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