@mediapipe/tasks-audio 0.10.19 → 0.10.20-rc.20241213
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(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let r,i;const o="undefined"!=typeof TextDecoder;let s;const a="undefined"!=typeof TextEncoder;function u(t){if(a)t=(s||=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 c,l;t:{for(var h=["CLOSURE_FLAGS"],f=t,d=0;d<h.length;d++)if(null==(f=f[h[d]])){l=null;break t}l=f}var g,p=l&&l[610401301];c=null!=p&&p;const m=t.navigator;function y(t){return!!c&&(!!g&&g.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function b(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function v(){return!!c&&(!!g&&g.brands.length>0)}function w(){return v()?y("Chromium"):(b("Chrome")||b("CriOS"))&&!(!v()&&b("Edge"))||b("Silk")}g=m&&m.userAgentData||null;var _=!v()&&(b("Trident")||b("MSIE"));!b("Android")||w(),w(),b("Safari")&&(w()||!v()&&b("Coast")||!v()&&b("Opera")||!v()&&b("Edge")||(v()?y("Microsoft Edge"):b("Edg/"))||v()&&y("Opera"));var S={},A=null;function I(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let i=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=A[e];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}E();let r=0;for(;;){const t=n(-1),r=n(0),i=n(64),o=n(64);if(64===o&&-1===t)break;e(t<<2|r>>4),64!=i&&(e(r<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function E(){if(!A){A={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));S[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===A[e]&&(A[e]=t)}}}}var T="undefined"!=typeof Uint8Array,P=!_&&"function"==typeof btoa;function U(t){if(!P){var e;void 0===e&&(e=0),E(),e=S[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 B=/[-_.]/g,x={"-":"+",_:"/",".":"="};function L(t){return x[t]||""}function N(t){if(!P)return I(t);B.test(t)&&(t=t.replace(B,L)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function O(t){return T&&null!=t&&t instanceof Uint8Array}var k={};function V(){return M||=new j(null,k)}function F(t){C(k);var e=t.g;return null==(e=null==e||O(e)?e:"string"==typeof e?N(e):null)?e:t.g=e}var j=class{i(){return new Uint8Array(F(this)||0)}constructor(t,e){if(C(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let M,D;function C(t){if(t!==k)throw Error("illegal external caller")}function G(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function R(){const e=Error();G(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function $(){const t=Error("int32");return G(t,"warning"),t}function W(){return"function"==typeof BigInt}function z(t){return Array.prototype.slice.call(t)}var H="function"==typeof Symbol&&"symbol"==typeof Symbol();function J(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var q=J(),K=J("2ex"),X=J("1oa"),Y=H?(t,e)=>{t[q]|=e}:(t,e)=>{void 0!==t.o?t.o|=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Q=H?(t,e)=>{t[q]&=~e}:(t,e)=>{void 0!==t.o&&(t.o&=~e)},Z=H?t=>0|t[q]:t=>0|t.o,tt=H?t=>t[q]:t=>t.o,et=H?(t,e)=>{t[q]=e}:(t,e)=>{void 0!==t.o?t.o=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function nt(t,e){et(e,-30975&(0|t))}function rt(t,e){et(e,-30941&(34|t))}var it,ot={},st={};function at(t){return!(!t||"object"!=typeof t||t.g!==st)}function ut(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ct(t,e){if(null!=t)if("string"==typeof t)t=t?new j(t,k):V();else if(t.constructor!==j)if(O(t))t=t.length?new j(new Uint8Array(t),k):V();else{if(!e)throw Error();t=void 0}return t}function lt(t){return!(!Array.isArray(t)||t.length)&&!!(1&Z(t))}const ht=[];function ft(t){if(2&t)throw Error()}let dt;function gt(t,e){(e=dt?e[dt]:void 0)&&(t[dt]=z(e))}et(ht,55),it=Object.freeze(ht);var pt=Object.freeze({}),mt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),yt=t=>mt?t>=vt&&t<=_t:"-"===t[0]?St(t,bt):St(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 St(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 At="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 Bt(t){const e=It||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Tt=0,Et=e.getUint32(0,!0)}function xt(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:Nt(t,e)}function Lt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),"number"==typeof(t=xt(t,e))?n?-t:t:n?"-"+t:t}function Nt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else W()?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+Ot(n)+Ot(t));return n}function Ot(t){return t=String(t),"0000000".slice(t.length)+t}function kt(t){if(t.length<16)Ut(Number(t));else if(W())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 Ct(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 Gt(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=Lt(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(W())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Vt(t,e);t="-"+Nt(n,r)}else t=Nt(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)),Gt(t)||(kt(t),t=Nt(Et,Tt))),t;if("number"===e)return(t=Math.trunc(t))>=0&&Number.isSafeInteger(t)?t:function(t){if(t<0){Ut(t);var e=Nt(Et,Tt);return t=Number(e),Number.isSafeInteger(t)?t:e}return Gt(e=String(t))?e:(Ut(t),xt(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.C===ot)return t;if(Array.isArray(t)){var r=Z(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&et(t,i),new e(t)}}function Xt(t){var e;return void 0===Zt&&(Zt="function"==typeof Proxy?oe(Proxy):null),(e=!Zt)||(void 0===te&&(te="function"==typeof WeakMap?oe(WeakMap):null),e=!te),e?t:(e=Yt?.get(t))?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),function(t,e){(Yt||=new te).set(t,e),(Qt||=new te).set(e,t)}(t,e=new Zt(t,{set:(t,e,n)=>(R(),t[e]=n,!0)})),e)}let Yt,Qt,Zt,te,ee,ne,re,ie;function oe(t){try{return-1!==t.toString().indexOf("[native code]")?t:null}catch{return null}}function se(t,e,n){return t=ae(t,e[0],e[1],n?1:2),e!==re&&n&&Y(t,16384),t}function ae(t,e,n,r){if(r=r??0,null==t&&(t=ne),ne=void 0,null==t){var i=96;n?(t=[n],i|=512):t=[],e&&(i=-33521665&i|(1023&e)<<15)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(i=Z(t)))throw Error("farr");if(64&i)return t;if(1===r||2===r||(i|=64),n&&(i|=512,n!==t[0]))throw Error("mid");t:{if(r=(n=t).length){const t=r-1;if(ut(n[t])){if((e=t-(+!!(512&(i|=256))-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&e)<<15;break t}}if(e){if((e=Math.max(e,r-(+!!(512&i)-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&e)<<15}}}return et(t,i),t}function ue(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=lt(t)?void 0:i&&2&Z(t)?t:ce(t,e,n,void 0!==r,i);else if(ut(t)){const o={};for(let s in t)o[s]=ue(t[s],e,n,r,i);t=o}else t=e(t,r);return t}}function ce(t,e,n,r,i){const o=r||n?Z(t):0;r=r?!!(32&o):void 0;const s=z(t);for(let t=0;t<s.length;t++)s[t]=ue(s[t],e,n,r,i);return n&&(gt(s,t),n(o,s)),s}function le(t){return t.C===ot?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(lt(t))return}else{if(O(t))return U(t);if(t instanceof j){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=U(e)}}}return t}(t)}function he(t,e,n=rt){if(null!=t){if(T&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Z(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(et(t,-12293&(34|r)),t):ce(t,he,4&r?rt:n,!0,!0))}return t.C===ot&&(n=t.l,t=2&(r=tt(n))?t:de(t,n,r,!0)),t}}function fe(t){const e=t.l;return de(t,e,tt(e),!1)}function de(t,e,n,r){return t=t.constructor,ne=e=ge(e,n,r),e=new t(e),ne=void 0,e}function ge(t,e,n){const r=n||2&e?rt:nt,i=!!(32&e);return t=function(t,e,n){const r=z(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 gt(r,t),r}(t,e,(t=>he(t,i,r))),Y(t,32|(n?2:0)),t}function pe(t){const e=t.l,n=tt(e);return 2&n?de(t,e,n,!1):t}function me(t,e){return be(t=t.l,tt(t),e)}function ye(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function be(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])?(ye(t,e,i,n)&&null!=K&&((e=(t=D??={})[K]||0)>=4||(t[K]=e+1,R())),r):ye(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function ve(t,e,n){const r=t.l;let i=tt(r);return ft(i),we(r,i,e,n),t}function we(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&&et(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function _e(t){t=t.l;let e=tt(t);const n=be(t,e,1),r=ct(n,!0);return null!=r&&r!==n&&we(t,e,1,r),r}function Se(t,e,n,r,i){const o=t.l,s=2&(t=tt(o))?1:r;i=!!i,r=Ae(o,t,e);var a=Z(r);if(!(4&a)){4&a&&(r=z(r),a=Ce(a,t),t=we(o,t,e,r));let i=0,s=0;for(;i<r.length;i++){const t=n(r[i]);null!=t&&(r[s++]=t)}s<i&&(r.length=s),a=-4097&(20|(a=Ie(a,t))),et(r,a&=-8193),2&a&&Object.freeze(r)}let u;return 1===s||4===s&&32&a?Ee(a)||(i=a,(a|=2)!==i&&et(r,a),Object.freeze(r)):(n=5===s&&(!!(32&a)||Ee(a)||!!Yt?.get(r)),(2===s||n)&&Ee(a)&&(r=z(r),a=Ge(a=Ce(a,t),t,i),et(r,a),t=we(o,t,e,r)),Ee(a)||(e=a,(a=Ge(a,t,i))!==e&&et(r,a)),n?u=Xt(r):2!==s||i||Yt?.delete(r)),u||r}function Ae(t,e,n,r){return t=be(t,e,n,r),Array.isArray(t)?t:it}function Ie(t,e){return 0===t&&(t=Ce(t,e)),1|t}function Ee(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Te(t,e,n){t=t.l;let r=tt(t);if(ft(r),null==n)we(t,r,e);else{n=Qt?.get(n)||n;var i=Z(n),o=i,s=!!(4&i),a=Ee(i),u=a||Object.isFrozen(n);if(a||(i=0),u||(n=z(n),o=0,i=Ge(i=Ce(i,r),r,!0),u=!1),i|=21,!s)for(s=0;s<n.length;s++){const t=Ht(a=n[s]);Object.is(a,t)||(u&&(n=z(n),o=0,i=Ge(i=Ce(i,r),r,!0),u=!1),n[s]=t)}i!==o&&(u&&(n=z(n),i=Ge(i=Ce(i,r),r,!0)),et(n,i)),we(t,r,e,n)}}function Pe(t,e){t=t.l;let n=tt(t);ft(n),we(t,n,2,""===e?void 0:e)}function Ue(t,e,n,r,i){ft(e);var o=!(!(64&e)&&16384&e);const s=(i=Ae(t,e,n,i))!==it;if(o||!s){let a=o=s?Z(i):0;(!s||2&a||Ee(a)||4&a&&!(32&a))&&(i=z(i),a=Ce(a,e),e=we(t,e,n,i)),a=-13&Ie(a,e),a=Ge(r?-17&a:16|a,e,!0),a!==o&&et(i,a)}return i}function Be(t,e){var n=Ui;return Ne(xe(t=t.l),t,tt(t),n)===e?e:-1}function xe(t){if(H)return t[X]??(t[X]=new Map);if(X in t)return t[X];const e=new Map;return Object.defineProperty(t,X,{value:e}),e}function Le(t,e,n,r){const i=xe(t),o=Ne(i,t,e,n);return o!==r&&(o&&(e=we(t,e,o)),i.set(n,r)),e}function Ne(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!=be(e,n,o)&&(0!==i&&(n=we(e,n,i)),i=o)}return t.set(r,i),i}function Oe(t,e,n,r){let i,o=tt(t);if(null!=(r=be(t,o,n,r))&&r.C===ot)return(e=pe(r))!==r&&we(t,o,n,e),e.l;if(Array.isArray(r)){const t=Z(r);i=2&t?se(ge(r,t,!1),e,!0):64&t?r:se(i,e,!0)}else i=se(void 0,e,!0);return i!==r&&we(t,o,n,i),i}function ke(t,e,n,r){t=t.l;let i=tt(t);return(e=Kt(r=be(t,i,n,r),e,i))!==r&&null!=e&&we(t,i,n,e),e}function Ve(t,e,n){if(null==(e=ke(t,e,n,!1)))return e;t=t.l;let r=tt(t);if(!(2&r)){const i=pe(e);i!==e&&we(t,r,n,e=i)}return e}function Fe(t,e,n,r,i,o){t=t.l;var s=!!(2&e);r=s?1:r,i=!!i,o&&=!s,s=Ae(t,e,1);var a=Z(s),u=!!(4&a);if(!u){var c=s,l=e;const t=!!(2&(a=Ie(a,e)));t&&(l|=2);let r=!t,i=!0,o=0,u=0;for(;o<c.length;o++){const e=Kt(c[o],n,l);if(e instanceof n){if(!t){const t=!!(2&Z(e.l));r&&=!t,i&&=t}c[u++]=e}}u<o&&(c.length=u),a|=4,a=i?16|a:-17&a,et(c,a=r?8|a:-9&a),t&&Object.freeze(c)}if(o&&!(8&a||!s.length&&(1===r||4===r&&32&a))){for(Ee(a)&&(s=z(s),a=Ce(a,e),e=we(t,e,1,s)),n=s,o=a,c=0;c<n.length;c++)(a=n[c])!==(l=pe(a))&&(n[c]=l);o|=8,o=n.length?-17&o:16|o,et(n,o),a=o}let h;return 1===r||4===r&&32&a?Ee(a)||(e=a,(a|=!s.length||16&a&&(!u||32&a)?2:2048)!==e&&et(s,a),Object.freeze(s)):(u=5===r&&(!!(32&a)||Ee(a)||!!Yt?.get(s)),(2===r||u)&&Ee(a)&&(s=z(s),a=Ge(a=Ce(a,e),e,i),et(s,a),e=we(t,e,1,s)),Ee(a)||(t=a,(a=Ge(a,e,i))!==t&&et(s,a)),u?h=Xt(s):2!==r||i||Yt?.delete(s)),h||s}function je(t,e){const n=tt(t.l);return Fe(t,n,e,void 0===pt?2:4,!1,!(2&n))}function Me(t,e,n,r){return null==r&&(r=void 0),ve(t,n,r)}function De(t,e,n){var r=gi;null==n&&(n=void 0);t:{t=t.l;let i=tt(t);if(ft(i),null==n){const n=xe(t);if(Ne(n,t,i,r)!==e)break t;n.set(r,0)}else i=Le(t,i,r,e);we(t,i,e,n)}}function Ce(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function Ge(t,e,n){return 32&e&&n||(t&=-33),t}function Re(t,e){var n=ii;const r=tt(t.l);ft(r),t=Fe(t,r,n,2,!0),e=null!=e?e:new n,t.push(e),2&Z(e.l)?Q(t,8):Q(t,16)}function $e(t,e){return t??e}function We(t,e,n){ft(tt(t.l)),Se(t,e,qt,2,!0).push(Ht(n))}function ze(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function He(){return Error("Failed to read varint, encoding is invalid.")}function Je(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function qe(t){if("string"==typeof t)return{buffer:N(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 Ke(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(nn(t,a),n<128)return e(r>>>0,i>>>0);throw He()}function Xe(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 nn(t,n),!!(127&e)}throw He()}function Ye(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 He();return nn(t,n),i}function Qe(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],nn(t,t.g+4),(r<<0|i<<8|o<<16|e<<24)>>>0}function Ze(t){var e=Qe(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 tn(t){return Ye(t)}function en(t,e,{D:n=!1}={}){t.D=n,e&&(e=qe(e),t.i=e.buffer,t.m=e.v,t.u=0,t.j=t.i.length,t.g=t.u)}function nn(t,e){if(t.g=e,e>t.j)throw Je(t.j,e)}function rn(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 Je(e,t.j-n);return t.g=r,n}function on(t,e){if(0==e)return V();var n=rn(t,e);return t.D&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?new Uint8Array(0):At?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?V():new j(n,k)}var sn=[];function an(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=Ye(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 un(t){switch(t.i){case 0:0!=t.i?un(t):Xe(t.g);break;case 1:nn(t=t.g,t.g+8);break;case 2:if(2!=t.i)un(t);else{var e=Ye(t.g)>>>0;nn(t=t.g,t.g+e)}break;case 5:nn(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!an(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}un(t)}break;default:throw ze(t.i,t.j)}}function cn(t,e,n){const r=t.g.j,i=Ye(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 ln(t){var s=Ye(t.g)>>>0,a=rn(t=t.g,s);if(t=t.i,o){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),s=a+s,c=0===a&&s===c.length?c:c.subarray(a,s);try{var l=u.decode(c)}catch(t){if(void 0===r){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),r=!0}catch(t){r=!1}}throw!r&&(i=void 0),t}}else{s=(l=a)+s,a=[];let r,i=null;for(;l<s;){var h=t[l++];h<128?a.push(h):h<224?l>=s?e():(r=t[l++],h<194||128!=(192&r)?(l--,e()):a.push((31&h)<<6|63&r)):h<240?l>=s-1?e():(r=t[l++],128!=(192&r)||224===h&&r<160||237===h&&r>=160||128!=(192&(u=t[l++]))?(l--,e()):a.push((15&h)<<12|(63&r)<<6|63&u)):h<=244?l>=s-2?e():(r=t[l++],128!=(192&r)||r-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,e()):(h=(7&h)<<18|(63&r)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):e(),a.length>=8192&&(i=n(i,a),a.length=0)}l=n(i,a)}return l}function hn(t){const e=Ye(t.g)>>>0;return on(t.g,e)}function fn(t,e,n){var r=Ye(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var dn=[];let gn;function pn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var mn=class{constructor(t,e){this.l=ae(t,e)}toJSON(){return yn(this)}v(){return!!(2&Z(this.l))}};function yn(t){t=t.l,t=gn?t:ce(t,le,void 0,void 0,!1);{var e=!gn;let c=t.length;if(c){var n=t[c-1],r=ut(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)&&(lt(r)||at(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])||lt(o)||at(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 bn(t){return t?/^\d+$/.test(t)?(kt(t),new vn(Et,Tt)):null:wn||=new vn(0,0)}mn.prototype.C=ot,mn.prototype.toString=function(){try{return gn=!0,yn(this).toString()}finally{gn=!1}};var vn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let wn;function _n(t){return t?/^-?\d+$/.test(t)?(kt(t),new Sn(Et,Tt)):null:An||=new Sn(0,0)}var Sn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let An;function In(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 En(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Tn(t,e){if(e>=0)En(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Pn(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 Un(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Bn(t,e,n){En(t.g,8*e+n)}function xn(t,e){return Bn(t,e,2),e=t.g.end(),Un(t,e),e.push(t.i),e}function Ln(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 Nn(t,e,n){Bn(t,e,2),En(t.g,n.length),Un(t,t.g.end()),Un(t,n)}function On(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var kn=On(),Vn=On(),Fn=On(),jn=On(),Mn=On(),Dn=On(),Cn=On(),Gn=On(),Rn=class{constructor(t,e,n){this.g=t,this.i=e,t=kn,this.j=!!t&&n===t||!1}};function $n(t,e){return new Rn(t,e,kn)}function Wn(t,e,n,r,i){null!=(e=er(e,r))&&(n=xn(t,n),i(e,t),Ln(t,n))}const zn=$n((function(t,e,n,r,i){return 2===t.i&&(cn(t,Oe(e,r,n),i),!0)}),Wn),Hn=$n((function(t,e,n,r,i){return 2===t.i&&(cn(t,Oe(e,r,n,!0),i),!0)}),Wn);var Jn=Symbol(),qn=Symbol(),Kn=Symbol(),Xn=Symbol();let Yn,Qn;function Zn(t,e,n,r){var i=r[t];if(i)return i;(i={}).B=function(t){switch(typeof t){case"boolean":return re||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ie||=[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.I=o,"function"==typeof(o=r[++s])&&(i.J=!0,Yn??=o,Qn??=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 Rn?t=o:(t=zn,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 tr(t){return Array.isArray(t)?t[0]instanceof Rn?t:[Hn,t]:[t,void 0]}function er(t,e){return t instanceof mn?t.l:Array.isArray(t)?se(t,e,!1):void 0}function nr(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function rr(t,e,n,r,i){const o=n.g;let s,a;t[e]=(t,e,n)=>o(t,e,n,a||=Zn(qn,nr,rr,r).B,s||=ir(r),i)}function ir(t){let e=t[Kn];if(null!=e)return e;const n=Zn(qn,nr,rr,t);return e=n.J?(t,e)=>Yn(t,e,n):(t,e)=>{const r=tt(t);for(;an(e)&&4!=e.i;){var i=e.m,o=n[i];if(null==o){var s=n.I;s&&(s=s[i])&&(null!=(s=or(s))&&(o=n[i]=s))}null!=o&&o(e,t,i)||(i=(o=e).j,un(o),o.H?o=void 0:(s=o.g.g-i,o.g.g=i,o=on(o.g,s)),i=t,o&&(dt||=Symbol(),(s=i[dt])?s.push(o):i[dt]=[o]))}return 16384&r&&Y(t,34),!0},t[Kn]=e}function or(t){const e=(t=tr(t))[0].g;if(t=t[1]){const n=ir(t),r=Zn(qn,nr,rr,t).B;return(t,i,o)=>e(t,i,o,r,n)}return e}function sr(t,e,n){t[e]=n.i}function ar(t,e,n,r){let i,o;const s=n.i;t[e]=(t,e,n)=>s(t,e,n,o||=Zn(Jn,sr,ar,r).B,i||=ur(r))}function ur(t){let e=t[Xn];if(!e){const n=Zn(Jn,sr,ar,t);e=(t,e)=>cr(t,e,n),t[Xn]=e}return e}function cr(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=lr(n,o);a&&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=lr(n,i))&&a(e,o,i)}if(t=dt?t[dt]:void 0)for(Un(e,e.g.end()),n=0;n<t.length;n++)Un(e,F(t[n])||new Uint8Array(0))}function lr(t,e){var n=t[e];if(n)return n;if((n=t.I)&&(n=n[e])){var r=(n=tr(n))[0].i;if(n=n[1]){const e=ur(n),i=Zn(Jn,sr,ar,n).B;n=t.J?Qn(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}function hr(t,e){if(Array.isArray(e)){var n=Z(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),et(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}function fr(t,e,n){return new Rn(t,e,n)}function dr(t,e,n){return new Rn(t,e,n)}function gr(t,e,n){we(t,tt(t),e,n)}function pr(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)_n(e);if(null!=e)switch(Bn(t,n,0),typeof e){case"number":t=t.g,Ut(e),In(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new Sn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),In(t.g,n.i,n.g);break;default:n=_n(e),In(t.g,n.i,n.g)}}}function mr(t,e,n){null!=(e=Ct(e))&&null!=e&&(Bn(t,n,0),Tn(t.g,e))}function yr(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Bn(t,n,0),t.g.g.push(e?1:0))}function br(t,e,n){null!=(e=qt(e))&&Nn(t,n,u(e))}function vr(t,e,n,r,i){null!=(e=er(e,r))&&(n=xn(t,n),i(e,t),Ln(t,n))}function wr(t,e,n){null!=(e=null==e||"string"==typeof e||O(e)||e instanceof j?e:void 0)&&Nn(t,n,qe(e).buffer)}var _r=fr((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=Qe(r);const i=Qe(r);r=2*(i>>31)+1;const o=i>>>20&2047;return t=4294967296*(1048575&i)+t,gr(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))&&(Bn(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),Pn(t,Et),Pn(t,Tt))}),On()),Sr=fr((function(t,e,n){return 5===t.i&&(gr(e,n,Ze(t.g)),!0)}),(function(t,e,n){null!=(e=Ft(e))&&(Bn(t,n,5),t=t.g,Bt(e),Pn(t,Et))}),Dn),Ar=dr((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ue(e,tt(e),n,!1,!1),2==t.i?fn(t,Ze,e):e.push(Ze(t.g)),!0)}),(function(t,e,n){if(null!=(e=hr(Ft,e))&&e.length){Bn(t,n,2),En(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Bt(e[r]),Pn(n,Et)}}),Dn),Ir=fr((function(t,e,n){return 0===t.i&&(gr(e,n,Ke(t.g,Lt)),!0)}),pr,Mn),Er=fr((function(t,e,n){return 0===t.i&&(gr(e,n,0===(t=Ke(t.g,Lt))?void 0:t),!0)}),pr,Mn),Tr=fr((function(t,e,n){return 0===t.i&&(gr(e,n,Ke(t.g,xt)),!0)}),(function(t,e,n){if(null!=(e=zt(e))){if("string"==typeof e)bn(e);if(null!=e)switch(Bn(t,n,0),typeof e){case"number":t=t.g,Ut(e),In(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new vn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),In(t.g,n.i,n.g);break;default:n=bn(e),In(t.g,n.i,n.g)}}}),On()),Pr=fr((function(t,e,n){return 0===t.i&&(gr(e,n,Ye(t.g)),!0)}),mr,jn),Ur=dr((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ue(e,tt(e),n,!1,!1),2==t.i?fn(t,Ye,e):e.push(Ye(t.g)),!0)}),(function(t,e,n){if(null!=(e=hr(Ct,e))&&e.length){n=xn(t,n);for(let n=0;n<e.length;n++)Tn(t.g,e[n]);Ln(t,n)}}),jn),Br=fr((function(t,e,n){return 0===t.i&&(gr(e,n,0===(t=Ye(t.g))?void 0:t),!0)}),mr,jn),xr=fr((function(t,e,n){return 0===t.i&&(gr(e,n,Xe(t.g)),!0)}),yr,Vn),Lr=fr((function(t,e,n){return 0===t.i&&(gr(e,n,!1===(t=Xe(t.g))?void 0:t),!0)}),yr,Vn),Nr=dr((function(t,e,n){return 2===t.i&&(t=ln(t),Ue(e,tt(e),n,!1).push(t),!0)}),(function(t,e,n){if(null!=(e=hr(qt,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&Nn(r,i,u(o))}}),Fn),Or=fr((function(t,e,n){return 2===t.i&&(gr(e,n,""===(t=ln(t))?void 0:t),!0)}),br,Fn),kr=fr((function(t,e,n){return 2===t.i&&(gr(e,n,ln(t)),!0)}),br,Fn),Vr=function(t,e,n=kn){return new Rn(t,e,n)}((function(t,e,n,r,i){return 2===t.i&&(r=se(void 0,r,!0),Ue(e,tt(e),n,!0).push(r),cn(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)vr(t,e[o],n,r,i)})),Fr=$n((function(t,e,n,r,i,o){return 2===t.i&&(Le(e,Z(e),o,n),cn(t,e=Oe(e,r,n),i),!0)}),vr),jr=fr((function(t,e,n){return 2===t.i&&(gr(e,n,hn(t)),!0)}),wr,Cn),Mr=fr((function(t,e,n){return 0===t.i&&(gr(e,n,0===(t=Ye(t.g)>>>0)?void 0:t),!0)}),(function(t,e,n){e=function(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(Bn(t,n,0),En(t.g,e))}),On()),Dr=fr((function(t,e,n){return 0===t.i&&(gr(e,n,Ye(t.g)),!0)}),(function(t,e,n){null!=(e=Ct(e))&&(e=parseInt(e,10),Bn(t,n,0),Tn(t.g,e))}),Gn);class Cr{constructor(t,e){this.i=t,this.g=e,this.j=Me,this.defaultValue=void 0}}function Gr(t,e){return(n,r)=>{if(dn.length){const t=dn.pop();t.s(r),en(t.g,n,r),n=t}else n=new class{constructor(t,e){if(sn.length){const n=sn.pop();en(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,en(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.D=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.s(e)}s({H:t=!1}={}){this.H=t}}(n,r);try{const r=new t,o=r.l;ir(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,dn.length<100&&dn.push(n)}return i}}var Rr=[0,Or,fr((function(t,e,n){return 2===t.i&&(gr(e,n,(t=hn(t))===V()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof mn){const r=e.P;return void(r&&(e=r(e),null!=e&&Nn(t,n,qe(e).buffer)))}if(Array.isArray(e))return}wr(t,e,n)}),Cn)];let $r,Wr=globalThis.trustedTypes;function zr(t){void 0===$r&&($r=function(){let t=null;if(!Wr)return t;try{const e=t=>t;t=Wr.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}());var e=$r;return new class{constructor(t){this.g=t}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function Hr(t,...e){if(0===e.length)return zr(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return zr(n)}var Jr=[0,Pr,Dr,xr,-1,Ur,Dr,-1],qr=class extends mn{constructor(){super()}},Kr=[0,xr,kr,xr,Dr,-1,dr((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ue(e,tt(e),n,!1,!1),2==t.i?fn(t,tn,e):e.push(Ye(t.g)),!0)}),(function(t,e,n){if(null!=(e=hr(Ct,e))&&e.length){n=xn(t,n);for(let n=0;n<e.length;n++)Tn(t.g,e[n]);Ln(t,n)}}),Gn),kr,-1,[0,xr,-1],Dr,xr,-1],Xr=[0,kr,-2],Yr=class extends mn{constructor(){super()}},Qr=[0],Zr=[0,Pr,xr,1,xr,-3],ti=class extends mn{constructor(t){super(t,2)}},ei={};ei[336783863]=[0,kr,xr,-1,Pr,[0,[1,2,3,4,5,6,7],Fr,Qr,Fr,Kr,Fr,Xr,Fr,Zr,Fr,Jr,Fr,[0,kr,-2],Fr,[0,kr,Dr]],[0,kr],xr,[0,[1,3],[2,4],Fr,[0,Ur],-1,Fr,[0,Nr],-1,Vr,[0,kr,-1]],kr];var ni,ri=[0,Er,-1,Lr,-3,Er,Ur,Or,Br,Er,-1,Lr,Br,Lr,-2,Or],ii=class extends mn{constructor(t){super(t,500)}s(t){return Me(this,0,7,t)}},oi=[-1,{}],si=[0,kr,1,oi],ai=[0,kr,Nr,oi],ui=class extends mn{constructor(){super(void 0,500)}s(t){return Me(this,0,1001,t)}};ui.prototype.g=(ni=[-500,Vr,[-500,Or,-1,Nr,-3,[-2,ei,xr],Vr,Rr,Br,-1,si,ai,Vr,[0,Or,Lr],Or,ri,Br,Nr,987,Nr],4,Vr,[-500,kr,-1,[-1,{}],998,kr],Vr,[-500,kr,Nr,-1,[-2,{},xr],997,Nr,-1],Br,Vr,[-500,kr,Nr,oi,998,Nr],Nr,Br,si,ai,Vr,[0,Or,-1,oi],Nr,-2,ri,Or,-1,Lr,[0,Lr,Mr],978,oi,Vr,Rr],function(){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}}}};cr(this.l,t,Zn(Jn,sr,ar,ni)),Un(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 ci=class extends mn{constructor(t){super(t)}},li=class extends mn{constructor(t){super(t)}g(){return je(this,ci)}},hi=[0,Vr,[0,Pr,Sr,kr,-1]],fi=class extends mn{constructor(t){super(t)}},di=class extends mn{constructor(t){super(t)}},gi=[1,2,3,4,5],pi=class extends mn{constructor(t){super(t)}g(){return null!=_e(this)}i(){return null!=qt(me(this,2))}},mi=class extends mn{constructor(t){super(t)}},yi=class extends mn{constructor(t){super(t)}},bi=[0,[0,jr,kr,[0,Pr,Ir,-1],[0,Tr,Ir]],xr,[0,gi,Fr,Zr,Fr,Kr,Fr,Jr,Fr,Qr,Fr,Xr],Dr],vi=new Cr(451755788,yi);ei[451755788]=[0,bi,[0,kr,Pr,Sr,Nr,-1],_r];var wi=class extends mn{constructor(t){super(t)}},_i=class extends mn{constructor(t){super(t)}},Si=new Cr(487277289,_i);ei[487277289]=[0,bi,[0,xr,-1]];var Ai=class extends mn{constructor(t){super(t)}},Ii=Gr(class extends mn{constructor(t){super(t)}},[0,Vr,[0,1,Pr,kr,hi],Ir]),Ei=class extends mn{constructor(t){super(t)}},Ti=class extends mn{constructor(t){super(t)}K(){const t=_e(this);return null==t?V():t}},Pi=class extends mn{constructor(t){super(t)}},Ui=[1,2],Bi=Gr(class extends mn{constructor(t){super(t)}},[0,Vr,[0,Ui,Fr,[0,Ar],Fr,[0,jr],Pr,kr],Ir]);function xi(){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 Li(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 Ni(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 Oi(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 ki(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Vi(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 Fi=function(t){return class extends t{N(){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:xi()?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?'),Ni(this,r||"input_audio",(r=>{Ni(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),Ni(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Ni(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){Ni(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Ni(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Ni(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Ni(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Ni(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Ni(this,e,(e=>{Ni(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Ni(this,e,(e=>{Oi(this,Object.keys(t),(r=>{Oi(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Ni(this,n,(n=>{Ni(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){Ni(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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)Ni(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Ni(this,e,(e=>{Ni(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Ni(this,n,(n=>{Ni(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){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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)Ni(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){ki(this,t,e),Ni(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Vi(this,t,e),Ni(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){ki(this,t,e),Ni(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Vi(this,t,e),Ni(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){ki(this,t,e),Ni(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Vi(this,t,e),Ni(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){ki(this,t,e),Ni(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Vi(this,t,e),Ni(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){ki(this,t,e),Ni(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Vi(this,t,e),Ni(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){ki(this,t,e),Ni(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Vi(this,t,e),Ni(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){ki(this,t,e),Ni(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Vi(this,t,e),Ni(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?'),ki(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Ni(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 ji=class extends Fi{};async function Mi(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Li(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Li(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 Di(t,e,n){return Mi(t,e,n)}function Ci(t,e){const n=Ve(t.baseOptions,pi,1)||new pi;"string"==typeof e?(ve(n,2,Jt(e)),ve(n,1)):e instanceof Uint8Array&&(ve(n,1,ct(e,!1)),ve(n,2)),Me(t.baseOptions,0,1,n)}function Gi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ve(t.baseOptions,pi,1)?.g()||Ve(t.baseOptions,pi,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=Ve(t.baseOptions,di,3);if(!n){var r=n=new di;De(r,4,new Yr)}"delegate"in e&&("GPU"===e.delegate?De(e=n,2,r=new qr):De(e=n,4,r=new Yr)),Me(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),Ci(t,"/model.dat"),t.A()}));if(n.modelAssetBuffer instanceof Uint8Array)Ci(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=>{Ci(t,e),t.A()}));return t.A(),Promise.resolve()}function Ri(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 $i(t,e){t.u=Math.max(t.u,e)}var Wi=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.N(),this.g.setGraph(t,e),Ri(this)}finishProcessing(){this.g.finishProcessing(),Ri(this)}close(){this.g.closeGraph()}};async function zi(t,e,n){return Di(t,e,n)}Wi.prototype.close=Wi.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",Wi);var Hi=class extends Wi{constructor(){super(...arguments),this.G=48e3}O(t){this.G=t}};function Ji(t){const e={classifications:je(t,Ai).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=$e(Ct(me(t,1)),0)??-1;const n=t.l;let r=tt(n);const i=be(n,r,2),o=Ft(i);return null!=o&&o!==i&&we(n,r,2,o),{index:e,score:o??0??0,categoryName:$e(qt(me(t,3)),"")??"",displayName:$e(qt(me(t,4)),"")??""}})),headIndex:e,headName:n}}(Ve(t,li,4)?.g()??[],$e(Ct(me(t,2)),0),$e(qt(me(t,3)),""))))};return null!=Wt(me(t,2))&&(e.timestampMs=$e(Wt(me(t,2)),0)),e}Hi.prototype.setDefaultSampleRate=Hi.prototype.O;var qi=class extends Hi{constructor(t,e){super(new ji(t,e)),this.m=[],Me(t=this.i=new yi,0,1,e=new mi)}get baseOptions(){return Ve(this.i,mi,1)}set baseOptions(t){Me(this.i,0,1,t)}s(t){var e=this.i,n=Ve(this.i,fi,2);if(n=n?fe(n):new fi,void 0!==t.displayNamesLocale?ve(n,1,Jt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&ve(n,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw $();if(!Number.isFinite(r))throw $();r|=0}ve(n,2,r)}else"maxResults"in t&&ve(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}`);ve(n,3,r)}else"scoreThreshold"in t&&ve(n,3);return void 0!==t.categoryAllowlist?Te(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&ve(n,4),void 0!==t.categoryDenylist?Te(n,5,t.categoryDenylist):"categoryDenylist"in t&&ve(n,5),Me(e,0,2,n),Gi(this,t)}L(t,e){return this.F(t,e??this.G,this.u+1)}F(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]}A(){var t=new ui;We(t,10,"audio_in"),We(t,10,"sample_rate"),We(t,15,"timestamped_classifications");const e=new ti;pn(e,vi,this.i);const n=new ii;Pe(n,Jt("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),We(n,3,"AUDIO:audio_in"),We(n,3,"SAMPLE_RATE:sample_rate"),We(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.s(e),Re(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=Ii(e),t.m.push(Ji(e))}))}(this,t),$i(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{$i(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Ki(t){return{embeddings:je(t,Pi).map((t=>{const e={headIndex:$e(Ct(me(t,3)),0)??-1,headName:$e(qt(me(t,4)),"")??""};if(void 0!==ke(t,Ei,Be(t,1)))e.floatEmbedding=Se(Ve(t,Ei,Be(t,1)),1,Ft,void 0===pt?2:4).slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=Ve(t,Ti,Be(t,2))?.K()?.i()??n}return e})),timestampMs:$e(Wt(me(t,2)),0)}}qi.prototype.classify=qi.prototype.L,qi.prototype.setOptions=qi.prototype.s,qi.createFromModelPath=function(t,e){return Di(qi,t,{baseOptions:{modelAssetPath:e}})},qi.createFromModelBuffer=function(t,e){return zi(qi,t,{baseOptions:{modelAssetBuffer:e}})},qi.createFromOptions=function(t,e){return zi(qi,t,e)};var Xi=class extends Hi{constructor(t,e){super(new ji(t,e)),this.m=[],Me(t=this.i=new _i,0,1,e=new mi)}get baseOptions(){return Ve(this.i,mi,1)}set baseOptions(t){Me(this.i,0,1,t)}s(t){var e=this.i,n=Ve(this.i,wi,2);return n=n?fe(n):new wi,void 0!==t.l2Normalize?ve(n,1,jt(t.l2Normalize)):"l2Normalize"in t&&ve(n,1),void 0!==t.quantize?ve(n,2,jt(t.quantize)):"quantize"in t&&ve(n,2),Me(e,0,2,n),Gi(this,t)}M(t,e){return this.F(t,e??this.G,this.u+1)}F(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}A(){var t=new ui;We(t,10,"audio_in"),We(t,10,"sample_rate"),We(t,15,"embeddings_out"),We(t,15,"timestamped_embeddings_out");const e=new ti;pn(e,Si,this.i);const n=new ii;Pe(n,Jt("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),We(n,3,"AUDIO:audio_in"),We(n,3,"SAMPLE_RATE:sample_rate"),We(n,4,"EMBEDDINGS:embeddings_out"),We(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.s(e),Re(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=Bi(t),this.m.push(Ki(t)),$i(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{$i(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=Bi(e),this.m.push(Ki(t));$i(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{$i(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let Yi;Xi.prototype.embed=Xi.prototype.M,Xi.prototype.setOptions=Xi.prototype.s,Xi.createFromModelPath=function(t,e){return zi(Xi,t,{baseOptions:{modelAssetPath:e}})},Xi.createFromModelBuffer=function(t,e){return zi(Xi,t,{baseOptions:{modelAssetBuffer:e}})},Xi.createFromOptions=function(t,e){return zi(Xi,t,e)};const Qi=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 Zi(){if(void 0===Yi)try{await WebAssembly.instantiate(Qi),Yi=!0}catch{Yi=!1}return Yi}async function to(t,e=Hr``){const n=await Zi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var eo=class{};eo.forVisionTasks=function(t){return to("vision",t)},eo.forTextTasks=function(t){return to("text",t)},eo.forGenAiExperimentalTasks=function(t){return to("genai_experimental",t)},eo.forGenAiTasks=function(t){return to("genai",t)},eo.forAudioTasks=function(t){return to("audio",t)},eo.isSimdSupported=function(){return Zi()},exports.AudioClassifier=qi,exports.AudioEmbedder=Xi,exports.AudioTaskRunner=Hi,exports.FilesetResolver=eo;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let r,i;const o="undefined"!=typeof TextDecoder;let s;const a="undefined"!=typeof TextEncoder;function u(t){if(a)t=(s||=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 c,l;t:{for(var h=["CLOSURE_FLAGS"],f=t,d=0;d<h.length;d++)if(null==(f=f[h[d]])){l=null;break t}l=f}var g,p=l&&l[610401301];c=null!=p&&p;const m=t.navigator;function y(t){return!!c&&(!!g&&g.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function b(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function v(){return!!c&&(!!g&&g.brands.length>0)}function w(){return v()?y("Chromium"):(b("Chrome")||b("CriOS"))&&!(!v()&&b("Edge"))||b("Silk")}g=m&&m.userAgentData||null;var _=!v()&&(b("Trident")||b("MSIE"));!b("Android")||w(),w(),b("Safari")&&(w()||!v()&&b("Coast")||!v()&&b("Opera")||!v()&&b("Edge")||(v()?y("Microsoft Edge"):b("Edg/"))||v()&&y("Opera"));var S={},A=null;function I(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let i=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=A[e];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}E();let r=0;for(;;){const t=n(-1),r=n(0),i=n(64),o=n(64);if(64===o&&-1===t)break;e(t<<2|r>>4),64!=i&&(e(r<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function E(){if(!A){A={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));S[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===A[e]&&(A[e]=t)}}}}var T="undefined"!=typeof Uint8Array,P=!_&&"function"==typeof btoa;function U(t){if(!P){var e;void 0===e&&(e=0),E(),e=S[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 B=/[-_.]/g,x={"-":"+",_:"/",".":"="};function L(t){return x[t]||""}function N(t){if(!P)return I(t);B.test(t)&&(t=t.replace(B,L)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function O(t){return T&&null!=t&&t instanceof Uint8Array}var k={};function V(){return M||=new j(null,k)}function F(t){C(k);var e=t.g;return null==(e=null==e||O(e)?e:"string"==typeof e?N(e):null)?e:t.g=e}var j=class{i(){return new Uint8Array(F(this)||0)}constructor(t,e){if(C(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let M,D;function C(t){if(t!==k)throw Error("illegal external caller")}function G(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function R(){const e=Error();G(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function $(){const t=Error("int32");return G(t,"warning"),t}function W(){return"function"==typeof BigInt}function z(t){return Array.prototype.slice.call(t)}var H="function"==typeof Symbol&&"symbol"==typeof Symbol();function J(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var q=J(),K=J("2ex"),X=J("1oa"),Y=H?(t,e)=>{t[q]|=e}:(t,e)=>{void 0!==t.o?t.o|=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Q=H?(t,e)=>{t[q]&=~e}:(t,e)=>{void 0!==t.o&&(t.o&=~e)},Z=H?t=>0|t[q]:t=>0|t.o,tt=H?t=>t[q]:t=>t.o,et=H?(t,e)=>{t[q]=e}:(t,e)=>{void 0!==t.o?t.o=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function nt(t,e){et(e,-30975&(0|t))}function rt(t,e){et(e,-30941&(34|t))}var it,ot={},st={};function at(t){return!(!t||"object"!=typeof t||t.g!==st)}function ut(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ct(t,e){if(null!=t)if("string"==typeof t)t=t?new j(t,k):V();else if(t.constructor!==j)if(O(t))t=t.length?new j(new Uint8Array(t),k):V();else{if(!e)throw Error();t=void 0}return t}function lt(t){return!(!Array.isArray(t)||t.length)&&!!(1&Z(t))}const ht=[];function ft(t){if(2&t)throw Error()}let dt;function gt(t,e){(e=dt?e[dt]:void 0)&&(t[dt]=z(e))}et(ht,55),it=Object.freeze(ht);var pt=Object.freeze({}),mt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),yt=t=>mt?t>=vt&&t<=_t:"-"===t[0]?St(t,bt):St(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 St(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 At="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 Bt(t){const e=It||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Tt=0,Et=e.getUint32(0,!0)}function xt(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:Nt(t,e)}function Lt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),"number"==typeof(t=xt(t,e))?n?-t:t:n?"-"+t:t}function Nt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else W()?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+Ot(n)+Ot(t));return n}function Ot(t){return t=String(t),"0000000".slice(t.length)+t}function kt(t){if(t.length<16)Ut(Number(t));else if(W())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 Ct(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 Gt(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=Lt(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(W())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Vt(t,e);t="-"+Nt(n,r)}else t=Nt(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)),Gt(t)||(kt(t),t=Nt(Et,Tt))),t;if("number"===e)return(t=Math.trunc(t))>=0&&Number.isSafeInteger(t)?t:function(t){if(t<0){Ut(t);var e=Nt(Et,Tt);return t=Number(e),Number.isSafeInteger(t)?t:e}return Gt(e=String(t))?e:(Ut(t),xt(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.C===ot)return t;if(Array.isArray(t)){var r=Z(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&et(t,i),new e(t)}}function Xt(t){var e;return void 0===Zt&&(Zt="function"==typeof Proxy?ie(Proxy):null),(e=!Zt)||(void 0===te&&(te="function"==typeof WeakMap?ie(WeakMap):null),e=!te),e?t:(e=Yt?.get(t))?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),function(t,e){(Yt||=new te).set(t,e),(Qt||=new te).set(e,t)}(t,e=new Zt(t,{set:(t,e,n)=>(R(),t[e]=n,!0)})),e)}let Yt,Qt,Zt,te,ee,ne,re;function ie(t){try{return-1!==t.toString().indexOf("[native code]")?t:null}catch{return null}}function oe(t,e,n){return t=se(t,e[0],e[1],n?1:2),e!==ne&&n&&Y(t,16384),t}function se(t,e,n,r){if(r=r??0,null==t){var i=96;n?(t=[n],i|=512):t=[],e&&(i=-33521665&i|(1023&e)<<15)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(i=Z(t)))throw Error("farr");if(64&i)return t;if(1===r||2===r||(i|=64),n&&(i|=512,n!==t[0]))throw Error("mid");t:{if(r=(n=t).length){const t=r-1;if(ut(n[t])){if((e=t-(+!!(512&(i|=256))-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&e)<<15;break t}}if(e){if((e=Math.max(e,r-(+!!(512&i)-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&e)<<15}}}return et(t,i),t}function ae(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=lt(t)?void 0:i&&2&Z(t)?t:ue(t,e,n,void 0!==r,i);else if(ut(t)){const o={};for(let s in t)o[s]=ae(t[s],e,n,r,i);t=o}else t=e(t,r);return t}}function ue(t,e,n,r,i){const o=r||n?Z(t):0;r=r?!!(32&o):void 0;const s=z(t);for(let t=0;t<s.length;t++)s[t]=ae(s[t],e,n,r,i);return n&&(gt(s,t),n(o,s)),s}function ce(t){return t.C===ot?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(lt(t))return}else{if(O(t))return U(t);if(t instanceof j){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=U(e)}}}return t}(t)}function le(t,e,n=rt){if(null!=t){if(T&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Z(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(et(t,-12293&(34|r)),t):ue(t,le,4&r?rt:n,!0,!0))}return t.C===ot&&(n=t.l,t=2&(r=tt(n))?t:new t.constructor(fe(n,r,!0))),t}}function he(t){const e=t.l;return new t.constructor(fe(e,tt(e),!1))}function fe(t,e,n){const r=n||2&e?rt:nt,i=!!(32&e);return t=function(t,e,n){const r=z(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 gt(r,t),r}(t,e,(t=>le(t,i,r))),Y(t,32|(n?2:0)),t}function de(t){const e=t.l,n=tt(e);return 2&n?new t.constructor(fe(e,n,!1)):t}function ge(t,e){return me(t=t.l,tt(t),e)}function pe(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function me(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])?(pe(t,e,i,n)&&null!=K&&((e=(t=D??={})[K]||0)>=4||(t[K]=e+1,R())),r):pe(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function ye(t,e,n){const r=t.l;let i=tt(r);return ft(i),be(r,i,e,n),t}function be(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&&et(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function ve(t){t=t.l;let e=tt(t);const n=me(t,e,1),r=ct(n,!0);return null!=r&&r!==n&&be(t,e,1,r),r}function we(t,e,n,r,i){const o=t.l,s=2&(t=tt(o))?1:r;i=!!i,r=_e(o,t,e);var a=Z(r);if(!(4&a)){4&a&&(r=z(r),a=Me(a,t),t=be(o,t,e,r));let i=0,s=0;for(;i<r.length;i++){const t=n(r[i]);null!=t&&(r[s++]=t)}s<i&&(r.length=s),a=-4097&(20|(a=Se(a,t))),et(r,a&=-8193),2&a&&Object.freeze(r)}let u;return 1===s||4===s&&32&a?Ae(a)||(i=a,(a|=2)!==i&&et(r,a),Object.freeze(r)):(n=5===s&&(!!(32&a)||Ae(a)||!!Yt?.get(r)),(2===s||n)&&Ae(a)&&(r=z(r),a=De(a=Me(a,t),t,i),et(r,a),t=be(o,t,e,r)),Ae(a)||(e=a,(a=De(a,t,i))!==e&&et(r,a)),n?u=Xt(r):2!==s||i||Yt?.delete(r)),u||r}function _e(t,e,n,r){return t=me(t,e,n,r),Array.isArray(t)?t:it}function Se(t,e){return 0===t&&(t=Me(t,e)),1|t}function Ae(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Ie(t,e,n){t=t.l;let r=tt(t);if(ft(r),null==n)be(t,r,e);else{n=Qt?.get(n)||n;var i=Z(n),o=i,s=Ae(i),a=s||Object.isFrozen(n);for(s||(i=0),a||(n=z(n),o=0,i=De(i=Me(i,r),r,!0),a=!1),i|=21,s=0;s<n.length;s++){const t=n[s],e=Ht(t);Object.is(t,e)||(a&&(n=z(n),o=0,i=De(i=Me(i,r),r,!0),a=!1),n[s]=e)}i!==o&&(a&&(n=z(n),i=De(i=Me(i,r),r,!0)),et(n,i)),be(t,r,e,n)}}function Ee(t,e){t=t.l;let n=tt(t);ft(n),be(t,n,2,""===e?void 0:e)}function Te(t,e,n,r,i){ft(e);var o=!(!(64&e)&&16384&e);const s=(i=_e(t,e,n,i))!==it;if(o||!s){let a=o=s?Z(i):0;(!s||2&a||Ae(a)||4&a&&!(32&a))&&(i=z(i),a=Me(a,e),e=be(t,e,n,i)),a=-13&Se(a,e),a=De(r?-17&a:16|a,e,!0),a!==o&&et(i,a)}return i}function Pe(t,e){var n=Ti;return xe(Ue(t=t.l),t,tt(t),n)===e?e:-1}function Ue(t){if(H)return t[X]??(t[X]=new Map);if(X in t)return t[X];const e=new Map;return Object.defineProperty(t,X,{value:e}),e}function Be(t,e,n,r){const i=Ue(t),o=xe(i,t,e,n);return o!==r&&(o&&(e=be(t,e,o)),i.set(n,r)),e}function xe(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!=me(e,n,o)&&(0!==i&&(n=be(e,n,i)),i=o)}return t.set(r,i),i}function Le(t,e,n,r){let i,o=tt(t);if(null!=(r=me(t,o,n,r))&&r.C===ot)return(e=de(r))!==r&&be(t,o,n,e),e.l;if(Array.isArray(r)){const t=Z(r);i=2&t?oe(fe(r,t,!1),e,!0):64&t?r:oe(i,e,!0)}else i=oe(void 0,e,!0);return i!==r&&be(t,o,n,i),i}function Ne(t,e,n,r){t=t.l;let i=tt(t);return(e=Kt(r=me(t,i,n,r),e,i))!==r&&null!=e&&be(t,i,n,e),e}function Oe(t,e,n){if(null==(e=Ne(t,e,n,!1)))return e;t=t.l;let r=tt(t);if(!(2&r)){const i=de(e);i!==e&&be(t,r,n,e=i)}return e}function ke(t,e,n,r,i,o){t=t.l;var s=!!(2&e);r=s?1:r,i=!!i,o&&=!s,s=_e(t,e,1);var a=Z(s),u=!!(4&a);if(!u){var c=s,l=e;const t=!!(2&(a=Se(a,e)));t&&(l|=2);let r=!t,i=!0,o=0,u=0;for(;o<c.length;o++){const e=Kt(c[o],n,l);if(e instanceof n){if(!t){const t=!!(2&Z(e.l));r&&=!t,i&&=t}c[u++]=e}}u<o&&(c.length=u),a|=4,a=i?16|a:-17&a,et(c,a=r?8|a:-9&a),t&&Object.freeze(c)}if(o&&!(8&a||!s.length&&(1===r||4===r&&32&a))){for(Ae(a)&&(s=z(s),a=Me(a,e),e=be(t,e,1,s)),n=s,o=a,c=0;c<n.length;c++)(a=n[c])!==(l=de(a))&&(n[c]=l);o|=8,o=n.length?-17&o:16|o,et(n,o),a=o}let h;return 1===r||4===r&&32&a?Ae(a)||(e=a,(a|=!s.length||16&a&&(!u||32&a)?2:2048)!==e&&et(s,a),Object.freeze(s)):(u=5===r&&(!!(32&a)||Ae(a)||!!Yt?.get(s)),(2===r||u)&&Ae(a)&&(s=z(s),a=De(a=Me(a,e),e,i),et(s,a),e=be(t,e,1,s)),Ae(a)||(t=a,(a=De(a,e,i))!==t&&et(s,a)),u?h=Xt(s):2!==r||i||Yt?.delete(s)),h||s}function Ve(t,e){const n=tt(t.l);return ke(t,n,e,void 0===pt?2:4,!1,!(2&n))}function Fe(t,e,n,r){return null==r&&(r=void 0),ye(t,n,r)}function je(t,e,n){var r=fi;null==n&&(n=void 0);t:{t=t.l;let i=tt(t);if(ft(i),null==n){const n=Ue(t);if(xe(n,t,i,r)!==e)break t;n.set(r,0)}else i=Be(t,i,r,e);be(t,i,e,n)}}function Me(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function De(t,e,n){return 32&e&&n||(t&=-33),t}function Ce(t,e){var n=ni;const r=tt(t.l);ft(r),t=ke(t,r,n,2,!0),e=null!=e?e:new n,t.push(e),2&Z(e.l)?Q(t,8):Q(t,16)}function Ge(t,e){return t??e}function Re(t,e,n){ft(tt(t.l)),we(t,e,qt,2,!0).push(Ht(n))}function $e(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function We(){return Error("Failed to read varint, encoding is invalid.")}function ze(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function He(t){if("string"==typeof t)return{buffer:N(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 Je(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(tn(t,a),n<128)return e(r>>>0,i>>>0);throw We()}function qe(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 tn(t,n),!!(127&e)}throw We()}function Ke(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 We();return tn(t,n),i}function Xe(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],tn(t,t.g+4),(r<<0|i<<8|o<<16|e<<24)>>>0}function Ye(t){var e=Xe(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 Qe(t){return Ke(t)}function Ze(t,e,{D:n=!1}={}){t.D=n,e&&(e=He(e),t.i=e.buffer,t.m=e.v,t.u=0,t.j=t.i.length,t.g=t.u)}function tn(t,e){if(t.g=e,e>t.j)throw ze(t.j,e)}function en(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 ze(e,t.j-n);return t.g=r,n}function nn(t,e){if(0==e)return V();var n=en(t,e);return t.D&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?new Uint8Array(0):At?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?V():new j(n,k)}var rn=[];function on(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=Ke(t.g)>>>0;if(e=n>>>3,!((n&=7)>=0&&n<=5))throw $e(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 sn(t){switch(t.i){case 0:0!=t.i?sn(t):qe(t.g);break;case 1:tn(t=t.g,t.g+8);break;case 2:if(2!=t.i)sn(t);else{var e=Ke(t.g)>>>0;tn(t=t.g,t.g+e)}break;case 5:tn(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!on(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}sn(t)}break;default:throw $e(t.i,t.j)}}function an(t,e,n){const r=t.g.j,i=Ke(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 un(t){var s=Ke(t.g)>>>0,a=en(t=t.g,s);if(t=t.i,o){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),s=a+s,c=0===a&&s===c.length?c:c.subarray(a,s);try{var l=u.decode(c)}catch(t){if(void 0===r){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),r=!0}catch(t){r=!1}}throw!r&&(i=void 0),t}}else{s=(l=a)+s,a=[];let r,i=null;for(;l<s;){var h=t[l++];h<128?a.push(h):h<224?l>=s?e():(r=t[l++],h<194||128!=(192&r)?(l--,e()):a.push((31&h)<<6|63&r)):h<240?l>=s-1?e():(r=t[l++],128!=(192&r)||224===h&&r<160||237===h&&r>=160||128!=(192&(u=t[l++]))?(l--,e()):a.push((15&h)<<12|(63&r)<<6|63&u)):h<=244?l>=s-2?e():(r=t[l++],128!=(192&r)||r-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,e()):(h=(7&h)<<18|(63&r)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):e(),a.length>=8192&&(i=n(i,a),a.length=0)}l=n(i,a)}return l}function cn(t){const e=Ke(t.g)>>>0;return nn(t.g,e)}function ln(t,e,n){var r=Ke(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var hn=[];let fn;function dn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var gn=class{constructor(t,e){this.l=se(t,e)}toJSON(){return pn(this)}v(){return!!(2&Z(this.l))}};function pn(t){t=t.l,t=fn?t:ue(t,ce,void 0,void 0,!1);{var e=!fn;let c=t.length;if(c){var n=t[c-1],r=ut(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)&&(lt(r)||at(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])||lt(o)||at(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 mn(t){return t?/^\d+$/.test(t)?(kt(t),new yn(Et,Tt)):null:bn||=new yn(0,0)}gn.prototype.C=ot,gn.prototype.toString=function(){try{return fn=!0,pn(this).toString()}finally{fn=!1}};var yn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let bn;function vn(t){return t?/^-?\d+$/.test(t)?(kt(t),new wn(Et,Tt)):null:_n||=new wn(0,0)}var wn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let _n;function Sn(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 An(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function In(t,e){if(e>=0)An(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function En(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 Tn(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Pn(t,e,n){An(t.g,8*e+n)}function Un(t,e){return Pn(t,e,2),e=t.g.end(),Tn(t,e),e.push(t.i),e}function Bn(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 xn(t,e,n){Pn(t,e,2),An(t.g,n.length),Tn(t,t.g.end()),Tn(t,n)}function Ln(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Nn=Ln(),On=Ln(),kn=Ln(),Vn=Ln(),Fn=Ln(),jn=Ln(),Mn=Ln(),Dn=Ln(),Cn=class{constructor(t,e,n){this.g=t,this.i=e,t=Nn,this.j=!!t&&n===t||!1}};function Gn(t,e){return new Cn(t,e,Nn)}function Rn(t,e,n,r,i){null!=(e=Zn(e,r))&&(n=Un(t,n),i(e,t),Bn(t,n))}const $n=Gn((function(t,e,n,r,i){return 2===t.i&&(an(t,Le(e,r,n),i),!0)}),Rn),Wn=Gn((function(t,e,n,r,i){return 2===t.i&&(an(t,Le(e,r,n,!0),i),!0)}),Rn);var zn=Symbol(),Hn=Symbol(),Jn=Symbol(),qn=Symbol();let Kn,Xn;function Yn(t,e,n,r){var i=r[t];if(i)return i;(i={}).B=function(t){switch(typeof t){case"boolean":return ne||=[0,void 0,!0];case"number":return t>0?void 0:0===t?re||=[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.I=o,"function"==typeof(o=r[++s])&&(i.J=!0,Kn??=o,Xn??=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 Cn?t=o:(t=$n,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 Qn(t){return Array.isArray(t)?t[0]instanceof Cn?t:[Wn,t]:[t,void 0]}function Zn(t,e){return t instanceof gn?t.l:Array.isArray(t)?oe(t,e,!1):void 0}function tr(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function er(t,e,n,r,i){const o=n.g;let s,a;t[e]=(t,e,n)=>o(t,e,n,a||=Yn(Hn,tr,er,r).B,s||=nr(r),i)}function nr(t){let e=t[Jn];if(null!=e)return e;const n=Yn(Hn,tr,er,t);return e=n.J?(t,e)=>Kn(t,e,n):(t,e)=>{const r=tt(t);for(;on(e)&&4!=e.i;){var i=e.m,o=n[i];if(null==o){var s=n.I;s&&(s=s[i])&&(null!=(s=rr(s))&&(o=n[i]=s))}null!=o&&o(e,t,i)||(i=(o=e).j,sn(o),o.H?o=void 0:(s=o.g.g-i,o.g.g=i,o=nn(o.g,s)),i=t,o&&(dt||=Symbol(),(s=i[dt])?s.push(o):i[dt]=[o]))}return 16384&r&&Y(t,34),!0},t[Jn]=e}function rr(t){const e=(t=Qn(t))[0].g;if(t=t[1]){const n=nr(t),r=Yn(Hn,tr,er,t).B;return(t,i,o)=>e(t,i,o,r,n)}return e}function ir(t,e,n){t[e]=n.i}function or(t,e,n,r){let i,o;const s=n.i;t[e]=(t,e,n)=>s(t,e,n,o||=Yn(zn,ir,or,r).B,i||=sr(r))}function sr(t){let e=t[qn];if(!e){const n=Yn(zn,ir,or,t);e=(t,e)=>ar(t,e,n),t[qn]=e}return e}function ar(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=ur(n,o);a&&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=ur(n,i))&&a(e,o,i)}if(t=dt?t[dt]:void 0)for(Tn(e,e.g.end()),n=0;n<t.length;n++)Tn(e,F(t[n])||new Uint8Array(0))}function ur(t,e){var n=t[e];if(n)return n;if((n=t.I)&&(n=n[e])){var r=(n=Qn(n))[0].i;if(n=n[1]){const e=sr(n),i=Yn(zn,ir,or,n).B;n=t.J?Xn(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}function cr(t,e){if(Array.isArray(e)){var n=Z(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),et(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}function lr(t,e,n){return new Cn(t,e,n)}function hr(t,e,n){return new Cn(t,e,n)}function fr(t,e,n){be(t,tt(t),e,n)}function dr(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)vn(e);if(null!=e)switch(Pn(t,n,0),typeof e){case"number":t=t.g,Ut(e),Sn(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new wn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Sn(t.g,n.i,n.g);break;default:n=vn(e),Sn(t.g,n.i,n.g)}}}function gr(t,e,n){null!=(e=Ct(e))&&null!=e&&(Pn(t,n,0),In(t.g,e))}function pr(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Pn(t,n,0),t.g.g.push(e?1:0))}function mr(t,e,n){null!=(e=qt(e))&&xn(t,n,u(e))}function yr(t,e,n,r,i){null!=(e=Zn(e,r))&&(n=Un(t,n),i(e,t),Bn(t,n))}function br(t,e,n){null!=(e=null==e||"string"==typeof e||O(e)||e instanceof j?e:void 0)&&xn(t,n,He(e).buffer)}var vr=lr((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=Xe(r);const i=Xe(r);r=2*(i>>31)+1;const o=i>>>20&2047;return t=4294967296*(1048575&i)+t,fr(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))&&(Pn(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),En(t,Et),En(t,Tt))}),Ln()),wr=lr((function(t,e,n){return 5===t.i&&(fr(e,n,Ye(t.g)),!0)}),(function(t,e,n){null!=(e=Ft(e))&&(Pn(t,n,5),t=t.g,Bt(e),En(t,Et))}),jn),_r=hr((function(t,e,n){return(5===t.i||2===t.i)&&(e=Te(e,tt(e),n,!1,!1),2==t.i?ln(t,Ye,e):e.push(Ye(t.g)),!0)}),(function(t,e,n){if(null!=(e=cr(Ft,e))&&e.length){Pn(t,n,2),An(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Bt(e[r]),En(n,Et)}}),jn),Sr=lr((function(t,e,n){return 0===t.i&&(fr(e,n,Je(t.g,Lt)),!0)}),dr,Fn),Ar=lr((function(t,e,n){return 0===t.i&&(fr(e,n,0===(t=Je(t.g,Lt))?void 0:t),!0)}),dr,Fn),Ir=lr((function(t,e,n){return 0===t.i&&(fr(e,n,Je(t.g,xt)),!0)}),(function(t,e,n){if(null!=(e=zt(e))){if("string"==typeof e)mn(e);if(null!=e)switch(Pn(t,n,0),typeof e){case"number":t=t.g,Ut(e),Sn(t,Et,Tt);break;case"bigint":n=BigInt.asUintN(64,e),n=new yn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Sn(t.g,n.i,n.g);break;default:n=mn(e),Sn(t.g,n.i,n.g)}}}),Ln()),Er=lr((function(t,e,n){return 0===t.i&&(fr(e,n,Ke(t.g)),!0)}),gr,Vn),Tr=hr((function(t,e,n){return(0===t.i||2===t.i)&&(e=Te(e,tt(e),n,!1,!1),2==t.i?ln(t,Ke,e):e.push(Ke(t.g)),!0)}),(function(t,e,n){if(null!=(e=cr(Ct,e))&&e.length){n=Un(t,n);for(let n=0;n<e.length;n++)In(t.g,e[n]);Bn(t,n)}}),Vn),Pr=lr((function(t,e,n){return 0===t.i&&(fr(e,n,0===(t=Ke(t.g))?void 0:t),!0)}),gr,Vn),Ur=lr((function(t,e,n){return 0===t.i&&(fr(e,n,qe(t.g)),!0)}),pr,On),Br=lr((function(t,e,n){return 0===t.i&&(fr(e,n,!1===(t=qe(t.g))?void 0:t),!0)}),pr,On),xr=hr((function(t,e,n){return 2===t.i&&(t=un(t),Te(e,tt(e),n,!1).push(t),!0)}),(function(t,e,n){if(null!=(e=cr(qt,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&xn(r,i,u(o))}}),kn),Lr=lr((function(t,e,n){return 2===t.i&&(fr(e,n,""===(t=un(t))?void 0:t),!0)}),mr,kn),Nr=lr((function(t,e,n){return 2===t.i&&(fr(e,n,un(t)),!0)}),mr,kn),Or=function(t,e,n=Nn){return new Cn(t,e,n)}((function(t,e,n,r,i){return 2===t.i&&(r=oe(void 0,r,!0),Te(e,tt(e),n,!0).push(r),an(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)yr(t,e[o],n,r,i)})),kr=Gn((function(t,e,n,r,i,o){return 2===t.i&&(Be(e,Z(e),o,n),an(t,e=Le(e,r,n),i),!0)}),yr),Vr=lr((function(t,e,n){return 2===t.i&&(fr(e,n,cn(t)),!0)}),br,Mn),Fr=lr((function(t,e,n){return 0===t.i&&(fr(e,n,0===(t=Ke(t.g)>>>0)?void 0:t),!0)}),(function(t,e,n){e=function(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(Pn(t,n,0),An(t.g,e))}),Ln()),jr=lr((function(t,e,n){return 0===t.i&&(fr(e,n,Ke(t.g)),!0)}),(function(t,e,n){null!=(e=Ct(e))&&(e=parseInt(e,10),Pn(t,n,0),In(t.g,e))}),Dn);class Mr{constructor(t,e){this.i=t,this.g=e,this.j=Fe,this.defaultValue=void 0}}function Dr(t,e){return(n,r)=>{if(hn.length){const t=hn.pop();t.s(r),Ze(t.g,n,r),n=t}else n=new class{constructor(t,e){if(rn.length){const n=rn.pop();Ze(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,Ze(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.D=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.s(e)}s({H:t=!1}={}){this.H=t}}(n,r);try{const r=new t,o=r.l;nr(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,hn.length<100&&hn.push(n)}return i}}var Cr=[0,Lr,lr((function(t,e,n){return 2===t.i&&(fr(e,n,(t=cn(t))===V()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof gn){const r=e.P;return void(r&&(e=r(e),null!=e&&xn(t,n,He(e).buffer)))}if(Array.isArray(e))return}br(t,e,n)}),Mn)];let Gr,Rr=globalThis.trustedTypes;function $r(t){void 0===Gr&&(Gr=function(){let t=null;if(!Rr)return t;try{const e=t=>t;t=Rr.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}());var e=Gr;return new class{constructor(t){this.g=t}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function Wr(t,...e){if(0===e.length)return $r(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return $r(n)}var zr=[0,Er,jr,Ur,-1,Tr,jr,-1],Hr=class extends gn{constructor(t){super(t)}},Jr=[0,Ur,Nr,Ur,jr,-1,hr((function(t,e,n){return(0===t.i||2===t.i)&&(e=Te(e,tt(e),n,!1,!1),2==t.i?ln(t,Qe,e):e.push(Ke(t.g)),!0)}),(function(t,e,n){if(null!=(e=cr(Ct,e))&&e.length){n=Un(t,n);for(let n=0;n<e.length;n++)In(t.g,e[n]);Bn(t,n)}}),Dn),Nr,-1,[0,Ur,-1],jr,Ur,-1],qr=[0,Nr,-2],Kr=class extends gn{constructor(t){super(t)}},Xr=[0],Yr=[0,Er,Ur,1,Ur,-3],Qr=class extends gn{constructor(t){super(t,2)}},Zr={};Zr[336783863]=[0,Nr,Ur,-1,Er,[0,[1,2,3,4,5,6,7],kr,Xr,kr,Jr,kr,qr,kr,Yr,kr,zr,kr,[0,Nr,-2],kr,[0,Nr,jr]],[0,Nr],Ur,[0,[1,3],[2,4],kr,[0,Tr],-1,kr,[0,xr],-1,Or,[0,Nr,-1]],Nr];var ti,ei=[0,Ar,-1,Br,-3,Ar,Tr,Lr,Pr,Ar,-1,Br,Pr,Br,-2,Lr],ni=class extends gn{constructor(t){super(t,500)}s(t){return Fe(this,0,7,t)}},ri=[-1,{}],ii=[0,Nr,1,ri],oi=[0,Nr,xr,ri],si=class extends gn{constructor(t){super(t,500)}s(t){return Fe(this,0,1001,t)}};si.prototype.g=(ti=[-500,Or,[-500,Lr,-1,xr,-3,[-2,Zr,Ur],Or,Cr,Pr,-1,ii,oi,Or,[0,Lr,Br],Lr,ei,Pr,xr,987,xr],4,Or,[-500,Nr,-1,[-1,{}],998,Nr],Or,[-500,Nr,xr,-1,[-2,{},Ur],997,xr,-1],Pr,Or,[-500,Nr,xr,ri,998,xr],xr,Pr,ii,oi,Or,[0,Lr,-1,ri],xr,-2,ei,Lr,-1,Br,[0,Br,Fr],978,ri,Or,Cr],function(){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}}}};ar(this.l,t,Yn(zn,ir,or,ti)),Tn(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 ai=class extends gn{constructor(t){super(t)}},ui=class extends gn{constructor(t){super(t)}g(){return Ve(this,ai)}},ci=[0,Or,[0,Er,wr,Nr,-1]],li=class extends gn{constructor(t){super(t)}},hi=class extends gn{constructor(t){super(t)}},fi=[1,2,3,4,5],di=class extends gn{constructor(t){super(t)}g(){return null!=ve(this)}i(){return null!=qt(ge(this,2))}},gi=class extends gn{constructor(t){super(t)}},pi=class extends gn{constructor(t){super(t)}},mi=[0,[0,Vr,Nr,[0,Er,Sr,-1],[0,Ir,Sr]],Ur,[0,fi,kr,Yr,kr,Jr,kr,zr,kr,Xr,kr,qr],jr],yi=new Mr(451755788,pi);Zr[451755788]=[0,mi,[0,Nr,Er,wr,xr,-1],vr];var bi=class extends gn{constructor(t){super(t)}},vi=class extends gn{constructor(t){super(t)}},wi=new Mr(487277289,vi);Zr[487277289]=[0,mi,[0,Ur,-1]];var _i=class extends gn{constructor(t){super(t)}},Si=Dr(class extends gn{constructor(t){super(t)}},[0,Or,[0,1,Er,Nr,ci],Sr]),Ai=class extends gn{constructor(t){super(t)}},Ii=class extends gn{constructor(t){super(t)}K(){const t=ve(this);return null==t?V():t}},Ei=class extends gn{constructor(t){super(t)}},Ti=[1,2],Pi=Dr(class extends gn{constructor(t){super(t)}},[0,Or,[0,Ti,kr,[0,_r],kr,[0,Vr],Er,Nr],Sr]);function Ui(){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 Bi(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 xi(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 Li(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 Oi(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 ki=function(t){return class extends t{N(){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:Ui()?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?'),xi(this,r||"input_audio",(r=>{xi(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),xi(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){xi(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){xi(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){xi(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){xi(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){xi(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){xi(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){xi(this,e,(e=>{xi(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){xi(this,e,(e=>{Li(this,Object.keys(t),(r=>{Li(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){xi(this,n,(n=>{xi(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){xi(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){xi(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){xi(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){xi(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){xi(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){xi(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){xi(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)xi(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){xi(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){xi(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){xi(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){xi(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){xi(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){xi(this,e,(e=>{xi(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){xi(this,n,(n=>{xi(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){xi(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){xi(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){xi(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){xi(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){xi(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){xi(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)xi(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Ni(this,t,e),xi(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Oi(this,t,e),xi(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){Ni(this,t,e),xi(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Oi(this,t,e),xi(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){Ni(this,t,e),xi(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Oi(this,t,e),xi(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Ni(this,t,e),xi(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Oi(this,t,e),xi(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Ni(this,t,e),xi(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Oi(this,t,e),xi(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){Ni(this,t,e),xi(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Oi(this,t,e),xi(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Ni(this,t,e),xi(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Oi(this,t,e),xi(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)})),xi(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 Vi=class extends ki{};async function Fi(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Bi(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Bi(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 ji(t,e,n){return Fi(t,e,n)}function Mi(t,e){const n=Oe(t.baseOptions,di,1)||new di;"string"==typeof e?(ye(n,2,Jt(e)),ye(n,1)):e instanceof Uint8Array&&(ye(n,1,ct(e,!1)),ye(n,2)),Fe(t.baseOptions,0,1,n)}function Di(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Oe(t.baseOptions,di,1)?.g()||Oe(t.baseOptions,di,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=Oe(t.baseOptions,hi,3);if(!n){var r=n=new hi;je(r,4,new Kr)}"delegate"in e&&("GPU"===e.delegate?je(e=n,2,r=new Hr):je(e=n,4,r=new Kr)),Fe(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),Mi(t,"/model.dat"),t.A()}));if(n.modelAssetBuffer instanceof Uint8Array)Mi(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=>{Mi(t,e),t.A()}));return t.A(),Promise.resolve()}function Ci(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 Gi(t,e){t.u=Math.max(t.u,e)}var Ri=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.N(),this.g.setGraph(t,e),Ci(this)}finishProcessing(){this.g.finishProcessing(),Ci(this)}close(){this.g.closeGraph()}};async function $i(t,e,n){return ji(t,e,n)}Ri.prototype.close=Ri.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",Ri);var Wi=class extends Ri{constructor(){super(...arguments),this.G=48e3}O(t){this.G=t}};function zi(t){const e={classifications:Ve(t,_i).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=Ge(Ct(ge(t,1)),0)??-1;const n=t.l;let r=tt(n);const i=me(n,r,2),o=Ft(i);return null!=o&&o!==i&&be(n,r,2,o),{index:e,score:o??0??0,categoryName:Ge(qt(ge(t,3)),"")??"",displayName:Ge(qt(ge(t,4)),"")??""}})),headIndex:e,headName:n}}(Oe(t,ui,4)?.g()??[],Ge(Ct(ge(t,2)),0),Ge(qt(ge(t,3)),""))))};return null!=Wt(ge(t,2))&&(e.timestampMs=Ge(Wt(ge(t,2)),0)),e}Wi.prototype.setDefaultSampleRate=Wi.prototype.O;var Hi=class extends Wi{constructor(t,e){super(new Vi(t,e)),this.m=[],Fe(t=this.i=new pi,0,1,e=new gi)}get baseOptions(){return Oe(this.i,gi,1)}set baseOptions(t){Fe(this.i,0,1,t)}s(t){var e=this.i,n=Oe(this.i,li,2);if(n=n?he(n):new li,void 0!==t.displayNamesLocale?ye(n,1,Jt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&ye(n,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw $();if(!Number.isFinite(r))throw $();r|=0}ye(n,2,r)}else"maxResults"in t&&ye(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}`);ye(n,3,r)}else"scoreThreshold"in t&&ye(n,3);return void 0!==t.categoryAllowlist?Ie(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&ye(n,4),void 0!==t.categoryDenylist?Ie(n,5,t.categoryDenylist):"categoryDenylist"in t&&ye(n,5),Fe(e,0,2,n),Di(this,t)}L(t,e){return this.F(t,e??this.G,this.u+1)}F(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]}A(){var t=new si;Re(t,10,"audio_in"),Re(t,10,"sample_rate"),Re(t,15,"timestamped_classifications");const e=new Qr;dn(e,yi,this.i);const n=new ni;Ee(n,Jt("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),Re(n,3,"AUDIO:audio_in"),Re(n,3,"SAMPLE_RATE:sample_rate"),Re(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.s(e),Ce(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=Si(e),t.m.push(zi(e))}))}(this,t),Gi(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{Gi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Ji(t){return{embeddings:Ve(t,Ei).map((t=>{const e={headIndex:Ge(Ct(ge(t,3)),0)??-1,headName:Ge(qt(ge(t,4)),"")??""};if(void 0!==Ne(t,Ai,Pe(t,1)))e.floatEmbedding=we(Oe(t,Ai,Pe(t,1)),1,Ft,void 0===pt?2:4).slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=Oe(t,Ii,Pe(t,2))?.K()?.i()??n}return e})),timestampMs:Ge(Wt(ge(t,2)),0)}}Hi.prototype.classify=Hi.prototype.L,Hi.prototype.setOptions=Hi.prototype.s,Hi.createFromModelPath=function(t,e){return ji(Hi,t,{baseOptions:{modelAssetPath:e}})},Hi.createFromModelBuffer=function(t,e){return $i(Hi,t,{baseOptions:{modelAssetBuffer:e}})},Hi.createFromOptions=function(t,e){return $i(Hi,t,e)};var qi=class extends Wi{constructor(t,e){super(new Vi(t,e)),this.m=[],Fe(t=this.i=new vi,0,1,e=new gi)}get baseOptions(){return Oe(this.i,gi,1)}set baseOptions(t){Fe(this.i,0,1,t)}s(t){var e=this.i,n=Oe(this.i,bi,2);return n=n?he(n):new bi,void 0!==t.l2Normalize?ye(n,1,jt(t.l2Normalize)):"l2Normalize"in t&&ye(n,1),void 0!==t.quantize?ye(n,2,jt(t.quantize)):"quantize"in t&&ye(n,2),Fe(e,0,2,n),Di(this,t)}M(t,e){return this.F(t,e??this.G,this.u+1)}F(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}A(){var t=new si;Re(t,10,"audio_in"),Re(t,10,"sample_rate"),Re(t,15,"embeddings_out"),Re(t,15,"timestamped_embeddings_out");const e=new Qr;dn(e,wi,this.i);const n=new ni;Ee(n,Jt("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),Re(n,3,"AUDIO:audio_in"),Re(n,3,"SAMPLE_RATE:sample_rate"),Re(n,4,"EMBEDDINGS:embeddings_out"),Re(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.s(e),Ce(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=Pi(t),this.m.push(Ji(t)),Gi(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Gi(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=Pi(e),this.m.push(Ji(t));Gi(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{Gi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let Ki;qi.prototype.embed=qi.prototype.M,qi.prototype.setOptions=qi.prototype.s,qi.createFromModelPath=function(t,e){return $i(qi,t,{baseOptions:{modelAssetPath:e}})},qi.createFromModelBuffer=function(t,e){return $i(qi,t,{baseOptions:{modelAssetBuffer:e}})},qi.createFromOptions=function(t,e){return $i(qi,t,e)};const Xi=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 Yi(){if(void 0===Ki)try{await WebAssembly.instantiate(Xi),Ki=!0}catch{Ki=!1}return Ki}async function Qi(t,e=Wr``){const n=await Yi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Zi=class{};Zi.forVisionTasks=function(t){return Qi("vision",t)},Zi.forTextTasks=function(t){return Qi("text",t)},Zi.forGenAiExperimentalTasks=function(t){return Qi("genai_experimental",t)},Zi.forGenAiTasks=function(t){return Qi("genai",t)},Zi.forAudioTasks=function(t){return Qi("audio",t)},Zi.isSimdSupported=function(){return Yi()},exports.AudioClassifier=Hi,exports.AudioEmbedder=qi,exports.AudioTaskRunner=Wi,exports.FilesetResolver=Zi;
|
|
2
2
|
//# sourceMappingURL=audio_bundle_cjs.js.map
|