@intelliweave/embedded 2.0.72-beta.8 → 2.1.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{a as le}from"./chunk-FSRPMVAS.js";var lh=Object.create,Kr=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,ch=Object.getOwnPropertyNames,dh=Object.getPrototypeOf,hh=Object.prototype.hasOwnProperty,fh=(t=>typeof le<"u"?le:typeof Proxy<"u"?new Proxy(t,{get:(r,n)=>(typeof le<"u"?le:r)[n]}):t)(function(t){if(typeof le<"u")return le.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),I=(t,r)=>()=>(t&&(r=t(t=0)),r),nt=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),gr=(t,r)=>{for(var n in r)Kr(t,n,{get:r[n],enumerable:!0})},Hu=(t,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of ch(r))!hh.call(t,p)&&p!==n&&Kr(t,p,{get:()=>r[p],enumerable:!(s=ph(r,p))||s.enumerable});return t},Ie=(t,r,n)=>(n=t!=null?lh(dh(t)):{},Hu(r||!t||!t.__esModule?Kr(n,"default",{value:t,enumerable:!0}):n,t)),zr=t=>Hu(Kr({},"__esModule",{value:!0}),t),Me,Zt,cr,da,Vo,Mo=I(()=>{"use strict";Me=new Map,Zt=[],cr=(t,r,n)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){let s=Me.get(t);if(s===void 0)Me.set(t,{backend:r,priority:n});else{if(s.priority>n)return;if(s.priority===n&&s.backend!==r)throw new Error(`cannot register backend "${t}" using priority ${n}`)}if(n>=0){let p=Zt.indexOf(t);p!==-1&&Zt.splice(p,1);for(let l=0;l<Zt.length;l++)if(Me.get(Zt[l]).priority<=n){Zt.splice(l,0,t);return}Zt.push(t)}return}throw new TypeError("not a valid backend")},da=async t=>{let r=Me.get(t);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{let n=!!r.initPromise;try{return n||(r.initPromise=r.backend.init(t)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return n||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Vo=async t=>{let r=t.executionProviders||[],n=r.map(a=>typeof a=="string"?a:a.name),s=n.length===0?Zt:n,p,l=[],c=new Set;for(let a of s){let e=await da(a);typeof e=="string"?l.push({name:a,err:e}):(p||(p=e),p===e&&c.add(a))}if(!p)throw new Error(`no available backend found. ERR: ${l.map(a=>`[${a.name}] ${a.err}`).join(", ")}`);for(let{name:a,err:e}of l)n.includes(a)&&console.warn(`removing requested execution provider "${a}" from session options because it is not available: ${e}`);let o=r.filter(a=>c.has(typeof a=="string"?a:a.name));return[p,new Proxy(t,{get:(a,e)=>e==="executionProviders"?o:Reflect.get(a,e)})]}}),gh=I(()=>{"use strict";Mo()}),qu,mh=I(()=>{"use strict";qu="1.20.0"}),fn,Dt,Wu=I(()=>{"use strict";mh(),fn="warning",Dt={wasm:{},webgl:{},webgpu:{},versions:{common:qu},set logLevel(t){if(t!==void 0){if(typeof t!="string"||["verbose","info","warning","error","fatal"].indexOf(t)===-1)throw new Error(`Unsupported logging level: ${t}`);fn=t}},get logLevel(){return fn}},Object.defineProperty(Dt,"logLevel",{enumerable:!0})}),j,bh=I(()=>{"use strict";Wu(),j=Dt}),Xu,Ku,yh=I(()=>{"use strict";Xu=(t,r)=>{let n=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);n.width=t.dims[3],n.height=t.dims[2];let s=n.getContext("2d");if(s!=null){let p,l;r?.tensorLayout!==void 0&&r.tensorLayout==="NHWC"?(p=t.dims[2],l=t.dims[3]):(p=t.dims[3],l=t.dims[2]);let c=r?.format!==void 0?r.format:"RGB",o=r?.norm,a,e;o===void 0||o.mean===void 0?a=[255,255,255,255]:typeof o.mean=="number"?a=[o.mean,o.mean,o.mean,o.mean]:(a=[o.mean[0],o.mean[1],o.mean[2],0],o.mean[3]!==void 0&&(a[3]=o.mean[3])),o===void 0||o.bias===void 0?e=[0,0,0,0]:typeof o.bias=="number"?e=[o.bias,o.bias,o.bias,o.bias]:(e=[o.bias[0],o.bias[1],o.bias[2],0],o.bias[3]!==void 0&&(e[3]=o.bias[3]));let u=l*p,i=0,d=u,h=u*2,m=-1;c==="RGBA"?(i=0,d=u,h=u*2,m=u*3):c==="RGB"?(i=0,d=u,h=u*2):c==="RBG"&&(i=0,h=u,d=u*2);for(let b=0;b<l;b++)for(let x=0;x<p;x++){let E=(t.data[i++]-e[0])*a[0],w=(t.data[d++]-e[1])*a[1],S=(t.data[h++]-e[2])*a[2],$=m===-1?255:(t.data[m++]-e[3])*a[3];s.fillStyle="rgba("+E+","+w+","+S+","+$+")",s.fillRect(x,b,1,1)}if("toDataURL"in n)return n.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},Ku=(t,r)=>{let n=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),s;if(n!=null){let p,l,c;r?.tensorLayout!==void 0&&r.tensorLayout==="NHWC"?(p=t.dims[2],l=t.dims[1],c=t.dims[3]):(p=t.dims[3],l=t.dims[2],c=t.dims[1]);let o=r!==void 0&&r.format!==void 0?r.format:"RGB",a=r?.norm,e,u;a===void 0||a.mean===void 0?e=[255,255,255,255]:typeof a.mean=="number"?e=[a.mean,a.mean,a.mean,a.mean]:(e=[a.mean[0],a.mean[1],a.mean[2],255],a.mean[3]!==void 0&&(e[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));let i=l*p;if(r!==void 0&&(r.format!==void 0&&c===4&&r.format!=="RGBA"||c===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let d=4,h=0,m=1,b=2,x=3,E=0,w=i,S=i*2,$=-1;o==="RGBA"?(E=0,w=i,S=i*2,$=i*3):o==="RGB"?(E=0,w=i,S=i*2):o==="RBG"&&(E=0,S=i,w=i*2),s=n.createImageData(p,l);for(let F=0;F<l*p;h+=d,m+=d,b+=d,x+=d,F++)s.data[h]=(t.data[E++]-u[0])*e[0],s.data[m]=(t.data[w++]-u[1])*e[1],s.data[b]=(t.data[S++]-u[2])*e[2],s.data[x]=$===-1?255:(t.data[$++]-u[3])*e[3]}else throw new Error("Can not access image data");return s}}),Nr,Zu,Ju,Yu,Qu,tl,wh=I(()=>{"use strict";zo(),Nr=(t,r)=>{if(t===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:n,width:s}=r,p=r.norm??{mean:255,bias:0},l,c;typeof p.mean=="number"?l=[p.mean,p.mean,p.mean,p.mean]:l=[p.mean[0],p.mean[1],p.mean[2],p.mean[3]??255],typeof p.bias=="number"?c=[p.bias,p.bias,p.bias,p.bias]:c=[p.bias[0],p.bias[1],p.bias[2],p.bias[3]??0];let o=r.format!==void 0?r.format:"RGBA",a=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",e=n*s,u=a==="RGBA"?new Float32Array(e*4):new Float32Array(e*3),i=4,d=0,h=1,m=2,b=3,x=0,E=e,w=e*2,S=-1;o==="RGB"&&(i=3,d=0,h=1,m=2,b=-1),a==="RGBA"?S=e*3:a==="RBG"?(x=0,w=e,E=e*2):a==="BGR"&&(w=0,E=e,x=e*2);for(let $=0;$<e;$++,d+=i,m+=i,h+=i,b+=i)u[x++]=(t[d]+c[0])/l[0],u[E++]=(t[h]+c[1])/l[1],u[w++]=(t[m]+c[2])/l[2],S!==-1&&b!==-1&&(u[S++]=(t[b]+c[3])/l[3]);return a==="RGBA"?new It("float32",u,[1,4,n,s]):new It("float32",u,[1,3,n,s])},Zu=async(t,r)=>{let n=typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement,s=typeof ImageData<"u"&&t instanceof ImageData,p=typeof ImageBitmap<"u"&&t instanceof ImageBitmap,l=typeof t=="string",c,o=r??{},a=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},e=u=>typeof HTMLCanvasElement<"u"&&u instanceof HTMLCanvasElement||u instanceof OffscreenCanvas?u.getContext("2d"):null;if(n){let u=a();u.width=t.width,u.height=t.height;let i=e(u);if(i!=null){let d=t.height,h=t.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,h=r.resizedWidth),r!==void 0){if(o=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");o.tensorFormat="RGBA",o.height=d,o.width=h}else o.tensorFormat="RGBA",o.height=d,o.width=h;i.drawImage(t,0,0),c=i.getImageData(0,0,h,d).data}else throw new Error("Can not access image data")}else if(s){let u,i;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(u=r.resizedHeight,i=r.resizedWidth):(u=t.height,i=t.width),r!==void 0&&(o=r),o.format="RGBA",o.height=u,o.width=i,r!==void 0){let d=a();d.width=i,d.height=u;let h=e(d);if(h!=null)h.putImageData(t,0,0),c=h.getImageData(0,0,i,u).data;else throw new Error("Can not access image data")}else c=t.data}else if(p){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");let u=a();u.width=t.width,u.height=t.height;let i=e(u);if(i!=null){let d=t.height,h=t.width;return i.drawImage(t,0,0,h,d),c=i.getImageData(0,0,h,d).data,o.height=d,o.width=h,Nr(c,o)}else throw new Error("Can not access image data")}else{if(l)return new Promise((u,i)=>{let d=a(),h=e(d);if(!t||!h)return i();let m=new Image;m.crossOrigin="Anonymous",m.src=t,m.onload=()=>{d.width=m.width,d.height=m.height,h.drawImage(m,0,0,d.width,d.height);let b=h.getImageData(0,0,d.width,d.height);o.height=d.height,o.width=d.width,u(Nr(b.data,o))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return Nr(c,o);throw new Error("Input data provided is not supported - aborted tensor creation")},Ju=(t,r)=>{let{width:n,height:s,download:p,dispose:l}=r,c=[1,s,n,4];return new It({location:"texture",type:"float32",texture:t,dims:c,download:p,dispose:l})},Yu=(t,r)=>{let{dataType:n,dims:s,download:p,dispose:l}=r;return new It({location:"gpu-buffer",type:n??"float32",gpuBuffer:t,dims:s,download:p,dispose:l})},Qu=(t,r)=>{let{dataType:n,dims:s,download:p,dispose:l}=r;return new It({location:"ml-tensor",type:n??"float32",mlTensor:t,dims:s,download:p,dispose:l})},tl=(t,r,n)=>new It({location:"cpu-pinned",type:t,data:r,dims:n??[r.length]})}),me,Ye,gn,el,vh=I(()=>{"use strict";me=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Ye=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),gn=!1,el=()=>{if(!gn){gn=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,n=typeof Float16Array<"u"&&Float16Array.from;t&&(me.set("int64",BigInt64Array),Ye.set(BigInt64Array,"int64")),r&&(me.set("uint64",BigUint64Array),Ye.set(BigUint64Array,"uint64")),n?(me.set("float16",Float16Array),Ye.set(Float16Array,"float16")):me.set("float16",Uint16Array)}}}),rl,nl,xh=I(()=>{"use strict";zo(),rl=t=>{let r=1;for(let n=0;n<t.length;n++){let s=t[n];if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`dims[${n}] must be an integer, got: ${s}`);if(s<0)throw new RangeError(`dims[${n}] must be a non-negative integer, got: ${s}`);r*=s}return r},nl=(t,r)=>{switch(t.location){case"cpu":return new It(t.type,t.data,r);case"cpu-pinned":return new It({location:"cpu-pinned",data:t.data,type:t.type,dims:r});case"texture":return new It({location:"texture",texture:t.texture,type:t.type,dims:r});case"gpu-buffer":return new It({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:r});case"ml-tensor":return new It({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}}),It,zo=I(()=>{"use strict";yh(),wh(),vh(),xh(),It=class{constructor(t,r,n){el();let s,p;if(typeof t=="object"&&"location"in t)switch(this.dataLocation=t.location,s=t.type,p=t.dims,t.location){case"cpu-pinned":{let c=me.get(s);if(!c)throw new TypeError(`unsupported type "${s}" to create tensor from pinned buffer`);if(!(t.data instanceof c))throw new TypeError(`buffer should be of type ${c.name}`);this.cpuData=t.data;break}case"texture":{if(s!=="float32")throw new TypeError(`unsupported type "${s}" to create tensor from texture`);this.gpuTextureData=t.texture,this.downloader=t.download,this.disposer=t.dispose;break}case"gpu-buffer":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from gpu buffer`);this.gpuBufferData=t.gpuBuffer,this.downloader=t.download,this.disposer=t.dispose;break}case"ml-tensor":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint64"&&s!=="int8"&&s!=="uint8"&&s!=="bool")throw new TypeError(`unsupported type "${s}" to create tensor from MLTensor`);this.mlTensorData=t.mlTensor,this.downloader=t.download,this.disposer=t.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let c,o;if(typeof t=="string")if(s=t,o=n,t==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");c=r}else{let a=me.get(t);if(a===void 0)throw new TypeError(`Unsupported tensor type: ${t}.`);if(Array.isArray(r)){if(t==="float16"&&a===Uint16Array||t==="uint4"||t==="int4")throw new TypeError(`Creating a ${t} tensor from number array is not supported. Please use ${a.name} as data.`);t==="uint64"||t==="int64"?c=a.from(r,BigInt):c=a.from(r)}else if(r instanceof a)c=r;else if(r instanceof Uint8ClampedArray)if(t==="uint8")c=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else throw new TypeError(`A ${s} tensor's data must be type of ${a}`)}else if(o=r,Array.isArray(t)){if(t.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let a=typeof t[0];if(a==="string")s="string",c=t;else if(a==="boolean")s="bool",c=Uint8Array.from(t);else throw new TypeError(`Invalid element type of data array: ${a}.`)}else if(t instanceof Uint8ClampedArray)s="uint8",c=Uint8Array.from(t);else{let a=Ye.get(t.constructor);if(a===void 0)throw new TypeError(`Unsupported type for tensor data: ${t.constructor}.`);s=a,c=t}if(o===void 0)o=[c.length];else if(!Array.isArray(o))throw new TypeError("A tensor's dims must be a number array");p=o,this.cpuData=c,this.dataLocation="cpu"}let l=rl(p);if(this.cpuData&&l!==this.cpuData.length&&!((s==="uint4"||s==="int4")&&Math.ceil(l/2)===this.cpuData.length))throw new Error(`Tensor's size(${l}) does not match data length(${this.cpuData.length}).`);this.type=s,this.dims=p,this.size=l}static async fromImage(t,r){return Zu(t,r)}static fromTexture(t,r){return Ju(t,r)}static fromGpuBuffer(t,r){return Yu(t,r)}static fromMLTensor(t,r){return Qu(t,r)}static fromPinnedBuffer(t,r,n){return tl(t,r,n)}toDataURL(t){return Xu(this,t)}toImageData(t){return Ku(this,t)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(t){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,t&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(t){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return nl(this,t)}}}),ft,Uo=I(()=>{"use strict";zo(),ft=It}),no,mn,Pe,Ae,ol=I(()=>{"use strict";Wu(),no=(t,r)=>{(typeof Dt.trace>"u"?!Dt.wasm.trace:!Dt.trace)||console.timeStamp(`${t}::ORT::${r}`)},mn=(t,r)=>{let n=new Error().stack?.split(/\r\n|\r|\n/g)||[],s=!1;for(let p=0;p<n.length;p++){if(s&&!n[p].includes("TRACE_FUNC")){let l=`FUNC_${t}::${n[p].trim().split(" ")[1]}`;r&&(l+=`::${r}`),no("CPU",l);return}n[p].includes("TRACE_FUNC")&&(s=!0)}},Pe=t=>{(typeof Dt.trace>"u"?!Dt.wasm.trace:!Dt.trace)||mn("BEGIN",t)},Ae=t=>{(typeof Dt.trace>"u"?!Dt.wasm.trace:!Dt.trace)||mn("END",t)}}),il,Th=I(()=>{"use strict";Mo(),Uo(),ol(),il=class al{constructor(r){this.handler=r}async run(r,n,s){Pe();let p={},l={};if(typeof r!="object"||r===null||r instanceof ft||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let c=!0;if(typeof n=="object"){if(n===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(n instanceof ft)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(n)){if(n.length===0)throw new TypeError("'fetches' cannot be an empty array.");c=!1;for(let e of n){if(typeof e!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(e)===-1)throw new RangeError(`'fetches' contains invalid output name: ${e}.`);p[e]=null}if(typeof s=="object"&&s!==null)l=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let e=!1,u=Object.getOwnPropertyNames(n);for(let i of this.outputNames)if(u.indexOf(i)!==-1){let d=n[i];(d===null||d instanceof ft)&&(e=!0,c=!1,p[i]=d)}if(e){if(typeof s=="object"&&s!==null)l=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else l=n}}else if(typeof n<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let e of this.inputNames)if(typeof r[e]>"u")throw new Error(`input '${e}' is missing in 'feeds'.`);if(c)for(let e of this.outputNames)p[e]=null;let o=await this.handler.run(r,p,l),a={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let u=o[e];u instanceof ft?a[e]=u:a[e]=new ft(u.type,u.data,u.dims)}return Ae(),a}async release(){return this.handler.dispose()}static async create(r,n,s,p){Pe();let l,c={};if(typeof r=="string"){if(l=r,typeof n=="object"&&n!==null)c=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(l=r,typeof n=="object"&&n!==null)c=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){let u=r,i=0,d=r.byteLength;if(typeof n=="object"&&n!==null)c=n;else if(typeof n=="number"){if(i=n,!Number.isSafeInteger(i))throw new RangeError("'byteOffset' must be an integer.");if(i<0||i>=u.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${u.byteLength}).`);if(d=r.byteLength-i,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||i+d>u.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${u.byteLength-i}].`);if(typeof p=="object"&&p!==null)c=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof n<"u")throw new TypeError("'options' must be an object.");l=new Uint8Array(u,i,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[o,a]=await Vo(c),e=await o.createInferenceSessionHandler(l,a);return Ae(),new al(e)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}}),sl,_h=I(()=>{"use strict";Th(),sl=il}),Sh=I(()=>{"use strict"}),Oh=I(()=>{"use strict"}),Eh=I(()=>{"use strict"}),Ih=I(()=>{"use strict"}),ha,ul,Ph=I(()=>{"use strict";Mo(),Uo(),ha="Training backend could not be resolved. Make sure you're using the correct configuration & WebAssembly files.",ul=class ll{constructor(r,n,s){this.handler=r,this.hasOptimizerModel=n,this.hasEvalModel=s}get trainingInputNames(){return this.handler.inputNames}get trainingOutputNames(){return this.handler.outputNames}get evalInputNames(){if(this.hasEvalModel)return this.handler.evalInputNames;throw new Error("This training session has no evalModel loaded.")}get evalOutputNames(){if(this.hasEvalModel)return this.handler.evalOutputNames;throw new Error("This training session has no evalModel loaded.")}static async create(r,n){let s=r.evalModel||"",p=r.optimizerModel||"",l=n||{},[c,o]=await Vo(l);if(c.createTrainingSessionHandler){let a=await c.createTrainingSessionHandler(r.checkpointState,r.trainModel,s,p,o);return new ll(a,!!r.optimizerModel,!!r.evalModel)}else throw new Error(ha)}typeNarrowingForRunStep(r,n,s,p,l){let c={},o={};if(typeof s!="object"||s===null||s instanceof ft||Array.isArray(s))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let a=!0;if(typeof p=="object"){if(p===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(p instanceof ft)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(p)){if(p.length===0)throw new TypeError("'fetches' cannot be an empty array.");a=!1;for(let e of p){if(typeof e!="string")throw new TypeError("'fetches' must be a string array or an object.");if(n.indexOf(e)===-1)throw new RangeError(`'fetches' contains invalid output name: ${e}.`);c[e]=null}if(typeof l=="object"&&l!==null)o=l;else if(typeof l<"u")throw new TypeError("'options' must be an object.")}else{let e=!1,u=Object.getOwnPropertyNames(p);for(let i of n)if(u.indexOf(i)!==-1){let d=p[i];(d===null||d instanceof ft)&&(e=!0,a=!1,c[i]=d)}if(e){if(typeof l=="object"&&l!==null)o=l;else if(typeof l<"u")throw new TypeError("'options' must be an object.")}else o=p}}else if(typeof p<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let e of r)if(typeof s[e]>"u")throw new Error(`input '${e}' is missing in 'feeds'.`);if(a)for(let e of n)c[e]=null;return[c,o]}convertHandlerReturnTypeToMapOfTensors(r){let n={};for(let s in r)if(Object.hasOwnProperty.call(r,s)){let p=r[s];p instanceof ft?n[s]=p:n[s]=new ft(p.type,p.data,p.dims)}return n}async lazyResetGrad(){await this.handler.lazyResetGrad()}async runTrainStep(r,n,s){let[p,l]=this.typeNarrowingForRunStep(this.trainingInputNames,this.trainingOutputNames,r,n,s),c=await this.handler.runTrainStep(r,p,l);return this.convertHandlerReturnTypeToMapOfTensors(c)}async runOptimizerStep(r){if(this.hasOptimizerModel)await this.handler.runOptimizerStep(r||{});else throw new Error("This TrainingSession has no OptimizerModel loaded.")}async runEvalStep(r,n,s){if(this.hasEvalModel){let[p,l]=this.typeNarrowingForRunStep(this.evalInputNames,this.evalOutputNames,r,n,s),c=await this.handler.runEvalStep(r,p,l);return this.convertHandlerReturnTypeToMapOfTensors(c)}else throw new Error("This TrainingSession has no EvalModel loaded.")}async getParametersSize(r=!0){return this.handler.getParametersSize(r)}async loadParametersBuffer(r,n=!0){let s=await this.getParametersSize(n);if(r.length!==4*s)throw new Error("Size of the buffer passed into loadParametersBuffer must match the number of parameters in the model. Please use getParametersSize method to check.");return this.handler.loadParametersBuffer(r,n)}async getContiguousParameters(r=!0){return this.handler.getContiguousParameters(r)}async release(){return this.handler.dispose()}}}),pl,Ah=I(()=>{"use strict";Ph(),pl=ul}),cl={};gr(cl,{InferenceSession:()=>sl,TRACE:()=>no,TRACE_FUNC_BEGIN:()=>Pe,TRACE_FUNC_END:()=>Ae,Tensor:()=>ft,TrainingSession:()=>pl,env:()=>j,registerBackend:()=>cr});var zt=I(()=>{"use strict";gh(),bh(),_h(),Uo(),Sh(),Oh(),ol(),Eh(),Ih(),Ah()});function be(t,r,n,s){if(r===void 0)return $h(t);if(n===void 0)kr(t,r,1);else if(typeof n=="number"&&s===void 0)kr(t,r,n);else if(typeof n=="string"&&s===void 0)kr(t,n,1,r);else if(typeof n=="string"&&typeof s=="number")kr(t,n,s,r);else throw new TypeError("input is valid")}function $h(t){return{verbose:be.verbose.bind(null,t),info:be.info.bind(null,t),warning:be.warning.bind(null,t),error:be.error.bind(null,t),fatal:be.fatal.bind(null,t)}}function kr(t,r,n,s){let p=Ee[s||""]||Ee[""];oo[t]<oo[p.minimalSeverity]||(p.logDateTime&&(r=`${new Date().toISOString()}|${r}`),p.logSourceLocation,dl[p.provider].log(t,r,s))}var fa,ga,oo,dl,bn,Ee,tt,yn,wn,hl,ze,Rt=I(()=>{"use strict";fa=class{log(t,r,n){}},ga=class{log(t,r,n){console.log(`${this.color(t)} ${n?"\x1B[35m"+n+"\x1B[0m ":""}${r}`)}color(t){switch(t){case"verbose":return"\x1B[34;40mv\x1B[0m";case"info":return"\x1B[32mi\x1B[0m";case"warning":return"\x1B[30;43mw\x1B[0m";case"error":return"\x1B[31;40me\x1B[0m";case"fatal":return"\x1B[101mf\x1B[0m";default:throw new Error(`unsupported severity: ${t}`)}}},oo={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},dl={none:new fa,console:new ga},bn={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1},Ee={"":bn},(t=>{function r(e,u){t("verbose",e,u)}t.verbose=r;function n(e,u){t("info",e,u)}t.info=n;function s(e,u){t("warning",e,u)}t.warning=s;function p(e,u){t("error",e,u)}t.error=p;function l(e,u){t("fatal",e,u)}t.fatal=l;function c(e){Ee={},o("",e||{})}t.reset=c;function o(e,u){if(e==="*")c(u);else{let i=Ee[e]||bn;Ee[e]={provider:u.provider||i.provider,minimalSeverity:u.minimalSeverity||i.minimalSeverity,logDateTime:u.logDateTime===void 0?i.logDateTime:u.logDateTime,logSourceLocation:u.logSourceLocation===void 0?i.logSourceLocation:u.logSourceLocation}}}t.set=o;function a(e){let u={};e.logLevel&&(u.minimalSeverity=e.logLevel),o("",u)}t.setWithEnv=a})(be||(be={})),tt=be,yn=class{constructor(t,r,n,s,p,l){this.category=t,this.name=r,this.startTime=n,this.endCallback=s,this.timer=p,this.ctx=l}async end(){return this.endCallback(this)}async checkTimer(){if(this.ctx===void 0||this.timer===void 0)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}},wn=class{constructor(t,r,n,s){this.category=t,this.name=r,this.startTime=n,this.endTime=s}},hl=class{constructor(t,r,n){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=t===void 0?1e4:t,this._flushBatchSize=r===void 0?10:r,this._flushIntervalInMilliseconds=n===void 0?5e3:n}static create(t){return t===void 0?new this:new this(t.maxNumberEvents,t.flushBatchSize,t.flushIntervalInMilliseconds)}start(){this._started=!0,this._timingEvents=[],this._flushTime=ze(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(t,r,n,s){let p=this._started?this.begin(t,r,s):void 0,l=!1,c=n();if(c&&typeof c.then=="function")return l=!0,new Promise((o,a)=>{c.then(async e=>{p&&await p.end(),o(e)},async e=>{p&&await p.end(),a(e)})});if(!l&&p){let o=p.end();if(o&&typeof o.then=="function")return new Promise((a,e)=>{o.then(()=>{a(c)},u=>{e(u)})})}return c}begin(t,r,n){if(!this._started)throw new Error("profiler is not started yet");if(n===void 0){let s=ze();return this.flush(s),new yn(t,r,s,p=>this.endSync(p))}else{let s=n.beginTimer();return new yn(t,r,0,async p=>this.end(p),s,n)}}async end(t){let r=await t.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new wn(t.category,t.name,t.startTime,r)),this.flush(r))}endSync(t){let r=ze();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new wn(t.category,t.name,t.startTime,r)),this.flush(r))}logOneEvent(t){tt.verbose(`Profiler.${t.category}`,`${(t.endTime-t.startTime).toFixed(2)}ms on event '${t.name}' at ${t.endTime.toFixed(2)}`)}flush(t){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(let r=this._flushPointer;this._flushPointer<r+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=ze()}}get started(){return this._started}},ze=typeof performance<"u"&&performance.now?()=>performance.now():Date.now});function Dh(t,r,n){for(let s of n){let p=s[0],l=s[1],c=s[2],o=s[3],a=s[4];if(t.opType===p){for(let e of r)if((e.domain===l||e.domain==="ai.onnx"&&l==="")&&Nh(e.version,c))return{opImpl:o,opInit:a}}}throw new TypeError(`cannot resolve operator '${t.opType}' with opsets: ${r.map(s=>`${s.domain||"ai.onnx"} v${s.version}`).join(", ")}`)}function Nh(t,r){if(r.endsWith("+")){let n=Number.parseInt(r.substring(0,r.length-1),10);return!isNaN(n)&&n<=t}else if(r.split("-").length===2){let n=r.split("-"),s=Number.parseInt(n[0],10),p=Number.parseInt(n[1],10);return!isNaN(s)&&!isNaN(p)&&s<=t&&t<=p}else return Number.parseInt(r,10)===t}var kh=I(()=>{"use strict"}),Fh=nt(t=>{"use strict";t.__esModule=!0;var r=function(){function n(s){if(!s)throw new TypeError("Invalid argument; `value` has no value.");this.value=n.EMPTY,s&&n.isGuid(s)&&(this.value=s)}return n.isGuid=function(s){var p=s.toString();return s&&(s instanceof n||n.validator.test(p))},n.create=function(){return new n([n.gen(2),n.gen(1),n.gen(1),n.gen(1),n.gen(3)].join("-"))},n.createEmpty=function(){return new n("emptyguid")},n.parse=function(s){return new n(s)},n.raw=function(){return[n.gen(2),n.gen(1),n.gen(1),n.gen(1),n.gen(3)].join("-")},n.gen=function(s){for(var p="",l=0;l<s;l++)p+=((1+Math.random())*65536|0).toString(16).substring(1);return p},n.prototype.equals=function(s){return n.isGuid(s)&&this.value===s.toString()},n.prototype.isEmpty=function(){return this.value===n.EMPTY},n.prototype.toString=function(){return this.value},n.prototype.toJSON=function(){return{value:this.value}},n.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),n.EMPTY="00000000-0000-0000-0000-000000000000",n}();t.Guid=r});function W(t,r,n){this.low=t|0,this.high=r|0,this.unsigned=!!n}function dt(t){return(t&&t.__isLong__)===!0}function ma(t){var r=Math.clz32(t&-t);return t?31-r:r}function pe(t,r){var n,s,p;return r?(t>>>=0,(p=0<=t&&t<256)&&(s=ao[t],s)?s:(n=M(t,0,!0),p&&(ao[t]=n),n)):(t|=0,(p=-128<=t&&t<128)&&(s=io[t],s)?s:(n=M(t,t<0?-1:0,!1),p&&(io[t]=n),n))}function kt(t,r){if(isNaN(t))return r?Bt:Nt;if(r){if(t<0)return Bt;if(t>=so)return po}else{if(t<=-uo)return mt;if(t+1>=uo)return lo}return t<0?kt(-t,r).neg():M(t%ye|0,t/ye|0,r)}function M(t,r,n){return new W(t,r,n)}function Go(t,r,n){if(t.length===0)throw Error("empty string");if(typeof r=="number"?(n=r,r=!1):r=!!r,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return r?Bt:Nt;if(n=n||10,n<2||36<n)throw RangeError("radix");var s;if((s=t.indexOf("-"))>0)throw Error("interior hyphen");if(s===0)return Go(t.substring(1),r,n).neg();for(var p=kt(sr(n,8)),l=Nt,c=0;c<t.length;c+=8){var o=Math.min(8,t.length-c),a=parseInt(t.substring(c,c+o),n);if(o<8){var e=kt(sr(n,o));l=l.mul(e).add(kt(a))}else l=l.mul(p),l=l.add(kt(a))}return l.unsigned=r,l}function Lt(t,r){return typeof t=="number"?kt(t,r):typeof t=="string"?Go(t,r):M(t.low,t.high,typeof r=="boolean"?r:t.unsigned)}var _t,io,ao,sr,vn,ba,ye,so,uo,xn,Nt,Bt,ce,Tn,Fr,lo,po,mt,A,ee,fl=I(()=>{_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{}W.prototype.__isLong__,Object.defineProperty(W.prototype,"__isLong__",{value:!0}),W.isLong=dt,io={},ao={},W.fromInt=pe,W.fromNumber=kt,W.fromBits=M,sr=Math.pow,W.fromString=Go,W.fromValue=Lt,vn=65536,ba=1<<24,ye=vn*vn,so=ye*ye,uo=so/2,xn=pe(ba),Nt=pe(0),W.ZERO=Nt,Bt=pe(0,!0),W.UZERO=Bt,ce=pe(1),W.ONE=ce,Tn=pe(1,!0),W.UONE=Tn,Fr=pe(-1),W.NEG_ONE=Fr,lo=M(-1,2147483647,!1),W.MAX_VALUE=lo,po=M(-1,-1,!0),W.MAX_UNSIGNED_VALUE=po,mt=M(0,-2147483648,!1),W.MIN_VALUE=mt,A=W.prototype,A.toInt=function(){return this.unsigned?this.low>>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*ye+(this.low>>>0):this.high*ye+(this.low>>>0)},A.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(mt)){var r=kt(t),n=this.div(r),s=n.mul(r).sub(this);return n.toString(t)+s.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var p=kt(sr(t,6),this.unsigned),l=this,c="";;){var o=l.div(p),a=l.sub(o.mul(p)).toInt()>>>0,e=a.toString(t);if(l=o,l.isZero())return e+c;for(;e.length<6;)e="0"+e;c=""+e+c}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(mt)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1},A.isZero=function(){return this.high===0&&this.low===0},A.eqz=A.isZero,A.isNegative=function(){return!this.unsigned&&this.high<0},A.isPositive=function(){return this.unsigned||this.high>=0},A.isOdd=function(){return(this.low&1)===1},A.isEven=function(){return(this.low&1)===0},A.equals=function(t){return dt(t)||(t=Lt(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},A.eq=A.equals,A.notEquals=function(t){return!this.eq(t)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(t){return this.comp(t)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(t){return this.comp(t)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(t){return this.comp(t)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(t){return this.comp(t)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.compare=function(t){if(dt(t)||(t=Lt(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(mt)?mt:this.not().add(ce)},A.neg=A.negate,A.add=function(t){dt(t)||(t=Lt(t));var r=this.high>>>16,n=this.high&65535,s=this.low>>>16,p=this.low&65535,l=t.high>>>16,c=t.high&65535,o=t.low>>>16,a=t.low&65535,e=0,u=0,i=0,d=0;return d+=p+a,i+=d>>>16,d&=65535,i+=s+o,u+=i>>>16,i&=65535,u+=n+c,e+=u>>>16,u&=65535,e+=r+l,e&=65535,M(i<<16|d,e<<16|u,this.unsigned)},A.subtract=function(t){return dt(t)||(t=Lt(t)),this.add(t.neg())},A.sub=A.subtract,A.multiply=function(t){if(this.isZero())return this;if(dt(t)||(t=Lt(t)),_t){var r=_t.mul(this.low,this.high,t.low,t.high);return M(r,_t.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Bt:Nt;if(this.eq(mt))return t.isOdd()?mt:Nt;if(t.eq(mt))return this.isOdd()?mt:Nt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(xn)&&t.lt(xn))return kt(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,s=this.high&65535,p=this.low>>>16,l=this.low&65535,c=t.high>>>16,o=t.high&65535,a=t.low>>>16,e=t.low&65535,u=0,i=0,d=0,h=0;return h+=l*e,d+=h>>>16,h&=65535,d+=p*e,i+=d>>>16,d&=65535,d+=l*a,i+=d>>>16,d&=65535,i+=s*e,u+=i>>>16,i&=65535,i+=p*a,u+=i>>>16,i&=65535,i+=l*o,u+=i>>>16,i&=65535,u+=n*e+s*a+p*o+l*c,u&=65535,M(d<<16|h,u<<16|i,this.unsigned)},A.mul=A.multiply,A.divide=function(t){if(dt(t)||(t=Lt(t)),t.isZero())throw Error("division by zero");if(_t){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?_t.div_u:_t.div_s)(this.low,this.high,t.low,t.high);return M(r,_t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Bt:Nt;var n,s,p;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Bt;if(t.gt(this.shru(1)))return Tn;p=Bt}else{if(this.eq(mt)){if(t.eq(ce)||t.eq(Fr))return mt;if(t.eq(mt))return ce;var l=this.shr(1);return n=l.div(t).shl(1),n.eq(Nt)?t.isNegative()?ce:Fr:(s=this.sub(t.mul(n)),p=n.add(s.div(t)),p)}else if(t.eq(mt))return this.unsigned?Bt:Nt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();p=Nt}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),o=c<=48?1:sr(2,c-48),a=kt(n),e=a.mul(t);e.isNegative()||e.gt(s);)n-=o,a=kt(n,this.unsigned),e=a.mul(t);a.isZero()&&(a=ce),p=p.add(a),s=s.sub(e)}return p},A.div=A.divide,A.modulo=function(t){if(dt(t)||(t=Lt(t)),_t){var r=(this.unsigned?_t.rem_u:_t.rem_s)(this.low,this.high,t.low,t.high);return M(r,_t.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return M(~this.low,~this.high,this.unsigned)},A.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},A.clz=A.countLeadingZeros,A.countTrailingZeros=function(){return this.low?ma(this.low):ma(this.high)+32},A.ctz=A.countTrailingZeros,A.and=function(t){return dt(t)||(t=Lt(t)),M(this.low&t.low,this.high&t.high,this.unsigned)},A.or=function(t){return dt(t)||(t=Lt(t)),M(this.low|t.low,this.high|t.high,this.unsigned)},A.xor=function(t){return dt(t)||(t=Lt(t)),M(this.low^t.low,this.high^t.high,this.unsigned)},A.shiftLeft=function(t){return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?M(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):M(0,this.low<<t-32,this.unsigned)},A.shl=A.shiftLeft,A.shiftRight=function(t){return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?M(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):M(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(t){return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?M(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?M(this.high,0,this.unsigned):M(this.high>>>t-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.rotateLeft=function(t){var r;return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?M(this.high,this.low,this.unsigned):t<32?(r=32-t,M(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,M(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))},A.rotl=A.rotateLeft,A.rotateRight=function(t){var r;return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?M(this.high,this.low,this.unsigned):t<32?(r=32-t,M(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,M(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))},A.rotr=A.rotateRight,A.toSigned=function(){return this.unsigned?M(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:M(this.low,this.high,!0)},A.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},A.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},W.fromBytes=function(t,r,n){return n?W.fromBytesLE(t,r):W.fromBytesBE(t,r)},W.fromBytesLE=function(t,r){return new W(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},W.fromBytesBE=function(t,r){return new W(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},ee=W}),T,Ho=I(()=>{T={},T.Offset,T.Table,T.SIZEOF_SHORT=2,T.SIZEOF_INT=4,T.FILE_IDENTIFIER_LENGTH=4,T.SIZE_PREFIX_LENGTH=4,T.Encoding={UTF8_BYTES:1,UTF16_STRING:2},T.int32=new Int32Array(2),T.float32=new Float32Array(T.int32.buffer),T.float64=new Float64Array(T.int32.buffer),T.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,T.Long=function(t,r){this.low=t|0,this.high=r|0},T.Long.create=function(t,r){return t==0&&r==0?T.Long.ZERO:new T.Long(t,r)},T.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296},T.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},T.Long.ZERO=new T.Long(0,0),T.Builder=function(t){if(t)var r=t;else var r=1024;this.bb=T.ByteBuffer.allocate(r),this.space=r,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},T.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},T.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},T.Builder.prototype.dataBuffer=function(){return this.bb},T.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},T.Builder.prototype.prep=function(t,r){t>this.minalign&&(this.minalign=t);for(var n=~(this.bb.capacity()-this.space+r)+1&t-1;this.space<n+t+r;){var s=this.bb.capacity();this.bb=T.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)},T.Builder.prototype.pad=function(t){for(var r=0;r<t;r++)this.bb.writeInt8(--this.space,0)},T.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},T.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},T.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},T.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},T.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},T.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},T.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},T.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},T.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},T.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},T.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},T.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},T.Builder.prototype.addFieldInt8=function(t,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(t))},T.Builder.prototype.addFieldInt16=function(t,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(t))},T.Builder.prototype.addFieldInt32=function(t,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(t))},T.Builder.prototype.addFieldInt64=function(t,r,n){(this.force_defaults||!r.equals(n))&&(this.addInt64(r),this.slot(t))},T.Builder.prototype.addFieldFloat32=function(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(t))},T.Builder.prototype.addFieldFloat64=function(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(t))},T.Builder.prototype.addFieldOffset=function(t,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(t))},T.Builder.prototype.addFieldStruct=function(t,r,n){r!=n&&(this.nested(r),this.slot(t))},T.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},T.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},T.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},T.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},T.Builder.growByteBuffer=function(t){var r=t.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=r<<1,s=T.ByteBuffer.allocate(n);return s.setPosition(n-r),s.bytes().set(t.bytes(),n-r),s},T.Builder.prototype.addOffset=function(t){this.prep(T.SIZEOF_INT,0),this.writeInt32(this.offset()-t+T.SIZEOF_INT)},T.Builder.prototype.startObject=function(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(var r=0;r<t;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()},T.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),r=this.vtable_in_use-1;r>=0&&this.vtable[r]==0;r--);for(var n=r+1;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);var s=2;this.addInt16(t-this.object_start);var p=(n+s)*T.SIZEOF_SHORT;this.addInt16(p);var l=0,c=this.space;t:for(r=0;r<this.vtables.length;r++){var o=this.bb.capacity()-this.vtables[r];if(p==this.bb.readInt16(o)){for(var a=T.SIZEOF_SHORT;a<p;a+=T.SIZEOF_SHORT)if(this.bb.readInt16(c+a)!=this.bb.readInt16(o+a))continue t;l=this.vtables[r];break}}return l?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,l-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},T.Builder.prototype.finish=function(t,r,n){var s=n?T.SIZE_PREFIX_LENGTH:0;if(r){var p=r;if(this.prep(this.minalign,T.SIZEOF_INT+T.FILE_IDENTIFIER_LENGTH+s),p.length!=T.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+T.FILE_IDENTIFIER_LENGTH);for(var l=T.FILE_IDENTIFIER_LENGTH-1;l>=0;l--)this.writeInt8(p.charCodeAt(l))}this.prep(this.minalign,T.SIZEOF_INT+s),this.addOffset(t),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},T.Builder.prototype.finishSizePrefixed=function(t,r){this.finish(t,r,!0)},T.Builder.prototype.requiredField=function(t,r){var n=this.bb.capacity()-t,s=n-this.bb.readInt32(n),p=this.bb.readInt16(s+r)!=0;if(!p)throw new Error("FlatBuffers: field "+r+" must be set")},T.Builder.prototype.startVector=function(t,r,n){this.notNested(),this.vector_num_elems=r,this.prep(T.SIZEOF_INT,t*r),this.prep(n,t*r)},T.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},T.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var r=t;else for(var r=[],n=0;n<t.length;){var s,p=t.charCodeAt(n++);if(p<55296||p>=56320)s=p;else{var l=t.charCodeAt(n++);s=(p<<10)+l+-56613888}s<128?r.push(s):(s<2048?r.push(s>>6&31|192):(s<65536?r.push(s>>12&15|224):r.push(s>>18&7|240,s>>12&63|128),r.push(s>>6&63|128)),r.push(s&63|128))}this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length);for(var n=0,c=this.space,o=this.bb.bytes();n<r.length;n++)o[c++]=r[n];return this.endVector()},T.Builder.prototype.createLong=function(t,r){return T.Long.create(t,r)},T.ByteBuffer=function(t){this.bytes_=t,this.position_=0},T.ByteBuffer.allocate=function(t){return new T.ByteBuffer(new Uint8Array(t))},T.ByteBuffer.prototype.clear=function(){this.position_=0},T.ByteBuffer.prototype.bytes=function(){return this.bytes_},T.ByteBuffer.prototype.position=function(){return this.position_},T.ByteBuffer.prototype.setPosition=function(t){this.position_=t},T.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},T.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},T.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},T.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},T.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},T.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},T.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},T.ByteBuffer.prototype.readInt64=function(t){return new T.Long(this.readInt32(t),this.readInt32(t+4))},T.ByteBuffer.prototype.readUint64=function(t){return new T.Long(this.readUint32(t),this.readUint32(t+4))},T.ByteBuffer.prototype.readFloat32=function(t){return T.int32[0]=this.readInt32(t),T.float32[0]},T.ByteBuffer.prototype.readFloat64=function(t){return T.int32[T.isLittleEndian?0:1]=this.readInt32(t),T.int32[T.isLittleEndian?1:0]=this.readInt32(t+4),T.float64[0]},T.ByteBuffer.prototype.writeInt8=function(t,r){this.bytes_[t]=r},T.ByteBuffer.prototype.writeUint8=function(t,r){this.bytes_[t]=r},T.ByteBuffer.prototype.writeInt16=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8},T.ByteBuffer.prototype.writeUint16=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8},T.ByteBuffer.prototype.writeInt32=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24},T.ByteBuffer.prototype.writeUint32=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24},T.ByteBuffer.prototype.writeInt64=function(t,r){this.writeInt32(t,r.low),this.writeInt32(t+4,r.high)},T.ByteBuffer.prototype.writeUint64=function(t,r){this.writeUint32(t,r.low),this.writeUint32(t+4,r.high)},T.ByteBuffer.prototype.writeFloat32=function(t,r){T.float32[0]=r,this.writeInt32(t,T.int32[0])},T.ByteBuffer.prototype.writeFloat64=function(t,r){T.float64[0]=r,this.writeInt32(t,T.int32[T.isLittleEndian?0:1]),this.writeInt32(t+4,T.int32[T.isLittleEndian?1:0])},T.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+T.SIZEOF_INT+T.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",r=0;r<T.FILE_IDENTIFIER_LENGTH;r++)t+=String.fromCharCode(this.readInt8(this.position_+T.SIZEOF_INT+r));return t},T.ByteBuffer.prototype.__offset=function(t,r){var n=t-this.readInt32(t);return r<this.readInt16(n)?this.readInt16(n+r):0},T.ByteBuffer.prototype.__union=function(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t},T.ByteBuffer.prototype.__string=function(t,r){t+=this.readInt32(t);var n=this.readInt32(t),s="",p=0;if(t+=T.SIZEOF_INT,r===T.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+n);for(;p<n;){var l,c=this.readUint8(t+p++);if(c<192)l=c;else{var o=this.readUint8(t+p++);if(c<224)l=(c&31)<<6|o&63;else{var a=this.readUint8(t+p++);if(c<240)l=(c&15)<<12|(o&63)<<6|a&63;else{var e=this.readUint8(t+p++);l=(c&7)<<18|(o&63)<<12|(a&63)<<6|e&63}}}l<65536?s+=String.fromCharCode(l):(l-=65536,s+=String.fromCharCode((l>>10)+55296,(l&1023)+56320))}return s},T.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},T.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+T.SIZEOF_INT},T.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},T.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=T.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+T.FILE_IDENTIFIER_LENGTH);for(var r=0;r<T.FILE_IDENTIFIER_LENGTH;r++)if(t.charCodeAt(r)!=this.readInt8(this.position_+T.SIZEOF_INT+r))return!1;return!0},T.ByteBuffer.prototype.createLong=function(t,r){return T.Long.create(t,r)}}),H,Zr=I(()=>{"use strict";Ho(),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.UNDEFINED=0]="UNDEFINED",c[c.FLOAT=1]="FLOAT",c[c.INT=2]="INT",c[c.STRING=3]="STRING",c[c.TENSOR=4]="TENSOR",c[c.GRAPH=5]="GRAPH",c[c.FLOATS=6]="FLOATS",c[c.INTS=7]="INTS",c[c.STRINGS=8]="STRINGS",c[c.TENSORS=9]="TENSORS",c[c.GRAPHS=10]="GRAPHS",c[c.SPARSE_TENSOR=11]="SPARSE_TENSOR",c[c.SPARSE_TENSORS=12]="SPARSE_TENSORS"))(l=p.AttributeType||(p.AttributeType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.UNKNOWN=0]="UNKNOWN",c[c.VALUE=1]="VALUE",c[c.PARAM=2]="PARAM"))(l=p.DimensionValueType||(p.DimensionValueType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.UNDEFINED=0]="UNDEFINED",c[c.FLOAT=1]="FLOAT",c[c.UINT8=2]="UINT8",c[c.INT8=3]="INT8",c[c.UINT16=4]="UINT16",c[c.INT16=5]="INT16",c[c.INT32=6]="INT32",c[c.INT64=7]="INT64",c[c.STRING=8]="STRING",c[c.BOOL=9]="BOOL",c[c.FLOAT16=10]="FLOAT16",c[c.DOUBLE=11]="DOUBLE",c[c.UINT32=12]="UINT32",c[c.UINT64=13]="UINT64",c[c.COMPLEX64=14]="COMPLEX64",c[c.COMPLEX128=15]="COMPLEX128",c[c.BFLOAT16=16]="BFLOAT16",c[c.FLOAT8E4M3FN=17]="FLOAT8E4M3FN",c[c.FLOAT8E4M3FNUZ=18]="FLOAT8E4M3FNUZ",c[c.FLOAT8E5M2=19]="FLOAT8E5M2",c[c.FLOAT8E5M2FNUZ=20]="FLOAT8E5M2FNUZ"))(l=p.TensorDataType||(p.TensorDataType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.Primitive=0]="Primitive",c[c.Fused=1]="Fused"))(l=p.NodeType||(p.NodeType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.NONE=0]="NONE",c[c.tensor_type=1]="tensor_type",c[c.sequence_type=2]="sequence_type",c[c.map_type=3]="map_type"))(l=p.TypeInfoValue||(p.TypeInfoValue={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsShape(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsShape(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}dim(o,a){let e=this.bb.__offset(this.bb_pos,4);return e?(a||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}dimLength(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__vector_len(this.bb_pos+o):0}static startShape(o){o.startObject(1)}static addDim(o,a){o.addFieldOffset(0,a,0)}static createDimVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startDimVector(o,a){o.startVector(4,a,4)}static endShape(o){return o.endObject()}static createShape(o,a){return l.startShape(o),l.addDim(o,a),l.endShape(o)}}p.Shape=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsDimension(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsDimension(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}value(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}denotation(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}static startDimension(o){o.startObject(2)}static addValue(o,a){o.addFieldOffset(0,a,0)}static addDenotation(o,a){o.addFieldOffset(1,a,0)}static endDimension(o){return o.endObject()}static createDimension(o,a,e){return l.startDimension(o),l.addValue(o,a),l.addDenotation(o,e),l.endDimension(o)}}p.Dimension=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsDimensionValue(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsDimensionValue(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}dimType(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt8(this.bb_pos+o):0}dimValue(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}dimParam(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,o):null}static startDimensionValue(o){o.startObject(3)}static addDimType(o,a){o.addFieldInt8(0,a,0)}static addDimValue(o,a){o.addFieldInt64(1,a,o.createLong(0,0))}static addDimParam(o,a){o.addFieldOffset(2,a,0)}static endDimensionValue(o){return o.endObject()}static createDimensionValue(o,a,e,u){return l.startDimensionValue(o),l.addDimType(o,a),l.addDimValue(o,e),l.addDimParam(o,u),l.endDimensionValue(o)}}p.DimensionValue=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsTensorTypeAndShape(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsTensorTypeAndShape(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}elemType(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt32(this.bb_pos+o):0}shape(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startTensorTypeAndShape(o){o.startObject(2)}static addElemType(o,a){o.addFieldInt32(0,a,0)}static addShape(o,a){o.addFieldOffset(1,a,0)}static endTensorTypeAndShape(o){return o.endObject()}static createTensorTypeAndShape(o,a,e){return l.startTensorTypeAndShape(o),l.addElemType(o,a),l.addShape(o,e),l.endTensorTypeAndShape(o)}}p.TensorTypeAndShape=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsMapType(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsMapType(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}keyType(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt32(this.bb_pos+o):0}valueType(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startMapType(o){o.startObject(2)}static addKeyType(o,a){o.addFieldInt32(0,a,0)}static addValueType(o,a){o.addFieldOffset(1,a,0)}static endMapType(o){return o.endObject()}static createMapType(o,a,e){return l.startMapType(o),l.addKeyType(o,a),l.addValueType(o,e),l.endMapType(o)}}p.MapType=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSequenceType(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSequenceType(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}elemType(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startSequenceType(o){o.startObject(1)}static addElemType(o,a){o.addFieldOffset(0,a,0)}static endSequenceType(o){return o.endObject()}static createSequenceType(o,a){return l.startSequenceType(o),l.addElemType(o,a),l.endSequenceType(o)}}p.SequenceType=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,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(o,a,e,u){return o.prep(4,12),o.writeInt32(u),o.writeInt32(e),o.writeInt32(a),o.offset()}}p.EdgeEnd=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsNodeEdge(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsNodeEdge(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}nodeIndex(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readUint32(this.bb_pos+o):0}inputEdges(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+e)+o*12,this.bb):null}inputEdgesLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}outputEdges(o,a){let e=this.bb.__offset(this.bb_pos,8);return e?(a||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+e)+o*12,this.bb):null}outputEdgesLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}static startNodeEdge(o){o.startObject(3)}static addNodeIndex(o,a){o.addFieldInt32(0,a,0)}static addInputEdges(o,a){o.addFieldOffset(1,a,0)}static startInputEdgesVector(o,a){o.startVector(12,a,4)}static addOutputEdges(o,a){o.addFieldOffset(2,a,0)}static startOutputEdgesVector(o,a){o.startVector(12,a,4)}static endNodeEdge(o){return o.endObject()}static createNodeEdge(o,a,e,u){return l.startNodeEdge(o),l.addNodeIndex(o,a),l.addInputEdges(o,e),l.addOutputEdges(o,u),l.endNodeEdge(o)}}p.NodeEdge=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsNode(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsNode(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}domain(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,o):null}sinceVersion(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readInt32(this.bb_pos+o):0}index(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.readUint32(this.bb_pos+o):0}opType(o){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__string(this.bb_pos+a,o):null}type(){let o=this.bb.__offset(this.bb_pos,16);return o?this.bb.readInt32(this.bb_pos+o):0}executionProviderType(o){let a=this.bb.__offset(this.bb_pos,18);return a?this.bb.__string(this.bb_pos+a,o):null}inputs(o,a){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}inputsLength(){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.__vector_len(this.bb_pos+o):0}outputs(o,a){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}outputsLength(){let o=this.bb.__offset(this.bb_pos,22);return o?this.bb.__vector_len(this.bb_pos+o):0}attributes(o,a){let e=this.bb.__offset(this.bb_pos,24);return e?(a||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}attributesLength(){let o=this.bb.__offset(this.bb_pos,24);return o?this.bb.__vector_len(this.bb_pos+o):0}inputArgCounts(o){let a=this.bb.__offset(this.bb_pos,26);return a?this.bb.readInt32(this.bb.__vector(this.bb_pos+a)+o*4):0}inputArgCountsLength(){let o=this.bb.__offset(this.bb_pos,26);return o?this.bb.__vector_len(this.bb_pos+o):0}inputArgCountsArray(){let o=this.bb.__offset(this.bb_pos,26);return o?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}implicitInputs(o,a){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}implicitInputsLength(){let o=this.bb.__offset(this.bb_pos,28);return o?this.bb.__vector_len(this.bb_pos+o):0}static startNode(o){o.startObject(13)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addDomain(o,a){o.addFieldOffset(2,a,0)}static addSinceVersion(o,a){o.addFieldInt32(3,a,0)}static addIndex(o,a){o.addFieldInt32(4,a,0)}static addOpType(o,a){o.addFieldOffset(5,a,0)}static addType(o,a){o.addFieldInt32(6,a,0)}static addExecutionProviderType(o,a){o.addFieldOffset(7,a,0)}static addInputs(o,a){o.addFieldOffset(8,a,0)}static createInputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startInputsVector(o,a){o.startVector(4,a,4)}static addOutputs(o,a){o.addFieldOffset(9,a,0)}static createOutputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startOutputsVector(o,a){o.startVector(4,a,4)}static addAttributes(o,a){o.addFieldOffset(10,a,0)}static createAttributesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startAttributesVector(o,a){o.startVector(4,a,4)}static addInputArgCounts(o,a){o.addFieldOffset(11,a,0)}static createInputArgCountsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addInt32(a[e]);return o.endVector()}static startInputArgCountsVector(o,a){o.startVector(4,a,4)}static addImplicitInputs(o,a){o.addFieldOffset(12,a,0)}static createImplicitInputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startImplicitInputsVector(o,a){o.startVector(4,a,4)}static endNode(o){return o.endObject()}static createNode(o,a,e,u,i,d,h,m,b,x,E,w,S,$){return l.startNode(o),l.addName(o,a),l.addDocString(o,e),l.addDomain(o,u),l.addSinceVersion(o,i),l.addIndex(o,d),l.addOpType(o,h),l.addType(o,m),l.addExecutionProviderType(o,b),l.addInputs(o,x),l.addOutputs(o,E),l.addAttributes(o,w),l.addInputArgCounts(o,S),l.addImplicitInputs(o,$),l.endNode(o)}}p.Node=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsValueInfo(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsValueInfo(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}type(o){let a=this.bb.__offset(this.bb_pos,8);return a?(o||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startValueInfo(o){o.startObject(3)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addType(o,a){o.addFieldOffset(2,a,0)}static endValueInfo(o){return o.endObject()}static createValueInfo(o,a,e,u){return l.startValueInfo(o),l.addName(o,a),l.addDocString(o,e),l.addType(o,u),l.endValueInfo(o)}}p.ValueInfo=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsTypeInfo(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsTypeInfo(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}denotation(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}valueType(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readUint8(this.bb_pos+o):0}value(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__union(o,this.bb_pos+a):null}static startTypeInfo(o){o.startObject(3)}static addDenotation(o,a){o.addFieldOffset(0,a,0)}static addValueType(o,a){o.addFieldInt8(1,a,0)}static addValue(o,a){o.addFieldOffset(2,a,0)}static endTypeInfo(o){return o.endObject()}static createTypeInfo(o,a,e,u){return l.startTypeInfo(o),l.addDenotation(o,a),l.addValueType(o,e),l.addValue(o,u),l.endTypeInfo(o)}}p.TypeInfo=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsOperatorSetId(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsOperatorSetId(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}domain(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}version(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}static startOperatorSetId(o){o.startObject(2)}static addDomain(o,a){o.addFieldOffset(0,a,0)}static addVersion(o,a){o.addFieldInt64(1,a,o.createLong(0,0))}static endOperatorSetId(o){return o.endObject()}static createOperatorSetId(o,a,e){return l.startOperatorSetId(o),l.addDomain(o,a),l.addVersion(o,e),l.endOperatorSetId(o)}}p.OperatorSetId=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsTensor(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsTensor(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}dims(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}dimsLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}dataType(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readInt32(this.bb_pos+o):0}rawData(o){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.readUint8(this.bb.__vector(this.bb_pos+a)+o):0}rawDataLength(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.__vector_len(this.bb_pos+o):0}rawDataArray(){let o=this.bb.__offset(this.bb_pos,12);return o?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}stringData(o,a){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}stringDataLength(){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__vector_len(this.bb_pos+o):0}static startTensor(o){o.startObject(6)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addDims(o,a){o.addFieldOffset(2,a,0)}static createDimsVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startDimsVector(o,a){o.startVector(8,a,8)}static addDataType(o,a){o.addFieldInt32(3,a,0)}static addRawData(o,a){o.addFieldOffset(4,a,0)}static createRawDataVector(o,a){o.startVector(1,a.length,1);for(let e=a.length-1;e>=0;e--)o.addInt8(a[e]);return o.endVector()}static startRawDataVector(o,a){o.startVector(1,a,1)}static addStringData(o,a){o.addFieldOffset(5,a,0)}static createStringDataVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startStringDataVector(o,a){o.startVector(4,a,4)}static endTensor(o){return o.endObject()}static createTensor(o,a,e,u,i,d,h){return l.startTensor(o),l.addName(o,a),l.addDocString(o,e),l.addDims(o,u),l.addDataType(o,i),l.addRawData(o,d),l.addStringData(o,h),l.endTensor(o)}}p.Tensor=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSparseTensor(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSparseTensor(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}values(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}indices(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}dims(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}dimsLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}static startSparseTensor(o){o.startObject(3)}static addValues(o,a){o.addFieldOffset(0,a,0)}static addIndices(o,a){o.addFieldOffset(1,a,0)}static addDims(o,a){o.addFieldOffset(2,a,0)}static createDimsVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startDimsVector(o,a){o.startVector(8,a,8)}static endSparseTensor(o){return o.endObject()}static createSparseTensor(o,a,e,u){return l.startSparseTensor(o),l.addValues(o,a),l.addIndices(o,e),l.addDims(o,u),l.endSparseTensor(o)}}p.SparseTensor=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsAttribute(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsAttribute(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}type(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.readInt32(this.bb_pos+o):0}f(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readFloat32(this.bb_pos+o):0}i(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}s(o){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__string(this.bb_pos+a,o):null}t(o){let a=this.bb.__offset(this.bb_pos,16);return a?(o||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}g(o){let a=this.bb.__offset(this.bb_pos,18);return a?(o||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}floats(o){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.readFloat32(this.bb.__vector(this.bb_pos+a)+o*4):0}floatsLength(){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.__vector_len(this.bb_pos+o):0}floatsArray(){let o=this.bb.__offset(this.bb_pos,20);return o?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}ints(o){let a=this.bb.__offset(this.bb_pos,22);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}intsLength(){let o=this.bb.__offset(this.bb_pos,22);return o?this.bb.__vector_len(this.bb_pos+o):0}strings(o,a){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}stringsLength(){let o=this.bb.__offset(this.bb_pos,24);return o?this.bb.__vector_len(this.bb_pos+o):0}tensors(o,a){let e=this.bb.__offset(this.bb_pos,26);return e?(a||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}tensorsLength(){let o=this.bb.__offset(this.bb_pos,26);return o?this.bb.__vector_len(this.bb_pos+o):0}graphs(o,a){let e=this.bb.__offset(this.bb_pos,28);return e?(a||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}graphsLength(){let o=this.bb.__offset(this.bb_pos,28);return o?this.bb.__vector_len(this.bb_pos+o):0}static startAttribute(o){o.startObject(13)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addType(o,a){o.addFieldInt32(2,a,0)}static addF(o,a){o.addFieldFloat32(3,a,0)}static addI(o,a){o.addFieldInt64(4,a,o.createLong(0,0))}static addS(o,a){o.addFieldOffset(5,a,0)}static addT(o,a){o.addFieldOffset(6,a,0)}static addG(o,a){o.addFieldOffset(7,a,0)}static addFloats(o,a){o.addFieldOffset(8,a,0)}static createFloatsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addFloat32(a[e]);return o.endVector()}static startFloatsVector(o,a){o.startVector(4,a,4)}static addInts(o,a){o.addFieldOffset(9,a,0)}static createIntsVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startIntsVector(o,a){o.startVector(8,a,8)}static addStrings(o,a){o.addFieldOffset(10,a,0)}static createStringsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startStringsVector(o,a){o.startVector(4,a,4)}static addTensors(o,a){o.addFieldOffset(11,a,0)}static createTensorsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startTensorsVector(o,a){o.startVector(4,a,4)}static addGraphs(o,a){o.addFieldOffset(12,a,0)}static createGraphsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startGraphsVector(o,a){o.startVector(4,a,4)}static endAttribute(o){return o.endObject()}static createAttribute(o,a,e,u,i,d,h,m,b,x,E,w,S,$){return l.startAttribute(o),l.addName(o,a),l.addDocString(o,e),l.addType(o,u),l.addF(o,i),l.addI(o,d),l.addS(o,h),l.addT(o,m),l.addG(o,b),l.addFloats(o,x),l.addInts(o,E),l.addStrings(o,w),l.addTensors(o,S),l.addGraphs(o,$),l.endAttribute(o)}}p.Attribute=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsGraph(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsGraph(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}initializers(o,a){let e=this.bb.__offset(this.bb_pos,4);return e?(a||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}initializersLength(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__vector_len(this.bb_pos+o):0}nodeArgs(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}nodeArgsLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}nodes(o,a){let e=this.bb.__offset(this.bb_pos,8);return e?(a||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}nodesLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}maxNodeIndex(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readUint32(this.bb_pos+o):0}nodeEdges(o,a){let e=this.bb.__offset(this.bb_pos,12);return e?(a||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}nodeEdgesLength(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.__vector_len(this.bb_pos+o):0}inputs(o,a){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}inputsLength(){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__vector_len(this.bb_pos+o):0}outputs(o,a){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}outputsLength(){let o=this.bb.__offset(this.bb_pos,16);return o?this.bb.__vector_len(this.bb_pos+o):0}sparseInitializers(o,a){let e=this.bb.__offset(this.bb_pos,18);return e?(a||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}sparseInitializersLength(){let o=this.bb.__offset(this.bb_pos,18);return o?this.bb.__vector_len(this.bb_pos+o):0}static startGraph(o){o.startObject(8)}static addInitializers(o,a){o.addFieldOffset(0,a,0)}static createInitializersVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startInitializersVector(o,a){o.startVector(4,a,4)}static addNodeArgs(o,a){o.addFieldOffset(1,a,0)}static createNodeArgsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startNodeArgsVector(o,a){o.startVector(4,a,4)}static addNodes(o,a){o.addFieldOffset(2,a,0)}static createNodesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startNodesVector(o,a){o.startVector(4,a,4)}static addMaxNodeIndex(o,a){o.addFieldInt32(3,a,0)}static addNodeEdges(o,a){o.addFieldOffset(4,a,0)}static createNodeEdgesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startNodeEdgesVector(o,a){o.startVector(4,a,4)}static addInputs(o,a){o.addFieldOffset(5,a,0)}static createInputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startInputsVector(o,a){o.startVector(4,a,4)}static addOutputs(o,a){o.addFieldOffset(6,a,0)}static createOutputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startOutputsVector(o,a){o.startVector(4,a,4)}static addSparseInitializers(o,a){o.addFieldOffset(7,a,0)}static createSparseInitializersVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startSparseInitializersVector(o,a){o.startVector(4,a,4)}static endGraph(o){return o.endObject()}static createGraph(o,a,e,u,i,d,h,m,b){return l.startGraph(o),l.addInitializers(o,a),l.addNodeArgs(o,e),l.addNodes(o,u),l.addMaxNodeIndex(o,i),l.addNodeEdges(o,d),l.addInputs(o,h),l.addOutputs(o,m),l.addSparseInitializers(o,b),l.endGraph(o)}}p.Graph=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsModel(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsModel(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}irVersion(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}opsetImport(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}opsetImportLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}producerName(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,o):null}producerVersion(o){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.__string(this.bb_pos+a,o):null}domain(o){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.__string(this.bb_pos+a,o):null}modelVersion(){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}docString(o){let a=this.bb.__offset(this.bb_pos,16);return a?this.bb.__string(this.bb_pos+a,o):null}graph(o){let a=this.bb.__offset(this.bb_pos,18);return a?(o||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}graphDocString(o){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.__string(this.bb_pos+a,o):null}static startModel(o){o.startObject(9)}static addIrVersion(o,a){o.addFieldInt64(0,a,o.createLong(0,0))}static addOpsetImport(o,a){o.addFieldOffset(1,a,0)}static createOpsetImportVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startOpsetImportVector(o,a){o.startVector(4,a,4)}static addProducerName(o,a){o.addFieldOffset(2,a,0)}static addProducerVersion(o,a){o.addFieldOffset(3,a,0)}static addDomain(o,a){o.addFieldOffset(4,a,0)}static addModelVersion(o,a){o.addFieldInt64(5,a,o.createLong(0,0))}static addDocString(o,a){o.addFieldOffset(6,a,0)}static addGraph(o,a){o.addFieldOffset(7,a,0)}static addGraphDocString(o,a){o.addFieldOffset(8,a,0)}static endModel(o){return o.endObject()}static createModel(o,a,e,u,i,d,h,m,b,x){return l.startModel(o),l.addIrVersion(o,a),l.addOpsetImport(o,e),l.addProducerName(o,u),l.addProducerVersion(o,i),l.addDomain(o,d),l.addModelVersion(o,h),l.addDocString(o,m),l.addGraph(o,b),l.addGraphDocString(o,x),l.endModel(o)}}p.Model=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsKernelCreateInfos(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsKernelCreateInfos(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}nodeIndices(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readUint32(this.bb.__vector(this.bb_pos+a)+o*4):0}nodeIndicesLength(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__vector_len(this.bb_pos+o):0}nodeIndicesArray(){let o=this.bb.__offset(this.bb_pos,4);return o?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}kernelDefHashes(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readUint64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}kernelDefHashesLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}static startKernelCreateInfos(o){o.startObject(2)}static addNodeIndices(o,a){o.addFieldOffset(0,a,0)}static createNodeIndicesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addInt32(a[e]);return o.endVector()}static startNodeIndicesVector(o,a){o.startVector(4,a,4)}static addKernelDefHashes(o,a){o.addFieldOffset(1,a,0)}static createKernelDefHashesVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startKernelDefHashesVector(o,a){o.startVector(8,a,8)}static endKernelCreateInfos(o){return o.endObject()}static createKernelCreateInfos(o,a,e){return l.startKernelCreateInfos(o),l.addNodeIndices(o,a),l.addKernelDefHashes(o,e),l.endKernelCreateInfos(o)}}p.KernelCreateInfos=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSubGraphSessionState(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSubGraphSessionState(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}graphId(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}sessionState(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startSubGraphSessionState(o){o.startObject(2)}static addGraphId(o,a){o.addFieldOffset(0,a,0)}static addSessionState(o,a){o.addFieldOffset(1,a,0)}static endSubGraphSessionState(o){let a=o.endObject();return o.requiredField(a,4),a}static createSubGraphSessionState(o,a,e){return l.startSubGraphSessionState(o),l.addGraphId(o,a),l.addSessionState(o,e),l.endSubGraphSessionState(o)}}p.SubGraphSessionState=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSessionState(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSessionState(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}kernels(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}subGraphSessionStates(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}subGraphSessionStatesLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}static startSessionState(o){o.startObject(2)}static addKernels(o,a){o.addFieldOffset(0,a,0)}static addSubGraphSessionStates(o,a){o.addFieldOffset(1,a,0)}static createSubGraphSessionStatesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startSubGraphSessionStatesVector(o,a){o.startVector(4,a,4)}static endSessionState(o){return o.endObject()}static createSessionState(o,a,e){return l.startSessionState(o),l.addKernels(o,a),l.addSubGraphSessionStates(o,e),l.endSessionState(o)}}p.SessionState=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsInferenceSession(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsInferenceSession(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static bufferHasIdentifier(o){return o.__has_identifier("ORTM")}ortVersion(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}model(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}sessionState(o){let a=this.bb.__offset(this.bb_pos,8);return a?(o||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startInferenceSession(o){o.startObject(3)}static addOrtVersion(o,a){o.addFieldOffset(0,a,0)}static addModel(o,a){o.addFieldOffset(1,a,0)}static addSessionState(o,a){o.addFieldOffset(2,a,0)}static endInferenceSession(o){return o.endObject()}static finishInferenceSessionBuffer(o,a){o.finish(a,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(o,a){o.finish(a,"ORTM",!0)}static createInferenceSession(o,a,e,u){return l.startInferenceSession(o),l.addOrtVersion(o,a),l.addModel(o,e),l.addSessionState(o,u),l.endInferenceSession(o)}}p.InferenceSession=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={}))}),Ch=nt((t,r)=>{"use strict";r.exports=n;function n(s,p){for(var l=new Array(arguments.length-1),c=0,o=2,a=!0;o<arguments.length;)l[c++]=arguments[o++];return new Promise(function(e,u){l[c]=function(i){if(a)if(a=!1,i)u(i);else{for(var d=new Array(arguments.length-1),h=0;h<d.length;)d[h++]=arguments[h];e.apply(null,d)}};try{s.apply(p||null,l)}catch(i){a&&(a=!1,u(i))}})}}),Lh=nt(t=>{"use strict";var r=t;r.length=function(c){var o=c.length;if(!o)return 0;for(var a=0;--o%4>1&&c.charAt(o)==="=";)++a;return Math.ceil(c.length*3)/4-a};var n=new Array(64),s=new Array(123);for(p=0;p<64;)s[n[p]=p<26?p+65:p<52?p+71:p<62?p-4:p-59|43]=p++;var p;r.encode=function(c,o,a){for(var e=null,u=[],i=0,d=0,h;o<a;){var m=c[o++];switch(d){case 0:u[i++]=n[m>>2],h=(m&3)<<4,d=1;break;case 1:u[i++]=n[h|m>>4],h=(m&15)<<2,d=2;break;case 2:u[i++]=n[h|m>>6],u[i++]=n[m&63],d=0;break}i>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,u)),i=0)}return d&&(u[i++]=n[h],u[i++]=61,d===1&&(u[i++]=61)),e?(i&&e.push(String.fromCharCode.apply(String,u.slice(0,i))),e.join("")):String.fromCharCode.apply(String,u.slice(0,i))};var l="invalid encoding";r.decode=function(c,o,a){for(var e=a,u=0,i,d=0;d<c.length;){var h=c.charCodeAt(d++);if(h===61&&u>1)break;if((h=s[h])===void 0)throw Error(l);switch(u){case 0:i=h,u=1;break;case 1:o[a++]=i<<2|(h&48)>>4,i=h,u=2;break;case 2:o[a++]=(i&15)<<4|(h&60)>>2,i=h,u=3;break;case 3:o[a++]=(i&3)<<6|h,u=0;break}}if(u===1)throw Error(l);return a-e},r.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}),Rh=nt((t,r)=>{"use strict";r.exports=n;function n(){this._listeners={}}n.prototype.on=function(s,p,l){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:p,ctx:l||this}),this},n.prototype.off=function(s,p){if(s===void 0)this._listeners={};else if(p===void 0)this._listeners[s]=[];else for(var l=this._listeners[s],c=0;c<l.length;)l[c].fn===p?l.splice(c,1):++c;return this},n.prototype.emit=function(s){var p=this._listeners[s];if(p){for(var l=[],c=1;c<arguments.length;)l.push(arguments[c++]);for(c=0;c<p.length;)p[c].fn.apply(p[c++].ctx,l)}return this}}),jh=nt((t,r)=>{"use strict";r.exports=n(n);function n(o){return typeof Float32Array<"u"?function(){var a=new Float32Array([-0]),e=new Uint8Array(a.buffer),u=e[3]===128;function i(b,x,E){a[0]=b,x[E]=e[0],x[E+1]=e[1],x[E+2]=e[2],x[E+3]=e[3]}function d(b,x,E){a[0]=b,x[E]=e[3],x[E+1]=e[2],x[E+2]=e[1],x[E+3]=e[0]}o.writeFloatLE=u?i:d,o.writeFloatBE=u?d:i;function h(b,x){return e[0]=b[x],e[1]=b[x+1],e[2]=b[x+2],e[3]=b[x+3],a[0]}function m(b,x){return e[3]=b[x],e[2]=b[x+1],e[1]=b[x+2],e[0]=b[x+3],a[0]}o.readFloatLE=u?h:m,o.readFloatBE=u?m:h}():function(){function a(u,i,d,h){var m=i<0?1:0;if(m&&(i=-i),i===0)u(1/i>0?0:2147483648,d,h);else if(isNaN(i))u(2143289344,d,h);else if(i>34028234663852886e22)u((m<<31|2139095040)>>>0,d,h);else if(i<11754943508222875e-54)u((m<<31|Math.round(i/1401298464324817e-60))>>>0,d,h);else{var b=Math.floor(Math.log(i)/Math.LN2),x=Math.round(i*Math.pow(2,-b)*8388608)&8388607;u((m<<31|b+127<<23|x)>>>0,d,h)}}o.writeFloatLE=a.bind(null,s),o.writeFloatBE=a.bind(null,p);function e(u,i,d){var h=u(i,d),m=(h>>31)*2+1,b=h>>>23&255,x=h&8388607;return b===255?x?NaN:m*(1/0):b===0?m*1401298464324817e-60*x:m*Math.pow(2,b-150)*(x+8388608)}o.readFloatLE=e.bind(null,l),o.readFloatBE=e.bind(null,c)}(),typeof Float64Array<"u"?function(){var a=new Float64Array([-0]),e=new Uint8Array(a.buffer),u=e[7]===128;function i(b,x,E){a[0]=b,x[E]=e[0],x[E+1]=e[1],x[E+2]=e[2],x[E+3]=e[3],x[E+4]=e[4],x[E+5]=e[5],x[E+6]=e[6],x[E+7]=e[7]}function d(b,x,E){a[0]=b,x[E]=e[7],x[E+1]=e[6],x[E+2]=e[5],x[E+3]=e[4],x[E+4]=e[3],x[E+5]=e[2],x[E+6]=e[1],x[E+7]=e[0]}o.writeDoubleLE=u?i:d,o.writeDoubleBE=u?d:i;function h(b,x){return e[0]=b[x],e[1]=b[x+1],e[2]=b[x+2],e[3]=b[x+3],e[4]=b[x+4],e[5]=b[x+5],e[6]=b[x+6],e[7]=b[x+7],a[0]}function m(b,x){return e[7]=b[x],e[6]=b[x+1],e[5]=b[x+2],e[4]=b[x+3],e[3]=b[x+4],e[2]=b[x+5],e[1]=b[x+6],e[0]=b[x+7],a[0]}o.readDoubleLE=u?h:m,o.readDoubleBE=u?m:h}():function(){function a(u,i,d,h,m,b){var x=h<0?1:0;if(x&&(h=-h),h===0)u(0,m,b+i),u(1/h>0?0:2147483648,m,b+d);else if(isNaN(h))u(0,m,b+i),u(2146959360,m,b+d);else if(h>17976931348623157e292)u(0,m,b+i),u((x<<31|2146435072)>>>0,m,b+d);else{var E;if(h<22250738585072014e-324)E=h/5e-324,u(E>>>0,m,b+i),u((x<<31|E/4294967296)>>>0,m,b+d);else{var w=Math.floor(Math.log(h)/Math.LN2);w===1024&&(w=1023),E=h*Math.pow(2,-w),u(E*4503599627370496>>>0,m,b+i),u((x<<31|w+1023<<20|E*1048576&1048575)>>>0,m,b+d)}}}o.writeDoubleLE=a.bind(null,s,0,4),o.writeDoubleBE=a.bind(null,p,4,0);function e(u,i,d,h,m){var b=u(h,m+i),x=u(h,m+d),E=(x>>31)*2+1,w=x>>>20&2047,S=4294967296*(x&1048575)+b;return w===2047?S?NaN:E*(1/0):w===0?E*5e-324*S:E*Math.pow(2,w-1075)*(S+4503599627370496)}o.readDoubleLE=e.bind(null,l,0,4),o.readDoubleBE=e.bind(null,c,4,0)}(),o}function s(o,a,e){a[e]=o&255,a[e+1]=o>>>8&255,a[e+2]=o>>>16&255,a[e+3]=o>>>24}function p(o,a,e){a[e]=o>>>24,a[e+1]=o>>>16&255,a[e+2]=o>>>8&255,a[e+3]=o&255}function l(o,a){return(o[a]|o[a+1]<<8|o[a+2]<<16|o[a+3]<<24)>>>0}function c(o,a){return(o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3])>>>0}}),Bh=nt((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}}),Vh=nt(t=>{"use strict";var r=t;r.length=function(n){for(var s=0,p=0,l=0;l<n.length;++l)p=n.charCodeAt(l),p<128?s+=1:p<2048?s+=2:(p&64512)===55296&&(n.charCodeAt(l+1)&64512)===56320?(++l,s+=4):s+=3;return s},r.read=function(n,s,p){var l=p-s;if(l<1)return"";for(var c=null,o=[],a=0,e;s<p;)e=n[s++],e<128?o[a++]=e:e>191&&e<224?o[a++]=(e&31)<<6|n[s++]&63:e>239&&e<365?(e=((e&7)<<18|(n[s++]&63)<<12|(n[s++]&63)<<6|n[s++]&63)-65536,o[a++]=55296+(e>>10),o[a++]=56320+(e&1023)):o[a++]=(e&15)<<12|(n[s++]&63)<<6|n[s++]&63,a>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,o)),a=0);return c?(a&&c.push(String.fromCharCode.apply(String,o.slice(0,a))),c.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(n,s,p){for(var l=p,c,o,a=0;a<n.length;++a)c=n.charCodeAt(a),c<128?s[p++]=c:c<2048?(s[p++]=c>>6|192,s[p++]=c&63|128):(c&64512)===55296&&((o=n.charCodeAt(a+1))&64512)===56320?(c=65536+((c&1023)<<10)+(o&1023),++a,s[p++]=c>>18|240,s[p++]=c>>12&63|128,s[p++]=c>>6&63|128,s[p++]=c&63|128):(s[p++]=c>>12|224,s[p++]=c>>6&63|128,s[p++]=c&63|128);return p-l}}),Mh=nt((t,r)=>{"use strict";r.exports=n;function n(s,p,l){var c=l||8192,o=c>>>1,a=null,e=c;return function(u){if(u<1||u>o)return s(u);e+u>c&&(a=s(c),e=0);var i=p.call(a,e,e+=u);return e&7&&(e=(e|7)+1),i}}}),zh=nt((t,r)=>{"use strict";r.exports=s;var n=we();function s(o,a){this.lo=o>>>0,this.hi=a>>>0}var p=s.zero=new s(0,0);p.toNumber=function(){return 0},p.zzEncode=p.zzDecode=function(){return this},p.length=function(){return 1};var l=s.zeroHash="\0\0\0\0\0\0\0\0";s.fromNumber=function(o){if(o===0)return p;var a=o<0;a&&(o=-o);var e=o>>>0,u=(o-e)/4294967296>>>0;return a&&(u=~u>>>0,e=~e>>>0,++e>4294967295&&(e=0,++u>4294967295&&(u=0))),new s(e,u)},s.from=function(o){if(typeof o=="number")return s.fromNumber(o);if(n.isString(o))if(n.Long)o=n.Long.fromString(o);else return s.fromNumber(parseInt(o,10));return o.low||o.high?new s(o.low>>>0,o.high>>>0):p},s.prototype.toNumber=function(o){if(!o&&this.hi>>>31){var a=~this.lo+1>>>0,e=~this.hi>>>0;return a||(e=e+1>>>0),-(a+e*4294967296)}return this.lo+this.hi*4294967296},s.prototype.toLong=function(o){return n.Long?new n.Long(this.lo|0,this.hi|0,!!o):{low:this.lo|0,high:this.hi|0,unsigned:!!o}};var c=String.prototype.charCodeAt;s.fromHash=function(o){return o===l?p:new s((c.call(o,0)|c.call(o,1)<<8|c.call(o,2)<<16|c.call(o,3)<<24)>>>0,(c.call(o,4)|c.call(o,5)<<8|c.call(o,6)<<16|c.call(o,7)<<24)>>>0)},s.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},s.prototype.zzEncode=function(){var o=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^o)>>>0,this.lo=(this.lo<<1^o)>>>0,this},s.prototype.zzDecode=function(){var o=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^o)>>>0,this.hi=(this.hi>>>1^o)>>>0,this},s.prototype.length=function(){var o=this.lo,a=(this.lo>>>28|this.hi<<4)>>>0,e=this.hi>>>24;return e===0?a===0?o<16384?o<128?1:2:o<2097152?3:4:a<16384?a<128?5:6:a<2097152?7:8:e<128?9:10}}),we=nt(t=>{"use strict";var r=t;r.asPromise=Ch(),r.base64=Lh(),r.EventEmitter=Rh(),r.float=jh(),r.inquire=Bh(),r.utf8=Vh(),r.pool=Mh(),r.LongBits=zh(),r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||t,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(p){return typeof p=="number"&&isFinite(p)&&Math.floor(p)===p},r.isString=function(p){return typeof p=="string"||p instanceof String},r.isObject=function(p){return p&&typeof p=="object"},r.isset=r.isSet=function(p,l){var c=p[l];return c!=null&&p.hasOwnProperty(l)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},r.Buffer=function(){try{var p=r.inquire("buffer").Buffer;return p.prototype.utf8Write?p:null}catch{return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(p){return typeof p=="number"?r.Buffer?r._Buffer_allocUnsafe(p):new r.Array(p):r.Buffer?r._Buffer_from(p):typeof Uint8Array>"u"?p:new Uint8Array(p)},r.Array=typeof Uint8Array<"u"?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(p){return p?r.LongBits.from(p).toHash():r.LongBits.zeroHash},r.longFromHash=function(p,l){var c=r.LongBits.fromHash(p);return r.Long?r.Long.fromBits(c.lo,c.hi,l):c.toNumber(!!l)};function n(p,l,c){for(var o=Object.keys(l),a=0;a<o.length;++a)(p[o[a]]===void 0||!c)&&(p[o[a]]=l[o[a]]);return p}r.merge=n,r.lcFirst=function(p){return p.charAt(0).toLowerCase()+p.substring(1)};function s(p){function l(c,o){if(!(this instanceof l))return new l(c,o);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,l):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&n(this,o)}return l.prototype=Object.create(Error.prototype,{constructor:{value:l,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return p},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),l}r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(p){for(var l={},c=0;c<p.length;++c)l[p[c]]=1;return function(){for(var o=Object.keys(this),a=o.length-1;a>-1;--a)if(l[o[a]]===1&&this[o[a]]!==void 0&&this[o[a]]!==null)return o[a]}},r.oneOfSetter=function(p){return function(l){for(var c=0;c<p.length;++c)p[c]!==l&&delete this[p[c]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var p=r.Buffer;if(!p){r._Buffer_from=r._Buffer_allocUnsafe=null;return}r._Buffer_from=p.from!==Uint8Array.from&&p.from||function(l,c){return new p(l,c)},r._Buffer_allocUnsafe=p.allocUnsafe||function(l){return new p(l)}}}),gl=nt((t,r)=>{"use strict";r.exports=u;var n=we(),s,p=n.LongBits,l=n.base64,c=n.utf8;function o(w,S,$){this.fn=w,this.len=S,this.next=void 0,this.val=$}function a(){}function e(w){this.head=w.head,this.tail=w.tail,this.len=w.len,this.next=w.states}function u(){this.len=0,this.head=new o(a,0,0),this.tail=this.head,this.states=null}var i=function(){return n.Buffer?function(){return(u.create=function(){return new s})()}:function(){return new u}};u.create=i(),u.alloc=function(w){return new n.Array(w)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(w,S,$){return this.tail=this.tail.next=new o(w,S,$),this.len+=S,this};function d(w,S,$){S[$]=w&255}function h(w,S,$){for(;w>127;)S[$++]=w&127|128,w>>>=7;S[$]=w}function m(w,S){this.len=w,this.next=void 0,this.val=S}m.prototype=Object.create(o.prototype),m.prototype.fn=h,u.prototype.uint32=function(w){return this.len+=(this.tail=this.tail.next=new m((w=w>>>0)<128?1:w<16384?2:w<2097152?3:w<268435456?4:5,w)).len,this},u.prototype.int32=function(w){return w<0?this._push(b,10,p.fromNumber(w)):this.uint32(w)},u.prototype.sint32=function(w){return this.uint32((w<<1^w>>31)>>>0)};function b(w,S,$){for(;w.hi;)S[$++]=w.lo&127|128,w.lo=(w.lo>>>7|w.hi<<25)>>>0,w.hi>>>=7;for(;w.lo>127;)S[$++]=w.lo&127|128,w.lo=w.lo>>>7;S[$++]=w.lo}u.prototype.uint64=function(w){var S=p.from(w);return this._push(b,S.length(),S)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(w){var S=p.from(w).zzEncode();return this._push(b,S.length(),S)},u.prototype.bool=function(w){return this._push(d,1,w?1:0)};function x(w,S,$){S[$]=w&255,S[$+1]=w>>>8&255,S[$+2]=w>>>16&255,S[$+3]=w>>>24}u.prototype.fixed32=function(w){return this._push(x,4,w>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(w){var S=p.from(w);return this._push(x,4,S.lo)._push(x,4,S.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(w){return this._push(n.float.writeFloatLE,4,w)},u.prototype.double=function(w){return this._push(n.float.writeDoubleLE,8,w)};var E=n.Array.prototype.set?function(w,S,$){S.set(w,$)}:function(w,S,$){for(var F=0;F<w.length;++F)S[$+F]=w[F]};u.prototype.bytes=function(w){var S=w.length>>>0;if(!S)return this._push(d,1,0);if(n.isString(w)){var $=u.alloc(S=l.length(w));l.decode(w,$,0),w=$}return this.uint32(S)._push(E,S,w)},u.prototype.string=function(w){var S=c.length(w);return S?this.uint32(S)._push(c.write,S,w):this._push(d,1,0)},u.prototype.fork=function(){return this.states=new e(this),this.head=this.tail=new o(a,0,0),this.len=0,this},u.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 o(a,0,0),this.len=0),this},u.prototype.ldelim=function(){var w=this.head,S=this.tail,$=this.len;return this.reset().uint32($),$&&(this.tail.next=w.next,this.tail=S,this.len+=$),this},u.prototype.finish=function(){for(var w=this.head.next,S=this.constructor.alloc(this.len),$=0;w;)w.fn(w.val,S,$),$+=w.len,w=w.next;return S},u._configure=function(w){s=w,u.create=i(),s._configure()}}),Uh=nt((t,r)=>{"use strict";r.exports=p;var n=gl();(p.prototype=Object.create(n.prototype)).constructor=p;var s=we();function p(){n.call(this)}p._configure=function(){p.alloc=s._Buffer_allocUnsafe,p.writeBytesBuffer=s.Buffer&&s.Buffer.prototype instanceof Uint8Array&&s.Buffer.prototype.set.name==="set"?function(c,o,a){o.set(c,a)}:function(c,o,a){if(c.copy)c.copy(o,a,0,c.length);else for(var e=0;e<c.length;)o[a++]=c[e++]}},p.prototype.bytes=function(c){s.isString(c)&&(c=s._Buffer_from(c,"base64"));var o=c.length>>>0;return this.uint32(o),o&&this._push(p.writeBytesBuffer,o,c),this};function l(c,o,a){c.length<40?s.utf8.write(c,o,a):o.utf8Write?o.utf8Write(c,a):o.write(c,a)}p.prototype.string=function(c){var o=s.Buffer.byteLength(c);return this.uint32(o),o&&this._push(l,o,c),this},p._configure()}),ml=nt((t,r)=>{"use strict";r.exports=o;var n=we(),s,p=n.LongBits,l=n.utf8;function c(h,m){return RangeError("index out of range: "+h.pos+" + "+(m||1)+" > "+h.len)}function o(h){this.buf=h,this.pos=0,this.len=h.length}var a=typeof Uint8Array<"u"?function(h){if(h instanceof Uint8Array||Array.isArray(h))return new o(h);throw Error("illegal buffer")}:function(h){if(Array.isArray(h))return new o(h);throw Error("illegal buffer")},e=function(){return n.Buffer?function(h){return(o.create=function(m){return n.Buffer.isBuffer(m)?new s(m):a(m)})(h)}:a};o.create=e(),o.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,o.prototype.uint32=function(){var h=4294967295;return function(){if(h=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(h=(h|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return h;if((this.pos+=5)>this.len)throw this.pos=this.len,c(this,10);return h}}(),o.prototype.int32=function(){return this.uint32()|0},o.prototype.sint32=function(){var h=this.uint32();return h>>>1^-(h&1)|0};function u(){var h=new p(0,0),m=0;if(this.len-this.pos>4){for(;m<4;++m)if(h.lo=(h.lo|(this.buf[this.pos]&127)<<m*7)>>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;m=0}else{for(;m<3;++m){if(this.pos>=this.len)throw c(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<<m*7)>>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<<m*7)>>>0,h}if(this.len-this.pos>4){for(;m<5;++m)if(h.hi=(h.hi|(this.buf[this.pos]&127)<<m*7+3)>>>0,this.buf[this.pos++]<128)return h}else for(;m<5;++m){if(this.pos>=this.len)throw c(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<<m*7+3)>>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}o.prototype.bool=function(){return this.uint32()!==0};function i(h,m){return(h[m-4]|h[m-3]<<8|h[m-2]<<16|h[m-1]<<24)>>>0}o.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return i(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return i(this.buf,this.pos+=4)|0};function d(){if(this.pos+8>this.len)throw c(this,8);return new p(i(this.buf,this.pos+=4),i(this.buf,this.pos+=4))}o.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var h=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,h},o.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var h=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,h},o.prototype.bytes=function(){var h=this.uint32(),m=this.pos,b=this.pos+h;if(b>this.len)throw c(this,h);if(this.pos+=h,Array.isArray(this.buf))return this.buf.slice(m,b);if(m===b){var x=n.Buffer;return x?x.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,m,b)},o.prototype.string=function(){var h=this.bytes();return l.read(h,0,h.length)},o.prototype.skip=function(h){if(typeof h=="number"){if(this.pos+h>this.len)throw c(this,h);this.pos+=h}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},o.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},o._configure=function(h){s=h,o.create=e(),s._configure();var m=n.Long?"toLong":"toNumber";n.merge(o.prototype,{int64:function(){return u.call(this)[m](!1)},uint64:function(){return u.call(this)[m](!0)},sint64:function(){return u.call(this).zzDecode()[m](!1)},fixed64:function(){return d.call(this)[m](!0)},sfixed64:function(){return d.call(this)[m](!1)}})}}),Gh=nt((t,r)=>{"use strict";r.exports=p;var n=ml();(p.prototype=Object.create(n.prototype)).constructor=p;var s=we();function p(l){n.call(this,l)}p._configure=function(){s.Buffer&&(p.prototype._slice=s.Buffer.prototype.slice)},p.prototype.string=function(){var l=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+l,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+l,this.len))},p._configure()}),Hh=nt((t,r)=>{"use strict";r.exports=s;var n=we();(s.prototype=Object.create(n.EventEmitter.prototype)).constructor=s;function s(p,l,c){if(typeof p!="function")throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=p,this.requestDelimited=!!l,this.responseDelimited=!!c}s.prototype.rpcCall=function p(l,c,o,a,e){if(!a)throw TypeError("request must be specified");var u=this;if(!e)return n.asPromise(p,u,l,c,o,a);if(!u.rpcImpl){setTimeout(function(){e(Error("already ended"))},0);return}try{return u.rpcImpl(l,c[u.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(i,d){if(i)return u.emit("error",i,l),e(i);if(d===null){u.end(!0);return}if(!(d instanceof o))try{d=o[u.responseDelimited?"decodeDelimited":"decode"](d)}catch(h){return u.emit("error",h,l),e(h)}return u.emit("data",d,l),e(null,d)})}catch(i){u.emit("error",i,l),setTimeout(function(){e(i)},0);return}},s.prototype.end=function(p){return this.rpcImpl&&(p||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}}),qh=nt(t=>{"use strict";var r=t;r.Service=Hh()}),Wh=nt((t,r)=>{"use strict";r.exports={}}),Xh=nt(t=>{"use strict";var r=t;r.build="minimal",r.Writer=gl(),r.BufferWriter=Uh(),r.Reader=ml(),r.BufferReader=Gh(),r.util=we(),r.rpc=qh(),r.roots=Wh(),r.configure=n;function n(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}n()}),Kh=nt((t,r)=>{"use strict";r.exports=Xh()}),mr=nt((t,r)=>{"use strict";var n=Kh(),s=n.Reader,p=n.Writer,l=n.util,c=n.roots.default||(n.roots.default={});c.onnx=function(){var o={};return o.Version=function(){var a={},e=Object.create(a);return e[a[0]="_START_VERSION"]=0,e[a[1]="IR_VERSION_2017_10_10"]=1,e[a[2]="IR_VERSION_2017_10_30"]=2,e[a[3]="IR_VERSION_2017_11_3"]=3,e[a[4]="IR_VERSION_2019_1_22"]=4,e[a[5]="IR_VERSION_2019_3_18"]=5,e[a[6]="IR_VERSION_2019_9_19"]=6,e[a[7]="IR_VERSION_2020_5_8"]=7,e[a[8]="IR_VERSION_2021_7_30"]=8,e[a[9]="IR_VERSION"]=9,e}(),o.AttributeProto=function(){function a(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],this.sparseTensors=[],this.typeProtos=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.name="",a.prototype.refAttrName="",a.prototype.docString="",a.prototype.type=0,a.prototype.f=0,a.prototype.i=l.Long?l.Long.fromBits(0,0,!1):0,a.prototype.s=l.newBuffer([]),a.prototype.t=null,a.prototype.g=null,a.prototype.sparseTensor=null,a.prototype.tp=null,a.prototype.floats=l.emptyArray,a.prototype.ints=l.emptyArray,a.prototype.strings=l.emptyArray,a.prototype.tensors=l.emptyArray,a.prototype.graphs=l.emptyArray,a.prototype.sparseTensors=l.emptyArray,a.prototype.typeProtos=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(10).string(e.name),e.f!=null&&Object.hasOwnProperty.call(e,"f")&&u.uint32(21).float(e.f),e.i!=null&&Object.hasOwnProperty.call(e,"i")&&u.uint32(24).int64(e.i),e.s!=null&&Object.hasOwnProperty.call(e,"s")&&u.uint32(34).bytes(e.s),e.t!=null&&Object.hasOwnProperty.call(e,"t")&&c.onnx.TensorProto.encode(e.t,u.uint32(42).fork()).ldelim(),e.g!=null&&Object.hasOwnProperty.call(e,"g")&&c.onnx.GraphProto.encode(e.g,u.uint32(50).fork()).ldelim(),e.floats!=null&&e.floats.length){u.uint32(58).fork();for(var i=0;i<e.floats.length;++i)u.float(e.floats[i]);u.ldelim()}if(e.ints!=null&&e.ints.length){u.uint32(66).fork();for(var i=0;i<e.ints.length;++i)u.int64(e.ints[i]);u.ldelim()}if(e.strings!=null&&e.strings.length)for(var i=0;i<e.strings.length;++i)u.uint32(74).bytes(e.strings[i]);if(e.tensors!=null&&e.tensors.length)for(var i=0;i<e.tensors.length;++i)c.onnx.TensorProto.encode(e.tensors[i],u.uint32(82).fork()).ldelim();if(e.graphs!=null&&e.graphs.length)for(var i=0;i<e.graphs.length;++i)c.onnx.GraphProto.encode(e.graphs[i],u.uint32(90).fork()).ldelim();if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(106).string(e.docString),e.tp!=null&&Object.hasOwnProperty.call(e,"tp")&&c.onnx.TypeProto.encode(e.tp,u.uint32(114).fork()).ldelim(),e.typeProtos!=null&&e.typeProtos.length)for(var i=0;i<e.typeProtos.length;++i)c.onnx.TypeProto.encode(e.typeProtos[i],u.uint32(122).fork()).ldelim();if(e.type!=null&&Object.hasOwnProperty.call(e,"type")&&u.uint32(160).int32(e.type),e.refAttrName!=null&&Object.hasOwnProperty.call(e,"refAttrName")&&u.uint32(170).string(e.refAttrName),e.sparseTensor!=null&&Object.hasOwnProperty.call(e,"sparseTensor")&&c.onnx.SparseTensorProto.encode(e.sparseTensor,u.uint32(178).fork()).ldelim(),e.sparseTensors!=null&&e.sparseTensors.length)for(var i=0;i<e.sparseTensors.length;++i)c.onnx.SparseTensorProto.encode(e.sparseTensors[i],u.uint32(186).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.AttributeProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.name=e.string();break}case 21:{d.refAttrName=e.string();break}case 13:{d.docString=e.string();break}case 20:{d.type=e.int32();break}case 2:{d.f=e.float();break}case 3:{d.i=e.int64();break}case 4:{d.s=e.bytes();break}case 5:{d.t=c.onnx.TensorProto.decode(e,e.uint32());break}case 6:{d.g=c.onnx.GraphProto.decode(e,e.uint32());break}case 22:{d.sparseTensor=c.onnx.SparseTensorProto.decode(e,e.uint32());break}case 14:{d.tp=c.onnx.TypeProto.decode(e,e.uint32());break}case 7:{if(d.floats&&d.floats.length||(d.floats=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.floats.push(e.float());else d.floats.push(e.float());break}case 8:{if(d.ints&&d.ints.length||(d.ints=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.ints.push(e.int64());else d.ints.push(e.int64());break}case 9:{d.strings&&d.strings.length||(d.strings=[]),d.strings.push(e.bytes());break}case 10:{d.tensors&&d.tensors.length||(d.tensors=[]),d.tensors.push(c.onnx.TensorProto.decode(e,e.uint32()));break}case 11:{d.graphs&&d.graphs.length||(d.graphs=[]),d.graphs.push(c.onnx.GraphProto.decode(e,e.uint32()));break}case 23:{d.sparseTensors&&d.sparseTensors.length||(d.sparseTensors=[]),d.sparseTensors.push(c.onnx.SparseTensorProto.decode(e,e.uint32()));break}case 15:{d.typeProtos&&d.typeProtos.length||(d.typeProtos=[]),d.typeProtos.push(c.onnx.TypeProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.refAttrName!=null&&e.hasOwnProperty("refAttrName")&&!l.isString(e.refAttrName))return"refAttrName: string expected";if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 11:case 13:case 6:case 7:case 8:case 9:case 10:case 12:case 14:break}if(e.f!=null&&e.hasOwnProperty("f")&&typeof e.f!="number")return"f: number expected";if(e.i!=null&&e.hasOwnProperty("i")&&!l.isInteger(e.i)&&!(e.i&&l.isInteger(e.i.low)&&l.isInteger(e.i.high)))return"i: integer|Long expected";if(e.s!=null&&e.hasOwnProperty("s")&&!(e.s&&typeof e.s.length=="number"||l.isString(e.s)))return"s: buffer expected";if(e.t!=null&&e.hasOwnProperty("t")){var u=c.onnx.TensorProto.verify(e.t);if(u)return"t."+u}if(e.g!=null&&e.hasOwnProperty("g")){var u=c.onnx.GraphProto.verify(e.g);if(u)return"g."+u}if(e.sparseTensor!=null&&e.hasOwnProperty("sparseTensor")){var u=c.onnx.SparseTensorProto.verify(e.sparseTensor);if(u)return"sparseTensor."+u}if(e.tp!=null&&e.hasOwnProperty("tp")){var u=c.onnx.TypeProto.verify(e.tp);if(u)return"tp."+u}if(e.floats!=null&&e.hasOwnProperty("floats")){if(!Array.isArray(e.floats))return"floats: array expected";for(var i=0;i<e.floats.length;++i)if(typeof e.floats[i]!="number")return"floats: number[] expected"}if(e.ints!=null&&e.hasOwnProperty("ints")){if(!Array.isArray(e.ints))return"ints: array expected";for(var i=0;i<e.ints.length;++i)if(!l.isInteger(e.ints[i])&&!(e.ints[i]&&l.isInteger(e.ints[i].low)&&l.isInteger(e.ints[i].high)))return"ints: integer|Long[] expected"}if(e.strings!=null&&e.hasOwnProperty("strings")){if(!Array.isArray(e.strings))return"strings: array expected";for(var i=0;i<e.strings.length;++i)if(!(e.strings[i]&&typeof e.strings[i].length=="number"||l.isString(e.strings[i])))return"strings: buffer[] expected"}if(e.tensors!=null&&e.hasOwnProperty("tensors")){if(!Array.isArray(e.tensors))return"tensors: array expected";for(var i=0;i<e.tensors.length;++i){var u=c.onnx.TensorProto.verify(e.tensors[i]);if(u)return"tensors."+u}}if(e.graphs!=null&&e.hasOwnProperty("graphs")){if(!Array.isArray(e.graphs))return"graphs: array expected";for(var i=0;i<e.graphs.length;++i){var u=c.onnx.GraphProto.verify(e.graphs[i]);if(u)return"graphs."+u}}if(e.sparseTensors!=null&&e.hasOwnProperty("sparseTensors")){if(!Array.isArray(e.sparseTensors))return"sparseTensors: array expected";for(var i=0;i<e.sparseTensors.length;++i){var u=c.onnx.SparseTensorProto.verify(e.sparseTensors[i]);if(u)return"sparseTensors."+u}}if(e.typeProtos!=null&&e.hasOwnProperty("typeProtos")){if(!Array.isArray(e.typeProtos))return"typeProtos: array expected";for(var i=0;i<e.typeProtos.length;++i){var u=c.onnx.TypeProto.verify(e.typeProtos[i]);if(u)return"typeProtos."+u}}return null},a.fromObject=function(e){if(e instanceof c.onnx.AttributeProto)return e;var u=new c.onnx.AttributeProto;switch(e.name!=null&&(u.name=String(e.name)),e.refAttrName!=null&&(u.refAttrName=String(e.refAttrName)),e.docString!=null&&(u.docString=String(e.docString)),e.type){default:if(typeof e.type=="number"){u.type=e.type;break}break;case"UNDEFINED":case 0:u.type=0;break;case"FLOAT":case 1:u.type=1;break;case"INT":case 2:u.type=2;break;case"STRING":case 3:u.type=3;break;case"TENSOR":case 4:u.type=4;break;case"GRAPH":case 5:u.type=5;break;case"SPARSE_TENSOR":case 11:u.type=11;break;case"TYPE_PROTO":case 13:u.type=13;break;case"FLOATS":case 6:u.type=6;break;case"INTS":case 7:u.type=7;break;case"STRINGS":case 8:u.type=8;break;case"TENSORS":case 9:u.type=9;break;case"GRAPHS":case 10:u.type=10;break;case"SPARSE_TENSORS":case 12:u.type=12;break;case"TYPE_PROTOS":case 14:u.type=14;break}if(e.f!=null&&(u.f=Number(e.f)),e.i!=null&&(l.Long?(u.i=l.Long.fromValue(e.i)).unsigned=!1:typeof e.i=="string"?u.i=parseInt(e.i,10):typeof e.i=="number"?u.i=e.i:typeof e.i=="object"&&(u.i=new l.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber())),e.s!=null&&(typeof e.s=="string"?l.base64.decode(e.s,u.s=l.newBuffer(l.base64.length(e.s)),0):e.s.length>=0&&(u.s=e.s)),e.t!=null){if(typeof e.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");u.t=c.onnx.TensorProto.fromObject(e.t)}if(e.g!=null){if(typeof e.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");u.g=c.onnx.GraphProto.fromObject(e.g)}if(e.sparseTensor!=null){if(typeof e.sparseTensor!="object")throw TypeError(".onnx.AttributeProto.sparseTensor: object expected");u.sparseTensor=c.onnx.SparseTensorProto.fromObject(e.sparseTensor)}if(e.tp!=null){if(typeof e.tp!="object")throw TypeError(".onnx.AttributeProto.tp: object expected");u.tp=c.onnx.TypeProto.fromObject(e.tp)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");u.floats=[];for(var i=0;i<e.floats.length;++i)u.floats[i]=Number(e.floats[i])}if(e.ints){if(!Array.isArray(e.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");u.ints=[];for(var i=0;i<e.ints.length;++i)l.Long?(u.ints[i]=l.Long.fromValue(e.ints[i])).unsigned=!1:typeof e.ints[i]=="string"?u.ints[i]=parseInt(e.ints[i],10):typeof e.ints[i]=="number"?u.ints[i]=e.ints[i]:typeof e.ints[i]=="object"&&(u.ints[i]=new l.LongBits(e.ints[i].low>>>0,e.ints[i].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");u.strings=[];for(var i=0;i<e.strings.length;++i)typeof e.strings[i]=="string"?l.base64.decode(e.strings[i],u.strings[i]=l.newBuffer(l.base64.length(e.strings[i])),0):e.strings[i].length>=0&&(u.strings[i]=e.strings[i])}if(e.tensors){if(!Array.isArray(e.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");u.tensors=[];for(var i=0;i<e.tensors.length;++i){if(typeof e.tensors[i]!="object")throw TypeError(".onnx.AttributeProto.tensors: object expected");u.tensors[i]=c.onnx.TensorProto.fromObject(e.tensors[i])}}if(e.graphs){if(!Array.isArray(e.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");u.graphs=[];for(var i=0;i<e.graphs.length;++i){if(typeof e.graphs[i]!="object")throw TypeError(".onnx.AttributeProto.graphs: object expected");u.graphs[i]=c.onnx.GraphProto.fromObject(e.graphs[i])}}if(e.sparseTensors){if(!Array.isArray(e.sparseTensors))throw TypeError(".onnx.AttributeProto.sparseTensors: array expected");u.sparseTensors=[];for(var i=0;i<e.sparseTensors.length;++i){if(typeof e.sparseTensors[i]!="object")throw TypeError(".onnx.AttributeProto.sparseTensors: object expected");u.sparseTensors[i]=c.onnx.SparseTensorProto.fromObject(e.sparseTensors[i])}}if(e.typeProtos){if(!Array.isArray(e.typeProtos))throw TypeError(".onnx.AttributeProto.typeProtos: array expected");u.typeProtos=[];for(var i=0;i<e.typeProtos.length;++i){if(typeof e.typeProtos[i]!="object")throw TypeError(".onnx.AttributeProto.typeProtos: object expected");u.typeProtos[i]=c.onnx.TypeProto.fromObject(e.typeProtos[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.floats=[],i.ints=[],i.strings=[],i.tensors=[],i.graphs=[],i.typeProtos=[],i.sparseTensors=[]),u.defaults){if(i.name="",i.f=0,l.Long){var d=new l.Long(0,0,!1);i.i=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.i=u.longs===String?"0":0;u.bytes===String?i.s="":(i.s=[],u.bytes!==Array&&(i.s=l.newBuffer(i.s))),i.t=null,i.g=null,i.docString="",i.tp=null,i.type=u.enums===String?"UNDEFINED":0,i.refAttrName="",i.sparseTensor=null}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.f!=null&&e.hasOwnProperty("f")&&(i.f=u.json&&!isFinite(e.f)?String(e.f):e.f),e.i!=null&&e.hasOwnProperty("i")&&(typeof e.i=="number"?i.i=u.longs===String?String(e.i):e.i:i.i=u.longs===String?l.Long.prototype.toString.call(e.i):u.longs===Number?new l.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber():e.i),e.s!=null&&e.hasOwnProperty("s")&&(i.s=u.bytes===String?l.base64.encode(e.s,0,e.s.length):u.bytes===Array?Array.prototype.slice.call(e.s):e.s),e.t!=null&&e.hasOwnProperty("t")&&(i.t=c.onnx.TensorProto.toObject(e.t,u)),e.g!=null&&e.hasOwnProperty("g")&&(i.g=c.onnx.GraphProto.toObject(e.g,u)),e.floats&&e.floats.length){i.floats=[];for(var h=0;h<e.floats.length;++h)i.floats[h]=u.json&&!isFinite(e.floats[h])?String(e.floats[h]):e.floats[h]}if(e.ints&&e.ints.length){i.ints=[];for(var h=0;h<e.ints.length;++h)typeof e.ints[h]=="number"?i.ints[h]=u.longs===String?String(e.ints[h]):e.ints[h]:i.ints[h]=u.longs===String?l.Long.prototype.toString.call(e.ints[h]):u.longs===Number?new l.LongBits(e.ints[h].low>>>0,e.ints[h].high>>>0).toNumber():e.ints[h]}if(e.strings&&e.strings.length){i.strings=[];for(var h=0;h<e.strings.length;++h)i.strings[h]=u.bytes===String?l.base64.encode(e.strings[h],0,e.strings[h].length):u.bytes===Array?Array.prototype.slice.call(e.strings[h]):e.strings[h]}if(e.tensors&&e.tensors.length){i.tensors=[];for(var h=0;h<e.tensors.length;++h)i.tensors[h]=c.onnx.TensorProto.toObject(e.tensors[h],u)}if(e.graphs&&e.graphs.length){i.graphs=[];for(var h=0;h<e.graphs.length;++h)i.graphs[h]=c.onnx.GraphProto.toObject(e.graphs[h],u)}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.tp!=null&&e.hasOwnProperty("tp")&&(i.tp=c.onnx.TypeProto.toObject(e.tp,u)),e.typeProtos&&e.typeProtos.length){i.typeProtos=[];for(var h=0;h<e.typeProtos.length;++h)i.typeProtos[h]=c.onnx.TypeProto.toObject(e.typeProtos[h],u)}if(e.type!=null&&e.hasOwnProperty("type")&&(i.type=u.enums===String?c.onnx.AttributeProto.AttributeType[e.type]===void 0?e.type:c.onnx.AttributeProto.AttributeType[e.type]:e.type),e.refAttrName!=null&&e.hasOwnProperty("refAttrName")&&(i.refAttrName=e.refAttrName),e.sparseTensor!=null&&e.hasOwnProperty("sparseTensor")&&(i.sparseTensor=c.onnx.SparseTensorProto.toObject(e.sparseTensor,u)),e.sparseTensors&&e.sparseTensors.length){i.sparseTensors=[];for(var h=0;h<e.sparseTensors.length;++h)i.sparseTensors[h]=c.onnx.SparseTensorProto.toObject(e.sparseTensors[h],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.AttributeProto"},a.AttributeType=function(){var e={},u=Object.create(e);return u[e[0]="UNDEFINED"]=0,u[e[1]="FLOAT"]=1,u[e[2]="INT"]=2,u[e[3]="STRING"]=3,u[e[4]="TENSOR"]=4,u[e[5]="GRAPH"]=5,u[e[11]="SPARSE_TENSOR"]=11,u[e[13]="TYPE_PROTO"]=13,u[e[6]="FLOATS"]=6,u[e[7]="INTS"]=7,u[e[8]="STRINGS"]=8,u[e[9]="TENSORS"]=9,u[e[10]="GRAPHS"]=10,u[e[12]="SPARSE_TENSORS"]=12,u[e[14]="TYPE_PROTOS"]=14,u}(),a}(),o.ValueInfoProto=function(){function a(e){if(e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.name="",a.prototype.type=null,a.prototype.docString="",a.create=function(e){return new a(e)},a.encode=function(e,u){return u||(u=p.create()),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(10).string(e.name),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&c.onnx.TypeProto.encode(e.type,u.uint32(18).fork()).ldelim(),e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(26).string(e.docString),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.ValueInfoProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.name=e.string();break}case 2:{d.type=c.onnx.TypeProto.decode(e,e.uint32());break}case 3:{d.docString=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.type!=null&&e.hasOwnProperty("type")){var u=c.onnx.TypeProto.verify(e.type);if(u)return"type."+u}return e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString)?"docString: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.ValueInfoProto)return e;var u=new c.onnx.ValueInfoProto;if(e.name!=null&&(u.name=String(e.name)),e.type!=null){if(typeof e.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");u.type=c.onnx.TypeProto.fromObject(e.type)}return e.docString!=null&&(u.docString=String(e.docString)),u},a.toObject=function(e,u){u||(u={});var i={};return u.defaults&&(i.name="",i.type=null,i.docString=""),e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.type!=null&&e.hasOwnProperty("type")&&(i.type=c.onnx.TypeProto.toObject(e.type,u)),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.ValueInfoProto"},a}(),o.NodeProto=function(){function a(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.input=l.emptyArray,a.prototype.output=l.emptyArray,a.prototype.name="",a.prototype.opType="",a.prototype.domain="",a.prototype.attribute=l.emptyArray,a.prototype.docString="",a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.input!=null&&e.input.length)for(var i=0;i<e.input.length;++i)u.uint32(10).string(e.input[i]);if(e.output!=null&&e.output.length)for(var i=0;i<e.output.length;++i)u.uint32(18).string(e.output[i]);if(e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(26).string(e.name),e.opType!=null&&Object.hasOwnProperty.call(e,"opType")&&u.uint32(34).string(e.opType),e.attribute!=null&&e.attribute.length)for(var i=0;i<e.attribute.length;++i)c.onnx.AttributeProto.encode(e.attribute[i],u.uint32(42).fork()).ldelim();return e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(50).string(e.docString),e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(58).string(e.domain),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.NodeProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.input&&d.input.length||(d.input=[]),d.input.push(e.string());break}case 2:{d.output&&d.output.length||(d.output=[]),d.output.push(e.string());break}case 3:{d.name=e.string();break}case 4:{d.opType=e.string();break}case 7:{d.domain=e.string();break}case 5:{d.attribute&&d.attribute.length||(d.attribute=[]),d.attribute.push(c.onnx.AttributeProto.decode(e,e.uint32()));break}case 6:{d.docString=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var u=0;u<e.input.length;++u)if(!l.isString(e.input[u]))return"input: string[] expected"}if(e.output!=null&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(var u=0;u<e.output.length;++u)if(!l.isString(e.output[u]))return"output: string[] expected"}if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.opType!=null&&e.hasOwnProperty("opType")&&!l.isString(e.opType))return"opType: string expected";if(e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain))return"domain: string expected";if(e.attribute!=null&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(var u=0;u<e.attribute.length;++u){var i=c.onnx.AttributeProto.verify(e.attribute[u]);if(i)return"attribute."+i}}return e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString)?"docString: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.NodeProto)return e;var u=new c.onnx.NodeProto;if(e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.NodeProto.input: array expected");u.input=[];for(var i=0;i<e.input.length;++i)u.input[i]=String(e.input[i])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.NodeProto.output: array expected");u.output=[];for(var i=0;i<e.output.length;++i)u.output[i]=String(e.output[i])}if(e.name!=null&&(u.name=String(e.name)),e.opType!=null&&(u.opType=String(e.opType)),e.domain!=null&&(u.domain=String(e.domain)),e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");u.attribute=[];for(var i=0;i<e.attribute.length;++i){if(typeof e.attribute[i]!="object")throw TypeError(".onnx.NodeProto.attribute: object expected");u.attribute[i]=c.onnx.AttributeProto.fromObject(e.attribute[i])}}return e.docString!=null&&(u.docString=String(e.docString)),u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.input=[],i.output=[],i.attribute=[]),u.defaults&&(i.name="",i.opType="",i.docString="",i.domain=""),e.input&&e.input.length){i.input=[];for(var d=0;d<e.input.length;++d)i.input[d]=e.input[d]}if(e.output&&e.output.length){i.output=[];for(var d=0;d<e.output.length;++d)i.output[d]=e.output[d]}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.opType!=null&&e.hasOwnProperty("opType")&&(i.opType=e.opType),e.attribute&&e.attribute.length){i.attribute=[];for(var d=0;d<e.attribute.length;++d)i.attribute[d]=c.onnx.AttributeProto.toObject(e.attribute[d],u)}return e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.NodeProto"},a}(),o.TrainingInfoProto=function(){function a(e){if(this.initializationBinding=[],this.updateBinding=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.initialization=null,a.prototype.algorithm=null,a.prototype.initializationBinding=l.emptyArray,a.prototype.updateBinding=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.initialization!=null&&Object.hasOwnProperty.call(e,"initialization")&&c.onnx.GraphProto.encode(e.initialization,u.uint32(10).fork()).ldelim(),e.algorithm!=null&&Object.hasOwnProperty.call(e,"algorithm")&&c.onnx.GraphProto.encode(e.algorithm,u.uint32(18).fork()).ldelim(),e.initializationBinding!=null&&e.initializationBinding.length)for(var i=0;i<e.initializationBinding.length;++i)c.onnx.StringStringEntryProto.encode(e.initializationBinding[i],u.uint32(26).fork()).ldelim();if(e.updateBinding!=null&&e.updateBinding.length)for(var i=0;i<e.updateBinding.length;++i)c.onnx.StringStringEntryProto.encode(e.updateBinding[i],u.uint32(34).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TrainingInfoProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.initialization=c.onnx.GraphProto.decode(e,e.uint32());break}case 2:{d.algorithm=c.onnx.GraphProto.decode(e,e.uint32());break}case 3:{d.initializationBinding&&d.initializationBinding.length||(d.initializationBinding=[]),d.initializationBinding.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}case 4:{d.updateBinding&&d.updateBinding.length||(d.updateBinding=[]),d.updateBinding.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.initialization!=null&&e.hasOwnProperty("initialization")){var u=c.onnx.GraphProto.verify(e.initialization);if(u)return"initialization."+u}if(e.algorithm!=null&&e.hasOwnProperty("algorithm")){var u=c.onnx.GraphProto.verify(e.algorithm);if(u)return"algorithm."+u}if(e.initializationBinding!=null&&e.hasOwnProperty("initializationBinding")){if(!Array.isArray(e.initializationBinding))return"initializationBinding: array expected";for(var i=0;i<e.initializationBinding.length;++i){var u=c.onnx.StringStringEntryProto.verify(e.initializationBinding[i]);if(u)return"initializationBinding."+u}}if(e.updateBinding!=null&&e.hasOwnProperty("updateBinding")){if(!Array.isArray(e.updateBinding))return"updateBinding: array expected";for(var i=0;i<e.updateBinding.length;++i){var u=c.onnx.StringStringEntryProto.verify(e.updateBinding[i]);if(u)return"updateBinding."+u}}return null},a.fromObject=function(e){if(e instanceof c.onnx.TrainingInfoProto)return e;var u=new c.onnx.TrainingInfoProto;if(e.initialization!=null){if(typeof e.initialization!="object")throw TypeError(".onnx.TrainingInfoProto.initialization: object expected");u.initialization=c.onnx.GraphProto.fromObject(e.initialization)}if(e.algorithm!=null){if(typeof e.algorithm!="object")throw TypeError(".onnx.TrainingInfoProto.algorithm: object expected");u.algorithm=c.onnx.GraphProto.fromObject(e.algorithm)}if(e.initializationBinding){if(!Array.isArray(e.initializationBinding))throw TypeError(".onnx.TrainingInfoProto.initializationBinding: array expected");u.initializationBinding=[];for(var i=0;i<e.initializationBinding.length;++i){if(typeof e.initializationBinding[i]!="object")throw TypeError(".onnx.TrainingInfoProto.initializationBinding: object expected");u.initializationBinding[i]=c.onnx.StringStringEntryProto.fromObject(e.initializationBinding[i])}}if(e.updateBinding){if(!Array.isArray(e.updateBinding))throw TypeError(".onnx.TrainingInfoProto.updateBinding: array expected");u.updateBinding=[];for(var i=0;i<e.updateBinding.length;++i){if(typeof e.updateBinding[i]!="object")throw TypeError(".onnx.TrainingInfoProto.updateBinding: object expected");u.updateBinding[i]=c.onnx.StringStringEntryProto.fromObject(e.updateBinding[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.initializationBinding=[],i.updateBinding=[]),u.defaults&&(i.initialization=null,i.algorithm=null),e.initialization!=null&&e.hasOwnProperty("initialization")&&(i.initialization=c.onnx.GraphProto.toObject(e.initialization,u)),e.algorithm!=null&&e.hasOwnProperty("algorithm")&&(i.algorithm=c.onnx.GraphProto.toObject(e.algorithm,u)),e.initializationBinding&&e.initializationBinding.length){i.initializationBinding=[];for(var d=0;d<e.initializationBinding.length;++d)i.initializationBinding[d]=c.onnx.StringStringEntryProto.toObject(e.initializationBinding[d],u)}if(e.updateBinding&&e.updateBinding.length){i.updateBinding=[];for(var d=0;d<e.updateBinding.length;++d)i.updateBinding[d]=c.onnx.StringStringEntryProto.toObject(e.updateBinding[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TrainingInfoProto"},a}(),o.ModelProto=function(){function a(e){if(this.opsetImport=[],this.metadataProps=[],this.trainingInfo=[],this.functions=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.irVersion=l.Long?l.Long.fromBits(0,0,!1):0,a.prototype.opsetImport=l.emptyArray,a.prototype.producerName="",a.prototype.producerVersion="",a.prototype.domain="",a.prototype.modelVersion=l.Long?l.Long.fromBits(0,0,!1):0,a.prototype.docString="",a.prototype.graph=null,a.prototype.metadataProps=l.emptyArray,a.prototype.trainingInfo=l.emptyArray,a.prototype.functions=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.irVersion!=null&&Object.hasOwnProperty.call(e,"irVersion")&&u.uint32(8).int64(e.irVersion),e.producerName!=null&&Object.hasOwnProperty.call(e,"producerName")&&u.uint32(18).string(e.producerName),e.producerVersion!=null&&Object.hasOwnProperty.call(e,"producerVersion")&&u.uint32(26).string(e.producerVersion),e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(34).string(e.domain),e.modelVersion!=null&&Object.hasOwnProperty.call(e,"modelVersion")&&u.uint32(40).int64(e.modelVersion),e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(50).string(e.docString),e.graph!=null&&Object.hasOwnProperty.call(e,"graph")&&c.onnx.GraphProto.encode(e.graph,u.uint32(58).fork()).ldelim(),e.opsetImport!=null&&e.opsetImport.length)for(var i=0;i<e.opsetImport.length;++i)c.onnx.OperatorSetIdProto.encode(e.opsetImport[i],u.uint32(66).fork()).ldelim();if(e.metadataProps!=null&&e.metadataProps.length)for(var i=0;i<e.metadataProps.length;++i)c.onnx.StringStringEntryProto.encode(e.metadataProps[i],u.uint32(114).fork()).ldelim();if(e.trainingInfo!=null&&e.trainingInfo.length)for(var i=0;i<e.trainingInfo.length;++i)c.onnx.TrainingInfoProto.encode(e.trainingInfo[i],u.uint32(162).fork()).ldelim();if(e.functions!=null&&e.functions.length)for(var i=0;i<e.functions.length;++i)c.onnx.FunctionProto.encode(e.functions[i],u.uint32(202).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.ModelProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.irVersion=e.int64();break}case 8:{d.opsetImport&&d.opsetImport.length||(d.opsetImport=[]),d.opsetImport.push(c.onnx.OperatorSetIdProto.decode(e,e.uint32()));break}case 2:{d.producerName=e.string();break}case 3:{d.producerVersion=e.string();break}case 4:{d.domain=e.string();break}case 5:{d.modelVersion=e.int64();break}case 6:{d.docString=e.string();break}case 7:{d.graph=c.onnx.GraphProto.decode(e,e.uint32());break}case 14:{d.metadataProps&&d.metadataProps.length||(d.metadataProps=[]),d.metadataProps.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}case 20:{d.trainingInfo&&d.trainingInfo.length||(d.trainingInfo=[]),d.trainingInfo.push(c.onnx.TrainingInfoProto.decode(e,e.uint32()));break}case 25:{d.functions&&d.functions.length||(d.functions=[]),d.functions.push(c.onnx.FunctionProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.irVersion!=null&&e.hasOwnProperty("irVersion")&&!l.isInteger(e.irVersion)&&!(e.irVersion&&l.isInteger(e.irVersion.low)&&l.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(e.opsetImport!=null&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var u=0;u<e.opsetImport.length;++u){var i=c.onnx.OperatorSetIdProto.verify(e.opsetImport[u]);if(i)return"opsetImport."+i}}if(e.producerName!=null&&e.hasOwnProperty("producerName")&&!l.isString(e.producerName))return"producerName: string expected";if(e.producerVersion!=null&&e.hasOwnProperty("producerVersion")&&!l.isString(e.producerVersion))return"producerVersion: string expected";if(e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain))return"domain: string expected";if(e.modelVersion!=null&&e.hasOwnProperty("modelVersion")&&!l.isInteger(e.modelVersion)&&!(e.modelVersion&&l.isInteger(e.modelVersion.low)&&l.isInteger(e.modelVersion.high)))return"modelVersion: integer|Long expected";if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.graph!=null&&e.hasOwnProperty("graph")){var i=c.onnx.GraphProto.verify(e.graph);if(i)return"graph."+i}if(e.metadataProps!=null&&e.hasOwnProperty("metadataProps")){if(!Array.isArray(e.metadataProps))return"metadataProps: array expected";for(var u=0;u<e.metadataProps.length;++u){var i=c.onnx.StringStringEntryProto.verify(e.metadataProps[u]);if(i)return"metadataProps."+i}}if(e.trainingInfo!=null&&e.hasOwnProperty("trainingInfo")){if(!Array.isArray(e.trainingInfo))return"trainingInfo: array expected";for(var u=0;u<e.trainingInfo.length;++u){var i=c.onnx.TrainingInfoProto.verify(e.trainingInfo[u]);if(i)return"trainingInfo."+i}}if(e.functions!=null&&e.hasOwnProperty("functions")){if(!Array.isArray(e.functions))return"functions: array expected";for(var u=0;u<e.functions.length;++u){var i=c.onnx.FunctionProto.verify(e.functions[u]);if(i)return"functions."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.ModelProto)return e;var u=new c.onnx.ModelProto;if(e.irVersion!=null&&(l.Long?(u.irVersion=l.Long.fromValue(e.irVersion)).unsigned=!1:typeof e.irVersion=="string"?u.irVersion=parseInt(e.irVersion,10):typeof e.irVersion=="number"?u.irVersion=e.irVersion:typeof e.irVersion=="object"&&(u.irVersion=new l.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");u.opsetImport=[];for(var i=0;i<e.opsetImport.length;++i){if(typeof e.opsetImport[i]!="object")throw TypeError(".onnx.ModelProto.opsetImport: object expected");u.opsetImport[i]=c.onnx.OperatorSetIdProto.fromObject(e.opsetImport[i])}}if(e.producerName!=null&&(u.producerName=String(e.producerName)),e.producerVersion!=null&&(u.producerVersion=String(e.producerVersion)),e.domain!=null&&(u.domain=String(e.domain)),e.modelVersion!=null&&(l.Long?(u.modelVersion=l.Long.fromValue(e.modelVersion)).unsigned=!1:typeof e.modelVersion=="string"?u.modelVersion=parseInt(e.modelVersion,10):typeof e.modelVersion=="number"?u.modelVersion=e.modelVersion:typeof e.modelVersion=="object"&&(u.modelVersion=new l.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber())),e.docString!=null&&(u.docString=String(e.docString)),e.graph!=null){if(typeof e.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");u.graph=c.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");u.metadataProps=[];for(var i=0;i<e.metadataProps.length;++i){if(typeof e.metadataProps[i]!="object")throw TypeError(".onnx.ModelProto.metadataProps: object expected");u.metadataProps[i]=c.onnx.StringStringEntryProto.fromObject(e.metadataProps[i])}}if(e.trainingInfo){if(!Array.isArray(e.trainingInfo))throw TypeError(".onnx.ModelProto.trainingInfo: array expected");u.trainingInfo=[];for(var i=0;i<e.trainingInfo.length;++i){if(typeof e.trainingInfo[i]!="object")throw TypeError(".onnx.ModelProto.trainingInfo: object expected");u.trainingInfo[i]=c.onnx.TrainingInfoProto.fromObject(e.trainingInfo[i])}}if(e.functions){if(!Array.isArray(e.functions))throw TypeError(".onnx.ModelProto.functions: array expected");u.functions=[];for(var i=0;i<e.functions.length;++i){if(typeof e.functions[i]!="object")throw TypeError(".onnx.ModelProto.functions: object expected");u.functions[i]=c.onnx.FunctionProto.fromObject(e.functions[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.opsetImport=[],i.metadataProps=[],i.trainingInfo=[],i.functions=[]),u.defaults){if(l.Long){var d=new l.Long(0,0,!1);i.irVersion=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.irVersion=u.longs===String?"0":0;if(i.producerName="",i.producerVersion="",i.domain="",l.Long){var d=new l.Long(0,0,!1);i.modelVersion=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.modelVersion=u.longs===String?"0":0;i.docString="",i.graph=null}if(e.irVersion!=null&&e.hasOwnProperty("irVersion")&&(typeof e.irVersion=="number"?i.irVersion=u.longs===String?String(e.irVersion):e.irVersion:i.irVersion=u.longs===String?l.Long.prototype.toString.call(e.irVersion):u.longs===Number?new l.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber():e.irVersion),e.producerName!=null&&e.hasOwnProperty("producerName")&&(i.producerName=e.producerName),e.producerVersion!=null&&e.hasOwnProperty("producerVersion")&&(i.producerVersion=e.producerVersion),e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.modelVersion!=null&&e.hasOwnProperty("modelVersion")&&(typeof e.modelVersion=="number"?i.modelVersion=u.longs===String?String(e.modelVersion):e.modelVersion:i.modelVersion=u.longs===String?l.Long.prototype.toString.call(e.modelVersion):u.longs===Number?new l.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.graph!=null&&e.hasOwnProperty("graph")&&(i.graph=c.onnx.GraphProto.toObject(e.graph,u)),e.opsetImport&&e.opsetImport.length){i.opsetImport=[];for(var h=0;h<e.opsetImport.length;++h)i.opsetImport[h]=c.onnx.OperatorSetIdProto.toObject(e.opsetImport[h],u)}if(e.metadataProps&&e.metadataProps.length){i.metadataProps=[];for(var h=0;h<e.metadataProps.length;++h)i.metadataProps[h]=c.onnx.StringStringEntryProto.toObject(e.metadataProps[h],u)}if(e.trainingInfo&&e.trainingInfo.length){i.trainingInfo=[];for(var h=0;h<e.trainingInfo.length;++h)i.trainingInfo[h]=c.onnx.TrainingInfoProto.toObject(e.trainingInfo[h],u)}if(e.functions&&e.functions.length){i.functions=[];for(var h=0;h<e.functions.length;++h)i.functions[h]=c.onnx.FunctionProto.toObject(e.functions[h],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.ModelProto"},a}(),o.StringStringEntryProto=function(){function a(e){if(e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.key="",a.prototype.value="",a.create=function(e){return new a(e)},a.encode=function(e,u){return u||(u=p.create()),e.key!=null&&Object.hasOwnProperty.call(e,"key")&&u.uint32(10).string(e.key),e.value!=null&&Object.hasOwnProperty.call(e,"value")&&u.uint32(18).string(e.value),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.StringStringEntryProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.key=e.string();break}case 2:{d.value=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){return typeof e!="object"||e===null?"object expected":e.key!=null&&e.hasOwnProperty("key")&&!l.isString(e.key)?"key: string expected":e.value!=null&&e.hasOwnProperty("value")&&!l.isString(e.value)?"value: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.StringStringEntryProto)return e;var u=new c.onnx.StringStringEntryProto;return e.key!=null&&(u.key=String(e.key)),e.value!=null&&(u.value=String(e.value)),u},a.toObject=function(e,u){u||(u={});var i={};return u.defaults&&(i.key="",i.value=""),e.key!=null&&e.hasOwnProperty("key")&&(i.key=e.key),e.value!=null&&e.hasOwnProperty("value")&&(i.value=e.value),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.StringStringEntryProto"},a}(),o.TensorAnnotation=function(){function a(e){if(this.quantParameterTensorNames=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.tensorName="",a.prototype.quantParameterTensorNames=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.tensorName!=null&&Object.hasOwnProperty.call(e,"tensorName")&&u.uint32(10).string(e.tensorName),e.quantParameterTensorNames!=null&&e.quantParameterTensorNames.length)for(var i=0;i<e.quantParameterTensorNames.length;++i)c.onnx.StringStringEntryProto.encode(e.quantParameterTensorNames[i],u.uint32(18).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TensorAnnotation;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.tensorName=e.string();break}case 2:{d.quantParameterTensorNames&&d.quantParameterTensorNames.length||(d.quantParameterTensorNames=[]),d.quantParameterTensorNames.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.tensorName!=null&&e.hasOwnProperty("tensorName")&&!l.isString(e.tensorName))return"tensorName: string expected";if(e.quantParameterTensorNames!=null&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var u=0;u<e.quantParameterTensorNames.length;++u){var i=c.onnx.StringStringEntryProto.verify(e.quantParameterTensorNames[u]);if(i)return"quantParameterTensorNames."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.TensorAnnotation)return e;var u=new c.onnx.TensorAnnotation;if(e.tensorName!=null&&(u.tensorName=String(e.tensorName)),e.quantParameterTensorNames){if(!Array.isArray(e.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");u.quantParameterTensorNames=[];for(var i=0;i<e.quantParameterTensorNames.length;++i){if(typeof e.quantParameterTensorNames[i]!="object")throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");u.quantParameterTensorNames[i]=c.onnx.StringStringEntryProto.fromObject(e.quantParameterTensorNames[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.quantParameterTensorNames=[]),u.defaults&&(i.tensorName=""),e.tensorName!=null&&e.hasOwnProperty("tensorName")&&(i.tensorName=e.tensorName),e.quantParameterTensorNames&&e.quantParameterTensorNames.length){i.quantParameterTensorNames=[];for(var d=0;d<e.quantParameterTensorNames.length;++d)i.quantParameterTensorNames[d]=c.onnx.StringStringEntryProto.toObject(e.quantParameterTensorNames[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TensorAnnotation"},a}(),o.GraphProto=function(){function a(e){if(this.node=[],this.initializer=[],this.sparseInitializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.node=l.emptyArray,a.prototype.name="",a.prototype.initializer=l.emptyArray,a.prototype.sparseInitializer=l.emptyArray,a.prototype.docString="",a.prototype.input=l.emptyArray,a.prototype.output=l.emptyArray,a.prototype.valueInfo=l.emptyArray,a.prototype.quantizationAnnotation=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.node!=null&&e.node.length)for(var i=0;i<e.node.length;++i)c.onnx.NodeProto.encode(e.node[i],u.uint32(10).fork()).ldelim();if(e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(18).string(e.name),e.initializer!=null&&e.initializer.length)for(var i=0;i<e.initializer.length;++i)c.onnx.TensorProto.encode(e.initializer[i],u.uint32(42).fork()).ldelim();if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(82).string(e.docString),e.input!=null&&e.input.length)for(var i=0;i<e.input.length;++i)c.onnx.ValueInfoProto.encode(e.input[i],u.uint32(90).fork()).ldelim();if(e.output!=null&&e.output.length)for(var i=0;i<e.output.length;++i)c.onnx.ValueInfoProto.encode(e.output[i],u.uint32(98).fork()).ldelim();if(e.valueInfo!=null&&e.valueInfo.length)for(var i=0;i<e.valueInfo.length;++i)c.onnx.ValueInfoProto.encode(e.valueInfo[i],u.uint32(106).fork()).ldelim();if(e.quantizationAnnotation!=null&&e.quantizationAnnotation.length)for(var i=0;i<e.quantizationAnnotation.length;++i)c.onnx.TensorAnnotation.encode(e.quantizationAnnotation[i],u.uint32(114).fork()).ldelim();if(e.sparseInitializer!=null&&e.sparseInitializer.length)for(var i=0;i<e.sparseInitializer.length;++i)c.onnx.SparseTensorProto.encode(e.sparseInitializer[i],u.uint32(122).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.GraphProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.node&&d.node.length||(d.node=[]),d.node.push(c.onnx.NodeProto.decode(e,e.uint32()));break}case 2:{d.name=e.string();break}case 5:{d.initializer&&d.initializer.length||(d.initializer=[]),d.initializer.push(c.onnx.TensorProto.decode(e,e.uint32()));break}case 15:{d.sparseInitializer&&d.sparseInitializer.length||(d.sparseInitializer=[]),d.sparseInitializer.push(c.onnx.SparseTensorProto.decode(e,e.uint32()));break}case 10:{d.docString=e.string();break}case 11:{d.input&&d.input.length||(d.input=[]),d.input.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break}case 12:{d.output&&d.output.length||(d.output=[]),d.output.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break}case 13:{d.valueInfo&&d.valueInfo.length||(d.valueInfo=[]),d.valueInfo.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break}case 14:{d.quantizationAnnotation&&d.quantizationAnnotation.length||(d.quantizationAnnotation=[]),d.quantizationAnnotation.push(c.onnx.TensorAnnotation.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.node!=null&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var u=0;u<e.node.length;++u){var i=c.onnx.NodeProto.verify(e.node[u]);if(i)return"node."+i}}if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.initializer!=null&&e.hasOwnProperty("initializer")){if(!Array.isArray(e.initializer))return"initializer: array expected";for(var u=0;u<e.initializer.length;++u){var i=c.onnx.TensorProto.verify(e.initializer[u]);if(i)return"initializer."+i}}if(e.sparseInitializer!=null&&e.hasOwnProperty("sparseInitializer")){if(!Array.isArray(e.sparseInitializer))return"sparseInitializer: array expected";for(var u=0;u<e.sparseInitializer.length;++u){var i=c.onnx.SparseTensorProto.verify(e.sparseInitializer[u]);if(i)return"sparseInitializer."+i}}if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var u=0;u<e.input.length;++u){var i=c.onnx.ValueInfoProto.verify(e.input[u]);if(i)return"input."+i}}if(e.output!=null&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(var u=0;u<e.output.length;++u){var i=c.onnx.ValueInfoProto.verify(e.output[u]);if(i)return"output."+i}}if(e.valueInfo!=null&&e.hasOwnProperty("valueInfo")){if(!Array.isArray(e.valueInfo))return"valueInfo: array expected";for(var u=0;u<e.valueInfo.length;++u){var i=c.onnx.ValueInfoProto.verify(e.valueInfo[u]);if(i)return"valueInfo."+i}}if(e.quantizationAnnotation!=null&&e.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(e.quantizationAnnotation))return"quantizationAnnotation: array expected";for(var u=0;u<e.quantizationAnnotation.length;++u){var i=c.onnx.TensorAnnotation.verify(e.quantizationAnnotation[u]);if(i)return"quantizationAnnotation."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.GraphProto)return e;var u=new c.onnx.GraphProto;if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.GraphProto.node: array expected");u.node=[];for(var i=0;i<e.node.length;++i){if(typeof e.node[i]!="object")throw TypeError(".onnx.GraphProto.node: object expected");u.node[i]=c.onnx.NodeProto.fromObject(e.node[i])}}if(e.name!=null&&(u.name=String(e.name)),e.initializer){if(!Array.isArray(e.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");u.initializer=[];for(var i=0;i<e.initializer.length;++i){if(typeof e.initializer[i]!="object")throw TypeError(".onnx.GraphProto.initializer: object expected");u.initializer[i]=c.onnx.TensorProto.fromObject(e.initializer[i])}}if(e.sparseInitializer){if(!Array.isArray(e.sparseInitializer))throw TypeError(".onnx.GraphProto.sparseInitializer: array expected");u.sparseInitializer=[];for(var i=0;i<e.sparseInitializer.length;++i){if(typeof e.sparseInitializer[i]!="object")throw TypeError(".onnx.GraphProto.sparseInitializer: object expected");u.sparseInitializer[i]=c.onnx.SparseTensorProto.fromObject(e.sparseInitializer[i])}}if(e.docString!=null&&(u.docString=String(e.docString)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.GraphProto.input: array expected");u.input=[];for(var i=0;i<e.input.length;++i){if(typeof e.input[i]!="object")throw TypeError(".onnx.GraphProto.input: object expected");u.input[i]=c.onnx.ValueInfoProto.fromObject(e.input[i])}}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.GraphProto.output: array expected");u.output=[];for(var i=0;i<e.output.length;++i){if(typeof e.output[i]!="object")throw TypeError(".onnx.GraphProto.output: object expected");u.output[i]=c.onnx.ValueInfoProto.fromObject(e.output[i])}}if(e.valueInfo){if(!Array.isArray(e.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");u.valueInfo=[];for(var i=0;i<e.valueInfo.length;++i){if(typeof e.valueInfo[i]!="object")throw TypeError(".onnx.GraphProto.valueInfo: object expected");u.valueInfo[i]=c.onnx.ValueInfoProto.fromObject(e.valueInfo[i])}}if(e.quantizationAnnotation){if(!Array.isArray(e.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");u.quantizationAnnotation=[];for(var i=0;i<e.quantizationAnnotation.length;++i){if(typeof e.quantizationAnnotation[i]!="object")throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");u.quantizationAnnotation[i]=c.onnx.TensorAnnotation.fromObject(e.quantizationAnnotation[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.node=[],i.initializer=[],i.input=[],i.output=[],i.valueInfo=[],i.quantizationAnnotation=[],i.sparseInitializer=[]),u.defaults&&(i.name="",i.docString=""),e.node&&e.node.length){i.node=[];for(var d=0;d<e.node.length;++d)i.node[d]=c.onnx.NodeProto.toObject(e.node[d],u)}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.initializer&&e.initializer.length){i.initializer=[];for(var d=0;d<e.initializer.length;++d)i.initializer[d]=c.onnx.TensorProto.toObject(e.initializer[d],u)}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.input&&e.input.length){i.input=[];for(var d=0;d<e.input.length;++d)i.input[d]=c.onnx.ValueInfoProto.toObject(e.input[d],u)}if(e.output&&e.output.length){i.output=[];for(var d=0;d<e.output.length;++d)i.output[d]=c.onnx.ValueInfoProto.toObject(e.output[d],u)}if(e.valueInfo&&e.valueInfo.length){i.valueInfo=[];for(var d=0;d<e.valueInfo.length;++d)i.valueInfo[d]=c.onnx.ValueInfoProto.toObject(e.valueInfo[d],u)}if(e.quantizationAnnotation&&e.quantizationAnnotation.length){i.quantizationAnnotation=[];for(var d=0;d<e.quantizationAnnotation.length;++d)i.quantizationAnnotation[d]=c.onnx.TensorAnnotation.toObject(e.quantizationAnnotation[d],u)}if(e.sparseInitializer&&e.sparseInitializer.length){i.sparseInitializer=[];for(var d=0;d<e.sparseInitializer.length;++d)i.sparseInitializer[d]=c.onnx.SparseTensorProto.toObject(e.sparseInitializer[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.GraphProto"},a}(),o.TensorProto=function(){function a(e){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.dims=l.emptyArray,a.prototype.dataType=0,a.prototype.segment=null,a.prototype.floatData=l.emptyArray,a.prototype.int32Data=l.emptyArray,a.prototype.stringData=l.emptyArray,a.prototype.int64Data=l.emptyArray,a.prototype.name="",a.prototype.docString="",a.prototype.rawData=l.newBuffer([]),a.prototype.externalData=l.emptyArray,a.prototype.dataLocation=0,a.prototype.doubleData=l.emptyArray,a.prototype.uint64Data=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.dims!=null&&e.dims.length){u.uint32(10).fork();for(var i=0;i<e.dims.length;++i)u.int64(e.dims[i]);u.ldelim()}if(e.dataType!=null&&Object.hasOwnProperty.call(e,"dataType")&&u.uint32(16).int32(e.dataType),e.segment!=null&&Object.hasOwnProperty.call(e,"segment")&&c.onnx.TensorProto.Segment.encode(e.segment,u.uint32(26).fork()).ldelim(),e.floatData!=null&&e.floatData.length){u.uint32(34).fork();for(var i=0;i<e.floatData.length;++i)u.float(e.floatData[i]);u.ldelim()}if(e.int32Data!=null&&e.int32Data.length){u.uint32(42).fork();for(var i=0;i<e.int32Data.length;++i)u.int32(e.int32Data[i]);u.ldelim()}if(e.stringData!=null&&e.stringData.length)for(var i=0;i<e.stringData.length;++i)u.uint32(50).bytes(e.stringData[i]);if(e.int64Data!=null&&e.int64Data.length){u.uint32(58).fork();for(var i=0;i<e.int64Data.length;++i)u.int64(e.int64Data[i]);u.ldelim()}if(e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(66).string(e.name),e.rawData!=null&&Object.hasOwnProperty.call(e,"rawData")&&u.uint32(74).bytes(e.rawData),e.doubleData!=null&&e.doubleData.length){u.uint32(82).fork();for(var i=0;i<e.doubleData.length;++i)u.double(e.doubleData[i]);u.ldelim()}if(e.uint64Data!=null&&e.uint64Data.length){u.uint32(90).fork();for(var i=0;i<e.uint64Data.length;++i)u.uint64(e.uint64Data[i]);u.ldelim()}if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(98).string(e.docString),e.externalData!=null&&e.externalData.length)for(var i=0;i<e.externalData.length;++i)c.onnx.StringStringEntryProto.encode(e.externalData[i],u.uint32(106).fork()).ldelim();return e.dataLocation!=null&&Object.hasOwnProperty.call(e,"dataLocation")&&u.uint32(112).int32(e.dataLocation),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TensorProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{if(d.dims&&d.dims.length||(d.dims=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.dims.push(e.int64());else d.dims.push(e.int64());break}case 2:{d.dataType=e.int32();break}case 3:{d.segment=c.onnx.TensorProto.Segment.decode(e,e.uint32());break}case 4:{if(d.floatData&&d.floatData.length||(d.floatData=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.floatData.push(e.float());else d.floatData.push(e.float());break}case 5:{if(d.int32Data&&d.int32Data.length||(d.int32Data=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.int32Data.push(e.int32());else d.int32Data.push(e.int32());break}case 6:{d.stringData&&d.stringData.length||(d.stringData=[]),d.stringData.push(e.bytes());break}case 7:{if(d.int64Data&&d.int64Data.length||(d.int64Data=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.int64Data.push(e.int64());else d.int64Data.push(e.int64());break}case 8:{d.name=e.string();break}case 12:{d.docString=e.string();break}case 9:{d.rawData=e.bytes();break}case 13:{d.externalData&&d.externalData.length||(d.externalData=[]),d.externalData.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}case 14:{d.dataLocation=e.int32();break}case 10:{if(d.doubleData&&d.doubleData.length||(d.doubleData=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.doubleData.push(e.double());else d.doubleData.push(e.double());break}case 11:{if(d.uint64Data&&d.uint64Data.length||(d.uint64Data=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.uint64Data.push(e.uint64());else d.uint64Data.push(e.uint64());break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.dims!=null&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var u=0;u<e.dims.length;++u)if(!l.isInteger(e.dims[u])&&!(e.dims[u]&&l.isInteger(e.dims[u].low)&&l.isInteger(e.dims[u].high)))return"dims: integer|Long[] expected"}if(e.dataType!=null&&e.hasOwnProperty("dataType")&&!l.isInteger(e.dataType))return"dataType: integer expected";if(e.segment!=null&&e.hasOwnProperty("segment")){var i=c.onnx.TensorProto.Segment.verify(e.segment);if(i)return"segment."+i}if(e.floatData!=null&&e.hasOwnProperty("floatData")){if(!Array.isArray(e.floatData))return"floatData: array expected";for(var u=0;u<e.floatData.length;++u)if(typeof e.floatData[u]!="number")return"floatData: number[] expected"}if(e.int32Data!=null&&e.hasOwnProperty("int32Data")){if(!Array.isArray(e.int32Data))return"int32Data: array expected";for(var u=0;u<e.int32Data.length;++u)if(!l.isInteger(e.int32Data[u]))return"int32Data: integer[] expected"}if(e.stringData!=null&&e.hasOwnProperty("stringData")){if(!Array.isArray(e.stringData))return"stringData: array expected";for(var u=0;u<e.stringData.length;++u)if(!(e.stringData[u]&&typeof e.stringData[u].length=="number"||l.isString(e.stringData[u])))return"stringData: buffer[] expected"}if(e.int64Data!=null&&e.hasOwnProperty("int64Data")){if(!Array.isArray(e.int64Data))return"int64Data: array expected";for(var u=0;u<e.int64Data.length;++u)if(!l.isInteger(e.int64Data[u])&&!(e.int64Data[u]&&l.isInteger(e.int64Data[u].low)&&l.isInteger(e.int64Data[u].high)))return"int64Data: integer|Long[] expected"}if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.rawData!=null&&e.hasOwnProperty("rawData")&&!(e.rawData&&typeof e.rawData.length=="number"||l.isString(e.rawData)))return"rawData: buffer expected";if(e.externalData!=null&&e.hasOwnProperty("externalData")){if(!Array.isArray(e.externalData))return"externalData: array expected";for(var u=0;u<e.externalData.length;++u){var i=c.onnx.StringStringEntryProto.verify(e.externalData[u]);if(i)return"externalData."+i}}if(e.dataLocation!=null&&e.hasOwnProperty("dataLocation"))switch(e.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:break}if(e.doubleData!=null&&e.hasOwnProperty("doubleData")){if(!Array.isArray(e.doubleData))return"doubleData: array expected";for(var u=0;u<e.doubleData.length;++u)if(typeof e.doubleData[u]!="number")return"doubleData: number[] expected"}if(e.uint64Data!=null&&e.hasOwnProperty("uint64Data")){if(!Array.isArray(e.uint64Data))return"uint64Data: array expected";for(var u=0;u<e.uint64Data.length;++u)if(!l.isInteger(e.uint64Data[u])&&!(e.uint64Data[u]&&l.isInteger(e.uint64Data[u].low)&&l.isInteger(e.uint64Data[u].high)))return"uint64Data: integer|Long[] expected"}return null},a.fromObject=function(e){if(e instanceof c.onnx.TensorProto)return e;var u=new c.onnx.TensorProto;if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.TensorProto.dims: array expected");u.dims=[];for(var i=0;i<e.dims.length;++i)l.Long?(u.dims[i]=l.Long.fromValue(e.dims[i])).unsigned=!1:typeof e.dims[i]=="string"?u.dims[i]=parseInt(e.dims[i],10):typeof e.dims[i]=="number"?u.dims[i]=e.dims[i]:typeof e.dims[i]=="object"&&(u.dims[i]=new l.LongBits(e.dims[i].low>>>0,e.dims[i].high>>>0).toNumber())}if(e.dataType!=null&&(u.dataType=e.dataType|0),e.segment!=null){if(typeof e.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");u.segment=c.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");u.floatData=[];for(var i=0;i<e.floatData.length;++i)u.floatData[i]=Number(e.floatData[i])}if(e.int32Data){if(!Array.isArray(e.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");u.int32Data=[];for(var i=0;i<e.int32Data.length;++i)u.int32Data[i]=e.int32Data[i]|0}if(e.stringData){if(!Array.isArray(e.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");u.stringData=[];for(var i=0;i<e.stringData.length;++i)typeof e.stringData[i]=="string"?l.base64.decode(e.stringData[i],u.stringData[i]=l.newBuffer(l.base64.length(e.stringData[i])),0):e.stringData[i].length>=0&&(u.stringData[i]=e.stringData[i])}if(e.int64Data){if(!Array.isArray(e.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");u.int64Data=[];for(var i=0;i<e.int64Data.length;++i)l.Long?(u.int64Data[i]=l.Long.fromValue(e.int64Data[i])).unsigned=!1:typeof e.int64Data[i]=="string"?u.int64Data[i]=parseInt(e.int64Data[i],10):typeof e.int64Data[i]=="number"?u.int64Data[i]=e.int64Data[i]:typeof e.int64Data[i]=="object"&&(u.int64Data[i]=new l.LongBits(e.int64Data[i].low>>>0,e.int64Data[i].high>>>0).toNumber())}if(e.name!=null&&(u.name=String(e.name)),e.docString!=null&&(u.docString=String(e.docString)),e.rawData!=null&&(typeof e.rawData=="string"?l.base64.decode(e.rawData,u.rawData=l.newBuffer(l.base64.length(e.rawData)),0):e.rawData.length>=0&&(u.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");u.externalData=[];for(var i=0;i<e.externalData.length;++i){if(typeof e.externalData[i]!="object")throw TypeError(".onnx.TensorProto.externalData: object expected");u.externalData[i]=c.onnx.StringStringEntryProto.fromObject(e.externalData[i])}}switch(e.dataLocation){default:if(typeof e.dataLocation=="number"){u.dataLocation=e.dataLocation;break}break;case"DEFAULT":case 0:u.dataLocation=0;break;case"EXTERNAL":case 1:u.dataLocation=1;break}if(e.doubleData){if(!Array.isArray(e.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");u.doubleData=[];for(var i=0;i<e.doubleData.length;++i)u.doubleData[i]=Number(e.doubleData[i])}if(e.uint64Data){if(!Array.isArray(e.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");u.uint64Data=[];for(var i=0;i<e.uint64Data.length;++i)l.Long?(u.uint64Data[i]=l.Long.fromValue(e.uint64Data[i])).unsigned=!0:typeof e.uint64Data[i]=="string"?u.uint64Data[i]=parseInt(e.uint64Data[i],10):typeof e.uint64Data[i]=="number"?u.uint64Data[i]=e.uint64Data[i]:typeof e.uint64Data[i]=="object"&&(u.uint64Data[i]=new l.LongBits(e.uint64Data[i].low>>>0,e.uint64Data[i].high>>>0).toNumber(!0))}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.dims=[],i.floatData=[],i.int32Data=[],i.stringData=[],i.int64Data=[],i.doubleData=[],i.uint64Data=[],i.externalData=[]),u.defaults&&(i.dataType=0,i.segment=null,i.name="",u.bytes===String?i.rawData="":(i.rawData=[],u.bytes!==Array&&(i.rawData=l.newBuffer(i.rawData))),i.docString="",i.dataLocation=u.enums===String?"DEFAULT":0),e.dims&&e.dims.length){i.dims=[];for(var d=0;d<e.dims.length;++d)typeof e.dims[d]=="number"?i.dims[d]=u.longs===String?String(e.dims[d]):e.dims[d]:i.dims[d]=u.longs===String?l.Long.prototype.toString.call(e.dims[d]):u.longs===Number?new l.LongBits(e.dims[d].low>>>0,e.dims[d].high>>>0).toNumber():e.dims[d]}if(e.dataType!=null&&e.hasOwnProperty("dataType")&&(i.dataType=e.dataType),e.segment!=null&&e.hasOwnProperty("segment")&&(i.segment=c.onnx.TensorProto.Segment.toObject(e.segment,u)),e.floatData&&e.floatData.length){i.floatData=[];for(var d=0;d<e.floatData.length;++d)i.floatData[d]=u.json&&!isFinite(e.floatData[d])?String(e.floatData[d]):e.floatData[d]}if(e.int32Data&&e.int32Data.length){i.int32Data=[];for(var d=0;d<e.int32Data.length;++d)i.int32Data[d]=e.int32Data[d]}if(e.stringData&&e.stringData.length){i.stringData=[];for(var d=0;d<e.stringData.length;++d)i.stringData[d]=u.bytes===String?l.base64.encode(e.stringData[d],0,e.stringData[d].length):u.bytes===Array?Array.prototype.slice.call(e.stringData[d]):e.stringData[d]}if(e.int64Data&&e.int64Data.length){i.int64Data=[];for(var d=0;d<e.int64Data.length;++d)typeof e.int64Data[d]=="number"?i.int64Data[d]=u.longs===String?String(e.int64Data[d]):e.int64Data[d]:i.int64Data[d]=u.longs===String?l.Long.prototype.toString.call(e.int64Data[d]):u.longs===Number?new l.LongBits(e.int64Data[d].low>>>0,e.int64Data[d].high>>>0).toNumber():e.int64Data[d]}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.rawData!=null&&e.hasOwnProperty("rawData")&&(i.rawData=u.bytes===String?l.base64.encode(e.rawData,0,e.rawData.length):u.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length){i.doubleData=[];for(var d=0;d<e.doubleData.length;++d)i.doubleData[d]=u.json&&!isFinite(e.doubleData[d])?String(e.doubleData[d]):e.doubleData[d]}if(e.uint64Data&&e.uint64Data.length){i.uint64Data=[];for(var d=0;d<e.uint64Data.length;++d)typeof e.uint64Data[d]=="number"?i.uint64Data[d]=u.longs===String?String(e.uint64Data[d]):e.uint64Data[d]:i.uint64Data[d]=u.longs===String?l.Long.prototype.toString.call(e.uint64Data[d]):u.longs===Number?new l.LongBits(e.uint64Data[d].low>>>0,e.uint64Data[d].high>>>0).toNumber(!0):e.uint64Data[d]}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.externalData&&e.externalData.length){i.externalData=[];for(var d=0;d<e.externalData.length;++d)i.externalData[d]=c.onnx.StringStringEntryProto.toObject(e.externalData[d],u)}return e.dataLocation!=null&&e.hasOwnProperty("dataLocation")&&(i.dataLocation=u.enums===String?c.onnx.TensorProto.DataLocation[e.dataLocation]===void 0?e.dataLocation:c.onnx.TensorProto.DataLocation[e.dataLocation]:e.dataLocation),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TensorProto"},a.DataType=function(){var e={},u=Object.create(e);return u[e[0]="UNDEFINED"]=0,u[e[1]="FLOAT"]=1,u[e[2]="UINT8"]=2,u[e[3]="INT8"]=3,u[e[4]="UINT16"]=4,u[e[5]="INT16"]=5,u[e[6]="INT32"]=6,u[e[7]="INT64"]=7,u[e[8]="STRING"]=8,u[e[9]="BOOL"]=9,u[e[10]="FLOAT16"]=10,u[e[11]="DOUBLE"]=11,u[e[12]="UINT32"]=12,u[e[13]="UINT64"]=13,u[e[14]="COMPLEX64"]=14,u[e[15]="COMPLEX128"]=15,u[e[16]="BFLOAT16"]=16,u[e[17]="FLOAT8E4M3FN"]=17,u[e[18]="FLOAT8E4M3FNUZ"]=18,u[e[19]="FLOAT8E5M2"]=19,u[e[20]="FLOAT8E5M2FNUZ"]=20,u}(),a.Segment=function(){function e(u){if(u)for(var i=Object.keys(u),d=0;d<i.length;++d)u[i[d]]!=null&&(this[i[d]]=u[i[d]])}return e.prototype.begin=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.end=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(u){return new e(u)},e.encode=function(u,i){return i||(i=p.create()),u.begin!=null&&Object.hasOwnProperty.call(u,"begin")&&i.uint32(8).int64(u.begin),u.end!=null&&Object.hasOwnProperty.call(u,"end")&&i.uint32(16).int64(u.end),i},e.encodeDelimited=function(u,i){return this.encode(u,i).ldelim()},e.decode=function(u,i){u instanceof s||(u=s.create(u));for(var d=i===void 0?u.len:u.pos+i,h=new c.onnx.TensorProto.Segment;u.pos<d;){var m=u.uint32();switch(m>>>3){case 1:{h.begin=u.int64();break}case 2:{h.end=u.int64();break}default:u.skipType(m&7);break}}return h},e.decodeDelimited=function(u){return u instanceof s||(u=new s(u)),this.decode(u,u.uint32())},e.verify=function(u){return typeof u!="object"||u===null?"object expected":u.begin!=null&&u.hasOwnProperty("begin")&&!l.isInteger(u.begin)&&!(u.begin&&l.isInteger(u.begin.low)&&l.isInteger(u.begin.high))?"begin: integer|Long expected":u.end!=null&&u.hasOwnProperty("end")&&!l.isInteger(u.end)&&!(u.end&&l.isInteger(u.end.low)&&l.isInteger(u.end.high))?"end: integer|Long expected":null},e.fromObject=function(u){if(u instanceof c.onnx.TensorProto.Segment)return u;var i=new c.onnx.TensorProto.Segment;return u.begin!=null&&(l.Long?(i.begin=l.Long.fromValue(u.begin)).unsigned=!1:typeof u.begin=="string"?i.begin=parseInt(u.begin,10):typeof u.begin=="number"?i.begin=u.begin:typeof u.begin=="object"&&(i.begin=new l.LongBits(u.begin.low>>>0,u.begin.high>>>0).toNumber())),u.end!=null&&(l.Long?(i.end=l.Long.fromValue(u.end)).unsigned=!1:typeof u.end=="string"?i.end=parseInt(u.end,10):typeof u.end=="number"?i.end=u.end:typeof u.end=="object"&&(i.end=new l.LongBits(u.end.low>>>0,u.end.high>>>0).toNumber())),i},e.toObject=function(u,i){i||(i={});var d={};if(i.defaults){if(l.Long){var h=new l.Long(0,0,!1);d.begin=i.longs===String?h.toString():i.longs===Number?h.toNumber():h}else d.begin=i.longs===String?"0":0;if(l.Long){var h=new l.Long(0,0,!1);d.end=i.longs===String?h.toString():i.longs===Number?h.toNumber():h}else d.end=i.longs===String?"0":0}return u.begin!=null&&u.hasOwnProperty("begin")&&(typeof u.begin=="number"?d.begin=i.longs===String?String(u.begin):u.begin:d.begin=i.longs===String?l.Long.prototype.toString.call(u.begin):i.longs===Number?new l.LongBits(u.begin.low>>>0,u.begin.high>>>0).toNumber():u.begin),u.end!=null&&u.hasOwnProperty("end")&&(typeof u.end=="number"?d.end=i.longs===String?String(u.end):u.end:d.end=i.longs===String?l.Long.prototype.toString.call(u.end):i.longs===Number?new l.LongBits(u.end.low>>>0,u.end.high>>>0).toNumber():u.end),d},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/onnx.TensorProto.Segment"},e}(),a.DataLocation=function(){var e={},u=Object.create(e);return u[e[0]="DEFAULT"]=0,u[e[1]="EXTERNAL"]=1,u}(),a}(),o.SparseTensorProto=function(){function a(e){if(this.dims=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.values=null,a.prototype.indices=null,a.prototype.dims=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.values!=null&&Object.hasOwnProperty.call(e,"values")&&c.onnx.TensorProto.encode(e.values,u.uint32(10).fork()).ldelim(),e.indices!=null&&Object.hasOwnProperty.call(e,"indices")&&c.onnx.TensorProto.encode(e.indices,u.uint32(18).fork()).ldelim(),e.dims!=null&&e.dims.length){u.uint32(26).fork();for(var i=0;i<e.dims.length;++i)u.int64(e.dims[i]);u.ldelim()}return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.SparseTensorProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.values=c.onnx.TensorProto.decode(e,e.uint32());break}case 2:{d.indices=c.onnx.TensorProto.decode(e,e.uint32());break}case 3:{if(d.dims&&d.dims.length||(d.dims=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.dims.push(e.int64());else d.dims.push(e.int64());break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.values!=null&&e.hasOwnProperty("values")){var u=c.onnx.TensorProto.verify(e.values);if(u)return"values."+u}if(e.indices!=null&&e.hasOwnProperty("indices")){var u=c.onnx.TensorProto.verify(e.indices);if(u)return"indices."+u}if(e.dims!=null&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var i=0;i<e.dims.length;++i)if(!l.isInteger(e.dims[i])&&!(e.dims[i]&&l.isInteger(e.dims[i].low)&&l.isInteger(e.dims[i].high)))return"dims: integer|Long[] expected"}return null},a.fromObject=function(e){if(e instanceof c.onnx.SparseTensorProto)return e;var u=new c.onnx.SparseTensorProto;if(e.values!=null){if(typeof e.values!="object")throw TypeError(".onnx.SparseTensorProto.values: object expected");u.values=c.onnx.TensorProto.fromObject(e.values)}if(e.indices!=null){if(typeof e.indices!="object")throw TypeError(".onnx.SparseTensorProto.indices: object expected");u.indices=c.onnx.TensorProto.fromObject(e.indices)}if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.SparseTensorProto.dims: array expected");u.dims=[];for(var i=0;i<e.dims.length;++i)l.Long?(u.dims[i]=l.Long.fromValue(e.dims[i])).unsigned=!1:typeof e.dims[i]=="string"?u.dims[i]=parseInt(e.dims[i],10):typeof e.dims[i]=="number"?u.dims[i]=e.dims[i]:typeof e.dims[i]=="object"&&(u.dims[i]=new l.LongBits(e.dims[i].low>>>0,e.dims[i].high>>>0).toNumber())}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.dims=[]),u.defaults&&(i.values=null,i.indices=null),e.values!=null&&e.hasOwnProperty("values")&&(i.values=c.onnx.TensorProto.toObject(e.values,u)),e.indices!=null&&e.hasOwnProperty("indices")&&(i.indices=c.onnx.TensorProto.toObject(e.indices,u)),e.dims&&e.dims.length){i.dims=[];for(var d=0;d<e.dims.length;++d)typeof e.dims[d]=="number"?i.dims[d]=u.longs===String?String(e.dims[d]):e.dims[d]:i.dims[d]=u.longs===String?l.Long.prototype.toString.call(e.dims[d]):u.longs===Number?new l.LongBits(e.dims[d].low>>>0,e.dims[d].high>>>0).toNumber():e.dims[d]}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.SparseTensorProto"},a}(),o.TensorShapeProto=function(){function a(e){if(this.dim=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.dim=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.dim!=null&&e.dim.length)for(var i=0;i<e.dim.length;++i)c.onnx.TensorShapeProto.Dimension.encode(e.dim[i],u.uint32(10).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TensorShapeProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.dim&&d.dim.length||(d.dim=[]),d.dim.push(c.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.dim!=null&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var u=0;u<e.dim.length;++u){var i=c.onnx.TensorShapeProto.Dimension.verify(e.dim[u]);if(i)return"dim."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto)return e;var u=new c.onnx.TensorShapeProto;if(e.dim){if(!Array.isArray(e.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");u.dim=[];for(var i=0;i<e.dim.length;++i){if(typeof e.dim[i]!="object")throw TypeError(".onnx.TensorShapeProto.dim: object expected");u.dim[i]=c.onnx.TensorShapeProto.Dimension.fromObject(e.dim[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.dim=[]),e.dim&&e.dim.length){i.dim=[];for(var d=0;d<e.dim.length;++d)i.dim[d]=c.onnx.TensorShapeProto.Dimension.toObject(e.dim[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TensorShapeProto"},a.Dimension=function(){function e(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}e.prototype.dimValue=null,e.prototype.dimParam=null,e.prototype.denotation="";var u;return Object.defineProperty(e.prototype,"value",{get:l.oneOfGetter(u=["dimValue","dimParam"]),set:l.oneOfSetter(u)}),e.create=function(i){return new e(i)},e.encode=function(i,d){return d||(d=p.create()),i.dimValue!=null&&Object.hasOwnProperty.call(i,"dimValue")&&d.uint32(8).int64(i.dimValue),i.dimParam!=null&&Object.hasOwnProperty.call(i,"dimParam")&&d.uint32(18).string(i.dimParam),i.denotation!=null&&Object.hasOwnProperty.call(i,"denotation")&&d.uint32(26).string(i.denotation),d},e.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},e.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TensorShapeProto.Dimension;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.dimValue=i.int64();break}case 2:{m.dimParam=i.string();break}case 3:{m.denotation=i.string();break}default:i.skipType(b&7);break}}return m},e.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},e.verify=function(i){if(typeof i!="object"||i===null)return"object expected";var d={};if(i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(d.value=1,!l.isInteger(i.dimValue)&&!(i.dimValue&&l.isInteger(i.dimValue.low)&&l.isInteger(i.dimValue.high))))return"dimValue: integer|Long expected";if(i.dimParam!=null&&i.hasOwnProperty("dimParam")){if(d.value===1)return"value: multiple values";if(d.value=1,!l.isString(i.dimParam))return"dimParam: string expected"}return i.denotation!=null&&i.hasOwnProperty("denotation")&&!l.isString(i.denotation)?"denotation: string expected":null},e.fromObject=function(i){if(i instanceof c.onnx.TensorShapeProto.Dimension)return i;var d=new c.onnx.TensorShapeProto.Dimension;return i.dimValue!=null&&(l.Long?(d.dimValue=l.Long.fromValue(i.dimValue)).unsigned=!1:typeof i.dimValue=="string"?d.dimValue=parseInt(i.dimValue,10):typeof i.dimValue=="number"?d.dimValue=i.dimValue:typeof i.dimValue=="object"&&(d.dimValue=new l.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber())),i.dimParam!=null&&(d.dimParam=String(i.dimParam)),i.denotation!=null&&(d.denotation=String(i.denotation)),d},e.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.denotation=""),i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(typeof i.dimValue=="number"?h.dimValue=d.longs===String?String(i.dimValue):i.dimValue:h.dimValue=d.longs===String?l.Long.prototype.toString.call(i.dimValue):d.longs===Number?new l.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber():i.dimValue,d.oneofs&&(h.value="dimValue")),i.dimParam!=null&&i.hasOwnProperty("dimParam")&&(h.dimParam=i.dimParam,d.oneofs&&(h.value="dimParam")),i.denotation!=null&&i.hasOwnProperty("denotation")&&(h.denotation=i.denotation),h},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TensorShapeProto.Dimension"},e}(),a}(),o.TypeProto=function(){function a(u){if(u)for(var i=Object.keys(u),d=0;d<i.length;++d)u[i[d]]!=null&&(this[i[d]]=u[i[d]])}a.prototype.tensorType=null,a.prototype.sequenceType=null,a.prototype.mapType=null,a.prototype.optionalType=null,a.prototype.sparseTensorType=null,a.prototype.denotation="";var e;return Object.defineProperty(a.prototype,"value",{get:l.oneOfGetter(e=["tensorType","sequenceType","mapType","optionalType","sparseTensorType"]),set:l.oneOfSetter(e)}),a.create=function(u){return new a(u)},a.encode=function(u,i){return i||(i=p.create()),u.tensorType!=null&&Object.hasOwnProperty.call(u,"tensorType")&&c.onnx.TypeProto.Tensor.encode(u.tensorType,i.uint32(10).fork()).ldelim(),u.sequenceType!=null&&Object.hasOwnProperty.call(u,"sequenceType")&&c.onnx.TypeProto.Sequence.encode(u.sequenceType,i.uint32(34).fork()).ldelim(),u.mapType!=null&&Object.hasOwnProperty.call(u,"mapType")&&c.onnx.TypeProto.Map.encode(u.mapType,i.uint32(42).fork()).ldelim(),u.denotation!=null&&Object.hasOwnProperty.call(u,"denotation")&&i.uint32(50).string(u.denotation),u.sparseTensorType!=null&&Object.hasOwnProperty.call(u,"sparseTensorType")&&c.onnx.TypeProto.SparseTensor.encode(u.sparseTensorType,i.uint32(66).fork()).ldelim(),u.optionalType!=null&&Object.hasOwnProperty.call(u,"optionalType")&&c.onnx.TypeProto.Optional.encode(u.optionalType,i.uint32(74).fork()).ldelim(),i},a.encodeDelimited=function(u,i){return this.encode(u,i).ldelim()},a.decode=function(u,i){u instanceof s||(u=s.create(u));for(var d=i===void 0?u.len:u.pos+i,h=new c.onnx.TypeProto;u.pos<d;){var m=u.uint32();switch(m>>>3){case 1:{h.tensorType=c.onnx.TypeProto.Tensor.decode(u,u.uint32());break}case 4:{h.sequenceType=c.onnx.TypeProto.Sequence.decode(u,u.uint32());break}case 5:{h.mapType=c.onnx.TypeProto.Map.decode(u,u.uint32());break}case 9:{h.optionalType=c.onnx.TypeProto.Optional.decode(u,u.uint32());break}case 8:{h.sparseTensorType=c.onnx.TypeProto.SparseTensor.decode(u,u.uint32());break}case 6:{h.denotation=u.string();break}default:u.skipType(m&7);break}}return h},a.decodeDelimited=function(u){return u instanceof s||(u=new s(u)),this.decode(u,u.uint32())},a.verify=function(u){if(typeof u!="object"||u===null)return"object expected";var i={};if(u.tensorType!=null&&u.hasOwnProperty("tensorType")){i.value=1;{var d=c.onnx.TypeProto.Tensor.verify(u.tensorType);if(d)return"tensorType."+d}}if(u.sequenceType!=null&&u.hasOwnProperty("sequenceType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.Sequence.verify(u.sequenceType);if(d)return"sequenceType."+d}}if(u.mapType!=null&&u.hasOwnProperty("mapType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.Map.verify(u.mapType);if(d)return"mapType."+d}}if(u.optionalType!=null&&u.hasOwnProperty("optionalType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.Optional.verify(u.optionalType);if(d)return"optionalType."+d}}if(u.sparseTensorType!=null&&u.hasOwnProperty("sparseTensorType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.SparseTensor.verify(u.sparseTensorType);if(d)return"sparseTensorType."+d}}return u.denotation!=null&&u.hasOwnProperty("denotation")&&!l.isString(u.denotation)?"denotation: string expected":null},a.fromObject=function(u){if(u instanceof c.onnx.TypeProto)return u;var i=new c.onnx.TypeProto;if(u.tensorType!=null){if(typeof u.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");i.tensorType=c.onnx.TypeProto.Tensor.fromObject(u.tensorType)}if(u.sequenceType!=null){if(typeof u.sequenceType!="object")throw TypeError(".onnx.TypeProto.sequenceType: object expected");i.sequenceType=c.onnx.TypeProto.Sequence.fromObject(u.sequenceType)}if(u.mapType!=null){if(typeof u.mapType!="object")throw TypeError(".onnx.TypeProto.mapType: object expected");i.mapType=c.onnx.TypeProto.Map.fromObject(u.mapType)}if(u.optionalType!=null){if(typeof u.optionalType!="object")throw TypeError(".onnx.TypeProto.optionalType: object expected");i.optionalType=c.onnx.TypeProto.Optional.fromObject(u.optionalType)}if(u.sparseTensorType!=null){if(typeof u.sparseTensorType!="object")throw TypeError(".onnx.TypeProto.sparseTensorType: object expected");i.sparseTensorType=c.onnx.TypeProto.SparseTensor.fromObject(u.sparseTensorType)}return u.denotation!=null&&(i.denotation=String(u.denotation)),i},a.toObject=function(u,i){i||(i={});var d={};return i.defaults&&(d.denotation=""),u.tensorType!=null&&u.hasOwnProperty("tensorType")&&(d.tensorType=c.onnx.TypeProto.Tensor.toObject(u.tensorType,i),i.oneofs&&(d.value="tensorType")),u.sequenceType!=null&&u.hasOwnProperty("sequenceType")&&(d.sequenceType=c.onnx.TypeProto.Sequence.toObject(u.sequenceType,i),i.oneofs&&(d.value="sequenceType")),u.mapType!=null&&u.hasOwnProperty("mapType")&&(d.mapType=c.onnx.TypeProto.Map.toObject(u.mapType,i),i.oneofs&&(d.value="mapType")),u.denotation!=null&&u.hasOwnProperty("denotation")&&(d.denotation=u.denotation),u.sparseTensorType!=null&&u.hasOwnProperty("sparseTensorType")&&(d.sparseTensorType=c.onnx.TypeProto.SparseTensor.toObject(u.sparseTensorType,i),i.oneofs&&(d.value="sparseTensorType")),u.optionalType!=null&&u.hasOwnProperty("optionalType")&&(d.optionalType=c.onnx.TypeProto.Optional.toObject(u.optionalType,i),i.oneofs&&(d.value="optionalType")),d},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/onnx.TypeProto"},a.Tensor=function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=0,u.prototype.shape=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&d.uint32(8).int32(i.elemType),i.shape!=null&&Object.hasOwnProperty.call(i,"shape")&&c.onnx.TensorShapeProto.encode(i.shape,d.uint32(18).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Tensor;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.elemType=i.int32();break}case 2:{m.shape=c.onnx.TensorShapeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")&&!l.isInteger(i.elemType))return"elemType: integer expected";if(i.shape!=null&&i.hasOwnProperty("shape")){var d=c.onnx.TensorShapeProto.verify(i.shape);if(d)return"shape."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Tensor)return i;var d=new c.onnx.TypeProto.Tensor;if(i.elemType!=null&&(d.elemType=i.elemType|0),i.shape!=null){if(typeof i.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");d.shape=c.onnx.TensorShapeProto.fromObject(i.shape)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=0,h.shape=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=i.elemType),i.shape!=null&&i.hasOwnProperty("shape")&&(h.shape=c.onnx.TensorShapeProto.toObject(i.shape,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Tensor"},u}(),a.Sequence=function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&c.onnx.TypeProto.encode(i.elemType,d.uint32(10).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Sequence;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.elemType=c.onnx.TypeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")){var d=c.onnx.TypeProto.verify(i.elemType);if(d)return"elemType."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Sequence)return i;var d=new c.onnx.TypeProto.Sequence;if(i.elemType!=null){if(typeof i.elemType!="object")throw TypeError(".onnx.TypeProto.Sequence.elemType: object expected");d.elemType=c.onnx.TypeProto.fromObject(i.elemType)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=c.onnx.TypeProto.toObject(i.elemType,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Sequence"},u}(),a.Map=function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.keyType=0,u.prototype.valueType=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.keyType!=null&&Object.hasOwnProperty.call(i,"keyType")&&d.uint32(8).int32(i.keyType),i.valueType!=null&&Object.hasOwnProperty.call(i,"valueType")&&c.onnx.TypeProto.encode(i.valueType,d.uint32(18).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Map;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.keyType=i.int32();break}case 2:{m.valueType=c.onnx.TypeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.keyType!=null&&i.hasOwnProperty("keyType")&&!l.isInteger(i.keyType))return"keyType: integer expected";if(i.valueType!=null&&i.hasOwnProperty("valueType")){var d=c.onnx.TypeProto.verify(i.valueType);if(d)return"valueType."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Map)return i;var d=new c.onnx.TypeProto.Map;if(i.keyType!=null&&(d.keyType=i.keyType|0),i.valueType!=null){if(typeof i.valueType!="object")throw TypeError(".onnx.TypeProto.Map.valueType: object expected");d.valueType=c.onnx.TypeProto.fromObject(i.valueType)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.keyType=0,h.valueType=null),i.keyType!=null&&i.hasOwnProperty("keyType")&&(h.keyType=i.keyType),i.valueType!=null&&i.hasOwnProperty("valueType")&&(h.valueType=c.onnx.TypeProto.toObject(i.valueType,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Map"},u}(),a.Optional=function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&c.onnx.TypeProto.encode(i.elemType,d.uint32(10).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Optional;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.elemType=c.onnx.TypeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")){var d=c.onnx.TypeProto.verify(i.elemType);if(d)return"elemType."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Optional)return i;var d=new c.onnx.TypeProto.Optional;if(i.elemType!=null){if(typeof i.elemType!="object")throw TypeError(".onnx.TypeProto.Optional.elemType: object expected");d.elemType=c.onnx.TypeProto.fromObject(i.elemType)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=c.onnx.TypeProto.toObject(i.elemType,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Optional"},u}(),a.SparseTensor=function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=0,u.prototype.shape=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&d.uint32(8).int32(i.elemType),i.shape!=null&&Object.hasOwnProperty.call(i,"shape")&&c.onnx.TensorShapeProto.encode(i.shape,d.uint32(18).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.SparseTensor;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.elemType=i.int32();break}case 2:{m.shape=c.onnx.TensorShapeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")&&!l.isInteger(i.elemType))return"elemType: integer expected";if(i.shape!=null&&i.hasOwnProperty("shape")){var d=c.onnx.TensorShapeProto.verify(i.shape);if(d)return"shape."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.SparseTensor)return i;var d=new c.onnx.TypeProto.SparseTensor;if(i.elemType!=null&&(d.elemType=i.elemType|0),i.shape!=null){if(typeof i.shape!="object")throw TypeError(".onnx.TypeProto.SparseTensor.shape: object expected");d.shape=c.onnx.TensorShapeProto.fromObject(i.shape)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=0,h.shape=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=i.elemType),i.shape!=null&&i.hasOwnProperty("shape")&&(h.shape=c.onnx.TensorShapeProto.toObject(i.shape,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.SparseTensor"},u}(),a}(),o.OperatorSetIdProto=function(){function a(e){if(e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.domain="",a.prototype.version=l.Long?l.Long.fromBits(0,0,!1):0,a.create=function(e){return new a(e)},a.encode=function(e,u){return u||(u=p.create()),e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(10).string(e.domain),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(16).int64(e.version),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.OperatorSetIdProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.domain=e.string();break}case 2:{d.version=e.int64();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){return typeof e!="object"||e===null?"object expected":e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain)?"domain: string expected":e.version!=null&&e.hasOwnProperty("version")&&!l.isInteger(e.version)&&!(e.version&&l.isInteger(e.version.low)&&l.isInteger(e.version.high))?"version: integer|Long expected":null},a.fromObject=function(e){if(e instanceof c.onnx.OperatorSetIdProto)return e;var u=new c.onnx.OperatorSetIdProto;return e.domain!=null&&(u.domain=String(e.domain)),e.version!=null&&(l.Long?(u.version=l.Long.fromValue(e.version)).unsigned=!1:typeof e.version=="string"?u.version=parseInt(e.version,10):typeof e.version=="number"?u.version=e.version:typeof e.version=="object"&&(u.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),u},a.toObject=function(e,u){u||(u={});var i={};if(u.defaults)if(i.domain="",l.Long){var d=new l.Long(0,0,!1);i.version=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.version=u.longs===String?"0":0;return e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?i.version=u.longs===String?String(e.version):e.version:i.version=u.longs===String?l.Long.prototype.toString.call(e.version):u.longs===Number?new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.OperatorSetIdProto"},a}(),o.OperatorStatus=function(){var a={},e=Object.create(a);return e[a[0]="EXPERIMENTAL"]=0,e[a[1]="STABLE"]=1,e}(),o.FunctionProto=function(){function a(e){if(this.input=[],this.output=[],this.attribute=[],this.attributeProto=[],this.node=[],this.opsetImport=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.name="",a.prototype.input=l.emptyArray,a.prototype.output=l.emptyArray,a.prototype.attribute=l.emptyArray,a.prototype.attributeProto=l.emptyArray,a.prototype.node=l.emptyArray,a.prototype.docString="",a.prototype.opsetImport=l.emptyArray,a.prototype.domain="",a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(10).string(e.name),e.input!=null&&e.input.length)for(var i=0;i<e.input.length;++i)u.uint32(34).string(e.input[i]);if(e.output!=null&&e.output.length)for(var i=0;i<e.output.length;++i)u.uint32(42).string(e.output[i]);if(e.attribute!=null&&e.attribute.length)for(var i=0;i<e.attribute.length;++i)u.uint32(50).string(e.attribute[i]);if(e.node!=null&&e.node.length)for(var i=0;i<e.node.length;++i)c.onnx.NodeProto.encode(e.node[i],u.uint32(58).fork()).ldelim();if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(66).string(e.docString),e.opsetImport!=null&&e.opsetImport.length)for(var i=0;i<e.opsetImport.length;++i)c.onnx.OperatorSetIdProto.encode(e.opsetImport[i],u.uint32(74).fork()).ldelim();if(e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(82).string(e.domain),e.attributeProto!=null&&e.attributeProto.length)for(var i=0;i<e.attributeProto.length;++i)c.onnx.AttributeProto.encode(e.attributeProto[i],u.uint32(90).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.FunctionProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.name=e.string();break}case 4:{d.input&&d.input.length||(d.input=[]),d.input.push(e.string());break}case 5:{d.output&&d.output.length||(d.output=[]),d.output.push(e.string());break}case 6:{d.attribute&&d.attribute.length||(d.attribute=[]),d.attribute.push(e.string());break}case 11:{d.attributeProto&&d.attributeProto.length||(d.attributeProto=[]),d.attributeProto.push(c.onnx.AttributeProto.decode(e,e.uint32()));break}case 7:{d.node&&d.node.length||(d.node=[]),d.node.push(c.onnx.NodeProto.decode(e,e.uint32()));break}case 8:{d.docString=e.string();break}case 9:{d.opsetImport&&d.opsetImport.length||(d.opsetImport=[]),d.opsetImport.push(c.onnx.OperatorSetIdProto.decode(e,e.uint32()));break}case 10:{d.domain=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var u=0;u<e.input.length;++u)if(!l.isString(e.input[u]))return"input: string[] expected"}if(e.output!=null&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(var u=0;u<e.output.length;++u)if(!l.isString(e.output[u]))return"output: string[] expected"}if(e.attribute!=null&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(var u=0;u<e.attribute.length;++u)if(!l.isString(e.attribute[u]))return"attribute: string[] expected"}if(e.attributeProto!=null&&e.hasOwnProperty("attributeProto")){if(!Array.isArray(e.attributeProto))return"attributeProto: array expected";for(var u=0;u<e.attributeProto.length;++u){var i=c.onnx.AttributeProto.verify(e.attributeProto[u]);if(i)return"attributeProto."+i}}if(e.node!=null&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var u=0;u<e.node.length;++u){var i=c.onnx.NodeProto.verify(e.node[u]);if(i)return"node."+i}}if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.opsetImport!=null&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var u=0;u<e.opsetImport.length;++u){var i=c.onnx.OperatorSetIdProto.verify(e.opsetImport[u]);if(i)return"opsetImport."+i}}return e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain)?"domain: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.FunctionProto)return e;var u=new c.onnx.FunctionProto;if(e.name!=null&&(u.name=String(e.name)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.FunctionProto.input: array expected");u.input=[];for(var i=0;i<e.input.length;++i)u.input[i]=String(e.input[i])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.FunctionProto.output: array expected");u.output=[];for(var i=0;i<e.output.length;++i)u.output[i]=String(e.output[i])}if(e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.FunctionProto.attribute: array expected");u.attribute=[];for(var i=0;i<e.attribute.length;++i)u.attribute[i]=String(e.attribute[i])}if(e.attributeProto){if(!Array.isArray(e.attributeProto))throw TypeError(".onnx.FunctionProto.attributeProto: array expected");u.attributeProto=[];for(var i=0;i<e.attributeProto.length;++i){if(typeof e.attributeProto[i]!="object")throw TypeError(".onnx.FunctionProto.attributeProto: object expected");u.attributeProto[i]=c.onnx.AttributeProto.fromObject(e.attributeProto[i])}}if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.FunctionProto.node: array expected");u.node=[];for(var i=0;i<e.node.length;++i){if(typeof e.node[i]!="object")throw TypeError(".onnx.FunctionProto.node: object expected");u.node[i]=c.onnx.NodeProto.fromObject(e.node[i])}}if(e.docString!=null&&(u.docString=String(e.docString)),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.FunctionProto.opsetImport: array expected");u.opsetImport=[];for(var i=0;i<e.opsetImport.length;++i){if(typeof e.opsetImport[i]!="object")throw TypeError(".onnx.FunctionProto.opsetImport: object expected");u.opsetImport[i]=c.onnx.OperatorSetIdProto.fromObject(e.opsetImport[i])}}return e.domain!=null&&(u.domain=String(e.domain)),u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.input=[],i.output=[],i.attribute=[],i.node=[],i.opsetImport=[],i.attributeProto=[]),u.defaults&&(i.name="",i.docString="",i.domain=""),e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.input&&e.input.length){i.input=[];for(var d=0;d<e.input.length;++d)i.input[d]=e.input[d]}if(e.output&&e.output.length){i.output=[];for(var d=0;d<e.output.length;++d)i.output[d]=e.output[d]}if(e.attribute&&e.attribute.length){i.attribute=[];for(var d=0;d<e.attribute.length;++d)i.attribute[d]=e.attribute[d]}if(e.node&&e.node.length){i.node=[];for(var d=0;d<e.node.length;++d)i.node[d]=c.onnx.NodeProto.toObject(e.node[d],u)}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.opsetImport&&e.opsetImport.length){i.opsetImport=[];for(var d=0;d<e.opsetImport.length;++d)i.opsetImport[d]=c.onnx.OperatorSetIdProto.toObject(e.opsetImport[d],u)}if(e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.attributeProto&&e.attributeProto.length){i.attributeProto=[];for(var d=0;d<e.attributeProto.length;++d)i.attributeProto[d]=c.onnx.AttributeProto.toObject(e.attributeProto[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.FunctionProto"},a}(),o}(),r.exports=c});function Ur(t,r){if(!t)throw new Error(typeof r=="string"?r:r())}function co(t){return new TextDecoder().decode(t)}var q,Qe,ya,Mt,bl,Et,Vt,C,ho,Gr,dr,hr,U=I(()=>{"use strict";Ho(),fl(),q=Ie(mr()),De(),Qe=class{static arraysEqual(t,r){if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==r[n])return!1;return!0}},ya=class{static preprocessInputShapes(t,r){let n=t.length===1?[1,t[0]]:t,s=r.length===1?[r[0],1]:r;return[n,s]}static postprocessOutputShape(t,r,n){r===1&&t.splice(t.length-2,1),n===1&&t.pop()}static calcMatMulShape(t,r){return t[1]!==r[0]?void 0:[t[0],r[1]]}},Mt=class tr{static calcShape(r,n,s=!1){let p=r.length,l=n.length;if(p===0)return n;if(l===0)return r;let c=Math.max(r.length,n.length),o=new Array(c);if(s){if(p<2||l<2)return;let a=ya.calcMatMulShape([r[p-2],r[p-1]],[n[l-2],n[l-1]]);if(a===void 0)return;[o[c-2],o[c-1]]=a}for(let a=s?3:1;a<=c;a++){let e=p-a<0?1:r[p-a],u=l-a<0?1:n[l-a];if(e!==u&&e>1&&u>1)return;o[c-a]=Math.max(e,u)}return o}static index(r,n){let s=new Array(n.length);return tr.fillIndex(r,n,s),s}static fillIndex(r,n,s){let p=r.length-n.length;for(let l=0;l<n.length;l++)s[l]=r[p+l]%n[l]}static calc(r,n,s,p,l){let c=tr.calcShape(r.dims,n.dims);if(c){if(p&&!C.areEqual(c,r.dims))return;let o=C.size(c),a=p?r:new Pt(c,l||r.type);if(c.length===0)a.set([],s(r.get([]),n.get([])));else{let e=new Array(c.length),u=new Array(r.dims.length),i=new Array(n.dims.length),d=0,h=0,m=!1,b=!1;r.dims.length===0&&(d=r.get([]),m=!0),n.dims.length===0&&(h=n.get([]),b=!0);let x;for(let E=0;E<o;E++){x=E;for(let w=c.length-1;w>=0;w--)e[w]=x%c[w],x=Math.floor(x/c[w]);m||(tr.fillIndex(e,r.dims,u),d=r.get(u)),b||(tr.fillIndex(e,n.dims,i),h=n.get(i)),a.set(e,s(d,h))}}return a}}static isValidBroadcast(r,n){let s=r.length,p=n.length;if(s>p)return!1;for(let l=1;l<=s;l++)if(r[s-l]!==1&&r[s-l]!==n[p-l])return!1;return!0}static getBroadcastDims(r,n){let s=r.length,p=[];for(let l=0;l<s;l++){let c=s-1-l,o=r[c]||1;(n[n.length-1-l]||1)>1&&o===1&&p.unshift(c)}return p}},bl=class{static getShapeOfGemmResult(t,r,n,s,p){if(t.length!==2||n.length!==2)throw new Error("shape need to be of size 2");let l,c,o;r?(l=t[1],c=t[0]):(l=t[0],c=t[1]);let a=-1;if(s?(o=n[0],a=1):(o=n[1],a=0),n[a]!==c)throw new Error("dimension mismatch");if(l<=0||o<=0||c<=0)throw new Error("invalid shape specified");if(p&&!Mt.isValidBroadcast(p,[l,o]))throw new Error("gemm: invalid bias shape for broadcast");return[l,o,c]}},Et=class fo{static tensorDataTypeFromProto(r){switch(r){case q.onnx.TensorProto.DataType.INT8:return"int8";case q.onnx.TensorProto.DataType.UINT8:return"uint8";case q.onnx.TensorProto.DataType.BOOL:return"bool";case q.onnx.TensorProto.DataType.INT16:return"int16";case q.onnx.TensorProto.DataType.UINT16:return"uint16";case q.onnx.TensorProto.DataType.INT32:return"int32";case q.onnx.TensorProto.DataType.UINT32:return"uint32";case q.onnx.TensorProto.DataType.FLOAT:return"float32";case q.onnx.TensorProto.DataType.DOUBLE:return"float64";case q.onnx.TensorProto.DataType.STRING:return"string";case q.onnx.TensorProto.DataType.INT64:return"int32";case q.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${q.onnx.TensorProto.DataType[r]}`)}}static tensorDataTypeStringToEnum(r){switch(r){case"int8":return q.onnx.TensorProto.DataType.INT8;case"uint8":return q.onnx.TensorProto.DataType.UINT8;case"bool":return q.onnx.TensorProto.DataType.BOOL;case"int16":return q.onnx.TensorProto.DataType.INT16;case"uint16":return q.onnx.TensorProto.DataType.UINT16;case"int32":return q.onnx.TensorProto.DataType.INT32;case"uint32":return q.onnx.TensorProto.DataType.UINT32;case"float32":return q.onnx.TensorProto.DataType.FLOAT;case"float64":return q.onnx.TensorProto.DataType.DOUBLE;case"string":return q.onnx.TensorProto.DataType.STRING;case"int64":return q.onnx.TensorProto.DataType.INT64;case"uint64":return q.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${r}`)}}static tensorDimsFromProto(r){return r.map(n=>ee.isLong(n)?n.toNumber():n)}static tensorValueTypeFromProto(r){return{tensorType:fo.tensorDataTypeFromProto(r.elemType),shape:{dims:fo.tensorDimsFromProto(r.shape.dim.map(n=>n.dimValue))}}}static tensorDimsFromORTFormat(r){let n=[];for(let s=0;s<r.dimsLength();s++)n.push(Vt.longToNumber(r.dims(s)));return n}static tensorAttributesFromORTFormat(r){let n=[];for(let s=0;s<r.attributesLength();s++)n.push(r.attributes(s));return n}},Vt=class{static longToNumber(t,r){return ee.isLong(t)?t.toNumber():t instanceof T.Long?ee.fromValue({low:t.low,high:t.high,unsigned:r??!1}).toNumber():t}static isLong(t){return ee.isLong(t)||t instanceof T.Long}},C=class Qt{static size(r){return Qt.getSizeFromDimensionRange(r,0,r.length)}static sizeFromDimension(r,n){if(n<0||n>r.length)throw new Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${r.length} dimensions.`);return Qt.getSizeFromDimensionRange(r,n,r.length)}static sizeToDimension(r,n){if(n<0||n>r.length)throw new Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${r.length} dimensions.`);return Qt.getSizeFromDimensionRange(r,0,n)}static getSizeFromDimensionRange(r,n,s){let p=1;for(let l=n;l<s;l++){if(r[l]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");p*=r[l]}return p}static computeStrides(r){let n=r.length;if(n===0)return[];if(n===1)return[1];let s=new Array(n);s[n-1]=1,s[n-2]=r[n-1];for(let p=n-3;p>=0;--p)s[p]=s[p+1]*r[p+1];return s}static transpose(r){return r.slice().reverse()}static indicesToOffset(r,n,s){s===void 0&&(s=r.length);let p=0;for(let l=0;l<s;++l)p+=n[l]*r[l];return p}static offsetToIndices(r,n){let s=n.length;if(s===0)return[];if(s===1)return[r*n[0]];let p=new Array(n.length);for(let l=0;l<p.length-1;++l)p[l]=Math.floor(r/n[l]),r-=p[l]*n[l];return p[p.length-1]=r,p}static normalizeAxis(r,n){if(r<-n&&r>=n)throw new Error("unsupported axis for this operation.");return r<0?r+n:r}static normalizeAxes(r,n){return r.map(s=>this.normalizeAxis(s,n))}static incrementIndex(r,n,s){if(n.length===0||r.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(s===void 0)s=n.length;else if(s<=0||s>n.length)throw new Error("Incorrect axis to increment on");for(let p=s-1;p>=0&&(r[p]++,!(r[p]<n[p]));--p)r[p]=0}static calculateReshapedDims(r,n){if(n.length===0){if(r.length===0||Qt.size(r)===1)return[];throw new Error("cannot reshape to a scalar Tensor")}let s=n.length,p=new Array(s),l=-1,c=1;for(let a=0;a<s;a++){if(n[a]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(n[a]===-1){if(l!==-1)throw new Error("at most one dimension in shape hints can be -1");l=a}else{if(n[a]===0){if(a>=r.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");p[a]=r[a]}else p[a]=n[a];c*=p[a]}}let o=Qt.size(r);if(l!==-1){if(o%c!==0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${r}] Output shape: [${n}]`);p[l]=o/c}else if(c!==o)throw new Error("reshapedDims and originalDims don't have matching sizes");return p}static sortBasedOnPerm(r,n){return n?n.map(s=>r[s]):r.slice().reverse()}static padShape(r,n){let s=r.length;return r.map((p,l)=>p+n[l]+n[l+s])}static areEqual(r,n){return r.length!==n.length?!1:r.every((s,p)=>s===n[p])}static validateDimsAndCalcSize(r){if(r.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let n=1;for(let s of r){if(!Number.isInteger(s))throw new TypeError(`Invalid shape: ${s} is not an integer`);if(s<0||s>2147483647)throw new TypeError(`Invalid shape: length ${s} is not allowed`);n*=s}return n}static flattenShape(r,n){n<0&&(n+=r.length);let s=r.reduce((l,c)=>l*c,1),p=r.slice(n).reduce((l,c)=>l*c,1);return[s/p,p]}static squeezeShape(r,n){let s=new Array;n=Qt.normalizeAxes(n,r.length);for(let p=0;p<r.length;p++){let l=n.indexOf(p)>=0;if(l&&r[p]!==1)throw new Error("squeeze an axis of size different than 1");(n.length===0&&r[p]>1||n.length>0&&!l)&&s.push(r[p])}return s}static unsqueezeShape(r,n){let s=new Array(r.length+n.length);s.fill(0);for(let l=0;l<n.length;l++){let c=Qt.normalizeAxis(n[l],s.length);if(c>=s.length)throw new Error("'axes' has an out of range axis");if(s[c]!==0)throw new Error("'axes' has a duplicate axis");s[c]=1}let p=0;for(let l=0;l<s.length;l++)s[l]===0&&(s[l]=r[p++]);if(p!==r.length)throw new Error("the unsqueezed dimension could not be established");return s}},ho=class yl{static splitShape(r,n,s,p){if(s.length===0){if(!p)throw new Error("need to know number of outputs when the 'split' attribute is not specified");yl.determineSplit(r[n],p,s)}let l=[],c=[0];for(let o=0;o<s.length;++o){o!==0&&c.push(c[o-1]+s[o-1]);let a=r.slice();a[n]=s[o],l.push(a)}return[l,c]}static determineSplit(r,n,s){if(r%n!==0)throw new Error("cannot split tensor to equal sized parts");for(let p=0;p<n;++p)s.push(r/n)}},Gr=class er{static adjustPoolAttributes(r,n,s,p,l,c){if(!r&&s.length!==n.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(r)for(let o=0;o<n.length-2;o++)o>=s.length?s.push(n[o+2]):s[o]=n[o+2];for(let o=0;o<s.length;o++)if(o<p.length){if(p[o]<0)throw new Error("strides should be greater than or equal to 1")}else p.push(1);for(let o=0;o<s.length;o++)if(o<l.length){if(l[o]<0)throw new Error("dilations should be greater than or equal to 1")}else l.push(1);for(let o=0;o<s.length*2;o++)if(o<c.length){if(c[o]<0)throw new Error("pad should be greater than or equal to 1")}else c.push(0);for(let o=0;o<s.length;o++){if(s[o]<=0)throw new Error("kernel shapes need to be greater than 0");if(c[o]>=s[o]||c[o+s.length]>=s[o])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(r,n,s,p,l,c){if(c){if(l.length!==2*(r.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(n.length!==r.length-2)throw new Error("length of strides should be the length of data dimensions");if(p.length!==r.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let o=0;o<r.length-2;o++)er.adjustPadAndReturnShape(r[o+2],n[o],s[o],p[o],l,o,o+r.length-2,c)}}static computePoolOutputShape(r,n,s,p,l,c,o){if(n.length<=0)throw new Error("input shape must be of size greater than 0");let a=[n[0],n[1]];return er.computeShapeHelper(r,n,a,s,p,l,c,o),a}static computeConvOutputShape(r,n,s,p,l,c,o){if(r.length<=0||n.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");let a=[r[0],n[0]];return er.computeShapeHelper(!1,r,a,s,p,l,c,o),a}static computeShapeHelper(r,n,s,p,l,c,o,a){if(r)for(let e=0;e<n.length-2;e++)s.push(1);else for(let e=0;e<n.length-2;e++)s.push(er.adjustPadAndReturnShape(n[e+2],p[e],l[e],c[e],o,e,e+n.length-2,a))}static adjustPadAndReturnShape(r,n,s,p,l,c,o,a){let e=s*(p-1)+1;if(a&&a!=="NOTSET")switch(a){case"VALID":return l[c]=0,l[o]=0,Math.floor((r-e)/n+1);case"SAME_LOWER":case"SAME_UPPER":if(s!==1)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{let u=((r+n-1)/n-1)*n+p-r;return l[c]=Math.floor(a==="SAME_LOWER"?(u+1)/2:u/2),l[o]=u-l[c],Math.floor((r+u-p)/n+1)}default:throw new Error("Unsupported AutoPad type")}else return Math.floor((r+l[c]+l[o]-e)/n+1)}},dr=-34028234663852886e22,hr=34028234663852886e22});function Zh(t){switch(t){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 ${t}`)}}function wa(t){switch(t){case L.onnx.TensorProto.DataType.UINT8:case L.onnx.TensorProto.DataType.INT8:case L.onnx.TensorProto.DataType.BOOL:return 1;case L.onnx.TensorProto.DataType.UINT16:case L.onnx.TensorProto.DataType.INT16:return 2;case L.onnx.TensorProto.DataType.FLOAT:case L.onnx.TensorProto.DataType.INT32:case L.onnx.TensorProto.DataType.UINT32:return 4;case L.onnx.TensorProto.DataType.INT64:case L.onnx.TensorProto.DataType.DOUBLE:case L.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${L.onnx.TensorProto.DataType[t]}`)}}function Jh(t,r){return new(wl(r))(t)}function wl(t){switch(t){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function go(t,r){if(r===L.onnx.TensorProto.DataType.INT64||r===Vr.TensorDataType.INT64){if(t.greaterThanOrEqual(2147483648)||t.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else if(r===L.onnx.TensorProto.DataType.UINT32||r===Vr.TensorDataType.UINT32||r===L.onnx.TensorProto.DataType.UINT64||r===Vr.TensorDataType.UINT64){if(t.greaterThanOrEqual(4294967296)||t.lessThan(0))throw new TypeError("uint64 is not supported")}else throw new TypeError(`not a LONG type: ${L.onnx.TensorProto.DataType[r]}`);return t.toNumber()}function va(t,r,n){switch(r){case L.onnx.TensorProto.DataType.BOOL:case L.onnx.TensorProto.DataType.UINT8:return t.getUint8(n);case L.onnx.TensorProto.DataType.INT8:return t.getInt8(n);case L.onnx.TensorProto.DataType.UINT16:return t.getUint16(n,!0);case L.onnx.TensorProto.DataType.INT16:return t.getInt16(n,!0);case L.onnx.TensorProto.DataType.FLOAT:return t.getFloat32(n,!0);case L.onnx.TensorProto.DataType.INT32:return t.getInt32(n,!0);case L.onnx.TensorProto.DataType.UINT32:return t.getUint32(n,!0);case L.onnx.TensorProto.DataType.INT64:return go(ee.fromBits(t.getUint32(n,!0),t.getUint32(n+4,!0),!1),r);case L.onnx.TensorProto.DataType.DOUBLE:return t.getFloat64(n,!0);case L.onnx.TensorProto.DataType.UINT64:return go(ee.fromBits(t.getUint32(n,!0),t.getUint32(n+4,!0),!0),r);default:throw new Error(`cannot read from DataView for type ${L.onnx.TensorProto.DataType[r]}`)}}var xa,L,Vr,Pt,De=I(()=>{"use strict";xa=Ie(Fh()),fl(),Zr(),L=Ie(mr()),U(),Vr=H.experimental.fbs,Pt=class Mr{constructor(r,n,s,p,l,c=xa.Guid.create()){this.dims=r,this.type=n,this.dataProvider=s,this.asyncDataProvider=p,this.cache=l,this.dataId=c,this.size=C.validateDimsAndCalcSize(r);let o=this.size,a=s===void 0&&p===void 0&&l===void 0;if(l!==void 0&&l.length!==o)throw new RangeError("Input dims doesn't match data length.");if(n==="string"){if(l!==void 0&&(!Array.isArray(l)||!l.every(e=>typeof e=="string")))throw new TypeError("cache should be a string array");a&&(this.cache=new Array(o))}else{if(l!==void 0){let e=wl(n);if(!(l instanceof e))throw new TypeError(`cache should be type ${e.name}`)}if(a){let e=new ArrayBuffer(o*Zh(n));this.cache=Jh(e,n)}}}get data(){if(this.cache===void 0){let r=this.dataProvider(this.dataId);if(r.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=r}return this.cache}get stringData(){if(this.type!=="string")throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if(this.type!=="string")return this.data;throw new TypeError("type cannot be non-number (string)")}get(r){return this.data[C.indicesToOffset(r,this.strides)]}set(r,n){this.data[C.indicesToOffset(r,this.strides)]=n}async getData(){return this.cache===void 0&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=C.computeStrides(this.dims)),this._strides}static fromProto(r){if(!r)throw new Error("cannot construct Value from an empty tensor");let n=Et.tensorDataTypeFromProto(r.dataType),s=Et.tensorDimsFromProto(r.dims),p=new Mr(s,n);if(n==="string")r.stringData.forEach((l,c)=>{p.data[c]=co(l)});else if(r.rawData&&typeof r.rawData.byteLength=="number"&&r.rawData.byteLength>0){let l=p.data,c=new DataView(r.rawData.buffer,r.rawData.byteOffset,r.rawData.byteLength),o=wa(r.dataType),a=r.rawData.byteLength/o;if(r.rawData.byteLength%o!==0)throw new Error("invalid buffer length");if(l.length!==a)throw new Error("buffer length mismatch");for(let e=0;e<a;e++){let u=va(c,r.dataType,e*o);l[e]=u}}else{let l;switch(r.dataType){case L.onnx.TensorProto.DataType.FLOAT:l=r.floatData;break;case L.onnx.TensorProto.DataType.INT32:case L.onnx.TensorProto.DataType.INT16:case L.onnx.TensorProto.DataType.UINT16:case L.onnx.TensorProto.DataType.INT8:case L.onnx.TensorProto.DataType.UINT8:case L.onnx.TensorProto.DataType.BOOL:l=r.int32Data;break;case L.onnx.TensorProto.DataType.INT64:l=r.int64Data;break;case L.onnx.TensorProto.DataType.DOUBLE:l=r.doubleData;break;case L.onnx.TensorProto.DataType.UINT32:case L.onnx.TensorProto.DataType.UINT64:l=r.uint64Data;break;default:throw new Error("unspecific error")}if(l==null)throw new Error("failed to populate data from a tensorproto value");let c=p.data;if(c.length!==l.length)throw new Error("array length mismatch");for(let o=0;o<l.length;o++){let a=l[o];ee.isLong(a)?c[o]=go(a,r.dataType):c[o]=a}}return p}static fromData(r,n,s){return new Mr(n,s,void 0,void 0,r)}static fromOrtTensor(r){if(!r)throw new Error("cannot construct Value from an empty tensor");let n=Et.tensorDimsFromORTFormat(r),s=Et.tensorDataTypeFromProto(r.dataType()),p=new Mr(n,s);if(s==="string")for(let l=0;l<r.stringDataLength();l++)p.data[l]=r.stringData(l);else if(r.rawDataArray()&&typeof r.rawDataLength()=="number"&&r.rawDataLength()>0){let l=p.data,c=new DataView(r.rawDataArray().buffer,r.rawDataArray().byteOffset,r.rawDataLength()),o=wa(r.dataType()),a=r.rawDataLength()/o;if(r.rawDataLength()%o!==0)throw new Error("invalid buffer length");if(l.length!==a)throw new Error("buffer length mismatch");for(let e=0;e<a;e++){let u=va(c,r.dataType(),e*o);l[e]=u}}return p}}});function B(t){return t===1?vl:xl}function Yh(t){let r=B(t);return`${r.version}
1
+ import{a as le}from"./chunk-FSRPMVAS.js";var lh=Object.create,Kr=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,ch=Object.getOwnPropertyNames,dh=Object.getPrototypeOf,hh=Object.prototype.hasOwnProperty,fh=(t=>typeof le<"u"?le:typeof Proxy<"u"?new Proxy(t,{get:(r,n)=>(typeof le<"u"?le:r)[n]}):t)(function(t){if(typeof le<"u")return le.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),I=(t,r)=>()=>(t&&(r=t(t=0)),r),nt=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),gr=(t,r)=>{for(var n in r)Kr(t,n,{get:r[n],enumerable:!0})},Hu=(t,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of ch(r))!hh.call(t,p)&&p!==n&&Kr(t,p,{get:()=>r[p],enumerable:!(s=ph(r,p))||s.enumerable});return t},Ie=(t,r,n)=>(n=t!=null?lh(dh(t)):{},Hu(r||!t||!t.__esModule?Kr(n,"default",{value:t,enumerable:!0}):n,t)),zr=t=>Hu(Kr({},"__esModule",{value:!0}),t),Me,Zt,cr,da,Vo,Mo=I(()=>{"use strict";Me=new Map,Zt=[],cr=(t,r,n)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){let s=Me.get(t);if(s===void 0)Me.set(t,{backend:r,priority:n});else{if(s.priority>n)return;if(s.priority===n&&s.backend!==r)throw new Error(`cannot register backend "${t}" using priority ${n}`)}if(n>=0){let p=Zt.indexOf(t);p!==-1&&Zt.splice(p,1);for(let l=0;l<Zt.length;l++)if(Me.get(Zt[l]).priority<=n){Zt.splice(l,0,t);return}Zt.push(t)}return}throw new TypeError("not a valid backend")},da=async t=>{let r=Me.get(t);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{let n=!!r.initPromise;try{return n||(r.initPromise=r.backend.init(t)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return n||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Vo=async t=>{let r=t.executionProviders||[],n=r.map(a=>typeof a=="string"?a:a.name),s=n.length===0?Zt:n,p,l=[],c=new Set;for(let a of s){let e=await da(a);typeof e=="string"?l.push({name:a,err:e}):(p||(p=e),p===e&&c.add(a))}if(!p)throw new Error(`no available backend found. ERR: ${l.map(a=>`[${a.name}] ${a.err}`).join(", ")}`);for(let{name:a,err:e}of l)n.includes(a)&&console.warn(`removing requested execution provider "${a}" from session options because it is not available: ${e}`);let o=r.filter(a=>c.has(typeof a=="string"?a:a.name));return[p,new Proxy(t,{get:(a,e)=>e==="executionProviders"?o:Reflect.get(a,e)})]}}),gh=I(()=>{"use strict";Mo()}),qu,mh=I(()=>{"use strict";qu="1.20.0"}),fn,Dt,Wu=I(()=>{"use strict";mh(),fn="warning",Dt={wasm:{},webgl:{},webgpu:{},versions:{common:qu},set logLevel(t){if(t!==void 0){if(typeof t!="string"||["verbose","info","warning","error","fatal"].indexOf(t)===-1)throw new Error(`Unsupported logging level: ${t}`);fn=t}},get logLevel(){return fn}},Object.defineProperty(Dt,"logLevel",{enumerable:!0})}),j,bh=I(()=>{"use strict";Wu(),j=Dt}),Xu,Ku,yh=I(()=>{"use strict";Xu=(t,r)=>{let n=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);n.width=t.dims[3],n.height=t.dims[2];let s=n.getContext("2d");if(s!=null){let p,l;r?.tensorLayout!==void 0&&r.tensorLayout==="NHWC"?(p=t.dims[2],l=t.dims[3]):(p=t.dims[3],l=t.dims[2]);let c=r?.format!==void 0?r.format:"RGB",o=r?.norm,a,e;o===void 0||o.mean===void 0?a=[255,255,255,255]:typeof o.mean=="number"?a=[o.mean,o.mean,o.mean,o.mean]:(a=[o.mean[0],o.mean[1],o.mean[2],0],o.mean[3]!==void 0&&(a[3]=o.mean[3])),o===void 0||o.bias===void 0?e=[0,0,0,0]:typeof o.bias=="number"?e=[o.bias,o.bias,o.bias,o.bias]:(e=[o.bias[0],o.bias[1],o.bias[2],0],o.bias[3]!==void 0&&(e[3]=o.bias[3]));let u=l*p,i=0,d=u,h=u*2,m=-1;c==="RGBA"?(i=0,d=u,h=u*2,m=u*3):c==="RGB"?(i=0,d=u,h=u*2):c==="RBG"&&(i=0,h=u,d=u*2);for(let b=0;b<l;b++)for(let x=0;x<p;x++){let E=(t.data[i++]-e[0])*a[0],w=(t.data[d++]-e[1])*a[1],S=(t.data[h++]-e[2])*a[2],$=m===-1?255:(t.data[m++]-e[3])*a[3];s.fillStyle="rgba("+E+","+w+","+S+","+$+")",s.fillRect(x,b,1,1)}if("toDataURL"in n)return n.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},Ku=(t,r)=>{let n=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),s;if(n!=null){let p,l,c;r?.tensorLayout!==void 0&&r.tensorLayout==="NHWC"?(p=t.dims[2],l=t.dims[1],c=t.dims[3]):(p=t.dims[3],l=t.dims[2],c=t.dims[1]);let o=r!==void 0&&r.format!==void 0?r.format:"RGB",a=r?.norm,e,u;a===void 0||a.mean===void 0?e=[255,255,255,255]:typeof a.mean=="number"?e=[a.mean,a.mean,a.mean,a.mean]:(e=[a.mean[0],a.mean[1],a.mean[2],255],a.mean[3]!==void 0&&(e[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));let i=l*p;if(r!==void 0&&(r.format!==void 0&&c===4&&r.format!=="RGBA"||c===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let d=4,h=0,m=1,b=2,x=3,E=0,w=i,S=i*2,$=-1;o==="RGBA"?(E=0,w=i,S=i*2,$=i*3):o==="RGB"?(E=0,w=i,S=i*2):o==="RBG"&&(E=0,S=i,w=i*2),s=n.createImageData(p,l);for(let F=0;F<l*p;h+=d,m+=d,b+=d,x+=d,F++)s.data[h]=(t.data[E++]-u[0])*e[0],s.data[m]=(t.data[w++]-u[1])*e[1],s.data[b]=(t.data[S++]-u[2])*e[2],s.data[x]=$===-1?255:(t.data[$++]-u[3])*e[3]}else throw new Error("Can not access image data");return s}}),Nr,Zu,Ju,Yu,Qu,tl,wh=I(()=>{"use strict";zo(),Nr=(t,r)=>{if(t===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:n,width:s}=r,p=r.norm??{mean:255,bias:0},l,c;typeof p.mean=="number"?l=[p.mean,p.mean,p.mean,p.mean]:l=[p.mean[0],p.mean[1],p.mean[2],p.mean[3]??255],typeof p.bias=="number"?c=[p.bias,p.bias,p.bias,p.bias]:c=[p.bias[0],p.bias[1],p.bias[2],p.bias[3]??0];let o=r.format!==void 0?r.format:"RGBA",a=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",e=n*s,u=a==="RGBA"?new Float32Array(e*4):new Float32Array(e*3),i=4,d=0,h=1,m=2,b=3,x=0,E=e,w=e*2,S=-1;o==="RGB"&&(i=3,d=0,h=1,m=2,b=-1),a==="RGBA"?S=e*3:a==="RBG"?(x=0,w=e,E=e*2):a==="BGR"&&(w=0,E=e,x=e*2);for(let $=0;$<e;$++,d+=i,m+=i,h+=i,b+=i)u[x++]=(t[d]+c[0])/l[0],u[E++]=(t[h]+c[1])/l[1],u[w++]=(t[m]+c[2])/l[2],S!==-1&&b!==-1&&(u[S++]=(t[b]+c[3])/l[3]);return a==="RGBA"?new It("float32",u,[1,4,n,s]):new It("float32",u,[1,3,n,s])},Zu=async(t,r)=>{let n=typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement,s=typeof ImageData<"u"&&t instanceof ImageData,p=typeof ImageBitmap<"u"&&t instanceof ImageBitmap,l=typeof t=="string",c,o=r??{},a=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},e=u=>typeof HTMLCanvasElement<"u"&&u instanceof HTMLCanvasElement||u instanceof OffscreenCanvas?u.getContext("2d"):null;if(n){let u=a();u.width=t.width,u.height=t.height;let i=e(u);if(i!=null){let d=t.height,h=t.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=r.resizedHeight,h=r.resizedWidth),r!==void 0){if(o=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");o.tensorFormat="RGBA",o.height=d,o.width=h}else o.tensorFormat="RGBA",o.height=d,o.width=h;i.drawImage(t,0,0),c=i.getImageData(0,0,h,d).data}else throw new Error("Can not access image data")}else if(s){let u,i;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(u=r.resizedHeight,i=r.resizedWidth):(u=t.height,i=t.width),r!==void 0&&(o=r),o.format="RGBA",o.height=u,o.width=i,r!==void 0){let d=a();d.width=i,d.height=u;let h=e(d);if(h!=null)h.putImageData(t,0,0),c=h.getImageData(0,0,i,u).data;else throw new Error("Can not access image data")}else c=t.data}else if(p){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");let u=a();u.width=t.width,u.height=t.height;let i=e(u);if(i!=null){let d=t.height,h=t.width;return i.drawImage(t,0,0,h,d),c=i.getImageData(0,0,h,d).data,o.height=d,o.width=h,Nr(c,o)}else throw new Error("Can not access image data")}else{if(l)return new Promise((u,i)=>{let d=a(),h=e(d);if(!t||!h)return i();let m=new Image;m.crossOrigin="Anonymous",m.src=t,m.onload=()=>{d.width=m.width,d.height=m.height,h.drawImage(m,0,0,d.width,d.height);let b=h.getImageData(0,0,d.width,d.height);o.height=d.height,o.width=d.width,u(Nr(b.data,o))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return Nr(c,o);throw new Error("Input data provided is not supported - aborted tensor creation")},Ju=(t,r)=>{let{width:n,height:s,download:p,dispose:l}=r,c=[1,s,n,4];return new It({location:"texture",type:"float32",texture:t,dims:c,download:p,dispose:l})},Yu=(t,r)=>{let{dataType:n,dims:s,download:p,dispose:l}=r;return new It({location:"gpu-buffer",type:n??"float32",gpuBuffer:t,dims:s,download:p,dispose:l})},Qu=(t,r)=>{let{dataType:n,dims:s,download:p,dispose:l}=r;return new It({location:"ml-tensor",type:n??"float32",mlTensor:t,dims:s,download:p,dispose:l})},tl=(t,r,n)=>new It({location:"cpu-pinned",type:t,data:r,dims:n??[r.length]})}),me,Ye,gn,el,vh=I(()=>{"use strict";me=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Ye=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),gn=!1,el=()=>{if(!gn){gn=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,n=typeof Float16Array<"u"&&Float16Array.from;t&&(me.set("int64",BigInt64Array),Ye.set(BigInt64Array,"int64")),r&&(me.set("uint64",BigUint64Array),Ye.set(BigUint64Array,"uint64")),n?(me.set("float16",Float16Array),Ye.set(Float16Array,"float16")):me.set("float16",Uint16Array)}}}),rl,nl,xh=I(()=>{"use strict";zo(),rl=t=>{let r=1;for(let n=0;n<t.length;n++){let s=t[n];if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`dims[${n}] must be an integer, got: ${s}`);if(s<0)throw new RangeError(`dims[${n}] must be a non-negative integer, got: ${s}`);r*=s}return r},nl=(t,r)=>{switch(t.location){case"cpu":return new It(t.type,t.data,r);case"cpu-pinned":return new It({location:"cpu-pinned",data:t.data,type:t.type,dims:r});case"texture":return new It({location:"texture",texture:t.texture,type:t.type,dims:r});case"gpu-buffer":return new It({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:r});case"ml-tensor":return new It({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}}),It,zo=I(()=>{"use strict";yh(),wh(),vh(),xh(),It=class{constructor(t,r,n){el();let s,p;if(typeof t=="object"&&"location"in t)switch(this.dataLocation=t.location,s=t.type,p=t.dims,t.location){case"cpu-pinned":{let c=me.get(s);if(!c)throw new TypeError(`unsupported type "${s}" to create tensor from pinned buffer`);if(!(t.data instanceof c))throw new TypeError(`buffer should be of type ${c.name}`);this.cpuData=t.data;break}case"texture":{if(s!=="float32")throw new TypeError(`unsupported type "${s}" to create tensor from texture`);this.gpuTextureData=t.texture,this.downloader=t.download,this.disposer=t.dispose;break}case"gpu-buffer":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint8"&&s!=="bool"&&s!=="uint4"&&s!=="int4")throw new TypeError(`unsupported type "${s}" to create tensor from gpu buffer`);this.gpuBufferData=t.gpuBuffer,this.downloader=t.download,this.disposer=t.dispose;break}case"ml-tensor":{if(s!=="float32"&&s!=="float16"&&s!=="int32"&&s!=="int64"&&s!=="uint32"&&s!=="uint64"&&s!=="int8"&&s!=="uint8"&&s!=="bool")throw new TypeError(`unsupported type "${s}" to create tensor from MLTensor`);this.mlTensorData=t.mlTensor,this.downloader=t.download,this.disposer=t.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let c,o;if(typeof t=="string")if(s=t,o=n,t==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");c=r}else{let a=me.get(t);if(a===void 0)throw new TypeError(`Unsupported tensor type: ${t}.`);if(Array.isArray(r)){if(t==="float16"&&a===Uint16Array||t==="uint4"||t==="int4")throw new TypeError(`Creating a ${t} tensor from number array is not supported. Please use ${a.name} as data.`);t==="uint64"||t==="int64"?c=a.from(r,BigInt):c=a.from(r)}else if(r instanceof a)c=r;else if(r instanceof Uint8ClampedArray)if(t==="uint8")c=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else throw new TypeError(`A ${s} tensor's data must be type of ${a}`)}else if(o=r,Array.isArray(t)){if(t.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let a=typeof t[0];if(a==="string")s="string",c=t;else if(a==="boolean")s="bool",c=Uint8Array.from(t);else throw new TypeError(`Invalid element type of data array: ${a}.`)}else if(t instanceof Uint8ClampedArray)s="uint8",c=Uint8Array.from(t);else{let a=Ye.get(t.constructor);if(a===void 0)throw new TypeError(`Unsupported type for tensor data: ${t.constructor}.`);s=a,c=t}if(o===void 0)o=[c.length];else if(!Array.isArray(o))throw new TypeError("A tensor's dims must be a number array");p=o,this.cpuData=c,this.dataLocation="cpu"}let l=rl(p);if(this.cpuData&&l!==this.cpuData.length&&!((s==="uint4"||s==="int4")&&Math.ceil(l/2)===this.cpuData.length))throw new Error(`Tensor's size(${l}) does not match data length(${this.cpuData.length}).`);this.type=s,this.dims=p,this.size=l}static async fromImage(t,r){return Zu(t,r)}static fromTexture(t,r){return Ju(t,r)}static fromGpuBuffer(t,r){return Yu(t,r)}static fromMLTensor(t,r){return Qu(t,r)}static fromPinnedBuffer(t,r,n){return tl(t,r,n)}toDataURL(t){return Xu(this,t)}toImageData(t){return Ku(this,t)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(t){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,t&&this.disposer&&(this.disposer(),this.disposer=void 0),r}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(t){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return nl(this,t)}}}),ft,Uo=I(()=>{"use strict";zo(),ft=It}),no,mn,Pe,Ae,ol=I(()=>{"use strict";Wu(),no=(t,r)=>{(typeof Dt.trace>"u"?!Dt.wasm.trace:!Dt.trace)||console.timeStamp(`${t}::ORT::${r}`)},mn=(t,r)=>{let n=new Error().stack?.split(/\r\n|\r|\n/g)||[],s=!1;for(let p=0;p<n.length;p++){if(s&&!n[p].includes("TRACE_FUNC")){let l=`FUNC_${t}::${n[p].trim().split(" ")[1]}`;r&&(l+=`::${r}`),no("CPU",l);return}n[p].includes("TRACE_FUNC")&&(s=!0)}},Pe=t=>{(typeof Dt.trace>"u"?!Dt.wasm.trace:!Dt.trace)||mn("BEGIN",t)},Ae=t=>{(typeof Dt.trace>"u"?!Dt.wasm.trace:!Dt.trace)||mn("END",t)}}),il,Th=I(()=>{"use strict";Mo(),Uo(),ol(),il=class al{constructor(r){this.handler=r}async run(r,n,s){Pe();let p={},l={};if(typeof r!="object"||r===null||r instanceof ft||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let c=!0;if(typeof n=="object"){if(n===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(n instanceof ft)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(n)){if(n.length===0)throw new TypeError("'fetches' cannot be an empty array.");c=!1;for(let e of n){if(typeof e!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(e)===-1)throw new RangeError(`'fetches' contains invalid output name: ${e}.`);p[e]=null}if(typeof s=="object"&&s!==null)l=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let e=!1,u=Object.getOwnPropertyNames(n);for(let i of this.outputNames)if(u.indexOf(i)!==-1){let d=n[i];(d===null||d instanceof ft)&&(e=!0,c=!1,p[i]=d)}if(e){if(typeof s=="object"&&s!==null)l=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else l=n}}else if(typeof n<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let e of this.inputNames)if(typeof r[e]>"u")throw new Error(`input '${e}' is missing in 'feeds'.`);if(c)for(let e of this.outputNames)p[e]=null;let o=await this.handler.run(r,p,l),a={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let u=o[e];u instanceof ft?a[e]=u:a[e]=new ft(u.type,u.data,u.dims)}return Ae(),a}async release(){return this.handler.dispose()}static async create(r,n,s,p){Pe();let l,c={};if(typeof r=="string"){if(l=r,typeof n=="object"&&n!==null)c=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(l=r,typeof n=="object"&&n!==null)c=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){let u=r,i=0,d=r.byteLength;if(typeof n=="object"&&n!==null)c=n;else if(typeof n=="number"){if(i=n,!Number.isSafeInteger(i))throw new RangeError("'byteOffset' must be an integer.");if(i<0||i>=u.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${u.byteLength}).`);if(d=r.byteLength-i,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||i+d>u.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${u.byteLength-i}].`);if(typeof p=="object"&&p!==null)c=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof n<"u")throw new TypeError("'options' must be an object.");l=new Uint8Array(u,i,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[o,a]=await Vo(c),e=await o.createInferenceSessionHandler(l,a);return Ae(),new al(e)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}}),sl,_h=I(()=>{"use strict";Th(),sl=il}),Sh=I(()=>{"use strict"}),Oh=I(()=>{"use strict"}),Eh=I(()=>{"use strict"}),Ih=I(()=>{"use strict"}),ha,ul,Ph=I(()=>{"use strict";Mo(),Uo(),ha="Training backend could not be resolved. Make sure you're using the correct configuration & WebAssembly files.",ul=class ll{constructor(r,n,s){this.handler=r,this.hasOptimizerModel=n,this.hasEvalModel=s}get trainingInputNames(){return this.handler.inputNames}get trainingOutputNames(){return this.handler.outputNames}get evalInputNames(){if(this.hasEvalModel)return this.handler.evalInputNames;throw new Error("This training session has no evalModel loaded.")}get evalOutputNames(){if(this.hasEvalModel)return this.handler.evalOutputNames;throw new Error("This training session has no evalModel loaded.")}static async create(r,n){let s=r.evalModel||"",p=r.optimizerModel||"",l=n||{},[c,o]=await Vo(l);if(c.createTrainingSessionHandler){let a=await c.createTrainingSessionHandler(r.checkpointState,r.trainModel,s,p,o);return new ll(a,!!r.optimizerModel,!!r.evalModel)}else throw new Error(ha)}typeNarrowingForRunStep(r,n,s,p,l){let c={},o={};if(typeof s!="object"||s===null||s instanceof ft||Array.isArray(s))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let a=!0;if(typeof p=="object"){if(p===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(p instanceof ft)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(p)){if(p.length===0)throw new TypeError("'fetches' cannot be an empty array.");a=!1;for(let e of p){if(typeof e!="string")throw new TypeError("'fetches' must be a string array or an object.");if(n.indexOf(e)===-1)throw new RangeError(`'fetches' contains invalid output name: ${e}.`);c[e]=null}if(typeof l=="object"&&l!==null)o=l;else if(typeof l<"u")throw new TypeError("'options' must be an object.")}else{let e=!1,u=Object.getOwnPropertyNames(p);for(let i of n)if(u.indexOf(i)!==-1){let d=p[i];(d===null||d instanceof ft)&&(e=!0,a=!1,c[i]=d)}if(e){if(typeof l=="object"&&l!==null)o=l;else if(typeof l<"u")throw new TypeError("'options' must be an object.")}else o=p}}else if(typeof p<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let e of r)if(typeof s[e]>"u")throw new Error(`input '${e}' is missing in 'feeds'.`);if(a)for(let e of n)c[e]=null;return[c,o]}convertHandlerReturnTypeToMapOfTensors(r){let n={};for(let s in r)if(Object.hasOwnProperty.call(r,s)){let p=r[s];p instanceof ft?n[s]=p:n[s]=new ft(p.type,p.data,p.dims)}return n}async lazyResetGrad(){await this.handler.lazyResetGrad()}async runTrainStep(r,n,s){let[p,l]=this.typeNarrowingForRunStep(this.trainingInputNames,this.trainingOutputNames,r,n,s),c=await this.handler.runTrainStep(r,p,l);return this.convertHandlerReturnTypeToMapOfTensors(c)}async runOptimizerStep(r){if(this.hasOptimizerModel)await this.handler.runOptimizerStep(r||{});else throw new Error("This TrainingSession has no OptimizerModel loaded.")}async runEvalStep(r,n,s){if(this.hasEvalModel){let[p,l]=this.typeNarrowingForRunStep(this.evalInputNames,this.evalOutputNames,r,n,s),c=await this.handler.runEvalStep(r,p,l);return this.convertHandlerReturnTypeToMapOfTensors(c)}else throw new Error("This TrainingSession has no EvalModel loaded.")}async getParametersSize(r=!0){return this.handler.getParametersSize(r)}async loadParametersBuffer(r,n=!0){let s=await this.getParametersSize(n);if(r.length!==4*s)throw new Error("Size of the buffer passed into loadParametersBuffer must match the number of parameters in the model. Please use getParametersSize method to check.");return this.handler.loadParametersBuffer(r,n)}async getContiguousParameters(r=!0){return this.handler.getContiguousParameters(r)}async release(){return this.handler.dispose()}}}),pl,Ah=I(()=>{"use strict";Ph(),pl=ul}),cl={};gr(cl,{InferenceSession:()=>sl,TRACE:()=>no,TRACE_FUNC_BEGIN:()=>Pe,TRACE_FUNC_END:()=>Ae,Tensor:()=>ft,TrainingSession:()=>pl,env:()=>j,registerBackend:()=>cr});var zt=I(()=>{"use strict";gh(),bh(),_h(),Uo(),Sh(),Oh(),ol(),Eh(),Ih(),Ah()});function be(t,r,n,s){if(r===void 0)return $h(t);if(n===void 0)kr(t,r,1);else if(typeof n=="number"&&s===void 0)kr(t,r,n);else if(typeof n=="string"&&s===void 0)kr(t,n,1,r);else if(typeof n=="string"&&typeof s=="number")kr(t,n,s,r);else throw new TypeError("input is valid")}function $h(t){return{verbose:be.verbose.bind(null,t),info:be.info.bind(null,t),warning:be.warning.bind(null,t),error:be.error.bind(null,t),fatal:be.fatal.bind(null,t)}}function kr(t,r,n,s){let p=Ee[s||""]||Ee[""];oo[t]<oo[p.minimalSeverity]||(p.logDateTime&&(r=`${new Date().toISOString()}|${r}`),p.logSourceLocation,dl[p.provider].log(t,r,s))}var fa,ga,oo,dl,bn,Ee,tt,yn,wn,hl,ze,Rt=I(()=>{"use strict";fa=class{log(t,r,n){}},ga=class{log(t,r,n){console.log(`${this.color(t)} ${n?"\x1B[35m"+n+"\x1B[0m ":""}${r}`)}color(t){switch(t){case"verbose":return"\x1B[34;40mv\x1B[0m";case"info":return"\x1B[32mi\x1B[0m";case"warning":return"\x1B[30;43mw\x1B[0m";case"error":return"\x1B[31;40me\x1B[0m";case"fatal":return"\x1B[101mf\x1B[0m";default:throw new Error(`unsupported severity: ${t}`)}}},oo={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},dl={none:new fa,console:new ga},bn={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1},Ee={"":bn},(t=>{function r(e,u){t("verbose",e,u)}t.verbose=r;function n(e,u){t("info",e,u)}t.info=n;function s(e,u){t("warning",e,u)}t.warning=s;function p(e,u){t("error",e,u)}t.error=p;function l(e,u){t("fatal",e,u)}t.fatal=l;function c(e){Ee={},o("",e||{})}t.reset=c;function o(e,u){if(e==="*")c(u);else{let i=Ee[e]||bn;Ee[e]={provider:u.provider||i.provider,minimalSeverity:u.minimalSeverity||i.minimalSeverity,logDateTime:u.logDateTime===void 0?i.logDateTime:u.logDateTime,logSourceLocation:u.logSourceLocation===void 0?i.logSourceLocation:u.logSourceLocation}}}t.set=o;function a(e){let u={};e.logLevel&&(u.minimalSeverity=e.logLevel),o("",u)}t.setWithEnv=a})(be||(be={})),tt=be,yn=class{constructor(t,r,n,s,p,l){this.category=t,this.name=r,this.startTime=n,this.endCallback=s,this.timer=p,this.ctx=l}async end(){return this.endCallback(this)}async checkTimer(){if(this.ctx===void 0||this.timer===void 0)throw new Error("No webgl timer found");return this.ctx.endTimer(),this.ctx.waitForQueryAndGetTime(this.timer)}},wn=class{constructor(t,r,n,s){this.category=t,this.name=r,this.startTime=n,this.endTime=s}},hl=class{constructor(t,r,n){this._started=!1,this._flushPointer=0,this._started=!1,this._maxNumberEvents=t===void 0?1e4:t,this._flushBatchSize=r===void 0?10:r,this._flushIntervalInMilliseconds=n===void 0?5e3:n}static create(t){return t===void 0?new this:new this(t.maxNumberEvents,t.flushBatchSize,t.flushIntervalInMilliseconds)}start(){this._started=!0,this._timingEvents=[],this._flushTime=ze(),this._flushPointer=0}stop(){for(this._started=!1;this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer])}event(t,r,n,s){let p=this._started?this.begin(t,r,s):void 0,l=!1,c=n();if(c&&typeof c.then=="function")return l=!0,new Promise((o,a)=>{c.then(async e=>{p&&await p.end(),o(e)},async e=>{p&&await p.end(),a(e)})});if(!l&&p){let o=p.end();if(o&&typeof o.then=="function")return new Promise((a,e)=>{o.then(()=>{a(c)},u=>{e(u)})})}return c}begin(t,r,n){if(!this._started)throw new Error("profiler is not started yet");if(n===void 0){let s=ze();return this.flush(s),new yn(t,r,s,p=>this.endSync(p))}else{let s=n.beginTimer();return new yn(t,r,0,async p=>this.end(p),s,n)}}async end(t){let r=await t.checkTimer();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new wn(t.category,t.name,t.startTime,r)),this.flush(r))}endSync(t){let r=ze();this._timingEvents.length<this._maxNumberEvents&&(this._timingEvents.push(new wn(t.category,t.name,t.startTime,r)),this.flush(r))}logOneEvent(t){tt.verbose(`Profiler.${t.category}`,`${(t.endTime-t.startTime).toFixed(2)}ms on event '${t.name}' at ${t.endTime.toFixed(2)}`)}flush(t){if(this._timingEvents.length-this._flushPointer>=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(let r=this._flushPointer;this._flushPointer<r+this._flushBatchSize&&this._flushPointer<this._timingEvents.length;this._flushPointer++)this.logOneEvent(this._timingEvents[this._flushPointer]);this._flushTime=ze()}}get started(){return this._started}},ze=typeof performance<"u"&&performance.now?()=>performance.now():Date.now});function Dh(t,r,n){for(let s of n){let p=s[0],l=s[1],c=s[2],o=s[3],a=s[4];if(t.opType===p){for(let e of r)if((e.domain===l||e.domain==="ai.onnx"&&l==="")&&Nh(e.version,c))return{opImpl:o,opInit:a}}}throw new TypeError(`cannot resolve operator '${t.opType}' with opsets: ${r.map(s=>`${s.domain||"ai.onnx"} v${s.version}`).join(", ")}`)}function Nh(t,r){if(r.endsWith("+")){let n=Number.parseInt(r.substring(0,r.length-1),10);return!isNaN(n)&&n<=t}else if(r.split("-").length===2){let n=r.split("-"),s=Number.parseInt(n[0],10),p=Number.parseInt(n[1],10);return!isNaN(s)&&!isNaN(p)&&s<=t&&t<=p}else return Number.parseInt(r,10)===t}var kh=I(()=>{"use strict"}),Fh=nt(t=>{"use strict";t.__esModule=!0;var r=(function(){function n(s){if(!s)throw new TypeError("Invalid argument; `value` has no value.");this.value=n.EMPTY,s&&n.isGuid(s)&&(this.value=s)}return n.isGuid=function(s){var p=s.toString();return s&&(s instanceof n||n.validator.test(p))},n.create=function(){return new n([n.gen(2),n.gen(1),n.gen(1),n.gen(1),n.gen(3)].join("-"))},n.createEmpty=function(){return new n("emptyguid")},n.parse=function(s){return new n(s)},n.raw=function(){return[n.gen(2),n.gen(1),n.gen(1),n.gen(1),n.gen(3)].join("-")},n.gen=function(s){for(var p="",l=0;l<s;l++)p+=((1+Math.random())*65536|0).toString(16).substring(1);return p},n.prototype.equals=function(s){return n.isGuid(s)&&this.value===s.toString()},n.prototype.isEmpty=function(){return this.value===n.EMPTY},n.prototype.toString=function(){return this.value},n.prototype.toJSON=function(){return{value:this.value}},n.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),n.EMPTY="00000000-0000-0000-0000-000000000000",n})();t.Guid=r});function W(t,r,n){this.low=t|0,this.high=r|0,this.unsigned=!!n}function dt(t){return(t&&t.__isLong__)===!0}function ma(t){var r=Math.clz32(t&-t);return t?31-r:r}function pe(t,r){var n,s,p;return r?(t>>>=0,(p=0<=t&&t<256)&&(s=ao[t],s)?s:(n=M(t,0,!0),p&&(ao[t]=n),n)):(t|=0,(p=-128<=t&&t<128)&&(s=io[t],s)?s:(n=M(t,t<0?-1:0,!1),p&&(io[t]=n),n))}function kt(t,r){if(isNaN(t))return r?Bt:Nt;if(r){if(t<0)return Bt;if(t>=so)return po}else{if(t<=-uo)return mt;if(t+1>=uo)return lo}return t<0?kt(-t,r).neg():M(t%ye|0,t/ye|0,r)}function M(t,r,n){return new W(t,r,n)}function Go(t,r,n){if(t.length===0)throw Error("empty string");if(typeof r=="number"?(n=r,r=!1):r=!!r,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return r?Bt:Nt;if(n=n||10,n<2||36<n)throw RangeError("radix");var s;if((s=t.indexOf("-"))>0)throw Error("interior hyphen");if(s===0)return Go(t.substring(1),r,n).neg();for(var p=kt(sr(n,8)),l=Nt,c=0;c<t.length;c+=8){var o=Math.min(8,t.length-c),a=parseInt(t.substring(c,c+o),n);if(o<8){var e=kt(sr(n,o));l=l.mul(e).add(kt(a))}else l=l.mul(p),l=l.add(kt(a))}return l.unsigned=r,l}function Lt(t,r){return typeof t=="number"?kt(t,r):typeof t=="string"?Go(t,r):M(t.low,t.high,typeof r=="boolean"?r:t.unsigned)}var _t,io,ao,sr,vn,ba,ye,so,uo,xn,Nt,Bt,ce,Tn,Fr,lo,po,mt,A,ee,fl=I(()=>{_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{}W.prototype.__isLong__,Object.defineProperty(W.prototype,"__isLong__",{value:!0}),W.isLong=dt,io={},ao={},W.fromInt=pe,W.fromNumber=kt,W.fromBits=M,sr=Math.pow,W.fromString=Go,W.fromValue=Lt,vn=65536,ba=1<<24,ye=vn*vn,so=ye*ye,uo=so/2,xn=pe(ba),Nt=pe(0),W.ZERO=Nt,Bt=pe(0,!0),W.UZERO=Bt,ce=pe(1),W.ONE=ce,Tn=pe(1,!0),W.UONE=Tn,Fr=pe(-1),W.NEG_ONE=Fr,lo=M(-1,2147483647,!1),W.MAX_VALUE=lo,po=M(-1,-1,!0),W.MAX_UNSIGNED_VALUE=po,mt=M(0,-2147483648,!1),W.MIN_VALUE=mt,A=W.prototype,A.toInt=function(){return this.unsigned?this.low>>>0:this.low},A.toNumber=function(){return this.unsigned?(this.high>>>0)*ye+(this.low>>>0):this.high*ye+(this.low>>>0)},A.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(mt)){var r=kt(t),n=this.div(r),s=n.mul(r).sub(this);return n.toString(t)+s.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var p=kt(sr(t,6),this.unsigned),l=this,c="";;){var o=l.div(p),a=l.sub(o.mul(p)).toInt()>>>0,e=a.toString(t);if(l=o,l.isZero())return e+c;for(;e.length<6;)e="0"+e;c=""+e+c}},A.getHighBits=function(){return this.high},A.getHighBitsUnsigned=function(){return this.high>>>0},A.getLowBits=function(){return this.low},A.getLowBitsUnsigned=function(){return this.low>>>0},A.getNumBitsAbs=function(){if(this.isNegative())return this.eq(mt)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1},A.isZero=function(){return this.high===0&&this.low===0},A.eqz=A.isZero,A.isNegative=function(){return!this.unsigned&&this.high<0},A.isPositive=function(){return this.unsigned||this.high>=0},A.isOdd=function(){return(this.low&1)===1},A.isEven=function(){return(this.low&1)===0},A.equals=function(t){return dt(t)||(t=Lt(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},A.eq=A.equals,A.notEquals=function(t){return!this.eq(t)},A.neq=A.notEquals,A.ne=A.notEquals,A.lessThan=function(t){return this.comp(t)<0},A.lt=A.lessThan,A.lessThanOrEqual=function(t){return this.comp(t)<=0},A.lte=A.lessThanOrEqual,A.le=A.lessThanOrEqual,A.greaterThan=function(t){return this.comp(t)>0},A.gt=A.greaterThan,A.greaterThanOrEqual=function(t){return this.comp(t)>=0},A.gte=A.greaterThanOrEqual,A.ge=A.greaterThanOrEqual,A.compare=function(t){if(dt(t)||(t=Lt(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},A.comp=A.compare,A.negate=function(){return!this.unsigned&&this.eq(mt)?mt:this.not().add(ce)},A.neg=A.negate,A.add=function(t){dt(t)||(t=Lt(t));var r=this.high>>>16,n=this.high&65535,s=this.low>>>16,p=this.low&65535,l=t.high>>>16,c=t.high&65535,o=t.low>>>16,a=t.low&65535,e=0,u=0,i=0,d=0;return d+=p+a,i+=d>>>16,d&=65535,i+=s+o,u+=i>>>16,i&=65535,u+=n+c,e+=u>>>16,u&=65535,e+=r+l,e&=65535,M(i<<16|d,e<<16|u,this.unsigned)},A.subtract=function(t){return dt(t)||(t=Lt(t)),this.add(t.neg())},A.sub=A.subtract,A.multiply=function(t){if(this.isZero())return this;if(dt(t)||(t=Lt(t)),_t){var r=_t.mul(this.low,this.high,t.low,t.high);return M(r,_t.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Bt:Nt;if(this.eq(mt))return t.isOdd()?mt:Nt;if(t.eq(mt))return this.isOdd()?mt:Nt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(xn)&&t.lt(xn))return kt(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,s=this.high&65535,p=this.low>>>16,l=this.low&65535,c=t.high>>>16,o=t.high&65535,a=t.low>>>16,e=t.low&65535,u=0,i=0,d=0,h=0;return h+=l*e,d+=h>>>16,h&=65535,d+=p*e,i+=d>>>16,d&=65535,d+=l*a,i+=d>>>16,d&=65535,i+=s*e,u+=i>>>16,i&=65535,i+=p*a,u+=i>>>16,i&=65535,i+=l*o,u+=i>>>16,i&=65535,u+=n*e+s*a+p*o+l*c,u&=65535,M(d<<16|h,u<<16|i,this.unsigned)},A.mul=A.multiply,A.divide=function(t){if(dt(t)||(t=Lt(t)),t.isZero())throw Error("division by zero");if(_t){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?_t.div_u:_t.div_s)(this.low,this.high,t.low,t.high);return M(r,_t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Bt:Nt;var n,s,p;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Bt;if(t.gt(this.shru(1)))return Tn;p=Bt}else{if(this.eq(mt)){if(t.eq(ce)||t.eq(Fr))return mt;if(t.eq(mt))return ce;var l=this.shr(1);return n=l.div(t).shl(1),n.eq(Nt)?t.isNegative()?ce:Fr:(s=this.sub(t.mul(n)),p=n.add(s.div(t)),p)}else if(t.eq(mt))return this.unsigned?Bt:Nt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();p=Nt}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),o=c<=48?1:sr(2,c-48),a=kt(n),e=a.mul(t);e.isNegative()||e.gt(s);)n-=o,a=kt(n,this.unsigned),e=a.mul(t);a.isZero()&&(a=ce),p=p.add(a),s=s.sub(e)}return p},A.div=A.divide,A.modulo=function(t){if(dt(t)||(t=Lt(t)),_t){var r=(this.unsigned?_t.rem_u:_t.rem_s)(this.low,this.high,t.low,t.high);return M(r,_t.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},A.mod=A.modulo,A.rem=A.modulo,A.not=function(){return M(~this.low,~this.high,this.unsigned)},A.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},A.clz=A.countLeadingZeros,A.countTrailingZeros=function(){return this.low?ma(this.low):ma(this.high)+32},A.ctz=A.countTrailingZeros,A.and=function(t){return dt(t)||(t=Lt(t)),M(this.low&t.low,this.high&t.high,this.unsigned)},A.or=function(t){return dt(t)||(t=Lt(t)),M(this.low|t.low,this.high|t.high,this.unsigned)},A.xor=function(t){return dt(t)||(t=Lt(t)),M(this.low^t.low,this.high^t.high,this.unsigned)},A.shiftLeft=function(t){return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?M(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):M(0,this.low<<t-32,this.unsigned)},A.shl=A.shiftLeft,A.shiftRight=function(t){return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?M(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):M(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},A.shr=A.shiftRight,A.shiftRightUnsigned=function(t){return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?M(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?M(this.high,0,this.unsigned):M(this.high>>>t-32,0,this.unsigned)},A.shru=A.shiftRightUnsigned,A.shr_u=A.shiftRightUnsigned,A.rotateLeft=function(t){var r;return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?M(this.high,this.low,this.unsigned):t<32?(r=32-t,M(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,M(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))},A.rotl=A.rotateLeft,A.rotateRight=function(t){var r;return dt(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?M(this.high,this.low,this.unsigned):t<32?(r=32-t,M(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,M(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))},A.rotr=A.rotateRight,A.toSigned=function(){return this.unsigned?M(this.low,this.high,!1):this},A.toUnsigned=function(){return this.unsigned?this:M(this.low,this.high,!0)},A.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},A.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},A.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},W.fromBytes=function(t,r,n){return n?W.fromBytesLE(t,r):W.fromBytesBE(t,r)},W.fromBytesLE=function(t,r){return new W(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},W.fromBytesBE=function(t,r){return new W(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},ee=W}),T,Ho=I(()=>{T={},T.Offset,T.Table,T.SIZEOF_SHORT=2,T.SIZEOF_INT=4,T.FILE_IDENTIFIER_LENGTH=4,T.SIZE_PREFIX_LENGTH=4,T.Encoding={UTF8_BYTES:1,UTF16_STRING:2},T.int32=new Int32Array(2),T.float32=new Float32Array(T.int32.buffer),T.float64=new Float64Array(T.int32.buffer),T.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,T.Long=function(t,r){this.low=t|0,this.high=r|0},T.Long.create=function(t,r){return t==0&&r==0?T.Long.ZERO:new T.Long(t,r)},T.Long.prototype.toFloat64=function(){return(this.low>>>0)+this.high*4294967296},T.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},T.Long.ZERO=new T.Long(0,0),T.Builder=function(t){if(t)var r=t;else var r=1024;this.bb=T.ByteBuffer.allocate(r),this.space=r,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},T.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},T.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},T.Builder.prototype.dataBuffer=function(){return this.bb},T.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},T.Builder.prototype.prep=function(t,r){t>this.minalign&&(this.minalign=t);for(var n=~(this.bb.capacity()-this.space+r)+1&t-1;this.space<n+t+r;){var s=this.bb.capacity();this.bb=T.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)},T.Builder.prototype.pad=function(t){for(var r=0;r<t;r++)this.bb.writeInt8(--this.space,0)},T.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},T.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},T.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},T.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},T.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},T.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},T.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},T.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},T.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},T.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},T.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},T.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},T.Builder.prototype.addFieldInt8=function(t,r,n){(this.force_defaults||r!=n)&&(this.addInt8(r),this.slot(t))},T.Builder.prototype.addFieldInt16=function(t,r,n){(this.force_defaults||r!=n)&&(this.addInt16(r),this.slot(t))},T.Builder.prototype.addFieldInt32=function(t,r,n){(this.force_defaults||r!=n)&&(this.addInt32(r),this.slot(t))},T.Builder.prototype.addFieldInt64=function(t,r,n){(this.force_defaults||!r.equals(n))&&(this.addInt64(r),this.slot(t))},T.Builder.prototype.addFieldFloat32=function(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat32(r),this.slot(t))},T.Builder.prototype.addFieldFloat64=function(t,r,n){(this.force_defaults||r!=n)&&(this.addFloat64(r),this.slot(t))},T.Builder.prototype.addFieldOffset=function(t,r,n){(this.force_defaults||r!=n)&&(this.addOffset(r),this.slot(t))},T.Builder.prototype.addFieldStruct=function(t,r,n){r!=n&&(this.nested(r),this.slot(t))},T.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},T.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},T.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},T.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},T.Builder.growByteBuffer=function(t){var r=t.capacity();if(r&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=r<<1,s=T.ByteBuffer.allocate(n);return s.setPosition(n-r),s.bytes().set(t.bytes(),n-r),s},T.Builder.prototype.addOffset=function(t){this.prep(T.SIZEOF_INT,0),this.writeInt32(this.offset()-t+T.SIZEOF_INT)},T.Builder.prototype.startObject=function(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(var r=0;r<t;r++)this.vtable[r]=0;this.isNested=!0,this.object_start=this.offset()},T.Builder.prototype.endObject=function(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),r=this.vtable_in_use-1;r>=0&&this.vtable[r]==0;r--);for(var n=r+1;r>=0;r--)this.addInt16(this.vtable[r]!=0?t-this.vtable[r]:0);var s=2;this.addInt16(t-this.object_start);var p=(n+s)*T.SIZEOF_SHORT;this.addInt16(p);var l=0,c=this.space;t:for(r=0;r<this.vtables.length;r++){var o=this.bb.capacity()-this.vtables[r];if(p==this.bb.readInt16(o)){for(var a=T.SIZEOF_SHORT;a<p;a+=T.SIZEOF_SHORT)if(this.bb.readInt16(c+a)!=this.bb.readInt16(o+a))continue t;l=this.vtables[r];break}}return l?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,l-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},T.Builder.prototype.finish=function(t,r,n){var s=n?T.SIZE_PREFIX_LENGTH:0;if(r){var p=r;if(this.prep(this.minalign,T.SIZEOF_INT+T.FILE_IDENTIFIER_LENGTH+s),p.length!=T.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+T.FILE_IDENTIFIER_LENGTH);for(var l=T.FILE_IDENTIFIER_LENGTH-1;l>=0;l--)this.writeInt8(p.charCodeAt(l))}this.prep(this.minalign,T.SIZEOF_INT+s),this.addOffset(t),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},T.Builder.prototype.finishSizePrefixed=function(t,r){this.finish(t,r,!0)},T.Builder.prototype.requiredField=function(t,r){var n=this.bb.capacity()-t,s=n-this.bb.readInt32(n),p=this.bb.readInt16(s+r)!=0;if(!p)throw new Error("FlatBuffers: field "+r+" must be set")},T.Builder.prototype.startVector=function(t,r,n){this.notNested(),this.vector_num_elems=r,this.prep(T.SIZEOF_INT,t*r),this.prep(n,t*r)},T.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},T.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var r=t;else for(var r=[],n=0;n<t.length;){var s,p=t.charCodeAt(n++);if(p<55296||p>=56320)s=p;else{var l=t.charCodeAt(n++);s=(p<<10)+l+-56613888}s<128?r.push(s):(s<2048?r.push(s>>6&31|192):(s<65536?r.push(s>>12&15|224):r.push(s>>18&7|240,s>>12&63|128),r.push(s>>6&63|128)),r.push(s&63|128))}this.addInt8(0),this.startVector(1,r.length,1),this.bb.setPosition(this.space-=r.length);for(var n=0,c=this.space,o=this.bb.bytes();n<r.length;n++)o[c++]=r[n];return this.endVector()},T.Builder.prototype.createLong=function(t,r){return T.Long.create(t,r)},T.ByteBuffer=function(t){this.bytes_=t,this.position_=0},T.ByteBuffer.allocate=function(t){return new T.ByteBuffer(new Uint8Array(t))},T.ByteBuffer.prototype.clear=function(){this.position_=0},T.ByteBuffer.prototype.bytes=function(){return this.bytes_},T.ByteBuffer.prototype.position=function(){return this.position_},T.ByteBuffer.prototype.setPosition=function(t){this.position_=t},T.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},T.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},T.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},T.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},T.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},T.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},T.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},T.ByteBuffer.prototype.readInt64=function(t){return new T.Long(this.readInt32(t),this.readInt32(t+4))},T.ByteBuffer.prototype.readUint64=function(t){return new T.Long(this.readUint32(t),this.readUint32(t+4))},T.ByteBuffer.prototype.readFloat32=function(t){return T.int32[0]=this.readInt32(t),T.float32[0]},T.ByteBuffer.prototype.readFloat64=function(t){return T.int32[T.isLittleEndian?0:1]=this.readInt32(t),T.int32[T.isLittleEndian?1:0]=this.readInt32(t+4),T.float64[0]},T.ByteBuffer.prototype.writeInt8=function(t,r){this.bytes_[t]=r},T.ByteBuffer.prototype.writeUint8=function(t,r){this.bytes_[t]=r},T.ByteBuffer.prototype.writeInt16=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8},T.ByteBuffer.prototype.writeUint16=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8},T.ByteBuffer.prototype.writeInt32=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24},T.ByteBuffer.prototype.writeUint32=function(t,r){this.bytes_[t]=r,this.bytes_[t+1]=r>>8,this.bytes_[t+2]=r>>16,this.bytes_[t+3]=r>>24},T.ByteBuffer.prototype.writeInt64=function(t,r){this.writeInt32(t,r.low),this.writeInt32(t+4,r.high)},T.ByteBuffer.prototype.writeUint64=function(t,r){this.writeUint32(t,r.low),this.writeUint32(t+4,r.high)},T.ByteBuffer.prototype.writeFloat32=function(t,r){T.float32[0]=r,this.writeInt32(t,T.int32[0])},T.ByteBuffer.prototype.writeFloat64=function(t,r){T.float64[0]=r,this.writeInt32(t,T.int32[T.isLittleEndian?0:1]),this.writeInt32(t+4,T.int32[T.isLittleEndian?1:0])},T.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+T.SIZEOF_INT+T.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",r=0;r<T.FILE_IDENTIFIER_LENGTH;r++)t+=String.fromCharCode(this.readInt8(this.position_+T.SIZEOF_INT+r));return t},T.ByteBuffer.prototype.__offset=function(t,r){var n=t-this.readInt32(t);return r<this.readInt16(n)?this.readInt16(n+r):0},T.ByteBuffer.prototype.__union=function(t,r){return t.bb_pos=r+this.readInt32(r),t.bb=this,t},T.ByteBuffer.prototype.__string=function(t,r){t+=this.readInt32(t);var n=this.readInt32(t),s="",p=0;if(t+=T.SIZEOF_INT,r===T.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+n);for(;p<n;){var l,c=this.readUint8(t+p++);if(c<192)l=c;else{var o=this.readUint8(t+p++);if(c<224)l=(c&31)<<6|o&63;else{var a=this.readUint8(t+p++);if(c<240)l=(c&15)<<12|(o&63)<<6|a&63;else{var e=this.readUint8(t+p++);l=(c&7)<<18|(o&63)<<12|(a&63)<<6|e&63}}}l<65536?s+=String.fromCharCode(l):(l-=65536,s+=String.fromCharCode((l>>10)+55296,(l&1023)+56320))}return s},T.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},T.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+T.SIZEOF_INT},T.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},T.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=T.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+T.FILE_IDENTIFIER_LENGTH);for(var r=0;r<T.FILE_IDENTIFIER_LENGTH;r++)if(t.charCodeAt(r)!=this.readInt8(this.position_+T.SIZEOF_INT+r))return!1;return!0},T.ByteBuffer.prototype.createLong=function(t,r){return T.Long.create(t,r)}}),H,Zr=I(()=>{"use strict";Ho(),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.UNDEFINED=0]="UNDEFINED",c[c.FLOAT=1]="FLOAT",c[c.INT=2]="INT",c[c.STRING=3]="STRING",c[c.TENSOR=4]="TENSOR",c[c.GRAPH=5]="GRAPH",c[c.FLOATS=6]="FLOATS",c[c.INTS=7]="INTS",c[c.STRINGS=8]="STRINGS",c[c.TENSORS=9]="TENSORS",c[c.GRAPHS=10]="GRAPHS",c[c.SPARSE_TENSOR=11]="SPARSE_TENSOR",c[c.SPARSE_TENSORS=12]="SPARSE_TENSORS"))(l=p.AttributeType||(p.AttributeType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.UNKNOWN=0]="UNKNOWN",c[c.VALUE=1]="VALUE",c[c.PARAM=2]="PARAM"))(l=p.DimensionValueType||(p.DimensionValueType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.UNDEFINED=0]="UNDEFINED",c[c.FLOAT=1]="FLOAT",c[c.UINT8=2]="UINT8",c[c.INT8=3]="INT8",c[c.UINT16=4]="UINT16",c[c.INT16=5]="INT16",c[c.INT32=6]="INT32",c[c.INT64=7]="INT64",c[c.STRING=8]="STRING",c[c.BOOL=9]="BOOL",c[c.FLOAT16=10]="FLOAT16",c[c.DOUBLE=11]="DOUBLE",c[c.UINT32=12]="UINT32",c[c.UINT64=13]="UINT64",c[c.COMPLEX64=14]="COMPLEX64",c[c.COMPLEX128=15]="COMPLEX128",c[c.BFLOAT16=16]="BFLOAT16",c[c.FLOAT8E4M3FN=17]="FLOAT8E4M3FN",c[c.FLOAT8E4M3FNUZ=18]="FLOAT8E4M3FNUZ",c[c.FLOAT8E5M2=19]="FLOAT8E5M2",c[c.FLOAT8E5M2FNUZ=20]="FLOAT8E5M2FNUZ"))(l=p.TensorDataType||(p.TensorDataType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.Primitive=0]="Primitive",c[c.Fused=1]="Fused"))(l=p.NodeType||(p.NodeType={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{let l;(c=>(c[c.NONE=0]="NONE",c[c.tensor_type=1]="tensor_type",c[c.sequence_type=2]="sequence_type",c[c.map_type=3]="map_type"))(l=p.TypeInfoValue||(p.TypeInfoValue={}))})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsShape(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsShape(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}dim(o,a){let e=this.bb.__offset(this.bb_pos,4);return e?(a||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}dimLength(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__vector_len(this.bb_pos+o):0}static startShape(o){o.startObject(1)}static addDim(o,a){o.addFieldOffset(0,a,0)}static createDimVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startDimVector(o,a){o.startVector(4,a,4)}static endShape(o){return o.endObject()}static createShape(o,a){return l.startShape(o),l.addDim(o,a),l.endShape(o)}}p.Shape=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsDimension(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsDimension(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}value(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}denotation(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}static startDimension(o){o.startObject(2)}static addValue(o,a){o.addFieldOffset(0,a,0)}static addDenotation(o,a){o.addFieldOffset(1,a,0)}static endDimension(o){return o.endObject()}static createDimension(o,a,e){return l.startDimension(o),l.addValue(o,a),l.addDenotation(o,e),l.endDimension(o)}}p.Dimension=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsDimensionValue(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsDimensionValue(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}dimType(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt8(this.bb_pos+o):0}dimValue(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}dimParam(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,o):null}static startDimensionValue(o){o.startObject(3)}static addDimType(o,a){o.addFieldInt8(0,a,0)}static addDimValue(o,a){o.addFieldInt64(1,a,o.createLong(0,0))}static addDimParam(o,a){o.addFieldOffset(2,a,0)}static endDimensionValue(o){return o.endObject()}static createDimensionValue(o,a,e,u){return l.startDimensionValue(o),l.addDimType(o,a),l.addDimValue(o,e),l.addDimParam(o,u),l.endDimensionValue(o)}}p.DimensionValue=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsTensorTypeAndShape(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsTensorTypeAndShape(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}elemType(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt32(this.bb_pos+o):0}shape(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startTensorTypeAndShape(o){o.startObject(2)}static addElemType(o,a){o.addFieldInt32(0,a,0)}static addShape(o,a){o.addFieldOffset(1,a,0)}static endTensorTypeAndShape(o){return o.endObject()}static createTensorTypeAndShape(o,a,e){return l.startTensorTypeAndShape(o),l.addElemType(o,a),l.addShape(o,e),l.endTensorTypeAndShape(o)}}p.TensorTypeAndShape=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsMapType(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsMapType(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}keyType(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt32(this.bb_pos+o):0}valueType(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startMapType(o){o.startObject(2)}static addKeyType(o,a){o.addFieldInt32(0,a,0)}static addValueType(o,a){o.addFieldOffset(1,a,0)}static endMapType(o){return o.endObject()}static createMapType(o,a,e){return l.startMapType(o),l.addKeyType(o,a),l.addValueType(o,e),l.endMapType(o)}}p.MapType=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSequenceType(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSequenceType(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}elemType(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startSequenceType(o){o.startObject(1)}static addElemType(o,a){o.addFieldOffset(0,a,0)}static endSequenceType(o){return o.endObject()}static createSequenceType(o,a){return l.startSequenceType(o),l.addElemType(o,a),l.endSequenceType(o)}}p.SequenceType=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,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(o,a,e,u){return o.prep(4,12),o.writeInt32(u),o.writeInt32(e),o.writeInt32(a),o.offset()}}p.EdgeEnd=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsNodeEdge(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsNodeEdge(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}nodeIndex(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readUint32(this.bb_pos+o):0}inputEdges(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+e)+o*12,this.bb):null}inputEdgesLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}outputEdges(o,a){let e=this.bb.__offset(this.bb_pos,8);return e?(a||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+e)+o*12,this.bb):null}outputEdgesLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}static startNodeEdge(o){o.startObject(3)}static addNodeIndex(o,a){o.addFieldInt32(0,a,0)}static addInputEdges(o,a){o.addFieldOffset(1,a,0)}static startInputEdgesVector(o,a){o.startVector(12,a,4)}static addOutputEdges(o,a){o.addFieldOffset(2,a,0)}static startOutputEdgesVector(o,a){o.startVector(12,a,4)}static endNodeEdge(o){return o.endObject()}static createNodeEdge(o,a,e,u){return l.startNodeEdge(o),l.addNodeIndex(o,a),l.addInputEdges(o,e),l.addOutputEdges(o,u),l.endNodeEdge(o)}}p.NodeEdge=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsNode(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsNode(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}domain(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,o):null}sinceVersion(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readInt32(this.bb_pos+o):0}index(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.readUint32(this.bb_pos+o):0}opType(o){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__string(this.bb_pos+a,o):null}type(){let o=this.bb.__offset(this.bb_pos,16);return o?this.bb.readInt32(this.bb_pos+o):0}executionProviderType(o){let a=this.bb.__offset(this.bb_pos,18);return a?this.bb.__string(this.bb_pos+a,o):null}inputs(o,a){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}inputsLength(){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.__vector_len(this.bb_pos+o):0}outputs(o,a){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}outputsLength(){let o=this.bb.__offset(this.bb_pos,22);return o?this.bb.__vector_len(this.bb_pos+o):0}attributes(o,a){let e=this.bb.__offset(this.bb_pos,24);return e?(a||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}attributesLength(){let o=this.bb.__offset(this.bb_pos,24);return o?this.bb.__vector_len(this.bb_pos+o):0}inputArgCounts(o){let a=this.bb.__offset(this.bb_pos,26);return a?this.bb.readInt32(this.bb.__vector(this.bb_pos+a)+o*4):0}inputArgCountsLength(){let o=this.bb.__offset(this.bb_pos,26);return o?this.bb.__vector_len(this.bb_pos+o):0}inputArgCountsArray(){let o=this.bb.__offset(this.bb_pos,26);return o?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}implicitInputs(o,a){let e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}implicitInputsLength(){let o=this.bb.__offset(this.bb_pos,28);return o?this.bb.__vector_len(this.bb_pos+o):0}static startNode(o){o.startObject(13)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addDomain(o,a){o.addFieldOffset(2,a,0)}static addSinceVersion(o,a){o.addFieldInt32(3,a,0)}static addIndex(o,a){o.addFieldInt32(4,a,0)}static addOpType(o,a){o.addFieldOffset(5,a,0)}static addType(o,a){o.addFieldInt32(6,a,0)}static addExecutionProviderType(o,a){o.addFieldOffset(7,a,0)}static addInputs(o,a){o.addFieldOffset(8,a,0)}static createInputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startInputsVector(o,a){o.startVector(4,a,4)}static addOutputs(o,a){o.addFieldOffset(9,a,0)}static createOutputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startOutputsVector(o,a){o.startVector(4,a,4)}static addAttributes(o,a){o.addFieldOffset(10,a,0)}static createAttributesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startAttributesVector(o,a){o.startVector(4,a,4)}static addInputArgCounts(o,a){o.addFieldOffset(11,a,0)}static createInputArgCountsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addInt32(a[e]);return o.endVector()}static startInputArgCountsVector(o,a){o.startVector(4,a,4)}static addImplicitInputs(o,a){o.addFieldOffset(12,a,0)}static createImplicitInputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startImplicitInputsVector(o,a){o.startVector(4,a,4)}static endNode(o){return o.endObject()}static createNode(o,a,e,u,i,d,h,m,b,x,E,w,S,$){return l.startNode(o),l.addName(o,a),l.addDocString(o,e),l.addDomain(o,u),l.addSinceVersion(o,i),l.addIndex(o,d),l.addOpType(o,h),l.addType(o,m),l.addExecutionProviderType(o,b),l.addInputs(o,x),l.addOutputs(o,E),l.addAttributes(o,w),l.addInputArgCounts(o,S),l.addImplicitInputs(o,$),l.endNode(o)}}p.Node=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsValueInfo(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsValueInfo(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}type(o){let a=this.bb.__offset(this.bb_pos,8);return a?(o||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startValueInfo(o){o.startObject(3)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addType(o,a){o.addFieldOffset(2,a,0)}static endValueInfo(o){return o.endObject()}static createValueInfo(o,a,e,u){return l.startValueInfo(o),l.addName(o,a),l.addDocString(o,e),l.addType(o,u),l.endValueInfo(o)}}p.ValueInfo=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsTypeInfo(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsTypeInfo(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}denotation(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}valueType(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readUint8(this.bb_pos+o):0}value(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__union(o,this.bb_pos+a):null}static startTypeInfo(o){o.startObject(3)}static addDenotation(o,a){o.addFieldOffset(0,a,0)}static addValueType(o,a){o.addFieldInt8(1,a,0)}static addValue(o,a){o.addFieldOffset(2,a,0)}static endTypeInfo(o){return o.endObject()}static createTypeInfo(o,a,e,u){return l.startTypeInfo(o),l.addDenotation(o,a),l.addValueType(o,e),l.addValue(o,u),l.endTypeInfo(o)}}p.TypeInfo=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsOperatorSetId(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsOperatorSetId(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}domain(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}version(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}static startOperatorSetId(o){o.startObject(2)}static addDomain(o,a){o.addFieldOffset(0,a,0)}static addVersion(o,a){o.addFieldInt64(1,a,o.createLong(0,0))}static endOperatorSetId(o){return o.endObject()}static createOperatorSetId(o,a,e){return l.startOperatorSetId(o),l.addDomain(o,a),l.addVersion(o,e),l.endOperatorSetId(o)}}p.OperatorSetId=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsTensor(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsTensor(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}dims(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}dimsLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}dataType(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readInt32(this.bb_pos+o):0}rawData(o){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.readUint8(this.bb.__vector(this.bb_pos+a)+o):0}rawDataLength(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.__vector_len(this.bb_pos+o):0}rawDataArray(){let o=this.bb.__offset(this.bb_pos,12);return o?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}stringData(o,a){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}stringDataLength(){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__vector_len(this.bb_pos+o):0}static startTensor(o){o.startObject(6)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addDims(o,a){o.addFieldOffset(2,a,0)}static createDimsVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startDimsVector(o,a){o.startVector(8,a,8)}static addDataType(o,a){o.addFieldInt32(3,a,0)}static addRawData(o,a){o.addFieldOffset(4,a,0)}static createRawDataVector(o,a){o.startVector(1,a.length,1);for(let e=a.length-1;e>=0;e--)o.addInt8(a[e]);return o.endVector()}static startRawDataVector(o,a){o.startVector(1,a,1)}static addStringData(o,a){o.addFieldOffset(5,a,0)}static createStringDataVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startStringDataVector(o,a){o.startVector(4,a,4)}static endTensor(o){return o.endObject()}static createTensor(o,a,e,u,i,d,h){return l.startTensor(o),l.addName(o,a),l.addDocString(o,e),l.addDims(o,u),l.addDataType(o,i),l.addRawData(o,d),l.addStringData(o,h),l.endTensor(o)}}p.Tensor=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSparseTensor(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSparseTensor(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}values(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}indices(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}dims(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}dimsLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}static startSparseTensor(o){o.startObject(3)}static addValues(o,a){o.addFieldOffset(0,a,0)}static addIndices(o,a){o.addFieldOffset(1,a,0)}static addDims(o,a){o.addFieldOffset(2,a,0)}static createDimsVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startDimsVector(o,a){o.startVector(8,a,8)}static endSparseTensor(o){return o.endObject()}static createSparseTensor(o,a,e,u){return l.startSparseTensor(o),l.addValues(o,a),l.addIndices(o,e),l.addDims(o,u),l.endSparseTensor(o)}}p.SparseTensor=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsAttribute(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsAttribute(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}name(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}docString(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.__string(this.bb_pos+a,o):null}type(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.readInt32(this.bb_pos+o):0}f(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readFloat32(this.bb_pos+o):0}i(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}s(o){let a=this.bb.__offset(this.bb_pos,14);return a?this.bb.__string(this.bb_pos+a,o):null}t(o){let a=this.bb.__offset(this.bb_pos,16);return a?(o||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}g(o){let a=this.bb.__offset(this.bb_pos,18);return a?(o||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}floats(o){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.readFloat32(this.bb.__vector(this.bb_pos+a)+o*4):0}floatsLength(){let o=this.bb.__offset(this.bb_pos,20);return o?this.bb.__vector_len(this.bb_pos+o):0}floatsArray(){let o=this.bb.__offset(this.bb_pos,20);return o?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}ints(o){let a=this.bb.__offset(this.bb_pos,22);return a?this.bb.readInt64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}intsLength(){let o=this.bb.__offset(this.bb_pos,22);return o?this.bb.__vector_len(this.bb_pos+o):0}strings(o,a){let e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}stringsLength(){let o=this.bb.__offset(this.bb_pos,24);return o?this.bb.__vector_len(this.bb_pos+o):0}tensors(o,a){let e=this.bb.__offset(this.bb_pos,26);return e?(a||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}tensorsLength(){let o=this.bb.__offset(this.bb_pos,26);return o?this.bb.__vector_len(this.bb_pos+o):0}graphs(o,a){let e=this.bb.__offset(this.bb_pos,28);return e?(a||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}graphsLength(){let o=this.bb.__offset(this.bb_pos,28);return o?this.bb.__vector_len(this.bb_pos+o):0}static startAttribute(o){o.startObject(13)}static addName(o,a){o.addFieldOffset(0,a,0)}static addDocString(o,a){o.addFieldOffset(1,a,0)}static addType(o,a){o.addFieldInt32(2,a,0)}static addF(o,a){o.addFieldFloat32(3,a,0)}static addI(o,a){o.addFieldInt64(4,a,o.createLong(0,0))}static addS(o,a){o.addFieldOffset(5,a,0)}static addT(o,a){o.addFieldOffset(6,a,0)}static addG(o,a){o.addFieldOffset(7,a,0)}static addFloats(o,a){o.addFieldOffset(8,a,0)}static createFloatsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addFloat32(a[e]);return o.endVector()}static startFloatsVector(o,a){o.startVector(4,a,4)}static addInts(o,a){o.addFieldOffset(9,a,0)}static createIntsVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startIntsVector(o,a){o.startVector(8,a,8)}static addStrings(o,a){o.addFieldOffset(10,a,0)}static createStringsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startStringsVector(o,a){o.startVector(4,a,4)}static addTensors(o,a){o.addFieldOffset(11,a,0)}static createTensorsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startTensorsVector(o,a){o.startVector(4,a,4)}static addGraphs(o,a){o.addFieldOffset(12,a,0)}static createGraphsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startGraphsVector(o,a){o.startVector(4,a,4)}static endAttribute(o){return o.endObject()}static createAttribute(o,a,e,u,i,d,h,m,b,x,E,w,S,$){return l.startAttribute(o),l.addName(o,a),l.addDocString(o,e),l.addType(o,u),l.addF(o,i),l.addI(o,d),l.addS(o,h),l.addT(o,m),l.addG(o,b),l.addFloats(o,x),l.addInts(o,E),l.addStrings(o,w),l.addTensors(o,S),l.addGraphs(o,$),l.endAttribute(o)}}p.Attribute=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsGraph(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsGraph(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}initializers(o,a){let e=this.bb.__offset(this.bb_pos,4);return e?(a||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}initializersLength(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__vector_len(this.bb_pos+o):0}nodeArgs(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}nodeArgsLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}nodes(o,a){let e=this.bb.__offset(this.bb_pos,8);return e?(a||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}nodesLength(){let o=this.bb.__offset(this.bb_pos,8);return o?this.bb.__vector_len(this.bb_pos+o):0}maxNodeIndex(){let o=this.bb.__offset(this.bb_pos,10);return o?this.bb.readUint32(this.bb_pos+o):0}nodeEdges(o,a){let e=this.bb.__offset(this.bb_pos,12);return e?(a||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}nodeEdgesLength(){let o=this.bb.__offset(this.bb_pos,12);return o?this.bb.__vector_len(this.bb_pos+o):0}inputs(o,a){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}inputsLength(){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.__vector_len(this.bb_pos+o):0}outputs(o,a){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb.__vector(this.bb_pos+e)+o*4,a):null}outputsLength(){let o=this.bb.__offset(this.bb_pos,16);return o?this.bb.__vector_len(this.bb_pos+o):0}sparseInitializers(o,a){let e=this.bb.__offset(this.bb_pos,18);return e?(a||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}sparseInitializersLength(){let o=this.bb.__offset(this.bb_pos,18);return o?this.bb.__vector_len(this.bb_pos+o):0}static startGraph(o){o.startObject(8)}static addInitializers(o,a){o.addFieldOffset(0,a,0)}static createInitializersVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startInitializersVector(o,a){o.startVector(4,a,4)}static addNodeArgs(o,a){o.addFieldOffset(1,a,0)}static createNodeArgsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startNodeArgsVector(o,a){o.startVector(4,a,4)}static addNodes(o,a){o.addFieldOffset(2,a,0)}static createNodesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startNodesVector(o,a){o.startVector(4,a,4)}static addMaxNodeIndex(o,a){o.addFieldInt32(3,a,0)}static addNodeEdges(o,a){o.addFieldOffset(4,a,0)}static createNodeEdgesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startNodeEdgesVector(o,a){o.startVector(4,a,4)}static addInputs(o,a){o.addFieldOffset(5,a,0)}static createInputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startInputsVector(o,a){o.startVector(4,a,4)}static addOutputs(o,a){o.addFieldOffset(6,a,0)}static createOutputsVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startOutputsVector(o,a){o.startVector(4,a,4)}static addSparseInitializers(o,a){o.addFieldOffset(7,a,0)}static createSparseInitializersVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startSparseInitializersVector(o,a){o.startVector(4,a,4)}static endGraph(o){return o.endObject()}static createGraph(o,a,e,u,i,d,h,m,b){return l.startGraph(o),l.addInitializers(o,a),l.addNodeArgs(o,e),l.addNodes(o,u),l.addMaxNodeIndex(o,i),l.addNodeEdges(o,d),l.addInputs(o,h),l.addOutputs(o,m),l.addSparseInitializers(o,b),l.endGraph(o)}}p.Graph=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsModel(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsModel(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}irVersion(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}opsetImport(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}opsetImportLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}producerName(o){let a=this.bb.__offset(this.bb_pos,8);return a?this.bb.__string(this.bb_pos+a,o):null}producerVersion(o){let a=this.bb.__offset(this.bb_pos,10);return a?this.bb.__string(this.bb_pos+a,o):null}domain(o){let a=this.bb.__offset(this.bb_pos,12);return a?this.bb.__string(this.bb_pos+a,o):null}modelVersion(){let o=this.bb.__offset(this.bb_pos,14);return o?this.bb.readInt64(this.bb_pos+o):this.bb.createLong(0,0)}docString(o){let a=this.bb.__offset(this.bb_pos,16);return a?this.bb.__string(this.bb_pos+a,o):null}graph(o){let a=this.bb.__offset(this.bb_pos,18);return a?(o||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}graphDocString(o){let a=this.bb.__offset(this.bb_pos,20);return a?this.bb.__string(this.bb_pos+a,o):null}static startModel(o){o.startObject(9)}static addIrVersion(o,a){o.addFieldInt64(0,a,o.createLong(0,0))}static addOpsetImport(o,a){o.addFieldOffset(1,a,0)}static createOpsetImportVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startOpsetImportVector(o,a){o.startVector(4,a,4)}static addProducerName(o,a){o.addFieldOffset(2,a,0)}static addProducerVersion(o,a){o.addFieldOffset(3,a,0)}static addDomain(o,a){o.addFieldOffset(4,a,0)}static addModelVersion(o,a){o.addFieldInt64(5,a,o.createLong(0,0))}static addDocString(o,a){o.addFieldOffset(6,a,0)}static addGraph(o,a){o.addFieldOffset(7,a,0)}static addGraphDocString(o,a){o.addFieldOffset(8,a,0)}static endModel(o){return o.endObject()}static createModel(o,a,e,u,i,d,h,m,b,x){return l.startModel(o),l.addIrVersion(o,a),l.addOpsetImport(o,e),l.addProducerName(o,u),l.addProducerVersion(o,i),l.addDomain(o,d),l.addModelVersion(o,h),l.addDocString(o,m),l.addGraph(o,b),l.addGraphDocString(o,x),l.endModel(o)}}p.Model=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsKernelCreateInfos(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsKernelCreateInfos(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}nodeIndices(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.readUint32(this.bb.__vector(this.bb_pos+a)+o*4):0}nodeIndicesLength(){let o=this.bb.__offset(this.bb_pos,4);return o?this.bb.__vector_len(this.bb_pos+o):0}nodeIndicesArray(){let o=this.bb.__offset(this.bb_pos,4);return o?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+o),this.bb.__vector_len(this.bb_pos+o)):null}kernelDefHashes(o){let a=this.bb.__offset(this.bb_pos,6);return a?this.bb.readUint64(this.bb.__vector(this.bb_pos+a)+o*8):this.bb.createLong(0,0)}kernelDefHashesLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}static startKernelCreateInfos(o){o.startObject(2)}static addNodeIndices(o,a){o.addFieldOffset(0,a,0)}static createNodeIndicesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addInt32(a[e]);return o.endVector()}static startNodeIndicesVector(o,a){o.startVector(4,a,4)}static addKernelDefHashes(o,a){o.addFieldOffset(1,a,0)}static createKernelDefHashesVector(o,a){o.startVector(8,a.length,8);for(let e=a.length-1;e>=0;e--)o.addInt64(a[e]);return o.endVector()}static startKernelDefHashesVector(o,a){o.startVector(8,a,8)}static endKernelCreateInfos(o){return o.endObject()}static createKernelCreateInfos(o,a,e){return l.startKernelCreateInfos(o),l.addNodeIndices(o,a),l.addKernelDefHashes(o,e),l.endKernelCreateInfos(o)}}p.KernelCreateInfos=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSubGraphSessionState(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSubGraphSessionState(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}graphId(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}sessionState(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startSubGraphSessionState(o){o.startObject(2)}static addGraphId(o,a){o.addFieldOffset(0,a,0)}static addSessionState(o,a){o.addFieldOffset(1,a,0)}static endSubGraphSessionState(o){let a=o.endObject();return o.requiredField(a,4),a}static createSubGraphSessionState(o,a,e){return l.startSubGraphSessionState(o),l.addGraphId(o,a),l.addSessionState(o,e),l.endSubGraphSessionState(o)}}p.SubGraphSessionState=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsSessionState(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsSessionState(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}kernels(o){let a=this.bb.__offset(this.bb_pos,4);return a?(o||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}subGraphSessionStates(o,a){let e=this.bb.__offset(this.bb_pos,6);return e?(a||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+e)+o*4),this.bb):null}subGraphSessionStatesLength(){let o=this.bb.__offset(this.bb_pos,6);return o?this.bb.__vector_len(this.bb_pos+o):0}static startSessionState(o){o.startObject(2)}static addKernels(o,a){o.addFieldOffset(0,a,0)}static addSubGraphSessionStates(o,a){o.addFieldOffset(1,a,0)}static createSubGraphSessionStatesVector(o,a){o.startVector(4,a.length,4);for(let e=a.length-1;e>=0;e--)o.addOffset(a[e]);return o.endVector()}static startSubGraphSessionStatesVector(o,a){o.startVector(4,a,4)}static endSessionState(o){return o.endObject()}static createSessionState(o,a,e){return l.startSessionState(o),l.addKernels(o,a),l.addSubGraphSessionStates(o,e),l.endSessionState(o)}}p.SessionState=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={})),(t=>{let r;(n=>{let s;(p=>{class l{constructor(){this.bb=null,this.bb_pos=0}__init(o,a){return this.bb_pos=o,this.bb=a,this}static getRootAsInferenceSession(o,a){return(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static getSizePrefixedRootAsInferenceSession(o,a){return o.setPosition(o.position()+T.SIZE_PREFIX_LENGTH),(a||new l).__init(o.readInt32(o.position())+o.position(),o)}static bufferHasIdentifier(o){return o.__has_identifier("ORTM")}ortVersion(o){let a=this.bb.__offset(this.bb_pos,4);return a?this.bb.__string(this.bb_pos+a,o):null}model(o){let a=this.bb.__offset(this.bb_pos,6);return a?(o||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}sessionState(o){let a=this.bb.__offset(this.bb_pos,8);return a?(o||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+a),this.bb):null}static startInferenceSession(o){o.startObject(3)}static addOrtVersion(o,a){o.addFieldOffset(0,a,0)}static addModel(o,a){o.addFieldOffset(1,a,0)}static addSessionState(o,a){o.addFieldOffset(2,a,0)}static endInferenceSession(o){return o.endObject()}static finishInferenceSessionBuffer(o,a){o.finish(a,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(o,a){o.finish(a,"ORTM",!0)}static createInferenceSession(o,a,e,u){return l.startInferenceSession(o),l.addOrtVersion(o,a),l.addModel(o,e),l.addSessionState(o,u),l.endInferenceSession(o)}}p.InferenceSession=l})(s=n.fbs||(n.fbs={}))})(r=t.experimental||(t.experimental={}))})(H||(H={}))}),Ch=nt((t,r)=>{"use strict";r.exports=n;function n(s,p){for(var l=new Array(arguments.length-1),c=0,o=2,a=!0;o<arguments.length;)l[c++]=arguments[o++];return new Promise(function(e,u){l[c]=function(i){if(a)if(a=!1,i)u(i);else{for(var d=new Array(arguments.length-1),h=0;h<d.length;)d[h++]=arguments[h];e.apply(null,d)}};try{s.apply(p||null,l)}catch(i){a&&(a=!1,u(i))}})}}),Lh=nt(t=>{"use strict";var r=t;r.length=function(c){var o=c.length;if(!o)return 0;for(var a=0;--o%4>1&&c.charAt(o)==="=";)++a;return Math.ceil(c.length*3)/4-a};var n=new Array(64),s=new Array(123);for(p=0;p<64;)s[n[p]=p<26?p+65:p<52?p+71:p<62?p-4:p-59|43]=p++;var p;r.encode=function(c,o,a){for(var e=null,u=[],i=0,d=0,h;o<a;){var m=c[o++];switch(d){case 0:u[i++]=n[m>>2],h=(m&3)<<4,d=1;break;case 1:u[i++]=n[h|m>>4],h=(m&15)<<2,d=2;break;case 2:u[i++]=n[h|m>>6],u[i++]=n[m&63],d=0;break}i>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,u)),i=0)}return d&&(u[i++]=n[h],u[i++]=61,d===1&&(u[i++]=61)),e?(i&&e.push(String.fromCharCode.apply(String,u.slice(0,i))),e.join("")):String.fromCharCode.apply(String,u.slice(0,i))};var l="invalid encoding";r.decode=function(c,o,a){for(var e=a,u=0,i,d=0;d<c.length;){var h=c.charCodeAt(d++);if(h===61&&u>1)break;if((h=s[h])===void 0)throw Error(l);switch(u){case 0:i=h,u=1;break;case 1:o[a++]=i<<2|(h&48)>>4,i=h,u=2;break;case 2:o[a++]=(i&15)<<4|(h&60)>>2,i=h,u=3;break;case 3:o[a++]=(i&3)<<6|h,u=0;break}}if(u===1)throw Error(l);return a-e},r.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}),Rh=nt((t,r)=>{"use strict";r.exports=n;function n(){this._listeners={}}n.prototype.on=function(s,p,l){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:p,ctx:l||this}),this},n.prototype.off=function(s,p){if(s===void 0)this._listeners={};else if(p===void 0)this._listeners[s]=[];else for(var l=this._listeners[s],c=0;c<l.length;)l[c].fn===p?l.splice(c,1):++c;return this},n.prototype.emit=function(s){var p=this._listeners[s];if(p){for(var l=[],c=1;c<arguments.length;)l.push(arguments[c++]);for(c=0;c<p.length;)p[c].fn.apply(p[c++].ctx,l)}return this}}),jh=nt((t,r)=>{"use strict";r.exports=n(n);function n(o){return typeof Float32Array<"u"?(function(){var a=new Float32Array([-0]),e=new Uint8Array(a.buffer),u=e[3]===128;function i(b,x,E){a[0]=b,x[E]=e[0],x[E+1]=e[1],x[E+2]=e[2],x[E+3]=e[3]}function d(b,x,E){a[0]=b,x[E]=e[3],x[E+1]=e[2],x[E+2]=e[1],x[E+3]=e[0]}o.writeFloatLE=u?i:d,o.writeFloatBE=u?d:i;function h(b,x){return e[0]=b[x],e[1]=b[x+1],e[2]=b[x+2],e[3]=b[x+3],a[0]}function m(b,x){return e[3]=b[x],e[2]=b[x+1],e[1]=b[x+2],e[0]=b[x+3],a[0]}o.readFloatLE=u?h:m,o.readFloatBE=u?m:h})():(function(){function a(u,i,d,h){var m=i<0?1:0;if(m&&(i=-i),i===0)u(1/i>0?0:2147483648,d,h);else if(isNaN(i))u(2143289344,d,h);else if(i>34028234663852886e22)u((m<<31|2139095040)>>>0,d,h);else if(i<11754943508222875e-54)u((m<<31|Math.round(i/1401298464324817e-60))>>>0,d,h);else{var b=Math.floor(Math.log(i)/Math.LN2),x=Math.round(i*Math.pow(2,-b)*8388608)&8388607;u((m<<31|b+127<<23|x)>>>0,d,h)}}o.writeFloatLE=a.bind(null,s),o.writeFloatBE=a.bind(null,p);function e(u,i,d){var h=u(i,d),m=(h>>31)*2+1,b=h>>>23&255,x=h&8388607;return b===255?x?NaN:m*(1/0):b===0?m*1401298464324817e-60*x:m*Math.pow(2,b-150)*(x+8388608)}o.readFloatLE=e.bind(null,l),o.readFloatBE=e.bind(null,c)})(),typeof Float64Array<"u"?(function(){var a=new Float64Array([-0]),e=new Uint8Array(a.buffer),u=e[7]===128;function i(b,x,E){a[0]=b,x[E]=e[0],x[E+1]=e[1],x[E+2]=e[2],x[E+3]=e[3],x[E+4]=e[4],x[E+5]=e[5],x[E+6]=e[6],x[E+7]=e[7]}function d(b,x,E){a[0]=b,x[E]=e[7],x[E+1]=e[6],x[E+2]=e[5],x[E+3]=e[4],x[E+4]=e[3],x[E+5]=e[2],x[E+6]=e[1],x[E+7]=e[0]}o.writeDoubleLE=u?i:d,o.writeDoubleBE=u?d:i;function h(b,x){return e[0]=b[x],e[1]=b[x+1],e[2]=b[x+2],e[3]=b[x+3],e[4]=b[x+4],e[5]=b[x+5],e[6]=b[x+6],e[7]=b[x+7],a[0]}function m(b,x){return e[7]=b[x],e[6]=b[x+1],e[5]=b[x+2],e[4]=b[x+3],e[3]=b[x+4],e[2]=b[x+5],e[1]=b[x+6],e[0]=b[x+7],a[0]}o.readDoubleLE=u?h:m,o.readDoubleBE=u?m:h})():(function(){function a(u,i,d,h,m,b){var x=h<0?1:0;if(x&&(h=-h),h===0)u(0,m,b+i),u(1/h>0?0:2147483648,m,b+d);else if(isNaN(h))u(0,m,b+i),u(2146959360,m,b+d);else if(h>17976931348623157e292)u(0,m,b+i),u((x<<31|2146435072)>>>0,m,b+d);else{var E;if(h<22250738585072014e-324)E=h/5e-324,u(E>>>0,m,b+i),u((x<<31|E/4294967296)>>>0,m,b+d);else{var w=Math.floor(Math.log(h)/Math.LN2);w===1024&&(w=1023),E=h*Math.pow(2,-w),u(E*4503599627370496>>>0,m,b+i),u((x<<31|w+1023<<20|E*1048576&1048575)>>>0,m,b+d)}}}o.writeDoubleLE=a.bind(null,s,0,4),o.writeDoubleBE=a.bind(null,p,4,0);function e(u,i,d,h,m){var b=u(h,m+i),x=u(h,m+d),E=(x>>31)*2+1,w=x>>>20&2047,S=4294967296*(x&1048575)+b;return w===2047?S?NaN:E*(1/0):w===0?E*5e-324*S:E*Math.pow(2,w-1075)*(S+4503599627370496)}o.readDoubleLE=e.bind(null,l,0,4),o.readDoubleBE=e.bind(null,c,4,0)})(),o}function s(o,a,e){a[e]=o&255,a[e+1]=o>>>8&255,a[e+2]=o>>>16&255,a[e+3]=o>>>24}function p(o,a,e){a[e]=o>>>24,a[e+1]=o>>>16&255,a[e+2]=o>>>8&255,a[e+3]=o&255}function l(o,a){return(o[a]|o[a+1]<<8|o[a+2]<<16|o[a+3]<<24)>>>0}function c(o,a){return(o[a]<<24|o[a+1]<<16|o[a+2]<<8|o[a+3])>>>0}}),Bh=nt((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}}),Vh=nt(t=>{"use strict";var r=t;r.length=function(n){for(var s=0,p=0,l=0;l<n.length;++l)p=n.charCodeAt(l),p<128?s+=1:p<2048?s+=2:(p&64512)===55296&&(n.charCodeAt(l+1)&64512)===56320?(++l,s+=4):s+=3;return s},r.read=function(n,s,p){var l=p-s;if(l<1)return"";for(var c=null,o=[],a=0,e;s<p;)e=n[s++],e<128?o[a++]=e:e>191&&e<224?o[a++]=(e&31)<<6|n[s++]&63:e>239&&e<365?(e=((e&7)<<18|(n[s++]&63)<<12|(n[s++]&63)<<6|n[s++]&63)-65536,o[a++]=55296+(e>>10),o[a++]=56320+(e&1023)):o[a++]=(e&15)<<12|(n[s++]&63)<<6|n[s++]&63,a>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,o)),a=0);return c?(a&&c.push(String.fromCharCode.apply(String,o.slice(0,a))),c.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(n,s,p){for(var l=p,c,o,a=0;a<n.length;++a)c=n.charCodeAt(a),c<128?s[p++]=c:c<2048?(s[p++]=c>>6|192,s[p++]=c&63|128):(c&64512)===55296&&((o=n.charCodeAt(a+1))&64512)===56320?(c=65536+((c&1023)<<10)+(o&1023),++a,s[p++]=c>>18|240,s[p++]=c>>12&63|128,s[p++]=c>>6&63|128,s[p++]=c&63|128):(s[p++]=c>>12|224,s[p++]=c>>6&63|128,s[p++]=c&63|128);return p-l}}),Mh=nt((t,r)=>{"use strict";r.exports=n;function n(s,p,l){var c=l||8192,o=c>>>1,a=null,e=c;return function(u){if(u<1||u>o)return s(u);e+u>c&&(a=s(c),e=0);var i=p.call(a,e,e+=u);return e&7&&(e=(e|7)+1),i}}}),zh=nt((t,r)=>{"use strict";r.exports=s;var n=we();function s(o,a){this.lo=o>>>0,this.hi=a>>>0}var p=s.zero=new s(0,0);p.toNumber=function(){return 0},p.zzEncode=p.zzDecode=function(){return this},p.length=function(){return 1};var l=s.zeroHash="\0\0\0\0\0\0\0\0";s.fromNumber=function(o){if(o===0)return p;var a=o<0;a&&(o=-o);var e=o>>>0,u=(o-e)/4294967296>>>0;return a&&(u=~u>>>0,e=~e>>>0,++e>4294967295&&(e=0,++u>4294967295&&(u=0))),new s(e,u)},s.from=function(o){if(typeof o=="number")return s.fromNumber(o);if(n.isString(o))if(n.Long)o=n.Long.fromString(o);else return s.fromNumber(parseInt(o,10));return o.low||o.high?new s(o.low>>>0,o.high>>>0):p},s.prototype.toNumber=function(o){if(!o&&this.hi>>>31){var a=~this.lo+1>>>0,e=~this.hi>>>0;return a||(e=e+1>>>0),-(a+e*4294967296)}return this.lo+this.hi*4294967296},s.prototype.toLong=function(o){return n.Long?new n.Long(this.lo|0,this.hi|0,!!o):{low:this.lo|0,high:this.hi|0,unsigned:!!o}};var c=String.prototype.charCodeAt;s.fromHash=function(o){return o===l?p:new s((c.call(o,0)|c.call(o,1)<<8|c.call(o,2)<<16|c.call(o,3)<<24)>>>0,(c.call(o,4)|c.call(o,5)<<8|c.call(o,6)<<16|c.call(o,7)<<24)>>>0)},s.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},s.prototype.zzEncode=function(){var o=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^o)>>>0,this.lo=(this.lo<<1^o)>>>0,this},s.prototype.zzDecode=function(){var o=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^o)>>>0,this.hi=(this.hi>>>1^o)>>>0,this},s.prototype.length=function(){var o=this.lo,a=(this.lo>>>28|this.hi<<4)>>>0,e=this.hi>>>24;return e===0?a===0?o<16384?o<128?1:2:o<2097152?3:4:a<16384?a<128?5:6:a<2097152?7:8:e<128?9:10}}),we=nt(t=>{"use strict";var r=t;r.asPromise=Ch(),r.base64=Lh(),r.EventEmitter=Rh(),r.float=jh(),r.inquire=Bh(),r.utf8=Vh(),r.pool=Mh(),r.LongBits=zh(),r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||t,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(p){return typeof p=="number"&&isFinite(p)&&Math.floor(p)===p},r.isString=function(p){return typeof p=="string"||p instanceof String},r.isObject=function(p){return p&&typeof p=="object"},r.isset=r.isSet=function(p,l){var c=p[l];return c!=null&&p.hasOwnProperty(l)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},r.Buffer=(function(){try{var p=r.inquire("buffer").Buffer;return p.prototype.utf8Write?p:null}catch{return null}})(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(p){return typeof p=="number"?r.Buffer?r._Buffer_allocUnsafe(p):new r.Array(p):r.Buffer?r._Buffer_from(p):typeof Uint8Array>"u"?p:new Uint8Array(p)},r.Array=typeof Uint8Array<"u"?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(p){return p?r.LongBits.from(p).toHash():r.LongBits.zeroHash},r.longFromHash=function(p,l){var c=r.LongBits.fromHash(p);return r.Long?r.Long.fromBits(c.lo,c.hi,l):c.toNumber(!!l)};function n(p,l,c){for(var o=Object.keys(l),a=0;a<o.length;++a)(p[o[a]]===void 0||!c)&&(p[o[a]]=l[o[a]]);return p}r.merge=n,r.lcFirst=function(p){return p.charAt(0).toLowerCase()+p.substring(1)};function s(p){function l(c,o){if(!(this instanceof l))return new l(c,o);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,l):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&n(this,o)}return l.prototype=Object.create(Error.prototype,{constructor:{value:l,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return p},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),l}r.newError=s,r.ProtocolError=s("ProtocolError"),r.oneOfGetter=function(p){for(var l={},c=0;c<p.length;++c)l[p[c]]=1;return function(){for(var o=Object.keys(this),a=o.length-1;a>-1;--a)if(l[o[a]]===1&&this[o[a]]!==void 0&&this[o[a]]!==null)return o[a]}},r.oneOfSetter=function(p){return function(l){for(var c=0;c<p.length;++c)p[c]!==l&&delete this[p[c]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var p=r.Buffer;if(!p){r._Buffer_from=r._Buffer_allocUnsafe=null;return}r._Buffer_from=p.from!==Uint8Array.from&&p.from||function(l,c){return new p(l,c)},r._Buffer_allocUnsafe=p.allocUnsafe||function(l){return new p(l)}}}),gl=nt((t,r)=>{"use strict";r.exports=u;var n=we(),s,p=n.LongBits,l=n.base64,c=n.utf8;function o(w,S,$){this.fn=w,this.len=S,this.next=void 0,this.val=$}function a(){}function e(w){this.head=w.head,this.tail=w.tail,this.len=w.len,this.next=w.states}function u(){this.len=0,this.head=new o(a,0,0),this.tail=this.head,this.states=null}var i=function(){return n.Buffer?function(){return(u.create=function(){return new s})()}:function(){return new u}};u.create=i(),u.alloc=function(w){return new n.Array(w)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(w,S,$){return this.tail=this.tail.next=new o(w,S,$),this.len+=S,this};function d(w,S,$){S[$]=w&255}function h(w,S,$){for(;w>127;)S[$++]=w&127|128,w>>>=7;S[$]=w}function m(w,S){this.len=w,this.next=void 0,this.val=S}m.prototype=Object.create(o.prototype),m.prototype.fn=h,u.prototype.uint32=function(w){return this.len+=(this.tail=this.tail.next=new m((w=w>>>0)<128?1:w<16384?2:w<2097152?3:w<268435456?4:5,w)).len,this},u.prototype.int32=function(w){return w<0?this._push(b,10,p.fromNumber(w)):this.uint32(w)},u.prototype.sint32=function(w){return this.uint32((w<<1^w>>31)>>>0)};function b(w,S,$){for(;w.hi;)S[$++]=w.lo&127|128,w.lo=(w.lo>>>7|w.hi<<25)>>>0,w.hi>>>=7;for(;w.lo>127;)S[$++]=w.lo&127|128,w.lo=w.lo>>>7;S[$++]=w.lo}u.prototype.uint64=function(w){var S=p.from(w);return this._push(b,S.length(),S)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(w){var S=p.from(w).zzEncode();return this._push(b,S.length(),S)},u.prototype.bool=function(w){return this._push(d,1,w?1:0)};function x(w,S,$){S[$]=w&255,S[$+1]=w>>>8&255,S[$+2]=w>>>16&255,S[$+3]=w>>>24}u.prototype.fixed32=function(w){return this._push(x,4,w>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(w){var S=p.from(w);return this._push(x,4,S.lo)._push(x,4,S.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(w){return this._push(n.float.writeFloatLE,4,w)},u.prototype.double=function(w){return this._push(n.float.writeDoubleLE,8,w)};var E=n.Array.prototype.set?function(w,S,$){S.set(w,$)}:function(w,S,$){for(var F=0;F<w.length;++F)S[$+F]=w[F]};u.prototype.bytes=function(w){var S=w.length>>>0;if(!S)return this._push(d,1,0);if(n.isString(w)){var $=u.alloc(S=l.length(w));l.decode(w,$,0),w=$}return this.uint32(S)._push(E,S,w)},u.prototype.string=function(w){var S=c.length(w);return S?this.uint32(S)._push(c.write,S,w):this._push(d,1,0)},u.prototype.fork=function(){return this.states=new e(this),this.head=this.tail=new o(a,0,0),this.len=0,this},u.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 o(a,0,0),this.len=0),this},u.prototype.ldelim=function(){var w=this.head,S=this.tail,$=this.len;return this.reset().uint32($),$&&(this.tail.next=w.next,this.tail=S,this.len+=$),this},u.prototype.finish=function(){for(var w=this.head.next,S=this.constructor.alloc(this.len),$=0;w;)w.fn(w.val,S,$),$+=w.len,w=w.next;return S},u._configure=function(w){s=w,u.create=i(),s._configure()}}),Uh=nt((t,r)=>{"use strict";r.exports=p;var n=gl();(p.prototype=Object.create(n.prototype)).constructor=p;var s=we();function p(){n.call(this)}p._configure=function(){p.alloc=s._Buffer_allocUnsafe,p.writeBytesBuffer=s.Buffer&&s.Buffer.prototype instanceof Uint8Array&&s.Buffer.prototype.set.name==="set"?function(c,o,a){o.set(c,a)}:function(c,o,a){if(c.copy)c.copy(o,a,0,c.length);else for(var e=0;e<c.length;)o[a++]=c[e++]}},p.prototype.bytes=function(c){s.isString(c)&&(c=s._Buffer_from(c,"base64"));var o=c.length>>>0;return this.uint32(o),o&&this._push(p.writeBytesBuffer,o,c),this};function l(c,o,a){c.length<40?s.utf8.write(c,o,a):o.utf8Write?o.utf8Write(c,a):o.write(c,a)}p.prototype.string=function(c){var o=s.Buffer.byteLength(c);return this.uint32(o),o&&this._push(l,o,c),this},p._configure()}),ml=nt((t,r)=>{"use strict";r.exports=o;var n=we(),s,p=n.LongBits,l=n.utf8;function c(h,m){return RangeError("index out of range: "+h.pos+" + "+(m||1)+" > "+h.len)}function o(h){this.buf=h,this.pos=0,this.len=h.length}var a=typeof Uint8Array<"u"?function(h){if(h instanceof Uint8Array||Array.isArray(h))return new o(h);throw Error("illegal buffer")}:function(h){if(Array.isArray(h))return new o(h);throw Error("illegal buffer")},e=function(){return n.Buffer?function(h){return(o.create=function(m){return n.Buffer.isBuffer(m)?new s(m):a(m)})(h)}:a};o.create=e(),o.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,o.prototype.uint32=(function(){var h=4294967295;return function(){if(h=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(h=(h|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(h=(h|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return h;if((this.pos+=5)>this.len)throw this.pos=this.len,c(this,10);return h}})(),o.prototype.int32=function(){return this.uint32()|0},o.prototype.sint32=function(){var h=this.uint32();return h>>>1^-(h&1)|0};function u(){var h=new p(0,0),m=0;if(this.len-this.pos>4){for(;m<4;++m)if(h.lo=(h.lo|(this.buf[this.pos]&127)<<m*7)>>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;m=0}else{for(;m<3;++m){if(this.pos>=this.len)throw c(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<<m*7)>>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<<m*7)>>>0,h}if(this.len-this.pos>4){for(;m<5;++m)if(h.hi=(h.hi|(this.buf[this.pos]&127)<<m*7+3)>>>0,this.buf[this.pos++]<128)return h}else for(;m<5;++m){if(this.pos>=this.len)throw c(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<<m*7+3)>>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}o.prototype.bool=function(){return this.uint32()!==0};function i(h,m){return(h[m-4]|h[m-3]<<8|h[m-2]<<16|h[m-1]<<24)>>>0}o.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return i(this.buf,this.pos+=4)},o.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return i(this.buf,this.pos+=4)|0};function d(){if(this.pos+8>this.len)throw c(this,8);return new p(i(this.buf,this.pos+=4),i(this.buf,this.pos+=4))}o.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var h=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,h},o.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var h=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,h},o.prototype.bytes=function(){var h=this.uint32(),m=this.pos,b=this.pos+h;if(b>this.len)throw c(this,h);if(this.pos+=h,Array.isArray(this.buf))return this.buf.slice(m,b);if(m===b){var x=n.Buffer;return x?x.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,m,b)},o.prototype.string=function(){var h=this.bytes();return l.read(h,0,h.length)},o.prototype.skip=function(h){if(typeof h=="number"){if(this.pos+h>this.len)throw c(this,h);this.pos+=h}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},o.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},o._configure=function(h){s=h,o.create=e(),s._configure();var m=n.Long?"toLong":"toNumber";n.merge(o.prototype,{int64:function(){return u.call(this)[m](!1)},uint64:function(){return u.call(this)[m](!0)},sint64:function(){return u.call(this).zzDecode()[m](!1)},fixed64:function(){return d.call(this)[m](!0)},sfixed64:function(){return d.call(this)[m](!1)}})}}),Gh=nt((t,r)=>{"use strict";r.exports=p;var n=ml();(p.prototype=Object.create(n.prototype)).constructor=p;var s=we();function p(l){n.call(this,l)}p._configure=function(){s.Buffer&&(p.prototype._slice=s.Buffer.prototype.slice)},p.prototype.string=function(){var l=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+l,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+l,this.len))},p._configure()}),Hh=nt((t,r)=>{"use strict";r.exports=s;var n=we();(s.prototype=Object.create(n.EventEmitter.prototype)).constructor=s;function s(p,l,c){if(typeof p!="function")throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=p,this.requestDelimited=!!l,this.responseDelimited=!!c}s.prototype.rpcCall=function p(l,c,o,a,e){if(!a)throw TypeError("request must be specified");var u=this;if(!e)return n.asPromise(p,u,l,c,o,a);if(!u.rpcImpl){setTimeout(function(){e(Error("already ended"))},0);return}try{return u.rpcImpl(l,c[u.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(i,d){if(i)return u.emit("error",i,l),e(i);if(d===null){u.end(!0);return}if(!(d instanceof o))try{d=o[u.responseDelimited?"decodeDelimited":"decode"](d)}catch(h){return u.emit("error",h,l),e(h)}return u.emit("data",d,l),e(null,d)})}catch(i){u.emit("error",i,l),setTimeout(function(){e(i)},0);return}},s.prototype.end=function(p){return this.rpcImpl&&(p||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}}),qh=nt(t=>{"use strict";var r=t;r.Service=Hh()}),Wh=nt((t,r)=>{"use strict";r.exports={}}),Xh=nt(t=>{"use strict";var r=t;r.build="minimal",r.Writer=gl(),r.BufferWriter=Uh(),r.Reader=ml(),r.BufferReader=Gh(),r.util=we(),r.rpc=qh(),r.roots=Wh(),r.configure=n;function n(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}n()}),Kh=nt((t,r)=>{"use strict";r.exports=Xh()}),mr=nt((t,r)=>{"use strict";var n=Kh(),s=n.Reader,p=n.Writer,l=n.util,c=n.roots.default||(n.roots.default={});c.onnx=(function(){var o={};return o.Version=(function(){var a={},e=Object.create(a);return e[a[0]="_START_VERSION"]=0,e[a[1]="IR_VERSION_2017_10_10"]=1,e[a[2]="IR_VERSION_2017_10_30"]=2,e[a[3]="IR_VERSION_2017_11_3"]=3,e[a[4]="IR_VERSION_2019_1_22"]=4,e[a[5]="IR_VERSION_2019_3_18"]=5,e[a[6]="IR_VERSION_2019_9_19"]=6,e[a[7]="IR_VERSION_2020_5_8"]=7,e[a[8]="IR_VERSION_2021_7_30"]=8,e[a[9]="IR_VERSION"]=9,e})(),o.AttributeProto=(function(){function a(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],this.sparseTensors=[],this.typeProtos=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.name="",a.prototype.refAttrName="",a.prototype.docString="",a.prototype.type=0,a.prototype.f=0,a.prototype.i=l.Long?l.Long.fromBits(0,0,!1):0,a.prototype.s=l.newBuffer([]),a.prototype.t=null,a.prototype.g=null,a.prototype.sparseTensor=null,a.prototype.tp=null,a.prototype.floats=l.emptyArray,a.prototype.ints=l.emptyArray,a.prototype.strings=l.emptyArray,a.prototype.tensors=l.emptyArray,a.prototype.graphs=l.emptyArray,a.prototype.sparseTensors=l.emptyArray,a.prototype.typeProtos=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(10).string(e.name),e.f!=null&&Object.hasOwnProperty.call(e,"f")&&u.uint32(21).float(e.f),e.i!=null&&Object.hasOwnProperty.call(e,"i")&&u.uint32(24).int64(e.i),e.s!=null&&Object.hasOwnProperty.call(e,"s")&&u.uint32(34).bytes(e.s),e.t!=null&&Object.hasOwnProperty.call(e,"t")&&c.onnx.TensorProto.encode(e.t,u.uint32(42).fork()).ldelim(),e.g!=null&&Object.hasOwnProperty.call(e,"g")&&c.onnx.GraphProto.encode(e.g,u.uint32(50).fork()).ldelim(),e.floats!=null&&e.floats.length){u.uint32(58).fork();for(var i=0;i<e.floats.length;++i)u.float(e.floats[i]);u.ldelim()}if(e.ints!=null&&e.ints.length){u.uint32(66).fork();for(var i=0;i<e.ints.length;++i)u.int64(e.ints[i]);u.ldelim()}if(e.strings!=null&&e.strings.length)for(var i=0;i<e.strings.length;++i)u.uint32(74).bytes(e.strings[i]);if(e.tensors!=null&&e.tensors.length)for(var i=0;i<e.tensors.length;++i)c.onnx.TensorProto.encode(e.tensors[i],u.uint32(82).fork()).ldelim();if(e.graphs!=null&&e.graphs.length)for(var i=0;i<e.graphs.length;++i)c.onnx.GraphProto.encode(e.graphs[i],u.uint32(90).fork()).ldelim();if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(106).string(e.docString),e.tp!=null&&Object.hasOwnProperty.call(e,"tp")&&c.onnx.TypeProto.encode(e.tp,u.uint32(114).fork()).ldelim(),e.typeProtos!=null&&e.typeProtos.length)for(var i=0;i<e.typeProtos.length;++i)c.onnx.TypeProto.encode(e.typeProtos[i],u.uint32(122).fork()).ldelim();if(e.type!=null&&Object.hasOwnProperty.call(e,"type")&&u.uint32(160).int32(e.type),e.refAttrName!=null&&Object.hasOwnProperty.call(e,"refAttrName")&&u.uint32(170).string(e.refAttrName),e.sparseTensor!=null&&Object.hasOwnProperty.call(e,"sparseTensor")&&c.onnx.SparseTensorProto.encode(e.sparseTensor,u.uint32(178).fork()).ldelim(),e.sparseTensors!=null&&e.sparseTensors.length)for(var i=0;i<e.sparseTensors.length;++i)c.onnx.SparseTensorProto.encode(e.sparseTensors[i],u.uint32(186).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.AttributeProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.name=e.string();break}case 21:{d.refAttrName=e.string();break}case 13:{d.docString=e.string();break}case 20:{d.type=e.int32();break}case 2:{d.f=e.float();break}case 3:{d.i=e.int64();break}case 4:{d.s=e.bytes();break}case 5:{d.t=c.onnx.TensorProto.decode(e,e.uint32());break}case 6:{d.g=c.onnx.GraphProto.decode(e,e.uint32());break}case 22:{d.sparseTensor=c.onnx.SparseTensorProto.decode(e,e.uint32());break}case 14:{d.tp=c.onnx.TypeProto.decode(e,e.uint32());break}case 7:{if(d.floats&&d.floats.length||(d.floats=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.floats.push(e.float());else d.floats.push(e.float());break}case 8:{if(d.ints&&d.ints.length||(d.ints=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.ints.push(e.int64());else d.ints.push(e.int64());break}case 9:{d.strings&&d.strings.length||(d.strings=[]),d.strings.push(e.bytes());break}case 10:{d.tensors&&d.tensors.length||(d.tensors=[]),d.tensors.push(c.onnx.TensorProto.decode(e,e.uint32()));break}case 11:{d.graphs&&d.graphs.length||(d.graphs=[]),d.graphs.push(c.onnx.GraphProto.decode(e,e.uint32()));break}case 23:{d.sparseTensors&&d.sparseTensors.length||(d.sparseTensors=[]),d.sparseTensors.push(c.onnx.SparseTensorProto.decode(e,e.uint32()));break}case 15:{d.typeProtos&&d.typeProtos.length||(d.typeProtos=[]),d.typeProtos.push(c.onnx.TypeProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.refAttrName!=null&&e.hasOwnProperty("refAttrName")&&!l.isString(e.refAttrName))return"refAttrName: string expected";if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 11:case 13:case 6:case 7:case 8:case 9:case 10:case 12:case 14:break}if(e.f!=null&&e.hasOwnProperty("f")&&typeof e.f!="number")return"f: number expected";if(e.i!=null&&e.hasOwnProperty("i")&&!l.isInteger(e.i)&&!(e.i&&l.isInteger(e.i.low)&&l.isInteger(e.i.high)))return"i: integer|Long expected";if(e.s!=null&&e.hasOwnProperty("s")&&!(e.s&&typeof e.s.length=="number"||l.isString(e.s)))return"s: buffer expected";if(e.t!=null&&e.hasOwnProperty("t")){var u=c.onnx.TensorProto.verify(e.t);if(u)return"t."+u}if(e.g!=null&&e.hasOwnProperty("g")){var u=c.onnx.GraphProto.verify(e.g);if(u)return"g."+u}if(e.sparseTensor!=null&&e.hasOwnProperty("sparseTensor")){var u=c.onnx.SparseTensorProto.verify(e.sparseTensor);if(u)return"sparseTensor."+u}if(e.tp!=null&&e.hasOwnProperty("tp")){var u=c.onnx.TypeProto.verify(e.tp);if(u)return"tp."+u}if(e.floats!=null&&e.hasOwnProperty("floats")){if(!Array.isArray(e.floats))return"floats: array expected";for(var i=0;i<e.floats.length;++i)if(typeof e.floats[i]!="number")return"floats: number[] expected"}if(e.ints!=null&&e.hasOwnProperty("ints")){if(!Array.isArray(e.ints))return"ints: array expected";for(var i=0;i<e.ints.length;++i)if(!l.isInteger(e.ints[i])&&!(e.ints[i]&&l.isInteger(e.ints[i].low)&&l.isInteger(e.ints[i].high)))return"ints: integer|Long[] expected"}if(e.strings!=null&&e.hasOwnProperty("strings")){if(!Array.isArray(e.strings))return"strings: array expected";for(var i=0;i<e.strings.length;++i)if(!(e.strings[i]&&typeof e.strings[i].length=="number"||l.isString(e.strings[i])))return"strings: buffer[] expected"}if(e.tensors!=null&&e.hasOwnProperty("tensors")){if(!Array.isArray(e.tensors))return"tensors: array expected";for(var i=0;i<e.tensors.length;++i){var u=c.onnx.TensorProto.verify(e.tensors[i]);if(u)return"tensors."+u}}if(e.graphs!=null&&e.hasOwnProperty("graphs")){if(!Array.isArray(e.graphs))return"graphs: array expected";for(var i=0;i<e.graphs.length;++i){var u=c.onnx.GraphProto.verify(e.graphs[i]);if(u)return"graphs."+u}}if(e.sparseTensors!=null&&e.hasOwnProperty("sparseTensors")){if(!Array.isArray(e.sparseTensors))return"sparseTensors: array expected";for(var i=0;i<e.sparseTensors.length;++i){var u=c.onnx.SparseTensorProto.verify(e.sparseTensors[i]);if(u)return"sparseTensors."+u}}if(e.typeProtos!=null&&e.hasOwnProperty("typeProtos")){if(!Array.isArray(e.typeProtos))return"typeProtos: array expected";for(var i=0;i<e.typeProtos.length;++i){var u=c.onnx.TypeProto.verify(e.typeProtos[i]);if(u)return"typeProtos."+u}}return null},a.fromObject=function(e){if(e instanceof c.onnx.AttributeProto)return e;var u=new c.onnx.AttributeProto;switch(e.name!=null&&(u.name=String(e.name)),e.refAttrName!=null&&(u.refAttrName=String(e.refAttrName)),e.docString!=null&&(u.docString=String(e.docString)),e.type){default:if(typeof e.type=="number"){u.type=e.type;break}break;case"UNDEFINED":case 0:u.type=0;break;case"FLOAT":case 1:u.type=1;break;case"INT":case 2:u.type=2;break;case"STRING":case 3:u.type=3;break;case"TENSOR":case 4:u.type=4;break;case"GRAPH":case 5:u.type=5;break;case"SPARSE_TENSOR":case 11:u.type=11;break;case"TYPE_PROTO":case 13:u.type=13;break;case"FLOATS":case 6:u.type=6;break;case"INTS":case 7:u.type=7;break;case"STRINGS":case 8:u.type=8;break;case"TENSORS":case 9:u.type=9;break;case"GRAPHS":case 10:u.type=10;break;case"SPARSE_TENSORS":case 12:u.type=12;break;case"TYPE_PROTOS":case 14:u.type=14;break}if(e.f!=null&&(u.f=Number(e.f)),e.i!=null&&(l.Long?(u.i=l.Long.fromValue(e.i)).unsigned=!1:typeof e.i=="string"?u.i=parseInt(e.i,10):typeof e.i=="number"?u.i=e.i:typeof e.i=="object"&&(u.i=new l.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber())),e.s!=null&&(typeof e.s=="string"?l.base64.decode(e.s,u.s=l.newBuffer(l.base64.length(e.s)),0):e.s.length>=0&&(u.s=e.s)),e.t!=null){if(typeof e.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");u.t=c.onnx.TensorProto.fromObject(e.t)}if(e.g!=null){if(typeof e.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");u.g=c.onnx.GraphProto.fromObject(e.g)}if(e.sparseTensor!=null){if(typeof e.sparseTensor!="object")throw TypeError(".onnx.AttributeProto.sparseTensor: object expected");u.sparseTensor=c.onnx.SparseTensorProto.fromObject(e.sparseTensor)}if(e.tp!=null){if(typeof e.tp!="object")throw TypeError(".onnx.AttributeProto.tp: object expected");u.tp=c.onnx.TypeProto.fromObject(e.tp)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");u.floats=[];for(var i=0;i<e.floats.length;++i)u.floats[i]=Number(e.floats[i])}if(e.ints){if(!Array.isArray(e.ints))throw TypeError(".onnx.AttributeProto.ints: array expected");u.ints=[];for(var i=0;i<e.ints.length;++i)l.Long?(u.ints[i]=l.Long.fromValue(e.ints[i])).unsigned=!1:typeof e.ints[i]=="string"?u.ints[i]=parseInt(e.ints[i],10):typeof e.ints[i]=="number"?u.ints[i]=e.ints[i]:typeof e.ints[i]=="object"&&(u.ints[i]=new l.LongBits(e.ints[i].low>>>0,e.ints[i].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");u.strings=[];for(var i=0;i<e.strings.length;++i)typeof e.strings[i]=="string"?l.base64.decode(e.strings[i],u.strings[i]=l.newBuffer(l.base64.length(e.strings[i])),0):e.strings[i].length>=0&&(u.strings[i]=e.strings[i])}if(e.tensors){if(!Array.isArray(e.tensors))throw TypeError(".onnx.AttributeProto.tensors: array expected");u.tensors=[];for(var i=0;i<e.tensors.length;++i){if(typeof e.tensors[i]!="object")throw TypeError(".onnx.AttributeProto.tensors: object expected");u.tensors[i]=c.onnx.TensorProto.fromObject(e.tensors[i])}}if(e.graphs){if(!Array.isArray(e.graphs))throw TypeError(".onnx.AttributeProto.graphs: array expected");u.graphs=[];for(var i=0;i<e.graphs.length;++i){if(typeof e.graphs[i]!="object")throw TypeError(".onnx.AttributeProto.graphs: object expected");u.graphs[i]=c.onnx.GraphProto.fromObject(e.graphs[i])}}if(e.sparseTensors){if(!Array.isArray(e.sparseTensors))throw TypeError(".onnx.AttributeProto.sparseTensors: array expected");u.sparseTensors=[];for(var i=0;i<e.sparseTensors.length;++i){if(typeof e.sparseTensors[i]!="object")throw TypeError(".onnx.AttributeProto.sparseTensors: object expected");u.sparseTensors[i]=c.onnx.SparseTensorProto.fromObject(e.sparseTensors[i])}}if(e.typeProtos){if(!Array.isArray(e.typeProtos))throw TypeError(".onnx.AttributeProto.typeProtos: array expected");u.typeProtos=[];for(var i=0;i<e.typeProtos.length;++i){if(typeof e.typeProtos[i]!="object")throw TypeError(".onnx.AttributeProto.typeProtos: object expected");u.typeProtos[i]=c.onnx.TypeProto.fromObject(e.typeProtos[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.floats=[],i.ints=[],i.strings=[],i.tensors=[],i.graphs=[],i.typeProtos=[],i.sparseTensors=[]),u.defaults){if(i.name="",i.f=0,l.Long){var d=new l.Long(0,0,!1);i.i=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.i=u.longs===String?"0":0;u.bytes===String?i.s="":(i.s=[],u.bytes!==Array&&(i.s=l.newBuffer(i.s))),i.t=null,i.g=null,i.docString="",i.tp=null,i.type=u.enums===String?"UNDEFINED":0,i.refAttrName="",i.sparseTensor=null}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.f!=null&&e.hasOwnProperty("f")&&(i.f=u.json&&!isFinite(e.f)?String(e.f):e.f),e.i!=null&&e.hasOwnProperty("i")&&(typeof e.i=="number"?i.i=u.longs===String?String(e.i):e.i:i.i=u.longs===String?l.Long.prototype.toString.call(e.i):u.longs===Number?new l.LongBits(e.i.low>>>0,e.i.high>>>0).toNumber():e.i),e.s!=null&&e.hasOwnProperty("s")&&(i.s=u.bytes===String?l.base64.encode(e.s,0,e.s.length):u.bytes===Array?Array.prototype.slice.call(e.s):e.s),e.t!=null&&e.hasOwnProperty("t")&&(i.t=c.onnx.TensorProto.toObject(e.t,u)),e.g!=null&&e.hasOwnProperty("g")&&(i.g=c.onnx.GraphProto.toObject(e.g,u)),e.floats&&e.floats.length){i.floats=[];for(var h=0;h<e.floats.length;++h)i.floats[h]=u.json&&!isFinite(e.floats[h])?String(e.floats[h]):e.floats[h]}if(e.ints&&e.ints.length){i.ints=[];for(var h=0;h<e.ints.length;++h)typeof e.ints[h]=="number"?i.ints[h]=u.longs===String?String(e.ints[h]):e.ints[h]:i.ints[h]=u.longs===String?l.Long.prototype.toString.call(e.ints[h]):u.longs===Number?new l.LongBits(e.ints[h].low>>>0,e.ints[h].high>>>0).toNumber():e.ints[h]}if(e.strings&&e.strings.length){i.strings=[];for(var h=0;h<e.strings.length;++h)i.strings[h]=u.bytes===String?l.base64.encode(e.strings[h],0,e.strings[h].length):u.bytes===Array?Array.prototype.slice.call(e.strings[h]):e.strings[h]}if(e.tensors&&e.tensors.length){i.tensors=[];for(var h=0;h<e.tensors.length;++h)i.tensors[h]=c.onnx.TensorProto.toObject(e.tensors[h],u)}if(e.graphs&&e.graphs.length){i.graphs=[];for(var h=0;h<e.graphs.length;++h)i.graphs[h]=c.onnx.GraphProto.toObject(e.graphs[h],u)}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.tp!=null&&e.hasOwnProperty("tp")&&(i.tp=c.onnx.TypeProto.toObject(e.tp,u)),e.typeProtos&&e.typeProtos.length){i.typeProtos=[];for(var h=0;h<e.typeProtos.length;++h)i.typeProtos[h]=c.onnx.TypeProto.toObject(e.typeProtos[h],u)}if(e.type!=null&&e.hasOwnProperty("type")&&(i.type=u.enums===String?c.onnx.AttributeProto.AttributeType[e.type]===void 0?e.type:c.onnx.AttributeProto.AttributeType[e.type]:e.type),e.refAttrName!=null&&e.hasOwnProperty("refAttrName")&&(i.refAttrName=e.refAttrName),e.sparseTensor!=null&&e.hasOwnProperty("sparseTensor")&&(i.sparseTensor=c.onnx.SparseTensorProto.toObject(e.sparseTensor,u)),e.sparseTensors&&e.sparseTensors.length){i.sparseTensors=[];for(var h=0;h<e.sparseTensors.length;++h)i.sparseTensors[h]=c.onnx.SparseTensorProto.toObject(e.sparseTensors[h],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.AttributeProto"},a.AttributeType=(function(){var e={},u=Object.create(e);return u[e[0]="UNDEFINED"]=0,u[e[1]="FLOAT"]=1,u[e[2]="INT"]=2,u[e[3]="STRING"]=3,u[e[4]="TENSOR"]=4,u[e[5]="GRAPH"]=5,u[e[11]="SPARSE_TENSOR"]=11,u[e[13]="TYPE_PROTO"]=13,u[e[6]="FLOATS"]=6,u[e[7]="INTS"]=7,u[e[8]="STRINGS"]=8,u[e[9]="TENSORS"]=9,u[e[10]="GRAPHS"]=10,u[e[12]="SPARSE_TENSORS"]=12,u[e[14]="TYPE_PROTOS"]=14,u})(),a})(),o.ValueInfoProto=(function(){function a(e){if(e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.name="",a.prototype.type=null,a.prototype.docString="",a.create=function(e){return new a(e)},a.encode=function(e,u){return u||(u=p.create()),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(10).string(e.name),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&c.onnx.TypeProto.encode(e.type,u.uint32(18).fork()).ldelim(),e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(26).string(e.docString),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.ValueInfoProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.name=e.string();break}case 2:{d.type=c.onnx.TypeProto.decode(e,e.uint32());break}case 3:{d.docString=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.type!=null&&e.hasOwnProperty("type")){var u=c.onnx.TypeProto.verify(e.type);if(u)return"type."+u}return e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString)?"docString: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.ValueInfoProto)return e;var u=new c.onnx.ValueInfoProto;if(e.name!=null&&(u.name=String(e.name)),e.type!=null){if(typeof e.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");u.type=c.onnx.TypeProto.fromObject(e.type)}return e.docString!=null&&(u.docString=String(e.docString)),u},a.toObject=function(e,u){u||(u={});var i={};return u.defaults&&(i.name="",i.type=null,i.docString=""),e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.type!=null&&e.hasOwnProperty("type")&&(i.type=c.onnx.TypeProto.toObject(e.type,u)),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.ValueInfoProto"},a})(),o.NodeProto=(function(){function a(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.input=l.emptyArray,a.prototype.output=l.emptyArray,a.prototype.name="",a.prototype.opType="",a.prototype.domain="",a.prototype.attribute=l.emptyArray,a.prototype.docString="",a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.input!=null&&e.input.length)for(var i=0;i<e.input.length;++i)u.uint32(10).string(e.input[i]);if(e.output!=null&&e.output.length)for(var i=0;i<e.output.length;++i)u.uint32(18).string(e.output[i]);if(e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(26).string(e.name),e.opType!=null&&Object.hasOwnProperty.call(e,"opType")&&u.uint32(34).string(e.opType),e.attribute!=null&&e.attribute.length)for(var i=0;i<e.attribute.length;++i)c.onnx.AttributeProto.encode(e.attribute[i],u.uint32(42).fork()).ldelim();return e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(50).string(e.docString),e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(58).string(e.domain),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.NodeProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.input&&d.input.length||(d.input=[]),d.input.push(e.string());break}case 2:{d.output&&d.output.length||(d.output=[]),d.output.push(e.string());break}case 3:{d.name=e.string();break}case 4:{d.opType=e.string();break}case 7:{d.domain=e.string();break}case 5:{d.attribute&&d.attribute.length||(d.attribute=[]),d.attribute.push(c.onnx.AttributeProto.decode(e,e.uint32()));break}case 6:{d.docString=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var u=0;u<e.input.length;++u)if(!l.isString(e.input[u]))return"input: string[] expected"}if(e.output!=null&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(var u=0;u<e.output.length;++u)if(!l.isString(e.output[u]))return"output: string[] expected"}if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.opType!=null&&e.hasOwnProperty("opType")&&!l.isString(e.opType))return"opType: string expected";if(e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain))return"domain: string expected";if(e.attribute!=null&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(var u=0;u<e.attribute.length;++u){var i=c.onnx.AttributeProto.verify(e.attribute[u]);if(i)return"attribute."+i}}return e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString)?"docString: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.NodeProto)return e;var u=new c.onnx.NodeProto;if(e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.NodeProto.input: array expected");u.input=[];for(var i=0;i<e.input.length;++i)u.input[i]=String(e.input[i])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.NodeProto.output: array expected");u.output=[];for(var i=0;i<e.output.length;++i)u.output[i]=String(e.output[i])}if(e.name!=null&&(u.name=String(e.name)),e.opType!=null&&(u.opType=String(e.opType)),e.domain!=null&&(u.domain=String(e.domain)),e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.NodeProto.attribute: array expected");u.attribute=[];for(var i=0;i<e.attribute.length;++i){if(typeof e.attribute[i]!="object")throw TypeError(".onnx.NodeProto.attribute: object expected");u.attribute[i]=c.onnx.AttributeProto.fromObject(e.attribute[i])}}return e.docString!=null&&(u.docString=String(e.docString)),u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.input=[],i.output=[],i.attribute=[]),u.defaults&&(i.name="",i.opType="",i.docString="",i.domain=""),e.input&&e.input.length){i.input=[];for(var d=0;d<e.input.length;++d)i.input[d]=e.input[d]}if(e.output&&e.output.length){i.output=[];for(var d=0;d<e.output.length;++d)i.output[d]=e.output[d]}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.opType!=null&&e.hasOwnProperty("opType")&&(i.opType=e.opType),e.attribute&&e.attribute.length){i.attribute=[];for(var d=0;d<e.attribute.length;++d)i.attribute[d]=c.onnx.AttributeProto.toObject(e.attribute[d],u)}return e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.NodeProto"},a})(),o.TrainingInfoProto=(function(){function a(e){if(this.initializationBinding=[],this.updateBinding=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.initialization=null,a.prototype.algorithm=null,a.prototype.initializationBinding=l.emptyArray,a.prototype.updateBinding=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.initialization!=null&&Object.hasOwnProperty.call(e,"initialization")&&c.onnx.GraphProto.encode(e.initialization,u.uint32(10).fork()).ldelim(),e.algorithm!=null&&Object.hasOwnProperty.call(e,"algorithm")&&c.onnx.GraphProto.encode(e.algorithm,u.uint32(18).fork()).ldelim(),e.initializationBinding!=null&&e.initializationBinding.length)for(var i=0;i<e.initializationBinding.length;++i)c.onnx.StringStringEntryProto.encode(e.initializationBinding[i],u.uint32(26).fork()).ldelim();if(e.updateBinding!=null&&e.updateBinding.length)for(var i=0;i<e.updateBinding.length;++i)c.onnx.StringStringEntryProto.encode(e.updateBinding[i],u.uint32(34).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TrainingInfoProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.initialization=c.onnx.GraphProto.decode(e,e.uint32());break}case 2:{d.algorithm=c.onnx.GraphProto.decode(e,e.uint32());break}case 3:{d.initializationBinding&&d.initializationBinding.length||(d.initializationBinding=[]),d.initializationBinding.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}case 4:{d.updateBinding&&d.updateBinding.length||(d.updateBinding=[]),d.updateBinding.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.initialization!=null&&e.hasOwnProperty("initialization")){var u=c.onnx.GraphProto.verify(e.initialization);if(u)return"initialization."+u}if(e.algorithm!=null&&e.hasOwnProperty("algorithm")){var u=c.onnx.GraphProto.verify(e.algorithm);if(u)return"algorithm."+u}if(e.initializationBinding!=null&&e.hasOwnProperty("initializationBinding")){if(!Array.isArray(e.initializationBinding))return"initializationBinding: array expected";for(var i=0;i<e.initializationBinding.length;++i){var u=c.onnx.StringStringEntryProto.verify(e.initializationBinding[i]);if(u)return"initializationBinding."+u}}if(e.updateBinding!=null&&e.hasOwnProperty("updateBinding")){if(!Array.isArray(e.updateBinding))return"updateBinding: array expected";for(var i=0;i<e.updateBinding.length;++i){var u=c.onnx.StringStringEntryProto.verify(e.updateBinding[i]);if(u)return"updateBinding."+u}}return null},a.fromObject=function(e){if(e instanceof c.onnx.TrainingInfoProto)return e;var u=new c.onnx.TrainingInfoProto;if(e.initialization!=null){if(typeof e.initialization!="object")throw TypeError(".onnx.TrainingInfoProto.initialization: object expected");u.initialization=c.onnx.GraphProto.fromObject(e.initialization)}if(e.algorithm!=null){if(typeof e.algorithm!="object")throw TypeError(".onnx.TrainingInfoProto.algorithm: object expected");u.algorithm=c.onnx.GraphProto.fromObject(e.algorithm)}if(e.initializationBinding){if(!Array.isArray(e.initializationBinding))throw TypeError(".onnx.TrainingInfoProto.initializationBinding: array expected");u.initializationBinding=[];for(var i=0;i<e.initializationBinding.length;++i){if(typeof e.initializationBinding[i]!="object")throw TypeError(".onnx.TrainingInfoProto.initializationBinding: object expected");u.initializationBinding[i]=c.onnx.StringStringEntryProto.fromObject(e.initializationBinding[i])}}if(e.updateBinding){if(!Array.isArray(e.updateBinding))throw TypeError(".onnx.TrainingInfoProto.updateBinding: array expected");u.updateBinding=[];for(var i=0;i<e.updateBinding.length;++i){if(typeof e.updateBinding[i]!="object")throw TypeError(".onnx.TrainingInfoProto.updateBinding: object expected");u.updateBinding[i]=c.onnx.StringStringEntryProto.fromObject(e.updateBinding[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.initializationBinding=[],i.updateBinding=[]),u.defaults&&(i.initialization=null,i.algorithm=null),e.initialization!=null&&e.hasOwnProperty("initialization")&&(i.initialization=c.onnx.GraphProto.toObject(e.initialization,u)),e.algorithm!=null&&e.hasOwnProperty("algorithm")&&(i.algorithm=c.onnx.GraphProto.toObject(e.algorithm,u)),e.initializationBinding&&e.initializationBinding.length){i.initializationBinding=[];for(var d=0;d<e.initializationBinding.length;++d)i.initializationBinding[d]=c.onnx.StringStringEntryProto.toObject(e.initializationBinding[d],u)}if(e.updateBinding&&e.updateBinding.length){i.updateBinding=[];for(var d=0;d<e.updateBinding.length;++d)i.updateBinding[d]=c.onnx.StringStringEntryProto.toObject(e.updateBinding[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TrainingInfoProto"},a})(),o.ModelProto=(function(){function a(e){if(this.opsetImport=[],this.metadataProps=[],this.trainingInfo=[],this.functions=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.irVersion=l.Long?l.Long.fromBits(0,0,!1):0,a.prototype.opsetImport=l.emptyArray,a.prototype.producerName="",a.prototype.producerVersion="",a.prototype.domain="",a.prototype.modelVersion=l.Long?l.Long.fromBits(0,0,!1):0,a.prototype.docString="",a.prototype.graph=null,a.prototype.metadataProps=l.emptyArray,a.prototype.trainingInfo=l.emptyArray,a.prototype.functions=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.irVersion!=null&&Object.hasOwnProperty.call(e,"irVersion")&&u.uint32(8).int64(e.irVersion),e.producerName!=null&&Object.hasOwnProperty.call(e,"producerName")&&u.uint32(18).string(e.producerName),e.producerVersion!=null&&Object.hasOwnProperty.call(e,"producerVersion")&&u.uint32(26).string(e.producerVersion),e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(34).string(e.domain),e.modelVersion!=null&&Object.hasOwnProperty.call(e,"modelVersion")&&u.uint32(40).int64(e.modelVersion),e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(50).string(e.docString),e.graph!=null&&Object.hasOwnProperty.call(e,"graph")&&c.onnx.GraphProto.encode(e.graph,u.uint32(58).fork()).ldelim(),e.opsetImport!=null&&e.opsetImport.length)for(var i=0;i<e.opsetImport.length;++i)c.onnx.OperatorSetIdProto.encode(e.opsetImport[i],u.uint32(66).fork()).ldelim();if(e.metadataProps!=null&&e.metadataProps.length)for(var i=0;i<e.metadataProps.length;++i)c.onnx.StringStringEntryProto.encode(e.metadataProps[i],u.uint32(114).fork()).ldelim();if(e.trainingInfo!=null&&e.trainingInfo.length)for(var i=0;i<e.trainingInfo.length;++i)c.onnx.TrainingInfoProto.encode(e.trainingInfo[i],u.uint32(162).fork()).ldelim();if(e.functions!=null&&e.functions.length)for(var i=0;i<e.functions.length;++i)c.onnx.FunctionProto.encode(e.functions[i],u.uint32(202).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.ModelProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.irVersion=e.int64();break}case 8:{d.opsetImport&&d.opsetImport.length||(d.opsetImport=[]),d.opsetImport.push(c.onnx.OperatorSetIdProto.decode(e,e.uint32()));break}case 2:{d.producerName=e.string();break}case 3:{d.producerVersion=e.string();break}case 4:{d.domain=e.string();break}case 5:{d.modelVersion=e.int64();break}case 6:{d.docString=e.string();break}case 7:{d.graph=c.onnx.GraphProto.decode(e,e.uint32());break}case 14:{d.metadataProps&&d.metadataProps.length||(d.metadataProps=[]),d.metadataProps.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}case 20:{d.trainingInfo&&d.trainingInfo.length||(d.trainingInfo=[]),d.trainingInfo.push(c.onnx.TrainingInfoProto.decode(e,e.uint32()));break}case 25:{d.functions&&d.functions.length||(d.functions=[]),d.functions.push(c.onnx.FunctionProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.irVersion!=null&&e.hasOwnProperty("irVersion")&&!l.isInteger(e.irVersion)&&!(e.irVersion&&l.isInteger(e.irVersion.low)&&l.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(e.opsetImport!=null&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var u=0;u<e.opsetImport.length;++u){var i=c.onnx.OperatorSetIdProto.verify(e.opsetImport[u]);if(i)return"opsetImport."+i}}if(e.producerName!=null&&e.hasOwnProperty("producerName")&&!l.isString(e.producerName))return"producerName: string expected";if(e.producerVersion!=null&&e.hasOwnProperty("producerVersion")&&!l.isString(e.producerVersion))return"producerVersion: string expected";if(e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain))return"domain: string expected";if(e.modelVersion!=null&&e.hasOwnProperty("modelVersion")&&!l.isInteger(e.modelVersion)&&!(e.modelVersion&&l.isInteger(e.modelVersion.low)&&l.isInteger(e.modelVersion.high)))return"modelVersion: integer|Long expected";if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.graph!=null&&e.hasOwnProperty("graph")){var i=c.onnx.GraphProto.verify(e.graph);if(i)return"graph."+i}if(e.metadataProps!=null&&e.hasOwnProperty("metadataProps")){if(!Array.isArray(e.metadataProps))return"metadataProps: array expected";for(var u=0;u<e.metadataProps.length;++u){var i=c.onnx.StringStringEntryProto.verify(e.metadataProps[u]);if(i)return"metadataProps."+i}}if(e.trainingInfo!=null&&e.hasOwnProperty("trainingInfo")){if(!Array.isArray(e.trainingInfo))return"trainingInfo: array expected";for(var u=0;u<e.trainingInfo.length;++u){var i=c.onnx.TrainingInfoProto.verify(e.trainingInfo[u]);if(i)return"trainingInfo."+i}}if(e.functions!=null&&e.hasOwnProperty("functions")){if(!Array.isArray(e.functions))return"functions: array expected";for(var u=0;u<e.functions.length;++u){var i=c.onnx.FunctionProto.verify(e.functions[u]);if(i)return"functions."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.ModelProto)return e;var u=new c.onnx.ModelProto;if(e.irVersion!=null&&(l.Long?(u.irVersion=l.Long.fromValue(e.irVersion)).unsigned=!1:typeof e.irVersion=="string"?u.irVersion=parseInt(e.irVersion,10):typeof e.irVersion=="number"?u.irVersion=e.irVersion:typeof e.irVersion=="object"&&(u.irVersion=new l.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");u.opsetImport=[];for(var i=0;i<e.opsetImport.length;++i){if(typeof e.opsetImport[i]!="object")throw TypeError(".onnx.ModelProto.opsetImport: object expected");u.opsetImport[i]=c.onnx.OperatorSetIdProto.fromObject(e.opsetImport[i])}}if(e.producerName!=null&&(u.producerName=String(e.producerName)),e.producerVersion!=null&&(u.producerVersion=String(e.producerVersion)),e.domain!=null&&(u.domain=String(e.domain)),e.modelVersion!=null&&(l.Long?(u.modelVersion=l.Long.fromValue(e.modelVersion)).unsigned=!1:typeof e.modelVersion=="string"?u.modelVersion=parseInt(e.modelVersion,10):typeof e.modelVersion=="number"?u.modelVersion=e.modelVersion:typeof e.modelVersion=="object"&&(u.modelVersion=new l.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber())),e.docString!=null&&(u.docString=String(e.docString)),e.graph!=null){if(typeof e.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");u.graph=c.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");u.metadataProps=[];for(var i=0;i<e.metadataProps.length;++i){if(typeof e.metadataProps[i]!="object")throw TypeError(".onnx.ModelProto.metadataProps: object expected");u.metadataProps[i]=c.onnx.StringStringEntryProto.fromObject(e.metadataProps[i])}}if(e.trainingInfo){if(!Array.isArray(e.trainingInfo))throw TypeError(".onnx.ModelProto.trainingInfo: array expected");u.trainingInfo=[];for(var i=0;i<e.trainingInfo.length;++i){if(typeof e.trainingInfo[i]!="object")throw TypeError(".onnx.ModelProto.trainingInfo: object expected");u.trainingInfo[i]=c.onnx.TrainingInfoProto.fromObject(e.trainingInfo[i])}}if(e.functions){if(!Array.isArray(e.functions))throw TypeError(".onnx.ModelProto.functions: array expected");u.functions=[];for(var i=0;i<e.functions.length;++i){if(typeof e.functions[i]!="object")throw TypeError(".onnx.ModelProto.functions: object expected");u.functions[i]=c.onnx.FunctionProto.fromObject(e.functions[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.opsetImport=[],i.metadataProps=[],i.trainingInfo=[],i.functions=[]),u.defaults){if(l.Long){var d=new l.Long(0,0,!1);i.irVersion=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.irVersion=u.longs===String?"0":0;if(i.producerName="",i.producerVersion="",i.domain="",l.Long){var d=new l.Long(0,0,!1);i.modelVersion=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.modelVersion=u.longs===String?"0":0;i.docString="",i.graph=null}if(e.irVersion!=null&&e.hasOwnProperty("irVersion")&&(typeof e.irVersion=="number"?i.irVersion=u.longs===String?String(e.irVersion):e.irVersion:i.irVersion=u.longs===String?l.Long.prototype.toString.call(e.irVersion):u.longs===Number?new l.LongBits(e.irVersion.low>>>0,e.irVersion.high>>>0).toNumber():e.irVersion),e.producerName!=null&&e.hasOwnProperty("producerName")&&(i.producerName=e.producerName),e.producerVersion!=null&&e.hasOwnProperty("producerVersion")&&(i.producerVersion=e.producerVersion),e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.modelVersion!=null&&e.hasOwnProperty("modelVersion")&&(typeof e.modelVersion=="number"?i.modelVersion=u.longs===String?String(e.modelVersion):e.modelVersion:i.modelVersion=u.longs===String?l.Long.prototype.toString.call(e.modelVersion):u.longs===Number?new l.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.graph!=null&&e.hasOwnProperty("graph")&&(i.graph=c.onnx.GraphProto.toObject(e.graph,u)),e.opsetImport&&e.opsetImport.length){i.opsetImport=[];for(var h=0;h<e.opsetImport.length;++h)i.opsetImport[h]=c.onnx.OperatorSetIdProto.toObject(e.opsetImport[h],u)}if(e.metadataProps&&e.metadataProps.length){i.metadataProps=[];for(var h=0;h<e.metadataProps.length;++h)i.metadataProps[h]=c.onnx.StringStringEntryProto.toObject(e.metadataProps[h],u)}if(e.trainingInfo&&e.trainingInfo.length){i.trainingInfo=[];for(var h=0;h<e.trainingInfo.length;++h)i.trainingInfo[h]=c.onnx.TrainingInfoProto.toObject(e.trainingInfo[h],u)}if(e.functions&&e.functions.length){i.functions=[];for(var h=0;h<e.functions.length;++h)i.functions[h]=c.onnx.FunctionProto.toObject(e.functions[h],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.ModelProto"},a})(),o.StringStringEntryProto=(function(){function a(e){if(e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.key="",a.prototype.value="",a.create=function(e){return new a(e)},a.encode=function(e,u){return u||(u=p.create()),e.key!=null&&Object.hasOwnProperty.call(e,"key")&&u.uint32(10).string(e.key),e.value!=null&&Object.hasOwnProperty.call(e,"value")&&u.uint32(18).string(e.value),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.StringStringEntryProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.key=e.string();break}case 2:{d.value=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){return typeof e!="object"||e===null?"object expected":e.key!=null&&e.hasOwnProperty("key")&&!l.isString(e.key)?"key: string expected":e.value!=null&&e.hasOwnProperty("value")&&!l.isString(e.value)?"value: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.StringStringEntryProto)return e;var u=new c.onnx.StringStringEntryProto;return e.key!=null&&(u.key=String(e.key)),e.value!=null&&(u.value=String(e.value)),u},a.toObject=function(e,u){u||(u={});var i={};return u.defaults&&(i.key="",i.value=""),e.key!=null&&e.hasOwnProperty("key")&&(i.key=e.key),e.value!=null&&e.hasOwnProperty("value")&&(i.value=e.value),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.StringStringEntryProto"},a})(),o.TensorAnnotation=(function(){function a(e){if(this.quantParameterTensorNames=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.tensorName="",a.prototype.quantParameterTensorNames=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.tensorName!=null&&Object.hasOwnProperty.call(e,"tensorName")&&u.uint32(10).string(e.tensorName),e.quantParameterTensorNames!=null&&e.quantParameterTensorNames.length)for(var i=0;i<e.quantParameterTensorNames.length;++i)c.onnx.StringStringEntryProto.encode(e.quantParameterTensorNames[i],u.uint32(18).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TensorAnnotation;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.tensorName=e.string();break}case 2:{d.quantParameterTensorNames&&d.quantParameterTensorNames.length||(d.quantParameterTensorNames=[]),d.quantParameterTensorNames.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.tensorName!=null&&e.hasOwnProperty("tensorName")&&!l.isString(e.tensorName))return"tensorName: string expected";if(e.quantParameterTensorNames!=null&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var u=0;u<e.quantParameterTensorNames.length;++u){var i=c.onnx.StringStringEntryProto.verify(e.quantParameterTensorNames[u]);if(i)return"quantParameterTensorNames."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.TensorAnnotation)return e;var u=new c.onnx.TensorAnnotation;if(e.tensorName!=null&&(u.tensorName=String(e.tensorName)),e.quantParameterTensorNames){if(!Array.isArray(e.quantParameterTensorNames))throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: array expected");u.quantParameterTensorNames=[];for(var i=0;i<e.quantParameterTensorNames.length;++i){if(typeof e.quantParameterTensorNames[i]!="object")throw TypeError(".onnx.TensorAnnotation.quantParameterTensorNames: object expected");u.quantParameterTensorNames[i]=c.onnx.StringStringEntryProto.fromObject(e.quantParameterTensorNames[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.quantParameterTensorNames=[]),u.defaults&&(i.tensorName=""),e.tensorName!=null&&e.hasOwnProperty("tensorName")&&(i.tensorName=e.tensorName),e.quantParameterTensorNames&&e.quantParameterTensorNames.length){i.quantParameterTensorNames=[];for(var d=0;d<e.quantParameterTensorNames.length;++d)i.quantParameterTensorNames[d]=c.onnx.StringStringEntryProto.toObject(e.quantParameterTensorNames[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TensorAnnotation"},a})(),o.GraphProto=(function(){function a(e){if(this.node=[],this.initializer=[],this.sparseInitializer=[],this.input=[],this.output=[],this.valueInfo=[],this.quantizationAnnotation=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.node=l.emptyArray,a.prototype.name="",a.prototype.initializer=l.emptyArray,a.prototype.sparseInitializer=l.emptyArray,a.prototype.docString="",a.prototype.input=l.emptyArray,a.prototype.output=l.emptyArray,a.prototype.valueInfo=l.emptyArray,a.prototype.quantizationAnnotation=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.node!=null&&e.node.length)for(var i=0;i<e.node.length;++i)c.onnx.NodeProto.encode(e.node[i],u.uint32(10).fork()).ldelim();if(e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(18).string(e.name),e.initializer!=null&&e.initializer.length)for(var i=0;i<e.initializer.length;++i)c.onnx.TensorProto.encode(e.initializer[i],u.uint32(42).fork()).ldelim();if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(82).string(e.docString),e.input!=null&&e.input.length)for(var i=0;i<e.input.length;++i)c.onnx.ValueInfoProto.encode(e.input[i],u.uint32(90).fork()).ldelim();if(e.output!=null&&e.output.length)for(var i=0;i<e.output.length;++i)c.onnx.ValueInfoProto.encode(e.output[i],u.uint32(98).fork()).ldelim();if(e.valueInfo!=null&&e.valueInfo.length)for(var i=0;i<e.valueInfo.length;++i)c.onnx.ValueInfoProto.encode(e.valueInfo[i],u.uint32(106).fork()).ldelim();if(e.quantizationAnnotation!=null&&e.quantizationAnnotation.length)for(var i=0;i<e.quantizationAnnotation.length;++i)c.onnx.TensorAnnotation.encode(e.quantizationAnnotation[i],u.uint32(114).fork()).ldelim();if(e.sparseInitializer!=null&&e.sparseInitializer.length)for(var i=0;i<e.sparseInitializer.length;++i)c.onnx.SparseTensorProto.encode(e.sparseInitializer[i],u.uint32(122).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.GraphProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.node&&d.node.length||(d.node=[]),d.node.push(c.onnx.NodeProto.decode(e,e.uint32()));break}case 2:{d.name=e.string();break}case 5:{d.initializer&&d.initializer.length||(d.initializer=[]),d.initializer.push(c.onnx.TensorProto.decode(e,e.uint32()));break}case 15:{d.sparseInitializer&&d.sparseInitializer.length||(d.sparseInitializer=[]),d.sparseInitializer.push(c.onnx.SparseTensorProto.decode(e,e.uint32()));break}case 10:{d.docString=e.string();break}case 11:{d.input&&d.input.length||(d.input=[]),d.input.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break}case 12:{d.output&&d.output.length||(d.output=[]),d.output.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break}case 13:{d.valueInfo&&d.valueInfo.length||(d.valueInfo=[]),d.valueInfo.push(c.onnx.ValueInfoProto.decode(e,e.uint32()));break}case 14:{d.quantizationAnnotation&&d.quantizationAnnotation.length||(d.quantizationAnnotation=[]),d.quantizationAnnotation.push(c.onnx.TensorAnnotation.decode(e,e.uint32()));break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.node!=null&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var u=0;u<e.node.length;++u){var i=c.onnx.NodeProto.verify(e.node[u]);if(i)return"node."+i}}if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.initializer!=null&&e.hasOwnProperty("initializer")){if(!Array.isArray(e.initializer))return"initializer: array expected";for(var u=0;u<e.initializer.length;++u){var i=c.onnx.TensorProto.verify(e.initializer[u]);if(i)return"initializer."+i}}if(e.sparseInitializer!=null&&e.hasOwnProperty("sparseInitializer")){if(!Array.isArray(e.sparseInitializer))return"sparseInitializer: array expected";for(var u=0;u<e.sparseInitializer.length;++u){var i=c.onnx.SparseTensorProto.verify(e.sparseInitializer[u]);if(i)return"sparseInitializer."+i}}if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var u=0;u<e.input.length;++u){var i=c.onnx.ValueInfoProto.verify(e.input[u]);if(i)return"input."+i}}if(e.output!=null&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(var u=0;u<e.output.length;++u){var i=c.onnx.ValueInfoProto.verify(e.output[u]);if(i)return"output."+i}}if(e.valueInfo!=null&&e.hasOwnProperty("valueInfo")){if(!Array.isArray(e.valueInfo))return"valueInfo: array expected";for(var u=0;u<e.valueInfo.length;++u){var i=c.onnx.ValueInfoProto.verify(e.valueInfo[u]);if(i)return"valueInfo."+i}}if(e.quantizationAnnotation!=null&&e.hasOwnProperty("quantizationAnnotation")){if(!Array.isArray(e.quantizationAnnotation))return"quantizationAnnotation: array expected";for(var u=0;u<e.quantizationAnnotation.length;++u){var i=c.onnx.TensorAnnotation.verify(e.quantizationAnnotation[u]);if(i)return"quantizationAnnotation."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.GraphProto)return e;var u=new c.onnx.GraphProto;if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.GraphProto.node: array expected");u.node=[];for(var i=0;i<e.node.length;++i){if(typeof e.node[i]!="object")throw TypeError(".onnx.GraphProto.node: object expected");u.node[i]=c.onnx.NodeProto.fromObject(e.node[i])}}if(e.name!=null&&(u.name=String(e.name)),e.initializer){if(!Array.isArray(e.initializer))throw TypeError(".onnx.GraphProto.initializer: array expected");u.initializer=[];for(var i=0;i<e.initializer.length;++i){if(typeof e.initializer[i]!="object")throw TypeError(".onnx.GraphProto.initializer: object expected");u.initializer[i]=c.onnx.TensorProto.fromObject(e.initializer[i])}}if(e.sparseInitializer){if(!Array.isArray(e.sparseInitializer))throw TypeError(".onnx.GraphProto.sparseInitializer: array expected");u.sparseInitializer=[];for(var i=0;i<e.sparseInitializer.length;++i){if(typeof e.sparseInitializer[i]!="object")throw TypeError(".onnx.GraphProto.sparseInitializer: object expected");u.sparseInitializer[i]=c.onnx.SparseTensorProto.fromObject(e.sparseInitializer[i])}}if(e.docString!=null&&(u.docString=String(e.docString)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.GraphProto.input: array expected");u.input=[];for(var i=0;i<e.input.length;++i){if(typeof e.input[i]!="object")throw TypeError(".onnx.GraphProto.input: object expected");u.input[i]=c.onnx.ValueInfoProto.fromObject(e.input[i])}}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.GraphProto.output: array expected");u.output=[];for(var i=0;i<e.output.length;++i){if(typeof e.output[i]!="object")throw TypeError(".onnx.GraphProto.output: object expected");u.output[i]=c.onnx.ValueInfoProto.fromObject(e.output[i])}}if(e.valueInfo){if(!Array.isArray(e.valueInfo))throw TypeError(".onnx.GraphProto.valueInfo: array expected");u.valueInfo=[];for(var i=0;i<e.valueInfo.length;++i){if(typeof e.valueInfo[i]!="object")throw TypeError(".onnx.GraphProto.valueInfo: object expected");u.valueInfo[i]=c.onnx.ValueInfoProto.fromObject(e.valueInfo[i])}}if(e.quantizationAnnotation){if(!Array.isArray(e.quantizationAnnotation))throw TypeError(".onnx.GraphProto.quantizationAnnotation: array expected");u.quantizationAnnotation=[];for(var i=0;i<e.quantizationAnnotation.length;++i){if(typeof e.quantizationAnnotation[i]!="object")throw TypeError(".onnx.GraphProto.quantizationAnnotation: object expected");u.quantizationAnnotation[i]=c.onnx.TensorAnnotation.fromObject(e.quantizationAnnotation[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.node=[],i.initializer=[],i.input=[],i.output=[],i.valueInfo=[],i.quantizationAnnotation=[],i.sparseInitializer=[]),u.defaults&&(i.name="",i.docString=""),e.node&&e.node.length){i.node=[];for(var d=0;d<e.node.length;++d)i.node[d]=c.onnx.NodeProto.toObject(e.node[d],u)}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.initializer&&e.initializer.length){i.initializer=[];for(var d=0;d<e.initializer.length;++d)i.initializer[d]=c.onnx.TensorProto.toObject(e.initializer[d],u)}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.input&&e.input.length){i.input=[];for(var d=0;d<e.input.length;++d)i.input[d]=c.onnx.ValueInfoProto.toObject(e.input[d],u)}if(e.output&&e.output.length){i.output=[];for(var d=0;d<e.output.length;++d)i.output[d]=c.onnx.ValueInfoProto.toObject(e.output[d],u)}if(e.valueInfo&&e.valueInfo.length){i.valueInfo=[];for(var d=0;d<e.valueInfo.length;++d)i.valueInfo[d]=c.onnx.ValueInfoProto.toObject(e.valueInfo[d],u)}if(e.quantizationAnnotation&&e.quantizationAnnotation.length){i.quantizationAnnotation=[];for(var d=0;d<e.quantizationAnnotation.length;++d)i.quantizationAnnotation[d]=c.onnx.TensorAnnotation.toObject(e.quantizationAnnotation[d],u)}if(e.sparseInitializer&&e.sparseInitializer.length){i.sparseInitializer=[];for(var d=0;d<e.sparseInitializer.length;++d)i.sparseInitializer[d]=c.onnx.SparseTensorProto.toObject(e.sparseInitializer[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.GraphProto"},a})(),o.TensorProto=(function(){function a(e){if(this.dims=[],this.floatData=[],this.int32Data=[],this.stringData=[],this.int64Data=[],this.externalData=[],this.doubleData=[],this.uint64Data=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.dims=l.emptyArray,a.prototype.dataType=0,a.prototype.segment=null,a.prototype.floatData=l.emptyArray,a.prototype.int32Data=l.emptyArray,a.prototype.stringData=l.emptyArray,a.prototype.int64Data=l.emptyArray,a.prototype.name="",a.prototype.docString="",a.prototype.rawData=l.newBuffer([]),a.prototype.externalData=l.emptyArray,a.prototype.dataLocation=0,a.prototype.doubleData=l.emptyArray,a.prototype.uint64Data=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.dims!=null&&e.dims.length){u.uint32(10).fork();for(var i=0;i<e.dims.length;++i)u.int64(e.dims[i]);u.ldelim()}if(e.dataType!=null&&Object.hasOwnProperty.call(e,"dataType")&&u.uint32(16).int32(e.dataType),e.segment!=null&&Object.hasOwnProperty.call(e,"segment")&&c.onnx.TensorProto.Segment.encode(e.segment,u.uint32(26).fork()).ldelim(),e.floatData!=null&&e.floatData.length){u.uint32(34).fork();for(var i=0;i<e.floatData.length;++i)u.float(e.floatData[i]);u.ldelim()}if(e.int32Data!=null&&e.int32Data.length){u.uint32(42).fork();for(var i=0;i<e.int32Data.length;++i)u.int32(e.int32Data[i]);u.ldelim()}if(e.stringData!=null&&e.stringData.length)for(var i=0;i<e.stringData.length;++i)u.uint32(50).bytes(e.stringData[i]);if(e.int64Data!=null&&e.int64Data.length){u.uint32(58).fork();for(var i=0;i<e.int64Data.length;++i)u.int64(e.int64Data[i]);u.ldelim()}if(e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(66).string(e.name),e.rawData!=null&&Object.hasOwnProperty.call(e,"rawData")&&u.uint32(74).bytes(e.rawData),e.doubleData!=null&&e.doubleData.length){u.uint32(82).fork();for(var i=0;i<e.doubleData.length;++i)u.double(e.doubleData[i]);u.ldelim()}if(e.uint64Data!=null&&e.uint64Data.length){u.uint32(90).fork();for(var i=0;i<e.uint64Data.length;++i)u.uint64(e.uint64Data[i]);u.ldelim()}if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(98).string(e.docString),e.externalData!=null&&e.externalData.length)for(var i=0;i<e.externalData.length;++i)c.onnx.StringStringEntryProto.encode(e.externalData[i],u.uint32(106).fork()).ldelim();return e.dataLocation!=null&&Object.hasOwnProperty.call(e,"dataLocation")&&u.uint32(112).int32(e.dataLocation),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TensorProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{if(d.dims&&d.dims.length||(d.dims=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.dims.push(e.int64());else d.dims.push(e.int64());break}case 2:{d.dataType=e.int32();break}case 3:{d.segment=c.onnx.TensorProto.Segment.decode(e,e.uint32());break}case 4:{if(d.floatData&&d.floatData.length||(d.floatData=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.floatData.push(e.float());else d.floatData.push(e.float());break}case 5:{if(d.int32Data&&d.int32Data.length||(d.int32Data=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.int32Data.push(e.int32());else d.int32Data.push(e.int32());break}case 6:{d.stringData&&d.stringData.length||(d.stringData=[]),d.stringData.push(e.bytes());break}case 7:{if(d.int64Data&&d.int64Data.length||(d.int64Data=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.int64Data.push(e.int64());else d.int64Data.push(e.int64());break}case 8:{d.name=e.string();break}case 12:{d.docString=e.string();break}case 9:{d.rawData=e.bytes();break}case 13:{d.externalData&&d.externalData.length||(d.externalData=[]),d.externalData.push(c.onnx.StringStringEntryProto.decode(e,e.uint32()));break}case 14:{d.dataLocation=e.int32();break}case 10:{if(d.doubleData&&d.doubleData.length||(d.doubleData=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.doubleData.push(e.double());else d.doubleData.push(e.double());break}case 11:{if(d.uint64Data&&d.uint64Data.length||(d.uint64Data=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.uint64Data.push(e.uint64());else d.uint64Data.push(e.uint64());break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.dims!=null&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var u=0;u<e.dims.length;++u)if(!l.isInteger(e.dims[u])&&!(e.dims[u]&&l.isInteger(e.dims[u].low)&&l.isInteger(e.dims[u].high)))return"dims: integer|Long[] expected"}if(e.dataType!=null&&e.hasOwnProperty("dataType")&&!l.isInteger(e.dataType))return"dataType: integer expected";if(e.segment!=null&&e.hasOwnProperty("segment")){var i=c.onnx.TensorProto.Segment.verify(e.segment);if(i)return"segment."+i}if(e.floatData!=null&&e.hasOwnProperty("floatData")){if(!Array.isArray(e.floatData))return"floatData: array expected";for(var u=0;u<e.floatData.length;++u)if(typeof e.floatData[u]!="number")return"floatData: number[] expected"}if(e.int32Data!=null&&e.hasOwnProperty("int32Data")){if(!Array.isArray(e.int32Data))return"int32Data: array expected";for(var u=0;u<e.int32Data.length;++u)if(!l.isInteger(e.int32Data[u]))return"int32Data: integer[] expected"}if(e.stringData!=null&&e.hasOwnProperty("stringData")){if(!Array.isArray(e.stringData))return"stringData: array expected";for(var u=0;u<e.stringData.length;++u)if(!(e.stringData[u]&&typeof e.stringData[u].length=="number"||l.isString(e.stringData[u])))return"stringData: buffer[] expected"}if(e.int64Data!=null&&e.hasOwnProperty("int64Data")){if(!Array.isArray(e.int64Data))return"int64Data: array expected";for(var u=0;u<e.int64Data.length;++u)if(!l.isInteger(e.int64Data[u])&&!(e.int64Data[u]&&l.isInteger(e.int64Data[u].low)&&l.isInteger(e.int64Data[u].high)))return"int64Data: integer|Long[] expected"}if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.rawData!=null&&e.hasOwnProperty("rawData")&&!(e.rawData&&typeof e.rawData.length=="number"||l.isString(e.rawData)))return"rawData: buffer expected";if(e.externalData!=null&&e.hasOwnProperty("externalData")){if(!Array.isArray(e.externalData))return"externalData: array expected";for(var u=0;u<e.externalData.length;++u){var i=c.onnx.StringStringEntryProto.verify(e.externalData[u]);if(i)return"externalData."+i}}if(e.dataLocation!=null&&e.hasOwnProperty("dataLocation"))switch(e.dataLocation){default:return"dataLocation: enum value expected";case 0:case 1:break}if(e.doubleData!=null&&e.hasOwnProperty("doubleData")){if(!Array.isArray(e.doubleData))return"doubleData: array expected";for(var u=0;u<e.doubleData.length;++u)if(typeof e.doubleData[u]!="number")return"doubleData: number[] expected"}if(e.uint64Data!=null&&e.hasOwnProperty("uint64Data")){if(!Array.isArray(e.uint64Data))return"uint64Data: array expected";for(var u=0;u<e.uint64Data.length;++u)if(!l.isInteger(e.uint64Data[u])&&!(e.uint64Data[u]&&l.isInteger(e.uint64Data[u].low)&&l.isInteger(e.uint64Data[u].high)))return"uint64Data: integer|Long[] expected"}return null},a.fromObject=function(e){if(e instanceof c.onnx.TensorProto)return e;var u=new c.onnx.TensorProto;if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.TensorProto.dims: array expected");u.dims=[];for(var i=0;i<e.dims.length;++i)l.Long?(u.dims[i]=l.Long.fromValue(e.dims[i])).unsigned=!1:typeof e.dims[i]=="string"?u.dims[i]=parseInt(e.dims[i],10):typeof e.dims[i]=="number"?u.dims[i]=e.dims[i]:typeof e.dims[i]=="object"&&(u.dims[i]=new l.LongBits(e.dims[i].low>>>0,e.dims[i].high>>>0).toNumber())}if(e.dataType!=null&&(u.dataType=e.dataType|0),e.segment!=null){if(typeof e.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");u.segment=c.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");u.floatData=[];for(var i=0;i<e.floatData.length;++i)u.floatData[i]=Number(e.floatData[i])}if(e.int32Data){if(!Array.isArray(e.int32Data))throw TypeError(".onnx.TensorProto.int32Data: array expected");u.int32Data=[];for(var i=0;i<e.int32Data.length;++i)u.int32Data[i]=e.int32Data[i]|0}if(e.stringData){if(!Array.isArray(e.stringData))throw TypeError(".onnx.TensorProto.stringData: array expected");u.stringData=[];for(var i=0;i<e.stringData.length;++i)typeof e.stringData[i]=="string"?l.base64.decode(e.stringData[i],u.stringData[i]=l.newBuffer(l.base64.length(e.stringData[i])),0):e.stringData[i].length>=0&&(u.stringData[i]=e.stringData[i])}if(e.int64Data){if(!Array.isArray(e.int64Data))throw TypeError(".onnx.TensorProto.int64Data: array expected");u.int64Data=[];for(var i=0;i<e.int64Data.length;++i)l.Long?(u.int64Data[i]=l.Long.fromValue(e.int64Data[i])).unsigned=!1:typeof e.int64Data[i]=="string"?u.int64Data[i]=parseInt(e.int64Data[i],10):typeof e.int64Data[i]=="number"?u.int64Data[i]=e.int64Data[i]:typeof e.int64Data[i]=="object"&&(u.int64Data[i]=new l.LongBits(e.int64Data[i].low>>>0,e.int64Data[i].high>>>0).toNumber())}if(e.name!=null&&(u.name=String(e.name)),e.docString!=null&&(u.docString=String(e.docString)),e.rawData!=null&&(typeof e.rawData=="string"?l.base64.decode(e.rawData,u.rawData=l.newBuffer(l.base64.length(e.rawData)),0):e.rawData.length>=0&&(u.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");u.externalData=[];for(var i=0;i<e.externalData.length;++i){if(typeof e.externalData[i]!="object")throw TypeError(".onnx.TensorProto.externalData: object expected");u.externalData[i]=c.onnx.StringStringEntryProto.fromObject(e.externalData[i])}}switch(e.dataLocation){default:if(typeof e.dataLocation=="number"){u.dataLocation=e.dataLocation;break}break;case"DEFAULT":case 0:u.dataLocation=0;break;case"EXTERNAL":case 1:u.dataLocation=1;break}if(e.doubleData){if(!Array.isArray(e.doubleData))throw TypeError(".onnx.TensorProto.doubleData: array expected");u.doubleData=[];for(var i=0;i<e.doubleData.length;++i)u.doubleData[i]=Number(e.doubleData[i])}if(e.uint64Data){if(!Array.isArray(e.uint64Data))throw TypeError(".onnx.TensorProto.uint64Data: array expected");u.uint64Data=[];for(var i=0;i<e.uint64Data.length;++i)l.Long?(u.uint64Data[i]=l.Long.fromValue(e.uint64Data[i])).unsigned=!0:typeof e.uint64Data[i]=="string"?u.uint64Data[i]=parseInt(e.uint64Data[i],10):typeof e.uint64Data[i]=="number"?u.uint64Data[i]=e.uint64Data[i]:typeof e.uint64Data[i]=="object"&&(u.uint64Data[i]=new l.LongBits(e.uint64Data[i].low>>>0,e.uint64Data[i].high>>>0).toNumber(!0))}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.dims=[],i.floatData=[],i.int32Data=[],i.stringData=[],i.int64Data=[],i.doubleData=[],i.uint64Data=[],i.externalData=[]),u.defaults&&(i.dataType=0,i.segment=null,i.name="",u.bytes===String?i.rawData="":(i.rawData=[],u.bytes!==Array&&(i.rawData=l.newBuffer(i.rawData))),i.docString="",i.dataLocation=u.enums===String?"DEFAULT":0),e.dims&&e.dims.length){i.dims=[];for(var d=0;d<e.dims.length;++d)typeof e.dims[d]=="number"?i.dims[d]=u.longs===String?String(e.dims[d]):e.dims[d]:i.dims[d]=u.longs===String?l.Long.prototype.toString.call(e.dims[d]):u.longs===Number?new l.LongBits(e.dims[d].low>>>0,e.dims[d].high>>>0).toNumber():e.dims[d]}if(e.dataType!=null&&e.hasOwnProperty("dataType")&&(i.dataType=e.dataType),e.segment!=null&&e.hasOwnProperty("segment")&&(i.segment=c.onnx.TensorProto.Segment.toObject(e.segment,u)),e.floatData&&e.floatData.length){i.floatData=[];for(var d=0;d<e.floatData.length;++d)i.floatData[d]=u.json&&!isFinite(e.floatData[d])?String(e.floatData[d]):e.floatData[d]}if(e.int32Data&&e.int32Data.length){i.int32Data=[];for(var d=0;d<e.int32Data.length;++d)i.int32Data[d]=e.int32Data[d]}if(e.stringData&&e.stringData.length){i.stringData=[];for(var d=0;d<e.stringData.length;++d)i.stringData[d]=u.bytes===String?l.base64.encode(e.stringData[d],0,e.stringData[d].length):u.bytes===Array?Array.prototype.slice.call(e.stringData[d]):e.stringData[d]}if(e.int64Data&&e.int64Data.length){i.int64Data=[];for(var d=0;d<e.int64Data.length;++d)typeof e.int64Data[d]=="number"?i.int64Data[d]=u.longs===String?String(e.int64Data[d]):e.int64Data[d]:i.int64Data[d]=u.longs===String?l.Long.prototype.toString.call(e.int64Data[d]):u.longs===Number?new l.LongBits(e.int64Data[d].low>>>0,e.int64Data[d].high>>>0).toNumber():e.int64Data[d]}if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.rawData!=null&&e.hasOwnProperty("rawData")&&(i.rawData=u.bytes===String?l.base64.encode(e.rawData,0,e.rawData.length):u.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length){i.doubleData=[];for(var d=0;d<e.doubleData.length;++d)i.doubleData[d]=u.json&&!isFinite(e.doubleData[d])?String(e.doubleData[d]):e.doubleData[d]}if(e.uint64Data&&e.uint64Data.length){i.uint64Data=[];for(var d=0;d<e.uint64Data.length;++d)typeof e.uint64Data[d]=="number"?i.uint64Data[d]=u.longs===String?String(e.uint64Data[d]):e.uint64Data[d]:i.uint64Data[d]=u.longs===String?l.Long.prototype.toString.call(e.uint64Data[d]):u.longs===Number?new l.LongBits(e.uint64Data[d].low>>>0,e.uint64Data[d].high>>>0).toNumber(!0):e.uint64Data[d]}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.externalData&&e.externalData.length){i.externalData=[];for(var d=0;d<e.externalData.length;++d)i.externalData[d]=c.onnx.StringStringEntryProto.toObject(e.externalData[d],u)}return e.dataLocation!=null&&e.hasOwnProperty("dataLocation")&&(i.dataLocation=u.enums===String?c.onnx.TensorProto.DataLocation[e.dataLocation]===void 0?e.dataLocation:c.onnx.TensorProto.DataLocation[e.dataLocation]:e.dataLocation),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TensorProto"},a.DataType=(function(){var e={},u=Object.create(e);return u[e[0]="UNDEFINED"]=0,u[e[1]="FLOAT"]=1,u[e[2]="UINT8"]=2,u[e[3]="INT8"]=3,u[e[4]="UINT16"]=4,u[e[5]="INT16"]=5,u[e[6]="INT32"]=6,u[e[7]="INT64"]=7,u[e[8]="STRING"]=8,u[e[9]="BOOL"]=9,u[e[10]="FLOAT16"]=10,u[e[11]="DOUBLE"]=11,u[e[12]="UINT32"]=12,u[e[13]="UINT64"]=13,u[e[14]="COMPLEX64"]=14,u[e[15]="COMPLEX128"]=15,u[e[16]="BFLOAT16"]=16,u[e[17]="FLOAT8E4M3FN"]=17,u[e[18]="FLOAT8E4M3FNUZ"]=18,u[e[19]="FLOAT8E5M2"]=19,u[e[20]="FLOAT8E5M2FNUZ"]=20,u})(),a.Segment=(function(){function e(u){if(u)for(var i=Object.keys(u),d=0;d<i.length;++d)u[i[d]]!=null&&(this[i[d]]=u[i[d]])}return e.prototype.begin=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.end=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(u){return new e(u)},e.encode=function(u,i){return i||(i=p.create()),u.begin!=null&&Object.hasOwnProperty.call(u,"begin")&&i.uint32(8).int64(u.begin),u.end!=null&&Object.hasOwnProperty.call(u,"end")&&i.uint32(16).int64(u.end),i},e.encodeDelimited=function(u,i){return this.encode(u,i).ldelim()},e.decode=function(u,i){u instanceof s||(u=s.create(u));for(var d=i===void 0?u.len:u.pos+i,h=new c.onnx.TensorProto.Segment;u.pos<d;){var m=u.uint32();switch(m>>>3){case 1:{h.begin=u.int64();break}case 2:{h.end=u.int64();break}default:u.skipType(m&7);break}}return h},e.decodeDelimited=function(u){return u instanceof s||(u=new s(u)),this.decode(u,u.uint32())},e.verify=function(u){return typeof u!="object"||u===null?"object expected":u.begin!=null&&u.hasOwnProperty("begin")&&!l.isInteger(u.begin)&&!(u.begin&&l.isInteger(u.begin.low)&&l.isInteger(u.begin.high))?"begin: integer|Long expected":u.end!=null&&u.hasOwnProperty("end")&&!l.isInteger(u.end)&&!(u.end&&l.isInteger(u.end.low)&&l.isInteger(u.end.high))?"end: integer|Long expected":null},e.fromObject=function(u){if(u instanceof c.onnx.TensorProto.Segment)return u;var i=new c.onnx.TensorProto.Segment;return u.begin!=null&&(l.Long?(i.begin=l.Long.fromValue(u.begin)).unsigned=!1:typeof u.begin=="string"?i.begin=parseInt(u.begin,10):typeof u.begin=="number"?i.begin=u.begin:typeof u.begin=="object"&&(i.begin=new l.LongBits(u.begin.low>>>0,u.begin.high>>>0).toNumber())),u.end!=null&&(l.Long?(i.end=l.Long.fromValue(u.end)).unsigned=!1:typeof u.end=="string"?i.end=parseInt(u.end,10):typeof u.end=="number"?i.end=u.end:typeof u.end=="object"&&(i.end=new l.LongBits(u.end.low>>>0,u.end.high>>>0).toNumber())),i},e.toObject=function(u,i){i||(i={});var d={};if(i.defaults){if(l.Long){var h=new l.Long(0,0,!1);d.begin=i.longs===String?h.toString():i.longs===Number?h.toNumber():h}else d.begin=i.longs===String?"0":0;if(l.Long){var h=new l.Long(0,0,!1);d.end=i.longs===String?h.toString():i.longs===Number?h.toNumber():h}else d.end=i.longs===String?"0":0}return u.begin!=null&&u.hasOwnProperty("begin")&&(typeof u.begin=="number"?d.begin=i.longs===String?String(u.begin):u.begin:d.begin=i.longs===String?l.Long.prototype.toString.call(u.begin):i.longs===Number?new l.LongBits(u.begin.low>>>0,u.begin.high>>>0).toNumber():u.begin),u.end!=null&&u.hasOwnProperty("end")&&(typeof u.end=="number"?d.end=i.longs===String?String(u.end):u.end:d.end=i.longs===String?l.Long.prototype.toString.call(u.end):i.longs===Number?new l.LongBits(u.end.low>>>0,u.end.high>>>0).toNumber():u.end),d},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/onnx.TensorProto.Segment"},e})(),a.DataLocation=(function(){var e={},u=Object.create(e);return u[e[0]="DEFAULT"]=0,u[e[1]="EXTERNAL"]=1,u})(),a})(),o.SparseTensorProto=(function(){function a(e){if(this.dims=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.values=null,a.prototype.indices=null,a.prototype.dims=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.values!=null&&Object.hasOwnProperty.call(e,"values")&&c.onnx.TensorProto.encode(e.values,u.uint32(10).fork()).ldelim(),e.indices!=null&&Object.hasOwnProperty.call(e,"indices")&&c.onnx.TensorProto.encode(e.indices,u.uint32(18).fork()).ldelim(),e.dims!=null&&e.dims.length){u.uint32(26).fork();for(var i=0;i<e.dims.length;++i)u.int64(e.dims[i]);u.ldelim()}return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.SparseTensorProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.values=c.onnx.TensorProto.decode(e,e.uint32());break}case 2:{d.indices=c.onnx.TensorProto.decode(e,e.uint32());break}case 3:{if(d.dims&&d.dims.length||(d.dims=[]),(h&7)===2)for(var m=e.uint32()+e.pos;e.pos<m;)d.dims.push(e.int64());else d.dims.push(e.int64());break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.values!=null&&e.hasOwnProperty("values")){var u=c.onnx.TensorProto.verify(e.values);if(u)return"values."+u}if(e.indices!=null&&e.hasOwnProperty("indices")){var u=c.onnx.TensorProto.verify(e.indices);if(u)return"indices."+u}if(e.dims!=null&&e.hasOwnProperty("dims")){if(!Array.isArray(e.dims))return"dims: array expected";for(var i=0;i<e.dims.length;++i)if(!l.isInteger(e.dims[i])&&!(e.dims[i]&&l.isInteger(e.dims[i].low)&&l.isInteger(e.dims[i].high)))return"dims: integer|Long[] expected"}return null},a.fromObject=function(e){if(e instanceof c.onnx.SparseTensorProto)return e;var u=new c.onnx.SparseTensorProto;if(e.values!=null){if(typeof e.values!="object")throw TypeError(".onnx.SparseTensorProto.values: object expected");u.values=c.onnx.TensorProto.fromObject(e.values)}if(e.indices!=null){if(typeof e.indices!="object")throw TypeError(".onnx.SparseTensorProto.indices: object expected");u.indices=c.onnx.TensorProto.fromObject(e.indices)}if(e.dims){if(!Array.isArray(e.dims))throw TypeError(".onnx.SparseTensorProto.dims: array expected");u.dims=[];for(var i=0;i<e.dims.length;++i)l.Long?(u.dims[i]=l.Long.fromValue(e.dims[i])).unsigned=!1:typeof e.dims[i]=="string"?u.dims[i]=parseInt(e.dims[i],10):typeof e.dims[i]=="number"?u.dims[i]=e.dims[i]:typeof e.dims[i]=="object"&&(u.dims[i]=new l.LongBits(e.dims[i].low>>>0,e.dims[i].high>>>0).toNumber())}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.dims=[]),u.defaults&&(i.values=null,i.indices=null),e.values!=null&&e.hasOwnProperty("values")&&(i.values=c.onnx.TensorProto.toObject(e.values,u)),e.indices!=null&&e.hasOwnProperty("indices")&&(i.indices=c.onnx.TensorProto.toObject(e.indices,u)),e.dims&&e.dims.length){i.dims=[];for(var d=0;d<e.dims.length;++d)typeof e.dims[d]=="number"?i.dims[d]=u.longs===String?String(e.dims[d]):e.dims[d]:i.dims[d]=u.longs===String?l.Long.prototype.toString.call(e.dims[d]):u.longs===Number?new l.LongBits(e.dims[d].low>>>0,e.dims[d].high>>>0).toNumber():e.dims[d]}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.SparseTensorProto"},a})(),o.TensorShapeProto=(function(){function a(e){if(this.dim=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.dim=l.emptyArray,a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.dim!=null&&e.dim.length)for(var i=0;i<e.dim.length;++i)c.onnx.TensorShapeProto.Dimension.encode(e.dim[i],u.uint32(10).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.TensorShapeProto;e.pos<i;){var h=e.uint32();h>>>3===1?(d.dim&&d.dim.length||(d.dim=[]),d.dim.push(c.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(h&7)}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.dim!=null&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var u=0;u<e.dim.length;++u){var i=c.onnx.TensorShapeProto.Dimension.verify(e.dim[u]);if(i)return"dim."+i}}return null},a.fromObject=function(e){if(e instanceof c.onnx.TensorShapeProto)return e;var u=new c.onnx.TensorShapeProto;if(e.dim){if(!Array.isArray(e.dim))throw TypeError(".onnx.TensorShapeProto.dim: array expected");u.dim=[];for(var i=0;i<e.dim.length;++i){if(typeof e.dim[i]!="object")throw TypeError(".onnx.TensorShapeProto.dim: object expected");u.dim[i]=c.onnx.TensorShapeProto.Dimension.fromObject(e.dim[i])}}return u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.dim=[]),e.dim&&e.dim.length){i.dim=[];for(var d=0;d<e.dim.length;++d)i.dim[d]=c.onnx.TensorShapeProto.Dimension.toObject(e.dim[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.TensorShapeProto"},a.Dimension=(function(){function e(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}e.prototype.dimValue=null,e.prototype.dimParam=null,e.prototype.denotation="";var u;return Object.defineProperty(e.prototype,"value",{get:l.oneOfGetter(u=["dimValue","dimParam"]),set:l.oneOfSetter(u)}),e.create=function(i){return new e(i)},e.encode=function(i,d){return d||(d=p.create()),i.dimValue!=null&&Object.hasOwnProperty.call(i,"dimValue")&&d.uint32(8).int64(i.dimValue),i.dimParam!=null&&Object.hasOwnProperty.call(i,"dimParam")&&d.uint32(18).string(i.dimParam),i.denotation!=null&&Object.hasOwnProperty.call(i,"denotation")&&d.uint32(26).string(i.denotation),d},e.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},e.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TensorShapeProto.Dimension;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.dimValue=i.int64();break}case 2:{m.dimParam=i.string();break}case 3:{m.denotation=i.string();break}default:i.skipType(b&7);break}}return m},e.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},e.verify=function(i){if(typeof i!="object"||i===null)return"object expected";var d={};if(i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(d.value=1,!l.isInteger(i.dimValue)&&!(i.dimValue&&l.isInteger(i.dimValue.low)&&l.isInteger(i.dimValue.high))))return"dimValue: integer|Long expected";if(i.dimParam!=null&&i.hasOwnProperty("dimParam")){if(d.value===1)return"value: multiple values";if(d.value=1,!l.isString(i.dimParam))return"dimParam: string expected"}return i.denotation!=null&&i.hasOwnProperty("denotation")&&!l.isString(i.denotation)?"denotation: string expected":null},e.fromObject=function(i){if(i instanceof c.onnx.TensorShapeProto.Dimension)return i;var d=new c.onnx.TensorShapeProto.Dimension;return i.dimValue!=null&&(l.Long?(d.dimValue=l.Long.fromValue(i.dimValue)).unsigned=!1:typeof i.dimValue=="string"?d.dimValue=parseInt(i.dimValue,10):typeof i.dimValue=="number"?d.dimValue=i.dimValue:typeof i.dimValue=="object"&&(d.dimValue=new l.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber())),i.dimParam!=null&&(d.dimParam=String(i.dimParam)),i.denotation!=null&&(d.denotation=String(i.denotation)),d},e.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.denotation=""),i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(typeof i.dimValue=="number"?h.dimValue=d.longs===String?String(i.dimValue):i.dimValue:h.dimValue=d.longs===String?l.Long.prototype.toString.call(i.dimValue):d.longs===Number?new l.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber():i.dimValue,d.oneofs&&(h.value="dimValue")),i.dimParam!=null&&i.hasOwnProperty("dimParam")&&(h.dimParam=i.dimParam,d.oneofs&&(h.value="dimParam")),i.denotation!=null&&i.hasOwnProperty("denotation")&&(h.denotation=i.denotation),h},e.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},e.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TensorShapeProto.Dimension"},e})(),a})(),o.TypeProto=(function(){function a(u){if(u)for(var i=Object.keys(u),d=0;d<i.length;++d)u[i[d]]!=null&&(this[i[d]]=u[i[d]])}a.prototype.tensorType=null,a.prototype.sequenceType=null,a.prototype.mapType=null,a.prototype.optionalType=null,a.prototype.sparseTensorType=null,a.prototype.denotation="";var e;return Object.defineProperty(a.prototype,"value",{get:l.oneOfGetter(e=["tensorType","sequenceType","mapType","optionalType","sparseTensorType"]),set:l.oneOfSetter(e)}),a.create=function(u){return new a(u)},a.encode=function(u,i){return i||(i=p.create()),u.tensorType!=null&&Object.hasOwnProperty.call(u,"tensorType")&&c.onnx.TypeProto.Tensor.encode(u.tensorType,i.uint32(10).fork()).ldelim(),u.sequenceType!=null&&Object.hasOwnProperty.call(u,"sequenceType")&&c.onnx.TypeProto.Sequence.encode(u.sequenceType,i.uint32(34).fork()).ldelim(),u.mapType!=null&&Object.hasOwnProperty.call(u,"mapType")&&c.onnx.TypeProto.Map.encode(u.mapType,i.uint32(42).fork()).ldelim(),u.denotation!=null&&Object.hasOwnProperty.call(u,"denotation")&&i.uint32(50).string(u.denotation),u.sparseTensorType!=null&&Object.hasOwnProperty.call(u,"sparseTensorType")&&c.onnx.TypeProto.SparseTensor.encode(u.sparseTensorType,i.uint32(66).fork()).ldelim(),u.optionalType!=null&&Object.hasOwnProperty.call(u,"optionalType")&&c.onnx.TypeProto.Optional.encode(u.optionalType,i.uint32(74).fork()).ldelim(),i},a.encodeDelimited=function(u,i){return this.encode(u,i).ldelim()},a.decode=function(u,i){u instanceof s||(u=s.create(u));for(var d=i===void 0?u.len:u.pos+i,h=new c.onnx.TypeProto;u.pos<d;){var m=u.uint32();switch(m>>>3){case 1:{h.tensorType=c.onnx.TypeProto.Tensor.decode(u,u.uint32());break}case 4:{h.sequenceType=c.onnx.TypeProto.Sequence.decode(u,u.uint32());break}case 5:{h.mapType=c.onnx.TypeProto.Map.decode(u,u.uint32());break}case 9:{h.optionalType=c.onnx.TypeProto.Optional.decode(u,u.uint32());break}case 8:{h.sparseTensorType=c.onnx.TypeProto.SparseTensor.decode(u,u.uint32());break}case 6:{h.denotation=u.string();break}default:u.skipType(m&7);break}}return h},a.decodeDelimited=function(u){return u instanceof s||(u=new s(u)),this.decode(u,u.uint32())},a.verify=function(u){if(typeof u!="object"||u===null)return"object expected";var i={};if(u.tensorType!=null&&u.hasOwnProperty("tensorType")){i.value=1;{var d=c.onnx.TypeProto.Tensor.verify(u.tensorType);if(d)return"tensorType."+d}}if(u.sequenceType!=null&&u.hasOwnProperty("sequenceType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.Sequence.verify(u.sequenceType);if(d)return"sequenceType."+d}}if(u.mapType!=null&&u.hasOwnProperty("mapType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.Map.verify(u.mapType);if(d)return"mapType."+d}}if(u.optionalType!=null&&u.hasOwnProperty("optionalType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.Optional.verify(u.optionalType);if(d)return"optionalType."+d}}if(u.sparseTensorType!=null&&u.hasOwnProperty("sparseTensorType")){if(i.value===1)return"value: multiple values";i.value=1;{var d=c.onnx.TypeProto.SparseTensor.verify(u.sparseTensorType);if(d)return"sparseTensorType."+d}}return u.denotation!=null&&u.hasOwnProperty("denotation")&&!l.isString(u.denotation)?"denotation: string expected":null},a.fromObject=function(u){if(u instanceof c.onnx.TypeProto)return u;var i=new c.onnx.TypeProto;if(u.tensorType!=null){if(typeof u.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");i.tensorType=c.onnx.TypeProto.Tensor.fromObject(u.tensorType)}if(u.sequenceType!=null){if(typeof u.sequenceType!="object")throw TypeError(".onnx.TypeProto.sequenceType: object expected");i.sequenceType=c.onnx.TypeProto.Sequence.fromObject(u.sequenceType)}if(u.mapType!=null){if(typeof u.mapType!="object")throw TypeError(".onnx.TypeProto.mapType: object expected");i.mapType=c.onnx.TypeProto.Map.fromObject(u.mapType)}if(u.optionalType!=null){if(typeof u.optionalType!="object")throw TypeError(".onnx.TypeProto.optionalType: object expected");i.optionalType=c.onnx.TypeProto.Optional.fromObject(u.optionalType)}if(u.sparseTensorType!=null){if(typeof u.sparseTensorType!="object")throw TypeError(".onnx.TypeProto.sparseTensorType: object expected");i.sparseTensorType=c.onnx.TypeProto.SparseTensor.fromObject(u.sparseTensorType)}return u.denotation!=null&&(i.denotation=String(u.denotation)),i},a.toObject=function(u,i){i||(i={});var d={};return i.defaults&&(d.denotation=""),u.tensorType!=null&&u.hasOwnProperty("tensorType")&&(d.tensorType=c.onnx.TypeProto.Tensor.toObject(u.tensorType,i),i.oneofs&&(d.value="tensorType")),u.sequenceType!=null&&u.hasOwnProperty("sequenceType")&&(d.sequenceType=c.onnx.TypeProto.Sequence.toObject(u.sequenceType,i),i.oneofs&&(d.value="sequenceType")),u.mapType!=null&&u.hasOwnProperty("mapType")&&(d.mapType=c.onnx.TypeProto.Map.toObject(u.mapType,i),i.oneofs&&(d.value="mapType")),u.denotation!=null&&u.hasOwnProperty("denotation")&&(d.denotation=u.denotation),u.sparseTensorType!=null&&u.hasOwnProperty("sparseTensorType")&&(d.sparseTensorType=c.onnx.TypeProto.SparseTensor.toObject(u.sparseTensorType,i),i.oneofs&&(d.value="sparseTensorType")),u.optionalType!=null&&u.hasOwnProperty("optionalType")&&(d.optionalType=c.onnx.TypeProto.Optional.toObject(u.optionalType,i),i.oneofs&&(d.value="optionalType")),d},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/onnx.TypeProto"},a.Tensor=(function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=0,u.prototype.shape=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&d.uint32(8).int32(i.elemType),i.shape!=null&&Object.hasOwnProperty.call(i,"shape")&&c.onnx.TensorShapeProto.encode(i.shape,d.uint32(18).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Tensor;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.elemType=i.int32();break}case 2:{m.shape=c.onnx.TensorShapeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")&&!l.isInteger(i.elemType))return"elemType: integer expected";if(i.shape!=null&&i.hasOwnProperty("shape")){var d=c.onnx.TensorShapeProto.verify(i.shape);if(d)return"shape."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Tensor)return i;var d=new c.onnx.TypeProto.Tensor;if(i.elemType!=null&&(d.elemType=i.elemType|0),i.shape!=null){if(typeof i.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");d.shape=c.onnx.TensorShapeProto.fromObject(i.shape)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=0,h.shape=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=i.elemType),i.shape!=null&&i.hasOwnProperty("shape")&&(h.shape=c.onnx.TensorShapeProto.toObject(i.shape,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Tensor"},u})(),a.Sequence=(function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&c.onnx.TypeProto.encode(i.elemType,d.uint32(10).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Sequence;i.pos<h;){var b=i.uint32();b>>>3===1?m.elemType=c.onnx.TypeProto.decode(i,i.uint32()):i.skipType(b&7)}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")){var d=c.onnx.TypeProto.verify(i.elemType);if(d)return"elemType."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Sequence)return i;var d=new c.onnx.TypeProto.Sequence;if(i.elemType!=null){if(typeof i.elemType!="object")throw TypeError(".onnx.TypeProto.Sequence.elemType: object expected");d.elemType=c.onnx.TypeProto.fromObject(i.elemType)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=c.onnx.TypeProto.toObject(i.elemType,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Sequence"},u})(),a.Map=(function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.keyType=0,u.prototype.valueType=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.keyType!=null&&Object.hasOwnProperty.call(i,"keyType")&&d.uint32(8).int32(i.keyType),i.valueType!=null&&Object.hasOwnProperty.call(i,"valueType")&&c.onnx.TypeProto.encode(i.valueType,d.uint32(18).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Map;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.keyType=i.int32();break}case 2:{m.valueType=c.onnx.TypeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.keyType!=null&&i.hasOwnProperty("keyType")&&!l.isInteger(i.keyType))return"keyType: integer expected";if(i.valueType!=null&&i.hasOwnProperty("valueType")){var d=c.onnx.TypeProto.verify(i.valueType);if(d)return"valueType."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Map)return i;var d=new c.onnx.TypeProto.Map;if(i.keyType!=null&&(d.keyType=i.keyType|0),i.valueType!=null){if(typeof i.valueType!="object")throw TypeError(".onnx.TypeProto.Map.valueType: object expected");d.valueType=c.onnx.TypeProto.fromObject(i.valueType)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.keyType=0,h.valueType=null),i.keyType!=null&&i.hasOwnProperty("keyType")&&(h.keyType=i.keyType),i.valueType!=null&&i.hasOwnProperty("valueType")&&(h.valueType=c.onnx.TypeProto.toObject(i.valueType,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Map"},u})(),a.Optional=(function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&c.onnx.TypeProto.encode(i.elemType,d.uint32(10).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.Optional;i.pos<h;){var b=i.uint32();b>>>3===1?m.elemType=c.onnx.TypeProto.decode(i,i.uint32()):i.skipType(b&7)}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")){var d=c.onnx.TypeProto.verify(i.elemType);if(d)return"elemType."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.Optional)return i;var d=new c.onnx.TypeProto.Optional;if(i.elemType!=null){if(typeof i.elemType!="object")throw TypeError(".onnx.TypeProto.Optional.elemType: object expected");d.elemType=c.onnx.TypeProto.fromObject(i.elemType)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=c.onnx.TypeProto.toObject(i.elemType,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.Optional"},u})(),a.SparseTensor=(function(){function u(i){if(i)for(var d=Object.keys(i),h=0;h<d.length;++h)i[d[h]]!=null&&(this[d[h]]=i[d[h]])}return u.prototype.elemType=0,u.prototype.shape=null,u.create=function(i){return new u(i)},u.encode=function(i,d){return d||(d=p.create()),i.elemType!=null&&Object.hasOwnProperty.call(i,"elemType")&&d.uint32(8).int32(i.elemType),i.shape!=null&&Object.hasOwnProperty.call(i,"shape")&&c.onnx.TensorShapeProto.encode(i.shape,d.uint32(18).fork()).ldelim(),d},u.encodeDelimited=function(i,d){return this.encode(i,d).ldelim()},u.decode=function(i,d){i instanceof s||(i=s.create(i));for(var h=d===void 0?i.len:i.pos+d,m=new c.onnx.TypeProto.SparseTensor;i.pos<h;){var b=i.uint32();switch(b>>>3){case 1:{m.elemType=i.int32();break}case 2:{m.shape=c.onnx.TensorShapeProto.decode(i,i.uint32());break}default:i.skipType(b&7);break}}return m},u.decodeDelimited=function(i){return i instanceof s||(i=new s(i)),this.decode(i,i.uint32())},u.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")&&!l.isInteger(i.elemType))return"elemType: integer expected";if(i.shape!=null&&i.hasOwnProperty("shape")){var d=c.onnx.TensorShapeProto.verify(i.shape);if(d)return"shape."+d}return null},u.fromObject=function(i){if(i instanceof c.onnx.TypeProto.SparseTensor)return i;var d=new c.onnx.TypeProto.SparseTensor;if(i.elemType!=null&&(d.elemType=i.elemType|0),i.shape!=null){if(typeof i.shape!="object")throw TypeError(".onnx.TypeProto.SparseTensor.shape: object expected");d.shape=c.onnx.TensorShapeProto.fromObject(i.shape)}return d},u.toObject=function(i,d){d||(d={});var h={};return d.defaults&&(h.elemType=0,h.shape=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(h.elemType=i.elemType),i.shape!=null&&i.hasOwnProperty("shape")&&(h.shape=c.onnx.TensorShapeProto.toObject(i.shape,d)),h},u.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},u.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/onnx.TypeProto.SparseTensor"},u})(),a})(),o.OperatorSetIdProto=(function(){function a(e){if(e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.domain="",a.prototype.version=l.Long?l.Long.fromBits(0,0,!1):0,a.create=function(e){return new a(e)},a.encode=function(e,u){return u||(u=p.create()),e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(10).string(e.domain),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&u.uint32(16).int64(e.version),u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.OperatorSetIdProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.domain=e.string();break}case 2:{d.version=e.int64();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){return typeof e!="object"||e===null?"object expected":e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain)?"domain: string expected":e.version!=null&&e.hasOwnProperty("version")&&!l.isInteger(e.version)&&!(e.version&&l.isInteger(e.version.low)&&l.isInteger(e.version.high))?"version: integer|Long expected":null},a.fromObject=function(e){if(e instanceof c.onnx.OperatorSetIdProto)return e;var u=new c.onnx.OperatorSetIdProto;return e.domain!=null&&(u.domain=String(e.domain)),e.version!=null&&(l.Long?(u.version=l.Long.fromValue(e.version)).unsigned=!1:typeof e.version=="string"?u.version=parseInt(e.version,10):typeof e.version=="number"?u.version=e.version:typeof e.version=="object"&&(u.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),u},a.toObject=function(e,u){u||(u={});var i={};if(u.defaults)if(i.domain="",l.Long){var d=new l.Long(0,0,!1);i.version=u.longs===String?d.toString():u.longs===Number?d.toNumber():d}else i.version=u.longs===String?"0":0;return e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?i.version=u.longs===String?String(e.version):e.version:i.version=u.longs===String?l.Long.prototype.toString.call(e.version):u.longs===Number?new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.OperatorSetIdProto"},a})(),o.OperatorStatus=(function(){var a={},e=Object.create(a);return e[a[0]="EXPERIMENTAL"]=0,e[a[1]="STABLE"]=1,e})(),o.FunctionProto=(function(){function a(e){if(this.input=[],this.output=[],this.attribute=[],this.attributeProto=[],this.node=[],this.opsetImport=[],e)for(var u=Object.keys(e),i=0;i<u.length;++i)e[u[i]]!=null&&(this[u[i]]=e[u[i]])}return a.prototype.name="",a.prototype.input=l.emptyArray,a.prototype.output=l.emptyArray,a.prototype.attribute=l.emptyArray,a.prototype.attributeProto=l.emptyArray,a.prototype.node=l.emptyArray,a.prototype.docString="",a.prototype.opsetImport=l.emptyArray,a.prototype.domain="",a.create=function(e){return new a(e)},a.encode=function(e,u){if(u||(u=p.create()),e.name!=null&&Object.hasOwnProperty.call(e,"name")&&u.uint32(10).string(e.name),e.input!=null&&e.input.length)for(var i=0;i<e.input.length;++i)u.uint32(34).string(e.input[i]);if(e.output!=null&&e.output.length)for(var i=0;i<e.output.length;++i)u.uint32(42).string(e.output[i]);if(e.attribute!=null&&e.attribute.length)for(var i=0;i<e.attribute.length;++i)u.uint32(50).string(e.attribute[i]);if(e.node!=null&&e.node.length)for(var i=0;i<e.node.length;++i)c.onnx.NodeProto.encode(e.node[i],u.uint32(58).fork()).ldelim();if(e.docString!=null&&Object.hasOwnProperty.call(e,"docString")&&u.uint32(66).string(e.docString),e.opsetImport!=null&&e.opsetImport.length)for(var i=0;i<e.opsetImport.length;++i)c.onnx.OperatorSetIdProto.encode(e.opsetImport[i],u.uint32(74).fork()).ldelim();if(e.domain!=null&&Object.hasOwnProperty.call(e,"domain")&&u.uint32(82).string(e.domain),e.attributeProto!=null&&e.attributeProto.length)for(var i=0;i<e.attributeProto.length;++i)c.onnx.AttributeProto.encode(e.attributeProto[i],u.uint32(90).fork()).ldelim();return u},a.encodeDelimited=function(e,u){return this.encode(e,u).ldelim()},a.decode=function(e,u){e instanceof s||(e=s.create(e));for(var i=u===void 0?e.len:e.pos+u,d=new c.onnx.FunctionProto;e.pos<i;){var h=e.uint32();switch(h>>>3){case 1:{d.name=e.string();break}case 4:{d.input&&d.input.length||(d.input=[]),d.input.push(e.string());break}case 5:{d.output&&d.output.length||(d.output=[]),d.output.push(e.string());break}case 6:{d.attribute&&d.attribute.length||(d.attribute=[]),d.attribute.push(e.string());break}case 11:{d.attributeProto&&d.attributeProto.length||(d.attributeProto=[]),d.attributeProto.push(c.onnx.AttributeProto.decode(e,e.uint32()));break}case 7:{d.node&&d.node.length||(d.node=[]),d.node.push(c.onnx.NodeProto.decode(e,e.uint32()));break}case 8:{d.docString=e.string();break}case 9:{d.opsetImport&&d.opsetImport.length||(d.opsetImport=[]),d.opsetImport.push(c.onnx.OperatorSetIdProto.decode(e,e.uint32()));break}case 10:{d.domain=e.string();break}default:e.skipType(h&7);break}}return d},a.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},a.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!l.isString(e.name))return"name: string expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var u=0;u<e.input.length;++u)if(!l.isString(e.input[u]))return"input: string[] expected"}if(e.output!=null&&e.hasOwnProperty("output")){if(!Array.isArray(e.output))return"output: array expected";for(var u=0;u<e.output.length;++u)if(!l.isString(e.output[u]))return"output: string[] expected"}if(e.attribute!=null&&e.hasOwnProperty("attribute")){if(!Array.isArray(e.attribute))return"attribute: array expected";for(var u=0;u<e.attribute.length;++u)if(!l.isString(e.attribute[u]))return"attribute: string[] expected"}if(e.attributeProto!=null&&e.hasOwnProperty("attributeProto")){if(!Array.isArray(e.attributeProto))return"attributeProto: array expected";for(var u=0;u<e.attributeProto.length;++u){var i=c.onnx.AttributeProto.verify(e.attributeProto[u]);if(i)return"attributeProto."+i}}if(e.node!=null&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var u=0;u<e.node.length;++u){var i=c.onnx.NodeProto.verify(e.node[u]);if(i)return"node."+i}}if(e.docString!=null&&e.hasOwnProperty("docString")&&!l.isString(e.docString))return"docString: string expected";if(e.opsetImport!=null&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var u=0;u<e.opsetImport.length;++u){var i=c.onnx.OperatorSetIdProto.verify(e.opsetImport[u]);if(i)return"opsetImport."+i}}return e.domain!=null&&e.hasOwnProperty("domain")&&!l.isString(e.domain)?"domain: string expected":null},a.fromObject=function(e){if(e instanceof c.onnx.FunctionProto)return e;var u=new c.onnx.FunctionProto;if(e.name!=null&&(u.name=String(e.name)),e.input){if(!Array.isArray(e.input))throw TypeError(".onnx.FunctionProto.input: array expected");u.input=[];for(var i=0;i<e.input.length;++i)u.input[i]=String(e.input[i])}if(e.output){if(!Array.isArray(e.output))throw TypeError(".onnx.FunctionProto.output: array expected");u.output=[];for(var i=0;i<e.output.length;++i)u.output[i]=String(e.output[i])}if(e.attribute){if(!Array.isArray(e.attribute))throw TypeError(".onnx.FunctionProto.attribute: array expected");u.attribute=[];for(var i=0;i<e.attribute.length;++i)u.attribute[i]=String(e.attribute[i])}if(e.attributeProto){if(!Array.isArray(e.attributeProto))throw TypeError(".onnx.FunctionProto.attributeProto: array expected");u.attributeProto=[];for(var i=0;i<e.attributeProto.length;++i){if(typeof e.attributeProto[i]!="object")throw TypeError(".onnx.FunctionProto.attributeProto: object expected");u.attributeProto[i]=c.onnx.AttributeProto.fromObject(e.attributeProto[i])}}if(e.node){if(!Array.isArray(e.node))throw TypeError(".onnx.FunctionProto.node: array expected");u.node=[];for(var i=0;i<e.node.length;++i){if(typeof e.node[i]!="object")throw TypeError(".onnx.FunctionProto.node: object expected");u.node[i]=c.onnx.NodeProto.fromObject(e.node[i])}}if(e.docString!=null&&(u.docString=String(e.docString)),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.FunctionProto.opsetImport: array expected");u.opsetImport=[];for(var i=0;i<e.opsetImport.length;++i){if(typeof e.opsetImport[i]!="object")throw TypeError(".onnx.FunctionProto.opsetImport: object expected");u.opsetImport[i]=c.onnx.OperatorSetIdProto.fromObject(e.opsetImport[i])}}return e.domain!=null&&(u.domain=String(e.domain)),u},a.toObject=function(e,u){u||(u={});var i={};if((u.arrays||u.defaults)&&(i.input=[],i.output=[],i.attribute=[],i.node=[],i.opsetImport=[],i.attributeProto=[]),u.defaults&&(i.name="",i.docString="",i.domain=""),e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.input&&e.input.length){i.input=[];for(var d=0;d<e.input.length;++d)i.input[d]=e.input[d]}if(e.output&&e.output.length){i.output=[];for(var d=0;d<e.output.length;++d)i.output[d]=e.output[d]}if(e.attribute&&e.attribute.length){i.attribute=[];for(var d=0;d<e.attribute.length;++d)i.attribute[d]=e.attribute[d]}if(e.node&&e.node.length){i.node=[];for(var d=0;d<e.node.length;++d)i.node[d]=c.onnx.NodeProto.toObject(e.node[d],u)}if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.opsetImport&&e.opsetImport.length){i.opsetImport=[];for(var d=0;d<e.opsetImport.length;++d)i.opsetImport[d]=c.onnx.OperatorSetIdProto.toObject(e.opsetImport[d],u)}if(e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.attributeProto&&e.attributeProto.length){i.attributeProto=[];for(var d=0;d<e.attributeProto.length;++d)i.attributeProto[d]=c.onnx.AttributeProto.toObject(e.attributeProto[d],u)}return i},a.prototype.toJSON=function(){return this.constructor.toObject(this,n.util.toJSONOptions)},a.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/onnx.FunctionProto"},a})(),o})(),r.exports=c});function Ur(t,r){if(!t)throw new Error(typeof r=="string"?r:r())}function co(t){return new TextDecoder().decode(t)}var q,Qe,ya,Mt,bl,Et,Vt,C,ho,Gr,dr,hr,U=I(()=>{"use strict";Ho(),fl(),q=Ie(mr()),De(),Qe=class{static arraysEqual(t,r){if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==r[n])return!1;return!0}},ya=class{static preprocessInputShapes(t,r){let n=t.length===1?[1,t[0]]:t,s=r.length===1?[r[0],1]:r;return[n,s]}static postprocessOutputShape(t,r,n){r===1&&t.splice(t.length-2,1),n===1&&t.pop()}static calcMatMulShape(t,r){return t[1]!==r[0]?void 0:[t[0],r[1]]}},Mt=class tr{static calcShape(r,n,s=!1){let p=r.length,l=n.length;if(p===0)return n;if(l===0)return r;let c=Math.max(r.length,n.length),o=new Array(c);if(s){if(p<2||l<2)return;let a=ya.calcMatMulShape([r[p-2],r[p-1]],[n[l-2],n[l-1]]);if(a===void 0)return;[o[c-2],o[c-1]]=a}for(let a=s?3:1;a<=c;a++){let e=p-a<0?1:r[p-a],u=l-a<0?1:n[l-a];if(e!==u&&e>1&&u>1)return;o[c-a]=Math.max(e,u)}return o}static index(r,n){let s=new Array(n.length);return tr.fillIndex(r,n,s),s}static fillIndex(r,n,s){let p=r.length-n.length;for(let l=0;l<n.length;l++)s[l]=r[p+l]%n[l]}static calc(r,n,s,p,l){let c=tr.calcShape(r.dims,n.dims);if(c){if(p&&!C.areEqual(c,r.dims))return;let o=C.size(c),a=p?r:new Pt(c,l||r.type);if(c.length===0)a.set([],s(r.get([]),n.get([])));else{let e=new Array(c.length),u=new Array(r.dims.length),i=new Array(n.dims.length),d=0,h=0,m=!1,b=!1;r.dims.length===0&&(d=r.get([]),m=!0),n.dims.length===0&&(h=n.get([]),b=!0);let x;for(let E=0;E<o;E++){x=E;for(let w=c.length-1;w>=0;w--)e[w]=x%c[w],x=Math.floor(x/c[w]);m||(tr.fillIndex(e,r.dims,u),d=r.get(u)),b||(tr.fillIndex(e,n.dims,i),h=n.get(i)),a.set(e,s(d,h))}}return a}}static isValidBroadcast(r,n){let s=r.length,p=n.length;if(s>p)return!1;for(let l=1;l<=s;l++)if(r[s-l]!==1&&r[s-l]!==n[p-l])return!1;return!0}static getBroadcastDims(r,n){let s=r.length,p=[];for(let l=0;l<s;l++){let c=s-1-l,o=r[c]||1;(n[n.length-1-l]||1)>1&&o===1&&p.unshift(c)}return p}},bl=class{static getShapeOfGemmResult(t,r,n,s,p){if(t.length!==2||n.length!==2)throw new Error("shape need to be of size 2");let l,c,o;r?(l=t[1],c=t[0]):(l=t[0],c=t[1]);let a=-1;if(s?(o=n[0],a=1):(o=n[1],a=0),n[a]!==c)throw new Error("dimension mismatch");if(l<=0||o<=0||c<=0)throw new Error("invalid shape specified");if(p&&!Mt.isValidBroadcast(p,[l,o]))throw new Error("gemm: invalid bias shape for broadcast");return[l,o,c]}},Et=class fo{static tensorDataTypeFromProto(r){switch(r){case q.onnx.TensorProto.DataType.INT8:return"int8";case q.onnx.TensorProto.DataType.UINT8:return"uint8";case q.onnx.TensorProto.DataType.BOOL:return"bool";case q.onnx.TensorProto.DataType.INT16:return"int16";case q.onnx.TensorProto.DataType.UINT16:return"uint16";case q.onnx.TensorProto.DataType.INT32:return"int32";case q.onnx.TensorProto.DataType.UINT32:return"uint32";case q.onnx.TensorProto.DataType.FLOAT:return"float32";case q.onnx.TensorProto.DataType.DOUBLE:return"float64";case q.onnx.TensorProto.DataType.STRING:return"string";case q.onnx.TensorProto.DataType.INT64:return"int32";case q.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${q.onnx.TensorProto.DataType[r]}`)}}static tensorDataTypeStringToEnum(r){switch(r){case"int8":return q.onnx.TensorProto.DataType.INT8;case"uint8":return q.onnx.TensorProto.DataType.UINT8;case"bool":return q.onnx.TensorProto.DataType.BOOL;case"int16":return q.onnx.TensorProto.DataType.INT16;case"uint16":return q.onnx.TensorProto.DataType.UINT16;case"int32":return q.onnx.TensorProto.DataType.INT32;case"uint32":return q.onnx.TensorProto.DataType.UINT32;case"float32":return q.onnx.TensorProto.DataType.FLOAT;case"float64":return q.onnx.TensorProto.DataType.DOUBLE;case"string":return q.onnx.TensorProto.DataType.STRING;case"int64":return q.onnx.TensorProto.DataType.INT64;case"uint64":return q.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${r}`)}}static tensorDimsFromProto(r){return r.map(n=>ee.isLong(n)?n.toNumber():n)}static tensorValueTypeFromProto(r){return{tensorType:fo.tensorDataTypeFromProto(r.elemType),shape:{dims:fo.tensorDimsFromProto(r.shape.dim.map(n=>n.dimValue))}}}static tensorDimsFromORTFormat(r){let n=[];for(let s=0;s<r.dimsLength();s++)n.push(Vt.longToNumber(r.dims(s)));return n}static tensorAttributesFromORTFormat(r){let n=[];for(let s=0;s<r.attributesLength();s++)n.push(r.attributes(s));return n}},Vt=class{static longToNumber(t,r){return ee.isLong(t)?t.toNumber():t instanceof T.Long?ee.fromValue({low:t.low,high:t.high,unsigned:r??!1}).toNumber():t}static isLong(t){return ee.isLong(t)||t instanceof T.Long}},C=class Qt{static size(r){return Qt.getSizeFromDimensionRange(r,0,r.length)}static sizeFromDimension(r,n){if(n<0||n>r.length)throw new Error(`invalid dimension of ${n} for sizeFromDimension as Tensor has ${r.length} dimensions.`);return Qt.getSizeFromDimensionRange(r,n,r.length)}static sizeToDimension(r,n){if(n<0||n>r.length)throw new Error(`invalid dimension of ${n} for sizeToDimension as Tensor has ${r.length} dimensions.`);return Qt.getSizeFromDimensionRange(r,0,n)}static getSizeFromDimensionRange(r,n,s){let p=1;for(let l=n;l<s;l++){if(r[l]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");p*=r[l]}return p}static computeStrides(r){let n=r.length;if(n===0)return[];if(n===1)return[1];let s=new Array(n);s[n-1]=1,s[n-2]=r[n-1];for(let p=n-3;p>=0;--p)s[p]=s[p+1]*r[p+1];return s}static transpose(r){return r.slice().reverse()}static indicesToOffset(r,n,s){s===void 0&&(s=r.length);let p=0;for(let l=0;l<s;++l)p+=n[l]*r[l];return p}static offsetToIndices(r,n){let s=n.length;if(s===0)return[];if(s===1)return[r*n[0]];let p=new Array(n.length);for(let l=0;l<p.length-1;++l)p[l]=Math.floor(r/n[l]),r-=p[l]*n[l];return p[p.length-1]=r,p}static normalizeAxis(r,n){if(r<-n&&r>=n)throw new Error("unsupported axis for this operation.");return r<0?r+n:r}static normalizeAxes(r,n){return r.map(s=>this.normalizeAxis(s,n))}static incrementIndex(r,n,s){if(n.length===0||r.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(s===void 0)s=n.length;else if(s<=0||s>n.length)throw new Error("Incorrect axis to increment on");for(let p=s-1;p>=0&&(r[p]++,!(r[p]<n[p]));--p)r[p]=0}static calculateReshapedDims(r,n){if(n.length===0){if(r.length===0||Qt.size(r)===1)return[];throw new Error("cannot reshape to a scalar Tensor")}let s=n.length,p=new Array(s),l=-1,c=1;for(let a=0;a<s;a++){if(n[a]<-1)throw new Error("a dimension in shape hints cannot be less than -1");if(n[a]===-1){if(l!==-1)throw new Error("at most one dimension in shape hints can be -1");l=a}else{if(n[a]===0){if(a>=r.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");p[a]=r[a]}else p[a]=n[a];c*=p[a]}}let o=Qt.size(r);if(l!==-1){if(o%c!==0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${r}] Output shape: [${n}]`);p[l]=o/c}else if(c!==o)throw new Error("reshapedDims and originalDims don't have matching sizes");return p}static sortBasedOnPerm(r,n){return n?n.map(s=>r[s]):r.slice().reverse()}static padShape(r,n){let s=r.length;return r.map((p,l)=>p+n[l]+n[l+s])}static areEqual(r,n){return r.length!==n.length?!1:r.every((s,p)=>s===n[p])}static validateDimsAndCalcSize(r){if(r.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let n=1;for(let s of r){if(!Number.isInteger(s))throw new TypeError(`Invalid shape: ${s} is not an integer`);if(s<0||s>2147483647)throw new TypeError(`Invalid shape: length ${s} is not allowed`);n*=s}return n}static flattenShape(r,n){n<0&&(n+=r.length);let s=r.reduce((l,c)=>l*c,1),p=r.slice(n).reduce((l,c)=>l*c,1);return[s/p,p]}static squeezeShape(r,n){let s=new Array;n=Qt.normalizeAxes(n,r.length);for(let p=0;p<r.length;p++){let l=n.indexOf(p)>=0;if(l&&r[p]!==1)throw new Error("squeeze an axis of size different than 1");(n.length===0&&r[p]>1||n.length>0&&!l)&&s.push(r[p])}return s}static unsqueezeShape(r,n){let s=new Array(r.length+n.length);s.fill(0);for(let l=0;l<n.length;l++){let c=Qt.normalizeAxis(n[l],s.length);if(c>=s.length)throw new Error("'axes' has an out of range axis");if(s[c]!==0)throw new Error("'axes' has a duplicate axis");s[c]=1}let p=0;for(let l=0;l<s.length;l++)s[l]===0&&(s[l]=r[p++]);if(p!==r.length)throw new Error("the unsqueezed dimension could not be established");return s}},ho=class yl{static splitShape(r,n,s,p){if(s.length===0){if(!p)throw new Error("need to know number of outputs when the 'split' attribute is not specified");yl.determineSplit(r[n],p,s)}let l=[],c=[0];for(let o=0;o<s.length;++o){o!==0&&c.push(c[o-1]+s[o-1]);let a=r.slice();a[n]=s[o],l.push(a)}return[l,c]}static determineSplit(r,n,s){if(r%n!==0)throw new Error("cannot split tensor to equal sized parts");for(let p=0;p<n;++p)s.push(r/n)}},Gr=class er{static adjustPoolAttributes(r,n,s,p,l,c){if(!r&&s.length!==n.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(r)for(let o=0;o<n.length-2;o++)o>=s.length?s.push(n[o+2]):s[o]=n[o+2];for(let o=0;o<s.length;o++)if(o<p.length){if(p[o]<0)throw new Error("strides should be greater than or equal to 1")}else p.push(1);for(let o=0;o<s.length;o++)if(o<l.length){if(l[o]<0)throw new Error("dilations should be greater than or equal to 1")}else l.push(1);for(let o=0;o<s.length*2;o++)if(o<c.length){if(c[o]<0)throw new Error("pad should be greater than or equal to 1")}else c.push(0);for(let o=0;o<s.length;o++){if(s[o]<=0)throw new Error("kernel shapes need to be greater than 0");if(c[o]>=s[o]||c[o+s.length]>=s[o])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(r,n,s,p,l,c){if(c){if(l.length!==2*(r.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(n.length!==r.length-2)throw new Error("length of strides should be the length of data dimensions");if(p.length!==r.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let o=0;o<r.length-2;o++)er.adjustPadAndReturnShape(r[o+2],n[o],s[o],p[o],l,o,o+r.length-2,c)}}static computePoolOutputShape(r,n,s,p,l,c,o){if(n.length<=0)throw new Error("input shape must be of size greater than 0");let a=[n[0],n[1]];return er.computeShapeHelper(r,n,a,s,p,l,c,o),a}static computeConvOutputShape(r,n,s,p,l,c,o){if(r.length<=0||n.length<=0)throw new Error("invalid input tensor dims or invalid filter tensor dims");let a=[r[0],n[0]];return er.computeShapeHelper(!1,r,a,s,p,l,c,o),a}static computeShapeHelper(r,n,s,p,l,c,o,a){if(r)for(let e=0;e<n.length-2;e++)s.push(1);else for(let e=0;e<n.length-2;e++)s.push(er.adjustPadAndReturnShape(n[e+2],p[e],l[e],c[e],o,e,e+n.length-2,a))}static adjustPadAndReturnShape(r,n,s,p,l,c,o,a){let e=s*(p-1)+1;if(a&&a!=="NOTSET")switch(a){case"VALID":return l[c]=0,l[o]=0,Math.floor((r-e)/n+1);case"SAME_LOWER":case"SAME_UPPER":if(s!==1)throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");{let u=((r+n-1)/n-1)*n+p-r;return l[c]=Math.floor(a==="SAME_LOWER"?(u+1)/2:u/2),l[o]=u-l[c],Math.floor((r+u-p)/n+1)}default:throw new Error("Unsupported AutoPad type")}else return Math.floor((r+l[c]+l[o]-e)/n+1)}},dr=-34028234663852886e22,hr=34028234663852886e22});function Zh(t){switch(t){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 ${t}`)}}function wa(t){switch(t){case L.onnx.TensorProto.DataType.UINT8:case L.onnx.TensorProto.DataType.INT8:case L.onnx.TensorProto.DataType.BOOL:return 1;case L.onnx.TensorProto.DataType.UINT16:case L.onnx.TensorProto.DataType.INT16:return 2;case L.onnx.TensorProto.DataType.FLOAT:case L.onnx.TensorProto.DataType.INT32:case L.onnx.TensorProto.DataType.UINT32:return 4;case L.onnx.TensorProto.DataType.INT64:case L.onnx.TensorProto.DataType.DOUBLE:case L.onnx.TensorProto.DataType.UINT64:return 8;default:throw new Error(`cannot calculate sizeof() on type ${L.onnx.TensorProto.DataType[t]}`)}}function Jh(t,r){return new(wl(r))(t)}function wl(t){switch(t){case"bool":case"uint8":return Uint8Array;case"int8":return Int8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"float32":return Float32Array;case"float64":return Float64Array;default:throw new Error("unspecified error")}}function go(t,r){if(r===L.onnx.TensorProto.DataType.INT64||r===Vr.TensorDataType.INT64){if(t.greaterThanOrEqual(2147483648)||t.lessThan(-2147483648))throw new TypeError("int64 is not supported")}else if(r===L.onnx.TensorProto.DataType.UINT32||r===Vr.TensorDataType.UINT32||r===L.onnx.TensorProto.DataType.UINT64||r===Vr.TensorDataType.UINT64){if(t.greaterThanOrEqual(4294967296)||t.lessThan(0))throw new TypeError("uint64 is not supported")}else throw new TypeError(`not a LONG type: ${L.onnx.TensorProto.DataType[r]}`);return t.toNumber()}function va(t,r,n){switch(r){case L.onnx.TensorProto.DataType.BOOL:case L.onnx.TensorProto.DataType.UINT8:return t.getUint8(n);case L.onnx.TensorProto.DataType.INT8:return t.getInt8(n);case L.onnx.TensorProto.DataType.UINT16:return t.getUint16(n,!0);case L.onnx.TensorProto.DataType.INT16:return t.getInt16(n,!0);case L.onnx.TensorProto.DataType.FLOAT:return t.getFloat32(n,!0);case L.onnx.TensorProto.DataType.INT32:return t.getInt32(n,!0);case L.onnx.TensorProto.DataType.UINT32:return t.getUint32(n,!0);case L.onnx.TensorProto.DataType.INT64:return go(ee.fromBits(t.getUint32(n,!0),t.getUint32(n+4,!0),!1),r);case L.onnx.TensorProto.DataType.DOUBLE:return t.getFloat64(n,!0);case L.onnx.TensorProto.DataType.UINT64:return go(ee.fromBits(t.getUint32(n,!0),t.getUint32(n+4,!0),!0),r);default:throw new Error(`cannot read from DataView for type ${L.onnx.TensorProto.DataType[r]}`)}}var xa,L,Vr,Pt,De=I(()=>{"use strict";xa=Ie(Fh()),fl(),Zr(),L=Ie(mr()),U(),Vr=H.experimental.fbs,Pt=class Mr{constructor(r,n,s,p,l,c=xa.Guid.create()){this.dims=r,this.type=n,this.dataProvider=s,this.asyncDataProvider=p,this.cache=l,this.dataId=c,this.size=C.validateDimsAndCalcSize(r);let o=this.size,a=s===void 0&&p===void 0&&l===void 0;if(l!==void 0&&l.length!==o)throw new RangeError("Input dims doesn't match data length.");if(n==="string"){if(l!==void 0&&(!Array.isArray(l)||!l.every(e=>typeof e=="string")))throw new TypeError("cache should be a string array");a&&(this.cache=new Array(o))}else{if(l!==void 0){let e=wl(n);if(!(l instanceof e))throw new TypeError(`cache should be type ${e.name}`)}if(a){let e=new ArrayBuffer(o*Zh(n));this.cache=Jh(e,n)}}}get data(){if(this.cache===void 0){let r=this.dataProvider(this.dataId);if(r.length!==this.size)throw new Error("Length of data provided by the Data Provider is inconsistent with the dims of this Tensor.");this.cache=r}return this.cache}get stringData(){if(this.type!=="string")throw new TypeError("data type is not string");return this.data}get integerData(){switch(this.type){case"uint8":case"int8":case"uint16":case"int16":case"int32":case"uint32":case"bool":return this.data;default:throw new TypeError("data type is not integer (uint8, int8, uint16, int16, int32, uint32, bool)")}}get floatData(){switch(this.type){case"float32":case"float64":return this.data;default:throw new TypeError("data type is not float (float32, float64)")}}get numberData(){if(this.type!=="string")return this.data;throw new TypeError("type cannot be non-number (string)")}get(r){return this.data[C.indicesToOffset(r,this.strides)]}set(r,n){this.data[C.indicesToOffset(r,this.strides)]=n}async getData(){return this.cache===void 0&&(this.cache=await this.asyncDataProvider(this.dataId)),this.cache}get strides(){return this._strides||(this._strides=C.computeStrides(this.dims)),this._strides}static fromProto(r){if(!r)throw new Error("cannot construct Value from an empty tensor");let n=Et.tensorDataTypeFromProto(r.dataType),s=Et.tensorDimsFromProto(r.dims),p=new Mr(s,n);if(n==="string")r.stringData.forEach((l,c)=>{p.data[c]=co(l)});else if(r.rawData&&typeof r.rawData.byteLength=="number"&&r.rawData.byteLength>0){let l=p.data,c=new DataView(r.rawData.buffer,r.rawData.byteOffset,r.rawData.byteLength),o=wa(r.dataType),a=r.rawData.byteLength/o;if(r.rawData.byteLength%o!==0)throw new Error("invalid buffer length");if(l.length!==a)throw new Error("buffer length mismatch");for(let e=0;e<a;e++){let u=va(c,r.dataType,e*o);l[e]=u}}else{let l;switch(r.dataType){case L.onnx.TensorProto.DataType.FLOAT:l=r.floatData;break;case L.onnx.TensorProto.DataType.INT32:case L.onnx.TensorProto.DataType.INT16:case L.onnx.TensorProto.DataType.UINT16:case L.onnx.TensorProto.DataType.INT8:case L.onnx.TensorProto.DataType.UINT8:case L.onnx.TensorProto.DataType.BOOL:l=r.int32Data;break;case L.onnx.TensorProto.DataType.INT64:l=r.int64Data;break;case L.onnx.TensorProto.DataType.DOUBLE:l=r.doubleData;break;case L.onnx.TensorProto.DataType.UINT32:case L.onnx.TensorProto.DataType.UINT64:l=r.uint64Data;break;default:throw new Error("unspecific error")}if(l==null)throw new Error("failed to populate data from a tensorproto value");let c=p.data;if(c.length!==l.length)throw new Error("array length mismatch");for(let o=0;o<l.length;o++){let a=l[o];ee.isLong(a)?c[o]=go(a,r.dataType):c[o]=a}}return p}static fromData(r,n,s){return new Mr(n,s,void 0,void 0,r)}static fromOrtTensor(r){if(!r)throw new Error("cannot construct Value from an empty tensor");let n=Et.tensorDimsFromORTFormat(r),s=Et.tensorDataTypeFromProto(r.dataType()),p=new Mr(n,s);if(s==="string")for(let l=0;l<r.stringDataLength();l++)p.data[l]=r.stringData(l);else if(r.rawDataArray()&&typeof r.rawDataLength()=="number"&&r.rawDataLength()>0){let l=p.data,c=new DataView(r.rawDataArray().buffer,r.rawDataArray().byteOffset,r.rawDataLength()),o=wa(r.dataType()),a=r.rawDataLength()/o;if(r.rawDataLength()%o!==0)throw new Error("invalid buffer length");if(l.length!==a)throw new Error("buffer length mismatch");for(let e=0;e<a;e++){let u=va(c,r.dataType(),e*o);l[e]=u}}return p}}});function B(t){return t===1?vl:xl}function Yh(t){let r=B(t);return`${r.version}
2
2
  precision highp float;
3
3
  ${r.attribute} vec3 position;
4
4
  ${r.attribute} vec2 textureCoord;
@@ -1794,10 +1794,10 @@ ${t}
1794
1794
  `);let r=this.glContext.compileShader(t,this.glContext.gl.FRAGMENT_SHADER),n=this.glContext.createProgram(this.vertexShader,r);return this.glContext.deleteShader(r),n}bindOutput(t){let r=t.width,n=t.height;tt.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${r}/${n}, shape=${t.shape}, type=${t.tensor.type}`),this.glContext.attachFramebuffer(t.texture,r,n)}bindAttributes(t){let r=t.position,n=t.textureCoord;this.glContext.setVertexAttributes(r,n),this.attributesBound=!0}bindUniforms(t,r,n){let s=this.glContext.gl,p=0;for(let{name:l,type:c,location:o,arrayLength:a}of t){let e=r.find(u=>u.name===l)?.data;if(c!=="sampler2D"&&!e)throw new Error(`variable '${l}' does not have data defined in program info`);switch(c){case"sampler2D":this.bindTexture(n[p],o,p),p++;break;case"float":a?s.uniform1fv(o,e):s.uniform1f(o,e);break;case"int":a?s.uniform1iv(o,e):s.uniform1i(o,e);break;default:throw new Error(`Uniform not implemented: ${c}`)}}}bindTexture(t,r,n){this.glContext.bindTextureToUniform(t.texture,n,r)}getAttribLocations(t){return{position:this.getAttribLocation(t,"position"),textureCoord:this.getAttribLocation(t,"textureCoord")}}getUniformLocations(t,r,n){let s=[];if(r)for(let p of r)s.push({name:p,type:"sampler2D",location:this.getUniformLocation(t,p)});if(n)for(let p of n)s.push({...p,location:this.getUniformLocation(t,p.name)});return s}getUniformLocation(t,r){let n=this.glContext.gl.getUniformLocation(t,r);if(n===null)throw new Error(`Uniform ${r} not found.`);return n}getAttribLocation(t,r){return this.glContext.gl.getAttribLocation(t,r)}}}),Xc,Gg=I(()=>{"use strict";Rt(),Hr(),Xc=class{constructor(t,r,n,s){this.glContext=t,this.layoutStrategy=r,this.profiler=n,this.config=s,this.pendingRead=new Map,s.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(t,r,n,s){let p=this.toEncoderType(t),l=this.glContext.getEncoder(p,r.channels||1,s);if(r.isPacked&&s===1)throw new Error("not implemented");let c=r.width,o=r.height,a,e;if(this.config.reuseTextures){a=`${c}x${o}_${l.format}_${l.internalFormat}_${l.textureType}`,e=this.inUseTextures.get(a),e||(e=[],this.inUseTextures.set(a,e));let i=this.idleTextures.get(a);if(i&&i.length>0){let d=i.pop();return e.push(d),s===1&&this.glContext.updateTexture(d,c,o,l,this.toTextureData(t,n)),d}}tt.verbose("TextureManager",`Creating new texture of size ${r.width}x${r.height}`);let u=this.glContext.allocateTexture(c,o,l,this.toTextureData(t,n));return this.config.reuseTextures&&(e.push(u),this.textureLookup.set(u,a)),u}readTexture(t,r,n){return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",()=>{let s=t.shape.reduce((l,c)=>l*c)*n,p=this.glContext.readTexture(t.texture,t.width,t.height,s,this.toEncoderType(r),n);return this.toTensorData(r,p)})}async readTextureAsync(t,r,n){let s=t.tensor.dataId;if(n||(n=1),this.pendingRead.has(s)){let p=this.pendingRead.get(s);return new Promise(l=>p?.push(l))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(s,[]);let p=t.shape.reduce((a,e)=>a*e)*n;await this.glContext.createAndWaitForFence();let l=this.glContext.readTexture(t.texture,t.width,t.height,p,this.toEncoderType(r),n),c=this.toTensorData(r,l),o=this.pendingRead.get(s);return this.pendingRead.delete(s),o?.forEach(a=>a(c)),c})}readUint8TextureAsFloat(t){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{let r=t.shape.reduce((s,p)=>s*p),n=this.glContext.readTexture(t.texture,t.width,t.height,r*4,"byte",4);return new Float32Array(n.buffer,n.byteOffset,r)})}releaseTexture(t,r){let n;if(this.config.reuseTextures&&(n=this.textureLookup.get(t.texture),n)){r&&this.textureLookup.delete(n);let s=this.inUseTextures.get(n);if(s){let p=s.indexOf(t.texture);if(p!==-1){s.splice(p,1);let l=this.idleTextures.get(n);l||(l=[],this.idleTextures.set(n,l)),l.push(t.texture)}}}(!n||r)&&(tt.verbose("TextureManager",`Deleting texture of size ${t.width}x${t.height}`),this.glContext.deleteTexture(t.texture))}toTensorData(t,r){switch(t){case"int16":return r instanceof Int16Array?r:Int16Array.from(r);case"int32":return r instanceof Int32Array?r:Int32Array.from(r);case"int8":return r instanceof Int8Array?r:Int8Array.from(r);case"uint16":return r instanceof Uint16Array?r:Uint16Array.from(r);case"uint32":return r instanceof Uint32Array?r:Uint32Array.from(r);case"uint8":case"bool":return r instanceof Uint8Array?r:Uint8Array.from(r);case"float32":return r instanceof Float32Array?r:Float32Array.from(r);case"float64":return r instanceof Float64Array?r:Float64Array.from(r);default:throw new Error(`TensorData type ${t} is not supported`)}}toTextureData(t,r){if(r)return r instanceof Float32Array?r:new Float32Array(r)}toEncoderType(t){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}}),Kc,Hg=I(()=>{"use strict";Rt(),kh(),mf(),$g(),Ug(),Vc(),Gg(),Kc=class{constructor(t,r){this.backend=t,this.context=r,this.layoutStrategy=new Bc(t.glContext.maxTextureSize),this.programManager=new Wc(this.context.profiler,t.glContext,this.layoutStrategy),this.textureManager=new Xc(t.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:t.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new Pl(this)}onGraphInitialized(t){let r=t.getValues().filter(n=>n.from===-1&&n.tensor).map(n=>n.tensor.dataId);this.initializers=new Set(r)}isInitializer(t){return this.initializers?this.initializers.has(t):!1}addInitializer(t){this.initializers.add(t)}getTextureData(t,r){return r?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)}setTextureData(t,r,n=!1){tt.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(t,r):this.unpackedTextureDataCache.set(t,r)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(t=>this.textureManager.releaseTexture(t,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(t=>this.textureManager.releaseTexture(t,!0)),this.unpackedTextureDataCache=new Map}resolve(t,r,n){let s=Dh(t,r,Rc);return{impl:s.opImpl,context:s.opInit?s.opInit(t,n):t}}}});function qg(t){let r=0;for(;r<t.length&&t[r]();++r);return r-1}var Co,Wg=I(()=>{"use strict";zt(),Hr(),Hr(),qt(),Co=class{constructor(t,r){this.frameBufferBound=!1,this.itemsToPoll=[],this.gl=t,this.version=r,this.getExtensions(),this.vertexbuffer=this.createVertexbuffer(),this.framebuffer=this.createFramebuffer(),this.queryVitalParameters()}allocateTexture(t,r,n,s){let p=this.gl,l=p.createTexture();p.bindTexture(p.TEXTURE_2D,l),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE);let c=s?n.encode(s,t*r):null;return p.texImage2D(p.TEXTURE_2D,0,n.internalFormat,t,r,0,n.format,n.textureType,c),this.checkError(),l}updateTexture(t,r,n,s,p){let l=this.gl;l.bindTexture(l.TEXTURE_2D,t);let c=s.encode(p,r*n);l.texSubImage2D(l.TEXTURE_2D,0,0,0,r,n,s.format,s.textureType,c),this.checkError()}attachFramebuffer(t,r,n){let s=this.gl;s.bindTexture(s.TEXTURE_2D,t),s.bindFramebuffer(s.FRAMEBUFFER,this.framebuffer),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,t,0),this.checkError(),s.viewport(0,0,r,n),s.scissor(0,0,r,n)}readTexture(t,r,n,s,p,l){let c=this.gl;l||(l=1),this.frameBufferBound||this.attachFramebuffer(t,r,n);let o=this.getEncoder(p,l),a=o.allocate(r*n);return c.bindTexture(c.TEXTURE_2D,t),c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,t,0),c.readPixels(0,0,r,n,c.RGBA,o.textureType,a),this.checkError(),o.decode(a,s)}isFramebufferReady(){return!0}getActiveTexture(){let t=this.gl;return`TEXTURE${t.getParameter(this.gl.ACTIVE_TEXTURE)-t.TEXTURE0}`}getTextureBinding(){return this.gl.getParameter(this.gl.TEXTURE_BINDING_2D)}getFramebufferBinding(){return this.gl.getParameter(this.gl.FRAMEBUFFER_BINDING)}setVertexAttributes(t,r){let n=this.gl;n.vertexAttribPointer(t,3,n.FLOAT,!1,20,0),n.enableVertexAttribArray(t),r!==-1&&(n.vertexAttribPointer(r,2,n.FLOAT,!1,20,12),n.enableVertexAttribArray(r)),this.checkError()}createProgram(t,r){let n=this.gl,s=n.createProgram();return n.attachShader(s,t),n.attachShader(s,r),n.linkProgram(s),s}compileShader(t,r){let n=this.gl,s=n.createShader(r);if(!s)throw new Error(`createShader() returned null with type ${r}`);if(n.shaderSource(s,t),n.compileShader(s),n.getShaderParameter(s,n.COMPILE_STATUS)===!1)throw new Error(`Failed to compile shader: ${n.getShaderInfoLog(s)}
1795
1795
  Shader source:
1796
1796
  ${t}`);return s}deleteShader(t){this.gl.deleteShader(t)}bindTextureToUniform(t,r,n){let s=this.gl;s.activeTexture(s.TEXTURE0+r),this.checkError(),s.bindTexture(s.TEXTURE_2D,t),this.checkError(),s.uniform1i(n,r),this.checkError()}draw(){this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4),this.checkError()}checkError(){if(j.debug){let t=this.gl,r=t.getError(),n="";switch(r){case t.NO_ERROR:return;case t.INVALID_ENUM:n="INVALID_ENUM";break;case t.INVALID_VALUE:n="INVALID_VALUE";break;case t.INVALID_OPERATION:n="INVALID_OPERATION";break;case t.INVALID_FRAMEBUFFER_OPERATION:n="INVALID_FRAMEBUFFER_OPERATION";break;case t.OUT_OF_MEMORY:n="OUT_OF_MEMORY";break;case t.CONTEXT_LOST_WEBGL:n="CONTEXT_LOST_WEBGL";break;default:n=`Unknown WebGL Error: ${r.toString(16)}`}throw new Error(n)}}deleteTexture(t){this.gl.deleteTexture(t)}deleteProgram(t){this.gl.deleteProgram(t)}getEncoder(t,r,n=0){if(this.version===2)return new Ol(this.gl,r);switch(t){case"float":return n===1||this.isRenderFloat32Supported?new bo(this.gl,r):new bo(this.gl,r,this.textureHalfFloatExtension.HALF_FLOAT_OES);case"int":throw new Error("not implemented");case"byte":return new El(this.gl,r);default:throw new Error(`Invalid dataType: ${t}`)}}clearActiveTextures(){let t=this.gl;for(let r=0;r<this.maxTextureImageUnits;++r)t.activeTexture(t.TEXTURE0+r),t.bindTexture(t.TEXTURE_2D,null)}dispose(){if(this.disposed)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(this.framebuffer),t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(this.vertexbuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.finish(),this.disposed=!0}createDefaultGeometry(){return new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0])}createVertexbuffer(){let t=this.gl,r=t.createBuffer();if(!r)throw new Error("createBuffer() returned null");let n=this.createDefaultGeometry();return t.bindBuffer(t.ARRAY_BUFFER,r),t.bufferData(t.ARRAY_BUFFER,n,t.STATIC_DRAW),this.checkError(),r}createFramebuffer(){let t=this.gl.createFramebuffer();if(!t)throw new Error("createFramebuffer returned null");return t}queryVitalParameters(){let t=this.gl;if(this.isFloatTextureAttachableToFrameBuffer=this.checkFloatTextureAttachableToFrameBuffer(),this.isRenderFloat32Supported=this.checkRenderFloat32(),this.isFloat32DownloadSupported=this.checkFloat32Download(),this.version===1&&!this.textureHalfFloatExtension&&!this.isRenderFloat32Supported)throw new Error("both float32 and float16 TextureType are not supported");this.isBlendSupported=!this.isRenderFloat32Supported||this.checkFloat32Blend(),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxTextureImageUnits=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.version}getExtensions(){this.version===2?(this.colorBufferFloatExtension=this.gl.getExtension("EXT_color_buffer_float"),this.disjointTimerQueryWebgl2Extension=this.gl.getExtension("EXT_disjoint_timer_query_webgl2")):(this.textureFloatExtension=this.gl.getExtension("OES_texture_float"),this.textureHalfFloatExtension=this.gl.getExtension("OES_texture_half_float"))}checkFloatTextureAttachableToFrameBuffer(){let t=this.gl,r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);let n=this.version===2?t.RGBA32F:t.RGBA;t.texImage2D(t.TEXTURE_2D,0,n,1,1,0,t.RGBA,t.FLOAT,null);let s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0);let p=t.checkFramebufferStatus(t.FRAMEBUFFER)===t.FRAMEBUFFER_COMPLETE;return t.bindTexture(t.TEXTURE_2D,null),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteTexture(r),t.deleteFramebuffer(s),p}checkRenderFloat32(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension)return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Download(){if(this.version===2){if(!this.colorBufferFloatExtension)return!1}else if(!this.textureFloatExtension||!this.gl.getExtension("WEBGL_color_buffer_float"))return!1;return this.isFloatTextureAttachableToFrameBuffer}checkFloat32Blend(){let t=this.gl,r,n,s,p,l;try{r=t.createTexture(),n=t.createFramebuffer(),t.bindTexture(t.TEXTURE_2D,r);let c=this.version===2?t.RGBA32F:t.RGBA;return t.texImage2D(t.TEXTURE_2D,0,c,1,1,0,t.RGBA,t.FLOAT,null),t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.enable(t.BLEND),s=t.createShader(t.VERTEX_SHADER),!s||(t.shaderSource(s,"void main(){}"),t.compileShader(s),p=t.createShader(t.FRAGMENT_SHADER),!p)||(t.shaderSource(p,"precision highp float;void main(){gl_FragColor=vec4(0.5);}"),t.compileShader(p),l=t.createProgram(),!l)?!1:(t.attachShader(l,s),t.attachShader(l,p),t.linkProgram(l),t.useProgram(l),t.drawArrays(t.POINTS,0,1),t.getError()===t.NO_ERROR)}finally{t.disable(t.BLEND),l&&t.deleteProgram(l),s&&t.deleteShader(s),p&&t.deleteShader(p),n&&(t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(n)),r&&(t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(r))}}beginTimer(){if(this.version===2&&this.disjointTimerQueryWebgl2Extension){let t=this.gl,r=this.disjointTimerQueryWebgl2Extension,n=t.createQuery();return t.beginQuery(r.TIME_ELAPSED_EXT,n),n}else throw new Error("WebGL1 profiling currently not supported.")}endTimer(){if(this.version===2&&this.disjointTimerQueryWebgl2Extension){let t=this.gl,r=this.disjointTimerQueryWebgl2Extension;t.endQuery(r.TIME_ELAPSED_EXT);return}else throw new Error("WebGL1 profiling currently not supported")}isTimerResultAvailable(t){let r=!1,n=!1;if(this.version===2&&this.disjointTimerQueryWebgl2Extension){let s=this.gl,p=this.disjointTimerQueryWebgl2Extension;r=s.getQueryParameter(t,s.QUERY_RESULT_AVAILABLE),n=s.getParameter(p.GPU_DISJOINT_EXT)}else throw new Error("WebGL1 profiling currently not supported");return r&&!n}getTimerResult(t){let r=0;if(this.version===2){let n=this.gl;r=n.getQueryParameter(t,n.QUERY_RESULT),n.deleteQuery(t)}else throw new Error("WebGL1 profiling currently not supported");return r/1e6}async waitForQueryAndGetTime(t){return await Ta(()=>this.isTimerResultAvailable(t)),this.getTimerResult(t)}async createAndWaitForFence(){let t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let r,n=t,s=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),s===null?r=()=>!0:r=()=>{let p=n.clientWaitSync(s,0,0);return p===n.ALREADY_SIGNALED||p===n.CONDITION_SATISFIED},{query:s,isFencePassed:r}}async pollFence(t){return new Promise(r=>{this.addItemToPoll(()=>t.isFencePassed(),()=>r())})}pollItems(){let t=qg(this.itemsToPoll.map(r=>r.isDoneFn));for(let r=0;r<=t;++r){let{resolveFn:n}=this.itemsToPoll[r];n()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}async addItemToPoll(t,r){this.itemsToPoll.push({isDoneFn:t,resolveFn:r}),!(this.itemsToPoll.length>1)&&await Ta(()=>(this.pollItems(),this.itemsToPoll.length===0))}}});function Zc(t){let r;if((!t||t==="webgl2")&&"webgl2"in ge?r=ge.webgl2:(!t||t==="webgl")&&"webgl"in ge&&(r=ge.webgl),!r)try{let s=Kg();r=Ou(s,t)}catch{let s=Xg();r=Ou(s,t)}t=t||r.version===1?"webgl":"webgl2";let n=r.gl;return ge[t]=r,n.isContextLost()?(delete ge[t],Zc(t)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),r)}function Ou(t,r){let n={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1},s,p=n;if((!r||r==="webgl2")&&(s=t.getContext("webgl2",p),s))try{return new Co(s,2)}catch(l){tt.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${l}`)}if((!r||r==="webgl")&&(s=t.getContext("webgl",p)||t.getContext("experimental-webgl",p),s))try{return new Co(s,1)}catch(l){tt.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${l}`)}throw new Error("WebGL is not supported")}function Xg(){if(typeof document>"u")throw new TypeError("failed to create canvas: document is not supported");let t=document.createElement("canvas");return t.width=1,t.height=1,t}function Kg(){if(typeof OffscreenCanvas>"u")throw new TypeError("failed to create offscreen canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}var ge,Zg=I(()=>{"use strict";Rt(),Wg(),ge={}}),Jc,Jg=I(()=>{"use strict";zt(),Rt(),Hg(),Zg(),Jc=class{get contextId(){return j.webgl.contextId}set contextId(t){j.webgl.contextId=t}get matmulMaxBatchSize(){return j.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(t){j.webgl.matmulMaxBatchSize=t}get textureCacheMode(){return j.webgl.textureCacheMode}set textureCacheMode(t){j.webgl.textureCacheMode=t}get pack(){return j.webgl.pack}set pack(t){j.webgl.pack=t}get async(){return j.webgl.async}set async(t){j.webgl.async=t}initialize(){try{return this.glContext=Zc(this.contextId),typeof this.matmulMaxBatchSize!="number"&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!="string"&&(this.textureCacheMode="full"),typeof this.pack!="boolean"&&(this.pack=!1),typeof this.async!="boolean"&&(this.async=!1),tt.setWithEnv(j),j.webgl.context||Object.defineProperty(j.webgl,"context",{value:this.glContext.gl}),tt.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(t){return tt.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${t}`),!1}}createSessionHandler(t){return new Kc(this,t)}dispose(){this.glContext.dispose()}}});async function Yc(t){if(t){let r=typeof t=="string"?[t]:t;for(let n of r){let s=Yo.get(n);if(s)return s;let p=await Yg(n);if(p)return p}}else return Yc(["webgl"]);throw new Error("no available backend to use")}async function Yg(t){let r=Qc;if(typeof r[t]<"u"&&Qg(r[t])){let n=r[t],s=n.initialize();if(typeof s=="object"&&"then"in s&&(s=await s),s)return Yo.set(t,n),n}}function Qg(t){let r=t;return"initialize"in r&&typeof r.initialize=="function"&&"createSessionHandler"in r&&typeof r.createSessionHandler=="function"&&"dispose"in r&&typeof r.dispose=="function"}var Yo,Qc,tm=I(()=>{"use strict";Jg(),Yo=new Map,Qc={webgl:new Jc}}),Eu,td,em=I(()=>{"use strict";Rt(),Eu=class{constructor(t,r){this.op=t,this.node=r}},td=class{constructor(t,r,n){this.graph=t,this.profiler=n,this.initialize(r)}initialize(t){this.profiler.event("session","ExecutionPlan.initialize",()=>{let r=this.graph.getNodes();if(r.length!==t.length)throw new Error("The size of nodes and OPs do not match.");this._ops=t.map((n,s)=>new Eu(n,r[s])),this.reset(),this._starter=[],this._ops.forEach((n,s)=>{let p=!0;for(let l of n.node.inputs)if(!this._values[l]&&this.graph.getInputIndices().indexOf(l)===-1){p=!1;break}p&&this._starter.push(s)})})}reset(){this._values=this.graph.getValues().map(t=>t.tensor)}async execute(t,r){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();let n=t.createInferenceHandler(),s=this.graph.getInputIndices();if(r.length!==s.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${r.length} expected: ${s.length}`);r.forEach((e,u)=>{let i=s[u];this._values[i]=e});let p=this._starter.slice(0),l=this.graph.getValues(),c=this.graph.getNodes(),o=0;for(;o<p.length;){let e=p[o++],u=this._ops[e],i=u.node.inputs.map(b=>this._values[b]);if(i.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${u.node}`);let d=i;tt.verbose("ExecPlan",`Running op:${u.node.name} (${d.map((b,x)=>`'${u.node.inputs[x]}': ${b.type}[${b.dims.join(",")}]`).join(", ")})`);let h=await this.profiler.event("node",u.node.name,async()=>u.op.impl(n,d,u.op.context));if(h.length!==u.node.outputs.length)throw new Error("the size of output does not match model definition.");h.forEach((b,x)=>{let E=u.node.outputs[x];if(this._values[E])throw new Error(`output [${E}] already has value: op:${u.node.name}`);this._values[E]=b});let m=new Set;h.forEach((b,x)=>{let E=u.node.outputs[x];for(let w of l[E].to){let S=c[w],$=!0;for(let F of S.inputs)if(!this._values[F]){$=!1;break}$&&m.add(w)}}),p.push(...m)}let a=[];for(let e=0;e<this.graph.getOutputIndices().length;e++){let u=this.graph.getOutputIndices()[e],i=this._values[u];if(i===void 0)throw new Error(`required output [${u}] does not have value`);u===0?await i.getData():i.data,a.push(i)}return tt.verbose("ExecPlan","disposing of inferenceHandler"),n.dispose(),a})}}}),R,Ot,Lo,rm=I(()=>{"use strict";Zr(),R=Ie(mr()),De(),U(),Ot=H.experimental.fbs,Lo=class or{constructor(r){if(this._attributes=new Map,r!=null){for(let n of r)n instanceof R.onnx.AttributeProto?this._attributes.set(n.name,[or.getValue(n),or.getType(n)]):n instanceof Ot.Attribute&&this._attributes.set(n.name(),[or.getValue(n),or.getType(n)]);if(this._attributes.size<r.length)throw new Error("duplicated attribute names")}}set(r,n,s){this._attributes.set(r,[s,n])}delete(r){this._attributes.delete(r)}getFloat(r,n){return this.get(r,"float",n)}getInt(r,n){return this.get(r,"int",n)}getString(r,n){return this.get(r,"string",n)}getTensor(r,n){return this.get(r,"tensor",n)}getFloats(r,n){return this.get(r,"floats",n)}getInts(r,n){return this.get(r,"ints",n)}getStrings(r,n){return this.get(r,"strings",n)}getTensors(r,n){return this.get(r,"tensors",n)}get(r,n,s){let p=this._attributes.get(r);if(p===void 0){if(s!==void 0)return s;throw new Error(`required attribute not found: ${r}`)}if(p[1]!==n)throw new Error(`type mismatch: expected ${n} but got ${p[1]}`);return p[0]}static getType(r){let n=r instanceof R.onnx.AttributeProto?r.type:r.type();switch(n){case R.onnx.AttributeProto.AttributeType.FLOAT:return"float";case R.onnx.AttributeProto.AttributeType.INT:return"int";case R.onnx.AttributeProto.AttributeType.STRING:return"string";case R.onnx.AttributeProto.AttributeType.TENSOR:return"tensor";case R.onnx.AttributeProto.AttributeType.FLOATS:return"floats";case R.onnx.AttributeProto.AttributeType.INTS:return"ints";case R.onnx.AttributeProto.AttributeType.STRINGS:return"strings";case R.onnx.AttributeProto.AttributeType.TENSORS:return"tensors";default:throw new Error(`attribute type is not supported yet: ${R.onnx.AttributeProto.AttributeType[n]}`)}}static getValue(r){let n=r instanceof R.onnx.AttributeProto?r.type:r.type();if(n===R.onnx.AttributeProto.AttributeType.GRAPH||n===R.onnx.AttributeProto.AttributeType.GRAPHS)throw new Error("graph attribute is not supported yet");let s=this.getValueNoCheck(r);if(n===R.onnx.AttributeProto.AttributeType.INT&&Vt.isLong(s))return Vt.longToNumber(s);if(n===R.onnx.AttributeProto.AttributeType.INTS){let p=s,l=new Array(p.length);for(let c=0;c<p.length;c++){let o=p[c];l[c]=Vt.longToNumber(o)}return l}if(n===R.onnx.AttributeProto.AttributeType.TENSOR)return r instanceof R.onnx.AttributeProto?Pt.fromProto(s):Pt.fromOrtTensor(s);if(n===R.onnx.AttributeProto.AttributeType.TENSORS){if(r instanceof R.onnx.AttributeProto)return s.map(p=>Pt.fromProto(p));if(r instanceof Ot.Attribute)return s.map(p=>Pt.fromOrtTensor(p))}return n===R.onnx.AttributeProto.AttributeType.STRING&&r instanceof R.onnx.AttributeProto?co(s):n===R.onnx.AttributeProto.AttributeType.STRINGS&&r instanceof R.onnx.AttributeProto?s.map(co):s}static getValueNoCheck(r){return r instanceof R.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(r):this.getValueNoCheckFromOrtFormat(r)}static getValueNoCheckFromOnnxFormat(r){switch(r.type){case R.onnx.AttributeProto.AttributeType.FLOAT:return r.f;case R.onnx.AttributeProto.AttributeType.INT:return r.i;case R.onnx.AttributeProto.AttributeType.STRING:return r.s;case R.onnx.AttributeProto.AttributeType.TENSOR:return r.t;case R.onnx.AttributeProto.AttributeType.GRAPH:return r.g;case R.onnx.AttributeProto.AttributeType.FLOATS:return r.floats;case R.onnx.AttributeProto.AttributeType.INTS:return r.ints;case R.onnx.AttributeProto.AttributeType.STRINGS:return r.strings;case R.onnx.AttributeProto.AttributeType.TENSORS:return r.tensors;case R.onnx.AttributeProto.AttributeType.GRAPHS:return r.graphs;default:throw new Error(`unsupported attribute type: ${R.onnx.AttributeProto.AttributeType[r.type]}`)}}static getValueNoCheckFromOrtFormat(r){switch(r.type()){case Ot.AttributeType.FLOAT:return r.f();case Ot.AttributeType.INT:return r.i();case Ot.AttributeType.STRING:return r.s();case Ot.AttributeType.TENSOR:return r.t();case Ot.AttributeType.GRAPH:return r.g();case Ot.AttributeType.FLOATS:return r.floatsArray();case Ot.AttributeType.INTS:{let n=[];for(let s=0;s<r.intsLength();s++)n.push(r.ints(s));return n}case Ot.AttributeType.STRINGS:{let n=[];for(let s=0;s<r.stringsLength();s++)n.push(r.strings(s));return n}case Ot.AttributeType.TENSORS:{let n=[];for(let s=0;s<r.tensorsLength();s++)n.push(r.tensors(s));return n}default:throw new Error(`unsupported attribute type: ${Ot.AttributeType[r.type()]}`)}}}}),Hn,Xe,Ro,Ht,qn,Iu,nm=I(()=>{"use strict";rm(),Zr(),Hn=Ie(mr()),De(),U(),Xe=H.experimental.fbs,Ro={from:(t,r)=>new Iu(t,r)},Ht=class{constructor(t){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t&&(this.type=Et.tensorValueTypeFromProto(t.type.tensorType))}get from(){return this._from}get to(){return this._to}},qn=class{constructor(t,r){t instanceof Hn.onnx.NodeProto?(this.name=t.name,this.opType=t.opType,this.attributes=new Lo(t.attribute)):t instanceof Xe.Node&&(this.name=r??t.name(),this.opType=t.opType(),this.attributes=new Lo(Et.tensorAttributesFromORTFormat(t))),this.inputs=[],this.outputs=[],this.executeNode=!0}},Iu=class{constructor(t,r){if(!t)throw new TypeError("graph is empty");this.buildGraph(t),this.transformGraph(r),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(t){if(t instanceof Hn.onnx.GraphProto)this.buildGraphFromOnnxFormat(t);else if(t instanceof Xe.Graph)this.buildGraphFromOrtFormat(t);else throw new TypeError("Graph type is not supported.")}buildGraphFromOnnxFormat(t){let r=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];let n=new Map;if(!t.input)throw new Error("missing information in graph: input");let s=[];for(let p of t.input){if(r.has(p.name))throw new Error(`duplicated input name: ${p.name}`);let l=this._allData.push(new Ht(p))-1;r.set(p.name,l),s.push(p.name)}if(!t.initializer)throw new Error("missing information in graph: initializer");for(let p of t.initializer){let l=r.get(p.name);if(l===void 0){let c=new Ht;c.type={shape:{dims:Et.tensorDimsFromProto(p.dims)},tensorType:Et.tensorDataTypeFromProto(p.dataType)},l=this._allData.push(c)-1,r.set(p.name,l)}this._allData[l]._from=-1,this._allData[l].tensor=Pt.fromProto(p)}for(let p=0;p<this._allData.length;p++)this._allData[p].tensor||(this._allInputIndices.push(p),this._allInputNames.push(s[p]));if(!t.output)throw new Error("missing information in graph: output");for(let p of t.output){if(r.has(p.name))throw new Error(`duplicated output name: ${p.name}`);let l=this._allData.push(new Ht(p))-1;r.set(p.name,l),this._allOutputIndices.push(l),this._allOutputNames.push(p.name)}if(!t.node)throw new Error("missing information in graph: node");for(let p of t.node){if(!p.name)for(let c=0;;c++){let o=`unnamed_${p.opType}_${c}`;if(!n.has(o)){p.name=o;break}}if(n.has(p.name))throw new Error(`duplicated node name: ${p.name}`);let l=this._nodes.push(new qn(p))-1;n.set(p.name,l)}for(let p=0;p<this._nodes.length;p++){let l=this._nodes[p],c=t.node[p];if(!c.output)throw new Error(`missing output for node: ${c.name}`);for(let o of c.output){let a=r.get(o);if(typeof a>"u"&&(a=this._allData.push(new Ht)-1,r.set(o,a)),l.outputs.push(a),this._allData[a]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${a}`);if(this._allData[a]._from=p,c.opType==="Constant"){if(!c.attribute||c.attribute.length!==1||!c.attribute[0].t)throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(!c.output||c.output.length!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");l.outputs.pop(),l.executeNode=!1,this._allData[a]._from=-1,this._allData[a].tensor=Pt.fromProto(c.attribute[0].t)}}}for(let p=0;p<this._nodes.length;p++){let l=this._nodes[p],c=t.node[p];if(!c.input)throw new Error(`missing input for node: ${c.name}`);for(let o of c.input){let a=r.get(o);if(typeof a>"u"){if(o===""&&(c.input.length===3||c.input.length===4)&&c.opType==="Resize")continue;throw new Error(`unrecognized input '${o}' for node: ${c.name}`)}l.inputs.push(a),this._allData[a]._to.push(p)}}return!0}buildGraphFromOrtFormat(t){let r=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];let n=new Map,s=[];for(let p=0;p<t.inputsLength();p++){let l=t.inputs(p);if(r.has(l))throw new Error(`duplicated input name: ${l}`);for(let c=0;c<t.nodeArgsLength();c++)if(t.nodeArgs(c)?.name()===l){let o=new Ht;if(t.nodeArgs(c)?.type()?.valueType()!==Xe.TypeInfoValue.tensor_type)throw new Error("Unexpected value type for the nodeArg.");let a=t.nodeArgs(c).type().value(new Xe.TensorTypeAndShape),e=Et.tensorDataTypeFromProto(a.elemType()),u=a.shape(),i=[];for(let h=0;h<u.dimLength();h++)i.push(Vt.longToNumber(u.dim(h).value().dimValue()));o.type={shape:{dims:i},tensorType:e};let d=this._allData.push(o)-1;r.set(l,d),s.push(l)}}for(let p=0;p<t.initializersLength();p++){let l=t.initializers(p),c=r.get(l.name());if(c===void 0){let o=new Ht,a=Et.tensorDimsFromORTFormat(l),e=Et.tensorDataTypeFromProto(l.dataType());o.type={shape:{dims:a},tensorType:e},c=this._allData.push(o)-1,r.set(l.name(),c)}this._allData[c]._from=-1,this._allData[c].tensor=Pt.fromOrtTensor(l)}for(let p=0;p<this._allData.length;p++)this._allData[p].tensor||(this._allInputIndices.push(p),this._allInputNames.push(s[p]));for(let p=0;p<t.outputsLength();p++){let l=t.outputs(p);if(r.has(l))throw new Error(`duplicated output name: ${l}`);let c=this._allData.push(new Ht)-1;r.set(l,c),this._allOutputIndices.push(c),this._allOutputNames.push(l)}if(!t.nodes)throw new Error("missing information in graph: node");for(let p=0;p<t.nodesLength();p++){let l=t.nodes(p),c=l.name();if(!c)for(let a=0;c=`unnamed_${l.opType()}_${a}`,!!n.has(c);a++);if(n.has(c))throw new Error(`duplicated node name: ${c}`);let o=this._nodes.push(new qn(l,c))-1;n.set(c,o)}for(let p=0;p<this._nodes.length;p++){let l=this._nodes[p],c=t.nodes(p);if(c==null)throw new Error(`No node exists at index ${p}`);if(c?.outputsLength()===0)throw new Error(`missing output for node: ${c.name}`);for(let o=0;o<c?.outputsLength();o++){let a=c?.outputs(o),e=r.get(a);if(typeof e>"u"&&(e=this._allData.push(new Ht)-1,r.set(a,e)),l.outputs.push(e),this._allData[e]._from!==void 0)throw new Error(`multiple nodes output to one data value: ${e}`);if(this._allData[e]._from=p,c.opType()==="Constant"){if(c.attributesLength()!==1||!c.attributes(0).t())throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");if(c.outputsLength()!==1)throw new Error("missing output or incorrect number of outputs for this Constant operator");l.outputs.pop(),l.executeNode=!1,this._allData[e]._from=-1,this._allData[e].tensor=Pt.fromOrtTensor(c.attributes(0).t())}}}for(let p=0;p<this._nodes.length;p++){let l=this._nodes[p],c=t.nodes(p);if(c.inputsLength()===0)throw new Error(`missing input for node: ${c.name}`);for(let o=0;o<c.inputsLength();o++){let a=c.inputs(o),e=r.get(a);if(typeof e>"u")throw new Error(`unrecognized input '${a}' for node: ${c.name()}`);l.inputs.push(e),this._allData[e]._to.push(p)}}}checkIsAcyclic(){let t=new Set;this._allInputIndices.forEach(s=>{this._allData[s]._to.forEach(p=>{t.add(p)})});let r=Array.from(t),n=new Array(this._nodes.length).fill("white");for(;r.length>0;){let s=r.pop();n[s]==="gray"?n[s]="black":(r.push(s),n[s]="gray",this._nodes[s].outputs.forEach(p=>{let l=this._allData[p];if(typeof l.tensor<"u")throw new Error("node outputs should not be initialized");if(l._from!==s)throw new Error("from property of the Value object doesn't match index of Node being processed");l._to.forEach(c=>{if(n[c]==="gray")throw new Error("model graph is cyclic");n[c]==="white"&&r.push(c)})}))}}transformGraph(t){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t&&t.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let t=0,r=new Array(this._nodes.length,0),n=0;for(let s=0;s<this._nodes.length;s++)r[s]=n,this._nodes[s].executeNode?(n!==s&&(this._nodes[n]=this._nodes[s]),n++):this._nodes[s].outputs.forEach(p=>{this._allData[p]._from=-2});this._nodes.splice(n,this._nodes.length-n);for(let s=0;s<this._allData.length;s++){let p=this._allData[s];p._from!==void 0&&p._from!==-1&&p._from!==-2&&(p._from=r[p._from]);for(let l=0;l<p._to.length;l++)if(p._to[l]>=0)p._to[l]=r[p._to[l]];else throw new Error("Trying to update a removed node")}t=0;for(let s=0;s<this._allData.length;s++){if(this._allData[s].from===-2&&this._allOutputIndices.indexOf(s+t)===-1){t++,this._allData.splice(s,1),s--;continue}if(t>0){let p=-1;this._allData[s].from!==void 0&&this._allData[s].from!==-1?(p=this._nodes[this._allData[s].from].outputs.indexOf(s+t),p!==-1&&(this._nodes[this._allData[s].from].outputs[p]=s)):(p=this._allInputIndices.indexOf(s+t),p!==-1&&(this._allInputIndices[p]=s)),this._allData[s].to.forEach(l=>{p=this._nodes[l].inputs.indexOf(s+t),p!==-1&&(this._nodes[l].inputs[p]=s)}),this._allData[s].to.length===0&&(p=this._allOutputIndices.indexOf(s+t),p!==-1&&(this._allOutputIndices[p]=s))}}}deleteNode(t){let r=this._nodes[t];if(r.outputs.length>1){for(let c=1;c<r.outputs.length;c++)if(this._allData[r.outputs[c]].to.length>0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}r.executeNode=!1;let n=r.inputs[0],s=r.outputs[0],p=this._allData[s].to;for(let c=0;c<r.inputs.length;c++){let o=this._allData[r.inputs[c]].to.indexOf(t);if(o===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[r.inputs[c]].to.splice(o,1)}this._allData[s]._to=[];let l=this._allOutputIndices.indexOf(s);if(l!==-1&&(this._allOutputIndices[l]=n),p&&p.length>0)for(let c of p){let o=this._nodes[c].inputs.indexOf(s);if(o===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[c].inputs[o]=n,this._allData[n].to.push(c)}}removeAllDropoutNodes(){let t=0;for(let r of this._nodes){if(r.opType==="Dropout"){if(r.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(r.outputs.length!==1&&r.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(r.outputs.length===2&&this._allData[r.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(t)}t++}}removeAllIdentityNodes(){let t=0;for(let r of this._nodes)r.opType==="Identity"&&this.deleteNode(t),t++}isActivation(t){switch(t.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(let t of this._nodes)if(t.opType==="Conv"){let r=this._allData[t.outputs[0]]._to;if(r.length===1&&this.isActivation(this._nodes[r[0]])){let n=this._nodes[r[0]];if(n.opType==="Clip")if(n.inputs.length===1)try{t.attributes.set("activation_params","floats",[n.attributes.getFloat("min"),n.attributes.getFloat("max")])}catch{t.attributes.set("activation_params","floats",[dr,hr])}else if(n.inputs.length>=3&&this._allData[n.inputs[1]].tensor!==void 0&&this._allData[n.inputs[2]].tensor!==void 0)t.attributes.set("activation_params","floats",[this._allData[n.inputs[1]].tensor.floatData[0],this._allData[n.inputs[2]].tensor.floatData[0]]);else continue;t.attributes.set("activation","string",n.opType),this.deleteNode(r[0])}}}}}),Pu,Au,ed,om=I(()=>{"use strict";Ho(),nm(),Zr(),Pu=Ie(mr()),U(),Au=H.experimental.fbs,ed=class{constructor(){}load(t,r,n){let s;if(!n)try{this.loadFromOnnxFormat(t,r);return}catch(p){if(n!==void 0)throw p;s=p}try{this.loadFromOrtFormat(t,r)}catch(p){throw n!==void 0?p:new Error(`Failed to load model as ONNX format: ${s}
1797
- as ORT format: ${p}`)}}loadFromOnnxFormat(t,r){let n=Pu.onnx.ModelProto.decode(t);if(Vt.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map(s=>({domain:s.domain,version:Vt.longToNumber(s.version)})),this._graph=Ro.from(n.graph,r)}loadFromOrtFormat(t,r){let n=new T.ByteBuffer(t),s=Au.InferenceSession.getRootAsInferenceSession(n).model();if(Vt.longToNumber(s.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let p=0;p<s.opsetImportLength();p++){let l=s.opsetImport(p);this._opsets.push({domain:l?.domain(),version:Vt.longToNumber(l.version())})}this._graph=Ro.from(s.graph(),r)}get graph(){return this._graph}get opsets(){return this._opsets}}}),rd,im=I(()=>{"use strict";tm(),em(),Rt(),om(),rd=class{constructor(t={}){this._initialized=!1,this.backendHint=t.backendHint,this.profiler=hl.create(t.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(t,r,n){await this.profiler.event("session","Session.loadModel",async()=>{let s=await Yc(this.backendHint);if(this.sessionHandler=s.createSessionHandler(this.context),this._model=new ed,typeof t=="string"){let p=t.endsWith(".ort");{let l=await(await fetch(t)).arrayBuffer();this.initialize(new Uint8Array(l),p)}}else if(ArrayBuffer.isView(t))this.initialize(t);else{let p=new Uint8Array(t,r||0,n||t.byteLength);this.initialize(p)}})}initialize(t,r){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{let n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(t,n,r),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new td(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(t){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{let r=this.normalizeAndValidateInputs(t),n=await this._executionPlan.execute(this.sessionHandler,r);return this.createOutput(n)})}normalizeAndValidateInputs(t){let r=this._model.graph.getInputNames();if(Array.isArray(t)){if(t.length!==r.length)throw new Error(`incorrect input array length: expected ${r.length} but got ${t.length}`)}else{if(t.size!==r.length)throw new Error(`incorrect input map size: expected ${r.length} but got ${t.size}`);let n=new Array(t.size),s=0;for(let p=0;p<r.length;++p){let l=t.get(r[p]);if(!l)throw new Error(`missing input tensor for: '${name}'`);n[s++]=l}t=n}if(!this.context.graphInputTypes||this.context.graphInputTypes.length===0||!this.context.graphInputDims||this.context.graphInputDims.length===0){let n=this._model.graph.getInputIndices(),s=this._model.graph.getValues(),p=new Array(n.length);for(let l=0;l<n.length;++l){let c=s[n[l]];p[l]=c.type.shape.dims,this.context.graphInputTypes.push(c.type.tensorType),this.context.graphInputDims.push(t[l].dims)}this.validateInputTensorDims(p,t,!0)}else this.validateInputTensorDims(this.context.graphInputDims,t,!1);return this.validateInputTensorTypes(this.context.graphInputTypes,t),t}validateInputTensorTypes(t,r){for(let n=0;n<r.length;n++){let s=t[n],p=r[n].type;if(s!==p)throw new Error(`input tensor[${n}] check failed: expected type '${s}' but got ${p}`)}}validateInputTensorDims(t,r,n){for(let s=0;s<r.length;s++){let p=t[s],l=r[s].dims;if(!this.compareTensorDims(p,l,n))throw new Error(`input tensor[${s}] check failed: expected shape '[${p.join(",")}]' but got [${l.join(",")}]`)}}compareTensorDims(t,r,n){if(t.length!==r.length)return!1;for(let s=0;s<t.length;++s)if(t[s]!==r[s]&&(!n||t[s]!==0))return!1;return!0}createOutput(t){let r=this._model.graph.getOutputNames();if(t.length!==r.length)throw new Error("expected number of outputs do not match number of generated outputs");let n=new Map;for(let s=0;s<r.length;++s)n.set(r[s],t[s]);return n}initializeOps(t){let r=t.getNodes();this._ops=new Array(r.length);for(let n=0;n<r.length;n++)this._ops[n]=this.sessionHandler.resolve(r[n],this._model.opsets,t)}}}),nd,am=I(()=>{"use strict";zt(),De(),nd=class{constructor(t){this.session=t,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(t,r,n){let s=new Map;for(let c in t)if(Object.hasOwnProperty.call(t,c)){let o=t[c];s.set(c,new Pt(o.dims,o.type,void 0,void 0,o.data))}let p=await this.session.run(s),l={};return p.forEach((c,o)=>{l[o]=new ft(c.type,c.data,c.dims)}),l}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}}),od={};gr(od,{onnxjsBackend:()=>id});var $u,id,sm=I(()=>{"use strict";im(),am(),$u=class{async init(){}async createInferenceSessionHandler(t,r){let n=new rd(r);return typeof t=="string"?await n.loadModel(t):await n.loadModel(t),new nd(n)}},id=new $u}),Qo=I(()=>{"use strict"}),ad={};gr(ad,{default:()=>sd});var Wn,Xn,sd,um=I(()=>{"use strict";vd(),Ce(),Qr(),Wn="ort-wasm-proxy-worker",Xn=globalThis.self?.name===Wn,Xn&&(self.onmessage=t=>{let{type:r,in:n}=t.data;try{switch(r){case"init-wasm":ti(n.wasm).then(()=>{ii(n).then(()=>{postMessage({type:r})},s=>{postMessage({type:r,err:s})})},s=>{postMessage({type:r,err:s})});break;case"init-ep":{let{epName:s,env:p}=n;ai(p,s).then(()=>{postMessage({type:r})},l=>{postMessage({type:r,err:l})});break}case"copy-from":{let{buffer:s}=n,p=Xr(s);postMessage({type:r,out:p});break}case"create":{let{model:s,options:p}=n;si(s,p).then(l=>{postMessage({type:r,out:l})},l=>{postMessage({type:r,err:l})});break}case"release":ui(n),postMessage({type:r});break;case"run":{let{sessionId:s,inputIndices:p,inputs:l,outputIndices:c,options:o}=n;li(s,p,l,c,new Array(c.length).fill(null),o).then(a=>{a.some(e=>e[3]!=="cpu")?postMessage({type:r,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:r,out:a},ci([...l,...a]))},a=>{postMessage({type:r,err:a})});break}case"end-profiling":pi(n),postMessage({type:r});break;default:}}catch(s){postMessage({type:r,err:s})}}),sd=Xn?null:t=>new Worker(t??Oe,{type:"module",name:Wn})}),ud={};gr(ud,{default:()=>ld});var Kn,Zn,ld,lm=I(()=>{"use strict";Zn=(Kn=import.meta.url,async function(t={}){function r(){return yt.buffer!=wt.buffer&&it(),wt}function n(){return yt.buffer!=wt.buffer&&it(),G}function s(){return yt.buffer!=wt.buffer&&it(),Wt}function p(){return yt.buffer!=wt.buffer&&it(),Tr}function l(){return yt.buffer!=wt.buffer&&it(),ve}var c,o,a=Object.assign({},t),e=new Promise((f,g)=>{c=f,o=g}),u=typeof window=="object",i=typeof importScripts=="function",d=i&&self.name=="em-pthread";a.mountExternalData=(f,g)=>{f.startsWith("./")&&(f=f.substring(2)),(a.Ua||(a.Ua=new Map)).set(f,g)},a.unmountExternalData=()=>{delete a.Ua};var h,m,b=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor,x=Object.assign({},a),E="./this.program",w=(f,g)=>{throw g},S="";(u||i)&&(i?S=self.location.href:typeof document<"u"&&document.currentScript&&(S=document.currentScript.src),Kn&&(S=Kn),S=S.startsWith("blob:")?"":S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1),i&&(m=f=>{var g=new XMLHttpRequest;return g.open("GET",f,!1),g.responseType="arraybuffer",g.send(null),new Uint8Array(g.response)}),h=(f,g,y)=>{var v=new XMLHttpRequest;v.open("GET",f,!0),v.responseType="arraybuffer",v.onload=()=>{v.status==200||v.status==0&&v.response?g(v.response):y()},v.onerror=y,v.send(null)});var $,F=console.log.bind(console),bt=console.error.bind(console),pt=F,Z=bt;if(Object.assign(a,x),x=null,d){let f=function(g){try{var y=g.data,v=y.cmd;if(v==="load"){let _=[];self.onmessage=P=>_.push(P),self.startWorker=()=>{postMessage({cmd:"loaded"});for(let P of _)f(P);self.onmessage=f};for(let P of y.handlers)a[P]&&!a[P].proxy||(a[P]=(...N)=>{postMessage({Za:"callHandler",kb:P,args:N})},P=="print"&&(pt=a[P]),P=="printErr"&&(Z=a[P]));yt=y.wasmMemory,it(),At(y.wasmModule)}else if(v==="run"){pn(y.pthread_ptr,0,0,1,0,0),on(y.pthread_ptr),kd(),wi(),vr||(vr=!0);try{Fd(y.start_routine,y.arg)}catch(_){if(_!="unwind")throw _}}else v==="cancel"?_e()&&$r(-1):y.target!=="setimmediate"&&(v==="checkMailbox"?vr&&Ir():v&&(Z(`worker: received unknown command ${v}`),Z(y)))}catch(_){throw oa(),_}};var Le=f,At,vr=!1;Z=function(...g){g=g.join(" "),console.error(g)},self.alert=function(...g){postMessage({Za:"alert",text:g.join(" "),nb:_e()})},a.instantiateWasm=(g,y)=>new Promise(v=>{At=_=>{_=new WebAssembly.Instance(_,hi()),y(_),v()}}),self.onunhandledrejection=g=>{throw g.reason||g},self.onmessage=f}a.wasmBinary&&($=a.wasmBinary);var yt,xr,Ut,wt,G,Wt,Tr,xt,ve,ot=!1;function it(){var f=yt.buffer;a.HEAP8=wt=new Int8Array(f),a.HEAP16=new Int16Array(f),a.HEAPU8=G=new Uint8Array(f),a.HEAPU16=new Uint16Array(f),a.HEAP32=Wt=new Int32Array(f),a.HEAPU32=Tr=new Uint32Array(f),a.HEAPF32=new Float32Array(f),a.HEAPF64=ve=new Float64Array(f),a.HEAP64=xt=new BigInt64Array(f),a.HEAPU64=new BigUint64Array(f)}if(!d){if(!((yt=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0})).buffer instanceof b))throw Z("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"),Error("bad memory");it()}var oe=[],Xt=[],_r=[],ie=0,Ct=null,Tt=null;function ae(){if(--ie==0&&(Ct!==null&&(clearInterval(Ct),Ct=null),Tt)){var f=Tt;Tt=null,f()}}function et(f){throw Z(f="Aborted("+f+")"),ot=!0,Ut=1,f=new WebAssembly.RuntimeError(f+". Build with -sASSERTIONS for more info."),o(f),f}var at,Gt=f=>f.startsWith("data:application/octet-stream;base64,"),Re=f=>f.startsWith("file://");function Sr(f){if(f==at&&$)return new Uint8Array($);if(m)return m(f);throw"both async and sync fetching of the wasm failed"}function di(f,g,y){return function(v){if(!$&&(u||i)){if(typeof fetch=="function"&&!Re(v))return fetch(v,{credentials:"same-origin"}).then(_=>{if(!_.ok)throw`failed to load wasm binary file at '${v}'`;return _.arrayBuffer()}).catch(()=>Sr(v));if(h)return new Promise((_,P)=>{h(v,N=>_(new Uint8Array(N)),P)})}return Promise.resolve().then(()=>Sr(v))}(f).then(v=>WebAssembly.instantiate(v,g)).then(y,v=>{Z(`failed to asynchronously prepare wasm: ${v}`),et(v)})}function hi(){return{a:{j:Nd,b:Ld,E:Si,g:Ii,V:Pi,A:Di,C:Ni,W:ki,T:Fi,L:Ci,S:Li,o:Ri,B:ji,y:Bi,U:Vi,z:Mi,_:Rd,Z:jd,P:Bd,w:Vd,F:Md,k:zd,O:on,Y:Ud,I:Gd,J:Hd,K:qd,G:Gi,H:Hi,v:Wd,q:Xd,l:Kd,p:Zd,e:Jd,X:Yd,x:Qd,d:qi,f:th,i:eh,u:rh,t:nh,s:oh,Q:Ki,R:Zi,D:nn,h:Ji,n:Yi,M:Qi,m:ta,a:yt,r:rn,N:na,c:sh}}}var fi={836900:(f,g,y,v,_)=>{if(a===void 0||!a.Ua)return 1;if((f=Be(f>>>0)).startsWith("./")&&(f=f.substring(2)),!(f=a.Ua.get(f)))return 2;if(v>>>=0,(g>>>=0)+(y>>>=0)>f.byteLength)return 3;try{let P=f.subarray(g,g+y);switch(_){case 0:n().set(P,v>>>0);break;case 1:a.mb(v,P);break;default:return 4}return 0}catch{return 4}},837583:()=>typeof wasmOffsetConverter<"u"};function Nd(){return typeof wasmOffsetConverter<"u"}function tn(f){this.name="ExitStatus",this.message=`Program terminated with exit(${f})`,this.status=f}var en=f=>{f.terminate(),f.onmessage=()=>{}},gi=f=>{Kt.length==0&&(xi(),vi(Kt[0]));var g=Kt.pop();if(!g)return 6;se.push(g),jt[f.Ra]=g,g.Ra=f.Ra;var y={cmd:"run",start_routine:f.cb,arg:f.ab,pthread_ptr:f.Ra};return g.postMessage(y,f.ib),0},je=0,J=(f,g,...y)=>{for(var v=2*y.length,_=hn(),P=dn(8*v),N=P>>>3,K=0;K<y.length;K++){var ct=y[K];typeof ct=="bigint"?(xt[N+2*K]=1n,xt[N+2*K+1]=ct):(xt[N+2*K]=0n,l()[N+2*K+1>>>0]=ct)}return f=ia(f,0,v,P,g),Dr(_),f};function rn(f){if(d)return J(0,1,f);if(Ut=f,!(0<je)){for(var g of se)en(g);for(g of Kt)en(g);Kt=[],se=[],jt=[],ot=!0}w(f,new tn(f))}function mi(f){if(d)return J(1,0,f);nn(f)}var nn=f=>{if(Ut=f,d)throw mi(f),"unwind";rn(f)},Kt=[],se=[],bi=[],jt={},yi=f=>{var g=f.Ra;delete jt[g],Kt.push(f),se.splice(se.indexOf(f),1),f.Ra=0,cn(g)};function wi(){bi.forEach(f=>f())}var vi=f=>new Promise(g=>{f.onmessage=_=>{var P=(_=_.data).cmd;if(_.targetThread&&_.targetThread!=_e()){var N=jt[_.targetThread];N?N.postMessage(_,_.transferList):Z(`Internal error! Worker sent a message "${P}" to target pthread ${_.targetThread}, but that thread no longer exists!`)}else P==="checkMailbox"?Ir():P==="spawnThread"?gi(_):P==="cleanupThread"?yi(jt[_.thread]):P==="killThread"?(_=_.thread,P=jt[_],delete jt[_],en(P),cn(_),se.splice(se.indexOf(P),1),P.Ra=0):P==="cancelThread"?jt[_.thread].postMessage({cmd:"cancel"}):P==="loaded"?(f.loaded=!0,g(f)):P==="alert"?alert(`Thread ${_.threadId}: ${_.text}`):_.target==="setimmediate"?f.postMessage(_):P==="callHandler"?a[_.handler](..._.args):P&&Z(`worker sent an unknown command ${P}`)},f.onerror=_=>{throw Z(`worker sent an error! ${_.filename}:${_.lineno}: ${_.message}`),_};var y,v=[];for(y of[])a.hasOwnProperty(y)&&v.push(y);f.postMessage({cmd:"load",handlers:v,wasmMemory:yt,wasmModule:xr})});function xi(){var f=new Worker(new URL(import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});Kt.push(f)}var Ti,Or=f=>{for(;0<f.length;)f.shift()(a)},kd=()=>{var f=_e(),g=p()[f+52>>>2>>>0];f=p()[f+56>>>2>>>0],sa(g,g-f),Dr(g)},Er=[],Fd=(f,g)=>{je=0;var y=Er[f];y||(f>=Er.length&&(Er.length=f+1),Er[f]=y=Ti.get(f)),f=y(g),0<je?Ut=f:$r(f)};class Cd{constructor(g){this.Xa=g-24}}function Ld(f,g,y){var v=new Cd(f>>>=0);throw g>>>=0,y>>>=0,p()[v.Xa+16>>>2>>>0]=0,p()[v.Xa+4>>>2>>>0]=g,p()[v.Xa+8>>>2>>>0]=y,f}function _i(f,g,y,v){return d?J(2,1,f,g,y,v):Si(f,g,y,v)}function Si(f,g,y,v){if(f>>>=0,g>>>=0,y>>>=0,v>>>=0,b===void 0)return Z("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var _=[];return d&&_.length===0?_i(f,g,y,v):(f={cb:y,Ra:f,ab:v,ib:_},d?(f.Za="spawnThread",postMessage(f,_),0):gi(f))}var Oi=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ei=(f,g,y)=>{var v=(g>>>=0)+y;for(y=g;f[y]&&!(y>=v);)++y;if(16<y-g&&f.buffer&&Oi)return Oi.decode(f.buffer instanceof b?f.slice(g,y):f.subarray(g,y));for(v="";g<y;){var _=f[g++];if(128&_){var P=63&f[g++];if((224&_)==192)v+=String.fromCharCode((31&_)<<6|P);else{var N=63&f[g++];65536>(_=(240&_)==224?(15&_)<<12|P<<6|N:(7&_)<<18|P<<12|N<<6|63&f[g++])?v+=String.fromCharCode(_):(_-=65536,v+=String.fromCharCode(55296|_>>10,56320|1023&_))}}else v+=String.fromCharCode(_)}return v},Be=(f,g)=>(f>>>=0)?Ei(n(),f,g):"";function Ii(f,g,y){return d?J(3,1,f,g,y):0}function Pi(f,g){if(d)return J(4,1,f,g)}var Ai=f=>{for(var g=0,y=0;y<f.length;++y){var v=f.charCodeAt(y);127>=v?g++:2047>=v?g+=2:55296<=v&&57343>=v?(g+=4,++y):g+=3}return g},$i=(f,g,y,v)=>{if(!(0<v))return 0;var _=y>>>=0;v=y+v-1;for(var P=0;P<f.length;++P){var N=f.charCodeAt(P);if(55296<=N&&57343>=N&&(N=65536+((1023&N)<<10)|1023&f.charCodeAt(++P)),127>=N){if(y>=v)break;g[y++>>>0]=N}else{if(2047>=N){if(y+1>=v)break;g[y++>>>0]=192|N>>6}else{if(65535>=N){if(y+2>=v)break;g[y++>>>0]=224|N>>12}else{if(y+3>=v)break;g[y++>>>0]=240|N>>18,g[y++>>>0]=128|N>>12&63}g[y++>>>0]=128|N>>6&63}g[y++>>>0]=128|63&N}}return g[y>>>0]=0,y-_},Ve=(f,g,y)=>$i(f,n(),g,y);function Di(f,g){if(d)return J(5,1,f,g)}function Ni(f,g,y){if(d)return J(6,1,f,g,y)}function ki(f,g,y){return d?J(7,1,f,g,y):0}function Fi(f,g){if(d)return J(8,1,f,g)}function Ci(f,g,y){if(d)return J(9,1,f,g,y)}function Li(f,g,y,v){if(d)return J(10,1,f,g,y,v)}function Ri(f,g,y,v){if(d)return J(11,1,f,g,y,v)}function ji(f,g,y,v){if(d)return J(12,1,f,g,y,v)}function Bi(f){if(d)return J(13,1,f)}function Vi(f,g){if(d)return J(14,1,f,g)}function Mi(f,g,y){if(d)return J(15,1,f,g,y)}var Rd=()=>{et("")},jd=()=>1;function Bd(f){pn(f>>>0,!i,1,!u,131072,!1),wi()}function on(f){f>>>=0,typeof Atomics.jb=="function"&&(Atomics.jb(s(),f>>>2,f).value.then(Ir),f+=128,Atomics.store(s(),f>>>2,1))}var Ir=()=>{var f=_e();if(f&&(on(f),f=aa,!ot))try{if(f(),!(0<je))try{d?$r(Ut):nn(Ut)}catch(g){g instanceof tn||g=="unwind"||w(1,g)}}catch(g){g instanceof tn||g=="unwind"||w(1,g)}};function Vd(f,g){(f>>>=0)==g>>>0?setTimeout(Ir):d?postMessage({targetThread:f,cmd:"checkMailbox"}):(f=jt[f])&&f.postMessage({cmd:"checkMailbox"})}var an=[];function Md(f,g,y,v,_){for(g>>>=0,v/=2,an.length=v,y=_>>>0>>>3,_=0;_<v;_++)an[_]=xt[y+2*_]?xt[y+2*_+1]:l()[y+2*_+1>>>0];return(g?fi[g]:uh[f])(...an)}function zd(f){f>>>=0,d?postMessage({cmd:"cleanupThread",thread:f}):yi(jt[f])}function Ud(f){}function Gd(f,g){f=-9007199254740992>f||9007199254740992<f?NaN:Number(f),g>>>=0,f=new Date(1e3*f),s()[g>>>2>>>0]=f.getUTCSeconds(),s()[g+4>>>2>>>0]=f.getUTCMinutes(),s()[g+8>>>2>>>0]=f.getUTCHours(),s()[g+12>>>2>>>0]=f.getUTCDate(),s()[g+16>>>2>>>0]=f.getUTCMonth(),s()[g+20>>>2>>>0]=f.getUTCFullYear()-1900,s()[g+24>>>2>>>0]=f.getUTCDay(),f=(f.getTime()-Date.UTC(f.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,s()[g+28>>>2>>>0]=f}var xe=f=>f%4==0&&(f%100!=0||f%400==0),zi=[0,31,60,91,121,152,182,213,244,274,305,335],Ui=[0,31,59,90,120,151,181,212,243,273,304,334];function Hd(f,g){f=-9007199254740992>f||9007199254740992<f?NaN:Number(f),g>>>=0,f=new Date(1e3*f),s()[g>>>2>>>0]=f.getSeconds(),s()[g+4>>>2>>>0]=f.getMinutes(),s()[g+8>>>2>>>0]=f.getHours(),s()[g+12>>>2>>>0]=f.getDate(),s()[g+16>>>2>>>0]=f.getMonth(),s()[g+20>>>2>>>0]=f.getFullYear()-1900,s()[g+24>>>2>>>0]=f.getDay();var y=(xe(f.getFullYear())?zi:Ui)[f.getMonth()]+f.getDate()-1|0;s()[g+28>>>2>>>0]=y,s()[g+36>>>2>>>0]=-60*f.getTimezoneOffset(),y=new Date(f.getFullYear(),6,1).getTimezoneOffset();var v=new Date(f.getFullYear(),0,1).getTimezoneOffset();f=0|(y!=v&&f.getTimezoneOffset()==Math.min(v,y)),s()[g+32>>>2>>>0]=f}function qd(f){f>>>=0;var g=new Date(s()[f+20>>>2>>>0]+1900,s()[f+16>>>2>>>0],s()[f+12>>>2>>>0],s()[f+8>>>2>>>0],s()[f+4>>>2>>>0],s()[f>>>2>>>0],0),y=s()[f+32>>>2>>>0],v=g.getTimezoneOffset(),_=new Date(g.getFullYear(),6,1).getTimezoneOffset(),P=new Date(g.getFullYear(),0,1).getTimezoneOffset(),N=Math.min(P,_);return 0>y?s()[f+32>>>2>>>0]=+(_!=P&&N==v):0<y!=(N==v)&&(_=Math.max(P,_),g.setTime(g.getTime()+6e4*((0<y?N:_)-v))),s()[f+24>>>2>>>0]=g.getDay(),y=(xe(g.getFullYear())?zi:Ui)[g.getMonth()]+g.getDate()-1|0,s()[f+28>>>2>>>0]=y,s()[f>>>2>>>0]=g.getSeconds(),s()[f+4>>>2>>>0]=g.getMinutes(),s()[f+8>>>2>>>0]=g.getHours(),s()[f+12>>>2>>>0]=g.getDate(),s()[f+16>>>2>>>0]=g.getMonth(),s()[f+20>>>2>>>0]=g.getYear(),f=g.getTime(),BigInt(isNaN(f)?-1:f/1e3)}function Gi(f,g,y,v,_,P,N){return d?J(16,1,f,g,y,v,_,P,N):-52}function Hi(f,g,y,v,_,P){if(d)return J(17,1,f,g,y,v,_,P)}function Wd(f,g,y,v){f>>>=0,g>>>=0,y>>>=0,v>>>=0;var _=new Date().getFullYear(),P=new Date(_,0,1),N=new Date(_,6,1);_=P.getTimezoneOffset();var K=N.getTimezoneOffset(),ct=Math.max(_,K);p()[f>>>2>>>0]=60*ct,s()[g>>>2>>>0]=+(_!=K),P=(f=gt=>gt.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1])(P),N=f(N),K<_?(Ve(P,y,17),Ve(N,v,17)):(Ve(P,v,17),Ve(N,y,17))}var sn=[];function Xd(f,g,y){f>>>=0,g>>>=0,y>>>=0,sn.length=0;for(var v;v=n()[g++>>>0];){var _=v!=105;y+=(_&=v!=112)&&y%8?4:0,sn.push(v==112?p()[y>>>2>>>0]:v==106?xt[y>>>3]:v==105?s()[y>>>2>>>0]:l()[y>>>3>>>0]),y+=_?8:4}return fi[f](...sn)}var Kd=()=>{},Zd=()=>Date.now();function Jd(f,g){return Z(Be(f>>>0,g>>>0))}var qi,Yd=()=>{throw je+=1,"unwind"};function Qd(){return 4294901760}qi=()=>performance.timeOrigin+performance.now();var th=()=>navigator.hardwareConcurrency;function eh(){return et("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function rh(f){f>>>=0;var g=n().length;if(f<=g||4294901760<f)return!1;for(var y=1;4>=y;y*=2){var v=g*(1+.2/y);v=Math.min(v,f+100663296);var _=Math;v=Math.max(f,v);t:{_=(_.min.call(_,4294901760,v+(65536-v%65536)%65536)-yt.buffer.byteLength+65535)/65536;try{yt.grow(_),it();var P=1;break t}catch{}P=void 0}if(P)return!0}return!1}var Pr=()=>(et("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),Te={},Wi=f=>{f.forEach(g=>{var y=Pr();y&&(Te[y]=g)})};function nh(){var f=Error().stack.toString().split(`
1797
+ as ORT format: ${p}`)}}loadFromOnnxFormat(t,r){let n=Pu.onnx.ModelProto.decode(t);if(Vt.longToNumber(n.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=n.opsetImport.map(s=>({domain:s.domain,version:Vt.longToNumber(s.version)})),this._graph=Ro.from(n.graph,r)}loadFromOrtFormat(t,r){let n=new T.ByteBuffer(t),s=Au.InferenceSession.getRootAsInferenceSession(n).model();if(Vt.longToNumber(s.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let p=0;p<s.opsetImportLength();p++){let l=s.opsetImport(p);this._opsets.push({domain:l?.domain(),version:Vt.longToNumber(l.version())})}this._graph=Ro.from(s.graph(),r)}get graph(){return this._graph}get opsets(){return this._opsets}}}),rd,im=I(()=>{"use strict";tm(),em(),Rt(),om(),rd=class{constructor(t={}){this._initialized=!1,this.backendHint=t.backendHint,this.profiler=hl.create(t.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(t,r,n){await this.profiler.event("session","Session.loadModel",async()=>{let s=await Yc(this.backendHint);if(this.sessionHandler=s.createSessionHandler(this.context),this._model=new ed,typeof t=="string"){let p=t.endsWith(".ort");{let l=await(await fetch(t)).arrayBuffer();this.initialize(new Uint8Array(l),p)}}else if(ArrayBuffer.isView(t))this.initialize(t);else{let p=new Uint8Array(t,r||0,n||t.byteLength);this.initialize(p)}})}initialize(t,r){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{let n=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(t,n,r),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new td(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(t){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{let r=this.normalizeAndValidateInputs(t),n=await this._executionPlan.execute(this.sessionHandler,r);return this.createOutput(n)})}normalizeAndValidateInputs(t){let r=this._model.graph.getInputNames();if(Array.isArray(t)){if(t.length!==r.length)throw new Error(`incorrect input array length: expected ${r.length} but got ${t.length}`)}else{if(t.size!==r.length)throw new Error(`incorrect input map size: expected ${r.length} but got ${t.size}`);let n=new Array(t.size),s=0;for(let p=0;p<r.length;++p){let l=t.get(r[p]);if(!l)throw new Error(`missing input tensor for: '${name}'`);n[s++]=l}t=n}if(!this.context.graphInputTypes||this.context.graphInputTypes.length===0||!this.context.graphInputDims||this.context.graphInputDims.length===0){let n=this._model.graph.getInputIndices(),s=this._model.graph.getValues(),p=new Array(n.length);for(let l=0;l<n.length;++l){let c=s[n[l]];p[l]=c.type.shape.dims,this.context.graphInputTypes.push(c.type.tensorType),this.context.graphInputDims.push(t[l].dims)}this.validateInputTensorDims(p,t,!0)}else this.validateInputTensorDims(this.context.graphInputDims,t,!1);return this.validateInputTensorTypes(this.context.graphInputTypes,t),t}validateInputTensorTypes(t,r){for(let n=0;n<r.length;n++){let s=t[n],p=r[n].type;if(s!==p)throw new Error(`input tensor[${n}] check failed: expected type '${s}' but got ${p}`)}}validateInputTensorDims(t,r,n){for(let s=0;s<r.length;s++){let p=t[s],l=r[s].dims;if(!this.compareTensorDims(p,l,n))throw new Error(`input tensor[${s}] check failed: expected shape '[${p.join(",")}]' but got [${l.join(",")}]`)}}compareTensorDims(t,r,n){if(t.length!==r.length)return!1;for(let s=0;s<t.length;++s)if(t[s]!==r[s]&&(!n||t[s]!==0))return!1;return!0}createOutput(t){let r=this._model.graph.getOutputNames();if(t.length!==r.length)throw new Error("expected number of outputs do not match number of generated outputs");let n=new Map;for(let s=0;s<r.length;++s)n.set(r[s],t[s]);return n}initializeOps(t){let r=t.getNodes();this._ops=new Array(r.length);for(let n=0;n<r.length;n++)this._ops[n]=this.sessionHandler.resolve(r[n],this._model.opsets,t)}}}),nd,am=I(()=>{"use strict";zt(),De(),nd=class{constructor(t){this.session=t,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(t,r,n){let s=new Map;for(let c in t)if(Object.hasOwnProperty.call(t,c)){let o=t[c];s.set(c,new Pt(o.dims,o.type,void 0,void 0,o.data))}let p=await this.session.run(s),l={};return p.forEach((c,o)=>{l[o]=new ft(c.type,c.data,c.dims)}),l}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}}),od={};gr(od,{onnxjsBackend:()=>id});var $u,id,sm=I(()=>{"use strict";im(),am(),$u=class{async init(){}async createInferenceSessionHandler(t,r){let n=new rd(r);return typeof t=="string"?await n.loadModel(t):await n.loadModel(t),new nd(n)}},id=new $u}),Qo=I(()=>{"use strict"}),ad={};gr(ad,{default:()=>sd});var Wn,Xn,sd,um=I(()=>{"use strict";vd(),Ce(),Qr(),Wn="ort-wasm-proxy-worker",Xn=globalThis.self?.name===Wn,Xn&&(self.onmessage=t=>{let{type:r,in:n}=t.data;try{switch(r){case"init-wasm":ti(n.wasm).then(()=>{ii(n).then(()=>{postMessage({type:r})},s=>{postMessage({type:r,err:s})})},s=>{postMessage({type:r,err:s})});break;case"init-ep":{let{epName:s,env:p}=n;ai(p,s).then(()=>{postMessage({type:r})},l=>{postMessage({type:r,err:l})});break}case"copy-from":{let{buffer:s}=n,p=Xr(s);postMessage({type:r,out:p});break}case"create":{let{model:s,options:p}=n;si(s,p).then(l=>{postMessage({type:r,out:l})},l=>{postMessage({type:r,err:l})});break}case"release":ui(n),postMessage({type:r});break;case"run":{let{sessionId:s,inputIndices:p,inputs:l,outputIndices:c,options:o}=n;li(s,p,l,c,new Array(c.length).fill(null),o).then(a=>{a.some(e=>e[3]!=="cpu")?postMessage({type:r,err:"Proxy does not support non-cpu tensor location."}):postMessage({type:r,out:a},ci([...l,...a]))},a=>{postMessage({type:r,err:a})});break}case"end-profiling":pi(n),postMessage({type:r});break;default:}}catch(s){postMessage({type:r,err:s})}}),sd=Xn?null:t=>new Worker(t??Oe,{type:"module",name:Wn})}),ud={};gr(ud,{default:()=>ld});var Kn,Zn,ld,lm=I(()=>{"use strict";Zn=(Kn=import.meta.url,async function(t={}){function r(){return yt.buffer!=wt.buffer&&it(),wt}function n(){return yt.buffer!=wt.buffer&&it(),G}function s(){return yt.buffer!=wt.buffer&&it(),Wt}function p(){return yt.buffer!=wt.buffer&&it(),Tr}function l(){return yt.buffer!=wt.buffer&&it(),ve}var c,o,a=Object.assign({},t),e=new Promise((f,g)=>{c=f,o=g}),u=typeof window=="object",i=typeof importScripts=="function",d=i&&self.name=="em-pthread";a.mountExternalData=(f,g)=>{f.startsWith("./")&&(f=f.substring(2)),(a.Ua||(a.Ua=new Map)).set(f,g)},a.unmountExternalData=()=>{delete a.Ua};var h,m,b=globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor,x=Object.assign({},a),E="./this.program",w=(f,g)=>{throw g},S="";(u||i)&&(i?S=self.location.href:typeof document<"u"&&document.currentScript&&(S=document.currentScript.src),Kn&&(S=Kn),S=S.startsWith("blob:")?"":S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1),i&&(m=f=>{var g=new XMLHttpRequest;return g.open("GET",f,!1),g.responseType="arraybuffer",g.send(null),new Uint8Array(g.response)}),h=(f,g,y)=>{var v=new XMLHttpRequest;v.open("GET",f,!0),v.responseType="arraybuffer",v.onload=()=>{v.status==200||v.status==0&&v.response?g(v.response):y()},v.onerror=y,v.send(null)});var $,F=console.log.bind(console),bt=console.error.bind(console),pt=F,Z=bt;if(Object.assign(a,x),x=null,d){let f=function(g){try{var y=g.data,v=y.cmd;if(v==="load"){let _=[];self.onmessage=P=>_.push(P),self.startWorker=()=>{postMessage({cmd:"loaded"});for(let P of _)f(P);self.onmessage=f};for(let P of y.handlers)a[P]&&!a[P].proxy||(a[P]=(...N)=>{postMessage({Za:"callHandler",kb:P,args:N})},P=="print"&&(pt=a[P]),P=="printErr"&&(Z=a[P]));yt=y.wasmMemory,it(),At(y.wasmModule)}else if(v==="run"){pn(y.pthread_ptr,0,0,1,0,0),on(y.pthread_ptr),kd(),wi(),vr||(vr=!0);try{Fd(y.start_routine,y.arg)}catch(_){if(_!="unwind")throw _}}else v==="cancel"?_e()&&$r(-1):y.target!=="setimmediate"&&(v==="checkMailbox"?vr&&Ir():v&&(Z(`worker: received unknown command ${v}`),Z(y)))}catch(_){throw oa(),_}};var Le=f,At,vr=!1;Z=function(...g){g=g.join(" "),console.error(g)},self.alert=function(...g){postMessage({Za:"alert",text:g.join(" "),nb:_e()})},a.instantiateWasm=(g,y)=>new Promise(v=>{At=_=>{_=new WebAssembly.Instance(_,hi()),y(_),v()}}),self.onunhandledrejection=g=>{throw g.reason||g},self.onmessage=f}a.wasmBinary&&($=a.wasmBinary);var yt,xr,Ut,wt,G,Wt,Tr,xt,ve,ot=!1;function it(){var f=yt.buffer;a.HEAP8=wt=new Int8Array(f),a.HEAP16=new Int16Array(f),a.HEAPU8=G=new Uint8Array(f),a.HEAPU16=new Uint16Array(f),a.HEAP32=Wt=new Int32Array(f),a.HEAPU32=Tr=new Uint32Array(f),a.HEAPF32=new Float32Array(f),a.HEAPF64=ve=new Float64Array(f),a.HEAP64=xt=new BigInt64Array(f),a.HEAPU64=new BigUint64Array(f)}if(!d){if(!((yt=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0})).buffer instanceof b))throw Z("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"),Error("bad memory");it()}var oe=[],Xt=[],_r=[],ie=0,Ct=null,Tt=null;function ae(){if(--ie==0&&(Ct!==null&&(clearInterval(Ct),Ct=null),Tt)){var f=Tt;Tt=null,f()}}function et(f){throw Z(f="Aborted("+f+")"),ot=!0,Ut=1,f=new WebAssembly.RuntimeError(f+". Build with -sASSERTIONS for more info."),o(f),f}var at,Gt=f=>f.startsWith("data:application/octet-stream;base64,"),Re=f=>f.startsWith("file://");function Sr(f){if(f==at&&$)return new Uint8Array($);if(m)return m(f);throw"both async and sync fetching of the wasm failed"}function di(f,g,y){return(function(v){if(!$&&(u||i)){if(typeof fetch=="function"&&!Re(v))return fetch(v,{credentials:"same-origin"}).then(_=>{if(!_.ok)throw`failed to load wasm binary file at '${v}'`;return _.arrayBuffer()}).catch(()=>Sr(v));if(h)return new Promise((_,P)=>{h(v,N=>_(new Uint8Array(N)),P)})}return Promise.resolve().then(()=>Sr(v))})(f).then(v=>WebAssembly.instantiate(v,g)).then(y,v=>{Z(`failed to asynchronously prepare wasm: ${v}`),et(v)})}function hi(){return{a:{j:Nd,b:Ld,E:Si,g:Ii,V:Pi,A:Di,C:Ni,W:ki,T:Fi,L:Ci,S:Li,o:Ri,B:ji,y:Bi,U:Vi,z:Mi,_:Rd,Z:jd,P:Bd,w:Vd,F:Md,k:zd,O:on,Y:Ud,I:Gd,J:Hd,K:qd,G:Gi,H:Hi,v:Wd,q:Xd,l:Kd,p:Zd,e:Jd,X:Yd,x:Qd,d:qi,f:th,i:eh,u:rh,t:nh,s:oh,Q:Ki,R:Zi,D:nn,h:Ji,n:Yi,M:Qi,m:ta,a:yt,r:rn,N:na,c:sh}}}var fi={836900:(f,g,y,v,_)=>{if(a===void 0||!a.Ua)return 1;if((f=Be(f>>>0)).startsWith("./")&&(f=f.substring(2)),!(f=a.Ua.get(f)))return 2;if(v>>>=0,(g>>>=0)+(y>>>=0)>f.byteLength)return 3;try{let P=f.subarray(g,g+y);switch(_){case 0:n().set(P,v>>>0);break;case 1:a.mb(v,P);break;default:return 4}return 0}catch{return 4}},837583:()=>typeof wasmOffsetConverter<"u"};function Nd(){return typeof wasmOffsetConverter<"u"}function tn(f){this.name="ExitStatus",this.message=`Program terminated with exit(${f})`,this.status=f}var en=f=>{f.terminate(),f.onmessage=()=>{}},gi=f=>{Kt.length==0&&(xi(),vi(Kt[0]));var g=Kt.pop();if(!g)return 6;se.push(g),jt[f.Ra]=g,g.Ra=f.Ra;var y={cmd:"run",start_routine:f.cb,arg:f.ab,pthread_ptr:f.Ra};return g.postMessage(y,f.ib),0},je=0,J=(f,g,...y)=>{for(var v=2*y.length,_=hn(),P=dn(8*v),N=P>>>3,K=0;K<y.length;K++){var ct=y[K];typeof ct=="bigint"?(xt[N+2*K]=1n,xt[N+2*K+1]=ct):(xt[N+2*K]=0n,l()[N+2*K+1>>>0]=ct)}return f=ia(f,0,v,P,g),Dr(_),f};function rn(f){if(d)return J(0,1,f);if(Ut=f,!(0<je)){for(var g of se)en(g);for(g of Kt)en(g);Kt=[],se=[],jt=[],ot=!0}w(f,new tn(f))}function mi(f){if(d)return J(1,0,f);nn(f)}var nn=f=>{if(Ut=f,d)throw mi(f),"unwind";rn(f)},Kt=[],se=[],bi=[],jt={},yi=f=>{var g=f.Ra;delete jt[g],Kt.push(f),se.splice(se.indexOf(f),1),f.Ra=0,cn(g)};function wi(){bi.forEach(f=>f())}var vi=f=>new Promise(g=>{f.onmessage=_=>{var P=(_=_.data).cmd;if(_.targetThread&&_.targetThread!=_e()){var N=jt[_.targetThread];N?N.postMessage(_,_.transferList):Z(`Internal error! Worker sent a message "${P}" to target pthread ${_.targetThread}, but that thread no longer exists!`)}else P==="checkMailbox"?Ir():P==="spawnThread"?gi(_):P==="cleanupThread"?yi(jt[_.thread]):P==="killThread"?(_=_.thread,P=jt[_],delete jt[_],en(P),cn(_),se.splice(se.indexOf(P),1),P.Ra=0):P==="cancelThread"?jt[_.thread].postMessage({cmd:"cancel"}):P==="loaded"?(f.loaded=!0,g(f)):P==="alert"?alert(`Thread ${_.threadId}: ${_.text}`):_.target==="setimmediate"?f.postMessage(_):P==="callHandler"?a[_.handler](..._.args):P&&Z(`worker sent an unknown command ${P}`)},f.onerror=_=>{throw Z(`worker sent an error! ${_.filename}:${_.lineno}: ${_.message}`),_};var y,v=[];for(y of[])a.hasOwnProperty(y)&&v.push(y);f.postMessage({cmd:"load",handlers:v,wasmMemory:yt,wasmModule:xr})});function xi(){var f=new Worker(new URL(import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});Kt.push(f)}var Ti,Or=f=>{for(;0<f.length;)f.shift()(a)},kd=()=>{var f=_e(),g=p()[f+52>>>2>>>0];f=p()[f+56>>>2>>>0],sa(g,g-f),Dr(g)},Er=[],Fd=(f,g)=>{je=0;var y=Er[f];y||(f>=Er.length&&(Er.length=f+1),Er[f]=y=Ti.get(f)),f=y(g),0<je?Ut=f:$r(f)};class Cd{constructor(g){this.Xa=g-24}}function Ld(f,g,y){var v=new Cd(f>>>=0);throw g>>>=0,y>>>=0,p()[v.Xa+16>>>2>>>0]=0,p()[v.Xa+4>>>2>>>0]=g,p()[v.Xa+8>>>2>>>0]=y,f}function _i(f,g,y,v){return d?J(2,1,f,g,y,v):Si(f,g,y,v)}function Si(f,g,y,v){if(f>>>=0,g>>>=0,y>>>=0,v>>>=0,b===void 0)return Z("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var _=[];return d&&_.length===0?_i(f,g,y,v):(f={cb:y,Ra:f,ab:v,ib:_},d?(f.Za="spawnThread",postMessage(f,_),0):gi(f))}var Oi=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ei=(f,g,y)=>{var v=(g>>>=0)+y;for(y=g;f[y]&&!(y>=v);)++y;if(16<y-g&&f.buffer&&Oi)return Oi.decode(f.buffer instanceof b?f.slice(g,y):f.subarray(g,y));for(v="";g<y;){var _=f[g++];if(128&_){var P=63&f[g++];if((224&_)==192)v+=String.fromCharCode((31&_)<<6|P);else{var N=63&f[g++];65536>(_=(240&_)==224?(15&_)<<12|P<<6|N:(7&_)<<18|P<<12|N<<6|63&f[g++])?v+=String.fromCharCode(_):(_-=65536,v+=String.fromCharCode(55296|_>>10,56320|1023&_))}}else v+=String.fromCharCode(_)}return v},Be=(f,g)=>(f>>>=0)?Ei(n(),f,g):"";function Ii(f,g,y){return d?J(3,1,f,g,y):0}function Pi(f,g){if(d)return J(4,1,f,g)}var Ai=f=>{for(var g=0,y=0;y<f.length;++y){var v=f.charCodeAt(y);127>=v?g++:2047>=v?g+=2:55296<=v&&57343>=v?(g+=4,++y):g+=3}return g},$i=(f,g,y,v)=>{if(!(0<v))return 0;var _=y>>>=0;v=y+v-1;for(var P=0;P<f.length;++P){var N=f.charCodeAt(P);if(55296<=N&&57343>=N&&(N=65536+((1023&N)<<10)|1023&f.charCodeAt(++P)),127>=N){if(y>=v)break;g[y++>>>0]=N}else{if(2047>=N){if(y+1>=v)break;g[y++>>>0]=192|N>>6}else{if(65535>=N){if(y+2>=v)break;g[y++>>>0]=224|N>>12}else{if(y+3>=v)break;g[y++>>>0]=240|N>>18,g[y++>>>0]=128|N>>12&63}g[y++>>>0]=128|N>>6&63}g[y++>>>0]=128|63&N}}return g[y>>>0]=0,y-_},Ve=(f,g,y)=>$i(f,n(),g,y);function Di(f,g){if(d)return J(5,1,f,g)}function Ni(f,g,y){if(d)return J(6,1,f,g,y)}function ki(f,g,y){return d?J(7,1,f,g,y):0}function Fi(f,g){if(d)return J(8,1,f,g)}function Ci(f,g,y){if(d)return J(9,1,f,g,y)}function Li(f,g,y,v){if(d)return J(10,1,f,g,y,v)}function Ri(f,g,y,v){if(d)return J(11,1,f,g,y,v)}function ji(f,g,y,v){if(d)return J(12,1,f,g,y,v)}function Bi(f){if(d)return J(13,1,f)}function Vi(f,g){if(d)return J(14,1,f,g)}function Mi(f,g,y){if(d)return J(15,1,f,g,y)}var Rd=()=>{et("")},jd=()=>1;function Bd(f){pn(f>>>0,!i,1,!u,131072,!1),wi()}function on(f){f>>>=0,typeof Atomics.jb=="function"&&(Atomics.jb(s(),f>>>2,f).value.then(Ir),f+=128,Atomics.store(s(),f>>>2,1))}var Ir=()=>{var f=_e();if(f&&(on(f),f=aa,!ot))try{if(f(),!(0<je))try{d?$r(Ut):nn(Ut)}catch(g){g instanceof tn||g=="unwind"||w(1,g)}}catch(g){g instanceof tn||g=="unwind"||w(1,g)}};function Vd(f,g){(f>>>=0)==g>>>0?setTimeout(Ir):d?postMessage({targetThread:f,cmd:"checkMailbox"}):(f=jt[f])&&f.postMessage({cmd:"checkMailbox"})}var an=[];function Md(f,g,y,v,_){for(g>>>=0,v/=2,an.length=v,y=_>>>0>>>3,_=0;_<v;_++)an[_]=xt[y+2*_]?xt[y+2*_+1]:l()[y+2*_+1>>>0];return(g?fi[g]:uh[f])(...an)}function zd(f){f>>>=0,d?postMessage({cmd:"cleanupThread",thread:f}):yi(jt[f])}function Ud(f){}function Gd(f,g){f=-9007199254740992>f||9007199254740992<f?NaN:Number(f),g>>>=0,f=new Date(1e3*f),s()[g>>>2>>>0]=f.getUTCSeconds(),s()[g+4>>>2>>>0]=f.getUTCMinutes(),s()[g+8>>>2>>>0]=f.getUTCHours(),s()[g+12>>>2>>>0]=f.getUTCDate(),s()[g+16>>>2>>>0]=f.getUTCMonth(),s()[g+20>>>2>>>0]=f.getUTCFullYear()-1900,s()[g+24>>>2>>>0]=f.getUTCDay(),f=(f.getTime()-Date.UTC(f.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,s()[g+28>>>2>>>0]=f}var xe=f=>f%4==0&&(f%100!=0||f%400==0),zi=[0,31,60,91,121,152,182,213,244,274,305,335],Ui=[0,31,59,90,120,151,181,212,243,273,304,334];function Hd(f,g){f=-9007199254740992>f||9007199254740992<f?NaN:Number(f),g>>>=0,f=new Date(1e3*f),s()[g>>>2>>>0]=f.getSeconds(),s()[g+4>>>2>>>0]=f.getMinutes(),s()[g+8>>>2>>>0]=f.getHours(),s()[g+12>>>2>>>0]=f.getDate(),s()[g+16>>>2>>>0]=f.getMonth(),s()[g+20>>>2>>>0]=f.getFullYear()-1900,s()[g+24>>>2>>>0]=f.getDay();var y=(xe(f.getFullYear())?zi:Ui)[f.getMonth()]+f.getDate()-1|0;s()[g+28>>>2>>>0]=y,s()[g+36>>>2>>>0]=-60*f.getTimezoneOffset(),y=new Date(f.getFullYear(),6,1).getTimezoneOffset();var v=new Date(f.getFullYear(),0,1).getTimezoneOffset();f=0|(y!=v&&f.getTimezoneOffset()==Math.min(v,y)),s()[g+32>>>2>>>0]=f}function qd(f){f>>>=0;var g=new Date(s()[f+20>>>2>>>0]+1900,s()[f+16>>>2>>>0],s()[f+12>>>2>>>0],s()[f+8>>>2>>>0],s()[f+4>>>2>>>0],s()[f>>>2>>>0],0),y=s()[f+32>>>2>>>0],v=g.getTimezoneOffset(),_=new Date(g.getFullYear(),6,1).getTimezoneOffset(),P=new Date(g.getFullYear(),0,1).getTimezoneOffset(),N=Math.min(P,_);return 0>y?s()[f+32>>>2>>>0]=+(_!=P&&N==v):0<y!=(N==v)&&(_=Math.max(P,_),g.setTime(g.getTime()+6e4*((0<y?N:_)-v))),s()[f+24>>>2>>>0]=g.getDay(),y=(xe(g.getFullYear())?zi:Ui)[g.getMonth()]+g.getDate()-1|0,s()[f+28>>>2>>>0]=y,s()[f>>>2>>>0]=g.getSeconds(),s()[f+4>>>2>>>0]=g.getMinutes(),s()[f+8>>>2>>>0]=g.getHours(),s()[f+12>>>2>>>0]=g.getDate(),s()[f+16>>>2>>>0]=g.getMonth(),s()[f+20>>>2>>>0]=g.getYear(),f=g.getTime(),BigInt(isNaN(f)?-1:f/1e3)}function Gi(f,g,y,v,_,P,N){return d?J(16,1,f,g,y,v,_,P,N):-52}function Hi(f,g,y,v,_,P){if(d)return J(17,1,f,g,y,v,_,P)}function Wd(f,g,y,v){f>>>=0,g>>>=0,y>>>=0,v>>>=0;var _=new Date().getFullYear(),P=new Date(_,0,1),N=new Date(_,6,1);_=P.getTimezoneOffset();var K=N.getTimezoneOffset(),ct=Math.max(_,K);p()[f>>>2>>>0]=60*ct,s()[g>>>2>>>0]=+(_!=K),P=(f=gt=>gt.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1])(P),N=f(N),K<_?(Ve(P,y,17),Ve(N,v,17)):(Ve(P,v,17),Ve(N,y,17))}var sn=[];function Xd(f,g,y){f>>>=0,g>>>=0,y>>>=0,sn.length=0;for(var v;v=n()[g++>>>0];){var _=v!=105;y+=(_&=v!=112)&&y%8?4:0,sn.push(v==112?p()[y>>>2>>>0]:v==106?xt[y>>>3]:v==105?s()[y>>>2>>>0]:l()[y>>>3>>>0]),y+=_?8:4}return fi[f](...sn)}var Kd=()=>{},Zd=()=>Date.now();function Jd(f,g){return Z(Be(f>>>0,g>>>0))}var qi,Yd=()=>{throw je+=1,"unwind"};function Qd(){return 4294901760}qi=()=>performance.timeOrigin+performance.now();var th=()=>navigator.hardwareConcurrency;function eh(){return et("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0}function rh(f){f>>>=0;var g=n().length;if(f<=g||4294901760<f)return!1;for(var y=1;4>=y;y*=2){var v=g*(1+.2/y);v=Math.min(v,f+100663296);var _=Math;v=Math.max(f,v);t:{_=(_.min.call(_,4294901760,v+(65536-v%65536)%65536)-yt.buffer.byteLength+65535)/65536;try{yt.grow(_),it();var P=1;break t}catch{}P=void 0}if(P)return!0}return!1}var Pr=()=>(et("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),Te={},Wi=f=>{f.forEach(g=>{var y=Pr();y&&(Te[y]=g)})};function nh(){var f=Error().stack.toString().split(`
1798
1798
  `);return f[0]=="Error"&&f.shift(),Wi(f),Te.$a=Pr(),Te.bb=f,Te.$a}function oh(f,g,y){if(f>>>=0,g>>>=0,Te.$a==f)var v=Te.bb;else(v=Error().stack.toString().split(`
1799
1799
  `))[0]=="Error"&&v.shift(),Wi(v);for(var _=3;v[_]&&Pr()!=f;)++_;for(f=0;f<y&&v[f+_];++f)s()[g+4*f>>>2>>>0]=Pr();return f}var un,ln={},Xi=()=>{if(!un){var f,g={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:E||"./this.program"};for(f in ln)ln[f]===void 0?delete g[f]:g[f]=ln[f];var y=[];for(f in g)y.push(`${f}=${g[f]}`);un=y}return un};function Ki(f,g){if(d)return J(18,1,f,g);f>>>=0,g>>>=0;var y=0;return Xi().forEach((v,_)=>{var P=g+y;for(_=p()[f+4*_>>>2>>>0]=P,P=0;P<v.length;++P)r()[_++>>>0]=v.charCodeAt(P);r()[_>>>0]=0,y+=v.length+1}),0}function Zi(f,g){if(d)return J(19,1,f,g);f>>>=0,g>>>=0;var y=Xi();p()[f>>>2>>>0]=y.length;var v=0;return y.forEach(_=>v+=_.length+1),p()[g>>>2>>>0]=v,0}function Ji(f){return d?J(20,1,f):52}function Yi(f,g,y,v){return d?J(21,1,f,g,y,v):52}function Qi(f,g,y,v){return d?J(22,1,f,g,y,v):70}var ih=[null,[],[]];function ta(f,g,y,v){if(d)return J(23,1,f,g,y,v);g>>>=0,y>>>=0,v>>>=0;for(var _=0,P=0;P<y;P++){var N=p()[g>>>2>>>0],K=p()[g+4>>>2>>>0];g+=8;for(var ct=0;ct<K;ct++){var gt=n()[N+ct>>>0],vt=ih[f];gt===0||gt===10?((f===1?pt:Z)(Ei(vt,0)),vt.length=0):vt.push(gt)}_+=K}return p()[v>>>2>>>0]=_,0}var ea=[31,29,31,30,31,30,31,31,30,31,30,31],ra=[31,28,31,30,31,30,31,31,30,31,30,31],ah=(f,g)=>{r().set(f,g>>>0)};function na(f,g,y,v){function _(O,z,rt){for(O=typeof O=="number"?O.toString():O||"";O.length<z;)O=rt[0]+O;return O}function P(O,z){return _(O,z,"0")}function N(O,z){function rt(ca){return 0>ca?-1:0<ca?1:0}var ue;return(ue=rt(O.getFullYear()-z.getFullYear()))===0&&(ue=rt(O.getMonth()-z.getMonth()))===0&&(ue=rt(O.getDate()-z.getDate())),ue}function K(O){switch(O.getDay()){case 0:return new Date(O.getFullYear()-1,11,29);case 1:return O;case 2:return new Date(O.getFullYear(),0,3);case 3:return new Date(O.getFullYear(),0,2);case 4:return new Date(O.getFullYear(),0,1);case 5:return new Date(O.getFullYear()-1,11,31);case 6:return new Date(O.getFullYear()-1,11,30)}}function ct(O){var z=O.Sa;for(O=new Date(new Date(O.Ta+1900,0,1).getTime());0<z;){var rt=O.getMonth(),ue=(xe(O.getFullYear())?ea:ra)[rt];if(!(z>ue-O.getDate())){O.setDate(O.getDate()+z);break}z-=ue-O.getDate()+1,O.setDate(1),11>rt?O.setMonth(rt+1):(O.setMonth(0),O.setFullYear(O.getFullYear()+1))}return rt=new Date(O.getFullYear()+1,0,4),z=K(new Date(O.getFullYear(),0,4)),rt=K(rt),0>=N(z,O)?0>=N(rt,O)?O.getFullYear()+1:O.getFullYear():O.getFullYear()-1}f>>>=0,g>>>=0,y>>>=0,v>>>=0;var gt=p()[v+40>>>2>>>0];for(var vt in v={gb:s()[v>>>2>>>0],fb:s()[v+4>>>2>>>0],Va:s()[v+8>>>2>>>0],Ya:s()[v+12>>>2>>>0],Wa:s()[v+16>>>2>>>0],Ta:s()[v+20>>>2>>>0],Qa:s()[v+24>>>2>>>0],Sa:s()[v+28>>>2>>>0],ob:s()[v+32>>>2>>>0],eb:s()[v+36>>>2>>>0],hb:gt?Be(gt):""},y=Be(y),gt={"%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"})y=y.replace(new RegExp(vt,"g"),gt[vt]);var la="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),pa="January February March April May June July August September October November December".split(" ");for(vt in gt={"%a":O=>la[O.Qa].substring(0,3),"%A":O=>la[O.Qa],"%b":O=>pa[O.Wa].substring(0,3),"%B":O=>pa[O.Wa],"%C":O=>P((O.Ta+1900)/100|0,2),"%d":O=>P(O.Ya,2),"%e":O=>_(O.Ya,2," "),"%g":O=>ct(O).toString().substring(2),"%G":ct,"%H":O=>P(O.Va,2),"%I":O=>((O=O.Va)==0?O=12:12<O&&(O-=12),P(O,2)),"%j":O=>{for(var z=0,rt=0;rt<=O.Wa-1;z+=(xe(O.Ta+1900)?ea:ra)[rt++]);return P(O.Ya+z,3)},"%m":O=>P(O.Wa+1,2),"%M":O=>P(O.fb,2),"%n":()=>`
1800
- `,"%p":O=>0<=O.Va&&12>O.Va?"AM":"PM","%S":O=>P(O.gb,2),"%t":()=>" ","%u":O=>O.Qa||7,"%U":O=>P(Math.floor((O.Sa+7-O.Qa)/7),2),"%V":O=>{var z=Math.floor((O.Sa+7-(O.Qa+6)%7)/7);if(2>=(O.Qa+371-O.Sa-2)%7&&z++,z)z==53&&((rt=(O.Qa+371-O.Sa)%7)==4||rt==3&&xe(O.Ta)||(z=1));else{z=52;var rt=(O.Qa+7-O.Sa-1)%7;(rt==4||rt==5&&xe(O.Ta%400-1))&&z++}return P(z,2)},"%w":O=>O.Qa,"%W":O=>P(Math.floor((O.Sa+7-(O.Qa+6)%7)/7),2),"%y":O=>(O.Ta+1900).toString().substring(2),"%Y":O=>O.Ta+1900,"%z":O=>{var z=0<=(O=O.eb);return O=Math.abs(O)/60,(z?"+":"-")+("0000"+(O/60*100+O%60)).slice(-4)},"%Z":O=>O.hb,"%%":()=>"%"},y=y.replace(/%%/g,"\0\0"),gt)y.includes(vt)&&(y=y.replace(new RegExp(vt,"g"),gt[vt](v)));return vt=function(O){var z=Array(Ai(O)+1);return $i(O,z,0,z.length),z}(y=y.replace(/\0\0/g,"%")),vt.length>g?0:(ah(vt,f),vt.length-1)}function sh(f,g,y,v){return na(f>>>0,g>>>0,y>>>0,v>>>0)}d||function(){for(var f=a.numThreads-1;f--;)xi();oe.unshift(()=>{ie++,function(g){d?g():Promise.all(Kt.map(vi)).then(g)}(()=>ae())})}();var uh=[rn,mi,_i,Ii,Pi,Di,Ni,ki,Fi,Ci,Li,Ri,ji,Bi,Vi,Mi,Gi,Hi,Ki,Zi,Ji,Yi,Qi,ta],k=function(){function f(y,v){return k=y.exports,k=function(){var _=k,P=K=>()=>K()>>>0,N=K=>ct=>K(ct)>>>0;return(_=Object.assign({},_)).Ba=P(_.Ba),_.Ca=N(_.Ca),_.emscripten_main_runtime_thread_id=P(_.emscripten_main_runtime_thread_id),_.Oa=N(_.Oa),_.Pa=P(_.Pa),_}(),bi.push(k.Ea),Ti=k.Fa,Xt.unshift(k.$),xr=v,ae(),k}var g=hi();if(ie++,a.instantiateWasm)try{return a.instantiateWasm(g,f)}catch(y){Z(`Module.instantiateWasm callback failed with error: ${y}`),o(y)}return at||(at=a.locateFile?Gt("ort-wasm-simd-threaded.wasm")?"ort-wasm-simd-threaded.wasm":a.locateFile?a.locateFile("ort-wasm-simd-threaded.wasm",S):S+"ort-wasm-simd-threaded.wasm":new URL("ort-wasm-simd-threaded.wasm",import.meta.url).href),function(y,v){var _=at;return $||typeof WebAssembly.instantiateStreaming!="function"||Gt(_)||Re(_)||typeof fetch!="function"?di(_,y,v):fetch(_,{credentials:"same-origin"}).then(P=>WebAssembly.instantiateStreaming(P,y).then(v,function(N){return Z(`wasm streaming compile failed: ${N}`),Z("falling back to ArrayBuffer instantiation"),di(_,y,v)}))}(g,function(y){f(y.instance,y.module)}).catch(o),{}}();a._OrtInit=(f,g)=>(a._OrtInit=k.aa)(f,g),a._OrtGetLastError=(f,g)=>(a._OrtGetLastError=k.ba)(f,g),a._OrtCreateSessionOptions=(f,g,y,v,_,P,N,K,ct,gt)=>(a._OrtCreateSessionOptions=k.ca)(f,g,y,v,_,P,N,K,ct,gt),a._OrtAppendExecutionProvider=(f,g)=>(a._OrtAppendExecutionProvider=k.da)(f,g),a._OrtAddFreeDimensionOverride=(f,g,y)=>(a._OrtAddFreeDimensionOverride=k.ea)(f,g,y),a._OrtAddSessionConfigEntry=(f,g,y)=>(a._OrtAddSessionConfigEntry=k.fa)(f,g,y),a._OrtReleaseSessionOptions=f=>(a._OrtReleaseSessionOptions=k.ga)(f),a._OrtCreateSession=(f,g,y)=>(a._OrtCreateSession=k.ha)(f,g,y),a._OrtReleaseSession=f=>(a._OrtReleaseSession=k.ia)(f),a._OrtGetInputOutputCount=(f,g,y)=>(a._OrtGetInputOutputCount=k.ja)(f,g,y),a._OrtGetInputName=(f,g)=>(a._OrtGetInputName=k.ka)(f,g),a._OrtGetOutputName=(f,g)=>(a._OrtGetOutputName=k.la)(f,g),a._OrtFree=f=>(a._OrtFree=k.ma)(f),a._OrtCreateTensor=(f,g,y,v,_,P)=>(a._OrtCreateTensor=k.na)(f,g,y,v,_,P),a._OrtGetTensorData=(f,g,y,v,_)=>(a._OrtGetTensorData=k.oa)(f,g,y,v,_),a._OrtReleaseTensor=f=>(a._OrtReleaseTensor=k.pa)(f),a._OrtCreateRunOptions=(f,g,y,v)=>(a._OrtCreateRunOptions=k.qa)(f,g,y,v),a._OrtAddRunConfigEntry=(f,g,y)=>(a._OrtAddRunConfigEntry=k.ra)(f,g,y),a._OrtReleaseRunOptions=f=>(a._OrtReleaseRunOptions=k.sa)(f),a._OrtCreateBinding=f=>(a._OrtCreateBinding=k.ta)(f),a._OrtBindInput=(f,g,y)=>(a._OrtBindInput=k.ua)(f,g,y),a._OrtBindOutput=(f,g,y,v)=>(a._OrtBindOutput=k.va)(f,g,y,v),a._OrtClearBoundOutputs=f=>(a._OrtClearBoundOutputs=k.wa)(f),a._OrtReleaseBinding=f=>(a._OrtReleaseBinding=k.xa)(f),a._OrtRunWithBinding=(f,g,y,v,_)=>(a._OrtRunWithBinding=k.ya)(f,g,y,v,_),a._OrtRun=(f,g,y,v,_,P,N,K)=>(a._OrtRun=k.za)(f,g,y,v,_,P,N,K),a._OrtEndProfiling=f=>(a._OrtEndProfiling=k.Aa)(f);var _e=()=>(_e=k.Ba)();a._malloc=f=>(a._malloc=k.Ca)(f),a._free=f=>(a._free=k.Da)(f);var Ar,pn=(f,g,y,v,_,P)=>(pn=k.Ga)(f,g,y,v,_,P),oa=()=>(oa=k.Ha)(),ia=(f,g,y,v,_)=>(ia=k.Ia)(f,g,y,v,_),cn=f=>(cn=k.Ja)(f),$r=f=>($r=k.Ka)(f),aa=()=>(aa=k.La)(),sa=(f,g)=>(sa=k.Ma)(f,g),Dr=f=>(Dr=k.Na)(f),dn=f=>(dn=k.Oa)(f),hn=()=>(hn=k.Pa)();function ua(){0<ie||(d?(c(a),d||Or(Xt),startWorker(a)):(Or(oe),0<ie||Ar||(Ar=!0,a.calledRun=!0,ot||(d||Or(Xt),c(a),d||Or(_r)))))}return a.___start_em_js=837640,a.___stop_em_js=837701,a.stackSave=()=>hn(),a.stackRestore=f=>Dr(f),a.stackAlloc=f=>dn(f),a.UTF8ToString=Be,a.stringToUTF8=Ve,a.lengthBytesUTF8=Ai,Tt=function f(){Ar||ua(),Ar||(Tt=f)},ua(),e}),ld=Zn,globalThis.self?.name==="em-pthread"&&Zn()}),Oe,Du,Nu,ku,Jn,pd,Fu,cd,Qr=I(()=>{"use strict";Qo(),Oe=import.meta.url??(typeof document<"u"?document.currentScript?.src:typeof self<"u"?self.location?.href:void 0),Du=typeof location>"u"?void 0:location.origin,Nu=(t,r)=>{try{let n=r??Oe;return(n?new URL(t,n):new URL(t)).origin===Du}catch{return!1}},ku=async t=>{let r=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(r)},Jn=(um(),zr(ad)).default,pd=async()=>{if(!Oe)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(Nu(Oe))return[void 0,Jn()];let t=await ku(Oe);return[t,Jn(t)]},Fu=(lm(),zr(ud)).default,cd=async(t,r,n)=>[void 0,Fu]}),Yn,Rr,Ke,Qn,Cu,Lu,ti,ht,Ce=I(()=>{"use strict";Qr(),Rr=!1,Ke=!1,Qn=!1,Cu=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return typeof MessageChannel<"u"&&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{return!1}},Lu=()=>{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{return!1}},ti=async t=>{if(Rr)return Promise.resolve();if(Ke)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Qn)throw new Error("previous call to 'initializeWebAssembly()' failed.");Ke=!0;let r=t.initTimeout,n=t.numThreads;if(!Lu())throw new Error("WebAssembly SIMD is not supported in the current environment.");let s=Cu();n>1&&!s&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+n+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),t.numThreads=n=1);let p=t.wasmPaths,l=typeof p=="string"?p:void 0,c=p?.mjs,o=c?.href??c,a=p?.wasm,e=a?.href??a,u=t.wasmBinary,[i,d]=await cd(o,l,n>1),h=!1,m=[];if(r>0&&m.push(new Promise(b=>{setTimeout(()=>{h=!0,b()},r)})),m.push(new Promise((b,x)=>{let E={numThreads:n};u?E.wasmBinary=u:(e||l)&&(E.locateFile=(w,S)=>e??(l??S)+w),d(E).then(w=>{Ke=!1,Rr=!0,Yn=w,b(),i&&URL.revokeObjectURL(i)},w=>{Ke=!1,Qn=!0,x(w)})})),await Promise.race(m),h)throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`)},ht=()=>{if(Rr&&Yn)return Yn;throw new Error("WebAssembly is not initialized yet.")}}),ut,Wr,st,ei=I(()=>{"use strict";Ce(),ut=(t,r)=>{let n=ht(),s=n.lengthBytesUTF8(t)+1,p=n._malloc(s);return n.stringToUTF8(t,p,s),r.push(p),p},Wr=(t,r,n,s)=>{if(typeof t=="object"&&t!==null){if(n.has(t))throw new Error("Circular reference in options");n.add(t)}Object.entries(t).forEach(([p,l])=>{let c=r?r+p:p;if(typeof l=="object")Wr(l,c+".",n,s);else if(typeof l=="string"||typeof l=="number")s(c,l.toString());else if(typeof l=="boolean")s(c,l?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof l}`)})},st=t=>{let r=ht(),n=r.stackSave();try{let s=r.stackAlloc(8);r._OrtGetLastError(s,s+4);let p=r.HEAP32[s/4],l=r.HEAPU32[s/4+1],c=l?r.UTF8ToString(l):"";throw new Error(`${t} ERROR_CODE: ${p}, ERROR_MESSAGE: ${c}`)}finally{r.stackRestore(n)}}}),dd,pm=I(()=>{"use strict";Ce(),ei(),dd=t=>{let r=ht(),n=0,s=[],p=t||{};try{if(t?.logSeverityLevel===void 0)p.logSeverityLevel=2;else if(typeof t.logSeverityLevel!="number"||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(t?.logVerbosityLevel===void 0)p.logVerbosityLevel=0;else if(typeof t.logVerbosityLevel!="number"||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);t?.terminate===void 0&&(p.terminate=!1);let l=0;return t?.tag!==void 0&&(l=ut(t.tag,s)),n=r._OrtCreateRunOptions(p.logSeverityLevel,p.logVerbosityLevel,!!p.terminate,l),n===0&&st("Can't create run options."),t?.extra!==void 0&&Wr(t.extra,"",new WeakSet,(c,o)=>{let a=ut(c,s),e=ut(o,s);r._OrtAddRunConfigEntry(n,a,e)!==0&&st(`Can't set a run config entry: ${c} - ${o}.`)}),[n,s]}catch(l){throw n!==0&&r._OrtReleaseRunOptions(n),s.forEach(c=>r._free(c)),l}}}),Ru,ju,Bu,Vu,hd,cm=I(()=>{"use strict";Ce(),ei(),Ru=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}`)}},ju=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},Bu=t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});let r=t.extra.session;r.use_ort_model_bytes_directly||(r.use_ort_model_bytes_directly="1"),t.executionProviders&&t.executionProviders.some(n=>(typeof n=="string"?n:n.name)==="webgpu")&&(t.enableMemPattern=!1)},Vu=(t,r,n)=>{for(let s of r){let p=typeof s=="string"?s:s.name;switch(p){case"webnn":if(p="WEBNN",typeof s!="string"){let c=s?.deviceType;if(c){let o=ut("deviceType",n),a=ut(c,n);ht()._OrtAddSessionConfigEntry(t,o,a)!==0&&st(`Can't set a session config entry: 'deviceType' - ${c}.`)}}break;case"webgpu":if(p="JS",typeof s!="string"){let c=s;if(c?.preferredLayout){if(c.preferredLayout!=="NCHW"&&c.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${c.preferredLayout}`);let o=ut("preferredLayout",n),a=ut(c.preferredLayout,n);ht()._OrtAddSessionConfigEntry(t,o,a)!==0&&st(`Can't set a session config entry: 'preferredLayout' - ${c.preferredLayout}.`)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${p}`)}let l=ut(p,n);ht()._OrtAppendExecutionProvider(t,l)!==0&&st(`Can't append execution provider: ${p}.`)}},hd=t=>{let r=ht(),n=0,s=[],p=t||{};Bu(p);try{let l=Ru(p.graphOptimizationLevel??"all"),c=ju(p.executionMode??"sequential"),o=typeof p.logId=="string"?ut(p.logId,s):0,a=p.logSeverityLevel??2;if(!Number.isInteger(a)||a<0||a>4)throw new Error(`log serverity level is not valid: ${a}`);let e=p.logVerbosityLevel??0;if(!Number.isInteger(e)||e<0||e>4)throw new Error(`log verbosity level is not valid: ${e}`);let u=typeof p.optimizedModelFilePath=="string"?ut(p.optimizedModelFilePath,s):0;if(n=r._OrtCreateSessionOptions(l,!!p.enableCpuMemArena,!!p.enableMemPattern,c,!!p.enableProfiling,0,o,a,e,u),n===0&&st("Can't create session options."),p.executionProviders&&Vu(n,p.executionProviders,s),p.enableGraphCapture!==void 0){if(typeof p.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${p.enableGraphCapture}`);let i=ut("enableGraphCapture",s),d=ut(p.enableGraphCapture.toString(),s);r._OrtAddSessionConfigEntry(n,i,d)!==0&&st(`Can't set a session config entry: 'enableGraphCapture' - ${p.enableGraphCapture}.`)}if(p.freeDimensionOverrides)for(let[i,d]of Object.entries(p.freeDimensionOverrides)){if(typeof i!="string")throw new Error(`free dimension override name must be a string: ${i}`);if(typeof d!="number"||!Number.isInteger(d)||d<0)throw new Error(`free dimension override value must be a non-negative integer: ${d}`);let h=ut(i,s);r._OrtAddFreeDimensionOverride(n,h,d)!==0&&st(`Can't set a free dimension override: ${i} - ${d}.`)}return p.extra!==void 0&&Wr(p.extra,"",new WeakSet,(i,d)=>{let h=ut(i,s),m=ut(d,s);r._OrtAddSessionConfigEntry(n,h,m)!==0&&st(`Can't set a session config entry: ${i} - ${d}.`)}),[n,s]}catch(l){throw n!==0&&r._OrtReleaseSessionOptions(n),s.forEach(c=>r._free(c)),l}}}),ir,fd,ar,gd,md,ri,ni,bd,yd=I(()=>{"use strict";ir=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"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${t}`)}},fd=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 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${t}`)}},ar=(t,r)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][t],s=typeof r=="number"?r:r.reduce((p,l)=>p*l,1);return n>0?Math.ceil(s*n):void 0},gd=t=>{switch(t){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}},md=t=>{switch(t){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: ${t}`)}},ri=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",ni=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool",bd=t=>{switch(t){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${t}`)}}}),oi,wd=I(()=>{"use strict";Qo(),oi=async t=>{if(typeof t=="string")if(0)try{}catch(r){}else{let r=await fetch(t);if(!r.ok)throw new Error(`failed to load external data file: ${t}`);let n=r.headers.get("Content-Length"),s=n?parseInt(n,10):0;if(s<1073741824)return new Uint8Array(await r.arrayBuffer());{if(!r.body)throw new Error(`failed to load external data file: ${t}, no response body.`);let p=r.body.getReader(),l;try{l=new ArrayBuffer(s)}catch(o){if(o instanceof RangeError){let a=Math.ceil(s/65536);l=new WebAssembly.Memory({initial:a,maximum:a}).buffer}else throw o}let c=0;for(;;){let{done:o,value:a}=await p.read();if(o)break;let e=a.byteLength;new Uint8Array(l,c,e).set(a),c+=e}return new Uint8Array(l,0,s)}}else return t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t instanceof Uint8Array?t:new Uint8Array(t)}}),Mu,ii,ai,de,zu,Xr,si,ui,to,li,pi,ci,vd=I(()=>{"use strict";pm(),cm(),yd(),Ce(),ei(),wd(),Mu=(t,r)=>{ht()._OrtInit(t,r)!==0&&st("Can't initialize onnxruntime.")},ii=async t=>{Mu(t.wasm.numThreads,md(t.logLevel))},ai=async(t,r)=>{},de=new Map,zu=t=>{let r=ht(),n=r.stackSave();try{let s=r.stackAlloc(8);return r._OrtGetInputOutputCount(t,s,s+4)!==0&&st("Can't get session input/output count."),[r.HEAP32[s/4],r.HEAP32[s/4+1]]}finally{r.stackRestore(n)}},Xr=t=>{let r=ht(),n=r._malloc(t.byteLength);if(n===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${t.byteLength}.`);return r.HEAPU8.set(t,n),[n,t.byteLength]},si=async(t,r)=>{let n,s,p=ht();Array.isArray(t)?[n,s]=t:t.buffer===p.HEAPU8.buffer?[n,s]=[t.byteOffset,t.byteLength]:[n,s]=Xr(t);let l=0,c=0,o=0,a=[],e=[],u=[];try{if([c,a]=hd(r),r?.externalData&&p.mountExternalData){let w=[];for(let S of r.externalData){let $=typeof S=="string"?S:S.path;w.push(oi(typeof S=="string"?S:S.data).then(F=>{p.mountExternalData($,F)}))}await Promise.all(w)}for(let w of r?.executionProviders??[])if((typeof w=="string"?w:w.name)==="webnn"){if(p.shouldTransferToMLTensor=!1,p.currentContext)throw new Error("WebNN execution provider is already set.");if(typeof w!="string"){let S=w,$=S?.context,F=S?.gpuDevice,bt=S?.deviceType,pt=S?.numThreads,Z=S?.powerPreference;$?p.currentContext=$:F?p.currentContext=await navigator.ml.createContext(F):p.currentContext=await navigator.ml.createContext({deviceType:bt,numThreads:pt,powerPreference:Z})}else p.currentContext=await navigator.ml.createContext();break}l=await p._OrtCreateSession(n,s,c),l===0&&st("Can't create a session."),p.currentContext&&(p.jsepRegisterMLContext(l,p.currentContext),p.currentContext=void 0,p.shouldTransferToMLTensor=!0);let[i,d]=zu(l),h=!!r?.enableGraphCapture,m=[],b=[],x=[];for(let w=0;w<i;w++){let S=p._OrtGetInputName(l,w);S===0&&st("Can't get an input name."),e.push(S),m.push(p.UTF8ToString(S))}for(let w=0;w<d;w++){let S=p._OrtGetOutputName(l,w);S===0&&st("Can't get an output name."),u.push(S);let $=p.UTF8ToString(S);b.push($)}return de.set(l,[l,e,u,null,h,!1]),[l,m,b]}catch(i){throw e.forEach(d=>p._OrtFree(d)),u.forEach(d=>p._OrtFree(d)),o!==0&&p._OrtReleaseBinding(o),l!==0&&p._OrtReleaseSession(l),i}finally{p._free(n),c!==0&&p._OrtReleaseSessionOptions(c),a.forEach(i=>p._free(i)),p.unmountExternalData?.()}},ui=t=>{let r=ht(),n=de.get(t);if(!n)throw new Error(`cannot release session. invalid session id: ${t}`);let[s,p,l,c,o]=n;c&&(o&&r._OrtClearBoundOutputs(c.handle),r._OrtReleaseBinding(c.handle)),r.jsepOnReleaseSession?.(t),p.forEach(a=>r._OrtFree(a)),l.forEach(a=>r._OrtFree(a)),r._OrtReleaseSession(s),de.delete(t)},to=(t,r,n,s,p,l=!1)=>{if(!t){r.push(0);return}let c=ht(),o=t[0],a=t[1],e=t[3],u,i;if(o==="string"&&(e==="gpu-buffer"||e==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(l&&e!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${p} when enableGraphCapture is true.`);if(e==="gpu-buffer"){let m=t[2].gpuBuffer;i=ar(ir(o),a);let b=c.jsepRegisterBuffer;if(!b)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');u=b(s,p,m,i)}else if(e==="ml-tensor"){let m=t[2].mlTensor;i=ar(ir(o),a);let b=c.jsepRegisterMLTensor;if(!b)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');u=b(m,ir(o),a)}else{let m=t[2];if(Array.isArray(m)){i=4*m.length,u=c._malloc(i),n.push(u);let b=u/4;for(let x=0;x<m.length;x++){if(typeof m[x]!="string")throw new TypeError(`tensor data at index ${x} is not a string`);c.HEAPU32[b++]=ut(m[x],n)}}else i=m.byteLength,u=c._malloc(i),n.push(u),c.HEAPU8.set(new Uint8Array(m.buffer,m.byteOffset,i),u)}let d=c.stackSave(),h=c.stackAlloc(4*a.length);try{let m=h/4;a.forEach(x=>c.HEAP32[m++]=x);let b=c._OrtCreateTensor(ir(o),u,i,h,a.length,bd(e));b===0&&st(`Can't create tensor for input/output. session=${s}, index=${p}.`),r.push(b)}finally{c.stackRestore(d)}},li=async(t,r,n,s,p,l)=>{let c=ht(),o=de.get(t);if(!o)throw new Error(`cannot run inference. invalid session id: ${t}`);let a=o[0],e=o[1],u=o[2],i=o[3],d=o[4],h=o[5],m=r.length,b=s.length,x=0,E=[],w=[],S=[],$=[],F=c.stackSave(),bt=c.stackAlloc(m*4),pt=c.stackAlloc(m*4),Z=c.stackAlloc(b*4),Le=c.stackAlloc(b*4);try{c.jsepOnRunStart?.(a),[x,E]=dd(l);for(let G=0;G<m;G++)to(n[G],w,$,t,r[G],d);for(let G=0;G<b;G++)to(p[G],S,$,t,m+s[G],d);let At=bt/4,vr=pt/4,yt=Z/4,xr=Le/4;for(let G=0;G<m;G++)c.HEAPU32[At++]=w[G],c.HEAPU32[vr++]=e[r[G]];for(let G=0;G<b;G++)c.HEAPU32[yt++]=S[G],c.HEAPU32[xr++]=u[s[G]];let Ut;Ut=await c._OrtRun(a,pt,bt,m,Le,b,Z,x),Ut!==0&&st("failed to call OrtRun().");let wt=[];for(let G=0;G<b;G++){let Wt=c.HEAPU32[Z/4+G];if(Wt===S[G]){wt.push(p[G]);continue}let Tr=c.stackSave(),xt=c.stackAlloc(4*4),ve=!1,ot,it=0;try{c._OrtGetTensorData(Wt,xt,xt+4,xt+8,xt+12)!==0&&st(`Can't access output tensor data on index ${G}.`);let oe=xt/4,Xt=c.HEAPU32[oe++];it=c.HEAPU32[oe++];let _r=c.HEAPU32[oe++],ie=c.HEAPU32[oe++],Ct=[];for(let et=0;et<ie;et++)Ct.push(c.HEAPU32[_r/4+et]);c._OrtFree(_r);let Tt=Ct.reduce((et,at)=>et*at,1);ot=fd(Xt);let ae=i?.outputPreferredLocations[s[G]];if(ot==="string"){if(ae==="gpu-buffer"||ae==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let et=[],at=it/4;for(let Gt=0;Gt<Tt;Gt++){let Re=c.HEAPU32[at++],Sr=Gt===Tt-1?void 0:c.HEAPU32[at]-Re;et.push(c.UTF8ToString(Re,Sr))}wt.push([ot,Ct,et,"cpu"])}else if(ae==="gpu-buffer"&&Tt>0){let et=c.jsepGetBuffer;if(!et)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let at=et(it),Gt=ar(Xt,Tt);if(Gt===void 0||!ri(ot))throw new Error(`Unsupported data type: ${ot}`);ve=!0,wt.push([ot,Ct,{gpuBuffer:at,download:c.jsepCreateDownloader(at,Gt,ot),dispose:()=>{c._OrtReleaseTensor(Wt)}},"gpu-buffer"])}else if(ae==="ml-tensor"&&Tt>0){let et=c.jsepEnsureTensor;if(!et)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(ar(Xt,Tt)===void 0||!ni(ot))throw new Error(`Unsupported data type: ${ot}`);let at=await et(it,Xt,Ct,!1);ve=!0,wt.push([ot,Ct,{mlTensor:at,download:c.jsepCreateMLTensorDownloader(it,ot),dispose:()=>{c.jsepReleaseTensorId(it),c._OrtReleaseTensor(Wt)}},"ml-tensor"])}else{let et=gd(ot),at=new et(Tt);new Uint8Array(at.buffer,at.byteOffset,at.byteLength).set(c.HEAPU8.subarray(it,it+at.byteLength)),wt.push([ot,Ct,at,"cpu"])}}finally{c.stackRestore(Tr),ot==="string"&&it&&c._free(it),ve||c._OrtReleaseTensor(Wt)}}return i&&!d&&(c._OrtClearBoundOutputs(i.handle),de.set(t,[a,e,u,i,d,!1])),wt}finally{c.stackRestore(F),w.forEach(At=>c._OrtReleaseTensor(At)),S.forEach(At=>c._OrtReleaseTensor(At)),$.forEach(At=>c._free(At)),x!==0&&c._OrtReleaseRunOptions(x),E.forEach(At=>c._free(At))}},pi=t=>{let r=ht(),n=de.get(t);if(!n)throw new Error("invalid session id");let s=n[0],p=r._OrtEndProfiling(s);p===0&&st("Can't get an profile file name."),r._OrtFree(p)},ci=t=>{let r=[];for(let n of t){let s=n[2];!Array.isArray(s)&&"buffer"in s&&r.push(s.buffer)}return r}}),Yt,$t,Se,Ze,Je,jr,eo,Br,he,fe,Uu,xd,Td,_d,Sd,Od,Ed,Id,Pd=I(()=>{"use strict";zt(),vd(),Ce(),Qr(),Yt=()=>!!j.wasm.proxy&&typeof document<"u",Se=!1,Ze=!1,Je=!1,Br=new Map,he=(t,r)=>{let n=Br.get(t);n?n.push(r):Br.set(t,[r])},fe=()=>{if(Se||!Ze||Je||!$t)throw new Error("worker not ready")},Uu=t=>{switch(t.data.type){case"init-wasm":Se=!1,t.data.err?(Je=!0,eo[1](t.data.err)):(Ze=!0,eo[0]()),jr&&(URL.revokeObjectURL(jr),jr=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let r=Br.get(t.data.type);t.data.err?r.shift()[1](t.data.err):r.shift()[0](t.data.out);break}default:}},xd=async()=>{if(!Ze){if(Se)throw new Error("multiple calls to 'initWasm()' detected.");if(Je)throw new Error("previous call to 'initWasm()' failed.");if(Se=!0,Yt())return new Promise((t,r)=>{$t?.terminate(),pd().then(([n,s])=>{try{$t=s,$t.onerror=l=>r(l),$t.onmessage=Uu,eo=[t,r];let p={type:"init-wasm",in:j};$t.postMessage(p),jr=n}catch(p){r(p)}},r)});try{await ti(j.wasm),await ii(j),Ze=!0}catch(t){throw Je=!0,t}finally{Se=!1}}},Td=async t=>{if(Yt())return fe(),new Promise((r,n)=>{he("init-ep",[r,n]);let s={type:"init-ep",in:{epName:t,env:j}};$t.postMessage(s)});await ai(j,t)},_d=async t=>Yt()?(fe(),new Promise((r,n)=>{he("copy-from",[r,n]);let s={type:"copy-from",in:{buffer:t}};$t.postMessage(s,[t.buffer])})):Xr(t),Sd=async(t,r)=>{if(Yt()){if(r?.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return fe(),new Promise((n,s)=>{he("create",[n,s]);let p={type:"create",in:{model:t,options:{...r}}},l=[];t instanceof Uint8Array&&l.push(t.buffer),$t.postMessage(p,l)})}else return si(t,r)},Od=async t=>{if(Yt())return fe(),new Promise((r,n)=>{he("release",[r,n]);let s={type:"release",in:t};$t.postMessage(s)});ui(t)},Ed=async(t,r,n,s,p,l)=>{if(Yt()){if(n.some(c=>c[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if(p.some(c=>c))throw new Error("pre-allocated output tensor is not supported for proxy.");return fe(),new Promise((c,o)=>{he("run",[c,o]);let a=n,e={type:"run",in:{sessionId:t,inputIndices:r,inputs:a,outputIndices:s,options:l}};$t.postMessage(e,ci(a))})}else return li(t,r,n,s,p,l)},Id=async t=>{if(Yt())return fe(),new Promise((r,n)=>{he("end-profiling",[r,n]);let s={type:"end-profiling",in:t};$t.postMessage(s)});pi(t)}}),ro,Gu,Ad,dm=I(()=>{"use strict";zt(),Pd(),yd(),Qo(),wd(),ro=(t,r)=>{switch(t.location){case"cpu":return[t.type,t.dims,t.data,"cpu"];case"gpu-buffer":return[t.type,t.dims,{gpuBuffer:t.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[t.type,t.dims,{mlTensor:t.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${t.location} for ${r()}`)}},Gu=t=>{switch(t[3]){case"cpu":return new ft(t[0],t[2],t[1]);case"gpu-buffer":{let r=t[0];if(!ri(r))throw new Error(`not supported data type: ${r} for deserializing GPU tensor`);let{gpuBuffer:n,download:s,dispose:p}=t[2];return ft.fromGpuBuffer(n,{dataType:r,dims:t[1],download:s,dispose:p})}case"ml-tensor":{let r=t[0];if(!ni(r))throw new Error(`not supported data type: ${r} for deserializing MLTensor tensor`);let{mlTensor:n,download:s,dispose:p}=t[2];return ft.fromMLTensor(n,{dataType:r,dims:t[1],download:s,dispose:p})}default:throw new Error(`invalid data location: ${t[3]}`)}},Ad=class{async fetchModelAndCopyToWasmMemory(t){return _d(await oi(t))}async loadModel(t,r){Pe();let n;typeof t=="string"?n=await this.fetchModelAndCopyToWasmMemory(t):n=t,[this.sessionId,this.inputNames,this.outputNames]=await Sd(n,r),Ae()}async dispose(){return Od(this.sessionId)}async run(t,r,n){Pe();let s=[],p=[];Object.entries(t).forEach(i=>{let d=i[0],h=i[1],m=this.inputNames.indexOf(d);if(m===-1)throw new Error(`invalid input '${d}'`);s.push(h),p.push(m)});let l=[],c=[];Object.entries(r).forEach(i=>{let d=i[0],h=i[1],m=this.outputNames.indexOf(d);if(m===-1)throw new Error(`invalid output '${d}'`);l.push(h),c.push(m)});let o=s.map((i,d)=>ro(i,()=>`input "${this.inputNames[p[d]]}"`)),a=l.map((i,d)=>i?ro(i,()=>`output "${this.outputNames[c[d]]}"`):null),e=await Ed(this.sessionId,p,o,c,a,n),u={};for(let i=0;i<e.length;i++)u[this.outputNames[c[i]]]=l[i]??Gu(e[i]);return Ae(),u}startProfiling(){}endProfiling(){Id(this.sessionId)}}}),$d={};gr($d,{OnnxruntimeWebAssemblyBackend:()=>Bo,initializeFlags:()=>jo,wasmBackend:()=>Dd});var jo,Bo,Dd,hm=I(()=>{"use strict";zt(),Pd(),dm(),Qr(),jo=()=>{if((typeof j.wasm.initTimeout!="number"||j.wasm.initTimeout<0)&&(j.wasm.initTimeout=0),j.wasm.simd===!1&&console.warn('Deprecated property "env.wasm.simd" is set to false. non-SIMD build is no longer provided, and this setting will be ignored.'),typeof j.wasm.proxy!="boolean"&&(j.wasm.proxy=!1),typeof j.wasm.trace!="boolean"&&(j.wasm.trace=!1),typeof j.wasm.numThreads!="number"||!Number.isInteger(j.wasm.numThreads)||j.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)j.wasm.numThreads=1;else{let t=typeof navigator>"u"?fh("node:os").cpus().length:navigator.hardwareConcurrency;j.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},Bo=class{async init(t){jo(),await xd(),await Td(t)}async createInferenceSessionHandler(t,r){let n=new Ad;return await n.loadModel(t,r),Promise.resolve(n)}},Dd=new Bo});zt();zt();zt();var fm="1.20.0",gm=cl;{let t=(sm(),zr(od)).onnxjsBackend;cr("webgl",t,-10)}{let t=(hm(),zr($d)).wasmBackend;cr("cpu",t,10),cr("wasm",t,10)}Object.defineProperty(j.versions,"web",{value:fm,enumerable:!0});export{sl as InferenceSession,no as TRACE,Pe as TRACE_FUNC_BEGIN,Ae as TRACE_FUNC_END,ft as Tensor,pl as TrainingSession,gm as default,j as env,cr as registerBackend};
1800
+ `,"%p":O=>0<=O.Va&&12>O.Va?"AM":"PM","%S":O=>P(O.gb,2),"%t":()=>" ","%u":O=>O.Qa||7,"%U":O=>P(Math.floor((O.Sa+7-O.Qa)/7),2),"%V":O=>{var z=Math.floor((O.Sa+7-(O.Qa+6)%7)/7);if(2>=(O.Qa+371-O.Sa-2)%7&&z++,z)z==53&&((rt=(O.Qa+371-O.Sa)%7)==4||rt==3&&xe(O.Ta)||(z=1));else{z=52;var rt=(O.Qa+7-O.Sa-1)%7;(rt==4||rt==5&&xe(O.Ta%400-1))&&z++}return P(z,2)},"%w":O=>O.Qa,"%W":O=>P(Math.floor((O.Sa+7-(O.Qa+6)%7)/7),2),"%y":O=>(O.Ta+1900).toString().substring(2),"%Y":O=>O.Ta+1900,"%z":O=>{var z=0<=(O=O.eb);return O=Math.abs(O)/60,(z?"+":"-")+("0000"+(O/60*100+O%60)).slice(-4)},"%Z":O=>O.hb,"%%":()=>"%"},y=y.replace(/%%/g,"\0\0"),gt)y.includes(vt)&&(y=y.replace(new RegExp(vt,"g"),gt[vt](v)));return vt=(function(O){var z=Array(Ai(O)+1);return $i(O,z,0,z.length),z})(y=y.replace(/\0\0/g,"%")),vt.length>g?0:(ah(vt,f),vt.length-1)}function sh(f,g,y,v){return na(f>>>0,g>>>0,y>>>0,v>>>0)}d||(function(){for(var f=a.numThreads-1;f--;)xi();oe.unshift(()=>{ie++,(function(g){d?g():Promise.all(Kt.map(vi)).then(g)})(()=>ae())})})();var uh=[rn,mi,_i,Ii,Pi,Di,Ni,ki,Fi,Ci,Li,Ri,ji,Bi,Vi,Mi,Gi,Hi,Ki,Zi,Ji,Yi,Qi,ta],k=(function(){function f(y,v){return k=y.exports,k=(function(){var _=k,P=K=>()=>K()>>>0,N=K=>ct=>K(ct)>>>0;return(_=Object.assign({},_)).Ba=P(_.Ba),_.Ca=N(_.Ca),_.emscripten_main_runtime_thread_id=P(_.emscripten_main_runtime_thread_id),_.Oa=N(_.Oa),_.Pa=P(_.Pa),_})(),bi.push(k.Ea),Ti=k.Fa,Xt.unshift(k.$),xr=v,ae(),k}var g=hi();if(ie++,a.instantiateWasm)try{return a.instantiateWasm(g,f)}catch(y){Z(`Module.instantiateWasm callback failed with error: ${y}`),o(y)}return at||(at=a.locateFile?Gt("ort-wasm-simd-threaded.wasm")?"ort-wasm-simd-threaded.wasm":a.locateFile?a.locateFile("ort-wasm-simd-threaded.wasm",S):S+"ort-wasm-simd-threaded.wasm":new URL("ort-wasm-simd-threaded.wasm",import.meta.url).href),(function(y,v){var _=at;return $||typeof WebAssembly.instantiateStreaming!="function"||Gt(_)||Re(_)||typeof fetch!="function"?di(_,y,v):fetch(_,{credentials:"same-origin"}).then(P=>WebAssembly.instantiateStreaming(P,y).then(v,function(N){return Z(`wasm streaming compile failed: ${N}`),Z("falling back to ArrayBuffer instantiation"),di(_,y,v)}))})(g,function(y){f(y.instance,y.module)}).catch(o),{}})();a._OrtInit=(f,g)=>(a._OrtInit=k.aa)(f,g),a._OrtGetLastError=(f,g)=>(a._OrtGetLastError=k.ba)(f,g),a._OrtCreateSessionOptions=(f,g,y,v,_,P,N,K,ct,gt)=>(a._OrtCreateSessionOptions=k.ca)(f,g,y,v,_,P,N,K,ct,gt),a._OrtAppendExecutionProvider=(f,g)=>(a._OrtAppendExecutionProvider=k.da)(f,g),a._OrtAddFreeDimensionOverride=(f,g,y)=>(a._OrtAddFreeDimensionOverride=k.ea)(f,g,y),a._OrtAddSessionConfigEntry=(f,g,y)=>(a._OrtAddSessionConfigEntry=k.fa)(f,g,y),a._OrtReleaseSessionOptions=f=>(a._OrtReleaseSessionOptions=k.ga)(f),a._OrtCreateSession=(f,g,y)=>(a._OrtCreateSession=k.ha)(f,g,y),a._OrtReleaseSession=f=>(a._OrtReleaseSession=k.ia)(f),a._OrtGetInputOutputCount=(f,g,y)=>(a._OrtGetInputOutputCount=k.ja)(f,g,y),a._OrtGetInputName=(f,g)=>(a._OrtGetInputName=k.ka)(f,g),a._OrtGetOutputName=(f,g)=>(a._OrtGetOutputName=k.la)(f,g),a._OrtFree=f=>(a._OrtFree=k.ma)(f),a._OrtCreateTensor=(f,g,y,v,_,P)=>(a._OrtCreateTensor=k.na)(f,g,y,v,_,P),a._OrtGetTensorData=(f,g,y,v,_)=>(a._OrtGetTensorData=k.oa)(f,g,y,v,_),a._OrtReleaseTensor=f=>(a._OrtReleaseTensor=k.pa)(f),a._OrtCreateRunOptions=(f,g,y,v)=>(a._OrtCreateRunOptions=k.qa)(f,g,y,v),a._OrtAddRunConfigEntry=(f,g,y)=>(a._OrtAddRunConfigEntry=k.ra)(f,g,y),a._OrtReleaseRunOptions=f=>(a._OrtReleaseRunOptions=k.sa)(f),a._OrtCreateBinding=f=>(a._OrtCreateBinding=k.ta)(f),a._OrtBindInput=(f,g,y)=>(a._OrtBindInput=k.ua)(f,g,y),a._OrtBindOutput=(f,g,y,v)=>(a._OrtBindOutput=k.va)(f,g,y,v),a._OrtClearBoundOutputs=f=>(a._OrtClearBoundOutputs=k.wa)(f),a._OrtReleaseBinding=f=>(a._OrtReleaseBinding=k.xa)(f),a._OrtRunWithBinding=(f,g,y,v,_)=>(a._OrtRunWithBinding=k.ya)(f,g,y,v,_),a._OrtRun=(f,g,y,v,_,P,N,K)=>(a._OrtRun=k.za)(f,g,y,v,_,P,N,K),a._OrtEndProfiling=f=>(a._OrtEndProfiling=k.Aa)(f);var _e=()=>(_e=k.Ba)();a._malloc=f=>(a._malloc=k.Ca)(f),a._free=f=>(a._free=k.Da)(f);var Ar,pn=(f,g,y,v,_,P)=>(pn=k.Ga)(f,g,y,v,_,P),oa=()=>(oa=k.Ha)(),ia=(f,g,y,v,_)=>(ia=k.Ia)(f,g,y,v,_),cn=f=>(cn=k.Ja)(f),$r=f=>($r=k.Ka)(f),aa=()=>(aa=k.La)(),sa=(f,g)=>(sa=k.Ma)(f,g),Dr=f=>(Dr=k.Na)(f),dn=f=>(dn=k.Oa)(f),hn=()=>(hn=k.Pa)();function ua(){0<ie||(d?(c(a),d||Or(Xt),startWorker(a)):(Or(oe),0<ie||Ar||(Ar=!0,a.calledRun=!0,ot||(d||Or(Xt),c(a),d||Or(_r)))))}return a.___start_em_js=837640,a.___stop_em_js=837701,a.stackSave=()=>hn(),a.stackRestore=f=>Dr(f),a.stackAlloc=f=>dn(f),a.UTF8ToString=Be,a.stringToUTF8=Ve,a.lengthBytesUTF8=Ai,Tt=function f(){Ar||ua(),Ar||(Tt=f)},ua(),e}),ld=Zn,globalThis.self?.name==="em-pthread"&&Zn()}),Oe,Du,Nu,ku,Jn,pd,Fu,cd,Qr=I(()=>{"use strict";Qo(),Oe=import.meta.url??(typeof document<"u"?document.currentScript?.src:typeof self<"u"?self.location?.href:void 0),Du=typeof location>"u"?void 0:location.origin,Nu=(t,r)=>{try{let n=r??Oe;return(n?new URL(t,n):new URL(t)).origin===Du}catch{return!1}},ku=async t=>{let r=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(r)},Jn=(um(),zr(ad)).default,pd=async()=>{if(!Oe)throw new Error("Failed to load proxy worker: cannot determine the script source URL.");if(Nu(Oe))return[void 0,Jn()];let t=await ku(Oe);return[t,Jn(t)]},Fu=(lm(),zr(ud)).default,cd=async(t,r,n)=>[void 0,Fu]}),Yn,Rr,Ke,Qn,Cu,Lu,ti,ht,Ce=I(()=>{"use strict";Qr(),Rr=!1,Ke=!1,Qn=!1,Cu=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return typeof MessageChannel<"u"&&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{return!1}},Lu=()=>{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{return!1}},ti=async t=>{if(Rr)return Promise.resolve();if(Ke)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Qn)throw new Error("previous call to 'initializeWebAssembly()' failed.");Ke=!0;let r=t.initTimeout,n=t.numThreads;if(!Lu())throw new Error("WebAssembly SIMD is not supported in the current environment.");let s=Cu();n>1&&!s&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+n+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),t.numThreads=n=1);let p=t.wasmPaths,l=typeof p=="string"?p:void 0,c=p?.mjs,o=c?.href??c,a=p?.wasm,e=a?.href??a,u=t.wasmBinary,[i,d]=await cd(o,l,n>1),h=!1,m=[];if(r>0&&m.push(new Promise(b=>{setTimeout(()=>{h=!0,b()},r)})),m.push(new Promise((b,x)=>{let E={numThreads:n};u?E.wasmBinary=u:(e||l)&&(E.locateFile=(w,S)=>e??(l??S)+w),d(E).then(w=>{Ke=!1,Rr=!0,Yn=w,b(),i&&URL.revokeObjectURL(i)},w=>{Ke=!1,Qn=!0,x(w)})})),await Promise.race(m),h)throw new Error(`WebAssembly backend initializing failed due to timeout: ${r}ms`)},ht=()=>{if(Rr&&Yn)return Yn;throw new Error("WebAssembly is not initialized yet.")}}),ut,Wr,st,ei=I(()=>{"use strict";Ce(),ut=(t,r)=>{let n=ht(),s=n.lengthBytesUTF8(t)+1,p=n._malloc(s);return n.stringToUTF8(t,p,s),r.push(p),p},Wr=(t,r,n,s)=>{if(typeof t=="object"&&t!==null){if(n.has(t))throw new Error("Circular reference in options");n.add(t)}Object.entries(t).forEach(([p,l])=>{let c=r?r+p:p;if(typeof l=="object")Wr(l,c+".",n,s);else if(typeof l=="string"||typeof l=="number")s(c,l.toString());else if(typeof l=="boolean")s(c,l?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof l}`)})},st=t=>{let r=ht(),n=r.stackSave();try{let s=r.stackAlloc(8);r._OrtGetLastError(s,s+4);let p=r.HEAP32[s/4],l=r.HEAPU32[s/4+1],c=l?r.UTF8ToString(l):"";throw new Error(`${t} ERROR_CODE: ${p}, ERROR_MESSAGE: ${c}`)}finally{r.stackRestore(n)}}}),dd,pm=I(()=>{"use strict";Ce(),ei(),dd=t=>{let r=ht(),n=0,s=[],p=t||{};try{if(t?.logSeverityLevel===void 0)p.logSeverityLevel=2;else if(typeof t.logSeverityLevel!="number"||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(t?.logVerbosityLevel===void 0)p.logVerbosityLevel=0;else if(typeof t.logVerbosityLevel!="number"||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);t?.terminate===void 0&&(p.terminate=!1);let l=0;return t?.tag!==void 0&&(l=ut(t.tag,s)),n=r._OrtCreateRunOptions(p.logSeverityLevel,p.logVerbosityLevel,!!p.terminate,l),n===0&&st("Can't create run options."),t?.extra!==void 0&&Wr(t.extra,"",new WeakSet,(c,o)=>{let a=ut(c,s),e=ut(o,s);r._OrtAddRunConfigEntry(n,a,e)!==0&&st(`Can't set a run config entry: ${c} - ${o}.`)}),[n,s]}catch(l){throw n!==0&&r._OrtReleaseRunOptions(n),s.forEach(c=>r._free(c)),l}}}),Ru,ju,Bu,Vu,hd,cm=I(()=>{"use strict";Ce(),ei(),Ru=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}`)}},ju=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},Bu=t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});let r=t.extra.session;r.use_ort_model_bytes_directly||(r.use_ort_model_bytes_directly="1"),t.executionProviders&&t.executionProviders.some(n=>(typeof n=="string"?n:n.name)==="webgpu")&&(t.enableMemPattern=!1)},Vu=(t,r,n)=>{for(let s of r){let p=typeof s=="string"?s:s.name;switch(p){case"webnn":if(p="WEBNN",typeof s!="string"){let c=s?.deviceType;if(c){let o=ut("deviceType",n),a=ut(c,n);ht()._OrtAddSessionConfigEntry(t,o,a)!==0&&st(`Can't set a session config entry: 'deviceType' - ${c}.`)}}break;case"webgpu":if(p="JS",typeof s!="string"){let c=s;if(c?.preferredLayout){if(c.preferredLayout!=="NCHW"&&c.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${c.preferredLayout}`);let o=ut("preferredLayout",n),a=ut(c.preferredLayout,n);ht()._OrtAddSessionConfigEntry(t,o,a)!==0&&st(`Can't set a session config entry: 'preferredLayout' - ${c.preferredLayout}.`)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${p}`)}let l=ut(p,n);ht()._OrtAppendExecutionProvider(t,l)!==0&&st(`Can't append execution provider: ${p}.`)}},hd=t=>{let r=ht(),n=0,s=[],p=t||{};Bu(p);try{let l=Ru(p.graphOptimizationLevel??"all"),c=ju(p.executionMode??"sequential"),o=typeof p.logId=="string"?ut(p.logId,s):0,a=p.logSeverityLevel??2;if(!Number.isInteger(a)||a<0||a>4)throw new Error(`log serverity level is not valid: ${a}`);let e=p.logVerbosityLevel??0;if(!Number.isInteger(e)||e<0||e>4)throw new Error(`log verbosity level is not valid: ${e}`);let u=typeof p.optimizedModelFilePath=="string"?ut(p.optimizedModelFilePath,s):0;if(n=r._OrtCreateSessionOptions(l,!!p.enableCpuMemArena,!!p.enableMemPattern,c,!!p.enableProfiling,0,o,a,e,u),n===0&&st("Can't create session options."),p.executionProviders&&Vu(n,p.executionProviders,s),p.enableGraphCapture!==void 0){if(typeof p.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${p.enableGraphCapture}`);let i=ut("enableGraphCapture",s),d=ut(p.enableGraphCapture.toString(),s);r._OrtAddSessionConfigEntry(n,i,d)!==0&&st(`Can't set a session config entry: 'enableGraphCapture' - ${p.enableGraphCapture}.`)}if(p.freeDimensionOverrides)for(let[i,d]of Object.entries(p.freeDimensionOverrides)){if(typeof i!="string")throw new Error(`free dimension override name must be a string: ${i}`);if(typeof d!="number"||!Number.isInteger(d)||d<0)throw new Error(`free dimension override value must be a non-negative integer: ${d}`);let h=ut(i,s);r._OrtAddFreeDimensionOverride(n,h,d)!==0&&st(`Can't set a free dimension override: ${i} - ${d}.`)}return p.extra!==void 0&&Wr(p.extra,"",new WeakSet,(i,d)=>{let h=ut(i,s),m=ut(d,s);r._OrtAddSessionConfigEntry(n,h,m)!==0&&st(`Can't set a session config entry: ${i} - ${d}.`)}),[n,s]}catch(l){throw n!==0&&r._OrtReleaseSessionOptions(n),s.forEach(c=>r._free(c)),l}}}),ir,fd,ar,gd,md,ri,ni,bd,yd=I(()=>{"use strict";ir=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"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${t}`)}},fd=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 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${t}`)}},ar=(t,r)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][t],s=typeof r=="number"?r:r.reduce((p,l)=>p*l,1);return n>0?Math.ceil(s*n):void 0},gd=t=>{switch(t){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}},md=t=>{switch(t){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: ${t}`)}},ri=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",ni=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool",bd=t=>{switch(t){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${t}`)}}}),oi,wd=I(()=>{"use strict";Qo(),oi=async t=>{if(typeof t=="string"){let r=await fetch(t);if(!r.ok)throw new Error(`failed to load external data file: ${t}`);let n=r.headers.get("Content-Length"),s=n?parseInt(n,10):0;if(s<1073741824)return new Uint8Array(await r.arrayBuffer());{if(!r.body)throw new Error(`failed to load external data file: ${t}, no response body.`);let p=r.body.getReader(),l;try{l=new ArrayBuffer(s)}catch(o){if(o instanceof RangeError){let a=Math.ceil(s/65536);l=new WebAssembly.Memory({initial:a,maximum:a}).buffer}else throw o}let c=0;for(;;){let{done:o,value:a}=await p.read();if(o)break;let e=a.byteLength;new Uint8Array(l,c,e).set(a),c+=e}return new Uint8Array(l,0,s)}}else return t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t instanceof Uint8Array?t:new Uint8Array(t)}}),Mu,ii,ai,de,zu,Xr,si,ui,to,li,pi,ci,vd=I(()=>{"use strict";pm(),cm(),yd(),Ce(),ei(),wd(),Mu=(t,r)=>{ht()._OrtInit(t,r)!==0&&st("Can't initialize onnxruntime.")},ii=async t=>{Mu(t.wasm.numThreads,md(t.logLevel))},ai=async(t,r)=>{},de=new Map,zu=t=>{let r=ht(),n=r.stackSave();try{let s=r.stackAlloc(8);return r._OrtGetInputOutputCount(t,s,s+4)!==0&&st("Can't get session input/output count."),[r.HEAP32[s/4],r.HEAP32[s/4+1]]}finally{r.stackRestore(n)}},Xr=t=>{let r=ht(),n=r._malloc(t.byteLength);if(n===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${t.byteLength}.`);return r.HEAPU8.set(t,n),[n,t.byteLength]},si=async(t,r)=>{let n,s,p=ht();Array.isArray(t)?[n,s]=t:t.buffer===p.HEAPU8.buffer?[n,s]=[t.byteOffset,t.byteLength]:[n,s]=Xr(t);let l=0,c=0,o=0,a=[],e=[],u=[];try{if([c,a]=hd(r),r?.externalData&&p.mountExternalData){let w=[];for(let S of r.externalData){let $=typeof S=="string"?S:S.path;w.push(oi(typeof S=="string"?S:S.data).then(F=>{p.mountExternalData($,F)}))}await Promise.all(w)}for(let w of r?.executionProviders??[])if((typeof w=="string"?w:w.name)==="webnn"){if(p.shouldTransferToMLTensor=!1,p.currentContext)throw new Error("WebNN execution provider is already set.");if(typeof w!="string"){let S=w,$=S?.context,F=S?.gpuDevice,bt=S?.deviceType,pt=S?.numThreads,Z=S?.powerPreference;$?p.currentContext=$:F?p.currentContext=await navigator.ml.createContext(F):p.currentContext=await navigator.ml.createContext({deviceType:bt,numThreads:pt,powerPreference:Z})}else p.currentContext=await navigator.ml.createContext();break}l=await p._OrtCreateSession(n,s,c),l===0&&st("Can't create a session."),p.currentContext&&(p.jsepRegisterMLContext(l,p.currentContext),p.currentContext=void 0,p.shouldTransferToMLTensor=!0);let[i,d]=zu(l),h=!!r?.enableGraphCapture,m=[],b=[],x=[];for(let w=0;w<i;w++){let S=p._OrtGetInputName(l,w);S===0&&st("Can't get an input name."),e.push(S),m.push(p.UTF8ToString(S))}for(let w=0;w<d;w++){let S=p._OrtGetOutputName(l,w);S===0&&st("Can't get an output name."),u.push(S);let $=p.UTF8ToString(S);b.push($)}return de.set(l,[l,e,u,null,h,!1]),[l,m,b]}catch(i){throw e.forEach(d=>p._OrtFree(d)),u.forEach(d=>p._OrtFree(d)),o!==0&&p._OrtReleaseBinding(o),l!==0&&p._OrtReleaseSession(l),i}finally{p._free(n),c!==0&&p._OrtReleaseSessionOptions(c),a.forEach(i=>p._free(i)),p.unmountExternalData?.()}},ui=t=>{let r=ht(),n=de.get(t);if(!n)throw new Error(`cannot release session. invalid session id: ${t}`);let[s,p,l,c,o]=n;c&&(o&&r._OrtClearBoundOutputs(c.handle),r._OrtReleaseBinding(c.handle)),r.jsepOnReleaseSession?.(t),p.forEach(a=>r._OrtFree(a)),l.forEach(a=>r._OrtFree(a)),r._OrtReleaseSession(s),de.delete(t)},to=(t,r,n,s,p,l=!1)=>{if(!t){r.push(0);return}let c=ht(),o=t[0],a=t[1],e=t[3],u,i;if(o==="string"&&(e==="gpu-buffer"||e==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(l&&e!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${p} when enableGraphCapture is true.`);if(e==="gpu-buffer"){let m=t[2].gpuBuffer;i=ar(ir(o),a);let b=c.jsepRegisterBuffer;if(!b)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');u=b(s,p,m,i)}else if(e==="ml-tensor"){let m=t[2].mlTensor;i=ar(ir(o),a);let b=c.jsepRegisterMLTensor;if(!b)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');u=b(m,ir(o),a)}else{let m=t[2];if(Array.isArray(m)){i=4*m.length,u=c._malloc(i),n.push(u);let b=u/4;for(let x=0;x<m.length;x++){if(typeof m[x]!="string")throw new TypeError(`tensor data at index ${x} is not a string`);c.HEAPU32[b++]=ut(m[x],n)}}else i=m.byteLength,u=c._malloc(i),n.push(u),c.HEAPU8.set(new Uint8Array(m.buffer,m.byteOffset,i),u)}let d=c.stackSave(),h=c.stackAlloc(4*a.length);try{let m=h/4;a.forEach(x=>c.HEAP32[m++]=x);let b=c._OrtCreateTensor(ir(o),u,i,h,a.length,bd(e));b===0&&st(`Can't create tensor for input/output. session=${s}, index=${p}.`),r.push(b)}finally{c.stackRestore(d)}},li=async(t,r,n,s,p,l)=>{let c=ht(),o=de.get(t);if(!o)throw new Error(`cannot run inference. invalid session id: ${t}`);let a=o[0],e=o[1],u=o[2],i=o[3],d=o[4],h=o[5],m=r.length,b=s.length,x=0,E=[],w=[],S=[],$=[],F=c.stackSave(),bt=c.stackAlloc(m*4),pt=c.stackAlloc(m*4),Z=c.stackAlloc(b*4),Le=c.stackAlloc(b*4);try{c.jsepOnRunStart?.(a),[x,E]=dd(l);for(let G=0;G<m;G++)to(n[G],w,$,t,r[G],d);for(let G=0;G<b;G++)to(p[G],S,$,t,m+s[G],d);let At=bt/4,vr=pt/4,yt=Z/4,xr=Le/4;for(let G=0;G<m;G++)c.HEAPU32[At++]=w[G],c.HEAPU32[vr++]=e[r[G]];for(let G=0;G<b;G++)c.HEAPU32[yt++]=S[G],c.HEAPU32[xr++]=u[s[G]];let Ut;Ut=await c._OrtRun(a,pt,bt,m,Le,b,Z,x),Ut!==0&&st("failed to call OrtRun().");let wt=[];for(let G=0;G<b;G++){let Wt=c.HEAPU32[Z/4+G];if(Wt===S[G]){wt.push(p[G]);continue}let Tr=c.stackSave(),xt=c.stackAlloc(16),ve=!1,ot,it=0;try{c._OrtGetTensorData(Wt,xt,xt+4,xt+8,xt+12)!==0&&st(`Can't access output tensor data on index ${G}.`);let oe=xt/4,Xt=c.HEAPU32[oe++];it=c.HEAPU32[oe++];let _r=c.HEAPU32[oe++],ie=c.HEAPU32[oe++],Ct=[];for(let et=0;et<ie;et++)Ct.push(c.HEAPU32[_r/4+et]);c._OrtFree(_r);let Tt=Ct.reduce((et,at)=>et*at,1);ot=fd(Xt);let ae=i?.outputPreferredLocations[s[G]];if(ot==="string"){if(ae==="gpu-buffer"||ae==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let et=[],at=it/4;for(let Gt=0;Gt<Tt;Gt++){let Re=c.HEAPU32[at++],Sr=Gt===Tt-1?void 0:c.HEAPU32[at]-Re;et.push(c.UTF8ToString(Re,Sr))}wt.push([ot,Ct,et,"cpu"])}else if(ae==="gpu-buffer"&&Tt>0){let et=c.jsepGetBuffer;if(!et)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let at=et(it),Gt=ar(Xt,Tt);if(Gt===void 0||!ri(ot))throw new Error(`Unsupported data type: ${ot}`);ve=!0,wt.push([ot,Ct,{gpuBuffer:at,download:c.jsepCreateDownloader(at,Gt,ot),dispose:()=>{c._OrtReleaseTensor(Wt)}},"gpu-buffer"])}else if(ae==="ml-tensor"&&Tt>0){let et=c.jsepEnsureTensor;if(!et)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(ar(Xt,Tt)===void 0||!ni(ot))throw new Error(`Unsupported data type: ${ot}`);let at=await et(it,Xt,Ct,!1);ve=!0,wt.push([ot,Ct,{mlTensor:at,download:c.jsepCreateMLTensorDownloader(it,ot),dispose:()=>{c.jsepReleaseTensorId(it),c._OrtReleaseTensor(Wt)}},"ml-tensor"])}else{let et=gd(ot),at=new et(Tt);new Uint8Array(at.buffer,at.byteOffset,at.byteLength).set(c.HEAPU8.subarray(it,it+at.byteLength)),wt.push([ot,Ct,at,"cpu"])}}finally{c.stackRestore(Tr),ot==="string"&&it&&c._free(it),ve||c._OrtReleaseTensor(Wt)}}return i&&!d&&(c._OrtClearBoundOutputs(i.handle),de.set(t,[a,e,u,i,d,!1])),wt}finally{c.stackRestore(F),w.forEach(At=>c._OrtReleaseTensor(At)),S.forEach(At=>c._OrtReleaseTensor(At)),$.forEach(At=>c._free(At)),x!==0&&c._OrtReleaseRunOptions(x),E.forEach(At=>c._free(At))}},pi=t=>{let r=ht(),n=de.get(t);if(!n)throw new Error("invalid session id");let s=n[0],p=r._OrtEndProfiling(s);p===0&&st("Can't get an profile file name."),r._OrtFree(p)},ci=t=>{let r=[];for(let n of t){let s=n[2];!Array.isArray(s)&&"buffer"in s&&r.push(s.buffer)}return r}}),Yt,$t,Se,Ze,Je,jr,eo,Br,he,fe,Uu,xd,Td,_d,Sd,Od,Ed,Id,Pd=I(()=>{"use strict";zt(),vd(),Ce(),Qr(),Yt=()=>!!j.wasm.proxy&&typeof document<"u",Se=!1,Ze=!1,Je=!1,Br=new Map,he=(t,r)=>{let n=Br.get(t);n?n.push(r):Br.set(t,[r])},fe=()=>{if(Se||!Ze||Je||!$t)throw new Error("worker not ready")},Uu=t=>{switch(t.data.type){case"init-wasm":Se=!1,t.data.err?(Je=!0,eo[1](t.data.err)):(Ze=!0,eo[0]()),jr&&(URL.revokeObjectURL(jr),jr=void 0);break;case"init-ep":case"copy-from":case"create":case"release":case"run":case"end-profiling":{let r=Br.get(t.data.type);t.data.err?r.shift()[1](t.data.err):r.shift()[0](t.data.out);break}default:}},xd=async()=>{if(!Ze){if(Se)throw new Error("multiple calls to 'initWasm()' detected.");if(Je)throw new Error("previous call to 'initWasm()' failed.");if(Se=!0,Yt())return new Promise((t,r)=>{$t?.terminate(),pd().then(([n,s])=>{try{$t=s,$t.onerror=l=>r(l),$t.onmessage=Uu,eo=[t,r];let p={type:"init-wasm",in:j};$t.postMessage(p),jr=n}catch(p){r(p)}},r)});try{await ti(j.wasm),await ii(j),Ze=!0}catch(t){throw Je=!0,t}finally{Se=!1}}},Td=async t=>{if(Yt())return fe(),new Promise((r,n)=>{he("init-ep",[r,n]);let s={type:"init-ep",in:{epName:t,env:j}};$t.postMessage(s)});await ai(j,t)},_d=async t=>Yt()?(fe(),new Promise((r,n)=>{he("copy-from",[r,n]);let s={type:"copy-from",in:{buffer:t}};$t.postMessage(s,[t.buffer])})):Xr(t),Sd=async(t,r)=>{if(Yt()){if(r?.preferredOutputLocation)throw new Error('session option "preferredOutputLocation" is not supported for proxy.');return fe(),new Promise((n,s)=>{he("create",[n,s]);let p={type:"create",in:{model:t,options:{...r}}},l=[];t instanceof Uint8Array&&l.push(t.buffer),$t.postMessage(p,l)})}else return si(t,r)},Od=async t=>{if(Yt())return fe(),new Promise((r,n)=>{he("release",[r,n]);let s={type:"release",in:t};$t.postMessage(s)});ui(t)},Ed=async(t,r,n,s,p,l)=>{if(Yt()){if(n.some(c=>c[3]!=="cpu"))throw new Error("input tensor on GPU is not supported for proxy.");if(p.some(c=>c))throw new Error("pre-allocated output tensor is not supported for proxy.");return fe(),new Promise((c,o)=>{he("run",[c,o]);let a=n,e={type:"run",in:{sessionId:t,inputIndices:r,inputs:a,outputIndices:s,options:l}};$t.postMessage(e,ci(a))})}else return li(t,r,n,s,p,l)},Id=async t=>{if(Yt())return fe(),new Promise((r,n)=>{he("end-profiling",[r,n]);let s={type:"end-profiling",in:t};$t.postMessage(s)});pi(t)}}),ro,Gu,Ad,dm=I(()=>{"use strict";zt(),Pd(),yd(),Qo(),wd(),ro=(t,r)=>{switch(t.location){case"cpu":return[t.type,t.dims,t.data,"cpu"];case"gpu-buffer":return[t.type,t.dims,{gpuBuffer:t.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[t.type,t.dims,{mlTensor:t.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${t.location} for ${r()}`)}},Gu=t=>{switch(t[3]){case"cpu":return new ft(t[0],t[2],t[1]);case"gpu-buffer":{let r=t[0];if(!ri(r))throw new Error(`not supported data type: ${r} for deserializing GPU tensor`);let{gpuBuffer:n,download:s,dispose:p}=t[2];return ft.fromGpuBuffer(n,{dataType:r,dims:t[1],download:s,dispose:p})}case"ml-tensor":{let r=t[0];if(!ni(r))throw new Error(`not supported data type: ${r} for deserializing MLTensor tensor`);let{mlTensor:n,download:s,dispose:p}=t[2];return ft.fromMLTensor(n,{dataType:r,dims:t[1],download:s,dispose:p})}default:throw new Error(`invalid data location: ${t[3]}`)}},Ad=class{async fetchModelAndCopyToWasmMemory(t){return _d(await oi(t))}async loadModel(t,r){Pe();let n;typeof t=="string"?n=await this.fetchModelAndCopyToWasmMemory(t):n=t,[this.sessionId,this.inputNames,this.outputNames]=await Sd(n,r),Ae()}async dispose(){return Od(this.sessionId)}async run(t,r,n){Pe();let s=[],p=[];Object.entries(t).forEach(i=>{let d=i[0],h=i[1],m=this.inputNames.indexOf(d);if(m===-1)throw new Error(`invalid input '${d}'`);s.push(h),p.push(m)});let l=[],c=[];Object.entries(r).forEach(i=>{let d=i[0],h=i[1],m=this.outputNames.indexOf(d);if(m===-1)throw new Error(`invalid output '${d}'`);l.push(h),c.push(m)});let o=s.map((i,d)=>ro(i,()=>`input "${this.inputNames[p[d]]}"`)),a=l.map((i,d)=>i?ro(i,()=>`output "${this.outputNames[c[d]]}"`):null),e=await Ed(this.sessionId,p,o,c,a,n),u={};for(let i=0;i<e.length;i++)u[this.outputNames[c[i]]]=l[i]??Gu(e[i]);return Ae(),u}startProfiling(){}endProfiling(){Id(this.sessionId)}}}),$d={};gr($d,{OnnxruntimeWebAssemblyBackend:()=>Bo,initializeFlags:()=>jo,wasmBackend:()=>Dd});var jo,Bo,Dd,hm=I(()=>{"use strict";zt(),Pd(),dm(),Qr(),jo=()=>{if((typeof j.wasm.initTimeout!="number"||j.wasm.initTimeout<0)&&(j.wasm.initTimeout=0),j.wasm.simd===!1&&console.warn('Deprecated property "env.wasm.simd" is set to false. non-SIMD build is no longer provided, and this setting will be ignored.'),typeof j.wasm.proxy!="boolean"&&(j.wasm.proxy=!1),typeof j.wasm.trace!="boolean"&&(j.wasm.trace=!1),typeof j.wasm.numThreads!="number"||!Number.isInteger(j.wasm.numThreads)||j.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)j.wasm.numThreads=1;else{let t=typeof navigator>"u"?fh("node:os").cpus().length:navigator.hardwareConcurrency;j.wasm.numThreads=Math.min(4,Math.ceil((t||1)/2))}},Bo=class{async init(t){jo(),await xd(),await Td(t)}async createInferenceSessionHandler(t,r){let n=new Ad;return await n.loadModel(t,r),Promise.resolve(n)}},Dd=new Bo});zt();zt();zt();var fm="1.20.0",gm=cl;{let t=(sm(),zr(od)).onnxjsBackend;cr("webgl",t,-10)}{let t=(hm(),zr($d)).wasmBackend;cr("cpu",t,10),cr("wasm",t,10)}Object.defineProperty(j.versions,"web",{value:fm,enumerable:!0});export{sl as InferenceSession,no as TRACE,Pe as TRACE_FUNC_BEGIN,Ae as TRACE_FUNC_END,ft as Tensor,pl as TrainingSession,gm as default,j as env,cr as registerBackend};
1801
1801
  /*! Bundled license information:
1802
1802
 
1803
1803
  onnxruntime-web/dist/ort.bundle.min.mjs: