@mediapipe/tasks-audio 0.10.16 → 0.10.17-rc.20241004
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.
- package/README.md +0 -0
- package/audio_bundle.cjs +1 -1
- package/audio_bundle.cjs.map +1 -1
- package/audio_bundle.mjs +1 -1
- package/audio_bundle.mjs.map +1 -1
- package/package.json +1 -1
- package/wasm/audio_wasm_internal.js +0 -0
- package/wasm/audio_wasm_internal.wasm +0 -0
- package/wasm/audio_wasm_nosimd_internal.js +0 -0
- package/wasm/audio_wasm_nosimd_internal.wasm +0 -0
package/README.md
CHANGED
|
File without changes
|
package/audio_bundle.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],i=t,o=0;o<r.length;o++)if(null==(i=i[r[o]])){r=null;break t}r=i}return null!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,o;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=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 o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-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 l,h=e(610401301,!1),f=e(653718497,e(1,!0)),d=e(660014094,!1);const g=t.navigator;function p(t){return!!h&&(!!l&&l.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function m(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function y(){return!!h&&(!!l&&l.brands.length>0)}function b(){return y()?p("Chromium"):(m("Chrome")||m("CriOS"))&&!(!y()&&m("Edge"))||m("Silk")}l=g&&g.userAgentData||null;var v=!y()&&(m("Trident")||m("MSIE"));!m("Android")||b(),b(),m("Safari")&&(b()||!y()&&m("Coast")||!y()&&m("Opera")||!y()&&m("Edge")||(y()?p("Microsoft Edge"):m("Edg/"))||y()&&p("Opera"));var w={},_=null;function A(t){var e=t.length,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);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=_[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}S();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function S(){if(!_){_={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;n<5;n++){var r=t.concat(e[n].split(""));w[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===_[o]&&(_[o]=i)}}}}var I="undefined"!=typeof Uint8Array,E=!v&&"function"==typeof btoa;function T(t){if(!E){var e;void 0===e&&(e=0),S(),e=w[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var i=t[u],o=t[u+1],s=t[u+2],a=e[i>>2];i=e[(3&i)<<4|o>>4],o=e[(15&o)<<2|s>>6],s=e[63&s],n[c++]=a+i+o+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+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 P=/[-_.]/g,U={"-":"+",_:"/",".":"="};function N(t){return U[t]||""}function B(t){if(!E)return A(t);P.test(t)&&(t=t.replace(P,N)),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 x(t){return I&&null!=t&&t instanceof Uint8Array}var O={};let L;function k(t){if(t!==O)throw Error("illegal external caller")}function V(){return L||=new j(null,O)}function F(t){k(O);var e=t.F;return null==(e=null==e||x(e)?e:"string"==typeof e?B(e):null)?e:t.F=e}var j=class{constructor(t,e){if(k(e),this.F=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}M(){return new Uint8Array(F(this)||0)}};function M(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}let D;function G(){const e=Error();M(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function C(){const t=Error("int32");return M(t,"warning"),t}function R(){return"function"==typeof BigInt}function $(t){return Array.prototype.slice.call(t)}var W="function"==typeof Symbol&&"symbol"==typeof Symbol();function z(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var H=z(),J=z("2ex"),q=z("1oa"),K=z("0dg"),X=W?(t,e)=>{t[H]|=e}:(t,e)=>{void 0!==t.o?t.o|=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Y=W?(t,e)=>{t[H]&=~e}:(t,e)=>{void 0!==t.o&&(t.o&=~e)},Q=W?t=>0|t[H]:t=>0|t.o,Z=W?t=>t[H]:t=>t.o,tt=W?(t,e)=>{t[H]=e}:(t,e)=>{void 0!==t.o?t.o=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function et(t,e){tt(e,-14591&(0|t))}function nt(t,e){tt(e,-14557&(34|t))}var rt,it={},ot={};function st(t){return!(!t||"object"!=typeof t||t.g!==ot)}function at(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ut(t,e,n){if(null!=t)if("string"==typeof t)t=t?new j(t,O):V();else if(t.constructor!==j)if(x(t))t=t.length?new j(n?t:new Uint8Array(t),O):V();else{if(!e)throw Error();t=void 0}return t}function ct(t){return!(!Array.isArray(t)||t.length)&&!!(1&Q(t))}const lt=[];function ht(t){if(2&t)throw Error()}let ft;function dt(t,e){(e=ft?e[ft]:void 0)&&(t[ft]=$(e))}tt(lt,55),rt=Object.freeze(lt);var gt=Object.freeze({});Object.freeze({});var pt=Object.freeze({}),mt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),yt=t=>mt?t>=vt&&t<=_t:"-"===t[0]?At(t,bt):At(t,wt);const bt=Number.MIN_SAFE_INTEGER.toString(),vt=mt?BigInt(Number.MIN_SAFE_INTEGER):void 0,wt=Number.MAX_SAFE_INTEGER.toString(),_t=mt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function At(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 St="function"==typeof Uint8Array.prototype.slice;let It,Et=0,Tt=0;function Pt(t){const e=t>>>0;Et=e,Tt=(t-e)/4294967296>>>0}function Ut(t){if(t<0){Pt(-t);const[e,n]=Vt(Et,Tt);Et=e>>>0,Tt=n>>>0}else Pt(t)}function Nt(t){const e=It||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Tt=0,Et=e.getUint32(0,!0)}function Bt(t,e){return 4294967296*e+(t>>>0)}function xt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Bt(t,e),n?-t:t}function Ot(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else R()?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+Lt(n)+Lt(t));return n}function Lt(t){return t=String(t),"0000000".slice(t.length)+t}function kt(t){if(t.length<16)Ut(Number(t));else if(R())t=BigInt(t),Et=Number(t&BigInt(4294967295))>>>0,Tt=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Tt=Et=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));Tt*=1e6,Et=1e6*Et+e,Et>=4294967296&&(Tt+=Math.trunc(Et/4294967296),Tt>>>=0,Et>>>=0)}if(e){const[t,e]=Vt(Et,Tt);Et=t,Tt=e}}}function Vt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ft(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function jt(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}const Mt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Dt(t){const e=typeof t;switch(e){case"bigint":return!0;case"number":return Number.isFinite(t)}return"string"===e&&Mt.test(t)}function Gt(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function Ct(t){return"-"!==t[0]&&(t.length<20||20===t.length&&Number(t.substring(0,6))<184467)}function Rt(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Ut(t),t=xt(Et,Tt)),t}function $t(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?t.length<20||20===t.length&&Number(t.substring(0,7))>-922337:t.length<19||19===t.length&&Number(t.substring(0,6))<922337))if(kt(t),t=Et,2147483648&(e=Tt))if(R())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Vt(t,e);t="-"+Ot(n,r)}else t=Ot(t,e);return t}function Wt(t){return null==t?t:"bigint"==typeof t?(yt(t)?t=Number(t):(t=BigInt.asIntN(64,t),t=yt(t)?Number(t):String(t)),t):Dt(t)?"number"==typeof t?Rt(t):$t(t):void 0}function zt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(BigInt.asUintN(64,t));if(Dt(t)){if("string"===e)return e=Math.trunc(Number(t)),Number.isSafeInteger(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Ct(t)||(kt(t),t=Ot(Et,Tt))),t;if("number"===e)return(t=Math.trunc(t))>=0&&Number.isSafeInteger(t)?t:function(t){if(t<0){Ut(t);const e=Ot(Et,Tt);return t=Number(e),Number.isSafeInteger(t)?t:e}return Ct(String(t))?t:(Ut(t),Bt(Et,Tt))}(t)}}function Ht(t){if("string"!=typeof t)throw Error();return t}function Jt(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function qt(t){return null==t||"string"==typeof t?t:void 0}function Kt(t,e,n){if(null!=t&&"object"==typeof t&&t.D===it)return t;if(Array.isArray(t)){var r=Q(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&tt(t,i),new e(t)}}function Xt(t){if(void 0===Zt&&(Zt="function"==typeof Proxy?ae(Proxy):null),!Zt||!se())return t;let e=Yt?.get(t);return e||(Math.random()>.01?t:(function(t){if(void 0===ee){const t=new Zt([],{});ee=1===Array.prototype.concat.call([],t).length}ee&&"function"==typeof Symbol&&Symbol.isConcatSpreadable&&(t[Symbol.isConcatSpreadable]=!0)}(t),e=new Zt(t,{set:(t,e,n)=>(G(),t[e]=n,!0)}),function(t,e){(Yt||=new te).set(t,e),(Qt||=new te).set(e,t)}(t,e),e))}let Yt,Qt,Zt,te,ee,ne,re,ie,oe;function se(){return void 0===te&&(te="function"==typeof WeakMap?ae(WeakMap):null),te}function ae(t){try{return-1!==t.toString().indexOf("[native code]")?t:null}catch{return null}}function ue(t,e,n){if(f&&se()){if(ne?.get(e)?.get(t)){if(n)return}else if(Math.random()>.01)return;var r=t.length;n={length:r};for(var i=0;i<Math.min(r,10);i++){if(r<=10)var o=i;else{o=r/10;const t=Math.floor(i*o);o=t+Math.floor(Math.random()*(Math.floor((i+1)*o)-t))}n[o]=t[o]}le(t,n)?((i=(r=ne||=new te).get(e))||(i=new te,r.set(e,i)),i.set(t,n)):(G(),fe(t,e))}}function ce(t,e){const n=ne?.get(e)?.get(t);n&&!le(t,n)&&(G(),fe(t,e))}function le(t,e){if(t.length!==e.length)return!1;for(const i in e){var n,r=Number(i);if((n=Number.isInteger(r))&&(n=t[r],r=e[r],n=!(Number.isNaN(n)?Number.isNaN(r):n===r)),n)return!1}return!0}function he(t){if(t&&ne?.has(t)){var e=t.l;if(e)for(let n=0;n<e.length;n++){const r=e[n];if(n===e.length-1&&at(r))for(const e in r){const n=r[e];Array.isArray(n)&&ce(n,t)}else Array.isArray(r)&&ce(r,t)}}}function fe(t,e){ne?.get(e)?.delete(t)}function de(t,e){return t=ge(t,e[0],e[1]),X(t,16384),t}function ge(t,e,n){if(null==t&&(t=re),re=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-33521665&r|(1023&e)<<15)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(r=Q(t)))throw Error("farr");if(64&r)return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error("mid");t:{const i=(n=t).length;if(i){const t=i-1;if(at(n[t])){if((e=t-(+!!(512&(r|=256))-1))>=1024)throw Error("pvtlmt");r=-33521665&r|(1023&e)<<15;break t}}if(e){if((e=Math.max(e,i-(+!!(512&r)-1)))>1024)throw Error("spvt");r=-33521665&r|(1023&e)<<15}}}return tt(t,r),t}function pe(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=ct(t)?void 0:i&&2&Q(t)?t:me(t,e,n,void 0!==r,i);else if(at(t)){const o={};for(let s in t)o[s]=pe(t[s],e,n,r,i);t=o}else t=e(t,r);return t}}function me(t,e,n,r,i){const o=r||n?Q(t):0;r=r?!!(32&o):void 0;const s=$(t);for(let t=0;t<s.length;t++)s[t]=pe(s[t],e,n,r,i);return n&&(dt(s,t),n(o,s)),s}function ye(t){return t.D===it?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return yt(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ct(t))return}else{if(x(t))return T(t);if(t instanceof j){const e=t.F;return null==e?"":"string"==typeof e?e:t.F=T(e)}}}return t}(t)}function be(t,e,n=nt){if(null!=t){if(I&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Q(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(tt(t,-12293&(34|r)),t):me(t,be,4&r?nt:n,!0,!0))}return t.D===it&&(n=t.l,t=2&(r=Z(n))?t:we(t,n,r,!0)),t}}function ve(t){const e=t.l;return we(t,e,Z(e),!1)}function we(t,e,n,r){return he(t),t=t.constructor,re=e=_e(e,n,r),e=new t(e),re=void 0,e}function _e(t,e,n){const r=n||2&e?nt:et,i=!!(32&e);return t=function(t,e,n){const r=$(t);var i=r.length;const o=256&e?r[i-1]:void 0;for(i+=o?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(o){e=r[e]={};for(const t in o)e[t]=n(o[t])}return dt(r,t),r}(t,e,(t=>be(t,i,r))),X(t,32|(n?2:0)),t}function Ae(t){const e=t.l,n=Z(e);return 2&n?we(t,e,n,!1):t}function Se(t,e,n,r){return!(4&e)||null!=n&&(!r&&0===n&&(4096&e||8192&e)&&(t.constructor[K]=1+(0|t.constructor[K]))<5&&G(),0!==n&&!(n&e))}function Ie(t,e){return Te(t=t.l,Z(t),e)}function Ee(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function Te(t,e,n,r){if(-1===n)return null;const i=e>>15&1023||536870912;if(!(n>=i)){var o=t.length;return r&&256&e&&null!=(r=t[o-1][n])?(Ee(t,e,i,n)&&null!=J&&((e=(t=D??={})[J]||0)>=4||(t[J]=e+1,G())),r):Ee(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function Pe(t,e,n){const r=t.l;let i=Z(r);return ht(i),Ue(r,i,e,n),t}function Ue(t,e,n,r){const i=e>>15&1023||536870912;if(n>=i){let o,s=e;if(256&e)o=t[t.length-1];else{if(null==r)return s;o=t[i+(+!!(512&e)-1)]={},s|=256}return o[n]=r,n<i&&(t[n+(+!!(512&e)-1)]=void 0),s!==e&&tt(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function Ne(t,e,n,r,i){var o=2&e;i=Te(t,e,n,i),Array.isArray(i)||(i=rt);const s=!(2&r);r=!(1&r);const a=!!(32&e);let u=Q(i);return 0!==u||!a||o||s?1&u||(u|=1,tt(i,u)):(u|=33,tt(i,u)),o?(t=!1,2&u||(X(i,34),t=!!(4&u)),(r||t)&&Object.freeze(i)):(o=!!(2&u)||!!(2048&u),r&&o?(i=$(i),o=1,a&&!s&&(o|=32),tt(i,o),Ue(t,e,n,i)):s&&32&u&&!o&&Y(i,32)),i}function Be(t){t=t.l;let e=Z(t);const n=Te(t,e,1),r=ut(n,!0,!!(34&e));return null!=r&&r!==n&&Ue(t,e,1,r),r}function xe(t,e,n,r,i,o){const s=t.l;let a=Z(s);r=2&a?1:r,o=!!o,i=Oe(s,a,e,i);var u=Q(i),c=i;if(ce(c,t),2!==r&&1!==r||fe(c,t),Se(t,u,void 0,o)){4&u&&(i=$(i),u=Je(u,a),a=Ue(s,a,e,i));let t=c=0;for(;c<i.length;c++){const e=n(i[c]);null!=e&&(i[t++]=e)}t<c&&(i.length=t),u=-4097&(20|(u=Le(u,a))),tt(i,u&=-8193),2&u&&Object.freeze(i)}let l;return 1===r||4===r&&32&u?ke(u)||(t=u,(u|=2)!==t&&tt(i,u),Object.freeze(i)):(n=5===r&&(!!(32&u)||ke(u)||!!Yt?.get(i)),(2===r||n)&&ke(u)&&(i=$(i),u=qe(u=Je(u,a),a,o),tt(i,u),a=Ue(s,a,e,i)),ke(u)||(e=u,(u=qe(u,a,o))!==e&&tt(i,u)),n?(l=Xt(i),ue(i,t,!0)):2!==r||o||Yt?.delete(i)),l||i}function Oe(t,e,n,r){return t=Te(t,e,n,r),Array.isArray(t)?t:rt}function Le(t,e){return 0===t&&(t=Je(t,e)),1|t}function ke(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Ve(t,e){t=t.l;let n=Z(t);ht(n),Ue(t,n,2,""===e?void 0:e)}function Fe(t,e){var n=Si;return De(je(t=t.l),t,Z(t),n)===e?e:-1}function je(t){if(W)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 Me(t,e,n,r){const i=je(t),o=De(i,t,e,n);return o!==r&&(o&&(e=Ue(t,e,o)),i.set(n,r)),e}function De(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 o=r[t];null!=Te(e,n,o)&&(0!==i&&(n=Ue(e,n,i)),i=o)}return t.set(r,i),i}function Ge(t,e,n,r){let i,o=Z(t);if(null!=(r=Te(t,o,n,r))&&r.D===it)return(e=Ae(r))!==r&&Ue(t,o,n,e),e.l;if(Array.isArray(r)){const t=Q(r);i=2&t?_e(r,t,!1):r,i=de(i,e)}else i=de(void 0,e);return i!==r&&Ue(t,o,n,i),i}function Ce(t,e,n,r){t=t.l;let i=Z(t);return(e=Kt(r=Te(t,i,n,r),e,i))!==r&&null!=e&&Ue(t,i,n,e),e}function Re(t,e,n){if(null==(e=Ce(t,e,n,!1)))return e;t=t.l;let r=Z(t);if(!(2&r)){const i=Ae(e);i!==e&&Ue(t,r,n,e=i)}return e}function $e(t,e,n,r,i,o){var s=t.l,a=!!(2&e);r=a?1:r,i=!!i,o&&=!a,a=Oe(s,e,1);var u=Q(a),c=a;if(ce(c,t),2!==r&&1!==r||fe(c,t),!(c=!!(4&u))){var l=a,h=e;const t=!!(2&(u=Le(u,e)));t&&(h|=2);let r=!t,i=!0,o=0,s=0;for(;o<l.length;o++){const e=Kt(l[o],n,h);if(e instanceof n){if(!t){const t=!!(2&Q(e.l));r&&=!t,i&&=t}l[s++]=e}}s<o&&(l.length=s),u|=4,u=i?16|u:-17&u,tt(l,u=r?8|u:-9&u),t&&Object.freeze(l)}if(o&&!(8&u||!a.length&&(1===r||4===r&&32&u))){for(ke(u)?(a=$(a),u=Je(u,e),e=Ue(s,e,1,a)):fe(a,t),n=a,o=u,l=0;l<n.length;l++)(u=n[l])!==(h=Ae(u))&&(n[l]=h);o|=8,o=n.length?-17&o:16|o,tt(n,o),u=o}let f;return 1===r||4===r&&32&u?ke(u)||(t=u,(u|=!a.length||16&u&&(!c||32&u)?2:2048)!==t&&tt(a,u),Object.freeze(a)):(c=5===r&&(!!(32&u)||ke(u)||!!Yt?.get(a)),(2===r||c)&&ke(u)&&(a=$(a),u=qe(u=Je(u,e),e,i),tt(a,u),e=Ue(s,e,1,a)),ke(u)||(s=u,(u=qe(u,e,i))!==s&&tt(a,u)),c?(f=Xt(a),ue(a,t,!0)):2!==r||i||Yt?.delete(a)),f||a}function We(t,e){const n=Z(t.l);return $e(t,n,e,void 0===gt?2:5,!1,!(2&n))}function ze(t,e,n,r){return null==r&&(r=void 0),Pe(t,n,r)}function He(t,e,n){var r=ci;null==n&&(n=void 0);t:{t=t.l;let i=Z(t);if(ht(i),null==n){const n=je(t);if(De(n,t,i,r)!==e)break t;n.set(r,0)}else i=Me(t,i,r,e);Ue(t,i,e,n)}}function Je(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function qe(t,e,n){return 32&e&&n||(t&=-33),t}function Ke(t,e){var n=Zr;const r=Z(t.l);ht(r),t=$e(t,r,n,2,!0),e=null!=e?e:new n,t.push(e),2&Q(e.l)?Y(t,8):Y(t,16)}function Xe(t,e){return t??e}function Ye(t,e,n){{const a=t.l;let u=Z(a);if(ht(u),null==n)Ue(a,u,e);else{n=Qt?.get(n)||n;var r,i=Q(n),o=i,s=!!(2&i)||Object.isFrozen(n);if((r=!s)&&(r=void 0===pt||!1),Se(t,i)){i=21,s&&(n=$(n),o=0,i=qe(i=Je(i,u),u,!0));for(let t=0;t<n.length;t++)n[t]=Ht(n[t])}r?(n=$(n),o=0,i=qe(i=Je(i,u),u,!0)):s||ue(n,t),i!==o&&tt(n,i),Ue(a,u,e,n)}}}function Qe(t,e,n){ht(Z(t.l)),xe(t,e,qt,2,void 0,!0).push(Ht(n))}function Ze(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function tn(){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 nn(t){if("string"==typeof t)return{buffer:B(t),v:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),v:!1};if(t.constructor===Uint8Array)return{buffer:t,v:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),v:!1};if(t.constructor===j)return{buffer:F(t)||new Uint8Array(0),v:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),v:!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 rn(t,e){let n,r=0,i=0,o=0;const s=t.i;let a=t.g;do{n=s[a++],r|=(127&n)<<o,o+=7}while(o<32&&128&n);for(o>32&&(i|=(127&n)>>4),o=3;o<32&&128&n;o+=7)n=s[a++],i|=(127&n)<<o;if(hn(t,a),n<128)return e(r>>>0,i>>>0);throw tn()}function on(t){let e=0,n=t.g;const r=n+10,i=t.i;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return hn(t,n),!!(127&e)}throw tn()}function sn(t){const e=t.i;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 tn();return hn(t,n),i}function an(t){var e=t.i;const n=t.g,r=e[n],i=e[n+1],o=e[n+2];return e=e[n+3],hn(t,t.g+4),(r<<0|i<<8|o<<16|e<<24)>>>0}function un(t){var e=an(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 cn(t){return sn(t)}function ln(t,e,{G:n=!1}={}){t.G=n,e&&(e=nn(e),t.i=e.buffer,t.m=e.v,t.u=0,t.j=t.i.length,t.g=t.u)}function hn(t,e){if(t.g=e,e>t.j)throw en(t.j,e)}function fn(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.j)throw en(e,t.j-n);return t.g=r,n}function dn(t,e){if(0==e)return V();var n=fn(t,e);return t.G&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?new Uint8Array(0):St?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?V():new j(n,O)}var gn=[];function pn(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=sn(t.g)>>>0;if(e=n>>>3,!((n&=7)>=0&&n<=5))throw Ze(n,t.j);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function mn(t){switch(t.i){case 0:0!=t.i?mn(t):on(t.g);break;case 1:hn(t=t.g,t.g+8);break;case 2:if(2!=t.i)mn(t);else{var e=sn(t.g)>>>0;hn(t=t.g,t.g+e)}break;case 5:hn(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!pn(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}mn(t)}break;default:throw Ze(t.i,t.j)}}function yn(t,e,n){const r=t.g.j,i=sn(t.g)>>>0,o=t.g.g+i;let s=o-r;if(s<=0&&(t.g.j=o,n(e,t,void 0,void 0,void 0),s=o-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=o,t.g.j=r}function bn(t){var e=sn(t.g)>>>0,a=fn(t=t.g,e);if(t=t.i,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===i){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(o=void 0),t}}else{e=(l=a)+e,a=[];let i,o=null;for(;l<e;){var h=t[l++];h<128?a.push(h):h<224?l>=e?n():(i=t[l++],h<194||128!=(192&i)?(l--,n()):a.push((31&h)<<6|63&i)):h<240?l>=e-1?n():(i=t[l++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?l>=e-2?n():(i=t[l++],128!=(192&i)||i-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),a.length>=8192&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function vn(t){const e=sn(t.g)>>>0;return dn(t.g,e)}function wn(t,e,n){var r=sn(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var _n=[];let An;function Sn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var In=class{constructor(t,e){this.l=ge(t,e)}toJSON(){return En(this)}v(){return!!(2&Q(this.l))}};function En(t){he(t),t=An?t.l:me(t.l,ye,void 0,void 0,!1);{var e=!An;let c=t.length;if(c){var n=t[c-1],r=at(n);r?c--:n=void 0;var i=t;if(r){t:{var o,s=n,a=!1;if(s)for(let t in s)isNaN(+t)?(o??={})[t]=s[t]:(r=s[t],Array.isArray(r)&&(ct(r)||st(r)&&0===r.size)&&(r=null),null==r&&(a=!0),null!=r&&((o??={})[t]=r));if(a||(o=s),o)for(let t in o){a=o;break t}a=null}s=null==a?null!=n:a!==n}for(;c>0&&(null==(o=i[c-1])||ct(o)||st(o)&&0===o.size);c--)var u=!0;(i!==t||s||u)&&(e?(u||s||a)&&(i.length=c):i=Array.prototype.slice.call(i,0,c),a&&i.push(a)),u=i}else u=t}return u}function Tn(t){return t?/^\d+$/.test(t)?(kt(t),new Pn(Et,Tt)):null:Un||=new Pn(0,0)}In.prototype.D=it,In.prototype.toString=function(){try{return An=!0,En(this).toString()}finally{An=!1}};var Pn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let Un;function Nn(t){return t?/^-?\d+$/.test(t)?(kt(t),new Bn(Et,Tt)):null:xn||=new Bn(0,0)}var Bn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let xn;function On(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 Ln(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function kn(t,e){if(e>=0)Ln(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Vn(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 Fn(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function jn(t,e,n){Ln(t.g,8*e+n)}function Mn(t,e){return jn(t,e,2),e=t.g.end(),Fn(t,e),e.push(t.i),e}function Dn(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function Gn(t,e,n){jn(t,e,2),Ln(t.g,n.length),Fn(t,t.g.end()),Fn(t,n)}class Cn{constructor(t,e,n){this.g=t,this.i=e,this.K=n}}function Rn(t){return Array.isArray(t)?t[0]instanceof Cn?t:[Or,t]:[t,void 0]}function $n(t,e){if(Array.isArray(e)){var n=Q(e);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),tt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}const Wn=Symbol();function zn(t){let e=t[Wn];if(!e){const n=ir(t),r=n.i;e=r?(t,e)=>r(t,e,n):(t,e)=>{for(;pn(e)&&4!=e.i;){var r=e.m;let s=n[r];const a=!s;let u=!1;if(!s){var i=n.B;if(i){var o=i[r];o&&(u=i.A?.[r],(!d||u)&&(i=Hn(o))&&(s=n[r]=i))}}s&&s(e,t,r)||(r=(i=e).j,mn(i),i.J?i=void 0:(o=i.g.g-r,i.g.g=r,i=dn(i.g,o)),r=t,i&&(ft||=Symbol(),(o=r[ft])?o.push(i):r[ft]=[i])),a&&s&&!u&&lr++<5&&G()}},t[Wn]=e}return e}function Hn(t){const e=(t=Rn(t))[0].g;if(t=t[1]){const n=zn(t),r=ir(t).g;return(t,i,o)=>e(t,i,o,r,n)}return e}function Jn(t,e,n){t[e]=n}function qn(t,e,n,r){var i=Jn;e.g=function(t){switch(typeof t){case"boolean":return ie||=[0,void 0,!0];case"number":return t>0?void 0:0===t?oe||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(t[0]);let o=0;var s=t[++o];s&&s.constructor===Object&&(e.B=s,"function"==typeof(s=t[++o])&&(e.i=s,e.j=t[++o],s=t[++o]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&s[0]>0;){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++o]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++o]);var c=void 0;if(s instanceof Cn?h=s:(h=Lr,o--),h.K){s=t[++o],c=t;var l=o;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++o])&&s<0&&(l-=s,s=t[++o]);u<l;u++){const t=a[u];i(e,u,c?r(h,c,t):n(h,t))}}return e}const Kn=Symbol();function Xn(t){let e=t[Kn];if(!e){const n=tr(t);e=(t,e)=>sr(t,e,n),t[Kn]=e}return e}const Yn=Symbol();function Qn(t){return t.i}function Zn(t,e){let n,r;const i=t.i;return(t,o,s)=>i(t,o,s,r||=tr(e).g,n||=Xn(e))}function tr(t){let e=t[Yn];return e||(e=qn(t,t[Yn]={},Qn,Zn))}const er=Symbol();function nr(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function rr(t,e,n){const r=t.g;let i,o;return(t,s,a)=>r(t,s,a,o||=ir(e).g,i||=zn(e),n)}function ir(t){let e=t[er];return e||(e=qn(t,t[er]={},nr,rr))}function or(t,e){var n=t[e];if(n)return n;if(n=t.B){var r=n[e];if(r){var i=(r=Rn(r))[0].i;if(r=r[1],n=n.A?.[e],!d||n){if(r){const e=Xn(r),o=tr(r).g;n=(n=t.j)?n(o,e):(t,n,r)=>i(t,n,r,o,e)}else n=i;return t[e]=n}}}}function sr(t,e,n){for(var r=Z(t),i=+!!(512&r)-1,o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=or(n,o);if(!a)continue;const u=n.B;u?.[o]&&!u?.A?.[o]&&lr++<5&&G(),a(e,r,o)}if(256&r){r=t[o-1];for(let t in r)i=+t,!Number.isNaN(i)&&(null!=(o=r[t])&&(a=or(n,i)))&&((s=n.B)?.[i]&&!s?.A?.[i]&&lr++<5&&G(),a(e,o,i))}if(t=ft?t[ft]:void 0)for(Fn(e,e.g.end()),n=0;n<t.length;n++)Fn(e,F(t[n])||new Uint8Array(0))}function ar(t,e){return new Cn(t,e,!1)}function ur(t,e){return new Cn(t,e,!1)}function cr(t,e,n){Ue(t,Z(t),e,n)}let lr=0;function hr(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(BigInt.asIntN(64,t));if(Dt(t)){if("string"===e)return $t(t);if("number"===e)return Rt(t)}}(e),null!=e){if("string"==typeof e)Nn(e);if(null!=e)switch(jn(t,n,0),typeof e){case"number":t=t.g,Ut(e),On(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new Bn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),On(t.g,n.i,n.g);break;default:n=Nn(e),On(t.g,n.i,n.g)}}}function fr(t,e,n){null!=(e=Gt(e))&&null!=e&&(jn(t,n,0),kn(t.g,e))}function dr(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(jn(t,n,0),t.g.g.push(e?1:0))}function gr(t,e,n){null!=(e=qt(e))&&Gn(t,n,c(e))}function pr(t,e,n,r,i){e instanceof In?(he(e),e=e.l):e=Array.isArray(e)?de(e,r):void 0,null!=e&&(n=Mn(t,n),i(e,t),Dn(t,n))}function mr(t,e,n){null!=(e=null==e||"string"==typeof e||x(e)||e instanceof j?e:void 0)&&Gn(t,n,nn(e).buffer)}var yr,br=ar((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=an(r);const i=an(r);r=2*(i>>31)+1;const o=i>>>20&2047;return t=4294967296*(1048575&i)+t,cr(e,n,2047==o?t?NaN:r*(1/0):0==o?5e-324*r*t:r*Math.pow(2,o-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=Ft(e))&&(jn(t,n,1),t=t.g,(n=It||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Et=n.getUint32(0,!0),Tt=n.getUint32(4,!0),Vn(t,Et),Vn(t,Tt))})),vr=ar((function(t,e,n){return 5===t.i&&(cr(e,n,un(t.g)),!0)}),(function(t,e,n){null!=(e=Ft(e))&&(jn(t,n,5),t=t.g,Nt(e),Vn(t,Et))})),wr=ur((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ne(e,Z(e),n,2,!1),2==t.i?wn(t,un,e):e.push(un(t.g)),!0)}),(function(t,e,n){if(null!=(e=$n(Ft,e))&&e.length){jn(t,n,2),Ln(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Nt(e[r]),Vn(n,Et)}})),_r=ar((function(t,e,n){return 0===t.i&&(cr(e,n,rn(t.g,xt)),!0)}),hr),Ar=ar((function(t,e,n){return 0===t.i&&(cr(e,n,0===(t=rn(t.g,xt))?void 0:t),!0)}),hr),Sr=ar((function(t,e,n){return 0===t.i&&(cr(e,n,rn(t.g,Bt)),!0)}),(function(t,e,n){if(null!=(e=zt(e))){if("string"==typeof e)Tn(e);if(null!=e)switch(jn(t,n,0),typeof e){case"number":t=t.g,Ut(e),On(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new Pn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),On(t.g,n.i,n.g);break;default:n=Tn(e),On(t.g,n.i,n.g)}}})),Ir=ar((function(t,e,n){return 0===t.i&&(cr(e,n,sn(t.g)),!0)}),fr),Er=ur((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ne(e,Z(e),n,2,!1),2==t.i?wn(t,sn,e):e.push(sn(t.g)),!0)}),(function(t,e,n){if(null!=(e=$n(Gt,e))&&e.length){n=Mn(t,n);for(let n=0;n<e.length;n++)kn(t.g,e[n]);Dn(t,n)}})),Tr=ar((function(t,e,n){return 0===t.i&&(cr(e,n,0===(t=sn(t.g))?void 0:t),!0)}),fr),Pr=ar((function(t,e,n){return 0===t.i&&(cr(e,n,on(t.g)),!0)}),dr),Ur=ar((function(t,e,n){return 0===t.i&&(cr(e,n,!1===(t=on(t.g))?void 0:t),!0)}),dr),Nr=ur((function(t,e,n){if(2!==t.i)return!1;t=bn(t);const r=Z(e);return ht(r),Ne(e,r,n,2).push(t),!0}),(function(t,e,n){if(null!=(e=$n(qt,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&Gn(r,i,c(o))}})),Br=ar((function(t,e,n){return 2===t.i&&(cr(e,n,""===(t=bn(t))?void 0:t),!0)}),gr),xr=ar((function(t,e,n){return 2===t.i&&(cr(e,n,bn(t)),!0)}),gr),Or=new Cn((function(t,e,n,r,i){return 2===t.i&&(yn(t,Ge(e,r,n,!0),i),!0)}),pr,!0),Lr=new Cn((function(t,e,n,r,i){return 2===t.i&&(yn(t,Ge(e,r,n),i),!0)}),pr,!0);yr=new Cn((function(t,e,n,r,i){if(2!==t.i)return!1;r=de(void 0,r);let o=Z(e);ht(o);let s=Ne(e,o,n,3);return o=Z(e),4&Q(s)&&(s=$(s),tt(s,-2079&(1|Q(s))),Ue(e,o,n,s)),s.push(r),yn(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)pr(t,e[o],n,r,i)}),!0);var kr=new Cn((function(t,e,n,r,i,o){return 2===t.i&&(Me(e,Z(e),o,n),yn(t,e=Ge(e,r,n),i),!0)}),pr,!0),Vr=ar((function(t,e,n){return 2===t.i&&(cr(e,n,vn(t)),!0)}),mr),Fr=ar((function(t,e,n){return 0===t.i&&(cr(e,n,sn(t.g)),!0)}),(function(t,e,n){null!=(e=Gt(e))&&(e=parseInt(e,10),jn(t,n,0),kn(t.g,e))}));class jr{constructor(t,e){this.i=t,this.g=e,this.j=ze,this.defaultValue=void 0}}function Mr(t,e){return(n,r)=>{if(_n.length){const t=_n.pop();t.s(r),ln(t.g,n,r),n=t}else n=new class{constructor(t,e){if(gn.length){const n=gn.pop();ln(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.u=0,ln(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.G=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.s(e)}s({J:t=!1}={}){this.J=t}}(n,r);try{const r=new t,o=r.l;zn(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,_n.length<100&&_n.push(n)}return i}}var Dr=[0,Br,ar((function(t,e,n){return 2===t.i&&(cr(e,n,(t=vn(t))===V()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof In){const r=e.S;return void(r&&(e=r(e),null!=e&&Gn(t,n,nn(e).buffer)))}if(Array.isArray(e))return}mr(t,e,n)}))],Gr=[0,Ir,Fr,Pr,-1,Er,Fr,-1],Cr=class extends In{constructor(){super()}},Rr=[0,Pr,xr,Pr,Fr,-1,ur((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ne(e,Z(e),n,2,!1),2==t.i?wn(t,cn,e):e.push(sn(t.g)),!0)}),(function(t,e,n){if(null!=(e=$n(Gt,e))&&e.length){n=Mn(t,n);for(let n=0;n<e.length;n++)kn(t.g,e[n]);Dn(t,n)}})),xr,-1,[0,Pr,-1],Fr,Pr,-1],$r=[0,xr,-2],Wr=class extends In{constructor(){super()}},zr=[0],Hr=[0,Ir,Pr,1,Pr,-3],Jr=[0,xr,Pr,-1,Ir,[0,[1,2,3,4,5,6,7],kr,zr,kr,Rr,kr,$r,kr,Hr,kr,Gr,kr,[0,xr,-2],kr,[0,xr,Fr]],[0,xr],Pr,[0,[1,3],[2,4],kr,[0,Er],-1,kr,[0,Nr],-1,yr,[0,xr,-1]],xr],qr=class extends In{constructor(t){super(t,2)}},Kr={},Xr=Kr.A={};Kr[336783863]=Jr,Xr[336783863]=1;var Yr,Qr=[0,Ar,-1,Ur,-3,Ar,Er,Br,Tr,Ar,-1,Ur,Tr,Ur,-2,Br],Zr=class extends In{constructor(t){super(t,500)}s(t){return ze(this,0,7,t)}},ti=[-1,{A:{}}],ei=[0,xr,1,ti],ni=[0,xr,Nr,ti],ri=class extends In{constructor(){super(void 0,500)}s(t){return ze(this,0,1001,t)}};ri.prototype.g=(Yr=[-500,yr,[-500,Br,-1,Nr,-3,[-2,Kr,Pr],yr,Dr,Tr,-1,ei,ni,yr,[0,Br,Ur],Br,Qr,Tr,Nr,987,Nr],4,yr,[-500,xr,-1,[-1,{A:{}}],998,xr],yr,[-500,xr,Nr,-1,[-2,{A:{}},Pr],997,Nr,-1],Tr,yr,[-500,xr,Nr,ti,998,Nr],Nr,Tr,ei,ni,yr,[0,Br,-1,ti],Nr,-2,Qr,Br,-1,Ur,979,ti,yr,Dr],function(){he(this);const t=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};sr(this.l,t,tr(Yr)),Fn(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let i=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,i),i+=r.length}return t.j=[e],e});var ii=class extends In{constructor(t){super(t)}},oi=class extends In{constructor(t){super(t)}g(){return We(this,ii)}},si=[0,yr,[0,Ir,vr,xr,-1]],ai=class extends In{constructor(t){super(t)}},ui=class extends In{constructor(t){super(t)}},ci=[1,2,3,4,5],li=class extends In{constructor(t){super(t)}g(){return null!=Be(this)}i(){return null!=qt(Ie(this,2))}},hi=class extends In{constructor(t){super(t)}},fi=class extends In{constructor(t){super(t)}},di=[0,[0,Vr,xr,[0,Ir,_r,-1],[0,Sr,_r]],Pr,[0,ci,kr,Hr,kr,Rr,kr,Gr,kr,zr,kr,$r],Fr],gi=new jr(451755788,fi);Kr[451755788]=[0,di,[0,xr,Ir,vr,Nr,-1],br],Xr[451755788]=1;var pi=class extends In{constructor(t){super(t)}},mi=class extends In{constructor(t){super(t)}},yi=new jr(487277289,mi);Kr[487277289]=[0,di,[0,Pr,-1]],Xr[487277289]=1;var bi=class extends In{constructor(t){super(t)}},vi=Mr(class extends In{constructor(t){super(t)}},[0,yr,[0,1,Ir,xr,si],_r]),wi=class extends In{constructor(t){super(t)}},_i=class extends In{constructor(t){super(t)}L(){const t=Be(this);return null==t?V():t}},Ai=class extends In{constructor(t){super(t)}},Si=[1,2],Ii=Mr(class extends In{constructor(t){super(t)}},[0,yr,[0,Si,kr,[0,wr],kr,[0,Vr],Ir,xr],_r]);function Ei(){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 Ti(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 Pi(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.h.stringToNewUTF8(e)),t.h._free(e)}function Ui(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.h.stringToNewUTF8(e[n]);e=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.h._free(e);t.h._free(e)}function Ni(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Bi(t,e,n){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}const xi=function(t){return class extends t{P(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==e?this.h.canvas=e:Ei()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.h._malloc(n);this.h.HEAPU8.set(t,r),e?this.h._changeBinaryGraph(n,r):this.h._changeTextGraph(n,r),this.h._free(r)}configureAudio(t,e,n,r,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Pi(this,r||"input_audio",(r=>{Pi(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),Pi(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Pi(this,e,(e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();const r=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[i,o]=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];!this.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);const[s,a]=[i,o];this.h._addBoundTextureToStream(e,s,a,n)}))}addBoolToStream(t,e,n){Pi(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Pi(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Pi(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Pi(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Pi(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Pi(this,e,(e=>{Pi(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Pi(this,e,(e=>{Ui(this,Object.keys(t),(r=>{Ui(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Pi(this,n,(n=>{Pi(this,e,(e=>{const i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,n,r),this.h._free(i)}))}))}addEmptyPacketToStream(t,e){Pi(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Pi(this,e,(e=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){Pi(this,e,(e=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){Pi(this,e,(e=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){Pi(this,e,(e=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputStream(r,e,n)}))}addUintVectorToStream(t,e,n){Pi(this,e,(e=>{const r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(r,e);this.h._addUintVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){Pi(this,e,(e=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Pi(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Pi(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Pi(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Pi(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Pi(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Pi(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Pi(this,e,(e=>{Pi(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Pi(this,n,(n=>{Pi(this,e,(e=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,e,n),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){Pi(this,e,(e=>{const n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){Pi(this,e,(e=>{const n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){Pi(this,e,(e=>{const n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){Pi(this,e,(e=>{const n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputSidePacket(n,e)}))}addUintVectorToInputSidePacket(t,e){Pi(this,e,(e=>{const n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(n,e);this.h._addUintVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){Pi(this,e,(e=>{const n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Pi(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Ni(this,t,e),Pi(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Bi(this,t,e),Pi(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){Ni(this,t,e),Pi(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Bi(this,t,e),Pi(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){Ni(this,t,e),Pi(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Bi(this,t,e),Pi(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Ni(this,t,e),Pi(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Bi(this,t,e),Pi(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Ni(this,t,e),Pi(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Bi(this,t,e),Pi(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){Ni(this,t,e),Pi(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Bi(this,t,e),Pi(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Ni(this,t,e),Pi(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Bi(this,t,e),Pi(this,t,(t=>{this.h._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ni(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Pi(this,t,(t=>{this.h._attachAudioListener(t,n||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var Oi=class extends xi{};async function Li(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Ti(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Ti(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.s(n),t}async function ki(t,e,n){return Li(t,e,n)}function Vi(t,e){const n=Re(t.baseOptions,li,1)||new li;"string"==typeof e?(Pe(n,2,Jt(e)),Pe(n,1)):e instanceof Uint8Array&&(Pe(n,1,ut(e,!1,!1)),Pe(n,2)),ze(t.baseOptions,0,1,n)}function Fi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Re(t.baseOptions,li,1)?.g()||Re(t.baseOptions,li,1)?.i()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=Re(t.baseOptions,ui,3);if(!n){var r=n=new ui;He(r,4,new Wr)}"delegate"in e&&("GPU"===e.delegate?He(e=n,2,r=new Cr):He(e=n,4,r=new Wr)),ze(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath)return fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${t.status})`)})).then((e=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),Vi(t,"/model.dat"),t.C()}));if(n.modelAssetBuffer instanceof Uint8Array)Vi(t,n.modelAssetBuffer);else if(n.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}(n.modelAssetBuffer).then((e=>{Vi(t,e),t.C()}));return t.C(),Promise.resolve()}function ji(t){try{const e=t.j.length;if(1===e)throw Error(t.j[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.j.map((t=>t.message)).join(", "))}finally{t.j=[]}}function Mi(t,e){t.u=Math.max(t.u,e)}var Di=class{constructor(t){this.g=t,this.j=[],this.u=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.j.push(Error(e))})),this.g.P(),this.g.setGraph(t,e),ji(this)}finishProcessing(){this.g.finishProcessing(),ji(this)}close(){this.g.closeGraph()}};async function Gi(t,e,n){return ki(t,e,n)}Di.prototype.close=Di.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",Di);var Ci=class extends Di{constructor(){super(...arguments),this.I=48e3}R(t){this.I=t}};function Ri(t){const e={classifications:We(t,bi).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=Xe(Gt(Ie(t,1)),0)??-1;const n=t.l;let r=Z(n);const i=Te(n,r,2),o=Ft(i);return null!=o&&o!==i&&Ue(n,r,2,o),{index:e,score:o??0??0,categoryName:Xe(qt(Ie(t,3)),"")??"",displayName:Xe(qt(Ie(t,4)),"")??""}})),headIndex:e,headName:n}}(Re(t,oi,4)?.g()??[],Xe(Gt(Ie(t,2)),0),Xe(qt(Ie(t,3)),""))))};return null!=Wt(Ie(t,2))&&(e.timestampMs=Xe(Wt(Ie(t,2)),0)),e}Ci.prototype.setDefaultSampleRate=Ci.prototype.R;var $i=class extends Ci{constructor(t,e){super(new Oi(t,e)),this.m=[],ze(t=this.i=new fi,0,1,e=new hi)}get baseOptions(){return Re(this.i,hi,1)}set baseOptions(t){ze(this.i,0,1,t)}s(t){var e=this.i,n=Re(this.i,ai,2);if(n=n?ve(n):new ai,void 0!==t.displayNamesLocale?Pe(n,1,Jt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Pe(n,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw C();if(!Number.isFinite(r))throw C();r|=0}Pe(n,2,r)}else"maxResults"in t&&Pe(n,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Pe(n,3,r)}else"scoreThreshold"in t&&Pe(n,3);return void 0!==t.categoryAllowlist?Ye(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&Pe(n,4),void 0!==t.categoryDenylist?Ye(n,5,t.categoryDenylist):"categoryDenylist"in t&&Pe(n,5),ze(e,0,2,n),Fi(this,t)}N(t,e){return this.H(t,e??this.I,this.u+1)}H(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),[...this.m]}C(){var t=new ri;Qe(t,10,"audio_in"),Qe(t,10,"sample_rate"),Qe(t,15,"timestamped_classifications");const e=new qr;Sn(e,gi,this.i);const n=new Zr;Ve(n,Jt("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),Qe(n,3,"AUDIO:audio_in"),Qe(n,3,"SAMPLE_RATE:sample_rate"),Qe(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.s(e),Ke(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=vi(e),t.m.push(Ri(e))}))}(this,t),Mi(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{Mi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Wi(t){return{embeddings:We(t,Ai).map((t=>{const e={headIndex:Xe(Gt(Ie(t,3)),0)??-1,headName:Xe(qt(Ie(t,4)),"")??""};if(void 0!==Ce(t,wi,Fe(t,1)))e.floatEmbedding=xe(Re(t,wi,Fe(t,1)),1,Ft,void 0===gt?2:5).slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=Re(t,_i,Fe(t,2))?.L()?.M()??n}return e})),timestampMs:Xe(Wt(Ie(t,2)),0)}}$i.prototype.classify=$i.prototype.N,$i.prototype.setOptions=$i.prototype.s,$i.createFromModelPath=function(t,e){return ki($i,t,{baseOptions:{modelAssetPath:e}})},$i.createFromModelBuffer=function(t,e){return Gi($i,t,{baseOptions:{modelAssetBuffer:e}})},$i.createFromOptions=function(t,e){return Gi($i,t,e)};var zi=class extends Ci{constructor(t,e){super(new Oi(t,e)),this.m=[],ze(t=this.i=new mi,0,1,e=new hi)}get baseOptions(){return Re(this.i,hi,1)}set baseOptions(t){ze(this.i,0,1,t)}s(t){var e=this.i,n=Re(this.i,pi,2);return n=n?ve(n):new pi,void 0!==t.l2Normalize?Pe(n,1,jt(t.l2Normalize)):"l2Normalize"in t&&Pe(n,1),void 0!==t.quantize?Pe(n,2,jt(t.quantize)):"quantize"in t&&Pe(n,2),ze(e,0,2,n),Fi(this,t)}O(t,e){return this.H(t,e??this.I,this.u+1)}H(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),this.m}C(){var t=new ri;Qe(t,10,"audio_in"),Qe(t,10,"sample_rate"),Qe(t,15,"embeddings_out"),Qe(t,15,"timestamped_embeddings_out");const e=new qr;Sn(e,yi,this.i);const n=new Zr;Ve(n,Jt("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),Qe(n,3,"AUDIO:audio_in"),Qe(n,3,"SAMPLE_RATE:sample_rate"),Qe(n,4,"EMBEDDINGS:embeddings_out"),Qe(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.s(e),Ke(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=Ii(t),this.m.push(Wi(t)),Mi(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Mi(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=Ii(e),this.m.push(Wi(t));Mi(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{Mi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let Hi;zi.prototype.embed=zi.prototype.O,zi.prototype.setOptions=zi.prototype.s,zi.createFromModelPath=function(t,e){return Gi(zi,t,{baseOptions:{modelAssetPath:e}})},zi.createFromModelBuffer=function(t,e){return Gi(zi,t,{baseOptions:{modelAssetBuffer:e}})},zi.createFromOptions=function(t,e){return Gi(zi,t,e)};const Ji=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 qi(){if(void 0===Hi)try{await WebAssembly.instantiate(Ji),Hi=!0}catch{Hi=!1}return Hi}async function Ki(t,e=""){const n=await qi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Xi=class{};Xi.forVisionTasks=function(t){return Ki("vision",t)},Xi.forTextTasks=function(t){return Ki("text",t)},Xi.forGenAiExperimentalTasks=function(t){return Ki("genai_experimental",t)},Xi.forGenAiTasks=function(t){return Ki("genai",t)},Xi.forAudioTasks=function(t){return Ki("audio",t)},Xi.isSimdSupported=function(){return qi()},exports.AudioClassifier=$i,exports.AudioEmbedder=zi,exports.AudioTaskRunner=Ci,exports.FilesetResolver=Xi;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],i=t,o=0;o<r.length;o++)if(null==(i=i[r[o]])){r=null;break t}r=i}return null!=(e=r&&r[e])?e:n}function n(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}function r(){throw Error("Invalid UTF8")}function i(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let o,s;const a="undefined"!=typeof TextDecoder;let u;const c="undefined"!=typeof TextEncoder;function l(t){if(c)t=(u||=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 o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-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,f=e(610401301,!1),d=e(660014094,e(1,!0));const g=t.navigator;function p(t){return!!f&&(!!h&&h.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function m(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function y(){return!!f&&(!!h&&h.brands.length>0)}function b(){return y()?p("Chromium"):(m("Chrome")||m("CriOS"))&&!(!y()&&m("Edge"))||m("Silk")}h=g&&g.userAgentData||null;var v=!y()&&(m("Trident")||m("MSIE"));!m("Android")||b(),b(),m("Safari")&&(b()||!y()&&m("Coast")||!y()&&m("Opera")||!y()&&m("Edge")||(y()?p("Microsoft Edge"):m("Edg/"))||y()&&p("Opera"));var w={},_=null;function A(t){var e=t.length,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);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=_[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}S();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function S(){if(!_){_={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;n<5;n++){var r=t.concat(e[n].split(""));w[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===_[o]&&(_[o]=i)}}}}var I="undefined"!=typeof Uint8Array,E=!v&&"function"==typeof btoa;function T(t){if(!E){var e;void 0===e&&(e=0),S(),e=w[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var i=t[u],o=t[u+1],s=t[u+2],a=e[i>>2];i=e[(3&i)<<4|o>>4],o=e[(15&o)<<2|s>>6],s=e[63&s],n[c++]=a+i+o+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+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 P=/[-_.]/g,U={"-":"+",_:"/",".":"="};function N(t){return U[t]||""}function B(t){if(!E)return A(t);P.test(t)&&(t=t.replace(P,N)),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 x(t){return I&&null!=t&&t instanceof Uint8Array}var O={};let L;function k(t){if(t!==O)throw Error("illegal external caller")}function V(){return L||=new j(null,O)}function F(t){k(O);var e=t.g;return null==(e=null==e||x(e)?e:"string"==typeof e?B(e):null)?e:t.g=e}var j=class{constructor(t,e){if(k(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}i(){return new Uint8Array(F(this)||0)}};function M(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}let D;function G(){const e=Error();M(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function C(){const t=Error("int32");return M(t,"warning"),t}function R(){return"function"==typeof BigInt}function $(t){return Array.prototype.slice.call(t)}var W="function"==typeof Symbol&&"symbol"==typeof Symbol();function z(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var H=z(),J=z("2ex"),K=z("1oa"),q=z("0dg"),X=W?(t,e)=>{t[H]|=e}:(t,e)=>{void 0!==t.o?t.o|=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Y=W?(t,e)=>{t[H]&=~e}:(t,e)=>{void 0!==t.o&&(t.o&=~e)},Q=W?t=>0|t[H]:t=>0|t.o,Z=W?t=>t[H]:t=>t.o,tt=W?(t,e)=>{t[H]=e}:(t,e)=>{void 0!==t.o?t.o=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function et(t,e){tt(e,-14591&(0|t))}function nt(t,e){tt(e,-14557&(34|t))}var rt,it={},ot={};function st(t){return!(!t||"object"!=typeof t||t.g!==ot)}function at(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ut(t,e,n){if(null!=t)if("string"==typeof t)t=t?new j(t,O):V();else if(t.constructor!==j)if(x(t))t=t.length?new j(n?t:new Uint8Array(t),O):V();else{if(!e)throw Error();t=void 0}return t}function ct(t){return!(!Array.isArray(t)||t.length)&&!!(1&Q(t))}const lt=[];function ht(t){if(2&t)throw Error()}let ft;function dt(t,e){(e=ft?e[ft]:void 0)&&(t[ft]=$(e))}tt(lt,55),rt=Object.freeze(lt);var gt=Object.freeze({});Object.freeze({});var pt=Object.freeze({}),mt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),yt=t=>mt?t>=vt&&t<=_t:"-"===t[0]?At(t,bt):At(t,wt);const bt=Number.MIN_SAFE_INTEGER.toString(),vt=mt?BigInt(Number.MIN_SAFE_INTEGER):void 0,wt=Number.MAX_SAFE_INTEGER.toString(),_t=mt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function At(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 St="function"==typeof Uint8Array.prototype.slice;let It,Et=0,Tt=0;function Pt(t){const e=t>>>0;Et=e,Tt=(t-e)/4294967296>>>0}function Ut(t){if(t<0){Pt(-t);const[e,n]=Vt(Et,Tt);Et=e>>>0,Tt=n>>>0}else Pt(t)}function Nt(t){const e=It||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Tt=0,Et=e.getUint32(0,!0)}function Bt(t,e){return 4294967296*e+(t>>>0)}function xt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Bt(t,e),n?-t:t}function Ot(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else R()?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+Lt(n)+Lt(t));return n}function Lt(t){return t=String(t),"0000000".slice(t.length)+t}function kt(t){if(t.length<16)Ut(Number(t));else if(R())t=BigInt(t),Et=Number(t&BigInt(4294967295))>>>0,Tt=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Tt=Et=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));Tt*=1e6,Et=1e6*Et+e,Et>=4294967296&&(Tt+=Math.trunc(Et/4294967296),Tt>>>=0,Et>>>=0)}if(e){const[t,e]=Vt(Et,Tt);Et=t,Tt=e}}}function Vt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ft(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function jt(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}const Mt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Dt(t){const e=typeof t;switch(e){case"bigint":return!0;case"number":return Number.isFinite(t)}return"string"===e&&Mt.test(t)}function Gt(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function Ct(t){return"-"!==t[0]&&(t.length<20||20===t.length&&Number(t.substring(0,6))<184467)}function Rt(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Ut(t),t=xt(Et,Tt)),t}function $t(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?t.length<20||20===t.length&&Number(t.substring(0,7))>-922337:t.length<19||19===t.length&&Number(t.substring(0,6))<922337))if(kt(t),t=Et,2147483648&(e=Tt))if(R())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Vt(t,e);t="-"+Ot(n,r)}else t=Ot(t,e);return t}function Wt(t){return null==t?t:"bigint"==typeof t?(yt(t)?t=Number(t):(t=BigInt.asIntN(64,t),t=yt(t)?Number(t):String(t)),t):Dt(t)?"number"==typeof t?Rt(t):$t(t):void 0}function zt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(BigInt.asUintN(64,t));if(Dt(t)){if("string"===e)return e=Math.trunc(Number(t)),Number.isSafeInteger(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Ct(t)||(kt(t),t=Ot(Et,Tt))),t;if("number"===e)return(t=Math.trunc(t))>=0&&Number.isSafeInteger(t)?t:function(t){if(t<0){Ut(t);const e=Ot(Et,Tt);return t=Number(e),Number.isSafeInteger(t)?t:e}return Ct(String(t))?t:(Ut(t),Bt(Et,Tt))}(t)}}function Ht(t){if("string"!=typeof t)throw Error();return t}function Jt(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Kt(t){return null==t||"string"==typeof t?t:void 0}function qt(t,e,n){if(null!=t&&"object"==typeof t&&t.F===it)return t;if(Array.isArray(t)){var r=Q(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&tt(t,i),new e(t)}}function Xt(t){if(void 0===Zt&&(Zt="function"==typeof Proxy?ae(Proxy):null),!Zt||!se())return t;let e=Yt?.get(t);return e||(Math.random()>.01?t:(function(t){if(void 0===ee){const t=new Zt([],{});ee=1===Array.prototype.concat.call([],t).length}ee&&"function"==typeof Symbol&&Symbol.isConcatSpreadable&&(t[Symbol.isConcatSpreadable]=!0)}(t),e=new Zt(t,{set:(t,e,n)=>(G(),t[e]=n,!0)}),function(t,e){(Yt||=new te).set(t,e),(Qt||=new te).set(e,t)}(t,e),e))}let Yt,Qt,Zt,te,ee,ne,re,ie,oe;function se(){return void 0===te&&(te="function"==typeof WeakMap?ae(WeakMap):null),te}function ae(t){try{return-1!==t.toString().indexOf("[native code]")?t:null}catch{return null}}function ue(t,e,n){if(se()){if(ne?.get(e)?.get(t)){if(n)return}else if(Math.random()>.01)return;var r=t.length;n={length:r};for(var i=0;i<Math.min(r,10);i++){if(r<=10)var o=i;else{o=r/10;const t=Math.floor(i*o);o=t+Math.floor(Math.random()*(Math.floor((i+1)*o)-t))}n[o]=t[o]}le(t,n)?((i=(r=ne||=new te).get(e))||(i=new te,r.set(e,i)),i.set(t,n)):(G(),fe(t,e))}}function ce(t,e){const n=ne?.get(e)?.get(t);n&&!le(t,n)&&(G(),fe(t,e))}function le(t,e){if(t.length!==e.length)return!1;for(const i in e){var n,r=Number(i);if((n=Number.isInteger(r))&&(n=t[r],r=e[r],n=!(Number.isNaN(n)?Number.isNaN(r):n===r)),n)return!1}return!0}function he(t){if(t&&ne?.has(t)){var e=t.l;if(e)for(let n=0;n<e.length;n++){const r=e[n];if(n===e.length-1&&at(r))for(const e in r){const n=r[e];Array.isArray(n)&&ce(n,t)}else Array.isArray(r)&&ce(r,t)}}}function fe(t,e){ne?.get(e)?.delete(t)}function de(t,e){return t=ge(t,e[0],e[1]),X(t,16384),t}function ge(t,e,n){if(null==t&&(t=re),re=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-33521665&r|(1023&e)<<15)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(r=Q(t)))throw Error("farr");if(64&r)return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error("mid");t:{const i=(n=t).length;if(i){const t=i-1;if(at(n[t])){if((e=t-(+!!(512&(r|=256))-1))>=1024)throw Error("pvtlmt");r=-33521665&r|(1023&e)<<15;break t}}if(e){if((e=Math.max(e,i-(+!!(512&r)-1)))>1024)throw Error("spvt");r=-33521665&r|(1023&e)<<15}}}return tt(t,r),t}function pe(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=ct(t)?void 0:i&&2&Q(t)?t:me(t,e,n,void 0!==r,i);else if(at(t)){const o={};for(let s in t)o[s]=pe(t[s],e,n,r,i);t=o}else t=e(t,r);return t}}function me(t,e,n,r,i){const o=r||n?Q(t):0;r=r?!!(32&o):void 0;const s=$(t);for(let t=0;t<s.length;t++)s[t]=pe(s[t],e,n,r,i);return n&&(dt(s,t),n(o,s)),s}function ye(t){return t.F===it?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return yt(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ct(t))return}else{if(x(t))return T(t);if(t instanceof j){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=T(e)}}}return t}(t)}function be(t,e,n=nt){if(null!=t){if(I&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Q(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(tt(t,-12293&(34|r)),t):me(t,be,4&r?nt:n,!0,!0))}return t.F===it&&(n=t.l,t=2&(r=Z(n))?t:we(t,n,r,!0)),t}}function ve(t){const e=t.l;return we(t,e,Z(e),!1)}function we(t,e,n,r){return he(t),t=t.constructor,re=e=_e(e,n,r),e=new t(e),re=void 0,e}function _e(t,e,n){const r=n||2&e?nt:et,i=!!(32&e);return t=function(t,e,n){const r=$(t);var i=r.length;const o=256&e?r[i-1]:void 0;for(i+=o?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(o){e=r[e]={};for(const t in o)e[t]=n(o[t])}return dt(r,t),r}(t,e,(t=>be(t,i,r))),X(t,32|(n?2:0)),t}function Ae(t){const e=t.l,n=Z(e);return 2&n?we(t,e,n,!1):t}function Se(t,e,n,r){return!(4&e)||null!=n&&(!r&&0===n&&(4096&e||8192&e)&&(t.constructor[q]=1+(0|t.constructor[q]))<5&&G(),0!==n&&!(n&e))}function Ie(t,e){return Te(t=t.l,Z(t),e)}function Ee(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function Te(t,e,n,r){if(-1===n)return null;const i=e>>15&1023||536870912;if(!(n>=i)){var o=t.length;return r&&256&e&&null!=(r=t[o-1][n])?(Ee(t,e,i,n)&&null!=J&&((e=(t=D??={})[J]||0)>=4||(t[J]=e+1,G())),r):Ee(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function Pe(t,e,n){const r=t.l;let i=Z(r);return ht(i),Ue(r,i,e,n),t}function Ue(t,e,n,r){const i=e>>15&1023||536870912;if(n>=i){let o,s=e;if(256&e)o=t[t.length-1];else{if(null==r)return s;o=t[i+(+!!(512&e)-1)]={},s|=256}return o[n]=r,n<i&&(t[n+(+!!(512&e)-1)]=void 0),s!==e&&tt(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function Ne(t,e,n,r,i){var o=2&e;i=Te(t,e,n,i),Array.isArray(i)||(i=rt);const s=!(2&r);r=!(1&r);const a=!!(32&e);let u=Q(i);return 0!==u||!a||o||s?1&u||(u|=1,tt(i,u)):(u|=33,tt(i,u)),o?(t=!1,2&u||(X(i,34),t=!!(4&u)),(r||t)&&Object.freeze(i)):(o=!!(2&u)||!!(2048&u),r&&o?(i=$(i),o=1,a&&!s&&(o|=32),tt(i,o),Ue(t,e,n,i)):s&&32&u&&!o&&Y(i,32)),i}function Be(t){t=t.l;let e=Z(t);const n=Te(t,e,1),r=ut(n,!0,!!(34&e));return null!=r&&r!==n&&Ue(t,e,1,r),r}function xe(t,e,n,r,i,o){const s=t.l;let a=Z(s);r=2&a?1:r,o=!!o,i=Oe(s,a,e,i);var u=Q(i),c=i;if(ce(c,t),2!==r&&1!==r||fe(c,t),Se(t,u,void 0,o)){4&u&&(i=$(i),u=Je(u,a),a=Ue(s,a,e,i));let t=c=0;for(;c<i.length;c++){const e=n(i[c]);null!=e&&(i[t++]=e)}t<c&&(i.length=t),u=-4097&(20|(u=Le(u,a))),tt(i,u&=-8193),2&u&&Object.freeze(i)}let l;return 1===r||4===r&&32&u?ke(u)||(t=u,(u|=2)!==t&&tt(i,u),Object.freeze(i)):(n=5===r&&(!!(32&u)||ke(u)||!!Yt?.get(i)),(2===r||n)&&ke(u)&&(i=$(i),u=Ke(u=Je(u,a),a,o),tt(i,u),a=Ue(s,a,e,i)),ke(u)||(e=u,(u=Ke(u,a,o))!==e&&tt(i,u)),n?(l=Xt(i),ue(i,t,!0)):2!==r||o||Yt?.delete(i)),l||i}function Oe(t,e,n,r){return t=Te(t,e,n,r),Array.isArray(t)?t:rt}function Le(t,e){return 0===t&&(t=Je(t,e)),1|t}function ke(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Ve(t,e){t=t.l;let n=Z(t);ht(n),Ue(t,n,2,""===e?void 0:e)}function Fe(t,e){var n=Li;return De(je(t=t.l),t,Z(t),n)===e?e:-1}function je(t){if(W)return t[K]??(t[K]=new Map);if(K in t)return t[K];const e=new Map;return Object.defineProperty(t,K,{value:e}),e}function Me(t,e,n,r){const i=je(t),o=De(i,t,e,n);return o!==r&&(o&&(e=Ue(t,e,o)),i.set(n,r)),e}function De(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 o=r[t];null!=Te(e,n,o)&&(0!==i&&(n=Ue(e,n,i)),i=o)}return t.set(r,i),i}function Ge(t,e,n,r){let i,o=Z(t);if(null!=(r=Te(t,o,n,r))&&r.F===it)return(e=Ae(r))!==r&&Ue(t,o,n,e),e.l;if(Array.isArray(r)){const t=Q(r);i=2&t?_e(r,t,!1):r,i=de(i,e)}else i=de(void 0,e);return i!==r&&Ue(t,o,n,i),i}function Ce(t,e,n,r){t=t.l;let i=Z(t);return(e=qt(r=Te(t,i,n,r),e,i))!==r&&null!=e&&Ue(t,i,n,e),e}function Re(t,e,n){if(null==(e=Ce(t,e,n,!1)))return e;t=t.l;let r=Z(t);if(!(2&r)){const i=Ae(e);i!==e&&Ue(t,r,n,e=i)}return e}function $e(t,e,n,r,i,o){var s=t.l,a=!!(2&e);r=a?1:r,i=!!i,o&&=!a,a=Oe(s,e,1);var u=Q(a),c=a;if(ce(c,t),2!==r&&1!==r||fe(c,t),!(c=!!(4&u))){var l=a,h=e;const t=!!(2&(u=Le(u,e)));t&&(h|=2);let r=!t,i=!0,o=0,s=0;for(;o<l.length;o++){const e=qt(l[o],n,h);if(e instanceof n){if(!t){const t=!!(2&Q(e.l));r&&=!t,i&&=t}l[s++]=e}}s<o&&(l.length=s),u|=4,u=i?16|u:-17&u,tt(l,u=r?8|u:-9&u),t&&Object.freeze(l)}if(o&&!(8&u||!a.length&&(1===r||4===r&&32&u))){for(ke(u)?(a=$(a),u=Je(u,e),e=Ue(s,e,1,a)):fe(a,t),n=a,o=u,l=0;l<n.length;l++)(u=n[l])!==(h=Ae(u))&&(n[l]=h);o|=8,o=n.length?-17&o:16|o,tt(n,o),u=o}let f;return 1===r||4===r&&32&u?ke(u)||(t=u,(u|=!a.length||16&u&&(!c||32&u)?2:2048)!==t&&tt(a,u),Object.freeze(a)):(c=5===r&&(!!(32&u)||ke(u)||!!Yt?.get(a)),(2===r||c)&&ke(u)&&(a=$(a),u=Ke(u=Je(u,e),e,i),tt(a,u),e=Ue(s,e,1,a)),ke(u)||(s=u,(u=Ke(u,e,i))!==s&&tt(a,u)),c?(f=Xt(a),ue(a,t,!0)):2!==r||i||Yt?.delete(a)),f||a}function We(t,e){const n=Z(t.l);return $e(t,n,e,void 0===gt?2:5,!1,!(2&n))}function ze(t,e,n,r){return null==r&&(r=void 0),Pe(t,n,r)}function He(t,e,n){var r=vi;null==n&&(n=void 0);t:{t=t.l;let i=Z(t);if(ht(i),null==n){const n=je(t);if(De(n,t,i,r)!==e)break t;n.set(r,0)}else i=Me(t,i,r,e);Ue(t,i,e,n)}}function Je(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function Ke(t,e,n){return 32&e&&n||(t&=-33),t}function qe(t,e){var n=ci;const r=Z(t.l);ht(r),t=$e(t,r,n,2,!0),e=null!=e?e:new n,t.push(e),2&Q(e.l)?Y(t,8):Y(t,16)}function Xe(t,e){return t??e}function Ye(t,e,n){{const a=t.l;let u=Z(a);if(ht(u),null==n)Ue(a,u,e);else{n=Qt?.get(n)||n;var r,i=Q(n),o=i,s=!!(2&i)||Object.isFrozen(n);if((r=!s)&&(r=void 0===pt||!1),Se(t,i)){i=21,s&&(n=$(n),o=0,i=Ke(i=Je(i,u),u,!0));for(let t=0;t<n.length;t++)n[t]=Ht(n[t])}r?(n=$(n),o=0,i=Ke(i=Je(i,u),u,!0)):s||ue(n,t),i!==o&&tt(n,i),Ue(a,u,e,n)}}}function Qe(t,e,n){ht(Z(t.l)),xe(t,e,Kt,2,void 0,!0).push(Ht(n))}function Ze(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function tn(){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 nn(t){if("string"==typeof t)return{buffer:B(t),v:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),v:!1};if(t.constructor===Uint8Array)return{buffer:t,v:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),v:!1};if(t.constructor===j)return{buffer:F(t)||new Uint8Array(0),v:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),v:!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 rn(t,e){let n,r=0,i=0,o=0;const s=t.i;let a=t.g;do{n=s[a++],r|=(127&n)<<o,o+=7}while(o<32&&128&n);for(o>32&&(i|=(127&n)>>4),o=3;o<32&&128&n;o+=7)n=s[a++],i|=(127&n)<<o;if(hn(t,a),n<128)return e(r>>>0,i>>>0);throw tn()}function on(t){let e=0,n=t.g;const r=n+10,i=t.i;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return hn(t,n),!!(127&e)}throw tn()}function sn(t){const e=t.i;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 tn();return hn(t,n),i}function an(t){var e=t.i;const n=t.g,r=e[n],i=e[n+1],o=e[n+2];return e=e[n+3],hn(t,t.g+4),(r<<0|i<<8|o<<16|e<<24)>>>0}function un(t){var e=an(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 cn(t){return sn(t)}function ln(t,e,{G:n=!1}={}){t.G=n,e&&(e=nn(e),t.i=e.buffer,t.m=e.v,t.u=0,t.j=t.i.length,t.g=t.u)}function hn(t,e){if(t.g=e,e>t.j)throw en(t.j,e)}function fn(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.j)throw en(e,t.j-n);return t.g=r,n}function dn(t,e){if(0==e)return V();var n=fn(t,e);return t.G&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?new Uint8Array(0):St?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?V():new j(n,O)}var gn=[];function pn(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=sn(t.g)>>>0;if(e=n>>>3,!((n&=7)>=0&&n<=5))throw Ze(n,t.j);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function mn(t){switch(t.i){case 0:0!=t.i?mn(t):on(t.g);break;case 1:hn(t=t.g,t.g+8);break;case 2:if(2!=t.i)mn(t);else{var e=sn(t.g)>>>0;hn(t=t.g,t.g+e)}break;case 5:hn(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!pn(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}mn(t)}break;default:throw Ze(t.i,t.j)}}function yn(t,e,n){const r=t.g.j,i=sn(t.g)>>>0,o=t.g.g+i;let s=o-r;if(s<=0&&(t.g.j=o,n(e,t,void 0,void 0,void 0),s=o-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=o,t.g.j=r}function bn(t){var e=sn(t.g)>>>0,n=fn(t=t.g,e);if(t=t.i,a){var u,c=t;(u=s)||(u=s=new TextDecoder("utf-8",{fatal:!0})),e=n+e,c=0===n&&e===c.length?c:c.subarray(n,e);try{var l=u.decode(c)}catch(t){if(void 0===o){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),o=!0}catch(t){o=!1}}throw!o&&(s=void 0),t}}else{e=(l=n)+e,n=[];let o,s=null;for(;l<e;){var h=t[l++];h<128?n.push(h):h<224?l>=e?r():(o=t[l++],h<194||128!=(192&o)?(l--,r()):n.push((31&h)<<6|63&o)):h<240?l>=e-1?r():(o=t[l++],128!=(192&o)||224===h&&o<160||237===h&&o>=160||128!=(192&(u=t[l++]))?(l--,r()):n.push((15&h)<<12|(63&o)<<6|63&u)):h<=244?l>=e-2?r():(o=t[l++],128!=(192&o)||o-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,r()):(h=(7&h)<<18|(63&o)<<12|(63&u)<<6|63&c,h-=65536,n.push(55296+(h>>10&1023),56320+(1023&h)))):r(),n.length>=8192&&(s=i(s,n),n.length=0)}l=i(s,n)}return l}function vn(t){const e=sn(t.g)>>>0;return dn(t.g,e)}function wn(t,e,n){var r=sn(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var _n=[];let An;function Sn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var In=class{constructor(t,e){this.l=ge(t,e)}toJSON(){return En(this)}v(){return!!(2&Q(this.l))}};function En(t){he(t),t=An?t.l:me(t.l,ye,void 0,void 0,!1);{var e=!An;let c=t.length;if(c){var n=t[c-1],r=at(n);r?c--:n=void 0;var i=t;if(r){t:{var o,s=n,a=!1;if(s)for(let t in s)isNaN(+t)?(o??={})[t]=s[t]:(r=s[t],Array.isArray(r)&&(ct(r)||st(r)&&0===r.size)&&(r=null),null==r&&(a=!0),null!=r&&((o??={})[t]=r));if(a||(o=s),o)for(let t in o){a=o;break t}a=null}s=null==a?null!=n:a!==n}for(;c>0&&(null==(o=i[c-1])||ct(o)||st(o)&&0===o.size);c--)var u=!0;(i!==t||s||u)&&(e?(u||s||a)&&(i.length=c):i=Array.prototype.slice.call(i,0,c),a&&i.push(a)),u=i}else u=t}return u}function Tn(t){return t?/^\d+$/.test(t)?(kt(t),new Pn(Et,Tt)):null:Un||=new Pn(0,0)}In.prototype.F=it,In.prototype.toString=function(){try{return An=!0,En(this).toString()}finally{An=!1}};var Pn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let Un;function Nn(t){return t?/^-?\d+$/.test(t)?(kt(t),new Bn(Et,Tt)):null:xn||=new Bn(0,0)}var Bn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let xn;function On(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 Ln(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function kn(t,e){if(e>=0)Ln(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Vn(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 Fn(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function jn(t,e,n){Ln(t.g,8*e+n)}function Mn(t,e){return jn(t,e,2),e=t.g.end(),Fn(t,e),e.push(t.i),e}function Dn(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function Gn(t,e,n){jn(t,e,2),Ln(t.g,n.length),Fn(t,t.g.end()),Fn(t,n)}var Cn=class{constructor(){}},Rn=class{constructor(){}},$n=class{constructor(){}},Wn=class{constructor(){}},zn=class{constructor(){}},Hn=class{constructor(){}},Jn=class{constructor(){}},Kn=class{constructor(){}},qn=class{constructor(t,e,n){this.g=t,this.i=e,t=Cn,this.j=!!t&&n===t||!1}};function Xn(t,e){return new qn(t,e,Cn)}function Yn(t,e,n,r,i){null!=(e=cr(e,r))&&(n=Mn(t,n),i(e,t),Dn(t,n))}const Qn=Xn((function(t,e,n,r,i){return 2===t.i&&(yn(t,Ge(e,r,n),i),!0)}),Yn),Zn=Xn((function(t,e,n,r,i){return 2===t.i&&(yn(t,Ge(e,r,n,!0),i),!0)}),Yn);var tr=Symbol(),er=Symbol(),nr=Symbol(),rr=Symbol();let ir,or;function sr(t,e,n,r){var i=r[t];if(i)return i;(i={}).D=function(t){switch(typeof t){case"boolean":return ie||=[0,void 0,!0];case"number":return t>0?void 0:0===t?oe||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var o=r[1];let s=1;o&&o.constructor===Object&&(i.B=o,"function"==typeof(o=r[++s])&&(i.K=!0,ir??=o,or??=r[s+1],o=r[s+=2]));const a={};for(;o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=r[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=r[++s]);var c=void 0;if(o instanceof qn?t=o:(t=Qn,s--),t?.j){o=r[++s],c=r;var l=s;"function"==typeof o&&(o=o(),c[l]=o),c=o}for(l=u+1,"number"==typeof(o=r[++s])&&o<0&&(l-=o,o=r[++s]);u<l;u++){const r=a[u];c?n(i,u,t,c,r):e(i,u,t,r)}}return r[t]=i}function ar(t){return Array.isArray(t)?t[0]instanceof qn?t:[Zn,t]:[t,void 0]}let ur=0;function cr(t,e){return t instanceof In?(he(t),t.l):Array.isArray(t)?de(t,e):void 0}function lr(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function hr(t,e,n,r,i){const o=n.g;let s,a;t[e]=(t,e,n)=>o(t,e,n,a||=sr(er,lr,hr,r).D,s||=fr(r),i)}function fr(t){let e=t[nr];if(null!=e)return e;const n=sr(er,lr,hr,t);return e=n.K?(t,e)=>ir(t,e,n):(t,e)=>{for(;pn(e)&&4!=e.i;){var r=e.m;let s=n[r];const a=null==s;let u=!1;if(null==s){var i=n.B;if(i){var o=i[r];o&&(u||=i.A?.[r],!d||u)&&(null!=(i=dr(o))&&(s=n[r]=i))}}null!=s&&s(e,t,r)||(r=(i=e).j,mn(i),i.J?i=void 0:(o=i.g.g-r,i.g.g=r,i=dn(i.g,o)),r=t,i&&(ft||=Symbol(),(o=r[ft])?o.push(i):r[ft]=[i])),a&&null!=s&&!u&&ur++<5&&G()}return!0},t[nr]=e}function dr(t){const e=(t=ar(t))[0].g;if(t=t[1]){const n=fr(t),r=sr(er,lr,hr,t).D;return(t,i,o)=>e(t,i,o,r,n)}return e}function gr(t,e,n){t[e]=n.i}function pr(t,e,n,r){let i,o;const s=n.i;t[e]=(t,e,n)=>s(t,e,n,o||=sr(tr,gr,pr,r).D,i||=mr(r))}function mr(t){let e=t[rr];if(!e){const n=sr(tr,gr,pr,t);e=(t,e)=>yr(t,e,n),t[rr]=e}return e}function yr(t,e,n){for(var r=Z(t),i=+!!(512&r)-1,o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=br(n,o);if(!a)continue;const u=n.B;u?.[o]&&!u?.A?.[o]&&ur++<5&&G(),a(e,r,o)}if(256&r){r=t[o-1];for(const t in r)i=+t,!Number.isNaN(i)&&(null!=(o=r[i])&&(a=br(n,i)))&&((s=n.B)?.[i]&&!s?.A?.[i]&&ur++<5&&G(),a(e,o,i))}if(t=ft?t[ft]:void 0)for(Fn(e,e.g.end()),n=0;n<t.length;n++)Fn(e,F(t[n])||new Uint8Array(0))}function br(t,e){var n=t[e];if(n)return n;if(n=t.B){var r=n[e];if(r){var i=(r=ar(r))[0].i;if(r=r[1],n=n?.A?.[e],!d||n){if(r){const e=mr(r),o=sr(tr,gr,pr,r).D;n=t.K?or(o,e):(t,n,r)=>i(t,n,r,o,e)}else n=i;return t[e]=n}}}}function vr(t,e){if(Array.isArray(e)){var n=Q(e);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),tt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}function wr(t,e,n){return new qn(t,e,n)}function _r(t,e,n){return new qn(t,e,n)}function Ar(t,e,n){Ue(t,Z(t),e,n)}function Sr(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(BigInt.asIntN(64,t));if(Dt(t)){if("string"===e)return $t(t);if("number"===e)return Rt(t)}}(e),null!=e){if("string"==typeof e)Nn(e);if(null!=e)switch(jn(t,n,0),typeof e){case"number":t=t.g,Ut(e),On(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new Bn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),On(t.g,n.i,n.g);break;default:n=Nn(e),On(t.g,n.i,n.g)}}}function Ir(t,e,n){null!=(e=Gt(e))&&null!=e&&(jn(t,n,0),kn(t.g,e))}function Er(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(jn(t,n,0),t.g.g.push(e?1:0))}function Tr(t,e,n){null!=(e=Kt(e))&&Gn(t,n,l(e))}function Pr(t,e,n,r,i){null!=(e=cr(e,r))&&(n=Mn(t,n),i(e,t),Dn(t,n))}function Ur(t,e,n){null!=(e=null==e||"string"==typeof e||x(e)||e instanceof j?e:void 0)&&Gn(t,n,nn(e).buffer)}var Nr=wr((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=an(r);const i=an(r);r=2*(i>>31)+1;const o=i>>>20&2047;return t=4294967296*(1048575&i)+t,Ar(e,n,2047==o?t?NaN:r*(1/0):0==o?5e-324*r*t:r*Math.pow(2,o-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=Ft(e))&&(jn(t,n,1),t=t.g,(n=It||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Et=n.getUint32(0,!0),Tt=n.getUint32(4,!0),Vn(t,Et),Vn(t,Tt))}),class{constructor(){}}),Br=wr((function(t,e,n){return 5===t.i&&(Ar(e,n,un(t.g)),!0)}),(function(t,e,n){null!=(e=Ft(e))&&(jn(t,n,5),t=t.g,Nt(e),Vn(t,Et))}),Hn),xr=_r((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ne(e,Z(e),n,2,!1),2==t.i?wn(t,un,e):e.push(un(t.g)),!0)}),(function(t,e,n){if(null!=(e=vr(Ft,e))&&e.length){jn(t,n,2),Ln(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Nt(e[r]),Vn(n,Et)}}),Hn),Or=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,rn(t.g,xt)),!0)}),Sr,zn),Lr=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,0===(t=rn(t.g,xt))?void 0:t),!0)}),Sr,zn),kr=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,rn(t.g,Bt)),!0)}),(function(t,e,n){if(null!=(e=zt(e))){if("string"==typeof e)Tn(e);if(null!=e)switch(jn(t,n,0),typeof e){case"number":t=t.g,Ut(e),On(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new Pn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),On(t.g,n.i,n.g);break;default:n=Tn(e),On(t.g,n.i,n.g)}}}),class{constructor(){}}),Vr=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,sn(t.g)),!0)}),Ir,Wn),Fr=_r((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ne(e,Z(e),n,2,!1),2==t.i?wn(t,sn,e):e.push(sn(t.g)),!0)}),(function(t,e,n){if(null!=(e=vr(Gt,e))&&e.length){n=Mn(t,n);for(let n=0;n<e.length;n++)kn(t.g,e[n]);Dn(t,n)}}),Wn),jr=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,0===(t=sn(t.g))?void 0:t),!0)}),Ir,Wn),Mr=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,on(t.g)),!0)}),Er,Rn),Dr=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,!1===(t=on(t.g))?void 0:t),!0)}),Er,Rn),Gr=_r((function(t,e,n){if(2!==t.i)return!1;t=bn(t);const r=Z(e);return ht(r),Ne(e,r,n,2).push(t),!0}),(function(t,e,n){if(null!=(e=vr(Kt,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&Gn(r,i,l(o))}}),$n),Cr=wr((function(t,e,n){return 2===t.i&&(Ar(e,n,""===(t=bn(t))?void 0:t),!0)}),Tr,$n),Rr=wr((function(t,e,n){return 2===t.i&&(Ar(e,n,bn(t)),!0)}),Tr,$n),$r=function(t,e,n=Cn){return new qn(t,e,n)}((function(t,e,n,r,i){if(2!==t.i)return!1;r=de(void 0,r);let o=Z(e);ht(o);let s=Ne(e,o,n,3);return o=Z(e),4&Q(s)&&(s=$(s),tt(s,-2079&(1|Q(s))),Ue(e,o,n,s)),s.push(r),yn(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)Pr(t,e[o],n,r,i)})),Wr=Xn((function(t,e,n,r,i,o){return 2===t.i&&(Me(e,Z(e),o,n),yn(t,e=Ge(e,r,n),i),!0)}),Pr),zr=wr((function(t,e,n){return 2===t.i&&(Ar(e,n,vn(t)),!0)}),Ur,Jn),Hr=wr((function(t,e,n){return 0===t.i&&(Ar(e,n,sn(t.g)),!0)}),(function(t,e,n){null!=(e=Gt(e))&&(e=parseInt(e,10),jn(t,n,0),kn(t.g,e))}),Kn);class Jr{constructor(t,e){this.i=t,this.g=e,this.j=ze,this.defaultValue=void 0}}function Kr(t,e){return(n,r)=>{if(_n.length){const t=_n.pop();t.s(r),ln(t.g,n,r),n=t}else n=new class{constructor(t,e){if(gn.length){const n=gn.pop();ln(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.u=0,ln(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.G=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.s(e)}s({J:t=!1}={}){this.J=t}}(n,r);try{const r=new t,o=r.l;fr(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,_n.length<100&&_n.push(n)}return i}}var qr=[0,Cr,wr((function(t,e,n){return 2===t.i&&(Ar(e,n,(t=vn(t))===V()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof In){const r=e.R;return void(r&&(e=r(e),null!=e&&Gn(t,n,nn(e).buffer)))}if(Array.isArray(e))return}Ur(t,e,n)}),Jn)],Xr=[0,Vr,Hr,Mr,-1,Fr,Hr,-1],Yr=class extends In{constructor(){super()}},Qr=[0,Mr,Rr,Mr,Hr,-1,_r((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ne(e,Z(e),n,2,!1),2==t.i?wn(t,cn,e):e.push(sn(t.g)),!0)}),(function(t,e,n){if(null!=(e=vr(Gt,e))&&e.length){n=Mn(t,n);for(let n=0;n<e.length;n++)kn(t.g,e[n]);Dn(t,n)}}),Kn),Rr,-1,[0,Mr,-1],Hr,Mr,-1],Zr=[0,Rr,-2],ti=class extends In{constructor(){super()}},ei=[0],ni=[0,Vr,Mr,1,Mr,-3],ri=[0,Rr,Mr,-1,Vr,[0,[1,2,3,4,5,6,7],Wr,ei,Wr,Qr,Wr,Zr,Wr,ni,Wr,Xr,Wr,[0,Rr,-2],Wr,[0,Rr,Hr]],[0,Rr],Mr,[0,[1,3],[2,4],Wr,[0,Fr],-1,Wr,[0,Gr],-1,$r,[0,Rr,-1]],Rr],ii=class extends In{constructor(t){super(t,2)}},oi={},si=oi.A={};oi[336783863]=ri,si[336783863]=1;var ai,ui=[0,Lr,-1,Dr,-3,Lr,Fr,Cr,jr,Lr,-1,Dr,jr,Dr,-2,Cr],ci=class extends In{constructor(t){super(t,500)}s(t){return ze(this,0,7,t)}},li=[-1,{A:{}}],hi=[0,Rr,1,li],fi=[0,Rr,Gr,li],di=class extends In{constructor(){super(void 0,500)}s(t){return ze(this,0,1001,t)}};di.prototype.g=(ai=[-500,$r,[-500,Cr,-1,Gr,-3,[-2,oi,Mr],$r,qr,jr,-1,hi,fi,$r,[0,Cr,Dr],Cr,ui,jr,Gr,987,Gr],4,$r,[-500,Rr,-1,[-1,{A:{}}],998,Rr],$r,[-500,Rr,Gr,-1,[-2,{A:{}},Mr],997,Gr,-1],jr,$r,[-500,Rr,Gr,li,998,Gr],Gr,jr,hi,fi,$r,[0,Cr,-1,li],Gr,-2,ui,Cr,-1,Dr,979,li,$r,qr],function(){he(this);const t=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};yr(this.l,t,sr(tr,gr,pr,ai)),Fn(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let i=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,i),i+=r.length}return t.j=[e],e});var gi=class extends In{constructor(t){super(t)}},pi=class extends In{constructor(t){super(t)}g(){return We(this,gi)}},mi=[0,$r,[0,Vr,Br,Rr,-1]],yi=class extends In{constructor(t){super(t)}},bi=class extends In{constructor(t){super(t)}},vi=[1,2,3,4,5],wi=class extends In{constructor(t){super(t)}g(){return null!=Be(this)}i(){return null!=Kt(Ie(this,2))}},_i=class extends In{constructor(t){super(t)}},Ai=class extends In{constructor(t){super(t)}},Si=[0,[0,zr,Rr,[0,Vr,Or,-1],[0,kr,Or]],Mr,[0,vi,Wr,ni,Wr,Qr,Wr,Xr,Wr,ei,Wr,Zr],Hr],Ii=new Jr(451755788,Ai);oi[451755788]=[0,Si,[0,Rr,Vr,Br,Gr,-1],Nr],si[451755788]=1;var Ei=class extends In{constructor(t){super(t)}},Ti=class extends In{constructor(t){super(t)}},Pi=new Jr(487277289,Ti);oi[487277289]=[0,Si,[0,Mr,-1]],si[487277289]=1;var Ui=class extends In{constructor(t){super(t)}},Ni=Kr(class extends In{constructor(t){super(t)}},[0,$r,[0,1,Vr,Rr,mi],Or]),Bi=class extends In{constructor(t){super(t)}},xi=class extends In{constructor(t){super(t)}L(){const t=Be(this);return null==t?V():t}},Oi=class extends In{constructor(t){super(t)}},Li=[1,2],ki=Kr(class extends In{constructor(t){super(t)}},[0,$r,[0,Li,Wr,[0,xr],Wr,[0,zr],Vr,Rr],Or]);function Vi(){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 Fi(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 ji(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.h.stringToNewUTF8(e)),t.h._free(e)}function Mi(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.h.stringToNewUTF8(e[n]);e=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.h._free(e);t.h._free(e)}function Di(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Gi(t,e,n){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}const Ci=function(t){return class extends t{O(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==e?this.h.canvas=e:Vi()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.h._malloc(n);this.h.HEAPU8.set(t,r),e?this.h._changeBinaryGraph(n,r):this.h._changeTextGraph(n,r),this.h._free(r)}configureAudio(t,e,n,r,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),ji(this,r||"input_audio",(r=>{ji(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e??0,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),ji(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){ji(this,e,(e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();const r=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[i,o]=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];!this.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);const[s,a]=[i,o];this.h._addBoundTextureToStream(e,s,a,n)}))}addBoolToStream(t,e,n){ji(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){ji(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){ji(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){ji(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){ji(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){ji(this,e,(e=>{ji(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){ji(this,e,(e=>{Mi(this,Object.keys(t),(r=>{Mi(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){ji(this,n,(n=>{ji(this,e,(e=>{const i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,n,r),this.h._free(i)}))}))}addEmptyPacketToStream(t,e){ji(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputStream(r,e,n)}))}addUintVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(r,e);this.h._addUintVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)ji(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){ji(this,e,(e=>{ji(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){ji(this,n,(n=>{ji(this,e,(e=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,e,n),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputSidePacket(n,e)}))}addUintVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(n,e);this.h._addUintVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)ji(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Di(this,t,e),ji(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Gi(this,t,e),ji(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){Di(this,t,e),ji(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Gi(this,t,e),ji(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){Di(this,t,e),ji(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Gi(this,t,e),ji(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Di(this,t,e),ji(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Gi(this,t,e),ji(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Di(this,t,e),ji(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Gi(this,t,e),ji(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){Di(this,t,e),ji(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Gi(this,t,e),ji(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Di(this,t,e),ji(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Gi(this,t,e),ji(this,t,(t=>{this.h._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Di(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),ji(this,t,(t=>{this.h._attachAudioListener(t,n||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var Ri=class extends Ci{};async function $i(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Fi(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Fi(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.s(n),t}async function Wi(t,e,n){return $i(t,e,n)}function zi(t,e){const n=Re(t.baseOptions,wi,1)||new wi;"string"==typeof e?(Pe(n,2,Jt(e)),Pe(n,1)):e instanceof Uint8Array&&(Pe(n,1,ut(e,!1,!1)),Pe(n,2)),ze(t.baseOptions,0,1,n)}function Hi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Re(t.baseOptions,wi,1)?.g()||Re(t.baseOptions,wi,1)?.i()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=Re(t.baseOptions,bi,3);if(!n){var r=n=new bi;He(r,4,new ti)}"delegate"in e&&("GPU"===e.delegate?He(e=n,2,r=new Yr):He(e=n,4,r=new ti)),ze(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath)return fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${t.status})`)})).then((e=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),zi(t,"/model.dat"),t.C()}));if(n.modelAssetBuffer instanceof Uint8Array)zi(t,n.modelAssetBuffer);else if(n.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}(n.modelAssetBuffer).then((e=>{zi(t,e),t.C()}));return t.C(),Promise.resolve()}function Ji(t){try{const e=t.j.length;if(1===e)throw Error(t.j[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.j.map((t=>t.message)).join(", "))}finally{t.j=[]}}function Ki(t,e){t.u=Math.max(t.u,e)}var qi=class{constructor(t){this.g=t,this.j=[],this.u=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.j.push(Error(e))})),this.g.O(),this.g.setGraph(t,e),Ji(this)}finishProcessing(){this.g.finishProcessing(),Ji(this)}close(){this.g.closeGraph()}};async function Xi(t,e,n){return Wi(t,e,n)}qi.prototype.close=qi.prototype.close,n("TaskRunner",qi);var Yi=class extends qi{constructor(){super(...arguments),this.I=48e3}P(t){this.I=t}};function Qi(t){const e={classifications:We(t,Ui).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=Xe(Gt(Ie(t,1)),0)??-1;const n=t.l;let r=Z(n);const i=Te(n,r,2),o=Ft(i);return null!=o&&o!==i&&Ue(n,r,2,o),{index:e,score:o??0??0,categoryName:Xe(Kt(Ie(t,3)),"")??"",displayName:Xe(Kt(Ie(t,4)),"")??""}})),headIndex:e,headName:n}}(Re(t,pi,4)?.g()??[],Xe(Gt(Ie(t,2)),0),Xe(Kt(Ie(t,3)),""))))};return null!=Wt(Ie(t,2))&&(e.timestampMs=Xe(Wt(Ie(t,2)),0)),e}Yi.prototype.setDefaultSampleRate=Yi.prototype.P,n("AudioTaskRunner",Yi);var Zi=class extends Yi{constructor(t,e){super(new Ri(t,e)),this.m=[],ze(t=this.i=new Ai,0,1,e=new _i)}get baseOptions(){return Re(this.i,_i,1)}set baseOptions(t){ze(this.i,0,1,t)}s(t){var e=this.i,n=Re(this.i,yi,2);if(n=n?ve(n):new yi,void 0!==t.displayNamesLocale?Pe(n,1,Jt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Pe(n,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw C();if(!Number.isFinite(r))throw C();r|=0}Pe(n,2,r)}else"maxResults"in t&&Pe(n,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Pe(n,3,r)}else"scoreThreshold"in t&&Pe(n,3);return void 0!==t.categoryAllowlist?Ye(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&Pe(n,4),void 0!==t.categoryDenylist?Ye(n,5,t.categoryDenylist):"categoryDenylist"in t&&Pe(n,5),ze(e,0,2,n),Hi(this,t)}M(t,e){return this.H(t,e??this.I,this.u+1)}H(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),[...this.m]}C(){var t=new di;Qe(t,10,"audio_in"),Qe(t,10,"sample_rate"),Qe(t,15,"timestamped_classifications");const e=new ii;Sn(e,Ii,this.i);const n=new ci;Ve(n,Jt("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),Qe(n,3,"AUDIO:audio_in"),Qe(n,3,"SAMPLE_RATE:sample_rate"),Qe(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.s(e),qe(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=Ni(e),t.m.push(Qi(e))}))}(this,t),Ki(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{Ki(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function to(t){return{embeddings:We(t,Oi).map((t=>{const e={headIndex:Xe(Gt(Ie(t,3)),0)??-1,headName:Xe(Kt(Ie(t,4)),"")??""};if(void 0!==Ce(t,Bi,Fe(t,1)))e.floatEmbedding=xe(Re(t,Bi,Fe(t,1)),1,Ft,void 0===gt?2:5).slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=Re(t,xi,Fe(t,2))?.L()?.i()??n}return e})),timestampMs:Xe(Wt(Ie(t,2)),0)}}Zi.prototype.classify=Zi.prototype.M,Zi.prototype.setOptions=Zi.prototype.s,Zi.createFromModelPath=function(t,e){return Wi(Zi,t,{baseOptions:{modelAssetPath:e}})},Zi.createFromModelBuffer=function(t,e){return Xi(Zi,t,{baseOptions:{modelAssetBuffer:e}})},Zi.createFromOptions=function(t,e){return Xi(Zi,t,e)};var eo=class extends Yi{constructor(t,e){super(new Ri(t,e)),this.m=[],ze(t=this.i=new Ti,0,1,e=new _i)}get baseOptions(){return Re(this.i,_i,1)}set baseOptions(t){ze(this.i,0,1,t)}s(t){var e=this.i,n=Re(this.i,Ei,2);return n=n?ve(n):new Ei,void 0!==t.l2Normalize?Pe(n,1,jt(t.l2Normalize)):"l2Normalize"in t&&Pe(n,1),void 0!==t.quantize?Pe(n,2,jt(t.quantize)):"quantize"in t&&Pe(n,2),ze(e,0,2,n),Hi(this,t)}N(t,e){return this.H(t,e??this.I,this.u+1)}H(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),this.m}C(){var t=new di;Qe(t,10,"audio_in"),Qe(t,10,"sample_rate"),Qe(t,15,"embeddings_out"),Qe(t,15,"timestamped_embeddings_out");const e=new ii;Sn(e,Pi,this.i);const n=new ci;Ve(n,Jt("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),Qe(n,3,"AUDIO:audio_in"),Qe(n,3,"SAMPLE_RATE:sample_rate"),Qe(n,4,"EMBEDDINGS:embeddings_out"),Qe(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.s(e),qe(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=ki(t),this.m.push(to(t)),Ki(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Ki(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=ki(e),this.m.push(to(t));Ki(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{Ki(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let no;eo.prototype.embed=eo.prototype.N,eo.prototype.setOptions=eo.prototype.s,eo.createFromModelPath=function(t,e){return Xi(eo,t,{baseOptions:{modelAssetPath:e}})},eo.createFromModelBuffer=function(t,e){return Xi(eo,t,{baseOptions:{modelAssetBuffer:e}})},eo.createFromOptions=function(t,e){return Xi(eo,t,e)};const ro=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===no)try{await WebAssembly.instantiate(ro),no=!0}catch{no=!1}return no}async function oo(t,e=""){const n=await io()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var so=class{};so.forVisionTasks=function(t){return oo("vision",t)},so.forTextTasks=function(t){return oo("text",t)},so.forGenAiExperimentalTasks=function(t){return oo("genai_experimental",t)},so.forGenAiTasks=function(t){return oo("genai",t)},so.forAudioTasks=function(t){return oo("audio",t)},so.isSimdSupported=function(){return io()},exports.AudioClassifier=Zi,exports.AudioEmbedder=eo,exports.FilesetResolver=so;
|
|
2
2
|
//# sourceMappingURL=audio_bundle_cjs.js.map
|