UNPKG

@mediapipe/tasks-vision

Version:

MediaPipe Vision Tasks

1 lines 138 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let r,i;const s="undefined"!=typeof TextDecoder;let o;const a="undefined"!=typeof TextEncoder;function c(t){if(a)t=(o||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){const s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var h,u;t:{for(var l=["CLOSURE_FLAGS"],d=t,f=0;f<l.length;f++)if(null==(d=d[l[f]])){u=null;break t}u=d}var p,g=u&&u[610401301];h=null!=g&&g;const m=t.navigator;function y(t){return!!h&&(!!p&&p.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function _(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function v(){return!!h&&(!!p&&p.brands.length>0)}function E(){return v()?y("Chromium"):(_("Chrome")||_("CriOS"))&&!(!v()&&_("Edge"))||_("Silk")}function w(t){return w[" "](t),t}p=m&&m.userAgentData||null,w[" "]=function(){};var T=!v()&&(_("Trident")||_("MSIE"));!_("Android")||E(),E(),_("Safari")&&(E()||!v()&&_("Coast")||!v()&&_("Opera")||!v()&&_("Edge")||(v()?y("Microsoft Edge"):_("Edg/"))||v()&&y("Opera"));var A={},b=null;function k(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let i=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=b[e];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}x();let r=0;for(;;){const t=n(-1),r=n(0),i=n(64),s=n(64);if(64===s&&-1===t)break;e(t<<2|r>>4),64!=i&&(e(r<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function x(){if(!b){b={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));A[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===b[e]&&(b[e]=t)}}}}var S="undefined"!=typeof Uint8Array,L=!T&&"function"==typeof btoa;function R(t){if(!L){var e;void 0===e&&(e=0),x(),e=A[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let c=0,h=0;for(;c<t.length-2;c+=3){var i=t[c],s=t[c+1],o=t[c+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[h++]=a+i+s+o}switch(a=0,o=r,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||r;case 1:t=t[c],n[h]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const F=/[-_.]/g,I={"-":"+",_:"/",".":"="};function M(t){return I[t]||""}function P(t){if(!L)return k(t);F.test(t)&&(t=t.replace(F,M)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function O(t){return S&&null!=t&&t instanceof Uint8Array}var C={};function U(){return B||=new N(null,C)}function D(t){j(C);var e=t.g;return null==(e=null==e||O(e)?e:"string"==typeof e?P(e):null)?e:t.g=e}var N=class{h(){return new Uint8Array(D(this)||0)}constructor(t,e){if(j(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let B,G;function j(t){if(t!==C)throw Error("illegal external caller")}function V(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function X(t){return V(t=Error(t),"warning"),t}var H="function"==typeof Symbol&&"symbol"==typeof Symbol(),W=new Set;function z(t,e,n=!1,r=!1){return t="function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e,n&&W.add(t),t}var K=z("jas",void 0,!0,!0),Y=z(void 0,"0di"),$=z(void 0,"2ex"),q=z(void 0,"1oa",!0),J=z(void 0,Symbol(),!0);const Z=H?K:"Ga",Q={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},tt=Object.defineProperties;function et(t,e){H||Z in t||tt(t,Q),t[Z]|=e}function nt(t,e){H||Z in t||tt(t,Q),t[Z]=e}function rt(t){return et(t,34),t}function it(t,e){nt(e,-30975&(0|t))}function st(t,e){nt(e,-30941&(34|t))}function ot(){return"function"==typeof BigInt}function at(t){return Array.prototype.slice.call(t)}var ct,ht={},ut={};function lt(t){return!(!t||"object"!=typeof t||t.Ia!==ut)}function dt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ft(t,e){if(null!=t)if("string"==typeof t)t=t?new N(t,C):U();else if(t.constructor!==N)if(O(t))t=t.length?new N(new Uint8Array(t),C):U();else{if(!e)throw Error();t=void 0}return t}function pt(t){return!(!Array.isArray(t)||t.length)&&!!(1&(0|t[Z]))}const gt=[];function mt(t){if(2&t)throw Error()}nt(gt,55),ct=Object.freeze(gt);class yt{constructor(t,e,n){this.l=0,this.g=t,this.h=e,this.m=n}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new yt(this.g,this.h,this.m)}}function _t(t){return J?t[J]:void 0}var vt=Object.freeze({});function Et(t){return t.Qa=!0,t}var wt=Et((t=>"number"==typeof t)),Tt=Et((t=>"string"==typeof t)),At=Et((t=>"boolean"==typeof t)),bt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),kt=Et((t=>bt?t>=St&&t<=Rt:"-"===t[0]?Ft(t,xt):Ft(t,Lt)));const xt=Number.MIN_SAFE_INTEGER.toString(),St=bt?BigInt(Number.MIN_SAFE_INTEGER):void 0,Lt=Number.MAX_SAFE_INTEGER.toString(),Rt=bt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Ft(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}const It="function"==typeof Uint8Array.prototype.slice;let Mt,Pt=0,Ot=0;function Ct(t){const e=t>>>0;Pt=e,Ot=(t-e)/4294967296>>>0}function Ut(t){if(t<0){Ct(-t);const[e,n]=Xt(Pt,Ot);Pt=e>>>0,Ot=n>>>0}else Ct(t)}function Dt(t){const e=Mt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Ot=0,Pt=e.getUint32(0,!0)}function Nt(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:Gt(t,e)}function Bt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),"number"==typeof(t=Nt(t,e))?n?-t:t:n?"-"+t:t}function Gt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else ot()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+jt(n)+jt(t));return n}function jt(t){return t=String(t),"0000000".slice(t.length)+t}function Vt(t){if(t.length<16)Ut(Number(t));else if(ot())t=BigInt(t),Pt=Number(t&BigInt(4294967295))>>>0,Ot=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Ot=Pt=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));Ot*=1e6,Pt=1e6*Pt+e,Pt>=4294967296&&(Ot+=Math.trunc(Pt/4294967296),Ot>>>=0,Pt>>>=0)}if(e){const[t,e]=Xt(Pt,Ot);Pt=t,Ot=e}}}function Xt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}const Ht="function"==typeof BigInt?BigInt.asIntN:void 0,Wt="function"==typeof BigInt?BigInt.asUintN:void 0,zt=Number.isSafeInteger,Kt=Number.isFinite,Yt=Math.trunc;function $t(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function qt(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}const Jt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Zt(t){switch(typeof t){case"bigint":return!0;case"number":return Kt(t);case"string":return Jt.test(t);default:return!1}}function Qt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Kt(t)?0|t:void 0}function te(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Kt(t)?t>>>0:void 0}function ee(t){if("-"===t[0])return!1;const e=t.length;return e<20||20===e&&Number(t.substring(0,6))<184467}function ne(t){return t=Yt(t),zt(t)||(Ut(t),t=Bt(Pt,Ot)),t}function re(t){var e=Yt(Number(t));if(zt(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),e=t.length,!("-"===t[0]?e<20||20===e&&Number(t.substring(0,7))>-922337:e<19||19===e&&Number(t.substring(0,6))<922337))if(Vt(t),t=Pt,2147483648&(e=Ot))if(ot())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Xt(t,e);t="-"+Gt(n,r)}else t=Gt(t,e);return t}function ie(t){return null==t?t:"bigint"==typeof t?(kt(t)?t=Number(t):(t=Ht(64,t),t=kt(t)?Number(t):String(t)),t):Zt(t)?"number"==typeof t?ne(t):re(t):void 0}function se(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Wt(64,t));if(Zt(t)){if("string"===e)return e=Yt(Number(t)),zt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),ee(t)||(Vt(t),t=Gt(Pt,Ot))),t;if("number"===e)return(t=Yt(t))>=0&&zt(t)?t:function(t){if(t<0){Ut(t);var e=Gt(Pt,Ot);return t=Number(e),zt(t)?t:e}return ee(e=String(t))?e:(Ut(t),Nt(Pt,Ot))}(t)}}function oe(t){if("string"!=typeof t)throw Error();return t}function ae(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ce(t){return null==t||"string"==typeof t?t:void 0}function he(t,e,n,r){if(null!=t&&"object"==typeof t&&t.W===ht)return t;if(!Array.isArray(t))return n?2&r?((t=e[Y])||(rt((t=new e).u),t=e[Y]=t),e=t):e=new e:e=void 0,e;let i=n=0|t[Z];return 0===i&&(i|=32&r),i|=2&r,i!==n&&nt(t,i),new e(t)}function ue(t,e,n){if(e)t:{if(!Zt(e=t))throw X("int64");switch(typeof e){case"string":e=re(e);break t;case"bigint":if(t=e=Ht(64,e),Tt(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(wt(t)&&!Number.isSafeInteger(t))throw Error(String(t));e=bt?BigInt(e):At(e)?e?"1":"0":Tt(e)?e.trim()||"0":String(e);break t;default:e=ne(e)}}else e=ie(t);return"string"==typeof(n=null==(t=e)?n?0:void 0:t)&&zt(e=+n)?e:n}const le={};let de=function(){try{return w(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class fe{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}const pe=de?(Object.setPrototypeOf(fe.prototype,Map.prototype),Object.defineProperties(fe.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),fe):class extends Map{constructor(){super()}};function ge(t){return t}function me(t){if(2&t.L)throw Error("Cannot mutate an immutable Map")}var ye=class extends pe{constructor(t,e,n=ge,r=ge){super();let i=0|t[Z];i|=64,nt(t,i),this.L=i,this.S=e,this.R=n,this.Y=this.S?_e:r;for(let s=0;s<t.length;s++){const o=t[s],a=n(o[0],!1,!0);let c=o[1];e?void 0===c&&(c=null):c=r(o[1],!1,!0,void 0,void 0,i),super.set(a,c)}}na(t=ve){if(0!==this.size)return this.X(t)}X(t=ve){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){me(this),super.clear()}delete(t){return me(this),super.delete(this.R(t,!0,!1))}entries(){var t=this.ma();return new yt(t,Ee,this)}keys(){return this.Ha()}values(){var t=this.ma();return new yt(t,ye.prototype.get,this)}forEach(t,e){super.forEach(((n,r)=>{t.call(e,this.get(r),r,this)}))}set(t,e){return me(this),null==(t=this.R(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.Y(e,!0,!0,this.S,!1,this.L))}Na(t){const e=this.R(t[0],!1,!0);t=t[1],t=this.S?void 0===t?null:t:this.Y(t,!1,!0,void 0,!1,this.L),super.set(e,t)}has(t){return super.has(this.R(t,!1,!1))}get(t){t=this.R(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.S;return n?((n=this.Y(e,!1,!0,n,this.ra,this.L))!==e&&super.set(t,n),n):e}}ma(){return Array.from(super.keys())}Ha(){return super.keys()}[Symbol.iterator](){return this.entries()}};function _e(t,e,n,r,i,s){return t=he(t,r,n,s),i&&(t=Oe(t)),t}function ve(t){return t}function Ee(t){return[t,this.get(t)]}let we,Te,Ae;function be(){return we||=new ye(rt([]),void 0,void 0,void 0,le)}function ke(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=pt(t)?void 0:i&&2&(0|t[Z])?t:xe(t,e,n,void 0!==r,i);else if(dt(t)){const s={};for(let o in t)s[o]=ke(t[o],e,n,r,i);t=s}else t=e(t,r);return t}}function xe(t,e,n,r,i){const s=r||n?0|t[Z]:0,o=r?!!(32&s):void 0;r=at(t);for(let t=0;t<r.length;t++)r[t]=ke(r[t],e,n,o,i);return n&&((t=_t(t))&&(r[J]=at(t)),n(s,r)),r}function Se(t){return ke(t,Le,void 0,void 0,!1)}function Le(t){return t.W===ht?t.toJSON():t instanceof ye?t.na(Se):function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return kt(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(pt(t))return}else{if(O(t))return R(t);if(t instanceof N){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=R(e)}if(t instanceof ye)return t.na()}}return t}(t)}function Re(t){return xe(t,Le,void 0,void 0,!1)}function Fe(t,e,n){return t=Ie(t,e[0],e[1],n?1:2),e!==Te&&n&&et(t,16384),t}function Ie(t,e,n,r){if(null==t){var i=96;n?(t=[n],i|=512):t=[],e&&(i=-33521665&i|(1023&e)<<15)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(i=0|t[Z]))throw Error("farr");if(64&i)return t;if(1===r||2===r||(i|=64),n&&(i|=512,n!==t[0]))throw Error("mid");t:{if(r=(n=t).length){const t=r-1;if(dt(n[t])){if((e=t-(512&(i|=256)?0:-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&e)<<15;break t}}if(e){if((e=Math.max(e,r-(512&i?0:-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&e)<<15}}}return nt(t,i),t}function Me(t,e,n=st){if(null!=t){if(S&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=0|t[Z];return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(nt(t,-12293&(34|r)),t):xe(t,Me,4&r?st:n,!0,!0))}return t.W===ht?t=2&(r=0|(n=t.u)[Z])?t:new t.constructor(Pe(n,r,!0)):t instanceof ye&&!(2&t.L)&&(n=rt(t.X(Me)),t=new ye(n,t.S,t.R,t.Y)),t}}function Pe(t,e,n){const r=n||2&e?st:it,i=!!(32&e);return t=function(t,e,n){const r=at(t);var i=r.length;const s=256&e?r[i-1]:void 0;for(i+=s?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(s){e=r[e]={};for(const t in s)e[t]=n(s[t])}return(t=_t(t))&&(r[J]=at(t)),r}(t,e,(t=>Me(t,i,r))),et(t,32|(n?2:0)),t}function Oe(t){const e=t.u,n=0|e[Z];return 2&n?new t.constructor(Pe(e,n,!1)):t}function Ce(t,e){return Ue(t=t.u,0|t[Z],e)}function Ue(e,n,r,i){if(-1===r)return null;var s=r+(512&n?0:-1);const o=e.length-1;return s>=o&&256&n?e[o][r]:i&&256&n&&null!=(n=e[o][r])?(null!=e[s]&&null!=$&&((s=(e=G??={})[$]||0)>=4||(e[$]=s+1,V(e=Error(),"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e))),n):s<=o?e[s]:void 0}function De(t,e,n){const r=t.u;let i=0|r[Z];return mt(i),Ne(r,i,e,n),t}function Ne(t,e,n,r){const i=512&e?0:-1,s=n+i;var o=t.length-1;return s>=o&&256&e?(t[o][n]=r,e):s<=o?(t[s]=r,256&e&&(n in(t=t[o])&&delete t[n]),e):(void 0!==r&&(n>=(o=e>>15&1023||536870912)?null!=r&&(t[o+i]={[n]:r},nt(t,e|=256)):t[s]=r),e)}function Be(t,e){let n=0|(t=t.u)[Z];const r=Ue(t,n,e),i=$t(r);return null!=i&&i!==r&&Ne(t,n,e,i),i}function Ge(t){let e=0|(t=t.u)[Z];const n=Ue(t,e,1),r=ft(n,!0);return null!=r&&r!==n&&Ne(t,e,1,r),r}function je(){return void 0===vt?2:4}function Ve(t,e,n,r,i){const s=t.u,o=2&(t=0|s[Z])?1:r;i=!!i;let a=0|(r=Xe(s,t,e))[Z];if(!(4&a)){4&a&&(r=at(r),a=an(a,t),t=Ne(s,t,e,r));let i=0,o=0;for(;i<r.length;i++){const t=n(r[i]);null!=t&&(r[o++]=t)}o<i&&(r.length=o),a=He(a,t),n=-4097&(20|a),a=n&=-8193,nt(r,a),2&a&&Object.freeze(r)}return 1===o||4===o&&32&a?We(a)||(i=a,a|=2,a!==i&&nt(r,a),Object.freeze(r)):(2===o&&We(a)&&(r=at(r),a=an(a,t),a=cn(a,t,i),nt(r,a),t=Ne(s,t,e,r)),We(a)||(e=a,a=cn(a,t,i),a!==e&&nt(r,a))),r}function Xe(t,e,n,r){return t=Ue(t,e,n,r),Array.isArray(t)?t:ct}function He(t,e){return 0===t&&(t=an(t,e)),1|t}function We(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function ze(t){t=at(t);for(let e=0;e<t.length;e++){const n=t[e]=at(t[e]);Array.isArray(n[1])&&(n[1]=rt(n[1]))}return t}function Ke(t,e,n,r){let i=0|(t=t.u)[Z];mt(i),Ne(t,i,e,("0"===r?0===Number(n):n===r)?void 0:n)}function Ye(t,e,n,r,i){mt(e);var s=!(!(64&e)&&16384&e);const o=(i=Xe(t,e,n,i))!==ct;if(s||!o){let a=s=o?0|i[Z]:0;(!o||2&a||We(a)||4&a&&!(32&a))&&(i=at(i),a=an(a,e),e=Ne(t,e,n,i)),a=-13&He(a,e),a=cn(r?-17&a:16|a,e,!0),a!==s&&nt(i,a)}return i}function $e(t,e){var n=vs;return Ze(qe(t=t.u),t,0|t[Z],n)===e?e:-1}function qe(t){if(H)return t[q]??(t[q]=new Map);if(q in t)return t[q];const e=new Map;return Object.defineProperty(t,q,{value:e}),e}function Je(t,e,n,r){const i=qe(t),s=Ze(i,t,e,n);return s!==r&&(s&&(e=Ne(t,e,s)),i.set(n,r)),e}function Ze(t,e,n,r){let i=t.get(r);if(null!=i)return i;i=0;for(let t=0;t<r.length;t++){const s=r[t];null!=Ue(e,n,s)&&(0!==i&&(n=Ne(e,n,i)),i=s)}return t.set(r,i),i}function Qe(t,e,n,r){let i,s=0|t[Z];if(null!=(r=Ue(t,s,n,r))&&r.W===ht)return(e=Oe(r))!==r&&Ne(t,s,n,e),e.u;if(Array.isArray(r)){const t=0|r[Z];i=2&t?Fe(Pe(r,t,!1),e,!0):64&t?r:Fe(i,e,!0)}else i=Fe(void 0,e,!0);return i!==r&&Ne(t,s,n,i),i}function tn(t,e,n,r){let i=0|(t=t.u)[Z];return(e=he(r=Ue(t,i,n,r),e,!1,i))!==r&&null!=e&&Ne(t,i,n,e),e}function en(t,e,n,r=!1){if(null==(e=tn(t,e,n,r)))return e;if(!(2&(r=0|(t=t.u)[Z]))){const i=Oe(e);i!==e&&Ne(t,r,n,e=i)}return e}function nn(t,e,n,r,i,s,o){t=t.u;var a=!!(2&e);const c=a?1:i;s=!!s,o&&=!a;var h=0|(i=Xe(t,e,r))[Z];if(!(a=!!(4&h))){var u=i,l=e;const t=!!(2&(h=He(h,e)));t&&(l|=2);let r=!t,s=!0,o=0,a=0;for(;o<u.length;o++){const e=he(u[o],n,!1,l);if(e instanceof n){if(!t){const t=!!(2&(0|e.u[Z]));r&&=!t,s&&=t}u[a++]=e}}a<o&&(u.length=a),h|=4,h=s?16|h:-17&h,nt(u,h=r?8|h:-9&h),t&&Object.freeze(u)}if(o&&!(8&h||!i.length&&(1===c||4===c&&32&h))){for(We(h)&&(i=at(i),h=an(h,e),e=Ne(t,e,r,i)),n=i,o=h,u=0;u<n.length;u++)(h=n[u])!==(l=Oe(h))&&(n[u]=l);o|=8,nt(n,o=n.length?-17&o:16|o),h=o}return 1===c||4===c&&32&h?We(h)||(e=h,(h|=!i.length||16&h&&(!a||32&h)?2:2048)!==e&&nt(i,h),Object.freeze(i)):(2===c&&We(h)&&(nt(i=at(i),h=cn(h=an(h,e),e,s)),e=Ne(t,e,r,i)),We(h)||(r=h,(h=cn(h,e,s))!==r&&nt(i,h))),i}function rn(t,e,n){const r=0|t.u[Z];return nn(t,r,e,n,je(),!1,!(2&r))}function sn(t,e,n,r){return null==r&&(r=void 0),De(t,n,r)}function on(t,e,n,r){null==r&&(r=void 0);t:{let i=0|(t=t.u)[Z];if(mt(i),null==r){const r=qe(t);if(Ze(r,t,i,n)!==e)break t;r.set(n,0)}else i=Je(t,i,n,e);Ne(t,i,e,r)}}function an(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function cn(t,e,n){return 32&e&&n||(t&=-33),t}function hn(t,e,n,r){const i=0|t.u[Z];mt(i),t=nn(t,i,n,e,2,!0),r=null!=r?r:new n,t.push(r),t[Z]=2&(0|r.u[Z])?-9&t[Z]:-17&t[Z]}function un(t,e){return Qt(Ce(t,e))}function ln(t,e){return ce(Ce(t,e))}function dn(t,e){return Be(t,e)??0}function fn(t,e,n){if(null!=n&&"boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);De(t,e,n)}function pn(t,e,n){if(null!=n){if("number"!=typeof n)throw X("int32");if(!Kt(n))throw X("int32");n|=0}De(t,e,n)}function gn(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);De(t,e,n)}function mn(t,e,n){{const o=t.u;let a=0|o[Z];if(mt(a),null==n)Ne(o,a,e);else{var r=t=0|n[Z],i=We(t),s=i||Object.isFrozen(n);for(i||(t=0),s||(n=at(n),r=0,t=cn(t=an(t,a),a,!0),s=!1),t|=21,i=0;i<n.length;i++){const e=n[i],o=oe(e);Object.is(e,o)||(s&&(n=at(n),r=0,t=cn(t=an(t,a),a,!0),s=!1),n[i]=o)}t!==r&&(s&&(n=at(n),t=cn(t=an(t,a),a,!0)),nt(n,t)),Ne(o,a,e,n)}}}function yn(t,e,n){mt(0|t.u[Z]),Ve(t,e,ce,2,!0).push(oe(n))}function _n(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function vn(){return Error("Failed to read varint, encoding is invalid.")}function En(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function wn(t){if("string"==typeof t)return{buffer:P(t),N:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),N:!1};if(t.constructor===Uint8Array)return{buffer:t,N:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),N:!1};if(t.constructor===N)return{buffer:D(t)||new Uint8Array(0),N:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),N:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Tn(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(s<32&&128&n);for(s>32&&(i|=(127&n)>>4),s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(Fn(t,a),n<128)return e(r>>>0,i>>>0);throw vn()}function An(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return Fn(t,n),!!(127&e)}throw vn()}function bn(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw vn();return Fn(t,n),i}function kn(t){return bn(t)>>>0}function xn(t){var e=t.h;const n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],Fn(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function Sn(t){var e=xn(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:t*(1/0):0==n?1401298464324817e-60*t*e:t*Math.pow(2,n-150)*(e+8388608)}function Ln(t){return bn(t)}function Rn(t,e,{ba:n=!1}={}){t.ba=n,e&&(e=wn(e),t.h=e.buffer,t.m=e.N,t.j=0,t.l=t.h.length,t.g=t.j)}function Fn(t,e){if(t.g=e,e>t.l)throw En(t.l,e)}function In(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw En(e,t.l-n);return t.g=r,n}function Mn(t,e){if(0==e)return U();var n=In(t,e);return t.ba&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):It?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?U():new N(n,C)}ye.prototype.toJSON=void 0,ye.prototype.Ia=ut;var Pn=[];function On(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=kn(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5))throw _n(n,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function Cn(t){switch(t.h){case 0:0!=t.h?Cn(t):An(t.g);break;case 1:Fn(t=t.g,t.g+8);break;case 2:if(2!=t.h)Cn(t);else{var e=kn(t.g);Fn(t=t.g,t.g+e)}break;case 5:Fn(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!On(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}Cn(t)}break;default:throw _n(t.h,t.l)}}function Un(t,e,n){const r=t.g.l,i=kn(t.g),s=t.g.g+i;let o=s-r;if(o<=0&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function Dn(t){var o=kn(t.g),a=In(t=t.g,o);if(t=t.h,s){var c,h=t;(c=i)||(c=i=new TextDecoder("utf-8",{fatal:!0})),o=a+o,h=0===a&&o===h.length?h:h.subarray(a,o);try{var u=c.decode(h)}catch(t){if(void 0===r){try{c.decode(new Uint8Array([128]))}catch(t){}try{c.decode(new Uint8Array([97])),r=!0}catch(t){r=!1}}throw!r&&(i=void 0),t}}else{o=(u=a)+o,a=[];let r,i=null;for(;u<o;){var l=t[u++];l<128?a.push(l):l<224?u>=o?e():(r=t[u++],l<194||128!=(192&r)?(u--,e()):a.push((31&l)<<6|63&r)):l<240?u>=o-1?e():(r=t[u++],128!=(192&r)||224===l&&r<160||237===l&&r>=160||128!=(192&(c=t[u++]))?(u--,e()):a.push((15&l)<<12|(63&r)<<6|63&c)):l<=244?u>=o-2?e():(r=t[u++],128!=(192&r)||r-144+(l<<28)>>30!=0||128!=(192&(c=t[u++]))||128!=(192&(h=t[u++]))?(u--,e()):(l=(7&l)<<18|(63&r)<<12|(63&c)<<6|63&h,l-=65536,a.push(55296+(l>>10&1023),56320+(1023&l)))):e(),a.length>=8192&&(i=n(i,a),a.length=0)}u=n(i,a)}return u}function Nn(t){const e=kn(t.g);return Mn(t.g,e)}function Bn(t,e,n){var r=kn(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var Gn=[];function jn(t){return t}let Vn;function Xn(t,e,n){e.g?e.m(t,e.g,e.h,n):e.m(t,e.h,n)}var Hn=class{constructor(t,e){this.u=Ie(t,e)}toJSON(){const t=!Vn;try{return t&&(Vn=Re),Wn(this)}finally{t&&(Vn=void 0)}}l(){var t=go;return t.g?t.l(this,t.g,t.h,!0):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.u;return new this.constructor(Pe(t,0|t[Z],!1))}N(){return!!(2&(0|this.u[Z]))}};function Wn(t){var e=t.u;{e=(t=Vn(e))!==e;let h=t.length;if(h){var n=t[h-1],r=dt(n);r?h--:n=void 0;var i=t;if(r){t:{var s,o=n,a=!1;if(o)for(let t in o)isNaN(+t)?(s??={})[t]=o[t]:(r=o[t],Array.isArray(r)&&(pt(r)||lt(r)&&0===r.size)&&(r=null),null==r&&(a=!0),null!=r&&((s??={})[t]=r));if(a||(s=o),s)for(let t in s){a=s;break t}a=null}o=null==a?null!=n:a!==n}for(;h>0&&(null==(s=i[h-1])||pt(s)||lt(s)&&0===s.size);h--)var c=!0;(i!==t||o||c)&&(e?(c||o||a)&&(i.length=h):i=Array.prototype.slice.call(i,0,h),a&&i.push(a)),c=i}else c=t}return c}function zn(t){return t?/^\d+$/.test(t)?(Vt(t),new Kn(Pt,Ot)):null:Yn||=new Kn(0,0)}Hn.prototype.W=ht,Hn.prototype.toString=function(){try{return Vn=jn,Wn(this).toString()}finally{Vn=void 0}};var Kn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Yn;function $n(t){return t?/^-?\d+$/.test(t)?(Vt(t),new qn(Pt,Ot)):null:Jn||=new qn(0,0)}var qn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Jn;function Zn(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Qn(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function tr(t,e){if(e>=0)Qn(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function er(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function nr(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function rr(t,e,n){Qn(t.g,8*e+n)}function ir(t,e){return rr(t,e,2),e=t.g.end(),nr(t,e),e.push(t.h),e}function sr(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function or(t,e,n){rr(t,e,2),Qn(t.g,n.length),nr(t,t.g.end()),nr(t,n)}function ar(t,e,n,r){null!=n&&(e=ir(t,e),r(n,t),sr(t,e))}function cr(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var hr=cr(),ur=cr(),lr=cr(),dr=cr(),fr=cr(),pr=cr(),gr=cr(),mr=cr(),yr=cr(),_r=class{constructor(t,e,n){this.g=t,this.h=e,t=hr,this.l=!!t&&n===t||!1}};function vr(t,e){return new _r(t,e,hr)}function Er(t,e,n,r,i){ar(t,n,Ir(e,r),i)}const wr=vr((function(t,e,n,r,i){return 2===t.h&&(Un(t,Qe(e,r,n),i),!0)}),Er),Tr=vr((function(t,e,n,r,i){return 2===t.h&&(Un(t,Qe(e,r,n,!0),i),!0)}),Er);var Ar=Symbol(),br=Symbol(),kr=Symbol(),xr=Symbol();let Sr,Lr;function Rr(t,e,n,r){var i=r[t];if(i)return i;(i={}).Pa=r,i.V=function(t){switch(typeof t){case"boolean":return Te||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Ae||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ga=s,"function"==typeof(s=r[++o])&&(i.la=!0,Sr??=s,Lr??=r[o+1],s=r[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=r[++o]}for(c=1;void 0!==s;){let t;"number"==typeof s&&(c+=s,s=r[++o]);var h=void 0;if(s instanceof _r?t=s:(t=wr,o--),t?.l){s=r[++o],h=r;var u=o;"function"==typeof s&&(s=s(),h[u]=s),h=s}for(u=c+1,"number"==typeof(s=r[++o])&&s<0&&(u-=s,s=r[++o]);c<u;c++){const r=a[c];h?n(i,c,t,h,r):e(i,c,t,r)}}return r[t]=i}function Fr(t){return Array.isArray(t)?t[0]instanceof _r?t:[Tr,t]:[t,void 0]}function Ir(t,e){return t instanceof Hn?t.u:Array.isArray(t)?Fe(t,e,!1):void 0}function Mr(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function Pr(t,e,n,r,i){const s=n.g;let o,a;t[e]=(t,e,n)=>s(t,e,n,a||=Rr(br,Mr,Pr,r).V,o||=Or(r),i)}function Or(t){let e=t[kr];if(null!=e)return e;const n=Rr(br,Mr,Pr,t);return e=n.la?(t,e)=>Sr(t,e,n):(t,e)=>{const r=0|t[Z];for(;On(e)&&4!=e.h;){var i=e.m,s=n[i];if(null==s){var o=n.ga;o&&(o=o[i])&&(null!=(o=Cr(o))&&(s=n[i]=o))}null!=s&&s(e,t,i)||(i=(s=e).l,Cn(s),s.fa?s=void 0:(o=s.g.g-i,s.g.g=i,s=Mn(s.g,o)),i=t,s&&((o=i[J])?o.push(s):i[J]=[s]))}return 16384&r&&rt(t),!0},t[kr]=e}function Cr(t){const e=(t=Fr(t))[0].g;if(t=t[1]){const n=Or(t),r=Rr(br,Mr,Pr,t).V;return(t,i,s)=>e(t,i,s,r,n)}return e}function Ur(t,e,n){t[e]=n.h}function Dr(t,e,n,r){let i,s;const o=n.h;t[e]=(t,e,n)=>o(t,e,n,s||=Rr(Ar,Ur,Dr,r).V,i||=Nr(r))}function Nr(t){let e=t[xr];if(!e){const n=Rr(Ar,Ur,Dr,t);e=(t,e)=>Br(t,e,n),t[xr]=e}return e}function Br(t,e,n){for(var r=0|t[Z],i=512&r?0:-1,s=t.length,o=512&r?1:0,a=s+(256&r?-1:0);o<a;o++){const r=t[o];if(null==r)continue;const s=o-i,a=Gr(n,s);a&&a(e,r,s)}if(256&r){r=t[s-1];for(const t in r)i=+t,Number.isNaN(i)||null!=(s=r[i])&&(a=Gr(n,i))&&a(e,s,i)}if(t=_t(t))for(nr(e,e.g.end()),n=0;n<t.length;n++)nr(e,D(t[n])||new Uint8Array(0))}function Gr(t,e){var n=t[e];if(n)return n;if((n=t.ga)&&(n=n[e])){var r=(n=Fr(n))[0].h;if(n=n[1]){const e=Nr(n),i=Rr(Ar,Ur,Dr,n).V;n=t.la?Lr(i,e):(t,n,s)=>r(t,n,s,i,e)}else n=r;return t[e]=n}}function jr(t,e){if(Array.isArray(e)){var n=0|e[Z];if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),nt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}function Vr(t,e,n){return new _r(t,e,n)}function Xr(t,e,n){return new _r(t,e,n)}function Hr(t,e,n){Ne(t,0|t[Z],e,n)}var Wr=vr((function(t,e,n,r,i){return 2===t.h&&(t=Un(t,Fe([void 0,void 0],r,!0),i),mt(r=0|e[Z]),(i=Ue(e,r,n))instanceof ye?0!=(2&i.L)?((i=i.X()).push(t),Ne(e,r,n,i)):i.Na(t):Array.isArray(i)?(2&(0|i[Z])&&Ne(e,r,n,i=ze(i)),i.push(t)):Ne(e,r,n,[t]),!0)}),(function(t,e,n,r,i){if(e instanceof ye)e.forEach(((e,s)=>{ar(t,n,Fe([s,e],r,!1),i)}));else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&ar(t,n,Fe(o,r,!1),i)}}));function zr(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(Ht(64,t));if(Zt(t)){if("string"===e)return re(t);if("number"===e)return ne(t)}}(e),null!=e){if("string"==typeof e)$n(e);if(null!=e)switch(rr(t,n,0),typeof e){case"number":t=t.g,Ut(e),Zn(t,Pt,Ot);break;case"bigint":n=BigInt.asUintN(64,e),n=new qn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Zn(t.g,n.h,n.g);break;default:n=$n(e),Zn(t.g,n.h,n.g)}}}function Kr(t,e,n){null!=(e=Qt(e))&&null!=e&&(rr(t,n,0),tr(t.g,e))}function Yr(t,e,n){null!=(e=qt(e))&&(rr(t,n,0),t.g.g.push(e?1:0))}function $r(t,e,n){null!=(e=ce(e))&&or(t,n,c(e))}function qr(t,e,n,r,i){ar(t,n,Ir(e,r),i)}function Jr(t,e,n){null!=(e=null==e||"string"==typeof e||O(e)||e instanceof N?e:void 0)&&or(t,n,wn(e).buffer)}function Zr(t,e,n){return(5===t.h||2===t.h)&&(e=Ye(e,0|e[Z],n,!1,!1),2==t.h?Bn(t,Sn,e):e.push(Sn(t.g)),!0)}var Qr=Vr((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=xn(r);const i=xn(r);r=2*(i>>31)+1;const s=i>>>20&2047;return t=4294967296*(1048575&i)+t,Hr(e,n,2047==s?t?NaN:r*(1/0):0==s?5e-324*r*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=$t(e))&&(rr(t,n,1),t=t.g,(n=Mt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Pt=n.getUint32(0,!0),Ot=n.getUint32(4,!0),er(t,Pt),er(t,Ot))}),cr()),ti=Vr((function(t,e,n){return 5===t.h&&(Hr(e,n,Sn(t.g)),!0)}),(function(t,e,n){null!=(e=$t(e))&&(rr(t,n,5),t=t.g,Dt(e),er(t,Pt))}),gr),ei=Xr(Zr,(function(t,e,n){if(null!=(e=jr($t,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(rr(r,i,5),r=r.g,Dt(s),er(r,Pt))}}),gr),ni=Xr(Zr,(function(t,e,n){if(null!=(e=jr($t,e))&&e.length){rr(t,n,2),Qn(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Dt(e[r]),er(n,Pt)}}),gr),ri=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,Tn(t.g,Bt)),!0)}),zr,pr),ii=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,0===(t=Tn(t.g,Bt))?void 0:t),!0)}),zr,pr),si=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,Tn(t.g,Nt)),!0)}),(function(t,e,n){if(null!=(e=se(e))){if("string"==typeof e)zn(e);if(null!=e)switch(rr(t,n,0),typeof e){case"number":t=t.g,Ut(e),Zn(t,Pt,Ot);break;case"bigint":n=BigInt.asUintN(64,e),n=new Kn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Zn(t.g,n.h,n.g);break;default:n=zn(e),Zn(t.g,n.h,n.g)}}}),cr()),oi=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,bn(t.g)),!0)}),Kr,dr),ai=Xr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Ye(e,0|e[Z],n,!1,!1),2==t.h?Bn(t,bn,e):e.push(bn(t.g)),!0)}),(function(t,e,n){if(null!=(e=jr(Qt,e))&&e.length){n=ir(t,n);for(let n=0;n<e.length;n++)tr(t.g,e[n]);sr(t,n)}}),dr),ci=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,0===(t=bn(t.g))?void 0:t),!0)}),Kr,dr),hi=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,An(t.g)),!0)}),Yr,ur),ui=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,!1===(t=An(t.g))?void 0:t),!0)}),Yr,ur),li=Xr((function(t,e,n){return 2===t.h&&(t=Dn(t),Ye(e,0|e[Z],n,!1).push(t),!0)}),(function(t,e,n){if(null!=(e=jr(ce,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&or(r,i,c(s))}}),lr),di=Vr((function(t,e,n){return 2===t.h&&(Hr(e,n,""===(t=Dn(t))?void 0:t),!0)}),$r,lr),fi=Vr((function(t,e,n){return 2===t.h&&(Hr(e,n,Dn(t)),!0)}),$r,lr),pi=function(t,e,n=hr){return new _r(t,e,n)}((function(t,e,n,r,i){return 2===t.h&&(r=Fe(void 0,r,!0),Ye(e,0|e[Z],n,!0).push(r),Un(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)qr(t,e[s],n,r,i)})),gi=vr((function(t,e,n,r,i,s){return 2===t.h&&(Je(e,0|e[Z],s,n),Un(t,e=Qe(e,r,n),i),!0)}),qr),mi=Vr((function(t,e,n){return 2===t.h&&(Hr(e,n,Nn(t)),!0)}),Jr,mr),yi=Xr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Ye(e,0|e[Z],n,!1,!1),2==t.h?Bn(t,kn,e):e.push(kn(t.g)),!0)}),(function(t,e,n){if(null!=(e=jr(te,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(rr(r,i,0),Qn(r.g,s))}}),fr),_i=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,0===(t=kn(t.g))?void 0:t),!0)}),(function(t,e,n){null!=(e=te(e))&&null!=e&&(rr(t,n,0),Qn(t.g,e))}),fr),vi=Vr((function(t,e,n){return 0===t.h&&(Hr(e,n,bn(t.g)),!0)}),(function(t,e,n){null!=(e=Qt(e))&&(e=parseInt(e,10),rr(t,n,0),tr(t.g,e))}),yr);class Ei{constructor(t,e){this.h=t,this.g=e,this.l=en,this.m=sn,this.defaultValue=void 0}}function wi(t,e){return new Ei(t,e)}function Ti(t,e){return(n,r)=>{if(Gn.length){const t=Gn.pop();t.o(r),Rn(t.g,n,r),n=t}else n=new class{constructor(t,e){if(Pn.length){const n=Pn.pop();Rn(n,t,e),t=n}else t=new class{constructor(t,e){this.h=null,this.m=!1,this.g=this.l=this.j=0,Rn(this,t,e)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ba=!1}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({fa:t=!1}={}){this.fa=t}}(n,r);try{const r=new t,s=r.u;Or(e)(s,n);var i=r}finally{n.g.clear(),n.m=-1,n.h=-1,Gn.length<100&&Gn.push(n)}return i}}function Ai(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Br(this.u,e,Rr(Ar,Ur,Dr,t)),nr(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var bi=class extends Hn{constructor(t){super(t)}},ki=[0,di,Vr((function(t,e,n){return 2===t.h&&(Hr(e,n,(t=Nn(t))===U()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof Hn){const r=e.Ra;return void(r&&(e=r(e),null!=e&&or(t,n,wn(e).buffer)))}if(Array.isArray(e))return}Jr(t,e,n)}),mr)];let xi,Si=globalThis.trustedTypes;function Li(t){void 0===xi&&(xi=function(){let t=null;if(!Si)return t;try{const e=t=>t;t=Si.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}());var e=xi;return new class{constructor(t){this.g=t}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function Ri(t,...e){if(0===e.length)return Li(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return Li(n)}var Fi=[0,oi,vi,hi,-1,ai,vi,-1],Ii=class extends Hn{constructor(t){super(t)}},Mi=[0,hi,fi,hi,vi,-1,Xr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Ye(e,0|e[Z],n,!1,!1),2==t.h?Bn(t,Ln,e):e.push(bn(t.g)),!0)}),(function(t,e,n){if(null!=(e=jr(Qt,e))&&e.length){n=ir(t,n);for(let n=0;n<e.length;n++)tr(t.g,e[n]);sr(t,n)}}),yr),fi,-1,[0,hi,-1],vi,hi,-1],Pi=[0,fi,-2],Oi=class extends Hn{constructor(t){super(t)}},Ci=[0],Ui=[0,oi,hi,1,hi,-3],Di=class extends Hn{constructor(t){super(t,2)}},Ni={};Ni[336783863]=[0,fi,hi,-1,oi,[0,[1,2,3,4,5,6,7,8],gi,Ci,gi,Mi,gi,Pi,gi,Ui,gi,Fi,gi,[0,fi,-2],gi,[0,fi,vi],gi,[0,vi,fi]],[0,fi],hi,[0,[1,3],[2,4],gi,[0,ai],-1,gi,[0,li],-1,pi,[0,fi,-1]],fi];var Bi=[0,ii,-1,ui,-3,ii,ai,di,ci,ii,-1,ui,ci,ui,-2,di];function Gi(t,e){Ke(t,2,ae(e),"")}function ji(t,e){yn(t,3,e)}function Vi(t,e){yn(t,4,e)}var Xi=class extends Hn{constructor(t){super(t,500)}o(t){return sn(this,0,7,t)}},Hi=[-1,{}],Wi=[0,fi,1,Hi],zi=[0,fi,li,Hi];function Ki(t,e){hn(t,1,Xi,e)}function Yi(t,e){yn(t,10,e)}function $i(t,e){yn(t,15,e)}var qi=class extends Hn{constructor(t){super(t,500)}o(t){return sn(this,0,1001,t)}},Ji=[-500,pi,[-500,di,-1,li,-3,[-2,Ni,hi],pi,ki,ci,-1,Wi,zi,pi,[0,di,ui],di,Bi,ci,li,987,li],4,pi,[-500,fi,-1,[-1,{}],998,fi],pi,[-500,fi,li,-1,[-2,{},hi],997,li,-1],ci,pi,[-500,fi,li,Hi,998,li],li,ci,Wi,zi,pi,[0,di,-1,Hi],li,-2,Bi,di,-1,ui,[0,ui,_i],978,Hi,pi,ki];qi.prototype.g=Ai(Ji);var Zi=Ti(qi,Ji),Qi=class extends Hn{constructor(t){super(t)}},ts=class extends Hn{constructor(t){super(t)}g(){return rn(this,Qi,1)}},es=[0,pi,[0,oi,ti,fi,-1]],ns=Ti(ts,es),rs=class extends Hn{constructor(t){super(t)}},is=class extends Hn{constructor(t){super(t)}},ss=class extends Hn{constructor(t){super(t)}h(){return en(this,rs,2)}g(){return rn(this,is,5)}},os=Ti(class extends Hn{constructor(t){super(t)}},[0,li,ai,ni,[0,vi,[0,oi,-3],[0,ti,-3],[0,oi,-1,[0,pi,[0,oi,-2]]],pi,[0,ti,-1,fi,ti]],fi,-1,ri,pi,[0,oi,ti],li,ri]),as=class extends Hn{constructor(t){super(t)}},cs=Ti(class extends Hn{constructor(t){super(t)}},[0,pi,[0,ti,-4]]),hs=class extends Hn{constructor(t){super(t)}},us=Ti(class extends Hn{constructor(t){super(t)}},[0,pi,[0,ti,-4]]),ls=class extends Hn{constructor(t){super(t)}},ds=[0,oi,-1,ni,vi],fs=class extends Hn{constructor(t){super(t)}};fs.prototype.g=Ai([0,ti,-4,ri]);var ps=class extends Hn{constructor(t){super(t)}},gs=Ti(class extends Hn{constructor(t){super(t)}},[0,pi,[0,1,oi,fi,es],ri]),ms=class extends Hn{constructor(t){super(t)}},ys=class extends Hn{constructor(t){super(t)}oa(){const t=Ge(this);return null==t?U():t}},_s=class extends Hn{constructor(t){super(t)}},vs=[1,2],Es=Ti(class extends Hn{constructor(t){super(t)}},[0,pi,[0,vs,gi,[0,ni],gi,[0,mi],oi,fi],ri]),ws=class extends Hn{constructor(t){super(t)}},Ts=[0,fi,oi,ti,li,-1],As=class extends Hn{constructor(t){super(t)}},bs=[0,hi,-1],ks=class extends Hn{constructor(t){super(t)}},xs=[1,2,3,4,5],Ss=class extends Hn{constructor(t){super(t)}g(){return null!=Ge(this)}h(){return null!=ln(this,2)}},Ls=class extends Hn{constructor(t){super(t)}g(){return qt(Ce(this,2))??!1}},Rs=[0,mi,fi,[0,oi,ri,-1],[0,si,ri]],Fs=[0,Rs,hi,[0,xs,gi,Ui,gi,Mi,gi,Fi,gi,Ci,gi,Pi],vi],Is=class extends Hn{constructor(t){super(t)}},Ms=[0,Fs,ti,-1,oi],Ps=wi(502141897,Is);Ni[502141897]=Ms;var Os=Ti(class extends Hn{constructor(t){super(t)}},[0,[0,vi,-1,ei,yi],ds]),Cs=class extends Hn{constructor(t){super(t)}},Us=class extends Hn{constructor(t){super(t)}},Ds=[0,Fs,ti,[0,Fs],hi],Ns=[0,Fs,Ms,Ds,ti,[0,[0,Rs]]],Bs=wi(508968150,Us);Ni[508968150]=Ns,Ni[508968149]=Ds;var Gs=class extends Hn{constructor(t){super(t)}},js=wi(513916220,Gs);Ni[513916220]=[0,Fs,Ns,oi];var Vs=class extends Hn{constructor(t){super(t)}h(){return en(this,ws,2)}g(){De(this,2)}},Xs=[0,Fs,Ts];Ni[478825465]=Xs;var Hs=class extends Hn{constructor(t){super(t)}},Ws=class extends Hn{constructor(t){super(t)}},zs=class extends Hn{constructor(t){super(t)}},Ks=class extends Hn{constructor(t){super(t)}},Ys=class extends Hn{constructor(t){super(t)}},$s=[0,Fs,[0,Fs],Xs,-1],qs=[0,Fs,ti,oi],Js=[0,Fs,ti],Zs=[0,Fs,qs,Js,ti],Qs=wi(479097054,Ys);Ni[479097054]=[0,Fs,Zs,$s],Ni[463370452]=$s,Ni[464864288]=qs;var to=wi(462713202,Ks);Ni[462713202]=Zs,Ni[474472470]=Js;var eo=class extends Hn{constructor(t){super(t)}},no=class extends Hn{constructor(t){super(t)}},ro=class extends Hn{constructor(t){super(t)}},io=class extends Hn{constructor(t){super(t)}},so=[0,Fs,ti,-1,oi],oo=[0,Fs,ti,hi];io.prototype.g=Ai([0,Fs,Js,[0,Fs],Ms,Ds,so,oo]);var ao=class extends Hn{constructor(t){super(t)}},co=wi(456383383,ao);Ni[456383383]=[0,Fs,Ts];var ho=class extends Hn{constructor(t){super(t)}},uo=wi(476348187,ho);Ni[476348187]=[0,Fs,bs];var lo=class extends Hn{constructor(t){super(t)}},fo=class extends Hn{constructor(t){super(t)}},po=[0,vi,-1],go=wi(458105876,class extends Hn{constructor(t){super(t)}g(){var t=this.u;const e=0|t[Z];const n=2&e;return t=function(t,e,n){var r=fo;const i=2&e;let s=!1;if(null==n){if(i)return be();n=[]}else if(n.constructor===ye){if(0==(2&n.L)||i)return n;n=n.X()}else Array.isArray(n)?s=!!(2&(0|n[Z])):n=[];if(i){if(!n.length)return be();s||(s=!0,rt(n))}else s&&(s=!1,n=ze(n));return s||(64&(0|n[Z])?n[Z]&=-33:32&e&&et(n,32)),Ne(t,e,2,r=new ye(n,r,ue,void 0)),r}(t,e,Ue(t,e,2)),!n&&fo&&(t.ra=!0),t}});Ni[458105876]=[0,po,Wr,[!0,ri,[0,fi,-1,li]]];var mo=class extends Hn{constructor(t){super(t)}},yo=wi(458105758,mo);Ni[458105758]=[0,Fs,fi,po];var _o=class extends Hn{constructor(t){super(t)}},vo=wi(443442058,_o);Ni[443442058]=[0,Fs,fi,oi,ti,li,-1,hi,ti],Ni[514774813]=so;var Eo=class extends Hn{constructor(t){super(t)}},wo=wi(516587230,Eo);function To(t,e){return e=e?e.clone():new ws,void 0!==t.displayNamesLocale?De(e,1,ae(t.displayNamesLocale)):void 0===t.displayNamesLocale&&De(e,1),void 0!==t.maxResults?pn(e,2,t.maxResults):"maxResults"in t&&De(e,2),void 0!==t.scoreThreshold?gn(e,3,t.scoreThreshold):"scoreThreshold"in t&&De(e,3),void 0!==t.categoryAllowlist?mn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&De(e,4),void 0!==t.categoryDenylist?mn(e,5,t.categoryDenylist):"categoryDenylist"in t&&De(e,5),e}function Ao(t,e=-1,n=""){return{categories:t.map((t=>({index:un(t,1)??0??-1,score:dn(t,2)??0,categoryName:ln(t,3)??""??"",displayName:ln(t,4)??""??""}))),headIndex:e,headName:n}}function bo(t){var e=Ve(t,3,$t,je()),n=Ve(t,2,Qt,je()),r=Ve(t,1,ce,je()),i=Ve(t,9,ce,je());const s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=en(t,ss,4)?.h())&&(s.boundingBox={originX:un(e,1)??0,originY:un(e,2)??0,width:un(e,3)??0,height:un(e,4)??0,angle:0}),en(t,ss,4)?.g().length)for(const e of en(t,ss,4).g())s.keypoints.push({x:Be(e,1)??0,y:Be(e,2)??0,score:Be(e,4)??0,label:ln(e,3)??""});return s}function ko(t){const e=[];for(const n of rn(t,hs,1))e.push({x:dn(n,1)??0,y:dn(n,2)??0,z:dn(n,3)??0,visibility:dn(n,4)??0});return e}function xo(t){const e=[];for(const n of rn(t,as,1))e.push({x:dn(n,1)??0,y:dn(n,2)??0,z:dn(n,3)??0,visibility:dn(n,4)??0});return e}function So(t){return Array.from(t,(t=>t>127?t-256:t))}function Lo(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Ro;Ni[516587230]=[0,Fs,so,oo,ti],Ni[518928384]=oo;const Fo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Io(){if(void 0===Ro)try{await WebAssembly.instantiate(Fo),Ro=!0}catch{Ro=!1}return Ro}async function Mo(t,e=Ri``){const n=await Io()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Po=class{};function Oo(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function Co(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function Uo(t){return void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function Do(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function No(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[r,i]=Uo(e);return!t.l||r===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=i),[r,i]}function Bo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function Go(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function jo(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}Po.forVisionTasks=function(t){return Mo("vision",t)},Po.forTextTasks=function(t){return Mo("text",t)},Po.forGenAiExperimentalTasks=function(t){return Mo("genai_experimental",t)},Po.forGenAiTasks=function(t){return Mo("genai",t)},Po.forAudioTasks=function(t){return Mo("audio",t)},Po.isSimdSupported=function(){return Io()};async function Vo(t,e,n,r){return t=await(async(t,e,n,r,i)=>{if(e&&await Co(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Co(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function Xo(t,e){const n=en(t.baseOptions,Ss,1)||new Ss;"string"==typeof e?(De(n,2,ae(e)),De(n,1)):e instanceof Uint8Array&&(De(n,1,ft(e,!1)),De(n,2)),sn(t.baseOptions,0,1,n)}function Ho(t){try{const e=t.G.length;if(1===e)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map((t=>t.message)).join(", "))}finally{t.G=[]}}function Wo(t,e){t.B=Math.max(t.B,e)}function zo(t,e){t.A=new Xi,Gi(t.A,"PassThroughCalculator"),ji(t.A,"free_memory"),Vi(t.A,"free_memory_unused_out"),Yi(e,"free_memory"),Ki(e,t.A)}function Ko(t,e){ji(t.A,e),Vi(t.A,e+"_unused_out")}function Yo(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var $o=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(en(this.baseOptions,Ss,1)?.g()||en(this.baseOptions,Ss,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=en(t.baseOptions,ks,3);if(!n){var r=n=new ks,i=new Oi;on(r,4,xs,i)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new Ii,on(e,2,xs,r)):(e=n,r=new Oi,on(e,4,xs,r))),sn(t.baseOptions,0,3,n)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Xo(this,"/model.dat"),this.m(),this.I()}));if(e.modelAssetBuffer instanceof Uint8Array)Xo(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){const e=[];for(var n=0;;){const{done:r,value:i}=await t.read();if(r)break;e.push(i),n+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(n),n=0;for(const r of e)t.set(r,n),n+=r.length;return t}(e.modelAssetBuffer).then((t=>{Xo(this,t),this.m(),this.I()}))}return this.m(),this.I(),Promise.resolve()}I(){}da(){let t;if(this.g.da((e=>{t=Zi(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.G.push(Error(e))})),this.g.La(),this.g.setGraph(t,e),this.A=void 0,Ho(this)}finishProcessing(){this.g.finishProcessing(),Ho(this)}close(){this.A=void 0,this.g.closeGraph()}};function qo(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}$o.prototype.close=$o.prototype.close,function(e,n){e=e.split(".");var r,i=t;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===n?i=i[r]&&i[r]!==Object.prototype[r]?i[r]:i[r]={}:i[r]=n}("TaskRunner",$o);class Jo{constructor(t,e,n,r){this.g=t,this.h=e,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Zo(t,e,n){const r=t.g;if(n=qo(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compil