@mediapipe/tasks-text 1.3.0-rc.20261118 → 1.3.0-rc.20261120
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/package.json +1 -1
- package/text.d.ts +1 -25
- package/text_bundle.cjs +1 -1
- package/text_bundle.cjs.map +1 -1
- package/text_bundle.js +1 -1
- package/text_bundle.js.map +1 -1
- package/text_bundle.mjs +1 -1
- package/text_bundle.mjs.map +1 -1
- package/wasm/text_wasm_internal.js +9 -9
- package/wasm/text_wasm_internal.wasm +0 -0
- package/wasm/text_wasm_module_internal.js +9 -9
- package/wasm/text_wasm_module_internal.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediapipe/tasks-text",
|
|
3
|
-
"version": "1.3.0-rc.
|
|
3
|
+
"version": "1.3.0-rc.20261120",
|
|
4
4
|
"description": "MediaPipe Text Tasks. See the privacy notice at https://goo.gle/mediapipe-privacy.",
|
|
5
5
|
"main": "text_bundle.cjs",
|
|
6
6
|
"browser": "text_bundle.mjs",
|
package/text.d.ts
CHANGED
|
@@ -236,18 +236,6 @@ export declare class FilesetResolver {
|
|
|
236
236
|
* tasks.
|
|
237
237
|
*/
|
|
238
238
|
static forDecisionTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;
|
|
239
|
-
/**
|
|
240
|
-
* Creates a fileset for the MediaPipe GenAI tasks.
|
|
241
|
-
*
|
|
242
|
-
* @export
|
|
243
|
-
* @param basePath An optional base path to specify the directory the Wasm
|
|
244
|
-
* files should be loaded from. If not specified, the Wasm files are
|
|
245
|
-
* loaded from the host's root directory.
|
|
246
|
-
* @param useModule Whether to use ES6 Modules for the Wasm files.
|
|
247
|
-
* @return A `WasmFileset` that can be used to initialize MediaPipe GenAI
|
|
248
|
-
* tasks.
|
|
249
|
-
*/
|
|
250
|
-
static forGenAiTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;
|
|
251
239
|
/**
|
|
252
240
|
* Creates a fileset for the MediaPipe Retrieval tasks.
|
|
253
241
|
*
|
|
@@ -272,18 +260,6 @@ export declare class FilesetResolver {
|
|
|
272
260
|
* tasks.
|
|
273
261
|
*/
|
|
274
262
|
static forTextTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;
|
|
275
|
-
/**
|
|
276
|
-
* Creates a fileset for the MediaPipe LiteRT LM Text tasks.
|
|
277
|
-
*
|
|
278
|
-
* @export
|
|
279
|
-
* @param basePath An optional base path to specify the directory the Wasm
|
|
280
|
-
* files should be loaded from. If not specified, the Wasm files are
|
|
281
|
-
* loaded from the host's root directory.
|
|
282
|
-
* @param useModule Whether to use ES6 Modules for the Wasm files.
|
|
283
|
-
* @return A `WasmFileset` that can be used to initialize MediaPipe LiteRT LM
|
|
284
|
-
* Text tasks.
|
|
285
|
-
*/
|
|
286
|
-
static forLiteRtLmTextTasks(basePath?: string, useModule?: boolean): Promise<WasmFileset>;
|
|
287
263
|
/**
|
|
288
264
|
* Creates a fileset for the MediaPipe Vision tasks.
|
|
289
265
|
*
|
|
@@ -529,7 +505,7 @@ export declare class TextEmbedder extends TaskRunner {
|
|
|
529
505
|
*/
|
|
530
506
|
setOptions(options: TextEmbedderOptions): Promise<void>;
|
|
531
507
|
/**
|
|
532
|
-
* Performs
|
|
508
|
+
* Performs embedding extraction on the provided text and waits synchronously
|
|
533
509
|
* for the response.
|
|
534
510
|
*
|
|
535
511
|
* @export
|
package/text_bundle.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t="undefined"!=typeof self?self:{};function e(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var n,i,o,s,a=void 0,u="undefined"!=typeof TextDecoder,l="undefined"!=typeof TextEncoder;function c(t){if(l)t=(i||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}t:{for(var h=["CLOSURE_FLAGS"],f=t,d=0;d<h.length;d++)if(null==(f=f[h[d]])){s=null;break t}s=f}var p=s&&s[748402147];function v(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}function m(t){return m[" "](t),t}o=null==p||p,m[" "]=function(){};var g={},y=null;function b(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=y[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}w();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function w(){if(!y){y={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));g[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===y[e]&&(y[e]=t)}}}}var S="undefined"!=typeof Uint8Array,_=!(-1!=v().indexOf("Trident")||-1!=v().indexOf("MSIE"))&&"function"==typeof btoa,E=/[-_.]/g,T={"-":"+",_:"/",".":"="};function A(t){return T[t]||""}function I(t){if(!_)return b(t);t=E.test(t)?t.replace(E,A):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var j={};function x(){return P||=new L(null,j)}function N(t){O(j);var e=t.h;return null==(e=null==e||S&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?I(e):null)?e:t.h=e}var P,L=class{j(){return new Uint8Array(N(this)||0)}constructor(t,e){if(O(e),this.h=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function O(t){if(t!==j)throw Error("illegal external caller")}function B(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var k=void 0;function U(t){return B(t=Error(t),"warning"),t}function F(e,r){if(null!=e){var n=k??={},i=n[e]||0;i>=r||(n[e]=i+1,B(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function V(){return"function"==typeof BigInt}var C="function"==typeof Symbol&&"symbol"==typeof Symbol();function M(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var R,G=M("jas",void 0,!0),D=M(void 0,"1oa"),z=M(void 0,Symbol()),$=M(void 0,"0ubs"),H=M(void 0,"0ubsb"),W=M(void 0,"0actk"),K=M("m_m","ja",!0),q={ba:{value:0,configurable:!0,writable:!0,enumerable:!1}},Y=Object.defineProperties,J=C?G:"ba",X=[];function Q(t,e){C||J in t||Y(t,q),t[J]|=e}function Z(t,e){C||J in t||Y(t,q),t[J]=e}function tt(t,e){return 2&e&&(t|=2),1|t}Z(X,7),R=Object.freeze(X);var et={};function rt(t,e){return void 0===e?t.h!==nt&&!!(2&t.m[J]):!!(2&e)&&t.h!==nt}var nt={};function it(t,e){if(null!=t)if("string"==typeof t)t=t?new L(t,j):x();else if(!(t instanceof L))if(S&&null!=t&&t instanceof Uint8Array)t=t.length?new L(new Uint8Array(t),j):x();else{if(!e)throw Error();t=void 0}return t}function ot(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var s=o+(n?-1:0);for(e=128&e?1:0;e<s;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}Object.freeze({});var st={};function at(t){return 128&t?st:void 0}function ut(t){return t.ha=!0,t}var lt=ut(t=>"number"==typeof t),ct=ut(t=>"string"==typeof t),ht=ut(t=>"boolean"==typeof t),ft="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function dt(t){var e=t;if(ct(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(lt(e)&&!Number.isSafeInteger(e))throw Error(String(e));return ft?BigInt(t):t=ht(t)?t?"1":"0":ct(t)?t.trim()||"0":String(t)}var pt=ut(t=>ft?t>=mt&&t<=yt:"-"===t[0]?bt(t,vt):bt(t,gt)),vt=Number.MIN_SAFE_INTEGER.toString(),mt=ft?BigInt(Number.MIN_SAFE_INTEGER):void 0,gt=Number.MAX_SAFE_INTEGER.toString(),yt=ft?BigInt(Number.MAX_SAFE_INTEGER):void 0;function bt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var wt,St="function"==typeof Uint8Array.prototype.slice,_t=0,Et=0;function Tt(t){var e=t>>>0;_t=e,Et=(t-e)/4294967296>>>0}function At(t){if(t<0){Tt(0-t);let[e,r]=kt(_t,Et);_t=e>>>0,Et=r>>>0}else Tt(t)}function It(t){var e=wt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Et=0,_t=e.getUint32(0,!0)}function jt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Pt(t,e)}function xt(t,e){return dt(V()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Pt(t,e))}function Nt(t,e){return V()?dt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):dt(Ot(t,e))}function Pt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else V()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Lt(r)+Lt(t));return r}function Lt(t){return t=String(t),"0000000".slice(t.length)+t}function Ot(t,e){if(2147483648&e)if(V())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=kt(t,e);t="-"+Pt(r,n)}else t=Pt(t,e);return t}function Bt(t){if(t.length<16)At(Number(t));else if(V())t=BigInt(t),_t=Number(t&BigInt(4294967295))>>>0,Et=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);Et=_t=0;let r=t.length;for(let n=0+e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));Et*=1e6,(_t=1e6*_t+e)>=4294967296&&(Et+=Math.trunc(_t/4294967296),Et>>>=0,_t>>>=0)}if(e){let[t,e]=kt(_t,Et);_t=t,Et=e}}}function kt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ut(t){return Array.prototype.slice.call(t)}var Ft="function"==typeof BigInt?BigInt.asIntN:void 0,Vt="function"==typeof BigInt?BigInt.asUintN:void 0,Ct=Number.isSafeInteger,Mt=Number.isFinite,Rt=Math.trunc;function Gt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Dt(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}var zt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function $t(t){switch(typeof t){case"bigint":return!0;case"number":return Mt(t);case"string":return zt.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 Mt(t)?0|t:void 0}function Wt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Bt(t),Ot(_t,Et))}function Kt(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Bt(t),Pt(_t,Et))}function qt(t){if(t=Rt(t),!Ct(t)){At(t);var e=_t,r=Et;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=jt(e,r))?t?-e:e:t?"-"+e:e}return t}function Yt(t){return t=Rt(t),Ct(t)?t=String(t):(At(t),t=Ot(_t,Et)),t}function Jt(t){var e=Rt(Number(t));return Ct(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t))}function Xt(t){var e=Rt(Number(t));return Ct(e)?dt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),V()?dt(Ft(64,BigInt(t))):dt(Wt(t)))}function Qt(t){var e=typeof t;return null==t?t:"bigint"===e?dt(Ft(64,t)):$t(t)?"string"===e?Xt(t):dt(Ct(t)?t:Yt(t)):void 0}function Zt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return dt(Ft(64,t));if($t(t)){if("string"===e)return Jt(t);if("number"===e)return qt(t)}}function te(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return dt(Vt(64,t));if($t(t)){if("string"===e)return function(t){var e=Rt(Number(t));return Ct(e)&&e>=0?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Kt(t))}(t);if("number"===e)return function(t){return(t=Rt(t))>=0&&Ct(t)||(At(t),t=jt(_t,Et)),t}(t)}}function ee(t){if(null==t||"string"==typeof t||t instanceof L)return t}function re(t){if("string"!=typeof t)throw Error();return t}function ne(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ie(t){return null==t||"string"==typeof t?t:void 0}function oe(t,e,r){if(null!=t&&t[K]===et)return t;if(Array.isArray(t)){var n=0|t[J];return(r=n|32&r|2&r)!==n&&Z(t,r),new e(t)}}function se(t){return t}function ae(t){return z?t[z]:void 0}function ue(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var le,ce,he,fe=class{};function de(t,e){e<100||F($,1)}function pe(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=z;!i&&C&&s&&(o=t[s])&&ue(o,de),s=[];var a=t.length;o=4294967295;var u=!1,l=!!(64&e),c=l?128&e?0:-1:void 0;if(!(1&e)){var h=a&&t[a-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--a:h=void 0,!l||128&e||i||(u=!0,o=(le??se)(o-c,c,t,h,void 0)+c)}e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=r(i,n)))if(l&&f>=o){let t=f-c;(e??={})[t]=i}else s[f]=i}if(h)for(let t in h){if(null==(a=h[t])||null==(a=r(a,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?s[i]=a:(e??={})[t]=a}return e&&(u?s.push(e):s[o]=e),i&&(r=z)&&(t=ae(t))&&t instanceof fe&&(s[r]=function(t){var e=new fe;return ue(t,(t,r,n)=>{e[r]=Ut(n)}),e.h=t.h,e}(t)),s}function ve(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 e=0|t[J];return 0===t.length&&1&e?void 0:pe(t,e,ve)}if(null!=t&&t[K]===et)return me(t);if(t instanceof L){if(null==(e=t.h))t="";else if("string"==typeof e)t=e;else{if(_){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),w(),r=g[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,l=0;for(;t<e.length-2;t+=3){var o=e[t],s=e[t+1],a=e[t+2],u=r[o>>2];o=r[(3&o)<<4|s>>4],s=r[(15&s)<<2|a>>6],a=r[63&a],n[l++]=u+o+s+a}switch(u=0,a=i,e.length-t){case 2:a=r[(15&(u=e[t+1]))<<2]||i;case 1:e=e[t],n[l]=r[e>>2]+r[(3&e)<<4|u>>4]+a+i}e=n.join("")}t=t.h=e}return t}return}return t}function me(t){return pe(t=t.m,0|t[J],ve)}function ge(t,e){return ye(t,e[0],e[1])}function ye(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[J],o&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(o)throw Error("carr");F(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Z(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var s=(r=t).length;if(s){var a=s-1;let t=r[a];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((a-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var u in t)(s=+u)<a&&(r[s+e]=t[u],delete t[u]);i=-16760833&i|(1023&a)<<14;break t}}if(e){if((u=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&u)<<14}}}return Z(t,64|i|n),t}function be(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[J];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=_e(t,r,!1,e&&!(16&r)):(Q(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[K]===et?rt(t,r=0|(e=t.m)[J])?t:je(t,e,r)?we(t,e):_e(e,r):t instanceof L?t:void 0}function we(t,e,r){return t=new t.constructor(e),r&&(t.h=nt),t.o=nt,t}function Se(t){var e=t.m,r=0|e[J];return je(t,e,r)?we(t,e,!0):new t.constructor(_e(e,r,!1))}function _e(t,e,r,n){return n??=!!(34&e),t=pe(t,e,be,n),n=32,r&&(n|=2),Z(t,e=16769217&e|n),t}function Ee(t){var e=t.m,r=0|e[J];return rt(t,r)?je(t,e,r)?we(t,e,!0):new t.constructor(_e(e,r,!1)):t}function Te(t){if(t.h!==nt)return!1;var e=t.m;return Q(e=_e(e,0|e[J]),2048),t.m=e,t.h=void 0,t.o=void 0,!0}function Ae(t){if(!Te(t)&&rt(t,0|t.m[J]))throw Error()}function Ie(t,e){void 0===e&&(e=0|t[J]),32&e&&!(4096&e)&&Z(t,4096|e)}function je(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(Z(e,2|r),t.h=nt,!0)}var xe=dt(0);function Ne(t,e,r,n){if(null!==(t=Pe(t.m,e,r,n)))return t}function Pe(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),o=t.length-1;if(!(o<1+(r?0:-1))){if(i>=o){var s=t[o];if(null!=s&&"object"==typeof s&&s.constructor===Object){r=s[e];var a=!0}else{if(i!==o)return;r=s}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?s[e]=n:t[i]=n,n}return r}}function Le(t,e,r,n){Ae(t);var i=t.m;return Oe(i,0|i[J],e,r,n),t}function Oe(t,e,r,n,i){var o=r+(i?0:-1),s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){let i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=s?(t[o]=n,e):(void 0!==n&&(r>=(s=(e??=0|t[J])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Be(t,e){return null!=(t=Pe(t.m,e))&&t[K]===et||Array.isArray(t)}function ke(t,e,r){return Be(t,e=ze(t,r)===e?e:-1)}function Ue(t,e,r,n,i){var o=t.m,s=0|o[J];n=n&&4!==n?1!==n&&(t?rt(t,s):2&s)?1:n:4,i=!!i||3===n,2===n&&Te(t)&&(s=0|(o=t.m)[J]);var a=(t=Ve(o,e))===R?7:0|t[J],u=tt(a,s),l=!(4&u);if(l){let e=0,n=0;for(;e<t.length;e++){let i=r(t[e]);null!=i&&(t[n++]=i)}n<e&&(t.length=n),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(Z(t,u),2&u&&Object.freeze(t)),Fe(t,u,o,s,e,n,l,i)}function Fe(t,e,r,n,i,o,s,a){var u=e,l=Ce(e);return l&&2===o&&(t=Ut(t),u=0,e=er(e,n),n=Oe(r,n,i,t),l=!1),l||(1===o||4===o&&(2&e||!(16&e)&&32&n)?((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&Z(t,e),Object.freeze(t)):(a||(e|=16),e!==u&&Z(t,e))),2&e||!(4096&e||16&e)||Ie(r,n),t}function Ve(t,e,r){return t=Pe(t,e,r),Array.isArray(t)?t:R}function Ce(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Me(t){return it(t,!0)}function Re(t,e,r){Ae(t);var n=0|(t=t.m)[J];if(null==r)Oe(t,n,e);else{var i=r===R?7:0|r[J],o=i,s=Ce(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=Ut(r),o=0,i=er(i,n),a=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,s=0;s<r.length;s++){let t=r[s],e=re(t);Object.is(t,e)||(a&&(r=Ut(r),o=0,i=er(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=Ut(r),i=er(i,n)),Z(r,i)),Oe(t,n,e,r)}}function Ge(t,e){Ae(t),Oe(t=t.m,0|t[J],2,""===e?void 0:e)}function De(t,e,r){if(2&e)throw Error();var n=at(e),i=Ve(t,r,n),o=i===R?7:0|i[J],s=tt(o,e);return(2&s||Ce(s)||16&s)&&(s===o||Ce(s)||Z(i,s),i=Ut(i),o=0,s=er(s,e),Oe(t,e,r,i,n)),(s&=-13)!==o&&Z(i,s),i}function ze(t,e){return We($e(t=t.m),t,void 0,e)}function $e(t){if(C)return t[D]??(t[D]=new Map);if(D in t)return t[D];var e=new Map;return Object.defineProperty(t,D,{value:e}),e}function He(t,e,r,n,i){var o=$e(t),s=We(o,t,e,r,i);return s!==n&&(s&&(e=Oe(t,e,s,void 0,i)),o.set(r,n)),e}function We(t,e,r,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let s=n[t];null!=Pe(e,s,i)&&(0!==o&&(r=Oe(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function Ke(t,e,r){var n=0|t[J],i=at(n),o=Pe(t,r,i);if(null!=o&&o[K]===et){if(!rt(o))return Te(o),o.m;var s=o.m}else Array.isArray(o)&&(s=o,2&n&&Q(s,34));if(s){let t=0|s[J];2&t&&(s=_e(s,t))}return(s=ge(s,e))!==o&&Oe(t,n,r,s,i),s}function qe(t,e,r,n){var i=!1;if(n=function(t,e,r){return Pe(t,e,void 0,r)}(t,n,t=>{var n=oe(t,r,e);return i=n!==t&&null!=n,n}),null!=n)return i&&!rt(n)&&Ie(t,e),n}function Ye(t,e,r){var n=t.m,i=0|n[J];if(null==(e=qe(n,i,e,r)))return e;if(!rt(t,i=0|n[J])){let o=Ee(e);o!==e&&(Te(t)&&(i=0|(n=t.m)[J]),Ie(n,i=Oe(n,i,r,e=o)))}return e}function Je(t,e,r,n,i,o,s,a){o=o&&4!==o?1!==o&&(t?rt(t,r):2&r)?1:o:4,s=!!s||3===o;var u=!!a&&!(t?rt(t,r):2&r);(2===o||u)&&t&&Te(t)&&(r=0|(e=t.m)[J]);var l=(t=Ve(e,i))===R?7:0|t[J],c=tt(l,r);if(a=!(4&c)){var h=t,f=r;let e=!!(2&c);e&&(f|=2);let i=!e,o=!0,s=0,a=0;for(;s<h.length;s++){let t=oe(h[s],n,f);if(t instanceof n){if(!e){let e=rt(t);i&&=!e,o&&=e}h[a++]=t}}a<s&&(h.length=a),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==l&&(Z(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&r)))){for(Ce(c)&&(t=Ut(t),c=er(c,r),r=Oe(e,r,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=Ee(h))&&(n[l]=c);u|=8,Z(t,c=u=n.length?4096|u:-4097&u)}return Fe(t,c,e,r,i,o,a,s)}function Xe(t,e){var r=t.m;return Je(t,r,0|r[J],e,1,void 0,!1,!0)}function Qe(t){return null==t&&(t=void 0),t}function Ze(t,e,r,n,i){return Le(t,r,n=Qe(n),i),n&&!rt(n)&&Ie(t.m),t}function tr(t,e,r,n){t:{var i=n=Qe(n);Ae(t);let o=t.m,s=0|o[J];if(null==i){let t=$e(o);if(We(t,o,s,r)!==e)break t;t.set(r,0)}else s=He(o,s,r,e);Oe(o,s,e,i)}return n&&!rt(n)&&Ie(t.m),t}function er(t,e){return-273&(2&e?2|t:-3&t)}function rr(t,e,r,n){Ae(t);var i=t.m;t=Je(t,i,0|i[J],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===R?7:0|t[J],(n=rt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&Z(t,r),n||Ie(i)}function nr(t,e,r,n){return Ye(t,e,r=ze(t,n)===r?r:-1)}function ir(t,e,r){if(null!=r)t:{if(!$t(r))throw U("int64");switch(typeof r){case"string":r=Xt(r);break t;case"bigint":r=dt(Ft(64,r));break t;default:r=dt(Ct(r)?r:Yt(r))}}return Le(t,e,r)}function or(t,e,r){return Le(t,e,null==r?r:function(t){if(!$t(t))throw U("uint64");var e=typeof t;switch(e){case"string":return e=Rt(Number(t)),Ct(e)&&e>=0?t=dt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=V()?dt(Vt(64,BigInt(t))):dt(Kt(t))),t;case"bigint":return dt(Vt(64,t));default:return t>=0&&Ct(t)||((t=Rt(t))>=0&&Ct(t)?t=String(t):(At(t),t=Pt(_t,Et))),dt(t)}}(r))}function sr(t,e,r){if(null!=r){if(!Mt(r))throw U("enum");r|=0}return Le(t,e,r)}function ar(t,e,r){Ae(t),Ue(t,e,ie,2,!0).push(re(r))}var ur=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.h=e}};function lr(t,e){if("string"==typeof t)return new ur(I(t),e);if(Array.isArray(t))return new ur(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new ur(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new ur(t,!1);if(t.constructor===L)return e=N(t)||new Uint8Array(0),new ur(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new ur(t,!1);throw Error()}function cr(t,e){var r=0,n=0,i=0,o=t.j,s=t.h;do{var a=o[s++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=o[s++]))<<i;if(gr(t,s),!(128&a))return e(r>>>0,n>>>0);throw Error()}function hr(t){for(var e=0,r=t.h,n=r+10,i=t.j;r<n;){let n=i[r++];if(e|=n,!(128&n))return gr(t,r),!!(127&e)}throw Error()}function fr(t){var e=t.j,r=t.h,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return gr(t,r),i}function dr(t){return cr(t,Nt)}function pr(t){var e=t.j,r=t.h,n=e[r+0],i=e[r+1],o=e[r+2];return e=e[r+3],gr(t,t.h+4),(n|i<<8|o<<16|e<<24)>>>0}function vr(t){var e=pr(t);t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,255==r?e?NaN:t*(1/0):0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(e+8388608)}function mr(t){return fr(t)}function gr(t,e){if(t.h=e,e>t.l)throw Error()}function yr(t,e){if(e<0)throw Error();var r=t.h;if((e=r+e)>t.l)throw Error();return t.h=e,r}function br(t,e){if(0==e)return x();var r=yr(t,e);return t.M&&t.A?r=t.j.subarray(r,r+e):(t=t.j,r=r===(e=r+e)?new Uint8Array(0):St?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?x():new L(r,j)}var wr=class{constructor(t,e,r,n){this.j=null,this.A=!1,this.h=this.l=this.o=0,this.init(t,e,r,n)}init(t,e,r,{M:n=!1,P:i=!1}={}){this.M=n,this.P=i,t&&(t=lr(t,this.P),this.j=t.buffer,this.A=t.h,this.o=e||0,this.l=void 0!==r?this.o+r:this.j.length,this.h=this.o)}clear(){this.j=null,this.A=!1,this.h=this.l=this.o=0,this.M=!1}},Sr=[],_r=0;function Er(t,e,r,n){if(Br.length){let i=Br.pop();return i.v(n),i.h.init(t,e,r,n),i}return new Or(t,e,r,n)}function Tr(t){t.h.clear(),t.l=-1,t.j=-1,Br.length<100&&Br.push(t)}function Ar(t){var e=t.h;if(e.h==e.l)return!1;t.o=t.h.h;var r=fr(t.h)>>>0;if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.l=e,t.j=r,!0}function Ir(t){try{switch(t.j){case 0:0!=t.j?Ir(t):hr(t.h);break;case 1:var e=t.h;gr(e,e.h+8);break;case 2:if(2!=t.j)Ir(t);else{var r=fr(t.h)>>>0,n=t.h;gr(n,n.h+r)}break;case 5:var i=t.h;gr(i,i.h+4);break;case 3:jr();let o=t.l;try{for(;;){if(!Ar(t))throw Error();if(4==t.j){if(t.l!=o)throw Error();break}Ir(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function jr(){if(_r>=100)throw new SyntaxError;_r++}function xr(t,e,r){var n=t.h.l,i=fr(t.h)>>>0,o=(i=t.h.h+i)-n;if(o<=0&&(t.h.l=i,r(e,t,void 0,void 0,void 0),o=i-t.h.h),o)throw Error();t.h.h=i,t.h.l=n}function Nr(t){var i=fr(t.h)>>>0,o=yr(t=t.h,i);if(t=t.j,u){var s,l=t;(s=n)||(s=n=new TextDecoder("utf-8",{fatal:!0})),i=o+i,l=0===o&&i===l.length?l:l.subarray(o,i);try{var c=s.decode(l)}catch(t){if(void 0===a){try{s.decode(new Uint8Array([128]))}catch(t){}try{s.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(n=void 0),t}}else{i=(c=o)+i,o=[];let n,a=null;for(;c<i;){var h=t[c++];h<128?o.push(h):h<224?c>=i?e():(n=t[c++],h<194||128!=(192&n)?(c--,e()):o.push((31&h)<<6|63&n)):h<240?c>=i-1?e():(n=t[c++],128!=(192&n)||224===h&&n<160||237===h&&n>=160||128!=(192&(s=t[c++]))?(c--,e()):o.push((15&h)<<12|(63&n)<<6|63&s)):h<=244?c>=i-2?e():(n=t[c++],128!=(192&n)||n-144+(h<<28)>>30||128!=(192&(s=t[c++]))||128!=(192&(l=t[c++]))?(c--,e()):(h=(7&h)<<18|(63&n)<<12|(63&s)<<6|63&l,h-=65536,o.push(55296+(h>>10&1023),56320+(1023&h)))):e(),o.length>=8192&&(a=r(a,o),o.length=0)}c=r(a,o)}return c}function Pr(t){var e=fr(t.h)>>>0;return br(t.h,e)}function Lr(t,e,r){var n=fr(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)r.push(e(t.h))}var Or=class{constructor(t,e,r,n){if(Sr.length){let i=Sr.pop();i.init(t,e,r,n),t=i}else t=new wr(t,e,r,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.v(n)}v({T:t=!1}={}){this.T=t}},Br=[];function kr(t){return new Fr(4294967295&t,Math.floor(t/4294967296))}var Ur,Fr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Vr(t){return new Wr(4294967295&t,Math.floor(t/4294967296))}var Cr,Mr,Rr,Gr,Dr,zr,$r,Hr,Wr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Kr(t,e,r){return"undefined"!=typeof BigInt64Array?($r||($r=new BigInt64Array(1),Hr=new Uint32Array($r.buffer),$r[0]=BigInt(1),zr=1===Hr[0]),$r[0]=t,new e(Hr[t=zr?0:1],Hr[1-t])):(Dr||(Mr=BigInt(Number.MIN_SAFE_INTEGER),Rr=BigInt(Number.MAX_SAFE_INTEGER),Gr=BigInt(4294967295),Dr=BigInt(32)),t>=Mr&&t<=Rr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Gr),Number(t>>Dr))))}function qr(t,e,r){for(;r>0||e>127;)t.h.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.h.push(e)}function Yr(t,e){for(;e>127;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function Jr(t,e){if(e>=0)Yr(t,e);else{for(let r=0;r<9;r++)t.h.push(127&e|128),e>>=7;t.h.push(1)}}function Xr(t,e){Bt(e),function(t){var e=Et>>31;t(_t<<1^e,(Et<<1|_t>>>31)^e)}((e,r)=>{qr(t,e>>>0,r>>>0)})}function Qr(t,e){t.h.push(e>>>0&255),t.h.push(e>>>8&255),t.h.push(e>>>16&255),t.h.push(e>>>24&255)}var Zr=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function tn(t,e){0!==e.length&&(t.l.push(e),t.j+=e.length)}function en(t,e,r){Yr(t.h,8*e+r)}function rn(t,e){return en(t,e,2),e=t.h.end(),tn(t,e),e.push(t.j),e}function nn(t,e){var r=e.pop();for(r=t.j+t.h.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.j++;e.push(r),t.j++}function on(t,e,r){if(null!=r)switch(en(t,e,0),typeof r){case"number":t=t.h,At(r),qr(t,_t,Et);break;case"bigint":r=Kr(r,Wr,Vr),qr(t.h,r.j,r.h);break;default:r?/^-?\d+$/.test(r)?(Bt(r),r=new Wr(_t,Et)):r=null:r=Cr||=new Wr(0,0),qr(t.h,r.j,r.h)}}function sn(t,e,r){en(t,e,2),Yr(t.h,r.length),tn(t,t.h.end()),tn(t,r)}var an=class{constructor(){this.l=[],this.j=0,this.h=new Zr}};function un(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var ln=un(),cn=un(),hn=un(),fn=un(),dn=un(),pn=un(),vn=un(),mn=un(),gn=un(),yn=un(),bn=un(),wn=un();function Sn(t,e,r){var n=t.m;z&&z in n&&(n=n[z])&&delete n[e.h],e.j?e.o(t,e.j,e.h,r,e.l):e.o(t,e.h,r,e.l)}var _n=class{constructor(t,e){this.m=ye(t,e,void 0,2048)}toJSON(){return me(this)}};_n.prototype[K]=et,_n.prototype.toString=function(){return this.m.toString()};var En=class{constructor(t,e,r){this.h=t,this.j=e,t=ln,this.l=!!t&&r===t||!1}};function Tn(t,e){return new En(t,e,ln)}function An(t,e,r,n,i){null!=(e=Vn(e,n))&&(r=rn(t,r),i(e,t),nn(t,r))}var In,jn,xn=Tn(function(t,e,r,n,i){return 2===t.j&&(xr(t,Ke(e,n,r),i),!0)},An),Nn=Tn(function(t,e,r,n,i){return 2===t.j&&(xr(t,Ke(e,n,r),i),!0)},An),Pn=Symbol(),Ln=Symbol(),On=Symbol(),Bn=Symbol(),kn=Symbol();function Un(t,e,r,n){var i=n[t];if(i)return i;(i={}).W=n,i.L=function(t){switch(typeof t){case"boolean":return ce||=[0,void 0,!0];case"number":return t>0?void 0:0===t?he||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],s=1;o&&o.constructor===Object&&(i.extensions=o,"function"==typeof(o=n[++s])&&o.length>0&&(i.U=!0,In??=o,jn??=n[s+1],o=n[s+=2]));for(var a={};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=n[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++s]);var l=void 0;if(o instanceof En?t=o:(t=xn,s--),t?.l){o=n[++s],l=n;var c=s;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++s])&&o<0&&(c-=o,o=n[++s]);u<c;u++){let n=a[u];l?r(i,u,t,l,n):e(i,u,t,n)}}return n[t]=i}function Fn(t){return Array.isArray(t)?t[0]instanceof En?t:[Nn,t]:[t,void 0]}function Vn(t,e){return t instanceof _n?t.m:Array.isArray(t)?ge(t,e):void 0}function Cn(t,e,r,n){var i=r.h;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Mn(t,e,r,n,i){var o,s,a=r.h;t[e]=(t,e,r)=>a(t,e,r,s||=Un(Ln,Cn,Mn,n).L,o||=Rn(n),i)}function Rn(t){var e=t[On];if(null!=e)return e;var r=Un(Ln,Cn,Mn,t);return e=r.U?(t,e)=>In(t,e,r):(t,e)=>{t:{jr();try{for(;Ar(e)&&4!=e.j;){let u=e.l,l=r[u];if(null==l){let t=r.extensions;if(t){let e=t[u];if(e){let t=Dn(e);null!=t&&(l=r[u]=t)}}}if(null==l||!l(e,t,u)){var n=e;let r=n.o;if(Ir(n),n.T)var i=void 0;else{let t=n.h.h-r;n.h.h=r,i=br(n.h,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[z]??(o[z]=new fe))[s]??(n[s]=[])).push(a)}}let l=ae(t);l&&(l.h=r.W[kn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}u=void 0}return u},t[On]=e,t[kn]=Gn.bind(t),e}function Gn(t,e,r,n){var i=this[Ln],o=this[On],s=ge(void 0,i.L),a=ae(t);if(a){var u=!1,l=i.extensions;if(l){if(i=(e,r,i)=>{if(0!==i.length)if(l[r])for(let t of i){e=Er(t);try{u=!0,o(s,e)}finally{Tr(e)}}else n?.(t,r,i)},null==e)ue(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[J];if(2&n&&2048&n&&!r?.la)throw Error();let i=at(n),o=(e,o)=>{if(null!=Pe(t,e,i)){if(1===r?.ka)return;throw Error()}null!=o&&(n=Oe(t,n,e,o,i)),delete a[e]};null==e?ot(s,0|s[J],(t,e)=>{o(t,e)}):o(e,Pe(s,e,i))}}}}function Dn(t){var e=(t=Fn(t))[0].h;if(t=t[1]){let r=Rn(t),n=Un(Ln,Cn,Mn,t).L;return(t,i,o)=>e(t,i,o,n,r)}return e}function zn(t,e,r){t[e]=r.j}function $n(t,e,r,n){var i,o,s=r.j;t[e]=(t,e,r)=>s(t,e,r,o||=Un(Pn,zn,$n,n).L,i||=Hn(n))}function Hn(t){var e=t[Bn];if(!e){let r=Un(Pn,zn,$n,t);e=(t,e)=>Wn(t,e,r),t[Bn]=e}return e}function Wn(t,e,r){ot(t,0|t[J],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.extensions)&&(r=r[e])){var n=(r=Fn(r))[0].j;if(r=r[1]){let e=Hn(r),i=Un(Pn,zn,$n,r).L;r=t.U?jn(i,e):(t,r,o)=>n(t,r,o,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||F(H,3)}}),(t=ae(t))&&ue(t,(t,r,n)=>{for(tn(e,e.h.end()),t=0;t<n.length;t++)tn(e,N(n[t])||new Uint8Array(0))})}var Kn=dt(0);function qn(t,e,r){if(Array.isArray(e)){var n=0|e[J];if(4&n)return e;for(var i=0,o=0;i<e.length;i++){let r=t(e[i]);null!=r&&(e[o++]=r)}return o<i&&(e.length=o),t=1|n,r&&(t=-1537&t|4),t!==n&&Z(e,t),r&&2&t&&Object.freeze(e),e}}var Yn=(t,e)=>{var r=new an;Wn(t.m,r,Un(Pn,zn,$n,e)),tn(r,r.h.end()),t=new Uint8Array(r.j);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function Jn(t,e,r){return new En(t,e,r)}function Xn(t,e,r){return new En(t,e,r)}function Qn(t,e,r){Oe(t,0|t[J],e,r,at(0|t[J]))}function Zn(t,e,r){null!=(e=Zt(e))&&on(t,r,e)}function ti(t,e,r){null!=(e=Ht(e))&&null!=e&&(en(t,r,0),Jr(t.h,e))}function ei(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(en(t,r,0),t.h.h.push(e?1:0))}function ri(t,e,r){null!=(e=ie(e))&&sn(t,r,c(e))}function ni(t,e,r,n,i){null!=(e=Vn(e,n))&&(r=rn(t,r),i(e,t),nn(t,r))}function ii(t,e,r){null!=(e=ee(e))&&sn(t,r,lr(e,!0).buffer)}function oi(t,e,r){e=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Mt(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(en(t,r,0),Yr(t.h,e))}function si(t,e,r){null!=(e=Ht(e))&&(e=parseInt(e,10),en(t,r,0),Jr(t.h,e))}function ai(t,e,r){return 0===t.j&&(Qn(e,r,dr(t.h)),!0)}function ui(t,e,r){return(0===t.j||2===t.j)&&(e=De(e,0|e[J],r),2==t.j?Lr(t,fr,e):e.push(fr(t.h)),!0)}function li(t,e,r){return 2===t.j&&(Qn(e,r,(t=Pr(t))===x()?void 0:t),!0)}var ci=Jn(function(t,e,r){if(1!==t.j)return!1;var n=t.h;t=pr(n);var i=pr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,Qn(e,r,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,e,r){null!=(e=Gt(e))&&(en(t,r,1),t=t.h,(r=wt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),_t=r.getUint32(0,!0),Et=r.getUint32(4,!0),Qr(t,_t),Qr(t,Et))},yn),hi=Jn(function(t,e,r){return 5===t.j&&(Qn(e,r,vr(t.h)),!0)},function(t,e,r){null!=(e=Gt(e))&&(en(t,r,5),t=t.h,It(e),Qr(t,_t))},gn),fi=Xn(function(t,e,r){return(5===t.j||2===t.j)&&(e=De(e,0|e[J],r),2==t.j?Lr(t,vr,e):e.push(vr(t.h)),!0)},function(t,e,r){if(null!=(e=qn(Gt,e,!0))&&e.length){en(t,r,2),Yr(t.h,4*e.length);for(let n=0;n<e.length;n++)r=t.h,It(e[n]),Qr(r,_t)}},gn),di=Jn(function(t,e,r){return ai(t,e,r)},Zn,pn),pi=Jn(function(t,e,r){return ai(t,e,r)},Zn,pn),vi=Xn(function(t,e,r){return 0!==t.j&&2!==t.j?t=!1:(e=De(e,0|e[J],r),2==t.j?Lr(t,dr,e):e.push(dr(t.h)),t=!0),t},function(t,e,r){if(null!=(e=qn(Zt,e,!1)))for(let n=0;n<e.length;n++)on(t,r,e[n])},pn),mi=Jn(function(t,e,r){return 0!==t.j?e=!1:(Qn(e,r,(t=dr(t.h))===Kn?void 0:t),e=!0),e},Zn,pn),gi=Jn(function(t,e,r){return 0!==t.j?t=!1:(Qn(e,r,cr(t.h,xt)),t=!0),t},function(t,e,r){if(null!=(e=te(e))&&null!=e)switch(en(t,r,0),typeof e){case"number":t=t.h,At(e),qr(t,_t,Et);break;case"bigint":r=Kr(e,Fr,kr),qr(t.h,r.j,r.h);break;default:e?/^\d+$/.test(e)?(Bt(e),r=new Fr(_t,Et)):r=null:r=Ur||=new Fr(0,0),qr(t.h,r.j,r.h)}},vn),yi=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,fr(t.h)),!0)},ti,fn),bi=Xn(ui,function(t,e,r){if(null!=(e=qn(Ht,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(en(n,i,0),Jr(n.h,o))}},fn),wi=Xn(ui,function(t,e,r){if(null!=(e=qn(Ht,e,!0))&&e.length){r=rn(t,r);for(let r=0;r<e.length;r++)Jr(t.h,e[r]);nn(t,r)}},fn),Si=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,0===(t=fr(t.h))?void 0:t),!0)},ti,fn),_i=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,hr(t.h)),!0)},ei,cn),Ei=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,!1===(t=hr(t.h))?void 0:t),!0)},ei,cn),Ti=Xn(function(t,e,r){return 2===t.j&&(t=Nr(t),De(e,0|e[J],r).push(t),!0)},function(t,e,r){if(null!=(e=qn(ie,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&sn(n,i,c(o))}},hn),Ai=Jn(function(t,e,r){return 2===t.j&&(Qn(e,r,""===(t=Nr(t))?void 0:t),!0)},ri,hn),Ii=Jn(function(t,e,r){return 2===t.j&&(Qn(e,r,Nr(t)),!0)},ri,hn),ji=function(t,e,r=ln){return new En(t,e,r)}(function(t,e,r,n,i){return 2===t.j&&(n=ge(void 0,n),De(e,0|e[J],r).push(n),xr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)ni(t,e[o],r,n,i);1&(t=0|e[J])||Z(e,1|t)}}),xi=Tn(function(t,e,r,n,i,o){if(2!==t.j)return!1;var s=0|e[J];return He(e,s,o,r,at(s)),xr(t,e=Ke(e,n,r),i),!0},ni),Ni=Jn(function(t,e,r){return 2===t.j&&(Qn(e,r,Pr(t)),!0)},ii,bn),Pi=Xn(function(t,e,r){return 2===t.j&&(t=Pr(t),De(e,0|e[J],r).push(t),!0)},function(t,e,r){if(null!=(e=qn(ee,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&sn(n,i,lr(o,!0).buffer)}},bn),Li=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,fr(t.h)>>>0),!0)},oi,dn),Oi=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,0===(t=fr(t.h)>>>0)?void 0:t),!0)},oi,dn),Bi=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,fr(t.h)),!0)},si,wn),ki=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,0===(t=fr(t.h))?void 0:t),!0)},si,wn),Ui=Jn(function(t,e,r){return 0!==t.j?t=!1:(Qn(e,r,function(t){return cr(t,(t,e)=>{var r=-(1&t);return Nt(t=(t>>>1|e<<31)^r,e>>>1^r)})}(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Zt(e))&&null!=e)switch(en(t,r,0),typeof e){case"number":t=t.h,e=(r=e)<0,Tt(r=2*Math.abs(r)),r=_t;let n=Et;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),qr(t,_t=r,Et=n);break;case"bigint":t=t.h,e=e<<BigInt(1)^e>>BigInt(63),_t=Number(BigInt.asUintN(32,e)),Et=Number(BigInt.asUintN(32,e>>BigInt(32))),qr(t,_t,Et);break;default:Xr(t.h,e)}},mn);class Fi{constructor(t,e){var r=io;this.h=t,this.j=e,this.o=Ze,this.defaultValue=void 0,this.l=null!=r.ia?st:void 0}register(){m(this)}}function Vi(t,e){return(r,n)=>{t:{let o={P:!0};n&&Object.assign(o,n),r=Er(r,void 0,void 0,o);try{let n=new t,o=n.m;Rn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Tr(r)}i=void 0}return i}}function Ci(t){return function(){return Yn(this,t)}}var Mi,Ri=[0,Ni,Pi,_i,Ii],Gi=[0,Ai,[0,ki,[0,mi,Si],ki,-1,[0,Bi],ki,-1],Jn(li,ii,bn)],Di=[0,Ai,Jn(li,function(t,e,r){if(null!=e){if(e instanceof _n){let n=e.na;return void(n?(e=n(e),null!=e&&sn(t,r,lr(e,!0).buffer)):F(H,3))}if(Array.isArray(e))return void F(H,3)}ii(t,e,r)},bn)],zi=[0,1,[0,12,yi,10,_i],[0,7,[0,yi,-1]]],$i=globalThis.trustedTypes;var Hi=class{constructor(t){this.h=t}toString(){return this.h+""}};function Wi(t){var e;return void 0===Mi&&(Mi=function(){var t=null;if(!$i)return t;try{let e=t=>t;t=$i.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Mi)?e.createScriptURL(t):t,new Hi(t)}function Ki(t,...e){if(0===e.length)return Wi(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Wi(r)}var qi=[0,yi,Bi,_i,-1,wi,Bi,-1,_i,-1],Yi=[0,Bi,-1,_i],Ji=class extends _n{constructor(t){super(t)}},Xi=[0,_i,Ii,_i,Bi,-1,Xn(function(t,e,r){return(0===t.j||2===t.j)&&(e=De(e,0|e[J],r),2==t.j?Lr(t,mr,e):e.push(fr(t.h)),!0)},function(t,e,r){if(null!=(e=qn(Ht,e,!0))&&e.length){r=rn(t,r);for(let r=0;r<e.length;r++)Jr(t.h,e[r]);nn(t,r)}},wn),Ii,-1,[0,_i,-1],Bi,_i,-1,Yi],Qi=class extends _n{constructor(t){super(t)}j(){return Be(this,9)}},Zi=[0,3,_i,-1,2,[0,[2],yi,xi,[0,Li]],[0,Bi,_i,Bi,_i,Bi,4,[0,_i,Ii,-1,_i,yi,-1,_i],Bi,_i,-4,Bi,Ti,_i,Ti,_i,-1,yi,_i,-3,[0,_i,yi],[0,Ii,yi,-1],[0,_i],[0,_i,-1],[0,_i,yi,-1]],[0,[3,4],Ii,-1,xi,[0,yi],xi,[0,Bi,-2]],[0],Ii,_i],to=[0,Ii,-2],eo=class extends _n{constructor(t){super(t)}},ro=[0],no=[0,yi,_i,1,_i,-4],io=class extends _n{constructor(t){super(t,2)}},oo={};oo[336783863]=[0,Ii,_i,-1,yi,[0,[1,2,3,4,5,6,7,8,9],xi,ro,xi,Xi,xi,to,xi,no,xi,qi,xi,[0,Ii,-2],xi,[0,Ii,Bi],xi,Zi,xi,Yi],[0,Ii],_i,[0,[1,3],[2,4],xi,[0,wi],-1,xi,[0,Ti],-1,ji,[0,Ii,-1]],Ii];var so=[0,mi,-1,Ei,-3,mi,wi,Ai,Si,mi,-1,Ei,Si,Ei,-2,Ai];function ao(t){ar(t,3,"TEXT:text_in")}var uo=class extends _n{constructor(t){super(t,500)}v(t){return Ze(this,0,7,t)}},lo=[-1,{}],co=[0,Ii,1,lo],ho=[0,Ii,Ti,lo];function fo(t){ar(t,10,"text_in")}var po=class extends _n{constructor(t){super(t,500)}v(t){return Ze(this,0,1001,t)}};po.prototype.j=Ci([-500,ji,[-500,Ai,-1,Ti,-3,[-2,oo,_i],ji,Di,Si,-1,co,ho,ji,[0,Ai,Ei],Ai,so,Si,Ti,987,Ti],4,ji,[-500,Ii,-1,[-1,{}],998,Ii],ji,[-500,Ii,Ti,-1,[-2,{},_i],997,Ti,-1],Si,ji,[-500,Ii,Ti,lo,998,Ti],Ti,Si,co,ho,ji,[0,Ai,-1,lo],Ti,-2,so,Ai,-1,Ei,[0,Ei,Oi],978,lo,ji,Di]);var vo=class extends _n{constructor(t){super(t)}},mo=class extends _n{constructor(t){super(t)}j(){return Xe(this,vo)}},go=class extends _n{constructor(t){super(t)}},yo=Vi(class extends _n{constructor(t){super(t)}},[0,ji,[0,1,yi,Ii,[0,ji,[0,yi,hi,Ii,-1]]],pi]),bo=class extends _n{constructor(t){super(t)}},wo=class extends _n{constructor(t){super(t)}j(){var t=Ne(this,1,void 0,Me);return null==t?x():t}},So=class extends _n{constructor(t){super(t)}},_o=[1,2],Eo=Vi(class extends _n{constructor(t){super(t)}},[0,ji,[0,_o,xi,[0,fi],xi,[0,Ni],yi,Ii],pi]),To=class extends _n{constructor(t){super(t)}},Ao=class extends _n{constructor(t){super(t)}},Io=[0,_i,-1],jo=class extends _n{constructor(t){super(t)}j(){return ke(this,2,xo)}l(){return nr(this,Qi,6,xo)}},xo=[1,2,3,4,5,6],No=class extends _n{constructor(t){super(t)}j(){return null!=Ne(this,1,void 0,Me)}l(){return null!=ie(Ne(this,2))}},Po=class extends _n{constructor(t){super(t)}},Lo=[0,Ni,Ii,[0,yi,pi,-1],[0,gi,pi]],Oo=[0,Lo,_i,[0,xo,xi,no,xi,Xi,xi,qi,xi,ro,xi,to,xi,Zi],Bi],Bo=class extends _n{constructor(t){super(t)}},ko=new Fi(462704549,Bo);oo[462704549]=[0,Oo,[0,Ii,yi,hi,Ti,-1]];var Uo=class extends _n{constructor(t){super(t)}},Fo=new Fi(477589892,Uo);function Vo(t,e){if(e=e?Se(e):new To,void 0!==t.displayNamesLocale?Le(e,1,ne(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Le(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw U("int32");if(!Mt(r))throw U("int32");r|=0}Le(e,2,r)}else"maxResults"in t&&Le(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}`);Le(e,3,r)}else"scoreThreshold"in t&&Le(e,3);return void 0!==t.categoryAllowlist?Re(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Le(e,4),void 0!==t.categoryDenylist?Re(e,5,t.categoryDenylist):"categoryDenylist"in t&&Le(e,5),e}function Co(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Mo(t){var e={classifications:Xe(t,go).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:Ht(Ne(t,1))??0??-1,score:Ne(t,2,void 0,Gt)??0??0,categoryName:ie(Ne(t,3))??""??"",displayName:ie(Ne(t,4))??""??""})),headIndex:e,headName:r}}(Ye(t,mo,4)?.j()??[],Ht(Ne(t,2))??0,ie(Ne(t,3))??""))};return null!=function(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?qt(t):Jt(t):void 0}(Ne(t,2,void 0,Qt))&&(e.timestampMs=Co(Ne(t,2,void 0,Qt)??xe)),e}function Ro(t){return Array.from(t,t=>t>127?t-256:t)}function Go(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let o=0;o<t.length;o++)r+=t[o]*e[o],n+=t[o]*t[o],i+=e[o]*e[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}function Do(t,e,r){return r=`wasm${r?"_module":""}_internal`,Promise.resolve({wasmLoaderPath:`${e}/${t}_${r}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`})}oo[477589892]=[0,Oo,Io,1,Lo];var zo=class{};function $o(t){return sr(new Ho,1,t)}zo.forVisionTasks=function(t,e=!1){return Do("vision",t??Ki``,e)},zo.forLiteRtLmTextTasks=function(t,e=!1){return Do("litertlm_text",t??Ki``,e)},zo.forTextTasks=function(t,e=!1){return Do("text",t??Ki``,e)},zo.forRetrievalTasks=function(t,e=!1){return Do("retrieval",t??Ki``,e)},zo.forGenAiTasks=function(t,e=!1){return Do("genai",t??Ki``,e)},zo.forDecisionTasks=function(t,e=!1){return Do("decision",t??Ki``,e)},zo.forAudioTasks=function(t,e=!1){return Do("audio",t??Ki``,e)};var Ho=class extends _n{constructor(t){super(t)}},Wo=class extends _n{constructor(t){super(t)}},Ko=[0,Bi,2,gi,-2,pi,ji,[0,Bi,pi]],qo=class extends _n{constructor(t){super(t)}},Yo=class extends _n{constructor(t){super(t)}};function Jo(t,e){return sr(t,1,e)}function Xo(t,e){return sr(t,2,e)}var Qo=class extends _n{constructor(t){super(t)}},Zo=[3,4,5,6,7],ts=class extends _n{constructor(t){super(t)}},es=class extends _n{constructor(t){super(t)}};es.prototype.j=Ci([0,[0,Bi,Ii,-3,Bi],[0,Zo,Bi,-1,xi,[0,Bi,Ii,gi],xi,Ko,xi,[0,1,Ko],xi,[0,Bi],xi,[0,Bi,Ii,gi]]]);var rs=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,e,r){var n=!!t.keepalive&&function(t){return t?"string"==typeof t?(new TextEncoder).encode(t).length:t.byteLength:0}(t.body)<=61440,i=this.h&&!n?new AbortController:void 0,o=i&&t.O>0?setTimeout(()=>{i.abort()},t.O):void 0;try{let o=await fetch(t.url,{method:t.fa,headers:{...t.ea},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},...n&&{keepalive:!0},signal:t.O&&i?i.signal:null});o.ok?e?.(await o.text()):r?.(o.status)}catch(t){if("AbortError"===t?.name)r?.(408);else r?.(0)}finally{clearTimeout(o)}}};var ns=class extends _n{constructor(t){super(t,37)}},is=[-4,{},zi,Bi,Gi],os=[0,Ii,Bi,1,Ii,-1,Bi,1,Bi,1,pi],ss=[0,Bi,Ii,-2],as=[0,Ii,Bi],us=[0,Ii,Bi],ls=[0,_i,-3],cs=[0,Bi,Ii,-1,pi,yi,-1,Ii,-5,ji,[0,Ii,-4],-1,_i,[0,_i,-3],Bi];var hs,fs=class extends _n{constructor(t){super(t,19)}},ds=(hs=[-19,{},[0,Bi,1,[0,Ii,-6,pi,yi,Ii,-1,pi],1,[0,Ii,1,Ii,-5],Ii,-1,[0,Bi,Ii,-8],[0,Ii,-3],[0,Ii,Bi,Ii,-2],[0,Ii,-1,Bi,Ii,-1,Bi,Ii,-1,[0,ji,[0,Ii,-1],_i,Ii,-5],[0,Bi,_i,yi,-2]],pi,[0,Ii,-3,pi,yi,Ii,-1],[0,Bi,Ii,-1],[0,Ii,-9],[0,Ii,-6,Bi,Ii,1,Ii,_i,Bi,-1,_i,Ii,-2,Bi,Ii,Bi,Ii,yi,-1],1,[0,Bi],1,[0,Ii,-4],1,os,[0,[1,2,3,4,5,6],xi,os,xi,as,xi,us,xi,[0,Bi],xi,cs,xi,ss],as,us,cs,[0,[0,Bi,Ii,-1,pi,yi,-1,Ii,-4,ji,[0,Ii,-4],-1,1,ls],[0,Bi,Ii,-1,pi,yi,-1,Ii,-4,ls]],ss,[0,Ii,[0,yi,-3,Bi],Bi,-2,[0,yi,-1],_i],4,[0,Ii,Bi,Ii,-1,pi,Bi,Ii,-1,Bi,yi,-1]],Bi,ji,[-37,{},di,Ii,ji,[0,Ii,-1],Ni,1,Ni,[0,Ti,-1,bi,vi,-1],Ii,[0,yi,Ii,-1],_i,yi,pi,Ii,-1,Ui,Ri,di,Ni,Bi,bi,pi,-1,[0,Bi,-1],Ii,_i,Ii,wi,Ii,-1,ci,1,ci,is,_i,[0,Bi,[0,hi,yi,-2],[0,hi]],[0,Bi,pi]],di,Pi,Ii,-1,di,Bi,-1,[0,_i,-1,Bi,_i],[0,pi,-1,Ii],[0,di,_i,pi],pi,1,Li,1,is],t=>Yn(t,hs)),ps=class{constructor(t){this.j=[],this.o=new rs,this.l=t??"",this.h=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.h&&(clearInterval(this.h),this.h=void 0),this.flush()}flush(t,e){if(this.error)e?.("net-send-failed");else if(0===this.j.length)t?.();else{var r=this.j;this.j=[],r=function(t){var e=new fs;Ae(e=sr(e,2,1786));var r=e.m,n=0|r[J];if(null==t)Oe(r,n,3);else{var i=t===R?7:0|t[J],o=i,s=Ce(i),a=s||Object.isFrozen(t),u=!0,l=!0;for(let e=0;e<t.length;e++){var c=t[e];s||(c=rt(c),u&&=!c,l&&=c)}s||(i=u?13:5,i=l?-4097&i:4096|i),a&&i===o||(t=Ut(t),o=0,i=er(i,n)),i!==o&&Z(t,i),n=Oe(r,n,3,t),2&i||!(4096&i||16&i)||Ie(r,n)}return e}(r),r=ds(r),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",fa:"POST",O:1e4,body:r,ga:2,ea:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.l},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.j=[],void 0!==this.h&&(clearInterval(this.h),this.h=void 0),e?.("net-send-failed",t)})}}};class vs{constructor(){this.K=this.F=this.J=this.D=this.H=this.I=this.G=0}}function ms(t,e){var r=new es;r=Ze(r,0,1,t.V),r=Ze(r,0,2,e),e=Le(e=new ns,6,it(r=r.j(),!1)),(t=t.C).error||t.j.push(e)}function gs(t,e){++t.h.G,t.j.set(e,performance.now())}function ys(t,e){var r={G:e.G-t.l.G,I:e.I-t.l.I,H:e.H-t.l.H,D:e.D-t.l.D,J:e.J-t.l.J,F:e.F,K:e.K},n=Xo(Jo(new Qo,t.B),1);r=ws(t,r),ms(t,n=tr(n,4,Zo,r)),t.l=e}function bs(t,e){var r=t.j.get(e);if(void 0!==r&&(t.j.delete(e),e=performance.now()-r,++t.h.H,t.h.J+=e,t.h.F=Math.max(t.h.F,e),t.A=Math.max(t.A,e),performance.now()>t.o+3e4)){for(let[n,i]of t.j.entries())e=n,i<r&&(t.h.D++,t.j.delete(e));r={...t.h,K:performance.now()-t.o},t.h.F=0,t.o=performance.now(),ys(t,r)}}function ws(t,e){var r=new Wo;return t=or(t=ir(t=sr(r,1,t.u),7,e.D),5,e.F),t=or(t,6,e.K),e.H>0&&or(t,4,e.J/e.H),0!==e.G&&(r=ir(r=$o(3),2,e.G),rr(t,8,Ho,r)),0!==e.I&&(e=ir(r=$o(4),2,e.I),rr(t,8,Ho,e)),t}var Ss=class{constructor(t,e,r){this.S=performance.now(),this.o=performance.now(),this.j=new Map,this.A=0,this.h=new vs,this.l=new vs,this.C=new ps(r),this.B=function(t){switch(t){case"AudioClassifier":return 4;case"AudioEmbedder":return 5;case"TextClassifier":return 6;case"TextEmbedder":return 7;case"GestureRecognizer":return 8;case"HandDetector":return 9;case"HandLandmarker":return 10;case"ImageClassifier":return 11;case"ImageEmbedder":return 12;case"ImageSegmenter":return 13;case"ObjectDetector":return 14;case"FaceDetector":return 15;case"FaceLandmarker":return 16;case"InteractiveSegmenter":case"InteractiveSegmenterLegacy":return 18;case"HolisticLandmarker":return 20;case"LlmInference":return 21;case"LanguageDetector":return 22;case"PoseLandmarker":return 23;case"UniversalEmbedder":return 28;case"SemanticRetriever":return 29;case"DecisionMaker":return 30;case"TextSummarizer":return 26;case"TextProofreader":return 27;case"AudioTranscriber":return 31;case"TextToSpeech":return 32;default:return 0}}(t),this.u=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(e),t=new ts,"undefined"==typeof navigator?e=0:(e=navigator.userAgent,e=/Android/i.test(e)?1:/iPhone|iPad|iPod/i.test(e)?2:/Windows/i.test(e)?5:/Macintosh/i.test(e)?4:/Linux/i.test(e)?3:0),t=Le(t=sr(t,1,e),2,ne("")),t=Le(t,3,ne("")),t=Le(t,4,ne("1.3.0")),t=Le(t,5,ne("")),this.V=sr(t,6,function(){var t=globalThis.__HOST_ENVIRONMENT__;if("string"==typeof t)switch(t){case"ANDROID":return 1;case"IOS":return 2;case"PYTHON":return 3;case"WEB":break;case"FLUTTER":return 5;case"FLUTTER_WEB":return 6;default:return 0}return 4}())}N(){var t=new Yo;t=or(t=sr(t,1,this.u),3,performance.now()-this.S),ms(this,t=tr(Xo(Jo(new Qo,this.B),0),3,Zo,t)),this.o=performance.now()}ca(){var t={...this.h,D:this.h.D+this.j.size,F:this.A,K:performance.now()-this.S};ys(this,t);var e=new qo;e=Ze(e,0,2,t=ws(this,t)),ms(this,e=tr(t=Xo(Jo(new Qo,this.B),2),5,Zo,e))}close(){var t=this.C;"function"==typeof t.close?t.close():t.flush()}};function _s(){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 Es(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function Ts(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function As(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function Is(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function js(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var xs=function(t){return class extends t{get R(){return this.i}aa(){if("function"==typeof this.R._mediapipeLoggerGetEncodedApiKey){let t=this.R._mediapipeLoggerGetEncodedApiKey();return this.R._decodeBase64(t)}}}}(function(t){return class extends t{da(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.l=!0,this.i=t,this.h=null,this.j=0,this.o="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:_s()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var 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){var r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Ts(this,n||"input_audio",n=>{Ts(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var o=4*t.length;this.j!==o&&(this.h&&this.i._free(this.h),this.h=this.i._malloc(o),this.j=o),this.i.HEAPF32.set(t,this.h/4),Ts(this,n,t=>{this.i._addAudioToInputStream(this.h,e,r,t,i)})}addGpuBufferToStream(t,e,r){Ts(this,e,e=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");e?this.i._bindTextureToStream(e):this.i._bindTextureToCanvas();var n=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[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.l||i===this.i.canvas.width&&o===this.i.canvas.height||(this.i.canvas.width=i,this.i.canvas.height=o);var[s,a]=[i,o];this.i._addBoundTextureToStream(e,s,a,r)})}addBoolToStream(t,e,r){Ts(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){Ts(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){Ts(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){Ts(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){Ts(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){Ts(this,e,e=>{Ts(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){Ts(this,e,e=>{As(this,Object.keys(t),n=>{As(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){Ts(this,r,r=>{Ts(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){Ts(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ts(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){Ts(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){Ts(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){Ts(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){Ts(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){Ts(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){Ts(this,e,e=>{Ts(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){Ts(this,r,r=>{Ts(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ts(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){Is(this,t,e),Ts(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){js(this,t,e),Ts(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Is(this,t,e),Ts(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){js(this,t,e),Ts(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Is(this,t,e),Ts(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){js(this,t,e),Ts(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Is(this,t,e),Ts(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){js(this,t,e),Ts(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Is(this,t,e),Ts(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){js(this,t,e),Ts(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Is(this,t,e),Ts(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){js(this,t,e),Ts(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Is(this,t,e),Ts(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){js(this,t,e),Ts(this,t,t=>{this.i._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Is(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),Ts(this,t,t=>{this.i._attachAudioListener(t,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}})),Ns=class extends xs{};async function Ps(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await Es(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Es(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),function(t,e){e=e.ma??"";var r=t.h.aa();t.j=new Ss(t.A(),e,r)}(t,r),await t.v(r),t}async function Ls(t,e,r){return Ps(t,e,r)}function Os(t,e,r){try{t.h.i.FS_unlink(`/${r}`)}catch{}t.h.i.FS_createDataFile("/",r,e,!0,!1,!0),Bs(t,`/${r}`)}function Bs(t,e){var r=Ye(t.baseOptions,No,1)||new No;"string"==typeof e?(Le(r,2,ne(e)),Le(r,1)):e instanceof Uint8Array&&(Le(r,1,it(e,!1)),Le(r,2)),Ze(t.baseOptions,0,1,r)}function ks(t,e,r=!0,n=!1){if(r){let r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ye(t.baseOptions,No,1)?.j()||Ye(t.baseOptions,No,1)?.l()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");!function(t,e){var r=Ye(t.baseOptions,jo,3);if(!r){var n=r=new jo,i=new eo;tr(n,4,xo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Ji,tr(e,2,xo,n)):(e=r,n=new eo,tr(e,4,xo,n))),Ze(t.baseOptions,0,3,r)}(t,r);let i=n?"model.litertlm":"model.dat";if(r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${t.status})`)}).then(e=>{Os(t,new Uint8Array(e),i),t.o()});if(r.modelAssetBuffer instanceof Uint8Array)n?Os(t,r.modelAssetBuffer,i):Bs(t,r.modelAssetBuffer);else if(r.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(r.modelAssetBuffer).then(e=>{n?Os(t,e,i):Bs(t,e),t.o()})}return t.o(),Promise.resolve()}function Us(t){try{let e=t.C.length;if(1===e)throw Error(t.C[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.C.map(t=>t.message).join(", "))}finally{t.C=[]}}function Fs(t,e){if(t.j&&void 0!==e){let r=Ye(t.baseOptions,jo,3);r?.j()||r?.l()?.j()?(++(t=t.j).h.I,t.j.set(e,performance.now())):gs(t.j,e)}}function Vs(t,e){t.B=Math.max(t.B,e)}var Cs=class{constructor(t){this.h=t,this.C=[],this.B=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,e){this.h.attachErrorListener((t,e)=>{this.C.push(Error(e))}),this.h.da(),this.h.setGraph(t,e),this.j?.N(),Us(this)}finishProcessing(t){this.h.finishProcessing(),Us(this),this.j&&void 0!==t&&bs(this.j,t)}close(){this.j?.ca(),this.j?.close(),this.h.closeGraph()}};Cs.prototype.close=Cs.prototype.close;var Ms=class extends Cs{constructor(t,e){super(new Ns(t,e)),this.u={languages:[]},Ze(t=this.l=new Bo,0,1,e=new Po)}A(){return"LanguageDetector"}v(t){return Ze(this.l,0,2,Vo(t,Ye(this.l,To,2))),ks(this,t)}get baseOptions(){return Ye(this.l,Po,1)}set baseOptions(t){Ze(this.l,0,1,t)}Y(t){this.u={languages:[]};var e=this.B+1;return Fs(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}o(){var t=new po;fo(t),ar(t,15,"classifications_out");var e=new io;Sn(e,ko,this.l);var r=new uo;Ge(r,ne("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),ao(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.v(e),rr(t,1,uo,r),this.h.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=Mo(yo(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.u.languages=t[0].categories.map(t=>({languageCode:t.categoryName,probability:t.score})),Vs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Vs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};Ms.prototype.detect=Ms.prototype.Y,Ms.prototype.setOptions=Ms.prototype.v,Ms.createFromModelPath=function(t,e){return Ls(Ms,t,{baseOptions:{modelAssetPath:e}})},Ms.createFromModelBuffer=function(t,e){return Ls(Ms,t,{baseOptions:{modelAssetBuffer:e}})},Ms.createFromOptions=function(t,e){return Ls(Ms,t,e)};var Rs=class extends Cs{constructor(t,e){super(new Ns(t,e)),this.u={classifications:[]},Ze(t=this.l=new Bo,0,1,e=new Po)}A(){return"TextClassifier"}v(t){return Ze(this.l,0,2,Vo(t,Ye(this.l,To,2))),ks(this,t)}get baseOptions(){return Ye(this.l,Po,1)}set baseOptions(t){Ze(this.l,0,1,t)}X(t){this.u={classifications:[]};var e=this.B+1;return Fs(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}o(){var t=new po;fo(t),ar(t,15,"classifications_out");var e=new io;Sn(e,ko,this.l);var r=new uo;Ge(r,ne("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),ao(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.v(e),rr(t,1,uo,r),this.h.attachProtoListener("classifications_out",(t,e)=>{this.u=Mo(yo(t)),Vs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Vs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Gs(t){switch(t){case"RETRIEVAL_QUERY":default:return"search result";case"SEMANTIC_SIMILARITY":return"sentence similarity";case"CLASSIFICATION":return"classification";case"CLUSTERING":return"clustering";case"QUESTION_ANSWERING":return"question answering";case"FACT_CHECKING":return"fact checking";case"CODE_RETRIEVAL":return"code retrieval"}}Rs.prototype.classify=Rs.prototype.X,Rs.prototype.setOptions=Rs.prototype.v,Rs.createFromModelPath=function(t,e){return Ls(Rs,t,{baseOptions:{modelAssetPath:e}})},Rs.createFromModelBuffer=function(t,e){return Ls(Rs,t,{baseOptions:{modelAssetBuffer:e}})},Rs.createFromOptions=function(t,e){return Ls(Rs,t,e)};var Ds=class extends Cs{constructor(t,e){super(new Ns(t,e)),this.u={embeddings:[]},Ze(t=this.l=new Uo,0,1,e=new Po)}A(){return"TextEmbedder"}v(t){var e=this.l,r=Ye(this.l,Ao,2);return r=r?Se(r):new Ao,void 0!==t.l2Normalize?Le(r,1,Dt(t.l2Normalize)):"l2Normalize"in t&&Le(r,1),void 0!==t.quantize?Le(r,2,Dt(t.quantize)):"quantize"in t&&Le(r,2),Ze(e,0,2,r),ks(this,t)}get baseOptions(){return Ye(this.l,Po,1)}set baseOptions(t){Ze(this.l,0,1,t)}Z(t,e){var r=this.B+1;if(Fs(this,r),e)t:{let r=e.type,n=e.title&&e.title.length>0?e.title:"none";switch(e="DOCUMENT"!==e.textRole,r){case"RETRIEVAL_DOCUMENT":t=`title: ${n} | text: ${t}`;break t;case"RETRIEVAL_QUERY":t=`task: ${Gs(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${Gs(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${Gs(r)} | query: ${t}`}}return this.h.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.u}o(){var t=new po;fo(t),ar(t,15,"embeddings_out");var e=new io;Sn(e,Fo,this.l);var r=new uo;Ge(r,ne("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),ao(r),ar(r,4,"EMBEDDINGS:embeddings_out"),r.v(e),rr(t,1,uo,r),this.h.attachProtoListener("embeddings_out",(t,e)=>{t=Eo(t),this.u=function(t){return{embeddings:Xe(t,So).map(t=>{var e={headIndex:Ht(Ne(t,3))??0??-1,headName:ie(Ne(t,4))??""??""};if(ke(t,1,_o))t=Ue(t=nr(t,bo,1,_o),1,Gt),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=nr(t,wo,2,_o)?.j()?.j()??r}return e}),timestampMs:Co(Ne(t,2,void 0,Qt)??xe)}}(t),Vs(this,e)}),this.h.attachEmptyPacketListener("embeddings_out",t=>{Vs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function zs(t,e){return Ls($s,t,e)}Ds.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Go(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Go(Ro(t.quantizedEmbedding),Ro(e.quantizedEmbedding))}return t},Ds.prototype.embed=Ds.prototype.Z,Ds.prototype.setOptions=Ds.prototype.v,Ds.createFromModelPath=function(t,e){return Ls(Ds,t,{baseOptions:{modelAssetPath:e}})},Ds.createFromModelBuffer=function(t,e){return Ls(Ds,t,{baseOptions:{modelAssetBuffer:e}})},Ds.createFromOptions=function(t,e){return Ls(Ds,t,e)};var $s=class extends Cs{constructor(t,e){super(new Ns(t,e)),this.baseOptions=new Po,this.u=this.l=this.maxNumTokens=0}A(){return"TextProofreader"}async v(t){if(0!==this.l)throw Error("LiteRT LM Tasks do not support updating options after initialization.");return void 0!==t.maxNumTokens&&(this.maxNumTokens=t.maxNumTokens),ks(this,t,!(!t.baseOptions||!t.baseOptions.modelAssetPath&&!t.baseOptions.modelAssetBuffer),!0)}o(){this.l=this.h.i.createTextProofreader("/model.litertlm",this.maxNumTokens),this.j.N()}proofread(t){var e=this.h.i;if(0===this.l)throw Error("TextProofreader is already closed.");var r=this.u++;gs(this.j,r);try{return e.proofread(this.l,t)}finally{bs(this.j,r)}}proofreadStreaming(t,e){var r=this.h.i;if(0===this.l)throw Error("TextProofreader is already closed.");if(r._userProofreaderListener)throw Error("Another proofread is already in progress.");var n=this.u++;gs(this.j,n);var i,o,s=new Promise((t,e)=>{i=t,o=e}),a=()=>{r._userProofreaderListener=void 0,bs(this.j,n)},u="";r._userProofreaderListener=(t,r,n,s)=>{if(n)a(),o(Error(n));else{if(u+=t,e)try{e(t,r)}catch(t){return a(),void o(t)}r&&(a(),i({proofreadText:u,corrections:s??[]}))}};try{r.proofreadStreaming(this.l,t)}catch(t){a(),o(t)}return s}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextProofreader(this.l)}catch{}this.l=0}super.close()}};function Hs(t,e){return Ls(Ws,t,e)}$s.prototype.proofreadStreaming=$s.prototype.proofreadStreaming,$s.createFromModelBuffer=function(t,e,r=0){return zs(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r})},$s.createFromModelPath=function(t,e,r=0){return zs(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r})},$s.createFromOptions=zs;var Ws=class extends Cs{constructor(t,e){super(new Ns(t,e)),this.baseOptions=new Po,this.maxNumTokens=0,this.mode="KEYPOINTS",this.u=this.l=0}A(){return"TextSummarizer"}async v(t){if(0!==this.l)throw Error("LiteRT LM Tasks do not support updating options after initialization.");return void 0!==t.maxNumTokens&&(this.maxNumTokens=t.maxNumTokens),void 0!==t.mode&&(this.mode=t.mode),ks(this,t,!(!t.baseOptions||!t.baseOptions.modelAssetPath&&!t.baseOptions.modelAssetBuffer),!0)}o(){this.l=this.h.i.createTextSummarizer("/model.litertlm",this.maxNumTokens,this.mode),this.j.N()}summarize(t){var e=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");var r=this.u++;gs(this.j,r);try{return e.summarize(this.l,t)}finally{bs(this.j,r)}}summarizeStreaming(t,e){var r=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");if(r._userSummarizerListener)throw Error("Another summarization is already in progress.");var n=this.u++;gs(this.j,n);var i,o,s=new Promise((t,e)=>{i=t,o=e}),a=()=>{r._userSummarizerListener=void 0,bs(this.j,n)},u="";r._userSummarizerListener=(t,r,n)=>{if(n)a(),o(Error(n));else{if(u+=t,e)try{e(t,r)}catch(t){return a(),void o(t)}r&&(a(),i(u))}};try{r.summarizeStreaming(this.l,t)}catch(t){a(),o(t)}return s}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextSummarizer(this.l)}catch{}this.l=0}super.close()}};Ws.prototype.summarizeStreaming=Ws.prototype.summarizeStreaming,Ws.createFromModelBuffer=function(t,e,r=0,n="KEYPOINTS"){return Hs(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r,mode:n})},Ws.createFromModelPath=function(t,e,r=0,n="KEYPOINTS"){return Hs(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r,mode:n})},Ws.createFromOptions=Hs,exports.FilesetResolver=zo,exports.LanguageDetector=Ms,exports.TaskRunner=Cs,exports.TextClassifier=Rs,exports.TextEmbedder=Ds,exports.TextProofreader=$s,exports.TextSummarizer=Ws;
|
|
1
|
+
"use strict";var t="undefined"!=typeof self?self:{};function e(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var n,i,o,s,a=void 0,u="undefined"!=typeof TextDecoder,l="undefined"!=typeof TextEncoder;function c(t){if(l)t=(i||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}t:{for(var h=["CLOSURE_FLAGS"],f=t,d=0;d<h.length;d++)if(null==(f=f[h[d]])){s=null;break t}s=f}var p=s&&s[748402147];function v(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}function g(t){return g[" "](t),t}o=null==p||p,g[" "]=function(){};var m={},y=null;function b(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=y[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}w();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function w(){if(!y){y={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));m[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===y[e]&&(y[e]=t)}}}}var _="undefined"!=typeof Uint8Array,S=!(-1!=v().indexOf("Trident")||-1!=v().indexOf("MSIE"))&&"function"==typeof btoa,E=/[-_.]/g,A={"-":"+",_:"/",".":"="};function I(t){return A[t]||""}function T(t){if(!S)return b(t);t=E.test(t)?t.replace(E,I):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var j={};function x(){return L||=new N(null,j)}function B(t){U(j);var e=t.h;return null==(e=null==e||_&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?T(e):null)?e:t.h=e}var L,N=class{j(){return new Uint8Array(B(this)||0)}constructor(t,e){if(U(e),this.h=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function U(t){if(t!==j)throw Error("illegal external caller")}function O(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var P=void 0;function k(t){return O(t=Error(t),"warning"),t}function F(e,r){if(null!=e){var n=P??={},i=n[e]||0;i>=r||(n[e]=i+1,O(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function V(){return"function"==typeof BigInt}var C="function"==typeof Symbol&&"symbol"==typeof Symbol();function M(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var R,D=M("jas",void 0,!0),G=M(void 0,"1oa"),$=M(void 0,Symbol()),z=M(void 0,"0ubs"),H=M(void 0,"0ubsb"),W=M(void 0,"0actk"),q=M("m_m","ja",!0),K={aa:{value:0,configurable:!0,writable:!0,enumerable:!1}},Y=Object.defineProperties,J=C?D:"aa",X=[];function Q(t,e){C||J in t||Y(t,K),t[J]|=e}function Z(t,e){C||J in t||Y(t,K),t[J]=e}function tt(t,e){return 2&e&&(t|=2),1|t}Z(X,7),R=Object.freeze(X);var et={};function rt(t,e){return void 0===e?t.h!==nt&&!!(2&t.m[J]):!!(2&e)&&t.h!==nt}var nt={};function it(t,e){if(null!=t)if("string"==typeof t)t=t?new N(t,j):x();else if(!(t instanceof N))if(_&&null!=t&&t instanceof Uint8Array)t=t.length?new N(new Uint8Array(t),j):x();else{if(!e)throw Error();t=void 0}return t}function ot(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var s=o+(n?-1:0);for(e=128&e?1:0;e<s;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}Object.freeze({});var st={};function at(t){return 128&t?st:void 0}function ut(t){return t.ha=!0,t}var lt=ut(t=>"number"==typeof t),ct=ut(t=>"string"==typeof t),ht=ut(t=>"boolean"==typeof t),ft="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function dt(t){var e=t;if(ct(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(lt(e)&&!Number.isSafeInteger(e))throw Error(String(e));return ft?BigInt(t):t=ht(t)?t?"1":"0":ct(t)?t.trim()||"0":String(t)}var pt=ut(t=>ft?t>=gt&&t<=yt:"-"===t[0]?bt(t,vt):bt(t,mt)),vt=Number.MIN_SAFE_INTEGER.toString(),gt=ft?BigInt(Number.MIN_SAFE_INTEGER):void 0,mt=Number.MAX_SAFE_INTEGER.toString(),yt=ft?BigInt(Number.MAX_SAFE_INTEGER):void 0;function bt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var wt,_t="function"==typeof Uint8Array.prototype.slice,St=0,Et=0;function At(t){var e=t>>>0;St=e,Et=(t-e)/4294967296>>>0}function It(t){if(t<0){At(0-t);let[e,r]=Pt(St,Et);St=e>>>0,Et=r>>>0}else At(t)}function Tt(t){var e=wt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Et=0,St=e.getUint32(0,!0)}function jt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Lt(t,e)}function xt(t,e){return dt(V()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Lt(t,e))}function Bt(t,e){return V()?dt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):dt(Ut(t,e))}function Lt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else V()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Nt(r)+Nt(t));return r}function Nt(t){return t=String(t),"0000000".slice(t.length)+t}function Ut(t,e){if(2147483648&e)if(V())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Pt(t,e);t="-"+Lt(r,n)}else t=Lt(t,e);return t}function Ot(t){if(t.length<16)It(Number(t));else if(V())t=BigInt(t),St=Number(t&BigInt(4294967295))>>>0,Et=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);Et=St=0;let r=t.length;for(let n=0+e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));Et*=1e6,(St=1e6*St+e)>=4294967296&&(Et+=Math.trunc(St/4294967296),Et>>>=0,St>>>=0)}if(e){let[t,e]=Pt(St,Et);St=t,Et=e}}}function Pt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function kt(t){return Array.prototype.slice.call(t)}var Ft="function"==typeof BigInt?BigInt.asIntN:void 0,Vt="function"==typeof BigInt?BigInt.asUintN:void 0,Ct=Number.isSafeInteger,Mt=Number.isFinite,Rt=Math.trunc;function Dt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Gt(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}var $t=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function zt(t){switch(typeof t){case"bigint":return!0;case"number":return Mt(t);case"string":return $t.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 Mt(t)?0|t:void 0}function Wt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Ot(t),Ut(St,Et))}function qt(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Ot(t),Lt(St,Et))}function Kt(t){if(t=Rt(t),!Ct(t)){It(t);var e=St,r=Et;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=jt(e,r))?t?-e:e:t?"-"+e:e}return t}function Yt(t){return t=Rt(t),Ct(t)?t=String(t):(It(t),t=Ut(St,Et)),t}function Jt(t){var e=Rt(Number(t));return Ct(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t))}function Xt(t){var e=Rt(Number(t));return Ct(e)?dt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),V()?dt(Ft(64,BigInt(t))):dt(Wt(t)))}function Qt(t){var e=typeof t;return null==t?t:"bigint"===e?dt(Ft(64,t)):zt(t)?"string"===e?Xt(t):dt(Ct(t)?t:Yt(t)):void 0}function Zt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return dt(Ft(64,t));if(zt(t)){if("string"===e)return Jt(t);if("number"===e)return Kt(t)}}function te(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return dt(Vt(64,t));if(zt(t)){if("string"===e)return function(t){var e=Rt(Number(t));return Ct(e)&&e>=0?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),qt(t))}(t);if("number"===e)return function(t){return(t=Rt(t))>=0&&Ct(t)||(It(t),t=jt(St,Et)),t}(t)}}function ee(t){if(null==t||"string"==typeof t||t instanceof N)return t}function re(t){if("string"!=typeof t)throw Error();return t}function ne(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ie(t){return null==t||"string"==typeof t?t:void 0}function oe(t,e,r){if(null!=t&&t[q]===et)return t;if(Array.isArray(t)){var n=0|t[J];return(r=n|32&r|2&r)!==n&&Z(t,r),new e(t)}}function se(t){return t}function ae(t){return $?t[$]:void 0}function ue(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var le,ce,he,fe=class{};function de(t,e){e<100||F(z,1)}function pe(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=$;!i&&C&&s&&(o=t[s])&&ue(o,de),s=[];var a=t.length;o=4294967295;var u=!1,l=!!(64&e),c=l?128&e?0:-1:void 0;if(!(1&e)){var h=a&&t[a-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--a:h=void 0,!l||128&e||i||(u=!0,o=(le??se)(o-c,c,t,h,void 0)+c)}e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=r(i,n)))if(l&&f>=o){let t=f-c;(e??={})[t]=i}else s[f]=i}if(h)for(let t in h){if(null==(a=h[t])||null==(a=r(a,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?s[i]=a:(e??={})[t]=a}return e&&(u?s.push(e):s[o]=e),i&&(r=$)&&(t=ae(t))&&t instanceof fe&&(s[r]=function(t){var e=new fe;return ue(t,(t,r,n)=>{e[r]=kt(n)}),e.h=t.h,e}(t)),s}function ve(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 e=0|t[J];return 0===t.length&&1&e?void 0:pe(t,e,ve)}if(null!=t&&t[q]===et)return ge(t);if(t instanceof N){if(null==(e=t.h))t="";else if("string"==typeof e)t=e;else{if(S){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),w(),r=m[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,l=0;for(;t<e.length-2;t+=3){var o=e[t],s=e[t+1],a=e[t+2],u=r[o>>2];o=r[(3&o)<<4|s>>4],s=r[(15&s)<<2|a>>6],a=r[63&a],n[l++]=u+o+s+a}switch(u=0,a=i,e.length-t){case 2:a=r[(15&(u=e[t+1]))<<2]||i;case 1:e=e[t],n[l]=r[e>>2]+r[(3&e)<<4|u>>4]+a+i}e=n.join("")}t=t.h=e}return t}return}return t}function ge(t){return pe(t=t.m,0|t[J],ve)}function me(t,e){return ye(t,e[0],e[1])}function ye(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[J],o&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(o)throw Error("carr");F(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Z(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var s=(r=t).length;if(s){var a=s-1;let t=r[a];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((a-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var u in t)(s=+u)<a&&(r[s+e]=t[u],delete t[u]);i=-16760833&i|(1023&a)<<14;break t}}if(e){if((u=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&u)<<14}}}return Z(t,64|i|n),t}function be(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[J];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=Se(t,r,!1,e&&!(16&r)):(Q(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[q]===et?rt(t,r=0|(e=t.m)[J])?t:je(t,e,r)?we(t,e):Se(e,r):t instanceof N?t:void 0}function we(t,e,r){return t=new t.constructor(e),r&&(t.h=nt),t.o=nt,t}function _e(t){var e=t.m,r=0|e[J];return je(t,e,r)?we(t,e,!0):new t.constructor(Se(e,r,!1))}function Se(t,e,r,n){return n??=!!(34&e),t=pe(t,e,be,n),n=32,r&&(n|=2),Z(t,e=16769217&e|n),t}function Ee(t){var e=t.m,r=0|e[J];return rt(t,r)?je(t,e,r)?we(t,e,!0):new t.constructor(Se(e,r,!1)):t}function Ae(t){if(t.h!==nt)return!1;var e=t.m;return Q(e=Se(e,0|e[J]),2048),t.m=e,t.h=void 0,t.o=void 0,!0}function Ie(t){if(!Ae(t)&&rt(t,0|t.m[J]))throw Error()}function Te(t,e){void 0===e&&(e=0|t[J]),32&e&&!(4096&e)&&Z(t,4096|e)}function je(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(Z(e,2|r),t.h=nt,!0)}var xe=dt(0);function Be(t,e,r,n){if(null!==(t=Le(t.m,e,r,n)))return t}function Le(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),o=t.length-1;if(!(o<1+(r?0:-1))){if(i>=o){var s=t[o];if(null!=s&&"object"==typeof s&&s.constructor===Object){r=s[e];var a=!0}else{if(i!==o)return;r=s}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?s[e]=n:t[i]=n,n}return r}}function Ne(t,e,r,n){Ie(t);var i=t.m;return Ue(i,0|i[J],e,r,n),t}function Ue(t,e,r,n,i){var o=r+(i?0:-1),s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){let i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=s?(t[o]=n,e):(void 0!==n&&(r>=(s=(e??=0|t[J])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Oe(t,e){return null!=(t=Le(t.m,e))&&t[q]===et||Array.isArray(t)}function Pe(t,e,r){return Oe(t,e=$e(t,r)===e?e:-1)}function ke(t,e,r,n,i){var o=t.m,s=0|o[J];n=n&&4!==n?1!==n&&(t?rt(t,s):2&s)?1:n:4,i=!!i||3===n,2===n&&Ae(t)&&(s=0|(o=t.m)[J]);var a=(t=Ve(o,e))===R?7:0|t[J],u=tt(a,s),l=!(4&u);if(l){let e=0,n=0;for(;e<t.length;e++){let i=r(t[e]);null!=i&&(t[n++]=i)}n<e&&(t.length=n),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(Z(t,u),2&u&&Object.freeze(t)),Fe(t,u,o,s,e,n,l,i)}function Fe(t,e,r,n,i,o,s,a){var u=e,l=Ce(e);return l&&2===o&&(t=kt(t),u=0,e=er(e,n),n=Ue(r,n,i,t),l=!1),l||(1===o||4===o&&(2&e||!(16&e)&&32&n)?((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&Z(t,e),Object.freeze(t)):(a||(e|=16),e!==u&&Z(t,e))),2&e||!(4096&e||16&e)||Te(r,n),t}function Ve(t,e,r){return t=Le(t,e,r),Array.isArray(t)?t:R}function Ce(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Me(t){return it(t,!0)}function Re(t,e,r){Ie(t);var n=0|(t=t.m)[J];if(null==r)Ue(t,n,e);else{var i=r===R?7:0|r[J],o=i,s=Ce(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=kt(r),o=0,i=er(i,n),a=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,s=0;s<r.length;s++){let t=r[s],e=re(t);Object.is(t,e)||(a&&(r=kt(r),o=0,i=er(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=kt(r),i=er(i,n)),Z(r,i)),Ue(t,n,e,r)}}function De(t,e){Ie(t),Ue(t=t.m,0|t[J],2,""===e?void 0:e)}function Ge(t,e,r){if(2&e)throw Error();var n=at(e),i=Ve(t,r,n),o=i===R?7:0|i[J],s=tt(o,e);return(2&s||Ce(s)||16&s)&&(s===o||Ce(s)||Z(i,s),i=kt(i),o=0,s=er(s,e),Ue(t,e,r,i,n)),(s&=-13)!==o&&Z(i,s),i}function $e(t,e){return We(ze(t=t.m),t,void 0,e)}function ze(t){if(C)return t[G]??(t[G]=new Map);if(G in t)return t[G];var e=new Map;return Object.defineProperty(t,G,{value:e}),e}function He(t,e,r,n,i){var o=ze(t),s=We(o,t,e,r,i);return s!==n&&(s&&(e=Ue(t,e,s,void 0,i)),o.set(r,n)),e}function We(t,e,r,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let s=n[t];null!=Le(e,s,i)&&(0!==o&&(r=Ue(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function qe(t,e,r){var n=0|t[J],i=at(n),o=Le(t,r,i);if(null!=o&&o[q]===et){if(!rt(o))return Ae(o),o.m;var s=o.m}else Array.isArray(o)&&(s=o,2&n&&Q(s,34));if(s){let t=0|s[J];2&t&&(s=Se(s,t))}return(s=me(s,e))!==o&&Ue(t,n,r,s,i),s}function Ke(t,e,r,n){var i=!1;if(n=function(t,e,r){return Le(t,e,void 0,r)}(t,n,t=>{var n=oe(t,r,e);return i=n!==t&&null!=n,n}),null!=n)return i&&!rt(n)&&Te(t,e),n}function Ye(t,e,r){var n=t.m,i=0|n[J];if(null==(e=Ke(n,i,e,r)))return e;if(!rt(t,i=0|n[J])){let o=Ee(e);o!==e&&(Ae(t)&&(i=0|(n=t.m)[J]),Te(n,i=Ue(n,i,r,e=o)))}return e}function Je(t,e,r,n,i,o,s,a){o=o&&4!==o?1!==o&&(t?rt(t,r):2&r)?1:o:4,s=!!s||3===o;var u=!!a&&!(t?rt(t,r):2&r);(2===o||u)&&t&&Ae(t)&&(r=0|(e=t.m)[J]);var l=(t=Ve(e,i))===R?7:0|t[J],c=tt(l,r);if(a=!(4&c)){var h=t,f=r;let e=!!(2&c);e&&(f|=2);let i=!e,o=!0,s=0,a=0;for(;s<h.length;s++){let t=oe(h[s],n,f);if(t instanceof n){if(!e){let e=rt(t);i&&=!e,o&&=e}h[a++]=t}}a<s&&(h.length=a),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==l&&(Z(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&r)))){for(Ce(c)&&(t=kt(t),c=er(c,r),r=Ue(e,r,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=Ee(h))&&(n[l]=c);u|=8,Z(t,c=u=n.length?4096|u:-4097&u)}return Fe(t,c,e,r,i,o,a,s)}function Xe(t,e){var r=t.m;return Je(t,r,0|r[J],e,1,void 0,!1,!0)}function Qe(t){return null==t&&(t=void 0),t}function Ze(t,e,r,n,i){return Ne(t,r,n=Qe(n),i),n&&!rt(n)&&Te(t.m),t}function tr(t,e,r,n){t:{var i=n=Qe(n);Ie(t);let o=t.m,s=0|o[J];if(null==i){let t=ze(o);if(We(t,o,s,r)!==e)break t;t.set(r,0)}else s=He(o,s,r,e);Ue(o,s,e,i)}return n&&!rt(n)&&Te(t.m),t}function er(t,e){return-273&(2&e?2|t:-3&t)}function rr(t,e,r,n){Ie(t);var i=t.m;t=Je(t,i,0|i[J],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===R?7:0|t[J],(n=rt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&Z(t,r),n||Te(i)}function nr(t,e,r,n){return Ye(t,e,r=$e(t,n)===r?r:-1)}function ir(t,e,r){if(null!=r)t:{if(!zt(r))throw k("int64");switch(typeof r){case"string":r=Xt(r);break t;case"bigint":r=dt(Ft(64,r));break t;default:r=dt(Ct(r)?r:Yt(r))}}return Ne(t,e,r)}function or(t,e,r){return Ne(t,e,null==r?r:function(t){if(!zt(t))throw k("uint64");var e=typeof t;switch(e){case"string":return e=Rt(Number(t)),Ct(e)&&e>=0?t=dt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=V()?dt(Vt(64,BigInt(t))):dt(qt(t))),t;case"bigint":return dt(Vt(64,t));default:return t>=0&&Ct(t)||((t=Rt(t))>=0&&Ct(t)?t=String(t):(It(t),t=Lt(St,Et))),dt(t)}}(r))}function sr(t,e,r){if(null!=r){if(!Mt(r))throw k("enum");r|=0}return Ne(t,e,r)}function ar(t,e,r){Ie(t),ke(t,e,ie,2,!0).push(re(r))}var ur=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.h=e}};function lr(t,e){if("string"==typeof t)return new ur(T(t),e);if(Array.isArray(t))return new ur(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new ur(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new ur(t,!1);if(t.constructor===N)return e=B(t)||new Uint8Array(0),new ur(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new ur(t,!1);throw Error()}function cr(t,e){var r=0,n=0,i=0,o=t.j,s=t.h;do{var a=o[s++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=o[s++]))<<i;if(mr(t,s),!(128&a))return e(r>>>0,n>>>0);throw Error()}function hr(t){for(var e=0,r=t.h,n=r+10,i=t.j;r<n;){let n=i[r++];if(e|=n,!(128&n))return mr(t,r),!!(127&e)}throw Error()}function fr(t){var e=t.j,r=t.h,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return mr(t,r),i}function dr(t){return cr(t,Bt)}function pr(t){var e=t.j,r=t.h,n=e[r+0],i=e[r+1],o=e[r+2];return e=e[r+3],mr(t,t.h+4),(n|i<<8|o<<16|e<<24)>>>0}function vr(t){var e=pr(t);t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,255==r?e?NaN:t*(1/0):0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(e+8388608)}function gr(t){return fr(t)}function mr(t,e){if(t.h=e,e>t.l)throw Error()}function yr(t,e){if(e<0)throw Error();var r=t.h;if((e=r+e)>t.l)throw Error();return t.h=e,r}function br(t,e){if(0==e)return x();var r=yr(t,e);return t.M&&t.v?r=t.j.subarray(r,r+e):(t=t.j,r=r===(e=r+e)?new Uint8Array(0):_t?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?x():new N(r,j)}var wr=class{constructor(t,e,r,n){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.init(t,e,r,n)}init(t,e,r,{M:n=!1,O:i=!1}={}){this.M=n,this.O=i,t&&(t=lr(t,this.O),this.j=t.buffer,this.v=t.h,this.o=e||0,this.l=void 0!==r?this.o+r:this.j.length,this.h=this.o)}clear(){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.M=!1}},_r=[],Sr=0;function Er(t,e,r,n){if(Or.length){let i=Or.pop();return i.u(n),i.h.init(t,e,r,n),i}return new Ur(t,e,r,n)}function Ar(t){t.h.clear(),t.l=-1,t.j=-1,Or.length<100&&Or.push(t)}function Ir(t){var e=t.h;if(e.h==e.l)return!1;t.o=t.h.h;var r=fr(t.h)>>>0;if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.l=e,t.j=r,!0}function Tr(t){try{switch(t.j){case 0:0!=t.j?Tr(t):hr(t.h);break;case 1:var e=t.h;mr(e,e.h+8);break;case 2:if(2!=t.j)Tr(t);else{var r=fr(t.h)>>>0,n=t.h;mr(n,n.h+r)}break;case 5:var i=t.h;mr(i,i.h+4);break;case 3:jr();let o=t.l;try{for(;;){if(!Ir(t))throw Error();if(4==t.j){if(t.l!=o)throw Error();break}Tr(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Sr>0&&Sr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function jr(){if(Sr>=100)throw new SyntaxError;Sr++}function xr(t,e,r){var n=t.h.l,i=fr(t.h)>>>0,o=(i=t.h.h+i)-n;if(o<=0&&(t.h.l=i,r(e,t,void 0,void 0,void 0),o=i-t.h.h),o)throw Error();t.h.h=i,t.h.l=n}function Br(t){var i=fr(t.h)>>>0,o=yr(t=t.h,i);if(t=t.j,u){var s,l=t;(s=n)||(s=n=new TextDecoder("utf-8",{fatal:!0})),i=o+i,l=0===o&&i===l.length?l:l.subarray(o,i);try{var c=s.decode(l)}catch(t){if(void 0===a){try{s.decode(new Uint8Array([128]))}catch(t){}try{s.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(n=void 0),t}}else{i=(c=o)+i,o=[];let n,a=null;for(;c<i;){var h=t[c++];h<128?o.push(h):h<224?c>=i?e():(n=t[c++],h<194||128!=(192&n)?(c--,e()):o.push((31&h)<<6|63&n)):h<240?c>=i-1?e():(n=t[c++],128!=(192&n)||224===h&&n<160||237===h&&n>=160||128!=(192&(s=t[c++]))?(c--,e()):o.push((15&h)<<12|(63&n)<<6|63&s)):h<=244?c>=i-2?e():(n=t[c++],128!=(192&n)||n-144+(h<<28)>>30||128!=(192&(s=t[c++]))||128!=(192&(l=t[c++]))?(c--,e()):(h=(7&h)<<18|(63&n)<<12|(63&s)<<6|63&l,h-=65536,o.push(55296+(h>>10&1023),56320+(1023&h)))):e(),o.length>=8192&&(a=r(a,o),o.length=0)}c=r(a,o)}return c}function Lr(t){var e=fr(t.h)>>>0;return br(t.h,e)}function Nr(t,e,r){var n=fr(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)r.push(e(t.h))}var Ur=class{constructor(t,e,r,n){if(_r.length){let i=_r.pop();i.init(t,e,r,n),t=i}else t=new wr(t,e,r,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.u(n)}u({S:t=!1}={}){this.S=t}},Or=[];function Pr(t){return new Fr(4294967295&t,Math.floor(t/4294967296))}var kr,Fr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Vr(t){return new Wr(4294967295&t,Math.floor(t/4294967296))}var Cr,Mr,Rr,Dr,Gr,$r,zr,Hr,Wr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function qr(t,e,r){return"undefined"!=typeof BigInt64Array?(zr||(zr=new BigInt64Array(1),Hr=new Uint32Array(zr.buffer),zr[0]=BigInt(1),$r=1===Hr[0]),zr[0]=t,new e(Hr[t=$r?0:1],Hr[1-t])):(Gr||(Mr=BigInt(Number.MIN_SAFE_INTEGER),Rr=BigInt(Number.MAX_SAFE_INTEGER),Dr=BigInt(4294967295),Gr=BigInt(32)),t>=Mr&&t<=Rr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Dr),Number(t>>Gr))))}function Kr(t,e,r){for(;r>0||e>127;)t.h.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.h.push(e)}function Yr(t,e){for(;e>127;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function Jr(t,e){if(e>=0)Yr(t,e);else{for(let r=0;r<9;r++)t.h.push(127&e|128),e>>=7;t.h.push(1)}}function Xr(t,e){Ot(e),function(t){var e=Et>>31;t(St<<1^e,(Et<<1|St>>>31)^e)}((e,r)=>{Kr(t,e>>>0,r>>>0)})}function Qr(t,e){t.h.push(e>>>0&255),t.h.push(e>>>8&255),t.h.push(e>>>16&255),t.h.push(e>>>24&255)}var Zr=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function tn(t,e){0!==e.length&&(t.l.push(e),t.j+=e.length)}function en(t,e,r){Yr(t.h,8*e+r)}function rn(t,e){return en(t,e,2),e=t.h.end(),tn(t,e),e.push(t.j),e}function nn(t,e){var r=e.pop();for(r=t.j+t.h.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.j++;e.push(r),t.j++}function on(t,e,r){if(null!=r)switch(en(t,e,0),typeof r){case"number":t=t.h,It(r),Kr(t,St,Et);break;case"bigint":r=qr(r,Wr,Vr),Kr(t.h,r.j,r.h);break;default:r?/^-?\d+$/.test(r)?(Ot(r),r=new Wr(St,Et)):r=null:r=Cr||=new Wr(0,0),Kr(t.h,r.j,r.h)}}function sn(t,e,r){en(t,e,2),Yr(t.h,r.length),tn(t,t.h.end()),tn(t,r)}var an=class{constructor(){this.l=[],this.j=0,this.h=new Zr}};function un(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var ln=un(),cn=un(),hn=un(),fn=un(),dn=un(),pn=un(),vn=un(),gn=un(),mn=un(),yn=un(),bn=un(),wn=un();function _n(t,e,r){var n=t.m;$&&$ in n&&(n=n[$])&&delete n[e.h],e.j?e.o(t,e.j,e.h,r,e.l):e.o(t,e.h,r,e.l)}var Sn=class{constructor(t,e){this.m=ye(t,e,void 0,2048)}toJSON(){return ge(this)}};Sn.prototype[q]=et,Sn.prototype.toString=function(){return this.m.toString()};var En=class{constructor(t,e,r){this.h=t,this.j=e,t=ln,this.l=!!t&&r===t||!1}};function An(t,e){return new En(t,e,ln)}function In(t,e,r,n,i){null!=(e=Vn(e,n))&&(r=rn(t,r),i(e,t),nn(t,r))}var Tn,jn,xn=An(function(t,e,r,n,i){return 2===t.j&&(xr(t,qe(e,n,r),i),!0)},In),Bn=An(function(t,e,r,n,i){return 2===t.j&&(xr(t,qe(e,n,r),i),!0)},In),Ln=Symbol(),Nn=Symbol(),Un=Symbol(),On=Symbol(),Pn=Symbol();function kn(t,e,r,n){var i=n[t];if(i)return i;(i={}).V=n,i.L=function(t){switch(typeof t){case"boolean":return ce||=[0,void 0,!0];case"number":return t>0?void 0:0===t?he||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],s=1;o&&o.constructor===Object&&(i.extensions=o,"function"==typeof(o=n[++s])&&o.length>0&&(i.T=!0,Tn??=o,jn??=n[s+1],o=n[s+=2]));for(var a={};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=n[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++s]);var l=void 0;if(o instanceof En?t=o:(t=xn,s--),t?.l){o=n[++s],l=n;var c=s;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++s])&&o<0&&(c-=o,o=n[++s]);u<c;u++){let n=a[u];l?r(i,u,t,l,n):e(i,u,t,n)}}return n[t]=i}function Fn(t){return Array.isArray(t)?t[0]instanceof En?t:[Bn,t]:[t,void 0]}function Vn(t,e){return t instanceof Sn?t.m:Array.isArray(t)?me(t,e):void 0}function Cn(t,e,r,n){var i=r.h;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Mn(t,e,r,n,i){var o,s,a=r.h;t[e]=(t,e,r)=>a(t,e,r,s||=kn(Nn,Cn,Mn,n).L,o||=Rn(n),i)}function Rn(t){var e=t[Un];if(null!=e)return e;var r=kn(Nn,Cn,Mn,t);return e=r.T?(t,e)=>Tn(t,e,r):(t,e)=>{t:{jr();try{for(;Ir(e)&&4!=e.j;){let u=e.l,l=r[u];if(null==l){let t=r.extensions;if(t){let e=t[u];if(e){let t=Gn(e);null!=t&&(l=r[u]=t)}}}if(null==l||!l(e,t,u)){var n=e;let r=n.o;if(Tr(n),n.S)var i=void 0;else{let t=n.h.h-r;n.h.h=r,i=br(n.h,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[$]??(o[$]=new fe))[s]??(n[s]=[])).push(a)}}let l=ae(t);l&&(l.h=r.V[Pn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Sr>0&&Sr--}u=void 0}return u},t[Un]=e,t[Pn]=Dn.bind(t),e}function Dn(t,e,r,n){var i=this[Nn],o=this[Un],s=me(void 0,i.L),a=ae(t);if(a){var u=!1,l=i.extensions;if(l){if(i=(e,r,i)=>{if(0!==i.length)if(l[r])for(let t of i){e=Er(t);try{u=!0,o(s,e)}finally{Ar(e)}}else n?.(t,r,i)},null==e)ue(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[J];if(2&n&&2048&n&&!r?.la)throw Error();let i=at(n),o=(e,o)=>{if(null!=Le(t,e,i)){if(1===r?.ka)return;throw Error()}null!=o&&(n=Ue(t,n,e,o,i)),delete a[e]};null==e?ot(s,0|s[J],(t,e)=>{o(t,e)}):o(e,Le(s,e,i))}}}}function Gn(t){var e=(t=Fn(t))[0].h;if(t=t[1]){let r=Rn(t),n=kn(Nn,Cn,Mn,t).L;return(t,i,o)=>e(t,i,o,n,r)}return e}function $n(t,e,r){t[e]=r.j}function zn(t,e,r,n){var i,o,s=r.j;t[e]=(t,e,r)=>s(t,e,r,o||=kn(Ln,$n,zn,n).L,i||=Hn(n))}function Hn(t){var e=t[On];if(!e){let r=kn(Ln,$n,zn,t);e=(t,e)=>Wn(t,e,r),t[On]=e}return e}function Wn(t,e,r){ot(t,0|t[J],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.extensions)&&(r=r[e])){var n=(r=Fn(r))[0].j;if(r=r[1]){let e=Hn(r),i=kn(Ln,$n,zn,r).L;r=t.T?jn(i,e):(t,r,o)=>n(t,r,o,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||F(H,3)}}),(t=ae(t))&&ue(t,(t,r,n)=>{for(tn(e,e.h.end()),t=0;t<n.length;t++)tn(e,B(n[t])||new Uint8Array(0))})}var qn=dt(0);function Kn(t,e,r){if(Array.isArray(e)){var n=0|e[J];if(4&n)return e;for(var i=0,o=0;i<e.length;i++){let r=t(e[i]);null!=r&&(e[o++]=r)}return o<i&&(e.length=o),t=1|n,r&&(t=-1537&t|4),t!==n&&Z(e,t),r&&2&t&&Object.freeze(e),e}}var Yn=(t,e)=>{var r=new an;Wn(t.m,r,kn(Ln,$n,zn,e)),tn(r,r.h.end()),t=new Uint8Array(r.j);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function Jn(t,e,r){return new En(t,e,r)}function Xn(t,e,r){return new En(t,e,r)}function Qn(t,e,r){Ue(t,0|t[J],e,r,at(0|t[J]))}function Zn(t,e,r){null!=(e=Zt(e))&&on(t,r,e)}function ti(t,e,r){null!=(e=Ht(e))&&null!=e&&(en(t,r,0),Jr(t.h,e))}function ei(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(en(t,r,0),t.h.h.push(e?1:0))}function ri(t,e,r){null!=(e=ie(e))&&sn(t,r,c(e))}function ni(t,e,r,n,i){null!=(e=Vn(e,n))&&(r=rn(t,r),i(e,t),nn(t,r))}function ii(t,e,r){null!=(e=ee(e))&&sn(t,r,lr(e,!0).buffer)}function oi(t,e,r){e=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Mt(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(en(t,r,0),Yr(t.h,e))}function si(t,e,r){null!=(e=Ht(e))&&(e=parseInt(e,10),en(t,r,0),Jr(t.h,e))}function ai(t,e,r){return 0===t.j&&(Qn(e,r,dr(t.h)),!0)}function ui(t,e,r){return(0===t.j||2===t.j)&&(e=Ge(e,0|e[J],r),2==t.j?Nr(t,fr,e):e.push(fr(t.h)),!0)}function li(t,e,r){return 2===t.j&&(Qn(e,r,(t=Lr(t))===x()?void 0:t),!0)}var ci=Jn(function(t,e,r){if(1!==t.j)return!1;var n=t.h;t=pr(n);var i=pr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,Qn(e,r,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,e,r){null!=(e=Dt(e))&&(en(t,r,1),t=t.h,(r=wt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),St=r.getUint32(0,!0),Et=r.getUint32(4,!0),Qr(t,St),Qr(t,Et))},yn),hi=Jn(function(t,e,r){return 5===t.j&&(Qn(e,r,vr(t.h)),!0)},function(t,e,r){null!=(e=Dt(e))&&(en(t,r,5),t=t.h,Tt(e),Qr(t,St))},mn),fi=Xn(function(t,e,r){return(5===t.j||2===t.j)&&(e=Ge(e,0|e[J],r),2==t.j?Nr(t,vr,e):e.push(vr(t.h)),!0)},function(t,e,r){if(null!=(e=Kn(Dt,e,!0))&&e.length){en(t,r,2),Yr(t.h,4*e.length);for(let n=0;n<e.length;n++)r=t.h,Tt(e[n]),Qr(r,St)}},mn),di=Jn(function(t,e,r){return ai(t,e,r)},Zn,pn),pi=Jn(function(t,e,r){return ai(t,e,r)},Zn,pn),vi=Xn(function(t,e,r){return 0!==t.j&&2!==t.j?t=!1:(e=Ge(e,0|e[J],r),2==t.j?Nr(t,dr,e):e.push(dr(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Kn(Zt,e,!1)))for(let n=0;n<e.length;n++)on(t,r,e[n])},pn),gi=Jn(function(t,e,r){return 0!==t.j?e=!1:(Qn(e,r,(t=dr(t.h))===qn?void 0:t),e=!0),e},Zn,pn),mi=Jn(function(t,e,r){return 0!==t.j?t=!1:(Qn(e,r,cr(t.h,xt)),t=!0),t},function(t,e,r){if(null!=(e=te(e))&&null!=e)switch(en(t,r,0),typeof e){case"number":t=t.h,It(e),Kr(t,St,Et);break;case"bigint":r=qr(e,Fr,Pr),Kr(t.h,r.j,r.h);break;default:e?/^\d+$/.test(e)?(Ot(e),r=new Fr(St,Et)):r=null:r=kr||=new Fr(0,0),Kr(t.h,r.j,r.h)}},vn),yi=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,fr(t.h)),!0)},ti,fn),bi=Xn(ui,function(t,e,r){if(null!=(e=Kn(Ht,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(en(n,i,0),Jr(n.h,o))}},fn),wi=Xn(ui,function(t,e,r){if(null!=(e=Kn(Ht,e,!0))&&e.length){r=rn(t,r);for(let r=0;r<e.length;r++)Jr(t.h,e[r]);nn(t,r)}},fn),_i=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,0===(t=fr(t.h))?void 0:t),!0)},ti,fn),Si=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,hr(t.h)),!0)},ei,cn),Ei=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,!1===(t=hr(t.h))?void 0:t),!0)},ei,cn),Ai=Xn(function(t,e,r){return 2===t.j&&(t=Br(t),Ge(e,0|e[J],r).push(t),!0)},function(t,e,r){if(null!=(e=Kn(ie,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&sn(n,i,c(o))}},hn),Ii=Jn(function(t,e,r){return 2===t.j&&(Qn(e,r,""===(t=Br(t))?void 0:t),!0)},ri,hn),Ti=Jn(function(t,e,r){return 2===t.j&&(Qn(e,r,Br(t)),!0)},ri,hn),ji=function(t,e,r=ln){return new En(t,e,r)}(function(t,e,r,n,i){return 2===t.j&&(n=me(void 0,n),Ge(e,0|e[J],r).push(n),xr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)ni(t,e[o],r,n,i);1&(t=0|e[J])||Z(e,1|t)}}),xi=An(function(t,e,r,n,i,o){if(2!==t.j)return!1;var s=0|e[J];return He(e,s,o,r,at(s)),xr(t,e=qe(e,n,r),i),!0},ni),Bi=Jn(function(t,e,r){return 2===t.j&&(Qn(e,r,Lr(t)),!0)},ii,bn),Li=Xn(function(t,e,r){return 2===t.j&&(t=Lr(t),Ge(e,0|e[J],r).push(t),!0)},function(t,e,r){if(null!=(e=Kn(ee,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&sn(n,i,lr(o,!0).buffer)}},bn),Ni=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,fr(t.h)>>>0),!0)},oi,dn),Ui=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,0===(t=fr(t.h)>>>0)?void 0:t),!0)},oi,dn),Oi=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,fr(t.h)),!0)},si,wn),Pi=Jn(function(t,e,r){return 0===t.j&&(Qn(e,r,0===(t=fr(t.h))?void 0:t),!0)},si,wn),ki=Jn(function(t,e,r){return 0!==t.j?t=!1:(Qn(e,r,function(t){return cr(t,(t,e)=>{var r=-(1&t);return Bt(t=(t>>>1|e<<31)^r,e>>>1^r)})}(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Zt(e))&&null!=e)switch(en(t,r,0),typeof e){case"number":t=t.h,e=(r=e)<0,At(r=2*Math.abs(r)),r=St;let n=Et;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),Kr(t,St=r,Et=n);break;case"bigint":t=t.h,e=e<<BigInt(1)^e>>BigInt(63),St=Number(BigInt.asUintN(32,e)),Et=Number(BigInt.asUintN(32,e>>BigInt(32))),Kr(t,St,Et);break;default:Xr(t.h,e)}},gn);class Fi{constructor(t,e){var r=io;this.h=t,this.j=e,this.o=Ze,this.defaultValue=void 0,this.l=null!=r.ia?st:void 0}register(){g(this)}}function Vi(t,e){return(r,n)=>{t:{let o={O:!0};n&&Object.assign(o,n),r=Er(r,void 0,void 0,o);try{let n=new t,o=n.m;Rn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Ar(r)}i=void 0}return i}}function Ci(t){return function(){return Yn(this,t)}}var Mi,Ri=[0,Bi,Li,Si,Ti],Di=[0,Ii,[0,Pi,[0,gi,_i],Pi,-1,[0,Oi],Pi,-1],Jn(li,ii,bn)],Gi=[0,Ii,Jn(li,function(t,e,r){if(null!=e){if(e instanceof Sn){let n=e.na;return void(n?(e=n(e),null!=e&&sn(t,r,lr(e,!0).buffer)):F(H,3))}if(Array.isArray(e))return void F(H,3)}ii(t,e,r)},bn)],$i=[0,1,[0,12,yi,10,Si],[0,7,[0,yi,-1]]],zi=globalThis.trustedTypes;var Hi=class{constructor(t){this.h=t}toString(){return this.h+""}};function Wi(t){var e;return void 0===Mi&&(Mi=function(){var t=null;if(!zi)return t;try{let e=t=>t;t=zi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Mi)?e.createScriptURL(t):t,new Hi(t)}function qi(t,...e){if(0===e.length)return Wi(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Wi(r)}var Ki=[0,yi,Oi,Si,-1,wi,Oi,-1,Si,-1],Yi=[0,Oi,-1,Si],Ji=class extends Sn{constructor(t){super(t)}},Xi=[0,Si,Ti,Si,Oi,-1,Xn(function(t,e,r){return(0===t.j||2===t.j)&&(e=Ge(e,0|e[J],r),2==t.j?Nr(t,gr,e):e.push(fr(t.h)),!0)},function(t,e,r){if(null!=(e=Kn(Ht,e,!0))&&e.length){r=rn(t,r);for(let r=0;r<e.length;r++)Jr(t.h,e[r]);nn(t,r)}},wn),Ti,-1,[0,Si,-1],Oi,Si,-1,Yi],Qi=class extends Sn{constructor(t){super(t)}j(){return Oe(this,9)}},Zi=[0,3,Si,-1,2,[0,[2],yi,xi,[0,Ni]],[0,Oi,Si,Oi,Si,Oi,4,[0,Si,Ti,-1,Si,yi,-1,Si],Oi,Si,-4,Oi,Ai,Si,Ai,Si,-1,yi,Si,-3,[0,Si,yi],[0,Ti,yi,-1],[0,Si],[0,Si,-1],[0,Si,yi,-1]],[0,[3,4],Ti,-1,xi,[0,yi],xi,[0,Oi,-2]],[0],Ti,Si],to=[0,Ti,-2],eo=class extends Sn{constructor(t){super(t)}},ro=[0],no=[0,yi,Si,1,Si,-4],io=class extends Sn{constructor(t){super(t,2)}},oo={};oo[336783863]=[0,Ti,Si,-1,yi,[0,[1,2,3,4,5,6,7,8,9],xi,ro,xi,Xi,xi,to,xi,no,xi,Ki,xi,[0,Ti,-2],xi,[0,Ti,Oi],xi,Zi,xi,Yi],[0,Ti],Si,[0,[1,3],[2,4],xi,[0,wi],-1,xi,[0,Ai],-1,ji,[0,Ti,-1]],Ti];var so=[0,gi,-1,Ei,-3,gi,wi,Ii,_i,gi,-1,Ei,_i,Ei,-2,Ii];function ao(t){ar(t,3,"TEXT:text_in")}var uo=class extends Sn{constructor(t){super(t,500)}u(t){return Ze(this,0,7,t)}},lo=[-1,{}],co=[0,Ti,1,lo],ho=[0,Ti,Ai,lo];function fo(t){ar(t,10,"text_in")}var po=class extends Sn{constructor(t){super(t,500)}u(t){return Ze(this,0,1001,t)}};po.prototype.j=Ci([-500,ji,[-500,Ii,-1,Ai,-3,[-2,oo,Si],ji,Gi,_i,-1,co,ho,ji,[0,Ii,Ei],Ii,so,_i,Ai,987,Ai],4,ji,[-500,Ti,-1,[-1,{}],998,Ti],ji,[-500,Ti,Ai,-1,[-2,{},Si],997,Ai,-1],_i,ji,[-500,Ti,Ai,lo,998,Ai],Ai,_i,co,ho,ji,[0,Ii,-1,lo],Ai,-2,so,Ii,-1,Ei,[0,Ei,Ui],978,lo,ji,Gi]);var vo=class extends Sn{constructor(t){super(t)}},go=class extends Sn{constructor(t){super(t)}j(){return Xe(this,vo)}},mo=class extends Sn{constructor(t){super(t)}},yo=Vi(class extends Sn{constructor(t){super(t)}},[0,ji,[0,1,yi,Ti,[0,ji,[0,yi,hi,Ti,-1]]],pi]),bo=class extends Sn{constructor(t){super(t)}},wo=class extends Sn{constructor(t){super(t)}j(){var t=Be(this,1,void 0,Me);return null==t?x():t}},_o=class extends Sn{constructor(t){super(t)}},So=[1,2],Eo=Vi(class extends Sn{constructor(t){super(t)}},[0,ji,[0,So,xi,[0,fi],xi,[0,Bi],yi,Ti],pi]),Ao=class extends Sn{constructor(t){super(t)}},Io=class extends Sn{constructor(t){super(t)}},To=[0,Si,-1],jo=class extends Sn{constructor(t){super(t)}j(){return Pe(this,2,xo)}l(){return nr(this,Qi,6,xo)}},xo=[1,2,3,4,5,6],Bo=class extends Sn{constructor(t){super(t)}j(){return null!=Be(this,1,void 0,Me)}l(){return null!=ie(Be(this,2))}},Lo=class extends Sn{constructor(t){super(t)}},No=[0,Bi,Ti,[0,yi,pi,-1],[0,mi,pi]],Uo=[0,No,Si,[0,xo,xi,no,xi,Xi,xi,Ki,xi,ro,xi,to,xi,Zi],Oi],Oo=class extends Sn{constructor(t){super(t)}},Po=new Fi(462704549,Oo);oo[462704549]=[0,Uo,[0,Ti,yi,hi,Ai,-1]];var ko=class extends Sn{constructor(t){super(t)}},Fo=new Fi(477589892,ko);function Vo(t,e){if(e=e?_e(e):new Ao,void 0!==t.displayNamesLocale?Ne(e,1,ne(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ne(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw k("int32");if(!Mt(r))throw k("int32");r|=0}Ne(e,2,r)}else"maxResults"in t&&Ne(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}`);Ne(e,3,r)}else"scoreThreshold"in t&&Ne(e,3);return void 0!==t.categoryAllowlist?Re(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ne(e,4),void 0!==t.categoryDenylist?Re(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ne(e,5),e}function Co(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Mo(t){var e={classifications:Xe(t,mo).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:Ht(Be(t,1))??0??-1,score:Be(t,2,void 0,Dt)??0??0,categoryName:ie(Be(t,3))??""??"",displayName:ie(Be(t,4))??""??""})),headIndex:e,headName:r}}(Ye(t,go,4)?.j()??[],Ht(Be(t,2))??0,ie(Be(t,3))??""))};return null!=function(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):zt(t)?"number"==typeof t?Kt(t):Jt(t):void 0}(Be(t,2,void 0,Qt))&&(e.timestampMs=Co(Be(t,2,void 0,Qt)??xe)),e}function Ro(t){return Array.from(t,t=>t>127?t-256:t)}function Do(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let o=0;o<t.length;o++)r+=t[o]*e[o],n+=t[o]*t[o],i+=e[o]*e[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}function Go(t,e,r){return r=`wasm${r?"_module":""}_internal`,Promise.resolve({wasmLoaderPath:`${e}/${t}_${r}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`})}oo[477589892]=[0,Uo,To,1,No];var $o=class{};function zo(t){return sr(new Ho,1,t)}$o.forVisionTasks=function(t,e=!1){return Go("vision",t??qi``,e)},$o.forTextTasks=function(t,e=!1){return Go("text",t??qi``,e)},$o.forRetrievalTasks=function(t,e=!1){return Go("retrieval",t??qi``,e)},$o.forDecisionTasks=function(t,e=!1){return Go("decision",t??qi``,e)},$o.forAudioTasks=function(t,e=!1){return Go("audio",t??qi``,e)};var Ho=class extends Sn{constructor(t){super(t)}},Wo=class extends Sn{constructor(t){super(t)}},qo=[0,Oi,2,mi,-2,pi,ji,[0,Oi,pi]],Ko=class extends Sn{constructor(t){super(t)}},Yo=class extends Sn{constructor(t){super(t)}};function Jo(t,e){return sr(t,1,e)}function Xo(t,e){return sr(t,2,e)}var Qo=class extends Sn{constructor(t){super(t)}},Zo=[3,4,5,6,7],ts=class extends Sn{constructor(t){super(t)}},es=class extends Sn{constructor(t){super(t)}};es.prototype.j=Ci([0,[0,Oi,Ti,-3,Oi],[0,Zo,Oi,-1,xi,[0,Oi,Ti,mi],xi,qo,xi,[0,1,qo],xi,[0,Oi],xi,[0,Oi,Ti,mi]]]);var rs=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,e,r){var n=!!t.keepalive&&function(t){return t?"string"==typeof t?(new TextEncoder).encode(t).length:t.byteLength:0}(t.body)<=61440,i=this.h&&!n?new AbortController:void 0,o=i&&t.N>0?setTimeout(()=>{i.abort()},t.N):void 0;try{let o=await fetch(t.url,{method:t.fa,headers:{...t.ea},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},...n&&{keepalive:!0},signal:t.N&&i?i.signal:null});o.ok?e?.(await o.text()):r?.(o.status)}catch(t){if("AbortError"===t?.name)r?.(408);else r?.(0)}finally{clearTimeout(o)}}};var ns=class extends Sn{constructor(t){super(t,37)}},is=[-4,{},$i,Oi,Di],os=[0,Ti,Oi,1,Ti,-1,Oi,1,Oi,1,pi],ss=[0,Oi,Ti,-2],as=[0,Ti,Oi],us=[0,Ti,Oi],ls=[0,Si,-3],cs=[0,Oi,Ti,-1,pi,yi,-1,Ti,-5,ji,[0,Ti,-4],-1,Si,[0,Si,-3],Oi];var hs,fs=class extends Sn{constructor(t){super(t,19)}},ds=(hs=[-19,{},[0,Oi,1,[0,Ti,-6,pi,yi,Ti,-1,pi],1,[0,Ti,1,Ti,-5],Ti,-1,[0,Oi,Ti,-8],[0,Ti,-3],[0,Ti,Oi,Ti,-2],[0,Ti,-1,Oi,Ti,-1,Oi,Ti,-1,[0,ji,[0,Ti,-1],Si,Ti,-5],[0,Oi,Si,yi,-2]],pi,[0,Ti,-3,pi,yi,Ti,-1],[0,Oi,Ti,-1],[0,Ti,-9],[0,Ti,-6,Oi,Ti,1,Ti,Si,Oi,-1,Si,Ti,-2,Oi,Ti,Oi,Ti,yi,-1],1,[0,Oi],1,[0,Ti,-4],1,os,[0,[1,2,3,4,5,6],xi,os,xi,as,xi,us,xi,[0,Oi],xi,cs,xi,ss],as,us,cs,[0,[0,Oi,Ti,-1,pi,yi,-1,Ti,-4,ji,[0,Ti,-4],-1,1,ls],[0,Oi,Ti,-1,pi,yi,-1,Ti,-4,ls]],ss,[0,Ti,[0,yi,-3,Oi],Oi,-2,[0,yi,-1],Si],4,[0,Ti,Oi,Ti,-1,pi,Oi,Ti,-1,Oi,yi,-1]],Oi,ji,[-37,{},di,Ti,ji,[0,Ti,-1],Bi,1,Bi,[0,Ai,-1,bi,vi,-1],Ti,[0,yi,Ti,-1],Si,yi,pi,Ti,-1,ki,Ri,di,Bi,Oi,bi,pi,-1,[0,Oi,-1],Ti,Si,Ti,wi,Ti,-1,ci,1,ci,is,Si,[0,Oi,[0,hi,yi,-2],[0,hi]],[0,Oi,pi]],di,Li,Ti,-1,di,Oi,-1,[0,Si,-1,Oi,Si],[0,pi,-1,Ti],[0,di,Si,pi],pi,1,Ni,1,is],t=>Yn(t,hs)),ps=class{constructor(t){this.j=[],this.o=new rs,this.l=t??"",this.h=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.h&&(clearInterval(this.h),this.h=void 0),this.flush()}flush(t,e){if(this.error)e?.("net-send-failed");else if(0===this.j.length)t?.();else{var r=this.j;this.j=[],r=function(t){var e=new fs;Ie(e=sr(e,2,1786));var r=e.m,n=0|r[J];if(null==t)Ue(r,n,3);else{var i=t===R?7:0|t[J],o=i,s=Ce(i),a=s||Object.isFrozen(t),u=!0,l=!0;for(let e=0;e<t.length;e++){var c=t[e];s||(c=rt(c),u&&=!c,l&&=c)}s||(i=u?13:5,i=l?-4097&i:4096|i),a&&i===o||(t=kt(t),o=0,i=er(i,n)),i!==o&&Z(t,i),n=Ue(r,n,3,t),2&i||!(4096&i||16&i)||Te(r,n)}return e}(r),r=ds(r),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",fa:"POST",N:1e4,body:r,ga:2,ea:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.l},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.j=[],void 0!==this.h&&(clearInterval(this.h),this.h=void 0),e?.("net-send-failed",t)})}}};class vs{constructor(){this.K=this.D=this.I=this.C=this.G=this.H=this.F=0}}function gs(t,e){var r=new es;r=Ze(r,0,1,t.U),r=Ze(r,0,2,e),e=Ne(e=new ns,6,it(r=r.j(),!1)),(t=t.A).error||t.j.push(e)}function ms(t,e){var r={F:e.F-t.l.F,H:e.H-t.l.H,G:e.G-t.l.G,C:e.C-t.l.C,I:e.I-t.l.I,D:e.D,K:e.K},n=Xo(Jo(new Qo,t.B),1);r=ys(t,r),gs(t,n=tr(n,4,Zo,r)),t.l=e}function ys(t,e){var r=new Wo;return t=or(t=ir(t=sr(r,1,t.J),7,e.C),5,e.D),t=or(t,6,e.K),e.G>0&&or(t,4,e.I/e.G),0!==e.F&&(r=ir(r=zo(3),2,e.F),rr(t,8,Ho,r)),0!==e.H&&(e=ir(r=zo(4),2,e.H),rr(t,8,Ho,e)),t}var bs=class{constructor(t,e,r){this.R=performance.now(),this.o=performance.now(),this.j=new Map,this.v=0,this.h=new vs,this.l=new vs,this.A=new ps(r),this.B=function(t){switch(t){case"AudioClassifier":return 4;case"AudioEmbedder":return 5;case"TextClassifier":return 6;case"TextEmbedder":return 7;case"GestureRecognizer":return 8;case"HandDetector":return 9;case"HandLandmarker":return 10;case"ImageClassifier":return 11;case"ImageEmbedder":return 12;case"ImageSegmenter":return 13;case"ObjectDetector":return 14;case"FaceDetector":return 15;case"FaceLandmarker":return 16;case"InteractiveSegmenter":case"InteractiveSegmenterLegacy":return 18;case"HolisticLandmarker":return 20;case"LlmInference":return 21;case"LanguageDetector":return 22;case"PoseLandmarker":return 23;case"UniversalEmbedder":return 28;case"SemanticRetriever":return 29;case"DecisionMaker":return 30;case"TextSummarizer":return 26;case"TextProofreader":return 27;case"AudioTranscriber":return 31;case"TextToSpeech":return 32;default:return 0}}(t),this.J=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(e),t=new ts,"undefined"==typeof navigator?e=0:(e=navigator.userAgent,e=/Android/i.test(e)?1:/iPhone|iPad|iPod/i.test(e)?2:/Windows/i.test(e)?5:/Macintosh/i.test(e)?4:/Linux/i.test(e)?3:0),t=Ne(t=sr(t,1,e),2,ne("")),t=Ne(t,3,ne("")),t=Ne(t,4,ne("1.3.0")),t=Ne(t,5,ne("")),this.U=sr(t,6,function(){var t=globalThis.__HOST_ENVIRONMENT__;if("string"==typeof t)switch(t){case"ANDROID":return 1;case"IOS":return 2;case"PYTHON":return 3;case"WEB":break;case"FLUTTER":return 5;case"FLUTTER_WEB":return 6;default:return 0}return 4}())}ca(){var t=new Yo;t=or(t=sr(t,1,this.J),3,performance.now()-this.R),gs(this,t=tr(Xo(Jo(new Qo,this.B),0),3,Zo,t)),this.o=performance.now()}ba(){var t={...this.h,C:this.h.C+this.j.size,D:this.v,K:performance.now()-this.R};ms(this,t);var e=new Ko;e=Ze(e,0,2,t=ys(this,t)),gs(this,e=tr(t=Xo(Jo(new Qo,this.B),2),5,Zo,e))}close(){var t=this.A;"function"==typeof t.close?t.close():t.flush()}};function ws(){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 _s(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function Ss(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Es(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function As(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Is(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Ts=function(t){return class extends t{get P(){return this.i}Z(){if("function"==typeof this.P._mediapipeLoggerGetEncodedApiKey){let t=this.P._mediapipeLoggerGetEncodedApiKey();return this.P._decodeBase64(t)}}}}(function(t){return class extends t{da(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.l=!0,this.i=t,this.h=null,this.j=0,this.o="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:ws()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var 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){var r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Ss(this,n||"input_audio",n=>{Ss(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var o=4*t.length;this.j!==o&&(this.h&&this.i._free(this.h),this.h=this.i._malloc(o),this.j=o),this.i.HEAPF32.set(t,this.h/4),Ss(this,n,t=>{this.i._addAudioToInputStream(this.h,e,r,t,i)})}addGpuBufferToStream(t,e,r){Ss(this,e,e=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");e?this.i._bindTextureToStream(e):this.i._bindTextureToCanvas();var n=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[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.l||i===this.i.canvas.width&&o===this.i.canvas.height||(this.i.canvas.width=i,this.i.canvas.height=o);var[s,a]=[i,o];this.i._addBoundTextureToStream(e,s,a,r)})}addBoolToStream(t,e,r){Ss(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){Ss(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){Ss(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){Ss(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){Ss(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){Ss(this,e,e=>{Ss(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){Ss(this,e,e=>{Es(this,Object.keys(t),n=>{Es(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){Ss(this,r,r=>{Ss(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){Ss(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){Ss(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){Ss(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){Ss(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){Ss(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){Ss(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){Ss(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ss(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){Ss(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){Ss(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){Ss(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){Ss(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){Ss(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){Ss(this,e,e=>{Ss(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){Ss(this,r,r=>{Ss(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){Ss(this,e,e=>{var r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){Ss(this,e,e=>{var r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){Ss(this,e,e=>{var r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){Ss(this,e,e=>{var r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){Ss(this,e,e=>{var r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){Ss(this,e,e=>{var r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ss(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){As(this,t,e),Ss(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Is(this,t,e),Ss(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){As(this,t,e),Ss(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Is(this,t,e),Ss(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){As(this,t,e),Ss(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Is(this,t,e),Ss(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){As(this,t,e),Ss(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Is(this,t,e),Ss(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){As(this,t,e),Ss(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Is(this,t,e),Ss(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){As(this,t,e),Ss(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Is(this,t,e),Ss(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){As(this,t,e),Ss(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Is(this,t,e),Ss(this,t,t=>{this.i._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),As(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),Ss(this,t,t=>{this.i._attachAudioListener(t,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}})),js=class extends Ts{};async function xs(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await _s(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await _s(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),function(t,e){e=e.ma??"";var r=t.h.Z();t.j=new bs(t.J(),e,r)}(t,r),await t.u(r),t}async function Bs(t,e,r){return xs(t,e,r)}function Ls(t,e){var r=Ye(t.baseOptions,Bo,1)||new Bo;"string"==typeof e?(Ne(r,2,ne(e)),Ne(r,1)):e instanceof Uint8Array&&(Ne(r,1,it(e,!1)),Ne(r,2)),Ze(t.baseOptions,0,1,r)}function Ns(t,e){var r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ye(t.baseOptions,Bo,1)?.j()||Ye(t.baseOptions,Bo,1)?.l()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=Ye(t.baseOptions,jo,3);if(!r){var n=r=new jo,i=new eo;tr(n,4,xo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Ji,tr(e,2,xo,n)):(e=r,n=new eo,tr(e,4,xo,n))),Ze(t.baseOptions,0,3,r)}(t,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${t.status})`)}).then(e=>{e=new Uint8Array(e);try{t.h.i.FS_unlink("/model.dat")}catch{}t.h.i.FS_createDataFile("/","model.dat",e,!0,!1,!0),Ls(t,"/model.dat"),t.B()});if(r.modelAssetBuffer instanceof Uint8Array)Ls(t,r.modelAssetBuffer);else if(r.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(r.modelAssetBuffer).then(e=>{Ls(t,e),t.B()});return t.B(),Promise.resolve()}function Us(t){try{let e=t.v.length;if(1===e)throw Error(t.v[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.v.map(t=>t.message).join(", "))}finally{t.v=[]}}function Os(t,e){if(t.j&&void 0!==e){let r=Ye(t.baseOptions,jo,3);r?.j()||r?.l()?.j()?(++(t=t.j).h.H,t.j.set(e,performance.now())):(++(t=t.j).h.F,t.j.set(e,performance.now()))}}function Ps(t,e){t.o=Math.max(t.o,e)}var ks=class{constructor(t){this.h=t,this.v=[],this.o=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,e){this.h.attachErrorListener((t,e)=>{this.v.push(Error(e))}),this.h.da(),this.h.setGraph(t,e),this.j?.ca(),Us(this)}finishProcessing(t){if(this.h.finishProcessing(),Us(this),this.j&&void 0!==t){var e=this.j,r=e.j.get(t);if(void 0!==r&&(e.j.delete(t),t=performance.now()-r,++e.h.G,e.h.I+=t,e.h.D=Math.max(e.h.D,t),e.v=Math.max(e.v,t),performance.now()>e.o+3e4)){for(let[n,i]of e.j.entries())t=n,i<r&&(e.h.C++,e.j.delete(t));r={...e.h,K:performance.now()-e.o},e.h.D=0,e.o=performance.now(),ms(e,r)}}}close(){this.j?.ba(),this.j?.close(),this.h.closeGraph()}};ks.prototype.close=ks.prototype.close;var Fs=class extends ks{constructor(t,e){super(new js(t,e)),this.A={languages:[]},Ze(t=this.l=new Oo,0,1,e=new Lo)}J(){return"LanguageDetector"}u(t){return Ze(this.l,0,2,Vo(t,Ye(this.l,Ao,2))),Ns(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}X(t){this.A={languages:[]};var e=this.o+1;return Os(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}B(){var t=new po;fo(t),ar(t,15,"classifications_out");var e=new io;_n(e,Po,this.l);var r=new uo;De(r,ne("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),ao(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),rr(t,1,uo,r),this.h.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=Mo(yo(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.A.languages=t[0].categories.map(t=>({languageCode:t.categoryName,probability:t.score})),Ps(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Ps(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};Fs.prototype.detect=Fs.prototype.X,Fs.prototype.setOptions=Fs.prototype.u,Fs.createFromModelPath=function(t,e){return Bs(Fs,t,{baseOptions:{modelAssetPath:e}})},Fs.createFromModelBuffer=function(t,e){return Bs(Fs,t,{baseOptions:{modelAssetBuffer:e}})},Fs.createFromOptions=function(t,e){return Bs(Fs,t,e)};var Vs=class extends ks{constructor(t,e){super(new js(t,e)),this.A={classifications:[]},Ze(t=this.l=new Oo,0,1,e=new Lo)}J(){return"TextClassifier"}u(t){return Ze(this.l,0,2,Vo(t,Ye(this.l,Ao,2))),Ns(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}W(t){this.A={classifications:[]};var e=this.o+1;return Os(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}B(){var t=new po;fo(t),ar(t,15,"classifications_out");var e=new io;_n(e,Po,this.l);var r=new uo;De(r,ne("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),ao(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),rr(t,1,uo,r),this.h.attachProtoListener("classifications_out",(t,e)=>{this.A=Mo(yo(t)),Ps(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Ps(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Cs(t){switch(t){case"RETRIEVAL_QUERY":default:return"search result";case"SEMANTIC_SIMILARITY":return"sentence similarity";case"CLASSIFICATION":return"classification";case"CLUSTERING":return"clustering";case"QUESTION_ANSWERING":return"question answering";case"FACT_CHECKING":return"fact checking";case"CODE_RETRIEVAL":return"code retrieval"}}Vs.prototype.classify=Vs.prototype.W,Vs.prototype.setOptions=Vs.prototype.u,Vs.createFromModelPath=function(t,e){return Bs(Vs,t,{baseOptions:{modelAssetPath:e}})},Vs.createFromModelBuffer=function(t,e){return Bs(Vs,t,{baseOptions:{modelAssetBuffer:e}})},Vs.createFromOptions=function(t,e){return Bs(Vs,t,e)};var Ms=class extends ks{constructor(t,e){super(new js(t,e)),this.A={embeddings:[]},Ze(t=this.l=new ko,0,1,e=new Lo)}J(){return"TextEmbedder"}u(t){var e=this.l,r=Ye(this.l,Io,2);return r=r?_e(r):new Io,void 0!==t.l2Normalize?Ne(r,1,Gt(t.l2Normalize)):"l2Normalize"in t&&Ne(r,1),void 0!==t.quantize?Ne(r,2,Gt(t.quantize)):"quantize"in t&&Ne(r,2),Ze(e,0,2,r),Ns(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}Y(t,e){var r=this.o+1;if(Os(this,r),e)t:{let r=e.type,n=e.title&&e.title.length>0?e.title:"none";switch(e="DOCUMENT"!==e.textRole,r){case"RETRIEVAL_DOCUMENT":t=`title: ${n} | text: ${t}`;break t;case"RETRIEVAL_QUERY":t=`task: ${Cs(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${Cs(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${Cs(r)} | query: ${t}`}}return this.h.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.A}B(){var t=new po;fo(t),ar(t,15,"embeddings_out");var e=new io;_n(e,Fo,this.l);var r=new uo;De(r,ne("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),ao(r),ar(r,4,"EMBEDDINGS:embeddings_out"),r.u(e),rr(t,1,uo,r),this.h.attachProtoListener("embeddings_out",(t,e)=>{t=Eo(t),this.A=function(t){return{embeddings:Xe(t,_o).map(t=>{var e={headIndex:Ht(Be(t,3))??0??-1,headName:ie(Be(t,4))??""??""};if(Pe(t,1,So))t=ke(t=nr(t,bo,1,So),1,Dt),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=nr(t,wo,2,So)?.j()?.j()??r}return e}),timestampMs:Co(Be(t,2,void 0,Qt)??xe)}}(t),Ps(this,e)}),this.h.attachEmptyPacketListener("embeddings_out",t=>{Ps(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};Ms.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Do(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Do(Ro(t.quantizedEmbedding),Ro(e.quantizedEmbedding))}return t},Ms.prototype.embed=Ms.prototype.Y,Ms.prototype.setOptions=Ms.prototype.u,Ms.createFromModelPath=function(t,e){return Bs(Ms,t,{baseOptions:{modelAssetPath:e}})},Ms.createFromModelBuffer=function(t,e){return Bs(Ms,t,{baseOptions:{modelAssetBuffer:e}})},Ms.createFromOptions=function(t,e){return Bs(Ms,t,e)},exports.FilesetResolver=$o,exports.LanguageDetector=Fs,exports.TaskRunner=ks,exports.TextClassifier=Vs,exports.TextEmbedder=Ms;
|
|
2
2
|
//# sourceMappingURL=text_bundle_cjs.js.map
|