@mediapipe/tasks-vision 1.0.0-rc.20260708 → 1.0.0-rc.20260710
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/vision_bundle.cjs +1 -1
- package/vision_bundle.cjs.map +1 -1
- package/vision_bundle.js +1 -1
- package/vision_bundle.js.map +1 -1
- package/vision_bundle.mjs +1 -1
- package/vision_bundle.mjs.map +1 -1
- package/wasm/vision_wasm_internal.js +9 -9
- package/wasm/vision_wasm_internal.wasm +0 -0
- package/wasm/vision_wasm_module_internal.js +9 -9
- package/wasm/vision_wasm_module_internal.wasm +0 -0
- package/wasm/vision_wasm_nosimd_internal.js +9 -9
- package/wasm/vision_wasm_nosimd_internal.wasm +0 -0
package/vision_bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Vision=function(t){"use strict";var e="undefined"!=typeof self?self:{};function r(t,r){t:{for(var n=["CLOSURE_FLAGS"],i=e,s=0;s<n.length;s++)if(null==(i=i[n[s]])){n=null;break t}n=i}return null!=(t=n&&n[t])?t:r}function n(t,r){t=t.split(".");for(var n,i=e;t.length&&(n=t.shift());)t.length||void 0===r?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=r}function i(){throw Error("Invalid UTF8")}function s(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var o,a,h=void 0,u="undefined"!=typeof TextDecoder,c="undefined"!=typeof TextEncoder;function l(t){if(c)t=(a||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}function d(t){e.setTimeout(()=>{throw t},0)}var f=r(610401301,!1),p=r(748402147,!0);function g(){var t=e.navigator;return t&&(t=t.userAgent)?t:""}var m,_=e.navigator;function v(t){return v[" "](t),t}m=_&&_.userAgentData||null,v[" "]=function(){};var y={},E=null;function A(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=E[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}w();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),s=r(64);if(64===s&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function w(){if(!E){E={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));y[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===E[e]&&(E[e]=t)}}}}var T="undefined"!=typeof Uint8Array,b=!(!(f&&m&&m.brands.length>0)&&(-1!=g().indexOf("Trident")||-1!=g().indexOf("MSIE")))&&"function"==typeof btoa,k=/[-_.]/g,S={"-":"+",_:"/",".":"="};function L(t){return S[t]||""}function x(t){if(!b)return A(t);t=k.test(t)?t.replace(k,L):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function R(t){return T&&null!=t&&t instanceof Uint8Array}var F={};function I(){return N||=new O(null,F)}function C(t){M(F);var e=t.g;return null==(e=null==e||R(e)?e:"string"==typeof e?x(e):null)?e:t.g=e}var N,O=class{h(){return new Uint8Array(C(this)||0)}constructor(t,e){if(M(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function M(t){if(t!==F)throw Error("illegal external caller")}function D(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var P=void 0;function $(t){return D(t=Error(t),"warning"),t}function U(t,e){if(null!=t){var r=P??={},n=r[t]||0;n>=e||(r[t]=n+1,D(t=Error(),"incident"),d(t))}}function B(){return"function"==typeof BigInt}var G="function"==typeof Symbol&&"symbol"==typeof Symbol();function j(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var V,H=j("jas",void 0,!0),K=j(void 0,"0di"),X=j(void 0,"1oa"),W=j(void 0,Symbol()),z=j(void 0,"0ub"),Y=j(void 0,"0ubs"),q=j(void 0,"0ubsb"),J=j(void 0,"0actk"),Z=j("m_m","Ra",!0),Q=j(),tt={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},et=Object.defineProperties,rt=G?H:"Ga",nt=[];function it(t,e){G||rt in t||et(t,tt),t[rt]|=e}function st(t,e){G||rt in t||et(t,tt),t[rt]=e}function ot(t){return it(t,34),t}function at(t){return it(t,8192),t}st(nt,7),V=Object.freeze(nt);var ht={};function ut(t,e){return void 0===e?t.h!==ct&&!!(2&t.v[rt]):!!(2&e)&&t.h!==ct}var ct={};function lt(t,e){if(null!=t)if("string"==typeof t)t=t?new O(t,F):I();else if(t.constructor!==O)if(R(t))t=t.length?new O(new Uint8Array(t),F):I();else{if(!e)throw Error();t=void 0}return t}class dt{constructor(t,e,r){this.g=t,this.h=e,this.l=r}next(){var t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var ft=Object.freeze({});function pt(t,e,r){var n,i=128&e?0:-1,s=t.length;(n=!!s)&&(n=null!=(n=t[s-1])&&"object"==typeof n&&n.constructor===Object);var o=s+(n?-1:0);for(e=128&e?1:0;e<o;e++)r(e-i,t[e]);if(n){t=t[s-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var gt={};function mt(t){return 128&t?gt:void 0}function _t(t){return t.Pa=!0,t}var vt=_t(t=>"number"==typeof t),yt=_t(t=>"string"==typeof t),Et=_t(t=>"boolean"==typeof t),At="function"==typeof e.BigInt&&"bigint"==typeof e.BigInt(0);function wt(t){var e=t;if(yt(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(vt(e)&&!Number.isSafeInteger(e))throw Error(String(e));return At?BigInt(t):t=Et(t)?t?"1":"0":yt(t)?t.trim()||"0":String(t)}var Tt=_t(t=>At?t>=kt&&t<=Lt:"-"===t[0]?xt(t,bt):xt(t,St)),bt=Number.MIN_SAFE_INTEGER.toString(),kt=At?BigInt(Number.MIN_SAFE_INTEGER):void 0,St=Number.MAX_SAFE_INTEGER.toString(),Lt=At?BigInt(Number.MAX_SAFE_INTEGER):void 0;function xt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var Rt,Ft="function"==typeof Uint8Array.prototype.slice,It=0,Ct=0;function Nt(t){var e=t>>>0;It=e,Ct=(t-e)/4294967296>>>0}function Ot(t){if(t<0){Nt(-t);let[e,r]=Vt(It,Ct);It=e>>>0,Ct=r>>>0}else Nt(t)}function Mt(t){var e=Rt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Ct=0,It=e.getUint32(0,!0)}function Dt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Ut(t,e)}function Pt(t,e){return wt(B()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Ut(t,e))}function $t(t,e){return B()?wt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):wt(Gt(t,e))}function Ut(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else B()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Bt(r)+Bt(t));return r}function Bt(t){return t=String(t),"0000000".slice(t.length)+t}function Gt(t,e){if(2147483648&e)if(B())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Vt(t,e);t="-"+Ut(r,n)}else t=Ut(t,e);return t}function jt(t){if(t.length<16)Ot(Number(t));else if(B())t=BigInt(t),It=Number(t&BigInt(4294967295))>>>0,Ct=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);Ct=It=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));Ct*=1e6,(It=1e6*It+e)>=4294967296&&(Ct+=Math.trunc(It/4294967296),Ct>>>=0,It>>>=0)}if(e){let[t,e]=Vt(It,Ct);It=t,Ct=e}}}function Vt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ht(t){return Array.prototype.slice.call(t)}var Kt="function"==typeof BigInt?BigInt.asIntN:void 0,Xt="function"==typeof BigInt?BigInt.asUintN:void 0,Wt=Number.isSafeInteger,zt=Number.isFinite,Yt=Math.trunc,qt=wt(0);function Jt(t){if("number"!=typeof t)throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function Zt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Qt(t){if("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}function te(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}var ee=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function re(t){switch(typeof t){case"bigint":return!0;case"number":return zt(t);case"string":return ee.test(t);default:return!1}}function ne(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return zt(t)?0|t:void 0}function ie(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return zt(t)?t>>>0:void 0}function se(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(jt(t),Gt(It,Ct))}function oe(t){if(t=Yt(t),!Wt(t)){Ot(t);var e=It,r=Ct;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Dt(e,r))?t?-e:e:t?"-"+e:e}return t}function ae(t){var e=Yt(Number(t));return Wt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),se(t))}function he(t){var e=Yt(Number(t));return Wt(e)?wt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),B()?wt(Kt(64,BigInt(t))):wt(se(t)))}function ue(t){return Wt(t)?t=wt(oe(t)):(t=Yt(t),Wt(t)?t=String(t):(Ot(t),t=Gt(It,Ct)),t=wt(t)),t}function ce(t){var e=typeof t;return null==t?t:"bigint"===e?wt(Kt(64,t)):re(t)?"string"===e?he(t):ue(t):void 0}function le(t){if("string"!=typeof t)throw Error();return t}function de(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function fe(t){return null==t||"string"==typeof t?t:void 0}function pe(t,e,r,n){return null!=t&&t[Z]===ht?t:Array.isArray(t)?((n=(r=0|t[rt])|32&n|2&n)!==r&&st(t,n),new e(t)):(r?2&n?((t=e[K])||(ot((t=new e).v),t=e[K]=t),e=t):e=new e:e=void 0,e)}function ge(t,e,r){if(e)t:{if(!re(e=t))throw $("int64");switch(typeof e){case"string":e=he(e);break t;case"bigint":e=wt(Kt(64,e));break t;default:e=ue(e)}}else e=ce(t);return null==(t=e)?r?qt:void 0:t}function me(t){return t}var _e={},ve=function(){try{return v(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class ye{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}var Ee=ve?(Object.setPrototypeOf(ye.prototype,Map.prototype),Object.defineProperties(ye.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),ye):class extends Map{constructor(){super()}};function Ae(t){return t}function we(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var Te,be=class extends Ee{constructor(t,e,r=Ae,n=Ae){super(),this.J=0|t[rt],this.K=e,this.S=r,this.fa=this.K?ke:n;for(let i=0;i<t.length;i++){let s=t[i],o=r(s[0],!1,!0),a=s[1];e?void 0===a&&(a=null):a=n(s[1],!1,!0,void 0,void 0,this.J),super.set(o,a)}}V(t){return at(Array.from(super.entries(),t))}clear(){we(this),super.clear()}delete(t){return we(this),super.delete(this.S(t,!0,!1))}entries(){if(this.K){var t=super.keys();t=new dt(t,Se,this)}else t=super.entries();return t}values(){if(this.K){var t=super.keys();t=new dt(t,be.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.K?super.forEach((r,n,i)=>{t.call(e,i.get(n),n,i)}):super.forEach(t,e)}set(t,e){return we(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.fa(e,!0,!0,this.K,!1,this.J))}Oa(t){var e=this.S(t[0],!1,!0);t=t[1],t=this.K?void 0===t?null:t:this.fa(t,!1,!0,void 0,!1,this.J),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);var e=super.get(t);if(void 0!==e){var r=this.K;return r?((r=this.fa(e,!1,!0,r,this.ra,this.J))!==e&&super.set(t,r),r):e}}[Symbol.iterator](){return this.entries()}};function ke(t,e,r,n,i,s){return t=pe(t,n,r,s),i&&(t=We(t)),t}function Se(t){return[t,this.get(t)]}function Le(){return Te||=new be(ot([]),void 0,void 0,void 0,_e)}function xe(t){return W?t[W]:void 0}function Re(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}be.prototype.toJSON=void 0;var Fe,Ie,Ce,Ne=class{},Oe={La:!0};function Me(t,e){e<100||U(Y,1)}function De(t,e,r,n){var i=void 0!==n;n=!!n;var s,o=W;!i&&G&&o&&(s=t[o])&&Re(s,Me),o=[];var a=t.length;s=4294967295;var h=!1,u=!!(64&e),c=u?128&e?0:-1:void 0;if(!(1&e)){var l=a&&t[a-1];null!=l&&"object"==typeof l&&l.constructor===Object?s=--a:l=void 0,!u||128&e||i||(h=!0,s=(Fe??me)(s-c,c,t,l,void 0)+c)}e=void 0;for(var d=0;d<a;d++){let i=t[d];if(null!=i&&null!=(i=r(i,n)))if(u&&d>=s){let t=d-c;(e??={})[t]=i}else o[d]=i}if(l)for(let t in l){if(null==(a=l[t])||null==(a=r(a,n)))continue;let i;d=+t,u&&!Number.isNaN(d)&&(i=d+c)<s?o[i]=a:(e??={})[t]=a}return e&&(h?o.push(e):o[s]=e),i&&W&&(t=xe(t))&&t instanceof Ne&&(o[W]=function(t){var e=new Ne;return Re(t,(t,r,n)=>{e[r]=Ht(n)}),e.da=t.da,e}(t)),o}function Pe(t){return t[0]=$e(t[0]),t[1]=$e(t[1]),t}function $e(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Tt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[rt];return 0===t.length&&1&e?void 0:De(t,e,$e)}if(null!=t&&t[Z]===ht)return Ue(t);if(t instanceof O){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(b){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),w(),r=y[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,u=0;for(;t<e.length-2;t+=3){var s=e[t],o=e[t+1],a=e[t+2],h=r[s>>2];s=r[(3&s)<<4|o>>4],o=r[(15&o)<<2|a>>6],a=r[63&a],n[u++]=h+s+o+a}switch(h=0,a=i,e.length-t){case 2:a=r[(15&(h=e[t+1]))<<2]||i;case 1:e=e[t],n[u]=r[e>>2]+r[(3&e)<<4|h>>4]+a+i}e=n.join("")}t=t.g=e}return t}return t instanceof be?t=0!==t.size?t.V(Pe):void 0:void 0}return t}function Ue(t){return De(t=t.v,0|t[rt],$e)}function Be(t,e){return Ge(t,e[0],e[1])}function Ge(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[rt],p&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(p)throw Error("carr");U(J,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&st(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var s=(r=t).length;if(s){var o=s-1;let t=r[o];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((o-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(s=+a)<o&&(r[s+e]=t[a],delete t[a]);i=-16760833&i|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return st(t,64|i|n),t}function je(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[rt];return 0===t.length&&1&r?void 0:Ve(t,r,e)}if(null!=t&&t[Z]===ht)return Ke(t);if(t instanceof be){if(2&(e=t.J))return t;if(!t.size)return;if(r=ot(t.V()),t.K)for(t=0;t<r.length;t++){let n=r[t],i=n[1];i=null==i||"object"!=typeof i?void 0:null!=i&&i[Z]===ht?Ke(i):Array.isArray(i)?Ve(i,0|i[rt],!!(32&e)):void 0,n[1]=i}return r}return t instanceof O?t:void 0}function Ve(t,e,r){return 2&e||(!r||4096&e||16&e?t=Xe(t,e,!1,r&&!(16&e)):(it(t,34),4&e&&Object.freeze(t))),t}function He(t,e,r){return t=new t.constructor(e),r&&(t.h=ct),t.m=ct,t}function Ke(t){var e=t.v,r=0|e[rt];return ut(t,r)?t:Je(t,e,r)?He(t,e):Xe(e,r)}function Xe(t,e,r,n){return n??=!!(34&e),t=De(t,e,je,n),n=32,r&&(n|=2),st(t,e=16769217&e|n),t}function We(t){var e=t.v,r=0|e[rt];return ut(t,r)?Je(t,e,r)?He(t,e,!0):new t.constructor(Xe(e,r,!1)):t}function ze(t){if(t.h!==ct)return!1;var e=t.v;return it(e=Xe(e,0|e[rt]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function Ye(t){if(!ze(t)&&ut(t,0|t.v[rt]))throw Error()}function qe(t,e){void 0===e&&(e=0|t[rt]),32&e&&!(4096&e)&&st(t,4096|e)}function Je(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(st(e,2|r),t.h=ct,!0)}var Ze=wt(0),Qe={};function tr(t,e,r,n,i){if(null!==(e=er(t.v,e,r,i))||n&&t.m!==ct)return e}function er(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),s=t.length-1;if(!(s<1+(r?0:-1))){if(i>=s){var o=t[s];if(null!=o&&"object"==typeof o&&o.constructor===Object){r=o[e];var a=!0}else{if(i!==s)return;r=o}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?o[e]=n:t[i]=n,n}return r}}function rr(t,e,r,n){Ye(t),nr(t=t.v,0|t[rt],e,r,n)}function nr(t,e,r,n,i){var s=r+(i?0:-1),o=t.length-1;if(o>=1+(i?0:-1)&&s>=o){let i=t[o];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return s<=o?(t[s]=n,e):(void 0!==n&&(r>=(o=(e??=0|t[rt])>>14&1023||536870912)?null!=n&&(t[o+(i?0:-1)]={[r]:n}):t[s]=n),e)}function ir(t,e,r,n){var i=t.v;return void 0!==Er(i,0|i[rt],e,t=gr(t,n)===r?r:-1)}function sr(){return void 0===ft?2:4}function or(t,e,r,n,i){var s=t.v,o=0|s[rt];n=ut(t,o)?1:n,i=!!i||3===n,2===n&&ze(t)&&(o=0|(s=t.v)[rt]);var a=(t=hr(s,e))===V?7:0|t[rt],h=ur(a,o),u=!(4&h);if(u){4&h&&(t=Ht(t),a=0,h=xr(h,o),o=nr(s,o,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&h|4,h=r&=-1025,h&=-4097}return h!==a&&(st(t,h),2&h&&Object.freeze(t)),ar(t,h,s,o,e,n,u,i)}function ar(t,e,r,n,i,s,o,a){var h=e;return 1===s||4===s&&(2&e||!(16&e)&&32&n)?cr(e)||((e|=!t.length||o&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==h&&st(t,e),Object.freeze(t)):(2===s&&cr(e)&&(t=Ht(t),h=0,e=xr(e,n),n=nr(r,n,i,t)),cr(e)||(a||(e|=16),e!==h&&st(t,e))),2&e||!(4096&e||16&e)||qe(r,n),t}function hr(t,e,r){return t=er(t,e,r),Array.isArray(t)?t:V}function ur(t,e){return 2&e&&(t|=2),1|t}function cr(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function lr(t){return lt(t,!0)}function dr(t){t=Ht(t);for(let e=0;e<t.length;e++){let r=t[e]=Ht(t[e]);Array.isArray(r[1])&&(r[1]=ot(r[1]))}return at(t)}function fr(t,e,r,n){Ye(t),nr(t=t.v,0|t[rt],e,("0"===n?0===Number(r):r===n)?void 0:r)}function pr(t,e,r){if(2&e)throw Error();var n=mt(e),i=hr(t,r,n),s=i===V?7:0|i[rt],o=ur(s,e);return(2&o||cr(o)||16&o)&&(o===s||cr(o)||st(i,o),i=Ht(i),s=0,o=xr(o,e),nr(t,e,r,i,n)),(o&=-13)!==s&&st(i,o),i}function gr(t,e){return vr(mr(t=t.v),t,void 0,e)}function mr(t){if(G)return t[X]??(t[X]=new Map);if(X in t)return t[X];var e=new Map;return Object.defineProperty(t,X,{value:e}),e}function _r(t,e,r,n,i){var s=mr(t),o=vr(s,t,e,r,i);return o!==n&&(o&&(e=nr(t,e,o,void 0,i)),s.set(r,n)),e}function vr(t,e,r,n,i){var s=t.get(n);if(null!=s)return s;s=0;for(let t=0;t<n.length;t++){let o=n[t];null!=er(e,o,i)&&(0!==s&&(r=nr(e,r,s,void 0,i)),s=o)}return t.set(n,s),s}function yr(t,e,r){var n=0|t[rt],i=mt(n),s=er(t,r,i);if(null!=s&&s[Z]===ht){if(!ut(s))return ze(s),s.v;var o=s.v}else Array.isArray(s)&&(o=s);if(o){let t=0|o[rt];2&t&&(o=Xe(o,t))}return(o=Be(o,e))!==s&&nr(t,n,r,o,i),o}function Er(t,e,r,n,i){var s=!1;if(null!=(n=er(t,n,i,t=>{var n=pe(t,r,!1,e);return s=n!==t&&null!=n,n})))return s&&!ut(n)&&qe(t,e),n}function Ar(t,e,r,n){var i=t.v,s=0|i[rt];if(null==(e=Er(i,s,e,r,n)))return e;if(!ut(t,s=0|i[rt])){let o=We(e);o!==e&&(ze(t)&&(s=0|(i=t.v)[rt]),qe(i,s=nr(i,s,r,e=o,n)))}return e}function wr(t,e,r,n,i,s,o,a){var h=ut(t,r);s=h?1:s,o=!!o||3===s,h=a&&!h,(2===s||h)&&ze(t)&&(r=0|(e=t.v)[rt]);var u=(t=hr(e,i))===V?7:0|t[rt],c=ur(u,r);if(a=!(4&c)){var l=t,d=r;let e=!!(2&c);e&&(d|=2);let i=!e,s=!0,o=0,a=0;for(;o<l.length;o++){let t=pe(l[o],n,!1,d);if(t instanceof n){if(!e){let e=ut(t);i&&=!e,s&&=e}l[a++]=t}}a<o&&(l.length=a),c|=4,c=s?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==u&&(st(t,c),2&c&&Object.freeze(t)),h&&!(8&c||!t.length&&(1===s||4===s&&(2&c||!(16&c)&&32&r)))){for(cr(c)&&(t=Ht(t),c=xr(c,r),r=nr(e,r,i,t)),n=t,h=c,u=0;u<n.length;u++)(l=n[u])!==(c=We(l))&&(n[u]=c);h|=8,st(t,c=h=n.length?4096|h:-4097&h)}return ar(t,c,e,r,i,s,a,o)}function Tr(t,e,r){var n=t.v;return wr(t,n,0|n[rt],e,r,sr(),!1,!0)}function br(t){return null==t&&(t=void 0),t}function kr(t,e,r,n,i){return rr(t,r,n=br(n),i),n&&!ut(n)&&qe(t.v),t}function Sr(t,e,r,n){t:{var i=n=br(n);Ye(t);let s=t.v,o=0|s[rt];if(null==i){let t=mr(s);if(vr(t,s,o,r)!==e)break t;t.set(r,0)}else o=_r(s,o,r,e);nr(s,o,e,i)}n&&!ut(n)&&qe(t.v)}function Lr(t,e,r){Ye(t);var n=0|(t=t.v)[rt];if(null==r)nr(t,n,e);else{var i=r===V?7:0|r[rt],s=i,o=cr(i),a=o||Object.isFrozen(r),h=!0,u=!0;for(let t=0;t<r.length;t++){var c=r[t];o||(c=ut(c),h&&=!c,u&&=c)}o||(i=h?13:5,i=u?-4097&i:4096|i),a&&i===s||(r=Ht(r),s=0,i=xr(i,n)),i!==s&&st(r,i),n=nr(t,n,e,r),2&i||!(4096&i||16&i)||qe(t,n)}}function xr(t,e){return-273&(2&e?2|t:-3&t)}function Rr(t,e,r,n){var i=n;Ye(t),t=wr(t,n=t.v,0|n[rt],r,e,2,!0),i=null!=i?i:new r,t.push(i),e=r=t===V?7:0|t[rt],(i=ut(i))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&st(t,r),i||qe(n)}function Fr(t,e,r){return ne(tr(t,e,void 0,r))}function Ir(t,e){return tr(t,e,void 0,void 0,Zt)??0}function Cr(t,e,r){return Ar(t,e,r=gr(t,lo)===r?r:-1,void 0)}function Nr(t,e){fr(t,3,null==e?e:Qt(e),!1)}function Or(t,e,r){if(null!=r){if("number"!=typeof r)throw $("int32");if(!zt(r))throw $("int32");r|=0}rr(t,e,r)}function Mr(t,e,r){rr(t,e,null==r?r:Jt(r))}function Dr(t,e,r){fr(t,e,null==r?r:Jt(r),0)}function Pr(t,e,r){fr(t,e,de(r),"")}function $r(t,e,r){{Ye(t);let o=t.v,a=0|o[rt];if(null==r)nr(o,a,e);else{var n=t=r===V?7:0|r[rt],i=cr(t),s=i||Object.isFrozen(r);for(i||(t=0),s||(r=Ht(r),n=0,t=xr(t,a),s=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??1024,i=0;i<r.length;i++){let e=r[i],o=le(e);Object.is(e,o)||(s&&(r=Ht(r),n=0,t=xr(t,a),s=!1),r[i]=o)}t!==n&&(s&&(r=Ht(r),t=xr(t,a)),st(r,t)),nr(o,a,e,r)}}}function Ur(t,e,r){Ye(t),or(t,e,fe,2,!0).push(le(r))}var Br=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.g=e}};function Gr(t,e){if("string"==typeof t)return new Br(x(t),e);if(Array.isArray(t))return new Br(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new Br(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new Br(t,!1);if(t.constructor===O)return e=C(t)||new Uint8Array(0),new Br(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Br(t,!1);throw Error()}function jr(t,e){var r=0,n=0,i=0,s=t.h,o=t.g;do{var a=s[o++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=s[o++]))<<i;if(zr(t,o),!(128&a))return e(r>>>0,n>>>0);throw Error()}function Vr(t){for(var e=0,r=t.g,n=r+10,i=t.h;r<n;){let n=i[r++];if(e|=n,!(128&n))return zr(t,r),!!(127&e)}throw Error()}function Hr(t){var e=t.h,r=t.g,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return zr(t,r),i}function Kr(t){return Hr(t)>>>0}function Xr(t){var e=t.h,r=t.g,n=e[r],i=e[r+1],s=e[r+2];return e=e[r+3],zr(t,t.g+4),t=2*((i=(n|i<<8|s<<16|e<<24)>>>0)>>31)+1,n=i>>>23&255,i&=8388607,255==n?i?NaN:t*(1/0):0==n?1401298464324817e-60*t*i:t*Math.pow(2,n-150)*(i+8388608)}function Wr(t){return Hr(t)}function zr(t,e){if(t.g=e,e>t.l)throw Error()}function Yr(t,e){if(e<0)throw Error();var r=t.g;if((e=r+e)>t.l)throw Error();return t.g=e,r}function qr(t,e){if(0==e)return I();var r=Yr(t,e);return t.Y&&t.j?r=t.h.subarray(r,r+e):(t=t.h,r=r===(e=r+e)?new Uint8Array(0):Ft?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?I():new O(r,F)}var Jr=class{constructor(t,e,r,n){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(t,e,r,n)}init(t,e,r,{Y:n=!1,ea:i=!1}={}){this.Y=n,this.ea=i,t&&(t=Gr(t,this.ea),this.h=t.buffer,this.j=t.g,this.m=e||0,this.l=void 0!==r?this.m+r:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}},Zr=[],Qr=0;function tn(t,e,r,n){if(ln.length){let i=ln.pop();return i.u(n),i.g.init(t,e,r,n),i}return new cn(t,e,r,n)}function en(t){t.g.clear(),t.l=-1,t.h=-1,ln.length<100&&ln.push(t)}function rn(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var r=Kr(t.g);if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.l=e,t.h=r,!0}function nn(t){try{switch(t.h){case 0:0!=t.h?nn(t):Vr(t.g);break;case 1:var e=t.g;zr(e,e.g+8);break;case 2:if(2!=t.h)nn(t);else{var r=Kr(t.g),n=t.g;zr(n,n.g+r)}break;case 5:var i=t.g;zr(i,i.g+4);break;case 3:sn();let s=t.l;try{for(;;){if(!rn(t))throw Error();if(4==t.h){if(t.l!=s)throw Error();break}nn(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Qr>0&&Qr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function sn(){if(Qr>=100)throw new SyntaxError;Qr++}function on(t,e,r){var n=t.g.l,i=Kr(t.g),s=(i=t.g.g+i)-n;if(s<=0&&(t.g.l=i,r(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error();return t.g.g=i,t.g.l=n,e}function an(t){var e=Kr(t.g),r=Yr(t=t.g,e);if(t=t.h,u){var n,a=t;(n=o)||(n=o=new TextDecoder("utf-8",{fatal:!0})),e=r+e,a=0===r&&e===a.length?a:a.subarray(r,e);try{var c=n.decode(a)}catch(t){if(void 0===h){try{n.decode(new Uint8Array([128]))}catch(t){}try{n.decode(new Uint8Array([97])),h=!0}catch(t){h=!1}}throw!h&&(o=void 0),t}}else{e=(c=r)+e,r=[];let o,h=null;for(;c<e;){var l=t[c++];l<128?r.push(l):l<224?c>=e?i():(o=t[c++],l<194||128!=(192&o)?(c--,i()):r.push((31&l)<<6|63&o)):l<240?c>=e-1?i():(o=t[c++],128!=(192&o)||224===l&&o<160||237===l&&o>=160||128!=(192&(n=t[c++]))?(c--,i()):r.push((15&l)<<12|(63&o)<<6|63&n)):l<=244?c>=e-2?i():(o=t[c++],128!=(192&o)||o-144+(l<<28)>>30||128!=(192&(n=t[c++]))||128!=(192&(a=t[c++]))?(c--,i()):(l=(7&l)<<18|(63&o)<<12|(63&n)<<6|63&a,l-=65536,r.push(55296+(l>>10&1023),56320+(1023&l)))):i(),r.length>=8192&&(h=s(h,r),r.length=0)}c=s(h,r)}return c}function hn(t){var e=Kr(t.g);return qr(t.g,e)}function un(t,e,r){var n=Kr(t.g);for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var cn=class{constructor(t,e,r,n){if(Zr.length){let i=Zr.pop();i.init(t,e,r,n),t=i}else t=new Jr(t,e,r,n);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.u(n)}u({ha:t=!1}={}){this.ha=t}},ln=[];function dn(t){return new gn(4294967295&t,Math.floor(t/4294967296))}function fn(t){return t?/^\d+$/.test(t)?(jt(t),new gn(It,Ct)):null:pn||=new gn(0,0)}var pn,gn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function mn(t){return new Sn(4294967295&t,Math.floor(t/4294967296))}function _n(t){return t?/^-?\d+$/.test(t)?(jt(t),new Sn(It,Ct)):null:vn||=new Sn(0,0)}var vn,yn,En,An,wn,Tn,bn,kn,Sn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function Ln(t,e,r){return"undefined"!=typeof BigInt64Array?(bn||(bn=new BigInt64Array(1),kn=new Uint32Array(bn.buffer),bn[0]=BigInt(1),Tn=1===kn[0]),bn[0]=t,new e(kn[t=Tn?0:1],kn[1-t])):(wn||(yn=BigInt(Number.MIN_SAFE_INTEGER),En=BigInt(Number.MAX_SAFE_INTEGER),An=BigInt(4294967295),wn=BigInt(32)),t>=yn&&t<=En?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&An),Number(t>>wn))))}function xn(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function Rn(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Fn(t,e){if(e>=0)Rn(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function In(t){var e=It;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}var Cn=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function Nn(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function On(t,e,r){Rn(t.g,8*e+r)}function Mn(t,e){return On(t,e,2),e=t.g.end(),Nn(t,e),e.push(t.h),e}function Dn(t,e){var r=e.pop();for(r=t.h+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.h++;e.push(r),t.h++}function Pn(t,e,r){On(t,e,2),Rn(t.g,r.length),Nn(t,t.g.end()),Nn(t,r)}function $n(t,e,r,n){null!=r&&(e=Mn(t,e),n(r,t),Dn(t,e))}var Un=class{constructor(){this.l=[],this.h=0,this.g=new Cn}};function Bn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Gn=Bn(),jn=Bn(),Vn=Bn(),Hn=Bn(),Kn=Bn(),Xn=Bn(),Wn=Bn(),zn=Bn(),Yn=Bn(),qn=Bn();function Jn(t,e,r){var n=t.v;W&&W in n&&(n=n[W])&&delete n[e.g],e.h?e.j(t,e.h,e.g,r,e.l):e.j(t,e.g,r,e.l)}var Zn=class{constructor(t,e){this.v=Ge(t,e,void 0,2048)}toJSON(){return Ue(this)}j(){var t=sa,e=this.v,r=t.g,n=W;if(G&&n&&null!=e[n]?.[r]&&U(z,3),e=t.g,Q&&W&&void 0===Q&&(n=(r=this.v)[W])&&(n=n.da))try{n(r,e,Oe)}catch(t){d(t)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){var t=this.v,e=0|t[rt];return Je(this,t,e)?He(this,t,!0):new this.constructor(Xe(t,e,!1))}};Zn.prototype[Z]=ht,Zn.prototype.toString=function(){return this.v.toString()};var Qn=class{constructor(t,e,r){this.g=t,this.h=e,t=Gn,this.l=!!t&&r===t||!1}};function ti(t,e){return new Qn(t,e,Gn)}function ei(t,e,r,n,i){$n(t,r,fi(e,n),i)}var ri,ni,ii=ti(function(t,e,r,n,i){return 2===t.h&&(on(t,yr(e,n,r),i),!0)},ei),si=ti(function(t,e,r,n,i){return 2===t.h&&(on(t,yr(e,n,r),i),!0)},ei),oi=Symbol(),ai=Symbol(),hi=Symbol(),ui=Symbol(),ci=Symbol();function li(t,e,r,n){var i=n[t];if(i)return i;(i={}).qa=n,i.T=function(t){switch(typeof t){case"boolean":return Ie||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Ce||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var s=n[1],o=1;s&&s.constructor===Object&&(i.ba=s,"function"==typeof(s=n[++o])&&(i.ma=!0,ri??=s,ni??=n[o+1],s=n[o+=2]));for(var a={};s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var h=0;h<s.length;h++)a[s[h]]=s;s=n[++o]}for(h=1;void 0!==s;){let t;"number"==typeof s&&(h+=s,s=n[++o]);var u=void 0;if(s instanceof Qn?t=s:(t=ii,o--),t?.l){s=n[++o],u=n;var c=o;"function"==typeof s&&(s=s(),u[c]=s),u=s}for(c=h+1,"number"==typeof(s=n[++o])&&s<0&&(c-=s,s=n[++o]);h<c;h++){let n=a[h];u?r(i,h,t,u,n):e(i,h,t,n)}}return n[t]=i}function di(t){return Array.isArray(t)?t[0]instanceof Qn?t:[si,t]:[t,void 0]}function fi(t,e){return t instanceof Zn?t.v:Array.isArray(t)?Be(t,e):void 0}function pi(t,e,r,n){var i=r.g;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function gi(t,e,r,n,i){var s,o,a=r.g;t[e]=(t,e,r)=>a(t,e,r,o||=li(ai,pi,gi,n).T,s||=mi(n),i)}function mi(t){var e=t[hi];if(null!=e)return e;var r=li(ai,pi,gi,t);return e=r.ma?(t,e)=>ri(t,e,r):(t,e)=>{t:{sn();try{for(;rn(e)&&4!=e.h;){let h=e.l,u=r[h];if(null==u){let t=r.ba;if(t){let e=t[h];if(e){let t=vi(e);null!=t&&(u=r[h]=t)}}}if(null==u||!u(e,t,h)){var n=e;let r=n.m;if(nn(n),n.ha)var i=void 0;else{let t=n.g.g-r;n.g.g=r,i=qr(n.g,t)}n=void 0;var s=t,o=h,a=i;a&&((n=s[W]??(s[W]=new Ne))[o]??(n[o]=[])).push(a)}}let u=xe(t);u&&(u.da=r.qa[ci]);var h=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Qr>0&&Qr--}h=void 0}return h},t[hi]=e,t[ci]=_i.bind(t),e}function _i(t,e,r,n){var i=this[ai],s=this[hi],o=Be(void 0,i.T),a=xe(t);if(a){var h=!1,u=i.ba;if(u){if(i=(e,r,i)=>{if(0!==i.length)if(u[r])for(let t of i){e=tn(t);try{h=!0,s(o,e)}finally{en(e)}}else n?.(t,r,i)},null==e)Re(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(h){let n=0|t[rt];if(2&n&&2048&n&&!r?.La)throw Error();let i=mt(n),s=(e,s)=>{if(null!=er(t,e,i)){if(1===r?.Sa)return;throw Error()}null!=s&&(n=nr(t,n,e,s,i)),delete a[e]};null==e?pt(o,0|o[rt],(t,e)=>{s(t,e)}):s(e,er(o,e,i))}}}}function vi(t){var e=(t=di(t))[0].g;if(t=t[1]){let r=mi(t),n=li(ai,pi,gi,t).T;return(t,i,s)=>e(t,i,s,n,r)}return e}function yi(t,e,r){t[e]=r.h}function Ei(t,e,r,n){var i,s,o=r.h;t[e]=(t,e,r)=>o(t,e,r,s||=li(oi,yi,Ei,n).T,i||=Ai(n))}function Ai(t){var e=t[ui];if(!e){let r=li(oi,yi,Ei,t);e=(t,e)=>wi(t,e,r),t[ui]=e}return e}function wi(t,e,r){pt(t,0|t[rt],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.ba)&&(r=r[e])){var n=(r=di(r))[0].h;if(r=r[1]){let e=Ai(r),i=li(oi,yi,Ei,r).T;r=t.ma?ni(i,e):(t,r,s)=>n(t,r,s,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||U(q,3)}}),(t=xe(t))&&Re(t,(t,r,n)=>{for(Nn(e,e.g.end()),t=0;t<n.length;t++)Nn(e,C(n[t])||new Uint8Array(0))})}var Ti=wt(0);function bi(t,e){if(Array.isArray(e)){var r=0|e[rt];if(4&r)return e;for(var n=0,i=0;n<e.length;n++){let r=t(e[n]);null!=r&&(e[i++]=r)}return i<n&&(e.length=i),(t=-1537&r|5)!==r&&st(e,t),2&t&&Object.freeze(e),e}}var ki=(t,e)=>{var r=new Un;wi(t.v,r,li(oi,yi,Ei,e)),Nn(r,r.g.end()),t=new Uint8Array(r.h);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function Si(t,e,r){return new Qn(t,e,r)}function Li(t,e,r){return new Qn(t,e,r)}function xi(t,e,r){nr(t,0|t[rt],e,r,mt(0|t[rt]))}var Ri=ti(function(t,e,r,n,i){if(2!==t.h)return!1;if(t=Ht(t=on(t,Be([void 0,void 0],n),i)),i=mt(n=0|e[rt]),2&n)throw Error();var s=er(e,r,i);if(s instanceof be)2&s.J?((s=s.V()).push(t),nr(e,n,r,s,i)):s.Oa(t);else if(Array.isArray(s)){var o=0|s[rt];8192&o||st(s,o|=8192),2&o&&nr(e,n,r,s=dr(s),i),s.push(t)}else nr(e,n,r,at([t]),i);return!0},function(t,e,r,n,i){if(e instanceof be)e.forEach((e,s)=>{$n(t,r,Be([s,e],n),i)});else if(Array.isArray(e)){for(let s=0;s<e.length;s++){let o=e[s];Array.isArray(o)&&$n(t,r,Be(o,n),i)}at(e)}});function Fi(t,e,r){null!=(e=Zt(e))&&(On(t,r,5),t=t.g,Mt(e),In(t))}function Ii(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Kt(64,t));if(re(t)){if("string"===e)return ae(t);if("number"===e)return oe(t)}}(e),null!=e){if("string"==typeof e)_n(e);if(null!=e)switch(On(t,r,0),typeof e){case"number":t=t.g,Ot(e),xn(t,It,Ct);break;case"bigint":r=Ln(e,Sn,mn),xn(t.g,r.h,r.g);break;default:r=_n(e),xn(t.g,r.h,r.g)}}}function Ci(t,e,r){null!=(e=ne(e))&&null!=e&&(On(t,r,0),Fn(t.g,e))}function Ni(t,e,r){null!=(e=te(e))&&(On(t,r,0),t.g.g.push(e?1:0))}function Oi(t,e,r){null!=(e=fe(e))&&Pn(t,r,l(e))}function Mi(t,e,r,n,i){$n(t,r,fi(e,n),i)}function Di(t,e,r){null!=(e=null==e||"string"==typeof e||e instanceof O?e:void 0)&&Pn(t,r,Gr(e,!0).buffer)}function Pi(t,e,r){null!=(e=ie(e))&&null!=e&&(On(t,r,0),Rn(t.g,e))}function $i(t,e,r){null!=(e=ne(e))&&(e=parseInt(e,10),On(t,r,0),Fn(t.g,e))}function Ui(t,e,r){return(5===t.h||2===t.h)&&(e=pr(e,0|e[rt],r),2==t.h?un(t,Xr,e):e.push(Xr(t.g)),!0)}var Bi=Si(function(t,e,r){return 5===t.h&&(xi(e,r,Xr(t.g)),!0)},Fi,zn),Gi=Li(Ui,function(t,e,r){if(null!=(e=bi(Zt,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(On(n,i,5),n=n.g,Mt(s),In(n))}},zn),ji=Li(Ui,function(t,e,r){if(null!=(e=bi(Zt,e))&&e.length){On(t,r,2),Rn(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,Mt(e[n]),In(r)}},zn),Vi=Si(function(t,e,r){return 5===t.h&&(xi(e,r,0===(t=Xr(t.g))?void 0:t),!0)},Fi,zn),Hi=Si(function(t,e,r){return 0!==t.h?t=!1:(xi(e,r,jr(t.g,$t)),t=!0),t},Ii,Xn),Ki=Si(function(t,e,r){return 0!==t.h?e=!1:(xi(e,r,(t=jr(t.g,$t))===Ti?void 0:t),e=!0),e},Ii,Xn),Xi=Si(function(t,e,r){return 0!==t.h?t=!1:(xi(e,r,jr(t.g,Pt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Xt(64,t));if(re(t)){if("string"===e)return e=Yt(Number(t)),Wt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),(e="-"!==t[0]&&((e=t.length)<20||20===e&&t<="18446744073709551615"))||(jt(t),t=Ut(It,Ct))),t;if("number"===e)return(t=Yt(t))>=0&&Wt(t)||(Ot(t),t=Dt(It,Ct)),t}}(e),null!=e){if("string"==typeof e)fn(e);if(null!=e)switch(On(t,r,0),typeof e){case"number":t=t.g,Ot(e),xn(t,It,Ct);break;case"bigint":r=Ln(e,gn,dn),xn(t.g,r.h,r.g);break;default:r=fn(e),xn(t.g,r.h,r.g)}}},Wn),Wi=Si(function(t,e,r){return 0===t.h&&(xi(e,r,Hr(t.g)),!0)},Ci,Hn),zi=Li(function(t,e,r){return(0===t.h||2===t.h)&&(e=pr(e,0|e[rt],r),2==t.h?un(t,Hr,e):e.push(Hr(t.g)),!0)},function(t,e,r){if(null!=(e=bi(ne,e))&&e.length){r=Mn(t,r);for(let r=0;r<e.length;r++)Fn(t.g,e[r]);Dn(t,r)}},Hn),Yi=Si(function(t,e,r){return 0===t.h&&(xi(e,r,0===(t=Hr(t.g))?void 0:t),!0)},Ci,Hn),qi=Si(function(t,e,r){return 0===t.h&&(xi(e,r,Vr(t.g)),!0)},Ni,jn),Ji=Si(function(t,e,r){return 0===t.h&&(xi(e,r,!1===(t=Vr(t.g))?void 0:t),!0)},Ni,jn),Zi=Li(function(t,e,r){return 2===t.h&&(t=an(t),pr(e,0|e[rt],r).push(t),!0)},function(t,e,r){if(null!=(e=bi(fe,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&Pn(n,i,l(s))}},Vn),Qi=Si(function(t,e,r){return 2===t.h&&(xi(e,r,""===(t=an(t))?void 0:t),!0)},Oi,Vn),ts=Si(function(t,e,r){return 2===t.h&&(xi(e,r,an(t)),!0)},Oi,Vn),es=function(t,e,r=Gn){return new Qn(t,e,r)}(function(t,e,r,n,i){return 2===t.h&&(n=Be(void 0,n),pr(e,0|e[rt],r).push(n),on(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let s=0;s<e.length;s++)Mi(t,e[s],r,n,i);1&(t=0|e[rt])||st(e,1|t)}}),rs=ti(function(t,e,r,n,i,s){if(2!==t.h)return!1;var o=0|e[rt];return _r(e,o,s,r,mt(o)),on(t,e=yr(e,n,r),i),!0},Mi),ns=Si(function(t,e,r){return 2===t.h&&(xi(e,r,hn(t)),!0)},Di,Yn),is=Li(function(t,e,r){return(0===t.h||2===t.h)&&(e=pr(e,0|e[rt],r),2==t.h?un(t,Kr,e):e.push(Kr(t.g)),!0)},function(t,e,r){if(null!=(e=bi(ie,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(On(n,i,0),Rn(n.g,s))}},Kn),ss=Si(function(t,e,r){return 0===t.h&&(xi(e,r,0===(t=Kr(t.g))?void 0:t),!0)},Pi,Kn),os=Si(function(t,e,r){return 0===t.h&&(xi(e,r,Hr(t.g)),!0)},$i,qn),as=Si(function(t,e,r){return 0===t.h&&(xi(e,r,0===(t=Hr(t.g))?void 0:t),!0)},$i,qn);class hs{constructor(t,e){var r=Fs;this.g=t,this.h=e,this.m=Ar,this.j=kr,this.defaultValue=void 0,this.l=null!=r.Qa?gt:void 0}register(){v(this)}}function us(t,e){return new hs(t,e)}function cs(t,e){return(r,n)=>{t:{let s={ea:!0};n&&Object.assign(s,n),r=tn(r,void 0,void 0,s);try{let n=new t,s=n.v;mi(e)(s,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{en(r)}i=void 0}return i}}function ls(t){return e=>ki(e,t)}function ds(t){return function(){return ki(this,t)}}var fs,ps=class extends Zn{constructor(t){super(t)}},gs=[0,Qi,Si(function(t,e,r){return 2===t.h&&(xi(e,r,(t=hn(t))===I()?void 0:t),!0)},function(t,e,r){if(null!=e){if(e instanceof Zn){let n=e.Ta;return void(n?(e=n(e),null!=e&&Pn(t,r,Gr(e,!0).buffer)):U(q,3))}if(Array.isArray(e))return void U(q,3)}Di(t,e,r)},Yn)],ms=globalThis.trustedTypes;var _s=class{constructor(t){this.g=t}toString(){return this.g+""}};function vs(t){var e;return void 0===fs&&(fs=function(){var t=null;if(!ms)return t;try{let e=t=>t;t=ms.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=fs)?e.createScriptURL(t):t,new _s(t)}function ys(t,...e){if(0===e.length)return vs(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return vs(r)}var Es=[0,Wi,os,qi,-1,zi,os,-1,qi,-1],As=[0,os,-1,qi],ws=class extends Zn{constructor(t){super(t)}},Ts=[0,qi,ts,qi,os,-1,Li(function(t,e,r){return(0===t.h||2===t.h)&&(e=pr(e,0|e[rt],r),2==t.h?un(t,Wr,e):e.push(Hr(t.g)),!0)},function(t,e,r){if(null!=(e=bi(ne,e))&&e.length){r=Mn(t,r);for(let r=0;r<e.length;r++)Fn(t.g,e[r]);Dn(t,r)}},qn),ts,-1,[0,qi,-1],os,qi,-1,As],bs=[0,3,qi,-1,2,[0,[2],Wi,rs,[0,Si(function(t,e,r){return 0===t.h&&(xi(e,r,Kr(t.g)),!0)},Pi,Kn)]],[0,os,qi,os,qi,os,qi,ts,-1],[0,[3,4],ts,-1,rs,[0,Wi],rs,[0,os]],[0]],ks=[0,ts,-2],Ss=class extends Zn{constructor(t){super(t)}},Ls=[0],xs=class extends Zn{constructor(t){super(t)}},Rs=[0,Wi,qi,1,qi,-4],Fs=class extends Zn{constructor(t){super(t,2)}},Is={};Is[336783863]=[0,ts,qi,-1,Wi,[0,[1,2,3,4,5,6,7,8,9],rs,Ls,rs,Ts,rs,ks,rs,Rs,rs,Es,rs,[0,ts,-2],rs,[0,ts,os],rs,bs,rs,As],[0,ts],qi,[0,[1,3],[2,4],rs,[0,zi],-1,rs,[0,Zi],-1,es,[0,ts,-1]],ts];var Cs=[0,Ki,-1,Ji,-3,Ki,zi,Qi,Yi,Ki,-1,Ji,Yi,Ji,-2,Qi];function Ns(t,e){Ur(t,3,e)}function Os(t,e){Ur(t,4,e)}var Ms=class extends Zn{constructor(t){super(t,500)}u(t){return kr(this,0,7,t)}},Ds=[-1,{}],Ps=[0,ts,1,Ds],$s=[0,ts,Zi,Ds];function Us(t,e){Rr(t,1,Ms,e)}function Bs(t,e){Ur(t,10,e)}function Gs(t,e){Ur(t,15,e)}var js=class extends Zn{constructor(t){super(t,500)}u(t){return kr(this,0,1001,t)}},Vs=[-500,es,[-500,Qi,-1,Zi,-3,[-2,Is,qi],es,gs,Yi,-1,Ps,$s,es,[0,Qi,Ji],Qi,Cs,Yi,Zi,987,Zi],4,es,[-500,ts,-1,[-1,{}],998,ts],es,[-500,ts,Zi,-1,[-2,{},qi],997,Zi,-1],Yi,es,[-500,ts,Zi,Ds,998,Zi],Zi,Yi,Ps,$s,es,[0,Qi,-1,Ds],Zi,-2,Cs,Qi,-1,Ji,[0,Ji,ss],978,Ds,es,gs];js.prototype.g=ds(Vs);var Hs=cs(js,Vs),Ks=class extends Zn{constructor(t){super(t)}},Xs=class extends Zn{constructor(t){super(t)}g(){return Tr(this,Ks,1)}},Ws=[0,es,[0,Wi,Bi,ts,-1]],zs=cs(Xs,Ws),Ys=class extends Zn{constructor(t){super(t)}},qs=class extends Zn{constructor(t){super(t)}},Js=class extends Zn{constructor(t){super(t)}l(){return Ar(this,Ys,2)}g(){return Tr(this,qs,5)}},Zs=cs(class extends Zn{constructor(t){super(t)}},[0,Zi,zi,ji,[0,os,[0,Wi,-3],[0,Bi,-3],[0,Wi,-1,[0,es,[0,Wi,-2]]],es,[0,Bi,-1,ts,Bi]],ts,-1,Hi,es,[0,Wi,Bi],Zi,Hi]),Qs=class extends Zn{constructor(t){super(t)}},to=cs(class extends Zn{constructor(t){super(t)}},[0,es,[0,Bi,-4]]),eo=class extends Zn{constructor(t){super(t)}},ro=cs(class extends Zn{constructor(t){super(t)}},[0,es,[0,Bi,-4]]),no=class extends Zn{constructor(t){super(t)}},io=[0,Wi,-1,ji,os],so=class extends Zn{constructor(t){super(t)}};so.prototype.g=ds([0,Bi,-4,Hi]);var oo=class extends Zn{constructor(t){super(t)}},ao=cs(class extends Zn{constructor(t){super(t)}},[0,es,[0,1,Wi,ts,Ws],Hi]),ho=class extends Zn{constructor(t){super(t)}},uo=class extends Zn{constructor(t){super(t)}g(){var t=tr(this,1,void 0,void 0,lr);return null==t?I():t}},co=class extends Zn{constructor(t){super(t)}},lo=[1,2],fo=cs(class extends Zn{constructor(t){super(t)}},[0,es,[0,lo,rs,[0,ji],rs,[0,ns],Wi,ts],Hi]),po=class extends Zn{constructor(t){super(t)}},go=[0,ts,Wi,Bi,Zi,-1],mo=class extends Zn{constructor(t){super(t)}},_o=[0,qi,-1],vo=class extends Zn{constructor(t){super(t)}g(){ir(this,ws,2,yo)}},yo=[1,2,3,4,5,6],Eo=class extends Zn{constructor(t){super(t)}g(){return null!=tr(this,1,void 0,void 0,lr)}l(){return null!=fe(tr(this,2))}},Ao=class extends Zn{constructor(t){super(t)}g(){return te(tr(this,2))??!1}},wo=[0,ns,ts,[0,Wi,Hi,-1],[0,Xi,Hi]],To=[0,wo,qi,[0,yo,rs,Rs,rs,Ts,rs,Es,rs,Ls,rs,ks,rs,bs],os],bo=ls(To),ko=class extends Zn{constructor(t){super(t)}},So=[0,To,Bi,-1,Wi],Lo=us(502141897,ko);Is[502141897]=So;var xo=cs(class extends Zn{constructor(t){super(t)}},[0,[0,os,-1,Gi,is],io]),Ro=class extends Zn{constructor(t){super(t)}},Fo=class extends Zn{constructor(t){super(t)}},Io=[0,To,Bi,[0,To],qi],Co=us(508968150,Fo);Is[508968150]=[0,To,So,Io,Bi,[0,[0,wo]]],Is[508968149]=Io;var No=class extends Zn{constructor(t){super(t)}l(){return Ar(this,po,2)}g(){rr(this,2)}},Oo=[0,To,go];Is[478825465]=Oo;var Mo=class extends Zn{constructor(t){super(t)}},Do=class extends Zn{constructor(t){super(t)}},Po=class extends Zn{constructor(t){super(t)}},$o=class extends Zn{constructor(t){super(t)}},Uo=class extends Zn{constructor(t){super(t)}},Bo=[0,To,[0,To],Oo,-1],Go=[0,To,Bi,Wi],jo=[0,To,Bi],Vo=[0,To,Go,jo,Bi],Ho=us(479097054,Uo);Is[479097054]=[0,To,Vo,Bo],Is[463370452]=Bo,Is[464864288]=Go;var Ko=us(462713202,$o);Is[462713202]=Vo,Is[474472470]=jo;var Xo=class extends Zn{constructor(t){super(t)}},Wo=class extends Zn{constructor(t){super(t)}},zo=class extends Zn{constructor(t){super(t)}},Yo=class extends Zn{constructor(t){super(t)}},qo=[0,To,Bi,-1,Wi],Jo=[0,To,Bi,qi];Yo.prototype.g=ds([0,To,jo,[0,To],So,Io,qo,Jo]);var Zo=class extends Zn{constructor(t){super(t)}},Qo=us(456383383,Zo);Is[456383383]=[0,To,go];var ta=class extends Zn{constructor(t){super(t)}},ea=us(476348187,ta);Is[476348187]=[0,To,_o];var ra=class extends Zn{constructor(t){super(t)}},na=class extends Zn{constructor(t){super(t)}},ia=[0,os,-1],sa=us(458105876,class extends Zn{constructor(t){super(t)}g(){var t=this.v,e=0|t[rt],r=ut(this,e);return t=function(t,e,r,n){var i=na;!n&&ze(t)&&(r=0|(e=t.v)[rt]);var s=er(e,2);if(t=!1,null==s){if(n)return Le();s=[]}else if(s.constructor===be){if(!(2&s.J)||n)return s;s=s.V()}else Array.isArray(s)?t=!!(2&s[rt]):s=[];if(n){if(!s.length)return Le();t||(t=!0,ot(s))}else t&&(t=!1,at(s),s=dr(s));return!t&&32&r&&it(s,32),r=nr(e,r,2,n=new be(s,i,ge,void 0)),t||qe(e,r),n}(this,t,e,r),!r&&na&&(t.ra=!0),t}});Is[458105876]=[0,ia,Ri,[!0,Hi,[0,ts,-1,Zi]],[0,zi,qi,os],qi];var oa=class extends Zn{constructor(t){super(t)}},aa=us(458105758,oa);Is[458105758]=[0,To,ts,ia];var ha=class extends Zn{constructor(t){super(t)}},ua=class extends Zn{constructor(t){super(t)}},ca=class extends Zn{constructor(t){super(t)}},la=ls([0,es,[0,as,es,[0,Vi,-1],Ji]]),da=class extends Zn{constructor(t){super(t)}},fa=[0,Vi,-1,Ji],pa=class extends Zn{constructor(t){super(t)}},ga=class extends Zn{constructor(t){super(t)}},ma=[1,2];ga.prototype.g=ds([0,ma,rs,fa,rs,[0,es,fa]]);var _a=class extends Zn{constructor(t){super(t)}},va=us(443442058,_a);Is[443442058]=[0,To,ts,Wi,Bi,Zi,-1,qi,Bi],Is[514774813]=qo;var ya=class extends Zn{constructor(t){super(t)}},Ea=us(516587230,ya);function Aa(t,e){return e=e?e.clone():new po,void 0!==t.displayNamesLocale?rr(e,1,de(t.displayNamesLocale)):void 0===t.displayNamesLocale&&rr(e,1),void 0!==t.maxResults?Or(e,2,t.maxResults):"maxResults"in t&&rr(e,2),void 0!==t.scoreThreshold?Mr(e,3,t.scoreThreshold):"scoreThreshold"in t&&rr(e,3),void 0!==t.categoryAllowlist?$r(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&rr(e,4),void 0!==t.categoryDenylist?$r(e,5,t.categoryDenylist):"categoryDenylist"in t&&rr(e,5),e}function wa(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Ta(t,e=-1,r=""){return{categories:t.map(t=>({index:Fr(t,1)??0??-1,score:Ir(t,2)??0,categoryName:fe(tr(t,3))??""??"",displayName:fe(tr(t,4))??""??""})),headIndex:e,headName:r}}function ba(t){var e={classifications:Tr(t,oo,1).map(t=>Ta(Ar(t,Xs,4)?.g()??[],Fr(t,2)??0,fe(tr(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(Tt(t)?t=Number(t):(t=Kt(64,t),t=Tt(t)?Number(t):String(t)),t):re(t)?"number"==typeof t?oe(t):ae(t):void 0}(tr(t,2,void 0,void 0,ce))&&(e.timestampMs=wa(tr(t,2,void 0,void 0,ce)??Ze)),e}function ka(t){var e=or(t,3,Zt,sr()),r=or(t,2,ne,sr()),n=or(t,1,fe,sr()),i=or(t,9,fe,sr()),s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:r[t]??-1,categoryName:n[t]??"",displayName:i[t]??""});if((e=Ar(t,Js,4)?.l())&&(s.boundingBox={originX:Fr(e,1,Qe)??0,originY:Fr(e,2,Qe)??0,width:Fr(e,3,Qe)??0,height:Fr(e,4,Qe)??0,angle:0}),Ar(t,Js,4)?.g().length)for(let e of Ar(t,Js,4).g())s.keypoints.push({x:tr(e,1,void 0,Qe,Zt)??0,y:tr(e,2,void 0,Qe,Zt)??0,score:tr(e,4,void 0,Qe,Zt)??0,label:fe(tr(e,3,void 0,Qe))??""});return s}function Sa(t){var e=[];for(let r of Tr(t,eo,1))e.push({x:Ir(r,1)??0,y:Ir(r,2)??0,z:Ir(r,3)??0,visibility:Ir(r,4)??0});return e}function La(t){var e=[];for(let r of Tr(t,Qs,1))e.push({x:Ir(r,1)??0,y:Ir(r,2)??0,z:Ir(r,3)??0,visibility:Ir(r,4)??0});return e}function xa(t){return Array.from(t,t=>t>127?t-256:t)}function Ra(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let s=0;s<t.length;s++)r+=t[s]*e[s],n+=t[s]*t[s],i+=e[s]*e[s];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}Is[516587230]=[0,To,qo,Jo,Bi],Is[518928384]=Jo;var Fa,Ia=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 Ca(t){if(t)return!0;if(void 0===Fa)try{await WebAssembly.instantiate(Ia),Fa=!0}catch{Fa=!1}return Fa}async function Na(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Ca(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var Oa=class{};Oa.forVisionTasks=function(t,e=!1){return Na("vision",t??ys``,e)},Oa.forTextTasks=function(t,e=!1){return Na("text",t??ys``,e)},Oa.forGenAiTasks=function(t,e=!1){return Na("genai",t??ys``,e)},Oa.forAudioTasks=function(t,e=!1){return Na("audio",t??ys``,e)},Oa.isSimdSupported=function(t=!1){return Ca(t)};var Ma=class{close(){}};function Da(){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 Pa(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function $a(t){return 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]}function Ua(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Ba(t,e,r){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(r?t.i._bindTextureToStream(r):t.i._bindTextureToCanvas(),!(r=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);var[n,i]=$a(e);return!t.l||n===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=i),[n,i]}function Ga(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function ja(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Va(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Ha=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:Da()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){var r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Ua(this,n||"input_audio",n=>{Ua(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){ja(this,"__graph_config__",e=>{t(e)}),Ua(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),Ua(this,n,t=>{this.i._addAudioToInputStream(this.g,e,r,t,i)})}addGpuBufferToStream(t,e,r){Ua(this,e,e=>{var[n,i]=Ba(this,t,e);this.i._addBoundTextureToStream(e,n,i,r)})}addBoolToStream(t,e,r){Ua(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){Ua(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){Ua(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){Ua(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){Ua(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){Ua(this,e,e=>{Ua(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){Ua(this,e,e=>{Ga(this,Object.keys(t),n=>{Ga(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){Ua(this,r,r=>{Ua(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){Ua(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){Ua(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){Ua(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){Ua(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){Ua(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){Ua(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){Ua(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ua(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){Ua(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){Ua(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){Ua(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){Ua(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){Ua(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){Ua(this,e,e=>{Ua(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){Ua(this,r,r=>{Ua(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){Ua(this,e,e=>{var r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){Ua(this,e,e=>{var r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){Ua(this,e,e=>{var r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){Ua(this,e,e=>{var r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){Ua(this,e,e=>{var r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){Ua(this,e,e=>{var r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ua(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){ja(this,t,e),Ua(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Va(this,t,e),Ua(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){ja(this,t,e),Ua(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Va(this,t,e),Ua(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){ja(this,t,e),Ua(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Va(this,t,e),Ua(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){ja(this,t,e),Ua(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Va(this,t,e),Ua(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){ja(this,t,e),Ua(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Va(this,t,e),Ua(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){ja(this,t,e),Ua(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Va(this,t,e),Ua(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){ja(this,t,e),Ua(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Va(this,t,e),Ua(this,t,t=>{this.i._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ja(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),Ua(this,t,t=>{this.i._attachAudioListener(t,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}};function Ka(t){return class extends t{Ka(){this.i._registerModelResourcesGraphService()}}}var Xa=Ka(Ha),Wa=class extends Xa{};async function za(t,e,r,n){return t=await(async(t,e,r,n,i)=>{if(e&&await Pa(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Pa(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,n)})(t,r.wasmLoaderPath,r.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&t.endsWith(".data")?r.assetBinaryPath.toString():t}),t.na=new Ma,await t.u(n),t}async function Ya(t,e,r,n){return za(t,e,r,n)}function qa(t,e){var r=Ar(t.baseOptions,Eo,1)||new Eo;"string"==typeof e?(rr(r,2,de(e)),rr(r,1)):e instanceof Uint8Array&&(rr(r,1,lt(e,!1)),rr(r,2)),kr(t.baseOptions,0,1,r)}function Ja(t){try{let e=t.H.length;if(1===e)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map(t=>t.message).join(", "))}finally{t.H=[]}}function Za(t,e){t.C=Math.max(t.C,e)}function Qa(t,e){t.B=new Ms,Pr(t.B,2,"PassThroughCalculator"),Ns(t.B,"free_memory"),Os(t.B,"free_memory_unused_out"),Bs(e,"free_memory"),Us(e,t.B)}function th(t,e){Ns(t.B,e),Os(t.B,e+"_unused_out")}function eh(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var rh=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){let e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ar(this.baseOptions,Eo,1)?.g()||Ar(this.baseOptions,Eo,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=Ar(t.baseOptions,vo,3);if(!r){var n=r=new vo,i=new Ss;Sr(n,4,yo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new ws,Sr(e,2,yo,n)):(e=r,n=new Ss,Sr(e,4,yo,n))),kr(t.baseOptions,0,3,r)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),qa(this,"/model.dat"),this.m(),this.L()});if(e.modelAssetBuffer instanceof Uint8Array)qa(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(e.modelAssetBuffer).then(t=>{qa(this,t),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){var t;if(this.g.ca(e=>{t=Hs(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((t,e)=>{this.H.push(Error(e))}),this.g.Ka(),this.g.setGraph(t,e),this.B=void 0,Ja(this)}finishProcessing(){this.g.finishProcessing(),Ja(this)}close(){this.B=void 0,this.na?.close(),this.g.closeGraph()}};function nh(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}rh.prototype.close=rh.prototype.close;class ih{constructor(t,e,r,n){this.g=t,this.h=e,this.m=r,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function sh(t,e,r){var n=t.g;if(r=nh(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(t.h,r),r}function oh(t,e){var r=t.g,n=nh(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);var i=nh(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(t.O),r.vertexAttribPointer(t.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);var s=nh(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(t.L),r.vertexAttribPointer(t.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new ih(r,n,i,s)}function ah(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function hh(t,e,r,n){return ah(t,e),t.h||(t.m(),t.D()),r?(t.o||(t.o=oh(t,!0)),r=t.o):(t.A||(t.A=oh(t,!1)),r=t.A),e.useProgram(t.h),r.bind(),t.l(),t=n(),r.g.bindVertexArray(null),t}function uh(t,e,r){return ah(t,e),t=nh(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function ch(t,e,r){ah(t,e),t.B||(t.B=nh(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function lh(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var dh=class{H(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){var t=this.g;if(this.h=nh(t.createProgram(),"Failed to create WebGL program"),this.X=sh(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.W=sh(this,this.H(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.O=t.getAttribLocation(this.h,"aVertex"),this.L=t.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){let t=this.g;t.deleteProgram(this.h),t.deleteShader(this.X),t.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.o&&this.o.close()}};var fh=class extends dh{H(){return"\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.C=uh(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=uh(this,t,t.NEAREST)}m(){super.m();var t=this.g;this.P=nh(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=nh(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.M=nh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.M,0),t.uniform1i(this.P,1),t.uniform1i(this.U,2)}close(){this.C&&this.g.deleteTexture(this.C),this.j&&this.g.deleteTexture(this.j),super.close()}},ph=class extends dh{H(){return"\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.j=uh(this,t),t.activeTexture(t.TEXTURE2),this.C=uh(this,t)}m(){super.m();var t=this.g;this.M=nh(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.P=nh(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=nh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.I,0),t.uniform1i(this.M,1),t.uniform1i(this.P,2)}close(){this.j&&this.g.deleteTexture(this.j),this.C&&this.g.deleteTexture(this.C),super.close()}};function gh(t,e){switch(e){case 0:return t.g.find(t=>t instanceof Uint8Array);case 1:return t.g.find(t=>t instanceof Float32Array);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function mh(t){var e=gh(t,1);if(!e){if(e=gh(t,0))e=new Float32Array(e).map(t=>t/255);else{e=new Float32Array(t.width*t.height);let n=vh(t);var r=Eh(t);if(ch(r,n,_h(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(t.width*t.height*4),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,r);for(let t=0,n=0;t<e.length;++t,n+=4)e[t]=r[n]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function _h(t){var e=gh(t,2);if(!e){let r=vh(t);e=Ah(t);let n=mh(t),i=yh(t);r.texImage2D(r.TEXTURE_2D,0,i,t.width,t.height,0,r.RED,r.FLOAT,n),wh(t)}return e}function vh(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=nh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function yh(t){if(t=vh(t),!Th)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))Th=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Th=t.R16F}return Th}function Eh(t){return t.l||(t.l=new dh),t.l}function Ah(t){var e=vh(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=gh(t,2);return r||(r=uh(Eh(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(r),t.j=!0),e.bindTexture(e.TEXTURE_2D,r),r}function wh(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var Th,bh=class{constructor(t,e,r,n,i,s,o){this.g=t,this.m=e,this.j=r,this.canvas=n,this.l=i,this.width=s,this.height=o,this.j&&(0===--kh&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Fa(){return!!gh(this,0)}ka(){return!!gh(this,1)}R(){return!!gh(this,2)}ja(){return(e=gh(t=this,0))||(e=mh(t),e=new Uint8Array(e.map(t=>Math.round(255*t))),t.g.push(e)),e;var t,e}ia(){return mh(this)}N(){return _h(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof Uint8Array)r=new Uint8Array(e);else if(e instanceof Float32Array)r=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{let t=vh(this),e=Eh(this);t.activeTexture(t.TEXTURE1),r=uh(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,r);let n=yh(this);t.texImage2D(t.TEXTURE_2D,0,n,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),ch(e,t,r),hh(e,t,!1,()=>{Ah(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),wh(this)}),lh(e),wh(this)}}t.push(r)}return new bh(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&vh(this).deleteTexture(gh(this,2)),kh=-1}};bh.prototype.close=bh.prototype.close,bh.prototype.clone=bh.prototype.clone,bh.prototype.getAsWebGLTexture=bh.prototype.N,bh.prototype.getAsFloat32Array=bh.prototype.ia,bh.prototype.getAsUint8Array=bh.prototype.ja,bh.prototype.hasWebGLTexture=bh.prototype.R,bh.prototype.hasFloat32Array=bh.prototype.ka,bh.prototype.hasUint8Array=bh.prototype.Fa;var kh=250,Sh={color:"white",lineWidth:4,radius:6};function Lh(t){return{...Sh,fillColor:(t=t||{}).color,...t}}function xh(t,e){return t instanceof Function?t(e):t}function Rh(t,e,r){return Math.max(Math.min(e,r),Math.min(Math.max(e,r),t))}function Fh(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Ih(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Ch(t,e,r){if(e.R())r(e.N());else{let n=e.ka()?e.ia():e.ja();t.m=t.m??new dh;let i=Ih(t);r((t=new bh([n],e.m,!1,i.canvas,t.m,e.width,e.height)).N()),t.close()}}function Nh(t,e,r,n){var i=function(t){return t.g||(t.g=new fh),t.g}(t),s=Ih(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;hh(i,s,!0,()=>{!function(t,e,r,n){var i=t.g;if(i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.C),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),t.I&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(let[r,n]of t){t=r;let i=n,s=e.next();if(s.done)return!1;let[o,a]=s.value;if(t!==o||i[0]!==a[0]||i[1]!==a[1]||i[2]!==a[2]||i[3]!==a[3])return!1}return!!e.next().done}(t.I,n))i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j);else{t.I=n;let e=Array(1024).fill(0);n.forEach((t,r)=>{if(4!==t.length)throw Error(`Color at index ${r} is not a four-channel value.`);e[4*r]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]}),i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,256,1,0,i.RGBA,i.UNSIGNED_BYTE,new Uint8Array(e))}}(i,e,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);var t=i.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}function Oh(t,e,r,n){var i=Ih(t),s=function(t){return t.h||(t.h=new ph),t.h}(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;hh(s,i,!0,()=>{var t=s.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s.j),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,s.C),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(t=s.g).activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}var Mh=class{constructor(t,e){"undefined"!=typeof CanvasRenderingContext2D&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}ya(t,e){if(t){var r=Fh(this);e=Lh(e),r.save();var n=r.canvas,i=0;for(let s of t)r.fillStyle=xh(e.fillColor,{index:i,from:s}),r.strokeStyle=xh(e.color,{index:i,from:s}),r.lineWidth=xh(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*n.width,s.y*n.height,xh(e.radius,{index:i,from:s}),0,2*Math.PI),r.fill(t),r.stroke(t),++i;r.restore()}}xa(t,e,r){if(t&&e){var n=Fh(this);r=Lh(r),n.save();var i=n.canvas,s=0;for(let o of e){n.beginPath(),e=t[o.start];let a=t[o.end];e&&a&&(n.strokeStyle=xh(r.color,{index:s,from:e,to:a}),n.lineWidth=xh(r.lineWidth,{index:s,from:e,to:a}),n.moveTo(e.x*i.width,e.y*i.height),n.lineTo(a.x*i.width,a.y*i.height)),++s,n.stroke()}n.restore()}}ua(t,e){var r=Fh(this);e=Lh(e),r.save(),r.beginPath(),r.lineWidth=xh(e.lineWidth,{}),r.strokeStyle=xh(e.color,{}),r.fillStyle=xh(e.fillColor,{}),r.moveTo(t.originX,t.originY),r.lineTo(t.originX+t.width,t.originY),r.lineTo(t.originX+t.width,t.originY+t.height),r.lineTo(t.originX,t.originY+t.height),r.lineTo(t.originX,t.originY),r.stroke(),r.fill(),r.restore()}va(t,e,r=[0,0,0,255]){this.l?function(t,e,r,n){var i=Ih(t);Ch(t,e,e=>{Nh(t,e,r,n),(e=Fh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,r,e):Nh(this,t.N(),r,e)}wa(t,e,r){this.l?function(t,e,r,n){var i=Ih(t);Ch(t,e,e=>{Oh(t,e,r,n),(e=Fh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,e,r):Oh(this,t.N(),e,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Dh(t,e){switch(e){case 0:return t.g.find(t=>t instanceof ImageData);case 1:return t.g.find(t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function Ph(t){var e=Dh(t,0);if(!e){e=Uh(t);let r=Bh(t),n=new Uint8Array(t.width*t.height*4);ch(r,e,$h(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),lh(r),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function $h(t){var e=Dh(t,2);if(!e){let r=Uh(t);e=Gh(t);let n=Dh(t,1)||Ph(t);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),jh(t)}return e}function Uh(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=nh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Bh(t){return t.l||(t.l=new dh),t.l}function Gh(t){var e=Uh(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=Dh(t,2);return r||(r=uh(Bh(t),e),t.g.push(r),t.m=!0),e.bindTexture(e.TEXTURE_2D,r),r}function jh(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Vh(t){var e=Uh(t);return hh(Bh(t),e,!0,()=>function(t,e){var r=t.canvas;if(r.width===t.width&&r.height===t.height)return e();var n=r.width,i=r.height;return r.width=t.width,r.height=t.height,t=e(),r.width=n,r.height=i,t}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}Mh.prototype.close=Mh.prototype.close,Mh.prototype.drawConfidenceMask=Mh.prototype.wa,Mh.prototype.drawCategoryMask=Mh.prototype.va,Mh.prototype.drawBoundingBox=Mh.prototype.ua,Mh.prototype.drawConnectors=Mh.prototype.xa,Mh.prototype.drawLandmarks=Mh.prototype.ya,Mh.lerp=function(t,e,r,n,i){return Rh(n*(1-(t-e)/(r-e))+i*(1-(r-t)/(r-e)),n,i)},Mh.clamp=Rh;var Hh=class{constructor(t,e,r,n,i,s,o){this.g=t,this.j=e,this.m=r,this.canvas=n,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--Kh&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Ea(){return!!Dh(this,0)}la(){return!!Dh(this,1)}R(){return!!Dh(this,2)}Ca(){return Ph(this)}Ba(){var t=Dh(this,1);return t||($h(this),Gh(this),t=Vh(this),jh(this),this.g.push(t),this.j=!0),t}N(){return $h(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof ImageData)r=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){let t=Uh(this),e=Bh(this);t.activeTexture(t.TEXTURE1),r=uh(e,t),t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),ch(e,t,r),hh(e,t,!1,()=>{Gh(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),jh(this)}),lh(e),jh(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);$h(this),Gh(this),r=Vh(this),jh(this)}t.push(r)}return new Hh(t,this.la(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Dh(this,1).close(),this.m&&Uh(this).deleteTexture(Dh(this,2)),Kh=-1}};Hh.prototype.close=Hh.prototype.close,Hh.prototype.clone=Hh.prototype.clone,Hh.prototype.getAsWebGLTexture=Hh.prototype.N,Hh.prototype.getAsImageBitmap=Hh.prototype.Ba,Hh.prototype.getAsImageData=Hh.prototype.Ca,Hh.prototype.hasWebGLTexture=Hh.prototype.R,Hh.prototype.hasImageBitmap=Hh.prototype.la,Hh.prototype.hasImageData=Hh.prototype.Ea;var Kh=250;function Xh(...t){return t.map(([t,e])=>({start:t,end:e}))}var Wh,zh=Ka((Wh=Ha,class extends Wh{get ga(){return this.i}pa(t,e,r){Ua(this,e,e=>{var[n,i]=Ba(this,t,e);this.ga._addBoundTextureAsImageToStream(e,n,i,r)})}Z(t,e){ja(this,t,e),Ua(this,t,t=>{this.ga._attachImageListener(t)})}aa(t,e){Va(this,t,e),Ua(this,t,t=>{this.ga._attachImageVectorListener(t)})}})),Yh=class extends zh{};async function qh(t,e,r){return Ya(t,r.canvas??(Da()?void 0:document.createElement("canvas")),e,r)}function Jh(t,e,r,n){if(t.na&&void 0!==n&&Ar(t.baseOptions,vo,3)?.g(),t.U){let s=new so;if(r?.regionOfInterest){if(!t.oa)throw Error("This task doesn't support region-of-interest.");var i=r.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");Mr(s,1,(i.left+i.right)/2),Mr(s,2,(i.top+i.bottom)/2),Mr(s,4,i.right-i.left),Mr(s,3,i.bottom-i.top)}else Mr(s,1,.5),Mr(s,2,.5),Mr(s,4,1),Mr(s,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(Mr(s,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[t,n]=$a(e);r=Ir(s,3)*n/t,i=Ir(s,4)*t/n,Mr(s,4,r),Mr(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,n)}t.g.pa(e,t.X,n??performance.now()),t.finishProcessing(n)}function Zh(t,e,r){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Jh(t,e,r,t.C+1)}function Qh(t,e,r,n){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Jh(t,e,r,n)}function tu(t,e,r,n){var i=e.data,s=e.width,o=s*(e=e.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==o)throw Error("Unsupported channel count: "+i.length/o);return t=new bh([i],r,!1,t.g.i.canvas,t.P,s,e),n?t.clone():t}var eu=class extends rh{constructor(t,e,r,n){super(t),this.g=t,this.X=e,this.U=r,this.oa=n,this.P=new dh}l(t,e=!0){if("runningMode"in t){var r=!!t.runningMode&&"IMAGE"!==t.runningMode;rr(this.baseOptions,2,null==r?r:Qt(r))}if(void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};eu.prototype.close=eu.prototype.close;var ru=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},kr(t=this.h=new ko,0,1,e=new Ao),Mr(this.h,2,.5),Mr(this.h,3,.3)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return"minDetectionConfidence"in t&&Mr(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&Mr(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}F(t,e){return this.j={detections:[]},Zh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Qh(this,t,r,e),this.j}m(){var t=new js;Bs(t,"image_in"),Bs(t,"norm_rect_in"),Gs(t,"detections");var e=new Fs;Jn(e,Lo,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Ns(r,"IMAGE:image_in"),Ns(r,"NORM_RECT:norm_rect_in"),Os(r,"DETECTIONS:detections"),r.u(e),Us(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=Zs(e),this.j.detections.push(ka(t));Za(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ru.prototype.detectForVideo=ru.prototype.G,ru.prototype.detect=ru.prototype.F,ru.prototype.setOptions=ru.prototype.u,ru.createFromModelPath=async function(t,e){return qh(ru,t,{baseOptions:{modelAssetPath:e}})},ru.createFromModelBuffer=function(t,e){return qh(ru,t,{baseOptions:{modelAssetBuffer:e}})},ru.createFromOptions=function(t,e){return qh(ru,t,e)};var nu=Xh([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),iu=Xh([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),su=Xh([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),ou=Xh([474,475],[475,476],[476,477],[477,474]),au=Xh([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),hu=Xh([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),uu=Xh([469,470],[470,471],[471,472],[472,469]),cu=Xh([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),lu=[...nu,...iu,...su,...au,...hu,...cu],du=Xh([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function fu(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var pu=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,kr(t=this.h=new Fo,0,1,e=new Ao),this.A=new Ro,kr(this.h,0,3,this.A),this.o=new ko,kr(this.h,0,2,this.o),Or(this.o,4,1),Mr(this.o,2,.5),Mr(this.A,2,.5),Mr(this.h,4,.5)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return"numFaces"in t&&Or(this.o,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Mr(this.o,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Mr(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Mr(this.A,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}F(t,e){return fu(this),Zh(this,t,e),this.j}G(t,e,r){return fu(this),Qh(this,t,r,e),this.j}m(){var t=new js;Bs(t,"image_in"),Bs(t,"norm_rect"),Gs(t,"face_landmarks");var e=new Fs;Jn(e,Co,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Ns(r,"IMAGE:image_in"),Ns(r,"NORM_RECT:norm_rect"),Os(r,"NORM_LANDMARKS:face_landmarks"),r.u(e),Us(t,r),this.g.attachProtoVectorListener("face_landmarks",(t,e)=>{for(let e of t)t=ro(e),this.j.faceLandmarks.push(Sa(t));Za(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{Za(this,t)}),this.outputFaceBlendshapes&&(Gs(t,"blendshapes"),Os(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(t,e)=>{if(this.outputFaceBlendshapes)for(let e of t)t=zs(e),this.j.faceBlendshapes.push(Ta(t.g()??[]));Za(this,e)}),this.g.attachEmptyPacketListener("blendshapes",t=>{Za(this,t)})),this.outputFacialTransformationMatrixes&&(Gs(t,"face_geometry"),Os(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(t,e)=>{if(this.outputFacialTransformationMatrixes)for(let e of t)(t=Ar(t=xo(e),no,2))&&this.j.facialTransformationMatrixes.push({rows:Fr(t,1)??0??0,columns:Fr(t,2)??0??0,data:or(t,3,Zt,sr()).slice()??[]});Za(this,e)}),this.g.attachEmptyPacketListener("face_geometry",t=>{Za(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};pu.prototype.detectForVideo=pu.prototype.G,pu.prototype.detect=pu.prototype.F,pu.prototype.setOptions=pu.prototype.u,pu.createFromModelPath=function(t,e){return qh(pu,t,{baseOptions:{modelAssetPath:e}})},pu.createFromModelBuffer=function(t,e){return qh(pu,t,{baseOptions:{modelAssetBuffer:e}})},pu.createFromOptions=function(t,e){return qh(pu,t,e)},pu.FACE_LANDMARKS_LIPS=nu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LIPS",pu.FACE_LANDMARKS_LIPS),pu.FACE_LANDMARKS_LEFT_EYE=iu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYE",pu.FACE_LANDMARKS_LEFT_EYE),pu.FACE_LANDMARKS_LEFT_EYEBROW=su,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",pu.FACE_LANDMARKS_LEFT_EYEBROW),pu.FACE_LANDMARKS_LEFT_IRIS=ou,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_IRIS",pu.FACE_LANDMARKS_LEFT_IRIS),pu.FACE_LANDMARKS_RIGHT_EYE=au,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYE",pu.FACE_LANDMARKS_RIGHT_EYE),pu.FACE_LANDMARKS_RIGHT_EYEBROW=hu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",pu.FACE_LANDMARKS_RIGHT_EYEBROW),pu.FACE_LANDMARKS_RIGHT_IRIS=uu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_IRIS",pu.FACE_LANDMARKS_RIGHT_IRIS),pu.FACE_LANDMARKS_FACE_OVAL=cu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_FACE_OVAL",pu.FACE_LANDMARKS_FACE_OVAL),pu.FACE_LANDMARKS_CONTOURS=lu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_CONTOURS",pu.FACE_LANDMARKS_CONTOURS),pu.FACE_LANDMARKS_TESSELATION=du,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_TESSELATION",pu.FACE_LANDMARKS_TESSELATION);var gu=Xh([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function mu(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function _u(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function vu(t,e=!0){var r=[];for(let i of t){var n=zs(i);t=[];for(let r of n.g())n=e&&null!=Fr(r,1)?Fr(r,1)??0:-1,t.push({score:Ir(r,2)??0,index:n,categoryName:fe(tr(r,3))??""??"",displayName:fe(tr(r,4))??""??""});r.push(t)}return r}var yu=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],kr(t=this.j=new Uo,0,1,e=new Ao),this.o=new $o,kr(this.j,0,2,this.o),this.D=new Po,kr(this.o,0,3,this.D),this.A=new Do,kr(this.o,0,2,this.A),this.h=new Mo,kr(this.j,0,3,this.h),Mr(this.A,2,.5),Mr(this.o,4,.5),Mr(this.D,2,.5)}get baseOptions(){return Ar(this.j,Ao,1)}set baseOptions(t){kr(this.j,0,1,t)}u(t){if(Or(this.A,3,t.numHands??1),"minHandDetectionConfidence"in t&&Mr(this.A,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Mr(this.o,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Mr(this.D,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new No,r=e,n=Aa(t.cannedGesturesClassifierOptions,Ar(this.h,No,3)?.l());kr(r,0,2,n),kr(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&Ar(this.h,No,3)?.g();return t.customGesturesClassifierOptions?(kr(r=e=new No,0,2,n=Aa(t.customGesturesClassifierOptions,Ar(this.h,No,4)?.l())),kr(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&Ar(this.h,No,4)?.g(),this.l(t)}Ia(t,e){return mu(this),Zh(this,t,e),_u(this)}Ja(t,e,r){return mu(this),Qh(this,t,r,e),_u(this)}m(){var t=new js;Bs(t,"image_in"),Bs(t,"norm_rect"),Gs(t,"hand_gestures"),Gs(t,"hand_landmarks"),Gs(t,"world_hand_landmarks"),Gs(t,"handedness");var e=new Fs;Jn(e,Ho,this.j);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Ns(r,"IMAGE:image_in"),Ns(r,"NORM_RECT:norm_rect"),Os(r,"HAND_GESTURES:hand_gestures"),Os(r,"LANDMARKS:hand_landmarks"),Os(r,"WORLD_LANDMARKS:world_hand_landmarks"),Os(r,"HANDEDNESS:handedness"),r.u(e),Us(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t){t=ro(e);let r=[];for(let e of Tr(t,eo,1))r.push({x:Ir(e,1)??0,y:Ir(e,2)??0,z:Ir(e,3)??0,visibility:Ir(e,4)??0});this.landmarks.push(r)}Za(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{Za(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t){t=to(e);let r=[];for(let e of Tr(t,Qs,1))r.push({x:Ir(e,1)??0,y:Ir(e,2)??0,z:Ir(e,3)??0,visibility:Ir(e,4)??0});this.worldLandmarks.push(r)}Za(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{Za(this,t)}),this.g.attachProtoVectorListener("hand_gestures",(t,e)=>{this.gestures.push(...vu(t,!1)),Za(this,e)}),this.g.attachEmptyPacketListener("hand_gestures",t=>{Za(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{this.handedness.push(...vu(t)),Za(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Eu(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}yu.prototype.recognizeForVideo=yu.prototype.Ja,yu.prototype.recognize=yu.prototype.Ia,yu.prototype.setOptions=yu.prototype.u,yu.createFromModelPath=function(t,e){return qh(yu,t,{baseOptions:{modelAssetPath:e}})},yu.createFromModelBuffer=function(t,e){return qh(yu,t,{baseOptions:{modelAssetBuffer:e}})},yu.createFromOptions=function(t,e){return qh(yu,t,e)},yu.HAND_CONNECTIONS=gu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$gesture_recognizer$gesture_recognizer.GestureRecognizer.HAND_CONNECTIONS",yu.HAND_CONNECTIONS);var Au=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],kr(t=this.h=new $o,0,1,e=new Ao),this.o=new Po,kr(this.h,0,3,this.o),this.j=new Do,kr(this.h,0,2,this.j),Or(this.j,3,1),Mr(this.j,2,.5),Mr(this.o,2,.5),Mr(this.h,4,.5)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return"numHands"in t&&Or(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&Mr(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Mr(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Mr(this.o,2,t.minHandPresenceConfidence??.5),this.l(t)}F(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Zh(this,t,e),Eu(this)}G(t,e,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Qh(this,t,r,e),Eu(this)}m(){var t=new js;Bs(t,"image_in"),Bs(t,"norm_rect"),Gs(t,"hand_landmarks"),Gs(t,"world_hand_landmarks"),Gs(t,"handedness");var e=new Fs;Jn(e,Ko,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Ns(r,"IMAGE:image_in"),Ns(r,"NORM_RECT:norm_rect"),Os(r,"LANDMARKS:hand_landmarks"),Os(r,"WORLD_LANDMARKS:world_hand_landmarks"),Os(r,"HANDEDNESS:handedness"),r.u(e),Us(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t)t=ro(e),this.landmarks.push(Sa(t));Za(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{Za(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t)t=to(e),this.worldLandmarks.push(La(t));Za(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{Za(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{var r=this.handedness,n=r.push,i=[];for(let e of t){t=zs(e);let r=[];for(let e of t.g())r.push({score:Ir(e,2)??0,index:Fr(e,1)??0??-1,categoryName:fe(tr(e,3))??""??"",displayName:fe(tr(e,4))??""??""});i.push(r)}n.call(r,...i),Za(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Au.prototype.detectForVideo=Au.prototype.G,Au.prototype.detect=Au.prototype.F,Au.prototype.setOptions=Au.prototype.u,Au.createFromModelPath=function(t,e){return qh(Au,t,{baseOptions:{modelAssetPath:e}})},Au.createFromModelBuffer=function(t,e){return qh(Au,t,{baseOptions:{modelAssetBuffer:e}})},Au.createFromOptions=function(t,e){return qh(Au,t,e)},Au.HAND_CONNECTIONS=gu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$hand_landmarker$hand_landmarker.HandLandmarker.HAND_CONNECTIONS",Au.HAND_CONNECTIONS);var wu=Xh([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function Tu(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function bu(t){try{if(!t.D)return t.h;t.D(t.h)}finally{eh(t)}}function ku(t,e){t=ro(t),e.push(Sa(t))}var Su=class extends eu{constructor(t,e){super(new Yh(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,kr(t=this.j=new Yo,0,1,e=new Ao),this.I=new Po,kr(this.j,0,2,this.I),this.W=new Xo,kr(this.j,0,3,this.W),this.o=new ko,kr(this.j,0,4,this.o),this.O=new Ro,kr(this.j,0,5,this.O),this.A=new Wo,kr(this.j,0,6,this.A),this.M=new zo,kr(this.j,0,7,this.M),Mr(this.o,2,.5),Mr(this.o,3,.3),Mr(this.O,2,.5),Mr(this.A,2,.5),Mr(this.A,3,.3),Mr(this.M,2,.5),Mr(this.I,2,.5)}get baseOptions(){return Ar(this.j,Ao,1)}set baseOptions(t){kr(this.j,0,1,t)}u(t){return"minFaceDetectionConfidence"in t&&Mr(this.o,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&Mr(this.o,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&Mr(this.O,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&Mr(this.A,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&Mr(this.A,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&Mr(this.M,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&Mr(this.I,2,t.minHandLandmarksConfidence??.5),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.D="function"==typeof e?e:r,Tu(this),Zh(this,t,n),bu(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.D="function"==typeof r?r:n,Tu(this),Qh(this,t,i,e),bu(this)}m(){var t=new js;Bs(t,"input_frames_image"),Gs(t,"pose_landmarks"),Gs(t,"pose_world_landmarks"),Gs(t,"face_landmarks"),Gs(t,"left_hand_landmarks"),Gs(t,"left_hand_world_landmarks"),Gs(t,"right_hand_landmarks"),Gs(t,"right_hand_world_landmarks");var e=new Fs,r=new ps;Pr(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(t,e){if(null!=e)if(Array.isArray(e))rr(t,2,De(e,0,$e));else{if(!("string"==typeof e||e instanceof O||R(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");fr(t,2,lt(e,!1),I())}}(r,this.j.g());var n=new Ms;Pr(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Rr(n,8,ps,r),Ns(n,"IMAGE:input_frames_image"),Os(n,"POSE_LANDMARKS:pose_landmarks"),Os(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Os(n,"FACE_LANDMARKS:face_landmarks"),Os(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Os(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Os(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Os(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.u(e),Us(t,n),Qa(this,t),this.g.attachProtoListener("pose_landmarks",(t,e)=>{ku(t,this.h.poseLandmarks),Za(this,e)}),this.g.attachEmptyPacketListener("pose_landmarks",t=>{Za(this,t)}),this.g.attachProtoListener("pose_world_landmarks",(t,e)=>{var r=this.h.poseWorldLandmarks;t=to(t),r.push(La(t)),Za(this,e)}),this.g.attachEmptyPacketListener("pose_world_landmarks",t=>{Za(this,t)}),this.outputPoseSegmentationMasks&&(Os(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),th(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(t,e)=>{this.h.poseSegmentationMasks=[tu(this,t,!0,!this.D)],Za(this,e)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",t=>{this.h.poseSegmentationMasks=[],Za(this,t)})),this.g.attachProtoListener("face_landmarks",(t,e)=>{ku(t,this.h.faceLandmarks),Za(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{Za(this,t)}),this.outputFaceBlendshapes&&(Gs(t,"extra_blendshapes"),Os(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(t,e)=>{var r=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=zs(t),r.push(Ta(t.g()??[]))),Za(this,e)}),this.g.attachEmptyPacketListener("extra_blendshapes",t=>{Za(this,t)})),this.g.attachProtoListener("left_hand_landmarks",(t,e)=>{ku(t,this.h.leftHandLandmarks),Za(this,e)}),this.g.attachEmptyPacketListener("left_hand_landmarks",t=>{Za(this,t)}),this.g.attachProtoListener("left_hand_world_landmarks",(t,e)=>{var r=this.h.leftHandWorldLandmarks;t=to(t),r.push(La(t)),Za(this,e)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",t=>{Za(this,t)}),this.g.attachProtoListener("right_hand_landmarks",(t,e)=>{ku(t,this.h.rightHandLandmarks),Za(this,e)}),this.g.attachEmptyPacketListener("right_hand_landmarks",t=>{Za(this,t)}),this.g.attachProtoListener("right_hand_world_landmarks",(t,e)=>{var r=this.h.rightHandWorldLandmarks;t=to(t),r.push(La(t)),Za(this,e)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",t=>{Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Su.prototype.detectForVideo=Su.prototype.G,Su.prototype.detect=Su.prototype.F,Su.prototype.setOptions=Su.prototype.u,Su.createFromModelPath=function(t,e){return qh(Su,t,{baseOptions:{modelAssetPath:e}})},Su.createFromModelBuffer=function(t,e){return qh(Su,t,{baseOptions:{modelAssetBuffer:e}})},Su.createFromOptions=function(t,e){return qh(Su,t,e)},Su.HAND_CONNECTIONS=gu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.HAND_CONNECTIONS",Su.HAND_CONNECTIONS),Su.POSE_CONNECTIONS=wu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.POSE_CONNECTIONS",Su.POSE_CONNECTIONS),Su.FACE_LANDMARKS_LIPS=nu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LIPS",Su.FACE_LANDMARKS_LIPS),Su.FACE_LANDMARKS_LEFT_EYE=iu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYE",Su.FACE_LANDMARKS_LEFT_EYE),Su.FACE_LANDMARKS_LEFT_EYEBROW=su,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",Su.FACE_LANDMARKS_LEFT_EYEBROW),Su.FACE_LANDMARKS_LEFT_IRIS=ou,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_IRIS",Su.FACE_LANDMARKS_LEFT_IRIS),Su.FACE_LANDMARKS_RIGHT_EYE=au,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYE",Su.FACE_LANDMARKS_RIGHT_EYE),Su.FACE_LANDMARKS_RIGHT_EYEBROW=hu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",Su.FACE_LANDMARKS_RIGHT_EYEBROW),Su.FACE_LANDMARKS_RIGHT_IRIS=uu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_IRIS",Su.FACE_LANDMARKS_RIGHT_IRIS),Su.FACE_LANDMARKS_FACE_OVAL=cu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_FACE_OVAL",Su.FACE_LANDMARKS_FACE_OVAL),Su.FACE_LANDMARKS_CONTOURS=lu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_CONTOURS",Su.FACE_LANDMARKS_CONTOURS),Su.FACE_LANDMARKS_TESSELATION=du,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_TESSELATION",Su.FACE_LANDMARKS_TESSELATION);var Lu=class extends eu{constructor(t,e){super(new Yh(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},kr(t=this.h=new Zo,0,1,e=new Ao)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return kr(this.h,0,2,Aa(t,Ar(this.h,po,2))),this.l(t)}sa(t,e){return this.j={classifications:[]},Zh(this,t,e),this.j}ta(t,e,r){return this.j={classifications:[]},Qh(this,t,r,e),this.j}m(){var t=new js;Bs(t,"input_image"),Bs(t,"norm_rect"),Gs(t,"classifications");var e=new Fs;Jn(e,Qo,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Ns(r,"IMAGE:input_image"),Ns(r,"NORM_RECT:norm_rect"),Os(r,"CLASSIFICATIONS:classifications"),r.u(e),Us(t,r),this.g.attachProtoListener("classifications",(t,e)=>{this.j=ba(ao(t)),Za(this,e)}),this.g.attachEmptyPacketListener("classifications",t=>{Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Lu.prototype.classifyForVideo=Lu.prototype.ta,Lu.prototype.classify=Lu.prototype.sa,Lu.prototype.setOptions=Lu.prototype.u,Lu.createFromModelPath=function(t,e){return qh(Lu,t,{baseOptions:{modelAssetPath:e}})},Lu.createFromModelBuffer=function(t,e){return qh(Lu,t,{baseOptions:{modelAssetBuffer:e}})},Lu.createFromOptions=function(t,e){return qh(Lu,t,e)};var xu=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect",!0),this.h=new ta,this.embeddings={embeddings:[]},kr(t=this.h,0,1,e=new Ao)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){var e=this.h,r=Ar(this.h,mo,2);if(r=r?r.clone():new mo,void 0!==t.l2Normalize){var n=t.l2Normalize;rr(r,1,null==n?n:Qt(n))}else"l2Normalize"in t&&rr(r,1);return void 0!==t.quantize?rr(r,2,null==(n=t.quantize)?n:Qt(n)):"quantize"in t&&rr(r,2),kr(e,0,2,r),this.l(t)}za(t,e){return Zh(this,t,e),this.embeddings}Aa(t,e,r){return Qh(this,t,r,e),this.embeddings}m(){var t=new js;Bs(t,"image_in"),Bs(t,"norm_rect"),Gs(t,"embeddings_out");var e=new Fs;Jn(e,ea,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Ns(r,"IMAGE:image_in"),Ns(r,"NORM_RECT:norm_rect"),Os(r,"EMBEDDINGS:embeddings_out"),r.u(e),Us(t,r),this.g.attachProtoListener("embeddings_out",(t,e)=>{t=fo(t),this.embeddings=function(t){return{embeddings:Tr(t,co,1).map(t=>{var e={headIndex:Fr(t,3)??0??-1,headName:fe(tr(t,4))??""??""};if(ir(t,ho,1,lo))t=or(t=Cr(t,ho,1),1,Zt,sr()),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=Cr(t,uo,2)?.g()?.h()??r}return e}),timestampMs:wa(tr(t,2,void 0,void 0,ce)??Ze)}}(t),Za(this,e)}),this.g.attachEmptyPacketListener("embeddings_out",t=>{Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};xu.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Ra(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Ra(xa(t.quantizedEmbedding),xa(e.quantizedEmbedding))}return t},xu.prototype.embedForVideo=xu.prototype.Aa,xu.prototype.embed=xu.prototype.za,xu.prototype.setOptions=xu.prototype.u,xu.createFromModelPath=function(t,e){return qh(xu,t,{baseOptions:{modelAssetPath:e}})},xu.createFromModelBuffer=function(t,e){return qh(xu,t,{baseOptions:{modelAssetBuffer:e}})},xu.createFromOptions=function(t,e){return qh(xu,t,e)};var Ru=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};function Fu(t){var e=function(t){return Tr(t,Ms,1)}(t.ca()).filter(t=>(fe(tr(t,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(t.o=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(Ar(e[0],Fs,7)?.j()?.g()??new Map).forEach((e,r)=>{t.o[Number(r)]=fe(tr(e,1))??""})}function Iu(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Cu(t){try{let e=new Ru(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{eh(t)}}Ru.prototype.close=Ru.prototype.close;var Nu=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect",!1),this.o=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new oa,this.A=new ra,kr(this.h,0,3,this.A),kr(t=this.h,0,1,e=new Ao)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?rr(this.h,2,de(t.displayNamesLocale)):"displayNamesLocale"in t&&rr(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}L(){Fu(this)}segment(t,e,r){var n="function"!=typeof e?e:{};return this.j="function"==typeof e?e:r,Iu(this),Zh(this,t,n),Cu(this)}Ma(t,e,r,n){var i="function"!=typeof r?r:{};return this.j="function"==typeof r?r:n,Iu(this),Qh(this,t,i,e),Cu(this)}Da(){return this.o}m(){var t=new js;Bs(t,"image_in"),Bs(t,"norm_rect");var e=new Fs;Jn(e,aa,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Ns(r,"IMAGE:image_in"),Ns(r,"NORM_RECT:norm_rect"),r.u(e),Us(t,r),Qa(this,t),this.outputConfidenceMasks&&(Gs(t,"confidence_masks"),Os(r,"CONFIDENCE_MASKS:confidence_masks"),th(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>tu(this,t,!0,!this.j)),Za(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],Za(this,t)})),this.outputCategoryMask&&(Gs(t,"category_mask"),Os(r,"CATEGORY_MASK:category_mask"),th(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=tu(this,t,!1,!this.j),Za(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,Za(this,t)})),Gs(t,"quality_scores"),Os(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,Za(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Nu.prototype.getLabels=Nu.prototype.Da,Nu.prototype.segmentForVideo=Nu.prototype.Ma,Nu.prototype.segment=Nu.prototype.segment,Nu.prototype.setOptions=Nu.prototype.u,Nu.createFromModelPath=function(t,e){return qh(Nu,t,{baseOptions:{modelAssetPath:e}})},Nu.createFromModelBuffer=function(t,e){return qh(Nu,t,{baseOptions:{modelAssetBuffer:e}})},Nu.createFromOptions=function(t,e){return qh(Nu,t,e)};var Ou={0:0,1:1,2:2,3:3};function Mu(){return Da()?void 0:document.createElement("canvas")}var Du=class extends rh{constructor(t,e){super(new Wa(t,e)),this.o=new dh,this.delegate="CPU",this.h=0,this.baseOptions=new Ao,this.j=0}get i(){return this.g.i}u(t){return this.delegate=t.baseOptions?.delegate??"CPU",super.l(t)}Na(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e;if(0!==this.j&&(this.i._free(this.j),this.j=0),!(e="undefined"!=typeof ImageData&&t instanceof ImageData))if("object"!=typeof t||null===t)e=!1;else{e=t.data;var r=t.width,n=t.height;e=Number.isInteger(r)&&r>0&&Number.isInteger(n)&&n>0&&(e instanceof Uint8ClampedArray||e instanceof Uint8Array)}if(e)e=t.width,r=t.height,t=t.data;else{if([e,r]=$a(t),"undefined"!=typeof OffscreenCanvas)n=new OffscreenCanvas(e,r);else{if("undefined"==typeof document)throw Error("Canvas is not supported in this environment.");n=document.createElement("canvas")}if(n.width=e,n.height=r,!(n=n.getContext("2d")))throw Error("Canvas 2D context is not supported in this environment.");n.drawImage(t,0,0),t=n.getImageData(0,0,e,r).data}if(!t)throw Error("Unsupported image source or failed to extract image pixels.");n=function({Ha:t,width:e,height:r}){if(e<=0||r<=0)throw Error(`Invalid image dimensions: ${e}x${r}. Dimensions must be positive.`);if(t%(e*r)!==0)throw Error(`Invalid image dimensions or pixel data length. Pixel data length ${t} is not a multiple of the number of pixels (${e*r}).`);if(4!==(t/=e*r)&&3!==t&&1!==t)throw Error(`Invalid image dimensions or pixel data length. Calculated channels: ${t}. Expected 1, 3, or 4.`);return t}({Ha:t.length,width:e,height:r});var i=this.i._malloc(t.length);if(this.i.HEAPU8.set(t,i),this.j=i,!this.i._interactive_segmenter_set_image(this.h,i,e,r,n))throw Error("Failed to set image on native engine.")}segment(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e=function(t){t=t.map(({isCompleted:t,brushMode:e,point:r})=>{e=Ou[e]??0,r=r.map(({x:t,y:e})=>{var r=new ha;return Dr(r,1,t),Dr(r,2,e),r});var n=new ua;if(Nr(n,t),null==e)t=e;else{if(!zt(e))throw $("enum");t=0|e}return fr(n,1,t,0),Lr(n,2,r),n});var e=new ca;return Lr(e,1,t),la(e)}(t);t=this.i._malloc(e.length),this.i.HEAPU8.set(e,t);var r=this.i._malloc(12),n=r+4,i=r+8,s=0;try{if(0===(s=this.i._interactive_segmenter_segment(this.h,t,e.length,r,n,i)))throw Error("Segmentation failed.");let h=this.i.HEAPU32[r/4],u=this.i.HEAPU32[n/4];var o=new Float32Array(this.i.HEAPU8.buffer,s,this.i.HEAPU32[i/4]/4),a=new Float32Array(o);if(o=h*u,(a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==o)throw Error("Unsupported channel count: "+a.length/o);return new bh([a],!0,!1,this.g.i.canvas??void 0,this.o,h,u)}finally{0!==t&&this.i._free(t),0!==r&&this.i._free(r),0!==s&&this.i._free(s)}}m(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0);var t=new vo;if("GPU"===this.delegate){var e=new ws;Sr(t,2,yo,e)}else Or(e=new xs,1,4),Sr(t,1,yo,e);if(kr(this.baseOptions,0,3,t),t=bo(this.baseOptions),e=this.i._malloc(t.length),this.i.HEAPU8.set(t,e),this.h=this.i._interactive_segmenter_create(e,t.length),this.i._free(e),0===this.h)throw Error("Failed to create native InteractiveSegmenter engine.")}close(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0),this.o.close(),super.close()}};Du.prototype.close=Du.prototype.close,Du.prototype.segment=Du.prototype.segment,Du.prototype.setImage=Du.prototype.Na,Du.prototype.setOptions=Du.prototype.u,Du.createFromModelPath=function(t,e){return Ya(Du,Mu(),t,{baseOptions:{modelAssetPath:e}})},Du.createFromModelBuffer=function(t,e){return Ya(Du,Mu(),t,{baseOptions:{modelAssetBuffer:e}})},Du.createFromOptions=function(t,e){var r=e.canvas??Mu();return Ya(Du,r,t,e)};var Pu=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};Pu.prototype.close=Pu.prototype.close;var $u=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new oa,this.o=new ra,kr(this.h,0,3,this.o),kr(t=this.h,0,1,e=new Ao)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,r,n){var i="function"!=typeof r?r:{};if(this.j="function"==typeof r?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new ga,e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var s=new da;Nr(s,!0),Dr(s,1,e.keypoint.x),Dr(s,2,e.keypoint.y),Sr(n,1,ma,s)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");{let t=new pa;for(s of e.scribble)Nr(e=new da,!0),Dr(e,1,s.x),Dr(e,2,s.y),Rr(t,1,da,e);Sr(n,2,ma,t)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter_legacy.proto.RegionOfInterest","roi_in",r),Zh(this,t,i);t:{try{let t=new Pu(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=t;break t}this.j(t)}finally{eh(this)}o=void 0}return o}m(){var t=new js;Bs(t,"image_in"),Bs(t,"roi_in"),Bs(t,"norm_rect_in");var e=new Fs;Jn(e,aa,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.interactive_segmenter_legacy.InteractiveSegmenterGraphV2"),Ns(r,"IMAGE:image_in"),Ns(r,"ROI:roi_in"),Ns(r,"NORM_RECT:norm_rect_in"),r.u(e),Us(t,r),Qa(this,t),this.outputConfidenceMasks&&(Gs(t,"confidence_masks"),Os(r,"CONFIDENCE_MASKS:confidence_masks"),th(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>tu(this,t,!0,!this.j)),Za(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],Za(this,t)})),this.outputCategoryMask&&(Gs(t,"category_mask"),Os(r,"CATEGORY_MASK:category_mask"),th(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=tu(this,t,!1,!this.j),Za(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,Za(this,t)})),Gs(t,"quality_scores"),Os(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,Za(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$u.prototype.segment=$u.prototype.segment,$u.prototype.setOptions=$u.prototype.u,$u.createFromModelPath=function(t,e){return qh($u,t,{baseOptions:{modelAssetPath:e}})},$u.createFromModelBuffer=function(t,e){return qh($u,t,{baseOptions:{modelAssetBuffer:e}})},$u.createFromOptions=function(t,e){return qh($u,t,e)};var Uu=class extends eu{constructor(t,e){super(new Yh(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},kr(t=this.h=new _a,0,1,e=new Ao)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?rr(this.h,2,de(t.displayNamesLocale)):"displayNamesLocale"in t&&rr(this.h,2),void 0!==t.maxResults?Or(this.h,3,t.maxResults):"maxResults"in t&&rr(this.h,3),void 0!==t.scoreThreshold?Mr(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&rr(this.h,4),void 0!==t.categoryAllowlist?$r(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&rr(this.h,5),void 0!==t.categoryDenylist?$r(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&rr(this.h,6),this.l(t)}F(t,e){return this.j={detections:[]},Zh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Qh(this,t,r,e),this.j}m(){var t=new js;Bs(t,"input_frame_gpu"),Bs(t,"norm_rect"),Gs(t,"detections");var e=new Fs;Jn(e,va,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),Ns(r,"IMAGE:input_frame_gpu"),Ns(r,"NORM_RECT:norm_rect"),Os(r,"DETECTIONS:detections"),r.u(e),Us(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=Zs(e),this.j.detections.push(ka(t));Za(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{Za(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Uu.prototype.detectForVideo=Uu.prototype.G,Uu.prototype.detect=Uu.prototype.F,Uu.prototype.setOptions=Uu.prototype.u,Uu.createFromModelPath=async function(t,e){return qh(Uu,t,{baseOptions:{modelAssetPath:e}})},Uu.createFromModelBuffer=function(t,e){return qh(Uu,t,{baseOptions:{modelAssetBuffer:e}})},Uu.createFromOptions=function(t,e){return qh(Uu,t,e)};var Bu=class{constructor(t,e,r){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=r}close(){this.segmentationMasks?.forEach(t=>{t.close()})}};function Gu(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function ju(t){try{let e=new Bu(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.o)return e;t.o(e)}finally{eh(t)}}Bu.prototype.close=Bu.prototype.close;var Vu=class extends eu{constructor(t,e){super(new Yh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,kr(t=this.h=new ya,0,1,e=new Ao),this.A=new zo,kr(this.h,0,3,this.A),this.j=new Wo,kr(this.h,0,2,this.j),Or(this.j,4,1),Mr(this.j,2,.5),Mr(this.A,2,.5),Mr(this.h,4,.5)}get baseOptions(){return Ar(this.h,Ao,1)}set baseOptions(t){kr(this.h,0,1,t)}u(t){return"numPoses"in t&&Or(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Mr(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Mr(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Mr(this.A,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.o="function"==typeof e?e:r,Gu(this),Zh(this,t,n),ju(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.o="function"==typeof r?r:n,Gu(this),Qh(this,t,i,e),ju(this)}m(){var t=new js;Bs(t,"image_in"),Bs(t,"norm_rect"),Gs(t,"normalized_landmarks"),Gs(t,"world_landmarks"),Gs(t,"segmentation_masks");var e=new Fs;Jn(e,Ea,this.h);var r=new Ms;Pr(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Ns(r,"IMAGE:image_in"),Ns(r,"NORM_RECT:norm_rect"),Os(r,"NORM_LANDMARKS:normalized_landmarks"),Os(r,"WORLD_LANDMARKS:world_landmarks"),r.u(e),Us(t,r),Qa(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(t,e)=>{this.landmarks=[];for(let e of t)t=ro(e),this.landmarks.push(Sa(t));Za(this,e)}),this.g.attachEmptyPacketListener("normalized_landmarks",t=>{this.landmarks=[],Za(this,t)}),this.g.attachProtoVectorListener("world_landmarks",(t,e)=>{this.worldLandmarks=[];for(let e of t)t=to(e),this.worldLandmarks.push(La(t));Za(this,e)}),this.g.attachEmptyPacketListener("world_landmarks",t=>{this.worldLandmarks=[],Za(this,t)}),this.outputSegmentationMasks&&(Os(r,"SEGMENTATION_MASK:segmentation_masks"),th(this,"segmentation_masks"),this.g.aa("segmentation_masks",(t,e)=>{this.segmentationMasks=t.map(t=>tu(this,t,!0,!this.o)),Za(this,e)}),this.g.attachEmptyPacketListener("segmentation_masks",t=>{this.segmentationMasks=[],Za(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};return Vu.prototype.detectForVideo=Vu.prototype.G,Vu.prototype.detect=Vu.prototype.F,Vu.prototype.setOptions=Vu.prototype.u,Vu.createFromModelPath=function(t,e){return qh(Vu,t,{baseOptions:{modelAssetPath:e}})},Vu.createFromModelBuffer=function(t,e){return qh(Vu,t,{baseOptions:{modelAssetBuffer:e}})},Vu.createFromOptions=function(t,e){return qh(Vu,t,e)},Vu.POSE_CONNECTIONS=wu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$pose_landmarker$pose_landmarker.PoseLandmarker.POSE_CONNECTIONS",Vu.POSE_CONNECTIONS),t.DrawingUtils=Mh,t.FaceDetector=ru,t.FaceLandmarker=pu,t.FilesetResolver=Oa,t.GestureRecognizer=yu,t.HandLandmarker=Au,t.HolisticLandmarker=Su,t.ImageClassifier=Lu,t.ImageEmbedder=xu,t.ImageSegmenter=Nu,t.ImageSegmenterResult=Ru,t.InteractiveSegmenter=Du,t.InteractiveSegmenterLegacy=$u,t.InteractiveSegmenterLegacyResult=Pu,t.MPImage=Hh,t.MPMask=bh,t.ObjectDetector=Uu,t.PoseLandmarker=Vu,t.TaskRunner=rh,t.VisionTaskRunner=eu,t}({});
|
|
1
|
+
var Vision=function(t){"use strict";var e="undefined"!=typeof self?self:{};function r(t,r){t:{for(var n=["CLOSURE_FLAGS"],i=e,s=0;s<n.length;s++)if(null==(i=i[n[s]])){n=null;break t}n=i}return null!=(t=n&&n[t])?t:r}function n(t,r){t=t.split(".");for(var n,i=e;t.length&&(n=t.shift());)t.length||void 0===r?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=r}function i(){throw Error("Invalid UTF8")}function s(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var o,a,h=void 0,u="undefined"!=typeof TextDecoder,c="undefined"!=typeof TextEncoder;function l(t){if(c)t=(a||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}function d(t){e.setTimeout(()=>{throw t},0)}var f=r(610401301,!1),p=r(748402147,!0);function g(){var t=e.navigator;return t&&(t=t.userAgent)?t:""}var m,_=e.navigator;function v(t){return v[" "](t),t}m=_&&_.userAgentData||null,v[" "]=function(){};var y={},E=null;function A(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=E[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}w();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),s=r(64);if(64===s&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function w(){if(!E){E={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));y[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===E[e]&&(E[e]=t)}}}}var T="undefined"!=typeof Uint8Array,b=!(!(f&&m&&m.brands.length>0)&&(-1!=g().indexOf("Trident")||-1!=g().indexOf("MSIE")))&&"function"==typeof btoa,k=/[-_.]/g,S={"-":"+",_:"/",".":"="};function L(t){return S[t]||""}function x(t){if(!b)return A(t);t=k.test(t)?t.replace(k,L):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function R(t){return T&&null!=t&&t instanceof Uint8Array}var F={};function I(){return N||=new O(null,F)}function C(t){M(F);var e=t.g;return null==(e=null==e||R(e)?e:"string"==typeof e?x(e):null)?e:t.g=e}var N,O=class{h(){return new Uint8Array(C(this)||0)}constructor(t,e){if(M(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function M(t){if(t!==F)throw Error("illegal external caller")}function D(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var P=void 0;function $(t){return D(t=Error(t),"warning"),t}function U(t,e){if(null!=t){var r=P??={},n=r[t]||0;n>=e||(r[t]=n+1,D(t=Error(),"incident"),d(t))}}function B(){return"function"==typeof BigInt}var G="function"==typeof Symbol&&"symbol"==typeof Symbol();function j(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var V,H=j("jas",void 0,!0),K=j(void 0,"0di"),X=j(void 0,"1oa"),W=j(void 0,Symbol()),z=j(void 0,"0ub"),Y=j(void 0,"0ubs"),q=j(void 0,"0ubsb"),J=j(void 0,"0actk"),Z=j("m_m","Sa",!0),Q=j(),tt={Ha:{value:0,configurable:!0,writable:!0,enumerable:!1}},et=Object.defineProperties,rt=G?H:"Ha",nt=[];function it(t,e){G||rt in t||et(t,tt),t[rt]|=e}function st(t,e){G||rt in t||et(t,tt),t[rt]=e}function ot(t){return it(t,34),t}function at(t){return it(t,8192),t}st(nt,7),V=Object.freeze(nt);var ht={};function ut(t,e){return void 0===e?t.h!==ct&&!!(2&t.v[rt]):!!(2&e)&&t.h!==ct}var ct={};function lt(t,e){if(null!=t)if("string"==typeof t)t=t?new O(t,F):I();else if(t.constructor!==O)if(R(t))t=t.length?new O(new Uint8Array(t),F):I();else{if(!e)throw Error();t=void 0}return t}class dt{constructor(t,e,r){this.g=t,this.h=e,this.l=r}next(){var t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var ft=Object.freeze({});function pt(t,e,r){var n,i=128&e?0:-1,s=t.length;(n=!!s)&&(n=null!=(n=t[s-1])&&"object"==typeof n&&n.constructor===Object);var o=s+(n?-1:0);for(e=128&e?1:0;e<o;e++)r(e-i,t[e]);if(n){t=t[s-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var gt={};function mt(t){return 128&t?gt:void 0}function _t(t){return t.Qa=!0,t}var vt=_t(t=>"number"==typeof t),yt=_t(t=>"string"==typeof t),Et=_t(t=>"boolean"==typeof t),At="function"==typeof e.BigInt&&"bigint"==typeof e.BigInt(0);function wt(t){var e=t;if(yt(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(vt(e)&&!Number.isSafeInteger(e))throw Error(String(e));return At?BigInt(t):t=Et(t)?t?"1":"0":yt(t)?t.trim()||"0":String(t)}var Tt=_t(t=>At?t>=kt&&t<=Lt:"-"===t[0]?xt(t,bt):xt(t,St)),bt=Number.MIN_SAFE_INTEGER.toString(),kt=At?BigInt(Number.MIN_SAFE_INTEGER):void 0,St=Number.MAX_SAFE_INTEGER.toString(),Lt=At?BigInt(Number.MAX_SAFE_INTEGER):void 0;function xt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var Rt,Ft="function"==typeof Uint8Array.prototype.slice,It=0,Ct=0;function Nt(t){var e=t>>>0;It=e,Ct=(t-e)/4294967296>>>0}function Ot(t){if(t<0){Nt(-t);let[e,r]=Vt(It,Ct);It=e>>>0,Ct=r>>>0}else Nt(t)}function Mt(t){var e=Rt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Ct=0,It=e.getUint32(0,!0)}function Dt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Ut(t,e)}function Pt(t,e){return wt(B()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Ut(t,e))}function $t(t,e){return B()?wt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):wt(Gt(t,e))}function Ut(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else B()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Bt(r)+Bt(t));return r}function Bt(t){return t=String(t),"0000000".slice(t.length)+t}function Gt(t,e){if(2147483648&e)if(B())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Vt(t,e);t="-"+Ut(r,n)}else t=Ut(t,e);return t}function jt(t){if(t.length<16)Ot(Number(t));else if(B())t=BigInt(t),It=Number(t&BigInt(4294967295))>>>0,Ct=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);Ct=It=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));Ct*=1e6,(It=1e6*It+e)>=4294967296&&(Ct+=Math.trunc(It/4294967296),Ct>>>=0,It>>>=0)}if(e){let[t,e]=Vt(It,Ct);It=t,Ct=e}}}function Vt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ht(t){return Array.prototype.slice.call(t)}var Kt="function"==typeof BigInt?BigInt.asIntN:void 0,Xt="function"==typeof BigInt?BigInt.asUintN:void 0,Wt=Number.isSafeInteger,zt=Number.isFinite,Yt=Math.trunc,qt=wt(0);function Jt(t){if("number"!=typeof t)throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function Zt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Qt(t){if("boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}var te=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function ee(t){switch(typeof t){case"bigint":return!0;case"number":return zt(t);case"string":return te.test(t);default:return!1}}function re(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return zt(t)?0|t:void 0}function ne(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return zt(t)?t>>>0:void 0}function ie(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(jt(t),Gt(It,Ct))}function se(t){if(t=Yt(t),!Wt(t)){Ot(t);var e=It,r=Ct;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Dt(e,r))?t?-e:e:t?"-"+e:e}return t}function oe(t){var e=Yt(Number(t));return Wt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),ie(t))}function ae(t){var e=Yt(Number(t));return Wt(e)?wt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),B()?wt(Kt(64,BigInt(t))):wt(ie(t)))}function he(t){return Wt(t)?t=wt(se(t)):(t=Yt(t),Wt(t)?t=String(t):(Ot(t),t=Gt(It,Ct)),t=wt(t)),t}function ue(t){var e=typeof t;return null==t?t:"bigint"===e?wt(Kt(64,t)):ee(t)?"string"===e?ae(t):he(t):void 0}function ce(t){if("string"!=typeof t)throw Error();return t}function le(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function de(t){return null==t||"string"==typeof t?t:void 0}function fe(t,e,r,n){return null!=t&&t[Z]===ht?t:Array.isArray(t)?((n=(r=0|t[rt])|32&n|2&n)!==r&&st(t,n),new e(t)):(r?2&n?((t=e[K])||(ot((t=new e).v),t=e[K]=t),e=t):e=new e:e=void 0,e)}function pe(t,e,r){if(e)t:{if(!ee(e=t))throw $("int64");switch(typeof e){case"string":e=ae(e);break t;case"bigint":e=wt(Kt(64,e));break t;default:e=he(e)}}else e=ue(t);return null==(t=e)?r?qt:void 0:t}function ge(t){return t}var me={},_e=function(){try{return v(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class ve{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}var ye=_e?(Object.setPrototypeOf(ve.prototype,Map.prototype),Object.defineProperties(ve.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),ve):class extends Map{constructor(){super()}};function Ee(t){return t}function Ae(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var we,Te=class extends ye{constructor(t,e,r=Ee,n=Ee){super(),this.J=0|t[rt],this.K=e,this.S=r,this.fa=this.K?be:n;for(let i=0;i<t.length;i++){let s=t[i],o=r(s[0],!1,!0),a=s[1];e?void 0===a&&(a=null):a=n(s[1],!1,!0,void 0,void 0,this.J),super.set(o,a)}}W(t){return at(Array.from(super.entries(),t))}clear(){Ae(this),super.clear()}delete(t){return Ae(this),super.delete(this.S(t,!0,!1))}entries(){if(this.K){var t=super.keys();t=new dt(t,ke,this)}else t=super.entries();return t}values(){if(this.K){var t=super.keys();t=new dt(t,Te.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.K?super.forEach((r,n,i)=>{t.call(e,i.get(n),n,i)}):super.forEach(t,e)}set(t,e){return Ae(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.fa(e,!0,!0,this.K,!1,this.J))}Pa(t){var e=this.S(t[0],!1,!0);t=t[1],t=this.K?void 0===t?null:t:this.fa(t,!1,!0,void 0,!1,this.J),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);var e=super.get(t);if(void 0!==e){var r=this.K;return r?((r=this.fa(e,!1,!0,r,this.sa,this.J))!==e&&super.set(t,r),r):e}}[Symbol.iterator](){return this.entries()}};function be(t,e,r,n,i,s){return t=fe(t,n,r,s),i&&(t=Xe(t)),t}function ke(t){return[t,this.get(t)]}function Se(){return we||=new Te(ot([]),void 0,void 0,void 0,me)}function Le(t){return W?t[W]:void 0}function xe(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}Te.prototype.toJSON=void 0;var Re,Fe,Ie,Ce=class{},Ne={Ma:!0};function Oe(t,e){e<100||U(Y,1)}function Me(t,e,r,n){var i=void 0!==n;n=!!n;var s,o=W;!i&&G&&o&&(s=t[o])&&xe(s,Oe),o=[];var a=t.length;s=4294967295;var h=!1,u=!!(64&e),c=u?128&e?0:-1:void 0;if(!(1&e)){var l=a&&t[a-1];null!=l&&"object"==typeof l&&l.constructor===Object?s=--a:l=void 0,!u||128&e||i||(h=!0,s=(Re??ge)(s-c,c,t,l,void 0)+c)}e=void 0;for(var d=0;d<a;d++){let i=t[d];if(null!=i&&null!=(i=r(i,n)))if(u&&d>=s){let t=d-c;(e??={})[t]=i}else o[d]=i}if(l)for(let t in l){if(null==(a=l[t])||null==(a=r(a,n)))continue;let i;d=+t,u&&!Number.isNaN(d)&&(i=d+c)<s?o[i]=a:(e??={})[t]=a}return e&&(h?o.push(e):o[s]=e),i&&W&&(t=Le(t))&&t instanceof Ce&&(o[W]=function(t){var e=new Ce;return xe(t,(t,r,n)=>{e[r]=Ht(n)}),e.da=t.da,e}(t)),o}function De(t){return t[0]=Pe(t[0]),t[1]=Pe(t[1]),t}function Pe(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Tt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[rt];return 0===t.length&&1&e?void 0:Me(t,e,Pe)}if(null!=t&&t[Z]===ht)return $e(t);if(t instanceof O){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(b){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),w(),r=y[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,u=0;for(;t<e.length-2;t+=3){var s=e[t],o=e[t+1],a=e[t+2],h=r[s>>2];s=r[(3&s)<<4|o>>4],o=r[(15&o)<<2|a>>6],a=r[63&a],n[u++]=h+s+o+a}switch(h=0,a=i,e.length-t){case 2:a=r[(15&(h=e[t+1]))<<2]||i;case 1:e=e[t],n[u]=r[e>>2]+r[(3&e)<<4|h>>4]+a+i}e=n.join("")}t=t.g=e}return t}return t instanceof Te?t=0!==t.size?t.W(De):void 0:void 0}return t}function $e(t){return Me(t=t.v,0|t[rt],Pe)}function Ue(t,e){return Be(t,e[0],e[1])}function Be(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[rt],p&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(p)throw Error("carr");U(J,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&st(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var s=(r=t).length;if(s){var o=s-1;let t=r[o];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((o-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(s=+a)<o&&(r[s+e]=t[a],delete t[a]);i=-16760833&i|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return st(t,64|i|n),t}function Ge(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[rt];return 0===t.length&&1&r?void 0:je(t,r,e)}if(null!=t&&t[Z]===ht)return He(t);if(t instanceof Te){if(2&(e=t.J))return t;if(!t.size)return;if(r=ot(t.W()),t.K)for(t=0;t<r.length;t++){let n=r[t],i=n[1];i=null==i||"object"!=typeof i?void 0:null!=i&&i[Z]===ht?He(i):Array.isArray(i)?je(i,0|i[rt],!!(32&e)):void 0,n[1]=i}return r}return t instanceof O?t:void 0}function je(t,e,r){return 2&e||(!r||4096&e||16&e?t=Ke(t,e,!1,r&&!(16&e)):(it(t,34),4&e&&Object.freeze(t))),t}function Ve(t,e,r){return t=new t.constructor(e),r&&(t.h=ct),t.m=ct,t}function He(t){var e=t.v,r=0|e[rt];return ut(t,r)?t:qe(t,e,r)?Ve(t,e):Ke(e,r)}function Ke(t,e,r,n){return n??=!!(34&e),t=Me(t,e,Ge,n),n=32,r&&(n|=2),st(t,e=16769217&e|n),t}function Xe(t){var e=t.v,r=0|e[rt];return ut(t,r)?qe(t,e,r)?Ve(t,e,!0):new t.constructor(Ke(e,r,!1)):t}function We(t){if(t.h!==ct)return!1;var e=t.v;return it(e=Ke(e,0|e[rt]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function ze(t){if(!We(t)&&ut(t,0|t.v[rt]))throw Error()}function Ye(t,e){void 0===e&&(e=0|t[rt]),32&e&&!(4096&e)&&st(t,4096|e)}function qe(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(st(e,2|r),t.h=ct,!0)}var Je=wt(0),Ze={};function Qe(t,e,r,n){if(null!==(e=tr(t.v,e,void 0,n))||r&&t.m!==ct)return e}function tr(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),s=t.length-1;if(!(s<1+(r?0:-1))){if(i>=s){var o=t[s];if(null!=o&&"object"==typeof o&&o.constructor===Object){r=o[e];var a=!0}else{if(i!==s)return;r=o}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?o[e]=n:t[i]=n,n}return r}}function er(t,e,r,n){ze(t),rr(t=t.v,0|t[rt],e,r,n)}function rr(t,e,r,n,i){var s=r+(i?0:-1),o=t.length-1;if(o>=1+(i?0:-1)&&s>=o){let i=t[o];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return s<=o?(t[s]=n,e):(void 0!==n&&(r>=(o=(e??=0|t[rt])>>14&1023||536870912)?null!=n&&(t[o+(i?0:-1)]={[r]:n}):t[s]=n),e)}function nr(t,e,r,n){var i=t.v;return void 0!==yr(i,0|i[rt],e,t=pr(t,n)===r?r:-1)}function ir(){return void 0===ft?2:4}function sr(t,e,r,n,i){var s=t.v,o=0|s[rt];n=ut(t,o)?1:n,i=!!i||3===n,2===n&&We(t)&&(o=0|(s=t.v)[rt]);var a=(t=ar(s,e))===V?7:0|t[rt],h=hr(a,o),u=!(4&h);if(u){4&h&&(t=Ht(t),a=0,h=Lr(h,o),o=rr(s,o,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&h|4,h=r&=-1025,h&=-4097}return h!==a&&(st(t,h),2&h&&Object.freeze(t)),or(t,h,s,o,e,n,u,i)}function or(t,e,r,n,i,s,o,a){var h=e;return 1===s||4===s&&(2&e||!(16&e)&&32&n)?ur(e)||((e|=!t.length||o&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==h&&st(t,e),Object.freeze(t)):(2===s&&ur(e)&&(t=Ht(t),h=0,e=Lr(e,n),n=rr(r,n,i,t)),ur(e)||(a||(e|=16),e!==h&&st(t,e))),2&e||!(4096&e||16&e)||Ye(r,n),t}function ar(t,e,r){return t=tr(t,e,r),Array.isArray(t)?t:V}function hr(t,e){return 2&e&&(t|=2),1|t}function ur(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function cr(t){return lt(t,!0)}function lr(t){t=Ht(t);for(let e=0;e<t.length;e++){let r=t[e]=Ht(t[e]);Array.isArray(r[1])&&(r[1]=ot(r[1]))}return at(t)}function dr(t,e,r,n){ze(t),rr(t=t.v,0|t[rt],e,("0"===n?0===Number(r):r===n)?void 0:r)}function fr(t,e,r){if(2&e)throw Error();var n=mt(e),i=ar(t,r,n),s=i===V?7:0|i[rt],o=hr(s,e);return(2&o||ur(o)||16&o)&&(o===s||ur(o)||st(i,o),i=Ht(i),s=0,o=Lr(o,e),rr(t,e,r,i,n)),(o&=-13)!==s&&st(i,o),i}function pr(t,e){return _r(gr(t=t.v),t,void 0,e)}function gr(t){if(G)return t[X]??(t[X]=new Map);if(X in t)return t[X];var e=new Map;return Object.defineProperty(t,X,{value:e}),e}function mr(t,e,r,n,i){var s=gr(t),o=_r(s,t,e,r,i);return o!==n&&(o&&(e=rr(t,e,o,void 0,i)),s.set(r,n)),e}function _r(t,e,r,n,i){var s=t.get(n);if(null!=s)return s;s=0;for(let t=0;t<n.length;t++){let o=n[t];null!=tr(e,o,i)&&(0!==s&&(r=rr(e,r,s,void 0,i)),s=o)}return t.set(n,s),s}function vr(t,e,r){var n=0|t[rt],i=mt(n),s=tr(t,r,i);if(null!=s&&s[Z]===ht){if(!ut(s))return We(s),s.v;var o=s.v}else Array.isArray(s)&&(o=s);if(o){let t=0|o[rt];2&t&&(o=Ke(o,t))}return(o=Ue(o,e))!==s&&rr(t,n,r,o,i),o}function yr(t,e,r,n,i){var s=!1;if(null!=(n=tr(t,n,i,t=>{var n=fe(t,r,!1,e);return s=n!==t&&null!=n,n})))return s&&!ut(n)&&Ye(t,e),n}function Er(t,e,r,n){var i=t.v,s=0|i[rt];if(null==(e=yr(i,s,e,r,n)))return e;if(!ut(t,s=0|i[rt])){let o=Xe(e);o!==e&&(We(t)&&(s=0|(i=t.v)[rt]),Ye(i,s=rr(i,s,r,e=o,n)))}return e}function Ar(t,e,r,n,i,s,o,a){var h=ut(t,r);s=h?1:s,o=!!o||3===s,h=a&&!h,(2===s||h)&&We(t)&&(r=0|(e=t.v)[rt]);var u=(t=ar(e,i))===V?7:0|t[rt],c=hr(u,r);if(a=!(4&c)){var l=t,d=r;let e=!!(2&c);e&&(d|=2);let i=!e,s=!0,o=0,a=0;for(;o<l.length;o++){let t=fe(l[o],n,!1,d);if(t instanceof n){if(!e){let e=ut(t);i&&=!e,s&&=e}l[a++]=t}}a<o&&(l.length=a),c|=4,c=s?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==u&&(st(t,c),2&c&&Object.freeze(t)),h&&!(8&c||!t.length&&(1===s||4===s&&(2&c||!(16&c)&&32&r)))){for(ur(c)&&(t=Ht(t),c=Lr(c,r),r=rr(e,r,i,t)),n=t,h=c,u=0;u<n.length;u++)(l=n[u])!==(c=Xe(l))&&(n[u]=c);h|=8,st(t,c=h=n.length?4096|h:-4097&h)}return or(t,c,e,r,i,s,a,o)}function wr(t,e,r){var n=t.v;return Ar(t,n,0|n[rt],e,r,ir(),!1,!0)}function Tr(t){return null==t&&(t=void 0),t}function br(t,e,r,n,i){return er(t,r,n=Tr(n),i),n&&!ut(n)&&Ye(t.v),t}function kr(t,e,r,n){t:{var i=n=Tr(n);ze(t);let s=t.v,o=0|s[rt];if(null==i){let t=gr(s);if(_r(t,s,o,r)!==e)break t;t.set(r,0)}else o=mr(s,o,r,e);rr(s,o,e,i)}n&&!ut(n)&&Ye(t.v)}function Sr(t,e,r){ze(t);var n=0|(t=t.v)[rt];if(null==r)rr(t,n,e);else{var i=r===V?7:0|r[rt],s=i,o=ur(i),a=o||Object.isFrozen(r),h=!0,u=!0;for(let t=0;t<r.length;t++){var c=r[t];o||(c=ut(c),h&&=!c,u&&=c)}o||(i=h?13:5,i=u?-4097&i:4096|i),a&&i===s||(r=Ht(r),s=0,i=Lr(i,n)),i!==s&&st(r,i),n=rr(t,n,e,r),2&i||!(4096&i||16&i)||Ye(t,n)}}function Lr(t,e){return-273&(2&e?2|t:-3&t)}function xr(t,e,r,n){var i=n;ze(t),t=Ar(t,n=t.v,0|n[rt],r,e,2,!0),i=null!=i?i:new r,t.push(i),e=r=t===V?7:0|t[rt],(i=ut(i))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&st(t,r),i||Ye(n)}function Rr(t,e,r){return re(Qe(t,e,r))}function Fr(t,e){return Qe(t,e,void 0,Zt)??0}function Ir(t,e,r){return Er(t,e,r=pr(t,co)===r?r:-1,void 0)}function Cr(t,e){dr(t,3,null==e?e:Qt(e),!1)}function Nr(t,e,r){if(null!=r){if("number"!=typeof r)throw $("int32");if(!zt(r))throw $("int32");r|=0}er(t,e,r)}function Or(t,e,r){er(t,e,null==r?r:Jt(r))}function Mr(t,e,r){dr(t,e,null==r?r:Jt(r),0)}function Dr(t,e,r){dr(t,e,le(r),"")}function Pr(t,e,r){{ze(t);let o=t.v,a=0|o[rt];if(null==r)rr(o,a,e);else{var n=t=r===V?7:0|r[rt],i=ur(t),s=i||Object.isFrozen(r);for(i||(t=0),s||(r=Ht(r),n=0,t=Lr(t,a),s=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??1024,i=0;i<r.length;i++){let e=r[i],o=ce(e);Object.is(e,o)||(s&&(r=Ht(r),n=0,t=Lr(t,a),s=!1),r[i]=o)}t!==n&&(s&&(r=Ht(r),t=Lr(t,a)),st(r,t)),rr(o,a,e,r)}}}function $r(t,e,r){ze(t),sr(t,e,de,2,!0).push(ce(r))}var Ur=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.g=e}};function Br(t,e){if("string"==typeof t)return new Ur(x(t),e);if(Array.isArray(t))return new Ur(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new Ur(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new Ur(t,!1);if(t.constructor===O)return e=C(t)||new Uint8Array(0),new Ur(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Ur(t,!1);throw Error()}function Gr(t,e){var r=0,n=0,i=0,s=t.h,o=t.g;do{var a=s[o++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=s[o++]))<<i;if(Wr(t,o),!(128&a))return e(r>>>0,n>>>0);throw Error()}function jr(t){for(var e=0,r=t.g,n=r+10,i=t.h;r<n;){let n=i[r++];if(e|=n,!(128&n))return Wr(t,r),!!(127&e)}throw Error()}function Vr(t){var e=t.h,r=t.g,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return Wr(t,r),i}function Hr(t){return Vr(t)>>>0}function Kr(t){var e=t.h,r=t.g,n=e[r],i=e[r+1],s=e[r+2];return e=e[r+3],Wr(t,t.g+4),t=2*((i=(n|i<<8|s<<16|e<<24)>>>0)>>31)+1,n=i>>>23&255,i&=8388607,255==n?i?NaN:t*(1/0):0==n?1401298464324817e-60*t*i:t*Math.pow(2,n-150)*(i+8388608)}function Xr(t){return Vr(t)}function Wr(t,e){if(t.g=e,e>t.l)throw Error()}function zr(t,e){if(e<0)throw Error();var r=t.g;if((e=r+e)>t.l)throw Error();return t.g=e,r}function Yr(t,e){if(0==e)return I();var r=zr(t,e);return t.Y&&t.j?r=t.h.subarray(r,r+e):(t=t.h,r=r===(e=r+e)?new Uint8Array(0):Ft?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?I():new O(r,F)}var qr=class{constructor(t,e,r,n){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(t,e,r,n)}init(t,e,r,{Y:n=!1,ea:i=!1}={}){this.Y=n,this.ea=i,t&&(t=Br(t,this.ea),this.h=t.buffer,this.j=t.g,this.m=e||0,this.l=void 0!==r?this.m+r:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}},Jr=[],Zr=0;function Qr(t,e,r,n){if(cn.length){let i=cn.pop();return i.u(n),i.g.init(t,e,r,n),i}return new un(t,e,r,n)}function tn(t){t.g.clear(),t.l=-1,t.h=-1,cn.length<100&&cn.push(t)}function en(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var r=Hr(t.g);if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.l=e,t.h=r,!0}function rn(t){try{switch(t.h){case 0:0!=t.h?rn(t):jr(t.g);break;case 1:var e=t.g;Wr(e,e.g+8);break;case 2:if(2!=t.h)rn(t);else{var r=Hr(t.g),n=t.g;Wr(n,n.g+r)}break;case 5:var i=t.g;Wr(i,i.g+4);break;case 3:nn();let s=t.l;try{for(;;){if(!en(t))throw Error();if(4==t.h){if(t.l!=s)throw Error();break}rn(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Zr>0&&Zr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function nn(){if(Zr>=100)throw new SyntaxError;Zr++}function sn(t,e,r){var n=t.g.l,i=Hr(t.g),s=(i=t.g.g+i)-n;if(s<=0&&(t.g.l=i,r(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error();return t.g.g=i,t.g.l=n,e}function on(t){var e=Hr(t.g),r=zr(t=t.g,e);if(t=t.h,u){var n,a=t;(n=o)||(n=o=new TextDecoder("utf-8",{fatal:!0})),e=r+e,a=0===r&&e===a.length?a:a.subarray(r,e);try{var c=n.decode(a)}catch(t){if(void 0===h){try{n.decode(new Uint8Array([128]))}catch(t){}try{n.decode(new Uint8Array([97])),h=!0}catch(t){h=!1}}throw!h&&(o=void 0),t}}else{e=(c=r)+e,r=[];let o,h=null;for(;c<e;){var l=t[c++];l<128?r.push(l):l<224?c>=e?i():(o=t[c++],l<194||128!=(192&o)?(c--,i()):r.push((31&l)<<6|63&o)):l<240?c>=e-1?i():(o=t[c++],128!=(192&o)||224===l&&o<160||237===l&&o>=160||128!=(192&(n=t[c++]))?(c--,i()):r.push((15&l)<<12|(63&o)<<6|63&n)):l<=244?c>=e-2?i():(o=t[c++],128!=(192&o)||o-144+(l<<28)>>30||128!=(192&(n=t[c++]))||128!=(192&(a=t[c++]))?(c--,i()):(l=(7&l)<<18|(63&o)<<12|(63&n)<<6|63&a,l-=65536,r.push(55296+(l>>10&1023),56320+(1023&l)))):i(),r.length>=8192&&(h=s(h,r),r.length=0)}c=s(h,r)}return c}function an(t){var e=Hr(t.g);return Yr(t.g,e)}function hn(t,e,r){var n=Hr(t.g);for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var un=class{constructor(t,e,r,n){if(Jr.length){let i=Jr.pop();i.init(t,e,r,n),t=i}else t=new qr(t,e,r,n);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.u(n)}u({ha:t=!1}={}){this.ha=t}},cn=[];function ln(t){return new pn(4294967295&t,Math.floor(t/4294967296))}function dn(t){return t?/^\d+$/.test(t)?(jt(t),new pn(It,Ct)):null:fn||=new pn(0,0)}var fn,pn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function gn(t){return new kn(4294967295&t,Math.floor(t/4294967296))}function mn(t){return t?/^-?\d+$/.test(t)?(jt(t),new kn(It,Ct)):null:_n||=new kn(0,0)}var _n,vn,yn,En,An,wn,Tn,bn,kn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function Sn(t,e,r){return"undefined"!=typeof BigInt64Array?(Tn||(Tn=new BigInt64Array(1),bn=new Uint32Array(Tn.buffer),Tn[0]=BigInt(1),wn=1===bn[0]),Tn[0]=t,new e(bn[t=wn?0:1],bn[1-t])):(An||(vn=BigInt(Number.MIN_SAFE_INTEGER),yn=BigInt(Number.MAX_SAFE_INTEGER),En=BigInt(4294967295),An=BigInt(32)),t>=vn&&t<=yn?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&En),Number(t>>An))))}function Ln(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function xn(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Rn(t,e){if(e>=0)xn(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Fn(t){var e=It;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}var In=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function Cn(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function Nn(t,e,r){xn(t.g,8*e+r)}function On(t,e){return Nn(t,e,2),e=t.g.end(),Cn(t,e),e.push(t.h),e}function Mn(t,e){var r=e.pop();for(r=t.h+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.h++;e.push(r),t.h++}function Dn(t,e,r){Nn(t,e,2),xn(t.g,r.length),Cn(t,t.g.end()),Cn(t,r)}function Pn(t,e,r,n){null!=r&&(e=On(t,e),n(r,t),Mn(t,e))}var $n=class{constructor(){this.l=[],this.h=0,this.g=new In}};function Un(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Bn=Un(),Gn=Un(),jn=Un(),Vn=Un(),Hn=Un(),Kn=Un(),Xn=Un(),Wn=Un(),zn=Un(),Yn=Un();function qn(t,e,r){var n=t.v;W&&W in n&&(n=n[W])&&delete n[e.g],e.h?e.j(t,e.h,e.g,r,e.l):e.j(t,e.g,r,e.l)}var Jn=class{constructor(t,e){this.v=Be(t,e,void 0,2048)}toJSON(){return $e(this)}j(){var t=ia,e=this.v,r=t.g,n=W;if(G&&n&&null!=e[n]?.[r]&&U(z,3),e=t.g,Q&&W&&void 0===Q&&(n=(r=this.v)[W])&&(n=n.da))try{n(r,e,Ne)}catch(t){d(t)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){var t=this.v,e=0|t[rt];return qe(this,t,e)?Ve(this,t,!0):new this.constructor(Ke(t,e,!1))}};Jn.prototype[Z]=ht,Jn.prototype.toString=function(){return this.v.toString()};var Zn=class{constructor(t,e,r){this.g=t,this.h=e,t=Bn,this.l=!!t&&r===t||!1}};function Qn(t,e){return new Zn(t,e,Bn)}function ti(t,e,r,n,i){Pn(t,r,di(e,n),i)}var ei,ri,ni=Qn(function(t,e,r,n,i){return 2===t.h&&(sn(t,vr(e,n,r),i),!0)},ti),ii=Qn(function(t,e,r,n,i){return 2===t.h&&(sn(t,vr(e,n,r),i),!0)},ti),si=Symbol(),oi=Symbol(),ai=Symbol(),hi=Symbol(),ui=Symbol();function ci(t,e,r,n){var i=n[t];if(i)return i;(i={}).ra=n,i.T=function(t){switch(typeof t){case"boolean":return Fe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Ie||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var s=n[1],o=1;s&&s.constructor===Object&&(i.ba=s,"function"==typeof(s=n[++o])&&(i.ma=!0,ei??=s,ri??=n[o+1],s=n[o+=2]));for(var a={};s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var h=0;h<s.length;h++)a[s[h]]=s;s=n[++o]}for(h=1;void 0!==s;){let t;"number"==typeof s&&(h+=s,s=n[++o]);var u=void 0;if(s instanceof Zn?t=s:(t=ni,o--),t?.l){s=n[++o],u=n;var c=o;"function"==typeof s&&(s=s(),u[c]=s),u=s}for(c=h+1,"number"==typeof(s=n[++o])&&s<0&&(c-=s,s=n[++o]);h<c;h++){let n=a[h];u?r(i,h,t,u,n):e(i,h,t,n)}}return n[t]=i}function li(t){return Array.isArray(t)?t[0]instanceof Zn?t:[ii,t]:[t,void 0]}function di(t,e){return t instanceof Jn?t.v:Array.isArray(t)?Ue(t,e):void 0}function fi(t,e,r,n){var i=r.g;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function pi(t,e,r,n,i){var s,o,a=r.g;t[e]=(t,e,r)=>a(t,e,r,o||=ci(oi,fi,pi,n).T,s||=gi(n),i)}function gi(t){var e=t[ai];if(null!=e)return e;var r=ci(oi,fi,pi,t);return e=r.ma?(t,e)=>ei(t,e,r):(t,e)=>{t:{nn();try{for(;en(e)&&4!=e.h;){let h=e.l,u=r[h];if(null==u){let t=r.ba;if(t){let e=t[h];if(e){let t=_i(e);null!=t&&(u=r[h]=t)}}}if(null==u||!u(e,t,h)){var n=e;let r=n.m;if(rn(n),n.ha)var i=void 0;else{let t=n.g.g-r;n.g.g=r,i=Yr(n.g,t)}n=void 0;var s=t,o=h,a=i;a&&((n=s[W]??(s[W]=new Ce))[o]??(n[o]=[])).push(a)}}let u=Le(t);u&&(u.da=r.ra[ui]);var h=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Zr>0&&Zr--}h=void 0}return h},t[ai]=e,t[ui]=mi.bind(t),e}function mi(t,e,r,n){var i=this[oi],s=this[ai],o=Ue(void 0,i.T),a=Le(t);if(a){var h=!1,u=i.ba;if(u){if(i=(e,r,i)=>{if(0!==i.length)if(u[r])for(let t of i){e=Qr(t);try{h=!0,s(o,e)}finally{tn(e)}}else n?.(t,r,i)},null==e)xe(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(h){let n=0|t[rt];if(2&n&&2048&n&&!r?.Ma)throw Error();let i=mt(n),s=(e,s)=>{if(null!=tr(t,e,i)){if(1===r?.Ta)return;throw Error()}null!=s&&(n=rr(t,n,e,s,i)),delete a[e]};null==e?pt(o,0|o[rt],(t,e)=>{s(t,e)}):s(e,tr(o,e,i))}}}}function _i(t){var e=(t=li(t))[0].g;if(t=t[1]){let r=gi(t),n=ci(oi,fi,pi,t).T;return(t,i,s)=>e(t,i,s,n,r)}return e}function vi(t,e,r){t[e]=r.h}function yi(t,e,r,n){var i,s,o=r.h;t[e]=(t,e,r)=>o(t,e,r,s||=ci(si,vi,yi,n).T,i||=Ei(n))}function Ei(t){var e=t[hi];if(!e){let r=ci(si,vi,yi,t);e=(t,e)=>Ai(t,e,r),t[hi]=e}return e}function Ai(t,e,r){pt(t,0|t[rt],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.ba)&&(r=r[e])){var n=(r=li(r))[0].h;if(r=r[1]){let e=Ei(r),i=ci(si,vi,yi,r).T;r=t.ma?ri(i,e):(t,r,s)=>n(t,r,s,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||U(q,3)}}),(t=Le(t))&&xe(t,(t,r,n)=>{for(Cn(e,e.g.end()),t=0;t<n.length;t++)Cn(e,C(n[t])||new Uint8Array(0))})}var wi=wt(0);function Ti(t,e){if(Array.isArray(e)){var r=0|e[rt];if(4&r)return e;for(var n=0,i=0;n<e.length;n++){let r=t(e[n]);null!=r&&(e[i++]=r)}return i<n&&(e.length=i),(t=-1537&r|5)!==r&&st(e,t),2&t&&Object.freeze(e),e}}var bi=(t,e)=>{var r=new $n;Ai(t.v,r,ci(si,vi,yi,e)),Cn(r,r.g.end()),t=new Uint8Array(r.h);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function ki(t,e,r){return new Zn(t,e,r)}function Si(t,e,r){return new Zn(t,e,r)}function Li(t,e,r){rr(t,0|t[rt],e,r,mt(0|t[rt]))}var xi=Qn(function(t,e,r,n,i){if(2!==t.h)return!1;if(t=Ht(t=sn(t,Ue([void 0,void 0],n),i)),i=mt(n=0|e[rt]),2&n)throw Error();var s=tr(e,r,i);if(s instanceof Te)2&s.J?((s=s.W()).push(t),rr(e,n,r,s,i)):s.Pa(t);else if(Array.isArray(s)){var o=0|s[rt];8192&o||st(s,o|=8192),2&o&&rr(e,n,r,s=lr(s),i),s.push(t)}else rr(e,n,r,at([t]),i);return!0},function(t,e,r,n,i){if(e instanceof Te)e.forEach((e,s)=>{Pn(t,r,Ue([s,e],n),i)});else if(Array.isArray(e)){for(let s=0;s<e.length;s++){let o=e[s];Array.isArray(o)&&Pn(t,r,Ue(o,n),i)}at(e)}});function Ri(t,e,r){null!=(e=Zt(e))&&(Nn(t,r,5),t=t.g,Mt(e),Fn(t))}function Fi(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Kt(64,t));if(ee(t)){if("string"===e)return oe(t);if("number"===e)return se(t)}}(e),null!=e){if("string"==typeof e)mn(e);if(null!=e)switch(Nn(t,r,0),typeof e){case"number":t=t.g,Ot(e),Ln(t,It,Ct);break;case"bigint":r=Sn(e,kn,gn),Ln(t.g,r.h,r.g);break;default:r=mn(e),Ln(t.g,r.h,r.g)}}}function Ii(t,e,r){null!=(e=re(e))&&null!=e&&(Nn(t,r,0),Rn(t.g,e))}function Ci(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Nn(t,r,0),t.g.g.push(e?1:0))}function Ni(t,e,r){null!=(e=de(e))&&Dn(t,r,l(e))}function Oi(t,e,r,n,i){Pn(t,r,di(e,n),i)}function Mi(t,e,r){null!=(e=null==e||"string"==typeof e||e instanceof O?e:void 0)&&Dn(t,r,Br(e,!0).buffer)}function Di(t,e,r){null!=(e=ne(e))&&null!=e&&(Nn(t,r,0),xn(t.g,e))}function Pi(t,e,r){null!=(e=re(e))&&(e=parseInt(e,10),Nn(t,r,0),Rn(t.g,e))}function $i(t,e,r){return(5===t.h||2===t.h)&&(e=fr(e,0|e[rt],r),2==t.h?hn(t,Kr,e):e.push(Kr(t.g)),!0)}var Ui=ki(function(t,e,r){return 5===t.h&&(Li(e,r,Kr(t.g)),!0)},Ri,Wn),Bi=Si($i,function(t,e,r){if(null!=(e=Ti(Zt,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(Nn(n,i,5),n=n.g,Mt(s),Fn(n))}},Wn),Gi=Si($i,function(t,e,r){if(null!=(e=Ti(Zt,e))&&e.length){Nn(t,r,2),xn(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,Mt(e[n]),Fn(r)}},Wn),ji=ki(function(t,e,r){return 5===t.h&&(Li(e,r,0===(t=Kr(t.g))?void 0:t),!0)},Ri,Wn),Vi=ki(function(t,e,r){return 0!==t.h?t=!1:(Li(e,r,Gr(t.g,$t)),t=!0),t},Fi,Kn),Hi=ki(function(t,e,r){return 0!==t.h?e=!1:(Li(e,r,(t=Gr(t.g,$t))===wi?void 0:t),e=!0),e},Fi,Kn),Ki=ki(function(t,e,r){return 0!==t.h?t=!1:(Li(e,r,Gr(t.g,Pt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Xt(64,t));if(ee(t)){if("string"===e)return e=Yt(Number(t)),Wt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),(e="-"!==t[0]&&((e=t.length)<20||20===e&&t<="18446744073709551615"))||(jt(t),t=Ut(It,Ct))),t;if("number"===e)return(t=Yt(t))>=0&&Wt(t)||(Ot(t),t=Dt(It,Ct)),t}}(e),null!=e){if("string"==typeof e)dn(e);if(null!=e)switch(Nn(t,r,0),typeof e){case"number":t=t.g,Ot(e),Ln(t,It,Ct);break;case"bigint":r=Sn(e,pn,ln),Ln(t.g,r.h,r.g);break;default:r=dn(e),Ln(t.g,r.h,r.g)}}},Xn),Xi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,Vr(t.g)),!0)},Ii,Vn),Wi=Si(function(t,e,r){return(0===t.h||2===t.h)&&(e=fr(e,0|e[rt],r),2==t.h?hn(t,Vr,e):e.push(Vr(t.g)),!0)},function(t,e,r){if(null!=(e=Ti(re,e))&&e.length){r=On(t,r);for(let r=0;r<e.length;r++)Rn(t.g,e[r]);Mn(t,r)}},Vn),zi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,0===(t=Vr(t.g))?void 0:t),!0)},Ii,Vn),Yi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,jr(t.g)),!0)},Ci,Gn),qi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,!1===(t=jr(t.g))?void 0:t),!0)},Ci,Gn),Ji=Si(function(t,e,r){return 2===t.h&&(t=on(t),fr(e,0|e[rt],r).push(t),!0)},function(t,e,r){if(null!=(e=Ti(de,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&Dn(n,i,l(s))}},jn),Zi=ki(function(t,e,r){return 2===t.h&&(Li(e,r,""===(t=on(t))?void 0:t),!0)},Ni,jn),Qi=ki(function(t,e,r){return 2===t.h&&(Li(e,r,on(t)),!0)},Ni,jn),ts=function(t,e,r=Bn){return new Zn(t,e,r)}(function(t,e,r,n,i){return 2===t.h&&(n=Ue(void 0,n),fr(e,0|e[rt],r).push(n),sn(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let s=0;s<e.length;s++)Oi(t,e[s],r,n,i);1&(t=0|e[rt])||st(e,1|t)}}),es=Qn(function(t,e,r,n,i,s){if(2!==t.h)return!1;var o=0|e[rt];return mr(e,o,s,r,mt(o)),sn(t,e=vr(e,n,r),i),!0},Oi),rs=ki(function(t,e,r){return 2===t.h&&(Li(e,r,an(t)),!0)},Mi,zn),ns=Si(function(t,e,r){return(0===t.h||2===t.h)&&(e=fr(e,0|e[rt],r),2==t.h?hn(t,Hr,e):e.push(Hr(t.g)),!0)},function(t,e,r){if(null!=(e=Ti(ne,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(Nn(n,i,0),xn(n.g,s))}},Hn),is=ki(function(t,e,r){return 0===t.h&&(Li(e,r,0===(t=Hr(t.g))?void 0:t),!0)},Di,Hn),ss=ki(function(t,e,r){return 0===t.h&&(Li(e,r,Vr(t.g)),!0)},Pi,Yn),os=ki(function(t,e,r){return 0===t.h&&(Li(e,r,0===(t=Vr(t.g))?void 0:t),!0)},Pi,Yn);class as{constructor(t,e){var r=Rs;this.g=t,this.h=e,this.m=Er,this.j=br,this.defaultValue=void 0,this.l=null!=r.Ra?gt:void 0}register(){v(this)}}function hs(t,e){return new as(t,e)}function us(t,e){return(r,n)=>{t:{let s={ea:!0};n&&Object.assign(s,n),r=Qr(r,void 0,void 0,s);try{let n=new t,s=n.v;gi(e)(s,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{tn(r)}i=void 0}return i}}function cs(t){return e=>bi(e,t)}function ls(t){return function(){return bi(this,t)}}var ds,fs=class extends Jn{constructor(t){super(t)}},ps=[0,Zi,ki(function(t,e,r){return 2===t.h&&(Li(e,r,(t=an(t))===I()?void 0:t),!0)},function(t,e,r){if(null!=e){if(e instanceof Jn){let n=e.Ua;return void(n?(e=n(e),null!=e&&Dn(t,r,Br(e,!0).buffer)):U(q,3))}if(Array.isArray(e))return void U(q,3)}Mi(t,e,r)},zn)],gs=globalThis.trustedTypes;var ms=class{constructor(t){this.g=t}toString(){return this.g+""}};function _s(t){var e;return void 0===ds&&(ds=function(){var t=null;if(!gs)return t;try{let e=t=>t;t=gs.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=ds)?e.createScriptURL(t):t,new ms(t)}function vs(t,...e){if(0===e.length)return _s(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return _s(r)}var ys=[0,Xi,ss,Yi,-1,Wi,ss,-1,Yi,-1],Es=[0,ss,-1,Yi],As=class extends Jn{constructor(t){super(t)}},ws=[0,Yi,Qi,Yi,ss,-1,Si(function(t,e,r){return(0===t.h||2===t.h)&&(e=fr(e,0|e[rt],r),2==t.h?hn(t,Xr,e):e.push(Vr(t.g)),!0)},function(t,e,r){if(null!=(e=Ti(re,e))&&e.length){r=On(t,r);for(let r=0;r<e.length;r++)Rn(t.g,e[r]);Mn(t,r)}},Yn),Qi,-1,[0,Yi,-1],ss,Yi,-1,Es],Ts=[0,3,Yi,-1,2,[0,[2],Xi,es,[0,ki(function(t,e,r){return 0===t.h&&(Li(e,r,Hr(t.g)),!0)},Di,Hn)]],[0,ss,Yi,ss,Yi,ss,Yi,Qi,-1],[0,[3,4],Qi,-1,es,[0,Xi],es,[0,ss]],[0]],bs=[0,Qi,-2],ks=class extends Jn{constructor(t){super(t)}},Ss=[0],Ls=class extends Jn{constructor(t){super(t)}},xs=[0,Xi,Yi,1,Yi,-4],Rs=class extends Jn{constructor(t){super(t,2)}},Fs={};Fs[336783863]=[0,Qi,Yi,-1,Xi,[0,[1,2,3,4,5,6,7,8,9],es,Ss,es,ws,es,bs,es,xs,es,ys,es,[0,Qi,-2],es,[0,Qi,ss],es,Ts,es,Es],[0,Qi],Yi,[0,[1,3],[2,4],es,[0,Wi],-1,es,[0,Ji],-1,ts,[0,Qi,-1]],Qi];var Is=[0,Hi,-1,qi,-3,Hi,Wi,Zi,zi,Hi,-1,qi,zi,qi,-2,Zi];function Cs(t,e){$r(t,3,e)}function Ns(t,e){$r(t,4,e)}var Os=class extends Jn{constructor(t){super(t,500)}u(t){return br(this,0,7,t)}},Ms=[-1,{}],Ds=[0,Qi,1,Ms],Ps=[0,Qi,Ji,Ms];function $s(t,e){xr(t,1,Os,e)}function Us(t,e){$r(t,10,e)}function Bs(t,e){$r(t,15,e)}var Gs=class extends Jn{constructor(t){super(t,500)}u(t){return br(this,0,1001,t)}},js=[-500,ts,[-500,Zi,-1,Ji,-3,[-2,Fs,Yi],ts,ps,zi,-1,Ds,Ps,ts,[0,Zi,qi],Zi,Is,zi,Ji,987,Ji],4,ts,[-500,Qi,-1,[-1,{}],998,Qi],ts,[-500,Qi,Ji,-1,[-2,{},Yi],997,Ji,-1],zi,ts,[-500,Qi,Ji,Ms,998,Ji],Ji,zi,Ds,Ps,ts,[0,Zi,-1,Ms],Ji,-2,Is,Zi,-1,qi,[0,qi,is],978,Ms,ts,ps];Gs.prototype.g=ls(js);var Vs=us(Gs,js),Hs=class extends Jn{constructor(t){super(t)}},Ks=class extends Jn{constructor(t){super(t)}g(){return wr(this,Hs,1)}},Xs=[0,ts,[0,Xi,Ui,Qi,-1]],Ws=us(Ks,Xs),zs=class extends Jn{constructor(t){super(t)}},Ys=class extends Jn{constructor(t){super(t)}},qs=class extends Jn{constructor(t){super(t)}l(){return Er(this,zs,2)}g(){return wr(this,Ys,5)}},Js=us(class extends Jn{constructor(t){super(t)}},[0,Ji,Wi,Gi,[0,ss,[0,Xi,-3],[0,Ui,-3],[0,Xi,-1,[0,ts,[0,Xi,-2]]],ts,[0,Ui,-1,Qi,Ui]],Qi,-1,Vi,ts,[0,Xi,Ui],Ji,Vi]),Zs=class extends Jn{constructor(t){super(t)}},Qs=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,Ui,-4]]),to=class extends Jn{constructor(t){super(t)}},eo=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,Ui,-4]]),ro=class extends Jn{constructor(t){super(t)}},no=[0,Xi,-1,Gi,ss],io=class extends Jn{constructor(t){super(t)}};io.prototype.g=ls([0,Ui,-4,Vi]);var so=class extends Jn{constructor(t){super(t)}},oo=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,1,Xi,Qi,Xs],Vi]),ao=class extends Jn{constructor(t){super(t)}},ho=class extends Jn{constructor(t){super(t)}g(){var t=Qe(this,1,void 0,cr);return null==t?I():t}},uo=class extends Jn{constructor(t){super(t)}},co=[1,2],lo=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,co,es,[0,Gi],es,[0,rs],Xi,Qi],Vi]),fo=class extends Jn{constructor(t){super(t)}},po=[0,Qi,Xi,Ui,Ji,-1],go=class extends Jn{constructor(t){super(t)}},mo=[0,Yi,-1],_o=class extends Jn{constructor(t){super(t)}g(){nr(this,As,2,vo)}},vo=[1,2,3,4,5,6],yo=class extends Jn{constructor(t){super(t)}g(){return null!=Qe(this,1,void 0,cr)}l(){return null!=de(Qe(this,2))}},Eo=class extends Jn{constructor(t){super(t)}},Ao=[0,rs,Qi,[0,Xi,Vi,-1],[0,Ki,Vi]],wo=[0,Ao,Yi,[0,vo,es,xs,es,ws,es,ys,es,Ss,es,bs,es,Ts],ss],To=cs(wo),bo=class extends Jn{constructor(t){super(t)}},ko=[0,wo,Ui,-1,Xi],So=hs(502141897,bo);Fs[502141897]=ko;var Lo=us(class extends Jn{constructor(t){super(t)}},[0,[0,ss,-1,Bi,ns],no]),xo=class extends Jn{constructor(t){super(t)}},Ro=class extends Jn{constructor(t){super(t)}},Fo=[0,wo,Ui,[0,wo],Yi],Io=hs(508968150,Ro);Fs[508968150]=[0,wo,ko,Fo,Ui,[0,[0,Ao]]],Fs[508968149]=Fo;var Co=class extends Jn{constructor(t){super(t)}l(){return Er(this,fo,2)}g(){er(this,2)}},No=[0,wo,po];Fs[478825465]=No;var Oo=class extends Jn{constructor(t){super(t)}},Mo=class extends Jn{constructor(t){super(t)}},Do=class extends Jn{constructor(t){super(t)}},Po=class extends Jn{constructor(t){super(t)}},$o=class extends Jn{constructor(t){super(t)}},Uo=[0,wo,[0,wo],No,-1],Bo=[0,wo,Ui,Xi],Go=[0,wo,Ui],jo=[0,wo,Bo,Go,Ui],Vo=hs(479097054,$o);Fs[479097054]=[0,wo,jo,Uo],Fs[463370452]=Uo,Fs[464864288]=Bo;var Ho=hs(462713202,Po);Fs[462713202]=jo,Fs[474472470]=Go;var Ko=class extends Jn{constructor(t){super(t)}},Xo=class extends Jn{constructor(t){super(t)}},Wo=class extends Jn{constructor(t){super(t)}},zo=class extends Jn{constructor(t){super(t)}},Yo=[0,wo,Ui,-1,Xi],qo=[0,wo,Ui,Yi];zo.prototype.g=ls([0,wo,Go,[0,wo],ko,Fo,Yo,qo]);var Jo=class extends Jn{constructor(t){super(t)}},Zo=hs(456383383,Jo);Fs[456383383]=[0,wo,po];var Qo=class extends Jn{constructor(t){super(t)}},ta=hs(476348187,Qo);Fs[476348187]=[0,wo,mo];var ea=class extends Jn{constructor(t){super(t)}},ra=class extends Jn{constructor(t){super(t)}},na=[0,ss,-1],ia=hs(458105876,class extends Jn{constructor(t){super(t)}g(){var t=this.v,e=0|t[rt],r=ut(this,e);return t=function(t,e,r,n){var i=ra;!n&&We(t)&&(r=0|(e=t.v)[rt]);var s=tr(e,2);if(t=!1,null==s){if(n)return Se();s=[]}else if(s.constructor===Te){if(!(2&s.J)||n)return s;s=s.W()}else Array.isArray(s)?t=!!(2&s[rt]):s=[];if(n){if(!s.length)return Se();t||(t=!0,ot(s))}else t&&(t=!1,at(s),s=lr(s));return!t&&32&r&&it(s,32),r=rr(e,r,2,n=new Te(s,i,pe,void 0)),t||Ye(e,r),n}(this,t,e,r),!r&&ra&&(t.sa=!0),t}});Fs[458105876]=[0,na,xi,[!0,Vi,[0,Qi,-1,Ji]],[0,Wi,Yi,ss],Yi];var sa=class extends Jn{constructor(t){super(t)}},oa=hs(458105758,sa);Fs[458105758]=[0,wo,Qi,na];var aa=class extends Jn{constructor(t){super(t)}},ha=class extends Jn{constructor(t){super(t)}},ua=class extends Jn{constructor(t){super(t)}},ca=cs([0,ts,[0,os,ts,[0,ji,-1],qi]]),la=class extends Jn{constructor(t){super(t)}},da=[0,ji,-1,qi],fa=class extends Jn{constructor(t){super(t)}},pa=class extends Jn{constructor(t){super(t)}},ga=[1,2];pa.prototype.g=ls([0,ga,es,da,es,[0,ts,da]]);var ma=class extends Jn{constructor(t){super(t)}},_a=hs(443442058,ma);Fs[443442058]=[0,wo,Qi,Xi,Ui,Ji,-1,Yi,Ui],Fs[514774813]=Yo;var va=class extends Jn{constructor(t){super(t)}},ya=hs(516587230,va);function Ea(t,e){return e=e?e.clone():new fo,void 0!==t.displayNamesLocale?er(e,1,le(t.displayNamesLocale)):void 0===t.displayNamesLocale&&er(e,1),void 0!==t.maxResults?Nr(e,2,t.maxResults):"maxResults"in t&&er(e,2),void 0!==t.scoreThreshold?Or(e,3,t.scoreThreshold):"scoreThreshold"in t&&er(e,3),void 0!==t.categoryAllowlist?Pr(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&er(e,4),void 0!==t.categoryDenylist?Pr(e,5,t.categoryDenylist):"categoryDenylist"in t&&er(e,5),e}function Aa(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function wa(t,e=-1,r=""){return{categories:t.map(t=>({index:Rr(t,1)??0??-1,score:Fr(t,2)??0,categoryName:de(Qe(t,3))??""??"",displayName:de(Qe(t,4))??""??""})),headIndex:e,headName:r}}function Ta(t){var e={classifications:wr(t,so,1).map(t=>wa(Er(t,Ks,4)?.g()??[],Rr(t,2)??0,de(Qe(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(Tt(t)?t=Number(t):(t=Kt(64,t),t=Tt(t)?Number(t):String(t)),t):ee(t)?"number"==typeof t?se(t):oe(t):void 0}(Qe(t,2,void 0,ue))&&(e.timestampMs=Aa(Qe(t,2,void 0,ue)??Je)),e}function ba(t){var e=sr(t,3,Zt,ir()),r=sr(t,2,re,ir()),n=sr(t,1,de,ir()),i=sr(t,9,de,ir()),s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:r[t]??-1,categoryName:n[t]??"",displayName:i[t]??""});if((e=Er(t,qs,4)?.l())&&(s.boundingBox={originX:Rr(e,1,Ze)??0,originY:Rr(e,2,Ze)??0,width:Rr(e,3,Ze)??0,height:Rr(e,4,Ze)??0,angle:0}),Er(t,qs,4)?.g().length)for(let e of Er(t,qs,4).g())s.keypoints.push({x:Qe(e,1,Ze,Zt)??0,y:Qe(e,2,Ze,Zt)??0,score:Qe(e,4,Ze,Zt)??0,label:de(Qe(e,3,Ze))??""});return s}function ka(t){var e=[];for(let r of wr(t,to,1))e.push({x:Fr(r,1)??0,y:Fr(r,2)??0,z:Fr(r,3)??0,visibility:Fr(r,4)??0});return e}function Sa(t){var e=[];for(let r of wr(t,Zs,1))e.push({x:Fr(r,1)??0,y:Fr(r,2)??0,z:Fr(r,3)??0,visibility:Fr(r,4)??0});return e}function La(t){return Array.from(t,t=>t>127?t-256:t)}function xa(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let s=0;s<t.length;s++)r+=t[s]*e[s],n+=t[s]*t[s],i+=e[s]*e[s];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}Fs[516587230]=[0,wo,Yo,qo,Ui],Fs[518928384]=qo;var Ra,Fa=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 Ia(t){if(t)return!0;if(void 0===Ra)try{await WebAssembly.instantiate(Fa),Ra=!0}catch{Ra=!1}return Ra}async function Ca(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Ia(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var Na=class{};Na.forVisionTasks=function(t,e=!1){return Ca("vision",t??vs``,e)},Na.forTextTasks=function(t,e=!1){return Ca("text",t??vs``,e)},Na.forGenAiTasks=function(t,e=!1){return Ca("genai",t??vs``,e)},Na.forAudioTasks=function(t,e=!1){return Ca("audio",t??vs``,e)},Na.isSimdSupported=function(t=!1){return Ia(t)};var Oa=class{close(){}};function Ma(){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 Da(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function Pa(t){return 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]}function $a(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Ua(t,e,r){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(r?t.i._bindTextureToStream(r):t.i._bindTextureToCanvas(),!(r=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);var[n,i]=Pa(e);return!t.l||n===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=i),[n,i]}function Ba(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function Ga(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function ja(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Va=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:Ma()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){var r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),$a(this,n||"input_audio",n=>{$a(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){Ga(this,"__graph_config__",e=>{t(e)}),$a(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),$a(this,n,t=>{this.i._addAudioToInputStream(this.g,e,r,t,i)})}addGpuBufferToStream(t,e,r){$a(this,e,e=>{var[n,i]=Ua(this,t,e);this.i._addBoundTextureToStream(e,n,i,r)})}addBoolToStream(t,e,r){$a(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){$a(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){$a(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){$a(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){$a(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){$a(this,e,e=>{$a(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){$a(this,e,e=>{Ba(this,Object.keys(t),n=>{Ba(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){$a(this,r,r=>{$a(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){$a(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)$a(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){$a(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){$a(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){$a(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){$a(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){$a(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){$a(this,e,e=>{$a(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){$a(this,r,r=>{$a(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)$a(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Ga(this,t,e),$a(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){ja(this,t,e),$a(this,t,t=>{this.i._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ga(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),$a(this,t,t=>{this.i._attachAudioListener(t,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}};function Ha(t){return class extends t{La(){this.i._registerModelResourcesGraphService()}}}var Ka=Ha(Va),Xa=class extends Ka{};async function Wa(t,e,r,n){return t=await(async(t,e,r,n,i)=>{if(e&&await Da(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Da(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,n)})(t,r.wasmLoaderPath,r.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&t.endsWith(".data")?r.assetBinaryPath.toString():t}),t.na=new Oa,await t.u(n),t}async function za(t,e,r,n){return Wa(t,e,r,n)}function Ya(t,e){var r=Er(t.baseOptions,yo,1)||new yo;"string"==typeof e?(er(r,2,le(e)),er(r,1)):e instanceof Uint8Array&&(er(r,1,lt(e,!1)),er(r,2)),br(t.baseOptions,0,1,r)}function qa(t){try{let e=t.H.length;if(1===e)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map(t=>t.message).join(", "))}finally{t.H=[]}}function Ja(t,e){t.C=Math.max(t.C,e)}function Za(t,e){t.B=new Os,Dr(t.B,2,"PassThroughCalculator"),Cs(t.B,"free_memory"),Ns(t.B,"free_memory_unused_out"),Us(e,"free_memory"),$s(e,t.B)}function Qa(t,e){Cs(t.B,e),Ns(t.B,e+"_unused_out")}function th(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var eh=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){let e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Er(this.baseOptions,yo,1)?.g()||Er(this.baseOptions,yo,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=Er(t.baseOptions,_o,3);if(!r){var n=r=new _o,i=new ks;kr(n,4,vo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new As,kr(e,2,vo,n)):(e=r,n=new ks,kr(e,4,vo,n))),br(t.baseOptions,0,3,r)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Ya(this,"/model.dat"),this.m(),this.M()});if(e.modelAssetBuffer instanceof Uint8Array)Ya(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(e.modelAssetBuffer).then(t=>{Ya(this,t),this.m(),this.M()})}return this.m(),this.M(),Promise.resolve()}M(){}ca(){var t;if(this.g.ca(e=>{t=Vs(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((t,e)=>{this.H.push(Error(e))}),this.g.La(),this.g.setGraph(t,e),this.B=void 0,qa(this)}finishProcessing(){this.g.finishProcessing(),qa(this)}close(){this.B=void 0,this.na?.close(),this.g.closeGraph()}};function rh(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}eh.prototype.close=eh.prototype.close;class nh{constructor(t,e,r,n){this.g=t,this.h=e,this.m=r,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ih(t,e,r){var n=t.g;if(r=rh(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(t.h,r),r}function sh(t,e){var r=t.g,n=rh(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);var i=rh(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(t.M),r.vertexAttribPointer(t.M,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);var s=rh(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(t.L),r.vertexAttribPointer(t.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new nh(r,n,i,s)}function oh(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function ah(t,e,r,n){return oh(t,e),t.h||(t.m(),t.D()),r?(t.o||(t.o=sh(t,!0)),r=t.o):(t.A||(t.A=sh(t,!1)),r=t.A),e.useProgram(t.h),r.bind(),t.l(),t=n(),r.g.bindVertexArray(null),t}function hh(t,e,r){return oh(t,e),t=rh(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function uh(t,e,r){oh(t,e),t.B||(t.B=rh(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function ch(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var lh=class{H(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){var t=this.g;if(this.h=rh(t.createProgram(),"Failed to create WebGL program"),this.X=ih(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.V=ih(this,this.H(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.M=t.getAttribLocation(this.h,"aVertex"),this.L=t.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){let t=this.g;t.deleteProgram(this.h),t.deleteShader(this.X),t.deleteShader(this.V)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.o&&this.o.close()}};var dh=class extends lh{H(){return"\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.C=hh(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=hh(this,t,t.NEAREST)}m(){super.m();var t=this.g;this.O=rh(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=rh(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.N=rh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.N,0),t.uniform1i(this.O,1),t.uniform1i(this.U,2)}close(){this.C&&this.g.deleteTexture(this.C),this.j&&this.g.deleteTexture(this.j),super.close()}},fh=class extends lh{H(){return"\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.j=hh(this,t),t.activeTexture(t.TEXTURE2),this.C=hh(this,t)}m(){super.m();var t=this.g;this.N=rh(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.O=rh(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=rh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.I,0),t.uniform1i(this.N,1),t.uniform1i(this.O,2)}close(){this.j&&this.g.deleteTexture(this.j),this.C&&this.g.deleteTexture(this.C),super.close()}};function ph(t,e){switch(e){case 0:return t.g.find(t=>t instanceof Uint8Array);case 1:return t.g.find(t=>t instanceof Float32Array);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function gh(t){var e=ph(t,1);if(!e){if(e=ph(t,0))e=new Float32Array(e).map(t=>t/255);else{e=new Float32Array(t.width*t.height);let n=_h(t);var r=yh(t);if(uh(r,n,mh(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(t.width*t.height*4),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,r);for(let t=0,n=0;t<e.length;++t,n+=4)e[t]=r[n]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function mh(t){var e=ph(t,2);if(!e){let r=_h(t);e=Eh(t);let n=gh(t),i=vh(t);r.texImage2D(r.TEXTURE_2D,0,i,t.width,t.height,0,r.RED,r.FLOAT,n),Ah(t)}return e}function _h(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=rh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function vh(t){if(t=_h(t),!wh)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))wh=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");wh=t.R16F}return wh}function yh(t){return t.l||(t.l=new lh),t.l}function Eh(t){var e=_h(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=ph(t,2);return r||(r=hh(yh(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(r),t.j=!0),e.bindTexture(e.TEXTURE_2D,r),r}function Ah(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var wh,Th=class{constructor(t,e,r,n,i,s,o){this.g=t,this.m=e,this.j=r,this.canvas=n,this.l=i,this.width=s,this.height=o,this.j&&(0===--bh&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Ga(){return!!ph(this,0)}ka(){return!!ph(this,1)}R(){return!!ph(this,2)}ja(){return(e=ph(t=this,0))||(e=gh(t),e=new Uint8Array(e.map(t=>Math.round(255*t))),t.g.push(e)),e;var t,e}ia(){return gh(this)}P(){return mh(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof Uint8Array)r=new Uint8Array(e);else if(e instanceof Float32Array)r=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{let t=_h(this),e=yh(this);t.activeTexture(t.TEXTURE1),r=hh(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,r);let n=vh(this);t.texImage2D(t.TEXTURE_2D,0,n,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),uh(e,t,r),ah(e,t,!1,()=>{Eh(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ah(this)}),ch(e),Ah(this)}}t.push(r)}return new Th(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&_h(this).deleteTexture(ph(this,2)),bh=-1}};Th.prototype.close=Th.prototype.close,Th.prototype.clone=Th.prototype.clone,Th.prototype.getAsWebGLTexture=Th.prototype.P,Th.prototype.getAsFloat32Array=Th.prototype.ia,Th.prototype.getAsUint8Array=Th.prototype.ja,Th.prototype.hasWebGLTexture=Th.prototype.R,Th.prototype.hasFloat32Array=Th.prototype.ka,Th.prototype.hasUint8Array=Th.prototype.Ga;var bh=250,kh={color:"white",lineWidth:4,radius:6};function Sh(t){return{...kh,fillColor:(t=t||{}).color,...t}}function Lh(t,e){return t instanceof Function?t(e):t}function xh(t,e,r){return Math.max(Math.min(e,r),Math.min(Math.max(e,r),t))}function Rh(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Fh(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Ih(t,e,r){if(e.R())r(e.P());else{let n=e.ka()?e.ia():e.ja();t.m=t.m??new lh;let i=Fh(t);r((t=new Th([n],e.m,!1,i.canvas,t.m,e.width,e.height)).P()),t.close()}}function Ch(t,e,r,n){var i=function(t){return t.g||(t.g=new dh),t.g}(t),s=Fh(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;ah(i,s,!0,()=>{!function(t,e,r,n){var i=t.g;if(i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.C),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),t.I&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(let[r,n]of t){t=r;let i=n,s=e.next();if(s.done)return!1;let[o,a]=s.value;if(t!==o||i[0]!==a[0]||i[1]!==a[1]||i[2]!==a[2]||i[3]!==a[3])return!1}return!!e.next().done}(t.I,n))i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j);else{t.I=n;let e=Array(1024).fill(0);n.forEach((t,r)=>{if(4!==t.length)throw Error(`Color at index ${r} is not a four-channel value.`);e[4*r]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]}),i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,256,1,0,i.RGBA,i.UNSIGNED_BYTE,new Uint8Array(e))}}(i,e,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);var t=i.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}function Nh(t,e,r,n){var i=Fh(t),s=function(t){return t.h||(t.h=new fh),t.h}(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;ah(s,i,!0,()=>{var t=s.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s.j),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,s.C),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(t=s.g).activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}var Oh=class{constructor(t,e){"undefined"!=typeof CanvasRenderingContext2D&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}za(t,e){if(t){var r=Rh(this);e=Sh(e),r.save();var n=r.canvas,i=0;for(let s of t)r.fillStyle=Lh(e.fillColor,{index:i,from:s}),r.strokeStyle=Lh(e.color,{index:i,from:s}),r.lineWidth=Lh(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*n.width,s.y*n.height,Lh(e.radius,{index:i,from:s}),0,2*Math.PI),r.fill(t),r.stroke(t),++i;r.restore()}}ya(t,e,r){if(t&&e){var n=Rh(this);r=Sh(r),n.save();var i=n.canvas,s=0;for(let o of e){n.beginPath(),e=t[o.start];let a=t[o.end];e&&a&&(n.strokeStyle=Lh(r.color,{index:s,from:e,to:a}),n.lineWidth=Lh(r.lineWidth,{index:s,from:e,to:a}),n.moveTo(e.x*i.width,e.y*i.height),n.lineTo(a.x*i.width,a.y*i.height)),++s,n.stroke()}n.restore()}}va(t,e){var r=Rh(this);e=Sh(e),r.save(),r.beginPath(),r.lineWidth=Lh(e.lineWidth,{}),r.strokeStyle=Lh(e.color,{}),r.fillStyle=Lh(e.fillColor,{}),r.moveTo(t.originX,t.originY),r.lineTo(t.originX+t.width,t.originY),r.lineTo(t.originX+t.width,t.originY+t.height),r.lineTo(t.originX,t.originY+t.height),r.lineTo(t.originX,t.originY),r.stroke(),r.fill(),r.restore()}wa(t,e,r=[0,0,0,255]){this.l?function(t,e,r,n){var i=Fh(t);Ih(t,e,e=>{Ch(t,e,r,n),(e=Rh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,r,e):Ch(this,t.P(),r,e)}xa(t,e,r){this.l?function(t,e,r,n){var i=Fh(t);Ih(t,e,e=>{Nh(t,e,r,n),(e=Rh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,e,r):Nh(this,t.P(),e,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Mh(t,e){switch(e){case 0:return t.g.find(t=>t instanceof ImageData);case 1:return t.g.find(t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function Dh(t){var e=Mh(t,0);if(!e){e=$h(t);let r=Uh(t),n=new Uint8Array(t.width*t.height*4);uh(r,e,Ph(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),ch(r),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function Ph(t){var e=Mh(t,2);if(!e){let r=$h(t);e=Bh(t);let n=Mh(t,1)||Dh(t);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),Gh(t)}return e}function $h(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=rh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Uh(t){return t.l||(t.l=new lh),t.l}function Bh(t){var e=$h(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=Mh(t,2);return r||(r=hh(Uh(t),e),t.g.push(r),t.m=!0),e.bindTexture(e.TEXTURE_2D,r),r}function Gh(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function jh(t){var e=$h(t);return ah(Uh(t),e,!0,()=>function(t,e){var r=t.canvas;if(r.width===t.width&&r.height===t.height)return e();var n=r.width,i=r.height;return r.width=t.width,r.height=t.height,t=e(),r.width=n,r.height=i,t}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}Oh.prototype.close=Oh.prototype.close,Oh.prototype.drawConfidenceMask=Oh.prototype.xa,Oh.prototype.drawCategoryMask=Oh.prototype.wa,Oh.prototype.drawBoundingBox=Oh.prototype.va,Oh.prototype.drawConnectors=Oh.prototype.ya,Oh.prototype.drawLandmarks=Oh.prototype.za,Oh.lerp=function(t,e,r,n,i){return xh(n*(1-(t-e)/(r-e))+i*(1-(r-t)/(r-e)),n,i)},Oh.clamp=xh;var Vh=class{constructor(t,e,r,n,i,s,o){this.g=t,this.j=e,this.m=r,this.canvas=n,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--Hh&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Fa(){return!!Mh(this,0)}la(){return!!Mh(this,1)}R(){return!!Mh(this,2)}Da(){return Dh(this)}Ca(){var t=Mh(this,1);return t||(Ph(this),Bh(this),t=jh(this),Gh(this),this.g.push(t),this.j=!0),t}P(){return Ph(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof ImageData)r=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){let t=$h(this),e=Uh(this);t.activeTexture(t.TEXTURE1),r=hh(e,t),t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),uh(e,t,r),ah(e,t,!1,()=>{Bh(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Gh(this)}),ch(e),Gh(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);Ph(this),Bh(this),r=jh(this),Gh(this)}t.push(r)}return new Vh(t,this.la(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Mh(this,1).close(),this.m&&$h(this).deleteTexture(Mh(this,2)),Hh=-1}};Vh.prototype.close=Vh.prototype.close,Vh.prototype.clone=Vh.prototype.clone,Vh.prototype.getAsWebGLTexture=Vh.prototype.P,Vh.prototype.getAsImageBitmap=Vh.prototype.Ca,Vh.prototype.getAsImageData=Vh.prototype.Da,Vh.prototype.hasWebGLTexture=Vh.prototype.R,Vh.prototype.hasImageBitmap=Vh.prototype.la,Vh.prototype.hasImageData=Vh.prototype.Fa;var Hh=250;function Kh(...t){return t.map(([t,e])=>({start:t,end:e}))}var Xh,Wh=Ha((Xh=Va,class extends Xh{get ga(){return this.i}qa(t,e,r){$a(this,e,e=>{var[n,i]=Ua(this,t,e);this.ga._addBoundTextureAsImageToStream(e,n,i,r)})}Z(t,e){Ga(this,t,e),$a(this,t,t=>{this.ga._attachImageListener(t)})}aa(t,e){ja(this,t,e),$a(this,t,t=>{this.ga._attachImageVectorListener(t)})}})),zh=class extends Wh{};async function Yh(t,e,r){return za(t,r.canvas??(Ma()?void 0:document.createElement("canvas")),e,r)}function qh(t,e,r,n){if(t.na&&void 0!==n&&Er(t.baseOptions,_o,3)?.g(),t.V){let s=new io;if(r?.regionOfInterest){if(!t.pa)throw Error("This task doesn't support region-of-interest.");var i=r.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");Or(s,1,(i.left+i.right)/2),Or(s,2,(i.top+i.bottom)/2),Or(s,4,i.right-i.left),Or(s,3,i.bottom-i.top)}else Or(s,1,.5),Or(s,2,.5),Or(s,4,1),Or(s,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(Or(s,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[t,n]=Pa(e);r=Fr(s,3)*n/t,i=Fr(s,4)*t/n,Or(s,4,r),Or(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.V,n)}t.g.qa(e,t.oa,n??performance.now()),t.finishProcessing(n)}function Jh(t,e,r){if(t.L)throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");qh(t,e,r,t.C+1)}function Zh(t,e,r,n){if(!t.L)throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");qh(t,e,r,n)}function Qh(t,e,r,n){var i=e.data,s=e.width,o=s*(e=e.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==o)throw Error("Unsupported channel count: "+i.length/o);return t=new Th([i],r,!1,t.g.i.canvas,t.U,s,e),n?t.clone():t}var tu=class extends eh{constructor(t,e,r,n){super(t),this.g=t,this.oa=e,this.V=r,this.pa=n,this.U=new lh,this.L=!1}l(t,e=!0){if("runningMode"in t){var r=this.L=!!t.runningMode&&"IMAGE"!==t.runningMode;er(this.baseOptions,2,null==r?r:Qt(r))}if(void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.U.close(),super.close()}};tu.prototype.close=tu.prototype.close;var eu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},br(t=this.h=new bo,0,1,e=new Eo),Or(this.h,2,.5),Or(this.h,3,.3)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"minDetectionConfidence"in t&&Or(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&Or(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}F(t,e){return this.j={detections:[]},Jh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect_in"),Bs(t,"detections");var e=new Rs;qn(e,So,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect_in"),Ns(r,"DETECTIONS:detections"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=Js(e),this.j.detections.push(ba(t));Ja(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};eu.prototype.detectForVideo=eu.prototype.G,eu.prototype.detect=eu.prototype.F,eu.prototype.setOptions=eu.prototype.u,eu.createFromModelPath=async function(t,e){return Yh(eu,t,{baseOptions:{modelAssetPath:e}})},eu.createFromModelBuffer=function(t,e){return Yh(eu,t,{baseOptions:{modelAssetBuffer:e}})},eu.createFromOptions=function(t,e){return Yh(eu,t,e)};var ru=Kh([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),nu=Kh([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),iu=Kh([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),su=Kh([474,475],[475,476],[476,477],[477,474]),ou=Kh([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),au=Kh([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),hu=Kh([469,470],[470,471],[471,472],[472,469]),uu=Kh([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),cu=[...ru,...nu,...iu,...ou,...au,...uu],lu=Kh([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function du(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var fu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,br(t=this.h=new Ro,0,1,e=new Eo),this.A=new xo,br(this.h,0,3,this.A),this.o=new bo,br(this.h,0,2,this.o),Nr(this.o,4,1),Or(this.o,2,.5),Or(this.A,2,.5),Or(this.h,4,.5)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"numFaces"in t&&Nr(this.o,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Or(this.o,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Or(this.A,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}F(t,e){return du(this),Jh(this,t,e),this.j}G(t,e,r){return du(this),Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"face_landmarks");var e=new Rs;qn(e,Io,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"NORM_LANDMARKS:face_landmarks"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("face_landmarks",(t,e)=>{for(let e of t)t=eo(e),this.j.faceLandmarks.push(ka(t));Ja(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{Ja(this,t)}),this.outputFaceBlendshapes&&(Bs(t,"blendshapes"),Ns(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(t,e)=>{if(this.outputFaceBlendshapes)for(let e of t)t=Ws(e),this.j.faceBlendshapes.push(wa(t.g()??[]));Ja(this,e)}),this.g.attachEmptyPacketListener("blendshapes",t=>{Ja(this,t)})),this.outputFacialTransformationMatrixes&&(Bs(t,"face_geometry"),Ns(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(t,e)=>{if(this.outputFacialTransformationMatrixes)for(let e of t)(t=Er(t=Lo(e),ro,2))&&this.j.facialTransformationMatrixes.push({rows:Rr(t,1)??0??0,columns:Rr(t,2)??0??0,data:sr(t,3,Zt,ir()).slice()??[]});Ja(this,e)}),this.g.attachEmptyPacketListener("face_geometry",t=>{Ja(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};fu.prototype.detectForVideo=fu.prototype.G,fu.prototype.detect=fu.prototype.F,fu.prototype.setOptions=fu.prototype.u,fu.createFromModelPath=function(t,e){return Yh(fu,t,{baseOptions:{modelAssetPath:e}})},fu.createFromModelBuffer=function(t,e){return Yh(fu,t,{baseOptions:{modelAssetBuffer:e}})},fu.createFromOptions=function(t,e){return Yh(fu,t,e)},fu.FACE_LANDMARKS_LIPS=ru,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LIPS",fu.FACE_LANDMARKS_LIPS),fu.FACE_LANDMARKS_LEFT_EYE=nu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYE",fu.FACE_LANDMARKS_LEFT_EYE),fu.FACE_LANDMARKS_LEFT_EYEBROW=iu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",fu.FACE_LANDMARKS_LEFT_EYEBROW),fu.FACE_LANDMARKS_LEFT_IRIS=su,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_IRIS",fu.FACE_LANDMARKS_LEFT_IRIS),fu.FACE_LANDMARKS_RIGHT_EYE=ou,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYE",fu.FACE_LANDMARKS_RIGHT_EYE),fu.FACE_LANDMARKS_RIGHT_EYEBROW=au,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",fu.FACE_LANDMARKS_RIGHT_EYEBROW),fu.FACE_LANDMARKS_RIGHT_IRIS=hu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_IRIS",fu.FACE_LANDMARKS_RIGHT_IRIS),fu.FACE_LANDMARKS_FACE_OVAL=uu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_FACE_OVAL",fu.FACE_LANDMARKS_FACE_OVAL),fu.FACE_LANDMARKS_CONTOURS=cu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_CONTOURS",fu.FACE_LANDMARKS_CONTOURS),fu.FACE_LANDMARKS_TESSELATION=lu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_TESSELATION",fu.FACE_LANDMARKS_TESSELATION);var pu=Kh([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function gu(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function mu(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function _u(t,e=!0){var r=[];for(let i of t){var n=Ws(i);t=[];for(let r of n.g())n=e&&null!=Rr(r,1)?Rr(r,1)??0:-1,t.push({score:Fr(r,2)??0,index:n,categoryName:de(Qe(r,3))??""??"",displayName:de(Qe(r,4))??""??""});r.push(t)}return r}var vu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],br(t=this.j=new $o,0,1,e=new Eo),this.o=new Po,br(this.j,0,2,this.o),this.D=new Do,br(this.o,0,3,this.D),this.A=new Mo,br(this.o,0,2,this.A),this.h=new Oo,br(this.j,0,3,this.h),Or(this.A,2,.5),Or(this.o,4,.5),Or(this.D,2,.5)}get baseOptions(){return Er(this.j,Eo,1)}set baseOptions(t){br(this.j,0,1,t)}u(t){if(Nr(this.A,3,t.numHands??1),"minHandDetectionConfidence"in t&&Or(this.A,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.o,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Or(this.D,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Co,r=e,n=Ea(t.cannedGesturesClassifierOptions,Er(this.h,Co,3)?.l());br(r,0,2,n),br(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&Er(this.h,Co,3)?.g();return t.customGesturesClassifierOptions?(br(r=e=new Co,0,2,n=Ea(t.customGesturesClassifierOptions,Er(this.h,Co,4)?.l())),br(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&Er(this.h,Co,4)?.g(),this.l(t)}Ja(t,e){return gu(this),Jh(this,t,e),mu(this)}Ka(t,e,r){return gu(this),Zh(this,t,r,e),mu(this)}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"hand_gestures"),Bs(t,"hand_landmarks"),Bs(t,"world_hand_landmarks"),Bs(t,"handedness");var e=new Rs;qn(e,Vo,this.j);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"HAND_GESTURES:hand_gestures"),Ns(r,"LANDMARKS:hand_landmarks"),Ns(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ns(r,"HANDEDNESS:handedness"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t){t=eo(e);let r=[];for(let e of wr(t,to,1))r.push({x:Fr(e,1)??0,y:Fr(e,2)??0,z:Fr(e,3)??0,visibility:Fr(e,4)??0});this.landmarks.push(r)}Ja(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t){t=Qs(e);let r=[];for(let e of wr(t,Zs,1))r.push({x:Fr(e,1)??0,y:Fr(e,2)??0,z:Fr(e,3)??0,visibility:Fr(e,4)??0});this.worldLandmarks.push(r)}Ja(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("hand_gestures",(t,e)=>{this.gestures.push(..._u(t,!1)),Ja(this,e)}),this.g.attachEmptyPacketListener("hand_gestures",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{this.handedness.push(..._u(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function yu(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}vu.prototype.recognizeForVideo=vu.prototype.Ka,vu.prototype.recognize=vu.prototype.Ja,vu.prototype.setOptions=vu.prototype.u,vu.createFromModelPath=function(t,e){return Yh(vu,t,{baseOptions:{modelAssetPath:e}})},vu.createFromModelBuffer=function(t,e){return Yh(vu,t,{baseOptions:{modelAssetBuffer:e}})},vu.createFromOptions=function(t,e){return Yh(vu,t,e)},vu.HAND_CONNECTIONS=pu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$gesture_recognizer$gesture_recognizer.GestureRecognizer.HAND_CONNECTIONS",vu.HAND_CONNECTIONS);var Eu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],br(t=this.h=new Po,0,1,e=new Eo),this.o=new Do,br(this.h,0,3,this.o),this.j=new Mo,br(this.h,0,2,this.j),Nr(this.j,3,1),Or(this.j,2,.5),Or(this.o,2,.5),Or(this.h,4,.5)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"numHands"in t&&Nr(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&Or(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Or(this.o,2,t.minHandPresenceConfidence??.5),this.l(t)}F(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Jh(this,t,e),yu(this)}G(t,e,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Zh(this,t,r,e),yu(this)}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"hand_landmarks"),Bs(t,"world_hand_landmarks"),Bs(t,"handedness");var e=new Rs;qn(e,Ho,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"LANDMARKS:hand_landmarks"),Ns(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ns(r,"HANDEDNESS:handedness"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t)t=eo(e),this.landmarks.push(ka(t));Ja(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t)t=Qs(e),this.worldLandmarks.push(Sa(t));Ja(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{var r=this.handedness,n=r.push,i=[];for(let e of t){t=Ws(e);let r=[];for(let e of t.g())r.push({score:Fr(e,2)??0,index:Rr(e,1)??0??-1,categoryName:de(Qe(e,3))??""??"",displayName:de(Qe(e,4))??""??""});i.push(r)}n.call(r,...i),Ja(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Eu.prototype.detectForVideo=Eu.prototype.G,Eu.prototype.detect=Eu.prototype.F,Eu.prototype.setOptions=Eu.prototype.u,Eu.createFromModelPath=function(t,e){return Yh(Eu,t,{baseOptions:{modelAssetPath:e}})},Eu.createFromModelBuffer=function(t,e){return Yh(Eu,t,{baseOptions:{modelAssetBuffer:e}})},Eu.createFromOptions=function(t,e){return Yh(Eu,t,e)},Eu.HAND_CONNECTIONS=pu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$hand_landmarker$hand_landmarker.HandLandmarker.HAND_CONNECTIONS",Eu.HAND_CONNECTIONS);var Au=Kh([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function wu(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Tu(t){try{if(!t.D)return t.h;t.D(t.h)}finally{th(t)}}function bu(t,e){t=eo(t),e.push(ka(t))}var ku=class extends tu{constructor(t,e){super(new zh(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,br(t=this.j=new zo,0,1,e=new Eo),this.N=new Do,br(this.j,0,2,this.N),this.X=new Ko,br(this.j,0,3,this.X),this.o=new bo,br(this.j,0,4,this.o),this.I=new xo,br(this.j,0,5,this.I),this.A=new Xo,br(this.j,0,6,this.A),this.O=new Wo,br(this.j,0,7,this.O),Or(this.o,2,.5),Or(this.o,3,.3),Or(this.I,2,.5),Or(this.A,2,.5),Or(this.A,3,.3),Or(this.O,2,.5),Or(this.N,2,.5)}get baseOptions(){return Er(this.j,Eo,1)}set baseOptions(t){br(this.j,0,1,t)}u(t){return"minFaceDetectionConfidence"in t&&Or(this.o,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&Or(this.o,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&Or(this.I,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&Or(this.A,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&Or(this.A,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&Or(this.O,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&Or(this.N,2,t.minHandLandmarksConfidence??.5),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.D="function"==typeof e?e:r,wu(this),Jh(this,t,n),Tu(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.D="function"==typeof r?r:n,wu(this),Zh(this,t,i,e),Tu(this)}m(){var t=new Gs;Us(t,"input_frames_image"),Bs(t,"pose_landmarks"),Bs(t,"pose_world_landmarks"),Bs(t,"face_landmarks"),Bs(t,"left_hand_landmarks"),Bs(t,"left_hand_world_landmarks"),Bs(t,"right_hand_landmarks"),Bs(t,"right_hand_world_landmarks");var e=new Rs,r=new fs;Dr(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(t,e){if(null!=e)if(Array.isArray(e))er(t,2,Me(e,0,Pe));else{if(!("string"==typeof e||e instanceof O||R(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");dr(t,2,lt(e,!1),I())}}(r,this.j.g());var n=new Os;Dr(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),xr(n,8,fs,r),Cs(n,"IMAGE:input_frames_image"),Ns(n,"POSE_LANDMARKS:pose_landmarks"),Ns(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Ns(n,"FACE_LANDMARKS:face_landmarks"),Ns(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Ns(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Ns(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Ns(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.u(e),$s(t,n),Za(this,t),this.g.attachProtoListener("pose_landmarks",(t,e)=>{bu(t,this.h.poseLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("pose_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("pose_world_landmarks",(t,e)=>{var r=this.h.poseWorldLandmarks;t=Qs(t),r.push(Sa(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("pose_world_landmarks",t=>{Ja(this,t)}),this.outputPoseSegmentationMasks&&(Ns(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Qa(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(t,e)=>{this.h.poseSegmentationMasks=[Qh(this,t,!0,!this.D)],Ja(this,e)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",t=>{this.h.poseSegmentationMasks=[],Ja(this,t)})),this.g.attachProtoListener("face_landmarks",(t,e)=>{bu(t,this.h.faceLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{Ja(this,t)}),this.outputFaceBlendshapes&&(Bs(t,"extra_blendshapes"),Ns(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(t,e)=>{var r=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=Ws(t),r.push(wa(t.g()??[]))),Ja(this,e)}),this.g.attachEmptyPacketListener("extra_blendshapes",t=>{Ja(this,t)})),this.g.attachProtoListener("left_hand_landmarks",(t,e)=>{bu(t,this.h.leftHandLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("left_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("left_hand_world_landmarks",(t,e)=>{var r=this.h.leftHandWorldLandmarks;t=Qs(t),r.push(Sa(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("right_hand_landmarks",(t,e)=>{bu(t,this.h.rightHandLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("right_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("right_hand_world_landmarks",(t,e)=>{var r=this.h.rightHandWorldLandmarks;t=Qs(t),r.push(Sa(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ku.prototype.detectForVideo=ku.prototype.G,ku.prototype.detect=ku.prototype.F,ku.prototype.setOptions=ku.prototype.u,ku.createFromModelPath=function(t,e){return Yh(ku,t,{baseOptions:{modelAssetPath:e}})},ku.createFromModelBuffer=function(t,e){return Yh(ku,t,{baseOptions:{modelAssetBuffer:e}})},ku.createFromOptions=function(t,e){return Yh(ku,t,e)},ku.HAND_CONNECTIONS=pu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.HAND_CONNECTIONS",ku.HAND_CONNECTIONS),ku.POSE_CONNECTIONS=Au,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.POSE_CONNECTIONS",ku.POSE_CONNECTIONS),ku.FACE_LANDMARKS_LIPS=ru,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LIPS",ku.FACE_LANDMARKS_LIPS),ku.FACE_LANDMARKS_LEFT_EYE=nu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYE",ku.FACE_LANDMARKS_LEFT_EYE),ku.FACE_LANDMARKS_LEFT_EYEBROW=iu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",ku.FACE_LANDMARKS_LEFT_EYEBROW),ku.FACE_LANDMARKS_LEFT_IRIS=su,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_IRIS",ku.FACE_LANDMARKS_LEFT_IRIS),ku.FACE_LANDMARKS_RIGHT_EYE=ou,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYE",ku.FACE_LANDMARKS_RIGHT_EYE),ku.FACE_LANDMARKS_RIGHT_EYEBROW=au,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",ku.FACE_LANDMARKS_RIGHT_EYEBROW),ku.FACE_LANDMARKS_RIGHT_IRIS=hu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_IRIS",ku.FACE_LANDMARKS_RIGHT_IRIS),ku.FACE_LANDMARKS_FACE_OVAL=uu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_FACE_OVAL",ku.FACE_LANDMARKS_FACE_OVAL),ku.FACE_LANDMARKS_CONTOURS=cu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_CONTOURS",ku.FACE_LANDMARKS_CONTOURS),ku.FACE_LANDMARKS_TESSELATION=lu,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_TESSELATION",ku.FACE_LANDMARKS_TESSELATION);var Su=class extends tu{constructor(t,e){super(new zh(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},br(t=this.h=new Jo,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return br(this.h,0,2,Ea(t,Er(this.h,fo,2))),this.l(t)}ta(t,e){return this.j={classifications:[]},Jh(this,t,e),this.j}ua(t,e,r){return this.j={classifications:[]},Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"input_image"),Us(t,"norm_rect"),Bs(t,"classifications");var e=new Rs;qn(e,Zo,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Cs(r,"IMAGE:input_image"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"CLASSIFICATIONS:classifications"),r.u(e),$s(t,r),this.g.attachProtoListener("classifications",(t,e)=>{this.j=Ta(oo(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("classifications",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Su.prototype.classifyForVideo=Su.prototype.ua,Su.prototype.classify=Su.prototype.ta,Su.prototype.setOptions=Su.prototype.u,Su.createFromModelPath=function(t,e){return Yh(Su,t,{baseOptions:{modelAssetPath:e}})},Su.createFromModelBuffer=function(t,e){return Yh(Su,t,{baseOptions:{modelAssetBuffer:e}})},Su.createFromOptions=function(t,e){return Yh(Su,t,e)};var Lu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!0),this.h=new Qo,this.embeddings={embeddings:[]},br(t=this.h,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){var e=this.h,r=Er(this.h,go,2);if(r=r?r.clone():new go,void 0!==t.l2Normalize){var n=t.l2Normalize;er(r,1,null==n?n:Qt(n))}else"l2Normalize"in t&&er(r,1);return void 0!==t.quantize?er(r,2,null==(n=t.quantize)?n:Qt(n)):"quantize"in t&&er(r,2),br(e,0,2,r),this.l(t)}Aa(t,e){return Jh(this,t,e),this.embeddings}Ba(t,e,r){return Zh(this,t,r,e),this.embeddings}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"embeddings_out");var e=new Rs;qn(e,ta,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"EMBEDDINGS:embeddings_out"),r.u(e),$s(t,r),this.g.attachProtoListener("embeddings_out",(t,e)=>{t=lo(t),this.embeddings=function(t){return{embeddings:wr(t,uo,1).map(t=>{var e={headIndex:Rr(t,3)??0??-1,headName:de(Qe(t,4))??""??""};if(nr(t,ao,1,co))t=sr(t=Ir(t,ao,1),1,Zt,ir()),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=Ir(t,ho,2)?.g()?.h()??r}return e}),timestampMs:Aa(Qe(t,2,void 0,ue)??Je)}}(t),Ja(this,e)}),this.g.attachEmptyPacketListener("embeddings_out",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Lu.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=xa(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=xa(La(t.quantizedEmbedding),La(e.quantizedEmbedding))}return t},Lu.prototype.embedForVideo=Lu.prototype.Ba,Lu.prototype.embed=Lu.prototype.Aa,Lu.prototype.setOptions=Lu.prototype.u,Lu.createFromModelPath=function(t,e){return Yh(Lu,t,{baseOptions:{modelAssetPath:e}})},Lu.createFromModelBuffer=function(t,e){return Yh(Lu,t,{baseOptions:{modelAssetBuffer:e}})},Lu.createFromOptions=function(t,e){return Yh(Lu,t,e)};var xu=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};function Ru(t){var e=function(t){return wr(t,Os,1)}(t.ca()).filter(t=>(de(Qe(t,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(t.o=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(Er(e[0],Rs,7)?.j()?.g()??new Map).forEach((e,r)=>{t.o[Number(r)]=de(Qe(e,1))??""})}function Fu(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Iu(t){try{let e=new xu(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{th(t)}}xu.prototype.close=xu.prototype.close;var Cu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.o=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new sa,this.A=new ea,br(this.h,0,3,this.A),br(t=this.h,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?er(this.h,2,le(t.displayNamesLocale)):"displayNamesLocale"in t&&er(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}M(){Ru(this)}segment(t,e,r){var n="function"!=typeof e?e:{};return this.j="function"==typeof e?e:r,Fu(this),Jh(this,t,n),Iu(this)}Na(t,e,r,n){var i="function"!=typeof r?r:{};return this.j="function"==typeof r?r:n,Fu(this),Zh(this,t,i,e),Iu(this)}Ea(){return this.o}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect");var e=new Rs;qn(e,oa,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),r.u(e),$s(t,r),Za(this,t),this.outputConfidenceMasks&&(Bs(t,"confidence_masks"),Ns(r,"CONFIDENCE_MASKS:confidence_masks"),Qa(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>Qh(this,t,!0,!this.j)),Ja(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],Ja(this,t)})),this.outputCategoryMask&&(Bs(t,"category_mask"),Ns(r,"CATEGORY_MASK:category_mask"),Qa(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=Qh(this,t,!1,!this.j),Ja(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,Ja(this,t)})),Bs(t,"quality_scores"),Ns(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,Ja(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Cu.prototype.getLabels=Cu.prototype.Ea,Cu.prototype.segmentForVideo=Cu.prototype.Na,Cu.prototype.segment=Cu.prototype.segment,Cu.prototype.setOptions=Cu.prototype.u,Cu.createFromModelPath=function(t,e){return Yh(Cu,t,{baseOptions:{modelAssetPath:e}})},Cu.createFromModelBuffer=function(t,e){return Yh(Cu,t,{baseOptions:{modelAssetBuffer:e}})},Cu.createFromOptions=function(t,e){return Yh(Cu,t,e)};var Nu={0:0,1:1,2:2,3:3};function Ou(){return Ma()?void 0:document.createElement("canvas")}var Mu=class extends eh{constructor(t,e){super(new Xa(t,e)),this.o=new lh,this.delegate="CPU",this.h=0,this.baseOptions=new Eo,this.j=0}get i(){return this.g.i}u(t){return this.delegate=t.baseOptions?.delegate??"CPU",super.l(t)}Oa(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e;if(0!==this.j&&(this.i._free(this.j),this.j=0),!(e="undefined"!=typeof ImageData&&t instanceof ImageData))if("object"!=typeof t||null===t)e=!1;else{e=t.data;var r=t.width,n=t.height;e=Number.isInteger(r)&&r>0&&Number.isInteger(n)&&n>0&&(e instanceof Uint8ClampedArray||e instanceof Uint8Array)}if(e)e=t.width,r=t.height,t=t.data;else{if([e,r]=Pa(t),"undefined"!=typeof OffscreenCanvas)n=new OffscreenCanvas(e,r);else{if("undefined"==typeof document)throw Error("Canvas is not supported in this environment.");n=document.createElement("canvas")}if(n.width=e,n.height=r,!(n=n.getContext("2d")))throw Error("Canvas 2D context is not supported in this environment.");n.drawImage(t,0,0),t=n.getImageData(0,0,e,r).data}if(!t)throw Error("Unsupported image source or failed to extract image pixels.");n=function({Ia:t,width:e,height:r}){if(e<=0||r<=0)throw Error(`Invalid image dimensions: ${e}x${r}. Dimensions must be positive.`);if(t%(e*r)!==0)throw Error(`Invalid image dimensions or pixel data length. Pixel data length ${t} is not a multiple of the number of pixels (${e*r}).`);if(4!==(t/=e*r)&&3!==t&&1!==t)throw Error(`Invalid image dimensions or pixel data length. Calculated channels: ${t}. Expected 1, 3, or 4.`);return t}({Ia:t.length,width:e,height:r});var i=this.i._malloc(t.length);if(this.i.HEAPU8.set(t,i),this.j=i,!this.i._interactive_segmenter_set_image(this.h,i,e,r,n))throw Error("Failed to set image on native engine.")}segment(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e=function(t){t=t.map(({isCompleted:t,brushMode:e,point:r})=>{e=Nu[e]??0,r=r.map(({x:t,y:e})=>{var r=new aa;return Mr(r,1,t),Mr(r,2,e),r});var n=new ha;if(Cr(n,t),null==e)t=e;else{if(!zt(e))throw $("enum");t=0|e}return dr(n,1,t,0),Sr(n,2,r),n});var e=new ua;return Sr(e,1,t),ca(e)}(t);t=this.i._malloc(e.length),this.i.HEAPU8.set(e,t);var r=this.i._malloc(12),n=r+4,i=r+8,s=0;try{if(0===(s=this.i._interactive_segmenter_segment(this.h,t,e.length,r,n,i)))throw Error("Segmentation failed.");let h=this.i.HEAPU32[r/4],u=this.i.HEAPU32[n/4];var o=new Float32Array(this.i.HEAPU8.buffer,s,this.i.HEAPU32[i/4]/4),a=new Float32Array(o);if(o=h*u,(a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==o)throw Error("Unsupported channel count: "+a.length/o);return new Th([a],!0,!1,this.g.i.canvas??void 0,this.o,h,u)}finally{0!==t&&this.i._free(t),0!==r&&this.i._free(r),0!==s&&this.i._free(s)}}m(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0);var t=new _o;if("GPU"===this.delegate){var e=new As;kr(t,2,vo,e)}else Nr(e=new Ls,1,4),kr(t,1,vo,e);if(br(this.baseOptions,0,3,t),t=To(this.baseOptions),e=this.i._malloc(t.length),this.i.HEAPU8.set(t,e),this.h=this.i._interactive_segmenter_create(e,t.length),this.i._free(e),0===this.h)throw Error("Failed to create native InteractiveSegmenter engine.")}close(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0),this.o.close(),super.close()}};Mu.prototype.close=Mu.prototype.close,Mu.prototype.segment=Mu.prototype.segment,Mu.prototype.setImage=Mu.prototype.Oa,Mu.prototype.setOptions=Mu.prototype.u,Mu.createFromModelPath=function(t,e){return za(Mu,Ou(),t,{baseOptions:{modelAssetPath:e}})},Mu.createFromModelBuffer=function(t,e){return za(Mu,Ou(),t,{baseOptions:{modelAssetBuffer:e}})},Mu.createFromOptions=function(t,e){var r=e.canvas??Ou();return za(Mu,r,t,e)};var Du=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};Du.prototype.close=Du.prototype.close;var Pu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new sa,this.o=new ea,br(this.h,0,3,this.o),br(t=this.h,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,r,n){var i="function"!=typeof r?r:{};if(this.j="function"==typeof r?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new pa,e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var s=new la;Cr(s,!0),Mr(s,1,e.keypoint.x),Mr(s,2,e.keypoint.y),kr(n,1,ga,s)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");{let t=new fa;for(s of e.scribble)Cr(e=new la,!0),Mr(e,1,s.x),Mr(e,2,s.y),xr(t,1,la,e);kr(n,2,ga,t)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter_legacy.proto.RegionOfInterest","roi_in",r),Jh(this,t,i);t:{try{let t=new Du(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=t;break t}this.j(t)}finally{th(this)}o=void 0}return o}m(){var t=new Gs;Us(t,"image_in"),Us(t,"roi_in"),Us(t,"norm_rect_in");var e=new Rs;qn(e,oa,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.interactive_segmenter_legacy.InteractiveSegmenterGraphV2"),Cs(r,"IMAGE:image_in"),Cs(r,"ROI:roi_in"),Cs(r,"NORM_RECT:norm_rect_in"),r.u(e),$s(t,r),Za(this,t),this.outputConfidenceMasks&&(Bs(t,"confidence_masks"),Ns(r,"CONFIDENCE_MASKS:confidence_masks"),Qa(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>Qh(this,t,!0,!this.j)),Ja(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],Ja(this,t)})),this.outputCategoryMask&&(Bs(t,"category_mask"),Ns(r,"CATEGORY_MASK:category_mask"),Qa(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=Qh(this,t,!1,!this.j),Ja(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,Ja(this,t)})),Bs(t,"quality_scores"),Ns(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,Ja(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Pu.prototype.segment=Pu.prototype.segment,Pu.prototype.setOptions=Pu.prototype.u,Pu.createFromModelPath=function(t,e){return Yh(Pu,t,{baseOptions:{modelAssetPath:e}})},Pu.createFromModelBuffer=function(t,e){return Yh(Pu,t,{baseOptions:{modelAssetBuffer:e}})},Pu.createFromOptions=function(t,e){return Yh(Pu,t,e)};var $u=class extends tu{constructor(t,e){super(new zh(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},br(t=this.h=new ma,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?er(this.h,2,le(t.displayNamesLocale)):"displayNamesLocale"in t&&er(this.h,2),void 0!==t.maxResults?Nr(this.h,3,t.maxResults):"maxResults"in t&&er(this.h,3),void 0!==t.scoreThreshold?Or(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&er(this.h,4),void 0!==t.categoryAllowlist?Pr(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&er(this.h,5),void 0!==t.categoryDenylist?Pr(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&er(this.h,6),this.l(t)}F(t,e){return this.j={detections:[]},Jh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"input_frame_gpu"),Us(t,"norm_rect"),Bs(t,"detections");var e=new Rs;qn(e,_a,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),Cs(r,"IMAGE:input_frame_gpu"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"DETECTIONS:detections"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=Js(e),this.j.detections.push(ba(t));Ja(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$u.prototype.detectForVideo=$u.prototype.G,$u.prototype.detect=$u.prototype.F,$u.prototype.setOptions=$u.prototype.u,$u.createFromModelPath=async function(t,e){return Yh($u,t,{baseOptions:{modelAssetPath:e}})},$u.createFromModelBuffer=function(t,e){return Yh($u,t,{baseOptions:{modelAssetBuffer:e}})},$u.createFromOptions=function(t,e){return Yh($u,t,e)};var Uu=class{constructor(t,e,r){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=r}close(){this.segmentationMasks?.forEach(t=>{t.close()})}};function Bu(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Gu(t){try{let e=new Uu(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.o)return e;t.o(e)}finally{th(t)}}Uu.prototype.close=Uu.prototype.close;var ju=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,br(t=this.h=new va,0,1,e=new Eo),this.A=new Wo,br(this.h,0,3,this.A),this.j=new Xo,br(this.h,0,2,this.j),Nr(this.j,4,1),Or(this.j,2,.5),Or(this.A,2,.5),Or(this.h,4,.5)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"numPoses"in t&&Nr(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Or(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Or(this.A,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.o="function"==typeof e?e:r,Bu(this),Jh(this,t,n),Gu(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.o="function"==typeof r?r:n,Bu(this),Zh(this,t,i,e),Gu(this)}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"normalized_landmarks"),Bs(t,"world_landmarks"),Bs(t,"segmentation_masks");var e=new Rs;qn(e,ya,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"NORM_LANDMARKS:normalized_landmarks"),Ns(r,"WORLD_LANDMARKS:world_landmarks"),r.u(e),$s(t,r),Za(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(t,e)=>{this.landmarks=[];for(let e of t)t=eo(e),this.landmarks.push(ka(t));Ja(this,e)}),this.g.attachEmptyPacketListener("normalized_landmarks",t=>{this.landmarks=[],Ja(this,t)}),this.g.attachProtoVectorListener("world_landmarks",(t,e)=>{this.worldLandmarks=[];for(let e of t)t=Qs(e),this.worldLandmarks.push(Sa(t));Ja(this,e)}),this.g.attachEmptyPacketListener("world_landmarks",t=>{this.worldLandmarks=[],Ja(this,t)}),this.outputSegmentationMasks&&(Ns(r,"SEGMENTATION_MASK:segmentation_masks"),Qa(this,"segmentation_masks"),this.g.aa("segmentation_masks",(t,e)=>{this.segmentationMasks=t.map(t=>Qh(this,t,!0,!this.o)),Ja(this,e)}),this.g.attachEmptyPacketListener("segmentation_masks",t=>{this.segmentationMasks=[],Ja(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};return ju.prototype.detectForVideo=ju.prototype.G,ju.prototype.detect=ju.prototype.F,ju.prototype.setOptions=ju.prototype.u,ju.createFromModelPath=function(t,e){return Yh(ju,t,{baseOptions:{modelAssetPath:e}})},ju.createFromModelBuffer=function(t,e){return Yh(ju,t,{baseOptions:{modelAssetBuffer:e}})},ju.createFromOptions=function(t,e){return Yh(ju,t,e)},ju.POSE_CONNECTIONS=Au,n("module$exports$google3$third_party$mediapipe$tasks$web$vision$pose_landmarker$pose_landmarker.PoseLandmarker.POSE_CONNECTIONS",ju.POSE_CONNECTIONS),t.DrawingUtils=Oh,t.FaceDetector=eu,t.FaceLandmarker=fu,t.FilesetResolver=Na,t.GestureRecognizer=vu,t.HandLandmarker=Eu,t.HolisticLandmarker=ku,t.ImageClassifier=Su,t.ImageEmbedder=Lu,t.ImageSegmenter=Cu,t.ImageSegmenterResult=xu,t.InteractiveSegmenter=Mu,t.InteractiveSegmenterLegacy=Pu,t.InteractiveSegmenterLegacyResult=Du,t.MPImage=Vh,t.MPMask=Th,t.ObjectDetector=$u,t.PoseLandmarker=ju,t.TaskRunner=eh,t.VisionTaskRunner=tu,t}({});
|
|
2
2
|
//# sourceMappingURL=vision_bundle_iife.js.map
|