UNPKG

onnxruntime-web

Version:

A Javascript library for running ONNX models on browsers

8 lines 113 kB
/*! * ONNX Runtime Web v1.27.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ var Hr=Object.defineProperty;var jf=Object.getOwnPropertyDescriptor;var Hf=Object.getOwnPropertyNames;var qf=Object.prototype.hasOwnProperty;var qr=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(r,s)=>(typeof require<"u"?require:r)[s]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var k=(a,r)=>()=>(a&&(r=a(a=0)),r);var At=(a,r)=>{for(var s in r)Hr(a,s,{get:r[s],enumerable:!0})},Yf=(a,r,s,f)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Hf(r))!qf.call(a,i)&&i!==s&&Hr(a,i,{get:()=>r[i],enumerable:!(f=jf(r,i))||f.enumerable});return a};var zt=a=>Yf(Hr({},"__esModule",{value:!0}),a);var Vt,Ke,Qe,Jf,va,Yr=k(()=>{"use strict";Vt=new Map,Ke=[],Qe=(a,r,s)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){let f=Vt.get(a);if(f===void 0)Vt.set(a,{backend:r,priority:s});else{if(f.priority>s)return;if(f.priority===s&&f.backend!==r)throw new Error(`cannot register backend "${a}" using priority ${s}`)}if(s>=0){let i=Ke.indexOf(a);i!==-1&&Ke.splice(i,1);for(let d=0;d<Ke.length;d++)if(Vt.get(Ke[d]).priority<=s){Ke.splice(d,0,a);return}Ke.push(a)}return}throw new TypeError("not a valid backend")},Jf=async a=>{let r=Vt.get(a);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{let s=!!r.initPromise;try{return s||(r.initPromise=r.backend.init(a)),await r.initPromise,r.initialized=!0,r.backend}catch(f){return s||(r.error=`${f}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},va=async a=>{let r=a.executionProviders||[],s=r.map(y=>typeof y=="string"?y:y.name),f=s.length===0?Ke:s,i,d=[],l=new Set;for(let y of f){let w=await Jf(y);typeof w=="string"?d.push({name:y,err:w}):(i||(i=w),i===w&&l.add(y))}if(!i)throw new Error(`no available backend found. ERR: ${d.map(y=>`[${y.name}] ${y.err}`).join(", ")}`);for(let{name:y,err:w}of d)s.includes(y)&&console.warn(`removing requested execution provider "${y}" from session options because it is not available: ${w}`);let m=r.filter(y=>l.has(typeof y=="string"?y:y.name));return[i,new Proxy(a,{get:(y,w)=>w==="executionProviders"?m:Reflect.get(y,w)})]}});var Ea=k(()=>{"use strict";Yr()});var Sa,Aa=k(()=>{"use strict";Sa="1.27.0"});var Ia,ie,Jr=k(()=>{"use strict";Aa();Ia="warning",ie={wasm:{},webgl:{},webgpu:{},versions:{common:Sa},set logLevel(a){if(a!==void 0){if(typeof a!="string"||["verbose","info","warning","error","fatal"].indexOf(a)===-1)throw new Error(`Unsupported logging level: ${a}`);Ia=a}},get logLevel(){return Ia}};Object.defineProperty(ie,"logLevel",{enumerable:!0})});var Q,xa=k(()=>{"use strict";Jr();Q=ie});var La,Ba,Oa=k(()=>{"use strict";La=(a,r)=>{let s=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);s.width=a.dims[3],s.height=a.dims[2];let f=s.getContext("2d");if(f!=null){let i,d;r?.tensorLayout!==void 0&&r.tensorLayout==="NHWC"?(i=a.dims[2],d=a.dims[3]):(i=a.dims[3],d=a.dims[2]);let l=r?.format!==void 0?r.format:"RGB",m=r?.norm,y,w;m===void 0||m.mean===void 0?y=[255,255,255,255]:typeof m.mean=="number"?y=[m.mean,m.mean,m.mean,m.mean]:(y=[m.mean[0],m.mean[1],m.mean[2],0],m.mean[3]!==void 0&&(y[3]=m.mean[3])),m===void 0||m.bias===void 0?w=[0,0,0,0]:typeof m.bias=="number"?w=[m.bias,m.bias,m.bias,m.bias]:(w=[m.bias[0],m.bias[1],m.bias[2],0],m.bias[3]!==void 0&&(w[3]=m.bias[3]));let T=d*i,g=0,v=T,S=T*2,U=-1;l==="RGBA"?(g=0,v=T,S=T*2,U=T*3):l==="RGB"?(g=0,v=T,S=T*2):l==="RBG"&&(g=0,S=T,v=T*2);for(let R=0;R<d;R++)for(let H=0;H<i;H++){let C=(a.data[g++]-w[0])*y[0],M=(a.data[v++]-w[1])*y[1],q=(a.data[S++]-w[2])*y[2],B=U===-1?255:(a.data[U++]-w[3])*y[3];f.fillStyle="rgba("+C+","+M+","+q+","+B+")",f.fillRect(H,R,1,1)}if("toDataURL"in s)return s.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},Ba=(a,r)=>{let s=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),f;if(s!=null){let i,d,l;r?.tensorLayout!==void 0&&r.tensorLayout==="NHWC"?(i=a.dims[2],d=a.dims[1],l=a.dims[3]):(i=a.dims[3],d=a.dims[2],l=a.dims[1]);let m=r!==void 0&&r.format!==void 0?r.format:"RGB",y=r?.norm,w,T;y===void 0||y.mean===void 0?w=[255,255,255,255]:typeof y.mean=="number"?w=[y.mean,y.mean,y.mean,y.mean]:(w=[y.mean[0],y.mean[1],y.mean[2],255],y.mean[3]!==void 0&&(w[3]=y.mean[3])),y===void 0||y.bias===void 0?T=[0,0,0,0]:typeof y.bias=="number"?T=[y.bias,y.bias,y.bias,y.bias]:(T=[y.bias[0],y.bias[1],y.bias[2],0],y.bias[3]!==void 0&&(T[3]=y.bias[3]));let g=d*i;if(r!==void 0&&(r.format!==void 0&&l===4&&r.format!=="RGBA"||l===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let v=4,S=0,U=1,R=2,H=3,C=0,M=g,q=g*2,B=-1;m==="RGBA"?(C=0,M=g,q=g*2,B=g*3):m==="RGB"?(C=0,M=g,q=g*2):m==="RBG"&&(C=0,q=g,M=g*2),f=s.createImageData(i,d);for(let W=0;W<d*i;S+=v,U+=v,R+=v,H+=v,W++)f.data[S]=(a.data[C++]-T[0])*w[0],f.data[U]=(a.data[M++]-T[1])*w[1],f.data[R]=(a.data[q++]-T[2])*w[2],f.data[H]=B===-1?255:(a.data[B++]-T[3])*w[3]}else throw new Error("Can not access image data");return f}});var Xr,Ma,Ua,Ca,Da,Pa,_a=k(()=>{"use strict";jt();Xr=(a,r)=>{if(a===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:s,width:f}=r,i=r.norm??{mean:255,bias:0},d,l;typeof i.mean=="number"?d=[i.mean,i.mean,i.mean,i.mean]:d=[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],typeof i.bias=="number"?l=[i.bias,i.bias,i.bias,i.bias]:l=[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let m=r.format!==void 0?r.format:"RGBA",y=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",w=s*f,T=y==="RGBA"?new Float32Array(w*4):new Float32Array(w*3),g=4,v=0,S=1,U=2,R=3,H=0,C=w,M=w*2,q=-1;m==="RGB"&&(g=3,v=0,S=1,U=2,R=-1),y==="RGBA"?q=w*3:y==="RBG"?(H=0,M=w,C=w*2):y==="BGR"&&(M=0,C=w,H=w*2);for(let W=0;W<w;W++,v+=g,U+=g,S+=g,R+=g)T[H++]=(a[v]+l[0])/d[0],T[C++]=(a[S]+l[1])/d[1],T[M++]=(a[U]+l[2])/d[2],q!==-1&&R!==-1&&(T[q++]=(a[R]+l[3])/d[3]);return y==="RGBA"?new le("float32",T,[1,4,s,f]):new le("float32",T,[1,3,s,f])},Ma=async(a,r)=>{let s=typeof HTMLImageElement<"u"&&a instanceof HTMLImageElement,f=typeof ImageData<"u"&&a instanceof ImageData,i=typeof ImageBitmap<"u"&&a instanceof ImageBitmap,d=typeof a=="string",l,m=r??{},y=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},w=T=>typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||T instanceof OffscreenCanvas?T.getContext("2d"):null;if(s){let T=y();T.width=a.width,T.height=a.height;let g=w(T);if(g!=null){let v=a.height,S=a.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(v=r.resizedHeight,S=r.resizedWidth),r!==void 0){if(m=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");m.tensorFormat="RGBA",m.height=v,m.width=S}else m.tensorFormat="RGBA",m.height=v,m.width=S;g.drawImage(a,0,0),l=g.getImageData(0,0,S,v).data}else throw new Error("Can not access image data")}else if(f){let T,g;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(T=r.resizedHeight,g=r.resizedWidth):(T=a.height,g=a.width),r!==void 0&&(m=r),m.format="RGBA",m.height=T,m.width=g,r!==void 0){let v=y();v.width=g,v.height=T;let S=w(v);if(S!=null)S.putImageData(a,0,0),l=S.getImageData(0,0,g,T).data;else throw new Error("Can not access image data")}else l=a.data}else if(i){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");let T=y();T.width=a.width,T.height=a.height;let g=w(T);if(g!=null){let v=a.height,S=a.width;return g.drawImage(a,0,0,S,v),l=g.getImageData(0,0,S,v).data,m.height=v,m.width=S,Xr(l,m)}else throw new Error("Can not access image data")}else{if(d)return new Promise((T,g)=>{let v=y(),S=w(v);if(!a||!S)return g();let U=new Image;U.crossOrigin="Anonymous",U.src=a,U.onload=()=>{v.width=U.width,v.height=U.height,S.drawImage(U,0,0,v.width,v.height);let R=S.getImageData(0,0,v.width,v.height);m.height=v.height,m.width=v.width,T(Xr(R.data,m))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(l!==void 0)return Xr(l,m);throw new Error("Input data provided is not supported - aborted tensor creation")},Ua=(a,r)=>{let{width:s,height:f,download:i,dispose:d}=r,l=[1,f,s,4];return new le({location:"texture",type:"float32",texture:a,dims:l,download:i,dispose:d})},Ca=(a,r)=>{let{dataType:s,dims:f,download:i,dispose:d}=r;return new le({location:"gpu-buffer",type:s??"float32",gpuBuffer:a,dims:f,download:i,dispose:d})},Da=(a,r)=>{let{dataType:s,dims:f,download:i,dispose:d}=r;return new le({location:"ml-tensor",type:s??"float32",mlTensor:a,dims:f,download:i,dispose:d})},Pa=(a,r,s)=>new le({location:"cpu-pinned",type:a,data:r,dims:s??[r.length]})});var et,It,Ra,Na,ka=k(()=>{"use strict";et=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),It=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),Ra=!1,Na=()=>{if(!Ra){Ra=!0;let a=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,s=globalThis.Float16Array,f=typeof s<"u"&&s.from;a&&(et.set("int64",BigInt64Array),It.set(BigInt64Array,"int64")),r&&(et.set("uint64",BigUint64Array),It.set(BigUint64Array,"uint64")),f?(et.set("float16",s),It.set(s,"float16")):et.set("float16",Uint16Array)}}});var Wa,Fa,Ga=k(()=>{"use strict";jt();Wa=a=>{let r=1;for(let s=0;s<a.length;s++){let f=a[s];if(typeof f!="number"||!Number.isSafeInteger(f))throw new TypeError(`dims[${s}] must be an integer, got: ${f}`);if(f<0)throw new RangeError(`dims[${s}] must be a non-negative integer, got: ${f}`);r*=f}return r},Fa=(a,r)=>{switch(a.location){case"cpu":return new le(a.type,a.data,r);case"cpu-pinned":return new le({location:"cpu-pinned",data:a.data,type:a.type,dims:r});case"texture":return new le({location:"texture",texture:a.texture,type:a.type,dims:r});case"gpu-buffer":return new le({location:"gpu-buffer",gpuBuffer:a.gpuBuffer,type:a.type,dims:r});case"ml-tensor":return new le({location:"ml-tensor",mlTensor:a.mlTensor,type:a.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${a.location} is not supported`)}}});var le,jt=k(()=>{"use strict";Oa();_a();ka();Ga();le=class{constructor(r,s,f){Na();let i,d;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,i=r.type,d=r.dims,r.location){case"cpu-pinned":{let m=et.get(i);if(!m)throw new TypeError(`unsupported type "${i}" to create tensor from pinned buffer`);if(!(r.data instanceof m))throw new TypeError(`buffer should be of type ${m.name}`);this.cpuData=r.data;break}case"texture":{if(i!=="float32")throw new TypeError(`unsupported type "${i}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(i!=="float32"&&i!=="float16"&&i!=="int32"&&i!=="int64"&&i!=="uint32"&&i!=="uint8"&&i!=="bool"&&i!=="uint4"&&i!=="int4")throw new TypeError(`unsupported type "${i}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(i!=="float32"&&i!=="float16"&&i!=="int32"&&i!=="int64"&&i!=="uint32"&&i!=="uint64"&&i!=="int8"&&i!=="uint8"&&i!=="bool"&&i!=="uint4"&&i!=="int4")throw new TypeError(`unsupported type "${i}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let m,y;if(typeof r=="string")if(i=r,y=f,r==="string"){if(!Array.isArray(s))throw new TypeError("A string tensor's data must be a string array.");m=s}else{let w=et.get(r);if(w===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(s)){if(r==="float16"&&w===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${w.name} as data.`);r==="uint64"||r==="int64"?m=w.from(s,BigInt):m=w.from(s)}else if(s instanceof w)m=s;else if(s instanceof Uint8ClampedArray)if(r==="uint8")m=Uint8Array.from(s);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&s instanceof Uint16Array&&w!==Uint16Array)m=new globalThis.Float16Array(s.buffer,s.byteOffset,s.length);else throw new TypeError(`A ${i} tensor's data must be type of ${w}`)}else if(y=s,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let w=typeof r[0];if(w==="string")i="string",m=r;else if(w==="boolean")i="bool",m=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${w}.`)}else if(r instanceof Uint8ClampedArray)i="uint8",m=Uint8Array.from(r);else{let w=It.get(r.constructor);if(w===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);i=w,m=r}if(y===void 0)y=[m.length];else if(!Array.isArray(y))throw new TypeError("A tensor's dims must be a number array");d=y,this.cpuData=m,this.dataLocation="cpu"}let l=Wa(d);if(this.cpuData&&l!==this.cpuData.length&&!((i==="uint4"||i==="int4")&&Math.ceil(l/2)===this.cpuData.length))throw new Error(`Tensor's size(${l}) does not match data length(${this.cpuData.length}).`);this.type=i,this.dims=d,this.size=l}static async fromImage(r,s){return Ma(r,s)}static fromTexture(r,s){return Ua(r,s)}static fromGpuBuffer(r,s){return Ca(r,s)}static fromMLTensor(r,s){return Da(r,s)}static fromPinnedBuffer(r,s,f){return Pa(r,s,f)}toDataURL(r){return La(this,r)}toImageData(r){return Ba(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let s=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=s,r&&this.disposer&&(this.disposer(),this.disposer=void 0),s}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Fa(this,r)}}});var Le,Zr=k(()=>{"use strict";jt();Le=le});var $a,za,tt,rt,$e,ze,Kr=k(()=>{"use strict";Jr();$a=(a,r)=>{(typeof ie.trace>"u"?!ie.wasm.trace:!ie.trace)||console.timeStamp(`${a}::ORT::${r}`)},za=(a,r)=>{let s=new Error().stack?.split(/\r\n|\r|\n/g)||[],f=!1;for(let i=0;i<s.length;i++){if(f&&!s[i].includes("TRACE_FUNC")){let d=`FUNC_${a}::${s[i].trim().split(" ")[1]}`;r&&(d+=`::${r}`),$a("CPU",d);return}s[i].includes("TRACE_FUNC")&&(f=!0)}},tt=a=>{(typeof ie.trace>"u"?!ie.wasm.trace:!ie.trace)||za("BEGIN",a)},rt=a=>{(typeof ie.trace>"u"?!ie.wasm.trace:!ie.trace)||za("END",a)},$e=a=>{(typeof ie.trace>"u"?!ie.wasm.trace:!ie.trace)||console.time(`ORT::${a}`)},ze=a=>{(typeof ie.trace>"u"?!ie.wasm.trace:!ie.trace)||console.timeEnd(`ORT::${a}`)}});var Ht,Va=k(()=>{"use strict";Yr();Zr();Kr();Ht=class a{constructor(r){this.handler=r}async run(r,s,f){tt(),$e("InferenceSession.run");let i={},d={};if(typeof r!="object"||r===null||r instanceof Le||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let l=!0;if(typeof s=="object"){if(s===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(s instanceof Le)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(s)){if(s.length===0)throw new TypeError("'fetches' cannot be an empty array.");l=!1;for(let w of s){if(typeof w!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(w)===-1)throw new RangeError(`'fetches' contains invalid output name: ${w}.`);i[w]=null}if(typeof f=="object"&&f!==null)d=f;else if(typeof f<"u")throw new TypeError("'options' must be an object.")}else{let w=!1,T=Object.getOwnPropertyNames(s);for(let g of this.outputNames)if(T.indexOf(g)!==-1){let v=s[g];(v===null||v instanceof Le)&&(w=!0,l=!1,i[g]=v)}if(w){if(typeof f=="object"&&f!==null)d=f;else if(typeof f<"u")throw new TypeError("'options' must be an object.")}else d=s}}else if(typeof s<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let w of this.inputNames)if(typeof r[w]>"u")throw new Error(`input '${w}' is missing in 'feeds'.`);if(l)for(let w of this.outputNames)i[w]=null;let m=await this.handler.run(r,i,d),y={};for(let w in m)if(Object.hasOwnProperty.call(m,w)){let T=m[w];T instanceof Le?y[w]=T:y[w]=new Le(T.type,T.data,T.dims)}return ze("InferenceSession.run"),rt(),y}async release(){return this.handler.dispose()}static async create(r,s,f,i){tt(),$e("InferenceSession.create");let d,l={};if(typeof r=="string"){if(d=r,typeof s=="object"&&s!==null)l=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(d=r,typeof s=="object"&&s!==null)l=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){let T=r,g=0,v=r.byteLength;if(typeof s=="object"&&s!==null)l=s;else if(typeof s=="number"){if(g=s,!Number.isSafeInteger(g))throw new RangeError("'byteOffset' must be an integer.");if(g<0||g>=T.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${T.byteLength}).`);if(v=r.byteLength-g,typeof f=="number"){if(v=f,!Number.isSafeInteger(v))throw new RangeError("'byteLength' must be an integer.");if(v<=0||g+v>T.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${T.byteLength-g}].`);if(typeof i=="object"&&i!==null)l=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else if(typeof f<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof s<"u")throw new TypeError("'options' must be an object.");d=new Uint8Array(T,g,v)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[m,y]=await va(l),w=await m.createInferenceSessionHandler(d,y);return ze("InferenceSession.create"),rt(),new a(w)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}});var Xf,ja=k(()=>{"use strict";Va();Xf=Ht});var Ha=k(()=>{"use strict"});var qa=k(()=>{"use strict"});var Ya=k(()=>{"use strict"});var Ja=k(()=>{"use strict"});var Qr={};At(Qr,{InferenceSession:()=>Xf,TRACE:()=>$a,TRACE_EVENT_BEGIN:()=>$e,TRACE_EVENT_END:()=>ze,TRACE_FUNC_BEGIN:()=>tt,TRACE_FUNC_END:()=>rt,Tensor:()=>Le,env:()=>Q,registerBackend:()=>Qe});var Ve=k(()=>{"use strict";Ea();xa();ja();Zr();Ha();qa();Kr();Ya();Ja()});var qt=k(()=>{"use strict"});var Qa={};At(Qa,{default:()=>Zf});var Za,Ka,Zf,es=k(()=>{"use strict";en();je();Yt();Za="ort-wasm-proxy-worker",Ka=globalThis.self?.name===Za;Ka&&(self.onmessage=a=>{let{type:r,in:s}=a.data;try{switch(r){case"init-wasm":Jt(s.wasm).then(()=>{Xt(s).then(()=>{postMessage({type:r})},f=>{postMessage({type:r,err:f})})},f=>{postMessage({type:r,err:f})});break;case"init-ep":{let{epName:f,env:i}=s;Zt(i,f).then(()=>{postMessage({type:r})},d=>{postMessage({type:r,err:d})});break}case"copy-from":{let{buffer:f}=s,i=xt(f);postMessage({type:r,out:i});break}case"create":{let{model:f,options:i}=s;Kt(f,i).then(d=>{postMessage({type:r,out:d})},d=>{postMessage({type:r,err:d})});break}case"release":Qt(s),postMessage({type:r});break;case"run":{let{sessionId:f,inputIndices:i,inputs:d,outputIndices:l,options:m}=s;er(f,i,d,l,new Array(l.length).fill(null),m).then(y=>{y.some(w=>w[3]!=="cpu")?postMessage({type:r,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:r,out:y},rr([...d,...y]))},y=>{postMessage({type:r,err:y})});break}case"end-profiling":tr(s),postMessage({type:r});break;default:}}catch(f){postMessage({type:r,err:f})}});Zf=Ka?null:a=>new Worker(a??ge,{type:"module",name:Za})});var rs={};At(rs,{default:()=>Kf});async function ts(a={}){var r=a,s=!!globalThis.window,f=!!globalThis.WorkerGlobalScope,i=f&&self.name?.startsWith("em-pthread");r.mountExternalData=(e,t)=>{e.startsWith("./")&&(e=e.substring(2)),(r.Vc||(r.Vc=new Map)).set(e,t)},r.unmountExternalData=()=>{delete r.Vc},globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor;let d=()=>{let e=t=>(...n)=>{let o=Me;return n=t(...n),Me!=o?new Promise((u,c)=>{Br={resolve:u,reject:c}}):n};(()=>{for(let t of["_OrtAppendExecutionProvider","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput"])r[t]=e(r[t])})(),typeof jsepRunAsync<"u"&&(r._OrtRun=jsepRunAsync(r._OrtRun),r._OrtRunWithBinding=jsepRunAsync(r._OrtRunWithBinding)),d=void 0};r.asyncInit=()=>{d?.()};var l,m,y=(e,t)=>{throw t},w=import.meta.url,T="";if(s||f){try{T=new URL(".",w).href}catch{}f&&(m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),l=async e=>{if(oe(e))return new Promise((n,o)=>{var u=new XMLHttpRequest;u.open("GET",e,!0),u.responseType="arraybuffer",u.onload=()=>{u.status==200||u.status==0&&u.response?n(u.response):o(u.status)},u.onerror=o,u.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw Error(t.status+" : "+t.url)}}var g,v,S,U,R,H,C=console.log.bind(console),M=console.error.bind(console),q=C,B=M,W=!1,oe=e=>e.startsWith("file://");function p(){Fe.buffer!=X.buffer&&se()}if(i){let e=function(t){try{var n=t.data,o=n.Pc;if(o==="load"){let u=[];self.onmessage=c=>u.push(c),H=()=>{postMessage({Pc:"loaded"});for(let c of u)e(c);self.onmessage=e};for(let c of n.ee)r[c]&&!r[c].proxy||(r[c]=(...h)=>{postMessage({Pc:"callHandler",de:c,args:h})},c=="print"&&(q=r[c]),c=="printErr"&&(B=r[c]));Fe=n.ke,se(),v=n.le,bt(),$t()}else if(o==="run"){(function(u){var c=(p(),A)[u+52>>>2>>>0];u=(p(),A)[u+56>>>2>>>0],Uo(c,c-u),D(c)})(n.Oc),Fr(n.Oc,0,0,1,0,0),bn(),Ir(n.Oc),ne||(po(),ne=!0);try{zs(n.ie,n.Xc)}catch(u){if(u!="unwind")throw u}}else n.target!=="setimmediate"&&(o==="checkMailbox"?ne&&Pt():o&&(B(`worker: received unknown command ${o}`),B(n)))}catch(u){throw xo(),u}};var Sc=e,ne=!1;self.onunhandledrejection=t=>{throw t.reason||t},self.onmessage=e}var X,J,Ce,Z,x,A,_,ae,me,Y,we,re=!1;function se(){var e=Fe.buffer;r.HEAP8=X=new Int8Array(e),Ce=new Int16Array(e),r.HEAPU8=J=new Uint8Array(e),Z=new Uint16Array(e),r.HEAP32=x=new Int32Array(e),r.HEAPU32=A=new Uint32Array(e),_=new Float32Array(e),ae=new Float64Array(e),me=new BigInt64Array(e),Y=new BigUint64Array(e)}function yr(){re=!0,i?H():ke.$b()}function Te(e){throw B(e="Aborted("+e+")"),W=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),R?.(e),e}function qe(){return{a:{f:Vs,J:js,k:Hs,p:qs,l:Ys,sa:Js,b:Xs,ca:Zs,Ja:Sn,q:Ks,da:Ln,Za:Bn,Fa:On,Ha:Mn,_a:Un,Xa:Cn,Qa:Dn,Wa:Pn,oa:_n,Ga:Rn,Yb:Nn,Ya:kn,Zb:Wn,db:Qs,Da:ti,Tb:ri,Rb:oi,Ca:si,M:ii,I:ui,Sb:fi,ja:yi,Ub:bi,Ta:wi,Wb:Ti,Ka:vi,Pb:Ei,ka:Si,Sa:Ir,ab:Ai,U:Bi,n:Di,c:Sr,rb:Pi,w:_i,L:Ri,z:Ni,j:ki,o:qn,sb:Wi,G:Fi,T:Gi,h:$i,u:zi,m:Vi,i:ji,Na:Hi,Oa:qi,Pa:Yi,La:Zn,Ma:Kn,Qb:Qn,eb:Xi,cb:Qi,Y:eu,qb:tu,la:ru,bb:Zi,fb:nu,$a:ou,Xb:au,N:Ji,gb:su,X:iu,Vb:uu,nb:bu,C:wu,ra:gu,qa:Tu,pb:vu,W:Eu,v:Su,mb:Au,lb:Iu,kb:xu,ob:Lu,jb:Bu,ib:Ou,hb:Mu,Ua:ao,Va:so,Ia:wr,V:io,na:uo,Ra:fo,ma:co,Cb:$f,xa:Rf,Db:Gf,ya:_f,F:Af,e:cf,s:uf,x:sf,B:Tf,Fb:Cf,ba:Uf,D:pf,za:Df,$:Nf,ga:Mf,Gb:Of,Hb:Bf,Ba:If,Aa:Lf,Ib:xf,wa:Ff,aa:Pf,d:ff,A:lf,r:df,Bb:zf,t:hf,y:Ef,H:mf,E:yf,K:Sf,R:kf,ia:gf,_:Wf,Kb:wf,Lb:bf,Jb:vf,g:Cu,a:Fe,Ob:Ye,Eb:Du,ha:Pu,O:_u,pa:Ru,Mb:Nu,ta:ku,Q:Wu,yb:Fu,zb:Gu,ua:$u,ea:zu,P:Vu,Ea:ju,va:Hu,Z:qu,wb:Yu,_b:Ju,S:Xu,Ab:Zu,tb:Ku,ub:ef,vb:tf,fa:rf,xb:nf,Nb:of}}}async function bt(){function e(o,u){var c=ke=o.exports;o={};for(let[h,b]of Object.entries(c))typeof b=="function"?(c=Ii(b),o[h]=c):o[h]=b;return ke=o,ke=(function(){var h=ke,b=I=>F=>I(F)>>>0,E=I=>()=>I()>>>0;return(h=Object.assign({},h)).ac=b(h.ac),h.Dc=E(h.Dc),h.Fc=b(h.Fc),h.sd=(I=>(F,j)=>I(F,j)>>>0)(h.sd),h.xd=b(h.xd),h.yd=E(h.yd),h.Cd=b(h.Cd),h})(),hn.push(ke.jd),lo=(o=ke).ac,po=o.bc,r._OrtInit=o.cc,r._OrtGetLastError=o.dc,r._OrtCreateSessionOptions=o.ec,r._OrtAppendExecutionProvider=o.fc,r._OrtAddFreeDimensionOverride=o.gc,r._OrtAddSessionConfigEntry=o.hc,r._OrtReleaseSessionOptions=o.ic,r._OrtCreateSession=o.jc,r._OrtReleaseSession=o.kc,r._OrtGetInputOutputCount=o.lc,r._OrtGetInputOutputMetadata=o.mc,r._OrtFree=o.nc,r._OrtCreateTensor=o.oc,r._OrtGetTensorData=o.pc,r._OrtReleaseTensor=o.qc,r._OrtCreateRunOptions=o.rc,r._OrtAddRunConfigEntry=o.sc,r._OrtReleaseRunOptions=o.tc,r._OrtCreateBinding=o.uc,r._OrtBindInput=o.vc,r._OrtBindOutput=o.wc,r._OrtClearBoundOutputs=o.xc,r._OrtReleaseBinding=o.yc,r._OrtRunWithBinding=o.zc,r._OrtRun=o.Ac,r._OrtEndProfiling=o.Bc,Pr=r._OrtGetWebGpuDevice=o.Cc,Ft=o.Dc,xe=r._free=o.Ec,pt=r._malloc=o.Fc,mo=r._wgpuBufferRelease=o.Gc,ho=r._wgpuCreateInstance=o.Hc,yo=o.Ic,bo=o.Jc,wo=o.Kc,go=o.Lc,To=o.Mc,vo=o.Qc,Eo=o._c,So=o.$c,Ao=o.ad,_r=o.cd,Rr=o.dd,Nr=o.ed,kr=o.fd,Et=o.gd,Wr=o.hd,Io=o.id,Fr=o.ld,xo=o.md,Lo=o.nd,Bo=o.od,Gr=o.pd,Oo=o.qd,Mo=o.rd,$r=o.sd,N=o.td,St=o.ud,Uo=o.vd,D=o.wd,Gt=o.xd,P=o.yd,Co=o.zd,zr=o.Ad,Do=o.Bd,Po=o.Cd,_o=o.Dd,Vr=o.Ed,Ro=o.Fd,No=o.Gd,ko=o.Hd,Wo=o.Id,Fo=o.Jd,Go=o.Kd,$o=o.Ld,zo=o.Md,Vo=o.Nd,jo=o.Od,Ho=o.Pd,qo=o.Qd,Yo=o.Rd,Jo=o.Sd,Xo=o.Ud,Zo=o.Vd,Ko=o.Wd,Qo=o.Xd,ea=o.Zd,ta=o._d,ra=o.$d,na=o.ae,oa=o.be,aa=o.ce,sa=o.qe,ia=o.re,ua=o.se,fa=o.te,ca=o.ue,da=o.ve,la=o.we,pa=o.xe,ma=o.ye,ha=o.ze,ya=o.Ae,ba=o.$e,wa=o.af,ga=o.bf,Ta=o.cf,v=u,ke}var t,n=qe();return r.instantiateWasm?new Promise(o=>{r.instantiateWasm(n,(u,c)=>{o(e(u,c))})}):i?e(new WebAssembly.Instance(v,qe()),v):(we??=r.locateFile?r.locateFile?r.locateFile("ort-wasm-simd-threaded.asyncify.wasm",T):T+"ort-wasm-simd-threaded.asyncify.wasm":new URL("ort-wasm-simd-threaded.asyncify.wasm",import.meta.url).href,t=await(async function(o){var u=we;if(!g&&!oe(u))try{var c=fetch(u,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,o)}catch(h){B(`wasm streaming compile failed: ${h}`),B("falling back to ArrayBuffer instantiation")}return(async function(h,b){try{var E=await(async function(I){if(!g)try{var F=await l(I);return new Uint8Array(F)}catch{}if(I==we&&g)I=new Uint8Array(g);else{if(!m)throw"both async and sync fetching of the wasm failed";I=m(I)}return I})(h);return await WebAssembly.instantiate(E,b)}catch(I){B(`failed to asynchronously prepare wasm: ${I}`),Te(I)}})(u,o)})(n),e(t.instance,t.module))}class wt{name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var Se=e=>{e.terminate(),e.onmessage=()=>{}},Ae=[],Be=0,ee=null,K=e=>{We.length==0&&(gn(),wn(We[0]));var t=We.pop();if(!t)return 6;gt.push(t),Je[e.Oc]=t,t.Oc=e.Oc;var n={Pc:"run",ie:e.he,Xc:e.Xc,Oc:e.Oc};return t.postMessage(n,e.Zc),0},G=0,V=(e,t,...n)=>{var o,u=16*n.length,c=P(),h=Gt(u),b=h>>>3;for(o of n)typeof o=="bigint"?((p(),me)[b++>>>0]=1n,(p(),me)[b++>>>0]=o):((p(),me)[b++>>>0]=0n,(p(),ae)[b++>>>0]=o);return e=Lo(e,0,u,h,t),D(c),e};function Ye(e){if(i)return V(0,1,e);if(S=e,!(0<G)){for(var t of gt)Se(t);for(t of We)Se(t);We=[],gt=[],Je={},W=!0}y(0,new wt(e))}function br(e){if(i)return V(1,0,e);wr(e)}var wr=e=>{if(S=e,i)throw br(e),"unwind";Ye(e)},We=[],gt=[],hn=[],Je={},yn=e=>{var t=e.Oc;delete Je[t],We.push(e),gt.splice(gt.indexOf(e),1),e.Oc=0,Bo(t)};function bn(){hn.forEach(e=>e())}var wn=e=>new Promise(t=>{e.onmessage=u=>{var c=u.data;if(u=c.Pc,c.Wc&&c.Wc!=Ft()){var h=Je[c.Wc];h?h.postMessage(c,c.Zc):B(`Internal error! Worker sent a message "${u}" to target pthread ${c.Wc}, but that thread no longer exists!`)}else u==="checkMailbox"?Pt():u==="spawnThread"?K(c):u==="cleanupThread"?he(()=>{yn(Je[c.je])}):u==="loaded"?(e.loaded=!0,t(e)):c.target==="setimmediate"?e.postMessage(c):u==="uncaughtException"?e.onerror(c.error):u==="callHandler"?r[c.de](...c.args):u&&B(`worker sent an unknown command ${u}`)},e.onerror=u=>{throw B(`worker sent an error! ${u.filename}:${u.lineno}: ${u.message}`),u};var n,o=[];for(n of[])r.propertyIsEnumerable(n)&&o.push(n);e.postMessage({Pc:"load",ee:o,ke:Fe,le:v})});function gn(){var e=new Worker((()=>{let t=URL;return import.meta.url>"file:"&&import.meta.url<"file;"?new t("ort.webgpu.bundle.min.mjs",import.meta.url):new URL(import.meta.url)})(),{type:"module",workerData:"em-pthread",name:"em-pthread"});We.push(e)}var Fe,zs=(e,t)=>{G=0,e=Vr(e,t),0<G?S=e:Gr(e)},Ct=[],Dt=0,ce=e=>-9007199254740992>e||9007199254740992<e?NaN:Number(e);function Vs(e){var t=new gr(e>>>=0);return(p(),X)[t.Rc+12>>>0]==0&&(Tn(t,!0),Dt--),vn(t,!1),Ct.push(t),Po(e)}var ft=0,js=()=>{N(0,0);var e=Ct.pop();Co(e.Yc),ft=0};function Tn(e,t){t=t?1:0,(p(),X)[e.Rc+12>>>0]=t}function vn(e,t){t=t?1:0,(p(),X)[e.Rc+13>>>0]=t}class gr{constructor(t){this.Yc=t,this.Rc=t-24}}var Tr=e=>{var t=ft;if(!t)return St(0),0;var n=new gr(t);(p(),A)[n.Rc+16>>>2>>>0]=t;var o=(p(),A)[n.Rc+4>>>2>>>0];if(!o)return St(0),t;for(var u of e){if(u===0||u===o)break;if(Do(u,o,n.Rc+16))return St(u),t}return St(o),t};function Hs(){return Tr([])}function qs(e){return Tr([e>>>0])}function Ys(e,t,n,o){return Tr([e>>>0,t>>>0,n>>>0,o>>>0])}var Js=()=>{var e=Ct.pop();e||Te("no exception to throw");var t=e.Yc;throw(p(),X)[e.Rc+13>>>0]==0&&(Ct.push(e),vn(e,!0),Tn(e,!1),Dt++),zr(t),ft=t};function Xs(e,t,n){var o=new gr(e>>>=0);throw t>>>=0,n>>>=0,(p(),A)[o.Rc+16>>>2>>>0]=0,(p(),A)[o.Rc+4>>>2>>>0]=t,(p(),A)[o.Rc+8>>>2>>>0]=n,zr(e),Dt++,ft=e}var Zs=()=>Dt;function En(e,t,n,o){return i?V(2,1,e,t,n,o):Sn(e,t,n,o)}function Sn(e,t,n,o){if(e>>>=0,t>>>=0,n>>>=0,o>>>=0,!globalThis.SharedArrayBuffer)return 6;var u=[];return i&&u.length===0?En(e,t,n,o):(e={he:n,Oc:e,Xc:o,Zc:u},i?(e.Pc="spawnThread",postMessage(e,u),0):K(e))}function Ks(e){throw ft||=e>>>0,ft}var An=globalThis.TextDecoder&&new TextDecoder,In=(e,t,n,o)=>{if(n=t+n,o)return n;for(;e[t]&&!(t>=n);)++t;return t},xn=(e,t=0,n,o)=>{if(16<(n=In(e,t>>>=0,n,o))-t&&e.buffer&&An)return An.decode(e.buffer instanceof ArrayBuffer?e.subarray(t,n):e.slice(t,n));for(o="";t<n;){var u=e[t++];if(128&u){var c=63&e[t++];if((224&u)==192)o+=String.fromCharCode((31&u)<<6|c);else{var h=63&e[t++];65536>(u=(240&u)==224?(15&u)<<12|c<<6|h:(7&u)<<18|c<<12|h<<6|63&e[t++])?o+=String.fromCharCode(u):(u-=65536,o+=String.fromCharCode(55296|u>>10,56320|1023&u))}}else o+=String.fromCharCode(u)}return o},ct=(e,t,n)=>(e>>>=0)?xn((p(),J),e,t,n):"";function Ln(e,t,n){return i?V(3,1,e,t,n):0}function Bn(e,t){if(i)return V(4,1,e,t)}function On(e,t){if(i)return V(5,1,e,t)}function Mn(e,t,n){if(i)return V(6,1,e,t,n)}function Un(e,t,n){return i?V(7,1,e,t,n):0}function Cn(e,t){if(i)return V(8,1,e,t)}function Dn(e,t,n){if(i)return V(9,1,e,t,n)}function Pn(e,t,n,o){if(i)return V(10,1,e,t,n,o)}function _n(e,t,n,o){if(i)return V(11,1,e,t,n,o)}function Rn(e,t,n,o){if(i)return V(12,1,e,t,n,o)}function Nn(e){if(i)return V(13,1,e)}function kn(e,t){if(i)return V(14,1,e,t)}function Wn(e,t,n){if(i)return V(15,1,e,t,n)}var Qs=()=>Te(""),Oe=e=>{e>>>=0;for(var t="";;){var n=(p(),J)[e++>>>0];if(!n)return t;t+=String.fromCharCode(n)}},vr={},Er={},ei={},dt=class extends Error{constructor(e){super(e),this.name="BindingError"}};function De(e,t,n={}){return(function(o,u,c={}){var h=u.name;if(!o)throw new dt(`type "${h}" must have a positive integer typeid pointer`);if(Er.hasOwnProperty(o)){if(c.fe)return;throw new dt(`Cannot register type '${h}' twice`)}Er[o]=u,delete ei[o],vr.hasOwnProperty(o)&&(u=vr[o],delete vr[o],u.forEach(b=>b()))})(e,t,n)}var Fn=(e,t,n)=>{switch(t){case 1:return n?o=>(p(),X)[o>>>0]:o=>(p(),J)[o>>>0];case 2:return n?o=>(p(),Ce)[o>>>1>>>0]:o=>(p(),Z)[o>>>1>>>0];case 4:return n?o=>(p(),x)[o>>>2>>>0]:o=>(p(),A)[o>>>2>>>0];case 8:return n?o=>(p(),me)[o>>>3>>>0]:o=>(p(),Y)[o>>>3>>>0];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}};function ti(e,t,n,o,u){e>>>=0,n>>>=0,t=Oe(t>>>0);let c=h=>h;if(o=o===0n){let h=8*n;c=b=>BigInt.asUintN(h,b),u=c(u)}De(e,{name:t,Nc:c,Tc:(h,b)=>(typeof b=="number"&&(b=BigInt(b)),b),Sc:Fn(t,n,!o),Uc:null})}function ri(e,t,n,o){De(e>>>=0,{name:t=Oe(t>>>0),Nc:function(u){return!!u},Tc:function(u,c){return c?n:o},Sc:function(u){return this.Nc((p(),J)[u>>>0])},Uc:null})}var Gn=[],Xe=[0,1,,1,null,1,!0,1,!1,1];function Sr(e){9<(e>>>=0)&&--Xe[e+1]===0&&(Xe[e]=void 0,Gn.push(e))}var ve=e=>{if(!e)throw new dt(`Cannot use deleted val. handle = ${e}`);return Xe[e]},Ie=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let t=Gn.pop()||Xe.length;return Xe[t]=e,Xe[t+1]=1,t}};function Ar(e){return this.Nc((p(),A)[e>>>2>>>0])}var ni={name:"emscripten::val",Nc:e=>{var t=ve(e);return Sr(e),t},Tc:(e,t)=>Ie(t),Sc:Ar,Uc:null};function oi(e){return De(e>>>0,ni)}var ai=(e,t)=>{switch(t){case 4:return function(n){return this.Nc((p(),_)[n>>>2>>>0])};case 8:return function(n){return this.Nc((p(),ae)[n>>>3>>>0])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}};function si(e,t,n){n>>>=0,De(e>>>=0,{name:t=Oe(t>>>0),Nc:o=>o,Tc:(o,u)=>u,Sc:ai(t,n),Uc:null})}function ii(e,t,n,o,u){e>>>=0,n>>>=0,t=Oe(t>>>0);let c=b=>b;if(o===0){var h=32-8*n;c=b=>b<<h>>>h,u=c(u)}De(e,{name:t,Nc:c,Tc:(b,E)=>E,Sc:Fn(t,n,o!==0),Uc:null})}function ui(e,t,n){function o(c){var h=(p(),A)[c>>>2>>>0];return c=(p(),A)[c+4>>>2>>>0],new u((p(),X).buffer,c,h)}var u=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][t];De(e>>>=0,{name:n=Oe(n>>>0),Nc:o,Sc:o},{fe:!0})}var Pe=(e,t,n)=>{var o=(p(),J);if(t>>>=0,0<n){var u=t;n=t+n-1;for(var c=0;c<e.length;++c){var h=e.codePointAt(c);if(127>=h){if(t>=n)break;o[t++>>>0]=h}else if(2047>=h){if(t+1>=n)break;o[t++>>>0]=192|h>>6,o[t++>>>0]=128|63&h}else if(65535>=h){if(t+2>=n)break;o[t++>>>0]=224|h>>12,o[t++>>>0]=128|h>>6&63,o[t++>>>0]=128|63&h}else{if(t+3>=n)break;o[t++>>>0]=240|h>>18,o[t++>>>0]=128|h>>12&63,o[t++>>>0]=128|h>>6&63,o[t++>>>0]=128|63&h,c++}}o[t>>>0]=0,e=t-u}else e=0;return e},_e=e=>{for(var t=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);127>=o?t++:2047>=o?t+=2:55296<=o&&57343>=o?(t+=4,++n):t+=3}return t};function fi(e,t){De(e>>>=0,{name:t=Oe(t>>>0),Nc(n){var o=(p(),A)[n>>>2>>>0];return o=ct(n+4,o,!0),xe(n),o},Tc(n,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var u=typeof o=="string";if(!(u||ArrayBuffer.isView(o)&&o.BYTES_PER_ELEMENT==1))throw new dt("Cannot pass non-string to std::string");var c=u?_e(o):o.length,h=pt(4+c+1),b=h+4;return(p(),A)[h>>>2>>>0]=c,u?Pe(o,b,c+1):(p(),J).set(o,b>>>0),n!==null&&n.push(xe,h),h},Sc:Ar,Uc(n){xe(n)}})}var $n=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,ci=(e,t,n)=>{if(e>>>=1,16<(t=In((p(),Z),e,t/2,n))-e&&$n)return $n.decode((p(),Z).slice(e,t));for(n="";e<t;++e){var o=(p(),Z)[e>>>0];n+=String.fromCharCode(o)}return n},di=(e,t,n)=>{if(n??=2147483647,2>n)return 0;var o=t;n=(n-=2)<2*e.length?n/2:e.length;for(var u=0;u<n;++u){var c=e.charCodeAt(u);(p(),Ce)[t>>>1>>>0]=c,t+=2}return(p(),Ce)[t>>>1>>>0]=0,t-o},li=e=>2*e.length,pi=(e,t,n)=>{var o="";e>>>=2;for(var u=0;!(u>=t/4);u++){var c=(p(),A)[e+u>>>0];if(!c&&!n)break;o+=String.fromCodePoint(c)}return o},mi=(e,t,n)=>{if(t>>>=0,n??=2147483647,4>n)return 0;var o=t;n=o+n-4;for(var u=0;u<e.length;++u){var c=e.codePointAt(u);if(65535<c&&u++,(p(),x)[t>>>2>>>0]=c,(t+=4)+4>n)break}return(p(),x)[t>>>2>>>0]=0,t-o},hi=e=>{for(var t=0,n=0;n<e.length;++n)65535<e.codePointAt(n)&&n++,t+=4;return t};function yi(e,t,n){if(e>>>=0,t>>>=0,n=Oe(n>>>=0),t===2)var o=ci,u=di,c=li;else o=pi,u=mi,c=hi;De(e,{name:n,Nc:h=>{var b=(p(),A)[h>>>2>>>0];return b=o(h+4,b*t,!0),xe(h),b},Tc:(h,b)=>{if(typeof b!="string")throw new dt(`Cannot pass non-string to C++ string type ${n}`);var E=c(b),I=pt(4+E+t);return(p(),A)[I>>>2>>>0]=E/t,u(b,I+4,E+t),h!==null&&h.push(xe,I),I},Sc:Ar,Uc(h){xe(h)}})}function bi(e,t){De(e>>>=0,{ge:!0,name:t=Oe(t>>>0),Nc:()=>{},Tc:()=>{}})}function wi(e){Fr(e>>>0,!f,1,!s,131072,!1),bn()}var he=e=>{if(!W)try{if(e(),!(0<G))try{i?Ft()&&Gr(S):wr(S)}catch(t){t instanceof wt||t=="unwind"||y(0,t)}}catch(t){t instanceof wt||t=="unwind"||y(0,t)}},gi=!Atomics.waitAsync||globalThis.navigator?.userAgent&&91>Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function Ir(e){e>>>=0,gi||(Atomics.waitAsync((p(),x),e>>>2,e).value.then(Pt),e+=128,Atomics.store((p(),x),e>>>2,1))}var Pt=()=>he(()=>{var e=Ft();e&&(Ir(e),Mo())});function Ti(e,t){(e>>>=0)==t>>>0?setTimeout(Pt):i?postMessage({Wc:e,Pc:"checkMailbox"}):(e=Je[e])&&e.postMessage({Pc:"checkMailbox"})}var xr=[];function vi(e,t,n,o,u){for(t>>>=0,u>>>=0,xr.length=0,n=u>>>3,o=u+o>>>3;n<o;){var c;c=(p(),me)[n++>>>0]?(p(),me)[n++>>>0]:(p(),ae)[n++>>>0],xr.push(c)}return(t?jr[t]:af[e])(...xr)}var Ei=()=>{G=0};function Si(e){e>>>=0,i?postMessage({Pc:"cleanupThread",je:e}):yn(Je[e])}function Ai(e){}var _t=e=>{try{e()}catch(t){Te(t)}};function Ii(e){var t=(...n)=>{Rt.push(e);try{return e(...n)}finally{W||(Rt.pop(),Me&&Ge===1&&Rt.length===0&&(Ge=0,G+=1,_t(wa),typeof Fibers<"u"&&Fibers.De()))}};return jn.set(e,t),t}var Ge=0,Me=null,zn=0,Rt=[],Lr=new Map,Vn=new Map,jn=new Map,xi=0,Br=null,Li=[],Hn=e=>(function(t){if(!W){if(Ge===0){var n=!1,o=!1;t((u=0)=>{if(!W&&(zn=u,n=!0,o)){Ge=2,_t(()=>ga(Me)),typeof MainLoop<"u"&&MainLoop.Yd&&MainLoop.resume(),u=!1;try{var c=(function(){var E=(p(),x)[Me+8>>>2>>>0];return E=Vn.get(E),E=jn.get(E),--G,E()})()}catch(E){c=E,u=!0}var h=!1;if(!Me){var b=Br;b&&(Br=null,(u?b.reject:b.resolve)(c),h=!0)}if(u&&!h)throw c}}),o=!0,n||(Ge=1,Me=(function(){var u=pt(65548),c=u+12;if((p(),A)[u>>>2>>>0]=c,(p(),A)[u+4>>>2>>>0]=c+65536,c=Rt[0],!Lr.has(c)){var h=xi++;Lr.set(c,h),Vn.set(h,c)}return c=Lr.get(c),(p(),x)[u+8>>>2>>>0]=c,u})(),typeof MainLoop<"u"&&MainLoop.Yd&&MainLoop.pause(),_t(()=>ba(Me)))}else Ge===2?(Ge=0,_t(Ta),xe(Me),Me=null,Li.forEach(he)):Te(`invalid state: ${Ge}`);return zn}})(t=>{e().then(t)});function Bi(e){return e>>>=0,Hn(async()=>{var t=await ve(e);return Ie(t)})}var Or=[],Oi=e=>{var t=Or.length;return Or.push(e),t},Mi=(e,t)=>{for(var n=Array(e),o=0;o<e;++o){var u=o,c=(p(),A)[t+4*o>>>2>>>0],h=Er[c];if(h===void 0)throw e=`parameter ${o}`,c=lo(c),t=Oe(c),xe(c),new dt(`${e} has unknown type ${t}`);n[u]=h}return n},Ui=(e,t,n)=>{var o=[];return e=e(o,n),o.length&&((p(),A)[t>>>2>>>0]=Ie(o)),e},Ci={},Nt=e=>{var t=Ci[e];return t===void 0?Oe(e):t};function Di(e,t,n){var[o,...u]=Mi(e,t>>>0);t=o.Tc.bind(o);var c=u.map(E=>E.Sc.bind(E));e--;var h={toValue:ve};switch(e=c.map((E,I)=>{var F=`argFromPtr${I}`;return h[F]=E,`${F}(args${I?"+"+8*I:""})`}),n){case 0:var b="toValue(handle)";break;case 2:b="new (toValue(handle))";break;case 3:b="";break;case 1:h.getStringOrSymbol=Nt,b="toValue(handle)[getStringOrSymbol(methodName)]"}return b+=`(${e})`,o.ge||(h.toReturnWire=t,h.emval_returnValue=Ui,b=`return emval_returnValue(toReturnWire, destructorsRef, ${b})`),b=`return function (handle, methodName, destructorsRef, args) { ${b} }`,n=new Function(Object.keys(h),b)(...Object.values(h)),b=`methodCaller<(${u.map(E=>E.name)}) => ${o.name}>`,Oi(Object.defineProperty(n,"name",{value:b}))}function Pi(e,t){return t>>>=0,(e=ve(e>>>0))==ve(t)}function _i(e){return(e>>>=0)?(e=Nt(e),Ie(globalThis[e])):Ie(globalThis)}function Ri(e){return e=Nt(e>>>0),Ie(r[e])}function Ni(e,t){return t>>>=0,e=ve(e>>>0),t=ve(t),Ie(e[t])}function ki(e){9<(e>>>=0)&&(Xe[e+1]+=1)}function qn(e,t,n,o,u){return Or[e>>>0](t>>>0,n>>>0,o>>>0,u>>>0)}function Wi(e,t,n,o,u){return qn(e>>>0,t>>>0,n>>>0,o>>>0,u>>>0)}function Fi(){return Ie([])}function Gi(e){e=ve(e>>>0);for(var t=Array(e.length),n=0;n<e.length;n++)t[n]=e[n];return Ie(t)}function $i(e){return Ie(Nt(e>>>0))}function zi(){return Ie({})}function Vi(e){for(var t=ve(e>>>=0);t.length;){var n=t.pop();t.pop()(n)}Sr(e)}function ji(e,t,n){t>>>=0,n>>>=0,e=ve(e>>>0),t=ve(t),n=ve(n),e[t]=n}function Hi(e,t){e=ce(e),t>>>=0,e=new Date(1e3*e),(p(),x)[t>>>2>>>0]=e.getUTCSeconds(),(p(),x)[t+4>>>2>>>0]=e.getUTCMinutes(),(p(),x)[t+8>>>2>>>0]=e.getUTCHours(),(p(),x)[t+12>>>2>>>0]=e.getUTCDate(),(p(),x)[t+16>>>2>>>0]=e.getUTCMonth(),(p(),x)[t+20>>>2>>>0]=e.getUTCFullYear()-1900,(p(),x)[t+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,(p(),x)[t+28>>>2>>>0]=e}var Yn=e=>e%4==0&&(e%100!=0||e%400==0),Jn=[0,31,60,91,121,152,182,213,244,274,305,335],Xn=[0,31,59,90,120,151,181,212,243,273,304,334];function qi(e,t){e=ce(e),t>>>=0,e=new Date(1e3*e),(p(),x)[t>>>2>>>0]=e.getSeconds(),(p(),x)[t+4>>>2>>>0]=e.getMinutes(),(p(),x)[t+8>>>2>>>0]=e.getHours(),(p(),x)[t+12>>>2>>>0]=e.getDate(),(p(),x)[t+16>>>2>>>0]=e.getMonth(),(p(),x)[t+20>>>2>>>0]=e.getFullYear()-1900,(p(),x)[t+24>>>2>>>0]=e.getDay();var n=(Yn(e.getFullYear())?Jn:Xn)[e.getMonth()]+e.getDate()-1|0;(p(),x)[t+28>>>2>>>0]=n,(p(),x)[t+36>>>2>>>0]=-60*e.getTimezoneOffset(),n=new Date(e.getFullYear(),6,1).getTimezoneOffset();var o=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(n!=o&&e.getTimezoneOffset()==Math.min(o,n)),(p(),x)[t+32>>>2>>>0]=e}function Yi(e){e>>>=0;var t=new Date((p(),x)[e+20>>>2>>>0]+1900,(p(),x)[e+16>>>2>>>0],(p(),x)[e+12>>>2>>>0],(p(),x)[e+8>>>2>>>0],(p(),x)[e+4>>>2>>>0],(p(),x)[e>>>2>>>0],0),n=(p(),x)[e+32>>>2>>>0],o=t.getTimezoneOffset(),u=new Date(t.getFullYear(),6,1).getTimezoneOffset(),c=new Date(t.getFullYear(),0,1).getTimezoneOffset(),h=Math.min(c,u);return 0>n?(p(),x)[e+32>>>2>>>0]=+(u!=c&&h==o):0<n!=(h==o)&&(u=Math.max(c,u),t.setTime(t.getTime()+6e4*((0<n?h:u)-o))),(p(),x)[e+24>>>2>>>0]=t.getDay(),n=(Yn(t.getFullYear())?Jn:Xn)[t.getMonth()]+t.getDate()-1|0,(p(),x)[e+28>>>2>>>0]=n,(p(),x)[e>>>2>>>0]=t.getSeconds(),(p(),x)[e+4>>>2>>>0]=t.getMinutes(),(p(),x)[e+8>>>2>>>0]=t.getHours(),(p(),x)[e+12>>>2>>>0]=t.getDate(),(p(),x)[e+16>>>2>>>0]=t.getMonth(),(p(),x)[e+20>>>2>>>0]=t.getYear(),e=t.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function Zn(e,t,n,o,u,c,h){return i?V(16,1,e,t,n,o,u,c,h):-52}function Kn(e,t,n,o,u,c){if(i)return V(17,1,e,t,n,o,u,c)}var Tt={},Ji=()=>performance.timeOrigin+performance.now();function Qn(e,t){if(i)return V(18,1,e,t);if(Tt[e]&&(clearTimeout(Tt[e].id),delete Tt[e]),!t)return 0;var n=setTimeout(()=>{delete Tt[e],he(()=>Oo(e,performance.timeOrigin+performance.now()))},t);return Tt[e]={id:n,Ce:t},0}function Xi(e,t,n,o){e>>>=0,t>>>=0,n>>>=0,o>>>=0;var u=new Date().getFullYear(),c=new Date(u,0,1).getTimezoneOffset();u=new Date(u,6,1).getTimezoneOffset();var h=Math.max(c,u);(p(),A)[e>>>2>>>0]=60*h,(p(),x)[t>>>2>>>0]=+(c!=u),e=(t=b=>{var E=Math.abs(b);return`UTC${0<=b?"-":"+"}${String(Math.floor(E/60)).padStart(2,"0")}${String(E%60).padStart(2,"0")}`})(c),t=t(u),u<c?(Pe(e,n,17),Pe(t,o,17)):(Pe(e,o,17),Pe(t,n,17))}var Zi=()=>Date.now(),Ki=1;function Qi(e,t,n){if(n>>>=0,!(0<=e&&3>=e))return 28;if(e===0)e=Date.now();else{if(!Ki)return 52;e=performance.timeOrigin+performance.now()}return e=Math.round(1e6*e),(p(),me)[n>>>3>>>0]=BigInt(e),0}var Mr=[],eo=(e,t)=>{Mr.length=0;for(var n;n=(p(),J)[e++>>>0];){var o=n!=105;t+=(o&=n!=112)&&t%8?4:0,Mr.push(n==112?(p(),A)[t>>>2>>>0]:n==106?(p(),me)[t>>>3>>>0]:n==105?(p(),x)[t>>>2>>>0]:(p(),ae)[t>>>3>>>0]),t+=o?8:4}return Mr};function eu(e,t,n){return e>>>=0,t=eo(t>>>0,n>>>0),jr[e](...t)}function tu(e,t,n){return e>>>=0,t=eo(t>>>0,n>>>0),jr[e](...t)}var ru=()=>{};function nu(e,t){return B(ct(e>>>0,t>>>0))}var ou=()=>{throw G+=1,"unwind"};function au(){return 4294901760}var su=()=>1,iu=()=>navigator.hardwareConcurrency;function uu(e){e>>>=0;var t=(p(),J).length;if(e<=t||4294901760<e)return!1;for(var n=1;4>=n;n*=2){var o=t*(1+.2/n);o=Math.min(o,e+100663296);e:{o=(Math.min(4294901760,65536*Math.ceil(Math.max(e,o)/65536))-Fe.buffer.byteLength+65535)/65536|0;try{Fe.grow(o),se();var u=1;break e}catch{}u=void 0}if(u)return!0}return!1}var Ue=e=>{var t=_e(e)+1,n=Gt(t);return Pe(e,n,t),n},Ur=(e,t)=>{(p(),A)[e>>>2>>>0]=t;var n=(p(),A)[e>>>2>>>0];(p(),A)[e+4>>>2>>>0]=(t-n)/4294967296},vt=e=>(p(),A)[e>>>2>>>0]+4294967296*(p(),x)[e+4>>>2>>>0],de=[],fu=(e,t)=>{de[e>>>0]=t},Re=[],kt=[],lt=(e,t)=>{kt[e]=new Promise(n=>t.finally(()=>n(e)))},L=e=>{if(e)return de[e>>>0]},cu=(e,t)=>{for(e=(p(),A)[e>>>2>>>0];e;e=(p(),A)[e>>>2>>>0])t[(p(),x)[e+4>>>2>>>0]](e)},Wt=(e,t,n)=>{(p(),A)[e>>>2>>>0]=t,(p(),A)[e+4>>>2>>>0]=n},to=e=>{var t=(p(),A)[e>>>2>>>0];return e=(p(),A)[e+4>>>2>>>0],ct(t,e)},Ne=e=>{var t=(p(),A)[e>>>2>>>0];return e=(p(),A)[e+4>>>2>>>0],t?ct(t,e):e===0?"":void 0},du=e=>{var t=Ne(e+4),n=(n=(p(),A)[e+12>>>2>>>0])?L(n):"auto";if(e+=16){var o=L((p(),A)[e+4>>>2>>>0]),u=(p(),A)[e+16>>>2>>>0],c=(p(),A)[e+20>>>2>>>0];if(u){for(var h={},b=0;b<u;++b){var E=c+24*b;h[to(E+4)]=(p(),ae)[E+16>>>3>>>0]}u=h}else u=void 0;e={module:o,constants:u,entryPoint:Ne(e+8)}}else e=void 0;return{label:t,layout:n,compute:e}},ro=(e,t)=>{function n(o,u){o=e[o],(p(),A)[t+u>>>2>>>0]=o}n("maxTextureDimension1D",4),n("maxTextureDimension2D",8),n("maxTextureDimension3D",12),n("maxTextureArrayLayers",16),n("maxBindGroups",20),n("maxBindGroupsPlusVertexBuffers",24),n("maxBindingsPerBindGroup",28),n("maxDynamicUniformBuffersPerPipelineLayout",32),n("maxDynamicStorageBuffersPerPipelineLayout",36),n("maxSampledTexturesPerShaderStage",40),n("maxSamplersPerShaderStage",44),n("maxStorageBuffersPerShaderStage",48),n("maxStorageTexturesPerShaderStage",52),n("maxUniformBuffersPerShaderStage",56),n("minUniformBufferOffsetAlignment",80),n("minStorageBufferOffsetAlignment",84),Ur(t+64,e.maxUniformBufferBindingSize),Ur(t+72,e.maxStorageBufferBindingSize),n("maxVertexBuffers",88),Ur(t+96,e.maxBufferSize),n("maxVertexAttributes",104),n("maxVertexBufferArrayStride",108),n("maxInterStageShaderVariables",112),n("maxColorAttachments",116),n("maxColorAttachmentBytesPerSample",120),n("maxComputeWorkgroupStorageSize",124),n("maxComputeInvocationsPerWorkgroup",128),n("maxComputeWorkgroupSizeX",132),n("maxComputeWorkgroupSizeY",136),n("maxComputeWorkgroupSizeZ",140),n("maxComputeWorkgroupsPerDimension",144),e.Be!==void 0&&n("maxImmediateSize",148)},lu=[,"validation","out-of-memory","internal"],pu=[,"compatibility","core"],no={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",22:"texture-component-swizzle",327692:"chromium-experimental-unorm16-texture-formats",327729:"chromium-experimental-multi-draw-indirect"},mu=[,"low-power","high-performance"],hu=[,"occlusion","timestamp"],yu={undefined:1,unknown:1,destroyed:2};function bu(e,t,n,o,u,c){t=ce(t),n=ce(n),o>>>=0,u>>>=0,c>>>=0;var h=L(e>>>0);if(e={},c){var b=(p(),A)[c+12>>>2>>>0];if(b){var E=(p(),A)[c+16>>>2>>>0];e.requiredFeatures=Array.from((p(),A).subarray(E>>>2>>>0,E+4*b>>>2>>>0),O=>no[O])}var I=(p(),A)[c+20>>>2>>>0];if(I){let O=function(ye,fe,Ze=!1){fe=I+fe,(fe=(p(),A)[fe>>>2>>>0])==4294967295||Ze&&fe==0||(F[ye]=fe)},ue=function(ye,fe){fe=I+fe;var Ze=(p(),A)[fe>>>2>>>0],Vf=(p(),A)[fe+4>>>2>>>0];Ze==4294967295&&Vf==4294967295||(F[ye]=vt(fe))};var j=O,te=ue,F={};O("maxTextureDimension1D",4),O("maxTextureDimension2D",8),O("maxTextureDimension3D",12),O("maxTextureArrayLayers",16),O("maxBindGroups",20),O("maxBindGroupsPlusVertexBuffers",24),O("maxDynamicUniformBuffersPerPipelineLayout",32),O("maxDynamicStorageBuffersPerPipelineLayout",36),O("maxSampledTexturesPerShaderStage",40),O("maxSamplersPerShaderStage",44),O("maxStorageBuffersPerShaderStage",48),O("maxStorageTexturesPerShaderStage",52),O("maxUniformBuffersPerShaderStage",56),O("minUniformBufferOffsetAlignment",80),O("minStorageBufferOffsetAlignment",84),ue("maxUniformBufferBindingSize",64),ue("maxStorageBufferBindingSize",72),O("maxVertexBuffers",88),ue("maxBufferSize",96),O("maxVertexAttributes",104),O("maxVertexBufferArrayStride",108),O("maxInterStageShaderVariabl