async function ortWasmThreaded(moduleArg={}){var moduleRtn;var g=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope,l=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type,n=ba&&self.name?.startsWith("em-pthread");if(l){const {createRequire:a}=await import("module");var require=a(import.meta.url),ca=require("worker_threads");global.Worker=ca.Worker;n=(ba=!ca.oe)&&"em-pthread"==ca.workerData}g.mountExternalData=(a,b)=>{a.startsWith("./")&&(a=a.substring(2));(g.Vc||(g.Vc=new Map)).set(a,b)};
g.unmountExternalData=()=>{delete g.Vc};var SharedArrayBuffer=globalThis.SharedArrayBuffer??(new WebAssembly.Memory({initial:0,maximum:0,shared:!0})).buffer.constructor;
let ea=()=>{const a=b=>(...c)=>{const d=q;c=b(...c);return q!=d?da():c};(b=>{for(const c of b)g[c]=a(g[c])})(["_OrtAppendExecutionProvider","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput"]);"undefined"!==typeof jsepRunAsync&&(g._OrtRun=jsepRunAsync(g._OrtRun),g._OrtRunWithBinding=jsepRunAsync(g._OrtRunWithBinding));ea=void 0};g.asyncInit=()=>{ea?.()};var fa="./this.program",ha=(a,b)=>{throw b;},ia=import.meta.url,ja="",ka,la;
if(l){var fs=require("fs");ia.startsWith("file:")&&(ja=require("path").dirname(require("url").fileURLToPath(ia))+"/");la=a=>{a=ma(a)?new URL(a):a;return fs.readFileSync(a)};ka=async a=>{a=ma(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1<process.argv.length&&(fa=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);ha=(a,b)=>{process.exitCode=a;throw b;}}else if(aa||ba){try{ja=(new URL(".",ia)).href}catch{}l||(ba&&(la=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";
b.send(null);return new Uint8Array(b.response)}),ka=async a=>{if(ma(a))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url);})}var na=console.log.bind(console),oa=console.error.bind(console);
if(l){var pa=require("util"),qa=a=>"object"==typeof a?pa.inspect(a):a;na=(...a)=>fs.writeSync(1,a.map(qa).join(" ")+"\n");oa=(...a)=>fs.writeSync(2,a.map(qa).join(" ")+"\n")}var ra=na,t=oa,sa,ta,ua=!1,va,ma=a=>a.startsWith("file://");function u(){v.buffer!=w.buffer&&wa()}var xa,ya;
if(l&&n){var Aa=ca.parentPort;Aa.on("message",a=>global.onmessage?.({data:a}));Object.assign(globalThis,{self:global,postMessage:a=>Aa.postMessage(a)});process.on("uncaughtException",a=>{postMessage({Pc:"uncaughtException",error:a});process.exit(1)})}var Ba;
if(n){var Ca=!1;self.onunhandledrejection=b=>{throw b.reason||b;};function a(b){try{var c=b.data,d=c.Pc;if("load"===d){let e=[];self.onmessage=f=>e.push(f);Ba=()=>{postMessage({Pc:"loaded"});for(let f of e)a(f);self.onmessage=a};for(const f of c.ee)if(!g[f]||g[f].proxy)g[f]=(...h)=>{postMessage({Pc:"callHandler",de:f,args:h})},"print"==f&&(ra=g[f]),"printErr"==f&&(t=g[f]);v=c.ke;wa();ta=c.le;Da();Ea()}else if("run"===d){Fa(c.Oc);Ga(c.Oc,0,0,1,0,0);Ha();Ia(c.Oc);Ca||(Ja(),Ca=!0);try{Ka(c.ie,c.Xc)}catch(e){if("unwind"!=
e)throw e;}}else"setimmediate"!==c.target&&("checkMailbox"===d?Ca&&La():d&&(t(`worker: received unknown command ${d}`),t(c)))}catch(e){throw Ma(),e;}}self.onmessage=a}var w,x,Na,Oa,A,B,Pa,E,F,Qa,Ra=!1;function wa(){var a=v.buffer;g.HEAP8=w=new Int8Array(a);Na=new Int16Array(a);g.HEAPU8=x=new Uint8Array(a);Oa=new Uint16Array(a);g.HEAP32=A=new Int32Array(a);g.HEAPU32=B=new Uint32Array(a);Pa=new Float32Array(a);E=new Float64Array(a);F=new BigInt64Array(a);Qa=new BigUint64Array(a)}
function Sa(){Ra=!0;n?Ba():G.$b()}function Ta(a){a="Aborted("+a+")";t(a);ua=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ya?.(a);throw a;}var Ua;async function Va(a){if(!sa)try{var b=await ka(a);return new Uint8Array(b)}catch{}if(a==Ua&&sa)a=new Uint8Array(sa);else if(la)a=la(a);else throw"both async and sync fetching of the wasm failed";return a}
async function Wa(a,b){try{var c=await Va(a);return await WebAssembly.instantiate(c,b)}catch(d){t(`failed to asynchronously prepare wasm: ${d}`),Ta(d)}}async function Xa(a){var b=Ua;if(!sa&&!ma(b)&&!l)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){t(`wasm streaming compile failed: ${d}`),t("falling back to ArrayBuffer instantiation")}return Wa(b,a)}
function Ya(){Za={f:$a,J:ab,k:bb,p:cb,l:db,sa:eb,b:fb,ca:gb,Ja:hb,q:ib,da:jb,Za:kb,Fa:lb,Ha:mb,_a:nb,Xa:ob,Qa:pb,Wa:qb,oa:rb,Ga:sb,Yb:tb,Ya:ub,Zb:vb,db:wb,Da:xb,Tb:zb,Rb:Ab,Ca:Cb,M:Db,I:Eb,Sb:Fb,ja:Gb,Ub:Hb,Ta:Ib,Wb:Jb,Ka:Kb,Pb:Lb,ka:Mb,Sa:Ia,ab:Nb,U:Ob,n:Pb,c:Qb,rb:Rb,w:Sb,L:Tb,z:Ub,j:Vb,o:Wb,sb:Xb,G:Yb,T:Zb,h:$b,u:ac,m:bc,i:cc,Na:dc,Oa:ec,Pa:fc,La:gc,Ma:hc,Qb:ic,eb:jc,cb:kc,Y:lc,qb:mc,la:nc,bb:oc,fb:pc,$a:qc,Xb:rc,N:sc,gb:tc,X:uc,Vb:vc,nb:wc,C:xc,ra:yc,qa:zc,pb:Ac,W:Bc,v:Cc,mb:Dc,lb:Ec,kb:Fc,ob:Gc,
jb:Hc,ib:Ic,hb:Jc,Ua:Kc,Va:Lc,Ia:Mc,V:Nc,na:Oc,Ra:Pc,ma:Qc,Cb:Rc,xa:Sc,Db:Tc,ya:Uc,F:Vc,e:Wc,s:Xc,x:Yc,B:Zc,Fb:$c,ba:ad,D:bd,za:cd,$:dd,ga:ed,Gb:fd,Hb:gd,Ba:hd,Aa:jd,Ib:kd,wa:ld,aa:md,d:nd,A:od,r:pd,Bb:qd,t:rd,y:sd,H:td,E:ud,K:vd,R:wd,ia:xd,_:yd,Kb:zd,Lb:Ad,Jb:Bd,g:Cd,a:v,Ob:Dd,Eb:Ed,ha:Fd,O:Gd,pa:Hd,Mb:Id,ta:Jd,Q:Kd,yb:Ld,zb:Md,ua:Nd,ea:Od,P:Pd,Ea:Qd,va:Rd,Z:Sd,wb:Td,_b:Ud,S:Vd,Ab:Wd,tb:Xd,ub:Yd,vb:Zd,fa:$d,xb:ae,Nb:be};return{a:Za}}
async function Da(){function a(d,e){var f=G=d.exports;d={};for(let [h,k]of Object.entries(f))"function"==typeof k?(f=ce(k),d[h]=f):d[h]=k;G=d;G=de();ee.push(G.jd);d=G;fe=d.ac;Ja=d.bc;g._OrtInit=d.cc;g._OrtGetLastError=d.dc;g._OrtCreateSessionOptions=d.ec;g._OrtAppendExecutionProvider=d.fc;g._OrtAddFreeDimensionOverride=d.gc;g._OrtAddSessionConfigEntry=d.hc;g._OrtReleaseSessionOptions=d.ic;g._OrtCreateSession=d.jc;g._OrtReleaseSession=d.kc;g._OrtGetInputOutputCount=d.lc;g._OrtGetInputOutputMetadata=
d.mc;g._OrtFree=d.nc;g._OrtCreateTensor=d.oc;g._OrtGetTensorData=d.pc;g._OrtReleaseTensor=d.qc;g._OrtCreateRunOptions=d.rc;g._OrtAddRunConfigEntry=d.sc;g._OrtReleaseRunOptions=d.tc;g._OrtCreateBinding=d.uc;g._OrtBindInput=d.vc;g._OrtBindOutput=d.wc;g._OrtClearBoundOutputs=d.xc;g._OrtReleaseBinding=d.yc;g._OrtRunWithBinding=d.zc;g._OrtRun=d.Ac;g._OrtEndProfiling=d.Bc;ge=g._OrtGetWebGpuDevice=d.Cc;he=d.Dc;H=g._free=d.Ec;ie=g._malloc=d.Fc;je=g._wgpuBufferRelease=d.Gc;ke=g._wgpuCreateInstance=d.Hc;le=
d.Ic;me=d.Jc;ne=d.Kc;oe=d.Lc;pe=d.Mc;qe=d.Qc;re=d._c;se=d.$c;te=d.ad;ue=d.cd;ve=d.dd;we=d.ed;xe=d.fd;ye=d.gd;ze=d.hd;Ae=d.id;Ga=d.ld;Ma=d.md;Be=d.nd;Ce=d.od;De=d.pd;Ee=d.qd;Fe=d.rd;Ge=d.sd;I=d.td;He=d.ud;Ie=d.vd;J=d.wd;Je=d.xd;K=d.yd;Ke=d.zd;Le=d.Ad;Me=d.Bd;Ne=d.Cd;dynCall_vii=d.Dd;Oe=d.Ed;dynCall_v=d.Fd;Pe=d.Gd;Qe=d.Hd;Re=d.Id;dynCall_iii=d.Jd;Se=d.Kd;Te=d.Ld;Ue=d.Md;dynCall_vi=d.Nd;Ve=d.Od;We=d.Pd;Xe=d.Qd;Ye=d.Rd;Ze=d.Sd;$e=d.Ud;af=d.Vd;bf=d.Wd;cf=d.Xd;df=d.Zd;ef=d._d;ff=d.$d;gf=d.ae;hf=d.be;jf=
d.ce;kf=d.qe;lf=d.re;mf=d.se;nf=d.te;of=d.ue;pf=d.ve;qf=d.we;rf=d.xe;sf=d.ye;tf=d.ze;uf=d.Ae;vf=d.$e;wf=d.af;xf=d.bf;yf=d.cf;ta=e;return G}var b=Ya();if(g.instantiateWasm)return new Promise(d=>{g.instantiateWasm(b,(e,f)=>{d(a(e,f))})});if(n){var c=new WebAssembly.Instance(ta,Ya());return a(c,ta)}Ua??=g.locateFile?g.locateFile?g.locateFile("ort-wasm-simd-threaded.asyncify.wasm",ja):ja+"ort-wasm-simd-threaded.asyncify.wasm":(new URL("ort-wasm-simd-threaded.asyncify.wasm",import.meta.url)).href;
return function(d){return a(d.instance,d.module)}(await Xa(b))}class zf{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
var Af=a=>{a.terminate();a.onmessage=()=>{}},Bf=[],Cf=0,Df=null,Jf=a=>{0==Ef.length&&(Ff(),Gf(Ef[0]));var b=Ef.pop();if(!b)return 6;Hf.push(b);If[a.Oc]=b;b.Oc=a.Oc;var c={Pc:"run",ie:a.he,Xc:a.Xc,Oc:a.Oc};l&&b.unref();b.postMessage(c,a.Zc);return 0},L=0,M=(a,b,...c)=>{var d=16*c.length,e=K(),f=Je(d),h=f>>>3,k;for(k of c)"bigint"==typeof k?((u(),F)[h++>>>0]=1n,(u(),F)[h++>>>0]=k):((u(),F)[h++>>>0]=0n,(u(),E)[h++>>>0]=k);a=Be(a,0,d,f,b);J(e);return a};
function Dd(a){if(n)return M(0,1,a);va=a;if(!(0<L)){for(var b of Hf)Af(b);for(b of Ef)Af(b);Ef=[];Hf=[];If={};ua=!0}ha(a,new zf(a))}function Kf(a){if(n)return M(1,0,a);Mc(a)}var Mc=a=>{va=a;if(n)throw Kf(a),"unwind";Dd(a)},Ef=[],Hf=[],ee=[],If={};function Lf(){for(var a=g.numThreads-1;a--;)Ff();Bf.push(async()=>{var b=Mf();Cf++;await b;Cf--;0==Cf&&Df&&(b=Df,Df=null,b())})}var Nf=a=>{var b=a.Oc;delete If[b];Ef.push(a);Hf.splice(Hf.indexOf(a),1);a.Oc=0;Ce(b)};function Ha(){ee.forEach(a=>a())}
var Gf=a=>new Promise(b=>{a.onmessage=f=>{var h=f.data;f=h.Pc;if(h.Wc&&h.Wc!=he()){var k=If[h.Wc];k?k.postMessage(h,h.Zc):t(`Internal error! Worker sent a message "${f}" to target pthread ${h.Wc}, but that thread no longer exists!`)}else if("checkMailbox"===f)La();else if("spawnThread"===f)Jf(h);else if("cleanupThread"===f)N(()=>{Nf(If[h.je])});else if("loaded"===f)a.loaded=!0,l&&!a.Oc&&a.unref(),b(a);else if("setimmediate"===h.target)a.postMessage(h);else if("uncaughtException"===f)a.onerror(h.error);
else if("callHandler"===f)g[h.de](...h.args);else f&&t(`worker sent an unknown command ${f}`)};a.onerror=f=>{t(`${"worker sent an error!"} ${f.filename}:${f.lineno}: ${f.message}`);throw f;};l&&(a.on("message",f=>a.onmessage({data:f})),a.on("error",f=>a.onerror(f)));var c=[],d=[],e;for(e of d)g.propertyIsEnumerable(e)&&c.push(e);a.postMessage({Pc:"load",ee:c,ke:v,le:ta})});async function Mf(){if(!n)return Promise.all(Ef.map(Gf))}
function Ff(){var a=new Worker(new URL(import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});Ef.push(a)}function Fa(a){var b=(u(),B)[a+52>>>2>>>0];a=(u(),B)[a+56>>>2>>>0];Ie(b,b-a);J(b)}var Ka=(a,b)=>{L=0;a=Oe(a,b);0<L?va=a:De(a)},v,Of=[],Pf=0,O=a=>-9007199254740992>a||9007199254740992<a?NaN:Number(a);function $a(a){a>>>=0;var b=new Qf(a);0==(u(),w)[b.Rc+12>>>0]&&(Rf(b,!0),Pf--);Sf(b,!1);Of.push(b);return Ne(a)}
var Tf=0,ab=()=>{I(0,0);var a=Of.pop();Ke(a.Yc);Tf=0};function Rf(a,b){b=b?1:0;(u(),w)[a.Rc+12>>>0]=b}function Sf(a,b){b=b?1:0;(u(),w)[a.Rc+13>>>0]=b}class Qf{constructor(a){this.Yc=a;this.Rc=a-24}}var Uf=a=>{var b=Tf;if(!b)return He(0),0;var c=new Qf(b);(u(),B)[c.Rc+16>>>2>>>0]=b;var d=(u(),B)[c.Rc+4>>>2>>>0];if(!d)return He(0),b;for(var e of a){if(0===e||e===d)break;if(Me(e,d,c.Rc+16))return He(e),b}He(d);return b};function bb(){return Uf([])}function cb(a){return Uf([a>>>0])}
function db(a,b,c,d){return Uf([a>>>0,b>>>0,c>>>0,d>>>0])}var eb=()=>{var a=Of.pop();a||Ta("no exception to throw");var b=a.Yc;0==(u(),w)[a.Rc+13>>>0]&&(Of.push(a),Sf(a,!0),Rf(a,!1),Pf++);Le(b);Tf=b;throw Tf;};function fb(a,b,c){a>>>=0;var d=new Qf(a);b>>>=0;c>>>=0;(u(),B)[d.Rc+16>>>2>>>0]=0;(u(),B)[d.Rc+4>>>2>>>0]=b;(u(),B)[d.Rc+8>>>2>>>0]=c;Le(a);Tf=a;Pf++;throw Tf;}var gb=()=>Pf;function Vf(a,b,c,d){return n?M(2,1,a,b,c,d):hb(a,b,c,d)}
function hb(a,b,c,d){a>>>=0;b>>>=0;c>>>=0;d>>>=0;if(!globalThis.SharedArrayBuffer)return 6;var e=[];if(n&&0===e.length)return Vf(a,b,c,d);a={he:c,Oc:a,Xc:d,Zc:e};return n?(a.Pc="spawnThread",postMessage(a,e),0):Jf(a)}function ib(a){Tf||=a>>>0;throw Tf;}
var Wf=globalThis.TextDecoder&&new TextDecoder,Xf=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},Yf=(a,b=0,c,d)=>{b>>>=0;c=Xf(a,b,c,d);if(16<c-b&&a.buffer&&Wf)return Wf.decode(a.buffer instanceof ArrayBuffer?a.subarray(b,c):a.slice(b,c));for(d="";b<c;){var e=a[b++];if(e&128){var f=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var h=a[b++]&63;e=224==(e&240)?(e&15)<<12|f<<6|h:(e&7)<<18|f<<12|h<<6|a[b++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|
e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},Zf=(a,b,c)=>(a>>>=0)?Yf((u(),x),a,b,c):"";function jb(a,b,c){return n?M(3,1,a,b,c):0}function kb(a,b){if(n)return M(4,1,a,b)}function lb(a,b){if(n)return M(5,1,a,b)}function mb(a,b,c){if(n)return M(6,1,a,b,c)}function nb(a,b,c){return n?M(7,1,a,b,c):0}function ob(a,b){if(n)return M(8,1,a,b)}function pb(a,b,c){if(n)return M(9,1,a,b,c)}function qb(a,b,c,d){if(n)return M(10,1,a,b,c,d)}function rb(a,b,c,d){if(n)return M(11,1,a,b,c,d)}
function sb(a,b,c,d){if(n)return M(12,1,a,b,c,d)}function tb(a){if(n)return M(13,1,a)}function ub(a,b){if(n)return M(14,1,a,b)}function vb(a,b,c){if(n)return M(15,1,a,b,c)}var wb=()=>Ta(""),P=a=>{a>>>=0;for(var b="";;){var c=(u(),x)[a++>>>0];if(!c)return b;b+=String.fromCharCode(c)}},$f={},ag={},bg={},cg=class extends Error{constructor(a){super(a);this.name="BindingError"}};
function dg(a,b,c={}){var d=b.name;if(!a)throw new cg(`type "${d}" must have a positive integer typeid pointer`);if(ag.hasOwnProperty(a)){if(c.fe)return;throw new cg(`Cannot register type '${d}' twice`);}ag[a]=b;delete bg[a];$f.hasOwnProperty(a)&&(b=$f[a],delete $f[a],b.forEach(e=>e()))}function Q(a,b,c={}){return dg(a,b,c)}
var eg=(a,b,c)=>{switch(b){case 1:return c?d=>(u(),w)[d>>>0]:d=>(u(),x)[d>>>0];case 2:return c?d=>(u(),Na)[d>>>1>>>0]:d=>(u(),Oa)[d>>>1>>>0];case 4:return c?d=>(u(),A)[d>>>2>>>0]:d=>(u(),B)[d>>>2>>>0];case 8:return c?d=>(u(),F)[d>>>3>>>0]:d=>(u(),Qa)[d>>>3>>>0];default:throw new TypeError(`invalid integer width (${b}): ${a}`);}};
function xb(a,b,c,d,e){a>>>=0;c>>>=0;b=P(b>>>0);d=0n===d;let f=h=>h;if(d){const h=8*c;f=k=>BigInt.asUintN(h,k);e=f(e)}Q(a,{name:b,Nc:f,Tc:(h,k)=>{"number"==typeof k&&(k=BigInt(k));return k},Sc:eg(b,c,!d),Uc:null})}function zb(a,b,c,d){a>>>=0;b=P(b>>>0);Q(a,{name:b,Nc:function(e){return!!e},Tc:function(e,f){return f?c:d},Sc:function(e){return this.Nc((u(),x)[e>>>0])},Uc:null})}var fg=[],gg=[0,1,,1,null,1,!0,1,!1,1];function Qb(a){a>>>=0;9<a&&0===--gg[a+1]&&(gg[a]=void 0,fg.push(a))}
var R=a=>{if(!a)throw new cg(`Cannot use deleted val. handle = ${a}`);return gg[a]},S=a=>{switch(a){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const b=fg.pop()||gg.length;gg[b]=a;gg[b+1]=1;return b}};function hg(a){return this.Nc((u(),B)[a>>>2>>>0])}var ig={name:"emscripten::val",Nc:a=>{var b=R(a);Qb(a);return b},Tc:(a,b)=>S(b),Sc:hg,Uc:null};function Ab(a){return Q(a>>>0,ig)}
var jg=(a,b)=>{switch(b){case 4:return function(c){return this.Nc((u(),Pa)[c>>>2>>>0])};case 8:return function(c){return this.Nc((u(),E)[c>>>3>>>0])};default:throw new TypeError(`invalid float width (${b}): ${a}`);}};function Cb(a,b,c){a>>>=0;c>>>=0;b=P(b>>>0);Q(a,{name:b,Nc:d=>d,Tc:(d,e)=>e,Sc:jg(b,c),Uc:null})}function Db(a,b,c,d,e){a>>>=0;c>>>=0;b=P(b>>>0);let f=k=>k;if(0===d){var h=32-8*c;f=k=>k<<h>>>h;e=f(e)}Q(a,{name:b,Nc:f,Tc:(k,m)=>m,Sc:eg(b,c,0!==d),Uc:null})}
function Eb(a,b,c){function d(f){var h=(u(),B)[f>>>2>>>0];f=(u(),B)[f+4>>>2>>>0];return new e((u(),w).buffer,f,h)}a>>>=0;var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=P(c>>>0);Q(a,{name:c,Nc:d,Sc:d},{fe:!0})}
var T=(a,b,c)=>{var d=(u(),x);b>>>=0;if(0<c){var e=b;c=b+c-1;for(var f=0;f<a.length;++f){var h=a.codePointAt(f);if(127>=h){if(b>=c)break;d[b++>>>0]=h}else if(2047>=h){if(b+1>=c)break;d[b++>>>0]=192|h>>6;d[b++>>>0]=128|h&63}else if(65535>=h){if(b+2>=c)break;d[b++>>>0]=224|h>>12;d[b++>>>0]=128|h>>6&63;d[b++>>>0]=128|h&63}else{if(b+3>=c)break;d[b++>>>0]=240|h>>18;d[b++>>>0]=128|h>>12&63;d[b++>>>0]=128|h>>6&63;d[b++>>>0]=128|h&63;f++}}d[b>>>0]=0;a=b-e}else a=0;return a},U=a=>{for(var b=0,c=0;c<a.length;++c){var d=
a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b};
function Fb(a,b){a>>>=0;b=P(b>>>0);Q(a,{name:b,Nc(c){var d=(u(),B)[c>>>2>>>0];d=Zf(c+4,d,!0);H(c);return d},Tc(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new cg("Cannot pass non-string to std::string");var f=e?U(d):d.length;var h=ie(4+f+1),k=h+4;(u(),B)[h>>>2>>>0]=f;e?T(d,k,f+1):(u(),x).set(d,k>>>0);null!==c&&c.push(H,h);return h},Sc:hg,Uc(c){H(c)}})}
var kg=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,lg=(a,b,c)=>{a>>>=1;b=Xf((u(),Oa),a,b/2,c);if(16<b-a&&kg)return kg.decode((u(),Oa).slice(a,b));for(c="";a<b;++a){var d=(u(),Oa)[a>>>0];c+=String.fromCharCode(d)}return c},mg=(a,b,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var e=0;e<c;++e){var f=a.charCodeAt(e);(u(),Na)[b>>>1>>>0]=f;b+=2}(u(),Na)[b>>>1>>>0]=0;return b-d},ng=a=>2*a.length,og=(a,b,c)=>{var d="";a>>>=2;for(var e=0;!(e>=b/4);e++){var f=
(u(),B)[a+e>>>0];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},pg=(a,b,c)=>{b>>>=0;c??=2147483647;if(4>c)return 0;var d=b;c=d+c-4;for(var e=0;e<a.length;++e){var f=a.codePointAt(e);65535<f&&e++;(u(),A)[b>>>2>>>0]=f;b+=4;if(b+4>c)break}(u(),A)[b>>>2>>>0]=0;return b-d},qg=a=>{for(var b=0,c=0;c<a.length;++c)65535<a.codePointAt(c)&&c++,b+=4;return b};
function Gb(a,b,c){a>>>=0;b>>>=0;c>>>=0;c=P(c);if(2===b){var d=lg;var e=mg;var f=ng}else d=og,e=pg,f=qg;Q(a,{name:c,Nc:h=>{var k=(u(),B)[h>>>2>>>0];k=d(h+4,k*b,!0);H(h);return k},Tc:(h,k)=>{if("string"!=typeof k)throw new cg(`Cannot pass non-string to C++ string type ${c}`);var m=f(k),p=ie(4+m+b);(u(),B)[p>>>2>>>0]=m/b;e(k,p+4,m+b);null!==h&&h.push(H,p);return p},Sc:hg,Uc(h){H(h)}})}function Hb(a,b){a>>>=0;b=P(b>>>0);Q(a,{ge:!0,name:b,Nc:()=>{},Tc:()=>{}})}
function Ib(a){Ga(a>>>0,!ba,1,!aa,131072,!1);Ha()}var N=a=>{if(!ua)try{if(a(),!(0<L))try{n?he()&&De(va):Mc(va)}catch(b){b instanceof zf||"unwind"==b||ha(1,b)}}catch(b){b instanceof zf||"unwind"==b||ha(1,b)}},rg=!Atomics.waitAsync||globalThis.navigator?.userAgent&&91>Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function Ia(a){a>>>=0;rg||(Atomics.waitAsync((u(),A),a>>>2,a).value.then(La),a+=128,Atomics.store((u(),A),a>>>2,1))}var La=()=>N(()=>{var a=he();a&&(Ia(a),Fe())});
function Jb(a,b){a>>>=0;a==b>>>0?setTimeout(La):n?postMessage({Wc:a,Pc:"checkMailbox"}):(a=If[a])&&a.postMessage({Pc:"checkMailbox"})}var sg=[];function Kb(a,b,c,d,e){b>>>=0;e>>>=0;sg.length=0;c=e>>>3;for(d=e+d>>>3;c<d;){var f;(u(),F)[c++>>>0]?f=(u(),F)[c++>>>0]:f=(u(),E)[c++>>>0];sg.push(f)}return(b?tg[b]:ug[a])(...sg)}var Lb=()=>{L=0};function Mb(a){a>>>=0;n?postMessage({Pc:"cleanupThread",je:a}):Nf(If[a])}function Nb(a){l&&If[a>>>0].ref()}var vg=a=>{try{a()}catch(b){Ta(b)}};
function ce(a){var b=(...c)=>{wg.push(a);try{return a(...c)}finally{ua||(wg.pop(),q&&1===xg&&0===wg.length&&(xg=0,L+=1,vg(wf),"undefined"!=typeof Fibers&&Fibers.De()))}};yg.set(a,b);return b}var xg=0,q=null,zg=0,wg=[],Ag=new Map,Bg=new Map,yg=new Map,Cg=0,Dg=null,Eg=[];function da(){return new Promise((a,b)=>{Dg={resolve:a,reject:b}})}
function Fg(){var a=ie(65548),b=a+12;(u(),B)[a>>>2>>>0]=b;(u(),B)[a+4>>>2>>>0]=b+65536;b=wg[0];if(!Ag.has(b)){var c=Cg++;Ag.set(b,c);Bg.set(c,b)}b=Ag.get(b);(u(),A)[a+8>>>2>>>0]=b;return a}function Gg(){var a=(u(),A)[q+8>>>2>>>0];a=Bg.get(a);a=yg.get(a);--L;return a()}
function Hg(a){if(!ua){if(0===xg){var b=!1,c=!1;a((d=0)=>{if(!ua&&(zg=d,b=!0,c)){xg=2;vg(()=>xf(q));"undefined"!=typeof MainLoop&&MainLoop.Yd&&MainLoop.resume();d=!1;try{var e=Gg()}catch(k){e=k,d=!0}var f=!1;if(!q){var h=Dg;h&&(Dg=null,(d?h.reject:h.resolve)(e),f=!0)}if(d&&!f)throw e;}});c=!0;b||(xg=1,q=Fg(),"undefined"!=typeof MainLoop&&MainLoop.Yd&&MainLoop.pause(),vg(()=>vf(q)))}else 2===xg?(xg=0,vg(yf),H(q),q=null,Eg.forEach(N)):Ta(`invalid state: ${xg}`);return zg}}var Ig=a=>Hg(b=>{a().then(b)});
function Ob(a){a>>>=0;return Ig(async()=>{var b=await R(a);return S(b)})}var Jg=[],Kg=a=>{var b=Jg.length;Jg.push(a);return b},Lg=(a,b)=>{for(var c=Array(a),d=0;d<a;++d){var e=d,f=(u(),B)[b+4*d>>>2>>>0],h=ag[f];if(void 0===h)throw a=`parameter ${d}`,f=fe(f),b=P(f),H(f),new cg(`${a} has unknown type ${b}`);c[e]=h}return c},Mg=(a,b,c)=>{var d=[];a=a(d,c);d.length&&((u(),B)[b>>>2>>>0]=S(d));return a},Ng={},Og=a=>{var b=Ng[a];return void 0===b?P(a):b};
function Pb(a,b,c){var [d,...e]=Lg(a,b>>>0);b=d.Tc.bind(d);var f=e.map(m=>m.Sc.bind(m));a--;var h={toValue:R};a=f.map((m,p)=>{var C=`argFromPtr${p}`;h[C]=m;return`${C}(args${p?"+"+8*p:""})`});switch(c){case 0:var k="toValue(handle)";break;case 2:k="new (toValue(handle))";break;case 3:k="";break;case 1:h.getStringOrSymbol=Og,k="toValue(handle)[getStringOrSymbol(methodName)]"}k+=`(${a})`;d.ge||(h.toReturnWire=b,h.emval_returnValue=Mg,k=`return emval_returnValue(toReturnWire, destructorsRef, ${k})`);
k=`return function (handle, methodName, destructorsRef, args) {\n  ${k}\n  }`;c=(new Function(Object.keys(h),k))(...Object.values(h));k=`methodCaller<(${e.map(m=>m.name)}) => ${d.name}>`;return Kg(Object.defineProperty(c,"name",{value:k}))}function Rb(a,b){b>>>=0;a=R(a>>>0);b=R(b);return a==b}function Sb(a){a>>>=0;if(!a)return S(globalThis);a=Og(a);return S(globalThis[a])}function Tb(a){a=Og(a>>>0);return S(g[a])}function Ub(a,b){b>>>=0;a=R(a>>>0);b=R(b);return S(a[b])}
function Vb(a){a>>>=0;9<a&&(gg[a+1]+=1)}function Wb(a,b,c,d,e){return Jg[a>>>0](b>>>0,c>>>0,d>>>0,e>>>0)}function Xb(a,b,c,d,e){return Wb(a>>>0,b>>>0,c>>>0,d>>>0,e>>>0)}function Yb(){return S([])}function Zb(a){a=R(a>>>0);for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=a[c];return S(b)}function $b(a){return S(Og(a>>>0))}function ac(){return S({})}function bc(a){a>>>=0;for(var b=R(a);b.length;){var c=b.pop();b.pop()(c)}Qb(a)}function cc(a,b,c){b>>>=0;c>>>=0;a=R(a>>>0);b=R(b);c=R(c);a[b]=c}
function dc(a,b){a=O(a);b>>>=0;a=new Date(1E3*a);(u(),A)[b>>>2>>>0]=a.getUTCSeconds();(u(),A)[b+4>>>2>>>0]=a.getUTCMinutes();(u(),A)[b+8>>>2>>>0]=a.getUTCHours();(u(),A)[b+12>>>2>>>0]=a.getUTCDate();(u(),A)[b+16>>>2>>>0]=a.getUTCMonth();(u(),A)[b+20>>>2>>>0]=a.getUTCFullYear()-1900;(u(),A)[b+24>>>2>>>0]=a.getUTCDay();a=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;(u(),A)[b+28>>>2>>>0]=a}
var Pg=a=>0===a%4&&(0!==a%100||0===a%400),Qg=[0,31,60,91,121,152,182,213,244,274,305,335],Rg=[0,31,59,90,120,151,181,212,243,273,304,334];
function ec(a,b){a=O(a);b>>>=0;a=new Date(1E3*a);(u(),A)[b>>>2>>>0]=a.getSeconds();(u(),A)[b+4>>>2>>>0]=a.getMinutes();(u(),A)[b+8>>>2>>>0]=a.getHours();(u(),A)[b+12>>>2>>>0]=a.getDate();(u(),A)[b+16>>>2>>>0]=a.getMonth();(u(),A)[b+20>>>2>>>0]=a.getFullYear()-1900;(u(),A)[b+24>>>2>>>0]=a.getDay();var c=(Pg(a.getFullYear())?Qg:Rg)[a.getMonth()]+a.getDate()-1|0;(u(),A)[b+28>>>2>>>0]=c;(u(),A)[b+36>>>2>>>0]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),
0,1)).getTimezoneOffset();a=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0;(u(),A)[b+32>>>2>>>0]=a}
function fc(a){a>>>=0;var b=new Date((u(),A)[a+20>>>2>>>0]+1900,(u(),A)[a+16>>>2>>>0],(u(),A)[a+12>>>2>>>0],(u(),A)[a+8>>>2>>>0],(u(),A)[a+4>>>2>>>0],(u(),A)[a>>>2>>>0],0),c=(u(),A)[a+32>>>2>>>0],d=b.getTimezoneOffset(),e=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),f=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),h=Math.min(f,e);0>c?(u(),A)[a+32>>>2>>>0]=Number(e!=f&&h==d):0<c!=(h==d)&&(e=Math.max(f,e),b.setTime(b.getTime()+6E4*((0<c?h:e)-d)));(u(),A)[a+24>>>2>>>0]=b.getDay();c=(Pg(b.getFullYear())?
Qg:Rg)[b.getMonth()]+b.getDate()-1|0;(u(),A)[a+28>>>2>>>0]=c;(u(),A)[a>>>2>>>0]=b.getSeconds();(u(),A)[a+4>>>2>>>0]=b.getMinutes();(u(),A)[a+8>>>2>>>0]=b.getHours();(u(),A)[a+12>>>2>>>0]=b.getDate();(u(),A)[a+16>>>2>>>0]=b.getMonth();(u(),A)[a+20>>>2>>>0]=b.getYear();a=b.getTime();return BigInt(isNaN(a)?-1:a/1E3)}function gc(a,b,c,d,e,f,h){return n?M(16,1,a,b,c,d,e,f,h):-52}function hc(a,b,c,d,e,f){if(n)return M(17,1,a,b,c,d,e,f)}var Sg={},sc=()=>performance.timeOrigin+performance.now();
function ic(a,b){if(n)return M(18,1,a,b);Sg[a]&&(clearTimeout(Sg[a].id),delete Sg[a]);if(!b)return 0;var c=setTimeout(()=>{delete Sg[a];N(()=>Ee(a,performance.timeOrigin+performance.now()))},b);Sg[a]={id:c,Ce:b};return 0}
function jc(a,b,c,d){a>>>=0;b>>>=0;c>>>=0;d>>>=0;var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();var h=Math.max(f,e);(u(),B)[a>>>2>>>0]=60*h;(u(),A)[b>>>2>>>0]=Number(f!=e);b=k=>{var m=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(m/60)).padStart(2,"0")}${String(m%60).padStart(2,"0")}`};a=b(f);b=b(e);e<f?(T(a,c,17),T(b,d,17)):(T(a,d,17),T(b,c,17))}var oc=()=>Date.now(),Tg=1;
function kc(a,b,c){c>>>=0;if(!(0<=a&&3>=a))return 28;if(0===a)a=Date.now();else if(Tg)a=performance.timeOrigin+performance.now();else return 52;a=Math.round(1E6*a);(u(),F)[c>>>3>>>0]=BigInt(a);return 0}var Ug=[],Vg=(a,b)=>{Ug.length=0;for(var c;c=(u(),x)[a++>>>0];){var d=105!=c;d&=112!=c;b+=d&&b%8?4:0;Ug.push(112==c?(u(),B)[b>>>2>>>0]:106==c?(u(),F)[b>>>3>>>0]:105==c?(u(),A)[b>>>2>>>0]:(u(),E)[b>>>3>>>0]);b+=d?8:4}return Ug};function lc(a,b,c){a>>>=0;b=Vg(b>>>0,c>>>0);return tg[a](...b)}
function mc(a,b,c){a>>>=0;b=Vg(b>>>0,c>>>0);return tg[a](...b)}var nc=()=>{};function pc(a,b){return t(Zf(a>>>0,b>>>0))}var qc=()=>{L+=1;throw"unwind";};function rc(){return 4294901760}var tc=()=>1,uc=()=>l?require("os").cpus().length:navigator.hardwareConcurrency;
function vc(a){a>>>=0;var b=(u(),x).length;if(a<=b||4294901760<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(4294901760,65536*Math.ceil(Math.max(a,d)/65536))-v.buffer.byteLength+65535)/65536|0;try{v.grow(d);wa();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1}
var V=a=>{var b=U(a)+1,c=Je(b);T(a,c,b);return c},Wg=(a,b)=>{(u(),B)[a>>>2>>>0]=b;var c=(u(),B)[a>>>2>>>0];(u(),B)[a+4>>>2>>>0]=(b-c)/4294967296},Xg=a=>(u(),B)[a>>>2>>>0]+4294967296*(u(),A)[a+4>>>2>>>0],W=[],Yg=(a,b)=>{W[a>>>0]=b},X=[],Zg=[],$g=(a,b)=>{Zg[a]=new Promise(c=>b.finally(()=>c(a)))},Y=a=>{if(a)return W[a>>>0]},ah=(a,b=0)=>{"unmapped"===a.mapState||Ta();b=re(b);W[b>>>0]=a;return b},bh=(a,b=0)=>{var c=te(b);b=se(b,c);W[c>>>0]=a.queue;W[b>>>0]=a;return b},ch=(a,b)=>{for(a=(u(),B)[a>>>2>>>
0];a;a=(u(),B)[a>>>2>>>0]){var c=(u(),A)[a+4>>>2>>>0];b[c](a)}},dh=(a,b,c)=>{(u(),B)[a>>>2>>>0]=b;(u(),B)[a+4>>>2>>>0]=c},eh=a=>{var b=(u(),B)[a>>>2>>>0];a=(u(),B)[a+4>>>2>>>0];return Zf(b,a)},Z=a=>{var b=(u(),B)[a>>>2>>>0];a=(u(),B)[a+4>>>2>>>0];if(b)return Zf(b,a);if(0===a)return""},fh=a=>{var b=Z(a+4);var c=(c=(u(),B)[a+12>>>2>>>0])?Y(c):"auto";if(a+=16){var d=Y((u(),B)[a+4>>>2>>>0]);var e=(u(),B)[a+16>>>2>>>0];var f=(u(),B)[a+20>>>2>>>0];if(e){for(var h={},k=0;k<e;++k){var m=f+24*k,p=eh(m+4);
h[p]=(u(),E)[m+16>>>3>>>0]}e=h}else e=void 0;a={module:d,constants:e,entryPoint:Z(a+8)}}else a=void 0;return{label:b,layout:c,compute:a}},gh=(a,b)=>{function c(d,e){d=a[d];(u(),B)[b+e>>>2>>>0]=d}c("maxTextureDimension1D",4);c("maxTextureDimension2D",8);c("maxTextureDimension3D",12);c("maxTextureArrayLayers",16);c("maxBindGroups",20);c("maxBindGroupsPlusVertexBuffers",24);c("maxBindingsPerBindGroup",28);c("maxDynamicUniformBuffersPerPipelineLayout",32);c("maxDynamicStorageBuffersPerPipelineLayout",
36);c("maxSampledTexturesPerShaderStage",40);c("maxSamplersPerShaderStage",44);c("maxStorageBuffersPerShaderStage",48);c("maxStorageTexturesPerShaderStage",52);c("maxUniformBuffersPerShaderStage",56);c("minUniformBufferOffsetAlignment",80);c("minStorageBufferOffsetAlignment",84);Wg(b+64,a.maxUniformBufferBindingSize);Wg(b+72,a.maxStorageBufferBindingSize);c("maxVertexBuffers",88);Wg(b+96,a.maxBufferSize);c("maxVertexAttributes",104);c("maxVertexBufferArrayStride",108);c("maxInterStageShaderVariables",
112);c("maxColorAttachments",116);c("maxColorAttachmentBytesPerSample",120);c("maxComputeWorkgroupStorageSize",124);c("maxComputeInvocationsPerWorkgroup",128);c("maxComputeWorkgroupSizeX",132);c("maxComputeWorkgroupSizeY",136);c("maxComputeWorkgroupSizeZ",140);c("maxComputeWorkgroupsPerDimension",144);void 0!==a.Be&&c("maxImmediateSize",148)},hh=[,"validation","out-of-memory","internal"],ih=[,"compatibility","core"],jh={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"},kh=[,"low-power","high-performance"],lh=[,"occlusion","timestamp"],mh={undefined:1,unknown:1,destroyed:2};
function wc(a,b,c,d,e,f){b=O(b);c=O(c);d>>>=0;e>>>=0;f>>>=0;var h=Y(a>>>0);a={};if(f){var k=(u(),B)[f+12>>>2>>>0];if(k){var m=(u(),B)[f+16>>>2>>>0];a.requiredFeatures=Array.from((u(),B).subarray(m>>>2>>>0,m+4*k>>>2>>>0),r=>jh[r])}var p=(u(),B)[f+20>>>2>>>0];if(p){var C={};function r(z,D,za=!1){D=p+D;D=(u(),B)[D>>>2>>>0];4294967295==D||za&&0==D||(C[z]=D)}function y(z,D){D=p+D;var za=(u(),B)[D>>>2>>>0],yb=(u(),B)[D+4>>>2>>>0];if(4294967295!=za||4294967295!=yb)C[z]=Xg(D)}r("maxTextureDimension1D",4);
r("maxTextureDimension2D",8);r("maxTextureDimension3D",12);r("maxTextureArrayLayers",16);r("maxBindGroups",20);r("maxBindGroupsPlusVertexBuffers",24);r("maxDynamicUniformBuffersPerPipelineLayout",32);r("maxDynamicStorageBuffersPerPipelineLayout",36);r("maxSampledTexturesPerShaderStage",40);r("maxSamplersPerShaderStage",44);r("maxStorageBuffersPerShaderStage",48);r("maxStorageTexturesPerShaderStage",52);r("maxUniformBuffersPerShaderStage",56);r("minUniformBufferOffsetAlignment",80);r("minStorageBufferOffsetAlignment",
84);y("maxUniformBufferBindingSize",64);y("maxStorageBufferBindingSize",72);r("maxVertexBuffers",88);y("maxBufferSize",96);r("maxVertexAttributes",104);r("maxVertexBufferArrayStride",108);r("maxInterStageShaderVariables",112);r("maxColorAttachments",116);r("maxColorAttachmentBytesPerSample",120);r("maxComputeWorkgroupStorageSize",124);r("maxComputeInvocationsPerWorkgroup",128);r("maxComputeWorkgroupSizeX",132);r("maxComputeWorkgroupSizeY",136);r("maxComputeWorkgroupSizeZ",140);r("maxComputeWorkgroupsPerDimension",
144);r("maxImmediateSize",148,!0);a.requiredLimits=C}if(k=(u(),B)[f+24>>>2>>>0])k={label:Z(k+4)},a.defaultQueue=k;a.label=Z(f+4)}L+=1;$g(b,h.requestDevice(a).then(r=>{--L;N(()=>{W[e>>>0]=r.queue;W[d>>>0]=r;L+=1;$g(c,r.lost.then(y=>{N(()=>{r.onuncapturederror=()=>{};var z=K(),D=V(y.message);ve(c,mh[y.reason],D);J(z)});--L}));r.onuncapturederror=y=>{var z=5;y.error instanceof GPUValidationError?z=2:y.error instanceof GPUOutOfMemoryError?z=3:y.error instanceof GPUInternalError&&(z=4);var D=K();y=V(y.error.message);
Ae(d,z,y);J(D)};"adapterInfo"in r||(r.adapterInfo=h.info);ze(b,1,d,0)})},r=>{--L;N(()=>{var y=K(),z=V(r.message);ze(b,3,d,z);c&&ve(c,4,z);J(y)})}))}function xc(a){a>>>=0;var b=Y(a),c=X[a];if(c){for(var d=0;d<c.length;++d)c[d]();delete X[a]}b.destroy()}function yc(a,b,c){a>>>=0;c>>>=0;var d=Y(a);4294967295==c&&(c=void 0);try{var e=d.getMappedRange(b>>>0,c)}catch(h){return 0}var f=Ge(16,e.byteLength);(u(),x).set(new Uint8Array(e),f>>>0);X[a].push(()=>H(f));return f}
function zc(a,b,c){a>>>=0;c>>>=0;var d=Y(a);4294967295==c&&(c=void 0);try{var e=d.getMappedRange(b>>>0,c)}catch(h){return 0}var f=Ge(16,e.byteLength);(u(),x).fill(0,f,e.byteLength);X[a].push(()=>{(new Uint8Array(e)).set((u(),x).subarray(f>>>0,f+e.byteLength>>>0));H(f)});return f}
function Ac(a,b,c,d,e){a>>>=0;b=O(b);c=O(c);e>>>=0;var f=Y(a);X[a]=[];4294967295==e&&(e=void 0);L+=1;$g(b,f.mapAsync(c,d>>>0,e).then(()=>{--L;N(()=>{we(b,1,0)})},h=>{--L;N(()=>{K();var k=V(h.message);we(b,"AbortError"===h.name?4:"OperationError"===h.name?3:0,k);delete X[a]})}))}function Bc(a){a>>>=0;var b=Y(a),c=X[a];if(c){for(var d=0;d<c.length;++d)c[d]();delete X[a];b.unmap()}}function Cc(a){delete W[a>>>0]}
function Dc(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=!!(u(),B)[b+32>>>2>>>0];b={label:Z(b+4),usage:(u(),B)[b+16>>>2>>>0],size:Xg(b+24),mappedAtCreation:d};a=Y(a);try{var e=a.createBuffer(b)}catch(f){return!1}W[c>>>0]=e;d&&(X[c]=[]);return!0}function Ec(a,b,c,d){a>>>=0;b=O(b);d>>>=0;c=fh(c>>>0);a=Y(a);L+=1;$g(b,a.createComputePipelineAsync(c).then(e=>{--L;N(()=>{W[d>>>0]=e;ue(b,1,d,0)})},e=>{--L;N(()=>{var f=K(),h=V(e.message);ue(b,"validation"===e.reason?3:"internal"===e.reason?4:0,d,h);J(f)})}))}
function Fc(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=(u(),B)[b>>>2>>>0],e=(u(),A)[d+4>>>2>>>0];b={label:Z(b+4),code:""};switch(e){case 2:b.code=eh(d+8)}a=Y(a).createShaderModule(b);W[c>>>0]=a}var Gc=a=>{a=Y(a);a.onuncapturederror=null;a.destroy()};
function Hc(a,b){b=O(b);a=Y(a>>>0);L+=1;$g(b,a.popErrorScope().then(c=>{--L;N(()=>{var d=5;c?c instanceof GPUValidationError?d=2:c instanceof GPUOutOfMemoryError?d=3:c instanceof GPUInternalError&&(d=4):d=1;var e=K(),f=c?V(c.message):0;xe(b,1,d,f);J(e)})},c=>{--L;N(()=>{var d=K(),e=V(c.message);xe(b,1,5,e);J(d)})}))}
function Ic(a,b,c,d){b=O(b);c>>>=0;d>>>=0;if(c){var e={featureLevel:ih[(u(),A)[c+4>>>2>>>0]],powerPreference:kh[(u(),A)[c+8>>>2>>>0]],forceFallbackAdapter:!!(u(),B)[c+12>>>2>>>0]};a=(u(),B)[c>>>2>>>0];0!==a&&(u(),e.Fe=!!(u(),B)[a+8>>>2>>>0])}"gpu"in navigator?(L+=1,$g(b,navigator.gpu.requestAdapter(e).then(f=>{--L;N(()=>{if(f)W[d>>>0]=f,ye(b,1,d,0);else{var h=K(),k=V("WebGPU not available on this browser (requestAdapter returned null)");ye(b,3,d,k);J(h)}})},f=>{--L;N(()=>{var h=K(),k=V(f.message);
ye(b,4,d,k);J(h)})}))):(e=K(),a=V("WebGPU not available on this browser (navigator.gpu is not available)"),ye(b,3,d,a),J(e))}function Jc(a,b,c){a>>>=0;b>>>=0;c>>>=0;return Ig(async()=>{var d=[];if(c){var e=(u(),A)[c>>>2>>>0];d.length=b+1;d[b]=new Promise(k=>setTimeout(k,e,0))}else d.length=b;for(var f=0;f<b;++f){var h=Xg(a+8*f);if(!(h in Zg))return h;d[f]=Zg[h]}d=await Promise.race(d);delete Zg[d];return d})}
var nh={},ph=()=>{if(!oh){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:fa||"./this.program"},b;for(b in nh)void 0===nh[b]?delete a[b]:a[b]=nh[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);oh=c}return oh},oh;function Kc(a,b){if(n)return M(19,1,a,b);a>>>=0;b>>>=0;var c=0,d=0,e;for(e of ph()){var f=b+c;(u(),B)[a+d>>>2>>>0]=f;c+=T(e,f,Infinity)+1;d+=4}return 0}
function Lc(a,b){if(n)return M(20,1,a,b);a>>>=0;b>>>=0;var c=ph();(u(),B)[a>>>2>>>0]=c.length;a=0;for(var d of c)a+=U(d)+1;(u(),B)[b>>>2>>>0]=a;return 0}function Nc(a){return n?M(21,1,a):52}function Oc(a,b,c,d){return n?M(22,1,a,b,c,d):52}function Pc(a,b,c,d){return n?M(23,1,a,b,c,d):70}var qh=[null,[],[]];
function Qc(a,b,c,d){if(n)return M(24,1,a,b,c,d);b>>>=0;c>>>=0;d>>>=0;for(var e=0,f=0;f<c;f++){var h=(u(),B)[b>>>2>>>0],k=(u(),B)[b+4>>>2>>>0];b+=8;for(var m=0;m<k;m++){var p=a,C=(u(),x)[h+m>>>0],r=qh[p];0===C||10===C?((1===p?ra:t)(Yf(r)),r.length=0):r.push(C)}e+=k}(u(),B)[d>>>2>>>0]=e;return 0}function Cd(a){return a>>>0}function Ed(a,b){gh(Y(a>>>0).limits,b>>>0);return 1}function Fd(a,b){return Y(a>>>0).features.has(jh[b])}function Gd(a){return BigInt(Y(a>>>0).size)}
function Hd(a){return BigInt(Y(a>>>0).usage)}function Id(a,b){a>>>=0;b>>>=0;if(b){var c=Z(b+4);b=(u(),B)[b+12>>>2>>>0];b=0!==b?{querySet:Y((u(),B)[b+4>>>2>>>0]),beginningOfPassWriteIndex:(u(),B)[b+8>>>2>>>0],endOfPassWriteIndex:(u(),B)[b+12>>>2>>>0]}:void 0;c={label:c,timestampWrites:b}}b=Y(a);a=pe(0);c=b.beginComputePass(c);W[a>>>0]=c;return a}function Jd(a,b,c,d){c=O(c);d=O(d);a=Y(a>>>0);-1==d&&(d=void 0);a.clearBuffer(Y(b>>>0),c,d)}
function Kd(a,b,c,d,e,f){c=O(c);e=O(e);f=O(f);Y(a>>>0).copyBufferToBuffer(Y(b>>>0),c,Y(d>>>0),e,f)}function Ld(a){var b=Y(a>>>0);a=ne(0);b=b.finish();W[a>>>0]=b;return a}function Md(a,b,c,d,e,f){f=O(f);Y(a>>>0).resolveQuerySet(Y(b>>>0),c,d,Y(e>>>0),f)}function Nd(a,b,c,d){Y(a>>>0).dispatchWorkgroups(b,c,d)}function Od(a,b,c){c=O(c);Y(a>>>0).dispatchWorkgroupsIndirect(Y(b>>>0),c)}function Pd(a){Y(a>>>0).end()}
function Qd(a,b,c,d,e){d>>>=0;e>>>=0;a=Y(a>>>0);c=Y(c>>>0);0==d?a.setBindGroup(b,c):a.setBindGroup(b,c,(u(),B),e>>>2,d)}function Rd(a,b){Y(a>>>0).setPipeline(Y(b>>>0))}function Sd(a,b,c){Y(a>>>0).Ee(Y(b>>>0),c)}function Td(a,b){var c=Y(a>>>0);a=me(0);b=c.getBindGroupLayout(b);W[a>>>0]=b;return a}
function Ud(a,b){function c(e){var f=(u(),B)[e+8>>>2>>>0],h=(u(),B)[e+32>>>2>>>0],k=(u(),B)[e+36>>>2>>>0],m=0;ch(e,{327681:p=>{m=(u(),B)[p+8>>>2>>>0]}});f?(h=Xg(e+24),-1==h&&(h=void 0),f={buffer:Y(f),offset:Xg(e+16),size:h}):f=Y(h||k||m);return{binding:(u(),B)[e+4>>>2>>>0],resource:f}}a>>>=0;b>>>=0;b={label:Z(b+4),layout:Y((u(),B)[b+12>>>2>>>0]),entries:function(e,f){for(var h=[],k=0;k<e;++k)h.push(c(f+40*k));return h}((u(),B)[b+16>>>2>>>0],(u(),B)[b+20>>>2>>>0])};a=Y(a);var d=le(0);Yg(d,a.createBindGroup(b));
return d}function Vd(a,b){a>>>=0;b>>>=0;var c;b&&(c={label:Z(b+4)});b=Y(a);a=oe(0);c=b.createCommandEncoder(c);W[a>>>0]=c;return a}function Wd(a,b){a>>>=0;b>>>=0;b={type:lh[(u(),A)[b+12>>>2>>>0]],count:(u(),B)[b+16>>>2>>>0]};var c=Y(a);a=qe(0);b=c.createQuerySet(b);W[a>>>0]=b;return a}
function Xd(a,b){a=Y(a>>>0).adapterInfo;b>>>=0;(u(),B)[b+52>>>2>>>0]=a.subgroupMinSize;(u(),B)[b+56>>>2>>>0]=a.subgroupMaxSize;var c=a.vendor+a.architecture+a.device+a.description;var d=U(c)+1,e=ie(d);e&&T(c,e,d);c=e;d=U(a.vendor);dh(b+4,c,d);c+=d;d=U(a.architecture);dh(b+12,c,d);c+=d;d=U(a.device);dh(b+20,c,d);dh(b+28,c+d,U(a.description));(u(),A)[b+36>>>2>>>0]=2;a=a.isFallbackAdapter?3:4;(u(),A)[b+40>>>2>>>0]=a;(u(),B)[b+44>>>2>>>0]=0;(u(),B)[b+48>>>2>>>0]=0;return 1}
var rh={"core-features-and-limits":1,"depth-clip-control":2,"depth32float-stencil8":3,"texture-compression-bc":4,"texture-compression-bc-sliced-3d":5,"texture-compression-etc2":6,"texture-compression-astc":7,"texture-compression-astc-sliced-3d":8,"timestamp-query":9,"indirect-first-instance":10,"shader-f16":11,"rg11b10ufloat-renderable":12,"bgra8unorm-storage":13,"float32-filterable":14,"float32-blendable":15,"clip-distances":16,"dual-source-blending":17,subgroups:18,"texture-formats-tier1":19,"texture-formats-tier2":20,
"primitive-index":21,"texture-component-swizzle":22,"chromium-experimental-unorm16-texture-formats":327692,"chromium-experimental-multi-draw-indirect":327729};function Yd(a,b){b>>>=0;var c=Y(a>>>0);a=ie(4*c.features.size);var d=0,e=0;for(const f of c.features)c=rh[f],0<=c&&((u(),A)[a+d>>>2>>>0]=c,d+=4,e++);(u(),B)[b+4>>>2>>>0]=a;(u(),B)[b>>>2>>>0]=e}function Zd(a,b){gh(Y(a>>>0).limits,b>>>0);return 1}function $d(a,b){Y(a>>>0).pushErrorScope(hh[b])}
function ae(a,b,c){b>>>=0;c>>>=0;a=Y(a>>>0);b=Array.from((u(),A).subarray(c>>>2>>>0,c+4*b>>>2>>>0),d=>Y(d));a.submit(b)}function be(a,b,c,d,e){c=O(c);d>>>=0;e>>>=0;a=Y(a>>>0);b=Y(b>>>0);d=(u(),x).subarray(d>>>0,d+e>>>0);a.writeBuffer(b,c,d,0,e)}n||Lf();n||(v=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),wa());g.wasmBinary&&(sa=g.wasmBinary);g.stackSave=()=>K();g.stackRestore=a=>J(a);g.stackAlloc=a=>Je(a);
g.setValue=function(a,b,c="i8"){c.endsWith("*")&&(c="*");switch(c){case "i1":(u(),w)[a>>>0]=b;break;case "i8":(u(),w)[a>>>0]=b;break;case "i16":(u(),Na)[a>>>1>>>0]=b;break;case "i32":(u(),A)[a>>>2>>>0]=b;break;case "i64":(u(),F)[a>>>3>>>0]=BigInt(b);break;case "float":(u(),Pa)[a>>>2>>>0]=b;break;case "double":(u(),E)[a>>>3>>>0]=b;break;case "*":(u(),B)[a>>>2>>>0]=b;break;default:Ta(`invalid type for setValue: ${c}`)}};
g.getValue=function(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return(u(),w)[a>>>0];case "i8":return(u(),w)[a>>>0];case "i16":return(u(),Na)[a>>>1>>>0];case "i32":return(u(),A)[a>>>2>>>0];case "i64":return(u(),F)[a>>>3>>>0];case "float":return(u(),Pa)[a>>>2>>>0];case "double":return(u(),E)[a>>>3>>>0];case "*":return(u(),B)[a>>>2>>>0];default:Ta(`invalid type for getValue: ${b}`)}};g.UTF8ToString=Zf;g.stringToUTF8=T;g.lengthBytesUTF8=U;
var ug=[Dd,Kf,Vf,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,gc,hc,ic,Kc,Lc,Nc,Oc,Pc,Qc],tg={1028716:(a,b,c,d,e)=>{if("undefined"==typeof g||!g.Vc)return 1;a=Zf(Number(a>>>0));a.startsWith("./")&&(a=a.substring(2));a=g.Vc.get(a);if(!a)return 2;b=Number(b>>>0);c=Number(c>>>0);d=Number(d>>>0);if(b+c>a.byteLength)return 3;try{const f=a.subarray(b,b+c);switch(e){case 0:(u(),x).set(f,d>>>0);break;case 1:g.bd?g.bd(d,f):g.pe(d,f);break;default:return 4}return 0}catch{return 4}},1029540:(a,b,c)=>{g.Td(a,(u(),
x).subarray(b>>>0,b+c>>>0))},1029604:()=>g.ne(),1029646:a=>{g.kd(a)},1029683:()=>"undefined"!==typeof wasmOffsetConverter},fe,Ja,ge,he,H,ie,je,ke,le,me,ne,oe,pe,qe,re,se,te,ue,ve,we,xe,ye,ze,Ae,Ga,Ma,Be,Ce,De,Ee,Fe,Ge,I,He,Ie,J,Je,K,Ke,Le,Me,Ne,dynCall_vii,Oe,dynCall_v,Pe,Qe,Re,dynCall_iii,Se,Te,Ue,dynCall_vi,Ve,We,Xe,Ye,Ze,$e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,xf,yf,Za;function Yc(a,b,c,d){var e=K();try{return Ue(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}
function Xc(a,b,c){var d=K();try{return dynCall_iii(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function nd(a){var b=K();try{dynCall_v(a)}catch(c){J(b);if(c!==c+0)throw c;I(1,0)}}function Wc(a,b){var c=K();try{return Oe(a,b)}catch(d){J(c);if(d!==d+0)throw d;I(1,0)}}function pd(a,b,c){var d=K();try{dynCall_vii(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function od(a,b){var c=K();try{dynCall_vi(a,b)}catch(d){J(c);if(d!==d+0)throw d;I(1,0)}}
function bd(a,b,c,d,e,f,h){var k=K();try{return Re(a,b,c,d,e,f,h)}catch(m){J(k);if(m!==m+0)throw m;I(1,0)}}function td(a,b,c,d,e,f){var h=K();try{Pe(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}function rd(a,b,c,d){var e=K();try{Te(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}function ud(a,b,c,d,e,f,h){var k=K();try{We(a,b,c,d,e,f,h)}catch(m){J(k);if(m!==m+0)throw m;I(1,0)}}function Ad(a,b,c,d,e,f,h){var k=K();try{Xe(a,b,c,d,e,f,h)}catch(m){J(k);if(m!==m+0)throw m;I(1,0)}}
function zd(a,b,c,d,e,f,h,k){var m=K();try{ff(a,b,c,d,e,f,h,k)}catch(p){J(m);if(p!==p+0)throw p;I(1,0)}}function xd(a,b,c,d,e,f,h,k,m,p,C,r){var y=K();try{Ye(a,b,c,d,e,f,h,k,m,p,C,r)}catch(z){J(y);if(z!==z+0)throw z;I(1,0)}}function Zc(a,b,c,d,e){var f=K();try{return Ve(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0)}}function Bd(a,b,c,d,e,f){var h=K();try{gf(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}
function sd(a,b,c,d,e){var f=K();try{Qe(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0)}}function vd(a,b,c,d,e,f,h,k){var m=K();try{Se(a,b,c,d,e,f,h,k)}catch(p){J(m);if(p!==p+0)throw p;I(1,0)}}function Vc(a){var b=K();try{return hf(a)}catch(c){J(b);if(c!==c+0)throw c;I(1,0)}}function hd(a,b,c){var d=K();try{return jf(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function kd(a,b){var c=K();try{return uf(a,b)}catch(d){J(c);if(d!==d+0)throw d;I(1,0);return 0n}}
function jd(a){var b=K();try{return Ze(a)}catch(c){J(b);if(c!==c+0)throw c;I(1,0);return 0n}}function gd(a,b,c,d){var e=K();try{return kf(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}function fd(a,b,c,d,e){var f=K();try{return lf(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0)}}function ed(a,b,c,d,e,f){var h=K();try{return mf(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}function ad(a,b,c,d,e,f){var h=K();try{return df(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}
function $c(a,b,c,d,e,f){var h=K();try{return nf(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}function cd(a,b,c,d,e,f,h,k){var m=K();try{return ef(a,b,c,d,e,f,h,k)}catch(p){J(m);if(p!==p+0)throw p;I(1,0)}}function md(a,b,c,d,e){var f=K();try{return of(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0);return 0n}}function Uc(a,b,c,d){var e=K();try{return pf(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}
function Sc(a,b,c,d){var e=K();try{return qf(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}function dd(a,b,c,d,e,f,h,k,m,p,C,r){var y=K();try{return rf(a,b,c,d,e,f,h,k,m,p,C,r)}catch(z){J(y);if(z!==z+0)throw z;I(1,0)}}function wd(a,b,c,d,e,f,h,k,m,p,C){var r=K();try{sf(a,b,c,d,e,f,h,k,m,p,C)}catch(y){J(r);if(y!==y+0)throw y;I(1,0)}}function yd(a,b,c,d,e,f,h,k,m,p,C,r,y,z,D,za){var yb=K();try{tf(a,b,c,d,e,f,h,k,m,p,C,r,y,z,D,za)}catch(Bb){J(yb);if(Bb!==Bb+0)throw Bb;I(1,0)}}
function ld(a,b,c){var d=K();try{return af(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0);return 0n}}function Tc(a,b,c){var d=K();try{return $e(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function Rc(a,b,c){var d=K();try{return bf(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function qd(a,b,c,d){var e=K();try{cf(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}
function de(){var a=G;a=Object.assign({},a);var b=d=>e=>d(e)>>>0,c=d=>()=>d()>>>0;a.ac=b(a.ac);a.Dc=c(a.Dc);a.Fc=b(a.Fc);a.sd=(d=>(e,f)=>d(e,f)>>>0)(a.sd);a.xd=b(a.xd);a.yd=c(a.yd);a.Cd=b(a.Cd);return a}function Ea(){if(0<Cf)Df=Ea;else if(n)xa?.(g),Sa();else{for(var a=Bf;0<a.length;)a.shift()(g);0<Cf?Df=Ea:(g.calledRun=!0,ua||(Sa(),xa?.(g)))}}var G;n||(G=await (Da()),Ea());g.PTR_SIZE=4;
g.webgpuInit=a=>{const b=new WeakMap;let c=1,d=void 0,e=void 0;g.webgpuRegisterDevice=k=>{if(void 0!==e)throw Error("another WebGPU EP inference session is being created.");if(k){var m=b.get(k);if(!m){m=ke(0);const p=bh(k,m);m=[c++,m,p];b.set(k,m)}d=k;e=m[0];return m}d=void 0;e=0};const f=new Map;g.webgpuOnCreateSession=k=>{if(void 0!==e){var m=e;e=void 0;if(k){const p=ge(m);f.set(k,p);0===m&&a(d??Y(p))}d=void 0}};g.webgpuOnReleaseSession=k=>{f.delete(k)};const h=Symbol("gpuBufferMetadata");g.webgpuRegisterBuffer=
(k,m,p)=>{if(p)return k[h]=[p,NaN],p;if(p=k[h])return p[1]++,p[0];m=f.get(m);if(void 0===m)throw Error("Invalid session handle passed to webgpuRegisterBuffer");m=ah(k,m);k[h]=[m,1];return m};g.webgpuUnregisterBuffer=k=>{const m=k[h];if(!m)throw Error("Buffer is not registered");m[1]--;0===m[1]&&(je(m[0]),delete k[h])};g.webgpuGetBuffer=k=>Y(k);g.webgpuCreateDownloader=(k,m,p)=>{p=f.get(p);if(void 0===p)throw Error("Invalid session handle passed to webgpuRegisterBuffer");const C=Y(p),r=16*Math.ceil(Number(m)/
16);return async()=>{const y=C.createBuffer({size:r,usage:9});try{const z=C.createCommandEncoder();z.copyBufferToBuffer(k,0,y,0,r);C.queue.submit([z.finish()]);await y.mapAsync(GPUMapMode.READ);return y.getMappedRange().slice(0,m)}finally{y.destroy()}}};g.bd=(k,m)=>{var p=m.buffer;const C=m.byteOffset,r=m.byteLength;m=16*Math.ceil(Number(r)/16);k=Y(k);if(!d){var y=ge(e);d=Y(y)}y=d.createBuffer({mappedAtCreation:!0,size:m,usage:6});const z=y.getMappedRange();(new Uint8Array(z)).set(new Uint8Array(p,
C,r));y.unmap();p=d.createCommandEncoder();p.copyBufferToBuffer(y,0,k,0,m);d.queue.submit([p.finish()]);y.destroy()}};
g.webnnInit=a=>{const b=a[0];[g.ne,g.kd,g.webnnEnsureTensor,g.Td,g.webnnDownloadTensor,g.me,g.webnnEnableTraceEvent]=a.slice(1);g.webnnReleaseTensorId=g.kd;g.webnnUploadTensor=g.Td;g.webnnRegisterMLContext=g.me;g.webnnOnRunStart=c=>b.onRunStart(c);g.webnnOnRunEnd=b.onRunEnd.bind(b);g.webnnOnReleaseSession=c=>{b.onReleaseSession(c)};g.webnnCreateMLTensorDownloader=(c,d)=>b.createMLTensorDownloader(c,d);g.webnnRegisterMLTensor=(c,d,e,f)=>b.registerMLTensor(c,d,e,f);g.webnnCreateMLContext=c=>b.createMLContext(c);
g.webnnRegisterMLConstant=(c,d,e,f,h,k)=>b.registerMLConstant(c,d,e,f,h,g.Vc,k);g.webnnRegisterGraphInput=b.registerGraphInput.bind(b);g.webnnIsGraphInput=b.isGraphInput.bind(b);g.webnnRegisterGraphOutput=b.registerGraphOutput.bind(b);g.webnnIsGraphOutput=b.isGraphOutput.bind(b);g.webnnCreateTemporaryTensor=b.createTemporaryTensor.bind(b);g.webnnIsGraphInputOutputTypeSupported=b.isGraphInputOutputTypeSupported.bind(b)};Ra?moduleRtn=g:moduleRtn=new Promise((a,b)=>{xa=a;ya=b});
;return moduleRtn}export default ortWasmThreaded;var isPthread=globalThis.self?.name?.startsWith("em-pthread");var isNode=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(isNode)isPthread=(await import("worker_threads")).workerData==="em-pthread";isPthread&&ortWasmThreaded();
