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