var __webpack_modules__={"./node_modules/onnxruntime-common/dist/lib/backend-impl.js": /*!******************************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/backend-impl.js ***! \******************************************************************/(e,t,n)=>{n.r(t),n.d(t,{registerBackend:()=>i,resolveBackend:()=>s});const r={},o=[],i=(e,t,n)=>{if(!t||"function"!=typeof t.init||"function"!=typeof t.createSessionHandler)throw new TypeError("not a valid backend");{const i=r[e];if(void 0===i)r[e]={backend:t,priority:n};else{if(i.priority>n)return;if(i.priority===n&&i.backend!==t)throw new Error(`cannot register backend "${e}" using priority ${n}`)}if(n>=0){const t=o.indexOf(e);-1!==t&&o.splice(t,1);for(let t=0;t{const t=0===e.length?o:e,n=[];for(const e of t){const t=r[e];if(t){if(t.initialized)return t.backend;if(t.aborted)continue;const r=!!t.initPromise;try{return r||(t.initPromise=t.backend.init()),await t.initPromise,t.initialized=!0,t.backend}catch(o){r||n.push({name:e,err:o}),t.aborted=!0}finally{delete t.initPromise}}}throw new Error(`no available backend found. ERR: ${n.map((e=>`[${e.name}] ${e.err}`)).join(", ")}`)}},"./node_modules/onnxruntime-common/dist/lib/backend.js": /*!*************************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/backend.js ***! \*************************************************************/(e,t,n)=>{n.r(t),n.d(t,{registerBackend:()=>r.registerBackend});var r=n(/*! ./backend-impl */"./node_modules/onnxruntime-common/dist/lib/backend-impl.js")},"./node_modules/onnxruntime-common/dist/lib/env-impl.js": /*!**************************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/env-impl.js ***! \**************************************************************/(e,t,n)=>{n.r(t),n.d(t,{EnvImpl:()=>r});class r{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(e){if(void 0!==e){if("string"!=typeof e||-1===["verbose","info","warning","error","fatal"].indexOf(e))throw new Error(`Unsupported logging level: ${e}`);this.logLevelInternal=e}}get logLevel(){return this.logLevelInternal}}},"./node_modules/onnxruntime-common/dist/lib/env.js": /*!*********************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/env.js ***! \*********************************************************/(e,t,n)=>{n.r(t),n.d(t,{env:()=>r});const r=new(n(/*! ./env-impl */"./node_modules/onnxruntime-common/dist/lib/env-impl.js").EnvImpl)},"./node_modules/onnxruntime-common/dist/lib/index.js": /*!***********************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/index.js ***! \***********************************************************/(e,t,n)=>{n.r(t),n.d(t,{InferenceSession:()=>i.InferenceSession,Tensor:()=>s.Tensor,env:()=>o.env,registerBackend:()=>r.registerBackend});var r=n(/*! ./backend */"./node_modules/onnxruntime-common/dist/lib/backend.js"),o=n(/*! ./env */"./node_modules/onnxruntime-common/dist/lib/env.js"),i=n(/*! ./inference-session */"./node_modules/onnxruntime-common/dist/lib/inference-session.js"),s=n(/*! ./tensor */"./node_modules/onnxruntime-common/dist/lib/tensor.js");n(/*! ./onnx-value */"./node_modules/onnxruntime-common/dist/lib/onnx-value.js")},"./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js": /*!****************************************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js ***! \****************************************************************************/(e,t,n)=>{n.r(t),n.d(t,{InferenceSession:()=>i});var r=n(/*! ./backend-impl */"./node_modules/onnxruntime-common/dist/lib/backend-impl.js"),o=n(/*! ./tensor */"./node_modules/onnxruntime-common/dist/lib/tensor.js");class i{constructor(e){this.handler=e}async run(e,t,n){const r={};let i={};if("object"!=typeof e||null===e||e instanceof o.Tensor||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let s=!0;if("object"==typeof t){if(null===t)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof o.Tensor)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(0===t.length)throw new TypeError("'fetches' cannot be an empty array.");s=!1;for(const e of t){if("string"!=typeof e)throw new TypeError("'fetches' must be a string array or an object.");if(-1===this.outputNames.indexOf(e))throw new RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if("object"==typeof n&&null!==n)i=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else{let e=!1;const a=Object.getOwnPropertyNames(t);for(const n of this.outputNames)if(-1!==a.indexOf(n)){const i=t[n];(null===i||i instanceof o.Tensor)&&(e=!0,s=!1,r[n]=i)}if(e){if("object"==typeof n&&null!==n)i=n;else if(void 0!==n)throw new TypeError("'options' must be an object.")}else i=t}}else if(void 0!==t)throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const t of this.inputNames)if(void 0===e[t])throw new Error(`input '${t}' is missing in 'feeds'.`);if(s)for(const e of this.outputNames)r[e]=null;const a=await this.handler.run(e,r,i),l={};for(const e in a)Object.hasOwnProperty.call(a,e)&&(l[e]=new o.Tensor(a[e].type,a[e].data,a[e].dims));return l}static async create(e,t,n,o){let s,a={};if("string"==typeof e){if(s=e,"object"==typeof t&&null!==t)a=t;else if(void 0!==t)throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if(s=e,"object"==typeof t&&null!==t)a=t;else if(void 0!==t)throw new TypeError("'options' must be an object.")}else{if(!(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer))throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");{const r=e;let i=0,l=e.byteLength;if("object"==typeof t&&null!==t)a=t;else if("number"==typeof t){if(i=t,!Number.isSafeInteger(i))throw new RangeError("'byteOffset' must be an integer.");if(i<0||i>=r.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${r.byteLength}).`);if(l=e.byteLength-i,"number"==typeof n){if(l=n,!Number.isSafeInteger(l))throw new RangeError("'byteLength' must be an integer.");if(l<=0||i+l>r.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${r.byteLength-i}].`);if("object"==typeof o&&null!==o)a=o;else if(void 0!==o)throw new TypeError("'options' must be an object.")}else if(void 0!==n)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==t)throw new TypeError("'options' must be an object.");s=new Uint8Array(r,i,l)}}const l=(a.executionProviders||[]).map((e=>"string"==typeof e?e:e.name)),c=await(0,r.resolveBackend)(l),u=await c.createSessionHandler(s,a);return new i(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}},"./node_modules/onnxruntime-common/dist/lib/inference-session.js": /*!***********************************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/inference-session.js ***! \***********************************************************************/(e,t,n)=>{n.r(t),n.d(t,{InferenceSession:()=>r});const r=n(/*! ./inference-session-impl */"./node_modules/onnxruntime-common/dist/lib/inference-session-impl.js").InferenceSession},"./node_modules/onnxruntime-common/dist/lib/onnx-value.js": /*!****************************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/onnx-value.js ***! \****************************************************************/(e,t,n)=>{n.r(t)},"./node_modules/onnxruntime-common/dist/lib/tensor-impl.js": /*!*****************************************************************!*\ !*** ./node_modules/onnxruntime-common/dist/lib/tensor-impl.js ***! \*****************************************************************/(e,t,n)=>{n.r(t),n.d(t,{Tensor:()=>a});const r="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,o="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from,i=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),s=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);r&&(i.set("int64",BigInt64Array),s.set(BigInt64Array,"int64")),o&&(i.set("uint64",BigUint64Array),s.set(BigUint64Array,"uint64"));class a{constructor(e,t,n){let r,o,a;if("string"==typeof e)if(r=e,a=n,"string"===e){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");o=t}else{const n=i.get(e);if(void 0===n)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t))o=n.from(t);else{if(!(t instanceof n))throw new TypeError(`A ${r} tensor's data must be type of ${n}`);o=t}}else if(a=t,Array.isArray(e)){if(0===e.length)throw new TypeError("Tensor type cannot be inferred from an empty array.");const t=typeof e[0];if("string"===t)r="string",o=e;else{if("boolean"!==t)throw new TypeError(`Invalid element type of data array: ${t}.`);r="bool",o=Uint8Array.from(e)}}else{const t=s.get(e.constructor);if(void 0===t)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,o=e}if(void 0===a)a=[o.length];else if(!Array.isArray(a))throw new TypeError("A tensor's dims must be a number array");const l=(e=>{let t=1;for(let n=0;n{const o=document.createElement("canvas"),i=o.getContext("2d");if(!e||!i)return r();const s=new Image;s.crossOrigin="Anonymous",s.src=e,s.onload=()=>{o.width=s.width,o.height=s.height,i.drawImage(s,0,0,o.width,o.height);const e=i.getImageData(0,0,o.width,o.height);if(void 0!==t){if(void 0!==t.height&&t.height!==o.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(l.height=o.height,void 0!==t.width&&t.width!==o.width)throw new Error("Image input config width doesn't match ImageBitmap width");l.width=o.width}else l.height=o.height,l.width=o.width;n(a.bufferToTensor(e.data,l))}}));throw new Error("Input data provided is not supported - aborted tensor creation")}{const n="RGBA";let r,o;if(void 0!==t&&void 0!==t.resizedWidth&&void 0!==t.resizedHeight?(r=t.resizedHeight,o=t.resizedWidth):(r=e.height,o=e.width),void 0!==t){if(l=t,void 0!==t.bitmapFormat&&t.bitmapFormat!==n)throw new Error("Image input config format must be RGBA for ImageData");l.bitmapFormat="RGBA"}else l.bitmapFormat="RGBA";if(l.height=r,l.width=o,void 0!==t){const t=document.createElement("canvas");t.width=o,t.height=r;const n=t.getContext("2d");if(null==n)throw new Error("Can not access image data");n.putImageData(e,0,0),s=n.getImageData(0,0,o,r).data}else s=e.data}}if(void 0!==s)return a.bufferToTensor(s,l);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(e){var t,n;const r=document.createElement("canvas").getContext("2d");let o;if(null==r)throw new Error("Can not access image data");{const i=this.dims[3],s=this.dims[2],a=this.dims[1],l=void 0!==e&&void 0!==e.format?e.format:"RGB",c=void 0!==e&&void 0!==(null===(t=e.norm)||void 0===t?void 0:t.mean)?e.norm.mean:255,u=void 0!==e&&void 0!==(null===(n=e.norm)||void 0===n?void 0:n.bias)?e.norm.bias:0,p=s*i;if(void 0!==e){if(void 0!==e.height&&e.height!==s)throw new Error("Image output config height doesn't match tensor height");if(void 0!==e.width&&e.width!==i)throw new Error("Image output config width doesn't match tensor width");if(void 0!==e.format&&4===a&&"RGBA"!==e.format||3===a&&"RGB"!==e.format&&"BGR"!==e.format)throw new Error("Tensor format doesn't match input tensor dims")}const d=4;let _=0,h=1,f=2,m=3,g=0,b=p,w=2*p,x=-1;"RGBA"===l?(g=0,b=p,w=2*p,x=3*p):"RGB"===l?(g=0,b=p,w=2*p):"RBG"===l&&(g=0,w=p,b=2*p),o=r.createImageData(i,s);for(let e=0;e{n.r(t),n.d(t,{Tensor:()=>r});const r=n(/*! ./tensor-impl */"./node_modules/onnxruntime-common/dist/lib/tensor-impl.js").Tensor},"./node_modules/onnxruntime-web/dist/ort-web.min.js": /*!**********************************************************!*\ !*** ./node_modules/onnxruntime-web/dist/ort-web.min.js ***! \**********************************************************/(module,__unused_webpack_exports,__webpack_require__)=>{var e;self,e=__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(e,t,n)=>{var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){function t(){return O.buffer!=D&&W(O.buffer),L}function o(){return O.buffer!=D&&W(O.buffer),$}function i(){return O.buffer!=D&&W(O.buffer),N}function s(){return O.buffer!=D&&W(O.buffer),B}function a(){return O.buffer!=D&&W(O.buffer),z}var l,c,u;e=e||{},l||(l=void 0!==e?e:{}),l.ready=new Promise((function(e,t){c=e,u=t}));var p,d,_,h,f,m,g=Object.assign({},l),b="./this.program",w=(e,t)=>{throw t},x="object"==typeof window,y="function"==typeof importScripts,T="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v=l.ENVIRONMENT_IS_PTHREAD||!1,k="";function M(e){return l.locateFile?l.locateFile(e,k):k+e}if(T){let t;k=y?n(908).dirname(k)+"/":"//",m=()=>{f||(h=n(1384),f=n(908))},p=function(e,t){return m(),e=f.normalize(e),h.readFileSync(e,t?void 0:"utf8")},_=e=>((e=p(e,!0)).buffer||(e=new Uint8Array(e)),e),d=(e,t,n)=>{m(),e=f.normalize(e),h.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1{if(J())throw process.exitCode=e,t;t instanceof ce||C("exiting due to exception: "+t),process.exit(e)},l.inspect=function(){return"[Emscripten Module object]"};try{t=n(9925)}catch(e){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),e}n.g.Worker=t.Worker}else(x||y)&&(y?k=self.location.href:"undefined"!=typeof document&&document.currentScript&&(k=document.currentScript.src),r&&(k=r),k=0!==k.indexOf("blob:")?k.substr(0,k.replace(/[?#].*/,"").lastIndexOf("/")+1):"",T||(p=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),d=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}));T&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var S=console.log.bind(console),P=console.warn.bind(console);T&&(m(),S=e=>h.writeSync(1,e+"\n"),P=e=>h.writeSync(2,e+"\n"));var A,F=l.print||S,C=l.printErr||P;Object.assign(l,g),g=null,l.thisProgram&&(b=l.thisProgram),l.quit&&(w=l.quit),l.wasmBinary&&(A=l.wasmBinary);var E=l.noExitRuntime||!1;"object"!=typeof WebAssembly&&ie("no native wasm support detected");var O,I,D,L,$,N,B,z,R=!1,j="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function V(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(o=224==(240&o)?(15&o)<<12|i<<6|s:(7&o)<<18|i<<12|s<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function U(e,t){return(e>>>=0)?V(o(),e,t):""}function G(e,t,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=s&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),127>=s){if(n>=r)break;t[n++>>>0]=s}else{if(2047>=s){if(n+1>=r)break;t[n++>>>0]=192|s>>6}else{if(65535>=s){if(n+2>=r)break;t[n++>>>0]=224|s>>12}else{if(n+3>=r)break;t[n++>>>0]=240|s>>18,t[n++>>>0]=128|s>>12&63}t[n++>>>0]=128|s>>6&63}t[n++>>>0]=128|63&s}}return t[n>>>0]=0,n-o}function q(e){for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function W(e){D=e,l.HEAP8=L=new Int8Array(e),l.HEAP16=new Int16Array(e),l.HEAP32=N=new Int32Array(e),l.HEAPU8=$=new Uint8Array(e),l.HEAPU16=new Uint16Array(e),l.HEAPU32=B=new Uint32Array(e),l.HEAPF32=new Float32Array(e),l.HEAPF64=z=new Float64Array(e)}v&&(D=l.buffer);var H=l.INITIAL_MEMORY||16777216;if(v)O=l.wasmMemory,D=l.buffer;else if(l.wasmMemory)O=l.wasmMemory;else if(!((O=new WebAssembly.Memory({initial:H/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw C("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),T&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");O&&(D=O.buffer),H=D.byteLength,W(D);var X,Q=[],Y=[],K=[],Z=[];function J(){return E||!1}function ee(){var e=l.preRun.shift();Q.unshift(e)}var te,ne=0,re=null,oe=null;function ie(e){throw v?postMessage({cmd:"onAbort",arg:e}):l.onAbort&&l.onAbort(e),C(e="Aborted("+e+")"),R=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),u(e),e}function se(){return te.startsWith("data:application/octet-stream;base64,")}function ae(){var e=te;try{if(e==te&&A)return new Uint8Array(A);if(_)return _(e);throw"both async and sync fetching of the wasm failed"}catch(e){ie(e)}}te="ort-wasm-threaded.wasm",se()||(te=M(te));var le={};function ce(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ue(e){(e=he.Vb[e])||ie(),he.mc(e)}function pe(e){var t=he.Cc();if(!t)return 6;he.ac.push(t),he.Vb[e.Ub]=t,t.Ub=e.Ub;var n={cmd:"run",start_routine:e.Ic,arg:e.zc,pthread_ptr:e.Ub};return t.$b=()=>{n.time=performance.now(),t.postMessage(n,e.Nc)},t.loaded&&(t.$b(),delete t.$b),0}function de(e){if(v)return He(1,1,e);J()||(he.oc(),l.onExit&&l.onExit(e),R=!0),w(e,new ce(e))}function _e(e,t){if(!t&&v)throw me(e),"unwind";J()||v||(gt(),fe(K),mt(0),rt[1].length&&ot(1,10),rt[2].length&&ot(2,10),he.oc()),de(e)}var he={Yb:[],ac:[],qc:[],Vb:{},fc:function(){v&&he.Ec()},Pc:function(){},Ec:function(){he.receiveObjectTransfer=he.Gc,he.threadInitTLS=he.pc,he.setExitStatus=he.nc,E=!1},nc:function(){},oc:function(){for(var e of Object.values(he.Vb))he.mc(e);for(e of he.Yb)e.terminate();he.Yb=[]},mc:function(e){var t=e.Ub;delete he.Vb[t],he.Yb.push(e),he.ac.splice(he.ac.indexOf(e),1),e.Ub=0,Tt(t)},Gc:function(){},pc:function(){he.qc.forEach((e=>e()))},Fc:function(e,t){e.onmessage=n=>{var r=(n=n.data).cmd;if(e.Ub&&(he.Bc=e.Ub),n.targetThread&&n.targetThread!=_t()){var o=he.Vb[n.Qc];o?o.postMessage(n,n.transferList):C('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?je(n.queue):"spawnThread"===r?pe(n):"cleanupThread"===r?ue(n.thread):"killThread"===r?(n=n.thread,r=he.Vb[n],delete he.Vb[n],r.terminate(),Tt(n),he.ac.splice(he.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?he.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(e.loaded=!0,t&&t(e),e.$b&&(e.$b(),delete e.$b)):"print"===r?F("Thread "+n.threadId+": "+n.text):"printErr"===r?C("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?e.postMessage(n):"onAbort"===r?l.onAbort&&l.onAbort(n.arg):r&&C("worker sent an unknown command "+r);he.Bc=void 0},e.onerror=e=>{throw C("worker sent an error! "+e.filename+":"+e.lineno+": "+e.message),e},T&&(e.on("message",(function(t){e.onmessage({data:t})})),e.on("error",(function(t){e.onerror(t)})),e.on("detachedExit",(function(){}))),e.postMessage({cmd:"load",urlOrBlob:l.mainScriptUrlOrBlob||r,wasmMemory:O,wasmModule:I})},yc:function(){var e=M("ort-wasm-threaded.worker.js");he.Yb.push(new Worker(e))},Cc:function(){return 0==he.Yb.length&&(he.yc(),he.Fc(he.Yb[0])),he.Yb.pop()}};function fe(e){for(;0>2>>>0];e=i()[e+48>>2>>>0],Mt(t,t-e),Pt(t)};var ge=[];function be(e){var t=ge[e];return t||(e>=ge.length&&(ge.length=e+1),ge[e]=t=X.get(e)),t}l.invokeEntryPoint=function(e,t){e=be(e)(t),J()?he.nc(e):vt(e)};var we,xe,ye=[],Te=0,ve=0;function ke(e){this.Zb=e,this.Sb=e-24,this.xc=function(e){s()[this.Sb+4>>2>>>0]=e},this.bc=function(){return s()[this.Sb+4>>2>>>0]},this.wc=function(e){s()[this.Sb+8>>2>>>0]=e},this.Dc=function(){return s()[this.Sb+8>>2>>>0]},this.rc=function(){i()[this.Sb>>2>>>0]=0},this.hc=function(e){e=e?1:0,t()[this.Sb+12>>0>>>0]=e},this.uc=function(){return 0!=t()[this.Sb+12>>0>>>0]},this.ic=function(e){e=e?1:0,t()[this.Sb+13>>0>>>0]=e},this.kc=function(){return 0!=t()[this.Sb+13>>0>>>0]},this.fc=function(e,t){this.cc(0),this.xc(e),this.wc(t),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(i(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(i(),this.Sb>>2,1)},this.cc=function(e){s()[this.Sb+16>>2>>>0]=e},this.tc=function(){return s()[this.Sb+16>>2>>>0]},this.vc=function(){if(Ct(this.bc()))return s()[this.Zb>>2>>>0];var e=this.tc();return 0!==e?e:this.Zb}}function Me(e){return ft(new ke(e).Sb)}function Se(e,t,n,r){return v?He(3,1,e,t,n,r):Pe(e,t,n,r)}function Pe(e,t,n,r){if("undefined"==typeof SharedArrayBuffer)return C("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];return v&&0===o.length?Se(e,t,n,r):(e={Ic:n,Ub:e,zc:r,Nc:o},v?(e.Oc="spawnThread",postMessage(e,o),0):pe(e))}function Ae(e,t,n){return v?He(4,1,e,t,n):0}function Fe(e,t){if(v)return He(5,1,e,t)}function Ce(e,t){if(v)return He(6,1,e,t)}function Ee(e,t,n){if(v)return He(7,1,e,t,n)}function Oe(e,t,n){return v?He(8,1,e,t,n):0}function Ie(e,t){if(v)return He(9,1,e,t)}function De(e,t,n){if(v)return He(10,1,e,t,n)}function Le(e,t,n,r){if(v)return He(11,1,e,t,n,r)}function $e(e,t,n,r){if(v)return He(12,1,e,t,n,r)}function Ne(e,t,n,r){if(v)return He(13,1,e,t,n,r)}function Be(e){if(v)return He(14,1,e)}function ze(e,t){if(v)return He(15,1,e,t)}function Re(e,t,n){if(v)return He(16,1,e,t,n)}function je(e){Atomics.store(i(),e>>2,1),_t()&&yt(e),Atomics.compareExchange(i(),e>>2,1,0)}function Ve(e){return s()[e>>>2]+4294967296*i()[e+4>>>2]}function Ue(e,t,n,r,o,i){return v?He(17,1,e,t,n,r,o,i):-52}function Ge(e,t,n,r,o,i){if(v)return He(18,1,e,t,n,r,o,i)}function qe(e){var n=q(e)+1,r=ht(n);return r&&G(e,t(),r,n),r}function We(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(v)return He(19,1,e,t,n);var o=(new Date).getFullYear(),a=new Date(o,0,1),l=new Date(o,6,1);o=a.getTimezoneOffset();var c=l.getTimezoneOffset(),u=Math.max(o,c);i()[e>>2>>>0]=60*u,i()[t>>2>>>0]=Number(o!=c),e=r(a),t=r(l),e=qe(e),t=qe(t),c>2>>>0]=e,s()[n+4>>2>>>0]=t):(s()[n>>2>>>0]=t,s()[n+4>>2>>>0]=e)}function He(e,t){var n=arguments.length-2,r=arguments;return function(e){var t=St();return e=e(),Pt(t),e}((()=>{for(var o=At(8*n),i=o>>3,s=0;s>>0]=l}return xt(e,n,o,t)}))}l.executeNotifiedProxyingQueue=je,xe=T?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:v?()=>performance.now()-l.__performance_now_clock_drift:()=>performance.now();var Xe,Qe=[],Ye={};function Ke(){if(!Xe){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:b||"./this.program"};for(e in Ye)void 0===Ye[e]?delete t[e]:t[e]=Ye[e];var n=[];for(e in t)n.push(e+"="+t[e]);Xe=n}return Xe}function Ze(e,n){if(v)return He(20,1,e,n);var r=0;return Ke().forEach((function(o,i){var a=n+r;for(i=s()[e+4*i>>2>>>0]=a,a=0;a>0>>>0]=o.charCodeAt(a);t()[i>>0>>>0]=0,r+=o.length+1})),0}function Je(e,t){if(v)return He(21,1,e,t);var n=Ke();s()[e>>2>>>0]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),s()[t>>2>>>0]=r,0}function et(e){return v?He(22,1,e):52}function tt(e,t,n,r){return v?He(23,1,e,t,n,r):52}function nt(e,t,n,r,o){return v?He(24,1,e,t,n,r,o):70}var rt=[null,[],[]];function ot(e,t){var n=rt[e];0===t||10===t?((1===e?F:C)(V(n,0)),n.length=0):n.push(t)}function it(e,t,n,r){if(v)return He(25,1,e,t,n,r);for(var i=0,a=0;a>2>>>0],c=s()[t+4>>2>>>0];t+=8;for(var u=0;u>>0]);i+=c}return s()[r>>2>>>0]=i,0}var st=0;function at(e){return 0==e%4&&(0!=e%100||0==e%400)}var lt=[31,29,31,30,31,30,31,31,30,31,30,31],ct=[31,28,31,30,31,30,31,31,30,31,30,31];function ut(e,n,r,o){function s(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.lengthe?-1:0r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=c(new Date(e.getFullYear(),0,4)),n=c(n),0>=l(t,e)?0>=l(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var p=i()[o+40>>2>>>0];for(var d in o={Lc:i()[o>>2>>>0],Kc:i()[o+4>>2>>>0],dc:i()[o+8>>2>>>0],jc:i()[o+12>>2>>>0],ec:i()[o+16>>2>>>0],Xb:i()[o+20>>2>>>0],Tb:i()[o+24>>2>>>0],Wb:i()[o+28>>2>>>0],Rc:i()[o+32>>2>>>0],Jc:i()[o+36>>2>>>0],Mc:p?U(p):""},r=U(r),p={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(d,"g"),p[d]);var _="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(d in p={"%a":function(e){return _[e.Tb].substring(0,3)},"%A":function(e){return _[e.Tb]},"%b":function(e){return h[e.ec].substring(0,3)},"%B":function(e){return h[e.ec]},"%C":function(e){return a((e.Xb+1900)/100|0,2)},"%d":function(e){return a(e.jc,2)},"%e":function(e){return s(e.jc,2," ")},"%g":function(e){return u(e).toString().substring(2)},"%G":function(e){return u(e)},"%H":function(e){return a(e.dc,2)},"%I":function(e){return 0==(e=e.dc)?e=12:12e.dc?"AM":"PM"},"%S":function(e){return a(e.Lc,2)},"%t":function(){return"\t"},"%u":function(e){return e.Tb||7},"%U":function(e){return a(Math.floor((e.Wb+7-e.Tb)/7),2)},"%V":function(e){var t=Math.floor((e.Wb+7-(e.Tb+6)%7)/7);if(2>=(e.Tb+371-e.Wb-2)%7&&t++,t)53==t&&(4==(n=(e.Tb+371-e.Wb)%7)||3==n&&at(e.Xb)||(t=1));else{t=52;var n=(e.Tb+7-e.Wb-1)%7;(4==n||5==n&&at(e.Xb%400-1))&&t++}return a(t,2)},"%w":function(e){return e.Tb},"%W":function(e){return a(Math.floor((e.Wb+7-(e.Tb+6)%7)/7),2)},"%y":function(e){return(e.Xb+1900).toString().substring(2)},"%Y":function(e){return e.Xb+1900},"%z":function(e){var t=0<=(e=e.Jc);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),p)r.includes(d)&&(r=r.replace(new RegExp(d,"g"),p[d](o)));return d=function(e){var t=Array(q(e)+1);return G(e,t,0,t.length),t}(r=r.replace(/\0\0/g,"%")),d.length>n?0:(function(e,n){t().set(e,n>>>0)}(d,e),d.length-1)}he.fc();var pt=[null,de,me,Se,Ae,Fe,Ce,Ee,Oe,Ie,De,Le,$e,Ne,Be,ze,Re,Ue,Ge,We,Ze,Je,et,tt,nt,it],dt={b:function(e){return ht(e+24)+24},n:function(e){return(e=new ke(e)).uc()||(e.hc(!0),Te--),e.ic(!1),ye.push(e),e.sc(),e.vc()},ma:function(e){throw C("Unexpected exception thrown, this is not properly supported - aborting"),R=!0,e},x:function(){kt(0);var e=ye.pop();if(e.Hc()&&!e.kc()){var t=e.Dc();t&&be(t)(e.Zb),Me(e.Zb)}ve=0},e:function(){var e=ve;if(!e)return st=0;var t=new ke(e);t.cc(e);var n=t.bc();if(!n)return st=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;oje(r)));else if(v)postMessage({targetThread:e,cmd:"processProxyingQueue",queue:r});else{if(!(e=he.Vb[e]))return;e.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(e,t){e=new Date(1e3*Ve(e)),i()[t>>2>>>0]=e.getUTCSeconds(),i()[t+4>>2>>>0]=e.getUTCMinutes(),i()[t+8>>2>>>0]=e.getUTCHours(),i()[t+12>>2>>>0]=e.getUTCDate(),i()[t+16>>2>>>0]=e.getUTCMonth(),i()[t+20>>2>>>0]=e.getUTCFullYear()-1900,i()[t+24>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,i()[t+28>>2>>>0]=e},Qa:function(e,t){e=new Date(1e3*Ve(e)),i()[t>>2>>>0]=e.getSeconds(),i()[t+4>>2>>>0]=e.getMinutes(),i()[t+8>>2>>>0]=e.getHours(),i()[t+12>>2>>>0]=e.getDate(),i()[t+16>>2>>>0]=e.getMonth(),i()[t+20>>2>>>0]=e.getFullYear()-1900,i()[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1),r=(e.getTime()-n.getTime())/864e5|0;i()[t+28>>2>>>0]=r,i()[t+36>>2>>>0]=-60*e.getTimezoneOffset(),r=new Date(e.getFullYear(),6,1).getTimezoneOffset(),e=0|(r!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,r)),i()[t+32>>2>>>0]=e},Ra:function(e){var t=new Date(i()[e+20>>2>>>0]+1900,i()[e+16>>2>>>0],i()[e+12>>2>>>0],i()[e+8>>2>>>0],i()[e+4>>2>>>0],i()[e>>2>>>0],0),n=i()[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),s=new Date(t.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),l=Math.min(a,s);return 0>n?i()[e+32>>2>>>0]=Number(s!=a&&l==r):0>2>>>0]=t.getDay(),n=(t.getTime()-o.getTime())/864e5|0,i()[e+28>>2>>>0]=n,i()[e>>2>>>0]=t.getSeconds(),i()[e+4>>2>>>0]=t.getMinutes(),i()[e+8>>2>>>0]=t.getHours(),i()[e+12>>2>>>0]=t.getDate(),i()[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},Aa:Ue,Ba:Ge,Sa:function e(t,n,r){e.Ac||(e.Ac=!0,We(t,n,r))},y:function(){ie("")},U:function(){if(!T&&!y){var e="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";we||(we={}),we[e]||(we[e]=1,T&&(e="warning: "+e),C(e))}},ra:function(){return 4294901760},B:xe,Ia:function(e,t,n){o().copyWithin(e>>>0,t>>>0,t+n>>>0)},F:function(){return T?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(e,t,n){Qe.length=t,n>>=3;for(var r=0;r>>0];return(0>e?le[-e-1]:pt[e]).apply(null,Qe)},qa:function(e){var t=o().length;if((e>>>=0)<=t||4294901760=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var i=Math;r=Math.max(e,r),i=i.min.call(i,4294901760,r+(65536-r%65536)%65536);e:{try{O.grow(i-D.byteLength+65535>>>16),W(O.buffer);var s=1;break e}catch(e){}s=void 0}if(s)return!0}return!1},Na:function(){throw"unwind"},Ga:Ze,Ha:Je,J:_e,I:et,S:tt,ga:nt,R:it,d:function(){return st},na:function e(r,o){e.lc||(e.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(T)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(e){}return()=>ie("randomDevice")}());for(var i=0;i>0>>>0]=e.lc();return 0},ia:function(e,t,n){var r=St();try{return be(e)(t,n)}catch(e){if(Pt(r),e!==e+0)throw e;kt(1,0)}},ja:function(e,t,n){var r=St();try{return be(e)(t,n)}catch(e){if(Pt(r),e!==e+0)throw e;kt(1,0)}},K:function(e){var t=St();try{return be(e)()}catch(e){if(Pt(t),e!==e+0)throw e;kt(1,0)}},f:function(e,t){var n=St();try{return be(e)(t)}catch(e){if(Pt(n),e!==e+0)throw e;kt(1,0)}},P:function(e,t,n){var r=St();try{return be(e)(t,n)}catch(e){if(Pt(r),e!==e+0)throw e;kt(1,0)}},Q:function(e,t,n){var r=St();try{return be(e)(t,n)}catch(e){if(Pt(r),e!==e+0)throw e;kt(1,0)}},k:function(e,t,n){var r=St();try{return be(e)(t,n)}catch(e){if(Pt(r),e!==e+0)throw e;kt(1,0)}},p:function(e,t,n,r){var o=St();try{return be(e)(t,n,r)}catch(e){if(Pt(o),e!==e+0)throw e;kt(1,0)}},q:function(e,t,n,r,o){var i=St();try{return be(e)(t,n,r,o)}catch(e){if(Pt(i),e!==e+0)throw e;kt(1,0)}},N:function(e,t,n,r,o,i){var s=St();try{return be(e)(t,n,r,o,i)}catch(e){if(Pt(s),e!==e+0)throw e;kt(1,0)}},s:function(e,t,n,r,o,i){var s=St();try{return be(e)(t,n,r,o,i)}catch(e){if(Pt(s),e!==e+0)throw e;kt(1,0)}},w:function(e,t,n,r,o,i,s){var a=St();try{return be(e)(t,n,r,o,i,s)}catch(e){if(Pt(a),e!==e+0)throw e;kt(1,0)}},L:function(e,t,n,r,o,i,s,a){var l=St();try{return be(e)(t,n,r,o,i,s,a)}catch(e){if(Pt(l),e!==e+0)throw e;kt(1,0)}},E:function(e,t,n,r,o,i,s,a,l,c,u,p){var d=St();try{return be(e)(t,n,r,o,i,s,a,l,c,u,p)}catch(e){if(Pt(d),e!==e+0)throw e;kt(1,0)}},aa:function(e,t,n,r,o,i,s,a){var l=St();try{return zt(e,t,n,r,o,i,s,a)}catch(e){if(Pt(l),e!==e+0)throw e;kt(1,0)}},_:function(e,t,n,r,o,i,s){var a=St();try{return Ot(e,t,n,r,o,i,s)}catch(e){if(Pt(a),e!==e+0)throw e;kt(1,0)}},Z:function(e,t,n,r,o){var i=St();try{return Rt(e,t,n,r,o)}catch(e){if(Pt(i),e!==e+0)throw e;kt(1,0)}},ca:function(e,t,n,r){var o=St();try{return Nt(e,t,n,r)}catch(e){if(Pt(o),e!==e+0)throw e;kt(1,0)}},$:function(e){var t=St();try{return Et(e)}catch(e){if(Pt(t),e!==e+0)throw e;kt(1,0)}},ba:function(e,t){var n=St();try{return Bt(e,t)}catch(e){if(Pt(n),e!==e+0)throw e;kt(1,0)}},Y:function(e,t,n){var r=St();try{return It(e,t,n)}catch(e){if(Pt(r),e!==e+0)throw e;kt(1,0)}},g:function(e){var t=St();try{be(e)()}catch(e){if(Pt(t),e!==e+0)throw e;kt(1,0)}},r:function(e,t){var n=St();try{be(e)(t)}catch(e){if(Pt(n),e!==e+0)throw e;kt(1,0)}},i:function(e,t,n){var r=St();try{be(e)(t,n)}catch(e){if(Pt(r),e!==e+0)throw e;kt(1,0)}},ha:function(e,t,n,r){var o=St();try{be(e)(t,n,r)}catch(e){if(Pt(o),e!==e+0)throw e;kt(1,0)}},m:function(e,t,n,r){var o=St();try{be(e)(t,n,r)}catch(e){if(Pt(o),e!==e+0)throw e;kt(1,0)}},v:function(e,t,n,r,o){var i=St();try{be(e)(t,n,r,o)}catch(e){if(Pt(i),e!==e+0)throw e;kt(1,0)}},u:function(e,t,n,r,o,i){var s=St();try{be(e)(t,n,r,o,i)}catch(e){if(Pt(s),e!==e+0)throw e;kt(1,0)}},O:function(e,t,n,r,o,i,s){var a=St();try{be(e)(t,n,r,o,i,s)}catch(e){if(Pt(a),e!==e+0)throw e;kt(1,0)}},A:function(e,t,n,r,o,i,s,a){var l=St();try{be(e)(t,n,r,o,i,s,a)}catch(e){if(Pt(l),e!==e+0)throw e;kt(1,0)}},ka:function(e,t,n,r,o,i,s,a,l){var c=St();try{be(e)(t,n,r,o,i,s,a,l)}catch(e){if(Pt(c),e!==e+0)throw e;kt(1,0)}},C:function(e,t,n,r,o,i,s,a,l,c,u){var p=St();try{be(e)(t,n,r,o,i,s,a,l,c,u)}catch(e){if(Pt(p),e!==e+0)throw e;kt(1,0)}},D:function(e,t,n,r,o,i,s,a,l,c,u,p,d,_,h,f){var m=St();try{be(e)(t,n,r,o,i,s,a,l,c,u,p,d,_,h,f)}catch(e){if(Pt(m),e!==e+0)throw e;kt(1,0)}},fa:function(e,t,n,r,o,i,s,a){var l=St();try{Dt(e,t,n,r,o,i,s,a)}catch(e){if(Pt(l),e!==e+0)throw e;kt(1,0)}},da:function(e,t,n,r,o,i,s,a,l,c,u,p){var d=St();try{$t(e,t,n,r,o,i,s,a,l,c,u,p)}catch(e){if(Pt(d),e!==e+0)throw e;kt(1,0)}},ea:function(e,t,n,r,o,i){var s=St();try{Lt(e,t,n,r,o,i)}catch(e){if(Pt(s),e!==e+0)throw e;kt(1,0)}},o:function(e){return e},a:O||l.wasmMemory,G:function(e){st=e},la:ut,z:function(e,t,n,r){return ut(e,t,n,r)}};!function(){function e(e,t){l.asm=e.exports,he.qc.push(l.asm.sb),X=l.asm.ub,Y.unshift(l.asm.Va),I=t,v||(ne--,l.monitorRunDependencies&&l.monitorRunDependencies(ne),0==ne&&(null!==re&&(clearInterval(re),re=null),oe&&(e=oe,oe=null,e())))}function t(t){e(t.instance,t.module)}function n(e){return function(){if(!A&&(x||y)){if("function"==typeof fetch&&!te.startsWith("file://"))return fetch(te,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+te+"'";return e.arrayBuffer()})).catch((function(){return ae()}));if(d)return new Promise((function(e,t){d(te,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ae()}))}().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(e){return e})).then(e,(function(e){C("failed to asynchronously prepare wasm: "+e),ie(e)}))}var r={a:dt};if(v||(ne++,l.monitorRunDependencies&&l.monitorRunDependencies(ne)),l.instantiateWasm)try{return l.instantiateWasm(r,e)}catch(e){return C("Module.instantiateWasm callback failed with error: "+e),!1}(A||"function"!=typeof WebAssembly.instantiateStreaming||se()||te.startsWith("file://")||T||"function"!=typeof fetch?n(t):fetch(te,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(t,(function(e){return C("wasm streaming compile failed: "+e),C("falling back to ArrayBuffer instantiation"),n(t)}))}))).catch(u)}(),l.___wasm_call_ctors=function(){return(l.___wasm_call_ctors=l.asm.Va).apply(null,arguments)},l._OrtInit=function(){return(l._OrtInit=l.asm.Wa).apply(null,arguments)},l._OrtCreateSessionOptions=function(){return(l._OrtCreateSessionOptions=l.asm.Xa).apply(null,arguments)},l._OrtAppendExecutionProvider=function(){return(l._OrtAppendExecutionProvider=l.asm.Ya).apply(null,arguments)},l._OrtAddSessionConfigEntry=function(){return(l._OrtAddSessionConfigEntry=l.asm.Za).apply(null,arguments)},l._OrtReleaseSessionOptions=function(){return(l._OrtReleaseSessionOptions=l.asm._a).apply(null,arguments)},l._OrtCreateSession=function(){return(l._OrtCreateSession=l.asm.$a).apply(null,arguments)},l._OrtReleaseSession=function(){return(l._OrtReleaseSession=l.asm.ab).apply(null,arguments)},l._OrtGetInputCount=function(){return(l._OrtGetInputCount=l.asm.bb).apply(null,arguments)},l._OrtGetOutputCount=function(){return(l._OrtGetOutputCount=l.asm.cb).apply(null,arguments)},l._OrtGetInputName=function(){return(l._OrtGetInputName=l.asm.db).apply(null,arguments)},l._OrtGetOutputName=function(){return(l._OrtGetOutputName=l.asm.eb).apply(null,arguments)},l._OrtFree=function(){return(l._OrtFree=l.asm.fb).apply(null,arguments)},l._OrtCreateTensor=function(){return(l._OrtCreateTensor=l.asm.gb).apply(null,arguments)},l._OrtGetTensorData=function(){return(l._OrtGetTensorData=l.asm.hb).apply(null,arguments)},l._OrtReleaseTensor=function(){return(l._OrtReleaseTensor=l.asm.ib).apply(null,arguments)},l._OrtCreateRunOptions=function(){return(l._OrtCreateRunOptions=l.asm.jb).apply(null,arguments)},l._OrtAddRunConfigEntry=function(){return(l._OrtAddRunConfigEntry=l.asm.kb).apply(null,arguments)},l._OrtReleaseRunOptions=function(){return(l._OrtReleaseRunOptions=l.asm.lb).apply(null,arguments)},l._OrtRun=function(){return(l._OrtRun=l.asm.mb).apply(null,arguments)},l._OrtEndProfiling=function(){return(l._OrtEndProfiling=l.asm.nb).apply(null,arguments)};var _t=l._pthread_self=function(){return(_t=l._pthread_self=l.asm.ob).apply(null,arguments)},ht=l._malloc=function(){return(ht=l._malloc=l.asm.pb).apply(null,arguments)},ft=l._free=function(){return(ft=l._free=l.asm.qb).apply(null,arguments)},mt=l._fflush=function(){return(mt=l._fflush=l.asm.rb).apply(null,arguments)};l.__emscripten_tls_init=function(){return(l.__emscripten_tls_init=l.asm.sb).apply(null,arguments)};var gt=l.___funcs_on_exit=function(){return(gt=l.___funcs_on_exit=l.asm.tb).apply(null,arguments)},bt=l.__emscripten_thread_init=function(){return(bt=l.__emscripten_thread_init=l.asm.vb).apply(null,arguments)};l.__emscripten_thread_crashed=function(){return(l.__emscripten_thread_crashed=l.asm.wb).apply(null,arguments)};var wt,xt=l._emscripten_run_in_main_runtime_thread_js=function(){return(xt=l._emscripten_run_in_main_runtime_thread_js=l.asm.xb).apply(null,arguments)},yt=l.__emscripten_proxy_execute_task_queue=function(){return(yt=l.__emscripten_proxy_execute_task_queue=l.asm.yb).apply(null,arguments)},Tt=l.__emscripten_thread_free_data=function(){return(Tt=l.__emscripten_thread_free_data=l.asm.zb).apply(null,arguments)},vt=l.__emscripten_thread_exit=function(){return(vt=l.__emscripten_thread_exit=l.asm.Ab).apply(null,arguments)},kt=l._setThrew=function(){return(kt=l._setThrew=l.asm.Bb).apply(null,arguments)},Mt=l._emscripten_stack_set_limits=function(){return(Mt=l._emscripten_stack_set_limits=l.asm.Cb).apply(null,arguments)},St=l.stackSave=function(){return(St=l.stackSave=l.asm.Db).apply(null,arguments)},Pt=l.stackRestore=function(){return(Pt=l.stackRestore=l.asm.Eb).apply(null,arguments)},At=l.stackAlloc=function(){return(At=l.stackAlloc=l.asm.Fb).apply(null,arguments)},Ft=l.___cxa_can_catch=function(){return(Ft=l.___cxa_can_catch=l.asm.Gb).apply(null,arguments)},Ct=l.___cxa_is_pointer_type=function(){return(Ct=l.___cxa_is_pointer_type=l.asm.Hb).apply(null,arguments)},Et=l.dynCall_j=function(){return(Et=l.dynCall_j=l.asm.Ib).apply(null,arguments)},Ot=l.dynCall_iiiiij=function(){return(Ot=l.dynCall_iiiiij=l.asm.Jb).apply(null,arguments)},It=l.dynCall_jii=function(){return(It=l.dynCall_jii=l.asm.Kb).apply(null,arguments)},Dt=l.dynCall_viiiiij=function(){return(Dt=l.dynCall_viiiiij=l.asm.Lb).apply(null,arguments)},Lt=l.dynCall_vjji=function(){return(Lt=l.dynCall_vjji=l.asm.Mb).apply(null,arguments)},$t=l.dynCall_viiijjjii=function(){return($t=l.dynCall_viiijjjii=l.asm.Nb).apply(null,arguments)},Nt=l.dynCall_iij=function(){return(Nt=l.dynCall_iij=l.asm.Ob).apply(null,arguments)},Bt=l.dynCall_ji=function(){return(Bt=l.dynCall_ji=l.asm.Pb).apply(null,arguments)},zt=l.dynCall_iiiiiij=function(){return(zt=l.dynCall_iiiiiij=l.asm.Qb).apply(null,arguments)},Rt=l.dynCall_iiij=function(){return(Rt=l.dynCall_iiij=l.asm.Rb).apply(null,arguments)};function jt(){function e(){if(!wt&&(wt=!0,l.calledRun=!0,!R)&&(v||fe(Y),c(l),l.onRuntimeInitialized&&l.onRuntimeInitialized(),!v)){if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var e=l.postRun.shift();Z.unshift(e)}fe(Z)}}if(!(0{var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){var t,o,i;e=e||{},t||(t=void 0!==e?e:{}),t.ready=new Promise((function(e,t){o=e,i=t}));var s,a,l,c,u,p,d=Object.assign({},t),_="./this.program",h=(e,t)=>{throw t},f="object"==typeof window,m="function"==typeof importScripts,g="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,b="";g?(b=m?n(908).dirname(b)+"/":"//",p=()=>{u||(c=n(1384),u=n(908))},s=function(e,t){return p(),e=u.normalize(e),c.readFileSync(e,t?void 0:"utf8")},l=e=>((e=s(e,!0)).buffer||(e=new Uint8Array(e)),e),a=(e,t,n)=>{p(),e=u.normalize(e),c.readFile(e,(function(e,r){e?n(e):t(r.buffer)}))},1{if(T||0{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m&&(l=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),a=(e,t,n)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)});var w,x=t.print||console.log.bind(console),y=t.printErr||console.warn.bind(console);Object.assign(t,d),d=null,t.thisProgram&&(_=t.thisProgram),t.quit&&(h=t.quit),t.wasmBinary&&(w=t.wasmBinary);var T=t.noExitRuntime||!1;"object"!=typeof WebAssembly&&H("no native wasm support detected");var v,k,M,S,P,A,F=!1,C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function E(e,t,n){var r=(t>>>=0)+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(o=224==(240&o)?(15&o)<<12|i<<6|s:(7&o)<<18|i<<12|s<<6|63&e[t++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function O(e,t){return(e>>>=0)?E(S,e,t):""}function I(e,t,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=s&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),127>=s){if(n>=r)break;t[n++>>>0]=s}else{if(2047>=s){if(n+1>=r)break;t[n++>>>0]=192|s>>6}else{if(65535>=s){if(n+2>=r)break;t[n++>>>0]=224|s>>12}else{if(n+3>=r)break;t[n++>>>0]=240|s>>18,t[n++>>>0]=128|s>>12&63}t[n++>>>0]=128|s>>6&63}t[n++>>>0]=128|63&s}}return t[n>>>0]=0,n-o}function D(e){for(var t=0,n=0;n=r?t++:2047>=r?t+=2:55296<=r&&57343>=r?(t+=4,++n):t+=3}return t}function L(){var e=v.buffer;k=e,t.HEAP8=M=new Int8Array(e),t.HEAP16=new Int16Array(e),t.HEAP32=P=new Int32Array(e),t.HEAPU8=S=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAPU32=A=new Uint32Array(e),t.HEAPF32=new Float32Array(e),t.HEAPF64=new Float64Array(e)}var $,N=[],B=[],z=[],R=[],j=0;function V(){var e=t.preRun.shift();N.unshift(e)}var U,G=0,q=null,W=null;function H(e){throw t.onAbort&&t.onAbort(e),y(e="Aborted("+e+")"),F=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),i(e),e}function X(){return U.startsWith("data:application/octet-stream;base64,")}if(U="ort-wasm.wasm",!X()){var Q=U;U=t.locateFile?t.locateFile(Q,b):b+Q}function Y(){var e=U;try{if(e==U&&w)return new Uint8Array(w);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(e){H(e)}}function K(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Z(e){for(;0>2>>>0]=e},this.Eb=function(){return A[this.zb+4>>2>>>0]},this.Sb=function(e){A[this.zb+8>>2>>>0]=e},this.Wb=function(){return A[this.zb+8>>2>>>0]},this.Tb=function(){P[this.zb>>2>>>0]=0},this.Ib=function(e){M[this.zb+12>>0>>>0]=e?1:0},this.Pb=function(){return 0!=M[this.zb+12>>0>>>0]},this.Jb=function(e){M[this.zb+13>>0>>>0]=e?1:0},this.Lb=function(){return 0!=M[this.zb+13>>0>>>0]},this.Rb=function(e,t){this.Fb(0),this.Ub(e),this.Sb(t),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){P[this.zb>>2>>>0]+=1},this.Xb=function(){var e=P[this.zb>>2>>>0];return P[this.zb>>2>>>0]=e-1,1===e},this.Fb=function(e){A[this.zb+16>>2>>>0]=e},this.Ob=function(){return A[this.zb+16>>2>>>0]},this.Qb=function(){if(Ae(this.Eb()))return A[this.Db>>2>>>0];var e=this.Ob();return 0!==e?e:this.Db}}function re(e){return xe(new ne(e).zb)}var oe=[];function ie(e){var t=oe[e];return t||(e>=oe.length&&(oe.length=e+1),oe[e]=t=$.get(e)),t}function se(e){var t=D(e)+1,n=we(t);return n&&I(e,M,n,t),n}var ae={};function le(){if(!ce){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:_||"./this.program"};for(e in ae)void 0===ae[e]?delete t[e]:t[e]=ae[e];var n=[];for(e in t)n.push(e+"="+t[e]);ce=n}return ce}var ce,ue=[null,[],[]];function pe(e,t){var n=ue[e];0===t||10===t?((1===e?x:y)(E(n,0)),n.length=0):n.push(t)}var de=0;function _e(e){return 0==e%4&&(0!=e%100||0==e%400)}var he=[31,29,31,30,31,30,31,31,30,31,30,31],fe=[31,28,31,30,31,30,31,31,30,31,30,31];function me(e,t,n,r){function o(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.lengthe?-1:0r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return n=new Date(e.getFullYear()+1,0,4),t=a(new Date(e.getFullYear(),0,4)),n=a(n),0>=s(t,e)?0>=s(n,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=P[r+40>>2>>>0];for(var u in r={$b:P[r>>2>>>0],Zb:P[r+4>>2>>>0],Gb:P[r+8>>2>>>0],Kb:P[r+12>>2>>>0],Hb:P[r+16>>2>>>0],Cb:P[r+20>>2>>>0],Ab:P[r+24>>2>>>0],Bb:P[r+28>>2>>>0],bc:P[r+32>>2>>>0],Yb:P[r+36>>2>>>0],ac:c?O(c):""},n=O(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(u,"g"),c[u]);var p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(u in c={"%a":function(e){return p[e.Ab].substring(0,3)},"%A":function(e){return p[e.Ab]},"%b":function(e){return d[e.Hb].substring(0,3)},"%B":function(e){return d[e.Hb]},"%C":function(e){return i((e.Cb+1900)/100|0,2)},"%d":function(e){return i(e.Kb,2)},"%e":function(e){return o(e.Kb,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return i(e.Gb,2)},"%I":function(e){return 0==(e=e.Gb)?e=12:12e.Gb?"AM":"PM"},"%S":function(e){return i(e.$b,2)},"%t":function(){return"\t"},"%u":function(e){return e.Ab||7},"%U":function(e){return i(Math.floor((e.Bb+7-e.Ab)/7),2)},"%V":function(e){var t=Math.floor((e.Bb+7-(e.Ab+6)%7)/7);if(2>=(e.Ab+371-e.Bb-2)%7&&t++,t)53==t&&(4==(n=(e.Ab+371-e.Bb)%7)||3==n&&_e(e.Cb)||(t=1));else{t=52;var n=(e.Ab+7-e.Bb-1)%7;(4==n||5==n&&_e(e.Cb%400-1))&&t++}return i(t,2)},"%w":function(e){return e.Ab},"%W":function(e){return i(Math.floor((e.Bb+7-(e.Ab+6)%7)/7),2)},"%y":function(e){return(e.Cb+1900).toString().substring(2)},"%Y":function(e){return e.Cb+1900},"%z":function(e){var t=0<=(e=e.Yb);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),c)n.includes(u)&&(n=n.replace(new RegExp(u,"g"),c[u](r)));return u=function(e){var t=Array(D(e)+1);return I(e,t,0,t.length),t}(n=n.replace(/\0\0/g,"%")),u.length>t?0:(M.set(u,e>>>0),u.length-1)}var ge={a:function(e){return we(e+24)+24},m:function(e){return(e=new ne(e)).Pb()||(e.Ib(!0),ee--),e.Jb(!1),J.push(e),e.Nb(),e.Qb()},ia:function(e){throw y("Unexpected exception thrown, this is not properly supported - aborting"),F=!0,e},w:function(){ve(0);var e=J.pop();if(e.Xb()&&!e.Lb()){var t=e.Wb();t&&ie(t)(e.Db),re(e.Db)}te=0},d:function(){var e=te;if(!e)return de=0;var t=new ne(e);t.Fb(e);var n=t.Eb();if(!n)return de=0,e;for(var r=Array.prototype.slice.call(arguments),o=0;o>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getUTCSeconds(),P[t+4>>2>>>0]=e.getUTCMinutes(),P[t+8>>2>>>0]=e.getUTCHours(),P[t+12>>2>>>0]=e.getUTCDate(),P[t+16>>2>>>0]=e.getUTCMonth(),P[t+20>>2>>>0]=e.getUTCFullYear()-1900,P[t+24>>2>>>0]=e.getUTCDay(),P[t+28>>2>>>0]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(e,t){e=new Date(1e3*(A[e>>>2]+4294967296*P[e+4>>>2])),P[t>>2>>>0]=e.getSeconds(),P[t+4>>2>>>0]=e.getMinutes(),P[t+8>>2>>>0]=e.getHours(),P[t+12>>2>>>0]=e.getDate(),P[t+16>>2>>>0]=e.getMonth(),P[t+20>>2>>>0]=e.getFullYear()-1900,P[t+24>>2>>>0]=e.getDay();var n=new Date(e.getFullYear(),0,1);P[t+28>>2>>>0]=(e.getTime()-n.getTime())/864e5|0,P[t+36>>2>>>0]=-60*e.getTimezoneOffset();var r=new Date(e.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),P[t+32>>2>>>0]=0|(r!=n&&e.getTimezoneOffset()==Math.min(n,r))},Fa:function(e){var t=new Date(P[e+20>>2>>>0]+1900,P[e+16>>2>>>0],P[e+12>>2>>>0],P[e+8>>2>>>0],P[e+4>>2>>>0],P[e>>2>>>0],0),n=P[e+32>>2>>>0],r=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),i=new Date(t.getFullYear(),6,1).getTimezoneOffset(),s=o.getTimezoneOffset(),a=Math.min(s,i);return 0>n?P[e+32>>2>>>0]=Number(i!=s&&a==r):0>2>>>0]=t.getDay(),P[e+28>>2>>>0]=(t.getTime()-o.getTime())/864e5|0,P[e>>2>>>0]=t.getSeconds(),P[e+4>>2>>>0]=t.getMinutes(),P[e+8>>2>>>0]=t.getHours(),P[e+12>>2>>>0]=t.getDate(),P[e+16>>2>>>0]=t.getMonth(),t.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function e(t,n,r){e.Vb||(e.Vb=!0,function(e,t,n){function r(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}var o=(new Date).getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1);o=i.getTimezoneOffset();var a=s.getTimezoneOffset();P[e>>2>>>0]=60*Math.max(o,a),P[t>>2>>>0]=Number(o!=a),e=r(i),t=r(s),e=se(e),t=se(t),a>2>>>0]=e,A[n+4>>2>>>0]=t):(A[n>>2>>>0]=t,A[n+4>>2>>>0]=e)}(t,n,r))},B:function(){H("")},ma:function(){return 4294901760},I:g?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now(),xa:function(e,t,n){S.copyWithin(e>>>0,t>>>0,t+n>>>0)},G:function(e){var t=S.length;if(4294901760<(e>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296);var o=Math;r=Math.max(e,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);e:{try{v.grow(o-k.byteLength+65535>>>16),L();var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},va:function(e,t){var n=0;return le().forEach((function(r,o){var i=t+n;for(o=A[e+4*o>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);M[o>>0>>>0]=0,n+=r.length+1})),0},wa:function(e,t){var n=le();A[e>>2>>>0]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),A[t>>2>>>0]=r,0},ba:function(e){T||0>2>>>0],a=A[t+4>>2>>>0];t+=8;for(var l=0;l>>0]);o+=a}return A[r>>2>>>0]=o,0},c:function(){return de},ja:function e(t,r){e.Mb||(e.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(g)try{var t=n(Object(function(){var e=new Error("Cannot find module 'crypto'");throw e.code="MODULE_NOT_FOUND",e}()));return()=>t.randomBytes(1)[0]}catch(e){}return()=>H("randomDevice")}());for(var o=0;o>0>>>0]=e.Mb();return 0},ea:function(e,t,n){var r=ke();try{return ie(e)(t,n)}catch(e){if(Me(r),e!==e+0)throw e;ve(1,0)}},fa:function(e,t,n){var r=ke();try{return ie(e)(t,n)}catch(e){if(Me(r),e!==e+0)throw e;ve(1,0)}},J:function(e){var t=ke();try{return ie(e)()}catch(e){if(Me(t),e!==e+0)throw e;ve(1,0)}},e:function(e,t){var n=ke();try{return ie(e)(t)}catch(e){if(Me(n),e!==e+0)throw e;ve(1,0)}},N:function(e,t,n){var r=ke();try{return ie(e)(t,n)}catch(e){if(Me(r),e!==e+0)throw e;ve(1,0)}},O:function(e,t,n){var r=ke();try{return ie(e)(t,n)}catch(e){if(Me(r),e!==e+0)throw e;ve(1,0)}},j:function(e,t,n){var r=ke();try{return ie(e)(t,n)}catch(e){if(Me(r),e!==e+0)throw e;ve(1,0)}},o:function(e,t,n,r){var o=ke();try{return ie(e)(t,n,r)}catch(e){if(Me(o),e!==e+0)throw e;ve(1,0)}},p:function(e,t,n,r,o){var i=ke();try{return ie(e)(t,n,r,o)}catch(e){if(Me(i),e!==e+0)throw e;ve(1,0)}},M:function(e,t,n,r,o,i){var s=ke();try{return ie(e)(t,n,r,o,i)}catch(e){if(Me(s),e!==e+0)throw e;ve(1,0)}},r:function(e,t,n,r,o,i){var s=ke();try{return ie(e)(t,n,r,o,i)}catch(e){if(Me(s),e!==e+0)throw e;ve(1,0)}},v:function(e,t,n,r,o,i,s){var a=ke();try{return ie(e)(t,n,r,o,i,s)}catch(e){if(Me(a),e!==e+0)throw e;ve(1,0)}},K:function(e,t,n,r,o,i,s,a){var l=ke();try{return ie(e)(t,n,r,o,i,s,a)}catch(e){if(Me(l),e!==e+0)throw e;ve(1,0)}},D:function(e,t,n,r,o,i,s,a,l,c,u,p){var d=ke();try{return ie(e)(t,n,r,o,i,s,a,l,c,u,p)}catch(e){if(Me(d),e!==e+0)throw e;ve(1,0)}},X:function(e,t,n,r,o,i,s,a){var l=ke();try{return Ne(e,t,n,r,o,i,s,a)}catch(e){if(Me(l),e!==e+0)throw e;ve(1,0)}},V:function(e,t,n,r,o,i,s){var a=ke();try{return Ce(e,t,n,r,o,i,s)}catch(e){if(Me(a),e!==e+0)throw e;ve(1,0)}},U:function(e,t,n,r,o){var i=ke();try{return Be(e,t,n,r,o)}catch(e){if(Me(i),e!==e+0)throw e;ve(1,0)}},Z:function(e,t,n,r){var o=ke();try{return Le(e,t,n,r)}catch(e){if(Me(o),e!==e+0)throw e;ve(1,0)}},W:function(e){var t=ke();try{return Fe(e)}catch(e){if(Me(t),e!==e+0)throw e;ve(1,0)}},Y:function(e,t){var n=ke();try{return $e(e,t)}catch(e){if(Me(n),e!==e+0)throw e;ve(1,0)}},T:function(e,t,n){var r=ke();try{return Ee(e,t,n)}catch(e){if(Me(r),e!==e+0)throw e;ve(1,0)}},f:function(e){var t=ke();try{ie(e)()}catch(e){if(Me(t),e!==e+0)throw e;ve(1,0)}},q:function(e,t){var n=ke();try{ie(e)(t)}catch(e){if(Me(n),e!==e+0)throw e;ve(1,0)}},h:function(e,t,n){var r=ke();try{ie(e)(t,n)}catch(e){if(Me(r),e!==e+0)throw e;ve(1,0)}},da:function(e,t,n,r){var o=ke();try{ie(e)(t,n,r)}catch(e){if(Me(o),e!==e+0)throw e;ve(1,0)}},l:function(e,t,n,r){var o=ke();try{ie(e)(t,n,r)}catch(e){if(Me(o),e!==e+0)throw e;ve(1,0)}},t:function(e,t,n,r,o){var i=ke();try{ie(e)(t,n,r,o)}catch(e){if(Me(i),e!==e+0)throw e;ve(1,0)}},u:function(e,t,n,r,o,i){var s=ke();try{ie(e)(t,n,r,o,i)}catch(e){if(Me(s),e!==e+0)throw e;ve(1,0)}},x:function(e,t,n,r,o,i,s){var a=ke();try{ie(e)(t,n,r,o,i,s)}catch(e){if(Me(a),e!==e+0)throw e;ve(1,0)}},z:function(e,t,n,r,o,i,s,a){var l=ke();try{ie(e)(t,n,r,o,i,s,a)}catch(e){if(Me(l),e!==e+0)throw e;ve(1,0)}},ga:function(e,t,n,r,o,i,s,a,l){var c=ke();try{ie(e)(t,n,r,o,i,s,a,l)}catch(e){if(Me(c),e!==e+0)throw e;ve(1,0)}},A:function(e,t,n,r,o,i,s,a,l,c,u){var p=ke();try{ie(e)(t,n,r,o,i,s,a,l,c,u)}catch(e){if(Me(p),e!==e+0)throw e;ve(1,0)}},C:function(e,t,n,r,o,i,s,a,l,c,u,p,d,_,h,f){var m=ke();try{ie(e)(t,n,r,o,i,s,a,l,c,u,p,d,_,h,f)}catch(e){if(Me(m),e!==e+0)throw e;ve(1,0)}},aa:function(e,t,n,r,o,i,s,a){var l=ke();try{Oe(e,t,n,r,o,i,s,a)}catch(e){if(Me(l),e!==e+0)throw e;ve(1,0)}},_:function(e,t,n,r,o,i,s,a,l,c,u,p){var d=ke();try{De(e,t,n,r,o,i,s,a,l,c,u,p)}catch(e){if(Me(d),e!==e+0)throw e;ve(1,0)}},$:function(e,t,n,r,o,i){var s=ke();try{Ie(e,t,n,r,o,i)}catch(e){if(Me(s),e!==e+0)throw e;ve(1,0)}},n:function(e){return e},F:function(e){de=e},ha:me,y:function(e,t,n,r){return me(e,t,n,r)}};!function(){function e(e){t.asm=e.exports,v=t.asm.Ka,L(),$=t.asm.ib,B.unshift(t.asm.La),G--,t.monitorRunDependencies&&t.monitorRunDependencies(G),0==G&&(null!==q&&(clearInterval(q),q=null),W&&(e=W,W=null,e()))}function n(t){e(t.instance)}function r(e){return function(){if(!w&&(f||m)){if("function"==typeof fetch&&!U.startsWith("file://"))return fetch(U,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+U+"'";return e.arrayBuffer()})).catch((function(){return Y()}));if(a)return new Promise((function(e,t){a(U,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return Y()}))}().then((function(e){return WebAssembly.instantiate(e,o)})).then((function(e){return e})).then(e,(function(e){y("failed to asynchronously prepare wasm: "+e),H(e)}))}var o={a:ge};if(G++,t.monitorRunDependencies&&t.monitorRunDependencies(G),t.instantiateWasm)try{return t.instantiateWasm(o,e)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||X()||U.startsWith("file://")||g||"function"!=typeof fetch?r(n):fetch(U,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,o).then(n,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(i)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.La).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.Ma).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.Na).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.Oa).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.Pa).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm.Qa).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.Ra).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.Sa).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.Ta).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.Ua).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm.Va).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.Wa).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.Xa).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.Ya).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.Za).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm._a).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.$a).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.ab).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.bb).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.cb).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.db).apply(null,arguments)};var be,we=t._malloc=function(){return(we=t._malloc=t.asm.eb).apply(null,arguments)},xe=t._free=function(){return(xe=t._free=t.asm.fb).apply(null,arguments)},ye=t._fflush=function(){return(ye=t._fflush=t.asm.gb).apply(null,arguments)},Te=t.___funcs_on_exit=function(){return(Te=t.___funcs_on_exit=t.asm.hb).apply(null,arguments)},ve=t._setThrew=function(){return(ve=t._setThrew=t.asm.jb).apply(null,arguments)},ke=t.stackSave=function(){return(ke=t.stackSave=t.asm.kb).apply(null,arguments)},Me=t.stackRestore=function(){return(Me=t.stackRestore=t.asm.lb).apply(null,arguments)},Se=t.stackAlloc=function(){return(Se=t.stackAlloc=t.asm.mb).apply(null,arguments)},Pe=t.___cxa_can_catch=function(){return(Pe=t.___cxa_can_catch=t.asm.nb).apply(null,arguments)},Ae=t.___cxa_is_pointer_type=function(){return(Ae=t.___cxa_is_pointer_type=t.asm.ob).apply(null,arguments)},Fe=t.dynCall_j=function(){return(Fe=t.dynCall_j=t.asm.pb).apply(null,arguments)},Ce=t.dynCall_iiiiij=function(){return(Ce=t.dynCall_iiiiij=t.asm.qb).apply(null,arguments)},Ee=t.dynCall_jii=function(){return(Ee=t.dynCall_jii=t.asm.rb).apply(null,arguments)},Oe=t.dynCall_viiiiij=function(){return(Oe=t.dynCall_viiiiij=t.asm.sb).apply(null,arguments)},Ie=t.dynCall_vjji=function(){return(Ie=t.dynCall_vjji=t.asm.tb).apply(null,arguments)},De=t.dynCall_viiijjjii=function(){return(De=t.dynCall_viiijjjii=t.asm.ub).apply(null,arguments)},Le=t.dynCall_iij=function(){return(Le=t.dynCall_iij=t.asm.vb).apply(null,arguments)},$e=t.dynCall_ji=function(){return($e=t.dynCall_ji=t.asm.wb).apply(null,arguments)},Ne=t.dynCall_iiiiiij=function(){return(Ne=t.dynCall_iiiiiij=t.asm.xb).apply(null,arguments)},Be=t.dynCall_iiij=function(){return(Be=t.dynCall_iiij=t.asm.yb).apply(null,arguments)};function ze(){function e(){if(!be&&(be=!0,t.calledRun=!0,!F)){if(Z(B),o(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var e=t.postRun.shift();R.unshift(e)}Z(R)}}if(!(0{e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,o=2,i=!0;o{var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),i=0;i<64;)o[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(e,t,n){for(var o,i=null,s=[],a=0,l=0;t>2],o=(3&c)<<4,l=1;break;case 1:s[a++]=r[o|c>>4],o=(15&c)<<2,l=2;break;case 2:s[a++]=r[o|c>>6],s[a++]=r[63&c],l=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return l&&(s[a++]=r[o],s[a++]=61,1===l&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";n.decode=function(e,t,n){for(var r,i=n,a=0,l=0;l1)break;if(void 0===(c=o[c]))throw Error(s);switch(a){case 0:r=c,a=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,a=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,a=3;break;case 3:t[n++]=(3&r)<<6|c,a=0}}if(1===a)throw Error(s);return n-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},9211:e=>{function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3]}function i(e,r,o){t[0]=e,r[o]=n[3],r[o+1]=n[2],r[o+2]=n[1],r[o+3]=n[0]}function s(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function a(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?o:i,e.writeFloatBE=r?i:o,e.readFloatLE=r?s:a,e.readFloatBE=r?a:s}():function(){function t(e,t,n,r){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,r)}}function s(e,t,n){var r=e(t,n),o=2*(r>>31)+1,i=r>>>23&255,s=8388607&r;return 255===i?s?NaN:o*(1/0):0===i?1401298464324817e-60*o*s:o*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=s.bind(null,o),e.readFloatBE=s.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function o(e,r,o){t[0]=e,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(e,r,o){t[0]=e,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function s(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function a(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?o:i,e.writeDoubleBE=r?i:o,e.readDoubleLE=r?s:a,e.readDoubleBE=r?a:s}():function(){function t(e,t,n,r,o,i){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,o,i+t),e(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))e(0,o,i+t),e(2146959360,o,i+n);else if(r>17976931348623157e292)e(0,o,i+t),e((s<<31|2146435072)>>>0,o,i+n);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,o,i+t),e((s<<31|a/4294967296)>>>0,o,i+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(a=r*Math.pow(2,-l))>>>0,o,i+t),e((s<<31|l+1023<<20|1048576*a&1048575)>>>0,o,i+n)}}}function s(e,t,n,r,o){var i=e(r,o+t),s=e(r,o+n),a=2*(s>>31)+1,l=s>>>20&2047,c=4294967296*(1048575&s)+i;return 2047===l?c?NaN:a*(1/0):0===l?5e-324*a*c:a*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=s.bind(null,o,0,4),e.readDoubleBE=s.bind(null,i,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function o(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},6662:e=>{e.exports=function(e,t,n){var r=n||8192,o=r>>>1,i=null,s=r;return function(n){if(n<1||n>o)return e(n);s+n>r&&(i=e(r),s=0);var a=t.call(i,s,s+=n);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{var n=t;n.length=function(e){for(var t=0,n=0,r=0;r191&&r<224?i[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(r>>10),i[s++]=56320+(1023&r)):i[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,i.slice(0,s))),o.join("")):String.fromCharCode.apply(String,i.slice(0,s))},n.write=function(e,t,n){for(var r,o,i=n,s=0;s>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&o),++s,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-i}},3442:(e,t)=>{t.__esModule=!0;var n=function(){function e(t){if(!t)throw new TypeError("Invalid argument; `value` has no value.");this.value=e.EMPTY,t&&e.isGuid(t)&&(this.value=t)}return e.isGuid=function(t){var n=t.toString();return t&&(t instanceof e||e.validator.test(n))},e.create=function(){return new e([e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-"))},e.createEmpty=function(){return new e("emptyguid")},e.parse=function(t){return new e(t)},e.raw=function(){return[e.gen(2),e.gen(1),e.gen(1),e.gen(1),e.gen(3)].join("-")},e.gen=function(e){for(var t="",n=0;n{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function r(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var o={},i={};function s(e,t){var n,r,s;return t?(s=0<=(e>>>=0)&&e<256)&&(r=i[e])?r:(n=l(e,(0|e)<0?-1:0,!0),s&&(i[e]=n),n):(s=-128<=(e|=0)&&e<128)&&(r=o[e])?r:(n=l(e,e<0?-1:0,!1),s&&(o[e]=n),n)}function a(e,t){if(isNaN(e))return t?g:m;if(t){if(e<0)return g;if(e>=_)return T}else{if(e<=-h)return v;if(e+1>=h)return y}return e<0?a(-e,t).neg():l(e%d|0,e/d|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=s,n.fromNumber=a,n.fromBits=l;var c=Math.pow;function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return m;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return u(e.substring(1),t,n).neg();for(var o=a(c(n,8)),i=m,s=0;s>>0:this.low},k.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},k.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((i=l).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},k.getHighBits=function(){return this.high},k.getHighBitsUnsigned=function(){return this.high>>>0},k.getLowBits=function(){return this.low},k.getLowBitsUnsigned=function(){return this.low>>>0},k.getNumBitsAbs=function(){if(this.isNegative())return this.eq(v)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},k.isOdd=function(){return 1==(1&this.low)},k.isEven=function(){return 0==(1&this.low)},k.equals=function(e){return r(e)||(e=p(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},k.eq=k.equals,k.notEquals=function(e){return!this.eq(e)},k.neq=k.notEquals,k.ne=k.notEquals,k.lessThan=function(e){return this.comp(e)<0},k.lt=k.lessThan,k.lessThanOrEqual=function(e){return this.comp(e)<=0},k.lte=k.lessThanOrEqual,k.le=k.lessThanOrEqual,k.greaterThan=function(e){return this.comp(e)>0},k.gt=k.greaterThan,k.greaterThanOrEqual=function(e){return this.comp(e)>=0},k.gte=k.greaterThanOrEqual,k.ge=k.greaterThanOrEqual,k.compare=function(e){if(r(e)||(e=p(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},k.comp=k.compare,k.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(b)},k.neg=k.negate,k.add=function(e){r(e)||(e=p(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,u=0,d=0,_=0,h=0;return _+=(h+=i+(65535&e.low))>>>16,d+=(_+=o+c)>>>16,u+=(d+=n+a)>>>16,u+=t+s,l((_&=65535)<<16|(h&=65535),(u&=65535)<<16|(d&=65535),this.unsigned)},k.subtract=function(e){return r(e)||(e=p(e)),this.add(e.neg())},k.sub=k.subtract,k.multiply=function(e){if(this.isZero())return m;if(r(e)||(e=p(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return m;if(this.eq(v))return e.isOdd()?v:m;if(e.eq(v))return this.isOdd()?v:m;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(f)&&e.lt(f))return a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,i=this.low>>>16,s=65535&this.low,c=e.high>>>16,u=65535&e.high,d=e.low>>>16,_=65535&e.low,h=0,g=0,b=0,w=0;return b+=(w+=s*_)>>>16,g+=(b+=i*_)>>>16,b&=65535,g+=(b+=s*d)>>>16,h+=(g+=o*_)>>>16,g&=65535,h+=(g+=i*d)>>>16,g&=65535,h+=(g+=s*u)>>>16,h+=n*_+o*d+i*u+s*c,l((b&=65535)<<16|(w&=65535),(h&=65535)<<16|(g&=65535),this.unsigned)},k.mul=k.multiply,k.divide=function(e){if(r(e)||(e=p(e)),e.isZero())throw Error("division by zero");var n,o,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:m;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return w;i=g}else{if(this.eq(v))return e.eq(b)||e.eq(x)?v:e.eq(v)?b:(n=this.shr(1).div(e).shl(1)).eq(m)?e.isNegative()?b:x:(o=this.sub(e.mul(n)),i=n.add(o.div(e)));if(e.eq(v))return this.unsigned?g:m;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=m}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:c(2,s-48),d=a(n),_=d.mul(e);_.isNegative()||_.gt(o);)_=(d=a(n-=u,this.unsigned)).mul(e);d.isZero()&&(d=b),i=i.add(d),o=o.sub(_)}return i},k.div=k.divide,k.modulo=function(e){return r(e)||(e=p(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},k.mod=k.modulo,k.rem=k.modulo,k.not=function(){return l(~this.low,~this.high,this.unsigned)},k.and=function(e){return r(e)||(e=p(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},k.or=function(e){return r(e)||(e=p(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},k.xor=function(e){return r(e)||(e=p(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},k.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<>>32-e,this.unsigned):l(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},k.shr=k.shiftRight,k.shiftRightUnsigned=function(e){if(r(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},k.shru=k.shiftRightUnsigned,k.shr_u=k.shiftRightUnsigned,k.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},k.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},k.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},k.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},k.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},1446:(e,t,n)=>{var r,o,i,s=n(2100),a=s.Reader,l=s.Writer,c=s.util,u=s.roots.default||(s.roots.default={});u.onnx=((i={}).Version=(r={},(o=Object.create(r))[r[0]="_START_VERSION"]=0,o[r[1]="IR_VERSION_2017_10_10"]=1,o[r[2]="IR_VERSION_2017_10_30"]=2,o[r[3]="IR_VERSION_2017_11_3"]=3,o[r[4]="IR_VERSION_2019_1_22"]=4,o[r[5]="IR_VERSION"]=5,o),i.AttributeProto=function(){function e(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.name=e.string();break;case 21:r.refAttrName=e.string();break;case 13:r.docString=e.string();break;case 20:r.type=e.int32();break;case 2:r.f=e.float();break;case 3:r.i=e.int64();break;case 4:r.s=e.bytes();break;case 5:r.t=u.onnx.TensorProto.decode(e,e.uint32());break;case 6:r.g=u.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos>>0,e.i.high>>>0).toNumber())),null!=e.s&&("string"==typeof e.s?c.base64.decode(e.s,t.s=c.newBuffer(c.base64.length(e.s)),0):e.s.length&&(t.s=e.s)),null!=e.t){if("object"!=typeof e.t)throw TypeError(".onnx.AttributeProto.t: object expected");t.t=u.onnx.TensorProto.fromObject(e.t)}if(null!=e.g){if("object"!=typeof e.g)throw TypeError(".onnx.AttributeProto.g: object expected");t.g=u.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");t.floats=[];for(var n=0;n>>0,e.ints[n].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(t.strings=[],n=0;n>>0,e.i.high>>>0).toNumber():e.i),null!=e.s&&e.hasOwnProperty("s")&&(n.s=t.bytes===String?c.base64.encode(e.s,0,e.s.length):t.bytes===Array?Array.prototype.slice.call(e.s):e.s),null!=e.t&&e.hasOwnProperty("t")&&(n.t=u.onnx.TensorProto.toObject(e.t,t)),null!=e.g&&e.hasOwnProperty("g")&&(n.g=u.onnx.GraphProto.toObject(e.g,t)),e.floats&&e.floats.length){n.floats=[];for(var o=0;o>>0,e.ints[o].high>>>0).toNumber():e.ints[o];if(e.strings&&e.strings.length)for(n.strings=[],o=0;o>>3){case 1:r.name=e.string();break;case 2:r.type=u.onnx.TypeProto.decode(e,e.uint32());break;case 3:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!c.isString(e.name))return"name: string expected";if(null!=e.type&&e.hasOwnProperty("type")){var t=u.onnx.TypeProto.verify(e.type);if(t)return"type."+t}return null!=e.docString&&e.hasOwnProperty("docString")&&!c.isString(e.docString)?"docString: string expected":null},e.fromObject=function(e){if(e instanceof u.onnx.ValueInfoProto)return e;var t=new u.onnx.ValueInfoProto;if(null!=e.name&&(t.name=String(e.name)),null!=e.type){if("object"!=typeof e.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");t.type=u.onnx.TypeProto.fromObject(e.type)}return null!=e.docString&&(t.docString=String(e.docString)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.type=null,n.docString=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.type&&e.hasOwnProperty("type")&&(n.type=u.onnx.TypeProto.toObject(e.type,t)),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),i.NodeProto=function(){function e(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(e.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(e.string());break;case 3:r.name=e.string();break;case 4:r.opType=e.string();break;case 7:r.domain=e.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(u.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:r.docString=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.input&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var t=0;t>>3){case 1:r.irVersion=e.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(u.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:r.producerName=e.string();break;case 3:r.producerVersion=e.string();break;case 4:r.domain=e.string();break;case 5:r.modelVersion=e.int64();break;case 6:r.docString=e.string();break;case 7:r.graph=u.onnx.GraphProto.decode(e,e.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(u.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.irVersion&&e.hasOwnProperty("irVersion")&&!(c.isInteger(e.irVersion)||e.irVersion&&c.isInteger(e.irVersion.low)&&c.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(null!=e.opsetImport&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var t=0;t>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");t.opsetImport=[];for(var n=0;n>>0,e.modelVersion.high>>>0).toNumber())),null!=e.docString&&(t.docString=String(e.docString)),null!=e.graph){if("object"!=typeof e.graph)throw TypeError(".onnx.ModelProto.graph: object expected");t.graph=u.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(t.metadataProps=[],n=0;n>>0,e.irVersion.high>>>0).toNumber():e.irVersion),null!=e.producerName&&e.hasOwnProperty("producerName")&&(n.producerName=e.producerName),null!=e.producerVersion&&e.hasOwnProperty("producerVersion")&&(n.producerVersion=e.producerVersion),null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.modelVersion&&e.hasOwnProperty("modelVersion")&&("number"==typeof e.modelVersion?n.modelVersion=t.longs===String?String(e.modelVersion):e.modelVersion:n.modelVersion=t.longs===String?c.Long.prototype.toString.call(e.modelVersion):t.longs===Number?new c.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),null!=e.graph&&e.hasOwnProperty("graph")&&(n.graph=u.onnx.GraphProto.toObject(e.graph,t)),e.opsetImport&&e.opsetImport.length){n.opsetImport=[];for(var o=0;o>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!c.isString(e.key)?"key: string expected":null!=e.value&&e.hasOwnProperty("value")&&!c.isString(e.value)?"value: string expected":null},e.fromObject=function(e){if(e instanceof u.onnx.StringStringEntryProto)return e;var t=new u.onnx.StringStringEntryProto;return null!=e.key&&(t.key=String(e.key)),null!=e.value&&(t.value=String(e.value)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.key="",n.value=""),null!=e.key&&e.hasOwnProperty("key")&&(n.key=e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=e.value),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),i.TensorAnnotation=function(){function e(e){if(this.quantParameterTensorNames=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.tensorName=e.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(u.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorName&&e.hasOwnProperty("tensorName")&&!c.isString(e.tensorName))return"tensorName: string expected";if(null!=e.quantParameterTensorNames&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var t=0;t>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(u.onnx.NodeProto.decode(e,e.uint32()));break;case 2:r.name=e.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(u.onnx.TensorProto.decode(e,e.uint32()));break;case 10:r.docString=e.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(u.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(u.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(u.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(u.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.node&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var t=0;t>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos>>0,e.dims[n].high>>>0).toNumber())}if(null!=e.dataType&&(t.dataType=0|e.dataType),null!=e.segment){if("object"!=typeof e.segment)throw TypeError(".onnx.TensorProto.segment: object expected");t.segment=u.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(t.floatData=[],n=0;n>>0,e.int64Data[n].high>>>0).toNumber())}if(null!=e.name&&(t.name=String(e.name)),null!=e.docString&&(t.docString=String(e.docString)),null!=e.rawData&&("string"==typeof e.rawData?c.base64.decode(e.rawData,t.rawData=c.newBuffer(c.base64.length(e.rawData)),0):e.rawData.length&&(t.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(t.externalData=[],n=0;n>>0,e.uint64Data[n].high>>>0).toNumber(!0))}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),t.defaults&&(n.dataType=0,n.segment=null,n.name="",t.bytes===String?n.rawData="":(n.rawData=[],t.bytes!==Array&&(n.rawData=c.newBuffer(n.rawData))),n.docString="",n.dataLocation=t.enums===String?"DEFAULT":0),e.dims&&e.dims.length){n.dims=[];for(var r=0;r>>0,e.dims[r].high>>>0).toNumber():e.dims[r]}if(null!=e.dataType&&e.hasOwnProperty("dataType")&&(n.dataType=e.dataType),null!=e.segment&&e.hasOwnProperty("segment")&&(n.segment=u.onnx.TensorProto.Segment.toObject(e.segment,t)),e.floatData&&e.floatData.length)for(n.floatData=[],r=0;r>>0,e.int64Data[r].high>>>0).toNumber():e.int64Data[r];if(null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.rawData&&e.hasOwnProperty("rawData")&&(n.rawData=t.bytes===String?c.base64.encode(e.rawData,0,e.rawData.length):t.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(n.doubleData=[],r=0;r>>0,e.uint64Data[r].high>>>0).toNumber(!0):e.uint64Data[r];if(null!=e.docString&&e.hasOwnProperty("docString")&&(n.docString=e.docString),e.externalData&&e.externalData.length)for(n.externalData=[],r=0;r>>3){case 1:r.begin=e.int64();break;case 2:r.end=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.begin&&e.hasOwnProperty("begin")&&!(c.isInteger(e.begin)||e.begin&&c.isInteger(e.begin.low)&&c.isInteger(e.begin.high))?"begin: integer|Long expected":null!=e.end&&e.hasOwnProperty("end")&&!(c.isInteger(e.end)||e.end&&c.isInteger(e.end.low)&&c.isInteger(e.end.high))?"end: integer|Long expected":null},e.fromObject=function(e){if(e instanceof u.onnx.TensorProto.Segment)return e;var t=new u.onnx.TensorProto.Segment;return null!=e.begin&&(c.Long?(t.begin=c.Long.fromValue(e.begin)).unsigned=!1:"string"==typeof e.begin?t.begin=parseInt(e.begin,10):"number"==typeof e.begin?t.begin=e.begin:"object"==typeof e.begin&&(t.begin=new c.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber())),null!=e.end&&(c.Long?(t.end=c.Long.fromValue(e.end)).unsigned=!1:"string"==typeof e.end?t.end=parseInt(e.end,10):"number"==typeof e.end?t.end=e.end:"object"==typeof e.end&&(t.end=new c.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.begin=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.begin=t.longs===String?"0":0;c.Long?(r=new c.Long(0,0,!1),n.end=t.longs===String?r.toString():t.longs===Number?r.toNumber():r):n.end=t.longs===String?"0":0}return null!=e.begin&&e.hasOwnProperty("begin")&&("number"==typeof e.begin?n.begin=t.longs===String?String(e.begin):e.begin:n.begin=t.longs===String?c.Long.prototype.toString.call(e.begin):t.longs===Number?new c.LongBits(e.begin.low>>>0,e.begin.high>>>0).toNumber():e.begin),null!=e.end&&e.hasOwnProperty("end")&&("number"==typeof e.end?n.end=t.longs===String?String(e.end):e.end:n.end=t.longs===String?c.Long.prototype.toString.call(e.end):t.longs===Number?new c.LongBits(e.end.low>>>0,e.end.high>>>0).toNumber():e.end),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e.DataLocation=function(){var e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="EXTERNAL"]=1,t}(),e}(),i.TensorShapeProto=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),n=0;n>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(u.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&o)}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.dim&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var t=0;t>>3){case 1:r.dimValue=e.int64();break;case 2:r.dimParam=e.string();break;case 3:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.dimValue&&e.hasOwnProperty("dimValue")&&(t.value=1,!(c.isInteger(e.dimValue)||e.dimValue&&c.isInteger(e.dimValue.low)&&c.isInteger(e.dimValue.high))))return"dimValue: integer|Long expected";if(null!=e.dimParam&&e.hasOwnProperty("dimParam")){if(1===t.value)return"value: multiple values";if(t.value=1,!c.isString(e.dimParam))return"dimParam: string expected"}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!c.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof u.onnx.TensorShapeProto.Dimension)return e;var t=new u.onnx.TensorShapeProto.Dimension;return null!=e.dimValue&&(c.Long?(t.dimValue=c.Long.fromValue(e.dimValue)).unsigned=!1:"string"==typeof e.dimValue?t.dimValue=parseInt(e.dimValue,10):"number"==typeof e.dimValue?t.dimValue=e.dimValue:"object"==typeof e.dimValue&&(t.dimValue=new c.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber())),null!=e.dimParam&&(t.dimParam=String(e.dimParam)),null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.dimValue&&e.hasOwnProperty("dimValue")&&("number"==typeof e.dimValue?n.dimValue=t.longs===String?String(e.dimValue):e.dimValue:n.dimValue=t.longs===String?c.Long.prototype.toString.call(e.dimValue):t.longs===Number?new c.LongBits(e.dimValue.low>>>0,e.dimValue.high>>>0).toNumber():e.dimValue,t.oneofs&&(n.value="dimValue")),null!=e.dimParam&&e.hasOwnProperty("dimParam")&&(n.dimParam=e.dimParam,t.oneofs&&(n.value="dimParam")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e}(),i.TypeProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.tensorType=u.onnx.TypeProto.Tensor.decode(e,e.uint32());break;case 6:r.denotation=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tensorType&&e.hasOwnProperty("tensorType")){var t=u.onnx.TypeProto.Tensor.verify(e.tensorType);if(t)return"tensorType."+t}return null!=e.denotation&&e.hasOwnProperty("denotation")&&!c.isString(e.denotation)?"denotation: string expected":null},e.fromObject=function(e){if(e instanceof u.onnx.TypeProto)return e;var t=new u.onnx.TypeProto;if(null!=e.tensorType){if("object"!=typeof e.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");t.tensorType=u.onnx.TypeProto.Tensor.fromObject(e.tensorType)}return null!=e.denotation&&(t.denotation=String(e.denotation)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.denotation=""),null!=e.tensorType&&e.hasOwnProperty("tensorType")&&(n.tensorType=u.onnx.TypeProto.Tensor.toObject(e.tensorType,t),t.oneofs&&(n.value="tensorType")),null!=e.denotation&&e.hasOwnProperty("denotation")&&(n.denotation=e.denotation),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e.Tensor=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.elemType=e.int32();break;case 2:r.shape=u.onnx.TensorShapeProto.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.elemType&&e.hasOwnProperty("elemType")&&!c.isInteger(e.elemType))return"elemType: integer expected";if(null!=e.shape&&e.hasOwnProperty("shape")){var t=u.onnx.TensorShapeProto.verify(e.shape);if(t)return"shape."+t}return null},e.fromObject=function(e){if(e instanceof u.onnx.TypeProto.Tensor)return e;var t=new u.onnx.TypeProto.Tensor;if(null!=e.elemType&&(t.elemType=0|e.elemType),null!=e.shape){if("object"!=typeof e.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");t.shape=u.onnx.TensorShapeProto.fromObject(e.shape)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.elemType=0,n.shape=null),null!=e.elemType&&e.hasOwnProperty("elemType")&&(n.elemType=e.elemType),null!=e.shape&&e.hasOwnProperty("shape")&&(n.shape=u.onnx.TensorShapeProto.toObject(e.shape,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),e}(),i.OperatorSetIdProto=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.domain=e.string();break;case 2:r.version=e.int64();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.domain&&e.hasOwnProperty("domain")&&!c.isString(e.domain)?"domain: string expected":null!=e.version&&e.hasOwnProperty("version")&&!(c.isInteger(e.version)||e.version&&c.isInteger(e.version.low)&&c.isInteger(e.version.high))?"version: integer|Long expected":null},e.fromObject=function(e){if(e instanceof u.onnx.OperatorSetIdProto)return e;var t=new u.onnx.OperatorSetIdProto;return null!=e.domain&&(t.domain=String(e.domain)),null!=e.version&&(c.Long?(t.version=c.Long.fromValue(e.version)).unsigned=!1:"string"==typeof e.version?t.version=parseInt(e.version,10):"number"==typeof e.version?t.version=e.version:"object"==typeof e.version&&(t.version=new c.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),t},e.toObject=function(e,t){t||(t={});var n={};if(t.defaults)if(n.domain="",c.Long){var r=new c.Long(0,0,!1);n.version=t.longs===String?r.toString():t.longs===Number?r.toNumber():r}else n.version=t.longs===String?"0":0;return null!=e.domain&&e.hasOwnProperty("domain")&&(n.domain=e.domain),null!=e.version&&e.hasOwnProperty("version")&&("number"==typeof e.version?n.version=t.longs===String?String(e.version):e.version:n.version=t.longs===String?c.Long.prototype.toString.call(e.version):t.longs===Number?new c.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),i),e.exports=u},2100:(e,t,n)=>{e.exports=n(9482)},9482:(e,t,n)=>{var r=t;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=o,o()},1408:(e,t,n)=>{e.exports=l;var r,o=n(9693),i=o.LongBits,s=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},p=function(){return o.Buffer?function(e){return(l.create=function(e){return o.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function d(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function _(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw a(this,8);return new i(_(this.buf,this.pos+=4),_(this.buf,this.pos+=4))}l.create=p(),l.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return _(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|_(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=p(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},593:(e,t,n)=>{e.exports=i;var r=n(1408);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(9693);function i(e){r.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},5054:e=>{e.exports={}},5994:(e,t,n)=>{t.Service=n(7948)},7948:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,n,o,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return r.asPromise(e,a,t,n,o,i);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,n){if(e)return a.emit("error",e,t),s(e);if(null!==n){if(!(n instanceof o))try{n=o[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",n,t),s(null,n)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(e,t,n)=>{e.exports=o;var r=n(9693);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(r.isString(e)){if(!r.Long)return o.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;o.fromHash=function(e){return e===s?i:new o((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},o.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},o.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},9693:function(e,t,n){var r=t;function o(e,t,n){for(var r=Object.keys(t),o=0;o0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n{e.exports=p;var r,o=n(9693),i=o.LongBits,s=o.base64,a=o.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var d=function(){return o.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function _(e,t,n){t[n]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function f(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function m(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}p.create=d(),p.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(p.alloc=o.pool(p.alloc,o.Array.prototype.subarray)),p.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},h.prototype=Object.create(l.prototype),h.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(f,10,i.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=i.from(e);return this._push(f,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(f,t.length(),t)},p.prototype.bool=function(e){return this._push(_,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=i.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r>>0;if(!t)return this._push(_,1,0);if(o.isString(e)){var n=p.alloc(t=s.length(e));s.decode(e,n,0),e=n}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(_,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},p._configure=function(e){r=e,p.create=d(),r._configure()}},3155:(e,t,n)=>{e.exports=i;var r=n(1173);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(9693);function i(){r.call(this)}function s(e,t,n){e.length<40?o.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},i._configure()},7714:(e,t,n)=>{t.R=void 0;const r=n(6919),o=n(7448);t.R=new class{async init(){}async createSessionHandler(e,t){const n=new r.Session(t);return await n.loadModel(e),new o.OnnxjsSessionHandler(n)}}},4200:(e,t,n)=>{t.c8=t.rX=void 0;const r=n(1670),o=n(5381),i=n(2157),s=n(2306);t.rX=()=>{if(("number"!=typeof r.env.wasm.initTimeout||r.env.wasm.initTimeout<0)&&(r.env.wasm.initTimeout=0),"boolean"!=typeof r.env.wasm.simd&&(r.env.wasm.simd=!0),"boolean"!=typeof r.env.wasm.proxy&&(r.env.wasm.proxy=!1),"number"!=typeof r.env.wasm.numThreads||!Number.isInteger(r.env.wasm.numThreads)||r.env.wasm.numThreads<=0){const e="undefined"==typeof navigator?(0,o.cpus)().length:navigator.hardwareConcurrency;r.env.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},t.c8=new class{async init(){(0,t.rX)(),await(0,i.initWasm)()}async createSessionHandler(e,t){const n=new s.OnnxruntimeWebAssemblySessionHandler;return await n.loadModel(e,t),Promise.resolve(n)}}},6018:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(1670),t);const i=n(1670);{const e=n(7714).R;(0,i.registerBackend)("webgl",e,-10)}{const e=n(4200).c8;(0,i.registerBackend)("cpu",e,10),(0,i.registerBackend)("wasm",e,10),(0,i.registerBackend)("xnnpack",e,9)}},246:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createAttributeWithCacheKey=void 0;class n{constructor(e){Object.assign(this,e)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map((e=>`${this[e]}`)).join(";")),this._cacheKey}}t.createAttributeWithCacheKey=e=>new n(e)},7778:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Attribute=void 0;const r=n(1446),o=n(9395),i=n(9162),s=n(2517);var a=o.onnxruntime.experimental.fbs;class l{constructor(e){if(this._attributes=new Map,null!=e){for(const t of e)t instanceof r.onnx.AttributeProto?this._attributes.set(t.name,[l.getValue(t),l.getType(t)]):t instanceof a.Attribute&&this._attributes.set(t.name(),[l.getValue(t),l.getType(t)]);if(this._attributes.sizei.Tensor.fromProto(e)));if(e instanceof a.Attribute)return n.map((e=>i.Tensor.fromOrtTensor(e)))}if(t===r.onnx.AttributeProto.AttributeType.STRING&&e instanceof r.onnx.AttributeProto){const e=n;return(0,s.decodeUtf8String)(e)}return t===r.onnx.AttributeProto.AttributeType.STRINGS&&e instanceof r.onnx.AttributeProto?n.map(s.decodeUtf8String):n}static getValueNoCheck(e){return e instanceof r.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(e):this.getValueNoCheckFromOrtFormat(e)}static getValueNoCheckFromOnnxFormat(e){switch(e.type){case r.onnx.AttributeProto.AttributeType.FLOAT:return e.f;case r.onnx.AttributeProto.AttributeType.INT:return e.i;case r.onnx.AttributeProto.AttributeType.STRING:return e.s;case r.onnx.AttributeProto.AttributeType.TENSOR:return e.t;case r.onnx.AttributeProto.AttributeType.GRAPH:return e.g;case r.onnx.AttributeProto.AttributeType.FLOATS:return e.floats;case r.onnx.AttributeProto.AttributeType.INTS:return e.ints;case r.onnx.AttributeProto.AttributeType.STRINGS:return e.strings;case r.onnx.AttributeProto.AttributeType.TENSORS:return e.tensors;case r.onnx.AttributeProto.AttributeType.GRAPHS:return e.graphs;default:throw new Error(`unsupported attribute type: ${r.onnx.AttributeProto.AttributeType[e.type]}`)}}static getValueNoCheckFromOrtFormat(e){switch(e.type()){case a.AttributeType.FLOAT:return e.f();case a.AttributeType.INT:return e.i();case a.AttributeType.STRING:return e.s();case a.AttributeType.TENSOR:return e.t();case a.AttributeType.GRAPH:return e.g();case a.AttributeType.FLOATS:return e.floatsArray();case a.AttributeType.INTS:{const t=[];for(let n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveBackend=t.backend=void 0;const r=n(5038),o=new Map;async function i(e){const n=t.backend;if(void 0!==n[e]&&function(e){const t=e;return"initialize"in t&&"function"==typeof t.initialize&&"createSessionHandler"in t&&"function"==typeof t.createSessionHandler&&"dispose"in t&&"function"==typeof t.dispose}(n[e])){const t=n[e];let r=t.initialize();if("object"==typeof r&&"then"in r&&(r=await r),r)return o.set(e,t),t}}t.backend={webgl:new r.WebGLBackend},t.resolveBackend=async function e(t){if(!t)return e(["webgl"]);{const e="string"==typeof t?[t]:t;for(const t of e){const e=o.get(t);if(e)return e;const n=await i(t);if(n)return n}}throw new Error("no available backend to use")}},5038:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLBackend=void 0;const r=n(1670),o=n(6231),i=n(6416),s=n(7305);t.WebGLBackend=class{get contextId(){return r.env.webgl.contextId}set contextId(e){r.env.webgl.contextId=e}get matmulMaxBatchSize(){return r.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(e){r.env.webgl.matmulMaxBatchSize=e}get textureCacheMode(){return r.env.webgl.textureCacheMode}set textureCacheMode(e){r.env.webgl.textureCacheMode=e}get pack(){return r.env.webgl.pack}set pack(e){r.env.webgl.pack=e}get async(){return r.env.webgl.async}set async(e){r.env.webgl.async=e}initialize(){try{return this.glContext=(0,s.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),o.Logger.setWithEnv(r.env),o.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(e){return o.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${e}`),!1}}createSessionHandler(e){return new i.WebGLSessionHandler(this,e)}dispose(){this.glContext.dispose()}}},5107:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoordsGlslLib=void 0;const r=n(2517),o=n(8520),i=n(5060),s=n(7859),a=n(9390);class l extends o.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new o.GlslLibRoutine("\n vec2 offsetToCoords(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n ")}}coordsToOffset(){return{coordsToOffset:new o.GlslLibRoutine("\n int coordsToOffset(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n ")}}getOutputSamplingSnippet(){const e=this.context.outputTextureLayout;return e.isPacked?this.getPackedOutputSamplingSnippet(e):this.getUnpackedOutputSamplingSnippet(e)}getPackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},s="getOutputCoords";switch(t.length){case 0:r[s]=this.getOutputScalarCoords();break;case 1:r[s]=this.getOutputPacked1DCoords(t,n);break;case 2:r[s]=this.getOutputPacked2DCoords(t,n);break;case 3:r[s]=this.getOutputPacked3DCoords(t,n);break;default:r[s]=this.getOutputPackedNDCoords(t,n)}const a=`\n void setOutput(vec4 val) {\n ${(0,i.getGlsl)(this.context.glContext.version).output} = val;\n }\n `;return r.floatTextureSetRGBA=new o.GlslLibRoutine(a),r}getUnpackedOutputSamplingSnippet(e){const t=e.unpackedShape,n=[e.width,e.height],r={},s="getOutputCoords";switch(t.length){case 0:r[s]=this.getOutputScalarCoords();break;case 1:r[s]=this.getOutputUnpacked1DCoords(t,n);break;case 2:r[s]=this.getOutputUnpacked2DCoords(t,n);break;case 3:r[s]=this.getOutputUnpacked3DCoords(t,n);break;case 4:r[s]=this.getOutputUnpacked4DCoords(t,n);break;case 5:r[s]=this.getOutputUnpacked5DCoords(t,n);break;case 6:r[s]=this.getOutputUnpacked6DCoords(t,n);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const a=`\n void setOutput(float val) {\n ${(0,i.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0);\n }\n `;return r.floatTextureSetR=new o.GlslLibRoutine(a),r}getOutputScalarCoords(){return new o.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")}getOutputPacked1DCoords(e,t){const n=t;let r="";return 1===n[0]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ${n[1]}.0);\n }\n `,new o.GlslLibRoutine(r)):1===n[1]?(r=`\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ${n[0]}.0);\n }\n `,new o.GlslLibRoutine(r)):(r=`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n return 2 * (resTexRC.y * ${n[0]} + resTexRC.x);\n }\n `,new o.GlslLibRoutine(r))}getOutputPacked2DCoords(e,t){let n="";if(r.ArrayUtil.arraysEqual(e,t))return n=`\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]}));\n }\n `,new o.GlslLibRoutine(n);const i=t,s=Math.ceil(e[1]/2);return n=`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${i[0]}, ${i[1]}));\n\n int index = resTexRC.y * ${i[0]} + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ${s}) * 2;\n int c = 2 * (index / ${s});\n\n return ivec2(r, c);\n }\n `,new o.GlslLibRoutine(n)}getOutputPacked3DCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[2]/2),i=r*Math.ceil(e[1]/2),s=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${n[0]}, ${n[1]}));\n int index = resTexRC.y * ${n[0]} + resTexRC.x;\n\n int b = index / ${i};\n index -= b * ${i};\n\n // reverse r and c order for packed texture\n int r = imod(index, ${r}) * 2;\n int c = 2 * (index / ${r});\n\n return ivec3(b, r, c);\n }\n `;return new o.GlslLibRoutine(s)}getOutputPackedNDCoords(e,t){const n=[t[0],t[1]],r=Math.ceil(e[e.length-1]/2),i=r*Math.ceil(e[e.length-2]/2);let s=i,a="",l="b, r, c";for(let t=2;t=0;--t)i[t]=i[t+1]*e[t+1];const s=["r","c","d"],a=i.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===i.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec3(r, c, d);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked4DCoords(e,t){let n="";const r=e.length;let i=null;r<2&&(i=[]),i=new Array(r-1),i[r-2]=e[r-1];for(let t=r-3;t>=0;--t)i[t]=i[t+1]*e[t+1];const s=["r","c","d","d2"],a=i.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===i.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec4(r, c, d, d2);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked5DCoords(e,t){let n="";const r=e.length;let i=null;r<2&&(i=[]),i=new Array(r-1),i[r-2]=e[r-1];for(let t=r-3;t>=0;--t)i[t]=i[t+1]*e[t+1];const s=["r","c","d","d2","d3"],a=i.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===i.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec5(r, c, d, d2, d3);\n }\n `,new o.GlslLibRoutine(n)}getOutputUnpacked6DCoords(e,t){let n="";const r=e.length;let i=null;r<2&&(i=[]),i=new Array(r-1),i[r-2]=e[r-1];for(let t=r-3;t>=0;--t)i[t]=i[t+1]*e[t+1];const s=["r","c","d","d2","d3","d4"],a=i.map(((e,t)=>`int ${s[t]} = index / ${e}; ${t===i.length-1?`int ${s[t+1]} = index - ${s[t]} * ${e}`:`index -= ${s[t]} * ${e}`};`)).join("");return n=`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.y * ${t[0]} + resTexRC.x;\n ${a}\n return ivec6(r, c, d, d2, d3, d4);\n }\n `,new o.GlslLibRoutine(n)}getCommonUtilFuncs(){const e={};let t="uvFromFlat";e[t]=new o.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),t="packedUVfrom1D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="packedUVfrom2D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="packedUVfrom3D",e[t]=new o.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t="sampleTexture";const n=(0,i.getGlsl)(this.context.glContext.version);return e[t]=new o.GlslLibRoutine(`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${n.texture2D}(textureSampler, uv).r;\n }`),e}getInputsSamplingSnippets(){const e={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach(((n,r)=>{const o=this.context.inputTextureLayouts[r],i=(0,a.generateShaderFuncNameFromInputSamplerName)(n);o.isPacked?e[i]=this.getPackedSamplerFromInput(i,n,o):e[i]=this.getUnpackedSamplerFromInput(i,n,o);const s=(0,a.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(n);o.unpackedShape.length<=t.unpackedShape.length&&(o.isPacked?e[s]=this.getPackedSamplerAtOutputCoords(s,o,t,n):e[s]=this.getUnpackedSamplerAtOutputCoords(s,o,t,n))})),e}getPackedSamplerAtOutputCoords(e,t,n,i){const s=t.unpackedShape,l=n.unpackedShape,c=i,u=(0,a.generateShaderFuncNameFromInputSamplerName)(c),p=s.length,d=l.length,_=r.BroadcastUtil.getBroadcastDims(s,l),h=(0,a.getCoordsDataType)(d),f=d-p;let m;const g=(0,a.getGlChannels)();m=0===p?"":d<2&&_.length>=1?"coords = 0;":_.map((e=>`coords.${g[e+f]} = 0;`)).join("\n");let b="";b=d<2&&p>0?"coords":s.map(((e,t)=>`coords.${g[t+f]}`)).join(", ");let w="return outputValue;";const x=1===r.ShapeUtil.size(s),y=1===r.ShapeUtil.size(l);if(1!==p||x||y){if(x&&!y)w=1===d?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(_.length){const e=p-2,t=p-1;_.indexOf(e)>-1&&_.indexOf(t)>-1?w="return vec4(outputValue.x);":_.indexOf(e)>-1?w="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":_.indexOf(t)>-1&&(w="return vec4(outputValue.xx, outputValue.zz);")}}else w="\n return vec4(outputValue.xy, outputValue.xy);\n ";const T=`\n vec4 ${e}() {\n ${h} coords = getOutputCoords();\n \n int lastDim = coords.${g[d-1]};\n coords.${g[d-1]} = coords.${g[d-2]};\n coords.${g[d-2]} = lastDim;\n \n ${m}\n vec4 outputValue = ${u}(${b});\n ${w}\n }\n `;return new o.GlslLibRoutine(T,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(e,t,n,i){const s=[n.width,n.height],l=[t.width,t.height],c=t.unpackedShape.length,u=n.unpackedShape.length,p=t.unpackedShape,d=n.unpackedShape,_=(0,a.generateShaderFuncNameFromInputSamplerName)(i);if(c===u&&r.ArrayUtil.arraysEqual(l,s)){const t=`\n float ${e}() {\n return sampleTexture(${i}, TexCoords);\n }\n `;return new o.GlslLibRoutine(t,["coordinates.sampleTexture"])}const h=(0,a.getCoordsDataType)(u),f=r.BroadcastUtil.getBroadcastDims(p,d),m=u-c;let g;const b=(0,a.getGlChannels)();g=0===c?"":u<2&&f.length>=1?"coords = 0;":f.map((e=>`coords.${b[e+m]} = 0;`)).join("\n");let w="";w=u<2&&c>0?"coords":t.unpackedShape.map(((e,t)=>`coords.${b[t+m]}`)).join(", ");const x=`\n float ${e}() {\n ${h} coords = getOutputCoords();\n ${g}\n return ${_}(${w});\n }\n `;return new o.GlslLibRoutine(x,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(e,t,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(e,t);case 1:return this.getPackedSampler1D(e,t,n);case 2:return this.getPackedSampler2D(e,t,n);case 3:return this.getPackedSampler3D(e,t,n);default:return this.getPackedSamplerND(e,t,n)}}getUnpackedSamplerFromInput(e,t,n){const r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(e,t,n);case 1:return this.getUnpackedSampler1D(e,t,n);case 2:return this.getUnpackedSampler2D(e,t,n);case 3:return this.getUnpackedSampler3D(e,t,n);case 4:return this.getUnpackedSampler4D(e,t,n);case 5:return this.getUnpackedSampler5D(e,t,n);case 6:return this.getUnpackedSampler6D(e,t,n);default:throw new Error(`Unsupported dimension ${r.length}-D`)}}getPackedSamplerScalar(e,t){const n=`\n vec4 ${e}() {\n return ${(0,i.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR);\n }\n `;return new o.GlslLibRoutine(n)}getPackedSampler1D(e,t,n){const r=[n.width,n.height],s=[r[1],r[0]],a=(0,i.getGlsl)(this.context.glContext.version),l=`vec4 ${e}(int index) {\n vec2 uv = packedUVfrom1D(\n ${s[0]}, ${s[1]}, index);\n return ${a.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(l,["coordinates.packedUVfrom1D"])}getPackedSampler2D(e,t,n){const s=n.unpackedShape,a=[n.width,n.height],l=(0,i.getGlsl)(this.context.glContext.version),c=a[0],u=a[1];if(null!=a&&r.ArrayUtil.arraysEqual(s,a)){const n=`vec4 ${e}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${u}.0, ${c}.0);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(n)}const p=a,d=Math.ceil(s[1]/2),_=`vec4 ${e}(int row, int col) {\n vec2 uv = packedUVfrom2D(${p[1]}, ${p[0]}, ${d}, row, col);\n return ${l.texture2D}(${t}, uv);\n }`;return new o.GlslLibRoutine(_,["coordinates.packedUVfrom2D"])}getPackedSampler3D(e,t,n){const r=n.unpackedShape,s=[n.width,n.height],l=[s[0],s[1]],c=(0,i.getGlsl)(this.context.glContext.version);if(1===r[0]){const i=r.slice(1),s=[1,2],l=(0,a.squeezeInputShape)(r,i),c=["b","row","col"],u=JSON.parse(JSON.stringify(n));u.unpackedShape=l;const p=this.getPackedSamplerFromInput(e,t,u),d=`${p.routineBody}\n vec4 ${e}(int b, int row, int col) {\n return ${e}(${(0,a.getSqueezedParams)(c,s)});\n } `;return new o.GlslLibRoutine(d,p.dependencies)}const u=l[0],p=l[1],d=Math.ceil(r[2]/2),_=`vec4 ${e}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${p}, ${u}, ${d*Math.ceil(r[1]/2)}, ${d}, b, row, col);\n return ${c.texture2D}(${t}, uv);}`;return new o.GlslLibRoutine(_,["coordinates.packedUVfrom3D"])}getPackedSamplerND(e,t,n){const r=n.unpackedShape,s=r.length,a=[n.width,n.height],l=(0,i.getGlsl)(this.context.glContext.version),c=[a[0],a[1]],u=c[1],p=c[0],d=Math.ceil(r[s-1]/2);let _=d*Math.ceil(r[s-2]/2),h="int b, int row, int col",f=`b * ${_} + (row / 2) * ${d} + (col / 2)`;for(let e=2;e{const r=this.context.inputTextureLayouts[n],i=(r.unpackedShape.length>0?r.unpackedShape:r.shape).length;let s=`_${t}`;e[s]=new o.GlslLibRoutine(this.getValueFromSingle(t,i,r.width,r.height,!1),[`shapeUtils.indicesToOffset${s}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),s+="_T",e[s]=new o.GlslLibRoutine(this.getValueFromSingle(t,i,r.width,r.height,!0),[`shapeUtils.indicesToOffset${s}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])})),e}getValueFromSingle(e,t,n,r,o){let s=`_${e}`;return o&&(s+="_T"),`\n float ${s}(int m[${t}]) {\n int offset = indicesToOffset${s}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n float value = getColorAsFloat(${(0,i.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords));\n return value;\n }\n `}getPackedValueFrom(e,t,n,r,o){let s=`_${e}_Pack`;return o&&(s+="_T"),`\n vec4 ${s}(int m[${t}]) {\n int offset = indicesToOffset_${e}(m);\n vec2 coords = offsetToCoords(offset, ${n}, ${r});\n return ${(0,i.getGlsl)(this.context.glContext.version).texture2D}(${e}, coords);\n }\n `}}t.CoordsGlslLib=l},8520:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TopologicalSortGlslRoutines=t.GlslLibRoutineNode=t.GlslLibRoutine=t.GlslLib=t.GlslContext=t.FunctionType=void 0,(n=t.FunctionType||(t.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional",t.GlslContext=class{constructor(e,t,n,r){this.glContext=e,this.programInfo=t,this.inputTextureLayouts=n,this.outputTextureLayout=r}},t.GlslLib=class{constructor(e){this.context=e}},t.GlslLibRoutine=class{constructor(e,t){this.routineBody=e,this.dependencies=t}},t.GlslLibRoutineNode=class{constructor(e,t,n){this.name=e,this.dependencies=n||[],t&&(this.routineBody=t)}addDependency(e){e&&this.dependencies.push(e)}},t.TopologicalSortGlslRoutines=class{static returnOrderedNodes(e){if(!e||0===e.length)return[];if(1===e.length)return e;const t=new Set,n=new Set,r=new Array;return this.createOrderedNodes(e,t,n,r),r}static createOrderedNodes(e,t,n,r){for(let o=0;o0)for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.EncodingGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new r.GlslLibRoutine("highp vec4 encode(highp float f) {\n return vec4(f, 0.0, 0.0, 0.0);\n }\n ")}}decodeFloat32(){return{decode:new r.GlslLibRoutine("highp float decode(highp vec4 rgba) {\n return rgba.r;\n }\n ")}}encodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new r.GlslLibRoutine(`\n highp vec4 encode(highp float f) {\n highp float F = abs(f);\n highp float Sign = step(0.0,-f);\n highp float Exponent = floor(log2(F));\n highp float Mantissa = (exp2(- Exponent) * F);\n Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa));\n highp vec4 rgba;\n rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0));\n rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0);\n rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0)));\n rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0)));\n ${e}\n rgba = rgba / 255.0; // values need to be normalized to [0,1]\n return rgba;\n }\n `)}}decodeUint8(){const e=o.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new r.GlslLibRoutine(`\n highp float decode(highp vec4 rgba) {\n rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255]\n ${e}\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n `)}}static isLittleEndian(){const e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);if(t[0]=3735928559,239===n[0])return!0;if(222===n[0])return!1;throw new Error("unknown endianness")}}t.EncodingGlslLib=o},9894:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FragColorGlslLib=void 0;const r=n(8520),o=n(5060);class i extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const e=(0,o.getGlsl)(this.context.glContext.version);return{setFragColor:new r.GlslLibRoutine(`\n void setFragColor(float value) {\n ${e.output} = encode(value);\n }\n `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new r.GlslLibRoutine("\n float getColorAsFloat(vec4 color) {\n return decode(color);\n }\n ",["encoding.decode"])}}}t.FragColorGlslLib=i},2848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.replaceInlines=void 0;const n=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;t.replaceInlines=function(e){const t={};let r;for(;null!==(r=n.exec(e));){const e=r[3].split(",").map((e=>{const t=e.trim().split(" ");return t&&2===t.length?{type:t[0],name:t[1]}:null})).filter((e=>null!==e));t[r[2]]={params:e,body:r[4]}}for(const n in t){const o="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",n),i=new RegExp(o,"gm");for(;null!==(r=i.exec(e));){const o=r[1],i=r[2],s=r[3].split(","),a=o?`${o} ${i};`:"";let l=t[n].body,c="";t[n].params.forEach(((e,t)=>{e&&(c+=`${e.type} ${e.name} = ${s[t]};\n`)})),l=`${c}\n ${l}`,l=l.replace("return",`${i} = `);const u=`\n ${a}\n {\n ${l}\n }\n `;e=e.replace(r[0],u)}}return e.replace(n,"")}},8879:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlslPreprocessor=void 0;const r=n(8520),o=n(2848),i=n(5483),s=n(5060);t.GlslPreprocessor=class{constructor(e,t,n,o){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new r.GlslContext(e,t,n,o),Object.keys(i.glslRegistry).forEach((e=>{const t=new i.glslRegistry[e](this.context);this.libs[e]=t}));const s=this.glslLibRoutineDependencyGraph;for(const e in this.libs){const t=this.libs[e].getFunctions();for(const n in t){const o=e+"."+n;let i;s[o]?(i=s[o],i.routineBody=t[n].routineBody):(i=new r.GlslLibRoutineNode(o,t[n].routineBody),s[o]=i);const a=t[n].dependencies;if(a)for(let e=0;e{const r=n.split(".")[1];-1!==e.indexOf(r)&&t.push(this.glslLibRoutineDependencyGraph[n])})),r.TopologicalSortGlslRoutines.returnOrderedNodes(t)}getUniforms(e,t){const n=[];if(e)for(const t of e)n.push(`uniform sampler2D ${t};`);if(t)for(const e of t)n.push(`uniform ${e.type} ${e.name}${e.arrayLength?`[${e.arrayLength}]`:""};`);return n.join("\n")}}},5483:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.glslRegistry=void 0;const r=n(5107),o=n(7341),i=n(9894),s=n(2655),a=n(3891);t.glslRegistry={encoding:o.EncodingGlslLib,fragcolor:i.FragColorGlslLib,vec:a.VecGlslLib,shapeUtils:s.ShapeUtilsGlslLib,coordinates:r.CoordsGlslLib}},2655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShapeUtilsGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const e=this.context.outputTextureLayout.shape.length,t={};return this.context.programInfo.inputNames.forEach(((n,o)=>{const i=this.context.inputTextureLayouts[o].unpackedShape;if(i.length<=e){const o=i.length,s=e-o,a=`bcastIndices_${n}`;let l="";for(let e=0;e{const i=this.context.inputTextureLayouts[o].shape;if(!(i.length<2||i.length>e)){const o=i.length,s=e-o,a=`bcastMatmulIndices_${n}`;let l="";for(let e=0;e{const i=this.context.inputTextureLayouts[n].shape,s=this.context.inputTextureLayouts[n].strides,a=i.length;let l=`indicesToOffset_${t}`;e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,a,s)),l=`indicesToOffset_${t}_T`,e[l]=new r.GlslLibRoutine(o.indexToOffsetSingle(l,a,s.slice().reverse()))})),e}static indexToOffsetSingle(e,t,n){let r="";for(let e=t-1;e>=0;--e)r+=`\n offset += indices[${e}] * ${n[e]};\n `;return`\n int ${e}(int indices[${t}]) {\n int offset = 0;\n ${r}\n return offset;\n }\n `}offsetToIndices(){const e={};return this.context.programInfo.inputNames.forEach(((t,n)=>{const i=this.context.inputTextureLayouts[n].shape,s=this.context.inputTextureLayouts[n].strides,a=i.length;let l=`offsetToIndices_${t}`;e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,a,s)),l=`offsetToIndices_${t}_T`,e[l]=new r.GlslLibRoutine(o.offsetToIndicesSingle(l,a,s.slice().reverse()))})),e}static offsetToIndicesSingle(e,t,n){const r=[];for(let e=0;e{const o=this.context.inputTextureLayouts[n].shape,i=o.length,s=`incrementIndices_${t}`;let a="";for(let e=0;e= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n `;e[s]=new r.GlslLibRoutine(l)})),e}}t.ShapeUtilsGlslLib=o},5060:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultFragShaderMain=t.getFragShaderPreamble=t.getVertexShaderSource=t.getGlsl=void 0;const n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function o(e){return 1===e?n:r}t.getGlsl=o,t.getVertexShaderSource=function(e){const t=o(e);return`${t.version}\n precision highp float;\n ${t.attribute} vec3 position;\n ${t.attribute} vec2 textureCoord;\n\n ${t.varyingVertex} vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }`},t.getFragShaderPreamble=function(e){const t=o(e);return`${t.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${t.varyingFrag} vec2 TexCoords;\n ${t.outputDeclaration}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n `},t.getDefaultFragShaderMain=function(e,t){return`\n void main() {\n int indices[${t}];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ${o(e).output} = result;\n }\n `}},3891:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VecGlslLib=void 0;const r=n(8520);class o extends r.GlslLib{constructor(e){super(e)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const e=this.context.outputTextureLayout.shape.length,t={add:"+=",sub:"-=",mul:"*=",div:"/="},n={};for(const o in t){const i=`${o}Vec`;let s="";for(let n=0;n{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLInferenceHandler=void 0;const r=n(6231),o=n(9162),i=n(2517),s=n(2403),a=n(7019),l=n(8710),c=n(5611),u=n(4057),p=n(2039);t.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,t){return(0,u.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,t)}executeProgram(e,t){if(t.length{const n=t.map((e=>`${e.unpackedShape.join(",")};${e.width}x${e.height}`)).join("_");let r=e.name;return e.cacheHint&&(r+="["+e.cacheHint+"]"),r+=":"+n,r})(e,n);let o=this.session.programManager.getArtifact(r);const i=o?o.programInfo:"function"==typeof e.get?e.get():e,s=(0,u.createTextureLayoutFromTextureType)(this.session.layoutStrategy,i.output.dims,i.output.textureType),a=this.createTextureData(s,i.output.type);return o||(o=this.session.programManager.build(i,n,a),this.session.programManager.setArtifact(r,o)),this.runProgram(o,n,a),a}run(e,t){return this.executeProgram(e,t).tensor}runProgram(e,t,n){for(let n=0;nthis.readTexture(s)),(async e=>this.readTextureAsync(s)),void 0,i),texture:n});return this.setTextureData(s.tensor.dataId,s,e.isPacked),s}getTextureData(e,t=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,t):t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){this.session.isInitializer(e)?this.session.setTextureData(e,t,n):(n?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,t)}isTextureLayoutCached(e,t=!1){return!!this.getTextureData(e.dataId,t)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((e=>this.session.textureManager.releaseTexture(e))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((e=>this.session.textureManager.releaseTexture(e))),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,l.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,s.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,c.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},1640:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WEBGL_OP_RESOLVE_RULES=void 0;const s=n(2898),a=i(n(7839)),l=n(4196),c=n(2069),u=n(8138),p=n(9663),d=n(5193),_=n(7992),h=n(1253),f=n(4776),m=n(6572),g=n(3346),b=n(5623),w=n(2870),x=n(2143),y=n(4939),T=n(718),v=n(2268),k=n(8117),M=n(2278),S=n(5524),P=n(5975),A=n(3933),F=n(6558),C=n(5723),E=n(3738),O=i(n(4909)),I=n(8428),D=n(9793);t.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",O.abs],["Acos","","7+",O.acos],["Add","","7+",a.add],["And","","7+",a.and],["Asin","","7+",O.asin],["Atan","","7+",O.atan],["AveragePool","","7+",x.averagePool,x.parseAveragePoolAttributes],["BatchNormalization","","7+",s.batchNormalization,s.parseBatchNormalizationAttributes],["Cast","","6+",l.cast,l.parseCastAttributes],["Ceil","","6+",O.ceil],["Clip","","6-10",O.clip,O.parseClipAttributes],["Clip","","11+",O.clipV11],["Concat","","4+",c.concat,c.parseConcatAttributes],["Conv","","1+",u.conv,u.parseConvAttributes],["ConvTranspose","","1+",p.convTranspose,p.parseConvTransposeAttributes],["Cos","","7+",O.cos],["Div","","7+",a.div],["Dropout","","7+",O.identity],["DepthToSpace","","1+",d.depthToSpace,d.parseDepthToSpaceAttributes],["Equal","","7+",a.equal],["Elu","","6+",O.elu,O.parseEluAttributes],["Exp","","6+",O.exp],["Flatten","","1+",_.flatten,_.parseFlattenAttributes],["Floor","","6+",O.floor],["FusedConv","com.microsoft","1+",u.conv,u.parseConvAttributes],["Gather","","1+",h.gather,h.parseGatherAttributes],["Gemm","","7-10",f.gemm,f.parseGemmAttributesV7],["Gemm","","11+",f.gemm,f.parseGemmAttributesV11],["GlobalAveragePool","","1+",x.globalAveragePool,x.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",x.globalMaxPool],["Greater","","7+",a.greater],["Identity","","1+",O.identity],["ImageScaler","","1+",m.imageScaler,m.parseImageScalerAttributes],["InstanceNormalization","","6+",g.instanceNormalization,g.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",O.leakyRelu,O.parseLeakyReluAttributes],["Less","","7+",a.less],["Log","","6+",O.log],["MatMul","","1+",b.matMul,b.parseMatMulAttributes],["MaxPool","","1+",x.maxPool,x.parseMaxPoolAttributes],["Mul","","7+",a.mul],["Neg","","6+",O.neg],["Not","","1+",O.not],["Or","","7+",a.or],["Pad","","2-10",w.padV2,w.parsePadAttributesV2],["Pad","","11+",w.padV11,w.parsePadAttributesV11],["Pow","","7+",a.pow],["PRelu","","7+",a.pRelu],["ReduceLogSum","","1+",y.reduceLogSum,y.parseReduceAttributes],["ReduceMax","","1+",y.reduceMax,y.parseReduceAttributes],["ReduceMean","","1+",y.reduceMean,y.parseReduceAttributes],["ReduceMin","","1+",y.reduceMin,y.parseReduceAttributes],["ReduceProd","","1+",y.reduceProd,y.parseReduceAttributes],["ReduceSum","","1-12",y.reduceSum,y.parseReduceAttributes],["ReduceSumSquare","","1+",y.reduceLogSumSquare,y.parseReduceAttributes],["Relu","","6+",O.relu],["Reshape","","5+",T.reshape],["Resize","","10",v.resize,v.parseResizeAttributesV10],["Resize","","11+",v.resize,v.parseResizeAttributesV11],["Shape","","1+",k.shape],["Sigmoid","","6+",O.sigmoid],["Sin","","7+",O.sin],["Slice","","10+",M.sliceV10],["Slice","","1-9",M.slice,M.parseSliceAttributes],["Softmax","","1-12",S.softmax,S.parseSoftmaxAttributes],["Softmax","","13+",S.softmaxV13,S.parseSoftmaxAttributesV13],["Split","","2-12",P.split,P.parseSplitAttributes],["Sqrt","","6+",O.sqrt],["Squeeze","","1-12",A.squeeze,A.parseSqueezeAttributes],["Squeeze","","13+",A.squeezeV13],["Sub","","7+",a.sub],["Sum","","6+",F.sum],["Tan","","7+",O.tan],["Tanh","","6+",O.tanh],["Tile","","6+",C.tile],["Transpose","","1+",E.transpose,E.parseTransposeAttributes],["Upsample","","7-8",D.upsample,D.parseUpsampleAttributesV7],["Upsample","","9",D.upsample,D.parseUpsampleAttributesV9],["Unsqueeze","","1-12",I.unsqueeze,I.parseUnsqueezeAttributes],["Unsqueeze","","13+",I.unsqueezeV13],["Xor","","7+",a.xor]]},2898:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseBatchNormalizationAttributes=t.batchNormalization=void 0;const r=n(246),o=n(5060),i=n(2039),s={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]};t.batchNormalization=(e,t,n)=>(l(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>a(e,t,n)}),t)]),t.parseBatchNormalizationAttributes=e=>{const t=e.attributes.getFloat("epsilon",1e-5),n=e.attributes.getFloat("momentum",.9),o=e.attributes.getInt("spatial",1);return(0,r.createAttributeWithCacheKey)({epsilon:t,momentum:n,spatial:o})};const a=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),a=t[0].dims.length,[l,c]=e.calculateTextureWidthAndHeight(t[1].dims,i.TextureType.unpacked),u=`\n float process(int[${a}] indices) {\n vec2 position = offsetToCoords(indices[1], ${l}, ${c});\n float scale = getColorAsFloat(${r.texture2D}(Scale, position));\n float mean = getColorAsFloat(${r.texture2D}(Mean, position));\n float variance = getColorAsFloat(${r.texture2D}(Variance, position));\n float b = getColorAsFloat(${r.texture2D}(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(${n.epsilon})) ) + b;\n }`;return Object.assign(Object.assign({},s),{output:{dims:t[0].dims,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:u})},l=e=>{if(!e||5!==e.length)throw new Error("BatchNormalization requires 5 inputs.");const t=e[0],n=e[1],r=e[2],o=e[3],i=e[4];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==o.dims.length||1!==i.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1]||o.dims[0]!==t.dims[1]||i.dims[0]!==t.dims[1])throw new Error("invalid input shape.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==o.type&&"float64"!==o.type||"float32"!==i.type&&"float64"!==i.type)throw new Error("invalid input tensor types.")}},7839:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.xor=t.sub=t.pRelu=t.pow=t.or=t.mul=t.less=t.greater=t.equal=t.div=t.and=t.add=t.glslPRelu=t.glslPow=t.glslXor=t.glslOr=t.glslAnd=t.glslLess=t.glslGreater=t.glslEqual=t.glslSub=t.glslMul=t.glslDiv=t.glslAdd=void 0;const r=n(2517),o=n(8520),i=n(5060),s=n(2039);function a(){const e="add_";return{body:`\n float ${e}(float a, float b) {\n return a + b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function l(){const e="div_";return{body:`\n float ${e}(float a, float b) {\n return a / b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function c(){const e="mul_";return{body:`\n float ${e}(float a, float b) {\n return a * b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function u(){const e="sub_";return{body:`\n float ${e}(float a, float b) {\n return a - b;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n `,name:e,type:o.FunctionType.ValueBased}}function p(){const e="equal_";return{body:`\n float ${e}(float a, float b) {\n return float(a == b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n `,name:e,type:o.FunctionType.ValueBased}}function d(){const e="greater_";return{body:`\n float ${e}(float a, float b) {\n return float(a > b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function _(){const e="less_";return{body:`\n float ${e}(float a, float b) {\n return float(a < b);\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function h(){const e="and_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function f(){const e="or_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function m(){const e="xor_";return{body:`\n float ${e}(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n `,name:e,type:o.FunctionType.ValueBased}}function g(){return function(e){const t=`${e}_`;return{body:`\n float ${t}(float a, float b) {\n return ${e}(a, b);\n }\n vec4 ${t}(vec4 v1, vec4 v2) {\n return ${e}(v1, v2);\n }\n `,name:t,type:o.FunctionType.ValueBased}}("pow")}function b(){const e="prelu_";return{body:`\n float ${e}(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ${e}(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n `,name:e,type:o.FunctionType.ValueBased}}t.glslAdd=a,t.glslDiv=l,t.glslMul=c,t.glslSub=u,t.glslEqual=p,t.glslGreater=d,t.glslLess=_,t.glslAnd=h,t.glslOr=f,t.glslXor=m,t.glslPow=g,t.glslPRelu=b;const w=(e,t,n,r=t[0].type,o)=>{const i=e.session.pack?s.TextureType.packed:s.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[i,i],cacheHint:o,get:()=>x(e,t,n,r)}},x=(e,t,n,o=t[0].type)=>{const a=e.session.pack?s.TextureType.packed:s.TextureType.unpacked,l=!r.ShapeUtil.areEqual(t[0].dims,t[1].dims);let c=t[0].dims;const u=e.session.pack;if(l){const s=r.BroadcastUtil.calcShape(t[0].dims,t[1].dims,!1);if(!s)throw new Error("Can't perform binary op on the given tensors");c=s;const l=c.length,p=0!==t[0].dims.length?t[0].dims.length:1,d=0!==t[1].dims.length?t[1].dims.length:1,_=0!==t[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",h=0!==t[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",f=(0,i.getGlsl)(e.session.backend.glContext.version),m=u?`\n ${n.body}\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ${n.name}(a, b);\n ${f.output} = result;\n }`:`\n ${n.body}\n float process(int indices[${l}]) {\n int aindices[${p}];\n int bindices[${d}];\n ${_}\n ${h}\n return ${n.name}(_A(aindices), _B(bindices));\n }`;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],output:{dims:c,type:o,textureType:a},shaderSource:m,hasMain:u}}const p=(0,i.getGlsl)(e.session.backend.glContext.version),d=`\n ${n.body}\n void main() {\n vec4 v1 = ${p.texture2D}(A, TexCoords);\n vec4 v2 = ${p.texture2D}(B, TexCoords);\n vec4 result = ${n.name}(v1, v2);\n ${p.output} = result;\n }\n `;return{name:n.name,inputNames:["A","B"],inputTypes:[a,a],output:{dims:t[0].dims,type:o,textureType:a},shaderSource:d,hasMain:!0}};t.add=(e,t)=>[e.run(w(e,t,a()),t)],t.and=(e,t)=>[e.run(w(e,t,h(),"bool"),t)],t.div=(e,t)=>[e.run(w(e,t,l()),t)],t.equal=(e,t)=>[e.run(w(e,t,p(),"bool"),t)],t.greater=(e,t)=>[e.run(w(e,t,d(),"bool"),t)],t.less=(e,t)=>[e.run(w(e,t,_(),"bool"),t)],t.mul=(e,t)=>[e.run(w(e,t,c()),t)],t.or=(e,t)=>[e.run(w(e,t,f(),"bool"),t)],t.pow=(e,t)=>[e.run(w(e,t,g()),t)],t.pRelu=(e,t)=>[e.run(w(e,t,b()),t)],t.sub=(e,t)=>[e.run(w(e,t,u()),t)],t.xor=(e,t)=>[e.run(w(e,t,m(),"bool"),t)]},4196:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseCastAttributes=t.cast=void 0;const r=n(2517);t.cast=(e,t,n)=>(o(t),[e.cast(t[0],n)]),t.parseCastAttributes=e=>r.ProtoUtil.tensorDataTypeFromProto(e.attributes.getInt("to"));const o=e=>{if(!e||1!==e.length)throw new Error("Cast requires 1 input.");if("string"===e[0].type)throw new Error("Invalid input type.")}},1163:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedConcatProgramInfoLoader=void 0;const r=n(5060),o=n(2039),i=n(9390),s=n(2827);t.createPackedConcatProgramInfoLoader=(e,t,n)=>{const l=(c=t.length,u=n.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:c},((e,t)=>`X${t}`)),inputTypes:Array(c).fill(o.TextureType.packed),cacheHint:u});var c,u;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const c=n[0].dims.slice();if(l>=c.length||l<-1*c.length)throw new Error("axis specified for concat doesn't match input dimensionality");l<0&&(l=c.length+l);const u=c.slice(0);for(let e=1;ee.dims)),m=(0,i.getGlChannels)(p),g=new Array(f.length-1);g[0]=f[0][l];for(let e=1;e= ${g[e-1]}) {\n return getChannel(\n getX${e}(${a(m,b,t)}),\n vec2(${a(w,b,t)}));\n }`}const T=g.length,v=g[g.length-1];y+=`\n return getChannel(\n getX${T}(${a(m,b,v)}),\n vec2(${a(w,b,v)}));`;const k=(0,r.getGlsl)(e.session.backend.glContext.version),M=`\n ${h}\n float getValue(${m.map((e=>"int "+e))}) {\n ${y}\n }\n\n void main() {\n ${_} coords = getOutputCoords();\n int lastDim = coords.${m[p-1]};\n coords.${m[p-1]} = coords.${m[p-2]};\n coords.${m[p-2]} = lastDim;\n\n vec4 result = vec4(getValue(${d}), 0., 0., 0.);\n\n ${d[p-1]} = ${d[p-1]} + 1;\n if (${d[p-1]} < ${u[p-1]}) {\n result.g = getValue(${d});\n }\n\n ${d[p-2]} = ${d[p-2]} + 1;\n if (${d[p-2]} < ${u[p-2]}) {\n result.a = getValue(${d});\n }\n\n ${d[p-1]} = ${d[p-1]} - 1;\n if (${d[p-2]} < ${u[p-2]} &&\n ${d[p-1]} < ${u[p-1]}) {\n result.b = getValue(${d});\n }\n ${k.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:u,type:n[0].type,textureType:o.TextureType.packed},shaderSource:M,hasMain:!0})})(e,l,t,n.axis)})};const a=(e,t,n)=>{const r=e.indexOf(t);return e.map(((e,t)=>t===r?`${e} - ${n}`:e)).join()}},2069:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConcatAttributes=t.concat=void 0;const r=n(246),o=n(2039),i=n(1163);t.concat=(e,t,n)=>(p(t),e.session.pack&&t[0].dims.length>1?[e.run((0,i.createPackedConcatProgramInfoLoader)(e,t,n),t)]:[e.run(s(e,t,n),t)]);const s=(e,t,n)=>{const r=(i=t.length,s=n.cacheKey,{name:"Concat",inputNames:Array.from({length:i},((e,t)=>`X${t}`)),inputTypes:Array(i).fill(o.TextureType.unpacked),cacheHint:s});var i,s;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const i=n[0].dims.slice();if(r>=i.length||r<-1*i.length)throw new Error("axis specified for concat doesn't match input dimensionality");r<0&&(r=i.length+r);const s=i.slice(0);for(let e=1;e`int getTextureWhereDataResides(int index) {\n ${e.map(((e,t)=>`if(index<${e}) {return ${t};}\n`)).join("")}\n }`,l=e=>a(e),c=(e,t)=>{const n=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${t}]) {`];for(let t=0;t{const t=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let n=0;n(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const p=e=>{if(!e||e.length<1)throw new Error("too few inputs");const t=e[0].type,n=e[0].dims.length;if("string"===t)throw new Error("string tensor is not supported yet");for(const r of e){if(r.type!==t)throw new Error("input tensors should be one type");if(r.dims.length!==n)throw new Error("input tensors should have the same shape")}}},4770:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackedGroupedConvProgramInfoLoader=void 0;const r=n(6231),o=n(5060),i=n(2039),s=n(8138),a=n(2823);t.createUnpackedGroupedConvProgramInfoLoader=(e,t,n)=>{const l=(c=t.length>2,u=n.cacheKey,{name:"GroupedConv",inputNames:c?["X","W","Bias"]:["X","W"],inputTypes:c?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u});var c,u;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,l)=>{const c=t.length>2?"value += getBias(output_channel);":"",u=t[0].dims.slice(),p=t[1].dims.slice(),d=p[0]/l.group;r.Logger.verbose("GroupedConv",`autpPad:${l.autoPad}, dilations:${l.dilations}, group:${l.group}, kernelShape:${l.kernelShape}, pads:${l.pads}, strides:${l.strides}`);const _=(0,s.calculateOutputShape)(u,p,l.dilations,l.pads,l.strides),h=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:f,applyActivation:m}=(0,a.getActivationSnippet)(l),g=`\n const ivec2 strides = ivec2(${l.strides[0]}, ${l.strides[1]});\n const ivec2 pads = ivec2(${l.pads[0]}, ${l.pads[1]});\n ${f}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ${d};\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ${p[1]}; wInChannel++) {\n int input_channel = group_id * ${p[1]} + wInChannel;\n for (int wHeight = 0; wHeight < ${p[2]}; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ${l.dilations[0]};\n\n if (xHeight < 0 || xHeight >= ${u[2]}) {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ${p[3]}; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ${l.dilations[1]};\n if (xWidth < 0 || xWidth >= ${u[3]}) {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ${c}\n ${m}\n ${h.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:_,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:g,hasMain:!0})})(e,t,l,n)})}},1386:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.conv2DPacked=t.conv2DPackedPointwise=void 0;const r=n(8138),o=n(8555),i=n(708);t.conv2DPackedPointwise=(e,t,n)=>{const o=t[0].dims,s=t[1].dims,a=(0,r.calculateOutputShape)(o,s,n.dilations,n.pads,n.strides),l=e.reshapePacked(t[0],[o[1],o[2]*o[3]]),c=e.reshapePacked(t[1],[s[0],s[1]]),u=t.length>2?[c,l,t[2]]:[c,l],p=e.run((0,i.createPackedMatmulProgramInfoLoader)(e,u,n),u);return e.reshapePacked(p,a)},t.conv2DPacked=(e,t,n)=>{const s=t[0].dims,a=t[1].dims,l=(0,r.calculateOutputShape)(s,a,n.dilations,n.pads,n.strides),c=e.run((0,o.createPackedIm2ColProgramInfoLoader)(e,t[0],t[1],l,n),[t[0]]),u=e.reshapePacked(t[1],[a[0],a[1]*a[2]*a[3]]),p=3===t.length?[u,c,t[2]]:[u,c],d=e.run((0,i.createPackedMatmulProgramInfoLoader)(e,p,n),p);return e.reshapePacked(d,l)}},9663:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvTransposeAttributes=t.convTranspose=void 0;const r=n(246),o=n(5060),i=n(2039),s=n(2823),a=(e,t,n,r,o,i)=>(e-1)*t+n+(r-1)*o+1-i,l=(e,t,n,r,o)=>{const i=Math.floor(e/2);"SAME_UPPER"===t?(n[r]=i,n[o]=e-i):"SAME_LOWER"===t&&(n[r]=e-i,n[o]=i)};t.convTranspose=(e,t,n)=>(d(t,n),c(e,t,n));const c=(e,t,n)=>{const r=p(n,t);return[u(e,t,r)]},u=(e,t,n)=>e.run(((e,t,n)=>{const r=(a=t.length>2,l=n.cacheKey,{name:"ConvTranspose",inputNames:a?["X","W","B"]:["X","W"],inputTypes:a?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:l});var a,l;return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const a=t.length>2?"getB(output_channel)":"0.0",l=t[0].dims,c=t[1].dims,u=c[1],p=c[0]/r.group,d=[t[0].dims[0],t[1].dims[1]*r.group,...r.outputShape],_=(0,o.getGlsl)(e.session.backend.glContext.version),{activationFunction:h,applyActivation:f}=(0,s.getActivationSnippet)(r),m=`\n const ivec2 strides = ivec2(${r.strides[0]}, ${r.strides[1]});\n const ivec2 pads = ivec2(${r.pads[0]}, ${r.pads[1]});\n ${h}\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ${u};\n int wOutChannel = output_channel - group_id * ${u};\n\n float value = ${a};\n for (int inChannelOffset = 0; inChannelOffset < ${p}; inChannelOffset++) {\n int input_channel = group_id * ${p} + inChannelOffset;\n for (int wWOff = 0; wWOff < ${c[2]}; wWOff++) {\n for (int wHOff = 0; wHOff < ${c[3]}; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ${r.dilations[0]}, wHOff * ${r.dilations[1]});\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ${l[2]} &&\n wLocIn.y >= 0 && wLocIn.y < ${l[3]}\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ${f}\n ${_.output} = vec4(value, .0, .0, .0);\n }\n`;return Object.assign(Object.assign({},n),{output:{dims:d,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:m,hasMain:!0})})(e,t,r,n)})})(e,t,n),t),p=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let e=2;e{const u=e.length-2,p=0===c.length;for(let d=0;d{const t=e.attributes,n=(0,s.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),i=t.getInts("dilations",[1,1]),a=t.getInt("group",1),l=t.getInts("kernel_shape",[]),c=t.getInts("output_padding",[0,0]),u=t.getInts("output_shape",[]),p=t.getInts("pads",[0,0,0,0]),d=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:i,group:a,kernelShape:l,outputPadding:c,outputShape:u,pads:p,strides:d},n))};const d=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const n=e[1].dims[1]*t.group;if(3===e.length&&(1!==e[2].dims.length||e[2].dims[0]!==n))throw new Error("invalid bias");const r=e[0].dims.length-2;if(t.dilations.length!==r)throw new Error(`dilations should be ${r}D`);if(t.strides.length!==r)throw new Error(`strides should be ${r}D`);if(t.pads.length!==2*r)throw new Error(`pads should be ${2*r}D`);if(t.outputPadding.length!==r)throw new Error(`output_padding should be ${r}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if(0!==t.outputShape.length&&t.outputShape.length!==e[0].dims.length-2)throw new Error("invalid output shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("ConvTranspose input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseConvAttributes=t.conv=t.calculateOutputShape=void 0;const r=n(246),o=n(2517),i=n(4770),s=n(1386),a=n(9828),l=n(2823),c=n(3248),u=n(5623);t.calculateOutputShape=(e,t,n,r,o)=>{const i=e[0],s=e.slice(2),a=s.length,l=t[0],c=t.slice(2).map(((e,t)=>e+(e-1)*(n[t]-1))),u=s.map(((e,t)=>e+r[t]+r[t+a])).map(((e,t)=>Math.floor((e-c[t]+o[t])/o[t])));return[i,l].concat(...u)},t.conv=(e,t,n)=>(f(t,n),p(e,t,n));const p=(e,t,n)=>{const r=h(n,t),o=e.session.pack,a=1===r.kernelShape[0]&&1===r.kernelShape[1];return r.group>1?[e.run((0,i.createUnpackedGroupedConvProgramInfoLoader)(e,t,r),t)]:a&&o?[d(e,t,r)]:o&&4===t[0].dims.length&&1===t[0].dims[0]&&!a?[(0,s.conv2DPacked)(e,t,r)]:[_(e,t,r)]},d=(e,n,r)=>{const o=n[0].dims,i=n[1].dims,s=(0,t.calculateOutputShape)(o,i,r.dilations,r.pads,r.strides),a=e.reshapeUnpacked(n[0],[o[1],o[2]*o[3]]),l=e.reshapeUnpacked(n[1],[i[0],i[1]]),c=n.length>2?[l,a,n[2]]:[l,a],p=e.run((0,u.createMatmulProgramInfoLoader)(c,r),c);return e.reshapeUnpacked(p,s)},_=(e,n,r)=>{const o=n[0].dims,i=n[1].dims,s=(0,t.calculateOutputShape)(o,i,r.dilations,r.pads,r.strides),l=e.run((0,c.createIm2ColProgramInfoLoader)(e,n[0],n[1],s,r),[n[0]]),u=3===n.length?[l,n[1],n[2]]:[l,n[1]];return e.run((0,a.createDotProductProgramInfoLoader)(e,n,s,r),u)},h=(e,t)=>{const n=e.kernelShape.slice();if(0===e.kernelShape.length)for(let e=2;e{const t=e.attributes,n=(0,l.parseInternalActivationAttributes)(t),o=t.getString("auto_pad","NOTSET"),i=t.getInts("dilations",[1,1]),s=t.getInt("group",1),a=t.getInts("kernel_shape",[]),c=t.getInts("pads",[0,0,0,0]),u=t.getInts("strides",[1,1]);return(0,r.createAttributeWithCacheKey)(Object.assign({autoPad:o,dilations:i,group:s,kernelShape:a,pads:c,strides:u},n))};const f=(e,t)=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Conv requires 2 or 3 inputs");if(4!==e[0].dims.length||4!==e[1].dims.length)throw new Error("currently only support 2-dimensional conv");if(e[0].dims[1]!==e[1].dims[1]*t.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(3===e.length&&(1!==e[2].dims.length||e[1].dims[0]!==e[2].dims[0]))throw new Error("invalid bias");const n=e[0].dims.length-2;if(t.dilations.length!==n)throw new Error(`dilations should be ${n}D`);if(t.strides.length!==n)throw new Error(`strides should be ${n}D`);if(t.pads.length!==2*n)throw new Error(`pads should be ${2*n}D`);if(0!==t.kernelShape.length&&t.kernelShape.length!==e[1].dims.length-2)throw new Error("invalid kernel shape");if("float32"!==e[0].type||"float32"!==e[1].type)throw new Error("Conv input(X,W) should be float tensor");if(3===e.length&&"float32"!==e[2].type)throw new Error("Conv input(bias) should be float tensor")}},5193:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseDepthToSpaceAttributes=t.depthToSpace=void 0;const r=n(3738);t.depthToSpace=(e,t,n)=>{o(t);const i=n.blocksize,s=i*i,a="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],l="DCR"===n.mode?[t[0].dims[0],i,i,t[0].dims[1]/s,t[0].dims[2],t[0].dims[3]]:[t[0].dims[0],t[0].dims[1]/s,i,i,t[0].dims[2],t[0].dims[3]],c=e.reshapeUnpacked(t[0],l),u={perm:a,cacheKey:`${a}`},[p]=(0,r.transpose)(e,[c],u),d=[t[0].dims[0],t[0].dims[1]/s,t[0].dims[2]*i,t[0].dims[3]*i];return[e.reshapeUnpacked(p,d)]},t.parseDepthToSpaceAttributes=e=>{const t=e.attributes.getInt("blocksize");if(t<1)throw new Error(`blocksize must be >= 1, but got : ${t} for DepthToSpace`);const n=e.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error(`unrecognized mode: ${n} for DepthToSpace`);return{mode:n,blocksize:t}};const o=e=>{if(1!==e.length)throw new Error(`DepthToSpace expect 1 inputs, but got ${e.length}`);if("string"===e[0].type||4!==e[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDotProductProgramInfoLoader=void 0;const r=n(2517),o=n(5060),i=n(2039),s=n(2823),a=n(3248);t.createDotProductProgramInfoLoader=(e,t,n,l)=>{const c=((e,t)=>({name:"ConvDotProduct",inputNames:e?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:e?[i.TextureType.unpacked,i.TextureType.packedLastDimension,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.packedLastDimension],cacheKey:t.activationCacheKey}))(t.length>2,l);return Object.assign(Object.assign({},c),{get:()=>((e,t,n,l,c)=>{const u=n[0].dims,p=n[1].dims,d=[p[0],Math.ceil(u[1]*p[2]*p[3]/4)],_=(0,a.calculateIm2ColDims)(u,p,l),[h,f]=e.calculateTextureWidthAndHeight(d,i.TextureType.packedLastDimension),m=r.ShapeUtil.computeStrides(_),[g,b]=e.calculateTextureWidthAndHeight(_,i.TextureType.packedLastDimension),w=l.length,x=n.length<3?"0.0":"_B(b)",y=Math.ceil(u[1]*p[2]*p[3]/4),{activationFunction:T,applyActivation:v}=(0,s.getActivationSnippet)(c),k=(0,o.getGlsl)(e.session.backend.glContext.version),M=`\n${T}\nfloat process(int indices[${w}]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ${m[0]} + im2col[1] * ${m[1]} + im2col[2] * ${m[2]};\n int kernelOffset = indices[1] * ${d[1]};\n float value = ${x};\n for (int i = 0; i < ${y}; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ${g}, ${b});\n vec2 kernelCoords = offsetToCoords(kernelOffset, ${h}, ${f});\n value += dot(${k.texture2D}(Im2Col, im2colCoords), ${k.texture2D}(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ${v}\n return value;\n}`;return Object.assign(Object.assign({},t),{output:{dims:l,type:n[0].type,textureType:i.TextureType.unpacked},shaderSource:M})})(e,c,t,n,l)})}},7992:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseFlattenAttributes=t.flatten=void 0;const r=n(2517);t.flatten=(e,t,n)=>{o(t,n);const i=r.ShapeUtil.flattenShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],i)]},t.parseFlattenAttributes=e=>e.attributes.getInt("axis",1);const o=(e,t)=>{if(!e||1!==e.length)throw new Error("Flatten requires 1 input.");const n=e[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(t<-n||t>n)throw new Error("Invalid axis");if("string"===e[0].type)throw new Error("string tensor is not supported.")}},2823:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInternalActivationAttributes=t.getActivationSnippet=void 0;const r=n(2517),o=n(4909);t.getActivationSnippet=function(e){let t;switch(e.activation){case"Relu":t=(0,o.glslRelu)();break;case"Sigmoid":t=(0,o.glslSigmoid)();break;case"Clip":t=(0,o.glslClip)(e.clipMin,e.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const n=t.name;return{activationFunction:t.body,applyActivation:`value = ${n}_(value);`}},t.parseInternalActivationAttributes=e=>{const t=e.getString("activation","");if("Clip"===t){const[n,o]=e.getFloats("activation_params",[r.MIN_CLIP,r.MAX_CLIP]);return{activation:t,clipMax:o,clipMin:n,activationCacheKey:`${t}:${n},${o}`}}return{activation:t,activationCacheKey:t}}},1253:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGatherAttributes=t.gather=void 0;const r=n(246),o=n(782),i=n(2517),s=n(2039);t.gather=(e,t,n)=>(c(t,n.axis),[e.run(l(e,t,n),t)]),t.parseGatherAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",0)});const a={name:"Gather",inputNames:["A","B"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},l=(e,t,n)=>{const r=Object.assign(Object.assign({},a),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const o=n[0].dims.slice(),a=n[1].dims.slice(),l=new Array(o.length+a.length-1);r=i.ShapeUtil.normalizeAxis(r,o.length);const c=[];for(let e=0;e{if(!e||2!==e.length)throw new Error("Gather requires 2 inputs.");const n=e[0].dims.length;if(n<1)throw new Error("Invalid input shape.");if(t<-n||t>n-1)throw new Error("Invalid axis.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invaid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invaid input type.")}},4776:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseGemmAttributesV11=t.parseGemmAttributesV7=t.gemm=void 0;const r=n(246),o=n(2517),i=n(2039);t.gemm=(e,t,n)=>(c(t,n),[e.run(a(t,n),t)]);const s=(e,t)=>{const n=0!==e.attributes.getInt("transA",0),o=0!==e.attributes.getInt("transB",0),i=e.attributes.getFloat("alpha",1),s=e.attributes.getFloat("beta",1);return(0,r.createAttributeWithCacheKey)({transA:n,transB:o,alpha:i,beta:s,isOptionalC:t})};t.parseGemmAttributesV7=e=>s(e,!1),t.parseGemmAttributesV11=e=>s(e,!0);const a=(e,t)=>{const n={name:"Gemm",inputNames:3===e.length?["A","B","C"]:["A","B"],inputTypes:3===e.length?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},n),{get:()=>l(n,e,t)})},l=(e,t,n)=>{const r=t[0].dims.slice(),s=t[1].dims.slice(),[a,l]=o.GemmUtil.getShapeOfGemmResult(r,n.transA,s,n.transB,3===t.length?t[2].dims:void 0),c=[a,l];if(!c)throw new Error("Can't use gemm on the given tensors");let u=r[r.length-1],p="";n.transA&&(u=r[0]),n.transA&&n.transB?p="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?p="value += _A_T(a) * _B(b);":!n.transA&&n.transB?p="value += _A(a) * _B_T(b);":n.transA||n.transB||(p="value += _A(a) * _B(b);");const d=c.length,_=`\n float process(int indices[${d}]) {\n int a[${d}];\n int b[${d}];\n ${3===t.length?`int c[${t[2].dims.length}];`:""}\n\n copyVec(indices, a);\n copyVec(indices, b);\n ${3===t.length?"bcastIndices_C(indices, c);":""}\n\n float value = 0.0;\n for (int k=0; k<${u}; ++k) {\n a[${d-1}] = k;\n b[${d-2}] = k;\n ${p}\n }\n\n value = value * alpha;\n ${3===t.length?"value += beta * _C(c);":""}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:c,type:t[0].type,textureType:i.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:_})},c=(e,t)=>{if(!e)throw new Error("Input is missing");if(t.isOptionalC&&(e.length<2||e.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&3!==e.length)throw new Error("Gemm requires 3 inputs");if(3===e.length&&1!==e[2].dims.length&&2!==e[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type||3===e.length&&"float32"!==e[2].type&&"float64"!==e[2].type)throw new Error("Invalid input type.");if(e[0].type!==e[1].type||3===e.length&&e[0].type!==e[2].type)throw new Error("Input types are mismatched")}},8555:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedIm2ColProgramInfoLoader=void 0;const r=n(5060),o=n(2039),i=n(2827);t.createPackedIm2ColProgramInfoLoader=(e,t,n,s,a)=>{const l=(c=a.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[o.TextureType.packed],cacheHint:c});var c;return Object.assign(Object.assign({},l),{get:()=>((e,t,n,s,a,l)=>{const c=n.dims,u=s.dims,p=a.length,d=[u[1]*u[2]*u[3],a[2]*a[3]],_=u[2]*u[3],h=(0,i.unpackFromChannel)(),f=(0,r.getGlsl)(e.session.backend.glContext.version);let m="";for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)m+=`\n blockIndex = rc.x + ${t};\n pos = rc.y + ${e};\n\n if(blockIndex < ${d[1]} && pos < ${d[0]}) {\n offsetY = int(blockIndex / (${a[p-1]})) * ${l.strides[0]} -\n ${l.pads[0]};\n d0 = offsetY + ${l.dilations[0]} * (imod(pos, ${_}) / ${u[2]});\n\n if(d0 < ${c[2]} && d0 >= 0) {\n offsetX = imod(blockIndex, ${a[p-1]}) * ${l.strides[1]} -\n ${l.pads[1]};\n d1 = offsetX + ${l.dilations[1]} * imod(imod(pos, ${_}), ${u[2]});\n\n if(d1 < ${c[3]} && d1 >= 0) {\n\n ch = int(float(pos)/ ${_}.);\n innerDims = vec2(d0, d1);\n result[${2*e+t}] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n `;const g=`\n ${h}\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ${m}\n ${f.output} = result;\n }\n `;return Object.assign(Object.assign({},t),{output:{dims:d,type:n.type,textureType:o.TextureType.packed},shaderSource:g,hasMain:!0})})(e,l,t,n,s,a)})}},3248:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.calculateIm2ColDims=t.createIm2ColProgramInfoLoader=void 0;const r=n(2039);t.createIm2ColProgramInfoLoader=(e,n,o,i,s)=>{const a=(l=s.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[r.TextureType.unpacked],cacheHint:l});var l;return Object.assign(Object.assign({},a),{get:()=>((e,n,o,i,s,a)=>{const l=o.dims,c=i.dims,u=s.length,p=(0,t.calculateIm2ColDims)(l,c,s,4),d=`\n const int XC = ${l[1]};\n const int XH = ${l[2]};\n const int XW = ${l[3]};\n const int KH = ${a.kernelShape[0]};\n const int KW = ${a.kernelShape[1]};\n const int dilationH = ${a.dilations[0]};\n const int dilationW = ${a.dilations[1]};\n const int strideH = ${a.strides[0]};\n const int strideW = ${a.strides[1]};\n const int padH = ${a.pads[0]};\n const int padW = ${a.pads[1]};\n const int KHKW = KH*KW;\n const int XCKHKW = XC * KHKW;\n const int outputChannels = 4;\n vec4 process(int indices[${u}]) {\n int b = indices[0]; // batch size\n int oh = indices[1] * strideH - padH; //output height\n int ow = indices[2] * strideW - padW; //output width\n int p = indices[3] * outputChannels; //patch\n vec4 value = vec4(0.0);\n for(int i=0; i < outputChannels; ++i) {\n if(p < XCKHKW) {\n int patchC = p / KHKW;\n int patchH = (p - patchC*KHKW) / KW;\n int patchW = (p - patchC*KHKW) - patchH * KW;\n int xh2 = oh + patchH * dilationH;\n int xw2 = ow + patchW * dilationW;\n int x[${l.length}];\n x[0] = b;\n x[1] = patchC;\n x[2] = xh2;\n x[3] = xw2;\n if(xh2 >= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:p,type:o.type,textureType:r.TextureType.packedLastDimension},shaderSource:d})})(0,a,n,o,i,s)})},t.calculateIm2ColDims=(e,t,n,r=4)=>[n[0],n[2],n[3],Math.ceil(e[1]*t[2]*t[3]/r)]},6572:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseImageScalerAttributes=t.imageScaler=void 0;const r=n(246),o=n(2039);t.imageScaler=(e,t,n)=>(l(t),[e.run(s(e,t,n),t)]),t.parseImageScalerAttributes=e=>{const t=e.attributes.getFloat("scale"),n=e.attributes.getFloats("bias");return(0,r.createAttributeWithCacheKey)({scale:t,bias:n})};const i={name:"ImageScaler",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},s=(e,t,n)=>{const r=Object.assign(Object.assign({},i),{cacheHint:n.cacheKey});return Object.assign(Object.assign({},r),{get:()=>((e,t,n,r)=>{const i=n[0].dims.slice(),s=i.length,l=`\n ${a(r.bias.length)}\n float process(int indices[${s}]) {\n return _X(indices) * scale + getBias(bias, indices[1]);\n }`;return Object.assign(Object.assign({},t),{output:{dims:i,type:n[0].type,textureType:o.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:r.bias.length,data:r.bias},{name:"scale",type:"float",data:r.scale}],shaderSource:l})})(0,r,t,n)})},a=e=>{const t=[`float getBias(float bias[${e}], int channel) {`];for(let n=0;n{if(!e||1!==e.length)throw new Error("ImageScaler requires 1 input.");if(4!==e[0].dims.length)throw new Error("Invalid input shape.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")}},3346:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInstanceNormalizationAttributes=t.instanceNormalization=void 0;const r=n(5060),o=n(2039);t.instanceNormalization=(e,t,n)=>{c(t);const r=e.run(s(t[0]),t);return[e.run(l(e,t[0],n,r.dims),[t[0],r,t[1],t[2]])]},t.parseInstanceNormalizationAttributes=e=>e.attributes.getFloat("epsilon",1e-5);const i={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[o.TextureType.unpacked]},s=e=>Object.assign(Object.assign({},i),{get:()=>((e,t)=>{const n=t.dims.slice(),r=n[1],i=n[2]*n[3],s=[n[0],r],a=`\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(${i});\n temp = 0.0;\n for(int a2=0; a2<${n[2]}; a2++) {\n a[2] = a2;\n for(int a3=0; a3<${n[3]}; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(${i});\n\n return v;\n }`;return Object.assign(Object.assign({},e),{output:{dims:s,type:t.type,textureType:o.TextureType.packedLastDimension},shaderSource:a})})(i,e)}),a={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[o.TextureType.unpacked,o.TextureType.packedLastDimension,o.TextureType.unpacked,o.TextureType.unpacked]},l=(e,t,n,i)=>{const s=Object.assign(Object.assign({},a),{cacheHint:`${n}`});return Object.assign(Object.assign({},s),{get:()=>((e,t,n,i,s)=>{const a=(0,r.getGlsl)(e.session.backend.glContext.version),[l,c]=e.calculateTextureWidthAndHeight(s,o.TextureType.packedLastDimension),[u,p]=[l/4,c],d=`\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ${u}, ${p});\n return ${a.texture2D}(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }`;return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:i}],shaderSource:d})})(e,s,t,n,i)})},c=e=>{if(!e||3!==e.length)throw new Error("InstanceNormalization requires 3 inputs.");const t=e[0],n=e[1],r=e[2];if(t.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==t.dims[1]||r.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==t.type&&"float64"!==t.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==e[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackedMatmulProgramInfoLoader=void 0;const r=n(2517),o=n(5060),i=n(2039),s=n(9390),a=n(2823),l=n(5623);t.createPackedMatmulProgramInfoLoader=(e,t,n)=>{const c=(u=t.length>2,p=n.activationCacheKey,{name:"MatMul (packed)",inputNames:u?["A","B","Bias"]:["A","B"],inputTypes:u?[i.TextureType.packed,i.TextureType.packed,i.TextureType.packed]:[i.TextureType.packed,i.TextureType.packed],cacheHint:p});var u,p;return Object.assign(Object.assign({},c),{get:()=>((e,t,n,c)=>{const u=n.length>2,p=u?"value += getBiasForMatmul();":"",d=n[0].dims,_=n[1].dims,h=r.BroadcastUtil.calcShape(d,_,!0),f=!r.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!h)throw new Error("Can't use matmul on the given tensors");const m=d[d.length-1],g=Math.ceil(m/2),b=d.length,w=_.length,x=(0,o.getGlsl)(e.session.backend.glContext.version),y=(0,s.getCoordsDataType)(h.length),T=h.length,v=(0,s.getGlChannels)(),{activationFunction:k,applyActivation:M}=(0,a.getActivationSnippet)(c),S=u?`${(0,l.getBiasForMatmul)(y,v,n[2].dims,h,!0)}`:"",P=f?`${function(e,t,n,o){let i=[],s=[];const a=n[0].dims,l=n[1].dims,c=a.length,u=l.length,p=o.length,d=p-c,_=p-u;i=a.map(((e,n)=>`coords.${t[n+d]}`)),i[c-1]="i*2",i.join(", "),s=l.map(((e,n)=>`coords.${t[n+_]}`)),s[u-2]="i*2",s.join(", ");const h=r.BroadcastUtil.getBroadcastDims(a,o),f=r.BroadcastUtil.getBroadcastDims(l,o),m=h.map((e=>`coords.${t[e+d]} = 0;`)).join("\n"),g=f.map((e=>`coords.${t[e+_]} = 0;`)).join("\n"),b=`int lastDim = coords.${t[p-1]};\n coords.${t[p-1]} = coords.${t[p-2]};\n coords.${t[p-2]} = lastDim;`;return`\nvec4 getAAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${b}\n ${m}\n vec4 outputValue = getA(${i});\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ${e} coords = getOutputCoords();\n ${b}\n ${g}\n vec4 outputValue = getB(${s});\n return outputValue;\n}`}(y,v,n,h)}`:"",A=f?"getAAtOutCoordsMatmul(i)":`getA(${function(e,t){let n="";for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.getBiasForMatmul=t.createMatmulProgramInfoLoader=t.parseMatMulAttributes=t.matMul=void 0;const r=n(2517),o=n(2039),i=n(9390),s=n(2823),a=n(708);function l(e,t){const n=(a=e.length>2,l=t.activationCacheKey,{name:"MatMul",inputNames:a?["A","B","Bias"]:["A","B"],inputTypes:a?[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]:[o.TextureType.unpacked,o.TextureType.unpacked],cacheHint:l});var a,l;return Object.assign(Object.assign({},n),{get:()=>function(e,t,n){const a=t[0].dims,l=t[1].dims,c=r.BroadcastUtil.calcShape(a,l,!0);if(!c)throw new Error("Can't use matmul on the given tensors");const p=(0,i.getCoordsDataType)(c.length),d=(0,i.getGlChannels)(),{activationFunction:_,applyActivation:h}=(0,s.getActivationSnippet)(n),f=t.length>2,m=f?"value += getBiasForMatmul();":"",g=f?`${u(p,d,t[2].dims,c,!1)}`:"",b=c.length,w=a.length,x=l.length,y=`\n ${_}\n ${g}\n float process(int indices[${b}]) {\n int a[${w}];\n int b[${x}];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<${a[a.length-1]}; ++k) {\n a[${w-1}] = k;\n b[${x-2}] = k;\n value += _A(a) * _B(b);\n }\n ${m}\n ${h}\n return value;\n }`;return Object.assign(Object.assign({},e),{output:{dims:c,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:y})}(n,e,t)})}t.matMul=(e,t,n)=>(c(t),e.session.pack?[e.run((0,a.createPackedMatmulProgramInfoLoader)(e,t,n),t)]:[e.run(l(t,n),t)]),t.parseMatMulAttributes=e=>(0,s.parseInternalActivationAttributes)(e.attributes),t.createMatmulProgramInfoLoader=l;const c=e=>{if(!e||2!==e.length)throw new Error("MatMul requires 2 inputs.");if(e[0].dims[e[0].dims.length-1]!==e[1].dims[e[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==e[0].type&&"float64"!==e[0].type||"float32"!==e[1].type&&"float64"!==e[1].type)throw new Error("inputs should be float type");if(e[0].type!==e[1].type)throw new Error("inputs types should match")};function u(e,t,n,o,i){let s="";const a=n.length,l=o.length,c=l-a;s=l<2&&a>0?"coords":n.map(((e,n)=>`coords.${t[n+c]}`)).join(", ");const u=r.BroadcastUtil.getBroadcastDims(n,o).map((e=>`coords.${t[e+c]} = 0;`)).join("\n");let p="vec4(outputValue.xx, outputValue.yy)";return 1===r.ShapeUtil.size(n)&&(p="vec4(outputValue.x)"),i?`\nvec4 getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${u}\n vec4 outputValue = getBias(${s});\n return ${p};\n}`:`\nfloat getBiasForMatmul() {\n ${e} coords = getOutputCoords();\n ${u}\n return getBias(coords.x);\n}`}t.getBiasForMatmul=u},2403:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createPackProgramInfoLoader=void 0;const r=n(5060),o=n(2039),i=n(9390),s=n(2827),a={name:"pack",inputNames:["A"],inputTypes:[o.TextureType.unpackedReversed]};t.createPackProgramInfoLoader=(e,t)=>Object.assign(Object.assign({},a),{get:()=>((e,t)=>{const n=(0,r.getGlsl)(e.session.backend.glContext.version),l=t.dims,c=l.length,u=t.dims.length,p=(0,i.getCoordsDataType)(u),d=(0,s.getChannels)("rc",u),_=(h=u,f=d,m=l[l.length-2],g=l[l.length-1],0===h||1===h?"":`\n int r = ${f[h-2]};\n int c = ${f[h-1]};\n int rp1 = ${f[h-2]} + 1;\n int cp1 = ${f[h-1]} + 1;\n bool rEdge = rp1 >= ${g};\n bool cEdge = cp1 >= ${m};\n `);var h,f,m,g;let b;b=0===c?[1,1]:1===c?[l[0],1]:[l[u-1],l[u-2]];const w=function(e,t,n){if(0===e)return"false";if(1===e)return`rc > ${t[0]}`;let r="";for(let o=e-2;o= ${t[o-e+2]}`,o= ${e[0]} ? 0. : getA(rc + 1),\n 0, 0`;let r="";if(n>2)for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.unpackFromChannel=t.getChannels=t.getVecChannels=void 0;const r=n(9390);function o(e,t){return(0,r.getGlChannels)(t).map((t=>`${e}.${t}`))}t.getVecChannels=o,t.getChannels=function(e,t){return 1===t?[e]:o(e,t)},t.unpackFromChannel=function(){return"\n float getChannel(vec4 frag, int dim) {\n int modCoord = imod(dim, 2);\n return modCoord == 0 ? frag.r : frag.g;\n }\n\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n "}},2870:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parsePadAttributesV11=t.padV11=t.parsePadAttributesV2=t.padV2=void 0;const r=n(246),o=n(2517),i=n(5060),s=n(2039),a={name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};t.padV2=(e,t,n)=>(u(t),[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>c(e,t[0],n)}),t)]),t.parsePadAttributesV2=e=>{const t=e.attributes.getString("mode","constant"),n=e.attributes.getFloat("value",0),o=e.attributes.getInts("pads");return(0,r.createAttributeWithCacheKey)({mode:t,value:n,pads:o})},t.padV11=(e,n,r)=>{p(n);const o=l(e,n,r);return(0,t.padV2)(e,[n[0]],o)},t.parsePadAttributesV11=e=>e.attributes.getString("mode","constant");const l=(e,t,n)=>{if(!e.session.isInitializer(t[1].dataId)||t.length>=3&&!e.session.isInitializer(t[2].dataId))throw new Error("dynamic pad attributes are not allowed");const o=Array.from(t[1].integerData),i=t.length>=3?t[2].floatData[0]:0;return(0,r.createAttributeWithCacheKey)({mode:n,pads:o,value:i})},c=(e,t,n)=>{const r=o.ShapeUtil.padShape(t.dims.slice(),n.pads),i=r.length,a=`\n ${d(e,t,n)}\n float process(int[${i}] indices) {\n return padA(indices);\n }`;return{name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked],output:{dims:r,type:t.type,textureType:s.TextureType.unpacked},shaderSource:a}},u=e=>{if(!e||1!==e.length)throw new Error("Pad requires 1 input");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},p=e=>{if(!e||2!==e.length&&3!==e.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==e[1].type)throw new Error("Invalid input type.");if(e.length>=3&&"string"===e[2].type)throw new Error("Invalid input type.")},d=(e,t,n)=>{const r=(0,i.getGlsl)(e.session.backend.glContext.version),[a,l]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),c=o.ShapeUtil.computeStrides(t.dims);switch(n.mode){case"constant":return _(r,t.dims,c,a,l,n.pads,n.value);case"reflect":return h(r,t.dims,c,a,l,n.pads);case"edge":return f(r,t.dims,c,a,l,n.pads);default:throw new Error("Invalid mode")}},_=(e,t,n,r,o,i,s)=>{const a=t.length;let l="";for(let e=a-1;e>=0;--e)l+=`\n k = m[${e}] - ${i[e]};\n if (k < 0) return constant;\n if (k >= ${t[e]}) return constant;\n offset += k * ${n[e]};\n `;return`\n float padA(int m[${a}]) {\n const float constant = float(${s});\n int offset = 0;\n int k = 0;\n ${l}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},h=(e,t,n,r,o,i)=>{const s=t.length;let a="";for(let e=s-1;e>=0;--e)a+=`\n k = m[${e}] - ${i[e]};\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ${2*(t[e]-1)};\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ${t[e]}) { k = _2n_1 - k; }\n }\n offset += k * ${n[e]};\n `;return`\n float padA(int m[${s}]) {\n int offset = 0;\n int k = 0;\n ${a}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `},f=(e,t,n,r,o,i)=>{const s=t.length;let a="";for(let e=s-1;e>=0;--e)a+=`\n k = m[${e}] - ${i[e]};\n if (k < 0) k = 0;\n if (k >= ${t[e]}) k = ${t[e]-1};\n offset += k * ${n[e]};\n `;return`\n float padA(int m[${s}]) {\n int offset = 0;\n int k = 0;\n ${a}\n vec2 coords = offsetToCoords(offset, ${r}, ${o});\n float value = getColorAsFloat(${e.texture2D}(A, coords));\n return value;\n }\n `}},2143:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.globalMaxPool=t.parseMaxPoolAttributes=t.maxPool=t.parseGlobalAveragePoolAttributes=t.globalAveragePool=t.parseAveragePoolAttributes=t.averagePool=void 0;const r=n(246),o=n(2517),i=n(2039);t.averagePool=(e,t,n)=>{p(t);const r={name:"AveragePool",inputNames:["X"],inputTypes:[i.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>s(t,r,!1,n)}),t)]},t.parseAveragePoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=0!==e.attributes.getInt("count_include_pad",0),i=e.attributes.getInts("kernel_shape"),s=e.attributes.getInts("strides",[]),a=e.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:o,kernelShape:i,strides:s,pads:a})};const s=(e,t,n,r)=>{const[s,a]=l(e,r,n),c=o.ShapeUtil.size(s.kernelShape);let u="";s.countIncludePad?u+=`value /= float(${c});`:u+=`value /= float(${c} - pad);`;const p=`\n ${d(e[0].dims,s,"value += _X(x);",u,"0.0")}\n `;return Object.assign(Object.assign({},t),{output:{dims:a,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:p})};t.globalAveragePool=(e,t,n)=>{p(t);const r={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[i.TextureType.unpacked],cacheHint:`${n.countIncludePad}`};return[e.run(Object.assign(Object.assign({},r),{get:()=>s(t,r,!0,n)}),t)]},t.parseGlobalAveragePoolAttributes=e=>{const t=0!==e.attributes.getInt("count_include_pad",0);return(0,r.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:t,kernelShape:[],strides:[],pads:[]})},t.maxPool=(e,t,n)=>{p(t);const r={name:"MaxPool",inputNames:["X"],inputTypes:[i.TextureType.unpacked],cacheHint:n.cacheKey};return[e.run(Object.assign(Object.assign({},r),{get:()=>a(t,r,!1,n)}),t)]},t.parseMaxPoolAttributes=e=>{const t=e.attributes.getString("auto_pad","NOTSET"),n=e.attributes.getInt("ceil_mode",0),o=e.attributes.getInts("kernel_shape"),i=e.attributes.getInts("strides",[]),s=e.attributes.getInts("pads",[]),a=e.attributes.getInt("storage_order",0),l=e.attributes.getInts("dilations",[]);if(0!==a)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,r.createAttributeWithCacheKey)({autoPad:t,ceilMode:n,countIncludePad:!1,kernelShape:o,strides:i,pads:s,storageOrder:a,dilations:l})};const a=(e,t,n,r)=>{const[o,s]=l(e,r,n),a=`\n ${d(e[0].dims,o,"\n value = max(_X(x), value);\n ","","-1e5")}\n `;return Object.assign(Object.assign({},t),{output:{dims:s,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:a})},l=(e,t,n)=>{const r=e[0].dims.slice(),i=Object.hasOwnProperty.call(t,"dilations"),s=t.kernelShape.slice(),a=t.strides.slice(),l=i?t.dilations.slice():[],c=t.pads.slice();o.PoolConvUtil.adjustPoolAttributes(n,r,s,a,l,c);const u=o.PoolConvUtil.computePoolOutputShape(n,r,a,l,s,c,t.autoPad),p=Object.assign({},t);return i?Object.assign(p,{kernelShape:s,strides:a,pads:c,dilations:l,cacheKey:t.cacheKey}):Object.assign(p,{kernelShape:s,strides:a,pads:c,cacheKey:t.cacheKey}),[p,u]},c={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},u={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[i.TextureType.unpacked]};t.globalMaxPool=(e,t)=>(p(t),[e.run(Object.assign(Object.assign({},u),{get:()=>a(t,u,!0,c)}),t)]);const p=e=>{if(!e||1!==e.length)throw new Error("Pool ops requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type.")},d=(e,t,n,r,i)=>{const s=e.length;if(t.kernelShape.length<=2){const o=t.kernelShape[t.kernelShape.length-1],a=t.strides[t.strides.length-1],l=t.pads[t.pads.length/2-1],c=t.pads[t.pads.length-1],u=e[s-1];let p="",d="",_="";if(p=l+c!==0?`\n for (int i = 0; i < ${o}; i++) {\n x[${s} - 1] = indices[${s} - 1] * ${a} - ${l} + i;\n if (x[${s} - 1] < 0 || x[${s} - 1] >= ${u}) {\n pad++;\n continue;\n }\n ${n}\n }`:`\n for (int i = 0; i < ${o}; i++) {\n x[${s} - 1] = indices[${s} - 1] * ${a} - ${l} + i;\n ${n}\n }`,2===t.kernelShape.length){const n=t.kernelShape[t.kernelShape.length-2],r=t.strides[t.strides.length-2],i=t.pads[t.pads.length/2-2],a=t.pads[t.pads.length-2],l=e[s-2];d=i+a!==0?`\n for (int j = 0; j < ${n}; j++) {\n x[${s} - 2] = indices[${s} - 2] * ${r} - ${i} + j;\n if (x[${s} - 2] < 0 || x[${s} - 2] >= ${l}) {\n pad+= ${o};\n continue;\n }\n `:`\n for (int j = 0; j < ${n}; j++) {\n x[${s} - 2] = indices[${s} - 2] * ${r} - ${i} + j;\n `,_="\n }\n "}return`\n float process(int indices[${s}]) {\n int x[${s}];\n copyVec(indices, x);\n\n float value = ${i};\n int pad = 0;\n ${d}\n ${p}\n ${_}\n ${r}\n return value;\n }\n `}{const a=o.ShapeUtil.size(t.kernelShape),l=o.ShapeUtil.computeStrides(t.kernelShape),c=l.length,u=t.pads.length,p=h(c),d=_(e,"inputDims"),f=_(t.pads,"pads"),m=_(l,"kernelStrides"),g=_(t.strides,"strides");let b="";return b=t.pads.reduce(((e,t)=>e+t))?`\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ${n}\n }`:`\n }\n ${n}\n `,`\n ${p}\n float process(int indices[${s}]) {\n int x[${s}];\n copyVec(indices, x);\n int offset[${c}];\n int pads[${u}];\n int inputDims[${s}];\n int kernelStrides[${c}];\n int strides[${c}];\n ${f}\n ${d}\n ${g}\n ${m}\n\n float value = ${i};\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ${a}; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ${s} - ${c}; j < ${s}; j++) {\n x[j] = indices[j] * strides[j - ${s} + ${c}]\n + offset[j - ${s} + ${c}] - pads[j - 2];\n ${b}\n }\n ${r}\n\n return value;\n }\n `}},_=(e,t)=>{let n="";for(let r=0;r`\n void offsetToIndices(int offset, int[${e}] strides, out int[${e}] indices) {\n if (${e} == 0) {\n return;\n }\n for (int i = 0; i < ${e} - 1; ++i) {\n indices[i] = offset / strides[i];\n offset -= indices[i] * strides[i];\n }\n indices[${e} - 1] = offset;\n }`},4939:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reduceLogSumSquare=t.reduceLogSum=t.reduceProd=t.reduceMin=t.reduceMax=t.reduceMean=t.reduceSum=t.parseReduceAttributes=void 0;const r=n(246),o=n(782),i=n(2517),s=n(2039),a=(e,t,n,r,o)=>{c(t);const i={name:r,inputNames:["A"],inputTypes:[s.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},i),{cacheHint:n.cacheKey,get:()=>l(e,t,n,r,o,i)}),t)]};t.parseReduceAttributes=e=>{const t=e.attributes.getInts("axes",[]),n=1===e.attributes.getInt("keepdims",1);return(0,r.createAttributeWithCacheKey)({axes:t,keepDims:n})};const l=(e,t,n,r,o,a)=>{const l=[],c=t[0].dims.length||1,u=[],p=i.ShapeUtil.normalizeAxes(n.axes,t[0].dims.length),d=o(t,p);let _=d[1];for(let e=0;e=0||0===p.length?(n.keepDims&&l.push(1),_=`\n for(int j${e} = 0; j${e} < ${t[0].dims[e]}; j${e}++) {\n inputIdx[${e}] = j${e};\n ${_}\n }`):(u.push(`inputIdx[${e}] = outputIdx[${l.length}];`),l.push(t[0].dims[e]));const h=`\n float process(int outputIdx[${l.length||1}]) {\n float value; // final result\n int inputIdx[${c}]; // addressing input data\n ${u.join("\n")}\n ${d[0]} // init ops for reduce max/min\n ${_}\n ${d[2]} // final computation for reduce mean\n return value;\n }`;return Object.assign(Object.assign({},a),{output:{dims:l,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:h})},c=e=>{if(!e||1!==e.length)throw new Error("Reduce op requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.reduceSum=(e,t,n)=>a(e,t,n,"ReduceSum",(()=>["value = 0.0;","value += _A(inputIdx);",""])),t.reduceMean=(e,t,n)=>a(e,t,n,"ReduceMean",((e,t)=>{let n=1;for(let r=0;r=0||0===t.length)&&(n*=e[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${n}.;`]})),t.reduceMax=(e,t,n)=>a(e,t,n,"ReduceMax",((e,t)=>{const n=[];for(let r=0;r=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]})),t.reduceMin=(e,t,n)=>a(e,t,n,"ReduceMin",((e,t)=>{const n=[];for(let r=0;r=0||0===t.length)&&n.push(`inputIdx[${r}] = 0;`);return[`${n.join("\n")}\nvalue = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]})),t.reduceProd=(e,t,n)=>a(e,t,n,"ReduceProd",(()=>["value = 1.0;","value *= _A(inputIdx);",""])),t.reduceLogSum=(e,t,n)=>a(e,t,n,"ReduceLogSum",(()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"])),t.reduceLogSumSquare=(e,t,n)=>a(e,t,n,"ReduceLogSumSquare",(()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""]))},7019:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isReshapeCheap=t.processDims3D=t.createPackedReshape3DProgramInfoLoader=void 0;const r=n(2517),o=n(5060),i=n(2039),s=n(2827);t.createPackedReshape3DProgramInfoLoader=(e,t,n)=>{const a=(e=>({name:"Reshape (packed)",inputTypes:[i.TextureType.packed],inputNames:["A"],cacheHint:`${e}`}))(n);return Object.assign(Object.assign({},a),{get:()=>((e,t,n,a)=>{const l=t.dims,c=a;let u="";for(let e=0;e<4;e++){let t="";switch(e){case 0:t="outputCoords = rc;";break;case 1:t="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:t="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:t="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}u+=`\n ${t}\n ${e>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""}\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${e}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ${e>0?"}":""}\n `}const p=(0,o.getGlsl)(e.session.backend.glContext.version),d=`\n ${function(e){const t=r.ShapeUtil.computeStrides(e),n=["b","r","c"],o="index";return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${t.map(((e,r)=>`int ${n[r]} = ${o} / ${e}; ${r===t.length-1?`int ${n[r+1]} = ${o} - ${n[r]} * ${e}`:`index -= ${n[r]} * ${e}`};`)).join("")}\n return ivec3(b, r, c);\n }\n `}(l)}\n ${function(e){const t=r.ShapeUtil.computeStrides(e);return`\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ${t[0]} + coords.z * ${t[1]} + coords.y;\n }\n`}(c)}\n ${(0,s.unpackFromChannel)()}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ${c[2]};\n int cols = ${c[1]};\n\n ${u}\n ${p.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:c,type:t.type,textureType:i.TextureType.packed},shaderSource:d,hasMain:!0})})(e,t,a,n)})},t.processDims3D=function(e){if(0===e.length)return[1,1,1];let t=1;for(let n=0;n1?e[e.length-2]:1,e[e.length-1]]},t.isReshapeCheap=function(e,t){let n=!1;return n=0===e.length||0===t.length||(e.length<2||t.length<2?e[e.length-1]===t[t.length-1]:e[e.length-1]===t[t.length-1]&&e[e.length-2]===t[t.length-2]),n}},718:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reshape=void 0;const r=n(2517);t.reshape=(e,t)=>{const n=r.ShapeUtil.calculateReshapedDims(t[0].dims,t[1].integerData);return e.session.pack?[e.reshapePacked(t[0],n)]:[e.reshapeUnpacked(t[0],n)]}},2268:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseResizeAttributesV11=t.parseResizeAttributesV10=t.resize=void 0;const r=n(5060),o=n(2039),i=n(9390),s=n(2827),a=n(9793),l={name:"Resize",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.resize=(e,t,n)=>((0,a.validateInputs)(t,n),[e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>c(e,t,n)}),t)]),t.parseResizeAttributesV10=e=>(0,a.parseUpsampleAttributes)(e,10),t.parseResizeAttributesV11=e=>(0,a.parseUpsampleAttributes)(e,11);const c=(e,t,n)=>{const a=(0,r.getGlsl)(e.session.backend.glContext.version),[c,p]=u(t,n);if(c.every((e=>1===e))&&"tf_crop_and_resize"!==n.coordinateTransformMode)return Object.assign(Object.assign({},l),{output:{dims:p,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:`void main() {\n vec4 v = ${a.texture2D}(X, TexCoords);\n ${a.output} = v;\n }`});const d=p.length;if(d<2)throw new Error(`output dimension should be at least 2, but got ${d}`);const _=p[d-2],h=p[d-1],f=t[0].dims;if(d!==f.length)throw new Error(`output dimension should match input ${f.length}, but got ${d}`);const m=f[d-2],g=f[d-1],b=c[d-2],w=c[d-1];let x="";if("linear"!==n.mode)throw new Error(`resize (packed) does not support mode: '${n.mode}'`);switch(n.coordinateTransformMode){case"asymmetric":x="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":x="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":x=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ${h}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ${_}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ${h}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ${_}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n `;break;case"align_corners":x=`\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(${h}.0 - 1.0, ${_}.0 - 1.0, ${h}.0 - 1.0,\n ${_}.0 - 1.0);\n vec4 original = vec4(${g}.0 - 1.0, ${m}.0 - 1.0, ${g}.0 - 1.0,\n ${m}.0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${n.coordinateTransformMode}'`)}const y=(0,i.getCoordsDataType)(d),T=`\n const vec2 inputWH = vec2(${m}.0, ${g}.0);\n const vec4 scaleWHWH = vec4(float(${b}), float(${w}), float(${b}), float(${w}));\n ${(0,s.unpackFromChannel)()}\n ${x}\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ${y} rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ${_-1};\n bool hasNextCol = rc.z < ${h-1};\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ${a.output} = vec4(newValue);\n }\n `;return Object.assign(Object.assign({},l),{output:{dims:p,type:t[0].type,textureType:o.TextureType.packed},hasMain:!0,shaderSource:T})},u=(e,t)=>{const n=e[0].dims;let r,o=t.scales;if(0===o.length){const i=e[t.scalesInputIdx];if(i&&0!==i.size){if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");o=p(i,t.mode,t.isResize)}else{const i=e[t.sizesInputIdx];if(!i||0===i.size)throw new Error("Either scales or sizes MUST be provided as input.");r=Array.from(i.integerData),o=d(r,n,t.mode,t.isResize)}}else if(e[t.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const i=r||n.map(((e,t)=>Math.floor(e*o[t])));return[o,i]},p=(e,t,n)=>{const r=Array.from(e.floatData);return(0,a.scalesValidation)(r,t,n),r},d=(e,t,n,r)=>{const o=t.length,i=new Array(o);for(let n=0,r=o;n{Object.defineProperty(t,"__esModule",{value:!0}),t.shape=void 0;const r=n(9162);t.shape=(e,t)=>(o(t),[new r.Tensor([t[0].dims.length],"int32",void 0,void 0,new Int32Array(t[0].dims))]);const o=e=>{if(!e||1!==e.length)throw new Error("Shape requires 1 input.")}},2278:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sliceV10=t.parseSliceAttributes=t.slice=void 0;const r=n(246),o=n(782),i=n(2517),s=n(2039),a={name:"Slice",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};t.slice=(e,t,n)=>(c(t),[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),t)]),t.parseSliceAttributes=e=>{const t=e.attributes.getInts("starts"),n=e.attributes.getInts("ends"),o=e.attributes.getInts("axes",[]);return(0,r.createAttributeWithCacheKey)({starts:t,ends:n,axes:o})};const l=(e,t,n)=>{const r=0===n.axes.length?t.dims.slice(0).map(((e,t)=>t)):n.axes,o=i.ShapeUtil.normalizeAxes(r,t.dims.length),l=n.starts.map(((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:i.ShapeUtil.normalizeAxis(e,t.dims[o[n]]))),c=n.ends.map(((e,n)=>e>t.dims[o[n]]-1?t.dims[o[n]]:i.ShapeUtil.normalizeAxis(e,t.dims[o[n]]))),u=t.dims.slice(),p=[];for(let e=0;e0&&p.push(`outputIdx[${o[e]}] += ${l[e]};`);const d=`\n float process(int outputIdx[${u.length}]) {\n ${p.join("\n ")}\n return _A(outputIdx);\n }`;return Object.assign(Object.assign({},a),{output:{dims:u,type:t.type,textureType:s.TextureType.unpacked},shaderSource:d})},c=e=>{if(!e||1!==e.length)throw new Error("Slice requires 1 input.");if(-1===o.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.")};t.sliceV10=(e,t)=>{p(t);const n=u(e,t);return[e.run(Object.assign(Object.assign({},a),{cacheHint:n.cacheKey,get:()=>l(e,t[0],n)}),[t[0]])]};const u=(e,t)=>{if(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)||t.length>=4&&!e.session.isInitializer(t[3].dataId)||t.length>=5&&!e.session.isInitializer(t[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(t.length>=5&&t[4].integerData.some((e=>1!==e)))throw new Error("currently non-1 steps is not supported for Slice");const n=Array.from(t[1].integerData),r=Array.from(t[2].integerData),o=t.length>=4?Array.from(t[3].integerData):[];return{starts:n,ends:r,axes:o,cacheKey:`${o};${n};${r}`}},p=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if("int32"!==e[1].type||1!==e[1].dims.length)throw new Error("Invalid input type.");if("int32"!==e[2].type||1!==e[2].dims.length)throw new Error("Invalid input type.");if(e.length>=4&&("int32"!==e[3].type||1!==e[3].dims.length))throw new Error("Invalid input type.");if(e.length>=5&&("int32"!==e[4].type||1!==e[4].dims.length))throw new Error("Invalid input type.")}},5524:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.softmaxV13=t.parseSoftmaxAttributesV13=t.parseSoftmaxAttributes=t.softmax=void 0;const r=n(246),o=n(2517),i=n(5060),s=n(2039),a=n(3738),l={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[s.TextureType.unpacked]},c={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},u={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]};t.softmax=(e,t,n)=>{f(t);const r=t[0].dims.slice(),i=o.ShapeUtil.normalizeAxis(n.axis,r.length),s=o.ShapeUtil.sizeToDimension(r,i),a=o.ShapeUtil.sizeFromDimension(r,i);return p(e,t,n,s,a)},t.parseSoftmaxAttributes=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",1)}),t.parseSoftmaxAttributesV13=e=>(0,r.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis",-1)}),t.softmaxV13=(e,t,n)=>{f(t);const i=t[0].dims.slice(),s=o.ShapeUtil.normalizeAxis(n.axis,i.length),l=i.length,c=s!==l-1,u=[];let d,_=[],h=[];c&&(_=Array.from({length:l}).map(((e,t)=>t)),_[s]=l-1,_[l-1]=s,_.map((e=>u.push(i[e]))),d=(0,r.createAttributeWithCacheKey)({perm:_}),h=(0,a.transpose)(e,t,d));const m=c?o.ShapeUtil.sizeToDimension(u,l-1):o.ShapeUtil.sizeToDimension(i,l-1),g=c?o.ShapeUtil.sizeFromDimension(u,l-1):o.ShapeUtil.sizeFromDimension(i,l-1),b=p(e,c?h:t,n,m,g);return c?(0,a.transpose)(e,b,d):b};const p=(e,t,n,r,o)=>{const i=d(e,t[0],r,o,[r]),s=e.run(Object.assign(Object.assign({},l),{cacheHint:n.cacheKey,get:()=>i}),t),a=_(e,t[0],r,o,i.output.dims,[r]),p=e.run(Object.assign(Object.assign({},c),{cacheHint:n.cacheKey,get:()=>a}),[t[0],s]),f=h(e,t[0],r,o,i.output.dims,a.output.dims);return[e.run(Object.assign(Object.assign({},u),{cacheHint:n.cacheKey,get:()=>f}),[t[0],s,p])]},d=(e,t,n,r,o)=>{const[a,c]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),u=o.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length)throw new Error("Dimensionality of the output should be 1");if(o[0]!==n)throw new Error("Shape of the output should be equal to logical row count");const p=(0,i.getGlsl)(e.session.backend.glContext.version),d=`\n float process(int[${u}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float max = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset, ${a},\n ${c} )));\n for(int i=1; i<${r}; ++i)\n {\n float current = getColorAsFloat(${p.texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${a}, ${c})));\n if(current > max)\n max = current;\n }\n\n return max;\n }`;return Object.assign(Object.assign({},l),{output:{dims:o,type:t.type,textureType:s.TextureType.unpacked},shaderSource:d})},_=(e,t,n,r,o,a)=>{const[l,u]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),p=a.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==a.length)throw new Error("Dimensionality of the output should be 1");if(a[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==o.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const d=`\n float process(int[${p}] indices) {\n int logical_row_start_offset = indices[0] * ${r};\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<${r}; ++i)\n {\n norm_factor += exp(getColorAsFloat(${(0,i.getGlsl)(e.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,\n ${l}, ${u}))) - max);\n }\n\n return norm_factor;\n }`;return Object.assign(Object.assign({},c),{output:{dims:a,type:t.type,textureType:s.TextureType.unpacked},shaderSource:d})},h=(e,t,n,r,o,i)=>{const[a,l]=e.calculateTextureWidthAndHeight(t.dims,s.TextureType.unpacked),c=t.dims.length;if(n<1||r<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==o.length||1!==i.length)throw new Error("Dimensionality of the intermediate results should be 1");if(o[0]!==n||i[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");const p=`\n float process(int[${c}] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ${a}, ${l});\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ${r};\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }`;return Object.assign(Object.assign({},u),{output:{dims:t.dims,type:t.type,textureType:s.TextureType.unpacked},shaderSource:p})},f=e=>{if(!e||1!==e.length)throw new Error("Softmax requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("Invalid input type")}},5975:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSplitAttributes=t.split=void 0;const r=n(246),o=n(2517),i=n(2039),s={name:"Split",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.split=(e,t,n)=>{c(t);const r=o.ShapeUtil.normalizeAxis(n.axis,t[0].dims.length),i=a(e,t,r,n),u=[];for(let o=0;ol(e,t[0],n,r,o)}),t));return u},t.parseSplitAttributes=e=>{const t=e.attributes.getInt("axis",0),n=e.attributes.getInts("split",[]),o=e.outputs.length;return(0,r.createAttributeWithCacheKey)({axis:t,split:n,numOutputs:o})};const a=(e,t,n,r)=>{const[,i]=o.SplitUtil.splitShape(t[0].dims,n,r.split,r.numOutputs);return i.length},l=(e,t,n,r,a)=>{const[l,c]=o.SplitUtil.splitShape(t.dims,r,n.split,n.numOutputs),u=c[a],p=l[a],d=`\n float process(int indices[${p.length}]) {\n indices[${r}] += ${u};\n return _A(indices);\n }\n `;return Object.assign(Object.assign({},s),{cacheHint:`${n.cacheKey}:${a}`,output:{dims:p,type:t.type,textureType:i.TextureType.unpacked},shaderSource:d})},c=e=>{if(!e||1!==e.length)throw new Error("Split requires one input.");if("int8"!==e[0].type&&"uint8"!==e[0].type&&"int16"!==e[0].type&&"uint16"!==e[0].type&&"int32"!==e[0].type&&"uint32"!==e[0].type&&"float32"!==e[0].type&&"float64"!==e[0].type&&"bool"!==e[0].type)throw new Error("Invalid input type.")}},3933:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseSqueezeAttributes=t.squeezeV13=t.squeeze=void 0;const r=n(2517);t.squeeze=(e,t,n)=>{o(t);const i=r.ShapeUtil.squeezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],i)]},t.squeezeV13=(e,n)=>(i(n),(0,t.squeeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseSqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Squeeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},i=e=>{if(!e||2!==e.length)throw new Error("Squeeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},6558:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sum=void 0;const r=n(5060),o=n(2039);t.sum=(e,t)=>{s(t);const n={name:"Sum",inputNames:t.map(((e,t)=>`X${t}`)),inputTypes:new Array(t.length).fill(o.TextureType.unpacked)};return[e.run(Object.assign(Object.assign({},n),{get:()=>i(e,t,n)}),t)]};const i=(e,t,n)=>{const i=(0,r.getGlsl)(e.session.backend.glContext.version),s=t[0].dims.slice(),a=`\n void main() {\n vec4 result = ${t.map(((e,t)=>`${i.texture2D}(X${t},TexCoords)`)).join(" + ")};\n ${i.output} = result;\n }\n `;return Object.assign(Object.assign({},n),{output:{dims:s,type:t[0].type,textureType:o.TextureType.unpacked},hasMain:!0,shaderSource:a})},s=e=>{if(!e||0===e.length)throw new Error("Sum requires inputs.");const t=e[0].dims.length;for(let n=1;n{Object.defineProperty(t,"__esModule",{value:!0}),t.tile=void 0;const r=n(782),o=n(2039);t.tile=(e,t)=>{s(t);const n={name:"Tile",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};return[e.run(Object.assign(Object.assign({},n),{get:()=>i(e,t,n)}),t)]};const i=(e,t,n)=>{const r=t[0].dims.slice(),i=new Array(r.length),s=[];for(let e=0;e{if(!e||2!==e.length)throw new Error("Tile requires 2 input.");if(1!==e[1].dims.length)throw new Error("The second input shape must 1 dimension.");if(e[1].dims[0]!==e[0].dims.length)throw new Error("Invalid input shape.");if(-1===r.NUMBER_TYPES.indexOf(e[0].type))throw new Error("Invalid input type.");if("int32"!==e[1].type&&"int16"!==e[1].type)throw new Error("Invalid repeat type.")}},3738:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseTransposeAttributes=t.transpose=void 0;const r=n(246),o=n(2517),i=n(2039),s={name:"Transpose",inputNames:["A"],inputTypes:[i.TextureType.unpacked]};t.transpose=(e,t,n)=>(p(t),[e.run(Object.assign(Object.assign({},s),{cacheHint:n.cacheKey,get:()=>a(e,t[0],n.perm)}),t)]),t.parseTransposeAttributes=e=>(0,r.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const a=(e,t,n)=>{const r=t.dims;n=l(r,n);const o=c(r,n),a=r.length,p=`\n ${u("perm",n,a)}\n float process(int indices[${a}]) {\n int a[${a}];\n perm(a, indices);\n return _A(a);\n }`;return Object.assign(Object.assign({},s),{output:{dims:o,type:t.type,textureType:i.TextureType.unpacked},shaderSource:p})},l=(e,t)=>(t&&t.length!==e.length&&(t=[...e.keys()].reverse()),t),c=(e,t)=>(t=l(e,t),o.ShapeUtil.sortBasedOnPerm(e,t)),u=(e,t,n)=>{const r=[];r.push(`void ${e}(out int a[${n}], int src[${n}]) {`);for(let e=0;e{if(!e||1!==e.length)throw new Error("Transpose requires 1 input.");if("float32"!==e[0].type&&"float64"!==e[0].type)throw new Error("input should be float tensor")}},8710:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.encodeAsUint8=void 0;const r=n(5060),o=n(2039);t.encodeAsUint8=(e,t)=>{const n=t.shape,i=(0,r.getGlsl)(e.session.backend.glContext.version),s=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n bool isNaN(float val) {\n return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true;\n }\n\n highp vec4 encodeAsUint8(highp float v) {\n if (isNaN(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ${i.texture2D}(X,TexCoords).r;\n ${i.output} = encodeAsUint8(value);\n }`,a={name:"Uint8Encode",inputTypes:[o.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:t.tensor.type,textureType:o.TextureType.downloadUint8AsFloat},shaderSource:s,hasMain:!0};return e.executeProgram(a,[t.tensor])}},4909:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tanh=t.tan=t.sqrt=t.sin=t.sigmoid=t.relu=t.not=t.neg=t.log=t.parseLeakyReluAttributes=t.leakyRelu=t.identity=t.floor=t.exp=t.parseEluAttributes=t.elu=t.cos=t.ceil=t.clipV11=t.parseClipAttributes=t.clip=t.atan=t.asin=t.acos=t.abs=t.glslTanh=t.glslTan=t.glslSqrt=t.glslSigmoid=t.glslRelu=t.glslSin=t.glslNot=t.glslNeg=t.glslLog=t.glslLeakyRelu=t.glslIdentity=t.glslClip=t.glslFloor=t.glslExp=t.glslElu=t.glslCos=t.glslCeil=t.glslAtan=t.glslAsin=t.glslAcos=t.glslAbs=void 0;const r=n(246),o=n(2517),i=n(8520),s=n(5060),a=n(2039);function l(){return F("abs")}function c(){return F("acos")}function u(){return F("asin")}function p(){return F("atan")}function d(){return F("ceil")}function _(){return F("cos")}function h(e){const t="elu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a >= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:i.FunctionType.ValueBased}}function f(){return F("exp")}function m(){return F("floor")}function g(e,t){const n="clip";return{body:`\n const float min = float(${e});\n const float max = float(${t});\n\n float ${n}_(float a) {\n return clamp(a, min, max);\n }\n vec4 ${n}_(vec4 v) {\n return clamp(v, min, max);\n }\n `,name:n,type:i.FunctionType.ValueBased}}function b(){const e="indentity";return{body:`\n float ${e}_(float a) {\n return a;\n }\n vec4 ${e}_(vec4 v) {\n return v;\n }\n `,name:e,type:i.FunctionType.ValueBased}}function w(e){const t="leakyRelu";return{body:`\n const float alpha = float(${e});\n\n float ${t}_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ${t}_(vec4 v) {\n return vec4(${t}_(v.x), ${t}_(v.y), ${t}_(v.z), ${t}_(v.w));\n }\n `,name:t,type:i.FunctionType.ValueBased}}function x(){return F("log")}function y(){const e="neg";return{body:`\n float ${e}_(float a) {\n return -a;\n }\n vec4 ${e}_(vec4 v) {\n return -v;\n }\n `,name:e,type:i.FunctionType.ValueBased}}function T(){const e="not";return{body:`\n float ${e}_(float a) {\n return float( ! bool(a) );\n }\n bool ${e}_(bool a) {\n return !a;\n }\n vec4 ${e}_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ${e}_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n `,name:e,type:i.FunctionType.ValueBased}}function v(){return F("sin")}function k(){const e="relu";return{body:`\n float ${e}_(float a) {\n return max( a, 0.0 );\n }\n vec4 ${e}_(vec4 v) {\n return max( v, 0.0 );\n }\n `,name:e,type:i.FunctionType.ValueBased}}function M(){const e="sigmoid";return{body:`\n float ${e}_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ${e}_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n `,name:e,type:i.FunctionType.ValueBased}}function S(){return F("sqrt")}function P(){return F("tan")}function A(){const e="tanh";return{body:`\n float ${e}_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ${e}_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n `,name:e,type:i.FunctionType.ValueBased}}function F(e){return{body:`\n float ${e}_(float a) {\n return ${e}(a);\n }\n vec4 ${e}_(vec4 v) {\n return ${e}(v);\n }\n `,name:e,type:i.FunctionType.ValueBased}}t.glslAbs=l,t.glslAcos=c,t.glslAsin=u,t.glslAtan=p,t.glslCeil=d,t.glslCos=_,t.glslElu=h,t.glslExp=f,t.glslFloor=m,t.glslClip=g,t.glslIdentity=b,t.glslLeakyRelu=w,t.glslLog=x,t.glslNeg=y,t.glslNot=T,t.glslSin=v,t.glslRelu=k,t.glslSigmoid=M,t.glslSqrt=S,t.glslTan=P,t.glslTanh=A;const C=(e,t,n,r)=>{const o=e.session.pack?a.TextureType.packed:a.TextureType.unpacked,i={name:n.name,inputTypes:[o],inputNames:["A"],cacheHint:r};return Object.assign(Object.assign({},i),{get:()=>((e,t,n,r)=>{const o=e.session.pack?a.TextureType.packed:a.TextureType.unpacked,i=(0,s.getGlsl)(e.session.backend.glContext.version);return Object.assign(Object.assign({},t),{output:{dims:n.dims,type:n.type,textureType:o},shaderSource:`\n ${r.body}\n void main() {\n vec4 v = ${i.texture2D}(A, TexCoords);\n v = ${r.name}_(v);\n ${i.output} = v;\n }\n `,hasMain:!0})})(e,i,t,n)})};t.abs=(e,t)=>[e.run(C(e,t[0],l()),t)],t.acos=(e,t)=>[e.run(C(e,t[0],c()),t)],t.asin=(e,t)=>[e.run(C(e,t[0],u()),t)],t.atan=(e,t)=>[e.run(C(e,t[0],p()),t)],t.clip=(e,t,n)=>[e.run(C(e,t[0],g(n.min,n.max),n.cacheKey),t)],t.parseClipAttributes=e=>(0,r.createAttributeWithCacheKey)({min:e.attributes.getFloat("min",o.MIN_CLIP),max:e.attributes.getFloat("max",o.MAX_CLIP)}),t.clipV11=(e,n)=>{const r=E(e,n);return(0,t.clip)(e,[n[0]],r)};const E=(e,t)=>{if(t.length>=3&&(!e.session.isInitializer(t[1].dataId)||!e.session.isInitializer(t[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const n=t.length>=3?t[1].numberData[0]:o.MIN_CLIP,i=t.length>=3?t[2].numberData[0]:o.MAX_CLIP;return(0,r.createAttributeWithCacheKey)({min:n,max:i})};t.ceil=(e,t)=>[e.run(C(e,t[0],d()),t)],t.cos=(e,t)=>[e.run(C(e,t[0],_()),t)],t.elu=(e,t,n)=>[e.run(C(e,t[0],h(n.alpha),n.cacheKey),t)],t.parseEluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",1)}),t.exp=(e,t)=>[e.run(C(e,t[0],f()),t)],t.floor=(e,t)=>[e.run(C(e,t[0],m()),t)],t.identity=(e,t)=>[e.run(C(e,t[0],b()),t)],t.leakyRelu=(e,t,n)=>[e.run(C(e,t[0],w(n.alpha),n.cacheKey),t)],t.parseLeakyReluAttributes=e=>(0,r.createAttributeWithCacheKey)({alpha:e.attributes.getFloat("alpha",.01)}),t.log=(e,t)=>[e.run(C(e,t[0],x()),t)],t.neg=(e,t)=>[e.run(C(e,t[0],y()),t)],t.not=(e,t)=>[e.run(C(e,t[0],T()),t)],t.relu=(e,t)=>[e.run(C(e,t[0],k()),t)],t.sigmoid=(e,t)=>[e.run(C(e,t[0],M()),t)],t.sin=(e,t)=>[e.run(C(e,t[0],v()),t)],t.sqrt=(e,t)=>[e.run(C(e,t[0],S()),t)],t.tan=(e,t)=>[e.run(C(e,t[0],P()),t)],t.tanh=(e,t)=>[e.run(C(e,t[0],A()),t)]},5611:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createUnpackProgramInfoLoader=t.createUnpackProgramInfo=void 0;const r=n(5060),o=n(2039),i=n(9390),s=n(2827),a={name:"unpack",inputNames:["A"],inputTypes:[o.TextureType.packed]};t.createUnpackProgramInfo=(e,t)=>{const n=t.dims.length,l=(0,s.getChannels)("rc",n),c=l.slice(-2),u=(0,i.getCoordsDataType)(n),p=(0,s.unpackFromChannel)(),d=0===t.dims.length?"":function(e,t){if(1===e)return"rc";let n="";for(let r=0;rObject.assign(Object.assign({},a),{get:()=>(0,t.createUnpackProgramInfo)(e,n)})},8428:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnsqueezeAttributes=t.unsqueezeV13=t.unsqueeze=void 0;const r=n(2517);t.unsqueeze=(e,t,n)=>{o(t);const i=r.ShapeUtil.unsqueezeShape(t[0].dims,n);return[e.reshapeUnpacked(t[0],i)]},t.unsqueezeV13=(e,n)=>(i(n),(0,t.unsqueeze)(e,[n[0]],Array.from(n[1].integerData))),t.parseUnsqueezeAttributes=e=>e.attributes.getInts("axes");const o=e=>{if(!e||1!==e.length)throw new Error("Unsqueeze requires 1 input.");if("string"===e[0].type)throw new Error("invalid input tensor types.")},i=e=>{if(!e||2!==e.length)throw new Error("Unsqueeze requires 2 inputs.");if("int32"!==e[1].type)throw new Error("Invalid input type.")}},9793:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scalesValidation=t.validateInputs=t.parseUpsampleAttributes=t.parseUpsampleAttributesV9=t.parseUpsampleAttributesV7=t.upsample=void 0;const r=n(246),o=n(5060),i=n(2039),s={name:"Upsample",inputNames:["X"],inputTypes:[i.TextureType.unpacked]};t.upsample=(e,n,r)=>((0,t.validateInputs)(n,r),[e.run(Object.assign(Object.assign({},s),{cacheHint:r.cacheKey,get:()=>a(e,n,r)}),n)]),t.parseUpsampleAttributesV7=e=>(0,t.parseUpsampleAttributes)(e,7),t.parseUpsampleAttributesV9=e=>(0,t.parseUpsampleAttributes)(e,9),t.parseUpsampleAttributes=(e,n)=>{const o=n>=10,i=e.attributes.getString("mode","nearest");if("nearest"!==i&&"linear"!==i&&(n<11||"cubic"!==i))throw new Error(`unrecognized mode: ${i}`);let s=[];n<9&&(s=e.attributes.getFloats("scales"),(0,t.scalesValidation)(s,i,o));const a=e.attributes.getFloat("extrapolation_value",0),l=n>10?e.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(l))throw new Error(`coordinate_transform_mode '${l}' is not supported`);const c="tf_crop_and_resize"===l,u=c,p="nearest"===i&&n>=11?e.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(p))throw new Error(`nearest_mode '${p}' is not supported`);const d=e.attributes.getFloat("cubic_coeff_a",-.75),_=0!==e.attributes.getInt("exclude_outside",0);if(_&&"cubic"!==i)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const h=n<11||"nearest"===i&&"asymmetric"===l&&"floor"===p;let f=0,m=0,g=0;return n>10?e.inputs.length>2?(f=1,m=2,g=3):(m=1,g=2):9===n&&(m=1),(0,r.createAttributeWithCacheKey)({opset:n,isResize:o,mode:i,scales:s,extrapolationValue:a,coordinateTransformMode:l,useExtrapolation:u,needRoiInput:c,nearestMode:p,cubicCoefficientA:d,excludeOutside:_,useNearest2xOptimization:h,roiInputIdx:f,scalesInputIdx:m,sizesInputIdx:g})};const a=(e,t,n)=>{const r=(0,o.getGlsl)(e.session.backend.glContext.version),[a,l]=e.calculateTextureWidthAndHeight(t[0].dims,i.TextureType.unpacked),c=t[0].dims.map(((e,t)=>Math.floor(e*n.scales[t]))),[u,p]=e.calculateTextureWidthAndHeight(c,i.TextureType.unpacked),d=c.length,_=new Array(d),h=new Array(d);let f=`\n int output_pitches[${d}];\n int input_pitches[${d}];\n `;for(let e=d-1;e>=0;e--)_[e]=e===d-1?1:_[e+1]*c[e+1],h[e]=e===d-1?1:h[e+1]*t[0].dims[e+1],f+=`\n output_pitches[${e}] = ${_[e]};\n input_pitches[${e}] = ${h[e]};\n `;const m=`\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ${a}, ${l});\n float value = getColorAsFloat(${r.texture2D}(X, coords));\n return value;\n }\n `,g="nearest"===n.mode?`\n ${m}\n float process(int indices[${d}]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${u}, ${p});\n\n ${f}\n\n int d, m;\n for (int dim = 0; dim < ${d}; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }`:4===d?`\n ${m}\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${u}, ${p});\n\n ${f}\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (${t[0].dims[2]} - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }`:`\n ${m}\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ${u}, ${p});\n\n ${f}\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (${t[0].dims[0]} - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }`;return Object.assign(Object.assign({},s),{output:{dims:c,type:t[0].type,textureType:i.TextureType.unpacked},shaderSource:g,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map((e=>Math.ceil(e)))}]})};t.validateInputs=(e,t)=>{if(!e||t.opset<9&&1!==e.length||t.opset>=9&&t.opset<11&&2!==e.length||t.opset>=11&&e.length<2)throw new Error("invalid inputs.");if(t.scales.length>0&&e[0].dims.length!==t.scales.length)throw new Error("Invalid input shape.");if("string"===e[0].type)throw new Error("Invalid input tensor types.")},t.scalesValidation=(e,t,n)=>{if(n){for(const t of e)if(t<=0)throw new Error("Scale value should be greater than 0.")}else for(const t of e)if(t<1)throw new Error("Scale value should be greater than or equal to 1.");if(!("linear"!==t&&"cubic"!==t||2===e.length||4===e.length&&1===e[0]&&1===e[1]))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${n?"Resize":"Upsample"} opeartor.`)}},1958:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProgramManager=void 0;const r=n(1670),o=n(6231),i=n(8879),s=n(5060);t.ProgramManager=class{constructor(e,t,n){this.profiler=e,this.glContext=t,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}getArtifact(e){return this.repo.get(e)}setArtifact(e,t){this.repo.set(e,t)}run(e,t,n){var r;this.profiler.event("op",`ProgramManager.run ${null!==(r=e.programInfo.name)&&void 0!==r?r:"unknown kernel"}`,(()=>{var r;const i=this.glContext.gl,s=e.program;i.useProgram(s);try{this.bindOutput(n),this.attributesBound||this.bindAttributes(e.attribLocations),this.bindUniforms(e.uniformLocations,null!==(r=e.programInfo.variables)&&void 0!==r?r:[],t)}catch(t){throw o.Logger.error("ProgramManager",e.programInfo.shaderSource),t}this.profiler.event("backend","GlContext.draw()",(()=>{this.glContext.draw()}))}),this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((e=>this.glContext.deleteProgram(e.program)))}build(e,t,n){return this.profiler.event("backend","ProgramManager.build",(()=>{const r=new i.GlslPreprocessor(this.glContext,e,t,n),o=r.preprocess(),s=this.compile(o);return{programInfo:e,program:s,uniformLocations:this.getUniformLocations(s,r.context.programInfo.inputNames,r.context.programInfo.variables),attribLocations:this.getAttribLocations(s)}}))}compile(e){if(!this.vertexShader){o.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const e=(0,s.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(e,this.glContext.gl.VERTEX_SHADER)}r.env.debug&&o.Logger.verbose("ProrgramManager",`FragShader:\n${e}\n`);const t=this.glContext.compileShader(e,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,t);return this.glContext.deleteShader(t),n}bindOutput(e){const t=e.width,n=e.height;o.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${t}/${n}, shape=${e.shape}, type=${e.tensor.type}`),this.glContext.attachFramebuffer(e.texture,t,n)}bindAttributes(e){const t=e.position,n=e.textureCoord;this.glContext.setVertexAttributes(t,n),this.attributesBound=!0}bindUniforms(e,t,n){var r;const o=this.glContext.gl;let i=0;for(const{name:s,type:a,location:l,arrayLength:c}of e){const e=null===(r=t.find((e=>e.name===s)))||void 0===r?void 0:r.data;if("sampler2D"!==a&&!e)throw new Error(`variable '${s}' does not have data defined in program info`);switch(a){case"sampler2D":this.bindTexture(n[i],l,i),i++;break;case"float":c?o.uniform1fv(l,e):o.uniform1f(l,e);break;case"int":c?o.uniform1iv(l,e):o.uniform1i(l,e);break;default:throw new Error(`Uniform not implemented: ${a}`)}}}bindTexture(e,t,n){this.glContext.bindTextureToUniform(e.texture,n,t)}getAttribLocations(e){return{position:this.getAttribLocation(e,"position"),textureCoord:this.getAttribLocation(e,"textureCoord")}}getUniformLocations(e,t,n){const r=[];if(t)for(const n of t)r.push({name:n,type:"sampler2D",location:this.getUniformLocation(e,n)});if(n)for(const t of n)r.push(Object.assign(Object.assign({},t),{location:this.getUniformLocation(e,t.name)}));return r}getUniformLocation(e,t){const n=this.glContext.gl.getUniformLocation(e,t);if(null===n)throw new Error(`Uniform ${t} not found.`);return n}getAttribLocation(e,t){return this.glContext.gl.getAttribLocation(e,t)}}},6416:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLSessionHandler=void 0;const r=n(6231),o=n(1047),i=n(8316),s=n(1640),a=n(1958),l=n(7859),c=n(5702);t.WebGLSessionHandler=class{constructor(e,t){this.backend=e,this.context=t,this.layoutStrategy=new l.PreferLogicalStrategy(e.glContext.maxTextureSize),this.programManager=new a.ProgramManager(this.context.profiler,e.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(e.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===e.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=e.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new i.WebGLInferenceHandler(this)}onGraphInitialized(e){const t=e.getValues().filter((e=>-1===e.from&&e.tensor)).map((e=>e.tensor.dataId));this.initializers=new Set(t)}isInitializer(e){return!!this.initializers&&this.initializers.has(e)}addInitializer(e){this.initializers.add(e)}getTextureData(e,t){return t?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,t,n=!1){r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(e,t):this.unpackedTextureDataCache.set(e,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((e=>this.textureManager.releaseTexture(e,!0))),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((e=>this.textureManager.releaseTexture(e,!0))),this.unpackedTextureDataCache=new Map}resolve(e,t,n){const r=(0,o.resolveOperator)(e,t,s.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(e,n):e}}}},7769:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Uint8DataEncoder=t.RGBAFloatDataEncoder=t.RedFloat32DataEncoder=void 0;const r=n(6231);t.RedFloat32DataEncoder=class{constructor(e,t=1){if(1===t)this.internalFormat=e.R32F,this.format=e.RED,this.textureType=e.FLOAT,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA32F,this.format=e.RGBA,this.textureType=e.FLOAT,this.channelSize=t}}encode(e,t){let n,o;return e.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),o=new Float32Array(e)),t*this.channelSize>e.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),o=e,n=this.allocate(t*this.channelSize),o.forEach(((e,t)=>n[t]=e))):(o=e,n=o),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter(((e,t)=>t%4==0)).subarray(0,t):e.subarray(0,t)}},t.RGBAFloatDataEncoder=class{constructor(e,t=1,n){if(1!==t&&4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.channelSize=t,this.textureType=n||e.FLOAT}encode(e,t){let n=e;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(t),e.forEach(((e,t)=>n[4*t]=e))),n}allocate(e){return new Float32Array(4*e)}decode(e,t){return 1===this.channelSize?e.filter(((e,t)=>t%4==0)).subarray(0,t):e.subarray(0,t)}},t.Uint8DataEncoder=class{constructor(e,t=1){if(this.channelSize=4,1===t)this.internalFormat=e.ALPHA,this.format=e.ALPHA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t;else{if(4!==t)throw new Error(`Invalid number of channels: ${t}`);this.internalFormat=e.RGBA,this.format=e.RGBA,this.textureType=e.UNSIGNED_BYTE,this.channelSize=t}}encode(e,t){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}allocate(e){return new Uint8Array(e*this.channelSize)}decode(e,t){if(e instanceof Uint8Array)return e.subarray(0,t);throw new Error(`Invalid array type: ${e.constructor}`)}}},7859:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getBatchDim=t.sizeToSquarishShape=t.getRowsCols=t.sizeFromShape=t.isInt=t.parseAxisParam=t.squeezeShape=t.PreferLogicalStrategy=t.AlwaysKeepOriginalSizeStrategy=void 0;const r=n(6231),o=n(2517);function i(e,t){const n=[],r=[],o=null!=t&&Array.isArray(t)&&0===t.length,i=null==t||o?null:s(t,e).sort();let a=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),r.push(t)),i[a]<=t&&a++}1!==e[t]&&(n.push(e[t]),r.push(t))}return{newShape:n,keptDims:r}}function s(e,t){const n=t.length;return e=null==e?t.map(((e,t)=>t)):[].concat(e),(0,o.assert)(e.every((e=>e>=-n&&e`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),(0,o.assert)(e.every(a),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function a(e){return e%1==0}function l(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n=e.length?1:e.slice(t.breakAxis).reduce(((e,t)=>e*t)),i=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce(((e,t)=>e*t));if(!(o>n||i>n))return[o,i];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}const o=e.reduce(((e,t)=>e*t));let i=Math.floor(Math.sqrt(o));for(;i=n||o%i!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${e}`);return[i,o/i]}},t.PreferLogicalStrategy=class{constructor(e){this.maxTextureSize=e}computeTextureWH(e,t){const n=this.computeTexture(e,t);return t&&t.isPacked&&(n[0]/=2,n[1]/=2),t&&t.reverseWH?[n[1],n[0]]:n}computeTexture(e,t){const n=t&&t.isPacked;if(0===e.length)return n?[2,2]:[1,1];let o=this.maxTextureSize;if(t&&void 0!==t.breakAxis){const n=t.breakAxis>=e.length?1:e.slice(t.breakAxis).reduce(((e,t)=>e*t)),i=t.breakAxis<=0?1:e.slice(0,t.breakAxis).reduce(((e,t)=>e*t));if(!(n>o||i>o))return[n,i];r.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${e}, breakAxis:${t.breakAxis}`)}let s=e.slice(0);if(n&&(o*=2,s=s.map(((e,t)=>t>=s.length-2?s[t]%2==0?s[t]:s[t]+1:s[t])),1===s.length&&(s=[2,s[0]])),2!==s.length){const e=i(s);s=e.newShape}const a=l(s);return s.length<=1&&a<=o?[1,a]:2===s.length&&s[0]<=o&&s[1]<=o?s:3===s.length&&s[0]*s[1]<=o&&s[2]<=o?[s[0]*s[1],s[2]]:3===s.length&&s[0]<=o&&s[1]*s[2]<=o?[s[0],s[1]*s[2]]:4===s.length&&s[0]*s[1]*s[2]<=o&&s[3]<=o?[s[0]*s[1]*s[2],s[3]]:4===s.length&&s[0]<=o&&s[1]*s[2]*s[3]<=o?[s[0],s[1]*s[2]*s[3]]:n?c(a/4).map((e=>2*e)):c(a)}},t.squeezeShape=i,t.parseAxisParam=s,t.isInt=a,t.sizeFromShape=l,t.getRowsCols=function(e){if(0===e.length)throw Error("Cannot get rows and columns of an empty shape array.");return[e.length>1?e[e.length-2]:1,e[e.length-1]]},t.sizeToSquarishShape=c,t.getBatchDim=function(e,t=2){return l(e.slice(0,e.length-t))}},4057:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTextureLayoutFromShape=t.calculateTextureWidthAndHeight=t.createTextureLayoutFromTextureType=void 0;const r=n(2517),o=n(2039);t.createTextureLayoutFromTextureType=(e,n,r)=>{const i=r===o.TextureType.unpacked||r===o.TextureType.unpackedReversed?1:4,s=r===o.TextureType.packed,a=r===o.TextureType.unpackedReversed||r===o.TextureType.packed,l=r===o.TextureType.packedLastDimension?n.length-1:void 0,c=r===o.TextureType.packedLastDimension?n.map(((e,t)=>t===n.length-1?4*e:e)):void 0;return(0,t.createTextureLayoutFromShape)(e,n,i,c,{isPacked:s,reverseWH:a,breakAxis:l})},t.calculateTextureWidthAndHeight=(e,n,r)=>{const o=(0,t.createTextureLayoutFromTextureType)(e,n,r);return[o.width,o.height]},t.createTextureLayoutFromShape=(e,t,n=1,o,i)=>{const s=!(!i||!i.isPacked),[a,l]=e.computeTextureWH(s&&o||t,i),c=t.length;let u=t.slice(0);if(0===c&&(u=[1]),1===n)o=t;else if(s){if(4!==n)throw new Error("a packed texture must be 4-channel");o=t,c>0&&(u[c-1]=Math.ceil(u[c-1]/2)),c>1&&(u[c-2]=Math.ceil(u[c-2]/2))}else if(!o)throw new Error("Unpacked shape is needed when using channels > 1");return{width:a,height:l,channels:n,isPacked:s,shape:u,strides:r.ShapeUtil.computeStrides(u),unpackedShape:o,reversedWH:i&&i.reverseWH}}},5702:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureManager=void 0;const r=n(6231);t.TextureManager=class{constructor(e,t,n,r){this.glContext=e,this.layoutStrategy=t,this.profiler=n,this.config=r,this.pendingRead=new Map,r.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(e,t,n,o){const i=this.toEncoderType(e),s=this.glContext.getEncoder(i,t.channels||1,o);if(t.isPacked&&1===o)throw new Error("not implemented");const a=t.width,l=t.height;let c,u;if(this.config.reuseTextures){c=`${a}x${l}_${s.format}_${s.internalFormat}_${s.textureType}`,u=this.inUseTextures.get(c),u||(u=[],this.inUseTextures.set(c,u));const t=this.idleTextures.get(c);if(t&&t.length>0){const r=t.pop();return u.push(r),1===o&&this.glContext.updateTexture(r,a,l,s,this.toTextureData(e,n)),r}}r.Logger.verbose("TextureManager",`Creating new texture of size ${t.width}x${t.height}`);const p=this.glContext.allocateTexture(a,l,s,this.toTextureData(e,n));return this.config.reuseTextures&&(u.push(p),this.textureLookup.set(p,c)),p}readTexture(e,t,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",(()=>{const r=e.shape.reduce(((e,t)=>e*t))*n,o=this.glContext.readTexture(e.texture,e.width,e.height,r,this.toEncoderType(t),n);return this.toTensorData(t,o)}))}async readTextureAsync(e,t,n){const r=e.tensor.dataId;if(n||(n=1),this.pendingRead.has(r)){const e=this.pendingRead.get(r);return new Promise((t=>null==e?void 0:e.push(t)))}return this.profiler.event("backend","TextureManager.readTextureAsync",(async()=>{this.pendingRead.set(r,[]);const o=e.shape.reduce(((e,t)=>e*t))*n;await this.glContext.createAndWaitForFence();const i=this.glContext.readTexture(e.texture,e.width,e.height,o,this.toEncoderType(t),n),s=this.toTensorData(t,i),a=this.pendingRead.get(r);return this.pendingRead.delete(r),null==a||a.forEach((e=>e(s))),s}))}readUint8TextureAsFloat(e){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",(()=>{const t=e.shape.reduce(((e,t)=>e*t)),n=this.glContext.readTexture(e.texture,e.width,e.height,4*t,"byte",4);return new Float32Array(n.buffer,n.byteOffset,t)}))}releaseTexture(e,t){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(e.texture),n)){t&&this.textureLookup.delete(n);const r=this.inUseTextures.get(n);if(r){const t=r.indexOf(e.texture);if(-1!==t){r.splice(t,1);let o=this.idleTextures.get(n);o||(o=[],this.idleTextures.set(n,o)),o.push(e.texture)}}}n&&!t||(r.Logger.verbose("TextureManager",`Deleting texture of size ${e.width}x${e.height}`),this.glContext.deleteTexture(e.texture))}toTensorData(e,t){switch(e){case"int16":return t instanceof Int16Array?t:Int16Array.from(t);case"int32":return t instanceof Int32Array?t:Int32Array.from(t);case"int8":return t instanceof Int8Array?t:Int8Array.from(t);case"uint16":return t instanceof Uint16Array?t:Uint16Array.from(t);case"uint32":return t instanceof Uint32Array?t:Uint32Array.from(t);case"uint8":case"bool":return t instanceof Uint8Array?t:Uint8Array.from(t);case"float32":return t instanceof Float32Array?t:Float32Array.from(t);case"float64":return t instanceof Float64Array?t:Float64Array.from(t);default:throw new Error(`TensorData type ${e} is not supported`)}}toTextureData(e,t){if(t)return t instanceof Float32Array?t:new Float32Array(t)}toEncoderType(e){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TextureType=void 0,(n=t.TextureType||(t.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlChannels=t.getCoordsDataType=t.getSqueezedParams=t.squeezeInputShape=t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=t.generateShaderFuncNameFromInputSamplerName=t.repeatedTry=t.getPackedShape=void 0;const r=n(2517);t.getPackedShape=function(e){const t=e.length;return e.slice(0,t-1).concat(e[t-1]/4)},t.repeatedTry=async function(e,t=(e=>0),n){return new Promise(((r,o)=>{let i=0;const s=()=>{if(e())return void r();i++;const a=t(i);null!=n&&i>=n?o():setTimeout(s,a)};s()}))},t.generateShaderFuncNameFromInputSamplerName=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,(()=>"empty string found for sampler name")),"get"+e.charAt(0).toUpperCase()+e.slice(1)},t.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(e){return(0,r.assert)(void 0!==e&&0!==e.length,(()=>"empty string found for sampler name")),"get"+e.charAt(0).toUpperCase()+e.slice(1)+"AtOutCoords"},t.squeezeInputShape=function(e,t){let n=JSON.parse(JSON.stringify(e));return n=t,n},t.getSqueezedParams=function(e,t){return t.map((t=>e[t])).join(", ")},t.getCoordsDataType=function(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)},t.getGlChannels=function(e=6){return["x","y","z","w","u","v"].slice(0,e)}},7305:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNewWebGLContext=t.createWebGLContext=void 0;const r=n(6231),o=n(1713),i={};function s(e){const t=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const e=document.createElement("canvas");return e.width=1,e.height=1,e}();let n;const i={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!e||"webgl2"===e)&&(n=t.getContext("webgl2",i),n))try{return new o.WebGLContext(n,2)}catch(e){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${e}`)}if((!e||"webgl"===e)&&(n=t.getContext("webgl",i)||t.getContext("experimental-webgl",i),n))try{return new o.WebGLContext(n,1)}catch(e){r.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${e}`)}throw new Error("WebGL is not supported")}t.createWebGLContext=function e(t){let n;t&&"webgl2"!==t||!("webgl2"in i)?t&&"webgl"!==t||!("webgl"in i)||(n=i.webgl):n=i.webgl2,n=n||s(t),t=t||1===n.version?"webgl":"webgl2";const r=n.gl;return i[t]=n,r.isContextLost()?(delete i[t],e(t)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},t.createNewWebGLContext=s},1713:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLContext=t.linearSearchLastTrue=void 0;const s=n(1670),a=i(n(7769)),l=n(9390);function c(e){let t=0;for(;tthis.isTimerResultAvailable(e))),this.getTimerResult(e)}async createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t;const n=e,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),t=null===r?()=>!0:()=>{const e=n.clientWaitSync(r,0,0);return e===n.ALREADY_SIGNALED||e===n.CONDITION_SATISFIED},{query:r,isFencePassed:t}}async pollFence(e){return new Promise((t=>{this.addItemToPoll((()=>e.isFencePassed()),(()=>t()))}))}pollItems(){const e=c(this.itemsToPoll.map((e=>e.isDoneFn)));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}async addItemToPoll(e,t){this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||await(0,l.repeatedTry)((()=>(this.pollItems(),0===this.itemsToPoll.length)))}}},1036:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutionPlan=void 0;const r=n(6231);class o{constructor(e,t){this.op=e,this.node=t}}t.ExecutionPlan=class{constructor(e,t,n){this.graph=e,this.profiler=n,this.initialize(t)}initialize(e){this.profiler.event("session","ExecutionPlan.initialize",(()=>{const t=this.graph.getNodes();if(t.length!==e.length)throw new Error("The size of nodes and OPs do not match.");this._ops=e.map(((e,n)=>new o(e,t[n]))),this.reset(),this._starter=[],this._ops.forEach(((e,t)=>{let n=!0;for(const t of e.node.inputs)if(!this._values[t]&&-1===this.graph.getInputIndices().indexOf(t)){n=!1;break}n&&this._starter.push(t)}))}))}reset(){this._values=this.graph.getValues().map((e=>e.tensor))}async execute(e,t){return this.profiler.event("session","ExecutionPlan.execute",(async()=>{this.reset();const n=e.createInferenceHandler(),o=this.graph.getInputIndices();if(t.length!==o.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${t.length} expected: ${o.length}`);t.forEach(((e,t)=>{const n=o[t];this._values[n]=e}));const i=this._starter.slice(0),s=this.graph.getValues(),a=this.graph.getNodes();let l=0;for(;lthis._values[e]));if(-1!==o.indexOf(void 0))throw new Error(`unresolved input detected: op: ${t.node}`);const c=o;r.Logger.verbose("ExecPlan",`Runing op:${t.node.name} (${c.map(((e,n)=>`'${t.node.inputs[n]}': ${e.type}[${e.dims.join(",")}]`)).join(", ")})`);const u=await this.profiler.event("node",t.node.name,(async()=>t.op.impl(n,c,t.op.context)));if(u.length!==t.node.outputs.length)throw new Error("the size of output does not match model definition.");u.forEach(((e,n)=>{const r=t.node.outputs[n];if(this._values[r])throw new Error(`output [${r}] already has value: op:${t.node.name}`);this._values[r]=e}));const p=new Set;u.forEach(((e,n)=>{const r=t.node.outputs[n];for(const e of s[r].to){const t=a[e];let n=!0;for(const e of t.inputs)if(!this._values[e]){n=!1;break}n&&p.add(e)}})),i.push(...p)}const c=[];for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.Graph=void 0;const r=n(1446),o=n(7778),i=n(9395),s=n(9162),a=n(2517);var l=i.onnxruntime.experimental.fbs;t.Graph={from:(e,t)=>new p(e,t)};class c{constructor(e){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,e&&(this.type=a.ProtoUtil.tensorValueTypeFromProto(e.type.tensorType))}get from(){return this._from}get to(){return this._to}}class u{constructor(e,t){e instanceof r.onnx.NodeProto?(this.name=e.name,this.opType=e.opType,this.attributes=new o.Attribute(e.attribute)):e instanceof l.Node&&(this.name=null!=t?t:e.name(),this.opType=e.opType(),this.attributes=new o.Attribute(a.ProtoUtil.tensorAttributesFromORTFormat(e))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class p{constructor(e,t){if(!e)throw new TypeError("graph is empty");this.buildGraph(e),this.transformGraph(t),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(e){if(e instanceof r.onnx.GraphProto)this.buildGraphFromOnnxFormat(e);else{if(!(e instanceof l.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(e)}}buildGraphFromOnnxFormat(e){const t=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const n=new Map;if(!e.input)throw new Error("missing information in graph: input");const r=[];for(const n of e.input){if(t.has(n.name))throw new Error(`duplicated input name: ${n.name}`);const e=this._allData.push(new c(n))-1;t.set(n.name,e),r.push(n.name)}if(!e.initializer)throw new Error("missing information in graph: initializer");for(const n of e.initializer){let e=t.get(n.name);if(void 0===e){const r=new c;r.type={shape:{dims:a.ProtoUtil.tensorDimsFromProto(n.dims)},tensorType:a.ProtoUtil.tensorDataTypeFromProto(n.dataType)},e=this._allData.push(r)-1,t.set(n.name,e)}this._allData[e]._from=-1,this._allData[e].tensor=s.Tensor.fromProto(n)}for(let e=0;e{this._allData[t]._to.forEach((t=>{e.add(t)}))}));const t=Array.from(e),n=new Array(this._nodes.length).fill("white");for(;t.length>0;){const e=t.pop();"gray"===n[e]?n[e]="black":(t.push(e),n[e]="gray",this._nodes[e].outputs.forEach((r=>{const o=this._allData[r];if(void 0!==o.tensor)throw new Error("node outputs should not be initialized");if(o._from!==e)throw new Error("from property of the Value object doesn't match index of Node being processed");o._to.forEach((e=>{if("gray"===n[e])throw new Error("model graph is cyclic");"white"===n[e]&&t.push(e)}))})))}}transformGraph(e){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),e&&e.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let e=0;for(let t=0;t0&&(this._nodes[t].inputs.forEach((n=>{const r=this._allData[n]._to.indexOf(t+e);-1!==r&&(this._allData[n]._to[r]=t)})),this._nodes[t].outputs.forEach((n=>{this._allData[n]._from&&this._allData[n]._from===t+e&&(this._allData[n]._from=t)}))):(e++,this._nodes[t].outputs.forEach((e=>{this._allData[e]._from=-2})),this._nodes.splice(t,1),t--);e=0;for(let t=0;t0){let n=-1;void 0!==this._allData[t].from&&-1!==this._allData[t].from?(n=this._nodes[this._allData[t].from].outputs.indexOf(t+e),-1!==n&&(this._nodes[this._allData[t].from].outputs[n]=t)):(n=this._allInputIndices.indexOf(t+e),-1!==n&&(this._allInputIndices[n]=t)),this._allData[t].to.forEach((r=>{n=this._nodes[r].inputs.indexOf(t+e),-1!==n&&(this._nodes[r].inputs[n]=t)})),0===this._allData[t].to.length&&(n=this._allOutputIndices.indexOf(t+e),-1!==n&&(this._allOutputIndices[n]=t))}}else e++,this._allData.splice(t,1),t--}deleteNode(e){const t=this._nodes[e];if(t.outputs.length>1)for(let e=1;e0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");t.executeNode=!1;const n=t.inputs[0],r=t.outputs[0],o=this._allData[r].to,i=this._allData[n].to.indexOf(e);if(-1===i)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[n].to.splice(i,1),this._allData[r]._to=[];const s=this._allOutputIndices.indexOf(r);if(-1!==s&&(this._allOutputIndices[s]=n),o&&o.length>0)for(const e of o){const t=this._nodes[e].inputs.indexOf(r);if(-1===t)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[e].inputs[t]=n,this._allData[n].to.push(e)}}removeAllDropoutNodes(){let e=0;for(const t of this._nodes){if("Dropout"===t.opType){if(1!==t.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==t.outputs.length&&2!==t.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===t.outputs.length&&0!==this._allData[t.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(e)}e++}}removeAllIdentityNodes(){let e=0;for(const t of this._nodes)"Identity"===t.opType&&this.deleteNode(e),e++}isActivation(e){switch(e.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const e of this._nodes)if("Conv"===e.opType){const t=this._allData[e.outputs[0]]._to;if(1===t.length&&this.isActivation(this._nodes[t[0]])){const n=this._nodes[t[0]];if("Clip"===n.opType)if(1===n.inputs.length)try{e.attributes.set("activation_params","floats",[n.attributes.getFloat("min"),n.attributes.getFloat("max")])}catch(t){e.attributes.set("activation_params","floats",[a.MIN_CLIP,a.MAX_CLIP])}else{if(!(n.inputs.length>=3&&void 0!==this._allData[n.inputs[1]].tensor&&void 0!==this._allData[n.inputs[2]].tensor))continue;e.attributes.set("activation_params","floats",[this._allData[n.inputs[1]].tensor.floatData[0],this._allData[n.inputs[2]].tensor.floatData[0]])}e.attributes.set("activation","string",n.opType),this.deleteNode(t[0])}}}}},6231:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.now=t.Profiler=t.Logger=void 0;const n={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},r={none:new class{log(e,t,n){}},console:new class{log(e,t,n){console.log(`${this.color(e)} ${n?""+n+" ":""}${t}`)}color(e){switch(e){case"verbose":return"v";case"info":return"i";case"warning":return"w";case"error":return"e";case"fatal":return"f";default:throw new Error(`unsupported severity: ${e}`)}}}},o={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let i={"":o};function s(e,t,n,r){if(void 0===t)return o=e,{verbose:s.verbose.bind(null,o),info:s.info.bind(null,o),warning:s.warning.bind(null,o),error:s.error.bind(null,o),fatal:s.fatal.bind(null,o)};if(void 0===n)a(e,t);else if("number"==typeof n&&void 0===r)a(e,t);else if("string"==typeof n&&void 0===r)a(e,n,0,t);else{if("string"!=typeof n||"number"!=typeof r)throw new TypeError("input is valid");a(e,n,0,t)}var o}function a(e,t,o,s){const a=i[s||""]||i[""];n[e]{s.then((async t=>{o&&await o.end(),e(t)}),(async e=>{o&&await o.end(),t(e)}))}));if(!i&&o){const e=o.end();if(e&&"function"==typeof e.then)return new Promise(((t,n)=>{e.then((()=>{t(s)}),(e=>{n(e)}))}))}return s}begin(e,n,r){if(!this._started)throw new Error("profiler is not started yet");if(void 0===r){const r=(0,t.now)();return this.flush(r),new l(e,n,r,(e=>this.endSync(e)))}{const t=r.beginTimer();return new l(e,n,0,(async e=>this.end(e)),t,r)}}async end(e){const t=await e.checkTimer();this._timingEvents.length=this._flushBatchSize||e-this._flushTime>=this._flushIntervalInMilliseconds){for(const e=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const r=n(5686),o=n(1446),i=n(7070),s=n(9395),a=n(2517);var l=s.onnxruntime.experimental.fbs;t.Model=class{constructor(){}load(e,t,n){if(!n)try{return void this.loadFromOnnxFormat(e,t)}catch(e){if(void 0!==n)throw e}this.loadFromOrtFormat(e,t)}loadFromOnnxFormat(e,t){const n=o.onnx.ModelProto.decode(e);if(a.LongUtil.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map((e=>({domain:e.domain,version:a.LongUtil.longToNumber(e.version)}))),this._graph=i.Graph.from(n.graph,t)}loadFromOrtFormat(e,t){const n=new r.flatbuffers.ByteBuffer(e),o=l.InferenceSession.getRootAsInferenceSession(n).model();if(a.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.FLOAT_TYPES=t.INT_TYPES=t.NUMBER_TYPES=void 0,t.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],t.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],t.FLOAT_TYPES=["float32","float64"]},1047:(e,t)=>{function n(e,t){if(t.endsWith("+")){const n=Number.parseInt(t.substring(0,t.length-1),10);return!isNaN(n)&&n<=e}if(2===t.split("-").length){const n=t.split("-"),r=Number.parseInt(n[0],10),o=Number.parseInt(n[1],10);return!isNaN(r)&&!isNaN(o)&&r<=e&&e<=o}return Number.parseInt(t,10)===e}Object.defineProperty(t,"__esModule",{value:!0}),t.resolveOperator=void 0,t.resolveOperator=function(e,t,r){for(const o of r){const r=o[0],i=o[1],s=o[2],a=o[3],l=o[4];if(e.opType===r)for(const e of t)if((e.domain===i||"ai.onnx"===e.domain&&""===i)&&n(e.version,s))return{opImpl:a,opInit:l}}throw new TypeError(`cannot resolve operator '${e.opType}' with opsets: ${t.map((e=>`${e.domain||"ai.onnx"} v${e.version}`)).join(", ")}`)}},9395:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.onnxruntime=void 0;const r=n(5686);var o,i;(function(e){let t;!function(e){e[e.UNDEFINED=0]="UNDEFINED",e[e.FLOAT=1]="FLOAT",e[e.INT=2]="INT",e[e.STRING=3]="STRING",e[e.TENSOR=4]="TENSOR",e[e.GRAPH=5]="GRAPH",e[e.FLOATS=6]="FLOATS",e[e.INTS=7]="INTS",e[e.STRINGS=8]="STRINGS",e[e.TENSORS=9]="TENSORS",e[e.GRAPHS=10]="GRAPHS",e[e.SPARSE_TENSOR=11]="SPARSE_TENSOR",e[e.SPARSE_TENSORS=12]="SPARSE_TENSORS"}(t=e.AttributeType||(e.AttributeType={}))})((i=(o=t.onnxruntime||(t.onnxruntime={})).experimental||(o.experimental={})).fbs||(i.fbs={})),function(e){!function(e){!function(e){let t;!function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.VALUE=1]="VALUE",e[e.PARAM=2]="PARAM"}(t=e.DimensionValueType||(e.DimensionValueType={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){let t;!function(e){e[e.UNDEFINED=0]="UNDEFINED",e[e.FLOAT=1]="FLOAT",e[e.UINT8=2]="UINT8",e[e.INT8=3]="INT8",e[e.UINT16=4]="UINT16",e[e.INT16=5]="INT16",e[e.INT32=6]="INT32",e[e.INT64=7]="INT64",e[e.STRING=8]="STRING",e[e.BOOL=9]="BOOL",e[e.FLOAT16=10]="FLOAT16",e[e.DOUBLE=11]="DOUBLE",e[e.UINT32=12]="UINT32",e[e.UINT64=13]="UINT64",e[e.COMPLEX64=14]="COMPLEX64",e[e.COMPLEX128=15]="COMPLEX128",e[e.BFLOAT16=16]="BFLOAT16"}(t=e.TensorDataType||(e.TensorDataType={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){let t;!function(e){e[e.Primitive=0]="Primitive",e[e.Fused=1]="Fused"}(t=e.NodeType||(e.NodeType={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){let t;!function(e){e[e.NONE=0]="NONE",e[e.tensor_type=1]="tensor_type",e[e.sequence_type=2]="sequence_type",e[e.map_type=3]="map_type"}(t=e.TypeInfoValue||(e.TypeInfoValue={}))}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dim(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}dimLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}static startShape(e){e.startObject(1)}static addDim(e,t){e.addFieldOffset(0,t,0)}static createDimVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startDimVector(e,t){e.startVector(4,t,4)}static endShape(e){return e.endObject()}static createShape(e,t){return n.startShape(e),n.addDim(e,t),n.endShape(e)}}t.Shape=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimension(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimension(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}value(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}denotation(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimension(e){e.startObject(2)}static addValue(e,t){e.addFieldOffset(0,t,0)}static addDenotation(e,t){e.addFieldOffset(1,t,0)}static endDimension(e){return e.endObject()}static createDimension(e,t,r){return n.startDimension(e),n.addValue(e,t),n.addDenotation(e,r),n.endDimension(e)}}t.Dimension=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDimensionValue(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDimensionValue(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):e.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}dimParam(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}static startDimensionValue(e){e.startObject(3)}static addDimType(t,n){t.addFieldInt8(0,n,e.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static addDimParam(e,t){e.addFieldOffset(2,t,0)}static endDimensionValue(e){return e.endObject()}static createDimensionValue(e,t,r,o){return n.startDimensionValue(e),n.addDimType(e,t),n.addDimValue(e,r),n.addDimParam(e,o),n.endDimensionValue(e)}}t.DimensionValue=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensorTypeAndShape(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensorTypeAndShape(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startTensorTypeAndShape(e){e.startObject(2)}static addElemType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(e,t){e.addFieldOffset(1,t,0)}static endTensorTypeAndShape(e){return e.endObject()}static createTensorTypeAndShape(e,t,r){return n.startTensorTypeAndShape(e),n.addElemType(e,t),n.addShape(e,r),n.endTensorTypeAndShape(e)}}t.TensorTypeAndShape=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMapType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMapType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startMapType(e){e.startObject(2)}static addKeyType(t,n){t.addFieldInt32(0,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(e,t){e.addFieldOffset(1,t,0)}static endMapType(e){return e.endObject()}static createMapType(e,t,r){return n.startMapType(e),n.addKeyType(e,t),n.addValueType(e,r),n.endMapType(e)}}t.MapType=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSequenceType(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSequenceType(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}elemType(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSequenceType(e){e.startObject(1)}static addElemType(e,t){e.addFieldOffset(0,t,0)}static endSequenceType(e){return e.endObject()}static createSequenceType(e,t){return n.startSequenceType(e),n.addElemType(e,t),n.endSequenceType(e)}}t.SequenceType=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){(e.fbs||(e.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(e,t,n,r){return e.prep(4,12),e.writeInt32(r),e.writeInt32(n),e.writeInt32(t),e.offset()}}}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNodeEdge(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNodeEdge(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}nodeIndex(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb_pos+e):0}inputEdges(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}inputEdgesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}outputEdges(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*t,this.bb):null}outputEdgesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNodeEdge(e){e.startObject(3)}static addNodeIndex(e,t){e.addFieldInt32(0,t,0)}static addInputEdges(e,t){e.addFieldOffset(1,t,0)}static startInputEdgesVector(e,t){e.startVector(12,t,4)}static addOutputEdges(e,t){e.addFieldOffset(2,t,0)}static startOutputEdgesVector(e,t){e.startVector(12,t,4)}static endNodeEdge(e){return e.endObject()}static createNodeEdge(e,t,r,o){return n.startNodeEdge(e),n.addNodeIndex(e,t),n.addInputEdges(e,r),n.addOutputEdges(e,o),n.endNodeEdge(e)}}t.NodeEdge=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNode(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNode(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}sinceVersion(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):0}index(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint32(this.bb_pos+e):0}opType(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.NodeType.Primitive}executionProviderType(e){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__string(this.bb_pos+t,e):null}inputs(e,t){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}attributes(t,n){let r=this.bb.__offset(this.bb_pos,24);return r?(n||new e.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}attributesLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCounts(e){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+4*e):0}inputArgCountsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}inputArgCountsArray(){let e=this.bb.__offset(this.bb_pos,26);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}implicitInputs(e,t){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}implicitInputsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startNode(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDomain(e,t){e.addFieldOffset(2,t,0)}static addSinceVersion(e,t){e.addFieldInt32(3,t,0)}static addIndex(e,t){e.addFieldInt32(4,t,0)}static addOpType(e,t){e.addFieldOffset(5,t,0)}static addType(t,n){t.addFieldInt32(6,n,e.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(e,t){e.addFieldOffset(7,t,0)}static addInputs(e,t){e.addFieldOffset(8,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(9,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addAttributes(e,t){e.addFieldOffset(10,t,0)}static createAttributesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startAttributesVector(e,t){e.startVector(4,t,4)}static addInputArgCounts(e,t){e.addFieldOffset(11,t,0)}static createInputArgCountsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startInputArgCountsVector(e,t){e.startVector(4,t,4)}static addImplicitInputs(e,t){e.addFieldOffset(12,t,0)}static createImplicitInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startImplicitInputsVector(e,t){e.startVector(4,t,4)}static endNode(e){return e.endObject()}static createNode(e,t,r,o,i,s,a,l,c,u,p,d,_,h){return n.startNode(e),n.addName(e,t),n.addDocString(e,r),n.addDomain(e,o),n.addSinceVersion(e,i),n.addIndex(e,s),n.addOpType(e,a),n.addType(e,l),n.addExecutionProviderType(e,c),n.addInputs(e,u),n.addOutputs(e,p),n.addAttributes(e,d),n.addInputArgCounts(e,_),n.addImplicitInputs(e,h),n.endNode(e)}}t.Node=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsValueInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsValueInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startValueInfo(e){e.startObject(3)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(e,t){e.addFieldOffset(2,t,0)}static endValueInfo(e){return e.endObject()}static createValueInfo(e,t,r,o){return n.startValueInfo(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.endValueInfo(e)}}t.ValueInfo=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTypeInfo(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTypeInfo(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}denotation(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):e.experimental.fbs.TypeInfoValue.NONE}value(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}static startTypeInfo(e){e.startObject(3)}static addDenotation(e,t){e.addFieldOffset(0,t,0)}static addValueType(t,n){t.addFieldInt8(1,n,e.experimental.fbs.TypeInfoValue.NONE)}static addValue(e,t){e.addFieldOffset(2,t,0)}static endTypeInfo(e){return e.endObject()}static createTypeInfo(e,t,r,o){return n.startTypeInfo(e),n.addDenotation(e,t),n.addValueType(e,r),n.addValue(e,o),n.endTypeInfo(e)}}t.TypeInfo=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsOperatorSetId(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsOperatorSetId(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}domain(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}version(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}static startOperatorSetId(e){e.startObject(2)}static addDomain(e,t){e.addFieldOffset(0,t,0)}static addVersion(e,t){e.addFieldInt64(1,t,e.createLong(0,0))}static endOperatorSetId(e){return e.endObject()}static createOperatorSetId(e,n,r){return t.startOperatorSetId(e),t.addDomain(e,n),t.addVersion(e,r),t.endOperatorSetId(e)}}e.OperatorSetId=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.TensorDataType.UNDEFINED}rawData(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}rawDataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}rawDataArray(){let e=this.bb.__offset(this.bb_pos,12);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}stringData(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringDataLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}static startTensor(e){e.startObject(6)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static addDataType(t,n){t.addFieldInt32(3,n,e.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(e,t){e.addFieldOffset(4,t,0)}static createRawDataVector(e,t){e.startVector(1,t.length,1);for(let n=t.length-1;n>=0;n--)e.addInt8(t[n]);return e.endVector()}static startRawDataVector(e,t){e.startVector(1,t,1)}static addStringData(e,t){e.addFieldOffset(5,t,0)}static createStringDataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringDataVector(e,t){e.startVector(4,t,4)}static endTensor(e){return e.endObject()}static createTensor(e,t,r,o,i,s,a){return n.startTensor(e),n.addName(e,t),n.addDocString(e,r),n.addDims(e,o),n.addDataType(e,i),n.addRawData(e,s),n.addStringData(e,a),n.endTensor(e)}}t.Tensor=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSparseTensor(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSparseTensor(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}values(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}indices(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}dims(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}dimsLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSparseTensor(e){e.startObject(3)}static addValues(e,t){e.addFieldOffset(0,t,0)}static addIndices(e,t){e.addFieldOffset(1,t,0)}static addDims(e,t){e.addFieldOffset(2,t,0)}static createDimsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startDimsVector(e,t){e.startVector(8,t,8)}static endSparseTensor(e){return e.endObject()}static createSparseTensor(e,t,r,o){return n.startSparseTensor(e),n.addValues(e,t),n.addIndices(e,r),n.addDims(e,o),n.endSparseTensor(e)}}t.SparseTensor=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsAttribute(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsAttribute(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}docString(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):e.experimental.fbs.AttributeType.UNDEFINED}f(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat32(this.bb_pos+e):0}i(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}s(e){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}t(t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}g(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}floats(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readFloat32(this.bb.__vector(this.bb_pos+t)+4*e):0}floatsLength(){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__vector_len(this.bb_pos+e):0}floatsArray(){let e=this.bb.__offset(this.bb_pos,20);return e?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}ints(e){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}intsLength(){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__vector_len(this.bb_pos+e):0}strings(e,t){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}stringsLength(){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__vector_len(this.bb_pos+e):0}tensors(t,n){let r=this.bb.__offset(this.bb_pos,26);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}tensorsLength(){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__vector_len(this.bb_pos+e):0}graphs(t,n){let r=this.bb.__offset(this.bb_pos,28);return r?(n||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}graphsLength(){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__vector_len(this.bb_pos+e):0}static startAttribute(e){e.startObject(13)}static addName(e,t){e.addFieldOffset(0,t,0)}static addDocString(e,t){e.addFieldOffset(1,t,0)}static addType(t,n){t.addFieldInt32(2,n,e.experimental.fbs.AttributeType.UNDEFINED)}static addF(e,t){e.addFieldFloat32(3,t,0)}static addI(e,t){e.addFieldInt64(4,t,e.createLong(0,0))}static addS(e,t){e.addFieldOffset(5,t,0)}static addT(e,t){e.addFieldOffset(6,t,0)}static addG(e,t){e.addFieldOffset(7,t,0)}static addFloats(e,t){e.addFieldOffset(8,t,0)}static createFloatsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addFloat32(t[n]);return e.endVector()}static startFloatsVector(e,t){e.startVector(4,t,4)}static addInts(e,t){e.addFieldOffset(9,t,0)}static createIntsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startIntsVector(e,t){e.startVector(8,t,8)}static addStrings(e,t){e.addFieldOffset(10,t,0)}static createStringsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startStringsVector(e,t){e.startVector(4,t,4)}static addTensors(e,t){e.addFieldOffset(11,t,0)}static createTensorsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startTensorsVector(e,t){e.startVector(4,t,4)}static addGraphs(e,t){e.addFieldOffset(12,t,0)}static createGraphsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startGraphsVector(e,t){e.startVector(4,t,4)}static endAttribute(e){return e.endObject()}static createAttribute(e,t,r,o,i,s,a,l,c,u,p,d,_,h){return n.startAttribute(e),n.addName(e,t),n.addDocString(e,r),n.addType(e,o),n.addF(e,i),n.addI(e,s),n.addS(e,a),n.addT(e,l),n.addG(e,c),n.addFloats(e,u),n.addInts(e,p),n.addStrings(e,d),n.addTensors(e,_),n.addGraphs(e,h),n.endAttribute(e)}}t.Attribute=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsGraph(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsGraph(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}initializers(t,n){let r=this.bb.__offset(this.bb_pos,4);return r?(n||new e.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}initializersLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeArgs(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeArgsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}nodes(t,n){let r=this.bb.__offset(this.bb_pos,8);return r?(n||new e.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}maxNodeIndex(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readUint32(this.bb_pos+e):0}nodeEdges(t,n){let r=this.bb.__offset(this.bb_pos,12);return r?(n||new e.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}nodeEdgesLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}inputs(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}inputsLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}outputs(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*e,t):null}outputsLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}sparseInitializers(t,n){let r=this.bb.__offset(this.bb_pos,18);return r?(n||new e.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}sparseInitializersLength(){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}static startGraph(e){e.startObject(8)}static addInitializers(e,t){e.addFieldOffset(0,t,0)}static createInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInitializersVector(e,t){e.startVector(4,t,4)}static addNodeArgs(e,t){e.addFieldOffset(1,t,0)}static createNodeArgsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeArgsVector(e,t){e.startVector(4,t,4)}static addNodes(e,t){e.addFieldOffset(2,t,0)}static createNodesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodesVector(e,t){e.startVector(4,t,4)}static addMaxNodeIndex(e,t){e.addFieldInt32(3,t,0)}static addNodeEdges(e,t){e.addFieldOffset(4,t,0)}static createNodeEdgesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startNodeEdgesVector(e,t){e.startVector(4,t,4)}static addInputs(e,t){e.addFieldOffset(5,t,0)}static createInputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startInputsVector(e,t){e.startVector(4,t,4)}static addOutputs(e,t){e.addFieldOffset(6,t,0)}static createOutputsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOutputsVector(e,t){e.startVector(4,t,4)}static addSparseInitializers(e,t){e.addFieldOffset(7,t,0)}static createSparseInitializersVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSparseInitializersVector(e,t){e.startVector(4,t,4)}static endGraph(e){return e.endObject()}static createGraph(e,t,r,o,i,s,a,l,c){return n.startGraph(e),n.addInitializers(e,t),n.addNodeArgs(e,r),n.addNodes(e,o),n.addMaxNodeIndex(e,i),n.addNodeEdges(e,s),n.addInputs(e,a),n.addOutputs(e,l),n.addSparseInitializers(e,c),n.endGraph(e)}}t.Graph=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsModel(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsModel(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}irVersion(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}opsetImport(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}opsetImportLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}producerName(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}producerVersion(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}domain(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}modelVersion(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readInt64(this.bb_pos+e):this.bb.createLong(0,0)}docString(e){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__string(this.bb_pos+t,e):null}graph(t){let n=this.bb.__offset(this.bb_pos,18);return n?(t||new e.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}graphDocString(e){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__string(this.bb_pos+t,e):null}static startModel(e){e.startObject(9)}static addIrVersion(e,t){e.addFieldInt64(0,t,e.createLong(0,0))}static addOpsetImport(e,t){e.addFieldOffset(1,t,0)}static createOpsetImportVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startOpsetImportVector(e,t){e.startVector(4,t,4)}static addProducerName(e,t){e.addFieldOffset(2,t,0)}static addProducerVersion(e,t){e.addFieldOffset(3,t,0)}static addDomain(e,t){e.addFieldOffset(4,t,0)}static addModelVersion(e,t){e.addFieldInt64(5,t,e.createLong(0,0))}static addDocString(e,t){e.addFieldOffset(6,t,0)}static addGraph(e,t){e.addFieldOffset(7,t,0)}static addGraphDocString(e,t){e.addFieldOffset(8,t,0)}static endModel(e){return e.endObject()}static createModel(e,t,r,o,i,s,a,l,c,u){return n.startModel(e),n.addIrVersion(e,t),n.addOpsetImport(e,r),n.addProducerName(e,o),n.addProducerVersion(e,i),n.addDomain(e,s),n.addModelVersion(e,a),n.addDocString(e,l),n.addGraph(e,c),n.addGraphDocString(e,u),n.endModel(e)}}t.Model=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(e){!function(e){class t{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKernelCreateInfos(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKernelCreateInfos(e,n){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)}nodeIndices(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}nodeIndicesLength(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}nodeIndicesArray(){let e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}kernelDefHashes(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):this.bb.createLong(0,0)}kernelDefHashesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startKernelCreateInfos(e){e.startObject(2)}static addNodeIndices(e,t){e.addFieldOffset(0,t,0)}static createNodeIndicesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startNodeIndicesVector(e,t){e.startVector(4,t,4)}static addKernelDefHashes(e,t){e.addFieldOffset(1,t,0)}static createKernelDefHashesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startKernelDefHashesVector(e,t){e.startVector(8,t,8)}static endKernelCreateInfos(e){return e.endObject()}static createKernelCreateInfos(e,n,r){return t.startKernelCreateInfos(e),t.addNodeIndices(e,n),t.addKernelDefHashes(e,r),t.endKernelCreateInfos(e)}}e.KernelCreateInfos=t}(e.fbs||(e.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSubGraphSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSubGraphSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}graphId(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startSubGraphSessionState(e){e.startObject(2)}static addGraphId(e,t){e.addFieldOffset(0,t,0)}static addSessionState(e,t){e.addFieldOffset(1,t,0)}static endSubGraphSessionState(e){let t=e.endObject();return e.requiredField(t,4),t}static createSubGraphSessionState(e,t,r){return n.startSubGraphSessionState(e),n.addGraphId(e,t),n.addSessionState(e,r),n.endSubGraphSessionState(e)}}t.SubGraphSessionState=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSessionState(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSessionState(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}kernels(t){let n=this.bb.__offset(this.bb_pos,4);return n?(t||new e.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}subGraphSessionStates(t,n){let r=this.bb.__offset(this.bb_pos,6);return r?(n||new e.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}subGraphSessionStatesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSessionState(e){e.startObject(2)}static addKernels(e,t){e.addFieldOffset(0,t,0)}static addSubGraphSessionStates(e,t){e.addFieldOffset(1,t,0)}static createSubGraphSessionStatesVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startSubGraphSessionStatesVector(e,t){e.startVector(4,t,4)}static endSessionState(e){return e.endObject()}static createSessionState(e,t,r){return n.startSessionState(e),n.addKernels(e,t),n.addSubGraphSessionStates(e,r),n.endSessionState(e)}}t.SessionState=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={})),function(e){!function(t){!function(t){class n{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInferenceSession(e,t){return(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInferenceSession(e,t){return e.setPosition(e.position()+r.flatbuffers.SIZE_PREFIX_LENGTH),(t||new n).__init(e.readInt32(e.position())+e.position(),e)}static bufferHasIdentifier(e){return e.__has_identifier("ORTM")}ortVersion(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}model(t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new e.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}sessionState(t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new e.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}static startInferenceSession(e){e.startObject(3)}static addOrtVersion(e,t){e.addFieldOffset(0,t,0)}static addModel(e,t){e.addFieldOffset(1,t,0)}static addSessionState(e,t){e.addFieldOffset(2,t,0)}static endInferenceSession(e){return e.endObject()}static finishInferenceSessionBuffer(e,t){e.finish(t,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(e,t){e.finish(t,"ORTM",!0)}static createInferenceSession(e,t,r,o){return n.startInferenceSession(e),n.addOrtVersion(e,t),n.addModel(e,r),n.addSessionState(e,o),n.endInferenceSession(e)}}t.InferenceSession=n}(t.fbs||(t.fbs={}))}(e.experimental||(e.experimental={}))}(t.onnxruntime||(t.onnxruntime={}))},7448:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxjsSessionHandler=void 0;const r=n(1670),o=n(9162);t.OnnxjsSessionHandler=class{constructor(e){this.session=e,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(e,t,n){const i=new Map;for(const t in e)if(Object.hasOwnProperty.call(e,t)){const n=e[t];i.set(t,new o.Tensor(n.dims,n.type,void 0,void 0,n.data))}const s=await this.session.run(i),a={};return s.forEach(((e,t)=>{a[t]=new r.Tensor(e.type,e.data,e.dims)})),a}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Session=void 0;const r=n(7067),o=n(1296),i=n(7091),s=n(1036),a=n(6231),l=n(2644);t.Session=class{constructor(e={}){this._initialized=!1,this.backendHint=e.backendHint,this.profiler=a.Profiler.create(e.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(e,t,n){await this.profiler.event("session","Session.loadModel",(async()=>{const s=await(0,i.resolveBackend)(this.backendHint);if(this.sessionHandler=s.createSessionHandler(this.context),this._model=new l.Model,"string"==typeof e){const t=e.endsWith(".ort");if("undefined"==typeof fetch){const n=await(0,o.promisify)(r.readFile)(e);this.initialize(n,t)}else{const n=await fetch(e),r=await n.arrayBuffer();this.initialize(new Uint8Array(r),t)}}else if(ArrayBuffer.isView(e))this.initialize(e);else{const r=new Uint8Array(e,t||0,n||e.byteLength);this.initialize(r)}}))}initialize(e,t){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",(()=>{const n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(e,n,t),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new s.ExecutionPlan(this._model.graph,this._ops,this.profiler)})),this._initialized=!0}async run(e){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",(async()=>{const t=this.normalizeAndValidateInputs(e),n=await this._executionPlan.execute(this.sessionHandler,t);return this.createOutput(n)}))}normalizeAndValidateInputs(e){const t=this._model.graph.getInputNames();if(Array.isArray(e)){if(e.length!==t.length)throw new Error(`incorrect input array length: expected ${t.length} but got ${e.length}`)}else{if(e.size!==t.length)throw new Error(`incorrect input map size: expected ${t.length} but got ${e.size}`);const n=new Array(e.size);let r=0;for(let o=0;o"string"==typeof e))))throw new TypeError("cache should be a string array");c&&(this.cache=new Array(a))}else{if(void 0!==i){const e=d(t);if(!(i instanceof e))throw new TypeError(`cache should be type ${e.name}`)}if(c){const e=new ArrayBuffer(a*function(e){switch(e){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${e}`)}}(t));this.cache=function(e,t){return new(d(t))(e)}(e,t)}}}static fromProto(e){if(!e)throw new Error("cannot construct Value from an empty tensor");const t=l.ProtoUtil.tensorDataTypeFromProto(e.dataType),n=l.ProtoUtil.tensorDimsFromProto(e.dims),r=new u(n,t);if("string"===t)e.stringData.forEach(((e,t)=>{r.data[t]=(0,l.decodeUtf8String)(e)}));else if(e.rawData&&"number"==typeof e.rawData.byteLength&&e.rawData.byteLength>0){const t=r.data,n=new DataView(e.rawData.buffer,e.rawData.byteOffset,e.rawData.byteLength),o=p(e.dataType),i=e.rawData.byteLength/o;if(e.rawData.byteLength%o!=0)throw new Error("invalid buffer length");if(t.length!==i)throw new Error("buffer length mismatch");for(let r=0;r0){const t=r.data,n=new DataView(e.rawDataArray().buffer,e.rawDataArray().byteOffset,e.rawDataLength()),o=p(e.dataType()),i=e.rawDataLength()/o;if(e.rawDataLength()%o!=0)throw new Error("invalid buffer length");if(t.length!==i)throw new Error("buffer length mismatch");for(let r=0;r1&&l>1)return;s[i-a]=Math.max(n,l)}return s}static index(e,t){const n=new Array(t.length);return c.fillIndex(e,t,n),n}static fillIndex(e,t,n){const r=e.length-t.length;for(let o=0;o=0;e--)r[e]=u%i[e],u=Math.floor(u/i[e]);_||(c.fillIndex(r,e.dims,o),p=e.get(o)),h||(c.fillIndex(r,t.dims,a),d=t.get(a)),l.set(r,n(p,d))}}return l}}static isValidBroadcast(e,t){const n=e.length,r=t.length;if(n>r)return!1;for(let o=1;o<=n;o++)if(1!==e[n-o]&&e[n-o]!==t[r-o])return!1;return!0}static getBroadcastDims(e,t){const n=e.length,r=[];for(let o=0;o1&&1===s&&r.unshift(i)}return r}}t.BroadcastUtil=c,t.arrayCopyHelper=function(e,t,n,r,o){if(r<0||r>=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;ii.default.isLong(e)?e.toNumber():e))}static tensorValueTypeFromProto(e){return{tensorType:u.tensorDataTypeFromProto(e.elemType),shape:{dims:u.tensorDimsFromProto(e.shape.dim.map((e=>e.dimValue)))}}}static tensorDimsFromORTFormat(e){const t=[];for(let n=0;ne.length)throw new Error(`invalid dimension of ${t} for sizeFromDimension as Tensor has ${e.length} dimensions.`);return d.getSizeFromDimensionRange(e,t,e.length)}static sizeToDimension(e,t){if(t<0||t>e.length)throw new Error(`invalid dimension of ${t} for sizeToDimension as Tensor has ${e.length} dimensions.`);return d.getSizeFromDimensionRange(e,0,t)}static getSizeFromDimensionRange(e,t,n){let r=1;for(let o=t;o=0;--r)n[r]=n[r+1]*e[r+1];return n}static transpose(e){return e.slice().reverse()}static indicesToOffset(e,t,n){void 0===n&&(n=e.length);let r=0;for(let o=0;o=t)throw new Error("unsupported axis for this operation.");return e<0?e+t:e}static normalizeAxes(e,t){return e.map((e=>this.normalizeAxis(e,t)))}static incrementIndex(e,t,n){if(0===t.length||0===e.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=t.length;else if(n<=0||n>t.length)throw new Error("Incorrect axis to increment on");for(let r=n-1;r>=0&&(e[r]++,!(e[r]=e.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");r[s]=e[s]}else r[s]=t[s];i*=r[s]}}const s=d.size(e);if(-1!==o){if(s%i!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${e}] Output shape: [${t}]`);r[o]=s/i}else if(i!==s)throw new Error("reshapedDims and originalDims don't have matching sizes");return r}static sortBasedOnPerm(e,t){return t?t.map((t=>e[t])):e.slice().reverse()}static padShape(e,t){const n=e.length;return e.map(((e,r)=>e+t[r]+t[r+n]))}static areEqual(e,t){return e.length===t.length&&e.every(((e,n)=>e===t[n]))}static validateDimsAndCalcSize(e){if(e.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let t=1;for(const n of e){if(!Number.isInteger(n))throw new TypeError(`Invalid shape: ${n} is not an integer`);if(n<0||n>2147483647)throw new TypeError(`Invalid shape: length ${n} is not allowed`);t*=n}return t}static flattenShape(e,t){t<0&&(t+=e.length);const n=e.reduce(((e,t)=>e*t),1),r=e.slice(t).reduce(((e,t)=>e*t),1);return[n/r,r]}static squeezeShape(e,t){const n=new Array;t=d.normalizeAxes(t,e.length);for(let r=0;r=0;if(o&&1!==e[r])throw new Error("squeeze an axis of size different than 1");(0===t.length&&e[r]>1||t.length>0&&!o)&&n.push(e[r])}return n}static unsqueezeShape(e,t){const n=new Array(e.length+t.length);n.fill(0);for(let e=0;e=n.length)throw new Error("'axes' has an out of range axis");if(0!==n[r])throw new Error("'axes' has a duplicate axis");n[r]=1}let r=0;for(let t=0;t=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;i=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let s=0;s=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let s=0;s=t.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=e.length)throw new Error("targetIndex out of bounds");if(r+o>t.length)throw new Error("source indices to be copied are outside bounds");if(n+o>e.length)throw new Error("target array is too small to hold result");for(let i=0;it.push(n)));const s=h.calcReduceShape(i,t,!0),l=d.size(s),u=new a.Tensor(s,e.type),p=d.computeStrides(s),_=d.computeStrides(i),f=new Array(i.length);for(let n=0;n=t.length)return i(e[o]);const l=t[r],c=l>=n.length?1:d.size(n.slice(l+1));for(let u=0;u0!==e))}}t.ReduceUtil=h;class f{static adjustPoolAttributes(e,t,n,r,o,i){if(!e&&n.length!==t.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(e)for(let e=0;e=n.length?n.push(t[e+2]):n[e]=t[e+2];for(let e=0;e=n[e]||i[e+n.length]>=n[e])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(e,t,n,r,o,i){if(i){if(o.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(t.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(r.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.iterateExtraOptions=void 0,t.iterateExtraOptions=(e,n,r,o)=>{if("object"==typeof e&&null!==e){if(r.has(e))throw new Error("Circular reference in options");r.add(e)}Object.entries(e).forEach((([e,i])=>{const s=n?n+e:e;if("object"==typeof i)(0,t.iterateExtraOptions)(i,s+".",r,o);else if("string"==typeof i||"number"==typeof i)o(s,i.toString());else{if("boolean"!=typeof i)throw new Error("Can't handle extra config type: "+typeof i);o(s,i?"1":"0")}}))}},2157:function(e,t,n){var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=t.initWasm=void 0;const a=n(1670),l=s(n(349)),c=n(6361),u=()=>!!a.env.wasm.proxy&&"undefined"!=typeof document;let p,d,_,h=!1,f=!1,m=!1;const g=[],b=[],w=[],x=[],y=[],T=[],v=()=>{if(h||!f||m||!p)throw new Error("worker not ready")},k=e=>{switch(e.data.type){case"init-wasm":h=!1,e.data.err?(m=!0,d[1](e.data.err)):(f=!0,d[0]());break;case"init-ort":e.data.err?_[1](e.data.err):_[0]();break;case"create_allocate":e.data.err?g.shift()[1](e.data.err):g.shift()[0](e.data.out);break;case"create_finalize":e.data.err?b.shift()[1](e.data.err):b.shift()[0](e.data.out);break;case"create":e.data.err?w.shift()[1](e.data.err):w.shift()[0](e.data.out);break;case"release":e.data.err?x.shift()[1](e.data.err):x.shift()[0]();break;case"run":e.data.err?y.shift()[1](e.data.err):y.shift()[0](e.data.out);break;case"end-profiling":e.data.err?T.shift()[1](e.data.err):T.shift()[0]()}},M="undefined"!=typeof document?null===(r=null===document||void 0===document?void 0:document.currentScript)||void 0===r?void 0:r.src:void 0;t.initWasm=async()=>{if(u()){if(f)return;if(h)throw new Error("multiple calls to 'initWasm()' detected.");if(m)throw new Error("previous call to 'initWasm()' failed.");return h=!0,void 0===a.env.wasm.wasmPaths&&M&&0!==M.indexOf("blob:")&&(a.env.wasm.wasmPaths=M.substr(0,+M.lastIndexOf("/")+1)),new Promise(((e,t)=>{null==p||p.terminate(),p=n(9710).Z(),p.onmessage=k,d=[e,t];const r={type:"init-wasm",in:a.env.wasm};p.postMessage(r)}))}return(0,c.initializeWebAssembly)(a.env.wasm)},t.initOrt=async(e,t)=>{if(u())return v(),new Promise(((n,r)=>{_=[n,r];const o={type:"init-ort",in:{numThreads:e,loggingLevel:t}};p.postMessage(o)}));l.initOrt(e,t)},t.createSessionAllocate=async e=>u()?(v(),new Promise(((t,n)=>{g.push([t,n]);const r={type:"create_allocate",in:{model:e}};p.postMessage(r,[e.buffer])}))):l.createSessionAllocate(e),t.createSessionFinalize=async(e,t)=>u()?(v(),new Promise(((n,r)=>{b.push([n,r]);const o={type:"create_finalize",in:{modeldata:e,options:t}};p.postMessage(o)}))):l.createSessionFinalize(e,t),t.createSession=async(e,t)=>u()?(v(),new Promise(((n,r)=>{w.push([n,r]);const o={type:"create",in:{model:e,options:t}};p.postMessage(o,[e.buffer])}))):l.createSession(e,t),t.releaseSession=async e=>{if(u())return v(),new Promise(((t,n)=>{x.push([t,n]);const r={type:"release",in:e};p.postMessage(r)}));l.releaseSession(e)},t.run=async(e,t,n,r,o)=>u()?(v(),new Promise(((i,s)=>{y.push([i,s]);const a={type:"run",in:{sessionId:e,inputIndices:t,inputs:n,outputIndices:r,options:o}};p.postMessage(a,l.extractTransferableBuffers(n))}))):l.run(e,t,n,r,o),t.endProfiling=async e=>{if(u())return v(),new Promise(((t,n)=>{T.push([t,n]);const r={type:"end-profiling",in:e};p.postMessage(r)}));l.endProfiling(e)}},586:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setRunOptions=void 0;const r=n(7967),o=n(4983),i=n(6361);t.setRunOptions=e=>{const t=(0,i.getInstance)();let n=0;const s=[],a=e||{};try{if(void 0===(null==e?void 0:e.logSeverityLevel))a.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))a.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);void 0===(null==e?void 0:e.terminate)&&(a.terminate=!1);let i=0;if(void 0!==(null==e?void 0:e.tag)&&(i=(0,o.allocWasmString)(e.tag,s)),n=t._OrtCreateRunOptions(a.logSeverityLevel,a.logVerbosityLevel,!!a.terminate,i),0===n)throw new Error("Can't create run options");return void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,((e,r)=>{const i=(0,o.allocWasmString)(e,s),a=(0,o.allocWasmString)(r,s);if(0!==t._OrtAddRunConfigEntry(n,i,a))throw new Error(`Can't set a run config entry: ${e} - ${r}`)})),[n,s]}catch(e){throw 0!==n&&t._OrtReleaseRunOptions(n),s.forEach(t._free),e}}},2306:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OnnxruntimeWebAssemblySessionHandler=void 0;const r=n(2806),o=n(1670),i=n(2850),s=n(2157);let a;t.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(e){const t=await fetch(e),n=await t.arrayBuffer();return(0,s.createSessionAllocate)(new Uint8Array(n))}async loadModel(e,t){if(a||(await(0,s.initOrt)(o.env.wasm.numThreads,(e=>{switch(e){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${e}`)}})(o.env.logLevel)),a=!0),"string"==typeof e)if("undefined"==typeof fetch){const n=await(0,i.promisify)(r.readFile)(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(n,t)}else{const n=await this.createSessionAllocate(e);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSessionFinalize)(n,t)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(e,t)}async dispose(){return(0,s.releaseSession)(this.sessionId)}async run(e,t,n){const r=[],i=[];Object.entries(e).forEach((e=>{const t=e[0],n=e[1],o=this.inputNames.indexOf(t);if(-1===o)throw new Error(`invalid input '${t}'`);r.push(n),i.push(o)}));const a=[];Object.entries(t).forEach((e=>{const t=e[0],n=this.outputNames.indexOf(t);if(-1===n)throw new Error(`invalid output '${t}'`);a.push(n)}));const l=await(0,s.run)(this.sessionId,i,r.map((e=>[e.type,e.dims,e.data])),a,n),c={};for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.setSessionOptions=void 0;const r=n(7967),o=n(4983),i=n(6361);t.setSessionOptions=e=>{const t=(0,i.getInstance)();let n=0;const s=[],a=e||{};(e=>{e.extra||(e.extra={}),e.extra.session||(e.extra.session={});const t=e.extra.session;t.use_ort_model_bytes_directly||(t.use_ort_model_bytes_directly="1")})(a);try{void 0===(null==e?void 0:e.graphOptimizationLevel)&&(a.graphOptimizationLevel="all");const l=(e=>{switch(e){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${e}`)}})(a.graphOptimizationLevel);void 0===(null==e?void 0:e.enableCpuMemArena)&&(a.enableCpuMemArena=!0),void 0===(null==e?void 0:e.enableMemPattern)&&(a.enableMemPattern=!0),void 0===(null==e?void 0:e.executionMode)&&(a.executionMode="sequential");const c=(e=>{switch(e){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${e}`)}})(a.executionMode);let u=0;if(void 0!==(null==e?void 0:e.logId)&&(u=(0,o.allocWasmString)(e.logId,s)),void 0===(null==e?void 0:e.logSeverityLevel))a.logSeverityLevel=2;else if("number"!=typeof e.logSeverityLevel||!Number.isInteger(e.logSeverityLevel)||e.logSeverityLevel<0||e.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${e.logSeverityLevel}`);if(void 0===(null==e?void 0:e.logVerbosityLevel))a.logVerbosityLevel=0;else if("number"!=typeof e.logVerbosityLevel||!Number.isInteger(e.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);if(void 0===(null==e?void 0:e.enableProfiling)&&(a.enableProfiling=!1),n=t._OrtCreateSessionOptions(l,!!a.enableCpuMemArena,!!a.enableMemPattern,c,!!a.enableProfiling,0,u,a.logSeverityLevel,a.logVerbosityLevel),0===n)throw new Error("Can't create session options");return(null==e?void 0:e.executionProviders)&&((e,t,n)=>{for(const r of t){let t="string"==typeof r?r:r.name;switch(t){case"xnnpack":t="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${t}`)}const s=(0,o.allocWasmString)(t,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(e,s))throw new Error(`Can't append execution provider: ${t}`)}})(n,e.executionProviders,s),void 0!==(null==e?void 0:e.extra)&&(0,r.iterateExtraOptions)(e.extra,"",new WeakSet,((e,r)=>{const i=(0,o.allocWasmString)(e,s),a=(0,o.allocWasmString)(r,s);if(0!==t._OrtAddSessionConfigEntry(n,i,a))throw new Error(`Can't set a session config entry: ${e} - ${r}`)})),[n,s]}catch(e){throw 0!==n&&t._OrtReleaseSessionOptions(n),s.forEach(t._free),e}}},4983:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.allocWasmString=void 0;const r=n(6361);t.allocWasmString=(e,t)=>{const n=(0,r.getInstance)(),o=n.lengthBytesUTF8(e)+1,i=n._malloc(o);return n.stringToUTF8(e,i,o),t.push(i),i}},349:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractTransferableBuffers=t.endProfiling=t.run=t.releaseSession=t.createSession=t.createSessionFinalize=t.createSessionAllocate=t.initOrt=void 0;const r=n(586),o=n(4919),i=n(4983),s=n(6361);t.initOrt=(e,t)=>{const n=(0,s.getInstance)()._OrtInit(e,t);if(0!==n)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const a=new Map;t.createSessionAllocate=e=>{const t=(0,s.getInstance)(),n=t._malloc(e.byteLength);return t.HEAPU8.set(e,n),[n,e.byteLength]},t.createSessionFinalize=(e,t)=>{const n=(0,s.getInstance)();let r=0,i=0,l=[];try{if([i,l]=(0,o.setSessionOptions)(t),r=n._OrtCreateSession(e[0],e[1],i),0===r)throw new Error("Can't create a session")}finally{n._free(e[0]),n._OrtReleaseSessionOptions(i),l.forEach(n._free)}const c=n._OrtGetInputCount(r),u=n._OrtGetOutputCount(r),p=[],d=[],_=[],h=[];for(let e=0;e{const r=(0,t.createSessionAllocate)(e);return(0,t.createSessionFinalize)(r,n)},t.releaseSession=e=>{const t=(0,s.getInstance)(),n=a.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=n[1],i=n[2];o.forEach(t._OrtFree),i.forEach(t._OrtFree),t._OrtReleaseSession(r),a.delete(e)};const l=e=>{switch(e){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${e}`)}},c=e=>{switch(e){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${e}`)}},u=e=>{switch(e){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${e}`)}};t.run=(e,t,n,o,p)=>{const d=(0,s.getInstance)(),_=a.get(e);if(!_)throw new Error("invalid session id");const h=_[0],f=_[1],m=_[2],g=t.length,b=o.length;let w=0,x=[];const y=[],T=[];try{[w,x]=(0,r.setRunOptions)(p);for(let e=0;ed.HEAP32[e++]=t));const n=d._OrtCreateTensor(l(t),s,a,u,r.length);if(0===n)throw new Error("Can't create a tensor");y.push(n)}finally{d.stackRestore(c)}}const e=d.stackSave(),s=d.stackAlloc(4*g),a=d.stackAlloc(4*g),_=d.stackAlloc(4*b),v=d.stackAlloc(4*b);try{let e=s/4,n=a/4,r=_/4,i=v/4;for(let r=0;re*t));if(o=c(n),"string"===o){const e=[];let t=i/4;for(let n=0;n{const t=(0,s.getInstance)(),n=a.get(e);if(!n)throw new Error("invalid session id");const r=n[0],o=t._OrtEndProfiling(r);if(0===o)throw new Error("Can't get an profile file name");t._OrtFree(o)},t.extractTransferableBuffers=e=>{const t=[];for(const n of e){const e=n[2];!Array.isArray(e)&&e.buffer&&t.push(e.buffer)}return t}},6361:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.dispose=t.getInstance=t.initializeWebAssembly=void 0;const a=i(n(6449)),l=s(n(932)),c=n(3474);let u,p=!1,d=!1,_=!1;const h=(e,t)=>t?e?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":e?"ort-wasm-simd.wasm":"ort-wasm.wasm";t.initializeWebAssembly=async e=>{if(p)return Promise.resolve();if(d)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(_)throw new Error("previous call to 'initializeWebAssembly()' failed.");d=!0;const t=e.initTimeout,r=e.numThreads,o=e.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(e){return!1}})(),s=o&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(e){return!1}})(),f="string"==typeof e.wasmPaths?e.wasmPaths:void 0,m=h(!1,i),g=h(s,i),b="object"==typeof e.wasmPaths?e.wasmPaths[g]:void 0;let w=!1;const x=[];if(t>0&&x.push(new Promise((e=>{setTimeout((()=>{w=!0,e()}),t)}))),x.push(new Promise(((e,t)=>{const r=i?c:l.default,o={locateFile:(e,t)=>i&&e.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):e===m?null!=b?b:(null!=f?f:t)+g:t+e};if(i)if("undefined"==typeof Blob)o.mainScriptUrlOrBlob=a.join("/","ort-wasm-threaded.js");else{const e=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;o.mainScriptUrlOrBlob=new Blob([e],{type:"text/javascript"})}r(o).then((t=>{d=!1,p=!0,u=t,e()}),(e=>{d=!1,_=!0,t(e)}))}))),await Promise.race(x),w)throw new Error(`WebAssembly backend initializing failed due to timeout: ${t}ms`)},t.getInstance=()=>{if(p&&u)return u;throw new Error("WebAssembly is not initialized yet.")},t.dispose=()=>{var e;!p||d||_||(d=!0,null===(e=u.PThread)||void 0===e||e.terminateAllThreads(),u=void 0,d=!1,p=!1,_=!0)}},9710:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(477),o=n.n(r);function i(){return o()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:e=>{e.exports=function(e,t,n,r){var o=self||window;try{try{var i;try{i=new o.Blob([e])}catch(t){(i=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(e),i=i.getBlob()}var s=o.URL||o.webkitURL,a=s.createObjectURL(i),l=new o[t](a,n);return s.revokeObjectURL(a),l}catch(r){return new o[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new o[t](r,n)}}},4154:e=>{e.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},1670:e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(e,t,n)=>{n.r(t),n.d(t,{flatbuffers:()=>r});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(e,t){this.low=0|e,this.high=0|t},r.Long.create=function(e,t){return 0==e&&0==t?r.Long.ZERO:new r.Long(e,t)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(e){return this.low==e.low&&this.high==e.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(e){if(e)t=e;else var t=1024;this.bb=r.ByteBuffer.allocate(t),this.space=t,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(e){this.force_defaults=e},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(e,t){e>this.minalign&&(this.minalign=e);for(var n=1+~(this.bb.capacity()-this.space+t)&e-1;this.space=0&&0==this.vtable[t];t--);for(var n=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var o=(n+2)*r.SIZEOF_SHORT;this.addInt16(o);var i=0,s=this.space;e:for(t=0;t=0;s--)this.writeInt8(i.charCodeAt(s))}this.prep(this.minalign,r.SIZEOF_INT+o),this.addOffset(e),o&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(e,t){this.finish(e,t,!0)},r.Builder.prototype.requiredField=function(e,t){var n=this.bb.capacity()-e,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+t))throw new Error("FlatBuffers: field "+t+" must be set")},r.Builder.prototype.startVector=function(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(r.SIZEOF_INT,e*t),this.prep(n,e*t)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(e){if(e instanceof Uint8Array)var t=e;else{t=[];for(var n=0;n=56320?o:(o<<10)+e.charCodeAt(n++)+-56613888)<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(63&r|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),n=0;for(var i=this.space,s=this.bb.bytes();n>24},r.ByteBuffer.prototype.readUint8=function(e){return this.bytes_[e]},r.ByteBuffer.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},r.ByteBuffer.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},r.ByteBuffer.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},r.ByteBuffer.prototype.readUint32=function(e){return this.readInt32(e)>>>0},r.ByteBuffer.prototype.readInt64=function(e){return new r.Long(this.readInt32(e),this.readInt32(e+4))},r.ByteBuffer.prototype.readUint64=function(e){return new r.Long(this.readUint32(e),this.readUint32(e+4))},r.ByteBuffer.prototype.readFloat32=function(e){return r.int32[0]=this.readInt32(e),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(e){return r.int32[r.isLittleEndian?0:1]=this.readInt32(e),r.int32[r.isLittleEndian?1:0]=this.readInt32(e+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeUint8=function(e,t){this.bytes_[e]=t},r.ByteBuffer.prototype.writeInt16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},r.ByteBuffer.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},r.ByteBuffer.prototype.writeInt64=function(e,t){this.writeInt32(e,t.low),this.writeInt32(e+4,t.high)},r.ByteBuffer.prototype.writeUint64=function(e,t){this.writeUint32(e,t.low),this.writeUint32(e+4,t.high)},r.ByteBuffer.prototype.writeFloat32=function(e,t){r.float32[0]=t,this.writeInt32(e,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(e,t){r.float64[0]=t,this.writeInt32(e,r.int32[r.isLittleEndian?0:1]),this.writeInt32(e+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&s)))}return o},r.ByteBuffer.prototype.__indirect=function(e){return e+this.readInt32(e)},r.ByteBuffer.prototype.__vector=function(e){return e+this.readInt32(e)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},r.ByteBuffer.prototype.__has_identifier=function(e){if(e.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return __nested_webpack_require_546802__.d(t,{a:t}),t},__nested_webpack_require_546802__.d=(e,t)=>{for(var n in t)__nested_webpack_require_546802__.o(t,n)&&!__nested_webpack_require_546802__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__nested_webpack_require_546802__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__nested_webpack_require_546802__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__nested_webpack_require_546802__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __nested_webpack_exports__=__nested_webpack_require_546802__(6018);return __nested_webpack_exports__})(),module.exports=e(__webpack_require__(/*! onnxruntime-common */"./node_modules/onnxruntime-common/dist/lib/index.js"))},"?2ce3": /*!**********************************!*\ !*** onnxruntime-node (ignored) ***! \**********************************/()=>{},"?7a2c": /*!********************!*\ !*** fs (ignored) ***! \********************/()=>{},"?a42a": /*!**********************!*\ !*** path (ignored) ***! \**********************/()=>{},"?2b25": /*!***********************!*\ !*** sharp (ignored) ***! \***********************/()=>{},"?e65c": /*!****************************!*\ !*** stream/web (ignored) ***! \****************************/()=>{},"?569f": /*!********************!*\ !*** fs (ignored) ***! \********************/()=>{},"?3f59": /*!**********************!*\ !*** path (ignored) ***! \**********************/()=>{},"?154a": /*!*********************!*\ !*** url (ignored) ***! \*********************/()=>{},"./node_modules/@huggingface/jinja/dist/index.js": /*!*******************************************************!*\ !*** ./node_modules/@huggingface/jinja/dist/index.js ***! \*******************************************************/(e,t,n)=>{n.r(t),n.d(t,{Environment:()=>H,Interpreter:()=>X,Template:()=>Y,parse:()=>I,tokenize:()=>u});var r=Object.freeze({Text:"Text",NumericLiteral:"NumericLiteral",BooleanLiteral:"BooleanLiteral",StringLiteral:"StringLiteral",Identifier:"Identifier",Equals:"Equals",OpenParen:"OpenParen",CloseParen:"CloseParen",OpenStatement:"OpenStatement",CloseStatement:"CloseStatement",OpenExpression:"OpenExpression",CloseExpression:"CloseExpression",OpenSquareBracket:"OpenSquareBracket",CloseSquareBracket:"CloseSquareBracket",OpenCurlyBracket:"OpenCurlyBracket",CloseCurlyBracket:"CloseCurlyBracket",Comma:"Comma",Dot:"Dot",Colon:"Colon",Pipe:"Pipe",CallOperator:"CallOperator",AdditiveBinaryOperator:"AdditiveBinaryOperator",MultiplicativeBinaryOperator:"MultiplicativeBinaryOperator",ComparisonBinaryOperator:"ComparisonBinaryOperator",UnaryOperator:"UnaryOperator",Set:"Set",If:"If",For:"For",In:"In",Is:"Is",NotIn:"NotIn",Else:"Else",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator"}),o=Object.freeze({set:r.Set,for:r.For,in:r.In,is:r.Is,if:r.If,else:r.Else,endif:r.EndIf,elif:r.ElseIf,endfor:r.EndFor,and:r.And,or:r.Or,not:r.Not,"not in":r.NotIn,true:r.BooleanLiteral,false:r.BooleanLiteral}),i=class{constructor(e,t){this.value=e,this.type=t}};function s(e){return/\w/.test(e)}function a(e){return/[0-9]/.test(e)}var l=[["{%",r.OpenStatement],["%}",r.CloseStatement],["{{",r.OpenExpression],["}}",r.CloseExpression],["(",r.OpenParen],[")",r.CloseParen],["{",r.OpenCurlyBracket],["}",r.CloseCurlyBracket],["[",r.OpenSquareBracket],["]",r.CloseSquareBracket],[",",r.Comma],[".",r.Dot],[":",r.Colon],["|",r.Pipe],["<=",r.ComparisonBinaryOperator],[">=",r.ComparisonBinaryOperator],["==",r.ComparisonBinaryOperator],["!=",r.ComparisonBinaryOperator],["<",r.ComparisonBinaryOperator],[">",r.ComparisonBinaryOperator],["+",r.AdditiveBinaryOperator],["-",r.AdditiveBinaryOperator],["*",r.MultiplicativeBinaryOperator],["/",r.MultiplicativeBinaryOperator],["%",r.MultiplicativeBinaryOperator],["=",r.Equals]],c=new Map([["n","\n"],["t","\t"],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function u(e,t={}){const n=[],u=function(e,t={}){return e.endsWith("\n")&&(e=e.slice(0,-1)),e=e.replace(/{#.*?#}/gs,"{##}"),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%])/gm,"$1")),t.trim_blocks&&(e=e.replace(/([#%]})\n/g,"$1")),e.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}(e,t);let p=0;const d=e=>{let t="";for(;e(u[p]);)if("\\"!==u[p]){if(t+=u[p++],p>=u.length)throw new SyntaxError("Unexpected end of input")}else{if(++p,p>=u.length)throw new SyntaxError("Unexpected end of input");const e=u[p++],n=c.get(e);if(void 0===n)throw new SyntaxError(`Unexpected escaped character: ${e}`);t+=n}return t};e:for(;p0){n.push(new i(e,r.Text));continue}}d((e=>/\s/.test(e)));const t=u[p];if("-"===t||"+"===t){const e=n.at(-1)?.type;if(e===r.Text||void 0===e)throw new SyntaxError(`Unexpected character: ${t}`);switch(e){case r.Identifier:case r.NumericLiteral:case r.BooleanLiteral:case r.StringLiteral:case r.CloseParen:case r.CloseSquareBracket:break;default:{++p;const e=d(a);n.push(new i(`${t}${e}`,e.length>0?r.NumericLiteral:r.UnaryOperator));continue}}}for(const[e,t]of l){if(u.slice(p,p+e.length)===e){n.push(new i(e,t)),p+=e.length;continue e}}if("'"!==t&&'"'!==t)if(a(t)){const e=d(a);n.push(new i(e,r.NumericLiteral))}else{if(!s(t))throw new SyntaxError(`Unexpected character: ${t}`);{const e=d(s),t=Object.hasOwn(o,e)?o[e]:r.Identifier;t===r.In&&n.at(-1)?.type===r.Not?(n.pop(),n.push(new i("not in",r.NotIn))):n.push(new i(e,t))}}else{++p;const e=d((e=>e!==t));n.push(new i(e,r.StringLiteral)),++p}}return n}var p=class{type="Statement"},d=class extends p{constructor(e){super(),this.body=e}type="Program"},_=class extends p{constructor(e,t,n){super(),this.test=e,this.body=t,this.alternate=n}type="If"},h=class extends p{constructor(e,t,n){super(),this.loopvar=e,this.iterable=t,this.body=n}type="For"},f=class extends p{constructor(e,t){super(),this.assignee=e,this.value=t}type="Set"},m=class extends p{type="Expression"},g=class extends m{constructor(e,t,n){super(),this.object=e,this.property=t,this.computed=n}type="MemberExpression"},b=class extends m{constructor(e,t){super(),this.callee=e,this.args=t}type="CallExpression"},w=class extends m{constructor(e){super(),this.value=e}type="Identifier"},x=class extends m{constructor(e){super(),this.value=e}type="Literal"},y=class extends x{type="NumericLiteral"},T=class extends x{type="StringLiteral"},v=class extends x{type="BooleanLiteral"},k=class extends x{type="ArrayLiteral"},M=class extends x{type="TupleLiteral"},S=class extends x{type="ObjectLiteral"},P=class extends m{constructor(e,t,n){super(),this.operator=e,this.left=t,this.right=n}type="BinaryExpression"},A=class extends m{constructor(e,t){super(),this.operand=e,this.filter=t}type="FilterExpression"},F=class extends m{constructor(e,t,n){super(),this.operand=e,this.negate=t,this.test=n}type="TestExpression"},C=class extends m{constructor(e,t){super(),this.operator=e,this.argument=t}type="UnaryExpression"},E=class extends m{constructor(e=void 0,t=void 0,n=void 0){super(),this.start=e,this.stop=t,this.step=n}type="SliceExpression"},O=class extends m{constructor(e,t){super(),this.key=e,this.value=t}type="KeywordArgumentExpression"};function I(e){const t=new d([]);let n=0;function o(t,r){const o=e[n++];if(!o||o.type!==t)throw new Error(`Parser Error: ${r}. ${o.type} !== ${t}.`);return o}function i(){switch(e[n].type){case r.Text:return new T(o(r.Text,"Expected text token").value);case r.OpenStatement:return function(){let t;switch(o(r.OpenStatement,"Expected opening statement token"),e[n].type){case r.Set:++n,t=l(),o(r.CloseStatement,"Expected closing statement token");break;case r.If:++n,t=c(),o(r.OpenStatement,"Expected {% token"),o(r.EndIf,"Expected endif token"),o(r.CloseStatement,"Expected %} token");break;case r.For:++n,t=function(){const e=u(!0);if(!(e instanceof w||e instanceof M))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${e.type} instead`);o(r.In,"Expected `in` keyword following loop variable");const t=p();o(r.CloseStatement,"Expected closing statement token");const n=[];for(;s(r.OpenStatement,r.EndFor);)n.push(i());return new h(e,t,n)}(),o(r.OpenStatement,"Expected {% token"),o(r.EndFor,"Expected endfor token"),o(r.CloseStatement,"Expected %} token");break;default:throw new SyntaxError(`Unknown statement type: ${e[n].type}`)}return t}();case r.OpenExpression:return function(){o(r.OpenExpression,"Expected opening expression token");const e=p();return o(r.CloseExpression,"Expected closing expression token"),e}();default:throw new SyntaxError(`Unexpected token type: ${e[n].type}`)}}function s(...t){return n+t.length<=e.length&&t.some(((t,r)=>t!==e[n+r].type))}function a(...t){return n+t.length<=e.length&&t.every(((t,r)=>t===e[n+r].type))}function l(){const e=p();if(a(r.Equals)){++n;const t=l();return new f(e,t)}return e}function c(){const t=p();o(r.CloseStatement,"Expected closing statement token");const s=[],l=[];for(;e[n]?.type!==r.OpenStatement||e[n+1]?.type!==r.ElseIf&&e[n+1]?.type!==r.Else&&e[n+1]?.type!==r.EndIf;)s.push(i());if(e[n]?.type===r.OpenStatement&&e[n+1]?.type!==r.EndIf)if(++n,a(r.ElseIf))o(r.ElseIf,"Expected elseif token"),l.push(c());else for(o(r.Else,"Expected else token"),o(r.CloseStatement,"Expected closing statement token");e[n]?.type!==r.OpenStatement||e[n+1]?.type!==r.EndIf;)l.push(i());return new _(t,s,l)}function u(e=!1){const t=e?R:p,o=[t()],i=a(r.Comma);for(;i&&(++n,o.push(t()),a(r.Comma)););return i?new M(o):o[0]}function p(){return function(){const e=m();if(a(r.If)){++n;const t=m();o(r.Else,"Expected else token");const i=m();return new _(t,[e],[i])}return e}()}function m(){let t=x();for(;a(r.Or);){const r=e[n];++n;const o=x();t=new P(r,t,o)}return t}function x(){let t=I();for(;a(r.And);){const r=e[n];++n;const o=I();t=new P(r,t,o)}return t}function I(){let t;for(;a(r.Not);){const r=e[n];++n;const o=I();t=new C(r,o)}return t??function(){let t=D();for(;a(r.ComparisonBinaryOperator)||a(r.In)||a(r.NotIn);){const r=e[n];++n;const o=D();t=new P(r,t,o)}return t}()}function D(){let t=B();for(;a(r.AdditiveBinaryOperator);){const r=e[n];++n;const o=B();t=new P(r,t,o)}return t}function L(){const t=function(){let t=R();for(;a(r.Dot)||a(r.OpenSquareBracket);){const i=e[n];let s;++n;const a=i.type!==r.Dot;if(a)s=N(),o(r.CloseSquareBracket,"Expected closing square bracket");else if(s=R(),"Identifier"!==s.type)throw new SyntaxError("Expected identifier following dot operator");t=new g(t,s,a)}return t}();return a(r.OpenParen)?$(t):t}function $(e){let t=new b(e,function(){o(r.OpenParen,"Expected opening parenthesis for arguments list");const e=function(){const e=[];for(;!a(r.CloseParen);){let t=p();if(a(r.Equals)){if(++n,!(t instanceof w))throw new SyntaxError("Expected identifier for keyword argument");const e=p();t=new O(t,e)}e.push(t),a(r.Comma)&&++n}return e}();return o(r.CloseParen,"Expected closing parenthesis for arguments list"),e}());return a(r.OpenParen)&&(t=$(t)),t}function N(){const e=[];let t=!1;for(;!a(r.CloseSquareBracket);)a(r.Colon)?(e.push(void 0),++n,t=!0):(e.push(p()),a(r.Colon)&&(++n,t=!0));if(0===e.length)throw new SyntaxError("Expected at least one argument for member/slice expression");if(t){if(e.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new E(...e)}return e[0]}function B(){let t=z();for(;a(r.MultiplicativeBinaryOperator);){const r=e[n];++n;const o=z();t=new P(r,t,o)}return t}function z(){let e=function(){let e=L();for(;a(r.Pipe);){++n;let t=R();if(!(t instanceof w))throw new SyntaxError("Expected identifier for the filter");a(r.OpenParen)&&(t=$(t)),e=new A(e,t)}return e}();for(;a(r.Is);){++n;const t=a(r.Not);t&&++n;let o=R();if(o instanceof v&&(o=new w(o.value.toString())),!(o instanceof w))throw new SyntaxError("Expected identifier for the test");e=new F(e,t,o)}return e}function R(){const t=e[n];switch(t.type){case r.NumericLiteral:return++n,new y(Number(t.value));case r.StringLiteral:return++n,new T(t.value);case r.BooleanLiteral:return++n,new v("true"===t.value);case r.Identifier:return++n,new w(t.value);case r.OpenParen:{++n;const t=u();if(e[n].type!==r.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${e[n].type} instead`);return++n,t}case r.OpenSquareBracket:{++n;const e=[];for(;!a(r.CloseSquareBracket);)e.push(p()),a(r.Comma)&&++n;return++n,new k(e)}case r.OpenCurlyBracket:{++n;const e=new Map;for(;!a(r.CloseCurlyBracket);){const t=p();o(r.Colon,"Expected colon between key and value in object literal");const i=p();e.set(t,i),a(r.Comma)&&++n}return++n,new S(e)}default:throw new SyntaxError(`Unexpected token: ${t.type}`)}}for(;n=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),n=(n??=e.length)<0?Math.max(e.length+n,0):Math.min(n,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),n=(n??=-1)<-1?Math.max(e.length+n,-1):Math.min(n,e.length-1));const i=[];for(let s=t;o*se.toUpperCase()))}var N=class{type="RuntimeValue";value;builtins=new Map;constructor(e=void 0){this.value=e}__bool__(){return new R(!!this.value)}},B=class extends N{type="NumericValue"},z=class extends N{type="StringValue";builtins=new Map([["upper",new G((()=>new z(this.value.toUpperCase())))],["lower",new G((()=>new z(this.value.toLowerCase())))],["strip",new G((()=>new z(this.value.trim())))],["title",new G((()=>new z($(this.value))))],["length",new B(this.value.length)]])},R=class extends N{type="BooleanValue"},j=class extends N{type="ObjectValue";__bool__(){return new R(this.value.size>0)}builtins=new Map([["get",new G((([e,t])=>{if(!(e instanceof z))throw new Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new q}))],["items",new G((()=>new V(Array.from(this.value.entries()).map((([e,t])=>new V([new z(e),t]))))))]])},V=class extends N{type="ArrayValue";builtins=new Map([["length",new B(this.value.length)]]);__bool__(){return new R(this.value.length>0)}},U=class extends V{type="TupleValue"},G=class extends N{type="FunctionValue"},q=class extends N{type="NullValue"},W=class extends N{type="UndefinedValue"},H=class{constructor(e){this.parent=e}variables=new Map([["namespace",new G((e=>{if(0===e.length)return new j(new Map);if(1!==e.length||!(e[0]instanceof j))throw new Error("`namespace` expects either zero arguments or a single object argument");return e[0]}))]]);tests=new Map([["boolean",e=>"BooleanValue"===e.type],["callable",e=>e instanceof G],["odd",e=>{if("NumericValue"!==e.type)throw new Error(`Cannot apply test "odd" to type: ${e.type}`);return e.value%2!=0}],["even",e=>{if("NumericValue"!==e.type)throw new Error(`Cannot apply test "even" to type: ${e.type}`);return e.value%2==0}],["false",e=>"BooleanValue"===e.type&&!e.value],["true",e=>"BooleanValue"===e.type&&e.value],["number",e=>"NumericValue"===e.type],["integer",e=>"NumericValue"===e.type&&Number.isInteger(e.value)],["iterable",e=>e instanceof V||e instanceof z],["lower",e=>{const t=e.value;return"StringValue"===e.type&&t===t.toLowerCase()}],["upper",e=>{const t=e.value;return"StringValue"===e.type&&t===t.toUpperCase()}],["none",e=>"NullValue"===e.type],["defined",e=>"UndefinedValue"!==e.type],["undefined",e=>"UndefinedValue"===e.type],["equalto",(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,Q(t))}declareVariable(e,t){if(this.variables.has(e))throw new SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw new Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new W}catch{return new W}}},X=class{global;constructor(e){this.global=e??new H}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){const n=this.evaluate(e.left,t);switch(e.operator.value){case"and":return n.__bool__().value?this.evaluate(e.right,t):n;case"or":return n.__bool__().value?n:this.evaluate(e.right,t)}const r=this.evaluate(e.right,t);switch(e.operator.value){case"==":return new R(n.value==r.value);case"!=":return new R(n.value!=r.value)}if(n instanceof W||r instanceof W)throw new Error("Cannot perform operation on undefined values");if(n instanceof q||r instanceof q)throw new Error("Cannot perform operation on null values");if(n instanceof B&&r instanceof B)switch(e.operator.value){case"+":return new B(n.value+r.value);case"-":return new B(n.value-r.value);case"*":return new B(n.value*r.value);case"/":return new B(n.value/r.value);case"%":return new B(n.value%r.value);case"<":return new R(n.value":return new R(n.value>r.value);case">=":return new R(n.value>=r.value);case"<=":return new R(n.value<=r.value)}else if(n instanceof V&&r instanceof V){if("+"===e.operator.value)return new V(n.value.concat(r.value))}else if(r instanceof V){const t=void 0!==r.value.find((e=>e.value===n.value));switch(e.operator.value){case"in":return new R(t);case"not in":return new R(!t)}}if((n instanceof z||r instanceof z)&&"+"===e.operator.value)return new z(n.value.toString()+r.value.toString());if(n instanceof z&&r instanceof z)switch(e.operator.value){case"in":return new R(r.value.includes(n.value));case"not in":return new R(!r.value.includes(n.value))}if(n instanceof z&&r instanceof j)switch(e.operator.value){case"in":return new R(r.value.has(n.value));case"not in":return new R(!r.value.has(n.value))}throw new SyntaxError(`Unknown operator "${e.operator.value}" between ${n.type} and ${r.type}`)}evaluateFilterExpression(e,t){const n=this.evaluate(e.operand,t);if("Identifier"===e.filter.type){const t=e.filter;if(n instanceof V)switch(t.value){case"list":return n;case"first":return n.value[0];case"last":return n.value[n.value.length-1];case"length":return new B(n.value.length);case"reverse":return new V(n.value.reverse());case"sort":return new V(n.value.sort(((e,t)=>{if(e.type!==t.type)throw new Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case"NumericValue":return e.value-t.value;case"StringValue":return e.value.localeCompare(t.value);default:throw new Error(`Cannot compare type: ${e.type}`)}})));default:throw new Error(`Unknown ArrayValue filter: ${t.value}`)}else if(n instanceof z)switch(t.value){case"length":return new B(n.value.length);case"upper":return new z(n.value.toUpperCase());case"lower":return new z(n.value.toLowerCase());case"title":return new z($(n.value));case"capitalize":return new z(n.value.charAt(0).toUpperCase()+n.value.slice(1));case"trim":return new z(n.value.trim());default:throw new Error(`Unknown StringValue filter: ${t.value}`)}else{if(n instanceof B){if("abs"===t.value)return new B(Math.abs(n.value));throw new Error(`Unknown NumericValue filter: ${t.value}`)}if(n instanceof j)switch(t.value){case"items":return new V(Array.from(n.value.entries()).map((([e,t])=>new V([new z(e),t]))));case"length":return new B(n.value.size);default:throw new Error(`Unknown ObjectValue filter: ${t.value}`)}}throw new Error(`Cannot apply filter "${t.value}" to type: ${n.type}`)}if("CallExpression"===e.filter.type){const r=e.filter;if("Identifier"!==r.callee.type)throw new Error(`Unknown filter: ${r.callee.type}`);const o=r.callee.value;if(n instanceof V){if("selectattr"===o){if(n.value.some((e=>!(e instanceof j))))throw new Error("`selectattr` can only be applied to array of objects");if(r.args.some((e=>"StringLiteral"!==e.type)))throw new Error("arguments of `selectattr` must be strings");const[e,o,i]=r.args.map((e=>this.evaluate(e,t)));let s;if(o){const e=t.tests.get(o.value);if(!e)throw new Error(`Unknown test: ${o.value}`);s=e}else s=(...e)=>e[0].__bool__().value;const a=n.value.filter((t=>{const n=t.value.get(e.value);return!!n&&s(n,i)}));return new V(a)}throw new Error(`Unknown ArrayValue filter: ${o}`)}throw new Error(`Cannot apply filter "${o}" to type: ${n.type}`)}throw new Error(`Unknown filter: ${e.filter.type}`)}evaluateTestExpression(e,t){const n=this.evaluate(e.operand,t),r=t.tests.get(e.test.value);if(!r)throw new Error(`Unknown test: ${e.test.value}`);const o=r(n);return new R(e.negate?!o:o)}evaluateUnaryExpression(e,t){const n=this.evaluate(e.argument,t);if("not"===e.operator.value)return new R(!n.value);throw new SyntaxError(`Unknown operator: ${e.operator.value}`)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let n="";for(const r of e){const e=this.evaluate(r,t);"NullValue"!==e.type&&"UndefinedValue"!==e.type&&(n+=e.value)}return new z(n)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){const n=[],r=new Map;for(const o of e.args)if("KeywordArgumentExpression"===o.type){const e=o;r.set(e.key.value,this.evaluate(e.value,t))}else n.push(this.evaluate(o,t));r.size>0&&n.push(new j(r));const o=this.evaluate(e.callee,t);if("FunctionValue"!==o.type)throw new Error(`Cannot call something that is not a function: got ${o.type}`);return o.value(n,t)}evaluateSliceExpression(e,t,n){if(!(e instanceof V||e instanceof z))throw new Error("Slice object must be an array or string");const r=this.evaluate(t.start,n),o=this.evaluate(t.stop,n),i=this.evaluate(t.step,n);if(!(r instanceof B||r instanceof W))throw new Error("Slice start must be numeric or undefined");if(!(o instanceof B||o instanceof W))throw new Error("Slice stop must be numeric or undefined");if(!(i instanceof B||i instanceof W))throw new Error("Slice step must be numeric or undefined");return e instanceof V?new V(L(e.value,r.value,o.value,i.value)):new z(L(Array.from(e.value),r.value,o.value,i.value).join(""))}evaluateMemberExpression(e,t){const n=this.evaluate(e.object,t);let r,o;if(e.computed){if("SliceExpression"===e.property.type)return this.evaluateSliceExpression(n,e.property,t);r=this.evaluate(e.property,t)}else r=new z(e.property.value);if(n instanceof j){if(!(r instanceof z))throw new Error(`Cannot access property with non-string: got ${r.type}`);o=n.value.get(r.value)??n.builtins.get(r.value)}else if(n instanceof V||n instanceof z)if(r instanceof B)o=n.value.at(r.value),n instanceof z&&(o=new z(n.value.at(r.value)));else{if(!(r instanceof z))throw new Error(`Cannot access property with non-string/non-number: got ${r.type}`);o=n.builtins.get(r.value)}else{if(!(r instanceof z))throw new Error(`Cannot access property with non-string: got ${r.type}`);o=n.builtins.get(r.value)}return o instanceof N?o:new W}evaluateSet(e,t){const n=this.evaluate(e.value,t);if("Identifier"===e.assignee.type){const r=e.assignee.value;t.setVariable(r,n)}else{if("MemberExpression"!==e.assignee.type)throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(e.assignee)}`);{const r=e.assignee,o=this.evaluate(r.object,t);if(!(o instanceof j))throw new Error("Cannot assign to member of non-object");if("Identifier"!==r.property.type)throw new Error("Cannot assign to member with non-identifier property");o.value.set(r.property.value,n)}}return new q}evaluateIf(e,t){const n=this.evaluate(e.test,t);return this.evaluateBlock(n.__bool__().value?e.body:e.alternate,t)}evaluateFor(e,t){const n=new H(t),r=this.evaluate(e.iterable,n);if(!(r instanceof V))throw new Error(`Expected iterable type in for loop: got ${r.type}`);let o="";for(let t=0;t0?r.value[t-1]:new W],["nextitem",tr.value.length?"few":"many"} items to unpack`);for(let e=0;ethis.evaluate(e,t))));case"TupleLiteral":return new U(e.value.map((e=>this.evaluate(e,t))));case"ObjectLiteral":{const n=new Map;for(const[r,o]of e.value){const e=this.evaluate(r,t);if(!(e instanceof z))throw new Error(`Object keys must be strings: got ${e.type}`);n.set(e.value,this.evaluate(o,t))}return new j(n)}case"Identifier":return this.evaluateIdentifier(e,t);case"CallExpression":return this.evaluateCallExpression(e,t);case"MemberExpression":return this.evaluateMemberExpression(e,t);case"UnaryExpression":return this.evaluateUnaryExpression(e,t);case"BinaryExpression":return this.evaluateBinaryExpression(e,t);case"FilterExpression":return this.evaluateFilterExpression(e,t);case"TestExpression":return this.evaluateTestExpression(e,t);default:throw new SyntaxError(`Unknown node type: ${e.type}`)}}};function Q(e){switch(typeof e){case"number":return new B(e);case"string":return new z(e);case"boolean":return new R(e);case"object":return null===e?new q:Array.isArray(e)?new V(e.map(Q)):new j(new Map(Object.entries(e).map((([e,t])=>[e,Q(t)]))));case"function":return new G(((t,n)=>Q(e(...t.map((e=>e.value)))??null)));default:throw new Error(`Cannot convert to runtime value: ${e}`)}}var Y=class{parsed;constructor(e){const t=u(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=I(t)}render(e){const t=new H;t.set("false",!1),t.set("true",!0),t.set("raise_exception",(e=>{throw new Error(e)})),t.set("range",D);for(const[n,r]of Object.entries(e))t.set(n,r);return new X(t).run(this.parsed).value}}},"./src/backends/onnx.js": /*!******************************!*\ !*** ./src/backends/onnx.js ***! \******************************/(e,t,n)=>{var r,o;n.r(t),n.d(t,{ONNX:()=>a,executionProviders:()=>l});var i=n(/*! onnxruntime-node */"?2ce3"),s=n(/*! onnxruntime-web */"./node_modules/onnxruntime-web/dist/ort-web.min.js");let a;const l=["wasm"];if("undefined"!=typeof process&&"node"===process?.release?.name)a=i??(r||(r=n.t(i,2))),l.unshift("cpu");else{a=s??(o||(o=n.t(s,2)));"undefined"!=typeof navigator&&/iP(hone|od|ad).+16_4.+AppleWebKit/.test(navigator.userAgent)&&(a.env.wasm.simd=!1)}},"./src/configs.js": /*!************************!*\ !*** ./src/configs.js ***! \************************/(e,t,n)=>{n.r(t),n.d(t,{AutoConfig:()=>i,PretrainedConfig:()=>o});var r=n(/*! ./utils/hub.js */"./src/utils/hub.js");class o{constructor(e){this.model_type=null,this.is_encoder_decoder=!1,Object.assign(this,e)}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:o=null,local_files_only:i=!1,revision:s="main"}={}){let a=n??await async function(e,t){return await(0,r.getModelJSON)(e,"config.json",!0,t)}(e,{progress_callback:t,config:n,cache_dir:o,local_files_only:i,revision:s});return new this(a)}}class i{static async from_pretrained(...e){return o.from_pretrained(...e)}}},"./src/env.js": /*!********************!*\ !*** ./src/env.js ***! \********************/(e,t,n)=>{n.r(t),n.d(t,{env:()=>g});var r=n(/*! fs */"?569f"),o=n(/*! path */"?3f59"),i=n(/*! url */"?154a"),s=n(/*! ./backends/onnx.js */"./src/backends/onnx.js");const{env:a}=s.ONNX,l="2.17.1",c="undefined"!=typeof self&&"caches"in self,u=!b(r),p=!b(o),d=u&&p,_=d?o.dirname(o.dirname(i.fileURLToPath("file:///home/runner/work/transformers.js/transformers.js/src/env.js"))):"./",h=d?o.join(_,"/.cache/"):null,f="/models/",m=d?o.join(_,f):f;a?.wasm&&(a.wasm.wasmPaths=d?o.join(_,"/dist/"):`https://cdn.jsdelivr.net/npm/@xenova/transformers@${l}/dist/`);const g={backends:{onnx:a,tfjs:{}},__dirname:_,version:l,allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!0,localModelPath:m,useFS:u,useBrowserCache:c,useFSCache:u,cacheDir:h,useCustomCache:!1,customCache:null};function b(e){return 0===Object.keys(e).length}},"./src/models.js": /*!***********************!*\ !*** ./src/models.js ***! \***********************/(e,t,n)=>{n.r(t),n.d(t,{ASTForAudioClassification:()=>Jt,ASTModel:()=>Zt,ASTPreTrainedModel:()=>Kt,AlbertForMaskedLM:()=>lt,AlbertForQuestionAnswering:()=>at,AlbertForSequenceClassification:()=>st,AlbertModel:()=>it,AlbertPreTrainedModel:()=>ot,AutoModel:()=>ts,AutoModelForAudioClassification:()=>ws,AutoModelForAudioFrameClassification:()=>ys,AutoModelForCTC:()=>bs,AutoModelForCausalLM:()=>ls,AutoModelForDepthEstimation:()=>Ms,AutoModelForDocumentQuestionAnswering:()=>Ts,AutoModelForImageClassification:()=>ds,AutoModelForImageFeatureExtraction:()=>Ss,AutoModelForImageMatting:()=>vs,AutoModelForImageSegmentation:()=>_s,AutoModelForImageToImage:()=>ks,AutoModelForMaskGeneration:()=>gs,AutoModelForMaskedLM:()=>cs,AutoModelForObjectDetection:()=>fs,AutoModelForQuestionAnswering:()=>us,AutoModelForSemanticSegmentation:()=>hs,AutoModelForSeq2SeqLM:()=>os,AutoModelForSequenceClassification:()=>ns,AutoModelForSpeechSeq2Seq:()=>is,AutoModelForTextToSpectrogram:()=>ss,AutoModelForTextToWaveform:()=>as,AutoModelForTokenClassification:()=>rs,AutoModelForVision2Seq:()=>ps,AutoModelForXVector:()=>xs,AutoModelForZeroShotObjectDetection:()=>ms,BartForConditionalGeneration:()=>xt,BartForSequenceClassification:()=>yt,BartModel:()=>wt,BartPretrainedModel:()=>bt,BaseModelOutput:()=>R,BeitForImageClassification:()=>mr,BeitModel:()=>fr,BeitPreTrainedModel:()=>hr,BertForMaskedLM:()=>U,BertForQuestionAnswering:()=>W,BertForSequenceClassification:()=>G,BertForTokenClassification:()=>q,BertModel:()=>V,BertPreTrainedModel:()=>j,BlenderbotForConditionalGeneration:()=>Ft,BlenderbotModel:()=>At,BlenderbotPreTrainedModel:()=>Pt,BlenderbotSmallForConditionalGeneration:()=>Ot,BlenderbotSmallModel:()=>Et,BlenderbotSmallPreTrainedModel:()=>Ct,BloomForCausalLM:()=>Hn,BloomModel:()=>Wn,BloomPreTrainedModel:()=>qn,CLIPModel:()=>sn,CLIPPreTrainedModel:()=>on,CLIPSegForImageSegmentation:()=>gn,CLIPSegModel:()=>mn,CLIPSegPreTrainedModel:()=>fn,CLIPTextModelWithProjection:()=>an,CLIPVisionModelWithProjection:()=>ln,CamembertForMaskedLM:()=>fe,CamembertForQuestionAnswering:()=>be,CamembertForSequenceClassification:()=>me,CamembertForTokenClassification:()=>ge,CamembertModel:()=>he,CamembertPreTrainedModel:()=>_e,CausalLMOutput:()=>Is,CausalLMOutputWithPast:()=>Ds,ChineseCLIPModel:()=>hn,ChineseCLIPPreTrainedModel:()=>_n,ClapAudioModelWithProjection:()=>pi,ClapModel:()=>ci,ClapPreTrainedModel:()=>li,ClapTextModelWithProjection:()=>ui,CodeGenForCausalLM:()=>Ln,CodeGenModel:()=>Dn,CodeGenPreTrainedModel:()=>In,ConvBertForMaskedLM:()=>re,ConvBertForQuestionAnswering:()=>se,ConvBertForSequenceClassification:()=>oe,ConvBertForTokenClassification:()=>ie,ConvBertModel:()=>ne,ConvBertPreTrainedModel:()=>te,ConvNextForImageClassification:()=>Kr,ConvNextModel:()=>Yr,ConvNextPreTrainedModel:()=>Qr,ConvNextV2ForImageClassification:()=>eo,ConvNextV2Model:()=>Jr,ConvNextV2PreTrainedModel:()=>Zr,DPTForDepthEstimation:()=>jr,DPTModel:()=>Rr,DPTPreTrainedModel:()=>zr,DebertaForMaskedLM:()=>ye,DebertaForQuestionAnswering:()=>ke,DebertaForSequenceClassification:()=>Te,DebertaForTokenClassification:()=>ve,DebertaModel:()=>xe,DebertaPreTrainedModel:()=>we,DebertaV2ForMaskedLM:()=>Pe,DebertaV2ForQuestionAnswering:()=>Ce,DebertaV2ForSequenceClassification:()=>Ae,DebertaV2ForTokenClassification:()=>Fe,DebertaV2Model:()=>Se,DebertaV2PreTrainedModel:()=>Me,DeiTForImageClassification:()=>Fr,DeiTModel:()=>Ar,DeiTPreTrainedModel:()=>Pr,DepthAnythingForDepthEstimation:()=>Ur,DepthAnythingPreTrainedModel:()=>Vr,DetrForObjectDetection:()=>wr,DetrForSegmentation:()=>xr,DetrModel:()=>br,DetrObjectDetectionOutput:()=>yr,DetrPreTrainedModel:()=>gr,DetrSegmentationOutput:()=>Tr,Dinov2ForImageClassification:()=>ro,Dinov2Model:()=>no,Dinov2PreTrainedModel:()=>to,DistilBertForMaskedLM:()=>$e,DistilBertForQuestionAnswering:()=>Le,DistilBertForSequenceClassification:()=>Ie,DistilBertForTokenClassification:()=>De,DistilBertModel:()=>Oe,DistilBertPreTrainedModel:()=>Ee,DonutSwinModel:()=>Xr,DonutSwinPreTrainedModel:()=>Hr,EfficientNetForImageClassification:()=>vi,EfficientNetModel:()=>Ti,EfficientNetPreTrainedModel:()=>yi,ElectraForMaskedLM:()=>ce,ElectraForQuestionAnswering:()=>de,ElectraForSequenceClassification:()=>ue,ElectraForTokenClassification:()=>pe,ElectraModel:()=>le,ElectraPreTrainedModel:()=>ae,EsmForMaskedLM:()=>ze,EsmForSequenceClassification:()=>Re,EsmForTokenClassification:()=>je,EsmModel:()=>Be,EsmPreTrainedModel:()=>Ne,FalconForCausalLM:()=>ai,FalconModel:()=>si,FalconPreTrainedModel:()=>ii,GLPNForDepthEstimation:()=>Wr,GLPNModel:()=>qr,GLPNPreTrainedModel:()=>Gr,GPT2LMHeadModel:()=>xn,GPT2Model:()=>wn,GPT2PreTrainedModel:()=>bn,GPTBigCodeForCausalLM:()=>On,GPTBigCodeModel:()=>En,GPTBigCodePreTrainedModel:()=>Cn,GPTJForCausalLM:()=>Fn,GPTJModel:()=>An,GPTJPreTrainedModel:()=>Pn,GPTNeoForCausalLM:()=>vn,GPTNeoModel:()=>Tn,GPTNeoPreTrainedModel:()=>yn,GPTNeoXForCausalLM:()=>Sn,GPTNeoXModel:()=>Mn,GPTNeoXPreTrainedModel:()=>kn,HubertForCTC:()=>Bo,HubertForSequenceClassification:()=>zo,HubertModel:()=>No,HubertPreTrainedModel:()=>$o,ImageMattingOutput:()=>Ls,LlamaForCausalLM:()=>Bn,LlamaModel:()=>Nn,LlamaPreTrainedModel:()=>$n,LongT5ForConditionalGeneration:()=>ht,LongT5Model:()=>_t,LongT5PreTrainedModel:()=>dt,M2M100ForConditionalGeneration:()=>go,M2M100Model:()=>mo,M2M100PreTrainedModel:()=>fo,MBartForCausalLM:()=>St,MBartForConditionalGeneration:()=>kt,MBartForSequenceClassification:()=>Mt,MBartModel:()=>vt,MBartPreTrainedModel:()=>Tt,MPNetForMaskedLM:()=>Qe,MPNetForQuestionAnswering:()=>Ze,MPNetForSequenceClassification:()=>Ye,MPNetForTokenClassification:()=>Ke,MPNetModel:()=>Xe,MPNetPreTrainedModel:()=>He,MT5ForConditionalGeneration:()=>gt,MT5Model:()=>mt,MT5PreTrainedModel:()=>ft,MarianMTModel:()=>ho,MarianModel:()=>_o,MarianPreTrainedModel:()=>po,MaskedLMOutput:()=>Es,MistralForCausalLM:()=>ti,MistralModel:()=>ei,MistralPreTrainedModel:()=>Jo,MobileBertForMaskedLM:()=>Ge,MobileBertForQuestionAnswering:()=>We,MobileBertForSequenceClassification:()=>qe,MobileBertModel:()=>Ue,MobileBertPreTrainedModel:()=>Ve,MobileViTForImageClassification:()=>ar,MobileViTModel:()=>sr,MobileViTPreTrainedModel:()=>ir,ModelOutput:()=>z,MptForCausalLM:()=>Yn,MptModel:()=>Qn,MptPreTrainedModel:()=>Xn,NomicBertModel:()=>X,NomicBertPreTrainedModel:()=>H,OPTForCausalLM:()=>Jn,OPTModel:()=>Zn,OPTPreTrainedModel:()=>Kn,OwlViTForObjectDetection:()=>ur,OwlViTModel:()=>cr,OwlViTPreTrainedModel:()=>lr,Owlv2ForObjectDetection:()=>_r,Owlv2Model:()=>dr,Owlv2PreTrainedModel:()=>pr,PhiForCausalLM:()=>Gn,PhiModel:()=>Un,PhiPreTrainedModel:()=>Vn,PreTrainedModel:()=>B,PretrainedMixin:()=>ki,QuestionAnsweringModelOutput:()=>Os,Qwen2ForCausalLM:()=>jn,Qwen2Model:()=>Rn,Qwen2PreTrainedModel:()=>zn,ResNetForImageClassification:()=>Or,ResNetModel:()=>Er,ResNetPreTrainedModel:()=>Cr,RoFormerForMaskedLM:()=>K,RoFormerForQuestionAnswering:()=>ee,RoFormerForSequenceClassification:()=>Z,RoFormerForTokenClassification:()=>J,RoFormerModel:()=>Y,RoFormerPreTrainedModel:()=>Q,RobertaForMaskedLM:()=>Lt,RobertaForQuestionAnswering:()=>Bt,RobertaForSequenceClassification:()=>$t,RobertaForTokenClassification:()=>Nt,RobertaModel:()=>Dt,RobertaPreTrainedModel:()=>It,SamImageSegmentationOutput:()=>uo,SamModel:()=>co,SamPreTrainedModel:()=>lo,SegformerForImageClassification:()=>mi,SegformerForSemanticSegmentation:()=>gi,SegformerModel:()=>fi,SegformerPreTrainedModel:()=>hi,Seq2SeqLMOutput:()=>Ps,SequenceClassifierOutput:()=>As,SiglipModel:()=>un,SiglipPreTrainedModel:()=>cn,SiglipTextModel:()=>pn,SiglipVisionModel:()=>dn,SpeechT5ForSpeechToText:()=>Xo,SpeechT5ForTextToSpeech:()=>Qo,SpeechT5HifiGan:()=>Yo,SpeechT5Model:()=>Ho,SpeechT5PreTrainedModel:()=>Wo,SqueezeBertForMaskedLM:()=>tt,SqueezeBertForQuestionAnswering:()=>rt,SqueezeBertForSequenceClassification:()=>nt,SqueezeBertModel:()=>et,SqueezeBertPreTrainedModel:()=>Je,StableLmForCausalLM:()=>xi,StableLmModel:()=>wi,StableLmPreTrainedModel:()=>bi,Starcoder2ForCausalLM:()=>oi,Starcoder2Model:()=>ri,Starcoder2PreTrainedModel:()=>ni,Swin2SRForImageSuperResolution:()=>Br,Swin2SRModel:()=>Nr,Swin2SRPreTrainedModel:()=>$r,SwinForImageClassification:()=>Lr,SwinModel:()=>Dr,SwinPreTrainedModel:()=>Ir,T5ForConditionalGeneration:()=>pt,T5Model:()=>ut,T5PreTrainedModel:()=>ct,TableTransformerForObjectDetection:()=>Mr,TableTransformerModel:()=>kr,TableTransformerObjectDetectionOutput:()=>Sr,TableTransformerPreTrainedModel:()=>vr,TokenClassifierOutput:()=>Cs,TrOCRForCausalLM:()=>Zo,TrOCRPreTrainedModel:()=>Ko,UniSpeechForCTC:()=>Mo,UniSpeechForSequenceClassification:()=>So,UniSpeechModel:()=>ko,UniSpeechPreTrainedModel:()=>vo,UniSpeechSatForAudioFrameClassification:()=>Eo,UniSpeechSatForCTC:()=>Fo,UniSpeechSatForSequenceClassification:()=>Co,UniSpeechSatModel:()=>Ao,UniSpeechSatPreTrainedModel:()=>Po,ViTForImageClassification:()=>nr,ViTModel:()=>tr,ViTPreTrainedModel:()=>er,VisionEncoderDecoderModel:()=>rn,VitMatteForImageMatting:()=>or,VitMattePreTrainedModel:()=>rr,VitsModel:()=>_i,VitsModelOutput:()=>$s,VitsPreTrainedModel:()=>di,Wav2Vec2BertForCTC:()=>Do,Wav2Vec2BertForSequenceClassification:()=>Lo,Wav2Vec2BertModel:()=>Io,Wav2Vec2BertPreTrainedModel:()=>Oo,Wav2Vec2ForAudioFrameClassification:()=>To,Wav2Vec2ForCTC:()=>xo,Wav2Vec2ForSequenceClassification:()=>yo,Wav2Vec2Model:()=>wo,Wav2Vec2PreTrainedModel:()=>bo,WavLMForAudioFrameClassification:()=>qo,WavLMForCTC:()=>Vo,WavLMForSequenceClassification:()=>Uo,WavLMForXVector:()=>Go,WavLMModel:()=>jo,WavLMPreTrainedModel:()=>Ro,WhisperForConditionalGeneration:()=>nn,WhisperModel:()=>tn,WhisperPreTrainedModel:()=>en,XLMForQuestionAnswering:()=>Gt,XLMForSequenceClassification:()=>Vt,XLMForTokenClassification:()=>Ut,XLMModel:()=>Rt,XLMPreTrainedModel:()=>zt,XLMRobertaForMaskedLM:()=>Ht,XLMRobertaForQuestionAnswering:()=>Yt,XLMRobertaForSequenceClassification:()=>Xt,XLMRobertaForTokenClassification:()=>Qt,XLMRobertaModel:()=>Wt,XLMRobertaPreTrainedModel:()=>qt,XLMWithLMHeadModel:()=>jt,XVectorOutput:()=>Fs,YolosForObjectDetection:()=>so,YolosModel:()=>io,YolosObjectDetectionOutput:()=>ao,YolosPreTrainedModel:()=>oo});var r=n(/*! ./configs.js */"./src/configs.js"),o=n(/*! ./utils/core.js */"./src/utils/core.js"),i=n(/*! ./utils/hub.js */"./src/utils/hub.js"),s=n(/*! ./utils/generation.js */"./src/utils/generation.js"),a=n(/*! ./utils/tensor.js */"./src/utils/tensor.js"),l=n(/*! ./backends/onnx.js */"./src/backends/onnx.js"),c=n(/*! ./transformers.js */"./src/transformers.js");const{InferenceSession:u,Tensor:p,env:d}=l.ONNX,_=0,h=1,f=2,m=3,g=4,b=5,w=new Map,x=new Map,y=new Map;async function T(e,t,n){let r=`onnx/${t}${n.quantized?"_quantized":""}.onnx`,o=await(0,i.getModelFile)(e,r,!0,n);try{return await u.create(o,{executionProviders:l.executionProviders})}catch(e){if(1===l.executionProviders.length&&"wasm"===l.executionProviders[0])throw e;return console.warn(e),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await u.create(o,{executionProviders:["wasm"]})}}async function v(e,t){const n=function(e,t){const n=Object.create(null),r=[];for(const o of e.inputNames){const e=t[o];e instanceof a.Tensor?n[o]=d.wasm.proxy?e.clone():e:r.push(o)}if(r.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${r.join(", ")}.`);const o=Object.keys(t).length,i=e.inputNames.length;if(o>i){let n=Object.keys(t).filter((t=>!e.inputNames.includes(t)));console.warn(`WARNING: Too many inputs were provided (${o} > ${i}). The following inputs will be ignored: "${n.join(", ")}".`)}return n}(e,t);try{let t=await e.run(n);return t=k(t),t}catch(e){throw console.error(`An error occurred during model execution: "${e}".`),console.error("Inputs given to model:",n),e}}function k(e){for(let t in e)e[t]instanceof p?e[t]=new a.Tensor(e[t]):"object"==typeof e[t]&&k(e[t]);return e}function M(e){if(e instanceof a.Tensor)return e;if(0===e.length)throw Error("items must be non-empty");if(Array.isArray(e[0])){if(e.some((t=>t.length!==e[0].length)))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new a.Tensor("int64",BigInt64Array.from(e.flat().map((e=>BigInt(e)))),[e.length,e[0].length])}return new a.Tensor("int64",BigInt64Array.from(e.map((e=>BigInt(e)))),[1,e.length])}function S(e,t){let n=e.config.pad_token_id??null,r=e.config.eos_token_id??null;(0,o.isIntegralNumber)(r)&&(r=[r]);let i=-1!==t.indexOf(n),s=null===r||!r.includes(n);if(i&&s){let e=BigInt64Array.from(t.data.map((e=>e!=n)));return new a.Tensor("int64",e,t.dims)}return(0,a.ones_like)(t)}function P(e,t,n){if(!e.inputNames.includes("position_ids"))return;const r=new BigInt64Array(t.attention_mask.data.length);for(let e=0;e0&&r.push(new s.NoRepeatNGramLogitsProcessor(e.no_repeat_ngram_size)),null!==e.bad_words_ids&&r.push(new s.NoBadWordsLogitsProcessor(e.bad_words_ids,e.eos_token_id)),null!==e.min_length&&null!==e.eos_token_id&&e.min_length>0&&r.push(new s.MinLengthLogitsProcessor(e.min_length,e.eos_token_id)),null!==e.min_new_tokens&&null!==e.eos_token_id&&e.min_new_tokens>0&&r.push(new s.MinNewTokensLengthLogitsProcessor(t,e.min_new_tokens,e.eos_token_id)),null!==e.forced_bos_token_id&&r.push(new s.ForcedBOSTokenLogitsProcessor(e.forced_bos_token_id)),null!==e.forced_eos_token_id&&r.push(new s.ForcedEOSTokenLogitsProcessor(e.max_length,e.forced_eos_token_id)),null!==e.begin_suppress_tokens){let n=t>1||null===e.forced_bos_token_id?t:t+1;null!==e.forced_decoder_ids&&(n+=e.forced_decoder_ids[e.forced_decoder_ids.length-1][0]),r.push(new s.SuppressTokensAtBeginLogitsProcessor(e.begin_suppress_tokens,n))}return null!==e.forced_decoder_ids&&r.push(new s.ForceTokensLogitsProcessor(e.forced_decoder_ids)),null!==n&&r.extend(n),r}_get_generation_config(e){let t=new s.GenerationConfig(this.config);return"generation_config"in this&&Object.assign(t,this.generation_config),null!==e&&Object.assign(t,e),t}async generate(e,t=null,n=null,{inputs_attention_mask:r=null}={}){if(!this.can_generate){let e=`The current model class (${y.get(this.constructor)}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;const t=this.config.model_type,n=Di.get(t)??Ii.get(t)??Ai.get(t)??Ni.get(t);throw n&&(e+=` Please use the following class instead: '${n[0]}'`),Error(e)}if(!(e instanceof a.Tensor||(0,o.isTypedArray)(e)||Array.isArray(e)))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${e.constructor.name}".`);let i;if(this.config.is_encoder_decoder)i=0;else if(i=e instanceof a.Tensor?e.dims.at(-1):e.length,0===i)throw Error("Must supply a non-empty array of input token ids.");t=this._get_generation_config(t),n=n??new s.LogitsProcessorList,n=this._get_logits_processor(t,i,n);let l=t.eos_token_id;null===l||Array.isArray(l)||(l=[l]);let c=1;const u=c+(t.max_new_tokens??1/0),p=Number.isInteger(t.max_length)&&null===(t.max_new_tokens??null);let d=s.Sampler.getSampler(t),_=this.getStartBeams(e,t,c,r);for(;_.some((e=>!e.done))&&c=t.max_length){r.done=!0,e.push(r);continue}let o=await this.runBeam(r);t.output_attentions&&this.addAttentionsToBeam(r,o),t.output_scores;let i=o.logits.slice(null,-1,null);n(r.output_token_ids,i);let s=d(i);for(let[t,n]of s){let o={...r};this.updateBeam(o,t),o.score+=n,l&&l.includes(t)&&(o.done=!0),e.push(o)}}++c,e=this.groupBeams(e).map((e=>e.sort(((e,t)=>t.score-e.score)).slice(0,t.num_beams))),_=e.flat(),t.callback_function&&t.callback_function(_)}const h=this.groupBeams(_),f=e=>h.map((n=>t.num_return_sequences>1?n.slice(0,t.num_return_sequences).map((t=>t[e])):[n[0][e]])).flat(),m=f("output_token_ids");if(t.return_dict_in_generate){return{sequences:m,decoder_attentions:f("decoder_attentions"),cross_attentions:f("cross_attentions")}}return m}addAttentionsToBeam(e,t){if(this.config.is_encoder_decoder){if(!t.cross_attentions||0===t.cross_attentions.length)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.cross_attentions||(e.cross_attentions=[]),e.cross_attentions.push(t.cross_attentions)}if(!t.decoder_attentions||0===t.decoder_attentions.length)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");e.decoder_attentions||(e.decoder_attentions=[]),e.decoder_attentions.push(t.decoder_attentions)}groupBeams(e){const t=Object.create(null);for(const n of e)void 0===t[n.id]?t[n.id]=[n]:t[n.id].push(n);return Object.values(t)}getPastKeyValues(e,t){const n=Object.create(null);for(const r in e)if(r.startsWith("present")){let o=r.replace("present","past_key_values");t&&r.includes("encoder")?n[o]=t[o]:n[o]=e[r]}return n}getAttentions(e){const t=Object.create(null);for(const n of["cross_attentions","decoder_attentions"]){const r=[];for(const t in e)if(t.startsWith(n)){r[t.split(".").pop()]=e[t]}t[n]=r}return t}addPastKeyValues(e,t){if(t)Object.assign(e,t);else{const t=1;if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??1)){let n=[t,this.num_encoder_heads,0,this.encoder_dim_kv],r=[t,this.num_decoder_heads,0,this.decoder_dim_kv];for(let t=0;t{let r=Array.from({length:this.config.decoder_layers},((t,n)=>(0,a.cat)(e.map((e=>e[n])),2))),o=(0,a.stack)(t.map((([e,t])=>n?r[e].slice(null,t,null,[0,n]):r[e].slice(null,t))));o=o.transpose(1,0,2,3);let[s,l]=(0,a.std_mean)(o,-2,0,!0),u=o.clone();for(let e=0;en[t+1]-n[t])),c=(0,o.mergeArrays)([1],l).map((e=>!!e)),p=[];for(let e=0;ee*t),1);e.input_labels=new a.Tensor("int64",new BigInt64Array(n).fill(1n),t)}return await v(this.prompt_encoder_mask_decoder,{input_points:e.input_points,input_labels:e.input_labels,image_embeddings:e.image_embeddings,image_positional_embeddings:e.image_positional_embeddings})}async _call(e){return new uo(await super._call(e))}}class uo extends z{constructor({iou_scores:e,pred_masks:t}){super(),this.iou_scores=e,this.pred_masks=t}}class po extends B{}class _o extends po{}class ho extends po{constructor(e,t,n,r){super(e,t),this.decoder_merged_session=n,this.generation_config=r,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class fo extends B{}class mo extends fo{}class go extends fo{constructor(e,t,n,r){super(e,t),this.decoder_merged_session=n,this.generation_config=r,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class bo extends B{}class wo extends bo{}class xo extends bo{async _call(e){return new Is(await super._call(e))}}class yo extends bo{async _call(e){return new As(await super._call(e))}}class To extends bo{async _call(e){return new Cs(await super._call(e))}}class vo extends B{}class ko extends vo{}class Mo extends vo{async _call(e){return new Is(await super._call(e))}}class So extends vo{async _call(e){return new As(await super._call(e))}}class Po extends B{}class Ao extends Po{}class Fo extends Po{async _call(e){return new Is(await super._call(e))}}class Co extends Po{async _call(e){return new As(await super._call(e))}}class Eo extends Po{async _call(e){return new Cs(await super._call(e))}}class Oo extends B{}class Io extends Oo{}class Do extends Oo{async _call(e){return new Is(await super._call(e))}}class Lo extends Oo{async _call(e){return new As(await super._call(e))}}class $o extends B{}class No extends bo{}class Bo extends bo{async _call(e){return new Is(await super._call(e))}}class zo extends bo{async _call(e){return new As(await super._call(e))}}class Ro extends B{}class jo extends Ro{}class Vo extends Ro{async _call(e){return new Is(await super._call(e))}}class Uo extends Ro{async _call(e){return new As(await super._call(e))}}class Go extends Ro{async _call(e){return new Fs(await super._call(e))}}class qo extends Ro{async _call(e){return new Cs(await super._call(e))}}class Wo extends B{}class Ho extends Wo{}class Xo extends Wo{}class Qo extends Wo{constructor(e,t,n,r){super(e,t),this.decoder_merged_session=n,this.generation_config=r,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(e,t,{threshold:n=.5,minlenratio:r=0,maxlenratio:o=20,vocoder:i=null}={}){const s={input_ids:e},{encoder_outputs:l,encoder_attention_mask:c}=await I(this,s),u=l.dims[1]/this.config.reduction_factor,p=Math.floor(u*o),d=Math.floor(u*r),_=this.config.num_mel_bins;let h=[],f=null,m=null,g=0;for(;;){++g;const e=A(!!m);let r;r=m?m.output_sequence_out:new a.Tensor("float32",new Float32Array(_),[1,1,_]);let o={use_cache_branch:e,output_sequence:r,encoder_attention_mask:c,speaker_embeddings:t,encoder_hidden_states:l};this.addPastKeyValues(o,f),m=await v(this.decoder_merged_session,o),f=this.getPastKeyValues(m,f);const{prob:i,spectrum:s}=m;if(h.push(s),g>=d&&(Array.from(i.data).filter((e=>e>=n)).length>0||g>=p))break}const b=(0,a.cat)(h),{waveform:w}=await v(i.session,{spectrogram:b});return{spectrogram:b,waveform:w}}}class Yo extends B{main_input_name="spectrogram"}class Ko extends B{constructor(e,t,n){super(e,t),this.generation_config=n,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class Zo extends Ko{}class Jo extends B{constructor(e,t,n){super(e,t),this.generation_config=n,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class ei extends Jo{}class ti extends Jo{}class ni extends B{constructor(e,t,n){super(e,t),this.generation_config=n,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class ri extends ni{}class oi extends ni{}class ii extends B{constructor(e,t,n){super(e,t),this.generation_config=n,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class si extends ii{}class ai extends ii{}class li extends B{}class ci extends li{}class ui extends li{static async from_pretrained(e,t={}){return t.model_file_name??="text_model",super.from_pretrained(e,t)}}class pi extends li{static async from_pretrained(e,t={}){return t.model_file_name??="audio_model",super.from_pretrained(e,t)}}class di extends B{}class _i extends di{async _call(e){return new $s(await super._call(e))}}class hi extends B{}class fi extends hi{}class mi extends hi{}class gi extends hi{}class bi extends B{constructor(e,t,n){super(e,t),this.generation_config=n,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class wi extends bi{}class xi extends bi{}class yi extends B{}class Ti extends yi{}class vi extends yi{async _call(e){return new As(await super._call(e))}}class ki{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(e,{quantized:t=!0,progress_callback:n=null,config:o=null,cache_dir:i=null,local_files_only:s=!1,revision:a="main",model_file_name:l=null}={}){let c={quantized:t,progress_callback:n,config:o,cache_dir:i,local_files_only:s,revision:a,model_file_name:l};if(o=await r.AutoConfig.from_pretrained(e,c),c.config||(c.config=o),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let t of this.MODEL_CLASS_MAPPINGS){const n=t.get(o.model_type);if(n)return await n[1].from_pretrained(e,c)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${o.model_type}", attempting to construct from base class.`),await B.from_pretrained(e,c);throw Error(`Unsupported model type: ${o.model_type}`)}}const Mi=new Map([["bert",["BertModel",V]],["nomic_bert",["NomicBertModel",X]],["roformer",["RoFormerModel",Y]],["electra",["ElectraModel",le]],["esm",["EsmModel",Be]],["convbert",["ConvBertModel",ne]],["camembert",["CamembertModel",he]],["deberta",["DebertaModel",xe]],["deberta-v2",["DebertaV2Model",Se]],["mpnet",["MPNetModel",Xe]],["albert",["AlbertModel",it]],["distilbert",["DistilBertModel",Oe]],["roberta",["RobertaModel",Dt]],["xlm",["XLMModel",Rt]],["xlm-roberta",["XLMRobertaModel",Wt]],["clap",["ClapModel",ci]],["clip",["CLIPModel",sn]],["clipseg",["CLIPSegModel",mn]],["chinese_clip",["ChineseCLIPModel",hn]],["siglip",["SiglipModel",un]],["mobilebert",["MobileBertModel",Ue]],["squeezebert",["SqueezeBertModel",et]],["wav2vec2",["Wav2Vec2Model",wo]],["wav2vec2-bert",["Wav2Vec2BertModel",Io]],["unispeech",["UniSpeechModel",ko]],["unispeech-sat",["UniSpeechSatModel",Ao]],["hubert",["HubertModel",No]],["wavlm",["WavLMModel",jo]],["audio-spectrogram-transformer",["ASTModel",Zt]],["vits",["VitsModel",_i]],["detr",["DetrModel",br]],["table-transformer",["TableTransformerModel",kr]],["vit",["ViTModel",tr]],["mobilevit",["MobileViTModel",sr]],["owlvit",["OwlViTModel",cr]],["owlv2",["Owlv2Model",dr]],["beit",["BeitModel",fr]],["deit",["DeiTModel",Ar]],["convnext",["ConvNextModel",Yr]],["convnextv2",["ConvNextV2Model",Jr]],["dinov2",["Dinov2Model",no]],["resnet",["ResNetModel",Er]],["swin",["SwinModel",Dr]],["swin2sr",["Swin2SRModel",Nr]],["donut-swin",["DonutSwinModel",Xr]],["yolos",["YolosModel",io]],["dpt",["DPTModel",Rr]],["glpn",["GLPNModel",qr]],["hifigan",["SpeechT5HifiGan",Yo]],["efficientnet",["EfficientNetModel",Ti]]]),Si=new Map([["t5",["T5Model",ut]],["longt5",["LongT5Model",_t]],["mt5",["MT5Model",mt]],["bart",["BartModel",wt]],["mbart",["MBartModel",vt]],["marian",["MarianModel",_o]],["whisper",["WhisperModel",tn]],["m2m_100",["M2M100Model",mo]],["blenderbot",["BlenderbotModel",At]],["blenderbot-small",["BlenderbotSmallModel",Et]]]),Pi=new Map([["bloom",["BloomModel",Wn]],["gpt2",["GPT2Model",wn]],["gptj",["GPTJModel",An]],["gpt_bigcode",["GPTBigCodeModel",En]],["gpt_neo",["GPTNeoModel",Tn]],["gpt_neox",["GPTNeoXModel",Mn]],["codegen",["CodeGenModel",Dn]],["llama",["LlamaModel",Nn]],["qwen2",["Qwen2Model",Rn]],["phi",["PhiModel",Un]],["mpt",["MptModel",Qn]],["opt",["OPTModel",Zn]],["mistral",["MistralModel",ei]],["starcoder2",["Starcoder2Model",ri]],["falcon",["FalconModel",si]]]),Ai=new Map([["speecht5",["SpeechT5ForSpeechToText",Xo]],["whisper",["WhisperForConditionalGeneration",nn]]]),Fi=new Map([["speecht5",["SpeechT5ForTextToSpeech",Qo]]]),Ci=new Map([["vits",["VitsModel",_i]]]),Ei=new Map([["bert",["BertForSequenceClassification",G]],["roformer",["RoFormerForSequenceClassification",Z]],["electra",["ElectraForSequenceClassification",ue]],["esm",["EsmForSequenceClassification",Re]],["convbert",["ConvBertForSequenceClassification",oe]],["camembert",["CamembertForSequenceClassification",me]],["deberta",["DebertaForSequenceClassification",Te]],["deberta-v2",["DebertaV2ForSequenceClassification",Ae]],["mpnet",["MPNetForSequenceClassification",Ye]],["albert",["AlbertForSequenceClassification",st]],["distilbert",["DistilBertForSequenceClassification",Ie]],["roberta",["RobertaForSequenceClassification",$t]],["xlm",["XLMForSequenceClassification",Vt]],["xlm-roberta",["XLMRobertaForSequenceClassification",Xt]],["bart",["BartForSequenceClassification",yt]],["mbart",["MBartForSequenceClassification",Mt]],["mobilebert",["MobileBertForSequenceClassification",qe]],["squeezebert",["SqueezeBertForSequenceClassification",nt]]]),Oi=new Map([["bert",["BertForTokenClassification",q]],["roformer",["RoFormerForTokenClassification",J]],["electra",["ElectraForTokenClassification",pe]],["esm",["EsmForTokenClassification",je]],["convbert",["ConvBertForTokenClassification",ie]],["camembert",["CamembertForTokenClassification",ge]],["deberta",["DebertaForTokenClassification",ve]],["deberta-v2",["DebertaV2ForTokenClassification",Fe]],["mpnet",["MPNetForTokenClassification",Ke]],["distilbert",["DistilBertForTokenClassification",De]],["roberta",["RobertaForTokenClassification",Nt]],["xlm",["XLMForTokenClassification",Ut]],["xlm-roberta",["XLMRobertaForTokenClassification",Qt]]]),Ii=new Map([["t5",["T5ForConditionalGeneration",pt]],["longt5",["LongT5ForConditionalGeneration",ht]],["mt5",["MT5ForConditionalGeneration",gt]],["bart",["BartForConditionalGeneration",xt]],["mbart",["MBartForConditionalGeneration",kt]],["marian",["MarianMTModel",ho]],["m2m_100",["M2M100ForConditionalGeneration",go]],["blenderbot",["BlenderbotForConditionalGeneration",Ft]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",Ot]]]),Di=new Map([["bloom",["BloomForCausalLM",Hn]],["gpt2",["GPT2LMHeadModel",xn]],["gptj",["GPTJForCausalLM",Fn]],["gpt_bigcode",["GPTBigCodeForCausalLM",On]],["gpt_neo",["GPTNeoForCausalLM",vn]],["gpt_neox",["GPTNeoXForCausalLM",Sn]],["codegen",["CodeGenForCausalLM",Ln]],["llama",["LlamaForCausalLM",Bn]],["qwen2",["Qwen2ForCausalLM",jn]],["phi",["PhiForCausalLM",Gn]],["mpt",["MptForCausalLM",Yn]],["opt",["OPTForCausalLM",Jn]],["mbart",["MBartForCausalLM",St]],["mistral",["MistralForCausalLM",ti]],["starcoder2",["Starcoder2ForCausalLM",oi]],["falcon",["FalconForCausalLM",ai]],["trocr",["TrOCRForCausalLM",Zo]],["stablelm",["StableLmForCausalLM",xi]]]),Li=new Map([["bert",["BertForMaskedLM",U]],["roformer",["RoFormerForMaskedLM",K]],["electra",["ElectraForMaskedLM",ce]],["esm",["EsmForMaskedLM",ze]],["convbert",["ConvBertForMaskedLM",re]],["camembert",["CamembertForMaskedLM",fe]],["deberta",["DebertaForMaskedLM",ye]],["deberta-v2",["DebertaV2ForMaskedLM",Pe]],["mpnet",["MPNetForMaskedLM",Qe]],["albert",["AlbertForMaskedLM",lt]],["distilbert",["DistilBertForMaskedLM",$e]],["roberta",["RobertaForMaskedLM",Lt]],["xlm",["XLMWithLMHeadModel",jt]],["xlm-roberta",["XLMRobertaForMaskedLM",Ht]],["mobilebert",["MobileBertForMaskedLM",Ge]],["squeezebert",["SqueezeBertForMaskedLM",tt]]]),$i=new Map([["bert",["BertForQuestionAnswering",W]],["roformer",["RoFormerForQuestionAnswering",ee]],["electra",["ElectraForQuestionAnswering",de]],["convbert",["ConvBertForQuestionAnswering",se]],["camembert",["CamembertForQuestionAnswering",be]],["deberta",["DebertaForQuestionAnswering",ke]],["deberta-v2",["DebertaV2ForQuestionAnswering",Ce]],["mpnet",["MPNetForQuestionAnswering",Ze]],["albert",["AlbertForQuestionAnswering",at]],["distilbert",["DistilBertForQuestionAnswering",Le]],["roberta",["RobertaForQuestionAnswering",Bt]],["xlm",["XLMForQuestionAnswering",Gt]],["xlm-roberta",["XLMRobertaForQuestionAnswering",Yt]],["mobilebert",["MobileBertForQuestionAnswering",We]],["squeezebert",["SqueezeBertForQuestionAnswering",rt]]]),Ni=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",rn]]]),Bi=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",rn]]]),zi=new Map([["vit",["ViTForImageClassification",nr]],["mobilevit",["MobileViTForImageClassification",ar]],["beit",["BeitForImageClassification",mr]],["deit",["DeiTForImageClassification",Fr]],["convnext",["ConvNextForImageClassification",Kr]],["convnextv2",["ConvNextV2ForImageClassification",eo]],["dinov2",["Dinov2ForImageClassification",ro]],["resnet",["ResNetForImageClassification",Or]],["swin",["SwinForImageClassification",Lr]],["segformer",["SegformerForImageClassification",mi]],["efficientnet",["EfficientNetForImageClassification",vi]]]),Ri=new Map([["detr",["DetrForObjectDetection",wr]],["table-transformer",["TableTransformerForObjectDetection",Mr]],["yolos",["YolosForObjectDetection",so]]]),ji=new Map([["owlvit",["OwlViTForObjectDetection",ur]],["owlv2",["Owlv2ForObjectDetection",_r]]]),Vi=new Map([["detr",["DetrForSegmentation",xr]],["clipseg",["CLIPSegForImageSegmentation",gn]]]),Ui=new Map([["segformer",["SegformerForSemanticSegmentation",gi]]]),Gi=new Map([["sam",["SamModel",co]]]),qi=new Map([["wav2vec2",["Wav2Vec2ForCTC",xo]],["wav2vec2-bert",["Wav2Vec2BertForCTC",Do]],["unispeech",["UniSpeechForCTC",Mo]],["unispeech-sat",["UniSpeechSatForCTC",Fo]],["wavlm",["WavLMForCTC",Vo]],["hubert",["HubertForCTC",Bo]]]),Wi=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",yo]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",Lo]],["unispeech",["UniSpeechForSequenceClassification",So]],["unispeech-sat",["UniSpeechSatForSequenceClassification",Co]],["wavlm",["WavLMForSequenceClassification",Uo]],["hubert",["HubertForSequenceClassification",zo]],["audio-spectrogram-transformer",["ASTForAudioClassification",Jt]]]),Hi=new Map([["wavlm",["WavLMForXVector",Go]]]),Xi=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",Eo]],["wavlm",["WavLMForAudioFrameClassification",qo]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",To]]]),Qi=new Map([["vitmatte",["VitMatteForImageMatting",or]]]),Yi=new Map([["swin2sr",["Swin2SRForImageSuperResolution",Br]]]),Ki=new Map([["dpt",["DPTForDepthEstimation",jr]],["depth_anything",["DepthAnythingForDepthEstimation",Ur]],["glpn",["GLPNForDepthEstimation",Wr]]]),Zi=new Map([["clip",["CLIPVisionModelWithProjection",ln]],["siglip",["SiglipVisionModel",dn]]]),Ji=[[Mi,_],[Si,h],[Pi,g],[Ei,_],[Oi,_],[Ii,f],[Ai,f],[Di,g],[Li,_],[$i,_],[Ni,m],[zi,_],[Vi,_],[Ui,_],[Qi,_],[Yi,_],[Ki,_],[Ri,_],[ji,_],[Gi,b],[qi,_],[Wi,_],[Fi,f],[Ci,_],[Hi,_],[Xi,_],[Zi,_]];for(const[e,t]of Ji)for(const[n,r]of e.values())w.set(n,t),y.set(r,n),x.set(n,r);const es=[["CLIPTextModelWithProjection",an,_],["SiglipTextModel",pn,_],["ClapTextModelWithProjection",ui,_],["ClapAudioModelWithProjection",pi,_]];for(const[e,t,n]of es)w.set(e,n),y.set(t,e),x.set(e,t);class ts extends ki{static MODEL_CLASS_MAPPINGS=Ji.map((e=>e[0]));static BASE_IF_FAIL=!0}class ns extends ki{static MODEL_CLASS_MAPPINGS=[Ei]}class rs extends ki{static MODEL_CLASS_MAPPINGS=[Oi]}class os extends ki{static MODEL_CLASS_MAPPINGS=[Ii]}class is extends ki{static MODEL_CLASS_MAPPINGS=[Ai]}class ss extends ki{static MODEL_CLASS_MAPPINGS=[Fi]}class as extends ki{static MODEL_CLASS_MAPPINGS=[Ci]}class ls extends ki{static MODEL_CLASS_MAPPINGS=[Di]}class cs extends ki{static MODEL_CLASS_MAPPINGS=[Li]}class us extends ki{static MODEL_CLASS_MAPPINGS=[$i]}class ps extends ki{static MODEL_CLASS_MAPPINGS=[Ni]}class ds extends ki{static MODEL_CLASS_MAPPINGS=[zi]}class _s extends ki{static MODEL_CLASS_MAPPINGS=[Vi]}class hs extends ki{static MODEL_CLASS_MAPPINGS=[Ui]}class fs extends ki{static MODEL_CLASS_MAPPINGS=[Ri]}class ms extends ki{static MODEL_CLASS_MAPPINGS=[ji]}class gs extends ki{static MODEL_CLASS_MAPPINGS=[Gi]}class bs extends ki{static MODEL_CLASS_MAPPINGS=[qi]}class ws extends ki{static MODEL_CLASS_MAPPINGS=[Wi]}class xs extends ki{static MODEL_CLASS_MAPPINGS=[Hi]}class ys extends ki{static MODEL_CLASS_MAPPINGS=[Xi]}class Ts extends ki{static MODEL_CLASS_MAPPINGS=[Bi]}class vs extends ki{static MODEL_CLASS_MAPPINGS=[Qi]}class ks extends ki{static MODEL_CLASS_MAPPINGS=[Yi]}class Ms extends ki{static MODEL_CLASS_MAPPINGS=[Ki]}class Ss extends ki{static MODEL_CLASS_MAPPINGS=[Zi]}class Ps extends z{constructor({logits:e,past_key_values:t,encoder_outputs:n,decoder_attentions:r=null,cross_attentions:o=null}){super(),this.logits=e,this.past_key_values=t,this.encoder_outputs=n,this.decoder_attentions=r,this.cross_attentions=o}}class As extends z{constructor({logits:e}){super(),this.logits=e}}class Fs extends z{constructor({logits:e,embeddings:t}){super(),this.logits=e,this.embeddings=t}}class Cs extends z{constructor({logits:e}){super(),this.logits=e}}class Es extends z{constructor({logits:e}){super(),this.logits=e}}class Os extends z{constructor({start_logits:e,end_logits:t}){super(),this.start_logits=e,this.end_logits=t}}class Is extends z{constructor({logits:e}){super(),this.logits=e}}class Ds extends z{constructor({logits:e,past_key_values:t}){super(),this.logits=e,this.past_key_values=t}}class Ls extends z{constructor({alphas:e}){super(),this.alphas=e}}class $s extends z{constructor({waveform:e,spectrogram:t}){super(),this.waveform=e,this.spectrogram=t}}},"./src/pipelines.js": /*!**************************!*\ !*** ./src/pipelines.js ***! \**************************/(e,t,n)=>{n.r(t),n.d(t,{AudioClassificationPipeline:()=>P,AutomaticSpeechRecognitionPipeline:()=>F,DepthEstimationPipeline:()=>z,DocumentQuestionAnsweringPipeline:()=>$,FeatureExtractionPipeline:()=>M,FillMaskPipeline:()=>b,ImageClassificationPipeline:()=>E,ImageFeatureExtractionPipeline:()=>S,ImageSegmentationPipeline:()=>O,ImageToImagePipeline:()=>B,ImageToTextPipeline:()=>C,ObjectDetectionPipeline:()=>D,Pipeline:()=>h,QuestionAnsweringPipeline:()=>g,SummarizationPipeline:()=>x,Text2TextGenerationPipeline:()=>w,TextClassificationPipeline:()=>f,TextGenerationPipeline:()=>v,TextToAudioPipeline:()=>N,TokenClassificationPipeline:()=>m,TranslationPipeline:()=>y,ZeroShotAudioClassificationPipeline:()=>A,ZeroShotClassificationPipeline:()=>k,ZeroShotImageClassificationPipeline:()=>I,ZeroShotObjectDetectionPipeline:()=>L,pipeline:()=>V});var r=n(/*! ./tokenizers.js */"./src/tokenizers.js"),o=n(/*! ./models.js */"./src/models.js"),i=n(/*! ./processors.js */"./src/processors.js"),s=n(/*! ./utils/core.js */"./src/utils/core.js"),a=n(/*! ./utils/maths.js */"./src/utils/maths.js"),l=n(/*! ./utils/audio.js */"./src/utils/audio.js"),c=n(/*! ./utils/tensor.js */"./src/utils/tensor.js"),u=n(/*! ./utils/image.js */"./src/utils/image.js");async function p(e){return Array.isArray(e)||(e=[e]),await Promise.all(e.map((e=>u.RawImage.read(e))))}async function d(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map((e=>"string"==typeof e||e instanceof URL?(0,l.read_audio)(e,t):e instanceof Float64Array?new Float32Array(e):e)))}function _(e,t){t&&(e=e.map((e=>0|e)));const[n,r,o,i]=e;return{xmin:n,ymin:r,xmax:o,ymax:i}}class h extends s.Callable{constructor({task:e,model:t,tokenizer:n=null,processor:r=null}){super(),this.task=e,this.model=t,this.tokenizer=n,this.processor=r}async dispose(){await this.model.dispose()}}class f extends h{constructor(e){super(e)}async _call(e,{topk:t=1}={}){const n=this.tokenizer(e,{padding:!0,truncation:!0}),r=await this.model(n),o="multi_label_classification"===this.model.config.problem_type?e=>e.sigmoid().data:e=>(0,a.softmax)(e.data),i=this.model.config.id2label,s=[];for(const e of r.logits){const n=o(e),r=(0,a.getTopItems)(n,t).map((e=>({label:i[e[0]],score:e[1]})));1===t?s.push(...r):s.push(r)}return Array.isArray(e)||1===t?s:s[0]}}class m extends h{constructor(e){super(e)}async _call(e,{ignore_labels:t=["O"]}={}){const n=Array.isArray(e),r=this.tokenizer(n?e:[e],{padding:!0,truncation:!0}),o=(await this.model(r)).logits,i=this.model.config.id2label,s=[];for(let e=0;e[e,t])).filter((e=>e[1]>l)),u=Array.from((0,a.softmax)(o.end_logits[e].data)).map(((e,t)=>[e,t])).filter((e=>e[1]>l)),p=(0,s.product)(c,u).filter((e=>e[0][1]<=e[1][1])).map((e=>[e[0][1],e[1][1],e[0][0]*e[1][0]])).sort(((e,t)=>t[2]-e[2]));for(let e=0;e{const t=[...i];return t[s]=e[0],{score:e[1],token:e[0],token_str:this.tokenizer.model.vocab[e[0]],sequence:this.tokenizer.decode(t,{skip_special_tokens:!0})}})))}return Array.isArray(e)?o:o[0]}}class w extends h{_key="generated_text";constructor(e){super(e)}async _call(e,t={}){Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map((e=>this.model.config.prefix+e)));const n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map((e=>n[this.task].prefix+e)));const r=this.tokenizer,o={padding:!0,truncation:!0};let i;i=this instanceof y&&"_build_translation_inputs"in r?r._build_translation_inputs(e,o,t).input_ids:r(e,o).input_ids;const s=await this.model.generate(i,t);return r.batch_decode(s,{skip_special_tokens:!0}).map((e=>({[this._key]:e})))}}class x extends w{_key="summary_text";constructor(e){super(e)}}class y extends w{_key="translation_text";constructor(e){super(e)}}function T(e){return Array.isArray(e)&&e.every((e=>"role"in e&&"content"in e))}class v extends h{constructor(e){super(e)}async _call(e,t={}){let n,r=!1,o=!1;if("string"==typeof e)n=e=[e];else if(Array.isArray(e)&&e.every((e=>"string"==typeof e)))r=!0,n=e;else{if(T(e))e=[e];else{if(!Array.isArray(e)||!e.every(T))throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");r=!0}o=!0,n=e.map((e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0})))}const i=t.add_special_tokens??!1,s=!o&&(t.return_full_text??!0);this.tokenizer.padding_side="left";const{input_ids:a,attention_mask:l}=this.tokenizer(n,{add_special_tokens:i,padding:!0,truncation:!0}),c=await this.model.generate(a,t,null,{inputs_attention_mask:l});let u,p=this.tokenizer.batch_decode(c,{skip_special_tokens:!0});!s&&a.dims.at(-1)>0&&(u=this.tokenizer.batch_decode(a,{skip_special_tokens:!0}).map((e=>e.length)));const d=Array.from({length:e.length},(e=>[]));for(let t=0;t[e.toLowerCase(),t]))),this.entailment_id=this.label2id.entailment,void 0===this.entailment_id&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,void 0===this.contradiction_id&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:n="This example is {}.",multi_label:r=!1}={}){const o=Array.isArray(e);o||(e=[e]),Array.isArray(t)||(t=[t]);const i=t.map((e=>n.replace("{}",e))),s=r||1===t.length,l=[];for(const n of e){const e=[];for(const t of i){const r=this.tokenizer(n,{text_pair:t,padding:!0,truncation:!0}),o=await this.model(r);s?e.push([o.logits.data[this.contradiction_id],o.logits.data[this.entailment_id]]):e.push(o.logits.data[this.entailment_id])}const r=(s?e.map((e=>(0,a.softmax)(e)[1])):(0,a.softmax)(e)).map(((e,t)=>[e,t])).sort(((e,t)=>t[0]-e[0]));l.push({sequence:n,labels:r.map((e=>t[e[1]])),scores:r.map((e=>e[0]))})}return o?l:l[0]}}class M extends h{constructor(e){super(e)}async _call(e,{pooling:t="none",normalize:n=!1,quantize:r=!1,precision:o="binary"}={}){const i=this.tokenizer(e,{padding:!0,truncation:!0}),s=await this.model(i);let a=s.last_hidden_state??s.logits;if("none"===t);else if("mean"===t)a=(0,c.mean_pooling)(a,i.attention_mask);else{if("cls"!==t)throw Error(`Pooling method '${t}' not supported.`);a=a.slice(null,0)}return n&&(a=a.normalize(2,-1)),r&&(a=(0,c.quantize_embeddings)(a,o)),a}}class S extends h{constructor(e){super(e)}async _call(e,{pool:t=null}={}){const n=await p(e),{pixel_values:r}=await this.processor(n),o=await this.model({pixel_values:r});let i;if(t){if(!("pooler_output"in o))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");i=o.pooler_output}else i=o.last_hidden_state??o.logits??o.image_embeds;return i}}class P extends h{constructor(e){super(e)}async _call(e,{topk:t=null}={}){const n=!Array.isArray(e),r=this.processor.feature_extractor.config.sampling_rate,o=await d(e,r),i=this.model.config.id2label,s=[];for(const e of o){const n=await this.processor(e),r=(await this.model(n)).logits[0],o=(0,a.getTopItems)((0,a.softmax)(r.data),t).map((e=>({label:i[e[0]],score:e[1]})));1===t?s.push(...o):s.push(o)}return n&&1!==t?s[0]:s}}class A extends h{constructor(e){super(e)}async _call(e,t,{hypothesis_template:n="This is a sound of {}."}={}){const r=!Array.isArray(e);r&&(e=[e]);const o=t.map((e=>n.replace("{}",e))),i=this.tokenizer(o,{padding:!0,truncation:!0}),s=this.processor.feature_extractor.config.sampling_rate,l=await d(e,s),c=[];for(const e of l){const n=await this.processor(e),r=await this.model({...i,...n}),o=(0,a.softmax)(r.logits_per_audio.data);c.push([...o].map(((e,n)=>({score:e,label:t[n]}))))}return r?c[0]:c}}class F extends h{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case"whisper":return this._call_whisper(e,t);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(e,t);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t={}){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const n=!Array.isArray(e);n&&(e=[e]);const r=this.processor.feature_extractor.config.sampling_rate,o=await d(e,r),i=[];for(const e of o){const t=await this.processor(e),n=(await this.model(t)).logits[0],r=[];for(const e of n)r.push((0,a.max)(e.data)[1]);const o=this.tokenizer.decode(r);i.push({text:o})}return n?i[0]:i}async _call_whisper(e,t={}){const n=t.return_timestamps??!1,r=t.chunk_length_s??0,o=t.chunk_callback??null,i=t.force_full_sequences??!1;let l=t.stride_length_s??null;"word"===n&&(t.return_token_timestamps=!0);const c=(0,s.pop)(t,"language",null),u=(0,s.pop)(t,"task",null);if(c||u||n){if(t.forced_decoder_ids)throw new Error("Cannot specify `language`/`task`/`return_timestamps` and `forced_decoder_ids` at the same time.");const e=this.tokenizer.get_decoder_prompt_ids({language:c,task:u,no_timestamps:!n});e.length>0&&(t.forced_decoder_ids=e)}const p=!Array.isArray(e);p&&(e=[e]);const _=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,h=this.processor.feature_extractor.config.hop_length,f=this.processor.feature_extractor.config.sampling_rate,m=await d(e,f),g=[];for(const e of m){let s=[];if(r>0){if(null===l)l=r/6;else if(r<=l)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const t=f*r,n=f*l,o=t-2*n;let i=0;for(;i=e.length;s.push({stride:[r.length,l?0:n,c?0:n],input_features:a.input_features,is_last:c}),i+=o}}else s=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(const e of s){t.num_frames=Math.floor(e.stride[0]/h);const r=await this.model.generate(e.input_features,t);"word"===n?(e.tokens=r.sequences[0],e.token_timestamps=r.token_timestamps.tolist()[0].map((e=>(0,a.round)(e,2)))):e.tokens=r[0],e.stride=e.stride.map((e=>e/f)),null!==o&&o(e)}const[c,u]=this.tokenizer._decode_asr(s,{time_precision:_,return_timestamps:n,force_full_sequences:i});g.push({text:c,...u})}return p?g[0]:g}}class C extends h{constructor(e){super(e)}async _call(e,t={}){const n=Array.isArray(e),r=await p(e),{pixel_values:o}=await this.processor(r),i=[];for(const e of o){e.dims=[1,...e.dims];const n=await this.model.generate(e,t),r=this.tokenizer.batch_decode(n,{skip_special_tokens:!0}).map((e=>({generated_text:e.trim()})));i.push(r)}return n?i:i[0]}}class E extends h{constructor(e){super(e)}async _call(e,{topk:t=1}={}){const n=Array.isArray(e),r=await p(e),{pixel_values:o}=await this.processor(r),i=await this.model({pixel_values:o}),s=this.model.config.id2label,l=[];for(const e of i.logits){const n=(0,a.getTopItems)((0,a.softmax)(e.data),t).map((e=>({label:s[e[0]],score:e[1]})));1===t?l.push(...n):l.push(n)}return n||1===t?l:l[0]}}class O extends h{constructor(e){super(e),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(e,{threshold:t=.5,mask_threshold:n=.5,overlap_mask_area_threshold:r=.8,label_ids_to_fuse:o=null,target_sizes:i=null,subtask:s=null}={}){if(Array.isArray(e)&&1!==e.length)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const a=await p(e),l=a.map((e=>[e.height,e.width])),{pixel_values:c,pixel_mask:d}=await this.processor(a),_=await this.model({pixel_values:c,pixel_mask:d});let h=null;if(null!==s)h=this.subtasks_mapping[s];else for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.feature_extractor){h=this.processor.feature_extractor[t].bind(this.processor.feature_extractor),s=e;break}const f=this.model.config.id2label,m=[];if("panoptic"===s||"instance"===s){const e=h(_,t,n,r,o,i??l)[0],s=e.segmentation;for(const t of e.segments_info){const e=new Uint8ClampedArray(s.data.length);for(let n=0;nn.replace("{}",e))),s=this.tokenizer(i,{padding:"siglip"!==this.model.config.model_type||"max_length",truncation:!0}),{pixel_values:l}=await this.processor(o),c=await this.model({...s,pixel_values:l}),u="siglip"===this.model.config.model_type?e=>e.sigmoid().data:e=>(0,a.softmax)(e.data),d=[];for(const e of c.logits_per_image){const n=[...u(e)].map(((e,n)=>({score:e,label:t[n]})));n.sort(((e,t)=>t.score-e.score)),d.push(n)}return r?d:d[0]}}class D extends h{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:n=!1}={}){const r=Array.isArray(e);if(r&&1!==e.length)throw Error("Object detection pipeline currently only supports a batch size of 1.");const o=await p(e),i=n?null:o.map((e=>[e.height,e.width])),{pixel_values:s,pixel_mask:a}=await this.processor(o),l=await this.model({pixel_values:s,pixel_mask:a}),c=this.processor.feature_extractor.post_process_object_detection(l,t,i),u=this.model.config.id2label,d=c.map((e=>e.boxes.map(((t,r)=>({score:e.scores[r],label:u[e.classes[r]],box:_(t,!n)})))));return r?d:d[0]}}class L extends h{constructor(e){super(e)}async _call(e,t,{threshold:n=.1,topk:r=null,percentage:o=!1}={}){const i=Array.isArray(e),s=await p(e),a=this.tokenizer(t,{padding:!0,truncation:!0}),l=await this.processor(s),c=[];for(let e=0;e({score:h.scores[n],label:t[h.classes[n]],box:_(e,!o)}))).sort(((e,t)=>t.score-e.score));null!==r&&(f=f.slice(0,r)),c.push(f)}return i?c:c[0]}}class $ extends h{constructor(e){super(e)}async _call(e,t,n={}){const r=(await p(e))[0],{pixel_values:o}=await this.processor(r),i=`${t}`,s=this.tokenizer(i,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,a=await this.model.generate(o,{...n,decoder_input_ids:s,max_length:this.model.config.decoder.max_position_embeddings}),l=this.tokenizer.batch_decode(a)[0].match(/(.*?)<\/s_answer>/);let c=null;return l&&l.length>=2&&(c=l[1].trim()),[{answer:c}]}}class N extends h{DEFAULT_VOCODER_ID="Xenova/speecht5_hifigan";constructor(e){super(e),this.vocoder=e.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){const t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model(t),r=this.model.config.sampling_rate;return{audio:n.data,sampling_rate:r}}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log("No vocoder specified, using default HifiGan vocoder."),this.vocoder=await o.AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{quantized:!1})),("string"==typeof t||t instanceof URL)&&(t=new Float32Array(await(await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new c.Tensor("float32",t,[1,t.length]);else if(!(t instanceof c.Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:n}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model.generate_speech(n,t,{vocoder:this.vocoder}),i=this.processor.feature_extractor.config.sampling_rate;return{audio:r.data,sampling_rate:i}}}class B extends h{constructor(e){super(e)}async _call(e){const t=await p(e),n=await this.processor(t),r=await this.model(n),o=[];for(const e of r.reconstruction){const t=e.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");o.push(u.RawImage.fromTensor(t))}return o.length>1?o:o[0]}}class z extends h{constructor(e){super(e)}async _call(e){const t=await p(e),n=await this.processor(t),{predicted_depth:r}=await this.model(n),o=[];for(let e=0;e1?o:o[0]}}const R=Object.freeze({"text-classification":{tokenizer:r.AutoTokenizer,pipeline:f,model:o.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:r.AutoTokenizer,pipeline:m,model:o.AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:r.AutoTokenizer,pipeline:g,model:o.AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:r.AutoTokenizer,pipeline:b,model:o.AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:r.AutoTokenizer,pipeline:x,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:r.AutoTokenizer,pipeline:y,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:r.AutoTokenizer,pipeline:w,model:o.AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:r.AutoTokenizer,pipeline:v,model:o.AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:r.AutoTokenizer,pipeline:k,model:o.AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:P,model:o.AutoModelForAudioClassification,processor:i.AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:r.AutoTokenizer,pipeline:A,model:o.AutoModel,processor:i.AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:r.AutoTokenizer,pipeline:F,model:[o.AutoModelForSpeechSeq2Seq,o.AutoModelForCTC],processor:i.AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:r.AutoTokenizer,pipeline:N,model:[o.AutoModelForTextToWaveform,o.AutoModelForTextToSpectrogram],processor:[i.AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:r.AutoTokenizer,pipeline:C,model:o.AutoModelForVision2Seq,processor:i.AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:E,model:o.AutoModelForImageClassification,processor:i.AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:O,model:[o.AutoModelForImageSegmentation,o.AutoModelForSemanticSegmentation],processor:i.AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"zero-shot-image-classification":{tokenizer:r.AutoTokenizer,pipeline:I,model:o.AutoModel,processor:i.AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:D,model:o.AutoModelForObjectDetection,processor:i.AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:r.AutoTokenizer,pipeline:L,model:o.AutoModelForZeroShotObjectDetection,processor:i.AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:r.AutoTokenizer,pipeline:$,model:o.AutoModelForDocumentQuestionAnswering,processor:i.AutoProcessor,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:B,model:o.AutoModelForImageToImage,processor:i.AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:z,model:o.AutoModelForDepthEstimation,processor:i.AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:r.AutoTokenizer,pipeline:M,model:o.AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:i.AutoProcessor,pipeline:S,model:[o.AutoModelForImageFeatureExtraction,o.AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),j=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function V(e,t=null,{quantized:n=!0,progress_callback:r=null,config:o=null,cache_dir:i=null,local_files_only:a=!1,revision:l="main"}={}){e=j[e]??e;const c=R[e.split("_",1)[0]];if(!c)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(R)}]`);t||(t=c.default.model,console.log(`No model specified. Using default model: "${t}".`));const u={quantized:n,progress_callback:r,config:o,cache_dir:i,local_files_only:a,revision:l},p=new Map([["tokenizer",c.tokenizer],["model",c.model],["processor",c.processor]]),d=await async function(e,t,n){const r=Object.create(null),o=[];for(let[i,s]of e.entries()){if(!s)continue;let e;e=Array.isArray(s)?new Promise((async(e,r)=>{let o;for(let r of s){if(null===r)return void e(null);try{return void e(await r.from_pretrained(t,n))}catch(e){o=e}}r(o)})):s.from_pretrained(t,n),r[i]=e,o.push(e)}await Promise.all(o);for(let[e,t]of Object.entries(r))r[e]=await t;return r}(p,t,u);d.task=e,(0,s.dispatchCallback)(r,{status:"ready",task:e,model:t});return new(0,c.pipeline)(d)}},"./src/processors.js": /*!***************************!*\ !*** ./src/processors.js ***! \***************************/(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>U,AutoProcessor:()=>Z,BeitFeatureExtractor:()=>O,BitImageProcessor:()=>b,CLIPFeatureExtractor:()=>x,ChineseCLIPFeatureExtractor:()=>y,ClapFeatureExtractor:()=>G,ConvNextFeatureExtractor:()=>v,ConvNextImageProcessor:()=>k,DPTFeatureExtractor:()=>m,DPTImageProcessor:()=>g,DeiTFeatureExtractor:()=>E,DetrFeatureExtractor:()=>L,DonutFeatureExtractor:()=>I,EfficientNetImageProcessor:()=>P,FeatureExtractor:()=>_,GLPNFeatureExtractor:()=>w,ImageFeatureExtractor:()=>h,MobileViTFeatureExtractor:()=>A,NougatImageProcessor:()=>D,OwlViTFeatureExtractor:()=>F,OwlViTProcessor:()=>K,Owlv2ImageProcessor:()=>C,Processor:()=>W,SamImageProcessor:()=>N,SamProcessor:()=>H,SeamlessM4TFeatureExtractor:()=>V,SegformerFeatureExtractor:()=>f,SiglipImageProcessor:()=>T,SpeechT5FeatureExtractor:()=>q,SpeechT5Processor:()=>Y,Swin2SRImageProcessor:()=>B,ViTFeatureExtractor:()=>M,ViTImageProcessor:()=>S,VitMatteImageProcessor:()=>z,Wav2Vec2FeatureExtractor:()=>j,Wav2Vec2ProcessorWithLM:()=>Q,WhisperFeatureExtractor:()=>R,WhisperProcessor:()=>X,YolosFeatureExtractor:()=>$});var r=n(/*! ./utils/core.js */"./src/utils/core.js"),o=n(/*! ./utils/hub.js */"./src/utils/hub.js"),i=n(/*! ./utils/maths.js */"./src/utils/maths.js"),s=n(/*! ./utils/tensor.js */"./src/utils/tensor.js"),a=(n(/*! ./utils/image.js */"./src/utils/image.js"),n(/*! ./utils/audio.js */"./src/utils/audio.js"));function l([e,t,n,r]){return[e-n/2,t-r/2,e+n/2,t+r/2]}function c(e,t=.5,n=null,r=!1){const o=e.logits,s=e.pred_boxes,[a,c,u]=o.dims;if(null!==n&&n.length!==a)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let p=[];for(let e=0;et&&s.push(e)}else{let e=(0,i.max)(o.data)[1];if(e===u-1)continue;s.push(e),n=(0,i.softmax)(o.data)}for(const t of s){let r=h[e].data;r=l(r),null!==a&&(r=r.map(((e,t)=>e*a[(t+1)%2]))),d.boxes.push(r),d.classes.push(t),d.scores.push(n[t])}}p.push(d)}return p}function u(e,t){if(!(e instanceof Float32Array||e instanceof Float64Array))throw new Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${e?.constructor?.name??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}function p(e,t,n=0,r=null){const o=e/t;let s=(0,i.bankers_round)(o)*t;return null!==r&&s>r&&(s=Math.floor(o)*t),so?l=Math.floor(o*a/r):o>r&&(a=Math.floor(r*l/o)),await e.resize(l,a,{resample:n}))}async crop_margin(e,t=200){const n=e.clone().grayscale(),r=(0,i.min)(n.data)[0],o=(0,i.max)(n.data)[0]-r;if(0===o)return e;const s=t/255;let a=n.width,l=n.height,c=0,u=0;for(let e=0;ethis.preprocess(e))));return{pixel_values:(0,s.stack)(n.map((e=>e.pixel_values)),0),original_sizes:n.map((e=>e.original_size)),reshaped_input_sizes:n.map((e=>e.reshaped_input_size))}}}class f extends h{post_process_semantic_segmentation(e,t=null){const n=e.logits,r=n.dims[0];if(null!==t&&t.length!==r)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const o=[];for(let e=0;eu[n]&&(u[n]=t[n],c.data[n]=e)}const p=new Array(i.dims[0]),d=c.data;for(let e=0;evoid 0!==e));o.push({segmentation:c,labels:_})}return o}}class m extends h{}class g extends m{}class b extends h{}class w extends h{}class x extends h{}class y extends h{}class T extends h{}class v extends h{constructor(e){super(e),this.crop_pct=this.config.crop_pct??.875}async resize(e){const t=this.size?.shortest_edge;if(void 0===t)throw new Error("Size dictionary must contain 'shortest_edge' key.");if(t<384){const n=Math.floor(t/this.crop_pct),[r,o]=this.get_resize_output_image_size(e,{shortest_edge:n});e=await e.resize(r,o,{resample:this.resample}),e=await e.center_crop(t,t)}else e=await e.resize(t,t,{resample:this.resample});return e}}class k extends v{}class M extends h{}class S extends h{}class P extends h{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map((e=>e*e)))}}class A extends h{}class F extends h{post_process_object_detection(...e){return c(...e)}}class C extends F{}class E extends h{}class O extends h{}class I extends h{pad_image(e,t,n,r={}){const[o,i,s]=t;let a=this.image_mean;Array.isArray(this.image_mean)||(a=new Array(s).fill(a));let l=this.image_std;Array.isArray(l)||(l=new Array(s).fill(a));const c=a.map(((e,t)=>-e/l[t]));return super.pad_image(e,t,n,{center:!0,constant_values:c,...r})}}class D extends I{}class L extends h{async _call(e){const t=await super._call(e),n=[t.pixel_values.dims[0],64,64],r=new s.Tensor("int64",new BigInt64Array(n.reduce(((e,t)=>e*t))).fill(1n),n);return{...t,pixel_mask:r}}post_process_object_detection(...e){return c(...e)}remove_low_and_no_objects(e,t,n,r){let o=[],s=[],a=[];for(let l=0;ln&&(o.push(u),s.push(d),a.push(p))}return[o,s,a]}check_segment_validity(e,t,n,r=.5,o=.8){let i=[],s=0,a=0;for(let o=0;o=r&&++a;let l=s>0&&a>0;if(l){l=s/a>o}return[l,i]}compute_segments(e,t,n,r,o,i=null,a=null){let[l,c]=a??e[0].dims,u=new s.Tensor("int32",new Int32Array(l*c),[l,c]),p=[];if(null!==a)for(let t=0;t_[t]&&(d[t]=n,_[t]=e[n].data[t])}let h=0;for(let i=0;ie!==t.dims[n])))throw Error(`The first ${n.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new s.Tensor("int64",e.flat(1/0).map(BigInt),n)}async _call(e,t=null,n=null){const r=await super._call(e);if(t&&(r.input_points=this.reshape_input_points(t,r.original_sizes,r.reshaped_input_sizes)),n){if(!r.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");r.input_labels=this.add_input_labels(n,r.input_points)}return r}post_process_masks(e,t,n,{mask_threshold:r=0,binarize:o=!0,pad_size:i=null}={}){const a=[],l=[(i=i??this.pad_size).height,i.width];for(let i=0;ir&&(e[t]=1);n=new s.Tensor("bool",e,n.dims)}d.push(n)}a.push((0,s.stack)(d))}return a}}class B extends h{pad_image(e,t,n,r={}){const[o,i,s]=t;return super.pad_image(e,t,{width:i+(n-i%n)%n,height:o+(n-o%n)%n},{mode:"symmetric",center:!1,constant_values:-1,...r})}}class z extends h{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);const n=await Promise.all(e.map((e=>this.preprocess(e)))),r=await Promise.all(t.map((e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0}))));return{pixel_values:(0,s.stack)(n.map(((e,t)=>(0,s.cat)([e.pixel_values,r[t].pixel_values],0))),0),original_sizes:n.map((e=>e.original_size)),reshaped_input_sizes:n.map((e=>e.reshaped_input_size))}}}class R extends _{constructor(e){super(e),this.config.mel_filters??=(0,a.mel_filter_bank)(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney"),this.window=(0,a.window_function)(this.config.n_fft,"hann")}_extract_fbank_features(e){const{data:t,dims:n}=(0,a.spectrogram)(e,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:this.config.nb_max_frames}),r=(0,i.max)(t)[0];for(let e=0;ethis.config.n_samples?(console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),t=e.slice(0,this.config.n_samples)):(t=new Float32Array(this.config.n_samples),t.set(e));const{data:n,dims:r}=this._extract_fbank_features(t);return{input_features:new s.Tensor("float32",n,[1,...r])}}}class j extends _{_zero_mean_unit_var_norm(e){const t=e.reduce(((e,t)=>e+t),0)/e.length,n=e.reduce(((e,n)=>e+(n-t)**2),0)/e.length;return e.map((e=>(e-t)/Math.sqrt(n+1e-7)))}async _call(e){u(e,"Wav2Vec2FeatureExtractor"),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));const n=[1,t.length];return{input_values:new s.Tensor("float32",t,n),attention_mask:new s.Tensor("int64",new BigInt64Array(t.length).fill(1n),n)}}}class V extends _{constructor(e){super(e);const t=this.config.sampling_rate,n=(0,a.mel_filter_bank)(256,this.config.num_mel_bins,20,Math.floor(t/2),t,null,"kaldi",!0);for(let e=0;e32768*e)),(0,a.spectrogram)(e,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1.192092955078125e-7,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:n=2,do_normalize_per_mel_bins:r=!0,return_attention_mask:o=!0}={}){u(e,"SeamlessM4TFeatureExtractor");let i,a=this._extract_fbank_features(e,this.config.max_length);if(r){const[e,t]=a.dims;for(let n=0;n0){const n=new Float32Array(t*(e+r));n.set(a.data),n.fill(this.config.padding_value,a.data.length);const l=e+r;a={data:n,dims:[l,t]},o&&(i=new s.Tensor("int64",new BigInt64Array(l),[1,l]),i.data.fill(1n,0,e))}}const[l,c]=a.dims,p=this.config.stride;if(0!==l%p)throw new Error(`The number of frames (${l}) must be a multiple of the stride (${p}).`);const d=new s.Tensor("float32",a.data,a.dims).view(1,Math.floor(l/p),c*p),_={input_features:d};if(o){const e=d.dims[1],t=new s.Tensor("int64",new BigInt64Array(e),[1,e]);if(i)for(let e=1,n=0;e0){if("rand_trunc"!==n)throw new Error(`Truncation strategy "${n}" not implemented`);{i=!0;const n=Math.floor(Math.random()*(s+1));e=e.subarray(n,n+t),o=this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples),o.dims=[1,...o.dims]}}else{if(s<0){let n=new Float64Array(t);if(n.set(e),"repeat"===r)for(let r=e.length;r{n.r(t),n.d(t,{AlbertTokenizer:()=>me,AutoTokenizer:()=>ut,BartTokenizer:()=>Ce,BertTokenizer:()=>fe,BlenderbotSmallTokenizer:()=>it,BlenderbotTokenizer:()=>ot,BloomTokenizer:()=>De,CLIPTokenizer:()=>et,CamembertTokenizer:()=>Me,CodeGenTokenizer:()=>Je,CodeLlamaTokenizer:()=>Ne,CohereTokenizer:()=>ct,ConvBertTokenizer:()=>Te,DebertaTokenizer:()=>we,DebertaV2Tokenizer:()=>xe,DistilBertTokenizer:()=>ke,ElectraTokenizer:()=>Pe,EsmTokenizer:()=>Ve,FalconTokenizer:()=>Re,GPT2Tokenizer:()=>Fe,GPTNeoXTokenizer:()=>je,GemmaTokenizer:()=>Ge,Grok1Tokenizer:()=>qe,HerbertTokenizer:()=>ye,LlamaTokenizer:()=>$e,M2M100Tokenizer:()=>Xe,MBart50Tokenizer:()=>Oe,MBartTokenizer:()=>Ee,MPNetTokenizer:()=>ze,MarianTokenizer:()=>nt,MobileBertTokenizer:()=>ge,NllbTokenizer:()=>He,NougatTokenizer:()=>at,PreTrainedTokenizer:()=>he,Qwen2Tokenizer:()=>Ue,RoFormerTokenizer:()=>ve,RobertaTokenizer:()=>Ie,SiglipTokenizer:()=>tt,SpeechT5Tokenizer:()=>st,SqueezeBertTokenizer:()=>be,T5Tokenizer:()=>Ae,TokenizerModel:()=>b,VitsTokenizer:()=>lt,Wav2Vec2CTCTokenizer:()=>rt,WhisperTokenizer:()=>Ze,XLMRobertaTokenizer:()=>Be,XLMTokenizer:()=>Se});var r=n(/*! ./utils/core.js */"./src/utils/core.js"),o=n(/*! ./utils/hub.js */"./src/utils/hub.js"),i=n(/*! ./utils/maths.js */"./src/utils/maths.js"),s=n(/*! ./utils/tensor.js */"./src/utils/tensor.js"),a=n(/*! ./utils/data-structures.js */"./src/utils/data-structures.js"),l=n(/*! @huggingface/jinja */"./node_modules/@huggingface/jinja/dist/index.js");async function c(e,t){const n=await Promise.all([(0,o.getModelJSON)(e,"tokenizer.json",!0,t),(0,o.getModelJSON)(e,"tokenizer_config.json",!0,t)]);return null!==t.legacy&&(n[1].legacy=t.legacy),n}function u(e,t=!0){if(void 0!==e.Regex){let t=e.Regex.replace(/\\([#&~])/g,"$1");for(const[e,n]of m)t=t.replaceAll(e,n);return new RegExp(t,"gu")}if(void 0!==e.String){const n=(0,r.escapeRegExp)(e.String);return new RegExp(t?n:`(${n})`,"gu")}return console.warn("Unknown pattern type:",e),null}function p(e){return new Map(Object.entries(e))}function d(e){const t=e.dims;switch(t.length){case 1:return e.tolist();case 2:if(1!==t[0])throw new Error("Unable to decode tensor with `batch size !== 1`. Use `tokenizer.batch_decode(...)` for batched inputs.");return e.tolist()[0];default:throw new Error(`Expected tensor to have 1-2 dimensions, got ${t.length}.`)}}function _(e){return e.replace(/ \./g,".").replace(/ \?/g,"?").replace(/ \!/g,"!").replace(/ ,/g,",").replace(/ \' /g,"'").replace(/ n\'t/g,"n't").replace(/ \'m/g,"'m").replace(/ \'s/g,"'s").replace(/ \'ve/g,"'ve").replace(/ \'re/g,"'re")}function h(e){return e.replace(/[\u0300-\u036f]/g,"")}const f="\\p{P}\\u0021-\\u002F\\u003A-\\u0040\\u005B-\\u0060\\u007B-\\u007E",m=new Map([["(?i:'s|'t|'re|'ve|'m|'ll|'d)","(?:'([sS]|[tT]|[rR][eE]|[vV][eE]|[mM]|[lL][lL]|[dD]))"]]);class g{constructor(e){this.content=e.content,this.id=e.id,this.single_word=e.single_word??!1,this.lstrip=e.lstrip??!1,this.rstrip=e.rstrip??!1,this.special=e.special??!1,this.normalized=e.normalized??null}}class b extends r.Callable{constructor(e){super(),this.config=e,this.vocab=[],this.tokens_to_ids=new Map,this.unk_token_id=void 0,this.unk_token=void 0,this.end_of_word_suffix=void 0,this.fuse_unk=this.config.fuse_unk??!1}static fromConfig(e,...t){switch(e.type){case"WordPiece":return new w(e);case"Unigram":return new x(e,...t);case"BPE":return new v(e);default:if(e.vocab)return new k(e,...t);throw new Error(`Unknown TokenizerModel type: ${e.type}`)}}_call(e){let t=this.encode(e);return this.fuse_unk&&(t=function(e,t,n){const r=[];let o=0;for(;othis.tokens_to_ids.get(e)??this.unk_token_id))}convert_ids_to_tokens(e){return e.map((e=>this.vocab[e]??this.unk_token))}}class w extends b{constructor(e){super(e),this.tokens_to_ids=p(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.max_input_chars_per_word=e.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){const t=[];for(const n of e){const e=[...n];if(e.length>this.max_input_chars_per_word){t.push(this.unk_token);continue}let r=!1,o=0;const i=[];for(;o0&&(r=this.config.continuing_subword_prefix+r),this.tokens_to_ids.has(r)){n=r;break}--t}if(null===n){r=!0;break}i.push(n),o=t}r?t.push(this.unk_token):t.push(...i)}return t}}class x extends b{constructor(e,t){super(e);const n=e.vocab.length;this.vocab=new Array(n),this.scores=new Array(n);for(let t=0;t[e,t]))),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids.get(this.bosToken),this.eosToken=t.eos_token,this.eosTokenId=this.tokens_to_ids.get(this.eosToken),this.unkToken=this.vocab[this.unk_token_id],this.minScore=(0,i.min)(this.scores)[0],this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new a.CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(e){const t=e.sentence,n=t.length;let r=0;for(;r{const e=[...Array.from({length:"~".charCodeAt(0)-"!".charCodeAt(0)+1},((e,t)=>t+"!".charCodeAt(0))),...Array.from({length:"¬".charCodeAt(0)-"¡".charCodeAt(0)+1},((e,t)=>t+"¡".charCodeAt(0))),...Array.from({length:"ÿ".charCodeAt(0)-"®".charCodeAt(0)+1},((e,t)=>t+"®".charCodeAt(0)))],t=e.slice();let n=0;for(let r=0;r<256;++r)e.includes(r)||(e.push(r),t.push(256+n),n+=1);const r=t.map((e=>String.fromCharCode(e)));return Object.fromEntries(e.map(((e,t)=>[e,r[t]])))})(),T=(0,r.reverseDictionary)(y);class v extends b{constructor(e){super(e),this.BPE_SPLIT_TOKEN=" ",this.tokens_to_ids=p(e.vocab),this.unk_token_id=this.tokens_to_ids.get(e.unk_token),this.unk_token=e.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[e,t]of this.tokens_to_ids)this.vocab[t]=e;this.bpe_ranks=new Map(e.merges.map(((e,t)=>[e,t]))),this.merges=e.merges.map((e=>e.split(this.BPE_SPLIT_TOKEN))),this.end_of_word_suffix=e.end_of_word_suffix,this.continuing_subword_suffix=e.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.cache=new Map}bpe(e){if(0===e.length)return[];const t=this.cache.get(e);if(void 0!==t)return t;const n=Array.from(e);this.end_of_word_suffix&&(n[n.length-1]+=this.end_of_word_suffix);let r=[];if(n.length>1){const e=new a.PriorityQueue(((e,t)=>e.score`<0x${e.toString(16).toUpperCase().padStart(2,"0")}>`))):t.push(this.unk_token)}return t}}class k extends b{constructor(e,t){super(e),this.tokens_to_ids=p(t.target_lang?e.vocab[t.target_lang]:e.vocab),this.bos_token=t.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=t.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=t.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=t.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[e,t]of this.tokens_to_ids)this.vocab[t]=e}encode(e){return e}}class M extends r.Callable{constructor(e){super(),this.config=e}static fromConfig(e){if(null===e)return null;switch(e.type){case"BertNormalizer":return new L(e);case"Precompiled":return new se(e);case"Sequence":return new D(e);case"Replace":return new S(e);case"NFC":return new P(e);case"NFKC":return new A(e);case"NFKD":return new F(e);case"Strip":return new C(e);case"StripAccents":return new E(e);case"Lowercase":return new O(e);case"Prepend":return new I(e);default:throw new Error(`Unknown Normalizer type: ${e.type}`)}}normalize(e){throw Error("normalize should be implemented in subclass.")}_call(e){return this.normalize(e)}}class S extends M{normalize(e){const t=u(this.config.pattern);return null===t?e:e.replaceAll(t,this.config.content)}}class P extends M{normalize(e){return e=e.normalize("NFC")}}class A extends M{normalize(e){return e=e.normalize("NFKC")}}class F extends M{normalize(e){return e=e.normalize("NFKD")}}class C extends M{normalize(e){return this.config.strip_left&&this.config.strip_right?e=e.trim():(this.config.strip_left&&(e=e.trimStart()),this.config.strip_right&&(e=e.trimEnd())),e}}class E extends M{normalize(e){return e=h(e)}}class O extends M{normalize(e){return e=e.toLowerCase()}}class I extends M{normalize(e){return e=this.config.prepend+e}}class D extends M{constructor(e){super(e),this.normalizers=e.normalizers.map((e=>M.fromConfig(e)))}normalize(e){return this.normalizers.reduce(((e,t)=>t.normalize(e)),e)}}class L extends M{_tokenize_chinese_chars(e){const t=[];for(let n=0;n=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=63744&&e<=64255||e>=194560&&e<=195103}stripAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}_is_control(e){switch(e){case"\t":case"\n":case"\r":return!1;default:return/^\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}$/u.test(e)}}_clean_text(e){const t=[];for(const n of e){const e=n.charCodeAt(0);0===e||65533===e||this._is_control(n)||(/^\s$/.test(n)?t.push(" "):t.push(n))}return t.join("")}normalize(e){return this.config.clean_text&&(e=this._clean_text(e)),this.config.handle_chinese_chars&&(e=this._tokenize_chinese_chars(e)),this.config.lowercase?(e=e.toLowerCase(),!1!==this.config.strip_accents&&(e=this.stripAccents(e))):this.config.strip_accents&&(e=this.stripAccents(e)),e}}class $ extends r.Callable{static fromConfig(e){if(null===e)return null;switch(e.type){case"BertPreTokenizer":return new N(e);case"Sequence":return new ae(e);case"Whitespace":return new le(e);case"WhitespaceSplit":return new ce(e);case"Metaspace":return new oe(e);case"ByteLevel":return new B(e);case"Split":return new z(e);case"Punctuation":return new R(e);case"Digits":return new j(e);case"Replace":return new ue(e);default:throw new Error(`Unknown PreTokenizer type: ${e.type}`)}}pre_tokenize_text(e,t){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(e,t){return(Array.isArray(e)?e.map((e=>this.pre_tokenize_text(e,t))):this.pre_tokenize_text(e,t)).flat()}_call(e,t){return this.pre_tokenize(e,t)}}class N extends ${constructor(e){super(),this.pattern=new RegExp(`[^\\s${f}]+|[${f}]`,"gu")}pre_tokenize_text(e,t){return e.trim().match(this.pattern)||[]}}class B extends ${constructor(e){super(),this.config=e,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=y,this.text_encoder=new TextEncoder}pre_tokenize_text(e,t){this.add_prefix_space&&!e.startsWith(" ")&&(e=" "+e);return(this.use_regex?e.match(this.pattern)||[]:[e]).map((e=>Array.from(this.text_encoder.encode(e),(e=>this.byte_encoder[e])).join("")))}}class z extends ${constructor(e){super(),this.config=e,this.pattern=u(this.config.pattern,this.config.invert)}pre_tokenize_text(e,t){return null===this.pattern?[]:this.config.invert?e.match(this.pattern)||[]:function(e,t){const n=[];let r=0;for(const o of e.matchAll(t)){const t=o[0];r0&&n.push(t),r=o.index+t.length}return re.replaceAll(t,this.config.content)))}}class Q extends H{constructor(e){super(e),this.text_decoder=new TextDecoder}decode_chain(e){const t=[];let n=[];for(const r of e){let e=null;if(6===r.length&&r.startsWith("<0x")&&r.endsWith(">")){const t=parseInt(r.slice(3,5),16);isNaN(t)||(e=t)}if(null!==e)n.push(e);else{if(n.length>0){const e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}t.push(r)}}if(n.length>0){const e=this.text_decoder.decode(Uint8Array.from(n));t.push(e),n=[]}return t}}class Y extends H{decode_chain(e){return[e.join("")]}}class K extends H{constructor(e){super(e),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(e){return e.map((e=>{let t=0;for(let n=0;n(0!==t&&(e=e.startsWith(this.config.prefix)?e.replace(this.config.prefix,""):" "+e),this.cleanup&&(e=_(e)),e)))}}class J extends H{constructor(e){super(e),this.byte_decoder=T,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(e){const t=e.join(""),n=new Uint8Array([...t].map((e=>this.byte_decoder[e])));return this.text_decoder.decode(n)}decode_chain(e){const t=[];let n=[];for(const r of e)void 0!==this.added_tokens.find((e=>e.content===r))?(n.length>0&&(t.push(this.convert_tokens_to_string(n)),n=[]),t.push(r)):n.push(r);return n.length>0&&t.push(this.convert_tokens_to_string(n)),t}}class ee extends H{constructor(e){super(e),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(e){if(0===e.length)return"";const t=[e[0]];for(let n=1;ne!==this.pad_token)).join("");return this.cleanup&&(n=_(n).replaceAll(this.word_delimiter_token," ").trim()),n}decode_chain(e){return[this.convert_tokens_to_string(e)]}}class te extends H{constructor(e){super(e),this.decoders=e.decoders.map((e=>H.fromConfig(e)))}decode_chain(e){return this.decoders.reduce(((e,t)=>t.decode_chain(e)),e)}}class ne extends H{constructor(e){super(e),this.suffix=this.config.suffix}decode_chain(e){return e.map(((t,n)=>t.replaceAll(this.suffix,n===e.length-1?"":" ")))}}class re extends H{decode_chain(e){let t="";for(let n=1;ne.normalize("NFKC"))).join("~")}else e=e.normalize("NFKC");return e}}class ae extends ${constructor(e){super(),this.tokenizers=e.pretokenizers.map((e=>$.fromConfig(e)))}pre_tokenize_text(e,t){return this.tokenizers.reduce(((e,n)=>n.pre_tokenize(e,t)),[e])}}class le extends ${constructor(e){super()}pre_tokenize_text(e,t){return e.match(/\w+|[^\w\s]+/g)||[]}}class ce extends ${constructor(e){super()}pre_tokenize_text(e,t){return function(e){return e.match(/\S+/g)||[]}(e)}}class ue extends ${constructor(e){super(),this.config=e,this.pattern=u(this.config.pattern),this.content=this.config.content}pre_tokenize_text(e,t){return null===this.pattern?[e]:[e.replaceAll(this.pattern,this.config.content)]}}const pe=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function de(e,t,n,o){for(const i of Object.keys(e)){const s=t-e[i].length,a=n(i),l=new Array(s).fill(a);e[i]="right"===o?(0,r.mergeArrays)(e[i],l):(0,r.mergeArrays)(l,e[i])}}function _e(e,t){for(const n of Object.keys(e))e[n].length=t}class he extends r.Callable{return_token_type_ids=!1;_default_chat_template="{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}";constructor(e,t){super(),this._tokenizer_config=t,this.normalizer=M.fromConfig(e.normalizer),this.pre_tokenizer=$.fromConfig(e.pre_tokenizer),this.model=b.fromConfig(e.model,t),this.post_processor=V.fromConfig(e.post_processor),this.decoder=H.fromConfig(e.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const t of e.added_tokens){const e=new g(t);this.added_tokens.push(e),this.model.tokens_to_ids.set(e.content,e.id),this.model.vocab[e.id]=e.content,e.special&&(this.special_tokens.push(e.content),this.all_special_ids.push(e.id))}if(this.additional_special_tokens=t.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.map((e=>`${e.lstrip?"\\s*":""}(${(0,r.escapeRegExp)(e.content)})${e.rstrip?"\\s*":""}`)).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.model_max_length=t.model_max_length,this.remove_space=t.remove_space,this.clean_up_tokenization_spaces=t.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=t.do_lowercase_and_remove_accent??!1,this.padding_side="right",this.legacy=!1,this.chat_template=t.chat_template??null,Array.isArray(this.chat_template)){const e=Object.create(null);for(const{name:t,template:n}of this.chat_template){if("string"!=typeof t||"string"!=typeof n)throw new Error('Chat template must be a list of objects with "name" and "template" properties');e[t]=n}this.chat_template=e}this._compiled_template_cache=new Map}getToken(...e){for(const t of e){const e=this._tokenizer_config[t];if(e){if("object"==typeof e){if("AddedToken"===e.__type)return e.content;throw Error(`Unknown token: ${e}`)}return e}}return null}static async from_pretrained(e,{progress_callback:t=null,config:n=null,cache_dir:r=null,local_files_only:o=!1,revision:i="main",legacy:s=null}={}){return new this(...await c(e,{progress_callback:t,config:n,cache_dir:r,local_files_only:o,revision:i,legacy:s}))}_call(e,{text_pair:t=null,add_special_tokens:n=!0,padding:r=!1,truncation:o=null,max_length:a=null,return_tensor:l=!0}={}){const c=Array.isArray(e);let u;if(c){if(0===e.length)throw Error("text array must be non-empty");if(null!==t){if(!Array.isArray(t))throw Error("text_pair must also be an array");if(e.length!==t.length)throw Error("text and text_pair must have the same length");u=e.map(((e,r)=>this._encode_plus(e,t[r],{add_special_tokens:n})))}else u=e.map((e=>this._encode_plus(e,null,{add_special_tokens:n})))}else{if(null==e)throw Error("text may not be null or undefined");if(Array.isArray(t))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");u=[this._encode_plus(e,t,{add_special_tokens:n})]}if(null===a?a="max_length"===r?this.model_max_length:(0,i.max)(u.map((e=>e.input_ids.length)))[0]:o||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),a=Math.min(a,this.model_max_length),r||o)for(let e=0;ea?o&&_e(u[e],a):r&&de(u[e],a,(e=>"input_ids"===e?this.pad_token_id:0),this.padding_side));const p={};if(l){if((!r||!o)&&u.some((e=>{for(const t of Object.keys(e))if(e[t].length!==u[0][t]?.length)return!0;return!1})))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");const e=[u.length,u[0].input_ids.length];for(const t of Object.keys(u[0]))p[t]=new s.Tensor("int64",BigInt64Array.from(u.flatMap((e=>e[t])).map(BigInt)),e)}else{for(const e of Object.keys(u[0]))p[e]=u.map((t=>t[e]));if(!c)for(const e of Object.keys(p))p[e]=p[e][0]}return p}_encode_text(e){if(null===e)return null;const t=(this.added_tokens_regex?e.split(this.added_tokens_regex).filter((e=>e)):[e]).map(((e,t)=>{if(void 0!==this.added_tokens.find((t=>t.content===e)))return e;{if(!0===this.remove_space&&(e=e.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(e=function(e){return h(e.toLowerCase())}(e)),null!==this.normalizer&&(e=this.normalizer(e)),0===e.length)return[];const n=null!==this.pre_tokenizer?this.pre_tokenizer(e,{section_index:t}):[e];return this.model(n)}})).flat();return t}_encode_plus(e,t=null,{add_special_tokens:n=!0}={}){const o=this._encode_text(e),i=this._encode_text(t),s=this.post_processor?this.post_processor(o,i,{add_special_tokens:n}):{tokens:(0,r.mergeArrays)(o??[],i??[])},a=this.model.convert_tokens_to_ids(s.tokens),l={input_ids:a,attention_mask:new Array(a.length).fill(1)};return this.return_token_type_ids&&s.token_type_ids&&(l.token_type_ids=s.token_type_ids),l}encode(e,t=null,{add_special_tokens:n=!0}={}){const{input_ids:r}=this._encode_plus(e,t,{add_special_tokens:n});return r}batch_decode(e,t={}){return e instanceof s.Tensor&&(e=e.tolist()),e.map((e=>this.decode(e,t)))}decode(e,t={}){if(e instanceof s.Tensor&&(e=d(e)),!Array.isArray(e)||0===e.length||!(0,r.isIntegralNumber)(e[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(e,t)}decode_single(e,{skip_special_tokens:t=!1,clean_up_tokenization_spaces:n=null}){let r=this.model.convert_ids_to_tokens(e);t&&(r=r.filter((e=>!this.special_tokens.includes(e))));let o=this.decoder?this.decoder(r):r.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(o=o.replaceAll(this.decoder.end_of_word_suffix," "),t&&(o=o.trim())),(n??this.clean_up_tokenization_spaces)&&(o=_(o)),o}get default_chat_template(){return this._warned_about_chat_template||(console.warn("No chat template is defined for this tokenizer - using a default chat template that implements the ChatML format. If the default is not appropriate for your model, please set `tokenizer.chat_template` to an appropriate template. See https://huggingface.co/docs/transformers/main/chat_templating for more information."),this._warned_about_chat_template=!0),this._default_chat_template}apply_chat_template(e,{chat_template:t=null,add_generation_prompt:n=!1,tokenize:r=!0,padding:o=!1,truncation:i=!1,max_length:s=null,return_tensor:a=!0,tokenizer_kwargs:c={},...u}={}){if(this.chat_template&&"object"==typeof this.chat_template||null===this.chat_template&&this.default_chat_template&&"object"==typeof this.default_chat_template){const e=this.chat_template??this.default_chat_template;if(null!==t&&Object.hasOwn(e,t))t=e[t];else if(null===t&&"default"in e)t=e.default;else if(null===t)throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(e).sort()}.`)}else t??=this.chat_template??this.default_chat_template;if("string"!=typeof t)throw Error("chat_template must be a string, but got "+typeof t);let p=this._compiled_template_cache.get(t);void 0===p&&(p=new l.Template(t),this._compiled_template_cache.set(t,p));const d=Object.create(null);for(const e of pe){const t=this.getToken(e);t&&(d[e]=t)}const _=p.render({messages:e,add_generation_prompt:n,...d,...u});return r?this._call(_,{add_special_tokens:!1,padding:o,truncation:i,max_length:s,return_tensor:a,...c}).input_ids:_}}class fe extends he{return_token_type_ids=!0}class me extends he{return_token_type_ids=!0}class ge extends he{return_token_type_ids=!0}class be extends he{return_token_type_ids=!0}class we extends he{return_token_type_ids=!0}class xe extends he{return_token_type_ids=!0}class ye extends he{return_token_type_ids=!0}class Te extends he{return_token_type_ids=!0}class ve extends he{return_token_type_ids=!0}class ke extends he{}class Me extends he{}class Se extends he{return_token_type_ids=!0;constructor(e,t){super(e,t),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class Pe extends he{return_token_type_ids=!0}class Ae extends he{}class Fe extends he{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}'}class Ce extends he{}class Ee extends he{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter((e=>this.languageRegex.test(e))),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return We(this,e,t,n)}}class Oe extends Ee{}class Ie extends he{}class De extends Fe{constructor(e,t){const n=".,!?…。,、।۔،",r=e.pre_tokenizer?.pretokenizers[0]?.pattern;r&&r.Regex===` ?[^(\\s|[${n}])]+`&&(r.Regex=` ?[^\\s${n}]+`),super(e,t)}}const Le="▁";class $e extends he{_default_chat_template="{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<>\n' + system_message + '\n<>\n\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'system' %}{{ '<>\n' + content.strip() + '\n<>\n\n' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}";DEFAULT_SYSTEM_PROMPT="You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.";constructor(e,t){super(e,t),this.use_default_system_prompt=t.use_default_system_prompt??!1,this.legacy=t.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new oe({replacement:Le,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(e){if(null===e)return null;if(this.legacy||0===e.length)return super._encode_text(e);let t=super._encode_text(Le+e.replaceAll(Le," "));return t.length>1&&t[0]===Le&&this.special_tokens.includes(t[1])&&(t=t.slice(1)),t}get default_chat_template(){return super.default_chat_template.replaceAll("USE_DEFAULT_PROMPT",this.use_default_system_prompt?"true":"false").replaceAll("DEFAULT_SYSTEM_MESSAGE",this.DEFAULT_SYSTEM_PROMPT.replaceAll("\n","\\n").replaceAll("'","\\'"))}}class Ne extends $e{}class Be extends he{}class ze extends he{}class Re extends he{}class je extends he{}class Ve extends he{}class Ue extends he{}class Ge extends he{_default_chat_template="{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '' + role + '\n' + message['content'] | trim + '\n' }}{% endfor %}{% if add_generation_prompt %}{{'model\n'}}{% endif %}"}class qe extends he{}function We(e,t,n,r){if(!("language_codes"in e)||!Array.isArray(e.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in e&&e.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in e)||"function"!=typeof e.lang_to_token)throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const o=r.src_lang,i=r.tgt_lang;if(!e.language_codes.includes(i))throw new Error(`Target language code "${i}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);if(void 0!==o){if(!e.language_codes.includes(o))throw new Error(`Source language code "${o}" is not valid. Must be one of: {${e.language_codes.join(", ")}}`);for(const t of e.post_processor.config.single)if("SpecialToken"in t&&e.languageRegex.test(t.SpecialToken.id)){t.SpecialToken.id=e.lang_to_token(o);break}}return r.forced_bos_token_id=e.model.convert_tokens_to_ids([e.lang_to_token(i)])[0],e._call(t,n)}class He extends he{constructor(e,t){super(e,t),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter((e=>this.languageRegex.test(e))),this.lang_to_token=e=>e}_build_translation_inputs(e,t,n){return We(this,e,t,n)}}class Xe extends he{constructor(e,t){super(e,t),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter((e=>this.languageRegex.test(e))).map((e=>e.slice(2,-2))),this.lang_to_token=e=>`__${e}__`}_build_translation_inputs(e,t,n){return We(this,e,t,n)}}const Qe=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],Ye=new Map(Qe),Ke=new Map([...Qe.map((([e,t])=>[t,e])),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);class Ze extends he{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}';_decode_asr(e,{return_timestamps:t=!1,return_language:n=!1,time_precision:r=null,force_full_sequences:o=!0}={}){if(null===r)throw Error("Must specify time_precision");let s=null;const a="word"===t;function l(){return{language:s,timestamp:[null,null],text:""}}const c=[];let u=l(),p=0;const d=this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1;let _=[],h=[],f=!1,m=null;const g=new Set(this.all_special_ids);for(const n of e){const e=n.tokens,o=a?n.token_timestamps:null;let b=null,w=d;if("stride"in n){const[t,o,i]=n.stride;if(p-=o,m=t-i,o&&(w=o/r+d),i)for(let t=e.length-1;t>=0;--t){const n=e[t];if(n>=d){if(null!==b&&(n-d)*r=d){const e=(m-d)*r+p,t=(0,i.round)(e,2);if(null!==b&&m>=b)f=!0;else if(f||_.length>0&&m0?(_.push(x),a&&h.push(y)):_.every((e=>0===e.length))&&(u=l(),_=[],x=[],h=[],y=[])}if(_.length>0){if(o&&t)throw new Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");const[e,n]=this.findLongestCommonSequence(_,h),r=this.decode(e);u.text=r,a&&(u.words=this.collateWordTimestamps(e,n,s)),c.push(u)}let b=Object.create(null);const w=c.map((e=>e.text)).join("");if(t||n){for(let e=0;e0;let s=i?[]:null,a=i?t[0]:null;for(let l=1;le===_[t])).length,f=h/e+t;h>1&&f>u&&(u=f,p=[o,i,a,l])}const[_,h,f,m]=p,g=Math.floor((h+_)/2),b=Math.floor((m+f)/2);o.push(...n.slice(0,g)),n=c.slice(b),r=n.length,i&&(s.push(...a.slice(0,g)),a=t[l].slice(b))}return o.push(...n),i?(s.push(...a),[o,s]):[o,[]]}collateWordTimestamps(e,t,n){const[r,o,i]=this.combineTokensIntoWords(e,n),s=[];for(let e=0;e=r){const e=(0,i.round)((t-r)*n,2);o.push(`<|${e}|>`),o.push([])}else o[o.length-1].push(t);return o=o.map((e=>"string"==typeof e?e:super.decode(e,t))),o.join("")}splitTokensOnUnicode(e){const t=this.decode(e,{decode_with_timestamps:!0}),n=[],r=[],o=[];let i=[],s=[],a=0;for(let l=0;l=this.model.tokens_to_ids.get("<|endoftext|>"),d=l.startsWith(" "),_=l.trim(),h=a.test(_);if(p||d||h||0===o.length)o.push(l),i.push(c),s.push(u);else{const e=o.length-1;o[e]+=l,i[e].push(...c),s[e].push(...u)}}return[o,i,s]}mergePunctuations(e,t,n,o,i){const s=structuredClone(e),a=structuredClone(t),l=structuredClone(n);let c=s.length-2,u=s.length-1;for(;c>=0;)s[c].startsWith(" ")&&o.includes(s[c].trim())?(s[u]=s[c]+s[u],a[u]=(0,r.mergeArrays)(a[c],a[u]),l[u]=(0,r.mergeArrays)(l[c],l[u]),s[c]="",a[c]=[],l[c]=[]):u=c,--c;for(c=0,u=1;ue)),a.filter((e=>e.length>0)),l.filter((e=>e.length>0))]}get_decoder_prompt_ids({language:e=null,task:t=null,no_timestamps:n=!0}={}){const r=[];if(e){e=e.toLowerCase();let t=Ke.get(e);if(void 0===t){if(!Ye.has(e)){const t=2===e.length?Ye.keys():Ye.values();throw new Error(`Language "${e}" is not supported. Must be one of: ${JSON.stringify(t)}`)}t=e}const n=this.model.tokens_to_ids.get(`<|${t}|>`);if(void 0===n)throw new Error(`Unable to find language "${t}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);r.push(n)}else r.push(null);if(t){if("transcribe"!==(t=t.toLowerCase())&&"translate"!==t)throw new Error(`Task "${t}" is not supported. Must be one of: ["transcribe", "translate"]`);const e=this.model.tokens_to_ids.get(`<|${t}|>`);if(void 0===e)throw new Error(`Unable to find task "${t}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);r.push(e)}else r.push(null);if(n){const e=this.model.tokens_to_ids.get("<|notimestamps|>");if(void 0===e)throw new Error('Unable to find "<|notimestamps|>" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.');r.push(e)}return r.map(((e,t)=>[t+1,e])).filter((e=>null!==e[1]))}}class Je extends he{}class et extends he{}class tt extends he{}class nt extends he{constructor(e,t){super(e,t),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter((e=>this.languageRegex.test(e))),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(e){if(null===e)return null;const[t,...n]=e.trim().split(this.languageRegex);if(0===n.length)return super._encode_text(t);if(2===n.length){const[e,t]=n;return this.supported_language_codes.includes(e)||console.warn(`Unsupported language code "${e}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),(0,r.mergeArrays)([e],super._encode_text(t))}}}class rt extends he{}class ot extends he{_default_chat_template="{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}"}class it extends ot{}class st extends he{}class at extends he{}class lt extends he{constructor(e,t){super(e,t),this.decoder=new re({})}}class ct extends he{}class ut{static TOKENIZER_CLASS_MAPPING={T5Tokenizer:Ae,DistilBertTokenizer:ke,CamembertTokenizer:Me,DebertaTokenizer:we,DebertaV2Tokenizer:xe,BertTokenizer:fe,HerbertTokenizer:ye,ConvBertTokenizer:Te,RoFormerTokenizer:ve,XLMTokenizer:Se,ElectraTokenizer:Pe,MobileBertTokenizer:ge,SqueezeBertTokenizer:be,AlbertTokenizer:me,GPT2Tokenizer:Fe,BartTokenizer:Ce,MBartTokenizer:Ee,MBart50Tokenizer:Oe,RobertaTokenizer:Ie,WhisperTokenizer:Ze,CodeGenTokenizer:Je,CLIPTokenizer:et,SiglipTokenizer:tt,MarianTokenizer:nt,BloomTokenizer:De,NllbTokenizer:He,M2M100Tokenizer:Xe,LlamaTokenizer:$e,CodeLlamaTokenizer:Ne,XLMRobertaTokenizer:Be,MPNetTokenizer:ze,FalconTokenizer:Re,GPTNeoXTokenizer:je,EsmTokenizer:Ve,Wav2Vec2CTCTokenizer:rt,BlenderbotTokenizer:ot,BlenderbotSmallTokenizer:it,SpeechT5Tokenizer:st,NougatTokenizer:at,VitsTokenizer:lt,Qwen2Tokenizer:Ue,GemmaTokenizer:Ge,Grok1Tokenizer:qe,CohereTokenizer:ct,PreTrainedTokenizer:he};static async from_pretrained(e,{quantized:t=!0,progress_callback:n=null,config:r=null,cache_dir:o=null,local_files_only:i=!1,revision:s="main",legacy:a=null}={}){const[l,u]=await c(e,{quantized:t,progress_callback:n,config:r,cache_dir:o,local_files_only:i,revision:s,legacy:a}),p=u.tokenizer_class?.replace(/Fast$/,"")??"PreTrainedTokenizer";let d=this.TOKENIZER_CLASS_MAPPING[p];return d||(console.warn(`Unknown tokenizer class "${p}", attempting to construct from base class.`),d=he),new d(l,u)}}},"./src/transformers.js": /*!*****************************!*\ !*** ./src/transformers.js ***! \*****************************/(e,t,n)=>{n.r(t),n.d(t,{ASTFeatureExtractor:()=>a.ASTFeatureExtractor,ASTForAudioClassification:()=>i.ASTForAudioClassification,ASTModel:()=>i.ASTModel,ASTPreTrainedModel:()=>i.ASTPreTrainedModel,AlbertForMaskedLM:()=>i.AlbertForMaskedLM,AlbertForQuestionAnswering:()=>i.AlbertForQuestionAnswering,AlbertForSequenceClassification:()=>i.AlbertForSequenceClassification,AlbertModel:()=>i.AlbertModel,AlbertPreTrainedModel:()=>i.AlbertPreTrainedModel,AlbertTokenizer:()=>s.AlbertTokenizer,AudioClassificationPipeline:()=>r.AudioClassificationPipeline,AutoConfig:()=>l.AutoConfig,AutoModel:()=>i.AutoModel,AutoModelForAudioClassification:()=>i.AutoModelForAudioClassification,AutoModelForAudioFrameClassification:()=>i.AutoModelForAudioFrameClassification,AutoModelForCTC:()=>i.AutoModelForCTC,AutoModelForCausalLM:()=>i.AutoModelForCausalLM,AutoModelForDepthEstimation:()=>i.AutoModelForDepthEstimation,AutoModelForDocumentQuestionAnswering:()=>i.AutoModelForDocumentQuestionAnswering,AutoModelForImageClassification:()=>i.AutoModelForImageClassification,AutoModelForImageFeatureExtraction:()=>i.AutoModelForImageFeatureExtraction,AutoModelForImageMatting:()=>i.AutoModelForImageMatting,AutoModelForImageSegmentation:()=>i.AutoModelForImageSegmentation,AutoModelForImageToImage:()=>i.AutoModelForImageToImage,AutoModelForMaskGeneration:()=>i.AutoModelForMaskGeneration,AutoModelForMaskedLM:()=>i.AutoModelForMaskedLM,AutoModelForObjectDetection:()=>i.AutoModelForObjectDetection,AutoModelForQuestionAnswering:()=>i.AutoModelForQuestionAnswering,AutoModelForSemanticSegmentation:()=>i.AutoModelForSemanticSegmentation,AutoModelForSeq2SeqLM:()=>i.AutoModelForSeq2SeqLM,AutoModelForSequenceClassification:()=>i.AutoModelForSequenceClassification,AutoModelForSpeechSeq2Seq:()=>i.AutoModelForSpeechSeq2Seq,AutoModelForTextToSpectrogram:()=>i.AutoModelForTextToSpectrogram,AutoModelForTextToWaveform:()=>i.AutoModelForTextToWaveform,AutoModelForTokenClassification:()=>i.AutoModelForTokenClassification,AutoModelForVision2Seq:()=>i.AutoModelForVision2Seq,AutoModelForXVector:()=>i.AutoModelForXVector,AutoModelForZeroShotObjectDetection:()=>i.AutoModelForZeroShotObjectDetection,AutoProcessor:()=>a.AutoProcessor,AutoTokenizer:()=>s.AutoTokenizer,AutomaticSpeechRecognitionPipeline:()=>r.AutomaticSpeechRecognitionPipeline,BartForConditionalGeneration:()=>i.BartForConditionalGeneration,BartForSequenceClassification:()=>i.BartForSequenceClassification,BartModel:()=>i.BartModel,BartPretrainedModel:()=>i.BartPretrainedModel,BartTokenizer:()=>s.BartTokenizer,BaseModelOutput:()=>i.BaseModelOutput,BeitFeatureExtractor:()=>a.BeitFeatureExtractor,BeitForImageClassification:()=>i.BeitForImageClassification,BeitModel:()=>i.BeitModel,BeitPreTrainedModel:()=>i.BeitPreTrainedModel,BertForMaskedLM:()=>i.BertForMaskedLM,BertForQuestionAnswering:()=>i.BertForQuestionAnswering,BertForSequenceClassification:()=>i.BertForSequenceClassification,BertForTokenClassification:()=>i.BertForTokenClassification,BertModel:()=>i.BertModel,BertPreTrainedModel:()=>i.BertPreTrainedModel,BertTokenizer:()=>s.BertTokenizer,BitImageProcessor:()=>a.BitImageProcessor,BlenderbotForConditionalGeneration:()=>i.BlenderbotForConditionalGeneration,BlenderbotModel:()=>i.BlenderbotModel,BlenderbotPreTrainedModel:()=>i.BlenderbotPreTrainedModel,BlenderbotSmallForConditionalGeneration:()=>i.BlenderbotSmallForConditionalGeneration,BlenderbotSmallModel:()=>i.BlenderbotSmallModel,BlenderbotSmallPreTrainedModel:()=>i.BlenderbotSmallPreTrainedModel,BlenderbotSmallTokenizer:()=>s.BlenderbotSmallTokenizer,BlenderbotTokenizer:()=>s.BlenderbotTokenizer,BloomForCausalLM:()=>i.BloomForCausalLM,BloomModel:()=>i.BloomModel,BloomPreTrainedModel:()=>i.BloomPreTrainedModel,BloomTokenizer:()=>s.BloomTokenizer,CLIPFeatureExtractor:()=>a.CLIPFeatureExtractor,CLIPModel:()=>i.CLIPModel,CLIPPreTrainedModel:()=>i.CLIPPreTrainedModel,CLIPSegForImageSegmentation:()=>i.CLIPSegForImageSegmentation,CLIPSegModel:()=>i.CLIPSegModel,CLIPSegPreTrainedModel:()=>i.CLIPSegPreTrainedModel,CLIPTextModelWithProjection:()=>i.CLIPTextModelWithProjection,CLIPTokenizer:()=>s.CLIPTokenizer,CLIPVisionModelWithProjection:()=>i.CLIPVisionModelWithProjection,CamembertForMaskedLM:()=>i.CamembertForMaskedLM,CamembertForQuestionAnswering:()=>i.CamembertForQuestionAnswering,CamembertForSequenceClassification:()=>i.CamembertForSequenceClassification,CamembertForTokenClassification:()=>i.CamembertForTokenClassification,CamembertModel:()=>i.CamembertModel,CamembertPreTrainedModel:()=>i.CamembertPreTrainedModel,CamembertTokenizer:()=>s.CamembertTokenizer,CausalLMOutput:()=>i.CausalLMOutput,CausalLMOutputWithPast:()=>i.CausalLMOutputWithPast,ChineseCLIPFeatureExtractor:()=>a.ChineseCLIPFeatureExtractor,ChineseCLIPModel:()=>i.ChineseCLIPModel,ChineseCLIPPreTrainedModel:()=>i.ChineseCLIPPreTrainedModel,ClapAudioModelWithProjection:()=>i.ClapAudioModelWithProjection,ClapFeatureExtractor:()=>a.ClapFeatureExtractor,ClapModel:()=>i.ClapModel,ClapPreTrainedModel:()=>i.ClapPreTrainedModel,ClapTextModelWithProjection:()=>i.ClapTextModelWithProjection,CodeGenForCausalLM:()=>i.CodeGenForCausalLM,CodeGenModel:()=>i.CodeGenModel,CodeGenPreTrainedModel:()=>i.CodeGenPreTrainedModel,CodeGenTokenizer:()=>s.CodeGenTokenizer,CodeLlamaTokenizer:()=>s.CodeLlamaTokenizer,CohereTokenizer:()=>s.CohereTokenizer,ConvBertForMaskedLM:()=>i.ConvBertForMaskedLM,ConvBertForQuestionAnswering:()=>i.ConvBertForQuestionAnswering,ConvBertForSequenceClassification:()=>i.ConvBertForSequenceClassification,ConvBertForTokenClassification:()=>i.ConvBertForTokenClassification,ConvBertModel:()=>i.ConvBertModel,ConvBertPreTrainedModel:()=>i.ConvBertPreTrainedModel,ConvBertTokenizer:()=>s.ConvBertTokenizer,ConvNextFeatureExtractor:()=>a.ConvNextFeatureExtractor,ConvNextForImageClassification:()=>i.ConvNextForImageClassification,ConvNextImageProcessor:()=>a.ConvNextImageProcessor,ConvNextModel:()=>i.ConvNextModel,ConvNextPreTrainedModel:()=>i.ConvNextPreTrainedModel,ConvNextV2ForImageClassification:()=>i.ConvNextV2ForImageClassification,ConvNextV2Model:()=>i.ConvNextV2Model,ConvNextV2PreTrainedModel:()=>i.ConvNextV2PreTrainedModel,DPTFeatureExtractor:()=>a.DPTFeatureExtractor,DPTForDepthEstimation:()=>i.DPTForDepthEstimation,DPTImageProcessor:()=>a.DPTImageProcessor,DPTModel:()=>i.DPTModel,DPTPreTrainedModel:()=>i.DPTPreTrainedModel,DebertaForMaskedLM:()=>i.DebertaForMaskedLM,DebertaForQuestionAnswering:()=>i.DebertaForQuestionAnswering,DebertaForSequenceClassification:()=>i.DebertaForSequenceClassification,DebertaForTokenClassification:()=>i.DebertaForTokenClassification,DebertaModel:()=>i.DebertaModel,DebertaPreTrainedModel:()=>i.DebertaPreTrainedModel,DebertaTokenizer:()=>s.DebertaTokenizer,DebertaV2ForMaskedLM:()=>i.DebertaV2ForMaskedLM,DebertaV2ForQuestionAnswering:()=>i.DebertaV2ForQuestionAnswering,DebertaV2ForSequenceClassification:()=>i.DebertaV2ForSequenceClassification,DebertaV2ForTokenClassification:()=>i.DebertaV2ForTokenClassification,DebertaV2Model:()=>i.DebertaV2Model,DebertaV2PreTrainedModel:()=>i.DebertaV2PreTrainedModel,DebertaV2Tokenizer:()=>s.DebertaV2Tokenizer,DeiTFeatureExtractor:()=>a.DeiTFeatureExtractor,DeiTForImageClassification:()=>i.DeiTForImageClassification,DeiTModel:()=>i.DeiTModel,DeiTPreTrainedModel:()=>i.DeiTPreTrainedModel,DepthAnythingForDepthEstimation:()=>i.DepthAnythingForDepthEstimation,DepthAnythingPreTrainedModel:()=>i.DepthAnythingPreTrainedModel,DepthEstimationPipeline:()=>r.DepthEstimationPipeline,DetrFeatureExtractor:()=>a.DetrFeatureExtractor,DetrForObjectDetection:()=>i.DetrForObjectDetection,DetrForSegmentation:()=>i.DetrForSegmentation,DetrModel:()=>i.DetrModel,DetrObjectDetectionOutput:()=>i.DetrObjectDetectionOutput,DetrPreTrainedModel:()=>i.DetrPreTrainedModel,DetrSegmentationOutput:()=>i.DetrSegmentationOutput,Dinov2ForImageClassification:()=>i.Dinov2ForImageClassification,Dinov2Model:()=>i.Dinov2Model,Dinov2PreTrainedModel:()=>i.Dinov2PreTrainedModel,DistilBertForMaskedLM:()=>i.DistilBertForMaskedLM,DistilBertForQuestionAnswering:()=>i.DistilBertForQuestionAnswering,DistilBertForSequenceClassification:()=>i.DistilBertForSequenceClassification,DistilBertForTokenClassification:()=>i.DistilBertForTokenClassification,DistilBertModel:()=>i.DistilBertModel,DistilBertPreTrainedModel:()=>i.DistilBertPreTrainedModel,DistilBertTokenizer:()=>s.DistilBertTokenizer,DocumentQuestionAnsweringPipeline:()=>r.DocumentQuestionAnsweringPipeline,DonutFeatureExtractor:()=>a.DonutFeatureExtractor,DonutSwinModel:()=>i.DonutSwinModel,DonutSwinPreTrainedModel:()=>i.DonutSwinPreTrainedModel,EfficientNetForImageClassification:()=>i.EfficientNetForImageClassification,EfficientNetImageProcessor:()=>a.EfficientNetImageProcessor,EfficientNetModel:()=>i.EfficientNetModel,EfficientNetPreTrainedModel:()=>i.EfficientNetPreTrainedModel,ElectraForMaskedLM:()=>i.ElectraForMaskedLM,ElectraForQuestionAnswering:()=>i.ElectraForQuestionAnswering,ElectraForSequenceClassification:()=>i.ElectraForSequenceClassification,ElectraForTokenClassification:()=>i.ElectraForTokenClassification,ElectraModel:()=>i.ElectraModel,ElectraPreTrainedModel:()=>i.ElectraPreTrainedModel,ElectraTokenizer:()=>s.ElectraTokenizer,EsmForMaskedLM:()=>i.EsmForMaskedLM,EsmForSequenceClassification:()=>i.EsmForSequenceClassification,EsmForTokenClassification:()=>i.EsmForTokenClassification,EsmModel:()=>i.EsmModel,EsmPreTrainedModel:()=>i.EsmPreTrainedModel,EsmTokenizer:()=>s.EsmTokenizer,FFT:()=>d.FFT,FalconForCausalLM:()=>i.FalconForCausalLM,FalconModel:()=>i.FalconModel,FalconPreTrainedModel:()=>i.FalconPreTrainedModel,FalconTokenizer:()=>s.FalconTokenizer,FeatureExtractionPipeline:()=>r.FeatureExtractionPipeline,FeatureExtractor:()=>a.FeatureExtractor,FillMaskPipeline:()=>r.FillMaskPipeline,GLPNFeatureExtractor:()=>a.GLPNFeatureExtractor,GLPNForDepthEstimation:()=>i.GLPNForDepthEstimation,GLPNModel:()=>i.GLPNModel,GLPNPreTrainedModel:()=>i.GLPNPreTrainedModel,GPT2LMHeadModel:()=>i.GPT2LMHeadModel,GPT2Model:()=>i.GPT2Model,GPT2PreTrainedModel:()=>i.GPT2PreTrainedModel,GPT2Tokenizer:()=>s.GPT2Tokenizer,GPTBigCodeForCausalLM:()=>i.GPTBigCodeForCausalLM,GPTBigCodeModel:()=>i.GPTBigCodeModel,GPTBigCodePreTrainedModel:()=>i.GPTBigCodePreTrainedModel,GPTJForCausalLM:()=>i.GPTJForCausalLM,GPTJModel:()=>i.GPTJModel,GPTJPreTrainedModel:()=>i.GPTJPreTrainedModel,GPTNeoForCausalLM:()=>i.GPTNeoForCausalLM,GPTNeoModel:()=>i.GPTNeoModel,GPTNeoPreTrainedModel:()=>i.GPTNeoPreTrainedModel,GPTNeoXForCausalLM:()=>i.GPTNeoXForCausalLM,GPTNeoXModel:()=>i.GPTNeoXModel,GPTNeoXPreTrainedModel:()=>i.GPTNeoXPreTrainedModel,GPTNeoXTokenizer:()=>s.GPTNeoXTokenizer,GemmaTokenizer:()=>s.GemmaTokenizer,Grok1Tokenizer:()=>s.Grok1Tokenizer,HerbertTokenizer:()=>s.HerbertTokenizer,HubertForCTC:()=>i.HubertForCTC,HubertForSequenceClassification:()=>i.HubertForSequenceClassification,HubertModel:()=>i.HubertModel,HubertPreTrainedModel:()=>i.HubertPreTrainedModel,ImageClassificationPipeline:()=>r.ImageClassificationPipeline,ImageFeatureExtractionPipeline:()=>r.ImageFeatureExtractionPipeline,ImageFeatureExtractor:()=>a.ImageFeatureExtractor,ImageMattingOutput:()=>i.ImageMattingOutput,ImageSegmentationPipeline:()=>r.ImageSegmentationPipeline,ImageToImagePipeline:()=>r.ImageToImagePipeline,ImageToTextPipeline:()=>r.ImageToTextPipeline,LlamaForCausalLM:()=>i.LlamaForCausalLM,LlamaModel:()=>i.LlamaModel,LlamaPreTrainedModel:()=>i.LlamaPreTrainedModel,LlamaTokenizer:()=>s.LlamaTokenizer,LongT5ForConditionalGeneration:()=>i.LongT5ForConditionalGeneration,LongT5Model:()=>i.LongT5Model,LongT5PreTrainedModel:()=>i.LongT5PreTrainedModel,M2M100ForConditionalGeneration:()=>i.M2M100ForConditionalGeneration,M2M100Model:()=>i.M2M100Model,M2M100PreTrainedModel:()=>i.M2M100PreTrainedModel,M2M100Tokenizer:()=>s.M2M100Tokenizer,MBart50Tokenizer:()=>s.MBart50Tokenizer,MBartForCausalLM:()=>i.MBartForCausalLM,MBartForConditionalGeneration:()=>i.MBartForConditionalGeneration,MBartForSequenceClassification:()=>i.MBartForSequenceClassification,MBartModel:()=>i.MBartModel,MBartPreTrainedModel:()=>i.MBartPreTrainedModel,MBartTokenizer:()=>s.MBartTokenizer,MPNetForMaskedLM:()=>i.MPNetForMaskedLM,MPNetForQuestionAnswering:()=>i.MPNetForQuestionAnswering,MPNetForSequenceClassification:()=>i.MPNetForSequenceClassification,MPNetForTokenClassification:()=>i.MPNetForTokenClassification,MPNetModel:()=>i.MPNetModel,MPNetPreTrainedModel:()=>i.MPNetPreTrainedModel,MPNetTokenizer:()=>s.MPNetTokenizer,MT5ForConditionalGeneration:()=>i.MT5ForConditionalGeneration,MT5Model:()=>i.MT5Model,MT5PreTrainedModel:()=>i.MT5PreTrainedModel,MarianMTModel:()=>i.MarianMTModel,MarianModel:()=>i.MarianModel,MarianPreTrainedModel:()=>i.MarianPreTrainedModel,MarianTokenizer:()=>s.MarianTokenizer,MaskedLMOutput:()=>i.MaskedLMOutput,MistralForCausalLM:()=>i.MistralForCausalLM,MistralModel:()=>i.MistralModel,MistralPreTrainedModel:()=>i.MistralPreTrainedModel,MobileBertForMaskedLM:()=>i.MobileBertForMaskedLM,MobileBertForQuestionAnswering:()=>i.MobileBertForQuestionAnswering,MobileBertForSequenceClassification:()=>i.MobileBertForSequenceClassification,MobileBertModel:()=>i.MobileBertModel,MobileBertPreTrainedModel:()=>i.MobileBertPreTrainedModel,MobileBertTokenizer:()=>s.MobileBertTokenizer,MobileViTFeatureExtractor:()=>a.MobileViTFeatureExtractor,MobileViTForImageClassification:()=>i.MobileViTForImageClassification,MobileViTModel:()=>i.MobileViTModel,MobileViTPreTrainedModel:()=>i.MobileViTPreTrainedModel,ModelOutput:()=>i.ModelOutput,MptForCausalLM:()=>i.MptForCausalLM,MptModel:()=>i.MptModel,MptPreTrainedModel:()=>i.MptPreTrainedModel,NllbTokenizer:()=>s.NllbTokenizer,NomicBertModel:()=>i.NomicBertModel,NomicBertPreTrainedModel:()=>i.NomicBertPreTrainedModel,NougatImageProcessor:()=>a.NougatImageProcessor,NougatTokenizer:()=>s.NougatTokenizer,OPTForCausalLM:()=>i.OPTForCausalLM,OPTModel:()=>i.OPTModel,OPTPreTrainedModel:()=>i.OPTPreTrainedModel,ObjectDetectionPipeline:()=>r.ObjectDetectionPipeline,OwlViTFeatureExtractor:()=>a.OwlViTFeatureExtractor,OwlViTForObjectDetection:()=>i.OwlViTForObjectDetection,OwlViTModel:()=>i.OwlViTModel,OwlViTPreTrainedModel:()=>i.OwlViTPreTrainedModel,OwlViTProcessor:()=>a.OwlViTProcessor,Owlv2ForObjectDetection:()=>i.Owlv2ForObjectDetection,Owlv2ImageProcessor:()=>a.Owlv2ImageProcessor,Owlv2Model:()=>i.Owlv2Model,Owlv2PreTrainedModel:()=>i.Owlv2PreTrainedModel,PhiForCausalLM:()=>i.PhiForCausalLM,PhiModel:()=>i.PhiModel,PhiPreTrainedModel:()=>i.PhiPreTrainedModel,Pipeline:()=>r.Pipeline,PreTrainedModel:()=>i.PreTrainedModel,PreTrainedTokenizer:()=>s.PreTrainedTokenizer,PretrainedConfig:()=>l.PretrainedConfig,PretrainedMixin:()=>i.PretrainedMixin,Processor:()=>a.Processor,QuestionAnsweringModelOutput:()=>i.QuestionAnsweringModelOutput,QuestionAnsweringPipeline:()=>r.QuestionAnsweringPipeline,Qwen2ForCausalLM:()=>i.Qwen2ForCausalLM,Qwen2Model:()=>i.Qwen2Model,Qwen2PreTrainedModel:()=>i.Qwen2PreTrainedModel,Qwen2Tokenizer:()=>s.Qwen2Tokenizer,RawImage:()=>u.RawImage,ResNetForImageClassification:()=>i.ResNetForImageClassification,ResNetModel:()=>i.ResNetModel,ResNetPreTrainedModel:()=>i.ResNetPreTrainedModel,RoFormerForMaskedLM:()=>i.RoFormerForMaskedLM,RoFormerForQuestionAnswering:()=>i.RoFormerForQuestionAnswering,RoFormerForSequenceClassification:()=>i.RoFormerForSequenceClassification,RoFormerForTokenClassification:()=>i.RoFormerForTokenClassification,RoFormerModel:()=>i.RoFormerModel,RoFormerPreTrainedModel:()=>i.RoFormerPreTrainedModel,RoFormerTokenizer:()=>s.RoFormerTokenizer,RobertaForMaskedLM:()=>i.RobertaForMaskedLM,RobertaForQuestionAnswering:()=>i.RobertaForQuestionAnswering,RobertaForSequenceClassification:()=>i.RobertaForSequenceClassification,RobertaForTokenClassification:()=>i.RobertaForTokenClassification,RobertaModel:()=>i.RobertaModel,RobertaPreTrainedModel:()=>i.RobertaPreTrainedModel,RobertaTokenizer:()=>s.RobertaTokenizer,SamImageProcessor:()=>a.SamImageProcessor,SamImageSegmentationOutput:()=>i.SamImageSegmentationOutput,SamModel:()=>i.SamModel,SamPreTrainedModel:()=>i.SamPreTrainedModel,SamProcessor:()=>a.SamProcessor,SeamlessM4TFeatureExtractor:()=>a.SeamlessM4TFeatureExtractor,SegformerFeatureExtractor:()=>a.SegformerFeatureExtractor,SegformerForImageClassification:()=>i.SegformerForImageClassification,SegformerForSemanticSegmentation:()=>i.SegformerForSemanticSegmentation,SegformerModel:()=>i.SegformerModel,SegformerPreTrainedModel:()=>i.SegformerPreTrainedModel,Seq2SeqLMOutput:()=>i.Seq2SeqLMOutput,SequenceClassifierOutput:()=>i.SequenceClassifierOutput,SiglipImageProcessor:()=>a.SiglipImageProcessor,SiglipModel:()=>i.SiglipModel,SiglipPreTrainedModel:()=>i.SiglipPreTrainedModel,SiglipTextModel:()=>i.SiglipTextModel,SiglipTokenizer:()=>s.SiglipTokenizer,SiglipVisionModel:()=>i.SiglipVisionModel,SpeechT5FeatureExtractor:()=>a.SpeechT5FeatureExtractor,SpeechT5ForSpeechToText:()=>i.SpeechT5ForSpeechToText,SpeechT5ForTextToSpeech:()=>i.SpeechT5ForTextToSpeech,SpeechT5HifiGan:()=>i.SpeechT5HifiGan,SpeechT5Model:()=>i.SpeechT5Model,SpeechT5PreTrainedModel:()=>i.SpeechT5PreTrainedModel,SpeechT5Processor:()=>a.SpeechT5Processor,SpeechT5Tokenizer:()=>s.SpeechT5Tokenizer,SqueezeBertForMaskedLM:()=>i.SqueezeBertForMaskedLM,SqueezeBertForQuestionAnswering:()=>i.SqueezeBertForQuestionAnswering,SqueezeBertForSequenceClassification:()=>i.SqueezeBertForSequenceClassification,SqueezeBertModel:()=>i.SqueezeBertModel,SqueezeBertPreTrainedModel:()=>i.SqueezeBertPreTrainedModel,SqueezeBertTokenizer:()=>s.SqueezeBertTokenizer,StableLmForCausalLM:()=>i.StableLmForCausalLM,StableLmModel:()=>i.StableLmModel,StableLmPreTrainedModel:()=>i.StableLmPreTrainedModel,Starcoder2ForCausalLM:()=>i.Starcoder2ForCausalLM,Starcoder2Model:()=>i.Starcoder2Model,Starcoder2PreTrainedModel:()=>i.Starcoder2PreTrainedModel,SummarizationPipeline:()=>r.SummarizationPipeline,Swin2SRForImageSuperResolution:()=>i.Swin2SRForImageSuperResolution,Swin2SRImageProcessor:()=>a.Swin2SRImageProcessor,Swin2SRModel:()=>i.Swin2SRModel,Swin2SRPreTrainedModel:()=>i.Swin2SRPreTrainedModel,SwinForImageClassification:()=>i.SwinForImageClassification,SwinModel:()=>i.SwinModel,SwinPreTrainedModel:()=>i.SwinPreTrainedModel,T5ForConditionalGeneration:()=>i.T5ForConditionalGeneration,T5Model:()=>i.T5Model,T5PreTrainedModel:()=>i.T5PreTrainedModel,T5Tokenizer:()=>s.T5Tokenizer,TableTransformerForObjectDetection:()=>i.TableTransformerForObjectDetection,TableTransformerModel:()=>i.TableTransformerModel,TableTransformerObjectDetectionOutput:()=>i.TableTransformerObjectDetectionOutput,TableTransformerPreTrainedModel:()=>i.TableTransformerPreTrainedModel,Tensor:()=>p.Tensor,Text2TextGenerationPipeline:()=>r.Text2TextGenerationPipeline,TextClassificationPipeline:()=>r.TextClassificationPipeline,TextGenerationPipeline:()=>r.TextGenerationPipeline,TextToAudioPipeline:()=>r.TextToAudioPipeline,TokenClassificationPipeline:()=>r.TokenClassificationPipeline,TokenClassifierOutput:()=>i.TokenClassifierOutput,TokenizerModel:()=>s.TokenizerModel,TrOCRForCausalLM:()=>i.TrOCRForCausalLM,TrOCRPreTrainedModel:()=>i.TrOCRPreTrainedModel,TranslationPipeline:()=>r.TranslationPipeline,UniSpeechForCTC:()=>i.UniSpeechForCTC,UniSpeechForSequenceClassification:()=>i.UniSpeechForSequenceClassification,UniSpeechModel:()=>i.UniSpeechModel,UniSpeechPreTrainedModel:()=>i.UniSpeechPreTrainedModel,UniSpeechSatForAudioFrameClassification:()=>i.UniSpeechSatForAudioFrameClassification,UniSpeechSatForCTC:()=>i.UniSpeechSatForCTC,UniSpeechSatForSequenceClassification:()=>i.UniSpeechSatForSequenceClassification,UniSpeechSatModel:()=>i.UniSpeechSatModel,UniSpeechSatPreTrainedModel:()=>i.UniSpeechSatPreTrainedModel,ViTFeatureExtractor:()=>a.ViTFeatureExtractor,ViTForImageClassification:()=>i.ViTForImageClassification,ViTImageProcessor:()=>a.ViTImageProcessor,ViTModel:()=>i.ViTModel,ViTPreTrainedModel:()=>i.ViTPreTrainedModel,VisionEncoderDecoderModel:()=>i.VisionEncoderDecoderModel,VitMatteForImageMatting:()=>i.VitMatteForImageMatting,VitMatteImageProcessor:()=>a.VitMatteImageProcessor,VitMattePreTrainedModel:()=>i.VitMattePreTrainedModel,VitsModel:()=>i.VitsModel,VitsModelOutput:()=>i.VitsModelOutput,VitsPreTrainedModel:()=>i.VitsPreTrainedModel,VitsTokenizer:()=>s.VitsTokenizer,Wav2Vec2BertForCTC:()=>i.Wav2Vec2BertForCTC,Wav2Vec2BertForSequenceClassification:()=>i.Wav2Vec2BertForSequenceClassification,Wav2Vec2BertModel:()=>i.Wav2Vec2BertModel,Wav2Vec2BertPreTrainedModel:()=>i.Wav2Vec2BertPreTrainedModel,Wav2Vec2CTCTokenizer:()=>s.Wav2Vec2CTCTokenizer,Wav2Vec2FeatureExtractor:()=>a.Wav2Vec2FeatureExtractor,Wav2Vec2ForAudioFrameClassification:()=>i.Wav2Vec2ForAudioFrameClassification,Wav2Vec2ForCTC:()=>i.Wav2Vec2ForCTC,Wav2Vec2ForSequenceClassification:()=>i.Wav2Vec2ForSequenceClassification,Wav2Vec2Model:()=>i.Wav2Vec2Model,Wav2Vec2PreTrainedModel:()=>i.Wav2Vec2PreTrainedModel,Wav2Vec2ProcessorWithLM:()=>a.Wav2Vec2ProcessorWithLM,WavLMForAudioFrameClassification:()=>i.WavLMForAudioFrameClassification,WavLMForCTC:()=>i.WavLMForCTC,WavLMForSequenceClassification:()=>i.WavLMForSequenceClassification,WavLMForXVector:()=>i.WavLMForXVector,WavLMModel:()=>i.WavLMModel,WavLMPreTrainedModel:()=>i.WavLMPreTrainedModel,WhisperFeatureExtractor:()=>a.WhisperFeatureExtractor,WhisperForConditionalGeneration:()=>i.WhisperForConditionalGeneration,WhisperModel:()=>i.WhisperModel,WhisperPreTrainedModel:()=>i.WhisperPreTrainedModel,WhisperProcessor:()=>a.WhisperProcessor,WhisperTokenizer:()=>s.WhisperTokenizer,XLMForQuestionAnswering:()=>i.XLMForQuestionAnswering,XLMForSequenceClassification:()=>i.XLMForSequenceClassification,XLMForTokenClassification:()=>i.XLMForTokenClassification,XLMModel:()=>i.XLMModel,XLMPreTrainedModel:()=>i.XLMPreTrainedModel,XLMRobertaForMaskedLM:()=>i.XLMRobertaForMaskedLM,XLMRobertaForQuestionAnswering:()=>i.XLMRobertaForQuestionAnswering,XLMRobertaForSequenceClassification:()=>i.XLMRobertaForSequenceClassification,XLMRobertaForTokenClassification:()=>i.XLMRobertaForTokenClassification,XLMRobertaModel:()=>i.XLMRobertaModel,XLMRobertaPreTrainedModel:()=>i.XLMRobertaPreTrainedModel,XLMRobertaTokenizer:()=>s.XLMRobertaTokenizer,XLMTokenizer:()=>s.XLMTokenizer,XLMWithLMHeadModel:()=>i.XLMWithLMHeadModel,XVectorOutput:()=>i.XVectorOutput,YolosFeatureExtractor:()=>a.YolosFeatureExtractor,YolosForObjectDetection:()=>i.YolosForObjectDetection,YolosModel:()=>i.YolosModel,YolosObjectDetectionOutput:()=>i.YolosObjectDetectionOutput,YolosPreTrainedModel:()=>i.YolosPreTrainedModel,ZeroShotAudioClassificationPipeline:()=>r.ZeroShotAudioClassificationPipeline,ZeroShotClassificationPipeline:()=>r.ZeroShotClassificationPipeline,ZeroShotImageClassificationPipeline:()=>r.ZeroShotImageClassificationPipeline,ZeroShotObjectDetectionPipeline:()=>r.ZeroShotObjectDetectionPipeline,bankers_round:()=>d.bankers_round,cat:()=>p.cat,cos_sim:()=>d.cos_sim,dot:()=>d.dot,dynamicTimeWarping:()=>p.dynamicTimeWarping,env:()=>o.env,getTopItems:()=>d.getTopItems,hanning:()=>c.hanning,interpolate:()=>p.interpolate,interpolate_data:()=>d.interpolate_data,layer_norm:()=>p.layer_norm,log_softmax:()=>d.log_softmax,magnitude:()=>d.magnitude,max:()=>d.max,mean:()=>p.mean,mean_pooling:()=>p.mean_pooling,medianFilter:()=>d.medianFilter,mel_filter_bank:()=>c.mel_filter_bank,min:()=>d.min,ones:()=>p.ones,ones_like:()=>p.ones_like,permute:()=>p.permute,permute_data:()=>d.permute_data,pipeline:()=>r.pipeline,quantize_embeddings:()=>p.quantize_embeddings,read_audio:()=>c.read_audio,round:()=>d.round,softmax:()=>d.softmax,spectrogram:()=>c.spectrogram,stack:()=>p.stack,std_mean:()=>p.std_mean,window_function:()=>c.window_function});var r=n(/*! ./pipelines.js */"./src/pipelines.js"),o=n(/*! ./env.js */"./src/env.js"),i=n(/*! ./models.js */"./src/models.js"),s=n(/*! ./tokenizers.js */"./src/tokenizers.js"),a=n(/*! ./processors.js */"./src/processors.js"),l=n(/*! ./configs.js */"./src/configs.js"),c=n(/*! ./utils/audio.js */"./src/utils/audio.js"),u=n(/*! ./utils/image.js */"./src/utils/image.js"),p=n(/*! ./utils/tensor.js */"./src/utils/tensor.js"),d=n(/*! ./utils/maths.js */"./src/utils/maths.js")},"./src/utils/audio.js": /*!****************************!*\ !*** ./src/utils/audio.js ***! \****************************/(e,t,n)=>{n.r(t),n.d(t,{hanning:()=>a,mel_filter_bank:()=>d,read_audio:()=>s,spectrogram:()=>h,window_function:()=>f});var r=n(/*! ./hub.js */"./src/utils/hub.js"),o=n(/*! ./maths.js */"./src/utils/maths.js"),i=n(/*! ./core.js */"./src/utils/core.js");async function s(e,t){if("undefined"==typeof AudioContext)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");const n=await(await(0,r.getFile)(e)).arrayBuffer(),o=new AudioContext({sampleRate:t});void 0===t&&console.warn(`No sampling rate provided, using default of ${o.sampleRate}Hz.`);const i=await o.decodeAudioData(n);let s;if(2===i.numberOfChannels){const e=Math.sqrt(2),t=i.getChannelData(0),n=i.getChannelData(1);s=new Float32Array(t.length);for(let r=0;r2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,n=15,r=27/Math.log(6.4))=>e>=t?n+Math.log(e/t)*r:3*e/200};function c(e,t="htk"){const n=l[t];if(!n)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return"number"==typeof e?n(e):e.map((e=>n(e)))}const u={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,n=15,r=Math.log(6.4)/27)=>e>=n?t*Math.exp(r*(e-n)):200*e/3};function p(e,t,n){const r=(t-e)/(n-1);return Float64Array.from({length:n},((t,n)=>e+r*n))}function d(e,t,n,r,o,i=null,s="htk",a=!1){if(null!==i&&"slaney"!==i)throw new Error('norm must be one of null or "slaney"');const l=p(c(n,s),c(r,s),t+2);let d,_=function(e,t="htk"){const n=u[t];if(!n)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return"number"==typeof e?n(e):e.map((e=>n(e)))}(l,s);if(a){const t=o/(2*e);d=c(Float64Array.from({length:e},((e,n)=>n*t)),s),_=l}else d=p(0,Math.floor(o/2),e);const h=function(e,t){const n=Float64Array.from({length:t.length-1},((e,n)=>t[n+1]-t[n])),r=Array.from({length:e.length},(()=>new Array(t.length)));for(let n=0;nnew Array(e.length)));for(let t=0;ts)throw Error(`frame_length (${n}) may not be larger than fft_length (${s})`);if(v!==n)throw new Error(`Length of the window (${v}) must equal frame_length (${n})`);if(r<=0)throw new Error("hop_length must be greater than zero");if(l){if("reflect"!==c)throw new Error(`pad_mode="${c}" not implemented yet.`);const t=Math.floor((s-1)/2)+1;e=function(e,t,n){const r=new e.constructor(e.length+t+n),o=e.length-1;for(let n=0;nk?y&&(P=x):P=S=x);const A=new o.FFT(s),F=new Float64Array(s),C=new Float64Array(A.outputBufferSize),E=new Array(S);for(let o=0;o=1;--e)F[e]-=p*F[e-1];F[0]*=1-p}for(let e=0;eMath.pow(e,.85)));break;default:throw new Error(`Unknown window type ${t}.`)}if(n&&(s=s.subarray(0,e)),null===r)return s;if(e>r)throw new Error(`Length of the window (${e}) may not be larger than frame_length (${r})`);return s}},"./src/utils/core.js": /*!***************************!*\ !*** ./src/utils/core.js ***! \***************************/(e,t,n)=>{function r(e,t){e&&e(t)}function o(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e])))}function i(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}n.r(t),n.d(t,{Callable:()=>s,calculateDimensions:()=>u,calculateReflectOffset:()=>h,dispatchCallback:()=>r,escapeRegExp:()=>i,exists:()=>c,isIntegralNumber:()=>l,isTypedArray:()=>a,mergeArrays:()=>d,pop:()=>p,product:()=>_,reverseDictionary:()=>o});const s=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error("Must implement _call method in subclass")}};function a(e){return"TypedArray"===e?.prototype?.__proto__?.constructor?.name}function l(e){return Number.isInteger(e)||"bigint"==typeof e}function c(e){return null!=e}function u(e){const t=[];let n=e;for(;Array.isArray(n);)t.push(n.length),n=n[0];return t}function p(e,t,n=void 0){const r=e[t];if(void 0!==r)return delete e[t],r;if(void 0===n)throw Error(`Key ${t} does not exist in object.`);return n}function d(...e){return Array.prototype.concat.apply([],e)}function _(...e){return e.reduce(((e,t)=>e.flatMap((e=>t.map((t=>[e,t]))))))}function h(e,t){return Math.abs((e+t)%(2*t)-t)}},"./src/utils/data-structures.js": /*!**************************************!*\ !*** ./src/utils/data-structures.js ***! \**************************************/(e,t,n)=>{n.r(t),n.d(t,{CharTrie:()=>o,PriorityQueue:()=>r,TokenLattice:()=>s});class r{constructor(e=((e,t)=>e>t)){this._heap=[],this._comparator=e}get size(){return this._heap.length}isEmpty(){return 0===this.size}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(const t of e)this._heap.push(t),this._siftUp();return this.size}pop(){const e=this.peek(),t=this.size-1;return t>0&&this._swap(0,t),this._heap.pop(),this._siftDown(),e}replace(e){const t=this.peek();return this._heap[0]=e,this._siftDown(),t}_parent(e){return(e+1>>>1)-1}_left(e){return 1+(e<<1)}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){const n=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=n}_siftUp(){let e=this.size-1;for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_siftDown(){let e=0;for(;this._left(e)[])),this.endNodes=Array.from({length:this.len+1},(()=>[]));const r=new a(this.bosTokenId,0,0,0,0),o=new a(this.eosTokenId,1,this.len,0,0);this.nodes.push(r.clone()),this.nodes.push(o.clone()),this.beginNodes[this.len].push(o),this.endNodes[0].push(r)}insert(e,t,n,r){const o=this.nodes.length,i=new a(r,o,e,t,n);this.beginNodes[e].push(i),this.endNodes[e+t].push(i),this.nodes.push(i)}viterbi(){const e=this.len;let t=0;for(;t<=e;){if(0==this.beginNodes[t].length)return[];for(let e of this.beginNodes[t]){e.prev=null;let n=0,r=null;for(let o of this.endNodes[t]){const t=o.backtraceScore+e.score;(null===r||t>n)&&(r=o.clone(),n=t)}if(null===r)return[];e.prev=r,e.backtraceScore=n}++t}const n=[],r=this.beginNodes[e][0].prev;if(null===r)return[];let o=r.clone();for(;null!==o.prev;){n.push(o.clone());const e=o.clone();o=e.prev.clone()}return n.reverse(),n}piece(e){return this.sentence.slice(e.pos,e.pos+e.length)}tokens(){return this.viterbi().map((e=>this.piece(e)))}tokenIds(){return this.viterbi().map((e=>e.tokenId))}}class a{constructor(e,t,n,r,o){this.tokenId=e,this.nodeId=t,this.pos=n,this.length=r,this.score=o,this.prev=null,this.backtraceScore=0}clone(){const e=new a(this.tokenId,this.nodeId,this.pos,this.length,this.score);return e.prev=this.prev,e.backtraceScore=this.backtraceScore,e}}},"./src/utils/generation.js": /*!*********************************!*\ !*** ./src/utils/generation.js ***! \*********************************/(e,t,n)=>{n.r(t),n.d(t,{ForceTokensLogitsProcessor:()=>a,ForcedBOSTokenLogitsProcessor:()=>l,ForcedEOSTokenLogitsProcessor:()=>c,GenerationConfig:()=>g,LogitsProcessor:()=>s,LogitsProcessorList:()=>i,MinLengthLogitsProcessor:()=>h,MinNewTokensLengthLogitsProcessor:()=>f,NoBadWordsLogitsProcessor:()=>m,NoRepeatNGramLogitsProcessor:()=>d,RepetitionPenaltyLogitsProcessor:()=>_,Sampler:()=>b,SuppressTokensAtBeginLogitsProcessor:()=>u,WhisperTimeStampLogitsProcessor:()=>p});n(/*! ./tensor.js */"./src/utils/tensor.js");var r=n(/*! ./core.js */"./src/utils/core.js"),o=n(/*! ./maths.js */"./src/utils/maths.js");class i extends r.Callable{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){for(let n of t)this.processors.forEach((t=>t(e,n)))}[Symbol.iterator](){return this.processors.values()}}class s extends r.Callable{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class a extends s{constructor(e){super(),this.force_token_map=Object.fromEntries(e??[])}_call(e,t){let n=this.force_token_map[e.length];return(0,r.exists)(n)&&(t.data.fill(-1/0),t.data[n]=0),t}}class l extends s{constructor(e){super(),this.bos_token_id=e}_call(e,t){return 1===e.length&&(t.data.fill(-1/0),t.data[this.bos_token_id]=0),t}}class c extends s{constructor(e,t){super(),this.max_length=e,this.forced_eos_token_id=t}_call(e,t){}}class u extends s{constructor(e,t){super(),this.begin_suppress_tokens=e,this.begin_index=t}_call(e,t){if(e.length===this.begin_index)for(let e of this.begin_suppress_tokens)t.data[e]=-1/0;return t}}class p extends s{constructor(e){super(),this.eos_token_id=e.eos_token_id,this.no_timestamps_token_id=e.no_timestamps_token_id,this.timestamp_begin=this.no_timestamps_token_id+1,this.begin_index=(e.forced_decoder_ids||[]).length+2,e.forced_decoder_ids.slice(-1)[0][1]===this.no_timestamps_token_id&&(this.begin_index-=1),this.max_initial_timestamp_index=e.max_initial_timestamp_index}_call(e,t){const n=t.data;if(n[this.no_timestamps_token_id]=-1/0,e.length===this.begin_index-1)return n.fill(-1/0),n[this.timestamp_begin]=0,t;const r=e.slice(this.begin_index),i=r.length>=1&&r[r.length-1]>=this.timestamp_begin,s=r.length<2||r[r.length-2]>=this.timestamp_begin;if(i&&(s?n.subarray(this.timestamp_begin).fill(-1/0):n.subarray(0,this.eos_token_id).fill(-1/0)),e.length===this.begin_index&&null!==this.max_initial_timestamp_index){const e=this.timestamp_begin+this.max_initial_timestamp_index;n.subarray(e+1).fill(-1/0)}const a=(0,o.log_softmax)(n);return Math.log(a.subarray(this.timestamp_begin).map(Math.exp).reduce(((e,t)=>e+t)))>(0,o.max)(a.subarray(0,this.timestamp_begin))[0]&&n.subarray(0,this.timestamp_begin).fill(-1/0),t}}class d extends s{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){const t=e.length,n=[];for(let r=0;r0&&(r=r.map((e=>e/this.generation_config.temperature))),r}randomSelect(e){let t=e.reduce(((e,t)=>e+t),0),n=Math.random()*t;for(let t=0;t1)return new y(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new w(e)}}class w extends b{sample(e,t=-1){let n=this.getLogits(e,t);return[[(0,o.max)(n)[1],0]]}}class x extends b{sample(e,t=-1){let n=e.dims.at(-1);this.generation_config.top_k>0&&(n=Math.min(this.generation_config.top_k,n));const r=this.getLogits(e,t),i=(0,o.getTopItems)(r,n),s=(0,o.softmax)(i.map((e=>e[1])));return Array.from({length:this.generation_config.num_beams},(()=>{const e=this.randomSelect(s);return[i[e][0],Math.log(s[e])]}))}}class y extends b{sample(e,t=-1){let n=e.dims.at(-1);this.generation_config.top_k>0&&(n=Math.min(this.generation_config.top_k,n));const r=this.getLogits(e,t),i=(0,o.getTopItems)(r,n),s=(0,o.softmax)(i.map((e=>e[1])));return Array.from({length:this.generation_config.num_beams},((e,t)=>[i[t][0],Math.log(s[t])]))}}},"./src/utils/hub.js": /*!**************************!*\ !*** ./src/utils/hub.js ***! \**************************/(e,t,n)=>{n.r(t),n.d(t,{getFile:()=>u,getModelFile:()=>_,getModelJSON:()=>h});var r=n(/*! fs */"?7a2c"),o=n(/*! path */"?a42a"),i=n(/*! stream/web */"?e65c"),s=n(/*! ../env.js */"./src/env.js"),a=n(/*! ./core.js */"./src/utils/core.js");globalThis.ReadableStream||(globalThis.ReadableStream=i.ReadableStream);class l{_CONTENT_TYPE_MAP={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=r.existsSync(e),this.exists){this.status=200,this.statusText="OK";let t=r.statSync(e);this.headers.set("content-length",t.size.toString()),this.updateContentType();let n=this;this.body=new ReadableStream({start(e){n.arrayBuffer().then((t=>{e.enqueue(new Uint8Array(t)),e.close()}))}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const e=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",this._CONTENT_TYPE_MAP[e]??"application/octet-stream")}clone(){let e=new l(this.filePath);return e.exists=this.exists,e.status=this.status,e.statusText=this.statusText,e.headers=new Headers(this.headers),e}async arrayBuffer(){return(await r.promises.readFile(this.filePath)).buffer}async blob(){const e=await r.promises.readFile(this.filePath);return new Blob([e],{type:this.headers.get("content-type")})}async text(){return await r.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function c(e,t=null){let n;try{n=new URL(e)}catch(e){return!1}return!(t&&!t.includes(n.hostname))&&("http:"===n.protocol||"https:"===n.protocol)}async function u(e){if(s.env.useFS&&!c(e))return new l(e);if("undefined"!=typeof process&&"node"===process?.release?.name){const t=!!process.env?.TESTING_REMOTELY,n=s.env.version,r=new Headers;r.set("User-Agent",`transformers.js/${n}; is_ci/${t};`);if(c(e,["huggingface.co","hf.co"])){const e=process.env?.HF_TOKEN??process.env?.HF_ACCESS_TOKEN;e&&r.set("Authorization",`Bearer ${e}`)}return fetch(e,{headers:r})}return fetch(e)}const p={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};class d{constructor(e){this.path=e}async match(e){let t=o.join(this.path,e),n=new l(t);return n.exists?n:void 0}async put(e,t){const n=Buffer.from(await t.arrayBuffer());let i=o.join(this.path,e);try{await r.promises.mkdir(o.dirname(i),{recursive:!0}),await r.promises.writeFile(i,n)}catch(e){console.warn("An error occurred while writing the file to cache:",e)}}}async function _(e,t,n=!0,r={}){if(!s.env.allowLocalModels){if(r.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!s.env.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}let o;if((0,a.dispatchCallback)(r.progress_callback,{status:"initiate",name:e,file:t}),!o&&s.env.useBrowserCache){if("undefined"==typeof caches)throw Error("Browser cache is not available in this environment.");try{o=await caches.open("transformers-cache")}catch(e){console.warn("An error occurred while opening the browser cache:",e)}}if(!o&&s.env.useFSCache&&(o=new d(r.cache_dir??s.env.cacheDir)),!o&&s.env.useCustomCache){if(!s.env.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!s.env.customCache.match||!s.env.customCache.put)throw new Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");o=s.env.customCache}const i=r.revision??"main";let l,_,h=f(e,t),m=f(s.env.localModelPath,h),g=f(s.env.remoteHost,s.env.remotePathTemplate.replaceAll("{model}",e).replaceAll("{revision}",encodeURIComponent(i)),t),b="main"===i?h:f(e,i,t),w=o instanceof d?b:g,x=!1;o&&(_=await async function(e,...t){for(let n of t)try{let t=await e.match(n);if(t)return t}catch(e){continue}}(o,m,w));const y=void 0!==_;if(void 0===_){if(s.env.allowLocalModels){if(c(h)){if(r.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${h}.`);if(!s.env.allowRemoteModels)throw new Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${h}.`)}else try{_=await u(m),l=m}catch(e){console.warn(`Unable to load from local path "${m}": "${e}"`)}}if(void 0===_||404===_.status){if(r.local_files_only||!s.env.allowRemoteModels){if(n)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${m}".`);return null}if(_=await u(g),200!==_.status)return function(e,t,n){if(!n)return null;const r=p[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${r}: "${t}".`)}(_.status,g,n);l=w}x=o&&"undefined"!=typeof Response&&_ instanceof Response&&200===_.status}(0,a.dispatchCallback)(r.progress_callback,{status:"download",name:e,file:t});const T={status:"progress",name:e,file:t};let v;return r.progress_callback?y&&"undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?(v=new Uint8Array(await _.arrayBuffer()),(0,a.dispatchCallback)(r.progress_callback,{...T,progress:100,loaded:v.length,total:v.length})):v=await async function(e,t){const n=e.headers.get("Content-Length");null===n&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let r=parseInt(n??"0"),o=new Uint8Array(r),i=0;const s=e.body.getReader();async function a(){const{done:e,value:n}=await s.read();if(e)return;let l=i+n.length;if(l>r){r=l;let e=new Uint8Array(r);e.set(o),o=e}o.set(n,i),i=l;return t({progress:i/r*100,loaded:i,total:r}),a()}return await a(),o}(_,(e=>{(0,a.dispatchCallback)(r.progress_callback,{...T,...e})})):v=new Uint8Array(await _.arrayBuffer()),x&&l&&void 0===await o.match(l)&&await o.put(l,new Response(v,{headers:_.headers})).catch((e=>{console.warn(`Unable to add response to browser cache: ${e}.`)})),(0,a.dispatchCallback)(r.progress_callback,{status:"done",name:e,file:t}),v}async function h(e,t,n=!0,r={}){let o=await _(e,t,n,r);if(null===o)return{};let i=new TextDecoder("utf-8").decode(o);return JSON.parse(i)}function f(...e){return(e=e.map(((t,n)=>(n&&(t=t.replace(new RegExp("^/"),"")),n!==e.length-1&&(t=t.replace(new RegExp("/$"),"")),t)))).join("/")}},"./src/utils/image.js": /*!****************************!*\ !*** ./src/utils/image.js ***! \****************************/(e,t,n)=>{n.r(t),n.d(t,{RawImage:()=>h});var r=n(/*! ./hub.js */"./src/utils/hub.js"),o=n(/*! ../env.js */"./src/env.js"),i=n(/*! ./tensor.js */"./src/utils/tensor.js"),s=n(/*! sharp */"?2b25");const a="undefined"!=typeof self,l=a&&"DedicatedWorkerGlobalScope"===self.constructor.name;let c,u,p;if(a)c=(e,t)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(e,t)},p=self.createImageBitmap,u=self.ImageData;else{if(!s)throw new Error("Unable to load image processing library.");p=async e=>{const t=(await e.metadata()).channels;let{data:n,info:r}=await e.raw().toBuffer({resolveWithObject:!0});const o=new h(new Uint8ClampedArray(n),r.width,r.height,r.channels);return void 0!==t&&t!==r.channels&&o.convert(t),o}}const d={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},_=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class h{constructor(e,t,n,r){this.data=e,this.width=t,this.height=n,this.channels=r}get size(){return[this.width,this.height]}static async read(e){if(e instanceof h)return e;if("string"==typeof e||e instanceof URL)return await this.fromURL(e);throw new Error("Unsupported input type: "+typeof e)}static async fromURL(e){let t=await(0,r.getFile)(e);if(200!==t.status)throw new Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let n=await t.blob();return this.fromBlob(n)}static async fromBlob(e){if(a){let t=await p(e);const n=c(t.width,t.height).getContext("2d");return n.drawImage(t,0,0),new this(n.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}{let t=s(await e.arrayBuffer());return await p(t)}}static fromTensor(e,t="CHW"){if(3!==e.dims.length)throw new Error(`Tensor should have 3 dimensions, but has ${e.dims.length} dimensions.`);if("CHW"===t)e=e.transpose(1,2,0);else if("HWC"!==t)throw new Error(`Unsupported channel format: ${t}`);if(!(e.data instanceof Uint8ClampedArray||e.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${e.type}`);switch(e.dims[2]){case 1:case 2:case 3:case 4:return new h(e.data,e.dims[1],e.dims[0],e.dims[2]);default:throw new Error(`Unsupported number of channels: ${e.dims[2]}`)}}grayscale(){if(1===this.channels)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,n=0;t=0?a=n:u=-n,r>=0?l=r:p=-r,s.drawImage(i,a,l,e,t,u,p,e,t),new h(s.getImageData(0,0,e,t).data,e,t,4).convert(o)}{let o=this.toSharp();if(n>=0&&r>=0)o=o.extract({left:Math.floor(n),top:Math.floor(r),width:e,height:t});else if(n<=0&&r<=0){let i=Math.floor(-r),s=Math.floor(-n);o=o.extend({top:i,left:s,right:e-this.width-s,bottom:t-this.height-i})}else{let i=[0,0],s=0;r<0?(i[0]=Math.floor(-r),i[1]=t-this.height-i[0]):s=Math.floor(r);let a=[0,0],l=0;n<0?(a[0]=Math.floor(-n),a[1]=e-this.width-a[0]):l=Math.floor(n),o=o.extend({top:i[0],bottom:i[1],left:a[0],right:a[1]}).extract({left:l,top:s,width:e,height:t})}return await p(o)}}async toBlob(e="image/png",t=1){if(!a)throw new Error("toBlob() is only supported in browser environments.");const n=this.toCanvas();return await n.convertToBlob({type:e,quality:t})}toTensor(e="CHW"){let t=new i.Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if("HWC"===e);else{if("CHW"!==e)throw new Error(`Unsupported channel format: ${e}`);t=t.permute(2,0,1)}return t}toCanvas(){if(!a)throw new Error("toCanvas() is only supported in browser environments.");let e=this.clone().rgba(),t=c(e.width,e.height),n=new u(e.data,e.width,e.height);return t.getContext("2d").putImageData(n,0,0),t}_update(e,t,n,r=null){return this.data=e,this.width=t,this.height=n,null!==r&&(this.channels=r),this}clone(){return new h(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(!a){if(o.env.useFS){const t=this.toSharp();return await t.toFile(e)}throw new Error("Unable to save the image because filesystem is disabled in this environment.")}{if(l)throw new Error("Unable to save an image from a Web Worker.");const t=e.split(".").pop().toLowerCase(),n=_.get(t)??"image/png",r=await this.toBlob(n),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=e,i.click(),i.remove()}}toSharp(){if(a)throw new Error("toSharp() is only supported in server-side environments.");return s(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}},"./src/utils/maths.js": /*!****************************!*\ !*** ./src/utils/maths.js ***! \****************************/(e,t,n)=>{function r(e,[t,n,r],[o,i],s="bilinear",a=!1){const l=i/r,c=o/n,u=new e.constructor(o*i*t),p=n*r,d=o*i;for(let s=0;s=0;--e)o[e]=i,r[e]=t[n[e]],i*=r[e];const i=n.map(((e,t)=>o[n.indexOf(t)])),s=new e.constructor(e.length);for(let n=0;n=0;--e)r+=o%t[e]*i[e],o=Math.floor(o/t[e]);s[r]=e[n]}return[s,r]}function i(e){const t=d(e)[0],n=e.map((e=>Math.exp(e-t))),r=n.reduce(((e,t)=>e+t),0);return n.map((e=>e/r))}function s(e){return i(e).map((e=>Math.log(e)))}function a(e,t){let n=0;for(let r=0;r[t,e])).sort(((e,t)=>t[1]-e[1])),null!==t&&t>0&&(e=e.slice(0,t)),e}function c(e,t){return a(e,t)/(u(e)*u(t))}function u(e){return Math.sqrt(e.reduce(((e,t)=>e+t*t),0))}function p(e){if(0===e.length)throw Error("Array must not be empty");let t=e[0],n=0;for(let r=1;rt&&(t=e[r],n=r);return[Number(t),n]}function _(e){return e>0&&0==(e&e-1)}n.r(t),n.d(t,{FFT:()=>m,bankers_round:()=>w,cos_sim:()=>c,dot:()=>a,getTopItems:()=>l,interpolate_data:()=>r,log_softmax:()=>s,magnitude:()=>u,max:()=>d,medianFilter:()=>g,min:()=>p,permute_data:()=>o,round:()=>b,softmax:()=>i});class h{constructor(e){if(this.size=0|e,this.size<=1||!_(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=e<<1,this.table=new Float64Array(2*this.size);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return n}toComplexArray(e,t){const n=t||this.createComplexArray();for(let t=0;t>>1],n[t+1]=0;return n}completeSpectrum(e){const t=this._csize,n=t>>>1;for(let r=2;r>=2;s>=2;s>>=2){a=r/s<<1;const t=a>>>2;for(o=0;o>>1,s>>>1)}else for(o=0,i=0;o>>1,s>>>1,n)}for(s>>=2;s>=2;s>>=2){a=r/s<<1;const t=a>>>2;for(o=0;o>1;++t){const n=(t+1-e)**2/2,r=Math.sqrt(a**2+l**2)**n,s=n*Math.atan2(l,a),c=2*t;o[c]=r*Math.cos(s),o[c+1]=r*Math.sin(s),i[c]=o[c],i[c+1]=-o[c+1]}this._slicedChirpBuffer=o.subarray(t,n),this._f=new h(r>>1),this._f.transform(this._chirpBuffer,i)}_transform(e,t,n){const r=this._buffer1,o=this._buffer2,i=this._outBuffer1,s=this._outBuffer2,a=this._chirpBuffer,l=this._slicedChirpBuffer,c=this._a;if(n)for(let e=0;e>1];r[e]=o*l[e],r[n]=o*l[n]}else for(let e=0;e=e.length&&(o=2*(e.length-1)-o),r[i++]=e[o]}r.sort(),n[t]=r[o]}return n}function b(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}function w(e){const t=Math.round(e);return Math.abs(e)%1==.5?t%2==0?t:t-1:t}},"./src/utils/tensor.js": /*!*****************************!*\ !*** ./src/utils/tensor.js ***! \*****************************/(e,t,n)=>{n.r(t),n.d(t,{Tensor:()=>a,cat:()=>f,dynamicTimeWarping:()=>w,interpolate:()=>c,layer_norm:()=>p,mean:()=>b,mean_pooling:()=>u,ones:()=>x,ones_like:()=>y,permute:()=>l,quantize_embeddings:()=>T,stack:()=>m,std_mean:()=>g});var r=n(/*! ../backends/onnx.js */"./src/backends/onnx.js"),o=n(/*! ./maths.js */"./src/utils/maths.js");const i=Object.freeze({float32:Float32Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array}),s=r.ONNX.Tensor;class a{dims;type;data;size;constructor(...e){return e[0]instanceof s?Object.assign(this,e[0]):Object.assign(this,new s(e[0],e[1],e[2])),new Proxy(this,{get:(e,t)=>{if("string"==typeof t){let n=Number(t);if(Number.isInteger(n))return e._getitem(n)}return e[t]},set:(e,t,n)=>e[t]=n})}*[Symbol.iterator](){const[e,...t]=this.dims;if(t.length>0){const n=t.reduce(((e,t)=>e*t));for(let r=0;r0){const t=n.reduce(((e,t)=>e*t));return this._subarray(e,t,n)}return new a(this.type,[this.data[e]],n)}indexOf(e){for(let t=0;te*t));if(n!==r)throw Error(`cannot reshape array of size ${n} into shape (${t})`);let o=e;for(let e=t.length-1;e>=0;e--)o=o.reduce(((n,r)=>{let o=n[n.length-1];return o.lengtho[1])throw new Error(`Invalid slice: ${o}`);let e=[Math.max(o[0],0),Math.min(o[1],this.dims[r])];n.push(e),t.push(e[1]-e[0])}}}let r=n.map((([e,t])=>t-e)),o=r.reduce(((e,t)=>e*t)),i=new this.data.constructor(o);const s=this.stride();for(let e=0;e=0;--o){const e=r[o];t+=(i%e+n[o][0])*s[o],i=Math.floor(i/e)}i[e]=this.data[t]}return new a(this.type,i,t)}permute(...e){return l(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(e="fro",t=null,n=!1){if("fro"===e)e=2;else if("string"==typeof e)throw Error(`Unsupported norm: ${e}`);if(null===t){let t=this.data.reduce(((t,n)=>t+n**e),0)**(1/e);return new a(this.type,[t],[])}t=h(t,this.dims.length);const r=this.dims.slice();r[t]=1;const o=new this.data.constructor(this.data.length/this.dims[t]);for(let n=0;n=0;--e){const n=this.dims[e];if(e!==t){i+=o%n*s,s*=r[e]}o=Math.floor(o/n)}o[i]+=this.data[n]**e}if(1!==e)for(let t=0;t=0;--n){const e=this.dims[n];if(n!==t){r+=o%e*i,i*=this.dims[n]}o=Math.floor(o/e)}this.data[e]/=n.data[r]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return function(e){const t=new Array(e.length);for(let n=e.length-1,r=1;n>=0;--n)t[n]=r,r*=e[n];return t}(this.dims)}squeeze(e=null){return new a(this.type,this.data,d(this.dims,e))}squeeze_(e=null){return this.dims=d(this.dims,e),this}unsqueeze(e=null){return new a(this.type,this.data,_(this.dims,e))}unsqueeze_(e=null){return this.dims=_(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let n=this.dims.slice(0,e),r=this.dims.slice(e,t+1),o=this.dims.slice(t+1);return this.dims=[...n,r.reduce(((e,t)=>e*t),1),...o],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...e){let t=-1;for(let n=0;nr!==t?e*n:e),1);e[t]=this.data.length/n}return new a(this.type,this.data,e)}neg_(){for(let e=0;e1!==e)):"number"==typeof t?1===e[t]&&e.splice(t,1):Array.isArray(t)&&(e=e.filter(((e,n)=>1!==e||!t.includes(n)))),e}function _(e,t){return t=h(t,e.length+1),(e=e.slice()).splice(t,0,1),e}function h(e,t,n=null){if(e<-t||e>=t)throw new Error(`IndexError: index ${e} is out of bounds for dimension${null===n?"":" "+n} with size ${t}`);return e<0&&(e=(e%t+t)%t),e}function f(e,t=0){t=h(t,e[0].dims.length);const n=e[0].dims.slice();n[t]=e.reduce(((e,n)=>e+n.dims[t]),0);const r=n.reduce(((e,t)=>e*t),1),o=new e[0].data.constructor(r),i=e[0].type;if(0===t){let t=0;for(let n of e)o.set(n.data,t),t+=n.data.length}else{let r=0;for(let i=0;i=0;--o){const e=s.dims[o];let c=a%e;o===t&&(c+=r),i+=c*l,l*=n[o],a=Math.floor(a/e)}o[i]=s.data[e]}r+=s.dims[t]}}return new a(i,o,n)}function m(e,t=0){return f(e.map((e=>e.unsqueeze(t))),t)}function g(e,t=null,n=1,r=!1){if(null===t){const t=e.data.reduce(((e,t)=>e+t),0)/e.data.length,r=Math.sqrt(e.data.reduce(((e,n)=>e+(n-t)**2),0)/(e.data.length-n)),o=new a(e.type,[t],[]);return[new a(e.type,[r],[]),o]}const o=b(e,t=h(t,e.dims.length),r),i=e.dims.slice();i[t]=1;const s=new e.data.constructor(e.data.length/e.dims[t]);for(let n=0;n=0;--o){const n=e.dims[o];if(o!==t){r+=s%n*a,a*=i[o]}s=Math.floor(s/n)}s[r]+=(e.data[n]-o.data[r])**2}for(let r=0;re+t),0);return new a(e.type,[t/e.data.length],[])}t=h(t,e.dims.length);const r=e.dims.slice();r[t]=1;const o=new e.data.constructor(e.data.length/e.dims[t]);for(let n=0;n=0;--o){const n=e.dims[o];if(o!==t){i+=s%n*a,a*=r[o]}s=Math.floor(s/n)}o[i]+=e.data[n]}if(1!==e.dims[t])for(let n=0;n0||l>0;){c.push(s-1),u.push(l-1);switch(i[s][l].item()){case 0:--s,--l;break;case 1:--s;break;case 2:--l;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${s}, ${l}]. Please file a bug report.`)}}return c.reverse(),u.reverse(),[c,u]}function x(e){const t=e.reduce(((e,t)=>e*t),1);return new a("int64",new BigInt64Array(t).fill(1n),e)}function y(e){return x(e.dims)}function T(e,t){if(2!==e.dims.length)throw new Error("The tensor must have 2 dimensions");if(e.dims.at(-1)%8!=0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(t))throw new Error("The precision must be either 'binary' or 'ubinary'");const n="binary"===t,r=n?"int8":"uint8",o=n?Int8Array:Uint8Array,i=e.data,s=new o(i.length/8);for(let e=0;e0?1:0,r=Math.floor(e/8),o=e%8;s[r]|=t<<7-o,n&&0===o&&(s[r]-=128)}return new a(r,s,[e.dims[0],e.dims[1]/8])}}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var o=2&t&&e;"object"==typeof o&&!~leafPrototypes.indexOf(o);o=getProto(o))Object.getOwnPropertyNames(o).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,__webpack_require__.d(n,r),n},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__("./src/transformers.js"),__webpack_exports__ASTFeatureExtractor=__webpack_exports__.ASTFeatureExtractor,__webpack_exports__ASTForAudioClassification=__webpack_exports__.ASTForAudioClassification,__webpack_exports__ASTModel=__webpack_exports__.ASTModel,__webpack_exports__ASTPreTrainedModel=__webpack_exports__.ASTPreTrainedModel,__webpack_exports__AlbertForMaskedLM=__webpack_exports__.AlbertForMaskedLM,__webpack_exports__AlbertForQuestionAnswering=__webpack_exports__.AlbertForQuestionAnswering,__webpack_exports__AlbertForSequenceClassification=__webpack_exports__.AlbertForSequenceClassification,__webpack_exports__AlbertModel=__webpack_exports__.AlbertModel,__webpack_exports__AlbertPreTrainedModel=__webpack_exports__.AlbertPreTrainedModel,__webpack_exports__AlbertTokenizer=__webpack_exports__.AlbertTokenizer,__webpack_exports__AudioClassificationPipeline=__webpack_exports__.AudioClassificationPipeline,__webpack_exports__AutoConfig=__webpack_exports__.AutoConfig,__webpack_exports__AutoModel=__webpack_exports__.AutoModel,__webpack_exports__AutoModelForAudioClassification=__webpack_exports__.AutoModelForAudioClassification,__webpack_exports__AutoModelForAudioFrameClassification=__webpack_exports__.AutoModelForAudioFrameClassification,__webpack_exports__AutoModelForCTC=__webpack_exports__.AutoModelForCTC,__webpack_exports__AutoModelForCausalLM=__webpack_exports__.AutoModelForCausalLM,__webpack_exports__AutoModelForDepthEstimation=__webpack_exports__.AutoModelForDepthEstimation,__webpack_exports__AutoModelForDocumentQuestionAnswering=__webpack_exports__.AutoModelForDocumentQuestionAnswering,__webpack_exports__AutoModelForImageClassification=__webpack_exports__.AutoModelForImageClassification,__webpack_exports__AutoModelForImageFeatureExtraction=__webpack_exports__.AutoModelForImageFeatureExtraction,__webpack_exports__AutoModelForImageMatting=__webpack_exports__.AutoModelForImageMatting,__webpack_exports__AutoModelForImageSegmentation=__webpack_exports__.AutoModelForImageSegmentation,__webpack_exports__AutoModelForImageToImage=__webpack_exports__.AutoModelForImageToImage,__webpack_exports__AutoModelForMaskGeneration=__webpack_exports__.AutoModelForMaskGeneration,__webpack_exports__AutoModelForMaskedLM=__webpack_exports__.AutoModelForMaskedLM,__webpack_exports__AutoModelForObjectDetection=__webpack_exports__.AutoModelForObjectDetection,__webpack_exports__AutoModelForQuestionAnswering=__webpack_exports__.AutoModelForQuestionAnswering,__webpack_exports__AutoModelForSemanticSegmentation=__webpack_exports__.AutoModelForSemanticSegmentation,__webpack_exports__AutoModelForSeq2SeqLM=__webpack_exports__.AutoModelForSeq2SeqLM,__webpack_exports__AutoModelForSequenceClassification=__webpack_exports__.AutoModelForSequenceClassification,__webpack_exports__AutoModelForSpeechSeq2Seq=__webpack_exports__.AutoModelForSpeechSeq2Seq,__webpack_exports__AutoModelForTextToSpectrogram=__webpack_exports__.AutoModelForTextToSpectrogram,__webpack_exports__AutoModelForTextToWaveform=__webpack_exports__.AutoModelForTextToWaveform,__webpack_exports__AutoModelForTokenClassification=__webpack_exports__.AutoModelForTokenClassification,__webpack_exports__AutoModelForVision2Seq=__webpack_exports__.AutoModelForVision2Seq,__webpack_exports__AutoModelForXVector=__webpack_exports__.AutoModelForXVector,__webpack_exports__AutoModelForZeroShotObjectDetection=__webpack_exports__.AutoModelForZeroShotObjectDetection,__webpack_exports__AutoProcessor=__webpack_exports__.AutoProcessor,__webpack_exports__AutoTokenizer=__webpack_exports__.AutoTokenizer,__webpack_exports__AutomaticSpeechRecognitionPipeline=__webpack_exports__.AutomaticSpeechRecognitionPipeline,__webpack_exports__BartForConditionalGeneration=__webpack_exports__.BartForConditionalGeneration,__webpack_exports__BartForSequenceClassification=__webpack_exports__.BartForSequenceClassification,__webpack_exports__BartModel=__webpack_exports__.BartModel,__webpack_exports__BartPretrainedModel=__webpack_exports__.BartPretrainedModel,__webpack_exports__BartTokenizer=__webpack_exports__.BartTokenizer,__webpack_exports__BaseModelOutput=__webpack_exports__.BaseModelOutput,__webpack_exports__BeitFeatureExtractor=__webpack_exports__.BeitFeatureExtractor,__webpack_exports__BeitForImageClassification=__webpack_exports__.BeitForImageClassification,__webpack_exports__BeitModel=__webpack_exports__.BeitModel,__webpack_exports__BeitPreTrainedModel=__webpack_exports__.BeitPreTrainedModel,__webpack_exports__BertForMaskedLM=__webpack_exports__.BertForMaskedLM,__webpack_exports__BertForQuestionAnswering=__webpack_exports__.BertForQuestionAnswering,__webpack_exports__BertForSequenceClassification=__webpack_exports__.BertForSequenceClassification,__webpack_exports__BertForTokenClassification=__webpack_exports__.BertForTokenClassification,__webpack_exports__BertModel=__webpack_exports__.BertModel,__webpack_exports__BertPreTrainedModel=__webpack_exports__.BertPreTrainedModel,__webpack_exports__BertTokenizer=__webpack_exports__.BertTokenizer,__webpack_exports__BitImageProcessor=__webpack_exports__.BitImageProcessor,__webpack_exports__BlenderbotForConditionalGeneration=__webpack_exports__.BlenderbotForConditionalGeneration,__webpack_exports__BlenderbotModel=__webpack_exports__.BlenderbotModel,__webpack_exports__BlenderbotPreTrainedModel=__webpack_exports__.BlenderbotPreTrainedModel,__webpack_exports__BlenderbotSmallForConditionalGeneration=__webpack_exports__.BlenderbotSmallForConditionalGeneration,__webpack_exports__BlenderbotSmallModel=__webpack_exports__.BlenderbotSmallModel,__webpack_exports__BlenderbotSmallPreTrainedModel=__webpack_exports__.BlenderbotSmallPreTrainedModel,__webpack_exports__BlenderbotSmallTokenizer=__webpack_exports__.BlenderbotSmallTokenizer,__webpack_exports__BlenderbotTokenizer=__webpack_exports__.BlenderbotTokenizer,__webpack_exports__BloomForCausalLM=__webpack_exports__.BloomForCausalLM,__webpack_exports__BloomModel=__webpack_exports__.BloomModel,__webpack_exports__BloomPreTrainedModel=__webpack_exports__.BloomPreTrainedModel,__webpack_exports__BloomTokenizer=__webpack_exports__.BloomTokenizer,__webpack_exports__CLIPFeatureExtractor=__webpack_exports__.CLIPFeatureExtractor,__webpack_exports__CLIPModel=__webpack_exports__.CLIPModel,__webpack_exports__CLIPPreTrainedModel=__webpack_exports__.CLIPPreTrainedModel,__webpack_exports__CLIPSegForImageSegmentation=__webpack_exports__.CLIPSegForImageSegmentation,__webpack_exports__CLIPSegModel=__webpack_exports__.CLIPSegModel,__webpack_exports__CLIPSegPreTrainedModel=__webpack_exports__.CLIPSegPreTrainedModel,__webpack_exports__CLIPTextModelWithProjection=__webpack_exports__.CLIPTextModelWithProjection,__webpack_exports__CLIPTokenizer=__webpack_exports__.CLIPTokenizer,__webpack_exports__CLIPVisionModelWithProjection=__webpack_exports__.CLIPVisionModelWithProjection,__webpack_exports__CamembertForMaskedLM=__webpack_exports__.CamembertForMaskedLM,__webpack_exports__CamembertForQuestionAnswering=__webpack_exports__.CamembertForQuestionAnswering,__webpack_exports__CamembertForSequenceClassification=__webpack_exports__.CamembertForSequenceClassification,__webpack_exports__CamembertForTokenClassification=__webpack_exports__.CamembertForTokenClassification,__webpack_exports__CamembertModel=__webpack_exports__.CamembertModel,__webpack_exports__CamembertPreTrainedModel=__webpack_exports__.CamembertPreTrainedModel,__webpack_exports__CamembertTokenizer=__webpack_exports__.CamembertTokenizer,__webpack_exports__CausalLMOutput=__webpack_exports__.CausalLMOutput,__webpack_exports__CausalLMOutputWithPast=__webpack_exports__.CausalLMOutputWithPast,__webpack_exports__ChineseCLIPFeatureExtractor=__webpack_exports__.ChineseCLIPFeatureExtractor,__webpack_exports__ChineseCLIPModel=__webpack_exports__.ChineseCLIPModel,__webpack_exports__ChineseCLIPPreTrainedModel=__webpack_exports__.ChineseCLIPPreTrainedModel,__webpack_exports__ClapAudioModelWithProjection=__webpack_exports__.ClapAudioModelWithProjection,__webpack_exports__ClapFeatureExtractor=__webpack_exports__.ClapFeatureExtractor,__webpack_exports__ClapModel=__webpack_exports__.ClapModel,__webpack_exports__ClapPreTrainedModel=__webpack_exports__.ClapPreTrainedModel,__webpack_exports__ClapTextModelWithProjection=__webpack_exports__.ClapTextModelWithProjection,__webpack_exports__CodeGenForCausalLM=__webpack_exports__.CodeGenForCausalLM,__webpack_exports__CodeGenModel=__webpack_exports__.CodeGenModel,__webpack_exports__CodeGenPreTrainedModel=__webpack_exports__.CodeGenPreTrainedModel,__webpack_exports__CodeGenTokenizer=__webpack_exports__.CodeGenTokenizer,__webpack_exports__CodeLlamaTokenizer=__webpack_exports__.CodeLlamaTokenizer,__webpack_exports__CohereTokenizer=__webpack_exports__.CohereTokenizer,__webpack_exports__ConvBertForMaskedLM=__webpack_exports__.ConvBertForMaskedLM,__webpack_exports__ConvBertForQuestionAnswering=__webpack_exports__.ConvBertForQuestionAnswering,__webpack_exports__ConvBertForSequenceClassification=__webpack_exports__.ConvBertForSequenceClassification,__webpack_exports__ConvBertForTokenClassification=__webpack_exports__.ConvBertForTokenClassification,__webpack_exports__ConvBertModel=__webpack_exports__.ConvBertModel,__webpack_exports__ConvBertPreTrainedModel=__webpack_exports__.ConvBertPreTrainedModel,__webpack_exports__ConvBertTokenizer=__webpack_exports__.ConvBertTokenizer,__webpack_exports__ConvNextFeatureExtractor=__webpack_exports__.ConvNextFeatureExtractor,__webpack_exports__ConvNextForImageClassification=__webpack_exports__.ConvNextForImageClassification,__webpack_exports__ConvNextImageProcessor=__webpack_exports__.ConvNextImageProcessor,__webpack_exports__ConvNextModel=__webpack_exports__.ConvNextModel,__webpack_exports__ConvNextPreTrainedModel=__webpack_exports__.ConvNextPreTrainedModel,__webpack_exports__ConvNextV2ForImageClassification=__webpack_exports__.ConvNextV2ForImageClassification,__webpack_exports__ConvNextV2Model=__webpack_exports__.ConvNextV2Model,__webpack_exports__ConvNextV2PreTrainedModel=__webpack_exports__.ConvNextV2PreTrainedModel,__webpack_exports__DPTFeatureExtractor=__webpack_exports__.DPTFeatureExtractor,__webpack_exports__DPTForDepthEstimation=__webpack_exports__.DPTForDepthEstimation,__webpack_exports__DPTImageProcessor=__webpack_exports__.DPTImageProcessor,__webpack_exports__DPTModel=__webpack_exports__.DPTModel,__webpack_exports__DPTPreTrainedModel=__webpack_exports__.DPTPreTrainedModel,__webpack_exports__DebertaForMaskedLM=__webpack_exports__.DebertaForMaskedLM,__webpack_exports__DebertaForQuestionAnswering=__webpack_exports__.DebertaForQuestionAnswering,__webpack_exports__DebertaForSequenceClassification=__webpack_exports__.DebertaForSequenceClassification,__webpack_exports__DebertaForTokenClassification=__webpack_exports__.DebertaForTokenClassification,__webpack_exports__DebertaModel=__webpack_exports__.DebertaModel,__webpack_exports__DebertaPreTrainedModel=__webpack_exports__.DebertaPreTrainedModel,__webpack_exports__DebertaTokenizer=__webpack_exports__.DebertaTokenizer,__webpack_exports__DebertaV2ForMaskedLM=__webpack_exports__.DebertaV2ForMaskedLM,__webpack_exports__DebertaV2ForQuestionAnswering=__webpack_exports__.DebertaV2ForQuestionAnswering,__webpack_exports__DebertaV2ForSequenceClassification=__webpack_exports__.DebertaV2ForSequenceClassification,__webpack_exports__DebertaV2ForTokenClassification=__webpack_exports__.DebertaV2ForTokenClassification,__webpack_exports__DebertaV2Model=__webpack_exports__.DebertaV2Model,__webpack_exports__DebertaV2PreTrainedModel=__webpack_exports__.DebertaV2PreTrainedModel,__webpack_exports__DebertaV2Tokenizer=__webpack_exports__.DebertaV2Tokenizer,__webpack_exports__DeiTFeatureExtractor=__webpack_exports__.DeiTFeatureExtractor,__webpack_exports__DeiTForImageClassification=__webpack_exports__.DeiTForImageClassification,__webpack_exports__DeiTModel=__webpack_exports__.DeiTModel,__webpack_exports__DeiTPreTrainedModel=__webpack_exports__.DeiTPreTrainedModel,__webpack_exports__DepthAnythingForDepthEstimation=__webpack_exports__.DepthAnythingForDepthEstimation,__webpack_exports__DepthAnythingPreTrainedModel=__webpack_exports__.DepthAnythingPreTrainedModel,__webpack_exports__DepthEstimationPipeline=__webpack_exports__.DepthEstimationPipeline,__webpack_exports__DetrFeatureExtractor=__webpack_exports__.DetrFeatureExtractor,__webpack_exports__DetrForObjectDetection=__webpack_exports__.DetrForObjectDetection,__webpack_exports__DetrForSegmentation=__webpack_exports__.DetrForSegmentation,__webpack_exports__DetrModel=__webpack_exports__.DetrModel,__webpack_exports__DetrObjectDetectionOutput=__webpack_exports__.DetrObjectDetectionOutput,__webpack_exports__DetrPreTrainedModel=__webpack_exports__.DetrPreTrainedModel,__webpack_exports__DetrSegmentationOutput=__webpack_exports__.DetrSegmentationOutput,__webpack_exports__Dinov2ForImageClassification=__webpack_exports__.Dinov2ForImageClassification,__webpack_exports__Dinov2Model=__webpack_exports__.Dinov2Model,__webpack_exports__Dinov2PreTrainedModel=__webpack_exports__.Dinov2PreTrainedModel,__webpack_exports__DistilBertForMaskedLM=__webpack_exports__.DistilBertForMaskedLM,__webpack_exports__DistilBertForQuestionAnswering=__webpack_exports__.DistilBertForQuestionAnswering,__webpack_exports__DistilBertForSequenceClassification=__webpack_exports__.DistilBertForSequenceClassification,__webpack_exports__DistilBertForTokenClassification=__webpack_exports__.DistilBertForTokenClassification,__webpack_exports__DistilBertModel=__webpack_exports__.DistilBertModel,__webpack_exports__DistilBertPreTrainedModel=__webpack_exports__.DistilBertPreTrainedModel,__webpack_exports__DistilBertTokenizer=__webpack_exports__.DistilBertTokenizer,__webpack_exports__DocumentQuestionAnsweringPipeline=__webpack_exports__.DocumentQuestionAnsweringPipeline,__webpack_exports__DonutFeatureExtractor=__webpack_exports__.DonutFeatureExtractor,__webpack_exports__DonutSwinModel=__webpack_exports__.DonutSwinModel,__webpack_exports__DonutSwinPreTrainedModel=__webpack_exports__.DonutSwinPreTrainedModel,__webpack_exports__EfficientNetForImageClassification=__webpack_exports__.EfficientNetForImageClassification,__webpack_exports__EfficientNetImageProcessor=__webpack_exports__.EfficientNetImageProcessor,__webpack_exports__EfficientNetModel=__webpack_exports__.EfficientNetModel,__webpack_exports__EfficientNetPreTrainedModel=__webpack_exports__.EfficientNetPreTrainedModel,__webpack_exports__ElectraForMaskedLM=__webpack_exports__.ElectraForMaskedLM,__webpack_exports__ElectraForQuestionAnswering=__webpack_exports__.ElectraForQuestionAnswering,__webpack_exports__ElectraForSequenceClassification=__webpack_exports__.ElectraForSequenceClassification,__webpack_exports__ElectraForTokenClassification=__webpack_exports__.ElectraForTokenClassification,__webpack_exports__ElectraModel=__webpack_exports__.ElectraModel,__webpack_exports__ElectraPreTrainedModel=__webpack_exports__.ElectraPreTrainedModel,__webpack_exports__ElectraTokenizer=__webpack_exports__.ElectraTokenizer,__webpack_exports__EsmForMaskedLM=__webpack_exports__.EsmForMaskedLM,__webpack_exports__EsmForSequenceClassification=__webpack_exports__.EsmForSequenceClassification,__webpack_exports__EsmForTokenClassification=__webpack_exports__.EsmForTokenClassification,__webpack_exports__EsmModel=__webpack_exports__.EsmModel,__webpack_exports__EsmPreTrainedModel=__webpack_exports__.EsmPreTrainedModel,__webpack_exports__EsmTokenizer=__webpack_exports__.EsmTokenizer,__webpack_exports__FFT=__webpack_exports__.FFT,__webpack_exports__FalconForCausalLM=__webpack_exports__.FalconForCausalLM,__webpack_exports__FalconModel=__webpack_exports__.FalconModel,__webpack_exports__FalconPreTrainedModel=__webpack_exports__.FalconPreTrainedModel,__webpack_exports__FalconTokenizer=__webpack_exports__.FalconTokenizer,__webpack_exports__FeatureExtractionPipeline=__webpack_exports__.FeatureExtractionPipeline,__webpack_exports__FeatureExtractor=__webpack_exports__.FeatureExtractor,__webpack_exports__FillMaskPipeline=__webpack_exports__.FillMaskPipeline,__webpack_exports__GLPNFeatureExtractor=__webpack_exports__.GLPNFeatureExtractor,__webpack_exports__GLPNForDepthEstimation=__webpack_exports__.GLPNForDepthEstimation,__webpack_exports__GLPNModel=__webpack_exports__.GLPNModel,__webpack_exports__GLPNPreTrainedModel=__webpack_exports__.GLPNPreTrainedModel,__webpack_exports__GPT2LMHeadModel=__webpack_exports__.GPT2LMHeadModel,__webpack_exports__GPT2Model=__webpack_exports__.GPT2Model,__webpack_exports__GPT2PreTrainedModel=__webpack_exports__.GPT2PreTrainedModel,__webpack_exports__GPT2Tokenizer=__webpack_exports__.GPT2Tokenizer,__webpack_exports__GPTBigCodeForCausalLM=__webpack_exports__.GPTBigCodeForCausalLM,__webpack_exports__GPTBigCodeModel=__webpack_exports__.GPTBigCodeModel,__webpack_exports__GPTBigCodePreTrainedModel=__webpack_exports__.GPTBigCodePreTrainedModel,__webpack_exports__GPTJForCausalLM=__webpack_exports__.GPTJForCausalLM,__webpack_exports__GPTJModel=__webpack_exports__.GPTJModel,__webpack_exports__GPTJPreTrainedModel=__webpack_exports__.GPTJPreTrainedModel,__webpack_exports__GPTNeoForCausalLM=__webpack_exports__.GPTNeoForCausalLM,__webpack_exports__GPTNeoModel=__webpack_exports__.GPTNeoModel,__webpack_exports__GPTNeoPreTrainedModel=__webpack_exports__.GPTNeoPreTrainedModel,__webpack_exports__GPTNeoXForCausalLM=__webpack_exports__.GPTNeoXForCausalLM,__webpack_exports__GPTNeoXModel=__webpack_exports__.GPTNeoXModel,__webpack_exports__GPTNeoXPreTrainedModel=__webpack_exports__.GPTNeoXPreTrainedModel,__webpack_exports__GPTNeoXTokenizer=__webpack_exports__.GPTNeoXTokenizer,__webpack_exports__GemmaTokenizer=__webpack_exports__.GemmaTokenizer,__webpack_exports__Grok1Tokenizer=__webpack_exports__.Grok1Tokenizer,__webpack_exports__HerbertTokenizer=__webpack_exports__.HerbertTokenizer,__webpack_exports__HubertForCTC=__webpack_exports__.HubertForCTC,__webpack_exports__HubertForSequenceClassification=__webpack_exports__.HubertForSequenceClassification,__webpack_exports__HubertModel=__webpack_exports__.HubertModel,__webpack_exports__HubertPreTrainedModel=__webpack_exports__.HubertPreTrainedModel,__webpack_exports__ImageClassificationPipeline=__webpack_exports__.ImageClassificationPipeline,__webpack_exports__ImageFeatureExtractionPipeline=__webpack_exports__.ImageFeatureExtractionPipeline,__webpack_exports__ImageFeatureExtractor=__webpack_exports__.ImageFeatureExtractor,__webpack_exports__ImageMattingOutput=__webpack_exports__.ImageMattingOutput,__webpack_exports__ImageSegmentationPipeline=__webpack_exports__.ImageSegmentationPipeline,__webpack_exports__ImageToImagePipeline=__webpack_exports__.ImageToImagePipeline,__webpack_exports__ImageToTextPipeline=__webpack_exports__.ImageToTextPipeline,__webpack_exports__LlamaForCausalLM=__webpack_exports__.LlamaForCausalLM,__webpack_exports__LlamaModel=__webpack_exports__.LlamaModel,__webpack_exports__LlamaPreTrainedModel=__webpack_exports__.LlamaPreTrainedModel,__webpack_exports__LlamaTokenizer=__webpack_exports__.LlamaTokenizer,__webpack_exports__LongT5ForConditionalGeneration=__webpack_exports__.LongT5ForConditionalGeneration,__webpack_exports__LongT5Model=__webpack_exports__.LongT5Model,__webpack_exports__LongT5PreTrainedModel=__webpack_exports__.LongT5PreTrainedModel,__webpack_exports__M2M100ForConditionalGeneration=__webpack_exports__.M2M100ForConditionalGeneration,__webpack_exports__M2M100Model=__webpack_exports__.M2M100Model,__webpack_exports__M2M100PreTrainedModel=__webpack_exports__.M2M100PreTrainedModel,__webpack_exports__M2M100Tokenizer=__webpack_exports__.M2M100Tokenizer,__webpack_exports__MBart50Tokenizer=__webpack_exports__.MBart50Tokenizer,__webpack_exports__MBartForCausalLM=__webpack_exports__.MBartForCausalLM,__webpack_exports__MBartForConditionalGeneration=__webpack_exports__.MBartForConditionalGeneration,__webpack_exports__MBartForSequenceClassification=__webpack_exports__.MBartForSequenceClassification,__webpack_exports__MBartModel=__webpack_exports__.MBartModel,__webpack_exports__MBartPreTrainedModel=__webpack_exports__.MBartPreTrainedModel,__webpack_exports__MBartTokenizer=__webpack_exports__.MBartTokenizer,__webpack_exports__MPNetForMaskedLM=__webpack_exports__.MPNetForMaskedLM,__webpack_exports__MPNetForQuestionAnswering=__webpack_exports__.MPNetForQuestionAnswering,__webpack_exports__MPNetForSequenceClassification=__webpack_exports__.MPNetForSequenceClassification,__webpack_exports__MPNetForTokenClassification=__webpack_exports__.MPNetForTokenClassification,__webpack_exports__MPNetModel=__webpack_exports__.MPNetModel,__webpack_exports__MPNetPreTrainedModel=__webpack_exports__.MPNetPreTrainedModel,__webpack_exports__MPNetTokenizer=__webpack_exports__.MPNetTokenizer,__webpack_exports__MT5ForConditionalGeneration=__webpack_exports__.MT5ForConditionalGeneration,__webpack_exports__MT5Model=__webpack_exports__.MT5Model,__webpack_exports__MT5PreTrainedModel=__webpack_exports__.MT5PreTrainedModel,__webpack_exports__MarianMTModel=__webpack_exports__.MarianMTModel,__webpack_exports__MarianModel=__webpack_exports__.MarianModel,__webpack_exports__MarianPreTrainedModel=__webpack_exports__.MarianPreTrainedModel,__webpack_exports__MarianTokenizer=__webpack_exports__.MarianTokenizer,__webpack_exports__MaskedLMOutput=__webpack_exports__.MaskedLMOutput,__webpack_exports__MistralForCausalLM=__webpack_exports__.MistralForCausalLM,__webpack_exports__MistralModel=__webpack_exports__.MistralModel,__webpack_exports__MistralPreTrainedModel=__webpack_exports__.MistralPreTrainedModel,__webpack_exports__MobileBertForMaskedLM=__webpack_exports__.MobileBertForMaskedLM,__webpack_exports__MobileBertForQuestionAnswering=__webpack_exports__.MobileBertForQuestionAnswering,__webpack_exports__MobileBertForSequenceClassification=__webpack_exports__.MobileBertForSequenceClassification,__webpack_exports__MobileBertModel=__webpack_exports__.MobileBertModel,__webpack_exports__MobileBertPreTrainedModel=__webpack_exports__.MobileBertPreTrainedModel,__webpack_exports__MobileBertTokenizer=__webpack_exports__.MobileBertTokenizer,__webpack_exports__MobileViTFeatureExtractor=__webpack_exports__.MobileViTFeatureExtractor,__webpack_exports__MobileViTForImageClassification=__webpack_exports__.MobileViTForImageClassification,__webpack_exports__MobileViTModel=__webpack_exports__.MobileViTModel,__webpack_exports__MobileViTPreTrainedModel=__webpack_exports__.MobileViTPreTrainedModel,__webpack_exports__ModelOutput=__webpack_exports__.ModelOutput,__webpack_exports__MptForCausalLM=__webpack_exports__.MptForCausalLM,__webpack_exports__MptModel=__webpack_exports__.MptModel,__webpack_exports__MptPreTrainedModel=__webpack_exports__.MptPreTrainedModel,__webpack_exports__NllbTokenizer=__webpack_exports__.NllbTokenizer,__webpack_exports__NomicBertModel=__webpack_exports__.NomicBertModel,__webpack_exports__NomicBertPreTrainedModel=__webpack_exports__.NomicBertPreTrainedModel,__webpack_exports__NougatImageProcessor=__webpack_exports__.NougatImageProcessor,__webpack_exports__NougatTokenizer=__webpack_exports__.NougatTokenizer,__webpack_exports__OPTForCausalLM=__webpack_exports__.OPTForCausalLM,__webpack_exports__OPTModel=__webpack_exports__.OPTModel,__webpack_exports__OPTPreTrainedModel=__webpack_exports__.OPTPreTrainedModel,__webpack_exports__ObjectDetectionPipeline=__webpack_exports__.ObjectDetectionPipeline,__webpack_exports__OwlViTFeatureExtractor=__webpack_exports__.OwlViTFeatureExtractor,__webpack_exports__OwlViTForObjectDetection=__webpack_exports__.OwlViTForObjectDetection,__webpack_exports__OwlViTModel=__webpack_exports__.OwlViTModel,__webpack_exports__OwlViTPreTrainedModel=__webpack_exports__.OwlViTPreTrainedModel,__webpack_exports__OwlViTProcessor=__webpack_exports__.OwlViTProcessor,__webpack_exports__Owlv2ForObjectDetection=__webpack_exports__.Owlv2ForObjectDetection,__webpack_exports__Owlv2ImageProcessor=__webpack_exports__.Owlv2ImageProcessor,__webpack_exports__Owlv2Model=__webpack_exports__.Owlv2Model,__webpack_exports__Owlv2PreTrainedModel=__webpack_exports__.Owlv2PreTrainedModel,__webpack_exports__PhiForCausalLM=__webpack_exports__.PhiForCausalLM,__webpack_exports__PhiModel=__webpack_exports__.PhiModel,__webpack_exports__PhiPreTrainedModel=__webpack_exports__.PhiPreTrainedModel,__webpack_exports__Pipeline=__webpack_exports__.Pipeline,__webpack_exports__PreTrainedModel=__webpack_exports__.PreTrainedModel,__webpack_exports__PreTrainedTokenizer=__webpack_exports__.PreTrainedTokenizer,__webpack_exports__PretrainedConfig=__webpack_exports__.PretrainedConfig,__webpack_exports__PretrainedMixin=__webpack_exports__.PretrainedMixin,__webpack_exports__Processor=__webpack_exports__.Processor,__webpack_exports__QuestionAnsweringModelOutput=__webpack_exports__.QuestionAnsweringModelOutput,__webpack_exports__QuestionAnsweringPipeline=__webpack_exports__.QuestionAnsweringPipeline,__webpack_exports__Qwen2ForCausalLM=__webpack_exports__.Qwen2ForCausalLM,__webpack_exports__Qwen2Model=__webpack_exports__.Qwen2Model,__webpack_exports__Qwen2PreTrainedModel=__webpack_exports__.Qwen2PreTrainedModel,__webpack_exports__Qwen2Tokenizer=__webpack_exports__.Qwen2Tokenizer,__webpack_exports__RawImage=__webpack_exports__.RawImage,__webpack_exports__ResNetForImageClassification=__webpack_exports__.ResNetForImageClassification,__webpack_exports__ResNetModel=__webpack_exports__.ResNetModel,__webpack_exports__ResNetPreTrainedModel=__webpack_exports__.ResNetPreTrainedModel,__webpack_exports__RoFormerForMaskedLM=__webpack_exports__.RoFormerForMaskedLM,__webpack_exports__RoFormerForQuestionAnswering=__webpack_exports__.RoFormerForQuestionAnswering,__webpack_exports__RoFormerForSequenceClassification=__webpack_exports__.RoFormerForSequenceClassification,__webpack_exports__RoFormerForTokenClassification=__webpack_exports__.RoFormerForTokenClassification,__webpack_exports__RoFormerModel=__webpack_exports__.RoFormerModel,__webpack_exports__RoFormerPreTrainedModel=__webpack_exports__.RoFormerPreTrainedModel,__webpack_exports__RoFormerTokenizer=__webpack_exports__.RoFormerTokenizer,__webpack_exports__RobertaForMaskedLM=__webpack_exports__.RobertaForMaskedLM,__webpack_exports__RobertaForQuestionAnswering=__webpack_exports__.RobertaForQuestionAnswering,__webpack_exports__RobertaForSequenceClassification=__webpack_exports__.RobertaForSequenceClassification,__webpack_exports__RobertaForTokenClassification=__webpack_exports__.RobertaForTokenClassification,__webpack_exports__RobertaModel=__webpack_exports__.RobertaModel,__webpack_exports__RobertaPreTrainedModel=__webpack_exports__.RobertaPreTrainedModel,__webpack_exports__RobertaTokenizer=__webpack_exports__.RobertaTokenizer,__webpack_exports__SamImageProcessor=__webpack_exports__.SamImageProcessor,__webpack_exports__SamImageSegmentationOutput=__webpack_exports__.SamImageSegmentationOutput,__webpack_exports__SamModel=__webpack_exports__.SamModel,__webpack_exports__SamPreTrainedModel=__webpack_exports__.SamPreTrainedModel,__webpack_exports__SamProcessor=__webpack_exports__.SamProcessor,__webpack_exports__SeamlessM4TFeatureExtractor=__webpack_exports__.SeamlessM4TFeatureExtractor,__webpack_exports__SegformerFeatureExtractor=__webpack_exports__.SegformerFeatureExtractor,__webpack_exports__SegformerForImageClassification=__webpack_exports__.SegformerForImageClassification,__webpack_exports__SegformerForSemanticSegmentation=__webpack_exports__.SegformerForSemanticSegmentation,__webpack_exports__SegformerModel=__webpack_exports__.SegformerModel,__webpack_exports__SegformerPreTrainedModel=__webpack_exports__.SegformerPreTrainedModel,__webpack_exports__Seq2SeqLMOutput=__webpack_exports__.Seq2SeqLMOutput,__webpack_exports__SequenceClassifierOutput=__webpack_exports__.SequenceClassifierOutput,__webpack_exports__SiglipImageProcessor=__webpack_exports__.SiglipImageProcessor,__webpack_exports__SiglipModel=__webpack_exports__.SiglipModel,__webpack_exports__SiglipPreTrainedModel=__webpack_exports__.SiglipPreTrainedModel,__webpack_exports__SiglipTextModel=__webpack_exports__.SiglipTextModel,__webpack_exports__SiglipTokenizer=__webpack_exports__.SiglipTokenizer,__webpack_exports__SiglipVisionModel=__webpack_exports__.SiglipVisionModel,__webpack_exports__SpeechT5FeatureExtractor=__webpack_exports__.SpeechT5FeatureExtractor,__webpack_exports__SpeechT5ForSpeechToText=__webpack_exports__.SpeechT5ForSpeechToText,__webpack_exports__SpeechT5ForTextToSpeech=__webpack_exports__.SpeechT5ForTextToSpeech,__webpack_exports__SpeechT5HifiGan=__webpack_exports__.SpeechT5HifiGan,__webpack_exports__SpeechT5Model=__webpack_exports__.SpeechT5Model,__webpack_exports__SpeechT5PreTrainedModel=__webpack_exports__.SpeechT5PreTrainedModel,__webpack_exports__SpeechT5Processor=__webpack_exports__.SpeechT5Processor,__webpack_exports__SpeechT5Tokenizer=__webpack_exports__.SpeechT5Tokenizer,__webpack_exports__SqueezeBertForMaskedLM=__webpack_exports__.SqueezeBertForMaskedLM,__webpack_exports__SqueezeBertForQuestionAnswering=__webpack_exports__.SqueezeBertForQuestionAnswering,__webpack_exports__SqueezeBertForSequenceClassification=__webpack_exports__.SqueezeBertForSequenceClassification,__webpack_exports__SqueezeBertModel=__webpack_exports__.SqueezeBertModel,__webpack_exports__SqueezeBertPreTrainedModel=__webpack_exports__.SqueezeBertPreTrainedModel,__webpack_exports__SqueezeBertTokenizer=__webpack_exports__.SqueezeBertTokenizer,__webpack_exports__StableLmForCausalLM=__webpack_exports__.StableLmForCausalLM,__webpack_exports__StableLmModel=__webpack_exports__.StableLmModel,__webpack_exports__StableLmPreTrainedModel=__webpack_exports__.StableLmPreTrainedModel,__webpack_exports__Starcoder2ForCausalLM=__webpack_exports__.Starcoder2ForCausalLM,__webpack_exports__Starcoder2Model=__webpack_exports__.Starcoder2Model,__webpack_exports__Starcoder2PreTrainedModel=__webpack_exports__.Starcoder2PreTrainedModel,__webpack_exports__SummarizationPipeline=__webpack_exports__.SummarizationPipeline,__webpack_exports__Swin2SRForImageSuperResolution=__webpack_exports__.Swin2SRForImageSuperResolution,__webpack_exports__Swin2SRImageProcessor=__webpack_exports__.Swin2SRImageProcessor,__webpack_exports__Swin2SRModel=__webpack_exports__.Swin2SRModel,__webpack_exports__Swin2SRPreTrainedModel=__webpack_exports__.Swin2SRPreTrainedModel,__webpack_exports__SwinForImageClassification=__webpack_exports__.SwinForImageClassification,__webpack_exports__SwinModel=__webpack_exports__.SwinModel,__webpack_exports__SwinPreTrainedModel=__webpack_exports__.SwinPreTrainedModel,__webpack_exports__T5ForConditionalGeneration=__webpack_exports__.T5ForConditionalGeneration,__webpack_exports__T5Model=__webpack_exports__.T5Model,__webpack_exports__T5PreTrainedModel=__webpack_exports__.T5PreTrainedModel,__webpack_exports__T5Tokenizer=__webpack_exports__.T5Tokenizer,__webpack_exports__TableTransformerForObjectDetection=__webpack_exports__.TableTransformerForObjectDetection,__webpack_exports__TableTransformerModel=__webpack_exports__.TableTransformerModel,__webpack_exports__TableTransformerObjectDetectionOutput=__webpack_exports__.TableTransformerObjectDetectionOutput,__webpack_exports__TableTransformerPreTrainedModel=__webpack_exports__.TableTransformerPreTrainedModel,__webpack_exports__Tensor=__webpack_exports__.Tensor,__webpack_exports__Text2TextGenerationPipeline=__webpack_exports__.Text2TextGenerationPipeline,__webpack_exports__TextClassificationPipeline=__webpack_exports__.TextClassificationPipeline,__webpack_exports__TextGenerationPipeline=__webpack_exports__.TextGenerationPipeline,__webpack_exports__TextToAudioPipeline=__webpack_exports__.TextToAudioPipeline,__webpack_exports__TokenClassificationPipeline=__webpack_exports__.TokenClassificationPipeline,__webpack_exports__TokenClassifierOutput=__webpack_exports__.TokenClassifierOutput,__webpack_exports__TokenizerModel=__webpack_exports__.TokenizerModel,__webpack_exports__TrOCRForCausalLM=__webpack_exports__.TrOCRForCausalLM,__webpack_exports__TrOCRPreTrainedModel=__webpack_exports__.TrOCRPreTrainedModel,__webpack_exports__TranslationPipeline=__webpack_exports__.TranslationPipeline,__webpack_exports__UniSpeechForCTC=__webpack_exports__.UniSpeechForCTC,__webpack_exports__UniSpeechForSequenceClassification=__webpack_exports__.UniSpeechForSequenceClassification,__webpack_exports__UniSpeechModel=__webpack_exports__.UniSpeechModel,__webpack_exports__UniSpeechPreTrainedModel=__webpack_exports__.UniSpeechPreTrainedModel,__webpack_exports__UniSpeechSatForAudioFrameClassification=__webpack_exports__.UniSpeechSatForAudioFrameClassification,__webpack_exports__UniSpeechSatForCTC=__webpack_exports__.UniSpeechSatForCTC,__webpack_exports__UniSpeechSatForSequenceClassification=__webpack_exports__.UniSpeechSatForSequenceClassification,__webpack_exports__UniSpeechSatModel=__webpack_exports__.UniSpeechSatModel,__webpack_exports__UniSpeechSatPreTrainedModel=__webpack_exports__.UniSpeechSatPreTrainedModel,__webpack_exports__ViTFeatureExtractor=__webpack_exports__.ViTFeatureExtractor,__webpack_exports__ViTForImageClassification=__webpack_exports__.ViTForImageClassification,__webpack_exports__ViTImageProcessor=__webpack_exports__.ViTImageProcessor,__webpack_exports__ViTModel=__webpack_exports__.ViTModel,__webpack_exports__ViTPreTrainedModel=__webpack_exports__.ViTPreTrainedModel,__webpack_exports__VisionEncoderDecoderModel=__webpack_exports__.VisionEncoderDecoderModel,__webpack_exports__VitMatteForImageMatting=__webpack_exports__.VitMatteForImageMatting,__webpack_exports__VitMatteImageProcessor=__webpack_exports__.VitMatteImageProcessor,__webpack_exports__VitMattePreTrainedModel=__webpack_exports__.VitMattePreTrainedModel,__webpack_exports__VitsModel=__webpack_exports__.VitsModel,__webpack_exports__VitsModelOutput=__webpack_exports__.VitsModelOutput,__webpack_exports__VitsPreTrainedModel=__webpack_exports__.VitsPreTrainedModel,__webpack_exports__VitsTokenizer=__webpack_exports__.VitsTokenizer,__webpack_exports__Wav2Vec2BertForCTC=__webpack_exports__.Wav2Vec2BertForCTC,__webpack_exports__Wav2Vec2BertForSequenceClassification=__webpack_exports__.Wav2Vec2BertForSequenceClassification,__webpack_exports__Wav2Vec2BertModel=__webpack_exports__.Wav2Vec2BertModel,__webpack_exports__Wav2Vec2BertPreTrainedModel=__webpack_exports__.Wav2Vec2BertPreTrainedModel,__webpack_exports__Wav2Vec2CTCTokenizer=__webpack_exports__.Wav2Vec2CTCTokenizer,__webpack_exports__Wav2Vec2FeatureExtractor=__webpack_exports__.Wav2Vec2FeatureExtractor,__webpack_exports__Wav2Vec2ForAudioFrameClassification=__webpack_exports__.Wav2Vec2ForAudioFrameClassification,__webpack_exports__Wav2Vec2ForCTC=__webpack_exports__.Wav2Vec2ForCTC,__webpack_exports__Wav2Vec2ForSequenceClassification=__webpack_exports__.Wav2Vec2ForSequenceClassification,__webpack_exports__Wav2Vec2Model=__webpack_exports__.Wav2Vec2Model,__webpack_exports__Wav2Vec2PreTrainedModel=__webpack_exports__.Wav2Vec2PreTrainedModel,__webpack_exports__Wav2Vec2ProcessorWithLM=__webpack_exports__.Wav2Vec2ProcessorWithLM,__webpack_exports__WavLMForAudioFrameClassification=__webpack_exports__.WavLMForAudioFrameClassification,__webpack_exports__WavLMForCTC=__webpack_exports__.WavLMForCTC,__webpack_exports__WavLMForSequenceClassification=__webpack_exports__.WavLMForSequenceClassification,__webpack_exports__WavLMForXVector=__webpack_exports__.WavLMForXVector,__webpack_exports__WavLMModel=__webpack_exports__.WavLMModel,__webpack_exports__WavLMPreTrainedModel=__webpack_exports__.WavLMPreTrainedModel,__webpack_exports__WhisperFeatureExtractor=__webpack_exports__.WhisperFeatureExtractor,__webpack_exports__WhisperForConditionalGeneration=__webpack_exports__.WhisperForConditionalGeneration,__webpack_exports__WhisperModel=__webpack_exports__.WhisperModel,__webpack_exports__WhisperPreTrainedModel=__webpack_exports__.WhisperPreTrainedModel,__webpack_exports__WhisperProcessor=__webpack_exports__.WhisperProcessor,__webpack_exports__WhisperTokenizer=__webpack_exports__.WhisperTokenizer,__webpack_exports__XLMForQuestionAnswering=__webpack_exports__.XLMForQuestionAnswering,__webpack_exports__XLMForSequenceClassification=__webpack_exports__.XLMForSequenceClassification,__webpack_exports__XLMForTokenClassification=__webpack_exports__.XLMForTokenClassification,__webpack_exports__XLMModel=__webpack_exports__.XLMModel,__webpack_exports__XLMPreTrainedModel=__webpack_exports__.XLMPreTrainedModel,__webpack_exports__XLMRobertaForMaskedLM=__webpack_exports__.XLMRobertaForMaskedLM,__webpack_exports__XLMRobertaForQuestionAnswering=__webpack_exports__.XLMRobertaForQuestionAnswering,__webpack_exports__XLMRobertaForSequenceClassification=__webpack_exports__.XLMRobertaForSequenceClassification,__webpack_exports__XLMRobertaForTokenClassification=__webpack_exports__.XLMRobertaForTokenClassification,__webpack_exports__XLMRobertaModel=__webpack_exports__.XLMRobertaModel,__webpack_exports__XLMRobertaPreTrainedModel=__webpack_exports__.XLMRobertaPreTrainedModel,__webpack_exports__XLMRobertaTokenizer=__webpack_exports__.XLMRobertaTokenizer,__webpack_exports__XLMTokenizer=__webpack_exports__.XLMTokenizer,__webpack_exports__XLMWithLMHeadModel=__webpack_exports__.XLMWithLMHeadModel,__webpack_exports__XVectorOutput=__webpack_exports__.XVectorOutput,__webpack_exports__YolosFeatureExtractor=__webpack_exports__.YolosFeatureExtractor,__webpack_exports__YolosForObjectDetection=__webpack_exports__.YolosForObjectDetection,__webpack_exports__YolosModel=__webpack_exports__.YolosModel,__webpack_exports__YolosObjectDetectionOutput=__webpack_exports__.YolosObjectDetectionOutput,__webpack_exports__YolosPreTrainedModel=__webpack_exports__.YolosPreTrainedModel,__webpack_exports__ZeroShotAudioClassificationPipeline=__webpack_exports__.ZeroShotAudioClassificationPipeline,__webpack_exports__ZeroShotClassificationPipeline=__webpack_exports__.ZeroShotClassificationPipeline,__webpack_exports__ZeroShotImageClassificationPipeline=__webpack_exports__.ZeroShotImageClassificationPipeline,__webpack_exports__ZeroShotObjectDetectionPipeline=__webpack_exports__.ZeroShotObjectDetectionPipeline,__webpack_exports__bankers_round=__webpack_exports__.bankers_round,__webpack_exports__cat=__webpack_exports__.cat,__webpack_exports__cos_sim=__webpack_exports__.cos_sim,__webpack_exports__dot=__webpack_exports__.dot,__webpack_exports__dynamicTimeWarping=__webpack_exports__.dynamicTimeWarping,__webpack_exports__env=__webpack_exports__.env,__webpack_exports__getTopItems=__webpack_exports__.getTopItems,__webpack_exports__hanning=__webpack_exports__.hanning,__webpack_exports__interpolate=__webpack_exports__.interpolate,__webpack_exports__interpolate_data=__webpack_exports__.interpolate_data,__webpack_exports__layer_norm=__webpack_exports__.layer_norm,__webpack_exports__log_softmax=__webpack_exports__.log_softmax,__webpack_exports__magnitude=__webpack_exports__.magnitude,__webpack_exports__max=__webpack_exports__.max,__webpack_exports__mean=__webpack_exports__.mean,__webpack_exports__mean_pooling=__webpack_exports__.mean_pooling,__webpack_exports__medianFilter=__webpack_exports__.medianFilter,__webpack_exports__mel_filter_bank=__webpack_exports__.mel_filter_bank,__webpack_exports__min=__webpack_exports__.min,__webpack_exports__ones=__webpack_exports__.ones,__webpack_exports__ones_like=__webpack_exports__.ones_like,__webpack_exports__permute=__webpack_exports__.permute,__webpack_exports__permute_data=__webpack_exports__.permute_data,__webpack_exports__pipeline=__webpack_exports__.pipeline,__webpack_exports__quantize_embeddings=__webpack_exports__.quantize_embeddings,__webpack_exports__read_audio=__webpack_exports__.read_audio,__webpack_exports__round=__webpack_exports__.round,__webpack_exports__softmax=__webpack_exports__.softmax,__webpack_exports__spectrogram=__webpack_exports__.spectrogram,__webpack_exports__stack=__webpack_exports__.stack,__webpack_exports__std_mean=__webpack_exports__.std_mean,__webpack_exports__window_function=__webpack_exports__.window_function;export{__webpack_exports__ASTFeatureExtractor as ASTFeatureExtractor,__webpack_exports__ASTForAudioClassification as ASTForAudioClassification,__webpack_exports__ASTModel as ASTModel,__webpack_exports__ASTPreTrainedModel as ASTPreTrainedModel,__webpack_exports__AlbertForMaskedLM as AlbertForMaskedLM,__webpack_exports__AlbertForQuestionAnswering as AlbertForQuestionAnswering,__webpack_exports__AlbertForSequenceClassification as AlbertForSequenceClassification,__webpack_exports__AlbertModel as AlbertModel,__webpack_exports__AlbertPreTrainedModel as AlbertPreTrainedModel,__webpack_exports__AlbertTokenizer as AlbertTokenizer,__webpack_exports__AudioClassificationPipeline as AudioClassificationPipeline,__webpack_exports__AutoConfig as AutoConfig,__webpack_exports__AutoModel as AutoModel,__webpack_exports__AutoModelForAudioClassification as AutoModelForAudioClassification,__webpack_exports__AutoModelForAudioFrameClassification as AutoModelForAudioFrameClassification,__webpack_exports__AutoModelForCTC as AutoModelForCTC,__webpack_exports__AutoModelForCausalLM as AutoModelForCausalLM,__webpack_exports__AutoModelForDepthEstimation as AutoModelForDepthEstimation,__webpack_exports__AutoModelForDocumentQuestionAnswering as AutoModelForDocumentQuestionAnswering,__webpack_exports__AutoModelForImageClassification as AutoModelForImageClassification,__webpack_exports__AutoModelForImageFeatureExtraction as AutoModelForImageFeatureExtraction,__webpack_exports__AutoModelForImageMatting as AutoModelForImageMatting,__webpack_exports__AutoModelForImageSegmentation as AutoModelForImageSegmentation,__webpack_exports__AutoModelForImageToImage as AutoModelForImageToImage,__webpack_exports__AutoModelForMaskGeneration as AutoModelForMaskGeneration,__webpack_exports__AutoModelForMaskedLM as AutoModelForMaskedLM,__webpack_exports__AutoModelForObjectDetection as AutoModelForObjectDetection,__webpack_exports__AutoModelForQuestionAnswering as AutoModelForQuestionAnswering,__webpack_exports__AutoModelForSemanticSegmentation as AutoModelForSemanticSegmentation,__webpack_exports__AutoModelForSeq2SeqLM as AutoModelForSeq2SeqLM,__webpack_exports__AutoModelForSequenceClassification as AutoModelForSequenceClassification,__webpack_exports__AutoModelForSpeechSeq2Seq as AutoModelForSpeechSeq2Seq,__webpack_exports__AutoModelForTextToSpectrogram as AutoModelForTextToSpectrogram,__webpack_exports__AutoModelForTextToWaveform as AutoModelForTextToWaveform,__webpack_exports__AutoModelForTokenClassification as AutoModelForTokenClassification,__webpack_exports__AutoModelForVision2Seq as AutoModelForVision2Seq,__webpack_exports__AutoModelForXVector as AutoModelForXVector,__webpack_exports__AutoModelForZeroShotObjectDetection as AutoModelForZeroShotObjectDetection,__webpack_exports__AutoProcessor as AutoProcessor,__webpack_exports__AutoTokenizer as AutoTokenizer,__webpack_exports__AutomaticSpeechRecognitionPipeline as AutomaticSpeechRecognitionPipeline,__webpack_exports__BartForConditionalGeneration as BartForConditionalGeneration,__webpack_exports__BartForSequenceClassification as BartForSequenceClassification,__webpack_exports__BartModel as BartModel,__webpack_exports__BartPretrainedModel as BartPretrainedModel,__webpack_exports__BartTokenizer as BartTokenizer,__webpack_exports__BaseModelOutput as BaseModelOutput,__webpack_exports__BeitFeatureExtractor as BeitFeatureExtractor,__webpack_exports__BeitForImageClassification as BeitForImageClassification,__webpack_exports__BeitModel as BeitModel,__webpack_exports__BeitPreTrainedModel as BeitPreTrainedModel,__webpack_exports__BertForMaskedLM as BertForMaskedLM,__webpack_exports__BertForQuestionAnswering as BertForQuestionAnswering,__webpack_exports__BertForSequenceClassification as BertForSequenceClassification,__webpack_exports__BertForTokenClassification as BertForTokenClassification,__webpack_exports__BertModel as BertModel,__webpack_exports__BertPreTrainedModel as BertPreTrainedModel,__webpack_exports__BertTokenizer as BertTokenizer,__webpack_exports__BitImageProcessor as BitImageProcessor,__webpack_exports__BlenderbotForConditionalGeneration as BlenderbotForConditionalGeneration,__webpack_exports__BlenderbotModel as BlenderbotModel,__webpack_exports__BlenderbotPreTrainedModel as BlenderbotPreTrainedModel,__webpack_exports__BlenderbotSmallForConditionalGeneration as BlenderbotSmallForConditionalGeneration,__webpack_exports__BlenderbotSmallModel as BlenderbotSmallModel,__webpack_exports__BlenderbotSmallPreTrainedModel as BlenderbotSmallPreTrainedModel,__webpack_exports__BlenderbotSmallTokenizer as BlenderbotSmallTokenizer,__webpack_exports__BlenderbotTokenizer as BlenderbotTokenizer,__webpack_exports__BloomForCausalLM as BloomForCausalLM,__webpack_exports__BloomModel as BloomModel,__webpack_exports__BloomPreTrainedModel as BloomPreTrainedModel,__webpack_exports__BloomTokenizer as BloomTokenizer,__webpack_exports__CLIPFeatureExtractor as CLIPFeatureExtractor,__webpack_exports__CLIPModel as CLIPModel,__webpack_exports__CLIPPreTrainedModel as CLIPPreTrainedModel,__webpack_exports__CLIPSegForImageSegmentation as CLIPSegForImageSegmentation,__webpack_exports__CLIPSegModel as CLIPSegModel,__webpack_exports__CLIPSegPreTrainedModel as CLIPSegPreTrainedModel,__webpack_exports__CLIPTextModelWithProjection as CLIPTextModelWithProjection,__webpack_exports__CLIPTokenizer as CLIPTokenizer,__webpack_exports__CLIPVisionModelWithProjection as CLIPVisionModelWithProjection,__webpack_exports__CamembertForMaskedLM as CamembertForMaskedLM,__webpack_exports__CamembertForQuestionAnswering as CamembertForQuestionAnswering,__webpack_exports__CamembertForSequenceClassification as CamembertForSequenceClassification,__webpack_exports__CamembertForTokenClassification as CamembertForTokenClassification,__webpack_exports__CamembertModel as CamembertModel,__webpack_exports__CamembertPreTrainedModel as CamembertPreTrainedModel,__webpack_exports__CamembertTokenizer as CamembertTokenizer,__webpack_exports__CausalLMOutput as CausalLMOutput,__webpack_exports__CausalLMOutputWithPast as CausalLMOutputWithPast,__webpack_exports__ChineseCLIPFeatureExtractor as ChineseCLIPFeatureExtractor,__webpack_exports__ChineseCLIPModel as ChineseCLIPModel,__webpack_exports__ChineseCLIPPreTrainedModel as ChineseCLIPPreTrainedModel,__webpack_exports__ClapAudioModelWithProjection as ClapAudioModelWithProjection,__webpack_exports__ClapFeatureExtractor as ClapFeatureExtractor,__webpack_exports__ClapModel as ClapModel,__webpack_exports__ClapPreTrainedModel as ClapPreTrainedModel,__webpack_exports__ClapTextModelWithProjection as ClapTextModelWithProjection,__webpack_exports__CodeGenForCausalLM as CodeGenForCausalLM,__webpack_exports__CodeGenModel as CodeGenModel,__webpack_exports__CodeGenPreTrainedModel as CodeGenPreTrainedModel,__webpack_exports__CodeGenTokenizer as CodeGenTokenizer,__webpack_exports__CodeLlamaTokenizer as CodeLlamaTokenizer,__webpack_exports__CohereTokenizer as CohereTokenizer,__webpack_exports__ConvBertForMaskedLM as ConvBertForMaskedLM,__webpack_exports__ConvBertForQuestionAnswering as ConvBertForQuestionAnswering,__webpack_exports__ConvBertForSequenceClassification as ConvBertForSequenceClassification,__webpack_exports__ConvBertForTokenClassification as ConvBertForTokenClassification,__webpack_exports__ConvBertModel as ConvBertModel,__webpack_exports__ConvBertPreTrainedModel as ConvBertPreTrainedModel,__webpack_exports__ConvBertTokenizer as ConvBertTokenizer,__webpack_exports__ConvNextFeatureExtractor as ConvNextFeatureExtractor,__webpack_exports__ConvNextForImageClassification as ConvNextForImageClassification,__webpack_exports__ConvNextImageProcessor as ConvNextImageProcessor,__webpack_exports__ConvNextModel as ConvNextModel,__webpack_exports__ConvNextPreTrainedModel as ConvNextPreTrainedModel,__webpack_exports__ConvNextV2ForImageClassification as ConvNextV2ForImageClassification,__webpack_exports__ConvNextV2Model as ConvNextV2Model,__webpack_exports__ConvNextV2PreTrainedModel as ConvNextV2PreTrainedModel,__webpack_exports__DPTFeatureExtractor as DPTFeatureExtractor,__webpack_exports__DPTForDepthEstimation as DPTForDepthEstimation,__webpack_exports__DPTImageProcessor as DPTImageProcessor,__webpack_exports__DPTModel as DPTModel,__webpack_exports__DPTPreTrainedModel as DPTPreTrainedModel,__webpack_exports__DebertaForMaskedLM as DebertaForMaskedLM,__webpack_exports__DebertaForQuestionAnswering as DebertaForQuestionAnswering,__webpack_exports__DebertaForSequenceClassification as DebertaForSequenceClassification,__webpack_exports__DebertaForTokenClassification as DebertaForTokenClassification,__webpack_exports__DebertaModel as DebertaModel,__webpack_exports__DebertaPreTrainedModel as DebertaPreTrainedModel,__webpack_exports__DebertaTokenizer as DebertaTokenizer,__webpack_exports__DebertaV2ForMaskedLM as DebertaV2ForMaskedLM,__webpack_exports__DebertaV2ForQuestionAnswering as DebertaV2ForQuestionAnswering,__webpack_exports__DebertaV2ForSequenceClassification as DebertaV2ForSequenceClassification,__webpack_exports__DebertaV2ForTokenClassification as DebertaV2ForTokenClassification,__webpack_exports__DebertaV2Model as DebertaV2Model,__webpack_exports__DebertaV2PreTrainedModel as DebertaV2PreTrainedModel,__webpack_exports__DebertaV2Tokenizer as DebertaV2Tokenizer,__webpack_exports__DeiTFeatureExtractor as DeiTFeatureExtractor,__webpack_exports__DeiTForImageClassification as DeiTForImageClassification,__webpack_exports__DeiTModel as DeiTModel,__webpack_exports__DeiTPreTrainedModel as DeiTPreTrainedModel,__webpack_exports__DepthAnythingForDepthEstimation as DepthAnythingForDepthEstimation,__webpack_exports__DepthAnythingPreTrainedModel as DepthAnythingPreTrainedModel,__webpack_exports__DepthEstimationPipeline as DepthEstimationPipeline,__webpack_exports__DetrFeatureExtractor as DetrFeatureExtractor,__webpack_exports__DetrForObjectDetection as DetrForObjectDetection,__webpack_exports__DetrForSegmentation as DetrForSegmentation,__webpack_exports__DetrModel as DetrModel,__webpack_exports__DetrObjectDetectionOutput as DetrObjectDetectionOutput,__webpack_exports__DetrPreTrainedModel as DetrPreTrainedModel,__webpack_exports__DetrSegmentationOutput as DetrSegmentationOutput,__webpack_exports__Dinov2ForImageClassification as Dinov2ForImageClassification,__webpack_exports__Dinov2Model as Dinov2Model,__webpack_exports__Dinov2PreTrainedModel as Dinov2PreTrainedModel,__webpack_exports__DistilBertForMaskedLM as DistilBertForMaskedLM,__webpack_exports__DistilBertForQuestionAnswering as DistilBertForQuestionAnswering,__webpack_exports__DistilBertForSequenceClassification as DistilBertForSequenceClassification,__webpack_exports__DistilBertForTokenClassification as DistilBertForTokenClassification,__webpack_exports__DistilBertModel as DistilBertModel,__webpack_exports__DistilBertPreTrainedModel as DistilBertPreTrainedModel,__webpack_exports__DistilBertTokenizer as DistilBertTokenizer,__webpack_exports__DocumentQuestionAnsweringPipeline as DocumentQuestionAnsweringPipeline,__webpack_exports__DonutFeatureExtractor as DonutFeatureExtractor,__webpack_exports__DonutSwinModel as DonutSwinModel,__webpack_exports__DonutSwinPreTrainedModel as DonutSwinPreTrainedModel,__webpack_exports__EfficientNetForImageClassification as EfficientNetForImageClassification,__webpack_exports__EfficientNetImageProcessor as EfficientNetImageProcessor,__webpack_exports__EfficientNetModel as EfficientNetModel,__webpack_exports__EfficientNetPreTrainedModel as EfficientNetPreTrainedModel,__webpack_exports__ElectraForMaskedLM as ElectraForMaskedLM,__webpack_exports__ElectraForQuestionAnswering as ElectraForQuestionAnswering,__webpack_exports__ElectraForSequenceClassification as ElectraForSequenceClassification,__webpack_exports__ElectraForTokenClassification as ElectraForTokenClassification,__webpack_exports__ElectraModel as ElectraModel,__webpack_exports__ElectraPreTrainedModel as ElectraPreTrainedModel,__webpack_exports__ElectraTokenizer as ElectraTokenizer,__webpack_exports__EsmForMaskedLM as EsmForMaskedLM,__webpack_exports__EsmForSequenceClassification as EsmForSequenceClassification,__webpack_exports__EsmForTokenClassification as EsmForTokenClassification,__webpack_exports__EsmModel as EsmModel,__webpack_exports__EsmPreTrainedModel as EsmPreTrainedModel,__webpack_exports__EsmTokenizer as EsmTokenizer,__webpack_exports__FFT as FFT,__webpack_exports__FalconForCausalLM as FalconForCausalLM,__webpack_exports__FalconModel as FalconModel,__webpack_exports__FalconPreTrainedModel as FalconPreTrainedModel,__webpack_exports__FalconTokenizer as FalconTokenizer,__webpack_exports__FeatureExtractionPipeline as FeatureExtractionPipeline,__webpack_exports__FeatureExtractor as FeatureExtractor,__webpack_exports__FillMaskPipeline as FillMaskPipeline,__webpack_exports__GLPNFeatureExtractor as GLPNFeatureExtractor,__webpack_exports__GLPNForDepthEstimation as GLPNForDepthEstimation,__webpack_exports__GLPNModel as GLPNModel,__webpack_exports__GLPNPreTrainedModel as GLPNPreTrainedModel,__webpack_exports__GPT2LMHeadModel as GPT2LMHeadModel,__webpack_exports__GPT2Model as GPT2Model,__webpack_exports__GPT2PreTrainedModel as GPT2PreTrainedModel,__webpack_exports__GPT2Tokenizer as GPT2Tokenizer,__webpack_exports__GPTBigCodeForCausalLM as GPTBigCodeForCausalLM,__webpack_exports__GPTBigCodeModel as GPTBigCodeModel,__webpack_exports__GPTBigCodePreTrainedModel as GPTBigCodePreTrainedModel,__webpack_exports__GPTJForCausalLM as GPTJForCausalLM,__webpack_exports__GPTJModel as GPTJModel,__webpack_exports__GPTJPreTrainedModel as GPTJPreTrainedModel,__webpack_exports__GPTNeoForCausalLM as GPTNeoForCausalLM,__webpack_exports__GPTNeoModel as GPTNeoModel,__webpack_exports__GPTNeoPreTrainedModel as GPTNeoPreTrainedModel,__webpack_exports__GPTNeoXForCausalLM as GPTNeoXForCausalLM,__webpack_exports__GPTNeoXModel as GPTNeoXModel,__webpack_exports__GPTNeoXPreTrainedModel as GPTNeoXPreTrainedModel,__webpack_exports__GPTNeoXTokenizer as GPTNeoXTokenizer,__webpack_exports__GemmaTokenizer as GemmaTokenizer,__webpack_exports__Grok1Tokenizer as Grok1Tokenizer,__webpack_exports__HerbertTokenizer as HerbertTokenizer,__webpack_exports__HubertForCTC as HubertForCTC,__webpack_exports__HubertForSequenceClassification as HubertForSequenceClassification,__webpack_exports__HubertModel as HubertModel,__webpack_exports__HubertPreTrainedModel as HubertPreTrainedModel,__webpack_exports__ImageClassificationPipeline as ImageClassificationPipeline,__webpack_exports__ImageFeatureExtractionPipeline as ImageFeatureExtractionPipeline,__webpack_exports__ImageFeatureExtractor as ImageFeatureExtractor,__webpack_exports__ImageMattingOutput as ImageMattingOutput,__webpack_exports__ImageSegmentationPipeline as ImageSegmentationPipeline,__webpack_exports__ImageToImagePipeline as ImageToImagePipeline,__webpack_exports__ImageToTextPipeline as ImageToTextPipeline,__webpack_exports__LlamaForCausalLM as LlamaForCausalLM,__webpack_exports__LlamaModel as LlamaModel,__webpack_exports__LlamaPreTrainedModel as LlamaPreTrainedModel,__webpack_exports__LlamaTokenizer as LlamaTokenizer,__webpack_exports__LongT5ForConditionalGeneration as LongT5ForConditionalGeneration,__webpack_exports__LongT5Model as LongT5Model,__webpack_exports__LongT5PreTrainedModel as LongT5PreTrainedModel,__webpack_exports__M2M100ForConditionalGeneration as M2M100ForConditionalGeneration,__webpack_exports__M2M100Model as M2M100Model,__webpack_exports__M2M100PreTrainedModel as M2M100PreTrainedModel,__webpack_exports__M2M100Tokenizer as M2M100Tokenizer,__webpack_exports__MBart50Tokenizer as MBart50Tokenizer,__webpack_exports__MBartForCausalLM as MBartForCausalLM,__webpack_exports__MBartForConditionalGeneration as MBartForConditionalGeneration,__webpack_exports__MBartForSequenceClassification as MBartForSequenceClassification,__webpack_exports__MBartModel as MBartModel,__webpack_exports__MBartPreTrainedModel as MBartPreTrainedModel,__webpack_exports__MBartTokenizer as MBartTokenizer,__webpack_exports__MPNetForMaskedLM as MPNetForMaskedLM,__webpack_exports__MPNetForQuestionAnswering as MPNetForQuestionAnswering,__webpack_exports__MPNetForSequenceClassification as MPNetForSequenceClassification,__webpack_exports__MPNetForTokenClassification as MPNetForTokenClassification,__webpack_exports__MPNetModel as MPNetModel,__webpack_exports__MPNetPreTrainedModel as MPNetPreTrainedModel,__webpack_exports__MPNetTokenizer as MPNetTokenizer,__webpack_exports__MT5ForConditionalGeneration as MT5ForConditionalGeneration,__webpack_exports__MT5Model as MT5Model,__webpack_exports__MT5PreTrainedModel as MT5PreTrainedModel,__webpack_exports__MarianMTModel as MarianMTModel,__webpack_exports__MarianModel as MarianModel,__webpack_exports__MarianPreTrainedModel as MarianPreTrainedModel,__webpack_exports__MarianTokenizer as MarianTokenizer,__webpack_exports__MaskedLMOutput as MaskedLMOutput,__webpack_exports__MistralForCausalLM as MistralForCausalLM,__webpack_exports__MistralModel as MistralModel,__webpack_exports__MistralPreTrainedModel as MistralPreTrainedModel,__webpack_exports__MobileBertForMaskedLM as MobileBertForMaskedLM,__webpack_exports__MobileBertForQuestionAnswering as MobileBertForQuestionAnswering,__webpack_exports__MobileBertForSequenceClassification as MobileBertForSequenceClassification,__webpack_exports__MobileBertModel as MobileBertModel,__webpack_exports__MobileBertPreTrainedModel as MobileBertPreTrainedModel,__webpack_exports__MobileBertTokenizer as MobileBertTokenizer,__webpack_exports__MobileViTFeatureExtractor as MobileViTFeatureExtractor,__webpack_exports__MobileViTForImageClassification as MobileViTForImageClassification,__webpack_exports__MobileViTModel as MobileViTModel,__webpack_exports__MobileViTPreTrainedModel as MobileViTPreTrainedModel,__webpack_exports__ModelOutput as ModelOutput,__webpack_exports__MptForCausalLM as MptForCausalLM,__webpack_exports__MptModel as MptModel,__webpack_exports__MptPreTrainedModel as MptPreTrainedModel,__webpack_exports__NllbTokenizer as NllbTokenizer,__webpack_exports__NomicBertModel as NomicBertModel,__webpack_exports__NomicBertPreTrainedModel as NomicBertPreTrainedModel,__webpack_exports__NougatImageProcessor as NougatImageProcessor,__webpack_exports__NougatTokenizer as NougatTokenizer,__webpack_exports__OPTForCausalLM as OPTForCausalLM,__webpack_exports__OPTModel as OPTModel,__webpack_exports__OPTPreTrainedModel as OPTPreTrainedModel,__webpack_exports__ObjectDetectionPipeline as ObjectDetectionPipeline,__webpack_exports__OwlViTFeatureExtractor as OwlViTFeatureExtractor,__webpack_exports__OwlViTForObjectDetection as OwlViTForObjectDetection,__webpack_exports__OwlViTModel as OwlViTModel,__webpack_exports__OwlViTPreTrainedModel as OwlViTPreTrainedModel,__webpack_exports__OwlViTProcessor as OwlViTProcessor,__webpack_exports__Owlv2ForObjectDetection as Owlv2ForObjectDetection,__webpack_exports__Owlv2ImageProcessor as Owlv2ImageProcessor,__webpack_exports__Owlv2Model as Owlv2Model,__webpack_exports__Owlv2PreTrainedModel as Owlv2PreTrainedModel,__webpack_exports__PhiForCausalLM as PhiForCausalLM,__webpack_exports__PhiModel as PhiModel,__webpack_exports__PhiPreTrainedModel as PhiPreTrainedModel,__webpack_exports__Pipeline as Pipeline,__webpack_exports__PreTrainedModel as PreTrainedModel,__webpack_exports__PreTrainedTokenizer as PreTrainedTokenizer,__webpack_exports__PretrainedConfig as PretrainedConfig,__webpack_exports__PretrainedMixin as PretrainedMixin,__webpack_exports__Processor as Processor,__webpack_exports__QuestionAnsweringModelOutput as QuestionAnsweringModelOutput,__webpack_exports__QuestionAnsweringPipeline as QuestionAnsweringPipeline,__webpack_exports__Qwen2ForCausalLM as Qwen2ForCausalLM,__webpack_exports__Qwen2Model as Qwen2Model,__webpack_exports__Qwen2PreTrainedModel as Qwen2PreTrainedModel,__webpack_exports__Qwen2Tokenizer as Qwen2Tokenizer,__webpack_exports__RawImage as RawImage,__webpack_exports__ResNetForImageClassification as ResNetForImageClassification,__webpack_exports__ResNetModel as ResNetModel,__webpack_exports__ResNetPreTrainedModel as ResNetPreTrainedModel,__webpack_exports__RoFormerForMaskedLM as RoFormerForMaskedLM,__webpack_exports__RoFormerForQuestionAnswering as RoFormerForQuestionAnswering,__webpack_exports__RoFormerForSequenceClassification as RoFormerForSequenceClassification,__webpack_exports__RoFormerForTokenClassification as RoFormerForTokenClassification,__webpack_exports__RoFormerModel as RoFormerModel,__webpack_exports__RoFormerPreTrainedModel as RoFormerPreTrainedModel,__webpack_exports__RoFormerTokenizer as RoFormerTokenizer,__webpack_exports__RobertaForMaskedLM as RobertaForMaskedLM,__webpack_exports__RobertaForQuestionAnswering as RobertaForQuestionAnswering,__webpack_exports__RobertaForSequenceClassification as RobertaForSequenceClassification,__webpack_exports__RobertaForTokenClassification as RobertaForTokenClassification,__webpack_exports__RobertaModel as RobertaModel,__webpack_exports__RobertaPreTrainedModel as RobertaPreTrainedModel,__webpack_exports__RobertaTokenizer as RobertaTokenizer,__webpack_exports__SamImageProcessor as SamImageProcessor,__webpack_exports__SamImageSegmentationOutput as SamImageSegmentationOutput,__webpack_exports__SamModel as SamModel,__webpack_exports__SamPreTrainedModel as SamPreTrainedModel,__webpack_exports__SamProcessor as SamProcessor,__webpack_exports__SeamlessM4TFeatureExtractor as SeamlessM4TFeatureExtractor,__webpack_exports__SegformerFeatureExtractor as SegformerFeatureExtractor,__webpack_exports__SegformerForImageClassification as SegformerForImageClassification,__webpack_exports__SegformerForSemanticSegmentation as SegformerForSemanticSegmentation,__webpack_exports__SegformerModel as SegformerModel,__webpack_exports__SegformerPreTrainedModel as SegformerPreTrainedModel,__webpack_exports__Seq2SeqLMOutput as Seq2SeqLMOutput,__webpack_exports__SequenceClassifierOutput as SequenceClassifierOutput,__webpack_exports__SiglipImageProcessor as SiglipImageProcessor,__webpack_exports__SiglipModel as SiglipModel,__webpack_exports__SiglipPreTrainedModel as SiglipPreTrainedModel,__webpack_exports__SiglipTextModel as SiglipTextModel,__webpack_exports__SiglipTokenizer as SiglipTokenizer,__webpack_exports__SiglipVisionModel as SiglipVisionModel,__webpack_exports__SpeechT5FeatureExtractor as SpeechT5FeatureExtractor,__webpack_exports__SpeechT5ForSpeechToText as SpeechT5ForSpeechToText,__webpack_exports__SpeechT5ForTextToSpeech as SpeechT5ForTextToSpeech,__webpack_exports__SpeechT5HifiGan as SpeechT5HifiGan,__webpack_exports__SpeechT5Model as SpeechT5Model,__webpack_exports__SpeechT5PreTrainedModel as SpeechT5PreTrainedModel,__webpack_exports__SpeechT5Processor as SpeechT5Processor,__webpack_exports__SpeechT5Tokenizer as SpeechT5Tokenizer,__webpack_exports__SqueezeBertForMaskedLM as SqueezeBertForMaskedLM,__webpack_exports__SqueezeBertForQuestionAnswering as SqueezeBertForQuestionAnswering,__webpack_exports__SqueezeBertForSequenceClassification as SqueezeBertForSequenceClassification,__webpack_exports__SqueezeBertModel as SqueezeBertModel,__webpack_exports__SqueezeBertPreTrainedModel as SqueezeBertPreTrainedModel,__webpack_exports__SqueezeBertTokenizer as SqueezeBertTokenizer,__webpack_exports__StableLmForCausalLM as StableLmForCausalLM,__webpack_exports__StableLmModel as StableLmModel,__webpack_exports__StableLmPreTrainedModel as StableLmPreTrainedModel,__webpack_exports__Starcoder2ForCausalLM as Starcoder2ForCausalLM,__webpack_exports__Starcoder2Model as Starcoder2Model,__webpack_exports__Starcoder2PreTrainedModel as Starcoder2PreTrainedModel,__webpack_exports__SummarizationPipeline as SummarizationPipeline,__webpack_exports__Swin2SRForImageSuperResolution as Swin2SRForImageSuperResolution,__webpack_exports__Swin2SRImageProcessor as Swin2SRImageProcessor,__webpack_exports__Swin2SRModel as Swin2SRModel,__webpack_exports__Swin2SRPreTrainedModel as Swin2SRPreTrainedModel,__webpack_exports__SwinForImageClassification as SwinForImageClassification,__webpack_exports__SwinModel as SwinModel,__webpack_exports__SwinPreTrainedModel as SwinPreTrainedModel,__webpack_exports__T5ForConditionalGeneration as T5ForConditionalGeneration,__webpack_exports__T5Model as T5Model,__webpack_exports__T5PreTrainedModel as T5PreTrainedModel,__webpack_exports__T5Tokenizer as T5Tokenizer,__webpack_exports__TableTransformerForObjectDetection as TableTransformerForObjectDetection,__webpack_exports__TableTransformerModel as TableTransformerModel,__webpack_exports__TableTransformerObjectDetectionOutput as TableTransformerObjectDetectionOutput,__webpack_exports__TableTransformerPreTrainedModel as TableTransformerPreTrainedModel,__webpack_exports__Tensor as Tensor,__webpack_exports__Text2TextGenerationPipeline as Text2TextGenerationPipeline,__webpack_exports__TextClassificationPipeline as TextClassificationPipeline,__webpack_exports__TextGenerationPipeline as TextGenerationPipeline,__webpack_exports__TextToAudioPipeline as TextToAudioPipeline,__webpack_exports__TokenClassificationPipeline as TokenClassificationPipeline,__webpack_exports__TokenClassifierOutput as TokenClassifierOutput,__webpack_exports__TokenizerModel as TokenizerModel,__webpack_exports__TrOCRForCausalLM as TrOCRForCausalLM,__webpack_exports__TrOCRPreTrainedModel as TrOCRPreTrainedModel,__webpack_exports__TranslationPipeline as TranslationPipeline,__webpack_exports__UniSpeechForCTC as UniSpeechForCTC,__webpack_exports__UniSpeechForSequenceClassification as UniSpeechForSequenceClassification,__webpack_exports__UniSpeechModel as UniSpeechModel,__webpack_exports__UniSpeechPreTrainedModel as UniSpeechPreTrainedModel,__webpack_exports__UniSpeechSatForAudioFrameClassification as UniSpeechSatForAudioFrameClassification,__webpack_exports__UniSpeechSatForCTC as UniSpeechSatForCTC,__webpack_exports__UniSpeechSatForSequenceClassification as UniSpeechSatForSequenceClassification,__webpack_exports__UniSpeechSatModel as UniSpeechSatModel,__webpack_exports__UniSpeechSatPreTrainedModel as UniSpeechSatPreTrainedModel,__webpack_exports__ViTFeatureExtractor as ViTFeatureExtractor,__webpack_exports__ViTForImageClassification as ViTForImageClassification,__webpack_exports__ViTImageProcessor as ViTImageProcessor,__webpack_exports__ViTModel as ViTModel,__webpack_exports__ViTPreTrainedModel as ViTPreTrainedModel,__webpack_exports__VisionEncoderDecoderModel as VisionEncoderDecoderModel,__webpack_exports__VitMatteForImageMatting as VitMatteForImageMatting,__webpack_exports__VitMatteImageProcessor as VitMatteImageProcessor,__webpack_exports__VitMattePreTrainedModel as VitMattePreTrainedModel,__webpack_exports__VitsModel as VitsModel,__webpack_exports__VitsModelOutput as VitsModelOutput,__webpack_exports__VitsPreTrainedModel as VitsPreTrainedModel,__webpack_exports__VitsTokenizer as VitsTokenizer,__webpack_exports__Wav2Vec2BertForCTC as Wav2Vec2BertForCTC,__webpack_exports__Wav2Vec2BertForSequenceClassification as Wav2Vec2BertForSequenceClassification,__webpack_exports__Wav2Vec2BertModel as Wav2Vec2BertModel,__webpack_exports__Wav2Vec2BertPreTrainedModel as Wav2Vec2BertPreTrainedModel,__webpack_exports__Wav2Vec2CTCTokenizer as Wav2Vec2CTCTokenizer,__webpack_exports__Wav2Vec2FeatureExtractor as Wav2Vec2FeatureExtractor,__webpack_exports__Wav2Vec2ForAudioFrameClassification as Wav2Vec2ForAudioFrameClassification,__webpack_exports__Wav2Vec2ForCTC as Wav2Vec2ForCTC,__webpack_exports__Wav2Vec2ForSequenceClassification as Wav2Vec2ForSequenceClassification,__webpack_exports__Wav2Vec2Model as Wav2Vec2Model,__webpack_exports__Wav2Vec2PreTrainedModel as Wav2Vec2PreTrainedModel,__webpack_exports__Wav2Vec2ProcessorWithLM as Wav2Vec2ProcessorWithLM,__webpack_exports__WavLMForAudioFrameClassification as WavLMForAudioFrameClassification,__webpack_exports__WavLMForCTC as WavLMForCTC,__webpack_exports__WavLMForSequenceClassification as WavLMForSequenceClassification,__webpack_exports__WavLMForXVector as WavLMForXVector,__webpack_exports__WavLMModel as WavLMModel,__webpack_exports__WavLMPreTrainedModel as WavLMPreTrainedModel,__webpack_exports__WhisperFeatureExtractor as WhisperFeatureExtractor,__webpack_exports__WhisperForConditionalGeneration as WhisperForConditionalGeneration,__webpack_exports__WhisperModel as WhisperModel,__webpack_exports__WhisperPreTrainedModel as WhisperPreTrainedModel,__webpack_exports__WhisperProcessor as WhisperProcessor,__webpack_exports__WhisperTokenizer as WhisperTokenizer,__webpack_exports__XLMForQuestionAnswering as XLMForQuestionAnswering,__webpack_exports__XLMForSequenceClassification as XLMForSequenceClassification,__webpack_exports__XLMForTokenClassification as XLMForTokenClassification,__webpack_exports__XLMModel as XLMModel,__webpack_exports__XLMPreTrainedModel as XLMPreTrainedModel,__webpack_exports__XLMRobertaForMaskedLM as XLMRobertaForMaskedLM,__webpack_exports__XLMRobertaForQuestionAnswering as XLMRobertaForQuestionAnswering,__webpack_exports__XLMRobertaForSequenceClassification as XLMRobertaForSequenceClassification,__webpack_exports__XLMRobertaForTokenClassification as XLMRobertaForTokenClassification,__webpack_exports__XLMRobertaModel as XLMRobertaModel,__webpack_exports__XLMRobertaPreTrainedModel as XLMRobertaPreTrainedModel,__webpack_exports__XLMRobertaTokenizer as XLMRobertaTokenizer,__webpack_exports__XLMTokenizer as XLMTokenizer,__webpack_exports__XLMWithLMHeadModel as XLMWithLMHeadModel,__webpack_exports__XVectorOutput as XVectorOutput,__webpack_exports__YolosFeatureExtractor as YolosFeatureExtractor,__webpack_exports__YolosForObjectDetection as YolosForObjectDetection,__webpack_exports__YolosModel as YolosModel,__webpack_exports__YolosObjectDetectionOutput as YolosObjectDetectionOutput,__webpack_exports__YolosPreTrainedModel as YolosPreTrainedModel,__webpack_exports__ZeroShotAudioClassificationPipeline as ZeroShotAudioClassificationPipeline,__webpack_exports__ZeroShotClassificationPipeline as ZeroShotClassificationPipeline,__webpack_exports__ZeroShotImageClassificationPipeline as ZeroShotImageClassificationPipeline,__webpack_exports__ZeroShotObjectDetectionPipeline as ZeroShotObjectDetectionPipeline,__webpack_exports__bankers_round as bankers_round,__webpack_exports__cat as cat,__webpack_exports__cos_sim as cos_sim,__webpack_exports__dot as dot,__webpack_exports__dynamicTimeWarping as dynamicTimeWarping,__webpack_exports__env as env,__webpack_exports__getTopItems as getTopItems,__webpack_exports__hanning as hanning,__webpack_exports__interpolate as interpolate,__webpack_exports__interpolate_data as interpolate_data,__webpack_exports__layer_norm as layer_norm,__webpack_exports__log_softmax as log_softmax,__webpack_exports__magnitude as magnitude,__webpack_exports__max as max,__webpack_exports__mean as mean,__webpack_exports__mean_pooling as mean_pooling,__webpack_exports__medianFilter as medianFilter,__webpack_exports__mel_filter_bank as mel_filter_bank,__webpack_exports__min as min,__webpack_exports__ones as ones,__webpack_exports__ones_like as ones_like,__webpack_exports__permute as permute,__webpack_exports__permute_data as permute_data,__webpack_exports__pipeline as pipeline,__webpack_exports__quantize_embeddings as quantize_embeddings,__webpack_exports__read_audio as read_audio,__webpack_exports__round as round,__webpack_exports__softmax as softmax,__webpack_exports__spectrogram as spectrogram,__webpack_exports__stack as stack,__webpack_exports__std_mean as std_mean,__webpack_exports__window_function as window_function}; //# sourceMappingURL=transformers.min.js.map