@viji-dev/core 0.8.10 → 0.8.11
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/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global-p5.d.ts +1 -1
- package/dist/artist-global.d.ts +1 -1
- package/dist/assets/{viji.worker-BPZz310Z.js → viji.worker-CtPXL0fz.js} +547 -493
- package/dist/docs-api.js +2 -2
- package/dist/{essentia-wasm.web-C4eP4VfK.js → essentia-wasm.web-BGfjWBMO.js} +2 -2
- package/dist/{index-zNlv_Ytu.js → index-BH2kB2OG.js} +8 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -807,7 +807,7 @@ class Lc {
|
|
|
807
807
|
this.mouseState.x = 0, this.mouseState.y = 0, this.mouseState.isInCanvas = !1, this.mouseState.isPressed = !1, this.mouseState.leftButton = !1, this.mouseState.rightButton = !1, this.mouseState.middleButton = !1, this.mouseState.deltaX = 0, this.mouseState.deltaY = 0, this.mouseState.wheelDelta = 0, this.mouseState.wheelX = 0, this.mouseState.wheelY = 0, this.mouseState.wasPressed = !1, this.mouseState.wasReleased = !1, this.mouseState.wasMoved = !1, this.keyboardState.activeKeys.clear(), this.keyboardState.pressedThisFrame.clear(), this.keyboardState.releasedThisFrame.clear(), this.keyboardState.lastKeyPressed = "", this.keyboardState.lastKeyReleased = "", this.keyboardState.shift = !1, this.keyboardState.ctrl = !1, this.keyboardState.alt = !1, this.keyboardState.meta = !1, this.keyboardTextureData.fill(0), this.touchState.points = [], this.touchState.count = 0, this.touchState.started = [], this.touchState.moved = [], this.touchState.ended = [], this.touchState.primary = null, this.previousTouchPositions.clear(), this.pointerState.x = 0, this.pointerState.y = 0, this.pointerState.deltaX = 0, this.pointerState.deltaY = 0, this.pointerState.isDown = !1, this.pointerState.wasPressed = !1, this.pointerState.wasReleased = !1, this.pointerState.isInCanvas = !1, this.pointerState.type = "none", this.previousPointerDown = !1;
|
|
808
808
|
}
|
|
809
809
|
}
|
|
810
|
-
var
|
|
810
|
+
var Pc = `/**\r
|
|
811
811
|
* MediaPipe Tasks Vision Classic Worker\r
|
|
812
812
|
* \r
|
|
813
813
|
* Classic worker for MediaPipe Tasks Vision processing.\r
|
|
@@ -826,6 +826,39 @@ function log(...args) {\r
|
|
|
826
826
|
// Asset config received from CVSystem via init message\r
|
|
827
827
|
let assetConfig = { wasmUrls: null };\r
|
|
828
828
|
\r
|
|
829
|
+
// ---------------------------------------------------------------------------\r
|
|
830
|
+
// WASM binary fetch shim.\r
|
|
831
|
+
//\r
|
|
832
|
+
// MediaPipe's Emscripten loader fetch()-es its wasm binary from the URL passed\r
|
|
833
|
+
// as \`wasmBinaryPath\`. The engine runs at an opaque origin, and WebKit (iOS\r
|
|
834
|
+
// Safari) refuses \`fetch()\` of an opaque \`blob:null/…\` URL with an\r
|
|
835
|
+
// access-control error — which breaks all CV on iOS. (Only Fetch-API loads are\r
|
|
836
|
+
// refused; \`importScripts\` and \`new Worker\` of the same blob URLs are not, so\r
|
|
837
|
+
// the loader JS can still be a blob URL.)\r
|
|
838
|
+
//\r
|
|
839
|
+
// Fix: CVSystem hands MediaPipe sentinel URLs as \`wasmBinaryPath\` and ships the\r
|
|
840
|
+
// binary bytes alongside. We register url -> bytes here and serve them from\r
|
|
841
|
+
// memory, so no opaque blob fetch ever happens. Every binary-load path in the\r
|
|
842
|
+
// Emscripten loader (instantiateStreaming AND the readAsync arrayBuffer\r
|
|
843
|
+
// fallback) funnels through self.fetch, so this single override covers them\r
|
|
844
|
+
// all. Non-matching URLs (e.g. the model .tflite from the CDN) pass through\r
|
|
845
|
+
// untouched. Runs identically on Chromium — one code path, no per-browser\r
|
|
846
|
+
// branch.\r
|
|
847
|
+
const wasmBinaryBytes = new Map();\r
|
|
848
|
+
const nativeFetch = self.fetch.bind(self);\r
|
|
849
|
+
self.fetch = (input, init) => {\r
|
|
850
|
+
const url = typeof input === 'string' ? input : (input && input.url);\r
|
|
851
|
+
const bytes = url != null ? wasmBinaryBytes.get(url) : undefined;\r
|
|
852
|
+
if (bytes !== undefined) {\r
|
|
853
|
+
// Fresh Response per call: a body is single-use and the loader may retry\r
|
|
854
|
+
// (streaming compile -> arrayBuffer fallback).\r
|
|
855
|
+
return Promise.resolve(new Response(bytes, {\r
|
|
856
|
+
headers: { 'Content-Type': 'application/wasm' }\r
|
|
857
|
+
}));\r
|
|
858
|
+
}\r
|
|
859
|
+
return nativeFetch(input, init);\r
|
|
860
|
+
};\r
|
|
861
|
+
\r
|
|
829
862
|
// Define CommonJS environment for MediaPipe bundle\r
|
|
830
863
|
self.exports = {};\r
|
|
831
864
|
self.module = { exports: {} };\r
|
|
@@ -1128,6 +1161,10 @@ async function initializeVision() {\r
|
|
|
1128
1161
|
const wasmFileset = simd\r
|
|
1129
1162
|
? { wasmLoaderPath: assetConfig.wasmUrls.simdLoaderJs, wasmBinaryPath: assetConfig.wasmUrls.simdBinary }\r
|
|
1130
1163
|
: { wasmLoaderPath: assetConfig.wasmUrls.nosimdLoaderJs, wasmBinaryPath: assetConfig.wasmUrls.nosimdBinary };\r
|
|
1164
|
+
\r
|
|
1165
|
+
// Free the unused variant's bytes; only the selected one may be re-fetched\r
|
|
1166
|
+
// as additional MediaPipe task graphs are created over the session.\r
|
|
1167
|
+
wasmBinaryBytes.delete(simd ? assetConfig.wasmUrls.nosimdBinary : assetConfig.wasmUrls.simdBinary);\r
|
|
1131
1168
|
\r
|
|
1132
1169
|
log('Using WASM fileset:', wasmFileset);\r
|
|
1133
1170
|
\r
|
|
@@ -1707,10 +1744,16 @@ self.onmessage = async (event) => {\r
|
|
|
1707
1744
|
\r
|
|
1708
1745
|
const visionCode = message.visionBundleCode;\r
|
|
1709
1746
|
assetConfig.wasmUrls = message.wasmUrls || null;\r
|
|
1747
|
+
const wasmBinaries = message.wasmBinaries || null;\r
|
|
1710
1748
|
\r
|
|
1711
|
-
if (!visionCode || !assetConfig.wasmUrls) {\r
|
|
1712
|
-
throw new Error('init message must include visionBundleCode and
|
|
1749
|
+
if (!visionCode || !assetConfig.wasmUrls || !wasmBinaries) {\r
|
|
1750
|
+
throw new Error('init message must include visionBundleCode, wasmUrls and wasmBinaries');\r
|
|
1713
1751
|
}\r
|
|
1752
|
+
\r
|
|
1753
|
+
// Register the binary bytes against the sentinel URLs we hand MediaPipe\r
|
|
1754
|
+
// as wasmBinaryPath; the fetch shim serves them from memory.\r
|
|
1755
|
+
wasmBinaryBytes.set(assetConfig.wasmUrls.simdBinary, wasmBinaries.simdBinary);\r
|
|
1756
|
+
wasmBinaryBytes.set(assetConfig.wasmUrls.nosimdBinary, wasmBinaries.nosimdBinary);\r
|
|
1714
1757
|
\r
|
|
1715
1758
|
log('WASM URLs received:', Object.keys(assetConfig.wasmUrls));\r
|
|
1716
1759
|
\r
|
|
@@ -1835,7 +1878,7 @@ self.onmessage = async (event) => {\r
|
|
|
1835
1878
|
};\r
|
|
1836
1879
|
\r
|
|
1837
1880
|
log('CV Tasks Worker loaded — waiting for init message with inlined code and WASM URLs');\r
|
|
1838
|
-
`, Pc = '"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){e=e.split(".");var r,i=t;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===n?i=i[r]&&i[r]!==Object.prototype[r]?i[r]:i[r]={}:i[r]=n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,s;const o="undefined"!=typeof TextDecoder;let a;const c="undefined"!=typeof TextEncoder;function h(t){if(c)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){const s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var u,l;t:{for(var f=["CLOSURE_FLAGS"],d=t,p=0;p<f.length;p++)if(null==(d=d[f[p]])){l=null;break t}l=d}var g,m=l&&l[610401301];u=null!=m&&m;const y=t.navigator;function _(t){return!!u&&(!!g&&g.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function v(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function E(){return!!u&&(!!g&&g.brands.length>0)}function w(){return E()?_("Chromium"):(v("Chrome")||v("CriOS"))&&!(!E()&&v("Edge"))||v("Silk")}function T(t){return T[" "](t),t}g=y&&y.userAgentData||null,T[" "]=function(){};var b=!E()&&(v("Trident")||v("MSIE"));!v("Android")||w(),w(),v("Safari")&&(w()||!E()&&v("Coast")||!E()&&v("Opera")||!E()&&v("Edge")||(E()?_("Microsoft Edge"):v("Edg/"))||E()&&_("Opera"));var A={},k=null;function x(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let i=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=k[e];if(null!=n)return n;if(!/^[\\s\\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}S();let r=0;for(;;){const t=n(-1),r=n(0),i=n(64),s=n(64);if(64===s&&-1===t)break;e(t<<2|r>>4),64!=i&&(e(r<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function S(){if(!k){k={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));A[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===k[e]&&(k[e]=t)}}}}var L="undefined"!=typeof Uint8Array,R=!b&&"function"==typeof btoa;function F(t){if(!R){var e;void 0===e&&(e=0),S(),e=A[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let c=0,h=0;for(;c<t.length-2;c+=3){var i=t[c],s=t[c+1],o=t[c+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[h++]=a+i+s+o}switch(a=0,o=r,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||r;case 1:t=t[c],n[h]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const I=/[-_.]/g,M={"-":"+",_:"/",".":"="};function P(t){return M[t]||""}function O(t){if(!R)return x(t);I.test(t)&&(t=t.replace(I,P)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function C(t){return L&&null!=t&&t instanceof Uint8Array}var U={};function N(){return G||=new B(null,U)}function D(t){V(U);var e=t.g;return null==(e=null==e||C(e)?e:"string"==typeof e?O(e):null)?e:t.g=e}var B=class{h(){return new Uint8Array(D(this)||0)}constructor(t,e){if(V(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let G,j;function V(t){if(t!==U)throw Error("illegal external caller")}function X(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function H(){const e=Error();X(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function W(t){return X(t=Error(t),"warning"),t}function z(){return"function"==typeof BigInt}function K(t){return Array.prototype.slice.call(t)}var Y="function"==typeof Symbol&&"symbol"==typeof Symbol();function $(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var q=$(),J=$("0di"),Z=$("2ex"),Q=$("1oa"),tt=Y?(t,e)=>{t[q]|=e}:(t,e)=>{void 0!==t.G?t.G|=e:Object.defineProperties(t,{G:{value:e,configurable:!0,writable:!0,enumerable:!1}})},et=Y?(t,e)=>{t[q]&=~e}:(t,e)=>{void 0!==t.G&&(t.G&=~e)},nt=Y?t=>0|t[q]:t=>0|t.G,rt=Y?t=>t[q]:t=>t.G,it=Y?(t,e)=>{t[q]=e}:(t,e)=>{void 0!==t.G?t.G=e:Object.defineProperties(t,{G:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function st(t){return tt(t,34),t}function ot(t,e){it(e,-30975&(0|t))}function at(t,e){it(e,-30941&(34|t))}var ct,ht={},ut={};function lt(t){return!(!t||"object"!=typeof t||t.Ia!==ut)}function ft(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function dt(t,e){if(null!=t)if("string"==typeof t)t=t?new B(t,U):N();else if(t.constructor!==B)if(C(t))t=t.length?new B(new Uint8Array(t),U):N();else{if(!e)throw Error();t=void 0}return t}function pt(t){return!(!Array.isArray(t)||t.length)&&!!(1&nt(t))}const gt=[];function mt(t){if(2&t)throw Error()}it(gt,55),ct=Object.freeze(gt);class yt{constructor(t,e,n){this.l=0,this.g=t,this.h=e,this.m=n}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new yt(this.g,this.h,this.m)}}let _t;function vt(t,e){(e=_t?e[_t]:void 0)&&(t[_t]=K(e))}var Et=Object.freeze({});function wt(t){return t.Pa=!0,t}var Tt=wt((t=>"number"==typeof t)),bt=wt((t=>"string"==typeof t)),At=wt((t=>"boolean"==typeof t)),kt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),xt=wt((t=>kt?t>=Lt&&t<=Ft:"-"===t[0]?It(t,St):It(t,Rt)));const St=Number.MIN_SAFE_INTEGER.toString(),Lt=kt?BigInt(Number.MIN_SAFE_INTEGER):void 0,Rt=Number.MAX_SAFE_INTEGER.toString(),Ft=kt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function It(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}const Mt="function"==typeof Uint8Array.prototype.slice;let Pt,Ot=0,Ct=0;function Ut(t){const e=t>>>0;Ot=e,Ct=(t-e)/4294967296>>>0}function Nt(t){if(t<0){Ut(-t);const[e,n]=Ht(Ot,Ct);Ot=e>>>0,Ct=n>>>0}else Ut(t)}function Dt(t){const e=Pt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Ct=0,Ot=e.getUint32(0,!0)}function Bt(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:jt(t,e)}function Gt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),"number"==typeof(t=Bt(t,e))?n?-t:t:n?"-"+t:t}function jt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else z()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+Vt(n)+Vt(t));return n}function Vt(t){return t=String(t),"0000000".slice(t.length)+t}function Xt(t){if(t.length<16)Nt(Number(t));else if(z())t=BigInt(t),Ot=Number(t&BigInt(4294967295))>>>0,Ct=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Ct=Ot=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));Ct*=1e6,Ot=1e6*Ot+e,Ot>=4294967296&&(Ct+=Math.trunc(Ot/4294967296),Ct>>>=0,Ot>>>=0)}if(e){const[t,e]=Ht(Ot,Ct);Ot=t,Ct=e}}}function Ht(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Wt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function zt(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}const Kt=/^-?([1-9][0-9]*|0)(\\.[0-9]+)?$/;function Yt(t){const e=typeof t;switch(e){case"bigint":return!0;case"number":return Number.isFinite(t)}return"string"===e&&Kt.test(t)}function $t(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function qt(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?t>>>0:void 0}function Jt(t){return"-"!==t[0]&&(t.length<20||20===t.length&&Number(t.substring(0,6))<184467)}function Zt(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Nt(t),t=Gt(Ot,Ct)),t}function Qt(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?t.length<20||20===t.length&&Number(t.substring(0,7))>-922337:t.length<19||19===t.length&&Number(t.substring(0,6))<922337))if(Xt(t),t=Ot,2147483648&(e=Ct))if(z())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Ht(t,e);t="-"+jt(n,r)}else t=jt(t,e);return t}function te(t){return null==t?t:"bigint"==typeof t?(xt(t)?t=Number(t):(t=BigInt.asIntN(64,t),t=xt(t)?Number(t):String(t)),t):Yt(t)?"number"==typeof t?Zt(t):Qt(t):void 0}function ee(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(BigInt.asUintN(64,t));if(Yt(t)){if("string"===e)return e=Math.trunc(Number(t)),Number.isSafeInteger(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Jt(t)||(Xt(t),t=jt(Ot,Ct))),t;if("number"===e)return(t=Math.trunc(t))>=0&&Number.isSafeInteger(t)?t:function(t){if(t<0){Nt(t);var e=jt(Ot,Ct);return t=Number(e),Number.isSafeInteger(t)?t:e}return Jt(e=String(t))?e:(Nt(t),Bt(Ot,Ct))}(t)}}function ne(t){if("string"!=typeof t)throw Error();return t}function re(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ie(t){return null==t||"string"==typeof t?t:void 0}function se(t,e,n,r){if(null!=t&&"object"==typeof t&&t.X===ht)return t;if(!Array.isArray(t))return n?2&r?(t=e[J])?e=t:(st((t=new e).u),e=e[J]=t):e=new e:e=void 0,e;let i=n=nt(t);return 0===i&&(i|=32&r),i|=2&r,i!==n&&it(t,i),new e(t)}function oe(t,e,n){if(e)t:{if(!Yt(e=t))throw W("int64");switch(typeof e){case"string":e=Qt(e);break t;case"bigint":if(t=e=BigInt.asIntN(64,e),bt(t)){if(!/^\\s*(?:-?[1-9]\\d*|0)?\\s*$/.test(t))throw Error(String(t))}else if(Tt(t)&&!Number.isSafeInteger(t))throw Error(String(t));e=kt?BigInt(e):At(e)?e?"1":"0":bt(e)?e.trim()||"0":String(e);break t;default:e=Zt(e)}}else e=te(t);return"string"==typeof(n=null==(t=e)?n?0:void 0:t)&&(e=+n,Number.isSafeInteger(e))?e:n}function ae(t){var e;return void 0===ue&&(ue="function"==typeof Proxy?me(Proxy):null),(e=!ue)||(void 0===le&&(le="function"==typeof WeakMap?me(WeakMap):null),e=!le),e?t:(e=ce?.get(t))?e:Math.random()>.01?t:(function(t){if(void 0===fe){const t=new ue([],{});fe=1===Array.prototype.concat.call([],t).length}fe&&"function"==typeof Symbol&&Symbol.isConcatSpreadable&&(t[Symbol.isConcatSpreadable]=!0)}(t),function(t,e){(ce||=new le).set(t,e),(he||=new le).set(e,t)}(t,e=new ue(t,{set:(t,e,n)=>(H(),t[e]=n,!0)})),e)}let ce,he,ue,le,fe,de,pe,ge;function me(t){try{return-1!==t.toString().indexOf("[native code]")?t:null}catch{return null}}function ye(t,e,n){return t=_e(t,e[0],e[1],n?1:2),e!==pe&&n&&tt(t,16384),t}function _e(t,e,n,r){if(r=r??0,null==t&&(t=de),de=void 0,null==t){var i=96;n?(t=[n],i|=512):t=[],e&&(i=-33521665&i|(1023&e)<<15)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(i=nt(t)))throw Error("farr");if(64&i)return t;if(1===r||2===r||(i|=64),n&&(i|=512,n!==t[0]))throw Error("mid");t:{if(r=(n=t).length){const t=r-1;if(ft(n[t])){if((e=t-(+!!(512&(i|=256))-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&e)<<15;break t}}if(e){if((e=Math.max(e,r-(+!!(512&i)-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&e)<<15}}}return it(t,i),t}const ve={};let Ee=function(){try{return T(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class we{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()}}const Te=Ee?(Object.setPrototypeOf(we.prototype,Map.prototype),Object.defineProperties(we.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),we):class extends Map{constructor(){super()}};function be(t){return t}function Ae(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var ke=class extends Te{constructor(t,e,n=be,r=be){super();let i=nt(t);i|=64,it(t,i),this.M=i,this.T=e,this.S=n,this.Z=this.T?xe:r;for(let s=0;s<t.length;s++){const o=t[s],a=n(o[0],!1,!0);let c=o[1];e?void 0===c&&(c=null):c=r(o[1],!1,!0,void 0,void 0,i),super.set(a,c)}}oa(t=Se){if(0!==this.size)return this.Y(t)}Y(t=Se){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){Ae(this),super.clear()}delete(t){return Ae(this),super.delete(this.S(t,!0,!1))}entries(){var t=this.na();return new yt(t,Le,this)}keys(){return this.Ha()}values(){var t=this.na();return new yt(t,ke.prototype.get,this)}forEach(t,e){super.forEach(((n,r)=>{t.call(e,this.get(r),r,this)}))}set(t,e){return Ae(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.Z(e,!0,!0,this.T,!1,this.M))}Na(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.T?void 0===t?null:t:this.Z(t,!1,!0,void 0,!1,this.M),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.T;return n?((n=this.Z(e,!1,!0,n,this.sa,this.M))!==e&&super.set(t,n),n):e}}na(){return Array.from(super.keys())}Ha(){return super.keys()}[Symbol.iterator](){return this.entries()}};function xe(t,e,n,r,i,s){return t=se(t,r,n,s),i&&(t=De(t)),t}function Se(t){return t}function Le(t){return[t,this.get(t)]}let Re;function Fe(){return Re||=new ke(st([]),void 0,void 0,void 0,ve)}function Ie(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=pt(t)?void 0:i&&2&nt(t)?t:Me(t,e,n,void 0!==r,i);else if(ft(t)){const s={};for(let o in t)s[o]=Ie(t[o],e,n,r,i);t=s}else t=e(t,r);return t}}function Me(t,e,n,r,i){const s=r||n?nt(t):0;r=r?!!(32&s):void 0;const o=K(t);for(let t=0;t<o.length;t++)o[t]=Ie(o[t],e,n,r,i);return n&&(vt(o,t),n(s,o)),o}function Pe(t){return Ie(t,Oe,void 0,void 0,!1)}function Oe(t){return t.X===ht?t.toJSON():t instanceof ke?t.oa(Pe):function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return xt(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(pt(t))return}else{if(C(t))return F(t);if(t instanceof B){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=F(e)}if(t instanceof ke)return t.oa()}}return t}(t)}function Ce(t,e,n=at){if(null!=t){if(L&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=nt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(it(t,-12293&(34|r)),t):Me(t,Ce,4&r?at:n,!0,!0))}return t.X===ht?(n=t.u,t=2&(r=rt(n))?t:Ue(t,n,r,!0)):t instanceof ke&&!(2&t.M)&&(n=st(t.Y(Ce)),t=new ke(n,t.T,t.S,t.Z)),t}}function Ue(t,e,n,r){return t=t.constructor,de=e=Ne(e,n,r),e=new t(e),de=void 0,e}function Ne(t,e,n){const r=n||2&e?at:ot,i=!!(32&e);return t=function(t,e,n){const r=K(t);var i=r.length;const s=256&e?r[i-1]:void 0;for(i+=s?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(s){e=r[e]={};for(const t in s)e[t]=n(s[t])}return vt(r,t),r}(t,e,(t=>Ce(t,i,r))),tt(t,32|(n?2:0)),t}function De(t){const e=t.u,n=rt(e);return 2&n?Ue(t,e,n,!1):t}function Be(t,e){return je(t=t.u,rt(t),e)}function Ge(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function je(t,e,n,r){if(-1===n)return null;const i=e>>15&1023||536870912;if(!(n>=i)){var s=t.length;return r&&256&e&&null!=(r=t[s-1][n])?(Ge(t,e,i,n)&&null!=Z&&((e=(t=j??={})[Z]||0)>=4||(t[Z]=e+1,H())),r):Ge(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function Ve(t,e,n){const r=t.u;let i=rt(r);return mt(i),Xe(r,i,e,n),t}function Xe(t,e,n,r){const i=e>>15&1023||536870912;if(n>=i){let s,o=e;if(256&e)s=t[t.length-1];else{if(null==r)return o;s=t[i+(+!!(512&e)-1)]={},o|=256}return s[n]=r,n<i&&(t[n+(+!!(512&e)-1)]=void 0),o!==e&&it(t,o),o}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function He(t,e){t=t.u;let n=rt(t);const r=je(t,n,e),i=Wt(r);return null!=i&&i!==r&&Xe(t,n,e,i),i}function We(t){t=t.u;let e=rt(t);const n=je(t,e,1),r=dt(n,!0);return null!=r&&r!==n&&Xe(t,e,1,r),r}function ze(){return void 0===Et?2:4}function Ke(t,e,n,r,i){const s=t.u,o=2&(t=rt(s))?1:r;i=!!i,r=Ye(s,t,e);var a=nt(r);if(!(4&a)){4&a&&(r=K(r),a=fn(a,t),t=Xe(s,t,e,r));let i=0,o=0;for(;i<r.length;i++){const t=n(r[i]);null!=t&&(r[o++]=t)}o<i&&(r.length=o),a=-4097&(20|(a=$e(a,t))),it(r,a&=-8193),2&a&&Object.freeze(r)}let c;return 1===o||4===o&&32&a?qe(a)||(i=a,(a|=2)!==i&&it(r,a),Object.freeze(r)):(n=5===o&&(!!(32&a)||qe(a)||!!ce?.get(r)),(2===o||n)&&qe(a)&&(r=K(r),a=dn(a=fn(a,t),t,i),it(r,a),t=Xe(s,t,e,r)),qe(a)||(e=a,(a=dn(a,t,i))!==e&&it(r,a)),n?c=ae(r):2!==o||i||ce?.delete(r)),c||r}function Ye(t,e,n,r){return t=je(t,e,n,r),Array.isArray(t)?t:ct}function $e(t,e){return 0===t&&(t=fn(t,e)),1|t}function qe(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Je(t){t=K(t);for(let e=0;e<t.length;e++){const n=t[e]=K(t[e]);Array.isArray(n[1])&&(n[1]=st(n[1]))}return t}function Ze(t,e,n,r){t=t.u;let i=rt(t);mt(i),Xe(t,i,e,("0"===r?0===Number(n):n===r)?void 0:n)}function Qe(t,e,n,r,i){mt(e);var s=!(!(64&e)&&16384&e);const o=(i=Ye(t,e,n,i))!==ct;if(s||!o){let a=s=o?nt(i):0;(!o||2&a||qe(a)||4&a&&!(32&a))&&(i=K(i),a=fn(a,e),e=Xe(t,e,n,i)),a=-13&$e(a,e),a=dn(r?-17&a:16|a,e,!0),a!==s&&it(i,a)}return i}function tn(t,e){var n=As;return rn(en(t=t.u),t,rt(t),n)===e?e:-1}function en(t){if(Y)return t[Q]??(t[Q]=new Map);if(Q in t)return t[Q];const e=new Map;return Object.defineProperty(t,Q,{value:e}),e}function nn(t,e,n,r){const i=en(t),s=rn(i,t,e,n);return s!==r&&(s&&(e=Xe(t,e,s)),i.set(n,r)),e}function rn(t,e,n,r){let i=t.get(r);if(null!=i)return i;i=0;for(let t=0;t<r.length;t++){const s=r[t];null!=je(e,n,s)&&(0!==i&&(n=Xe(e,n,i)),i=s)}return t.set(r,i),i}function sn(t,e,n,r){let i,s=rt(t);if(null!=(r=je(t,s,n,r))&&r.X===ht)return(e=De(r))!==r&&Xe(t,s,n,e),e.u;if(Array.isArray(r)){const t=nt(r);i=2&t?ye(Ne(r,t,!1),e,!0):64&t?r:ye(i,e,!0)}else i=ye(void 0,e,!0);return i!==r&&Xe(t,s,n,i),i}function on(t,e,n,r){t=t.u;let i=rt(t);return(e=se(r=je(t,i,n,r),e,!1,i))!==r&&null!=e&&Xe(t,i,n,e),e}function an(t,e,n,r=!1){if(null==(e=on(t,e,n,r)))return e;if(t=t.u,!(2&(r=rt(t)))){const i=De(e);i!==e&&Xe(t,r,n,e=i)}return e}function cn(t,e,n,r,i,s,o){t=t.u;var a=!!(2&e);i=a?1:i,s=!!s,o&&=!a,a=Ye(t,e,r);var c=nt(a),h=!!(4&c);if(!h){var u=a,l=e;const t=!!(2&(c=$e(c,e)));t&&(l|=2);let r=!t,i=!0,s=0,o=0;for(;s<u.length;s++){const e=se(u[s],n,!1,l);if(e instanceof n){if(!t){const t=!!(2&nt(e.u));r&&=!t,i&&=t}u[o++]=e}}o<s&&(u.length=o),c|=4,c=i?16|c:-17&c,it(u,c=r?8|c:-9&c),t&&Object.freeze(u)}if(o&&!(8&c||!a.length&&(1===i||4===i&&32&c))){for(qe(c)&&(a=K(a),c=fn(c,e),e=Xe(t,e,r,a)),n=a,o=c,u=0;u<n.length;u++)(c=n[u])!==(l=De(c))&&(n[u]=l);o|=8,o=n.length?-17&o:16|o,it(n,o),c=o}let f;return 1===i||4===i&&32&c?qe(c)||(e=c,(c|=!a.length||16&c&&(!h||32&c)?2:2048)!==e&&it(a,c),Object.freeze(a)):(h=5===i&&(!!(32&c)||qe(c)||!!ce?.get(a)),(2===i||h)&&qe(c)&&(a=K(a),c=dn(c=fn(c,e),e,s),it(a,c),e=Xe(t,e,r,a)),qe(c)||(r=c,(c=dn(c,e,s))!==r&&it(a,c)),h?f=ae(a):2!==i||s||ce?.delete(a)),f||a}function hn(t,e,n){const r=rt(t.u);return cn(t,r,e,n,ze(),!1,!(2&r))}function un(t,e,n,r){return null==r&&(r=void 0),Ve(t,n,r)}function ln(t,e,n,r){null==r&&(r=void 0);t:{t=t.u;let i=rt(t);if(mt(i),null==r){const r=en(t);if(rn(r,t,i,n)!==e)break t;r.set(n,0)}else i=nn(t,i,n,e);Xe(t,i,e,r)}}function fn(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function dn(t,e,n){return 32&e&&n||(t&=-33),t}function pn(t,e,n,r){const i=rt(t.u);mt(i),t=cn(t,i,n,e,2,!0),r=null!=r?r:new n,t.push(r),2&nt(r.u)?et(t,8):et(t,16)}function gn(t,e){return t??e}function mn(t,e){return $t(Be(t,e))}function yn(t,e){return gn(He(t,e),0)}function _n(t,e){return gn(ie(Be(t,e)),"")}function vn(t,e,n){if(null!=n&&"boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);Ve(t,e,n)}function En(t,e,n){if(null!=n){if("number"!=typeof n)throw W("int32");if(!Number.isFinite(n))throw W("int32");n|=0}Ve(t,e,n)}function wn(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Ve(t,e,n)}function Tn(t,e,n){{const o=t.u;let a=rt(o);if(mt(a),null==n)Xe(o,a,e);else{n=he?.get(n)||n;var r=t=nt(n),i=qe(t),s=i||Object.isFrozen(n);for(i||(t=0),s||(n=K(n),r=0,t=dn(t=fn(t,a),a,!0),s=!1),t|=21,i=0;i<n.length;i++){const e=n[i],o=ne(e);Object.is(e,o)||(s&&(n=K(n),r=0,t=dn(t=fn(t,a),a,!0),s=!1),n[i]=o)}t!==r&&(s&&(n=K(n),t=dn(t=fn(t,a),a,!0)),it(n,t)),Xe(o,a,e,n)}}}function bn(t,e,n){mt(rt(t.u)),Ke(t,e,ie,2,!0).push(ne(n))}function An(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function kn(){return Error("Failed to read varint, encoding is invalid.")}function xn(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function Sn(t){if("string"==typeof t)return{buffer:O(t),O:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:!1};if(t.constructor===Uint8Array)return{buffer:t,O:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:!1};if(t.constructor===B)return{buffer:D(t)||new Uint8Array(0),O:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Ln(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(s<32&&128&n);for(s>32&&(i|=(127&n)>>4),s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(Un(t,a),n<128)return e(r>>>0,i>>>0);throw kn()}function Rn(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return Un(t,n),!!(127&e)}throw kn()}function Fn(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw kn();return Un(t,n),i}function In(t){return Fn(t)>>>0}function Mn(t){var e=t.h;const n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],Un(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function Pn(t){var e=Mn(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:t*(1/0):0==n?1401298464324817e-60*t*e:t*Math.pow(2,n-150)*(e+8388608)}function On(t){return Fn(t)}function Cn(t,e,{ca:n=!1}={}){t.ca=n,e&&(e=Sn(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function Un(t,e){if(t.g=e,e>t.l)throw xn(t.l,e)}function Nn(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw xn(e,t.l-n);return t.g=r,n}function Dn(t,e){if(0==e)return N();var n=Nn(t,e);return t.ca&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):Mt?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?N():new B(n,U)}ke.prototype.toJSON=void 0,ke.prototype.Ia=ut;var Bn=[];function Gn(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=In(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5))throw An(n,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function jn(t){switch(t.h){case 0:0!=t.h?jn(t):Rn(t.g);break;case 1:Un(t=t.g,t.g+8);break;case 2:if(2!=t.h)jn(t);else{var e=In(t.g);Un(t=t.g,t.g+e)}break;case 5:Un(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Gn(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}jn(t)}break;default:throw An(t.h,t.l)}}function Vn(t,e,n){const r=t.g.l,i=In(t.g),s=t.g.g+i;let o=s-r;if(o<=0&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function Xn(t){var e=In(t.g),a=Nn(t=t.g,e);if(t=t.h,o){var c,h=t;(c=s)||(c=s=new TextDecoder("utf-8",{fatal:!0})),e=a+e,h=0===a&&e===h.length?h:h.subarray(a,e);try{var u=c.decode(h)}catch(t){if(void 0===i){try{c.decode(new Uint8Array([128]))}catch(t){}try{c.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(s=void 0),t}}else{e=(u=a)+e,a=[];let i,s=null;for(;u<e;){var l=t[u++];l<128?a.push(l):l<224?u>=e?n():(i=t[u++],l<194||128!=(192&i)?(u--,n()):a.push((31&l)<<6|63&i)):l<240?u>=e-1?n():(i=t[u++],128!=(192&i)||224===l&&i<160||237===l&&i>=160||128!=(192&(c=t[u++]))?(u--,n()):a.push((15&l)<<12|(63&i)<<6|63&c)):l<=244?u>=e-2?n():(i=t[u++],128!=(192&i)||i-144+(l<<28)>>30!=0||128!=(192&(c=t[u++]))||128!=(192&(h=t[u++]))?(u--,n()):(l=(7&l)<<18|(63&i)<<12|(63&c)<<6|63&h,l-=65536,a.push(55296+(l>>10&1023),56320+(1023&l)))):n(),a.length>=8192&&(s=r(s,a),a.length=0)}u=r(s,a)}return u}function Hn(t){const e=In(t.g);return Dn(t.g,e)}function Wn(t,e,n){var r=In(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var zn=[];let Kn;function Yn(t,e,n){e.g?e.m(t,e.g,e.h,n,!0):e.m(t,e.h,n,!0)}var $n=class{constructor(t,e){this.u=_e(t,e)}toJSON(){return qn(this)}l(){var t=Eo;return t.g?t.l(this,t.g,t.h,!0):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.u;return Ue(this,t,rt(t),!1)}O(){return!!(2&nt(this.u))}};function qn(t){t=t.u,t=Kn?t:Me(t,Oe,void 0,void 0,!1);{var e=!Kn;let h=t.length;if(h){var n=t[h-1],r=ft(n);r?h--:n=void 0;var i=t;if(r){t:{var s,o=n,a=!1;if(o)for(let t in o)isNaN(+t)?(s??={})[t]=o[t]:(r=o[t],Array.isArray(r)&&(pt(r)||lt(r)&&0===r.size)&&(r=null),null==r&&(a=!0),null!=r&&((s??={})[t]=r));if(a||(s=o),s)for(let t in s){a=s;break t}a=null}o=null==a?null!=n:a!==n}for(;h>0&&(null==(s=i[h-1])||pt(s)||lt(s)&&0===s.size);h--)var c=!0;(i!==t||o||c)&&(e?(c||o||a)&&(i.length=h):i=Array.prototype.slice.call(i,0,h),a&&i.push(a)),c=i}else c=t}return c}function Jn(t){return t?/^\\d+$/.test(t)?(Xt(t),new Zn(Ot,Ct)):null:Qn||=new Zn(0,0)}$n.prototype.X=ht,$n.prototype.toString=function(){try{return Kn=!0,qn(this).toString()}finally{Kn=!1}};var Zn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Qn;function tr(t){return t?/^-?\\d+$/.test(t)?(Xt(t),new er(Ot,Ct)):null:nr||=new er(0,0)}var er=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let nr;function rr(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function ir(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function sr(t,e){if(e>=0)ir(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function or(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function ar(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function cr(t,e,n){ir(t.g,8*e+n)}function hr(t,e){return cr(t,e,2),e=t.g.end(),ar(t,e),e.push(t.h),e}function ur(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function lr(t,e,n){cr(t,e,2),ir(t.g,n.length),ar(t,t.g.end()),ar(t,n)}function fr(t,e,n,r){null!=n&&(e=hr(t,e),r(n,t),ur(t,e))}function dr(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var pr=dr(),gr=dr(),mr=dr(),yr=dr(),_r=dr(),vr=dr(),Er=dr(),wr=dr(),Tr=dr(),br=class{constructor(t,e,n){this.g=t,this.h=e,t=pr,this.l=!!t&&n===t||!1}};function Ar(t,e){return new br(t,e,pr)}function kr(t,e,n,r,i){fr(t,n,Ur(e,r),i)}const xr=Ar((function(t,e,n,r,i){return 2===t.h&&(Vn(t,sn(e,r,n),i),!0)}),kr),Sr=Ar((function(t,e,n,r,i){return 2===t.h&&(Vn(t,sn(e,r,n,!0),i),!0)}),kr);var Lr=Symbol(),Rr=Symbol(),Fr=Symbol(),Ir=Symbol();let Mr,Pr;function Or(t,e,n,r){var i=r[t];if(i)return i;(i={}).W=function(t){switch(typeof t){case"boolean":return pe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ge||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ha=s,"function"==typeof(s=r[++o])&&(i.ma=!0,Mr??=s,Pr??=r[o+1],s=r[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=r[++o]}for(c=1;void 0!==s;){let t;"number"==typeof s&&(c+=s,s=r[++o]);var h=void 0;if(s instanceof br?t=s:(t=xr,o--),t?.l){s=r[++o],h=r;var u=o;"function"==typeof s&&(s=s(),h[u]=s),h=s}for(u=c+1,"number"==typeof(s=r[++o])&&s<0&&(u-=s,s=r[++o]);c<u;c++){const r=a[c];h?n(i,c,t,h,r):e(i,c,t,r)}}return r[t]=i}function Cr(t){return Array.isArray(t)?t[0]instanceof br?t:[Sr,t]:[t,void 0]}function Ur(t,e){return t instanceof $n?t.u:Array.isArray(t)?ye(t,e,!1):void 0}function Nr(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function Dr(t,e,n,r,i){const s=n.g;let o,a;t[e]=(t,e,n)=>s(t,e,n,a||=Or(Rr,Nr,Dr,r).W,o||=Br(r),i)}function Br(t){let e=t[Fr];if(null!=e)return e;const n=Or(Rr,Nr,Dr,t);return e=n.ma?(t,e)=>Mr(t,e,n):(t,e)=>{const r=rt(t);for(;Gn(e)&&4!=e.h;){var i=e.m,s=n[i];if(null==s){var o=n.ha;o&&(o=o[i])&&(null!=(o=Gr(o))&&(s=n[i]=o))}null!=s&&s(e,t,i)||(i=(s=e).l,jn(s),s.ga?s=void 0:(o=s.g.g-i,s.g.g=i,s=Dn(s.g,o)),i=t,s&&(_t||=Symbol(),(o=i[_t])?o.push(s):i[_t]=[s]))}return 16384&r&&st(t),!0},t[Fr]=e}function Gr(t){const e=(t=Cr(t))[0].g;if(t=t[1]){const n=Br(t),r=Or(Rr,Nr,Dr,t).W;return(t,i,s)=>e(t,i,s,r,n)}return e}function jr(t,e,n){t[e]=n.h}function Vr(t,e,n,r){let i,s;const o=n.h;t[e]=(t,e,n)=>o(t,e,n,s||=Or(Lr,jr,Vr,r).W,i||=Xr(r))}function Xr(t){let e=t[Ir];if(!e){const n=Or(Lr,jr,Vr,t);e=(t,e)=>Hr(t,e,n),t[Ir]=e}return e}function Hr(t,e,n){for(var r=nt(t),i=+!!(512&r)-1,s=t.length,o=512&r?1:0,a=s+(256&r?-1:0);o<a;o++){const r=t[o];if(null==r)continue;const s=o-i,a=Wr(n,s);a&&a(e,r,s)}if(256&r){r=t[s-1];for(const t in r)i=+t,Number.isNaN(i)||null!=(s=r[i])&&(a=Wr(n,i))&&a(e,s,i)}if(t=_t?t[_t]:void 0)for(ar(e,e.g.end()),n=0;n<t.length;n++)ar(e,D(t[n])||new Uint8Array(0))}function Wr(t,e){var n=t[e];if(n)return n;if((n=t.ha)&&(n=n[e])){var r=(n=Cr(n))[0].h;if(n=n[1]){const e=Xr(n),i=Or(Lr,jr,Vr,n).W;n=t.ma?Pr(i,e):(t,n,s)=>r(t,n,s,i,e)}else n=r;return t[e]=n}}function zr(t,e){if(Array.isArray(e)){var n=nt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),it(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}function Kr(t,e,n){return new br(t,e,n)}function Yr(t,e,n){return new br(t,e,n)}function $r(t,e,n){Xe(t,rt(t),e,n)}var qr=Ar((function(t,e,n,r,i){return 2===t.h&&(t=Vn(t,ye([void 0,void 0],r,!0),i),mt(r=rt(e)),(i=je(e,r,n))instanceof ke?0!=(2&i.M)?((i=i.Y()).push(t),Xe(e,r,n,i)):i.Na(t):Array.isArray(i)?(2&nt(i)&&Xe(e,r,n,i=Je(i)),i.push(t)):Xe(e,r,n,[t]),!0)}),(function(t,e,n,r,i){if(e instanceof ke)e.forEach(((e,s)=>{fr(t,n,ye([s,e],r,!1),i)}));else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&fr(t,n,ye(o,r,!1),i)}}));function Jr(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(BigInt.asIntN(64,t));if(Yt(t)){if("string"===e)return Qt(t);if("number"===e)return Zt(t)}}(e),null!=e){if("string"==typeof e)tr(e);if(null!=e)switch(cr(t,n,0),typeof e){case"number":t=t.g,Nt(e),rr(t,Ot,Ct);break;case"bigint":n=BigInt.asUintN(64,e),n=new er(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),rr(t.g,n.h,n.g);break;default:n=tr(e),rr(t.g,n.h,n.g)}}}function Zr(t,e,n){null!=(e=$t(e))&&null!=e&&(cr(t,n,0),sr(t.g,e))}function Qr(t,e,n){null!=(e=zt(e))&&(cr(t,n,0),t.g.g.push(e?1:0))}function ti(t,e,n){null!=(e=ie(e))&&lr(t,n,h(e))}function ei(t,e,n,r,i){fr(t,n,Ur(e,r),i)}function ni(t,e,n){null!=(e=null==e||"string"==typeof e||C(e)||e instanceof B?e:void 0)&&lr(t,n,Sn(e).buffer)}function ri(t,e,n){return(5===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,Pn,e):e.push(Pn(t.g)),!0)}var ii=Kr((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=Mn(r);const i=Mn(r);r=2*(i>>31)+1;const s=i>>>20&2047;return t=4294967296*(1048575&i)+t,$r(e,n,2047==s?t?NaN:r*(1/0):0==s?5e-324*r*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=Wt(e))&&(cr(t,n,1),t=t.g,(n=Pt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Ot=n.getUint32(0,!0),Ct=n.getUint32(4,!0),or(t,Ot),or(t,Ct))}),dr()),si=Kr((function(t,e,n){return 5===t.h&&($r(e,n,Pn(t.g)),!0)}),(function(t,e,n){null!=(e=Wt(e))&&(cr(t,n,5),t=t.g,Dt(e),or(t,Ot))}),Er),oi=Yr(ri,(function(t,e,n){if(null!=(e=zr(Wt,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(cr(r,i,5),r=r.g,Dt(s),or(r,Ot))}}),Er),ai=Yr(ri,(function(t,e,n){if(null!=(e=zr(Wt,e))&&e.length){cr(t,n,2),ir(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Dt(e[r]),or(n,Ot)}}),Er),ci=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Ln(t.g,Gt)),!0)}),Jr,vr),hi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,0===(t=Ln(t.g,Gt))?void 0:t),!0)}),Jr,vr),ui=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Ln(t.g,Bt)),!0)}),(function(t,e,n){if(null!=(e=ee(e))){if("string"==typeof e)Jn(e);if(null!=e)switch(cr(t,n,0),typeof e){case"number":t=t.g,Nt(e),rr(t,Ot,Ct);break;case"bigint":n=BigInt.asUintN(64,e),n=new Zn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),rr(t.g,n.h,n.g);break;default:n=Jn(e),rr(t.g,n.h,n.g)}}}),dr()),li=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Fn(t.g)),!0)}),Zr,yr),fi=Yr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,Fn,e):e.push(Fn(t.g)),!0)}),(function(t,e,n){if(null!=(e=zr($t,e))&&e.length){n=hr(t,n);for(let n=0;n<e.length;n++)sr(t.g,e[n]);ur(t,n)}}),yr),di=Kr((function(t,e,n){return 0===t.h&&($r(e,n,0===(t=Fn(t.g))?void 0:t),!0)}),Zr,yr),pi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Rn(t.g)),!0)}),Qr,gr),gi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,!1===(t=Rn(t.g))?void 0:t),!0)}),Qr,gr),mi=Yr((function(t,e,n){return 2===t.h&&(t=Xn(t),Qe(e,rt(e),n,!1).push(t),!0)}),(function(t,e,n){if(null!=(e=zr(ie,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&lr(r,i,h(s))}}),mr),yi=Kr((function(t,e,n){return 2===t.h&&($r(e,n,""===(t=Xn(t))?void 0:t),!0)}),ti,mr),_i=Kr((function(t,e,n){return 2===t.h&&($r(e,n,Xn(t)),!0)}),ti,mr),vi=function(t,e,n=pr){return new br(t,e,n)}((function(t,e,n,r,i){return 2===t.h&&(r=ye(void 0,r,!0),Qe(e,rt(e),n,!0).push(r),Vn(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)ei(t,e[s],n,r,i)})),Ei=Ar((function(t,e,n,r,i,s){return 2===t.h&&(nn(e,nt(e),s,n),Vn(t,e=sn(e,r,n),i),!0)}),ei),wi=Kr((function(t,e,n){return 2===t.h&&($r(e,n,Hn(t)),!0)}),ni,wr),Ti=Yr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,In,e):e.push(In(t.g)),!0)}),(function(t,e,n){if(null!=(e=zr(qt,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(cr(r,i,0),ir(r.g,s))}}),_r),bi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,0===(t=In(t.g))?void 0:t),!0)}),(function(t,e,n){null!=(e=qt(e))&&null!=e&&(cr(t,n,0),ir(t.g,e))}),_r),Ai=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Fn(t.g)),!0)}),(function(t,e,n){null!=(e=$t(e))&&(e=parseInt(e,10),cr(t,n,0),sr(t.g,e))}),Tr);class ki{constructor(t,e){this.h=t,this.g=e,this.l=an,this.m=un,this.defaultValue=void 0}}function xi(t,e){return new ki(t,e)}function Si(t,e){return(n,r)=>{if(zn.length){const t=zn.pop();t.o(r),Cn(t.g,n,r),n=t}else n=new class{constructor(t,e){if(Bn.length){const n=Bn.pop();Cn(n,t,e),t=n}else t=new class{constructor(t,e){this.h=null,this.m=!1,this.g=this.l=this.j=0,Cn(this,t,e)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ca=!1}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({ga:t=!1}={}){this.ga=t}}(n,r);try{const r=new t,s=r.u;Br(e)(s,n);var i=r}finally{n.g.clear(),n.m=-1,n.h=-1,zn.length<100&&zn.push(n)}return i}}function Li(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Hr(this.u,e,Or(Lr,jr,Vr,t)),ar(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var Ri=class extends $n{constructor(t){super(t)}},Fi=[0,yi,Kr((function(t,e,n){return 2===t.h&&($r(e,n,(t=Hn(t))===N()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof $n){const r=e.Qa;return void(r&&(e=r(e),null!=e&&lr(t,n,Sn(e).buffer)))}if(Array.isArray(e))return}ni(t,e,n)}),wr)];let Ii,Mi=globalThis.trustedTypes;function Pi(t){void 0===Ii&&(Ii=function(){let t=null;if(!Mi)return t;try{const e=t=>t;t=Mi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}());var e=Ii;return new class{constructor(t){this.g=t}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function Oi(t,...e){if(0===e.length)return Pi(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return Pi(n)}var Ci=[0,li,Ai,pi,-1,fi,Ai,-1],Ui=class extends $n{constructor(){super()}},Ni=[0,pi,_i,pi,Ai,-1,Yr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,On,e):e.push(Fn(t.g)),!0)}),(function(t,e,n){if(null!=(e=zr($t,e))&&e.length){n=hr(t,n);for(let n=0;n<e.length;n++)sr(t.g,e[n]);ur(t,n)}}),Tr),_i,-1,[0,pi,-1],Ai,pi,-1],Di=[0,_i,-2],Bi=class extends $n{constructor(){super()}},Gi=[0],ji=[0,li,pi,1,pi,-3],Vi=class extends $n{constructor(t){super(t,2)}},Xi={};Xi[336783863]=[0,_i,pi,-1,li,[0,[1,2,3,4,5,6,7],Ei,Gi,Ei,Ni,Ei,Di,Ei,ji,Ei,Ci,Ei,[0,_i,-2],Ei,[0,_i,Ai]],[0,_i],pi,[0,[1,3],[2,4],Ei,[0,fi],-1,Ei,[0,mi],-1,vi,[0,_i,-1]],_i];var Hi=[0,hi,-1,gi,-3,hi,fi,yi,di,hi,-1,gi,di,gi,-2,yi];function Wi(t,e){Ze(t,2,re(e),"")}function zi(t,e){bn(t,3,e)}function Ki(t,e){bn(t,4,e)}var Yi=class extends $n{constructor(t){super(t,500)}o(t){return un(this,0,7,t)}},$i=[-1,{}],qi=[0,_i,1,$i],Ji=[0,_i,mi,$i];function Zi(t,e){pn(t,1,Yi,e)}function Qi(t,e){bn(t,10,e)}function ts(t,e){bn(t,15,e)}var es=class extends $n{constructor(t){super(t,500)}o(t){return un(this,0,1001,t)}},ns=[-500,vi,[-500,yi,-1,mi,-3,[-2,Xi,pi],vi,Fi,di,-1,qi,Ji,vi,[0,yi,gi],yi,Hi,di,mi,987,mi],4,vi,[-500,_i,-1,[-1,{}],998,_i],vi,[-500,_i,mi,-1,[-2,{},pi],997,mi,-1],di,vi,[-500,_i,mi,$i,998,mi],mi,di,qi,Ji,vi,[0,yi,-1,$i],mi,-2,Hi,yi,-1,gi,[0,gi,bi],978,$i,vi,Fi];es.prototype.g=Li(ns);var rs=Si(es,ns),is=class extends $n{constructor(t){super(t)}},ss=class extends $n{constructor(t){super(t)}g(){return hn(this,is,1)}},os=[0,vi,[0,li,si,_i,-1]],as=Si(ss,os),cs=class extends $n{constructor(t){super(t)}},hs=class extends $n{constructor(t){super(t)}},us=class extends $n{constructor(t){super(t)}h(){return an(this,cs,2)}g(){return hn(this,hs,5)}},ls=Si(class extends $n{constructor(t){super(t)}},[0,mi,fi,ai,[0,Ai,[0,li,-3],[0,si,-3],[0,li,-1,[0,vi,[0,li,-2]]],vi,[0,si,-1,_i,si]],_i,-1,ci,vi,[0,li,si],mi,ci]),fs=class extends $n{constructor(t){super(t)}},ds=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,si,-4]]),ps=class extends $n{constructor(t){super(t)}},gs=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,si,-4]]),ms=class extends $n{constructor(t){super(t)}},ys=[0,li,-1,ai,Ai],_s=class extends $n{constructor(){super()}};_s.prototype.g=Li([0,si,-4,ci]);var vs=class extends $n{constructor(t){super(t)}},Es=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,1,li,_i,os],ci]),ws=class extends $n{constructor(t){super(t)}},Ts=class extends $n{constructor(t){super(t)}pa(){const t=We(this);return null==t?N():t}},bs=class extends $n{constructor(t){super(t)}},As=[1,2],ks=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,As,Ei,[0,ai],Ei,[0,wi],li,_i],ci]),xs=class extends $n{constructor(t){super(t)}},Ss=[0,_i,li,si,mi,-1],Ls=class extends $n{constructor(t){super(t)}},Rs=[0,pi,-1],Fs=class extends $n{constructor(t){super(t)}},Is=[1,2,3,4,5],Ms=class extends $n{constructor(t){super(t)}g(){return null!=We(this)}h(){return null!=ie(Be(this,2))}},Ps=class extends $n{constructor(t){super(t)}g(){return zt(Be(this,2))??!1}},Os=[0,wi,_i,[0,li,ci,-1],[0,ui,ci]],Cs=[0,Os,pi,[0,Is,Ei,ji,Ei,Ni,Ei,Ci,Ei,Gi,Ei,Di],Ai],Us=class extends $n{constructor(t){super(t)}},Ns=[0,Cs,si,-1,li],Ds=xi(502141897,Us);Xi[502141897]=Ns;var Bs=Si(class extends $n{constructor(t){super(t)}},[0,[0,Ai,-1,oi,Ti],ys]),Gs=class extends $n{constructor(t){super(t)}},js=class extends $n{constructor(t){super(t)}},Vs=[0,Cs,si,[0,Cs],pi],Xs=[0,Cs,Ns,Vs,si,[0,[0,Os]]],Hs=xi(508968150,js);Xi[508968150]=Xs,Xi[508968149]=Vs;var Ws=class extends $n{constructor(t){super(t)}},zs=xi(513916220,Ws);Xi[513916220]=[0,Cs,Xs,li];var Ks=class extends $n{constructor(t){super(t)}h(){return an(this,xs,2)}g(){Ve(this,2)}},Ys=[0,Cs,Ss];Xi[478825465]=Ys;var $s=class extends $n{constructor(t){super(t)}},qs=class extends $n{constructor(t){super(t)}},Js=class extends $n{constructor(t){super(t)}},Zs=class extends $n{constructor(t){super(t)}},Qs=class extends $n{constructor(t){super(t)}},to=[0,Cs,[0,Cs],Ys,-1],eo=[0,Cs,si,li],no=[0,Cs,si],ro=[0,Cs,eo,no,si],io=xi(479097054,Qs);Xi[479097054]=[0,Cs,ro,to],Xi[463370452]=to,Xi[464864288]=eo;var so=xi(462713202,Zs);Xi[462713202]=ro,Xi[474472470]=no;var oo=class extends $n{constructor(t){super(t)}},ao=class extends $n{constructor(t){super(t)}},co=class extends $n{constructor(t){super(t)}},ho=class extends $n{constructor(){super()}},uo=[0,Cs,si,-1,li],lo=[0,Cs,si,pi];ho.prototype.g=Li([0,Cs,no,[0,Cs],Ns,Vs,uo,lo]);var fo=class extends $n{constructor(t){super(t)}},po=xi(456383383,fo);Xi[456383383]=[0,Cs,Ss];var go=class extends $n{constructor(t){super(t)}},mo=xi(476348187,go);Xi[476348187]=[0,Cs,Rs];var yo=class extends $n{constructor(t){super(t)}},_o=class extends $n{constructor(t){super(t)}},vo=[0,Ai,-1],Eo=xi(458105876,class extends $n{constructor(t){super(t)}g(){var t=this.u;const e=rt(t);const n=2&e;return t=function(t,e,n){var r=_o;const i=2&e;let s=!1;if(null==n){if(i)return Fe();n=[]}else if(n.constructor===ke){if(0==(2&n.M)||i)return n;n=n.Y()}else Array.isArray(n)?s=!!(2&nt(n)):n=[];if(i){if(!n.length)return Fe();s||(s=!0,st(n))}else s&&(s=!1,n=Je(n));return s||(64&nt(n)?et(n,32):32&e&&tt(n,32)),Xe(t,e,2,r=new ke(n,r,oe,void 0)),r}(t,e,je(t,e,2)),!n&&_o&&(t.sa=!0),t}});Xi[458105876]=[0,vo,qr,[!0,ci,[0,_i,-1,mi]]];var wo=class extends $n{constructor(t){super(t)}},To=xi(458105758,wo);Xi[458105758]=[0,Cs,_i,vo];var bo=class extends $n{constructor(t){super(t)}},Ao=xi(443442058,bo);Xi[443442058]=[0,Cs,_i,li,si,mi,-1],Xi[514774813]=uo;var ko=class extends $n{constructor(t){super(t)}},xo=xi(516587230,ko);function So(t,e){return e=e?e.clone():new xs,void 0!==t.displayNamesLocale?Ve(e,1,re(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ve(e,1),void 0!==t.maxResults?En(e,2,t.maxResults):"maxResults"in t&&Ve(e,2),void 0!==t.scoreThreshold?wn(e,3,t.scoreThreshold):"scoreThreshold"in t&&Ve(e,3),void 0!==t.categoryAllowlist?Tn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ve(e,4),void 0!==t.categoryDenylist?Tn(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ve(e,5),e}function Lo(t,e=-1,n=""){return{categories:t.map((t=>({index:gn(mn(t,1),0)??-1,score:yn(t,2)??0,categoryName:_n(t,3)??"",displayName:_n(t,4)??""}))),headIndex:e,headName:n}}function Ro(t){var e=Ke(t,3,Wt,ze()),n=Ke(t,2,$t,ze()),r=Ke(t,1,ie,ze()),i=Ke(t,9,ie,ze());const s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=an(t,us,4)?.h())&&(s.boundingBox={originX:mn(e,1)??0,originY:mn(e,2)??0,width:mn(e,3)??0,height:mn(e,4)??0,angle:0}),an(t,us,4)?.g().length)for(const e of an(t,us,4).g())s.keypoints.push({x:He(e,1)??0,y:He(e,2)??0,score:He(e,4)??0,label:ie(Be(e,3))??""});return s}function Fo(t){const e=[];for(const n of hn(t,ps,1))e.push({x:yn(n,1)??0,y:yn(n,2)??0,z:yn(n,3)??0,visibility:yn(n,4)??0});return e}function Io(t){const e=[];for(const n of hn(t,fs,1))e.push({x:yn(n,1)??0,y:yn(n,2)??0,z:yn(n,3)??0,visibility:yn(n,4)??0});return e}function Mo(t){return Array.from(t,(t=>t>127?t-256:t))}function Po(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Oo;Xi[516587230]=[0,Cs,uo,lo,si],Xi[518928384]=lo;const Co=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 Uo(){if(void 0===Oo)try{await WebAssembly.instantiate(Co),Oo=!0}catch{Oo=!1}return Oo}async function No(t,e=Oi``){const n=await Uo()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Do=class{};function Bo(){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 Go(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function jo(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 Vo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Xo(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=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&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[r,i]=jo(e);return!t.l||r===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=i),[r,i]}function Ho(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function Wo(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function zo(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}Do.forVisionTasks=function(t){return No("vision",t)},Do.forTextTasks=function(t){return No("text",t)},Do.forGenAiExperimentalTasks=function(t){return No("genai_experimental",t)},Do.forGenAiTasks=function(t){return No("genai",t)},Do.forAudioTasks=function(t){return No("audio",t)},Do.isSimdSupported=function(){return Uo()};async function Ko(t,e,n,r){return t=await(async(t,e,n,r,i)=>{if(e&&await Go(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Go(n),!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,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function Yo(t,e){const n=an(t.baseOptions,Ms,1)||new Ms;"string"==typeof e?(Ve(n,2,re(e)),Ve(n,1)):e instanceof Uint8Array&&(Ve(n,1,dt(e,!1)),Ve(n,2)),un(t.baseOptions,0,1,n)}function $o(t){try{const 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 qo(t,e){t.B=Math.max(t.B,e)}function Jo(t,e){t.A=new Yi,Wi(t.A,"PassThroughCalculator"),zi(t.A,"free_memory"),Ki(t.A,"free_memory_unused_out"),Qi(e,"free_memory"),Zi(e,t.A)}function Zo(t,e){zi(t.A,e),Ki(t.A,e+"_unused_out")}function Qo(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var ta=class{constructor(t){this.g=t,this.H=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(an(this.baseOptions,Ms,1)?.g()||an(this.baseOptions,Ms,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=an(t.baseOptions,Fs,3);if(!n){var r=n=new Fs,i=new Bi;ln(r,4,Is,i)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new Ui,ln(e,2,Is,r)):(e=n,r=new Bi,ln(e,4,Is,r))),un(t.baseOptions,0,3,n)}(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),Yo(this,"/model.dat"),this.m(),this.J()}));if(e.modelAssetBuffer instanceof Uint8Array)Yo(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){const e=[];for(var n=0;;){const{done:r,value:i}=await t.read();if(r)break;e.push(i),n+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(n),n=0;for(const r of e)t.set(r,n),n+=r.length;return t}(e.modelAssetBuffer).then((t=>{Yo(this,t),this.m(),this.J()}))}return this.m(),this.J(),Promise.resolve()}J(){}ea(){let t;if(this.g.ea((e=>{t=rs(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.A=void 0,$o(this)}finishProcessing(){this.g.finishProcessing(),$o(this)}close(){this.A=void 0,this.g.closeGraph()}};function ea(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}ta.prototype.close=ta.prototype.close,e("TaskRunner",ta);class na{constructor(t,e,n,r){this.g=t,this.h=e,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ra(t,e,n){const r=t.g;if(n=ea(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function ia(t,e){const n=t.g,r=ea(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const i=ea(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.P),n.vertexAttribPointer(t.P,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const s=ea(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.J),n.vertexAttribPointer(t.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new na(n,r,i,s)}function sa(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function oa(t,e,n,r){return sa(t,e),t.h||(t.m(),t.C()),n?(t.s||(t.s=ia(t,!0)),n=t.s):(t.v||(t.v=ia(t,!1)),n=t.v),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function aa(t,e,n){return sa(t,e),t=ea(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,n??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function ca(t,e,n){sa(t,e),t.A||(t.A=ea(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function ha(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var ua=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(){const t=this.g;if(this.h=ea(t.createProgram(),"Failed to create WebGL program"),this.ba=ra(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.aa=ra(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.P=t.getAttribLocation(this.h,"aVertex"),this.J=t.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.ba),t.deleteShader(this.aa)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}};var la=class extends ua{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 "}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=aa(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=aa(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.L=ea(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=ea(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=ea(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.K,0),t.uniform1i(this.L,1),t.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},fa=class extends ua{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 "}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=aa(this,t),t.activeTexture(t.TEXTURE2),this.B=aa(this,t)}m(){super.m();const t=this.g;this.K=ea(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=ea(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=ea(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.I,0),t.uniform1i(this.K,1),t.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function da(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 pa(t){var e=da(t,1);if(!e){if(e=da(t,0))e=new Float32Array(e).map((t=>t/255));else{e=new Float32Array(t.width*t.height);const r=ma(t);var n=_a(t);if(ca(n,r,ga(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){n=new Float32Array(t.width*t.height*4),r.readPixels(0,0,t.width,t.height,r.RGBA,r.FLOAT,n);for(let t=0,r=0;t<e.length;++t,r+=4)e[t]=n[r]}else r.readPixels(0,0,t.width,t.height,r.RED,r.FLOAT,e)}t.g.push(e)}return e}function ga(t){let e=da(t,2);if(!e){const n=ma(t);e=va(t);const r=pa(t),i=ya(t);n.texImage2D(n.TEXTURE_2D,0,i,t.width,t.height,0,n.RED,n.FLOAT,r),Ea(t)}return e}function ma(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=ea(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ya(t){if(t=ma(t),!wa)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))wa=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");wa=t.R16F}return wa}function _a(t){return t.l||(t.l=new ua),t.l}function va(t){const e=ma(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=da(t,2);return n||(n=aa(_a(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(n),t.j=!0),e.bindTexture(e.TEXTURE_2D,n),n}function Ea(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var wa,Ta=class{constructor(t,e,n,r,i,s,o){this.g=t,this.m=e,this.j=n,this.canvas=r,this.l=i,this.width=s,this.height=o,this.j&&(0===--ba&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Ga(){return!!da(this,0)}ka(){return!!da(this,1)}R(){return!!da(this,2)}ja(){return(e=da(t=this,0))||(e=pa(t),e=new Uint8Array(e.map((t=>255*t))),t.g.push(e)),e;var t,e}ia(){return pa(this)}N(){return ga(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof Uint8Array)n=new Uint8Array(e);else if(e instanceof Float32Array)n=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const t=ma(this),e=_a(this);t.activeTexture(t.TEXTURE1),n=aa(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,n);const r=ya(this);t.texImage2D(t.TEXTURE_2D,0,r,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),ca(e,t,n),oa(e,t,!1,(()=>{va(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ea(this)})),ha(e),Ea(this)}}t.push(n)}return new Ta(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ma(this).deleteTexture(da(this,2)),ba=-1}};Ta.prototype.close=Ta.prototype.close,Ta.prototype.clone=Ta.prototype.clone,Ta.prototype.getAsWebGLTexture=Ta.prototype.N,Ta.prototype.getAsFloat32Array=Ta.prototype.ia,Ta.prototype.getAsUint8Array=Ta.prototype.ja,Ta.prototype.hasWebGLTexture=Ta.prototype.R,Ta.prototype.hasFloat32Array=Ta.prototype.ka,Ta.prototype.hasUint8Array=Ta.prototype.Ga;var ba=250;const Aa={color:"white",lineWidth:4,radius:6};function ka(t){return{...Aa,fillColor:(t=t||{}).color,...t}}function xa(t,e){return t instanceof Function?t(e):t}function Sa(t,e,n){return Math.max(Math.min(e,n),Math.min(Math.max(e,n),t))}function La(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Ra(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Fa(t,e,n){if(e.R())n(e.N());else{const r=e.ka()?e.ia():e.ja();t.m=t.m??new ua;const i=Ra(t);n((t=new Ta([r],e.m,!1,i.canvas,t.m,e.width,e.height)).N()),t.close()}}function Ia(t,e,n,r){const i=function(t){return t.g||(t.g=new la),t.g}(t),s=Ra(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;oa(i,s,!0,(()=>{!function(t,e,n,r){const i=t.g;if(i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.B),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.I&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(const[r,i]of t){t=r;const s=i;var n=e.next();if(n.done)return!1;const[o,a]=n.value;if(n=a,t!==o||s[0]!==n[0]||s[1]!==n[1]||s[2]!==n[2]||s[3]!==n[3])return!1}return!!e.next().done}(t.I,r))i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j);else{t.I=r;const e=Array(1024).fill(0);r.forEach(((t,n)=>{if(4!==t.length)throw Error(`Color at index ${n} is not a four-channel value.`);e[4*n]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+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,r),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);const 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 Ma(t,e,n,r){const i=Ra(t),s=function(t){return t.h||(t.h=new fa),t.h}(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n,a=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;oa(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.B),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 Pa=class{constructor(t,e){t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}za(t,e){if(t){var n=La(this);e=ka(e),n.save();var r=n.canvas,i=0;for(const s of t)n.fillStyle=xa(e.fillColor,{index:i,from:s}),n.strokeStyle=xa(e.color,{index:i,from:s}),n.lineWidth=xa(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*r.width,s.y*r.height,xa(e.radius,{index:i,from:s}),0,2*Math.PI),n.fill(t),n.stroke(t),++i;n.restore()}}ya(t,e,n){if(t&&e){var r=La(this);n=ka(n),r.save();var i=r.canvas,s=0;for(const o of e){r.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(r.strokeStyle=xa(n.color,{index:s,from:e,to:a}),r.lineWidth=xa(n.lineWidth,{index:s,from:e,to:a}),r.moveTo(e.x*i.width,e.y*i.height),r.lineTo(a.x*i.width,a.y*i.height)),++s,r.stroke()}r.restore()}}va(t,e){const n=La(this);e=ka(e),n.save(),n.beginPath(),n.lineWidth=xa(e.lineWidth,{}),n.strokeStyle=xa(e.color,{}),n.fillStyle=xa(e.fillColor,{}),n.moveTo(t.originX,t.originY),n.lineTo(t.originX+t.width,t.originY),n.lineTo(t.originX+t.width,t.originY+t.height),n.lineTo(t.originX,t.originY+t.height),n.lineTo(t.originX,t.originY),n.stroke(),n.fill(),n.restore()}wa(t,e,n=[0,0,0,255]){this.l?function(t,e,n,r){const i=Ra(t);Fa(t,e,(e=>{Ia(t,e,n,r),(e=La(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,n,e):Ia(this,t.N(),n,e)}xa(t,e,n){this.l?function(t,e,n,r){const i=Ra(t);Fa(t,e,(e=>{Ma(t,e,n,r),(e=La(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,e,n):Ma(this,t.N(),e,n)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Oa(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 Ca(t){var e=Oa(t,0);if(!e){e=Na(t);const n=Da(t),r=new Uint8Array(t.width*t.height*4);ca(n,e,Ua(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,r),ha(n),e=new ImageData(new Uint8ClampedArray(r.buffer),t.width,t.height),t.g.push(e)}return e}function Ua(t){let e=Oa(t,2);if(!e){const n=Na(t);e=Ba(t);const r=Oa(t,1)||Ca(t);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),Ga(t)}return e}function Na(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return t.h||(t.h=ea(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Da(t){return t.l||(t.l=new ua),t.l}function Ba(t){const e=Na(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=Oa(t,2);return n||(n=aa(Da(t),e),t.g.push(n),t.m=!0),e.bindTexture(e.TEXTURE_2D,n),n}function Ga(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function ja(t){const e=Na(t);return oa(Da(t),e,!0,(()=>function(t,e){const n=t.canvas;if(n.width===t.width&&n.height===t.height)return e();const r=n.width,i=n.height;return n.width=t.width,n.height=t.height,t=e(),n.width=r,n.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()}))))}Pa.prototype.close=Pa.prototype.close,Pa.prototype.drawConfidenceMask=Pa.prototype.xa,Pa.prototype.drawCategoryMask=Pa.prototype.wa,Pa.prototype.drawBoundingBox=Pa.prototype.va,Pa.prototype.drawConnectors=Pa.prototype.ya,Pa.prototype.drawLandmarks=Pa.prototype.za,Pa.lerp=function(t,e,n,r,i){return Sa(r*(1-(t-e)/(n-e))+i*(1-(n-t)/(n-e)),r,i)},Pa.clamp=Sa,e("DrawingUtils",Pa);var Va=class{constructor(t,e,n,r,i,s,o){this.g=t,this.j=e,this.m=n,this.canvas=r,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--Xa&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Fa(){return!!Oa(this,0)}la(){return!!Oa(this,1)}R(){return!!Oa(this,2)}Da(){return Ca(this)}Ca(){var t=Oa(this,1);return t||(Ua(this),Ba(this),t=ja(this),Ga(this),this.g.push(t),this.j=!0),t}N(){return Ua(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof ImageData)n=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const t=Na(this),e=Da(this);t.activeTexture(t.TEXTURE1),n=aa(e,t),t.bindTexture(t.TEXTURE_2D,n),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),ca(e,t,n),oa(e,t,!1,(()=>{Ba(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ga(this)})),ha(e),Ga(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);Ua(this),Ba(this),n=ja(this),Ga(this)}t.push(n)}return new Va(t,this.la(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Oa(this,1).close(),this.m&&Na(this).deleteTexture(Oa(this,2)),Xa=-1}};Va.prototype.close=Va.prototype.close,Va.prototype.clone=Va.prototype.clone,Va.prototype.getAsWebGLTexture=Va.prototype.N,Va.prototype.getAsImageBitmap=Va.prototype.Ca,Va.prototype.getAsImageData=Va.prototype.Da,Va.prototype.hasWebGLTexture=Va.prototype.R,Va.prototype.hasImageBitmap=Va.prototype.la,Va.prototype.hasImageData=Va.prototype.Fa;var Xa=250;function Ha(...t){return t.map((([t,e])=>({start:t,end:e})))}const Wa=function(t){return class extends t{La(){this.i._registerModelResourcesGraphService()}}}((za=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:Bo()?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){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,i){this.i._configureAudio||console.warn(\'Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?\'),Vo(this,r||"input_audio",(r=>{Vo(this,i=i||"audio_header",(i=>{this.i._configureAudio(r,i,t,e??0,n)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ea(t){Wo(this,"__graph_config__",(e=>{t(e)})),Vo(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,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const 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),Vo(this,r,(t=>{this.i._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Vo(this,e,(e=>{const[r,i]=Xo(this,t,e);this.i._addBoundTextureToStream(e,r,i,n)}))}addBoolToStream(t,e,n){Vo(this,e,(e=>{this.i._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Vo(this,e,(e=>{this.i._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Vo(this,e,(e=>{this.i._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Vo(this,e,(e=>{this.i._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Vo(this,e,(e=>{this.i._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Vo(this,e,(e=>{Vo(this,t,(t=>{this.i._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Vo(this,e,(e=>{Ho(this,Object.keys(t),(r=>{Ho(this,Object.values(t),(i=>{this.i._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Vo(this,n,(n=>{Vo(this,e,(e=>{const i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,n,r),this.i._free(i)}))}))}addEmptyPacketToStream(t,e){Vo(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputStream(r,e,n)}))}addUintVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Vo(this,e,(t=>{this.i._addStringVectorEntry(r,t)}));this.i._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Vo(this,e,(e=>{Vo(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Vo(this,n,(n=>{Vo(this,e,(e=>{const r=this.i._malloc(t.length);this.i.HEAPU8.set(t,r),this.i._addProtoToInputSidePacket(r,t.length,e,n),this.i._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputSidePacket(n,e)}))}addUintVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Vo(this,e,(t=>{this.i._addStringVectorEntry(n,t)}));this.i._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachUintListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachUintListener(t)}))}attachUintVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){zo(this,t,e),Vo(this,t,(t=>{this.i._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn(\'Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?\'),Wo(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Vo(this,t,(t=>{this.i._attachAudioListener(t,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends za{get fa(){return this.i}ra(t,e,n){Vo(this,e,(e=>{const[r,i]=Xo(this,t,e);this.fa._addBoundTextureAsImageToStream(e,r,i,n)}))}V(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.fa._attachImageListener(t)}))}da(t,e){zo(this,t,e),Vo(this,t,(t=>{this.fa._attachImageVectorListener(t)}))}}));var za,Ka=class extends Wa{};async function Ya(t,e,n){return async function(t,e,n,r){return Ko(t,e,n,r)}(t,n.canvas??(Bo()?void 0:document.createElement("canvas")),e,n)}function $a(t,e,n,r){if(t.U){const s=new _s;if(n?.regionOfInterest){if(!t.qa)throw Error("This task doesn\'t support region-of-interest.");var i=n.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].");wn(s,1,(i.left+i.right)/2),wn(s,2,(i.top+i.bottom)/2),wn(s,4,i.right-i.left),wn(s,3,i.bottom-i.top)}else wn(s,1,.5),wn(s,2,.5),wn(s,4,1),wn(s,3,1);if(n?.rotationDegrees){if(n?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(wn(s,5,-Math.PI*n.rotationDegrees/180),n?.rotationDegrees%180!=0){const[t,r]=jo(e);n=yn(s,3)*r/t,i=yn(s,4)*t/r,wn(s,4,n),wn(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,r)}t.g.ra(e,t.ba,r??performance.now()),t.finishProcessing()}function qa(t,e,n){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. \'runningMode\' must be set to \'IMAGE\'.");$a(t,e,n,t.B+1)}function Ja(t,e,n,r){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. \'runningMode\' must be set to \'VIDEO\'.");$a(t,e,n,r)}function Za(t,e,n,r){var i=e.data;const 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 Ta([i],n,!1,t.g.i.canvas,t.P,s,e),r?t.clone():t}var Qa=class extends ta{constructor(t,e,n,r){super(t),this.g=t,this.ba=e,this.U=n,this.qa=r,this.P=new ua}l(t,e=!0){if("runningMode"in t&&vn(this.baseOptions,2,!!t.runningMode&&"IMAGE"!==t.runningMode),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()}};Qa.prototype.close=Qa.prototype.close;var tc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},un(t=this.h=new Us,0,1,e=new Ps),wn(this.h,2,.5),wn(this.h,3,.3)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&wn(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&wn(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}D(t,e){return this.j={detections:[]},qa(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect_in"),ts(t,"detections");const e=new Vi;Yn(e,Ds,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect_in"),Ki(n,"DETECTIONS:detections"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=ls(e),this.j.detections.push(Ro(t));qo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};tc.prototype.detectForVideo=tc.prototype.F,tc.prototype.detect=tc.prototype.D,tc.prototype.setOptions=tc.prototype.o,tc.createFromModelPath=async function(t,e){return Ya(tc,t,{baseOptions:{modelAssetPath:e}})},tc.createFromModelBuffer=function(t,e){return Ya(tc,t,{baseOptions:{modelAssetBuffer:e}})},tc.createFromOptions=function(t,e){return Ya(tc,t,e)};var ec=Ha([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]),nc=Ha([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]),rc=Ha([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),ic=Ha([474,475],[475,476],[476,477],[477,474]),sc=Ha([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]),oc=Ha([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),ac=Ha([469,470],[470,471],[471,472],[472,469]),cc=Ha([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]),hc=[...ec,...nc,...rc,...sc,...oc,...cc],uc=Ha([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 lc(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var fc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,un(t=this.h=new js,0,1,e=new Ps),this.v=new Gs,un(this.h,0,3,this.v),this.s=new Us,un(this.h,0,2,this.s),En(this.s,4,1),wn(this.s,2,.5),wn(this.v,2,.5),wn(this.h,4,.5)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"numFaces"in t&&En(this.s,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&wn(this.s,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&wn(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return lc(this),qa(this,t,e),this.j}F(t,e,n){return lc(this),Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"face_landmarks");const e=new Vi;Yn(e,Hs,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"NORM_LANDMARKS:face_landmarks"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("face_landmarks",((t,e)=>{for(const e of t)t=gs(e),this.j.faceLandmarks.push(Fo(t));qo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{qo(this,t)})),this.outputFaceBlendshapes&&(ts(t,"blendshapes"),Ki(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((t,e)=>{if(this.outputFaceBlendshapes)for(const e of t)t=as(e),this.j.faceBlendshapes.push(Lo(t.g()??[]));qo(this,e)})),this.g.attachEmptyPacketListener("blendshapes",(t=>{qo(this,t)}))),this.outputFacialTransformationMatrixes&&(ts(t,"face_geometry"),Ki(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((t,e)=>{if(this.outputFacialTransformationMatrixes)for(const e of t)(t=an(Bs(e),ms,2))&&this.j.facialTransformationMatrixes.push({rows:gn(mn(t,1),0)??0,columns:gn(mn(t,2),0)??0,data:Ke(t,3,Wt,ze()).slice()??[]});qo(this,e)})),this.g.attachEmptyPacketListener("face_geometry",(t=>{qo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};fc.prototype.detectForVideo=fc.prototype.F,fc.prototype.detect=fc.prototype.D,fc.prototype.setOptions=fc.prototype.o,fc.createFromModelPath=function(t,e){return Ya(fc,t,{baseOptions:{modelAssetPath:e}})},fc.createFromModelBuffer=function(t,e){return Ya(fc,t,{baseOptions:{modelAssetBuffer:e}})},fc.createFromOptions=function(t,e){return Ya(fc,t,e)},fc.FACE_LANDMARKS_LIPS=ec,fc.FACE_LANDMARKS_LEFT_EYE=nc,fc.FACE_LANDMARKS_LEFT_EYEBROW=rc,fc.FACE_LANDMARKS_LEFT_IRIS=ic,fc.FACE_LANDMARKS_RIGHT_EYE=sc,fc.FACE_LANDMARKS_RIGHT_EYEBROW=oc,fc.FACE_LANDMARKS_RIGHT_IRIS=ac,fc.FACE_LANDMARKS_FACE_OVAL=cc,fc.FACE_LANDMARKS_CONTOURS=hc,fc.FACE_LANDMARKS_TESSELATION=uc;var dc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!0),un(t=this.j=new Ws,0,1,e=new Ps)}get baseOptions(){return an(this.j,Ps,1)}set baseOptions(t){un(this.j,0,1,t)}o(t){return super.l(t)}Oa(t,e,n){const r="function"!=typeof e?e:{};if(this.h="function"==typeof e?e:n,qa(this,t,r??{}),!this.h)return this.s}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"stylized_image");const e=new Vi;Yn(e,zs,this.j);const n=new Yi;Wi(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"STYLIZED_IMAGE:stylized_image"),n.o(e),Zi(t,n),this.g.V("stylized_image",((t,e)=>{var n=!this.h,r=t.data,i=t.width;const s=i*(t=t.height);if(r instanceof Uint8Array)if(r.length===3*s){const e=new Uint8ClampedArray(4*s);for(let t=0;t<s;++t)e[4*t]=r[3*t],e[4*t+1]=r[3*t+1],e[4*t+2]=r[3*t+2],e[4*t+3]=255;r=new ImageData(e,i,t)}else{if(r.length!==4*s)throw Error("Unsupported channel count: "+r.length/s);r=new ImageData(new Uint8ClampedArray(r.buffer,r.byteOffset,r.length),i,t)}else if(!(r instanceof WebGLTexture))throw Error(`Unsupported format: ${r.constructor.name}`);i=new Va([r],!1,!1,this.g.i.canvas,this.P,i,t),this.s=n=n?i.clone():i,this.h&&this.h(n),qo(this,e)})),this.g.attachEmptyPacketListener("stylized_image",(t=>{this.s=null,this.h&&this.h(null),qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};dc.prototype.stylize=dc.prototype.Oa,dc.prototype.setOptions=dc.prototype.o,dc.createFromModelPath=function(t,e){return Ya(dc,t,{baseOptions:{modelAssetPath:e}})},dc.createFromModelBuffer=function(t,e){return Ya(dc,t,{baseOptions:{modelAssetBuffer:e}})},dc.createFromOptions=function(t,e){return Ya(dc,t,e)};var pc=Ha([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 gc(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function mc(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 yc(t,e=!0){const n=[];for(const i of t){var r=as(i);t=[];for(const n of r.g())r=e&&null!=mn(n,1)?gn(mn(n,1),0):-1,t.push({score:yn(n,2)??0,index:r,categoryName:_n(n,3)??"",displayName:_n(n,4)??""});n.push(t)}return n}var _c=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],un(t=this.j=new Qs,0,1,e=new Ps),this.s=new Zs,un(this.j,0,2,this.s),this.C=new Js,un(this.s,0,3,this.C),this.v=new qs,un(this.s,0,2,this.v),this.h=new $s,un(this.j,0,3,this.h),wn(this.v,2,.5),wn(this.s,4,.5),wn(this.C,2,.5)}get baseOptions(){return an(this.j,Ps,1)}set baseOptions(t){un(this.j,0,1,t)}o(t){if(En(this.v,3,t.numHands??1),"minHandDetectionConfidence"in t&&wn(this.v,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.s,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&wn(this.C,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Ks,n=e,r=So(t.cannedGesturesClassifierOptions,an(this.h,Ks,3)?.h());un(n,0,2,r),un(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&an(this.h,Ks,3)?.g();return t.customGesturesClassifierOptions?(un(n=e=new Ks,0,2,r=So(t.customGesturesClassifierOptions,an(this.h,Ks,4)?.h())),un(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&an(this.h,Ks,4)?.g(),this.l(t)}Ja(t,e){return gc(this),qa(this,t,e),mc(this)}Ka(t,e,n){return gc(this),Ja(this,t,n,e),mc(this)}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"hand_gestures"),ts(t,"hand_landmarks"),ts(t,"world_hand_landmarks"),ts(t,"handedness");const e=new Vi;Yn(e,io,this.j);const n=new Yi;Wi(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"HAND_GESTURES:hand_gestures"),Ki(n,"LANDMARKS:hand_landmarks"),Ki(n,"WORLD_LANDMARKS:world_hand_landmarks"),Ki(n,"HANDEDNESS:handedness"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t){t=gs(e);const n=[];for(const e of hn(t,ps,1))n.push({x:yn(e,1)??0,y:yn(e,2)??0,z:yn(e,3)??0,visibility:yn(e,4)??0});this.landmarks.push(n)}qo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t){t=ds(e);const n=[];for(const e of hn(t,fs,1))n.push({x:yn(e,1)??0,y:yn(e,2)??0,z:yn(e,3)??0,visibility:yn(e,4)??0});this.worldLandmarks.push(n)}qo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("hand_gestures",((t,e)=>{this.gestures.push(...yc(t,!1)),qo(this,e)})),this.g.attachEmptyPacketListener("hand_gestures",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{this.handedness.push(...yc(t)),qo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function vc(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}_c.prototype.recognizeForVideo=_c.prototype.Ka,_c.prototype.recognize=_c.prototype.Ja,_c.prototype.setOptions=_c.prototype.o,_c.createFromModelPath=function(t,e){return Ya(_c,t,{baseOptions:{modelAssetPath:e}})},_c.createFromModelBuffer=function(t,e){return Ya(_c,t,{baseOptions:{modelAssetBuffer:e}})},_c.createFromOptions=function(t,e){return Ya(_c,t,e)},_c.HAND_CONNECTIONS=pc;var Ec=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],un(t=this.h=new Zs,0,1,e=new Ps),this.s=new Js,un(this.h,0,3,this.s),this.j=new qs,un(this.h,0,2,this.j),En(this.j,3,1),wn(this.j,2,.5),wn(this.s,2,.5),wn(this.h,4,.5)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"numHands"in t&&En(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&wn(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&wn(this.s,2,t.minHandPresenceConfidence??.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],qa(this,t,e),vc(this)}F(t,e,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ja(this,t,n,e),vc(this)}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"hand_landmarks"),ts(t,"world_hand_landmarks"),ts(t,"handedness");const e=new Vi;Yn(e,so,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"LANDMARKS:hand_landmarks"),Ki(n,"WORLD_LANDMARKS:world_hand_landmarks"),Ki(n,"HANDEDNESS:handedness"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t)t=gs(e),this.landmarks.push(Fo(t));qo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t)t=ds(e),this.worldLandmarks.push(Io(t));qo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{var n=this.handedness,r=n.push;const i=[];for(const e of t){t=as(e);const n=[];for(const e of t.g())n.push({score:yn(e,2)??0,index:gn(mn(e,1),0)??-1,categoryName:_n(e,3)??"",displayName:_n(e,4)??""});i.push(n)}r.call(n,...i),qo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ec.prototype.detectForVideo=Ec.prototype.F,Ec.prototype.detect=Ec.prototype.D,Ec.prototype.setOptions=Ec.prototype.o,Ec.createFromModelPath=function(t,e){return Ya(Ec,t,{baseOptions:{modelAssetPath:e}})},Ec.createFromModelBuffer=function(t,e){return Ya(Ec,t,{baseOptions:{modelAssetBuffer:e}})},Ec.createFromOptions=function(t,e){return Ya(Ec,t,e)},Ec.HAND_CONNECTIONS=pc;var wc=Ha([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 Tc(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function bc(t){try{if(!t.C)return t.h;t.C(t.h)}finally{Qo(t)}}function Ac(t,e){t=gs(t),e.push(Fo(t))}var kc=class extends Qa{constructor(t,e){super(new Ka(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,un(t=this.j=new ho,0,1,e=new Ps),this.K=new Js,un(this.j,0,2,this.K),this.aa=new oo,un(this.j,0,3,this.aa),this.s=new Us,un(this.j,0,4,this.s),this.I=new Gs,un(this.j,0,5,this.I),this.v=new ao,un(this.j,0,6,this.v),this.L=new co,un(this.j,0,7,this.L),wn(this.s,2,.5),wn(this.s,3,.3),wn(this.I,2,.5),wn(this.v,2,.5),wn(this.v,3,.3),wn(this.L,2,.5),wn(this.K,2,.5)}get baseOptions(){return an(this.j,Ps,1)}set baseOptions(t){un(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&wn(this.s,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&wn(this.s,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&wn(this.I,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&wn(this.v,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&wn(this.v,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&wn(this.L,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&wn(this.K,2,t.minHandLandmarksConfidence??.5),this.l(t)}D(t,e,n){const r="function"!=typeof e?e:{};return this.C="function"==typeof e?e:n,Tc(this),qa(this,t,r),bc(this)}F(t,e,n,r){const i="function"!=typeof n?n:{};return this.C="function"==typeof n?n:r,Tc(this),Ja(this,t,i,e),bc(this)}m(){var t=new es;Qi(t,"input_frames_image"),ts(t,"pose_landmarks"),ts(t,"pose_world_landmarks"),ts(t,"face_landmarks"),ts(t,"left_hand_landmarks"),ts(t,"left_hand_world_landmarks"),ts(t,"right_hand_landmarks"),ts(t,"right_hand_world_landmarks");const e=new Vi,n=new Ri;Ze(n,1,re("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(t,e){if(null!=e)if(Array.isArray(e))Ve(t,2,Me(e,Oe,void 0,void 0,!1));else{if(!("string"==typeof e||e instanceof B||C(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Ze(t,2,dt(e,!1),N())}}(n,this.j.g());const r=new Yi;Wi(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),pn(r,8,Ri,n),zi(r,"IMAGE:input_frames_image"),Ki(r,"POSE_LANDMARKS:pose_landmarks"),Ki(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Ki(r,"FACE_LANDMARKS:face_landmarks"),Ki(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Ki(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Ki(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Ki(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(e),Zi(t,r),Jo(this,t),this.g.attachProtoListener("pose_landmarks",((t,e)=>{Ac(t,this.h.poseLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("pose_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("pose_world_landmarks",((t,e)=>{var n=this.h.poseWorldLandmarks;t=ds(t),n.push(Io(t)),qo(this,e)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(t=>{qo(this,t)})),this.outputPoseSegmentationMasks&&(Ki(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Zo(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",((t,e)=>{this.h.poseSegmentationMasks=[Za(this,t,!0,!this.C)],qo(this,e)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(t=>{this.h.poseSegmentationMasks=[],qo(this,t)}))),this.g.attachProtoListener("face_landmarks",((t,e)=>{Ac(t,this.h.faceLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{qo(this,t)})),this.outputFaceBlendshapes&&(ts(t,"extra_blendshapes"),Ki(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((t,e)=>{var n=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=as(t),n.push(Lo(t.g()??[]))),qo(this,e)})),this.g.attachEmptyPacketListener("extra_blendshapes",(t=>{qo(this,t)}))),this.g.attachProtoListener("left_hand_landmarks",((t,e)=>{Ac(t,this.h.leftHandLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("left_hand_world_landmarks",((t,e)=>{var n=this.h.leftHandWorldLandmarks;t=ds(t),n.push(Io(t)),qo(this,e)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("right_hand_landmarks",((t,e)=>{Ac(t,this.h.rightHandLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("right_hand_world_landmarks",((t,e)=>{var n=this.h.rightHandWorldLandmarks;t=ds(t),n.push(Io(t)),qo(this,e)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};kc.prototype.detectForVideo=kc.prototype.F,kc.prototype.detect=kc.prototype.D,kc.prototype.setOptions=kc.prototype.o,kc.createFromModelPath=function(t,e){return Ya(kc,t,{baseOptions:{modelAssetPath:e}})},kc.createFromModelBuffer=function(t,e){return Ya(kc,t,{baseOptions:{modelAssetBuffer:e}})},kc.createFromOptions=function(t,e){return Ya(kc,t,e)},kc.HAND_CONNECTIONS=pc,kc.POSE_CONNECTIONS=wc,kc.FACE_LANDMARKS_LIPS=ec,kc.FACE_LANDMARKS_LEFT_EYE=nc,kc.FACE_LANDMARKS_LEFT_EYEBROW=rc,kc.FACE_LANDMARKS_LEFT_IRIS=ic,kc.FACE_LANDMARKS_RIGHT_EYE=sc,kc.FACE_LANDMARKS_RIGHT_EYEBROW=oc,kc.FACE_LANDMARKS_RIGHT_IRIS=ac,kc.FACE_LANDMARKS_FACE_OVAL=cc,kc.FACE_LANDMARKS_CONTOURS=hc,kc.FACE_LANDMARKS_TESSELATION=uc;var xc=class extends Qa{constructor(t,e){super(new Ka(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},un(t=this.h=new fo,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return un(this.h,0,2,So(t,an(this.h,xs,2))),this.l(t)}ta(t,e){return this.j={classifications:[]},qa(this,t,e),this.j}ua(t,e,n){return this.j={classifications:[]},Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"input_image"),Qi(t,"norm_rect"),ts(t,"classifications");const e=new Vi;Yn(e,po,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),zi(n,"IMAGE:input_image"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"CLASSIFICATIONS:classifications"),n.o(e),Zi(t,n),this.g.attachProtoListener("classifications",((t,e)=>{this.j=function(t){const e={classifications:hn(t,vs,1).map((t=>Lo(an(t,ss,4)?.g()??[],gn(mn(t,2),0),_n(t,3))))};return null!=te(Be(t,2))&&(e.timestampMs=gn(te(Be(t,2)),0)),e}(Es(t)),qo(this,e)})),this.g.attachEmptyPacketListener("classifications",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};xc.prototype.classifyForVideo=xc.prototype.ua,xc.prototype.classify=xc.prototype.ta,xc.prototype.setOptions=xc.prototype.o,xc.createFromModelPath=function(t,e){return Ya(xc,t,{baseOptions:{modelAssetPath:e}})},xc.createFromModelBuffer=function(t,e){return Ya(xc,t,{baseOptions:{modelAssetBuffer:e}})},xc.createFromOptions=function(t,e){return Ya(xc,t,e)};var Sc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!0),this.h=new go,this.embeddings={embeddings:[]},un(t=this.h,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){var e=this.h,n=an(this.h,Ls,2);return n=n?n.clone():new Ls,void 0!==t.l2Normalize?vn(n,1,t.l2Normalize):"l2Normalize"in t&&Ve(n,1),void 0!==t.quantize?vn(n,2,t.quantize):"quantize"in t&&Ve(n,2),un(e,0,2,n),this.l(t)}Aa(t,e){return qa(this,t,e),this.embeddings}Ba(t,e,n){return Ja(this,t,n,e),this.embeddings}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"embeddings_out");const e=new Vi;Yn(e,mo,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"EMBEDDINGS:embeddings_out"),n.o(e),Zi(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=ks(t),this.embeddings=function(t){return{embeddings:hn(t,bs,1).map((t=>{const e={headIndex:gn(mn(t,3),0)??-1,headName:_n(t,4)??""};if(void 0!==on(t,ws,tn(t,1)))t=Ke(t=an(t,ws,tn(t,1)),1,Wt,ze()),e.floatEmbedding=t.slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=an(t,Ts,tn(t,2))?.pa()?.h()??n}return e})),timestampMs:gn(te(Be(t,2)),0)}}(t),qo(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Sc.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Po(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Po(Mo(t.quantizedEmbedding),Mo(e.quantizedEmbedding))}return t},Sc.prototype.embedForVideo=Sc.prototype.Ba,Sc.prototype.embed=Sc.prototype.Aa,Sc.prototype.setOptions=Sc.prototype.o,Sc.createFromModelPath=function(t,e){return Ya(Sc,t,{baseOptions:{modelAssetPath:e}})},Sc.createFromModelBuffer=function(t,e){return Ya(Sc,t,{baseOptions:{modelAssetBuffer:e}})},Sc.createFromOptions=function(t,e){return Ya(Sc,t,e)};var Lc=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};function Rc(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Fc(t){try{const e=new Lc(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Qo(t)}}Lc.prototype.close=Lc.prototype.close;var Ic=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new wo,this.v=new yo,un(this.h,0,3,this.v),un(t=this.h,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?Ve(this.h,2,re(t.displayNamesLocale)):"displayNamesLocale"in t&&Ve(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}J(){!function(t){const e=hn(t.ea(),Yi,1).filter((t=>_n(t,1).includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(an(e[0],Vi,7)?.l()?.g()??new Map).forEach(((e,n)=>{t.s[Number(n)]=_n(e,1)}))}(this)}segment(t,e,n){const r="function"!=typeof e?e:{};return this.j="function"==typeof e?e:n,Rc(this),qa(this,t,r),Fc(this)}Ma(t,e,n,r){const i="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,Rc(this),Ja(this,t,i,e),Fc(this)}Ea(){return this.s}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect");const e=new Vi;Yn(e,To,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),n.o(e),Zi(t,n),Jo(this,t),this.outputConfidenceMasks&&(ts(t,"confidence_masks"),Ki(n,"CONFIDENCE_MASKS:confidence_masks"),Zo(this,"confidence_masks"),this.g.da("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>Za(this,t,!0,!this.j))),qo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],qo(this,t)}))),this.outputCategoryMask&&(ts(t,"category_mask"),Ki(n,"CATEGORY_MASK:category_mask"),Zo(this,"category_mask"),this.g.V("category_mask",((t,e)=>{this.categoryMask=Za(this,t,!1,!this.j),qo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,qo(this,t)}))),ts(t,"quality_scores"),Ki(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,qo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ic.prototype.getLabels=Ic.prototype.Ea,Ic.prototype.segmentForVideo=Ic.prototype.Ma,Ic.prototype.segment=Ic.prototype.segment,Ic.prototype.setOptions=Ic.prototype.o,Ic.createFromModelPath=function(t,e){return Ya(Ic,t,{baseOptions:{modelAssetPath:e}})},Ic.createFromModelBuffer=function(t,e){return Ya(Ic,t,{baseOptions:{modelAssetBuffer:e}})},Ic.createFromOptions=function(t,e){return Ya(Ic,t,e)};var Mc=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};Mc.prototype.close=Mc.prototype.close;var Pc=class extends $n{constructor(t){super(t)}},Oc=[0,li,-2],Cc=[0,ii,-3,pi,ii,-1],Uc=[0,Cc],Nc=[0,Cc,li,-1],Dc=class extends $n{constructor(t){super(t)}},Bc=[0,ii,-1,pi],Gc=class extends $n{constructor(){super()}},jc=class extends $n{constructor(t){super(t)}},Vc=[1,2,3,4,5,6,7,8,9,10,14,15],Xc=class extends $n{constructor(){super()}};Xc.prototype.g=Li([0,vi,[0,Vc,Ei,Cc,Ei,[0,Cc,Oc],Ei,Uc,Ei,[0,Uc,Oc],Ei,Bc,Ei,[0,ii,-3,pi,Ai],Ei,[0,ii,-3,pi],Ei,[0,_i,ii,-2,pi,li,pi,-1,2,ii,Oc],Ei,Nc,Ei,[0,Nc,Oc],ii,Oc,_i,Ei,[0,ii,-3,pi,Oc,-1],Ei,[0,vi,Bc]],_i,[0,_i,li,-1,pi]]);var Hc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new wo,this.s=new yo,un(this.h,0,3,this.s),un(t=this.h,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,n,r){const i="function"!=typeof n?n:{};this.j="function"==typeof n?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.B+1,r=new Xc;const s=new jc;var o=new Pc;if(En(o,1,255),un(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new Dc;vn(a,3,!0),wn(a,1,e.keypoint.x),wn(a,2,e.keypoint.y),ln(s,5,Vc,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new Gc,e.scribble))vn(e=new Dc,3,!0),wn(e,1,a.x),wn(e,2,a.y),pn(o,1,Dc,e);ln(s,15,Vc,o)}pn(r,1,jc,s),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),qa(this,t,i);t:{try{const t=new Mc(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=t;break t}this.j(t)}finally{Qo(this)}c=void 0}return c}m(){var t=new es;Qi(t,"image_in"),Qi(t,"roi_in"),Qi(t,"norm_rect_in");const e=new Vi;Yn(e,To,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),zi(n,"IMAGE:image_in"),zi(n,"ROI:roi_in"),zi(n,"NORM_RECT:norm_rect_in"),n.o(e),Zi(t,n),Jo(this,t),this.outputConfidenceMasks&&(ts(t,"confidence_masks"),Ki(n,"CONFIDENCE_MASKS:confidence_masks"),Zo(this,"confidence_masks"),this.g.da("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>Za(this,t,!0,!this.j))),qo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],qo(this,t)}))),this.outputCategoryMask&&(ts(t,"category_mask"),Ki(n,"CATEGORY_MASK:category_mask"),Zo(this,"category_mask"),this.g.V("category_mask",((t,e)=>{this.categoryMask=Za(this,t,!1,!this.j),qo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,qo(this,t)}))),ts(t,"quality_scores"),Ki(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,qo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Hc.prototype.segment=Hc.prototype.segment,Hc.prototype.setOptions=Hc.prototype.o,Hc.createFromModelPath=function(t,e){return Ya(Hc,t,{baseOptions:{modelAssetPath:e}})},Hc.createFromModelBuffer=function(t,e){return Ya(Hc,t,{baseOptions:{modelAssetBuffer:e}})},Hc.createFromOptions=function(t,e){return Ya(Hc,t,e)};var Wc=class extends Qa{constructor(t,e){super(new Ka(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},un(t=this.h=new bo,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?Ve(this.h,2,re(t.displayNamesLocale)):"displayNamesLocale"in t&&Ve(this.h,2),void 0!==t.maxResults?En(this.h,3,t.maxResults):"maxResults"in t&&Ve(this.h,3),void 0!==t.scoreThreshold?wn(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&Ve(this.h,4),void 0!==t.categoryAllowlist?Tn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&Ve(this.h,5),void 0!==t.categoryDenylist?Tn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&Ve(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},qa(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"input_frame_gpu"),Qi(t,"norm_rect"),ts(t,"detections");const e=new Vi;Yn(e,Ao,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),zi(n,"IMAGE:input_frame_gpu"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"DETECTIONS:detections"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=ls(e),this.j.detections.push(Ro(t));qo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Wc.prototype.detectForVideo=Wc.prototype.F,Wc.prototype.detect=Wc.prototype.D,Wc.prototype.setOptions=Wc.prototype.o,Wc.createFromModelPath=async function(t,e){return Ya(Wc,t,{baseOptions:{modelAssetPath:e}})},Wc.createFromModelBuffer=function(t,e){return Ya(Wc,t,{baseOptions:{modelAssetBuffer:e}})},Wc.createFromOptions=function(t,e){return Ya(Wc,t,e)};var zc=class{constructor(t,e,n){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=n}close(){this.segmentationMasks?.forEach((t=>{t.close()}))}};function Kc(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Yc(t){try{const e=new zc(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{Qo(t)}}zc.prototype.close=zc.prototype.close;var $c=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,un(t=this.h=new ko,0,1,e=new Ps),this.v=new co,un(this.h,0,3,this.v),this.j=new ao,un(this.h,0,2,this.j),En(this.j,4,1),wn(this.j,2,.5),wn(this.v,2,.5),wn(this.h,4,.5)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"numPoses"in t&&En(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&wn(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&wn(this.v,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}D(t,e,n){const r="function"!=typeof e?e:{};return this.s="function"==typeof e?e:n,Kc(this),qa(this,t,r),Yc(this)}F(t,e,n,r){const i="function"!=typeof n?n:{};return this.s="function"==typeof n?n:r,Kc(this),Ja(this,t,i,e),Yc(this)}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"normalized_landmarks"),ts(t,"world_landmarks"),ts(t,"segmentation_masks");const e=new Vi;Yn(e,xo,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"NORM_LANDMARKS:normalized_landmarks"),Ki(n,"WORLD_LANDMARKS:world_landmarks"),n.o(e),Zi(t,n),Jo(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((t,e)=>{this.landmarks=[];for(const e of t)t=gs(e),this.landmarks.push(Fo(t));qo(this,e)})),this.g.attachEmptyPacketListener("normalized_landmarks",(t=>{this.landmarks=[],qo(this,t)})),this.g.attachProtoVectorListener("world_landmarks",((t,e)=>{this.worldLandmarks=[];for(const e of t)t=ds(e),this.worldLandmarks.push(Io(t));qo(this,e)})),this.g.attachEmptyPacketListener("world_landmarks",(t=>{this.worldLandmarks=[],qo(this,t)})),this.outputSegmentationMasks&&(Ki(n,"SEGMENTATION_MASK:segmentation_masks"),Zo(this,"segmentation_masks"),this.g.da("segmentation_masks",((t,e)=>{this.segmentationMasks=t.map((t=>Za(this,t,!0,!this.s))),qo(this,e)})),this.g.attachEmptyPacketListener("segmentation_masks",(t=>{this.segmentationMasks=[],qo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$c.prototype.detectForVideo=$c.prototype.F,$c.prototype.detect=$c.prototype.D,$c.prototype.setOptions=$c.prototype.o,$c.createFromModelPath=function(t,e){return Ya($c,t,{baseOptions:{modelAssetPath:e}})},$c.createFromModelBuffer=function(t,e){return Ya($c,t,{baseOptions:{modelAssetBuffer:e}})},$c.createFromOptions=function(t,e){return Ya($c,t,e)},$c.POSE_CONNECTIONS=wc,exports.FaceDetector=tc,exports.FaceLandmarker=fc,exports.FaceStylizer=dc,exports.FilesetResolver=Do,exports.GestureRecognizer=_c,exports.HandLandmarker=Ec,exports.HolisticLandmarker=kc,exports.ImageClassifier=xc,exports.ImageEmbedder=Sc,exports.ImageSegmenter=Ic,exports.ImageSegmenterResult=Lc,exports.InteractiveSegmenter=Hc,exports.InteractiveSegmenterResult=Mc,exports.MPImage=Va,exports.MPMask=Ta,exports.ObjectDetector=Wc,exports.PoseLandmarker=$c,exports.VisionTaskRunner=Qa;\n//# sourceMappingURL=vision_bundle_cjs.js.map\n';
|
|
1881
|
+
`, Fc = '"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){e=e.split(".");var r,i=t;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===n?i=i[r]&&i[r]!==Object.prototype[r]?i[r]:i[r]={}:i[r]=n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,s;const o="undefined"!=typeof TextDecoder;let a;const c="undefined"!=typeof TextEncoder;function h(t){if(c)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){const s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var u,l;t:{for(var f=["CLOSURE_FLAGS"],d=t,p=0;p<f.length;p++)if(null==(d=d[f[p]])){l=null;break t}l=d}var g,m=l&&l[610401301];u=null!=m&&m;const y=t.navigator;function _(t){return!!u&&(!!g&&g.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function v(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function E(){return!!u&&(!!g&&g.brands.length>0)}function w(){return E()?_("Chromium"):(v("Chrome")||v("CriOS"))&&!(!E()&&v("Edge"))||v("Silk")}function T(t){return T[" "](t),t}g=y&&y.userAgentData||null,T[" "]=function(){};var b=!E()&&(v("Trident")||v("MSIE"));!v("Android")||w(),w(),v("Safari")&&(w()||!E()&&v("Coast")||!E()&&v("Opera")||!E()&&v("Edge")||(E()?_("Microsoft Edge"):v("Edg/"))||E()&&_("Opera"));var A={},k=null;function x(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let i=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=k[e];if(null!=n)return n;if(!/^[\\s\\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}S();let r=0;for(;;){const t=n(-1),r=n(0),i=n(64),s=n(64);if(64===s&&-1===t)break;e(t<<2|r>>4),64!=i&&(e(r<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function S(){if(!k){k={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));A[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===k[e]&&(k[e]=t)}}}}var L="undefined"!=typeof Uint8Array,R=!b&&"function"==typeof btoa;function F(t){if(!R){var e;void 0===e&&(e=0),S(),e=A[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let c=0,h=0;for(;c<t.length-2;c+=3){var i=t[c],s=t[c+1],o=t[c+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[h++]=a+i+s+o}switch(a=0,o=r,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||r;case 1:t=t[c],n[h]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const I=/[-_.]/g,M={"-":"+",_:"/",".":"="};function P(t){return M[t]||""}function O(t){if(!R)return x(t);I.test(t)&&(t=t.replace(I,P)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function C(t){return L&&null!=t&&t instanceof Uint8Array}var U={};function N(){return G||=new B(null,U)}function D(t){V(U);var e=t.g;return null==(e=null==e||C(e)?e:"string"==typeof e?O(e):null)?e:t.g=e}var B=class{h(){return new Uint8Array(D(this)||0)}constructor(t,e){if(V(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let G,j;function V(t){if(t!==U)throw Error("illegal external caller")}function X(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function H(){const e=Error();X(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function W(t){return X(t=Error(t),"warning"),t}function z(){return"function"==typeof BigInt}function K(t){return Array.prototype.slice.call(t)}var Y="function"==typeof Symbol&&"symbol"==typeof Symbol();function $(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var q=$(),J=$("0di"),Z=$("2ex"),Q=$("1oa"),tt=Y?(t,e)=>{t[q]|=e}:(t,e)=>{void 0!==t.G?t.G|=e:Object.defineProperties(t,{G:{value:e,configurable:!0,writable:!0,enumerable:!1}})},et=Y?(t,e)=>{t[q]&=~e}:(t,e)=>{void 0!==t.G&&(t.G&=~e)},nt=Y?t=>0|t[q]:t=>0|t.G,rt=Y?t=>t[q]:t=>t.G,it=Y?(t,e)=>{t[q]=e}:(t,e)=>{void 0!==t.G?t.G=e:Object.defineProperties(t,{G:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function st(t){return tt(t,34),t}function ot(t,e){it(e,-30975&(0|t))}function at(t,e){it(e,-30941&(34|t))}var ct,ht={},ut={};function lt(t){return!(!t||"object"!=typeof t||t.Ia!==ut)}function ft(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function dt(t,e){if(null!=t)if("string"==typeof t)t=t?new B(t,U):N();else if(t.constructor!==B)if(C(t))t=t.length?new B(new Uint8Array(t),U):N();else{if(!e)throw Error();t=void 0}return t}function pt(t){return!(!Array.isArray(t)||t.length)&&!!(1&nt(t))}const gt=[];function mt(t){if(2&t)throw Error()}it(gt,55),ct=Object.freeze(gt);class yt{constructor(t,e,n){this.l=0,this.g=t,this.h=e,this.m=n}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new yt(this.g,this.h,this.m)}}let _t;function vt(t,e){(e=_t?e[_t]:void 0)&&(t[_t]=K(e))}var Et=Object.freeze({});function wt(t){return t.Pa=!0,t}var Tt=wt((t=>"number"==typeof t)),bt=wt((t=>"string"==typeof t)),At=wt((t=>"boolean"==typeof t)),kt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),xt=wt((t=>kt?t>=Lt&&t<=Ft:"-"===t[0]?It(t,St):It(t,Rt)));const St=Number.MIN_SAFE_INTEGER.toString(),Lt=kt?BigInt(Number.MIN_SAFE_INTEGER):void 0,Rt=Number.MAX_SAFE_INTEGER.toString(),Ft=kt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function It(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}const Mt="function"==typeof Uint8Array.prototype.slice;let Pt,Ot=0,Ct=0;function Ut(t){const e=t>>>0;Ot=e,Ct=(t-e)/4294967296>>>0}function Nt(t){if(t<0){Ut(-t);const[e,n]=Ht(Ot,Ct);Ot=e>>>0,Ct=n>>>0}else Ut(t)}function Dt(t){const e=Pt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Ct=0,Ot=e.getUint32(0,!0)}function Bt(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:jt(t,e)}function Gt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),"number"==typeof(t=Bt(t,e))?n?-t:t:n?"-"+t:t}function jt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else z()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+Vt(n)+Vt(t));return n}function Vt(t){return t=String(t),"0000000".slice(t.length)+t}function Xt(t){if(t.length<16)Nt(Number(t));else if(z())t=BigInt(t),Ot=Number(t&BigInt(4294967295))>>>0,Ct=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Ct=Ot=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));Ct*=1e6,Ot=1e6*Ot+e,Ot>=4294967296&&(Ct+=Math.trunc(Ot/4294967296),Ct>>>=0,Ot>>>=0)}if(e){const[t,e]=Ht(Ot,Ct);Ot=t,Ct=e}}}function Ht(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Wt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function zt(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}const Kt=/^-?([1-9][0-9]*|0)(\\.[0-9]+)?$/;function Yt(t){const e=typeof t;switch(e){case"bigint":return!0;case"number":return Number.isFinite(t)}return"string"===e&&Kt.test(t)}function $t(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function qt(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?t>>>0:void 0}function Jt(t){return"-"!==t[0]&&(t.length<20||20===t.length&&Number(t.substring(0,6))<184467)}function Zt(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Nt(t),t=Gt(Ot,Ct)),t}function Qt(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?t.length<20||20===t.length&&Number(t.substring(0,7))>-922337:t.length<19||19===t.length&&Number(t.substring(0,6))<922337))if(Xt(t),t=Ot,2147483648&(e=Ct))if(z())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Ht(t,e);t="-"+jt(n,r)}else t=jt(t,e);return t}function te(t){return null==t?t:"bigint"==typeof t?(xt(t)?t=Number(t):(t=BigInt.asIntN(64,t),t=xt(t)?Number(t):String(t)),t):Yt(t)?"number"==typeof t?Zt(t):Qt(t):void 0}function ee(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(BigInt.asUintN(64,t));if(Yt(t)){if("string"===e)return e=Math.trunc(Number(t)),Number.isSafeInteger(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Jt(t)||(Xt(t),t=jt(Ot,Ct))),t;if("number"===e)return(t=Math.trunc(t))>=0&&Number.isSafeInteger(t)?t:function(t){if(t<0){Nt(t);var e=jt(Ot,Ct);return t=Number(e),Number.isSafeInteger(t)?t:e}return Jt(e=String(t))?e:(Nt(t),Bt(Ot,Ct))}(t)}}function ne(t){if("string"!=typeof t)throw Error();return t}function re(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ie(t){return null==t||"string"==typeof t?t:void 0}function se(t,e,n,r){if(null!=t&&"object"==typeof t&&t.X===ht)return t;if(!Array.isArray(t))return n?2&r?(t=e[J])?e=t:(st((t=new e).u),e=e[J]=t):e=new e:e=void 0,e;let i=n=nt(t);return 0===i&&(i|=32&r),i|=2&r,i!==n&&it(t,i),new e(t)}function oe(t,e,n){if(e)t:{if(!Yt(e=t))throw W("int64");switch(typeof e){case"string":e=Qt(e);break t;case"bigint":if(t=e=BigInt.asIntN(64,e),bt(t)){if(!/^\\s*(?:-?[1-9]\\d*|0)?\\s*$/.test(t))throw Error(String(t))}else if(Tt(t)&&!Number.isSafeInteger(t))throw Error(String(t));e=kt?BigInt(e):At(e)?e?"1":"0":bt(e)?e.trim()||"0":String(e);break t;default:e=Zt(e)}}else e=te(t);return"string"==typeof(n=null==(t=e)?n?0:void 0:t)&&(e=+n,Number.isSafeInteger(e))?e:n}function ae(t){var e;return void 0===ue&&(ue="function"==typeof Proxy?me(Proxy):null),(e=!ue)||(void 0===le&&(le="function"==typeof WeakMap?me(WeakMap):null),e=!le),e?t:(e=ce?.get(t))?e:Math.random()>.01?t:(function(t){if(void 0===fe){const t=new ue([],{});fe=1===Array.prototype.concat.call([],t).length}fe&&"function"==typeof Symbol&&Symbol.isConcatSpreadable&&(t[Symbol.isConcatSpreadable]=!0)}(t),function(t,e){(ce||=new le).set(t,e),(he||=new le).set(e,t)}(t,e=new ue(t,{set:(t,e,n)=>(H(),t[e]=n,!0)})),e)}let ce,he,ue,le,fe,de,pe,ge;function me(t){try{return-1!==t.toString().indexOf("[native code]")?t:null}catch{return null}}function ye(t,e,n){return t=_e(t,e[0],e[1],n?1:2),e!==pe&&n&&tt(t,16384),t}function _e(t,e,n,r){if(r=r??0,null==t&&(t=de),de=void 0,null==t){var i=96;n?(t=[n],i|=512):t=[],e&&(i=-33521665&i|(1023&e)<<15)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(i=nt(t)))throw Error("farr");if(64&i)return t;if(1===r||2===r||(i|=64),n&&(i|=512,n!==t[0]))throw Error("mid");t:{if(r=(n=t).length){const t=r-1;if(ft(n[t])){if((e=t-(+!!(512&(i|=256))-1))>=1024)throw Error("pvtlmt");i=-33521665&i|(1023&e)<<15;break t}}if(e){if((e=Math.max(e,r-(+!!(512&i)-1)))>1024)throw Error("spvt");i=-33521665&i|(1023&e)<<15}}}return it(t,i),t}const ve={};let Ee=function(){try{return T(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class we{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()}}const Te=Ee?(Object.setPrototypeOf(we.prototype,Map.prototype),Object.defineProperties(we.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),we):class extends Map{constructor(){super()}};function be(t){return t}function Ae(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var ke=class extends Te{constructor(t,e,n=be,r=be){super();let i=nt(t);i|=64,it(t,i),this.M=i,this.T=e,this.S=n,this.Z=this.T?xe:r;for(let s=0;s<t.length;s++){const o=t[s],a=n(o[0],!1,!0);let c=o[1];e?void 0===c&&(c=null):c=r(o[1],!1,!0,void 0,void 0,i),super.set(a,c)}}oa(t=Se){if(0!==this.size)return this.Y(t)}Y(t=Se){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){Ae(this),super.clear()}delete(t){return Ae(this),super.delete(this.S(t,!0,!1))}entries(){var t=this.na();return new yt(t,Le,this)}keys(){return this.Ha()}values(){var t=this.na();return new yt(t,ke.prototype.get,this)}forEach(t,e){super.forEach(((n,r)=>{t.call(e,this.get(r),r,this)}))}set(t,e){return Ae(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.Z(e,!0,!0,this.T,!1,this.M))}Na(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.T?void 0===t?null:t:this.Z(t,!1,!0,void 0,!1,this.M),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.T;return n?((n=this.Z(e,!1,!0,n,this.sa,this.M))!==e&&super.set(t,n),n):e}}na(){return Array.from(super.keys())}Ha(){return super.keys()}[Symbol.iterator](){return this.entries()}};function xe(t,e,n,r,i,s){return t=se(t,r,n,s),i&&(t=De(t)),t}function Se(t){return t}function Le(t){return[t,this.get(t)]}let Re;function Fe(){return Re||=new ke(st([]),void 0,void 0,void 0,ve)}function Ie(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=pt(t)?void 0:i&&2&nt(t)?t:Me(t,e,n,void 0!==r,i);else if(ft(t)){const s={};for(let o in t)s[o]=Ie(t[o],e,n,r,i);t=s}else t=e(t,r);return t}}function Me(t,e,n,r,i){const s=r||n?nt(t):0;r=r?!!(32&s):void 0;const o=K(t);for(let t=0;t<o.length;t++)o[t]=Ie(o[t],e,n,r,i);return n&&(vt(o,t),n(s,o)),o}function Pe(t){return Ie(t,Oe,void 0,void 0,!1)}function Oe(t){return t.X===ht?t.toJSON():t instanceof ke?t.oa(Pe):function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return xt(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(pt(t))return}else{if(C(t))return F(t);if(t instanceof B){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=F(e)}if(t instanceof ke)return t.oa()}}return t}(t)}function Ce(t,e,n=at){if(null!=t){if(L&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=nt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(it(t,-12293&(34|r)),t):Me(t,Ce,4&r?at:n,!0,!0))}return t.X===ht?(n=t.u,t=2&(r=rt(n))?t:Ue(t,n,r,!0)):t instanceof ke&&!(2&t.M)&&(n=st(t.Y(Ce)),t=new ke(n,t.T,t.S,t.Z)),t}}function Ue(t,e,n,r){return t=t.constructor,de=e=Ne(e,n,r),e=new t(e),de=void 0,e}function Ne(t,e,n){const r=n||2&e?at:ot,i=!!(32&e);return t=function(t,e,n){const r=K(t);var i=r.length;const s=256&e?r[i-1]:void 0;for(i+=s?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(s){e=r[e]={};for(const t in s)e[t]=n(s[t])}return vt(r,t),r}(t,e,(t=>Ce(t,i,r))),tt(t,32|(n?2:0)),t}function De(t){const e=t.u,n=rt(e);return 2&n?Ue(t,e,n,!1):t}function Be(t,e){return je(t=t.u,rt(t),e)}function Ge(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function je(t,e,n,r){if(-1===n)return null;const i=e>>15&1023||536870912;if(!(n>=i)){var s=t.length;return r&&256&e&&null!=(r=t[s-1][n])?(Ge(t,e,i,n)&&null!=Z&&((e=(t=j??={})[Z]||0)>=4||(t[Z]=e+1,H())),r):Ge(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function Ve(t,e,n){const r=t.u;let i=rt(r);return mt(i),Xe(r,i,e,n),t}function Xe(t,e,n,r){const i=e>>15&1023||536870912;if(n>=i){let s,o=e;if(256&e)s=t[t.length-1];else{if(null==r)return o;s=t[i+(+!!(512&e)-1)]={},o|=256}return s[n]=r,n<i&&(t[n+(+!!(512&e)-1)]=void 0),o!==e&&it(t,o),o}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function He(t,e){t=t.u;let n=rt(t);const r=je(t,n,e),i=Wt(r);return null!=i&&i!==r&&Xe(t,n,e,i),i}function We(t){t=t.u;let e=rt(t);const n=je(t,e,1),r=dt(n,!0);return null!=r&&r!==n&&Xe(t,e,1,r),r}function ze(){return void 0===Et?2:4}function Ke(t,e,n,r,i){const s=t.u,o=2&(t=rt(s))?1:r;i=!!i,r=Ye(s,t,e);var a=nt(r);if(!(4&a)){4&a&&(r=K(r),a=fn(a,t),t=Xe(s,t,e,r));let i=0,o=0;for(;i<r.length;i++){const t=n(r[i]);null!=t&&(r[o++]=t)}o<i&&(r.length=o),a=-4097&(20|(a=$e(a,t))),it(r,a&=-8193),2&a&&Object.freeze(r)}let c;return 1===o||4===o&&32&a?qe(a)||(i=a,(a|=2)!==i&&it(r,a),Object.freeze(r)):(n=5===o&&(!!(32&a)||qe(a)||!!ce?.get(r)),(2===o||n)&&qe(a)&&(r=K(r),a=dn(a=fn(a,t),t,i),it(r,a),t=Xe(s,t,e,r)),qe(a)||(e=a,(a=dn(a,t,i))!==e&&it(r,a)),n?c=ae(r):2!==o||i||ce?.delete(r)),c||r}function Ye(t,e,n,r){return t=je(t,e,n,r),Array.isArray(t)?t:ct}function $e(t,e){return 0===t&&(t=fn(t,e)),1|t}function qe(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Je(t){t=K(t);for(let e=0;e<t.length;e++){const n=t[e]=K(t[e]);Array.isArray(n[1])&&(n[1]=st(n[1]))}return t}function Ze(t,e,n,r){t=t.u;let i=rt(t);mt(i),Xe(t,i,e,("0"===r?0===Number(n):n===r)?void 0:n)}function Qe(t,e,n,r,i){mt(e);var s=!(!(64&e)&&16384&e);const o=(i=Ye(t,e,n,i))!==ct;if(s||!o){let a=s=o?nt(i):0;(!o||2&a||qe(a)||4&a&&!(32&a))&&(i=K(i),a=fn(a,e),e=Xe(t,e,n,i)),a=-13&$e(a,e),a=dn(r?-17&a:16|a,e,!0),a!==s&&it(i,a)}return i}function tn(t,e){var n=As;return rn(en(t=t.u),t,rt(t),n)===e?e:-1}function en(t){if(Y)return t[Q]??(t[Q]=new Map);if(Q in t)return t[Q];const e=new Map;return Object.defineProperty(t,Q,{value:e}),e}function nn(t,e,n,r){const i=en(t),s=rn(i,t,e,n);return s!==r&&(s&&(e=Xe(t,e,s)),i.set(n,r)),e}function rn(t,e,n,r){let i=t.get(r);if(null!=i)return i;i=0;for(let t=0;t<r.length;t++){const s=r[t];null!=je(e,n,s)&&(0!==i&&(n=Xe(e,n,i)),i=s)}return t.set(r,i),i}function sn(t,e,n,r){let i,s=rt(t);if(null!=(r=je(t,s,n,r))&&r.X===ht)return(e=De(r))!==r&&Xe(t,s,n,e),e.u;if(Array.isArray(r)){const t=nt(r);i=2&t?ye(Ne(r,t,!1),e,!0):64&t?r:ye(i,e,!0)}else i=ye(void 0,e,!0);return i!==r&&Xe(t,s,n,i),i}function on(t,e,n,r){t=t.u;let i=rt(t);return(e=se(r=je(t,i,n,r),e,!1,i))!==r&&null!=e&&Xe(t,i,n,e),e}function an(t,e,n,r=!1){if(null==(e=on(t,e,n,r)))return e;if(t=t.u,!(2&(r=rt(t)))){const i=De(e);i!==e&&Xe(t,r,n,e=i)}return e}function cn(t,e,n,r,i,s,o){t=t.u;var a=!!(2&e);i=a?1:i,s=!!s,o&&=!a,a=Ye(t,e,r);var c=nt(a),h=!!(4&c);if(!h){var u=a,l=e;const t=!!(2&(c=$e(c,e)));t&&(l|=2);let r=!t,i=!0,s=0,o=0;for(;s<u.length;s++){const e=se(u[s],n,!1,l);if(e instanceof n){if(!t){const t=!!(2&nt(e.u));r&&=!t,i&&=t}u[o++]=e}}o<s&&(u.length=o),c|=4,c=i?16|c:-17&c,it(u,c=r?8|c:-9&c),t&&Object.freeze(u)}if(o&&!(8&c||!a.length&&(1===i||4===i&&32&c))){for(qe(c)&&(a=K(a),c=fn(c,e),e=Xe(t,e,r,a)),n=a,o=c,u=0;u<n.length;u++)(c=n[u])!==(l=De(c))&&(n[u]=l);o|=8,o=n.length?-17&o:16|o,it(n,o),c=o}let f;return 1===i||4===i&&32&c?qe(c)||(e=c,(c|=!a.length||16&c&&(!h||32&c)?2:2048)!==e&&it(a,c),Object.freeze(a)):(h=5===i&&(!!(32&c)||qe(c)||!!ce?.get(a)),(2===i||h)&&qe(c)&&(a=K(a),c=dn(c=fn(c,e),e,s),it(a,c),e=Xe(t,e,r,a)),qe(c)||(r=c,(c=dn(c,e,s))!==r&&it(a,c)),h?f=ae(a):2!==i||s||ce?.delete(a)),f||a}function hn(t,e,n){const r=rt(t.u);return cn(t,r,e,n,ze(),!1,!(2&r))}function un(t,e,n,r){return null==r&&(r=void 0),Ve(t,n,r)}function ln(t,e,n,r){null==r&&(r=void 0);t:{t=t.u;let i=rt(t);if(mt(i),null==r){const r=en(t);if(rn(r,t,i,n)!==e)break t;r.set(n,0)}else i=nn(t,i,n,e);Xe(t,i,e,r)}}function fn(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function dn(t,e,n){return 32&e&&n||(t&=-33),t}function pn(t,e,n,r){const i=rt(t.u);mt(i),t=cn(t,i,n,e,2,!0),r=null!=r?r:new n,t.push(r),2&nt(r.u)?et(t,8):et(t,16)}function gn(t,e){return t??e}function mn(t,e){return $t(Be(t,e))}function yn(t,e){return gn(He(t,e),0)}function _n(t,e){return gn(ie(Be(t,e)),"")}function vn(t,e,n){if(null!=n&&"boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);Ve(t,e,n)}function En(t,e,n){if(null!=n){if("number"!=typeof n)throw W("int32");if(!Number.isFinite(n))throw W("int32");n|=0}Ve(t,e,n)}function wn(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Ve(t,e,n)}function Tn(t,e,n){{const o=t.u;let a=rt(o);if(mt(a),null==n)Xe(o,a,e);else{n=he?.get(n)||n;var r=t=nt(n),i=qe(t),s=i||Object.isFrozen(n);for(i||(t=0),s||(n=K(n),r=0,t=dn(t=fn(t,a),a,!0),s=!1),t|=21,i=0;i<n.length;i++){const e=n[i],o=ne(e);Object.is(e,o)||(s&&(n=K(n),r=0,t=dn(t=fn(t,a),a,!0),s=!1),n[i]=o)}t!==r&&(s&&(n=K(n),t=dn(t=fn(t,a),a,!0)),it(n,t)),Xe(o,a,e,n)}}}function bn(t,e,n){mt(rt(t.u)),Ke(t,e,ie,2,!0).push(ne(n))}function An(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function kn(){return Error("Failed to read varint, encoding is invalid.")}function xn(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function Sn(t){if("string"==typeof t)return{buffer:O(t),O:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:!1};if(t.constructor===Uint8Array)return{buffer:t,O:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:!1};if(t.constructor===B)return{buffer:D(t)||new Uint8Array(0),O:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Ln(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(s<32&&128&n);for(s>32&&(i|=(127&n)>>4),s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(Un(t,a),n<128)return e(r>>>0,i>>>0);throw kn()}function Rn(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return Un(t,n),!!(127&e)}throw kn()}function Fn(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw kn();return Un(t,n),i}function In(t){return Fn(t)>>>0}function Mn(t){var e=t.h;const n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],Un(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function Pn(t){var e=Mn(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:t*(1/0):0==n?1401298464324817e-60*t*e:t*Math.pow(2,n-150)*(e+8388608)}function On(t){return Fn(t)}function Cn(t,e,{ca:n=!1}={}){t.ca=n,e&&(e=Sn(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function Un(t,e){if(t.g=e,e>t.l)throw xn(t.l,e)}function Nn(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw xn(e,t.l-n);return t.g=r,n}function Dn(t,e){if(0==e)return N();var n=Nn(t,e);return t.ca&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):Mt?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?N():new B(n,U)}ke.prototype.toJSON=void 0,ke.prototype.Ia=ut;var Bn=[];function Gn(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=In(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5))throw An(n,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function jn(t){switch(t.h){case 0:0!=t.h?jn(t):Rn(t.g);break;case 1:Un(t=t.g,t.g+8);break;case 2:if(2!=t.h)jn(t);else{var e=In(t.g);Un(t=t.g,t.g+e)}break;case 5:Un(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Gn(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}jn(t)}break;default:throw An(t.h,t.l)}}function Vn(t,e,n){const r=t.g.l,i=In(t.g),s=t.g.g+i;let o=s-r;if(o<=0&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function Xn(t){var e=In(t.g),a=Nn(t=t.g,e);if(t=t.h,o){var c,h=t;(c=s)||(c=s=new TextDecoder("utf-8",{fatal:!0})),e=a+e,h=0===a&&e===h.length?h:h.subarray(a,e);try{var u=c.decode(h)}catch(t){if(void 0===i){try{c.decode(new Uint8Array([128]))}catch(t){}try{c.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(s=void 0),t}}else{e=(u=a)+e,a=[];let i,s=null;for(;u<e;){var l=t[u++];l<128?a.push(l):l<224?u>=e?n():(i=t[u++],l<194||128!=(192&i)?(u--,n()):a.push((31&l)<<6|63&i)):l<240?u>=e-1?n():(i=t[u++],128!=(192&i)||224===l&&i<160||237===l&&i>=160||128!=(192&(c=t[u++]))?(u--,n()):a.push((15&l)<<12|(63&i)<<6|63&c)):l<=244?u>=e-2?n():(i=t[u++],128!=(192&i)||i-144+(l<<28)>>30!=0||128!=(192&(c=t[u++]))||128!=(192&(h=t[u++]))?(u--,n()):(l=(7&l)<<18|(63&i)<<12|(63&c)<<6|63&h,l-=65536,a.push(55296+(l>>10&1023),56320+(1023&l)))):n(),a.length>=8192&&(s=r(s,a),a.length=0)}u=r(s,a)}return u}function Hn(t){const e=In(t.g);return Dn(t.g,e)}function Wn(t,e,n){var r=In(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var zn=[];let Kn;function Yn(t,e,n){e.g?e.m(t,e.g,e.h,n,!0):e.m(t,e.h,n,!0)}var $n=class{constructor(t,e){this.u=_e(t,e)}toJSON(){return qn(this)}l(){var t=Eo;return t.g?t.l(this,t.g,t.h,!0):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.u;return Ue(this,t,rt(t),!1)}O(){return!!(2&nt(this.u))}};function qn(t){t=t.u,t=Kn?t:Me(t,Oe,void 0,void 0,!1);{var e=!Kn;let h=t.length;if(h){var n=t[h-1],r=ft(n);r?h--:n=void 0;var i=t;if(r){t:{var s,o=n,a=!1;if(o)for(let t in o)isNaN(+t)?(s??={})[t]=o[t]:(r=o[t],Array.isArray(r)&&(pt(r)||lt(r)&&0===r.size)&&(r=null),null==r&&(a=!0),null!=r&&((s??={})[t]=r));if(a||(s=o),s)for(let t in s){a=s;break t}a=null}o=null==a?null!=n:a!==n}for(;h>0&&(null==(s=i[h-1])||pt(s)||lt(s)&&0===s.size);h--)var c=!0;(i!==t||o||c)&&(e?(c||o||a)&&(i.length=h):i=Array.prototype.slice.call(i,0,h),a&&i.push(a)),c=i}else c=t}return c}function Jn(t){return t?/^\\d+$/.test(t)?(Xt(t),new Zn(Ot,Ct)):null:Qn||=new Zn(0,0)}$n.prototype.X=ht,$n.prototype.toString=function(){try{return Kn=!0,qn(this).toString()}finally{Kn=!1}};var Zn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Qn;function tr(t){return t?/^-?\\d+$/.test(t)?(Xt(t),new er(Ot,Ct)):null:nr||=new er(0,0)}var er=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let nr;function rr(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function ir(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function sr(t,e){if(e>=0)ir(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function or(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function ar(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function cr(t,e,n){ir(t.g,8*e+n)}function hr(t,e){return cr(t,e,2),e=t.g.end(),ar(t,e),e.push(t.h),e}function ur(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function lr(t,e,n){cr(t,e,2),ir(t.g,n.length),ar(t,t.g.end()),ar(t,n)}function fr(t,e,n,r){null!=n&&(e=hr(t,e),r(n,t),ur(t,e))}function dr(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var pr=dr(),gr=dr(),mr=dr(),yr=dr(),_r=dr(),vr=dr(),Er=dr(),wr=dr(),Tr=dr(),br=class{constructor(t,e,n){this.g=t,this.h=e,t=pr,this.l=!!t&&n===t||!1}};function Ar(t,e){return new br(t,e,pr)}function kr(t,e,n,r,i){fr(t,n,Ur(e,r),i)}const xr=Ar((function(t,e,n,r,i){return 2===t.h&&(Vn(t,sn(e,r,n),i),!0)}),kr),Sr=Ar((function(t,e,n,r,i){return 2===t.h&&(Vn(t,sn(e,r,n,!0),i),!0)}),kr);var Lr=Symbol(),Rr=Symbol(),Fr=Symbol(),Ir=Symbol();let Mr,Pr;function Or(t,e,n,r){var i=r[t];if(i)return i;(i={}).W=function(t){switch(typeof t){case"boolean":return pe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ge||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ha=s,"function"==typeof(s=r[++o])&&(i.ma=!0,Mr??=s,Pr??=r[o+1],s=r[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=r[++o]}for(c=1;void 0!==s;){let t;"number"==typeof s&&(c+=s,s=r[++o]);var h=void 0;if(s instanceof br?t=s:(t=xr,o--),t?.l){s=r[++o],h=r;var u=o;"function"==typeof s&&(s=s(),h[u]=s),h=s}for(u=c+1,"number"==typeof(s=r[++o])&&s<0&&(u-=s,s=r[++o]);c<u;c++){const r=a[c];h?n(i,c,t,h,r):e(i,c,t,r)}}return r[t]=i}function Cr(t){return Array.isArray(t)?t[0]instanceof br?t:[Sr,t]:[t,void 0]}function Ur(t,e){return t instanceof $n?t.u:Array.isArray(t)?ye(t,e,!1):void 0}function Nr(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function Dr(t,e,n,r,i){const s=n.g;let o,a;t[e]=(t,e,n)=>s(t,e,n,a||=Or(Rr,Nr,Dr,r).W,o||=Br(r),i)}function Br(t){let e=t[Fr];if(null!=e)return e;const n=Or(Rr,Nr,Dr,t);return e=n.ma?(t,e)=>Mr(t,e,n):(t,e)=>{const r=rt(t);for(;Gn(e)&&4!=e.h;){var i=e.m,s=n[i];if(null==s){var o=n.ha;o&&(o=o[i])&&(null!=(o=Gr(o))&&(s=n[i]=o))}null!=s&&s(e,t,i)||(i=(s=e).l,jn(s),s.ga?s=void 0:(o=s.g.g-i,s.g.g=i,s=Dn(s.g,o)),i=t,s&&(_t||=Symbol(),(o=i[_t])?o.push(s):i[_t]=[s]))}return 16384&r&&st(t),!0},t[Fr]=e}function Gr(t){const e=(t=Cr(t))[0].g;if(t=t[1]){const n=Br(t),r=Or(Rr,Nr,Dr,t).W;return(t,i,s)=>e(t,i,s,r,n)}return e}function jr(t,e,n){t[e]=n.h}function Vr(t,e,n,r){let i,s;const o=n.h;t[e]=(t,e,n)=>o(t,e,n,s||=Or(Lr,jr,Vr,r).W,i||=Xr(r))}function Xr(t){let e=t[Ir];if(!e){const n=Or(Lr,jr,Vr,t);e=(t,e)=>Hr(t,e,n),t[Ir]=e}return e}function Hr(t,e,n){for(var r=nt(t),i=+!!(512&r)-1,s=t.length,o=512&r?1:0,a=s+(256&r?-1:0);o<a;o++){const r=t[o];if(null==r)continue;const s=o-i,a=Wr(n,s);a&&a(e,r,s)}if(256&r){r=t[s-1];for(const t in r)i=+t,Number.isNaN(i)||null!=(s=r[i])&&(a=Wr(n,i))&&a(e,s,i)}if(t=_t?t[_t]:void 0)for(ar(e,e.g.end()),n=0;n<t.length;n++)ar(e,D(t[n])||new Uint8Array(0))}function Wr(t,e){var n=t[e];if(n)return n;if((n=t.ha)&&(n=n[e])){var r=(n=Cr(n))[0].h;if(n=n[1]){const e=Xr(n),i=Or(Lr,jr,Vr,n).W;n=t.ma?Pr(i,e):(t,n,s)=>r(t,n,s,i,e)}else n=r;return t[e]=n}}function zr(t,e){if(Array.isArray(e)){var n=nt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),it(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}function Kr(t,e,n){return new br(t,e,n)}function Yr(t,e,n){return new br(t,e,n)}function $r(t,e,n){Xe(t,rt(t),e,n)}var qr=Ar((function(t,e,n,r,i){return 2===t.h&&(t=Vn(t,ye([void 0,void 0],r,!0),i),mt(r=rt(e)),(i=je(e,r,n))instanceof ke?0!=(2&i.M)?((i=i.Y()).push(t),Xe(e,r,n,i)):i.Na(t):Array.isArray(i)?(2&nt(i)&&Xe(e,r,n,i=Je(i)),i.push(t)):Xe(e,r,n,[t]),!0)}),(function(t,e,n,r,i){if(e instanceof ke)e.forEach(((e,s)=>{fr(t,n,ye([s,e],r,!1),i)}));else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&fr(t,n,ye(o,r,!1),i)}}));function Jr(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(BigInt.asIntN(64,t));if(Yt(t)){if("string"===e)return Qt(t);if("number"===e)return Zt(t)}}(e),null!=e){if("string"==typeof e)tr(e);if(null!=e)switch(cr(t,n,0),typeof e){case"number":t=t.g,Nt(e),rr(t,Ot,Ct);break;case"bigint":n=BigInt.asUintN(64,e),n=new er(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),rr(t.g,n.h,n.g);break;default:n=tr(e),rr(t.g,n.h,n.g)}}}function Zr(t,e,n){null!=(e=$t(e))&&null!=e&&(cr(t,n,0),sr(t.g,e))}function Qr(t,e,n){null!=(e=zt(e))&&(cr(t,n,0),t.g.g.push(e?1:0))}function ti(t,e,n){null!=(e=ie(e))&&lr(t,n,h(e))}function ei(t,e,n,r,i){fr(t,n,Ur(e,r),i)}function ni(t,e,n){null!=(e=null==e||"string"==typeof e||C(e)||e instanceof B?e:void 0)&&lr(t,n,Sn(e).buffer)}function ri(t,e,n){return(5===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,Pn,e):e.push(Pn(t.g)),!0)}var ii=Kr((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=Mn(r);const i=Mn(r);r=2*(i>>31)+1;const s=i>>>20&2047;return t=4294967296*(1048575&i)+t,$r(e,n,2047==s?t?NaN:r*(1/0):0==s?5e-324*r*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=Wt(e))&&(cr(t,n,1),t=t.g,(n=Pt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Ot=n.getUint32(0,!0),Ct=n.getUint32(4,!0),or(t,Ot),or(t,Ct))}),dr()),si=Kr((function(t,e,n){return 5===t.h&&($r(e,n,Pn(t.g)),!0)}),(function(t,e,n){null!=(e=Wt(e))&&(cr(t,n,5),t=t.g,Dt(e),or(t,Ot))}),Er),oi=Yr(ri,(function(t,e,n){if(null!=(e=zr(Wt,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(cr(r,i,5),r=r.g,Dt(s),or(r,Ot))}}),Er),ai=Yr(ri,(function(t,e,n){if(null!=(e=zr(Wt,e))&&e.length){cr(t,n,2),ir(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Dt(e[r]),or(n,Ot)}}),Er),ci=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Ln(t.g,Gt)),!0)}),Jr,vr),hi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,0===(t=Ln(t.g,Gt))?void 0:t),!0)}),Jr,vr),ui=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Ln(t.g,Bt)),!0)}),(function(t,e,n){if(null!=(e=ee(e))){if("string"==typeof e)Jn(e);if(null!=e)switch(cr(t,n,0),typeof e){case"number":t=t.g,Nt(e),rr(t,Ot,Ct);break;case"bigint":n=BigInt.asUintN(64,e),n=new Zn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),rr(t.g,n.h,n.g);break;default:n=Jn(e),rr(t.g,n.h,n.g)}}}),dr()),li=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Fn(t.g)),!0)}),Zr,yr),fi=Yr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,Fn,e):e.push(Fn(t.g)),!0)}),(function(t,e,n){if(null!=(e=zr($t,e))&&e.length){n=hr(t,n);for(let n=0;n<e.length;n++)sr(t.g,e[n]);ur(t,n)}}),yr),di=Kr((function(t,e,n){return 0===t.h&&($r(e,n,0===(t=Fn(t.g))?void 0:t),!0)}),Zr,yr),pi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Rn(t.g)),!0)}),Qr,gr),gi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,!1===(t=Rn(t.g))?void 0:t),!0)}),Qr,gr),mi=Yr((function(t,e,n){return 2===t.h&&(t=Xn(t),Qe(e,rt(e),n,!1).push(t),!0)}),(function(t,e,n){if(null!=(e=zr(ie,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&lr(r,i,h(s))}}),mr),yi=Kr((function(t,e,n){return 2===t.h&&($r(e,n,""===(t=Xn(t))?void 0:t),!0)}),ti,mr),_i=Kr((function(t,e,n){return 2===t.h&&($r(e,n,Xn(t)),!0)}),ti,mr),vi=function(t,e,n=pr){return new br(t,e,n)}((function(t,e,n,r,i){return 2===t.h&&(r=ye(void 0,r,!0),Qe(e,rt(e),n,!0).push(r),Vn(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)ei(t,e[s],n,r,i)})),Ei=Ar((function(t,e,n,r,i,s){return 2===t.h&&(nn(e,nt(e),s,n),Vn(t,e=sn(e,r,n),i),!0)}),ei),wi=Kr((function(t,e,n){return 2===t.h&&($r(e,n,Hn(t)),!0)}),ni,wr),Ti=Yr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,In,e):e.push(In(t.g)),!0)}),(function(t,e,n){if(null!=(e=zr(qt,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(cr(r,i,0),ir(r.g,s))}}),_r),bi=Kr((function(t,e,n){return 0===t.h&&($r(e,n,0===(t=In(t.g))?void 0:t),!0)}),(function(t,e,n){null!=(e=qt(e))&&null!=e&&(cr(t,n,0),ir(t.g,e))}),_r),Ai=Kr((function(t,e,n){return 0===t.h&&($r(e,n,Fn(t.g)),!0)}),(function(t,e,n){null!=(e=$t(e))&&(e=parseInt(e,10),cr(t,n,0),sr(t.g,e))}),Tr);class ki{constructor(t,e){this.h=t,this.g=e,this.l=an,this.m=un,this.defaultValue=void 0}}function xi(t,e){return new ki(t,e)}function Si(t,e){return(n,r)=>{if(zn.length){const t=zn.pop();t.o(r),Cn(t.g,n,r),n=t}else n=new class{constructor(t,e){if(Bn.length){const n=Bn.pop();Cn(n,t,e),t=n}else t=new class{constructor(t,e){this.h=null,this.m=!1,this.g=this.l=this.j=0,Cn(this,t,e)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ca=!1}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({ga:t=!1}={}){this.ga=t}}(n,r);try{const r=new t,s=r.u;Br(e)(s,n);var i=r}finally{n.g.clear(),n.m=-1,n.h=-1,zn.length<100&&zn.push(n)}return i}}function Li(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Hr(this.u,e,Or(Lr,jr,Vr,t)),ar(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var Ri=class extends $n{constructor(t){super(t)}},Fi=[0,yi,Kr((function(t,e,n){return 2===t.h&&($r(e,n,(t=Hn(t))===N()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof $n){const r=e.Qa;return void(r&&(e=r(e),null!=e&&lr(t,n,Sn(e).buffer)))}if(Array.isArray(e))return}ni(t,e,n)}),wr)];let Ii,Mi=globalThis.trustedTypes;function Pi(t){void 0===Ii&&(Ii=function(){let t=null;if(!Mi)return t;try{const e=t=>t;t=Mi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}());var e=Ii;return new class{constructor(t){this.g=t}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function Oi(t,...e){if(0===e.length)return Pi(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return Pi(n)}var Ci=[0,li,Ai,pi,-1,fi,Ai,-1],Ui=class extends $n{constructor(){super()}},Ni=[0,pi,_i,pi,Ai,-1,Yr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Qe(e,rt(e),n,!1,!1),2==t.h?Wn(t,On,e):e.push(Fn(t.g)),!0)}),(function(t,e,n){if(null!=(e=zr($t,e))&&e.length){n=hr(t,n);for(let n=0;n<e.length;n++)sr(t.g,e[n]);ur(t,n)}}),Tr),_i,-1,[0,pi,-1],Ai,pi,-1],Di=[0,_i,-2],Bi=class extends $n{constructor(){super()}},Gi=[0],ji=[0,li,pi,1,pi,-3],Vi=class extends $n{constructor(t){super(t,2)}},Xi={};Xi[336783863]=[0,_i,pi,-1,li,[0,[1,2,3,4,5,6,7],Ei,Gi,Ei,Ni,Ei,Di,Ei,ji,Ei,Ci,Ei,[0,_i,-2],Ei,[0,_i,Ai]],[0,_i],pi,[0,[1,3],[2,4],Ei,[0,fi],-1,Ei,[0,mi],-1,vi,[0,_i,-1]],_i];var Hi=[0,hi,-1,gi,-3,hi,fi,yi,di,hi,-1,gi,di,gi,-2,yi];function Wi(t,e){Ze(t,2,re(e),"")}function zi(t,e){bn(t,3,e)}function Ki(t,e){bn(t,4,e)}var Yi=class extends $n{constructor(t){super(t,500)}o(t){return un(this,0,7,t)}},$i=[-1,{}],qi=[0,_i,1,$i],Ji=[0,_i,mi,$i];function Zi(t,e){pn(t,1,Yi,e)}function Qi(t,e){bn(t,10,e)}function ts(t,e){bn(t,15,e)}var es=class extends $n{constructor(t){super(t,500)}o(t){return un(this,0,1001,t)}},ns=[-500,vi,[-500,yi,-1,mi,-3,[-2,Xi,pi],vi,Fi,di,-1,qi,Ji,vi,[0,yi,gi],yi,Hi,di,mi,987,mi],4,vi,[-500,_i,-1,[-1,{}],998,_i],vi,[-500,_i,mi,-1,[-2,{},pi],997,mi,-1],di,vi,[-500,_i,mi,$i,998,mi],mi,di,qi,Ji,vi,[0,yi,-1,$i],mi,-2,Hi,yi,-1,gi,[0,gi,bi],978,$i,vi,Fi];es.prototype.g=Li(ns);var rs=Si(es,ns),is=class extends $n{constructor(t){super(t)}},ss=class extends $n{constructor(t){super(t)}g(){return hn(this,is,1)}},os=[0,vi,[0,li,si,_i,-1]],as=Si(ss,os),cs=class extends $n{constructor(t){super(t)}},hs=class extends $n{constructor(t){super(t)}},us=class extends $n{constructor(t){super(t)}h(){return an(this,cs,2)}g(){return hn(this,hs,5)}},ls=Si(class extends $n{constructor(t){super(t)}},[0,mi,fi,ai,[0,Ai,[0,li,-3],[0,si,-3],[0,li,-1,[0,vi,[0,li,-2]]],vi,[0,si,-1,_i,si]],_i,-1,ci,vi,[0,li,si],mi,ci]),fs=class extends $n{constructor(t){super(t)}},ds=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,si,-4]]),ps=class extends $n{constructor(t){super(t)}},gs=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,si,-4]]),ms=class extends $n{constructor(t){super(t)}},ys=[0,li,-1,ai,Ai],_s=class extends $n{constructor(){super()}};_s.prototype.g=Li([0,si,-4,ci]);var vs=class extends $n{constructor(t){super(t)}},Es=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,1,li,_i,os],ci]),ws=class extends $n{constructor(t){super(t)}},Ts=class extends $n{constructor(t){super(t)}pa(){const t=We(this);return null==t?N():t}},bs=class extends $n{constructor(t){super(t)}},As=[1,2],ks=Si(class extends $n{constructor(t){super(t)}},[0,vi,[0,As,Ei,[0,ai],Ei,[0,wi],li,_i],ci]),xs=class extends $n{constructor(t){super(t)}},Ss=[0,_i,li,si,mi,-1],Ls=class extends $n{constructor(t){super(t)}},Rs=[0,pi,-1],Fs=class extends $n{constructor(t){super(t)}},Is=[1,2,3,4,5],Ms=class extends $n{constructor(t){super(t)}g(){return null!=We(this)}h(){return null!=ie(Be(this,2))}},Ps=class extends $n{constructor(t){super(t)}g(){return zt(Be(this,2))??!1}},Os=[0,wi,_i,[0,li,ci,-1],[0,ui,ci]],Cs=[0,Os,pi,[0,Is,Ei,ji,Ei,Ni,Ei,Ci,Ei,Gi,Ei,Di],Ai],Us=class extends $n{constructor(t){super(t)}},Ns=[0,Cs,si,-1,li],Ds=xi(502141897,Us);Xi[502141897]=Ns;var Bs=Si(class extends $n{constructor(t){super(t)}},[0,[0,Ai,-1,oi,Ti],ys]),Gs=class extends $n{constructor(t){super(t)}},js=class extends $n{constructor(t){super(t)}},Vs=[0,Cs,si,[0,Cs],pi],Xs=[0,Cs,Ns,Vs,si,[0,[0,Os]]],Hs=xi(508968150,js);Xi[508968150]=Xs,Xi[508968149]=Vs;var Ws=class extends $n{constructor(t){super(t)}},zs=xi(513916220,Ws);Xi[513916220]=[0,Cs,Xs,li];var Ks=class extends $n{constructor(t){super(t)}h(){return an(this,xs,2)}g(){Ve(this,2)}},Ys=[0,Cs,Ss];Xi[478825465]=Ys;var $s=class extends $n{constructor(t){super(t)}},qs=class extends $n{constructor(t){super(t)}},Js=class extends $n{constructor(t){super(t)}},Zs=class extends $n{constructor(t){super(t)}},Qs=class extends $n{constructor(t){super(t)}},to=[0,Cs,[0,Cs],Ys,-1],eo=[0,Cs,si,li],no=[0,Cs,si],ro=[0,Cs,eo,no,si],io=xi(479097054,Qs);Xi[479097054]=[0,Cs,ro,to],Xi[463370452]=to,Xi[464864288]=eo;var so=xi(462713202,Zs);Xi[462713202]=ro,Xi[474472470]=no;var oo=class extends $n{constructor(t){super(t)}},ao=class extends $n{constructor(t){super(t)}},co=class extends $n{constructor(t){super(t)}},ho=class extends $n{constructor(){super()}},uo=[0,Cs,si,-1,li],lo=[0,Cs,si,pi];ho.prototype.g=Li([0,Cs,no,[0,Cs],Ns,Vs,uo,lo]);var fo=class extends $n{constructor(t){super(t)}},po=xi(456383383,fo);Xi[456383383]=[0,Cs,Ss];var go=class extends $n{constructor(t){super(t)}},mo=xi(476348187,go);Xi[476348187]=[0,Cs,Rs];var yo=class extends $n{constructor(t){super(t)}},_o=class extends $n{constructor(t){super(t)}},vo=[0,Ai,-1],Eo=xi(458105876,class extends $n{constructor(t){super(t)}g(){var t=this.u;const e=rt(t);const n=2&e;return t=function(t,e,n){var r=_o;const i=2&e;let s=!1;if(null==n){if(i)return Fe();n=[]}else if(n.constructor===ke){if(0==(2&n.M)||i)return n;n=n.Y()}else Array.isArray(n)?s=!!(2&nt(n)):n=[];if(i){if(!n.length)return Fe();s||(s=!0,st(n))}else s&&(s=!1,n=Je(n));return s||(64&nt(n)?et(n,32):32&e&&tt(n,32)),Xe(t,e,2,r=new ke(n,r,oe,void 0)),r}(t,e,je(t,e,2)),!n&&_o&&(t.sa=!0),t}});Xi[458105876]=[0,vo,qr,[!0,ci,[0,_i,-1,mi]]];var wo=class extends $n{constructor(t){super(t)}},To=xi(458105758,wo);Xi[458105758]=[0,Cs,_i,vo];var bo=class extends $n{constructor(t){super(t)}},Ao=xi(443442058,bo);Xi[443442058]=[0,Cs,_i,li,si,mi,-1],Xi[514774813]=uo;var ko=class extends $n{constructor(t){super(t)}},xo=xi(516587230,ko);function So(t,e){return e=e?e.clone():new xs,void 0!==t.displayNamesLocale?Ve(e,1,re(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ve(e,1),void 0!==t.maxResults?En(e,2,t.maxResults):"maxResults"in t&&Ve(e,2),void 0!==t.scoreThreshold?wn(e,3,t.scoreThreshold):"scoreThreshold"in t&&Ve(e,3),void 0!==t.categoryAllowlist?Tn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ve(e,4),void 0!==t.categoryDenylist?Tn(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ve(e,5),e}function Lo(t,e=-1,n=""){return{categories:t.map((t=>({index:gn(mn(t,1),0)??-1,score:yn(t,2)??0,categoryName:_n(t,3)??"",displayName:_n(t,4)??""}))),headIndex:e,headName:n}}function Ro(t){var e=Ke(t,3,Wt,ze()),n=Ke(t,2,$t,ze()),r=Ke(t,1,ie,ze()),i=Ke(t,9,ie,ze());const s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=an(t,us,4)?.h())&&(s.boundingBox={originX:mn(e,1)??0,originY:mn(e,2)??0,width:mn(e,3)??0,height:mn(e,4)??0,angle:0}),an(t,us,4)?.g().length)for(const e of an(t,us,4).g())s.keypoints.push({x:He(e,1)??0,y:He(e,2)??0,score:He(e,4)??0,label:ie(Be(e,3))??""});return s}function Fo(t){const e=[];for(const n of hn(t,ps,1))e.push({x:yn(n,1)??0,y:yn(n,2)??0,z:yn(n,3)??0,visibility:yn(n,4)??0});return e}function Io(t){const e=[];for(const n of hn(t,fs,1))e.push({x:yn(n,1)??0,y:yn(n,2)??0,z:yn(n,3)??0,visibility:yn(n,4)??0});return e}function Mo(t){return Array.from(t,(t=>t>127?t-256:t))}function Po(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Oo;Xi[516587230]=[0,Cs,uo,lo,si],Xi[518928384]=lo;const Co=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 Uo(){if(void 0===Oo)try{await WebAssembly.instantiate(Co),Oo=!0}catch{Oo=!1}return Oo}async function No(t,e=Oi``){const n=await Uo()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Do=class{};function Bo(){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 Go(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function jo(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 Vo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Xo(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=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&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[r,i]=jo(e);return!t.l||r===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=i),[r,i]}function Ho(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function Wo(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function zo(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}Do.forVisionTasks=function(t){return No("vision",t)},Do.forTextTasks=function(t){return No("text",t)},Do.forGenAiExperimentalTasks=function(t){return No("genai_experimental",t)},Do.forGenAiTasks=function(t){return No("genai",t)},Do.forAudioTasks=function(t){return No("audio",t)},Do.isSimdSupported=function(){return Uo()};async function Ko(t,e,n,r){return t=await(async(t,e,n,r,i)=>{if(e&&await Go(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Go(n),!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,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function Yo(t,e){const n=an(t.baseOptions,Ms,1)||new Ms;"string"==typeof e?(Ve(n,2,re(e)),Ve(n,1)):e instanceof Uint8Array&&(Ve(n,1,dt(e,!1)),Ve(n,2)),un(t.baseOptions,0,1,n)}function $o(t){try{const 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 qo(t,e){t.B=Math.max(t.B,e)}function Jo(t,e){t.A=new Yi,Wi(t.A,"PassThroughCalculator"),zi(t.A,"free_memory"),Ki(t.A,"free_memory_unused_out"),Qi(e,"free_memory"),Zi(e,t.A)}function Zo(t,e){zi(t.A,e),Ki(t.A,e+"_unused_out")}function Qo(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var ta=class{constructor(t){this.g=t,this.H=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(an(this.baseOptions,Ms,1)?.g()||an(this.baseOptions,Ms,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=an(t.baseOptions,Fs,3);if(!n){var r=n=new Fs,i=new Bi;ln(r,4,Is,i)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new Ui,ln(e,2,Is,r)):(e=n,r=new Bi,ln(e,4,Is,r))),un(t.baseOptions,0,3,n)}(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),Yo(this,"/model.dat"),this.m(),this.J()}));if(e.modelAssetBuffer instanceof Uint8Array)Yo(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){const e=[];for(var n=0;;){const{done:r,value:i}=await t.read();if(r)break;e.push(i),n+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(n),n=0;for(const r of e)t.set(r,n),n+=r.length;return t}(e.modelAssetBuffer).then((t=>{Yo(this,t),this.m(),this.J()}))}return this.m(),this.J(),Promise.resolve()}J(){}ea(){let t;if(this.g.ea((e=>{t=rs(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.A=void 0,$o(this)}finishProcessing(){this.g.finishProcessing(),$o(this)}close(){this.A=void 0,this.g.closeGraph()}};function ea(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}ta.prototype.close=ta.prototype.close,e("TaskRunner",ta);class na{constructor(t,e,n,r){this.g=t,this.h=e,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ra(t,e,n){const r=t.g;if(n=ea(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function ia(t,e){const n=t.g,r=ea(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const i=ea(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.P),n.vertexAttribPointer(t.P,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const s=ea(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.J),n.vertexAttribPointer(t.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new na(n,r,i,s)}function sa(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function oa(t,e,n,r){return sa(t,e),t.h||(t.m(),t.C()),n?(t.s||(t.s=ia(t,!0)),n=t.s):(t.v||(t.v=ia(t,!1)),n=t.v),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function aa(t,e,n){return sa(t,e),t=ea(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,n??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function ca(t,e,n){sa(t,e),t.A||(t.A=ea(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function ha(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var ua=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(){const t=this.g;if(this.h=ea(t.createProgram(),"Failed to create WebGL program"),this.ba=ra(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.aa=ra(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.P=t.getAttribLocation(this.h,"aVertex"),this.J=t.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.ba),t.deleteShader(this.aa)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}};var la=class extends ua{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 "}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=aa(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=aa(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.L=ea(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=ea(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=ea(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.K,0),t.uniform1i(this.L,1),t.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},fa=class extends ua{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 "}C(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=aa(this,t),t.activeTexture(t.TEXTURE2),this.B=aa(this,t)}m(){super.m();const t=this.g;this.K=ea(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=ea(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=ea(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.I,0),t.uniform1i(this.K,1),t.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function da(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 pa(t){var e=da(t,1);if(!e){if(e=da(t,0))e=new Float32Array(e).map((t=>t/255));else{e=new Float32Array(t.width*t.height);const r=ma(t);var n=_a(t);if(ca(n,r,ga(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){n=new Float32Array(t.width*t.height*4),r.readPixels(0,0,t.width,t.height,r.RGBA,r.FLOAT,n);for(let t=0,r=0;t<e.length;++t,r+=4)e[t]=n[r]}else r.readPixels(0,0,t.width,t.height,r.RED,r.FLOAT,e)}t.g.push(e)}return e}function ga(t){let e=da(t,2);if(!e){const n=ma(t);e=va(t);const r=pa(t),i=ya(t);n.texImage2D(n.TEXTURE_2D,0,i,t.width,t.height,0,n.RED,n.FLOAT,r),Ea(t)}return e}function ma(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=ea(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ya(t){if(t=ma(t),!wa)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))wa=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");wa=t.R16F}return wa}function _a(t){return t.l||(t.l=new ua),t.l}function va(t){const e=ma(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=da(t,2);return n||(n=aa(_a(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(n),t.j=!0),e.bindTexture(e.TEXTURE_2D,n),n}function Ea(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var wa,Ta=class{constructor(t,e,n,r,i,s,o){this.g=t,this.m=e,this.j=n,this.canvas=r,this.l=i,this.width=s,this.height=o,this.j&&(0===--ba&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Ga(){return!!da(this,0)}ka(){return!!da(this,1)}R(){return!!da(this,2)}ja(){return(e=da(t=this,0))||(e=pa(t),e=new Uint8Array(e.map((t=>255*t))),t.g.push(e)),e;var t,e}ia(){return pa(this)}N(){return ga(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof Uint8Array)n=new Uint8Array(e);else if(e instanceof Float32Array)n=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const t=ma(this),e=_a(this);t.activeTexture(t.TEXTURE1),n=aa(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,n);const r=ya(this);t.texImage2D(t.TEXTURE_2D,0,r,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),ca(e,t,n),oa(e,t,!1,(()=>{va(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ea(this)})),ha(e),Ea(this)}}t.push(n)}return new Ta(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ma(this).deleteTexture(da(this,2)),ba=-1}};Ta.prototype.close=Ta.prototype.close,Ta.prototype.clone=Ta.prototype.clone,Ta.prototype.getAsWebGLTexture=Ta.prototype.N,Ta.prototype.getAsFloat32Array=Ta.prototype.ia,Ta.prototype.getAsUint8Array=Ta.prototype.ja,Ta.prototype.hasWebGLTexture=Ta.prototype.R,Ta.prototype.hasFloat32Array=Ta.prototype.ka,Ta.prototype.hasUint8Array=Ta.prototype.Ga;var ba=250;const Aa={color:"white",lineWidth:4,radius:6};function ka(t){return{...Aa,fillColor:(t=t||{}).color,...t}}function xa(t,e){return t instanceof Function?t(e):t}function Sa(t,e,n){return Math.max(Math.min(e,n),Math.min(Math.max(e,n),t))}function La(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Ra(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Fa(t,e,n){if(e.R())n(e.N());else{const r=e.ka()?e.ia():e.ja();t.m=t.m??new ua;const i=Ra(t);n((t=new Ta([r],e.m,!1,i.canvas,t.m,e.width,e.height)).N()),t.close()}}function Ia(t,e,n,r){const i=function(t){return t.g||(t.g=new la),t.g}(t),s=Ra(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;oa(i,s,!0,(()=>{!function(t,e,n,r){const i=t.g;if(i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.B),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.I&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(const[r,i]of t){t=r;const s=i;var n=e.next();if(n.done)return!1;const[o,a]=n.value;if(n=a,t!==o||s[0]!==n[0]||s[1]!==n[1]||s[2]!==n[2]||s[3]!==n[3])return!1}return!!e.next().done}(t.I,r))i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j);else{t.I=r;const e=Array(1024).fill(0);r.forEach(((t,n)=>{if(4!==t.length)throw Error(`Color at index ${n} is not a four-channel value.`);e[4*n]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+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,r),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);const 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 Ma(t,e,n,r){const i=Ra(t),s=function(t){return t.h||(t.h=new fa),t.h}(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n,a=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;oa(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.B),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 Pa=class{constructor(t,e){t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}za(t,e){if(t){var n=La(this);e=ka(e),n.save();var r=n.canvas,i=0;for(const s of t)n.fillStyle=xa(e.fillColor,{index:i,from:s}),n.strokeStyle=xa(e.color,{index:i,from:s}),n.lineWidth=xa(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*r.width,s.y*r.height,xa(e.radius,{index:i,from:s}),0,2*Math.PI),n.fill(t),n.stroke(t),++i;n.restore()}}ya(t,e,n){if(t&&e){var r=La(this);n=ka(n),r.save();var i=r.canvas,s=0;for(const o of e){r.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(r.strokeStyle=xa(n.color,{index:s,from:e,to:a}),r.lineWidth=xa(n.lineWidth,{index:s,from:e,to:a}),r.moveTo(e.x*i.width,e.y*i.height),r.lineTo(a.x*i.width,a.y*i.height)),++s,r.stroke()}r.restore()}}va(t,e){const n=La(this);e=ka(e),n.save(),n.beginPath(),n.lineWidth=xa(e.lineWidth,{}),n.strokeStyle=xa(e.color,{}),n.fillStyle=xa(e.fillColor,{}),n.moveTo(t.originX,t.originY),n.lineTo(t.originX+t.width,t.originY),n.lineTo(t.originX+t.width,t.originY+t.height),n.lineTo(t.originX,t.originY+t.height),n.lineTo(t.originX,t.originY),n.stroke(),n.fill(),n.restore()}wa(t,e,n=[0,0,0,255]){this.l?function(t,e,n,r){const i=Ra(t);Fa(t,e,(e=>{Ia(t,e,n,r),(e=La(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,n,e):Ia(this,t.N(),n,e)}xa(t,e,n){this.l?function(t,e,n,r){const i=Ra(t);Fa(t,e,(e=>{Ma(t,e,n,r),(e=La(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,e,n):Ma(this,t.N(),e,n)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Oa(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 Ca(t){var e=Oa(t,0);if(!e){e=Na(t);const n=Da(t),r=new Uint8Array(t.width*t.height*4);ca(n,e,Ua(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,r),ha(n),e=new ImageData(new Uint8ClampedArray(r.buffer),t.width,t.height),t.g.push(e)}return e}function Ua(t){let e=Oa(t,2);if(!e){const n=Na(t);e=Ba(t);const r=Oa(t,1)||Ca(t);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),Ga(t)}return e}function Na(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return t.h||(t.h=ea(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Da(t){return t.l||(t.l=new ua),t.l}function Ba(t){const e=Na(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=Oa(t,2);return n||(n=aa(Da(t),e),t.g.push(n),t.m=!0),e.bindTexture(e.TEXTURE_2D,n),n}function Ga(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function ja(t){const e=Na(t);return oa(Da(t),e,!0,(()=>function(t,e){const n=t.canvas;if(n.width===t.width&&n.height===t.height)return e();const r=n.width,i=n.height;return n.width=t.width,n.height=t.height,t=e(),n.width=r,n.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()}))))}Pa.prototype.close=Pa.prototype.close,Pa.prototype.drawConfidenceMask=Pa.prototype.xa,Pa.prototype.drawCategoryMask=Pa.prototype.wa,Pa.prototype.drawBoundingBox=Pa.prototype.va,Pa.prototype.drawConnectors=Pa.prototype.ya,Pa.prototype.drawLandmarks=Pa.prototype.za,Pa.lerp=function(t,e,n,r,i){return Sa(r*(1-(t-e)/(n-e))+i*(1-(n-t)/(n-e)),r,i)},Pa.clamp=Sa,e("DrawingUtils",Pa);var Va=class{constructor(t,e,n,r,i,s,o){this.g=t,this.j=e,this.m=n,this.canvas=r,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--Xa&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Fa(){return!!Oa(this,0)}la(){return!!Oa(this,1)}R(){return!!Oa(this,2)}Da(){return Ca(this)}Ca(){var t=Oa(this,1);return t||(Ua(this),Ba(this),t=ja(this),Ga(this),this.g.push(t),this.j=!0),t}N(){return Ua(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof ImageData)n=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const t=Na(this),e=Da(this);t.activeTexture(t.TEXTURE1),n=aa(e,t),t.bindTexture(t.TEXTURE_2D,n),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),ca(e,t,n),oa(e,t,!1,(()=>{Ba(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ga(this)})),ha(e),Ga(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);Ua(this),Ba(this),n=ja(this),Ga(this)}t.push(n)}return new Va(t,this.la(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Oa(this,1).close(),this.m&&Na(this).deleteTexture(Oa(this,2)),Xa=-1}};Va.prototype.close=Va.prototype.close,Va.prototype.clone=Va.prototype.clone,Va.prototype.getAsWebGLTexture=Va.prototype.N,Va.prototype.getAsImageBitmap=Va.prototype.Ca,Va.prototype.getAsImageData=Va.prototype.Da,Va.prototype.hasWebGLTexture=Va.prototype.R,Va.prototype.hasImageBitmap=Va.prototype.la,Va.prototype.hasImageData=Va.prototype.Fa;var Xa=250;function Ha(...t){return t.map((([t,e])=>({start:t,end:e})))}const Wa=function(t){return class extends t{La(){this.i._registerModelResourcesGraphService()}}}((za=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:Bo()?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){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,i){this.i._configureAudio||console.warn(\'Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?\'),Vo(this,r||"input_audio",(r=>{Vo(this,i=i||"audio_header",(i=>{this.i._configureAudio(r,i,t,e??0,n)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ea(t){Wo(this,"__graph_config__",(e=>{t(e)})),Vo(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,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const 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),Vo(this,r,(t=>{this.i._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Vo(this,e,(e=>{const[r,i]=Xo(this,t,e);this.i._addBoundTextureToStream(e,r,i,n)}))}addBoolToStream(t,e,n){Vo(this,e,(e=>{this.i._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Vo(this,e,(e=>{this.i._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Vo(this,e,(e=>{this.i._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Vo(this,e,(e=>{this.i._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Vo(this,e,(e=>{this.i._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Vo(this,e,(e=>{Vo(this,t,(t=>{this.i._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Vo(this,e,(e=>{Ho(this,Object.keys(t),(r=>{Ho(this,Object.values(t),(i=>{this.i._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Vo(this,n,(n=>{Vo(this,e,(e=>{const i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,n,r),this.i._free(i)}))}))}addEmptyPacketToStream(t,e){Vo(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputStream(r,e,n)}))}addUintVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){Vo(this,e,(e=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Vo(this,e,(t=>{this.i._addStringVectorEntry(r,t)}));this.i._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Vo(this,e,(e=>{this.i._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Vo(this,e,(e=>{Vo(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Vo(this,n,(n=>{Vo(this,e,(e=>{const r=this.i._malloc(t.length);this.i.HEAPU8.set(t,r),this.i._addProtoToInputSidePacket(r,t.length,e,n),this.i._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputSidePacket(n,e)}))}addUintVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){Vo(this,e,(e=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Vo(this,e,(t=>{this.i._addStringVectorEntry(n,t)}));this.i._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachUintListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachUintListener(t)}))}attachUintVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){zo(this,t,e),Vo(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Wo(this,t,e),Vo(this,t,(t=>{this.i._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){zo(this,t,e),Vo(this,t,(t=>{this.i._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn(\'Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?\'),Wo(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Vo(this,t,(t=>{this.i._attachAudioListener(t,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends za{get fa(){return this.i}ra(t,e,n){Vo(this,e,(e=>{const[r,i]=Xo(this,t,e);this.fa._addBoundTextureAsImageToStream(e,r,i,n)}))}V(t,e){Wo(this,t,e),Vo(this,t,(t=>{this.fa._attachImageListener(t)}))}da(t,e){zo(this,t,e),Vo(this,t,(t=>{this.fa._attachImageVectorListener(t)}))}}));var za,Ka=class extends Wa{};async function Ya(t,e,n){return async function(t,e,n,r){return Ko(t,e,n,r)}(t,n.canvas??(Bo()?void 0:document.createElement("canvas")),e,n)}function $a(t,e,n,r){if(t.U){const s=new _s;if(n?.regionOfInterest){if(!t.qa)throw Error("This task doesn\'t support region-of-interest.");var i=n.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].");wn(s,1,(i.left+i.right)/2),wn(s,2,(i.top+i.bottom)/2),wn(s,4,i.right-i.left),wn(s,3,i.bottom-i.top)}else wn(s,1,.5),wn(s,2,.5),wn(s,4,1),wn(s,3,1);if(n?.rotationDegrees){if(n?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(wn(s,5,-Math.PI*n.rotationDegrees/180),n?.rotationDegrees%180!=0){const[t,r]=jo(e);n=yn(s,3)*r/t,i=yn(s,4)*t/r,wn(s,4,n),wn(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,r)}t.g.ra(e,t.ba,r??performance.now()),t.finishProcessing()}function qa(t,e,n){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. \'runningMode\' must be set to \'IMAGE\'.");$a(t,e,n,t.B+1)}function Ja(t,e,n,r){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. \'runningMode\' must be set to \'VIDEO\'.");$a(t,e,n,r)}function Za(t,e,n,r){var i=e.data;const 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 Ta([i],n,!1,t.g.i.canvas,t.P,s,e),r?t.clone():t}var Qa=class extends ta{constructor(t,e,n,r){super(t),this.g=t,this.ba=e,this.U=n,this.qa=r,this.P=new ua}l(t,e=!0){if("runningMode"in t&&vn(this.baseOptions,2,!!t.runningMode&&"IMAGE"!==t.runningMode),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()}};Qa.prototype.close=Qa.prototype.close;var tc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},un(t=this.h=new Us,0,1,e=new Ps),wn(this.h,2,.5),wn(this.h,3,.3)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&wn(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&wn(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}D(t,e){return this.j={detections:[]},qa(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect_in"),ts(t,"detections");const e=new Vi;Yn(e,Ds,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect_in"),Ki(n,"DETECTIONS:detections"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=ls(e),this.j.detections.push(Ro(t));qo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};tc.prototype.detectForVideo=tc.prototype.F,tc.prototype.detect=tc.prototype.D,tc.prototype.setOptions=tc.prototype.o,tc.createFromModelPath=async function(t,e){return Ya(tc,t,{baseOptions:{modelAssetPath:e}})},tc.createFromModelBuffer=function(t,e){return Ya(tc,t,{baseOptions:{modelAssetBuffer:e}})},tc.createFromOptions=function(t,e){return Ya(tc,t,e)};var ec=Ha([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]),nc=Ha([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]),rc=Ha([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),ic=Ha([474,475],[475,476],[476,477],[477,474]),sc=Ha([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]),oc=Ha([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),ac=Ha([469,470],[470,471],[471,472],[472,469]),cc=Ha([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]),hc=[...ec,...nc,...rc,...sc,...oc,...cc],uc=Ha([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 lc(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var fc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,un(t=this.h=new js,0,1,e=new Ps),this.v=new Gs,un(this.h,0,3,this.v),this.s=new Us,un(this.h,0,2,this.s),En(this.s,4,1),wn(this.s,2,.5),wn(this.v,2,.5),wn(this.h,4,.5)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"numFaces"in t&&En(this.s,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&wn(this.s,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&wn(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return lc(this),qa(this,t,e),this.j}F(t,e,n){return lc(this),Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"face_landmarks");const e=new Vi;Yn(e,Hs,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"NORM_LANDMARKS:face_landmarks"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("face_landmarks",((t,e)=>{for(const e of t)t=gs(e),this.j.faceLandmarks.push(Fo(t));qo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{qo(this,t)})),this.outputFaceBlendshapes&&(ts(t,"blendshapes"),Ki(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((t,e)=>{if(this.outputFaceBlendshapes)for(const e of t)t=as(e),this.j.faceBlendshapes.push(Lo(t.g()??[]));qo(this,e)})),this.g.attachEmptyPacketListener("blendshapes",(t=>{qo(this,t)}))),this.outputFacialTransformationMatrixes&&(ts(t,"face_geometry"),Ki(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((t,e)=>{if(this.outputFacialTransformationMatrixes)for(const e of t)(t=an(Bs(e),ms,2))&&this.j.facialTransformationMatrixes.push({rows:gn(mn(t,1),0)??0,columns:gn(mn(t,2),0)??0,data:Ke(t,3,Wt,ze()).slice()??[]});qo(this,e)})),this.g.attachEmptyPacketListener("face_geometry",(t=>{qo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};fc.prototype.detectForVideo=fc.prototype.F,fc.prototype.detect=fc.prototype.D,fc.prototype.setOptions=fc.prototype.o,fc.createFromModelPath=function(t,e){return Ya(fc,t,{baseOptions:{modelAssetPath:e}})},fc.createFromModelBuffer=function(t,e){return Ya(fc,t,{baseOptions:{modelAssetBuffer:e}})},fc.createFromOptions=function(t,e){return Ya(fc,t,e)},fc.FACE_LANDMARKS_LIPS=ec,fc.FACE_LANDMARKS_LEFT_EYE=nc,fc.FACE_LANDMARKS_LEFT_EYEBROW=rc,fc.FACE_LANDMARKS_LEFT_IRIS=ic,fc.FACE_LANDMARKS_RIGHT_EYE=sc,fc.FACE_LANDMARKS_RIGHT_EYEBROW=oc,fc.FACE_LANDMARKS_RIGHT_IRIS=ac,fc.FACE_LANDMARKS_FACE_OVAL=cc,fc.FACE_LANDMARKS_CONTOURS=hc,fc.FACE_LANDMARKS_TESSELATION=uc;var dc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!0),un(t=this.j=new Ws,0,1,e=new Ps)}get baseOptions(){return an(this.j,Ps,1)}set baseOptions(t){un(this.j,0,1,t)}o(t){return super.l(t)}Oa(t,e,n){const r="function"!=typeof e?e:{};if(this.h="function"==typeof e?e:n,qa(this,t,r??{}),!this.h)return this.s}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"stylized_image");const e=new Vi;Yn(e,zs,this.j);const n=new Yi;Wi(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"STYLIZED_IMAGE:stylized_image"),n.o(e),Zi(t,n),this.g.V("stylized_image",((t,e)=>{var n=!this.h,r=t.data,i=t.width;const s=i*(t=t.height);if(r instanceof Uint8Array)if(r.length===3*s){const e=new Uint8ClampedArray(4*s);for(let t=0;t<s;++t)e[4*t]=r[3*t],e[4*t+1]=r[3*t+1],e[4*t+2]=r[3*t+2],e[4*t+3]=255;r=new ImageData(e,i,t)}else{if(r.length!==4*s)throw Error("Unsupported channel count: "+r.length/s);r=new ImageData(new Uint8ClampedArray(r.buffer,r.byteOffset,r.length),i,t)}else if(!(r instanceof WebGLTexture))throw Error(`Unsupported format: ${r.constructor.name}`);i=new Va([r],!1,!1,this.g.i.canvas,this.P,i,t),this.s=n=n?i.clone():i,this.h&&this.h(n),qo(this,e)})),this.g.attachEmptyPacketListener("stylized_image",(t=>{this.s=null,this.h&&this.h(null),qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};dc.prototype.stylize=dc.prototype.Oa,dc.prototype.setOptions=dc.prototype.o,dc.createFromModelPath=function(t,e){return Ya(dc,t,{baseOptions:{modelAssetPath:e}})},dc.createFromModelBuffer=function(t,e){return Ya(dc,t,{baseOptions:{modelAssetBuffer:e}})},dc.createFromOptions=function(t,e){return Ya(dc,t,e)};var pc=Ha([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 gc(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function mc(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 yc(t,e=!0){const n=[];for(const i of t){var r=as(i);t=[];for(const n of r.g())r=e&&null!=mn(n,1)?gn(mn(n,1),0):-1,t.push({score:yn(n,2)??0,index:r,categoryName:_n(n,3)??"",displayName:_n(n,4)??""});n.push(t)}return n}var _c=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],un(t=this.j=new Qs,0,1,e=new Ps),this.s=new Zs,un(this.j,0,2,this.s),this.C=new Js,un(this.s,0,3,this.C),this.v=new qs,un(this.s,0,2,this.v),this.h=new $s,un(this.j,0,3,this.h),wn(this.v,2,.5),wn(this.s,4,.5),wn(this.C,2,.5)}get baseOptions(){return an(this.j,Ps,1)}set baseOptions(t){un(this.j,0,1,t)}o(t){if(En(this.v,3,t.numHands??1),"minHandDetectionConfidence"in t&&wn(this.v,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.s,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&wn(this.C,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Ks,n=e,r=So(t.cannedGesturesClassifierOptions,an(this.h,Ks,3)?.h());un(n,0,2,r),un(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&an(this.h,Ks,3)?.g();return t.customGesturesClassifierOptions?(un(n=e=new Ks,0,2,r=So(t.customGesturesClassifierOptions,an(this.h,Ks,4)?.h())),un(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&an(this.h,Ks,4)?.g(),this.l(t)}Ja(t,e){return gc(this),qa(this,t,e),mc(this)}Ka(t,e,n){return gc(this),Ja(this,t,n,e),mc(this)}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"hand_gestures"),ts(t,"hand_landmarks"),ts(t,"world_hand_landmarks"),ts(t,"handedness");const e=new Vi;Yn(e,io,this.j);const n=new Yi;Wi(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"HAND_GESTURES:hand_gestures"),Ki(n,"LANDMARKS:hand_landmarks"),Ki(n,"WORLD_LANDMARKS:world_hand_landmarks"),Ki(n,"HANDEDNESS:handedness"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t){t=gs(e);const n=[];for(const e of hn(t,ps,1))n.push({x:yn(e,1)??0,y:yn(e,2)??0,z:yn(e,3)??0,visibility:yn(e,4)??0});this.landmarks.push(n)}qo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t){t=ds(e);const n=[];for(const e of hn(t,fs,1))n.push({x:yn(e,1)??0,y:yn(e,2)??0,z:yn(e,3)??0,visibility:yn(e,4)??0});this.worldLandmarks.push(n)}qo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("hand_gestures",((t,e)=>{this.gestures.push(...yc(t,!1)),qo(this,e)})),this.g.attachEmptyPacketListener("hand_gestures",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{this.handedness.push(...yc(t)),qo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function vc(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}_c.prototype.recognizeForVideo=_c.prototype.Ka,_c.prototype.recognize=_c.prototype.Ja,_c.prototype.setOptions=_c.prototype.o,_c.createFromModelPath=function(t,e){return Ya(_c,t,{baseOptions:{modelAssetPath:e}})},_c.createFromModelBuffer=function(t,e){return Ya(_c,t,{baseOptions:{modelAssetBuffer:e}})},_c.createFromOptions=function(t,e){return Ya(_c,t,e)},_c.HAND_CONNECTIONS=pc;var Ec=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],un(t=this.h=new Zs,0,1,e=new Ps),this.s=new Js,un(this.h,0,3,this.s),this.j=new qs,un(this.h,0,2,this.j),En(this.j,3,1),wn(this.j,2,.5),wn(this.s,2,.5),wn(this.h,4,.5)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"numHands"in t&&En(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&wn(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&wn(this.s,2,t.minHandPresenceConfidence??.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],qa(this,t,e),vc(this)}F(t,e,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ja(this,t,n,e),vc(this)}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"hand_landmarks"),ts(t,"world_hand_landmarks"),ts(t,"handedness");const e=new Vi;Yn(e,so,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"LANDMARKS:hand_landmarks"),Ki(n,"WORLD_LANDMARKS:world_hand_landmarks"),Ki(n,"HANDEDNESS:handedness"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t)t=gs(e),this.landmarks.push(Fo(t));qo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t)t=ds(e),this.worldLandmarks.push(Io(t));qo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{var n=this.handedness,r=n.push;const i=[];for(const e of t){t=as(e);const n=[];for(const e of t.g())n.push({score:yn(e,2)??0,index:gn(mn(e,1),0)??-1,categoryName:_n(e,3)??"",displayName:_n(e,4)??""});i.push(n)}r.call(n,...i),qo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ec.prototype.detectForVideo=Ec.prototype.F,Ec.prototype.detect=Ec.prototype.D,Ec.prototype.setOptions=Ec.prototype.o,Ec.createFromModelPath=function(t,e){return Ya(Ec,t,{baseOptions:{modelAssetPath:e}})},Ec.createFromModelBuffer=function(t,e){return Ya(Ec,t,{baseOptions:{modelAssetBuffer:e}})},Ec.createFromOptions=function(t,e){return Ya(Ec,t,e)},Ec.HAND_CONNECTIONS=pc;var wc=Ha([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 Tc(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function bc(t){try{if(!t.C)return t.h;t.C(t.h)}finally{Qo(t)}}function Ac(t,e){t=gs(t),e.push(Fo(t))}var kc=class extends Qa{constructor(t,e){super(new Ka(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,un(t=this.j=new ho,0,1,e=new Ps),this.K=new Js,un(this.j,0,2,this.K),this.aa=new oo,un(this.j,0,3,this.aa),this.s=new Us,un(this.j,0,4,this.s),this.I=new Gs,un(this.j,0,5,this.I),this.v=new ao,un(this.j,0,6,this.v),this.L=new co,un(this.j,0,7,this.L),wn(this.s,2,.5),wn(this.s,3,.3),wn(this.I,2,.5),wn(this.v,2,.5),wn(this.v,3,.3),wn(this.L,2,.5),wn(this.K,2,.5)}get baseOptions(){return an(this.j,Ps,1)}set baseOptions(t){un(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&wn(this.s,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&wn(this.s,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&wn(this.I,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&wn(this.v,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&wn(this.v,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&wn(this.L,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&wn(this.K,2,t.minHandLandmarksConfidence??.5),this.l(t)}D(t,e,n){const r="function"!=typeof e?e:{};return this.C="function"==typeof e?e:n,Tc(this),qa(this,t,r),bc(this)}F(t,e,n,r){const i="function"!=typeof n?n:{};return this.C="function"==typeof n?n:r,Tc(this),Ja(this,t,i,e),bc(this)}m(){var t=new es;Qi(t,"input_frames_image"),ts(t,"pose_landmarks"),ts(t,"pose_world_landmarks"),ts(t,"face_landmarks"),ts(t,"left_hand_landmarks"),ts(t,"left_hand_world_landmarks"),ts(t,"right_hand_landmarks"),ts(t,"right_hand_world_landmarks");const e=new Vi,n=new Ri;Ze(n,1,re("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(t,e){if(null!=e)if(Array.isArray(e))Ve(t,2,Me(e,Oe,void 0,void 0,!1));else{if(!("string"==typeof e||e instanceof B||C(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Ze(t,2,dt(e,!1),N())}}(n,this.j.g());const r=new Yi;Wi(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),pn(r,8,Ri,n),zi(r,"IMAGE:input_frames_image"),Ki(r,"POSE_LANDMARKS:pose_landmarks"),Ki(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Ki(r,"FACE_LANDMARKS:face_landmarks"),Ki(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Ki(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Ki(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Ki(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(e),Zi(t,r),Jo(this,t),this.g.attachProtoListener("pose_landmarks",((t,e)=>{Ac(t,this.h.poseLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("pose_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("pose_world_landmarks",((t,e)=>{var n=this.h.poseWorldLandmarks;t=ds(t),n.push(Io(t)),qo(this,e)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(t=>{qo(this,t)})),this.outputPoseSegmentationMasks&&(Ki(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Zo(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",((t,e)=>{this.h.poseSegmentationMasks=[Za(this,t,!0,!this.C)],qo(this,e)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(t=>{this.h.poseSegmentationMasks=[],qo(this,t)}))),this.g.attachProtoListener("face_landmarks",((t,e)=>{Ac(t,this.h.faceLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{qo(this,t)})),this.outputFaceBlendshapes&&(ts(t,"extra_blendshapes"),Ki(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((t,e)=>{var n=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=as(t),n.push(Lo(t.g()??[]))),qo(this,e)})),this.g.attachEmptyPacketListener("extra_blendshapes",(t=>{qo(this,t)}))),this.g.attachProtoListener("left_hand_landmarks",((t,e)=>{Ac(t,this.h.leftHandLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("left_hand_world_landmarks",((t,e)=>{var n=this.h.leftHandWorldLandmarks;t=ds(t),n.push(Io(t)),qo(this,e)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("right_hand_landmarks",((t,e)=>{Ac(t,this.h.rightHandLandmarks),qo(this,e)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(t=>{qo(this,t)})),this.g.attachProtoListener("right_hand_world_landmarks",((t,e)=>{var n=this.h.rightHandWorldLandmarks;t=ds(t),n.push(Io(t)),qo(this,e)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};kc.prototype.detectForVideo=kc.prototype.F,kc.prototype.detect=kc.prototype.D,kc.prototype.setOptions=kc.prototype.o,kc.createFromModelPath=function(t,e){return Ya(kc,t,{baseOptions:{modelAssetPath:e}})},kc.createFromModelBuffer=function(t,e){return Ya(kc,t,{baseOptions:{modelAssetBuffer:e}})},kc.createFromOptions=function(t,e){return Ya(kc,t,e)},kc.HAND_CONNECTIONS=pc,kc.POSE_CONNECTIONS=wc,kc.FACE_LANDMARKS_LIPS=ec,kc.FACE_LANDMARKS_LEFT_EYE=nc,kc.FACE_LANDMARKS_LEFT_EYEBROW=rc,kc.FACE_LANDMARKS_LEFT_IRIS=ic,kc.FACE_LANDMARKS_RIGHT_EYE=sc,kc.FACE_LANDMARKS_RIGHT_EYEBROW=oc,kc.FACE_LANDMARKS_RIGHT_IRIS=ac,kc.FACE_LANDMARKS_FACE_OVAL=cc,kc.FACE_LANDMARKS_CONTOURS=hc,kc.FACE_LANDMARKS_TESSELATION=uc;var xc=class extends Qa{constructor(t,e){super(new Ka(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},un(t=this.h=new fo,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return un(this.h,0,2,So(t,an(this.h,xs,2))),this.l(t)}ta(t,e){return this.j={classifications:[]},qa(this,t,e),this.j}ua(t,e,n){return this.j={classifications:[]},Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"input_image"),Qi(t,"norm_rect"),ts(t,"classifications");const e=new Vi;Yn(e,po,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),zi(n,"IMAGE:input_image"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"CLASSIFICATIONS:classifications"),n.o(e),Zi(t,n),this.g.attachProtoListener("classifications",((t,e)=>{this.j=function(t){const e={classifications:hn(t,vs,1).map((t=>Lo(an(t,ss,4)?.g()??[],gn(mn(t,2),0),_n(t,3))))};return null!=te(Be(t,2))&&(e.timestampMs=gn(te(Be(t,2)),0)),e}(Es(t)),qo(this,e)})),this.g.attachEmptyPacketListener("classifications",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};xc.prototype.classifyForVideo=xc.prototype.ua,xc.prototype.classify=xc.prototype.ta,xc.prototype.setOptions=xc.prototype.o,xc.createFromModelPath=function(t,e){return Ya(xc,t,{baseOptions:{modelAssetPath:e}})},xc.createFromModelBuffer=function(t,e){return Ya(xc,t,{baseOptions:{modelAssetBuffer:e}})},xc.createFromOptions=function(t,e){return Ya(xc,t,e)};var Sc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!0),this.h=new go,this.embeddings={embeddings:[]},un(t=this.h,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){var e=this.h,n=an(this.h,Ls,2);return n=n?n.clone():new Ls,void 0!==t.l2Normalize?vn(n,1,t.l2Normalize):"l2Normalize"in t&&Ve(n,1),void 0!==t.quantize?vn(n,2,t.quantize):"quantize"in t&&Ve(n,2),un(e,0,2,n),this.l(t)}Aa(t,e){return qa(this,t,e),this.embeddings}Ba(t,e,n){return Ja(this,t,n,e),this.embeddings}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"embeddings_out");const e=new Vi;Yn(e,mo,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"EMBEDDINGS:embeddings_out"),n.o(e),Zi(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=ks(t),this.embeddings=function(t){return{embeddings:hn(t,bs,1).map((t=>{const e={headIndex:gn(mn(t,3),0)??-1,headName:_n(t,4)??""};if(void 0!==on(t,ws,tn(t,1)))t=Ke(t=an(t,ws,tn(t,1)),1,Wt,ze()),e.floatEmbedding=t.slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=an(t,Ts,tn(t,2))?.pa()?.h()??n}return e})),timestampMs:gn(te(Be(t,2)),0)}}(t),qo(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Sc.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Po(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Po(Mo(t.quantizedEmbedding),Mo(e.quantizedEmbedding))}return t},Sc.prototype.embedForVideo=Sc.prototype.Ba,Sc.prototype.embed=Sc.prototype.Aa,Sc.prototype.setOptions=Sc.prototype.o,Sc.createFromModelPath=function(t,e){return Ya(Sc,t,{baseOptions:{modelAssetPath:e}})},Sc.createFromModelBuffer=function(t,e){return Ya(Sc,t,{baseOptions:{modelAssetBuffer:e}})},Sc.createFromOptions=function(t,e){return Ya(Sc,t,e)};var Lc=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};function Rc(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Fc(t){try{const e=new Lc(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Qo(t)}}Lc.prototype.close=Lc.prototype.close;var Ic=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new wo,this.v=new yo,un(this.h,0,3,this.v),un(t=this.h,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?Ve(this.h,2,re(t.displayNamesLocale)):"displayNamesLocale"in t&&Ve(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}J(){!function(t){const e=hn(t.ea(),Yi,1).filter((t=>_n(t,1).includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(an(e[0],Vi,7)?.l()?.g()??new Map).forEach(((e,n)=>{t.s[Number(n)]=_n(e,1)}))}(this)}segment(t,e,n){const r="function"!=typeof e?e:{};return this.j="function"==typeof e?e:n,Rc(this),qa(this,t,r),Fc(this)}Ma(t,e,n,r){const i="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,Rc(this),Ja(this,t,i,e),Fc(this)}Ea(){return this.s}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect");const e=new Vi;Yn(e,To,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),n.o(e),Zi(t,n),Jo(this,t),this.outputConfidenceMasks&&(ts(t,"confidence_masks"),Ki(n,"CONFIDENCE_MASKS:confidence_masks"),Zo(this,"confidence_masks"),this.g.da("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>Za(this,t,!0,!this.j))),qo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],qo(this,t)}))),this.outputCategoryMask&&(ts(t,"category_mask"),Ki(n,"CATEGORY_MASK:category_mask"),Zo(this,"category_mask"),this.g.V("category_mask",((t,e)=>{this.categoryMask=Za(this,t,!1,!this.j),qo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,qo(this,t)}))),ts(t,"quality_scores"),Ki(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,qo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ic.prototype.getLabels=Ic.prototype.Ea,Ic.prototype.segmentForVideo=Ic.prototype.Ma,Ic.prototype.segment=Ic.prototype.segment,Ic.prototype.setOptions=Ic.prototype.o,Ic.createFromModelPath=function(t,e){return Ya(Ic,t,{baseOptions:{modelAssetPath:e}})},Ic.createFromModelBuffer=function(t,e){return Ya(Ic,t,{baseOptions:{modelAssetBuffer:e}})},Ic.createFromOptions=function(t,e){return Ya(Ic,t,e)};var Mc=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};Mc.prototype.close=Mc.prototype.close;var Pc=class extends $n{constructor(t){super(t)}},Oc=[0,li,-2],Cc=[0,ii,-3,pi,ii,-1],Uc=[0,Cc],Nc=[0,Cc,li,-1],Dc=class extends $n{constructor(t){super(t)}},Bc=[0,ii,-1,pi],Gc=class extends $n{constructor(){super()}},jc=class extends $n{constructor(t){super(t)}},Vc=[1,2,3,4,5,6,7,8,9,10,14,15],Xc=class extends $n{constructor(){super()}};Xc.prototype.g=Li([0,vi,[0,Vc,Ei,Cc,Ei,[0,Cc,Oc],Ei,Uc,Ei,[0,Uc,Oc],Ei,Bc,Ei,[0,ii,-3,pi,Ai],Ei,[0,ii,-3,pi],Ei,[0,_i,ii,-2,pi,li,pi,-1,2,ii,Oc],Ei,Nc,Ei,[0,Nc,Oc],ii,Oc,_i,Ei,[0,ii,-3,pi,Oc,-1],Ei,[0,vi,Bc]],_i,[0,_i,li,-1,pi]]);var Hc=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new wo,this.s=new yo,un(this.h,0,3,this.s),un(t=this.h,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,n,r){const i="function"!=typeof n?n:{};this.j="function"==typeof n?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.B+1,r=new Xc;const s=new jc;var o=new Pc;if(En(o,1,255),un(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new Dc;vn(a,3,!0),wn(a,1,e.keypoint.x),wn(a,2,e.keypoint.y),ln(s,5,Vc,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new Gc,e.scribble))vn(e=new Dc,3,!0),wn(e,1,a.x),wn(e,2,a.y),pn(o,1,Dc,e);ln(s,15,Vc,o)}pn(r,1,jc,s),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),qa(this,t,i);t:{try{const t=new Mc(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=t;break t}this.j(t)}finally{Qo(this)}c=void 0}return c}m(){var t=new es;Qi(t,"image_in"),Qi(t,"roi_in"),Qi(t,"norm_rect_in");const e=new Vi;Yn(e,To,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),zi(n,"IMAGE:image_in"),zi(n,"ROI:roi_in"),zi(n,"NORM_RECT:norm_rect_in"),n.o(e),Zi(t,n),Jo(this,t),this.outputConfidenceMasks&&(ts(t,"confidence_masks"),Ki(n,"CONFIDENCE_MASKS:confidence_masks"),Zo(this,"confidence_masks"),this.g.da("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>Za(this,t,!0,!this.j))),qo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],qo(this,t)}))),this.outputCategoryMask&&(ts(t,"category_mask"),Ki(n,"CATEGORY_MASK:category_mask"),Zo(this,"category_mask"),this.g.V("category_mask",((t,e)=>{this.categoryMask=Za(this,t,!1,!this.j),qo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,qo(this,t)}))),ts(t,"quality_scores"),Ki(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,qo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Hc.prototype.segment=Hc.prototype.segment,Hc.prototype.setOptions=Hc.prototype.o,Hc.createFromModelPath=function(t,e){return Ya(Hc,t,{baseOptions:{modelAssetPath:e}})},Hc.createFromModelBuffer=function(t,e){return Ya(Hc,t,{baseOptions:{modelAssetBuffer:e}})},Hc.createFromOptions=function(t,e){return Ya(Hc,t,e)};var Wc=class extends Qa{constructor(t,e){super(new Ka(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},un(t=this.h=new bo,0,1,e=new Ps)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?Ve(this.h,2,re(t.displayNamesLocale)):"displayNamesLocale"in t&&Ve(this.h,2),void 0!==t.maxResults?En(this.h,3,t.maxResults):"maxResults"in t&&Ve(this.h,3),void 0!==t.scoreThreshold?wn(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&Ve(this.h,4),void 0!==t.categoryAllowlist?Tn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&Ve(this.h,5),void 0!==t.categoryDenylist?Tn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&Ve(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},qa(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},Ja(this,t,n,e),this.j}m(){var t=new es;Qi(t,"input_frame_gpu"),Qi(t,"norm_rect"),ts(t,"detections");const e=new Vi;Yn(e,Ao,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),zi(n,"IMAGE:input_frame_gpu"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"DETECTIONS:detections"),n.o(e),Zi(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=ls(e),this.j.detections.push(Ro(t));qo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{qo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Wc.prototype.detectForVideo=Wc.prototype.F,Wc.prototype.detect=Wc.prototype.D,Wc.prototype.setOptions=Wc.prototype.o,Wc.createFromModelPath=async function(t,e){return Ya(Wc,t,{baseOptions:{modelAssetPath:e}})},Wc.createFromModelBuffer=function(t,e){return Ya(Wc,t,{baseOptions:{modelAssetBuffer:e}})},Wc.createFromOptions=function(t,e){return Ya(Wc,t,e)};var zc=class{constructor(t,e,n){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=n}close(){this.segmentationMasks?.forEach((t=>{t.close()}))}};function Kc(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Yc(t){try{const e=new zc(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{Qo(t)}}zc.prototype.close=zc.prototype.close;var $c=class extends Qa{constructor(t,e){super(new Ka(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,un(t=this.h=new ko,0,1,e=new Ps),this.v=new co,un(this.h,0,3,this.v),this.j=new ao,un(this.h,0,2,this.j),En(this.j,4,1),wn(this.j,2,.5),wn(this.v,2,.5),wn(this.h,4,.5)}get baseOptions(){return an(this.h,Ps,1)}set baseOptions(t){un(this.h,0,1,t)}o(t){return"numPoses"in t&&En(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&wn(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&wn(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&wn(this.v,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}D(t,e,n){const r="function"!=typeof e?e:{};return this.s="function"==typeof e?e:n,Kc(this),qa(this,t,r),Yc(this)}F(t,e,n,r){const i="function"!=typeof n?n:{};return this.s="function"==typeof n?n:r,Kc(this),Ja(this,t,i,e),Yc(this)}m(){var t=new es;Qi(t,"image_in"),Qi(t,"norm_rect"),ts(t,"normalized_landmarks"),ts(t,"world_landmarks"),ts(t,"segmentation_masks");const e=new Vi;Yn(e,xo,this.h);const n=new Yi;Wi(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),zi(n,"IMAGE:image_in"),zi(n,"NORM_RECT:norm_rect"),Ki(n,"NORM_LANDMARKS:normalized_landmarks"),Ki(n,"WORLD_LANDMARKS:world_landmarks"),n.o(e),Zi(t,n),Jo(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((t,e)=>{this.landmarks=[];for(const e of t)t=gs(e),this.landmarks.push(Fo(t));qo(this,e)})),this.g.attachEmptyPacketListener("normalized_landmarks",(t=>{this.landmarks=[],qo(this,t)})),this.g.attachProtoVectorListener("world_landmarks",((t,e)=>{this.worldLandmarks=[];for(const e of t)t=ds(e),this.worldLandmarks.push(Io(t));qo(this,e)})),this.g.attachEmptyPacketListener("world_landmarks",(t=>{this.worldLandmarks=[],qo(this,t)})),this.outputSegmentationMasks&&(Ki(n,"SEGMENTATION_MASK:segmentation_masks"),Zo(this,"segmentation_masks"),this.g.da("segmentation_masks",((t,e)=>{this.segmentationMasks=t.map((t=>Za(this,t,!0,!this.s))),qo(this,e)})),this.g.attachEmptyPacketListener("segmentation_masks",(t=>{this.segmentationMasks=[],qo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$c.prototype.detectForVideo=$c.prototype.F,$c.prototype.detect=$c.prototype.D,$c.prototype.setOptions=$c.prototype.o,$c.createFromModelPath=function(t,e){return Ya($c,t,{baseOptions:{modelAssetPath:e}})},$c.createFromModelBuffer=function(t,e){return Ya($c,t,{baseOptions:{modelAssetBuffer:e}})},$c.createFromOptions=function(t,e){return Ya($c,t,e)},$c.POSE_CONNECTIONS=wc,exports.FaceDetector=tc,exports.FaceLandmarker=fc,exports.FaceStylizer=dc,exports.FilesetResolver=Do,exports.GestureRecognizer=_c,exports.HandLandmarker=Ec,exports.HolisticLandmarker=kc,exports.ImageClassifier=xc,exports.ImageEmbedder=Sc,exports.ImageSegmenter=Ic,exports.ImageSegmenterResult=Lc,exports.InteractiveSegmenter=Hc,exports.InteractiveSegmenterResult=Mc,exports.MPImage=Va,exports.MPMask=Ta,exports.ObjectDetector=Wc,exports.PoseLandmarker=$c,exports.VisionTaskRunner=Qa;\n//# sourceMappingURL=vision_bundle_cjs.js.map\n';
|
|
1839
1882
|
class Dc {
|
|
1840
1883
|
// MediaPipe Tasks Vision worker
|
|
1841
1884
|
cvWorker = null;
|
|
@@ -1914,9 +1957,13 @@ class Dc {
|
|
|
1914
1957
|
actualCVFPS = 0;
|
|
1915
1958
|
debugMode = !1;
|
|
1916
1959
|
// Debug mode disabled for production
|
|
1917
|
-
// WASM URLs resolved on the main thread (where the consumer's bundler
|
|
1918
|
-
// and passed down via the message chain.
|
|
1960
|
+
// WASM loader URLs resolved on the main thread (where the consumer's bundler
|
|
1961
|
+
// operates) and passed down via the message chain. Binary entries are
|
|
1962
|
+
// sentinel URLs served from `cvWasmBinaries` by the cv-tasks fetch shim.
|
|
1919
1963
|
cvWasmUrls = null;
|
|
1964
|
+
// MediaPipe binary bytes, shipped to the cv-tasks worker (structured-cloned)
|
|
1965
|
+
// at init so its fetch shim can serve them in place of an opaque blob fetch.
|
|
1966
|
+
cvWasmBinaries = null;
|
|
1920
1967
|
// Monotonic correlation id for postToCV. Each request gets a unique id; the
|
|
1921
1968
|
// worker echoes it on its result message so the host can match responses to
|
|
1922
1969
|
// requests under burst (replaces the prior anonymous-listener bridge that
|
|
@@ -1941,11 +1988,11 @@ class Dc {
|
|
|
1941
1988
|
this.debugMode && console.log("🔧 [CVSystem]", ...e);
|
|
1942
1989
|
}
|
|
1943
1990
|
/**
|
|
1944
|
-
* Receive WASM
|
|
1991
|
+
* Receive WASM loader URLs and binary bytes resolved by the main thread.
|
|
1945
1992
|
* Must be called before any CV feature is enabled.
|
|
1946
1993
|
*/
|
|
1947
|
-
|
|
1948
|
-
this.cvWasmUrls = e, this.debugLog("WASM
|
|
1994
|
+
setCVWasmAssets(e, n) {
|
|
1995
|
+
this.cvWasmUrls = e, this.cvWasmBinaries = n, this.debugLog("WASM assets received from main thread");
|
|
1949
1996
|
}
|
|
1950
1997
|
setDebugMode(e) {
|
|
1951
1998
|
this.debugMode = e, this.debugLog(`Debug mode ${e ? "enabled" : "disabled"}`), this.cvWorker && this.cvWorker.postMessage({ type: "debug", enabled: e });
|
|
@@ -1971,16 +2018,17 @@ class Dc {
|
|
|
1971
2018
|
* core build time (via ?raw imports), so no external file fetch is needed
|
|
1972
2019
|
* for them. The worker is created from a Blob URL.
|
|
1973
2020
|
*
|
|
1974
|
-
* WASM
|
|
1975
|
-
* bundler can discover them) and passed here via
|
|
2021
|
+
* WASM loader URLs and binary bytes are resolved on the main thread (where
|
|
2022
|
+
* the consumer's bundler can discover them) and passed here via
|
|
2023
|
+
* setCVWasmAssets().
|
|
1976
2024
|
*/
|
|
1977
2025
|
async ensureCVWorker() {
|
|
1978
2026
|
if (!this.cvWorker) {
|
|
1979
|
-
if (!this.cvWasmUrls)
|
|
1980
|
-
throw new Error("CV WASM
|
|
2027
|
+
if (!this.cvWasmUrls || !this.cvWasmBinaries)
|
|
2028
|
+
throw new Error("CV WASM assets not set — setCVWasmAssets() must be called before enabling CV features");
|
|
1981
2029
|
try {
|
|
1982
2030
|
this.debugLog("🔧 Creating MediaPipe Tasks Vision worker...");
|
|
1983
|
-
const e = new Blob([
|
|
2031
|
+
const e = new Blob([Pc], { type: "application/javascript" }), n = URL.createObjectURL(e);
|
|
1984
2032
|
this.cvWorker = new Worker(n), URL.revokeObjectURL(n), this.cvWorker.addEventListener("message", (r) => {
|
|
1985
2033
|
const i = r.data;
|
|
1986
2034
|
this.debugLog(`📨 [CV Worker -> CVSystem] ${i.type}`, i.success ? i.data : i.error);
|
|
@@ -1995,8 +2043,9 @@ class Dc {
|
|
|
1995
2043
|
}, this.cvWorker.onmessageerror = (r) => {
|
|
1996
2044
|
this.debugLog("❌ CV worker message error", r), this.handleWorkerFailure("Worker message error");
|
|
1997
2045
|
}, this.cvWorker.postMessage({ type: "debug", enabled: this.debugMode }), this.debugLog("Sending init with inlined vision bundle and WASM URLs"), await this.postToCV("init", {
|
|
1998
|
-
visionBundleCode:
|
|
1999
|
-
wasmUrls: this.cvWasmUrls
|
|
2046
|
+
visionBundleCode: Fc,
|
|
2047
|
+
wasmUrls: this.cvWasmUrls,
|
|
2048
|
+
wasmBinaries: this.cvWasmBinaries
|
|
2000
2049
|
}), this.debugLog("✅ CV worker initialized");
|
|
2001
2050
|
} catch (e) {
|
|
2002
2051
|
throw this.debugLog("❌ Failed to initialize CV worker:", e), e;
|
|
@@ -2657,10 +2706,10 @@ class pn {
|
|
|
2657
2706
|
return this.cvSurface;
|
|
2658
2707
|
}
|
|
2659
2708
|
/**
|
|
2660
|
-
* Pass WASM URLs
|
|
2709
|
+
* Pass WASM loader URLs and binary bytes down to CVSystem.
|
|
2661
2710
|
*/
|
|
2662
|
-
|
|
2663
|
-
this.cvSystem.
|
|
2711
|
+
setCVWasmAssets(e, n) {
|
|
2712
|
+
this.cvSystem.setCVWasmAssets(e, n);
|
|
2664
2713
|
}
|
|
2665
2714
|
/**
|
|
2666
2715
|
* Set stream type and optional device ID
|
|
@@ -3375,7 +3424,7 @@ const cs = [
|
|
|
3375
3424
|
"poseDetection",
|
|
3376
3425
|
"bodySegmentation"
|
|
3377
3426
|
];
|
|
3378
|
-
class
|
|
3427
|
+
class yi {
|
|
3379
3428
|
/**
|
|
3380
3429
|
* Parse all parameter declarations from shader code
|
|
3381
3430
|
*/
|
|
@@ -3674,7 +3723,7 @@ class De {
|
|
|
3674
3723
|
*/
|
|
3675
3724
|
async init() {
|
|
3676
3725
|
try {
|
|
3677
|
-
this.parameters =
|
|
3726
|
+
this.parameters = yi.parseParameters(this.shaderCode);
|
|
3678
3727
|
for (const r of this.parameters)
|
|
3679
3728
|
r.type === "accumulator" && this.accumulatorValues.set(r.uniformName, r.config.default ?? 0);
|
|
3680
3729
|
for (const r of this.parameters) {
|
|
@@ -3744,7 +3793,7 @@ class De {
|
|
|
3744
3793
|
break;
|
|
3745
3794
|
}
|
|
3746
3795
|
}
|
|
3747
|
-
const o = this.findInjectionPoint(r), c = this.getBuiltInUniforms(), u = this.parameters.map((w) =>
|
|
3796
|
+
const o = this.findInjectionPoint(r), c = this.getBuiltInUniforms(), u = this.parameters.map((w) => yi.generateUniformDeclaration(w)).join(`
|
|
3748
3797
|
`), h = e.includes("fwidth");
|
|
3749
3798
|
h && this.glslVersion === "glsl100" && (this.gl.getExtension("OES_standard_derivatives") || console.warn("Shader uses fwidth() but OES_standard_derivatives extension is not supported. Shader may not compile."));
|
|
3750
3799
|
const f = [];
|
|
@@ -4380,136 +4429,136 @@ ${c}`);
|
|
|
4380
4429
|
*/
|
|
4381
4430
|
updateBuiltInUniforms(e) {
|
|
4382
4431
|
this.setUniform("u_resolution", "vec2", [e.width, e.height]), this.setUniform("u_time", "float", e.time), this.setUniform("u_deltaTime", "float", e.deltaTime), this.setUniform("u_frame", "int", e.frameCount), this.setUniform("u_fps", "float", e.fps), this.setUniform("u_mouse", "vec2", [e.mouse.x, e.height - e.mouse.y]), this.setUniform("u_mouseInCanvas", "bool", e.mouse.isInCanvas), this.setUniform("u_mousePressed", "bool", e.mouse.isPressed), this.setUniform("u_mouseLeft", "bool", e.mouse.leftButton), this.setUniform("u_mouseRight", "bool", e.mouse.rightButton), this.setUniform("u_mouseMiddle", "bool", e.mouse.middleButton), this.setUniform("u_mouseDelta", "vec2", [e.mouse.deltaX, -e.mouse.deltaY]), this.setUniform("u_mouseWheel", "float", e.mouse.wheelDelta), this.setUniform("u_mouseWasPressed", "bool", e.mouse.wasPressed), this.setUniform("u_mouseWasReleased", "bool", e.mouse.wasReleased), this.setUniform("u_keySpace", "bool", e.keyboard.isPressed(" ") || e.keyboard.isPressed("space")), this.setUniform("u_keyShift", "bool", e.keyboard.shift), this.setUniform("u_keyCtrl", "bool", e.keyboard.ctrl), this.setUniform("u_keyAlt", "bool", e.keyboard.alt), this.setUniform("u_keyW", "bool", e.keyboard.isPressed("w") || e.keyboard.isPressed("W")), this.setUniform("u_keyA", "bool", e.keyboard.isPressed("a") || e.keyboard.isPressed("A")), this.setUniform("u_keyS", "bool", e.keyboard.isPressed("s") || e.keyboard.isPressed("S")), this.setUniform("u_keyD", "bool", e.keyboard.isPressed("d") || e.keyboard.isPressed("D")), this.setUniform("u_keyUp", "bool", e.keyboard.isPressed("ArrowUp")), this.setUniform("u_keyDown", "bool", e.keyboard.isPressed("ArrowDown")), this.setUniform("u_keyLeft", "bool", e.keyboard.isPressed("ArrowLeft")), this.setUniform("u_keyRight", "bool", e.keyboard.isPressed("ArrowRight")), e.keyboard.textureData && this.updateKeyboardTexture(e.keyboard.textureData), this.setUniform("u_touchCount", "int", e.touches.count);
|
|
4383
|
-
for (let
|
|
4384
|
-
const
|
|
4385
|
-
|
|
4432
|
+
for (let b = 0; b < 5; b++) {
|
|
4433
|
+
const y = e.touches.points[b];
|
|
4434
|
+
y ? this.setUniform(`u_touch${b}`, "vec2", [y.x, e.height - y.y]) : this.setUniform(`u_touch${b}`, "vec2", [0, 0]);
|
|
4386
4435
|
}
|
|
4387
4436
|
this.setUniform("u_pointer", "vec2", [e.pointer.x, e.height - e.pointer.y]), this.setUniform("u_pointerDelta", "vec2", [e.pointer.deltaX, -e.pointer.deltaY]), this.setUniform("u_pointerDown", "bool", e.pointer.isDown), this.setUniform("u_pointerWasPressed", "bool", e.pointer.wasPressed), this.setUniform("u_pointerWasReleased", "bool", e.pointer.wasReleased), this.setUniform("u_pointerInCanvas", "bool", e.pointer.isInCanvas);
|
|
4388
4437
|
const n = e.audio;
|
|
4389
4438
|
if (this.setUniform("u_audioVolume", "float", n.volume?.current || 0), this.setUniform("u_audioPeak", "float", n.volume?.peak || 0), this.setUniform("u_audioVolumeSmoothed", "float", n.volume?.smoothed || 0), this.setUniform("u_audioLow", "float", n.bands?.low || 0), this.setUniform("u_audioLowMid", "float", n.bands?.lowMid || 0), this.setUniform("u_audioMid", "float", n.bands?.mid || 0), this.setUniform("u_audioHighMid", "float", n.bands?.highMid || 0), this.setUniform("u_audioHigh", "float", n.bands?.high || 0), this.setUniform("u_audioLowSmoothed", "float", n.bands?.lowSmoothed || 0), this.setUniform("u_audioLowMidSmoothed", "float", n.bands?.lowMidSmoothed || 0), this.setUniform("u_audioMidSmoothed", "float", n.bands?.midSmoothed || 0), this.setUniform("u_audioHighMidSmoothed", "float", n.bands?.highMidSmoothed || 0), this.setUniform("u_audioHighSmoothed", "float", n.bands?.highSmoothed || 0), this.setUniform("u_audioKick", "float", n.beat?.kick || 0), this.setUniform("u_audioSnare", "float", n.beat?.snare || 0), this.setUniform("u_audioHat", "float", n.beat?.hat || 0), this.setUniform("u_audioAny", "float", n.beat?.any || 0), this.setUniform("u_audioKickSmoothed", "float", n.beat?.kickSmoothed || 0), this.setUniform("u_audioSnareSmoothed", "float", n.beat?.snareSmoothed || 0), this.setUniform("u_audioHatSmoothed", "float", n.beat?.hatSmoothed || 0), this.setUniform("u_audioAnySmoothed", "float", n.beat?.anySmoothed || 0), this.setUniform("u_audioKickTrigger", "bool", n.beat?.triggers?.kick || !1), this.setUniform("u_audioSnareTrigger", "bool", n.beat?.triggers?.snare || !1), this.setUniform("u_audioHatTrigger", "bool", n.beat?.triggers?.hat || !1), this.setUniform("u_audioAnyTrigger", "bool", n.beat?.triggers?.any || !1), this.setUniform("u_audioBPM", "float", n.beat?.bpm || 120), this.setUniform("u_audioConfidence", "float", n.beat?.confidence || 0), this.setUniform("u_audioIsLocked", "bool", n.beat?.isLocked || !1), this.setUniform("u_audioBrightness", "float", n.spectral?.brightness || 0), this.setUniform("u_audioFlatness", "float", n.spectral?.flatness || 0), n.isConnected) {
|
|
4390
4439
|
this.updateAudioFFTTexture(n.getFrequencyData());
|
|
4391
|
-
const
|
|
4392
|
-
|
|
4440
|
+
const b = n.getWaveform();
|
|
4441
|
+
b.length > 0 && this.updateAudioWaveformTexture(b);
|
|
4393
4442
|
}
|
|
4394
4443
|
const r = e.video;
|
|
4395
4444
|
r.isConnected && r.currentFrame ? (this.updateVideoTexture(r.currentFrame), this.setUniform("u_videoResolution", "vec2", [r.frameWidth, r.frameHeight]), this.setUniform("u_videoFrameRate", "float", r.frameRate)) : (this.setUniform("u_videoResolution", "vec2", [0, 0]), this.setUniform("u_videoFrameRate", "float", 0)), r.cv?.analysedFrame instanceof OffscreenCanvas ? (this.updateAnalysedFrameTexture(r.cv.analysedFrame), this.setUniform("u_videoAnalysedAvailable", "bool", !0)) : (this.bindAnalysedFrameFallback(), this.setUniform("u_videoAnalysedAvailable", "bool", !1));
|
|
4396
4445
|
const i = e.videoStreams || [], o = Math.min(i.length, De.MAX_VIDEO_STREAMS);
|
|
4397
4446
|
this.setUniform("u_videoStreamCount", "int", o);
|
|
4398
|
-
for (let
|
|
4399
|
-
const
|
|
4400
|
-
|
|
4447
|
+
for (let b = 0; b < De.MAX_VIDEO_STREAMS; b++) {
|
|
4448
|
+
const y = `u_videoStream${b}Connected`, E = `u_videoStream${b}Resolution`;
|
|
4449
|
+
b < o && i[b]?.isConnected && i[b]?.currentFrame ? (this.updateVideoStreamTexture(b, i[b].currentFrame), this.setUniform(
|
|
4401
4450
|
E,
|
|
4402
4451
|
"vec2",
|
|
4403
|
-
[i[
|
|
4404
|
-
), this.setUniform(
|
|
4452
|
+
[i[b].frameWidth, i[b].frameHeight]
|
|
4453
|
+
), this.setUniform(y, "bool", !0)) : (this.setUniform(E, "vec2", [0, 0]), this.setUniform(y, "bool", !1));
|
|
4405
4454
|
}
|
|
4406
4455
|
const c = e.devices || [], u = Math.min(c.length, De.MAX_DEVICE_VIDEOS);
|
|
4407
4456
|
this.setUniform("u_deviceCount", "int", u);
|
|
4408
|
-
for (let
|
|
4409
|
-
const
|
|
4410
|
-
|
|
4457
|
+
for (let b = 0; b < De.MAX_DEVICE_VIDEOS; b++) {
|
|
4458
|
+
const y = `u_device${b}Connected`, E = `u_device${b}Resolution`;
|
|
4459
|
+
b < u && c[b]?.video?.isConnected && c[b].video.currentFrame ? (this.updateDeviceTexture(b, c[b].video.currentFrame), this.setUniform(
|
|
4411
4460
|
E,
|
|
4412
4461
|
"vec2",
|
|
4413
|
-
[c[
|
|
4414
|
-
), this.setUniform(
|
|
4462
|
+
[c[b].video.frameWidth, c[b].video.frameHeight]
|
|
4463
|
+
), this.setUniform(y, "bool", !0)) : (this.setUniform(E, "vec2", [0, 0]), this.setUniform(y, "bool", !1));
|
|
4415
4464
|
}
|
|
4416
4465
|
const h = e.audioStreams || [], f = Math.min(h.length, De.MAX_AUDIO_STREAMS);
|
|
4417
4466
|
this.setUniform("u_audioStreamCount", "int", f);
|
|
4418
|
-
for (let
|
|
4419
|
-
const
|
|
4420
|
-
if (
|
|
4421
|
-
const E = h[
|
|
4422
|
-
this.setUniform(`${
|
|
4467
|
+
for (let b = 0; b < De.MAX_AUDIO_STREAMS; b++) {
|
|
4468
|
+
const y = `u_audioStream${b}`;
|
|
4469
|
+
if (b < f && h[b]?.isConnected) {
|
|
4470
|
+
const E = h[b];
|
|
4471
|
+
this.setUniform(`${y}Connected`, "bool", !0), this.setUniform(`${y}Volume`, "float", E.volume?.current || 0), this.setUniform(`${y}Low`, "float", E.bands?.low || 0), this.setUniform(`${y}LowMid`, "float", E.bands?.lowMid || 0), this.setUniform(`${y}Mid`, "float", E.bands?.mid || 0), this.setUniform(`${y}HighMid`, "float", E.bands?.highMid || 0), this.setUniform(`${y}High`, "float", E.bands?.high || 0), this.setUniform(`${y}Brightness`, "float", E.spectral?.brightness || 0), this.setUniform(`${y}Flatness`, "float", E.spectral?.flatness || 0);
|
|
4423
4472
|
} else
|
|
4424
|
-
this.setUniform(`${
|
|
4473
|
+
this.setUniform(`${y}Connected`, "bool", !1), this.setUniform(`${y}Volume`, "float", 0), this.setUniform(`${y}Low`, "float", 0), this.setUniform(`${y}LowMid`, "float", 0), this.setUniform(`${y}Mid`, "float", 0), this.setUniform(`${y}HighMid`, "float", 0), this.setUniform(`${y}High`, "float", 0), this.setUniform(`${y}Brightness`, "float", 0), this.setUniform(`${y}Flatness`, "float", 0);
|
|
4425
4474
|
}
|
|
4426
4475
|
const m = r.cv?.faces || [], g = m[0], v = this.visibleFeatures.has("faceDetection") && !!g, w = this.visibleFeatures.has("faceMesh") && !!g, D = this.visibleFeatures.has("emotionDetection") && !!g;
|
|
4427
4476
|
if (this.setUniform("u_faceCount", "int", this.visibleFeatures.has("faceDetection") ? m.length : 0), v) {
|
|
4428
|
-
const
|
|
4429
|
-
this.setUniform("u_face0Bounds", "vec4", [
|
|
4477
|
+
const b = g.bounds, y = g.center?.x || 0, E = g.center?.y || 0;
|
|
4478
|
+
this.setUniform("u_face0Bounds", "vec4", [b?.x || 0, 1 - (b?.y || 0) - (b?.height || 0), b?.width || 0, b?.height || 0]), this.setUniform("u_face0Center", "vec2", [y, 1 - E]), this.setUniform("u_face0Confidence", "float", g.confidence || 0);
|
|
4430
4479
|
} else
|
|
4431
4480
|
this.setUniform("u_face0Bounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_face0Center", "vec2", [0, 0]), this.setUniform("u_face0Confidence", "float", 0);
|
|
4432
4481
|
if (w) {
|
|
4433
|
-
const
|
|
4434
|
-
this.setUniform("u_face0HeadPose", "vec3", [
|
|
4482
|
+
const b = g.headPose || {};
|
|
4483
|
+
this.setUniform("u_face0HeadPose", "vec3", [b.pitch || 0, b.yaw || 0, -(b.roll || 0)]);
|
|
4435
4484
|
} else
|
|
4436
4485
|
this.setUniform("u_face0HeadPose", "vec3", [0, 0, 0]);
|
|
4437
4486
|
if (D) {
|
|
4438
|
-
const
|
|
4439
|
-
this.setUniform("u_face0Neutral", "float",
|
|
4487
|
+
const b = g.expressions || {}, y = g.blendshapes || {};
|
|
4488
|
+
this.setUniform("u_face0Neutral", "float", b.neutral || 0), this.setUniform("u_face0Happy", "float", b.happy || 0), this.setUniform("u_face0Sad", "float", b.sad || 0), this.setUniform("u_face0Angry", "float", b.angry || 0), this.setUniform("u_face0Surprised", "float", b.surprised || 0), this.setUniform("u_face0Disgusted", "float", b.disgusted || 0), this.setUniform("u_face0Fearful", "float", b.fearful || 0), this.setUniform("u_face0BrowDownLeft", "float", y.browDownLeft || 0), this.setUniform("u_face0BrowDownRight", "float", y.browDownRight || 0), this.setUniform("u_face0BrowInnerUp", "float", y.browInnerUp || 0), this.setUniform("u_face0BrowOuterUpLeft", "float", y.browOuterUpLeft || 0), this.setUniform("u_face0BrowOuterUpRight", "float", y.browOuterUpRight || 0), this.setUniform("u_face0CheekPuff", "float", y.cheekPuff || 0), this.setUniform("u_face0CheekSquintLeft", "float", y.cheekSquintLeft || 0), this.setUniform("u_face0CheekSquintRight", "float", y.cheekSquintRight || 0), this.setUniform("u_face0EyeBlinkLeft", "float", y.eyeBlinkLeft || 0), this.setUniform("u_face0EyeBlinkRight", "float", y.eyeBlinkRight || 0), this.setUniform("u_face0EyeLookDownLeft", "float", y.eyeLookDownLeft || 0), this.setUniform("u_face0EyeLookDownRight", "float", y.eyeLookDownRight || 0), this.setUniform("u_face0EyeLookInLeft", "float", y.eyeLookInLeft || 0), this.setUniform("u_face0EyeLookInRight", "float", y.eyeLookInRight || 0), this.setUniform("u_face0EyeLookOutLeft", "float", y.eyeLookOutLeft || 0), this.setUniform("u_face0EyeLookOutRight", "float", y.eyeLookOutRight || 0), this.setUniform("u_face0EyeLookUpLeft", "float", y.eyeLookUpLeft || 0), this.setUniform("u_face0EyeLookUpRight", "float", y.eyeLookUpRight || 0), this.setUniform("u_face0EyeSquintLeft", "float", y.eyeSquintLeft || 0), this.setUniform("u_face0EyeSquintRight", "float", y.eyeSquintRight || 0), this.setUniform("u_face0EyeWideLeft", "float", y.eyeWideLeft || 0), this.setUniform("u_face0EyeWideRight", "float", y.eyeWideRight || 0), this.setUniform("u_face0JawForward", "float", y.jawForward || 0), this.setUniform("u_face0JawLeft", "float", y.jawLeft || 0), this.setUniform("u_face0JawOpen", "float", y.jawOpen || 0), this.setUniform("u_face0JawRight", "float", y.jawRight || 0), this.setUniform("u_face0MouthClose", "float", y.mouthClose || 0), this.setUniform("u_face0MouthDimpleLeft", "float", y.mouthDimpleLeft || 0), this.setUniform("u_face0MouthDimpleRight", "float", y.mouthDimpleRight || 0), this.setUniform("u_face0MouthFrownLeft", "float", y.mouthFrownLeft || 0), this.setUniform("u_face0MouthFrownRight", "float", y.mouthFrownRight || 0), this.setUniform("u_face0MouthFunnel", "float", y.mouthFunnel || 0), this.setUniform("u_face0MouthLeft", "float", y.mouthLeft || 0), this.setUniform("u_face0MouthLowerDownLeft", "float", y.mouthLowerDownLeft || 0), this.setUniform("u_face0MouthLowerDownRight", "float", y.mouthLowerDownRight || 0), this.setUniform("u_face0MouthPressLeft", "float", y.mouthPressLeft || 0), this.setUniform("u_face0MouthPressRight", "float", y.mouthPressRight || 0), this.setUniform("u_face0MouthPucker", "float", y.mouthPucker || 0), this.setUniform("u_face0MouthRight", "float", y.mouthRight || 0), this.setUniform("u_face0MouthRollLower", "float", y.mouthRollLower || 0), this.setUniform("u_face0MouthRollUpper", "float", y.mouthRollUpper || 0), this.setUniform("u_face0MouthShrugLower", "float", y.mouthShrugLower || 0), this.setUniform("u_face0MouthShrugUpper", "float", y.mouthShrugUpper || 0), this.setUniform("u_face0MouthSmileLeft", "float", y.mouthSmileLeft || 0), this.setUniform("u_face0MouthSmileRight", "float", y.mouthSmileRight || 0), this.setUniform("u_face0MouthStretchLeft", "float", y.mouthStretchLeft || 0), this.setUniform("u_face0MouthStretchRight", "float", y.mouthStretchRight || 0), this.setUniform("u_face0MouthUpperUpLeft", "float", y.mouthUpperUpLeft || 0), this.setUniform("u_face0MouthUpperUpRight", "float", y.mouthUpperUpRight || 0), this.setUniform("u_face0NoseSneerLeft", "float", y.noseSneerLeft || 0), this.setUniform("u_face0NoseSneerRight", "float", y.noseSneerRight || 0), this.setUniform("u_face0TongueOut", "float", y.tongueOut || 0);
|
|
4440
4489
|
} else
|
|
4441
4490
|
this.setUniform("u_face0Neutral", "float", 0), this.setUniform("u_face0Happy", "float", 0), this.setUniform("u_face0Sad", "float", 0), this.setUniform("u_face0Angry", "float", 0), this.setUniform("u_face0Surprised", "float", 0), this.setUniform("u_face0Disgusted", "float", 0), this.setUniform("u_face0Fearful", "float", 0), this.setUniform("u_face0BrowDownLeft", "float", 0), this.setUniform("u_face0BrowDownRight", "float", 0), this.setUniform("u_face0BrowInnerUp", "float", 0), this.setUniform("u_face0BrowOuterUpLeft", "float", 0), this.setUniform("u_face0BrowOuterUpRight", "float", 0), this.setUniform("u_face0CheekPuff", "float", 0), this.setUniform("u_face0CheekSquintLeft", "float", 0), this.setUniform("u_face0CheekSquintRight", "float", 0), this.setUniform("u_face0EyeBlinkLeft", "float", 0), this.setUniform("u_face0EyeBlinkRight", "float", 0), this.setUniform("u_face0EyeLookDownLeft", "float", 0), this.setUniform("u_face0EyeLookDownRight", "float", 0), this.setUniform("u_face0EyeLookInLeft", "float", 0), this.setUniform("u_face0EyeLookInRight", "float", 0), this.setUniform("u_face0EyeLookOutLeft", "float", 0), this.setUniform("u_face0EyeLookOutRight", "float", 0), this.setUniform("u_face0EyeLookUpLeft", "float", 0), this.setUniform("u_face0EyeLookUpRight", "float", 0), this.setUniform("u_face0EyeSquintLeft", "float", 0), this.setUniform("u_face0EyeSquintRight", "float", 0), this.setUniform("u_face0EyeWideLeft", "float", 0), this.setUniform("u_face0EyeWideRight", "float", 0), this.setUniform("u_face0JawForward", "float", 0), this.setUniform("u_face0JawLeft", "float", 0), this.setUniform("u_face0JawOpen", "float", 0), this.setUniform("u_face0JawRight", "float", 0), this.setUniform("u_face0MouthClose", "float", 0), this.setUniform("u_face0MouthDimpleLeft", "float", 0), this.setUniform("u_face0MouthDimpleRight", "float", 0), this.setUniform("u_face0MouthFrownLeft", "float", 0), this.setUniform("u_face0MouthFrownRight", "float", 0), this.setUniform("u_face0MouthFunnel", "float", 0), this.setUniform("u_face0MouthLeft", "float", 0), this.setUniform("u_face0MouthLowerDownLeft", "float", 0), this.setUniform("u_face0MouthLowerDownRight", "float", 0), this.setUniform("u_face0MouthPressLeft", "float", 0), this.setUniform("u_face0MouthPressRight", "float", 0), this.setUniform("u_face0MouthPucker", "float", 0), this.setUniform("u_face0MouthRight", "float", 0), this.setUniform("u_face0MouthRollLower", "float", 0), this.setUniform("u_face0MouthRollUpper", "float", 0), this.setUniform("u_face0MouthShrugLower", "float", 0), this.setUniform("u_face0MouthShrugUpper", "float", 0), this.setUniform("u_face0MouthSmileLeft", "float", 0), this.setUniform("u_face0MouthSmileRight", "float", 0), this.setUniform("u_face0MouthStretchLeft", "float", 0), this.setUniform("u_face0MouthStretchRight", "float", 0), this.setUniform("u_face0MouthUpperUpLeft", "float", 0), this.setUniform("u_face0MouthUpperUpRight", "float", 0), this.setUniform("u_face0NoseSneerLeft", "float", 0), this.setUniform("u_face0NoseSneerRight", "float", 0), this.setUniform("u_face0TongueOut", "float", 0);
|
|
4442
4491
|
const N = r.cv?.hands || [], W = this.visibleFeatures.has("handTracking");
|
|
4443
4492
|
this.setUniform("u_handCount", "int", W ? N.length : 0);
|
|
4444
|
-
const K = W ? N.find((
|
|
4493
|
+
const K = W ? N.find((b) => b.handedness === "left") : void 0, L = W ? N.find((b) => b.handedness === "right") : void 0;
|
|
4445
4494
|
if (K) {
|
|
4446
|
-
const
|
|
4447
|
-
this.setUniform("u_leftHandPalm", "vec3", [
|
|
4495
|
+
const b = K.palm || K.landmarks?.[9], y = K.gestures || {}, E = K.bounds;
|
|
4496
|
+
this.setUniform("u_leftHandPalm", "vec3", [b?.x || 0, 1 - (b?.y || 0), b?.z || 0]), this.setUniform("u_leftHandConfidence", "float", K.confidence || 0), this.setUniform("u_leftHandBounds", "vec4", [E?.x || 0, 1 - (E?.y || 0) - (E?.height || 0), E?.width || 0, E?.height || 0]), this.setUniform("u_leftHandFist", "float", y.fist || 0), this.setUniform("u_leftHandOpen", "float", y.openPalm || 0), this.setUniform("u_leftHandPeace", "float", y.peace || 0), this.setUniform("u_leftHandThumbsUp", "float", y.thumbsUp || 0), this.setUniform("u_leftHandThumbsDown", "float", y.thumbsDown || 0), this.setUniform("u_leftHandPointing", "float", y.pointing || 0), this.setUniform("u_leftHandILoveYou", "float", y.iLoveYou || 0);
|
|
4448
4497
|
} else
|
|
4449
4498
|
this.setUniform("u_leftHandPalm", "vec3", [0, 0, 0]), this.setUniform("u_leftHandConfidence", "float", 0), this.setUniform("u_leftHandBounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_leftHandFist", "float", 0), this.setUniform("u_leftHandOpen", "float", 0), this.setUniform("u_leftHandPeace", "float", 0), this.setUniform("u_leftHandThumbsUp", "float", 0), this.setUniform("u_leftHandThumbsDown", "float", 0), this.setUniform("u_leftHandPointing", "float", 0), this.setUniform("u_leftHandILoveYou", "float", 0);
|
|
4450
4499
|
if (L) {
|
|
4451
|
-
const
|
|
4452
|
-
this.setUniform("u_rightHandPalm", "vec3", [
|
|
4500
|
+
const b = L.palm || L.landmarks?.[9], y = L.gestures || {}, E = L.bounds;
|
|
4501
|
+
this.setUniform("u_rightHandPalm", "vec3", [b?.x || 0, 1 - (b?.y || 0), b?.z || 0]), this.setUniform("u_rightHandConfidence", "float", L.confidence || 0), this.setUniform("u_rightHandBounds", "vec4", [E?.x || 0, 1 - (E?.y || 0) - (E?.height || 0), E?.width || 0, E?.height || 0]), this.setUniform("u_rightHandFist", "float", y.fist || 0), this.setUniform("u_rightHandOpen", "float", y.openPalm || 0), this.setUniform("u_rightHandPeace", "float", y.peace || 0), this.setUniform("u_rightHandThumbsUp", "float", y.thumbsUp || 0), this.setUniform("u_rightHandThumbsDown", "float", y.thumbsDown || 0), this.setUniform("u_rightHandPointing", "float", y.pointing || 0), this.setUniform("u_rightHandILoveYou", "float", y.iLoveYou || 0);
|
|
4453
4502
|
} else
|
|
4454
4503
|
this.setUniform("u_rightHandPalm", "vec3", [0, 0, 0]), this.setUniform("u_rightHandConfidence", "float", 0), this.setUniform("u_rightHandBounds", "vec4", [0, 0, 0, 0]), this.setUniform("u_rightHandFist", "float", 0), this.setUniform("u_rightHandOpen", "float", 0), this.setUniform("u_rightHandPeace", "float", 0), this.setUniform("u_rightHandThumbsUp", "float", 0), this.setUniform("u_rightHandThumbsDown", "float", 0), this.setUniform("u_rightHandPointing", "float", 0), this.setUniform("u_rightHandILoveYou", "float", 0);
|
|
4455
4504
|
const O = this.visibleFeatures.has("poseDetection") ? r.cv?.pose ?? null : null;
|
|
4456
4505
|
if (this.setUniform("u_poseDetected", "bool", O !== null), O && O.landmarks) {
|
|
4457
|
-
const
|
|
4458
|
-
this.setUniform("u_poseConfidence", "float", O.confidence || 0), this.setUniform("u_nosePosition", "vec2", [
|
|
4506
|
+
const b = O.landmarks, y = (E) => 1 - (b[E]?.y || 0);
|
|
4507
|
+
this.setUniform("u_poseConfidence", "float", O.confidence || 0), this.setUniform("u_nosePosition", "vec2", [b[0]?.x || 0, y(0)]), this.setUniform("u_leftShoulderPosition", "vec2", [b[11]?.x || 0, y(11)]), this.setUniform("u_rightShoulderPosition", "vec2", [b[12]?.x || 0, y(12)]), this.setUniform("u_leftElbowPosition", "vec2", [b[13]?.x || 0, y(13)]), this.setUniform("u_rightElbowPosition", "vec2", [b[14]?.x || 0, y(14)]), this.setUniform("u_leftWristPosition", "vec2", [b[15]?.x || 0, y(15)]), this.setUniform("u_rightWristPosition", "vec2", [b[16]?.x || 0, y(16)]), this.setUniform("u_leftHipPosition", "vec2", [b[23]?.x || 0, y(23)]), this.setUniform("u_rightHipPosition", "vec2", [b[24]?.x || 0, y(24)]), this.setUniform("u_leftKneePosition", "vec2", [b[25]?.x || 0, y(25)]), this.setUniform("u_rightKneePosition", "vec2", [b[26]?.x || 0, y(26)]), this.setUniform("u_leftAnklePosition", "vec2", [b[27]?.x || 0, y(27)]), this.setUniform("u_rightAnklePosition", "vec2", [b[28]?.x || 0, y(28)]);
|
|
4459
4508
|
} else
|
|
4460
4509
|
this.setUniform("u_poseConfidence", "float", 0), this.setUniform("u_nosePosition", "vec2", [0, 0]), this.setUniform("u_leftShoulderPosition", "vec2", [0, 0]), this.setUniform("u_rightShoulderPosition", "vec2", [0, 0]), this.setUniform("u_leftElbowPosition", "vec2", [0, 0]), this.setUniform("u_rightElbowPosition", "vec2", [0, 0]), this.setUniform("u_leftWristPosition", "vec2", [0, 0]), this.setUniform("u_rightWristPosition", "vec2", [0, 0]), this.setUniform("u_leftHipPosition", "vec2", [0, 0]), this.setUniform("u_rightHipPosition", "vec2", [0, 0]), this.setUniform("u_leftKneePosition", "vec2", [0, 0]), this.setUniform("u_rightKneePosition", "vec2", [0, 0]), this.setUniform("u_leftAnklePosition", "vec2", [0, 0]), this.setUniform("u_rightAnklePosition", "vec2", [0, 0]);
|
|
4461
4510
|
const ae = this.visibleFeatures.has("bodySegmentation") ? r.cv?.segmentation ?? null : null;
|
|
4462
4511
|
ae ? (this.updateSegmentationTexture(ae.mask, ae.width, ae.height), this.setUniform("u_segmentationRes", "vec2", [ae.width, ae.height])) : this.setUniform("u_segmentationRes", "vec2", [0, 0]);
|
|
4463
4512
|
const ee = e.device;
|
|
4464
4513
|
if (ee) {
|
|
4465
|
-
const
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
]) : this.setUniform("u_deviceAcceleration", "vec3", [0, 0, 0]),
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
]) : this.setUniform("u_deviceAccelerationGravity", "vec3", [0, 0, 0]),
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4514
|
+
const b = ee.motion;
|
|
4515
|
+
b?.acceleration ? this.setUniform("u_deviceAcceleration", "vec3", [
|
|
4516
|
+
b.acceleration.x ?? 0,
|
|
4517
|
+
b.acceleration.y ?? 0,
|
|
4518
|
+
b.acceleration.z ?? 0
|
|
4519
|
+
]) : this.setUniform("u_deviceAcceleration", "vec3", [0, 0, 0]), b?.accelerationIncludingGravity ? this.setUniform("u_deviceAccelerationGravity", "vec3", [
|
|
4520
|
+
b.accelerationIncludingGravity.x ?? 0,
|
|
4521
|
+
b.accelerationIncludingGravity.y ?? 0,
|
|
4522
|
+
b.accelerationIncludingGravity.z ?? 0
|
|
4523
|
+
]) : this.setUniform("u_deviceAccelerationGravity", "vec3", [0, 0, 0]), b?.rotationRate ? this.setUniform("u_deviceRotationRate", "vec3", [
|
|
4524
|
+
b.rotationRate.alpha ?? 0,
|
|
4525
|
+
b.rotationRate.beta ?? 0,
|
|
4526
|
+
b.rotationRate.gamma ?? 0
|
|
4478
4527
|
]) : this.setUniform("u_deviceRotationRate", "vec3", [0, 0, 0]);
|
|
4479
|
-
const
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
]), this.setUniform("u_deviceOrientationAbsolute", "bool",
|
|
4528
|
+
const y = ee.orientation;
|
|
4529
|
+
y ? (this.setUniform("u_deviceOrientation", "vec3", [
|
|
4530
|
+
y.alpha ?? 0,
|
|
4531
|
+
y.beta ?? 0,
|
|
4532
|
+
y.gamma ?? 0
|
|
4533
|
+
]), this.setUniform("u_deviceOrientationAbsolute", "bool", y.absolute)) : (this.setUniform("u_deviceOrientation", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientationAbsolute", "bool", !1));
|
|
4485
4534
|
} else
|
|
4486
4535
|
this.setUniform("u_deviceAcceleration", "vec3", [0, 0, 0]), this.setUniform("u_deviceAccelerationGravity", "vec3", [0, 0, 0]), this.setUniform("u_deviceRotationRate", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientation", "vec3", [0, 0, 0]), this.setUniform("u_deviceOrientationAbsolute", "bool", !1);
|
|
4487
4536
|
const z = e.devices || [], me = Math.min(z.length, De.MAX_EXTERNAL_DEVICES);
|
|
4488
4537
|
this.setUniform("u_externalDeviceCount", "int", me);
|
|
4489
|
-
for (let
|
|
4490
|
-
if (
|
|
4491
|
-
const
|
|
4492
|
-
E?.acceleration ? this.setUniform(`u_device${
|
|
4538
|
+
for (let b = 0; b < De.MAX_EXTERNAL_DEVICES; b++)
|
|
4539
|
+
if (b < me) {
|
|
4540
|
+
const y = z[b], E = y.motion;
|
|
4541
|
+
E?.acceleration ? this.setUniform(`u_device${b}Acceleration`, "vec3", [
|
|
4493
4542
|
E.acceleration.x ?? 0,
|
|
4494
4543
|
E.acceleration.y ?? 0,
|
|
4495
4544
|
E.acceleration.z ?? 0
|
|
4496
|
-
]) : this.setUniform(`u_device${
|
|
4545
|
+
]) : this.setUniform(`u_device${b}Acceleration`, "vec3", [0, 0, 0]), E?.accelerationIncludingGravity ? this.setUniform(`u_device${b}AccelerationGravity`, "vec3", [
|
|
4497
4546
|
E.accelerationIncludingGravity.x ?? 0,
|
|
4498
4547
|
E.accelerationIncludingGravity.y ?? 0,
|
|
4499
4548
|
E.accelerationIncludingGravity.z ?? 0
|
|
4500
|
-
]) : this.setUniform(`u_device${
|
|
4549
|
+
]) : this.setUniform(`u_device${b}AccelerationGravity`, "vec3", [0, 0, 0]), E?.rotationRate ? this.setUniform(`u_device${b}RotationRate`, "vec3", [
|
|
4501
4550
|
E.rotationRate.alpha ?? 0,
|
|
4502
4551
|
E.rotationRate.beta ?? 0,
|
|
4503
4552
|
E.rotationRate.gamma ?? 0
|
|
4504
|
-
]) : this.setUniform(`u_device${
|
|
4505
|
-
const V =
|
|
4506
|
-
V ? this.setUniform(`u_device${
|
|
4553
|
+
]) : this.setUniform(`u_device${b}RotationRate`, "vec3", [0, 0, 0]);
|
|
4554
|
+
const V = y.orientation;
|
|
4555
|
+
V ? this.setUniform(`u_device${b}Orientation`, "vec3", [
|
|
4507
4556
|
V.alpha ?? 0,
|
|
4508
4557
|
V.beta ?? 0,
|
|
4509
4558
|
V.gamma ?? 0
|
|
4510
|
-
]) : this.setUniform(`u_device${
|
|
4559
|
+
]) : this.setUniform(`u_device${b}Orientation`, "vec3", [0, 0, 0]);
|
|
4511
4560
|
} else
|
|
4512
|
-
this.setUniform(`u_device${
|
|
4561
|
+
this.setUniform(`u_device${b}Acceleration`, "vec3", [0, 0, 0]), this.setUniform(`u_device${b}AccelerationGravity`, "vec3", [0, 0, 0]), this.setUniform(`u_device${b}RotationRate`, "vec3", [0, 0, 0]), this.setUniform(`u_device${b}Orientation`, "vec3", [0, 0, 0]);
|
|
4513
4562
|
}
|
|
4514
4563
|
/**
|
|
4515
4564
|
* Update accumulator uniforms — CPU-side phase accumulation for smooth animation.
|
|
@@ -4920,7 +4969,7 @@ function Ss(t) {
|
|
|
4920
4969
|
return e;
|
|
4921
4970
|
}
|
|
4922
4971
|
const st = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
4923
|
-
function
|
|
4972
|
+
function bi(t) {
|
|
4924
4973
|
if (t >= st._0 && t <= st._9)
|
|
4925
4974
|
return t - st._0;
|
|
4926
4975
|
if (t >= st.A && t <= st.F)
|
|
@@ -4942,7 +4991,7 @@ function mo(t) {
|
|
|
4942
4991
|
throw new RangeError("hex string expected, got unpadded hex of length " + e);
|
|
4943
4992
|
const r = new Uint8Array(n);
|
|
4944
4993
|
for (let i = 0, o = 0; i < n; i++, o += 2) {
|
|
4945
|
-
const c =
|
|
4994
|
+
const c = bi(t.charCodeAt(o)), u = bi(t.charCodeAt(o + 1));
|
|
4946
4995
|
if (c === void 0 || u === void 0) {
|
|
4947
4996
|
const h = t[o] + t[o + 1];
|
|
4948
4997
|
throw new RangeError('hex string expected, got non-hex character "' + h + '" at index ' + o);
|
|
@@ -5179,7 +5228,7 @@ const Yc = /* @__PURE__ */ Vc(
|
|
|
5179
5228
|
/* @__PURE__ */ $c(1)
|
|
5180
5229
|
);
|
|
5181
5230
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5182
|
-
const Ce = (t, e, n) => Ct(t, e, n), po = St, go = Ss, ht = (...t) => Bc(...t), us = (t) => mo(t),
|
|
5231
|
+
const Ce = (t, e, n) => Ct(t, e, n), po = St, go = Ss, ht = (...t) => Bc(...t), us = (t) => mo(t), yo = uo, bo = (t) => jc(t), In = /* @__PURE__ */ BigInt(0), ls = /* @__PURE__ */ BigInt(1);
|
|
5183
5232
|
function Zt(t, e = "") {
|
|
5184
5233
|
if (typeof t != "boolean") {
|
|
5185
5234
|
const n = e && `"${e}" `;
|
|
@@ -5561,7 +5610,7 @@ Object.freeze(Lo.prototype);
|
|
|
5561
5610
|
function Ls(t, e = {}) {
|
|
5562
5611
|
return new Lo(t, e);
|
|
5563
5612
|
}
|
|
5564
|
-
function
|
|
5613
|
+
function Po(t) {
|
|
5565
5614
|
if (typeof t != "bigint")
|
|
5566
5615
|
throw new Error("field order must be bigint");
|
|
5567
5616
|
if (t <= Te)
|
|
@@ -5569,13 +5618,13 @@ function Fo(t) {
|
|
|
5569
5618
|
const e = Is(t - Te);
|
|
5570
5619
|
return Math.ceil(e / 8);
|
|
5571
5620
|
}
|
|
5572
|
-
function
|
|
5573
|
-
const e =
|
|
5621
|
+
function Fo(t) {
|
|
5622
|
+
const e = Po(t);
|
|
5574
5623
|
return e + Math.ceil(e / 2);
|
|
5575
5624
|
}
|
|
5576
5625
|
function c1(t, e, n = !1) {
|
|
5577
5626
|
Ce(t);
|
|
5578
|
-
const r = t.length, i =
|
|
5627
|
+
const r = t.length, i = Po(e), o = Math.max(Fo(e), 16);
|
|
5579
5628
|
if (r < o || r > 1024)
|
|
5580
5629
|
throw new Error("expected " + o + "-1024 bytes of input, got " + r);
|
|
5581
5630
|
const c = n ? ko(t) : qn(t), u = qe(c, e - Te) + Te;
|
|
@@ -5919,8 +5968,8 @@ const We = {
|
|
|
5919
5968
|
Object.freeze(We._tlv);
|
|
5920
5969
|
Object.freeze(We._int);
|
|
5921
5970
|
Object.freeze(We);
|
|
5922
|
-
const Qe = /* @__PURE__ */ BigInt(0), ft = /* @__PURE__ */ BigInt(1), Mo = /* @__PURE__ */ BigInt(2),
|
|
5923
|
-
function
|
|
5971
|
+
const Qe = /* @__PURE__ */ BigInt(0), ft = /* @__PURE__ */ BigInt(1), Mo = /* @__PURE__ */ BigInt(2), yn = /* @__PURE__ */ BigInt(3), g1 = /* @__PURE__ */ BigInt(4);
|
|
5972
|
+
function y1(t, e = {}) {
|
|
5924
5973
|
const n = h1("weierstrass", t, e), r = n.Fp, i = n.Fn;
|
|
5925
5974
|
let o = n.CURVE;
|
|
5926
5975
|
const { h: c, n: u } = o;
|
|
@@ -5940,7 +5989,7 @@ function b1(t, e = {}) {
|
|
|
5940
5989
|
if (!r.isOdd)
|
|
5941
5990
|
throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
5942
5991
|
}
|
|
5943
|
-
function v(
|
|
5992
|
+
function v(y, E, V) {
|
|
5944
5993
|
if (f && E.is0())
|
|
5945
5994
|
return Uint8Array.of(0);
|
|
5946
5995
|
const { x: H, y: M } = E.toAffine(), R = r.toBytes(H);
|
|
@@ -5951,19 +6000,19 @@ function b1(t, e = {}) {
|
|
|
5951
6000
|
} else
|
|
5952
6001
|
return ht(Uint8Array.of(4), R, r.toBytes(M));
|
|
5953
6002
|
}
|
|
5954
|
-
function w(
|
|
5955
|
-
Ce(
|
|
5956
|
-
const { publicKey: E, publicKeyUncompressed: V } = m, H =
|
|
6003
|
+
function w(y) {
|
|
6004
|
+
Ce(y, void 0, "Point");
|
|
6005
|
+
const { publicKey: E, publicKeyUncompressed: V } = m, H = y.length, M = y[0], R = y.subarray(1);
|
|
5957
6006
|
if (f && H === 1 && M === 0)
|
|
5958
6007
|
return { x: r.ZERO, y: r.ZERO };
|
|
5959
6008
|
if (H === E && (M === 2 || M === 3)) {
|
|
5960
6009
|
const U = r.fromBytes(R);
|
|
5961
6010
|
if (!r.isValid(U))
|
|
5962
6011
|
throw new Error("bad point: is not on curve, wrong x");
|
|
5963
|
-
const
|
|
6012
|
+
const F = W(U);
|
|
5964
6013
|
let B;
|
|
5965
6014
|
try {
|
|
5966
|
-
B = r.sqrt(
|
|
6015
|
+
B = r.sqrt(F);
|
|
5967
6016
|
} catch (oe) {
|
|
5968
6017
|
const ce = oe instanceof Error ? ": " + oe.message : "";
|
|
5969
6018
|
throw new Error("bad point: is not on curve, sqrt error" + ce);
|
|
@@ -5972,43 +6021,43 @@ function b1(t, e = {}) {
|
|
|
5972
6021
|
const $ = r.isOdd(B);
|
|
5973
6022
|
return (M & 1) === 1 !== $ && (B = r.neg(B)), { x: U, y: B };
|
|
5974
6023
|
} else if (H === V && M === 4) {
|
|
5975
|
-
const U = r.BYTES,
|
|
5976
|
-
if (!K(
|
|
6024
|
+
const U = r.BYTES, F = r.fromBytes(R.subarray(0, U)), B = r.fromBytes(R.subarray(U, U * 2));
|
|
6025
|
+
if (!K(F, B))
|
|
5977
6026
|
throw new Error("bad point: is not on curve");
|
|
5978
|
-
return { x:
|
|
6027
|
+
return { x: F, y: B };
|
|
5979
6028
|
} else
|
|
5980
6029
|
throw new Error(`bad point: got length ${H}, expected compressed=${E} or uncompressed=${V}`);
|
|
5981
6030
|
}
|
|
5982
6031
|
const D = e.toBytes === void 0 ? v : e.toBytes, N = e.fromBytes === void 0 ? w : e.fromBytes;
|
|
5983
|
-
function W(
|
|
5984
|
-
const E = r.sqr(
|
|
5985
|
-
return r.add(r.add(V, r.mul(
|
|
6032
|
+
function W(y) {
|
|
6033
|
+
const E = r.sqr(y), V = r.mul(E, y);
|
|
6034
|
+
return r.add(r.add(V, r.mul(y, o.a)), o.b);
|
|
5986
6035
|
}
|
|
5987
|
-
function K(
|
|
5988
|
-
const V = r.sqr(E), H = W(
|
|
6036
|
+
function K(y, E) {
|
|
6037
|
+
const V = r.sqr(E), H = W(y);
|
|
5989
6038
|
return r.eql(V, H);
|
|
5990
6039
|
}
|
|
5991
6040
|
if (!K(o.Gx, o.Gy))
|
|
5992
6041
|
throw new Error("bad curve params: generator point");
|
|
5993
|
-
const L = r.mul(r.pow(o.a,
|
|
6042
|
+
const L = r.mul(r.pow(o.a, yn), g1), j = r.mul(r.sqr(o.b), BigInt(27));
|
|
5994
6043
|
if (r.is0(r.add(L, j)))
|
|
5995
6044
|
throw new Error("bad curve params: a or b");
|
|
5996
|
-
function O(
|
|
6045
|
+
function O(y, E, V = !1) {
|
|
5997
6046
|
if (!r.isValid(E) || V && r.is0(E))
|
|
5998
|
-
throw new Error(`bad point coordinate ${
|
|
6047
|
+
throw new Error(`bad point coordinate ${y}`);
|
|
5999
6048
|
return E;
|
|
6000
6049
|
}
|
|
6001
|
-
function J(
|
|
6002
|
-
if (!(
|
|
6050
|
+
function J(y) {
|
|
6051
|
+
if (!(y instanceof z))
|
|
6003
6052
|
throw new Error("Weierstrass Point expected");
|
|
6004
6053
|
}
|
|
6005
|
-
function ae(
|
|
6054
|
+
function ae(y) {
|
|
6006
6055
|
if (!h || !h.basises)
|
|
6007
6056
|
throw new Error("no endo");
|
|
6008
|
-
return m1(
|
|
6057
|
+
return m1(y, h.basises, i.ORDER);
|
|
6009
6058
|
}
|
|
6010
|
-
function ee(
|
|
6011
|
-
return V = new z(r.mul(V.X,
|
|
6059
|
+
function ee(y, E, V, H, M) {
|
|
6060
|
+
return V = new z(r.mul(V.X, y), V.Y, V.Z), E = Rn(H, E), V = Rn(M, V), E.add(V);
|
|
6012
6061
|
}
|
|
6013
6062
|
class z {
|
|
6014
6063
|
// base / generator point
|
|
@@ -6059,7 +6108,7 @@ function b1(t, e = {}) {
|
|
|
6059
6108
|
* @returns
|
|
6060
6109
|
*/
|
|
6061
6110
|
precompute(E = 8, V = !0) {
|
|
6062
|
-
return
|
|
6111
|
+
return b.createCache(this, E), V || this.multiply(yn), this;
|
|
6063
6112
|
}
|
|
6064
6113
|
// TODO: return `this`
|
|
6065
6114
|
/** A point on curve is valid if it conforms to equation. */
|
|
@@ -6087,7 +6136,7 @@ function b1(t, e = {}) {
|
|
|
6087
6136
|
/** Compare one point to another. */
|
|
6088
6137
|
equals(E) {
|
|
6089
6138
|
J(E);
|
|
6090
|
-
const { X: V, Y: H, Z: M } = this, { X: R, Y: U, Z:
|
|
6139
|
+
const { X: V, Y: H, Z: M } = this, { X: R, Y: U, Z: F } = E, B = r.eql(r.mul(V, F), r.mul(R, M)), $ = r.eql(r.mul(H, F), r.mul(U, M));
|
|
6091
6140
|
return B && $;
|
|
6092
6141
|
}
|
|
6093
6142
|
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
|
|
@@ -6099,9 +6148,9 @@ function b1(t, e = {}) {
|
|
|
6099
6148
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
6100
6149
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
6101
6150
|
double() {
|
|
6102
|
-
const { a: E, b: V } = o, H = r.mul(V,
|
|
6103
|
-
let
|
|
6104
|
-
return ie = r.add(ie, ie), $ = r.mul(M, U), $ = r.add($, $),
|
|
6151
|
+
const { a: E, b: V } = o, H = r.mul(V, yn), { X: M, Y: R, Z: U } = this;
|
|
6152
|
+
let F = r.ZERO, B = r.ZERO, $ = r.ZERO, Y = r.mul(M, M), oe = r.mul(R, R), ce = r.mul(U, U), ie = r.mul(M, R);
|
|
6153
|
+
return ie = r.add(ie, ie), $ = r.mul(M, U), $ = r.add($, $), F = r.mul(E, $), B = r.mul(H, ce), B = r.add(F, B), F = r.sub(oe, B), B = r.add(oe, B), B = r.mul(F, B), F = r.mul(ie, F), $ = r.mul(H, $), ce = r.mul(E, ce), ie = r.sub(Y, ce), ie = r.mul(E, ie), ie = r.add(ie, $), $ = r.add(Y, Y), Y = r.add($, Y), Y = r.add(Y, ce), Y = r.mul(Y, ie), B = r.add(B, Y), ce = r.mul(R, U), ce = r.add(ce, ce), Y = r.mul(ce, ie), F = r.sub(F, Y), $ = r.mul(ce, oe), $ = r.add($, $), $ = r.add($, $), new z(F, B, $);
|
|
6105
6154
|
}
|
|
6106
6155
|
// Renes-Costello-Batina exception-free addition formula.
|
|
6107
6156
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -6109,13 +6158,13 @@ function b1(t, e = {}) {
|
|
|
6109
6158
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
6110
6159
|
add(E) {
|
|
6111
6160
|
J(E);
|
|
6112
|
-
const { X: V, Y: H, Z: M } = this, { X: R, Y: U, Z:
|
|
6161
|
+
const { X: V, Y: H, Z: M } = this, { X: R, Y: U, Z: F } = E;
|
|
6113
6162
|
let B = r.ZERO, $ = r.ZERO, Y = r.ZERO;
|
|
6114
|
-
const oe = o.a, ce = r.mul(o.b,
|
|
6115
|
-
let ie = r.mul(V, R), k = r.mul(H, U), x = r.mul(M,
|
|
6163
|
+
const oe = o.a, ce = r.mul(o.b, yn);
|
|
6164
|
+
let ie = r.mul(V, R), k = r.mul(H, U), x = r.mul(M, F), I = r.add(V, H), A = r.add(R, U);
|
|
6116
6165
|
I = r.mul(I, A), A = r.add(ie, k), I = r.sub(I, A), A = r.add(V, M);
|
|
6117
|
-
let
|
|
6118
|
-
return A = r.mul(A,
|
|
6166
|
+
let P = r.add(R, F);
|
|
6167
|
+
return A = r.mul(A, P), P = r.add(ie, x), A = r.sub(A, P), P = r.add(H, M), B = r.add(U, F), P = r.mul(P, B), B = r.add(k, x), P = r.sub(P, B), Y = r.mul(oe, A), B = r.mul(ce, x), Y = r.add(B, Y), B = r.sub(k, Y), Y = r.add(k, Y), $ = r.mul(B, Y), k = r.add(ie, ie), k = r.add(k, ie), x = r.mul(oe, x), A = r.mul(ce, A), k = r.add(k, x), x = r.sub(ie, x), x = r.mul(oe, x), A = r.add(A, x), ie = r.mul(k, A), $ = r.add($, ie), ie = r.mul(P, A), B = r.mul(I, B), B = r.sub(B, ie), ie = r.mul(I, k), Y = r.mul(P, Y), Y = r.add(Y, ie), new z(B, $, Y);
|
|
6119
6168
|
}
|
|
6120
6169
|
subtract(E) {
|
|
6121
6170
|
return J(E), this.add(E.negate());
|
|
@@ -6137,13 +6186,13 @@ function b1(t, e = {}) {
|
|
|
6137
6186
|
if (!i.isValidNot0(E))
|
|
6138
6187
|
throw new RangeError("invalid scalar: out of range");
|
|
6139
6188
|
let H, M;
|
|
6140
|
-
const R = (U) =>
|
|
6189
|
+
const R = (U) => b.cached(this, U, (F) => wi(z, F));
|
|
6141
6190
|
if (V) {
|
|
6142
|
-
const { k1neg: U, k1:
|
|
6191
|
+
const { k1neg: U, k1: F, k2neg: B, k2: $ } = ae(E), { p: Y, f: oe } = R(F), { p: ce, f: ie } = R($);
|
|
6143
6192
|
M = oe.add(ie), H = ee(V.beta, Y, ce, U, B);
|
|
6144
6193
|
} else {
|
|
6145
|
-
const { p: U, f:
|
|
6146
|
-
H = U, M =
|
|
6194
|
+
const { p: U, f: F } = R(E);
|
|
6195
|
+
H = U, M = F;
|
|
6147
6196
|
}
|
|
6148
6197
|
return wi(z, [H, M])[0];
|
|
6149
6198
|
}
|
|
@@ -6160,13 +6209,13 @@ function b1(t, e = {}) {
|
|
|
6160
6209
|
return z.ZERO;
|
|
6161
6210
|
if (M === ft)
|
|
6162
6211
|
return H;
|
|
6163
|
-
if (
|
|
6212
|
+
if (b.hasCache(this))
|
|
6164
6213
|
return this.multiply(M);
|
|
6165
6214
|
if (V) {
|
|
6166
|
-
const { k1neg: R, k1: U, k2neg:
|
|
6167
|
-
return ee(V.beta, $, Y, R,
|
|
6215
|
+
const { k1neg: R, k1: U, k2neg: F, k2: B } = ae(M), { p1: $, p2: Y } = l1(z, H, U, B);
|
|
6216
|
+
return ee(V.beta, $, Y, R, F);
|
|
6168
6217
|
} else
|
|
6169
|
-
return
|
|
6218
|
+
return b.unsafe(H, M);
|
|
6170
6219
|
}
|
|
6171
6220
|
/**
|
|
6172
6221
|
* Converts Projective point to affine (x, y) coordinates.
|
|
@@ -6179,10 +6228,10 @@ function b1(t, e = {}) {
|
|
|
6179
6228
|
const { X: M, Y: R, Z: U } = V;
|
|
6180
6229
|
if (r.eql(U, r.ONE))
|
|
6181
6230
|
return { x: M, y: R };
|
|
6182
|
-
const
|
|
6183
|
-
H == null && (H =
|
|
6231
|
+
const F = V.is0();
|
|
6232
|
+
H == null && (H = F ? r.ONE : r.inv(U));
|
|
6184
6233
|
const B = r.mul(M, H), $ = r.mul(R, H), Y = r.mul(U, H);
|
|
6185
|
-
if (
|
|
6234
|
+
if (F)
|
|
6186
6235
|
return { x: r.ZERO, y: r.ZERO };
|
|
6187
6236
|
if (!r.eql(Y, r.ONE))
|
|
6188
6237
|
throw new Error("invZ was invalid");
|
|
@@ -6194,7 +6243,7 @@ function b1(t, e = {}) {
|
|
|
6194
6243
|
*/
|
|
6195
6244
|
isTorsionFree() {
|
|
6196
6245
|
const { isTorsionFree: E } = e;
|
|
6197
|
-
return c === ft ? !0 : E ? E(z, this) :
|
|
6246
|
+
return c === ft ? !0 : E ? E(z, this) : b.unsafe(this, u).is0();
|
|
6198
6247
|
}
|
|
6199
6248
|
clearCofactor() {
|
|
6200
6249
|
const { clearCofactor: E } = e;
|
|
@@ -6213,7 +6262,7 @@ function b1(t, e = {}) {
|
|
|
6213
6262
|
return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
|
|
6214
6263
|
}
|
|
6215
6264
|
}
|
|
6216
|
-
const me = i.BITS,
|
|
6265
|
+
const me = i.BITS, b = new u1(z, e.endo ? Math.ceil(me / 2) : me);
|
|
6217
6266
|
return me >= 8 && z.BASE.precompute(8), Object.freeze(z.prototype), Object.freeze(z), z;
|
|
6218
6267
|
}
|
|
6219
6268
|
function No(t) {
|
|
@@ -6230,9 +6279,9 @@ function Oo(t, e) {
|
|
|
6230
6279
|
signature: 2 * e.BYTES
|
|
6231
6280
|
};
|
|
6232
6281
|
}
|
|
6233
|
-
function
|
|
6234
|
-
const { Fn: n } = t, r = e.randomBytes === void 0 ?
|
|
6235
|
-
seed: Math.max(
|
|
6282
|
+
function b1(t, e = {}) {
|
|
6283
|
+
const { Fn: n } = t, r = e.randomBytes === void 0 ? bo : e.randomBytes, i = Object.assign(Oo(t.Fp, n), {
|
|
6284
|
+
seed: Math.max(Fo(n.ORDER), 16)
|
|
6236
6285
|
});
|
|
6237
6286
|
function o(w) {
|
|
6238
6287
|
try {
|
|
@@ -6259,7 +6308,7 @@ function y1(t, e = {}) {
|
|
|
6259
6308
|
}
|
|
6260
6309
|
function f(w) {
|
|
6261
6310
|
const { secretKey: D, publicKey: N, publicKeyUncompressed: W } = i, K = n._lengths;
|
|
6262
|
-
if (!
|
|
6311
|
+
if (!yo(w))
|
|
6263
6312
|
return;
|
|
6264
6313
|
const L = Ce(w, void 0, "key").length, j = L === N || L === W, O = L === D || !!K?.includes(L);
|
|
6265
6314
|
if (!(j && O))
|
|
@@ -6289,7 +6338,7 @@ function _1(t, e, n = {}) {
|
|
|
6289
6338
|
bits2int: "function",
|
|
6290
6339
|
bits2int_modN: "function"
|
|
6291
6340
|
}), n = Object.assign({}, n);
|
|
6292
|
-
const i = n.randomBytes === void 0 ?
|
|
6341
|
+
const i = n.randomBytes === void 0 ? bo : n.randomBytes, o = n.hmac === void 0 ? (M, R) => d1(r, M, R) : n.hmac, { Fp: c, Fn: u } = t, { ORDER: h, BITS: f } = u, { keygen: m, getPublicKey: g, getSharedSecret: v, utils: w, lengths: D } = b1(t, n), N = {
|
|
6293
6342
|
prehash: !0,
|
|
6294
6343
|
lowS: typeof n.lowS == "boolean" ? n.lowS : !0,
|
|
6295
6344
|
format: "compact",
|
|
@@ -6310,31 +6359,31 @@ function _1(t, e, n = {}) {
|
|
|
6310
6359
|
}
|
|
6311
6360
|
function O(M, R) {
|
|
6312
6361
|
fs(R);
|
|
6313
|
-
const U = D.signature,
|
|
6314
|
-
return Ce(M,
|
|
6362
|
+
const U = D.signature, F = R === "compact" ? U : R === "recovered" ? U + 1 : void 0;
|
|
6363
|
+
return Ce(M, F);
|
|
6315
6364
|
}
|
|
6316
6365
|
class J {
|
|
6317
6366
|
r;
|
|
6318
6367
|
s;
|
|
6319
6368
|
recovery;
|
|
6320
|
-
constructor(R, U,
|
|
6321
|
-
if (this.r = L("r", R), this.s = L("s", U),
|
|
6322
|
-
if (j(), ![0, 1, 2, 3].includes(
|
|
6369
|
+
constructor(R, U, F) {
|
|
6370
|
+
if (this.r = L("r", R), this.s = L("s", U), F != null) {
|
|
6371
|
+
if (j(), ![0, 1, 2, 3].includes(F))
|
|
6323
6372
|
throw new Error("invalid recovery id");
|
|
6324
|
-
this.recovery =
|
|
6373
|
+
this.recovery = F;
|
|
6325
6374
|
}
|
|
6326
6375
|
Object.freeze(this);
|
|
6327
6376
|
}
|
|
6328
6377
|
static fromBytes(R, U = N.format) {
|
|
6329
6378
|
O(R, U);
|
|
6330
|
-
let
|
|
6379
|
+
let F;
|
|
6331
6380
|
if (U === "der") {
|
|
6332
6381
|
const { r: oe, s: ce } = We.toSig(Ce(R));
|
|
6333
6382
|
return new J(oe, ce);
|
|
6334
6383
|
}
|
|
6335
|
-
U === "recovered" && (
|
|
6384
|
+
U === "recovered" && (F = R[0], U = "compact", R = R.subarray(1));
|
|
6336
6385
|
const B = D.signature / 2, $ = R.subarray(0, B), Y = R.subarray(B, B * 2);
|
|
6337
|
-
return new J(u.fromBytes($), u.fromBytes(Y),
|
|
6386
|
+
return new J(u.fromBytes($), u.fromBytes(Y), F);
|
|
6338
6387
|
}
|
|
6339
6388
|
static fromHex(R, U) {
|
|
6340
6389
|
return this.fromBytes(us(R), U);
|
|
@@ -6351,10 +6400,10 @@ function _1(t, e, n = {}) {
|
|
|
6351
6400
|
// Unlike the top-level helper below, this method expects a digest that has
|
|
6352
6401
|
// already been hashed to the curve's message representative.
|
|
6353
6402
|
recoverPublicKey(R) {
|
|
6354
|
-
const { r: U, s:
|
|
6403
|
+
const { r: U, s: F } = this, B = this.assertRecovery(), $ = B === 2 || B === 3 ? U + h : U;
|
|
6355
6404
|
if (!c.isValid($))
|
|
6356
6405
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
6357
|
-
const Y = c.toBytes($), oe = t.fromBytes(ht(No((B & 1) === 0), Y)), ce = u.inv($), ie = ee(Ce(R, void 0, "msgHash")), k = u.create(-ie * ce), x = u.create(
|
|
6406
|
+
const Y = c.toBytes($), oe = t.fromBytes(ht(No((B & 1) === 0), Y)), ce = u.inv($), ie = ee(Ce(R, void 0, "msgHash")), k = u.create(-ie * ce), x = u.create(F * ce), I = t.BASE.multiplyUnsafe(k).add(oe.multiplyUnsafe(x));
|
|
6358
6407
|
if (I.is0())
|
|
6359
6408
|
throw new Error("invalid recovery: point at infinify");
|
|
6360
6409
|
return I.assertValidity(), I;
|
|
@@ -6366,7 +6415,7 @@ function _1(t, e, n = {}) {
|
|
|
6366
6415
|
toBytes(R = N.format) {
|
|
6367
6416
|
if (fs(R), R === "der")
|
|
6368
6417
|
return us(We.hexFromSig(this));
|
|
6369
|
-
const { r: U, s:
|
|
6418
|
+
const { r: U, s: F } = this, B = u.toBytes(U), $ = u.toBytes(F);
|
|
6370
6419
|
return R === "recovered" ? (j(), ht(Uint8Array.of(this.assertRecovery()), B, $)) : ht(B, $);
|
|
6371
6420
|
}
|
|
6372
6421
|
toHex(R) {
|
|
@@ -6377,20 +6426,20 @@ function _1(t, e, n = {}) {
|
|
|
6377
6426
|
const ae = n.bits2int === void 0 ? function(R) {
|
|
6378
6427
|
if (R.length > 8192)
|
|
6379
6428
|
throw new Error("input is too large");
|
|
6380
|
-
const U = qn(R),
|
|
6381
|
-
return
|
|
6429
|
+
const U = qn(R), F = R.length * 8 - f;
|
|
6430
|
+
return F > 0 ? U >> BigInt(F) : U;
|
|
6382
6431
|
} : n.bits2int, ee = n.bits2int_modN === void 0 ? function(R) {
|
|
6383
6432
|
return u.create(ae(R));
|
|
6384
6433
|
} : n.bits2int_modN, z = Rs(f);
|
|
6385
6434
|
function me(M) {
|
|
6386
6435
|
return wo("num < 2^" + f, M, Qe, z), u.toBytes(M);
|
|
6387
6436
|
}
|
|
6388
|
-
function
|
|
6437
|
+
function b(M, R) {
|
|
6389
6438
|
return Ce(M, void 0, "message"), R ? Ce(r(M), void 0, "prehashed message") : M;
|
|
6390
6439
|
}
|
|
6391
|
-
function
|
|
6392
|
-
const { lowS:
|
|
6393
|
-
M =
|
|
6440
|
+
function y(M, R, U) {
|
|
6441
|
+
const { lowS: F, prehash: B, extraEntropy: $ } = Jr(U, N);
|
|
6442
|
+
M = b(M, B);
|
|
6394
6443
|
const Y = ee(M), oe = u.fromBytes(R);
|
|
6395
6444
|
if (!u.isValidNot0(oe))
|
|
6396
6445
|
throw new Error("invalid private key");
|
|
@@ -6404,24 +6453,24 @@ function _1(t, e, n = {}) {
|
|
|
6404
6453
|
const A = ae(I);
|
|
6405
6454
|
if (!u.isValidNot0(A))
|
|
6406
6455
|
return;
|
|
6407
|
-
const
|
|
6456
|
+
const P = u.inv(A), G = t.BASE.multiply(A).toAffine(), Z = u.create(G.x);
|
|
6408
6457
|
if (Z === Qe)
|
|
6409
6458
|
return;
|
|
6410
|
-
const ue = u.create(
|
|
6459
|
+
const ue = u.create(P * u.create(k + Z * oe));
|
|
6411
6460
|
if (ue === Qe)
|
|
6412
6461
|
return;
|
|
6413
6462
|
let ge = (G.x === Z ? 0 : 2) | Number(G.y & ft), de = ue;
|
|
6414
|
-
return
|
|
6463
|
+
return F && K(ue) && (de = u.neg(ue), ge ^= 1), new J(Z, de, W ? void 0 : ge);
|
|
6415
6464
|
}
|
|
6416
6465
|
return { seed: ie, k2sig: x };
|
|
6417
6466
|
}
|
|
6418
6467
|
function E(M, R, U = {}) {
|
|
6419
|
-
const { seed:
|
|
6420
|
-
return Qc(r.outputLen, u.BYTES, o)(
|
|
6468
|
+
const { seed: F, k2sig: B } = y(M, R, U);
|
|
6469
|
+
return Qc(r.outputLen, u.BYTES, o)(F, B).toBytes(U.format);
|
|
6421
6470
|
}
|
|
6422
|
-
function V(M, R, U,
|
|
6423
|
-
const { lowS: B, prehash: $, format: Y } = Jr(
|
|
6424
|
-
if (U = Ce(U, void 0, "publicKey"), R =
|
|
6471
|
+
function V(M, R, U, F = {}) {
|
|
6472
|
+
const { lowS: B, prehash: $, format: Y } = Jr(F, N);
|
|
6473
|
+
if (U = Ce(U, void 0, "publicKey"), R = b(R, $), !yo(M)) {
|
|
6425
6474
|
const oe = M instanceof J ? ", use sig.toBytes()" : "";
|
|
6426
6475
|
throw new Error("verify expects Uint8Array signature" + oe);
|
|
6427
6476
|
}
|
|
@@ -6430,15 +6479,15 @@ function _1(t, e, n = {}) {
|
|
|
6430
6479
|
const oe = J.fromBytes(M, Y), ce = t.fromBytes(U);
|
|
6431
6480
|
if (B && oe.hasHighS())
|
|
6432
6481
|
return !1;
|
|
6433
|
-
const { r: ie, s: k } = oe, x = ee(R), I = u.inv(k), A = u.create(x * I),
|
|
6482
|
+
const { r: ie, s: k } = oe, x = ee(R), I = u.inv(k), A = u.create(x * I), P = u.create(ie * I), G = t.BASE.multiplyUnsafe(A).add(ce.multiplyUnsafe(P));
|
|
6434
6483
|
return G.is0() ? !1 : u.create(G.x) === ie;
|
|
6435
6484
|
} catch {
|
|
6436
6485
|
return !1;
|
|
6437
6486
|
}
|
|
6438
6487
|
}
|
|
6439
6488
|
function H(M, R, U = {}) {
|
|
6440
|
-
const { prehash:
|
|
6441
|
-
return R =
|
|
6489
|
+
const { prehash: F } = Jr(U, N);
|
|
6490
|
+
return R = b(R, F), J.fromBytes(M, "recovered").recoverPublicKey(R).toBytes();
|
|
6442
6491
|
}
|
|
6443
6492
|
return Object.freeze({
|
|
6444
6493
|
keygen: m,
|
|
@@ -6463,11 +6512,11 @@ const k1 = {
|
|
|
6463
6512
|
b: BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),
|
|
6464
6513
|
Gx: BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),
|
|
6465
6514
|
Gy: BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")
|
|
6466
|
-
}, v1 = /* @__PURE__ */
|
|
6515
|
+
}, v1 = /* @__PURE__ */ y1(k1), w1 = /* @__PURE__ */ _1(v1, Yc), Ii = {
|
|
6467
6516
|
x: "6bkPbVZXx-c08blVs6qIwm0gfSRLS2nnf2Tsz19ggtM",
|
|
6468
6517
|
y: "lhi486ASKQkS8TGbVee-FpdAu7qKaO3gad_4ScX8qJI"
|
|
6469
6518
|
}, E1 = 60;
|
|
6470
|
-
let ds = null,
|
|
6519
|
+
let ds = null, Ps = !1, Et = null, Nt = 0;
|
|
6471
6520
|
function Cn(t) {
|
|
6472
6521
|
const e = t.replace(/-/g, "+").replace(/_/g, "/"), n = atob(e), r = new Uint8Array(n.length);
|
|
6473
6522
|
for (let i = 0; i < n.length; i++) r[i] = n.charCodeAt(i);
|
|
@@ -6480,11 +6529,11 @@ async function T1() {
|
|
|
6480
6529
|
const n = new Uint8Array(65);
|
|
6481
6530
|
n[0] = 4, n.set(t, 1), n.set(e, 33), ds = n;
|
|
6482
6531
|
} catch {
|
|
6483
|
-
|
|
6532
|
+
Ps = !0, console.warn("[Viji] _SC: key import failed — restricted mode active");
|
|
6484
6533
|
}
|
|
6485
6534
|
}
|
|
6486
6535
|
async function Ri(t) {
|
|
6487
|
-
if (
|
|
6536
|
+
if (Ps || !ds) {
|
|
6488
6537
|
Et = null, Nt = 0;
|
|
6489
6538
|
return;
|
|
6490
6539
|
}
|
|
@@ -6503,11 +6552,11 @@ async function Ri(t) {
|
|
|
6503
6552
|
}
|
|
6504
6553
|
}
|
|
6505
6554
|
function S1(t, e) {
|
|
6506
|
-
if (
|
|
6555
|
+
if (Ps || !Et) return e;
|
|
6507
6556
|
const n = Math.floor(Date.now() / 1e3);
|
|
6508
6557
|
return Nt > 0 && Nt + E1 < n ? (Et = null, Nt = 0, e) : typeof Et[t] == "number" ? Et[t] : e;
|
|
6509
6558
|
}
|
|
6510
|
-
const
|
|
6559
|
+
const Fs = 44, Ds = 74, Us = 44, Ms = 23, Bo = "#F1F1F1";
|
|
6511
6560
|
let Qt = null, Jt = null, Vo = null, jo = null, Ue = null, zt = null, Ln = null, lt = null, it = -1, ot = -1, Ci = null, $o = 0;
|
|
6512
6561
|
const x1 = `
|
|
6513
6562
|
attribute vec2 a_pos;
|
|
@@ -6532,7 +6581,7 @@ function R1(t) {
|
|
|
6532
6581
|
}
|
|
6533
6582
|
function C1(t) {
|
|
6534
6583
|
try {
|
|
6535
|
-
Qt = new OffscreenCanvas(
|
|
6584
|
+
Qt = new OffscreenCanvas(Fs, Ds);
|
|
6536
6585
|
const e = Qt.getContext("2d");
|
|
6537
6586
|
e && I1(e), Jt = new OffscreenCanvas(Us, Ms);
|
|
6538
6587
|
const n = Jt.getContext("2d");
|
|
@@ -6550,7 +6599,7 @@ function L1(t, e, n, r, i = 1) {
|
|
|
6550
6599
|
e ? D1(e, o, t.width, c) : n && U1(n, t, o, c);
|
|
6551
6600
|
}
|
|
6552
6601
|
const qo = 34229;
|
|
6553
|
-
function
|
|
6602
|
+
function P1(t) {
|
|
6554
6603
|
const e = t;
|
|
6555
6604
|
if (typeof e.createVertexArray == "function")
|
|
6556
6605
|
return {
|
|
@@ -6563,16 +6612,16 @@ function F1(t) {
|
|
|
6563
6612
|
bind: (r) => n.bindVertexArrayOES(r)
|
|
6564
6613
|
} : null;
|
|
6565
6614
|
}
|
|
6566
|
-
function
|
|
6615
|
+
function Pi(t, e) {
|
|
6567
6616
|
if (!e) return null;
|
|
6568
6617
|
const n = t.getParameter(t.TEXTURE_BINDING_2D), r = t.getParameter(t.UNPACK_FLIP_Y_WEBGL), i = t.getParameter(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL);
|
|
6569
6618
|
t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 1), t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0);
|
|
6570
6619
|
const o = t.createTexture();
|
|
6571
6620
|
return t.bindTexture(t.TEXTURE_2D, o), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, e), t.bindTexture(t.TEXTURE_2D, n), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, r ? 1 : 0), t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, i ? 1 : 0), o;
|
|
6572
6621
|
}
|
|
6573
|
-
function
|
|
6622
|
+
function F1(t) {
|
|
6574
6623
|
if (Ci === t) return;
|
|
6575
|
-
Ci = t, Vo =
|
|
6624
|
+
Ci = t, Vo = Pi(t, Qt), jo = Pi(t, Jt);
|
|
6576
6625
|
const e = t.createShader(t.VERTEX_SHADER);
|
|
6577
6626
|
t.shaderSource(e, x1), t.compileShader(e);
|
|
6578
6627
|
const n = t.createShader(t.FRAGMENT_SHADER);
|
|
@@ -6580,12 +6629,12 @@ function P1(t) {
|
|
|
6580
6629
|
console.warn("[Viji] overlay: shader link failed"), Ue = null;
|
|
6581
6630
|
return;
|
|
6582
6631
|
}
|
|
6583
|
-
if (zt = t.createBuffer(), it = t.getAttribLocation(Ue, "a_pos"), ot = t.getAttribLocation(Ue, "a_uv"), lt =
|
|
6632
|
+
if (zt = t.createBuffer(), it = t.getAttribLocation(Ue, "a_pos"), ot = t.getAttribLocation(Ue, "a_uv"), lt = P1(t), lt) {
|
|
6584
6633
|
const r = t.getParameter(qo), i = t.getParameter(t.ARRAY_BUFFER_BINDING);
|
|
6585
6634
|
Ln = lt.create(), lt.bind(Ln), t.bindBuffer(t.ARRAY_BUFFER, zt), it >= 0 && (t.enableVertexAttribArray(it), t.vertexAttribPointer(it, 2, t.FLOAT, !1, 16, 0)), ot >= 0 && (t.enableVertexAttribArray(ot), t.vertexAttribPointer(ot, 2, t.FLOAT, !1, 16, 8)), lt.bind(r), t.bindBuffer(t.ARRAY_BUFFER, i);
|
|
6586
6635
|
}
|
|
6587
6636
|
}
|
|
6588
|
-
function
|
|
6637
|
+
function Fi(t, e) {
|
|
6589
6638
|
return {
|
|
6590
6639
|
index: e,
|
|
6591
6640
|
buffer: t.getVertexAttrib(e, t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),
|
|
@@ -6604,16 +6653,16 @@ function Di(t, e) {
|
|
|
6604
6653
|
function D1(t, e, n, r) {
|
|
6605
6654
|
const i = e ? Jt : Qt;
|
|
6606
6655
|
if (!i) return;
|
|
6607
|
-
const o = (e ? Us :
|
|
6656
|
+
const o = (e ? Us : Fs) * r, c = (e ? Ms : Ds) * r, u = Math.round(e ? (n - o) / 2 : 48 * r), h = Math.round((e ? 52 : 48) * r);
|
|
6608
6657
|
t.save(), t.globalAlpha = 0.85, t.drawImage(i, u, h, o, c), t.restore();
|
|
6609
6658
|
}
|
|
6610
6659
|
function U1(t, e, n, r) {
|
|
6611
|
-
if (
|
|
6660
|
+
if (F1(t), !Ue || !zt) return;
|
|
6612
6661
|
const i = n ? jo : Vo;
|
|
6613
6662
|
if (!i) return;
|
|
6614
|
-
const o = (n ? Us :
|
|
6663
|
+
const o = (n ? Us : Fs) * r, c = (n ? Ms : Ds) * r, u = e.width, h = e.height, f = Math.round(n ? (u - o) / 2 : 48 * r), m = Math.round((n ? 52 : 48) * r), g = f / u * 2 - 1, v = 1 - (m + c) / h * 2, w = (f + o) / u * 2 - 1, D = 1 - m / h * 2, N = !!(lt && Ln), W = t.getParameter(t.CURRENT_PROGRAM), K = t.getParameter(t.ACTIVE_TEXTURE);
|
|
6615
6664
|
t.activeTexture(t.TEXTURE0);
|
|
6616
|
-
const L = t.getParameter(t.TEXTURE_BINDING_2D), j = t.getParameter(t.ARRAY_BUFFER_BINDING), O = t.getParameter(t.FRAMEBUFFER_BINDING), J = t.getParameter(t.VIEWPORT), ae = t.isEnabled(t.BLEND), ee = t.getParameter(t.BLEND_SRC_RGB), z = t.getParameter(t.BLEND_DST_RGB), me = t.getParameter(t.BLEND_SRC_ALPHA),
|
|
6665
|
+
const L = t.getParameter(t.TEXTURE_BINDING_2D), j = t.getParameter(t.ARRAY_BUFFER_BINDING), O = t.getParameter(t.FRAMEBUFFER_BINDING), J = t.getParameter(t.VIEWPORT), ae = t.isEnabled(t.BLEND), ee = t.getParameter(t.BLEND_SRC_RGB), z = t.getParameter(t.BLEND_DST_RGB), me = t.getParameter(t.BLEND_SRC_ALPHA), b = t.getParameter(t.BLEND_DST_ALPHA), y = t.getParameter(t.BLEND_EQUATION_RGB), E = t.getParameter(t.BLEND_EQUATION_ALPHA), V = t.isEnabled(t.DEPTH_TEST), H = t.isEnabled(t.SCISSOR_TEST), M = t.isEnabled(t.STENCIL_TEST), R = t.isEnabled(t.CULL_FACE), U = t.getParameter(t.COLOR_WRITEMASK), F = t.getParameter(t.UNPACK_FLIP_Y_WEBGL), B = N ? t.getParameter(qo) : null, $ = !N && it >= 0 ? Fi(t, it) : null, Y = !N && ot >= 0 ? Fi(t, ot) : null;
|
|
6617
6666
|
t.bindFramebuffer(t.FRAMEBUFFER, null), t.viewport(0, 0, u, h), t.useProgram(Ue), t.enable(t.BLEND), t.blendEquation(t.FUNC_ADD), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA), t.disable(t.DEPTH_TEST), t.disable(t.SCISSOR_TEST), t.disable(t.STENCIL_TEST), t.disable(t.CULL_FACE), t.colorMask(!0, !0, !0, !0), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 0), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(t.getUniformLocation(Ue, "u_tex"), 0), t.uniform1f(t.getUniformLocation(Ue, "u_alpha"), 0.85);
|
|
6618
6667
|
const oe = new Float32Array([
|
|
6619
6668
|
g,
|
|
@@ -6641,9 +6690,9 @@ function U1(t, e, n, r) {
|
|
|
6641
6690
|
1,
|
|
6642
6691
|
1
|
|
6643
6692
|
]);
|
|
6644
|
-
N ? (lt.bind(Ln), t.bindBuffer(t.ARRAY_BUFFER, zt), t.bufferData(t.ARRAY_BUFFER, oe, t.DYNAMIC_DRAW)) : (t.bindBuffer(t.ARRAY_BUFFER, zt), t.bufferData(t.ARRAY_BUFFER, oe, t.DYNAMIC_DRAW), it >= 0 && (t.enableVertexAttribArray(it), t.vertexAttribPointer(it, 2, t.FLOAT, !1, 16, 0)), ot >= 0 && (t.enableVertexAttribArray(ot), t.vertexAttribPointer(ot, 2, t.FLOAT, !1, 16, 8))), t.drawArrays(t.TRIANGLES, 0, 6), N ? lt.bind(B) : (Y && Di(t, Y), $ && Di(t, $)), t.bindFramebuffer(t.FRAMEBUFFER, O), t.viewport(J[0], J[1], J[2], J[3]), t.bindBuffer(t.ARRAY_BUFFER, j), t.colorMask(U[0], U[1], U[2], U[3]), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,
|
|
6693
|
+
N ? (lt.bind(Ln), t.bindBuffer(t.ARRAY_BUFFER, zt), t.bufferData(t.ARRAY_BUFFER, oe, t.DYNAMIC_DRAW)) : (t.bindBuffer(t.ARRAY_BUFFER, zt), t.bufferData(t.ARRAY_BUFFER, oe, t.DYNAMIC_DRAW), it >= 0 && (t.enableVertexAttribArray(it), t.vertexAttribPointer(it, 2, t.FLOAT, !1, 16, 0)), ot >= 0 && (t.enableVertexAttribArray(ot), t.vertexAttribPointer(ot, 2, t.FLOAT, !1, 16, 8))), t.drawArrays(t.TRIANGLES, 0, 6), N ? lt.bind(B) : (Y && Di(t, Y), $ && Di(t, $)), t.bindFramebuffer(t.FRAMEBUFFER, O), t.viewport(J[0], J[1], J[2], J[3]), t.bindBuffer(t.ARRAY_BUFFER, j), t.colorMask(U[0], U[1], U[2], U[3]), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, F ? 1 : 0), H ? t.enable(t.SCISSOR_TEST) : t.disable(t.SCISSOR_TEST), M ? t.enable(t.STENCIL_TEST) : t.disable(t.STENCIL_TEST), R ? t.enable(t.CULL_FACE) : t.disable(t.CULL_FACE), V ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST), ae ? t.enable(t.BLEND) : t.disable(t.BLEND), t.blendFuncSeparate(ee, z, me, b), t.blendEquationSeparate(y, E), t.activeTexture(t.TEXTURE0), t.bindTexture(t.TEXTURE_2D, L), t.activeTexture(K), t.useProgram(W);
|
|
6645
6694
|
}
|
|
6646
|
-
class
|
|
6695
|
+
class Pn {
|
|
6647
6696
|
canvas = null;
|
|
6648
6697
|
ctx = null;
|
|
6649
6698
|
gl = null;
|
|
@@ -6739,6 +6788,11 @@ class Fn {
|
|
|
6739
6788
|
videoSystems = [];
|
|
6740
6789
|
// WASM URLs for CV (resolved on the main thread, relayed to VideoSystem/CVSystem)
|
|
6741
6790
|
cvWasmUrls;
|
|
6791
|
+
// Canonical MediaPipe binary bytes, retained for the worker's lifetime so
|
|
6792
|
+
// every cv-tasks worker (one per video stream, plus restarts) can be handed
|
|
6793
|
+
// a structured-clone copy at init. See handleInit for why these aren't blob
|
|
6794
|
+
// URLs.
|
|
6795
|
+
cvWasmBinaries;
|
|
6742
6796
|
// Auto-capture for frame sources
|
|
6743
6797
|
autoCaptureEnabled = !1;
|
|
6744
6798
|
autoCaptureFormat = { flipY: !0 };
|
|
@@ -7113,7 +7167,7 @@ class Fn {
|
|
|
7113
7167
|
updateVijiAudioStreams() {
|
|
7114
7168
|
const e = [];
|
|
7115
7169
|
for (const [n, r] of this.audioStreamStates)
|
|
7116
|
-
n >=
|
|
7170
|
+
n >= Pn.AUDIO_ADDITIONAL_BASE && n < Pn.AUDIO_DEVICE_BASE && e.push({ index: n, ...r });
|
|
7117
7171
|
e.sort((n, r) => n.index - r.index), this.viji.audioStreams.length = e.length;
|
|
7118
7172
|
for (let n = 0; n < e.length; n++) {
|
|
7119
7173
|
const r = e[n], i = r.frequencyData, o = r.waveformData;
|
|
@@ -7253,10 +7307,10 @@ class Fn {
|
|
|
7253
7307
|
const r = e.data.cvWasmFiles;
|
|
7254
7308
|
this.cvWasmUrls = {
|
|
7255
7309
|
simdLoaderJs: URL.createObjectURL(new Blob([r.simdLoaderJs], { type: "application/javascript" })),
|
|
7256
|
-
simdBinary: URL.createObjectURL(new Blob([r.simdBinary], { type: "application/wasm" })),
|
|
7257
7310
|
nosimdLoaderJs: URL.createObjectURL(new Blob([r.nosimdLoaderJs], { type: "application/javascript" })),
|
|
7258
|
-
|
|
7259
|
-
|
|
7311
|
+
simdBinary: "viji-cv-wasm:simd",
|
|
7312
|
+
nosimdBinary: "viji-cv-wasm:nosimd"
|
|
7313
|
+
}, this.cvWasmBinaries = { simdBinary: r.simdBinary, nosimdBinary: r.nosimdBinary }, this.videoSystems[0] && this.videoSystems[0].setCVWasmAssets(this.cvWasmUrls, this.cvWasmBinaries);
|
|
7260
7314
|
}
|
|
7261
7315
|
e.data.controlPort && (this.controlPort = e.data.controlPort, this.controlPort.onmessage = (r) => {
|
|
7262
7316
|
this.dispatchMessage(r.data);
|
|
@@ -7433,7 +7487,7 @@ class Fn {
|
|
|
7433
7487
|
const { streamIndex: n, streamType: r, deviceId: i } = e.data, o = n || 0;
|
|
7434
7488
|
let c = this.videoSystems[o];
|
|
7435
7489
|
const u = !!c;
|
|
7436
|
-
switch (c || (c = new pn(), c.setDebugMode(this.debugMode), this.cvWasmUrls && c.
|
|
7490
|
+
switch (c || (c = new pn(), c.setDebugMode(this.debugMode), this.cvWasmUrls && this.cvWasmBinaries && c.setCVWasmAssets(this.cvWasmUrls, this.cvWasmBinaries), this.videoSystems[o] = c), c.setStreamType(r, i), c.handleCanvasSetup({
|
|
7437
7491
|
offscreenCanvas: e.data.offscreenCanvas,
|
|
7438
7492
|
width: e.data.width,
|
|
7439
7493
|
height: e.data.height,
|
|
@@ -8284,11 +8338,11 @@ var d;
|
|
|
8284
8338
|
t[t._namespace = z] = "_namespace";
|
|
8285
8339
|
const me = z + 1;
|
|
8286
8340
|
t[t._of = me] = "_of";
|
|
8287
|
-
const
|
|
8288
|
-
t[t._opaque =
|
|
8289
|
-
const
|
|
8290
|
-
t[t._out =
|
|
8291
|
-
const E =
|
|
8341
|
+
const b = me + 1;
|
|
8342
|
+
t[t._opaque = b] = "_opaque";
|
|
8343
|
+
const y = b + 1;
|
|
8344
|
+
t[t._out = y] = "_out";
|
|
8345
|
+
const E = y + 1;
|
|
8292
8346
|
t[t._override = E] = "_override";
|
|
8293
8347
|
const V = E + 1;
|
|
8294
8348
|
t[t._private = V] = "_private";
|
|
@@ -8300,9 +8354,9 @@ var d;
|
|
|
8300
8354
|
t[t._public = R] = "_public";
|
|
8301
8355
|
const U = R + 1;
|
|
8302
8356
|
t[t._readonly = U] = "_readonly";
|
|
8303
|
-
const
|
|
8304
|
-
t[t._require =
|
|
8305
|
-
const B =
|
|
8357
|
+
const F = U + 1;
|
|
8358
|
+
t[t._require = F] = "_require";
|
|
8359
|
+
const B = F + 1;
|
|
8306
8360
|
t[t._satisfies = B] = "_satisfies";
|
|
8307
8361
|
const $ = B + 1;
|
|
8308
8362
|
t[t._set = $] = "_set";
|
|
@@ -8368,10 +8422,10 @@ var s;
|
|
|
8368
8422
|
t[t.semi = z] = "semi";
|
|
8369
8423
|
const me = 17408;
|
|
8370
8424
|
t[t.colon = me] = "colon";
|
|
8371
|
-
const
|
|
8372
|
-
t[t.doubleColon =
|
|
8373
|
-
const
|
|
8374
|
-
t[t.dot =
|
|
8425
|
+
const b = 18432;
|
|
8426
|
+
t[t.doubleColon = b] = "doubleColon";
|
|
8427
|
+
const y = 19456;
|
|
8428
|
+
t[t.dot = y] = "dot";
|
|
8375
8429
|
const E = 20480;
|
|
8376
8430
|
t[t.question = E] = "question";
|
|
8377
8431
|
const V = 21504;
|
|
@@ -8384,8 +8438,8 @@ var s;
|
|
|
8384
8438
|
t[t.ellipsis = R] = "ellipsis";
|
|
8385
8439
|
const U = 25600;
|
|
8386
8440
|
t[t.backQuote = U] = "backQuote";
|
|
8387
|
-
const
|
|
8388
|
-
t[t.dollarBraceL =
|
|
8441
|
+
const F = 27136;
|
|
8442
|
+
t[t.dollarBraceL = F] = "dollarBraceL";
|
|
8389
8443
|
const B = 27648;
|
|
8390
8444
|
t[t.at = B] = "at";
|
|
8391
8445
|
const $ = 29184;
|
|
@@ -8406,8 +8460,8 @@ var s;
|
|
|
8406
8460
|
t[t.pipeline = I] = "pipeline";
|
|
8407
8461
|
const A = 36866;
|
|
8408
8462
|
t[t.nullishCoalescing = A] = "nullishCoalescing";
|
|
8409
|
-
const
|
|
8410
|
-
t[t.logicalOR =
|
|
8463
|
+
const P = 37890;
|
|
8464
|
+
t[t.logicalOR = P] = "logicalOR";
|
|
8411
8465
|
const G = 38915;
|
|
8412
8466
|
t[t.logicalAND = G] = "logicalAND";
|
|
8413
8467
|
const Z = 39940;
|
|
@@ -8420,18 +8474,18 @@ var s;
|
|
|
8420
8474
|
t[t.equality = de] = "equality";
|
|
8421
8475
|
const Se = 44040;
|
|
8422
8476
|
t[t.lessThan = Se] = "lessThan";
|
|
8423
|
-
const
|
|
8424
|
-
t[t.greaterThan =
|
|
8477
|
+
const Fe = 45064;
|
|
8478
|
+
t[t.greaterThan = Fe] = "greaterThan";
|
|
8425
8479
|
const ke = 46088;
|
|
8426
8480
|
t[t.relationalOrEqual = ke] = "relationalOrEqual";
|
|
8427
8481
|
const Ie = 47113;
|
|
8428
8482
|
t[t.bitShiftL = Ie] = "bitShiftL";
|
|
8429
8483
|
const Re = 48137;
|
|
8430
8484
|
t[t.bitShiftR = Re] = "bitShiftR";
|
|
8431
|
-
const
|
|
8432
|
-
t[t.plus =
|
|
8433
|
-
const
|
|
8434
|
-
t[t.minus =
|
|
8485
|
+
const bt = 49802;
|
|
8486
|
+
t[t.plus = bt] = "plus";
|
|
8487
|
+
const Ft = 50826;
|
|
8488
|
+
t[t.minus = Ft] = "minus";
|
|
8435
8489
|
const qt = 51723;
|
|
8436
8490
|
t[t.modulo = qt] = "modulo";
|
|
8437
8491
|
const Jn = 52235;
|
|
@@ -8470,10 +8524,10 @@ var s;
|
|
|
8470
8524
|
t[t._do = pr] = "_do";
|
|
8471
8525
|
const gr = 69648;
|
|
8472
8526
|
t[t._else = gr] = "_else";
|
|
8473
|
-
const
|
|
8474
|
-
t[t._finally =
|
|
8475
|
-
const
|
|
8476
|
-
t[t._for =
|
|
8527
|
+
const yr = 70672;
|
|
8528
|
+
t[t._finally = yr] = "_finally";
|
|
8529
|
+
const br = 71696;
|
|
8530
|
+
t[t._for = br] = "_for";
|
|
8477
8531
|
const _r = 73232;
|
|
8478
8532
|
t[t._function = _r] = "_function";
|
|
8479
8533
|
const kr = 73744;
|
|
@@ -8500,10 +8554,10 @@ var s;
|
|
|
8500
8554
|
t[t._new = Cr] = "_new";
|
|
8501
8555
|
const Lr = 85520;
|
|
8502
8556
|
t[t._this = Lr] = "_this";
|
|
8503
|
-
const
|
|
8504
|
-
t[t._super =
|
|
8505
|
-
const
|
|
8506
|
-
t[t._class =
|
|
8557
|
+
const Pr = 86544;
|
|
8558
|
+
t[t._super = Pr] = "_super";
|
|
8559
|
+
const Fr = 87568;
|
|
8560
|
+
t[t._class = Fr] = "_class";
|
|
8507
8561
|
const Dr = 88080;
|
|
8508
8562
|
t[t._extends = Dr] = "_extends";
|
|
8509
8563
|
const Ur = 89104;
|
|
@@ -8552,10 +8606,10 @@ var s;
|
|
|
8552
8606
|
t[t._override = pc] = "_override";
|
|
8553
8607
|
const gc = 112144;
|
|
8554
8608
|
t[t._as = gc] = "_as";
|
|
8555
|
-
const
|
|
8556
|
-
t[t._enum =
|
|
8557
|
-
const
|
|
8558
|
-
t[t._type =
|
|
8609
|
+
const yc = 113168;
|
|
8610
|
+
t[t._enum = yc] = "_enum";
|
|
8611
|
+
const bc = 114192;
|
|
8612
|
+
t[t._type = bc] = "_type";
|
|
8559
8613
|
const _c = 115216;
|
|
8560
8614
|
t[t._implements = _c] = "_implements";
|
|
8561
8615
|
})(s || (s = {}));
|
|
@@ -8931,10 +8985,10 @@ var p;
|
|
|
8931
8985
|
t[t.digit2 = z] = "digit2";
|
|
8932
8986
|
const me = 51;
|
|
8933
8987
|
t[t.digit3 = me] = "digit3";
|
|
8934
|
-
const
|
|
8935
|
-
t[t.digit4 =
|
|
8936
|
-
const
|
|
8937
|
-
t[t.digit5 =
|
|
8988
|
+
const b = 52;
|
|
8989
|
+
t[t.digit4 = b] = "digit4";
|
|
8990
|
+
const y = 53;
|
|
8991
|
+
t[t.digit5 = y] = "digit5";
|
|
8938
8992
|
const E = 54;
|
|
8939
8993
|
t[t.digit6 = E] = "digit6";
|
|
8940
8994
|
const V = 55;
|
|
@@ -8947,8 +9001,8 @@ var p;
|
|
|
8947
9001
|
t[t.colon = R] = "colon";
|
|
8948
9002
|
const U = 59;
|
|
8949
9003
|
t[t.semicolon = U] = "semicolon";
|
|
8950
|
-
const
|
|
8951
|
-
t[t.lessThan =
|
|
9004
|
+
const F = 60;
|
|
9005
|
+
t[t.lessThan = F] = "lessThan";
|
|
8952
9006
|
const B = 61;
|
|
8953
9007
|
t[t.equalsTo = B] = "equalsTo";
|
|
8954
9008
|
const $ = 62;
|
|
@@ -8969,8 +9023,8 @@ var p;
|
|
|
8969
9023
|
t[t.uppercaseE = I] = "uppercaseE";
|
|
8970
9024
|
const A = 70;
|
|
8971
9025
|
t[t.uppercaseF = A] = "uppercaseF";
|
|
8972
|
-
const
|
|
8973
|
-
t[t.uppercaseG =
|
|
9026
|
+
const P = 71;
|
|
9027
|
+
t[t.uppercaseG = P] = "uppercaseG";
|
|
8974
9028
|
const G = 72;
|
|
8975
9029
|
t[t.uppercaseH = G] = "uppercaseH";
|
|
8976
9030
|
const Z = 73;
|
|
@@ -8983,18 +9037,18 @@ var p;
|
|
|
8983
9037
|
t[t.uppercaseL = de] = "uppercaseL";
|
|
8984
9038
|
const Se = 77;
|
|
8985
9039
|
t[t.uppercaseM = Se] = "uppercaseM";
|
|
8986
|
-
const
|
|
8987
|
-
t[t.uppercaseN =
|
|
9040
|
+
const Fe = 78;
|
|
9041
|
+
t[t.uppercaseN = Fe] = "uppercaseN";
|
|
8988
9042
|
const ke = 79;
|
|
8989
9043
|
t[t.uppercaseO = ke] = "uppercaseO";
|
|
8990
9044
|
const Ie = 80;
|
|
8991
9045
|
t[t.uppercaseP = Ie] = "uppercaseP";
|
|
8992
9046
|
const Re = 81;
|
|
8993
9047
|
t[t.uppercaseQ = Re] = "uppercaseQ";
|
|
8994
|
-
const
|
|
8995
|
-
t[t.uppercaseR =
|
|
8996
|
-
const
|
|
8997
|
-
t[t.uppercaseS =
|
|
9048
|
+
const bt = 82;
|
|
9049
|
+
t[t.uppercaseR = bt] = "uppercaseR";
|
|
9050
|
+
const Ft = 83;
|
|
9051
|
+
t[t.uppercaseS = Ft] = "uppercaseS";
|
|
8998
9052
|
const qt = 84;
|
|
8999
9053
|
t[t.uppercaseT = qt] = "uppercaseT";
|
|
9000
9054
|
const Jn = 85;
|
|
@@ -9033,10 +9087,10 @@ var p;
|
|
|
9033
9087
|
t[t.lowercaseE = pr] = "lowercaseE";
|
|
9034
9088
|
const gr = 102;
|
|
9035
9089
|
t[t.lowercaseF = gr] = "lowercaseF";
|
|
9036
|
-
const
|
|
9037
|
-
t[t.lowercaseG =
|
|
9038
|
-
const
|
|
9039
|
-
t[t.lowercaseH =
|
|
9090
|
+
const yr = 103;
|
|
9091
|
+
t[t.lowercaseG = yr] = "lowercaseG";
|
|
9092
|
+
const br = 104;
|
|
9093
|
+
t[t.lowercaseH = br] = "lowercaseH";
|
|
9040
9094
|
const _r = 105;
|
|
9041
9095
|
t[t.lowercaseI = _r] = "lowercaseI";
|
|
9042
9096
|
const kr = 106;
|
|
@@ -9063,10 +9117,10 @@ var p;
|
|
|
9063
9117
|
t[t.lowercaseT = Cr] = "lowercaseT";
|
|
9064
9118
|
const Lr = 117;
|
|
9065
9119
|
t[t.lowercaseU = Lr] = "lowercaseU";
|
|
9066
|
-
const
|
|
9067
|
-
t[t.lowercaseV =
|
|
9068
|
-
const
|
|
9069
|
-
t[t.lowercaseW =
|
|
9120
|
+
const Pr = 118;
|
|
9121
|
+
t[t.lowercaseV = Pr] = "lowercaseV";
|
|
9122
|
+
const Fr = 119;
|
|
9123
|
+
t[t.lowercaseW = Fr] = "lowercaseW";
|
|
9070
9124
|
const Dr = 120;
|
|
9071
9125
|
t[t.lowercaseX = Dr] = "lowercaseX";
|
|
9072
9126
|
const Ur = 121;
|
|
@@ -9129,9 +9183,9 @@ function ve(t) {
|
|
|
9129
9183
|
Ee(t) || ne();
|
|
9130
9184
|
}
|
|
9131
9185
|
function Oe() {
|
|
9132
|
-
return l(s.eof) || l(s.braceR) ||
|
|
9186
|
+
return l(s.eof) || l(s.braceR) || Pe();
|
|
9133
9187
|
}
|
|
9134
|
-
function
|
|
9188
|
+
function Pe() {
|
|
9135
9189
|
const t = a.tokens[a.tokens.length - 1], e = t ? t.end : 0;
|
|
9136
9190
|
for (let n = e; n < a.start; n++) {
|
|
9137
9191
|
const r = C.charCodeAt(n);
|
|
@@ -9152,7 +9206,7 @@ function Ho() {
|
|
|
9152
9206
|
function Je() {
|
|
9153
9207
|
return _(s.semi) || Oe();
|
|
9154
9208
|
}
|
|
9155
|
-
function
|
|
9209
|
+
function ye() {
|
|
9156
9210
|
Je() || ne('Unexpected token, expected ";"');
|
|
9157
9211
|
}
|
|
9158
9212
|
function T(t) {
|
|
@@ -18638,7 +18692,7 @@ function dt() {
|
|
|
18638
18692
|
a.tokens.push(new Gn()), a.start = a.pos, ku();
|
|
18639
18693
|
}
|
|
18640
18694
|
function su() {
|
|
18641
|
-
a.type === s.assign && --a.pos,
|
|
18695
|
+
a.type === s.assign && --a.pos, yu();
|
|
18642
18696
|
}
|
|
18643
18697
|
function se(t) {
|
|
18644
18698
|
for (let n = a.tokens.length - t; n < a.tokens.length; n++)
|
|
@@ -18659,7 +18713,7 @@ function Ko(t) {
|
|
|
18659
18713
|
function l(t) {
|
|
18660
18714
|
return a.type === t;
|
|
18661
18715
|
}
|
|
18662
|
-
function
|
|
18716
|
+
function be() {
|
|
18663
18717
|
const t = a.snapshot();
|
|
18664
18718
|
S();
|
|
18665
18719
|
const e = a.type;
|
|
@@ -18890,7 +18944,7 @@ function sa(t) {
|
|
|
18890
18944
|
case p.digit0: {
|
|
18891
18945
|
const e = C.charCodeAt(a.pos + 1);
|
|
18892
18946
|
if (e === p.lowercaseX || e === p.uppercaseX || e === p.lowercaseO || e === p.uppercaseO || e === p.lowercaseB || e === p.uppercaseB) {
|
|
18893
|
-
|
|
18947
|
+
bu();
|
|
18894
18948
|
return;
|
|
18895
18949
|
}
|
|
18896
18950
|
}
|
|
@@ -18946,7 +19000,7 @@ function sa(t) {
|
|
|
18946
19000
|
function fe(t, e) {
|
|
18947
19001
|
a.pos += e, te(t);
|
|
18948
19002
|
}
|
|
18949
|
-
function
|
|
19003
|
+
function yu() {
|
|
18950
19004
|
const t = a.pos;
|
|
18951
19005
|
let e = !1, n = !1;
|
|
18952
19006
|
for (; ; ) {
|
|
@@ -18979,7 +19033,7 @@ function ts() {
|
|
|
18979
19033
|
break;
|
|
18980
19034
|
}
|
|
18981
19035
|
}
|
|
18982
|
-
function
|
|
19036
|
+
function bu() {
|
|
18983
19037
|
for (a.pos += 2; ; ) {
|
|
18984
19038
|
const e = C.charCodeAt(a.pos);
|
|
18985
19039
|
if (e >= p.digit0 && e <= p.digit9 || e >= p.lowercaseA && e <= p.lowercaseF || e >= p.uppercaseA && e <= p.uppercaseF || e === p.underscore)
|
|
@@ -19057,7 +19111,7 @@ function vu() {
|
|
|
19057
19111
|
}
|
|
19058
19112
|
function tn(t, e = t.currentIndex()) {
|
|
19059
19113
|
let n = e + 1;
|
|
19060
|
-
if (
|
|
19114
|
+
if (bn(t, n)) {
|
|
19061
19115
|
const r = t.identifierNameAtIndex(e);
|
|
19062
19116
|
return {
|
|
19063
19117
|
isType: !1,
|
|
@@ -19066,21 +19120,21 @@ function tn(t, e = t.currentIndex()) {
|
|
|
19066
19120
|
endIndex: n
|
|
19067
19121
|
};
|
|
19068
19122
|
}
|
|
19069
|
-
if (n++,
|
|
19123
|
+
if (n++, bn(t, n))
|
|
19070
19124
|
return {
|
|
19071
19125
|
isType: !0,
|
|
19072
19126
|
leftName: null,
|
|
19073
19127
|
rightName: null,
|
|
19074
19128
|
endIndex: n
|
|
19075
19129
|
};
|
|
19076
|
-
if (n++,
|
|
19130
|
+
if (n++, bn(t, n))
|
|
19077
19131
|
return {
|
|
19078
19132
|
isType: !1,
|
|
19079
19133
|
leftName: t.identifierNameAtIndex(e),
|
|
19080
19134
|
rightName: t.identifierNameAtIndex(e + 2),
|
|
19081
19135
|
endIndex: n
|
|
19082
19136
|
};
|
|
19083
|
-
if (n++,
|
|
19137
|
+
if (n++, bn(t, n))
|
|
19084
19138
|
return {
|
|
19085
19139
|
isType: !0,
|
|
19086
19140
|
leftName: null,
|
|
@@ -19089,7 +19143,7 @@ function tn(t, e = t.currentIndex()) {
|
|
|
19089
19143
|
};
|
|
19090
19144
|
throw new Error(`Unexpected import/export specifier at ${e}`);
|
|
19091
19145
|
}
|
|
19092
|
-
function
|
|
19146
|
+
function bn(t, e) {
|
|
19093
19147
|
const n = t.tokens[e];
|
|
19094
19148
|
return n.type === s.braceR || n.type === s.comma;
|
|
19095
19149
|
}
|
|
@@ -20051,7 +20105,7 @@ function Lu(t) {
|
|
|
20051
20105
|
}
|
|
20052
20106
|
return e.flush();
|
|
20053
20107
|
}
|
|
20054
|
-
var xt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
|
|
20108
|
+
var xt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Pu = { exports: {} };
|
|
20055
20109
|
(function(t, e) {
|
|
20056
20110
|
(function(n, r) {
|
|
20057
20111
|
t.exports = r();
|
|
@@ -20120,23 +20174,23 @@ var xt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
20120
20174
|
function W(L, j) {
|
|
20121
20175
|
const O = j <= 4, J = L.path.split("/");
|
|
20122
20176
|
let ae = 1, ee = 0, z = !1;
|
|
20123
|
-
for (let
|
|
20124
|
-
const
|
|
20125
|
-
if (!
|
|
20177
|
+
for (let b = 1; b < J.length; b++) {
|
|
20178
|
+
const y = J[b];
|
|
20179
|
+
if (!y) {
|
|
20126
20180
|
z = !0;
|
|
20127
20181
|
continue;
|
|
20128
20182
|
}
|
|
20129
|
-
if (z = !1,
|
|
20130
|
-
if (
|
|
20131
|
-
ee ? (z = !0, ee--, ae--) : O && (J[ae++] =
|
|
20183
|
+
if (z = !1, y !== ".") {
|
|
20184
|
+
if (y === "..") {
|
|
20185
|
+
ee ? (z = !0, ee--, ae--) : O && (J[ae++] = y);
|
|
20132
20186
|
continue;
|
|
20133
20187
|
}
|
|
20134
|
-
J[ae++] =
|
|
20188
|
+
J[ae++] = y, ee++;
|
|
20135
20189
|
}
|
|
20136
20190
|
}
|
|
20137
20191
|
let me = "";
|
|
20138
|
-
for (let
|
|
20139
|
-
me += "/" + J[
|
|
20192
|
+
for (let b = 1; b < ae; b++)
|
|
20193
|
+
me += "/" + J[b];
|
|
20140
20194
|
(!me || z && !me.endsWith("/..")) && (me += "/"), L.path = me;
|
|
20141
20195
|
}
|
|
20142
20196
|
function K(L, j) {
|
|
@@ -20179,17 +20233,17 @@ var xt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
20179
20233
|
}
|
|
20180
20234
|
return K;
|
|
20181
20235
|
});
|
|
20182
|
-
})(
|
|
20236
|
+
})(Pu);
|
|
20183
20237
|
var ns = class {
|
|
20184
20238
|
constructor() {
|
|
20185
20239
|
this._indexes = { __proto__: null }, this.array = [];
|
|
20186
20240
|
}
|
|
20187
20241
|
};
|
|
20188
|
-
function
|
|
20242
|
+
function Fu(t, e) {
|
|
20189
20243
|
return t._indexes[e];
|
|
20190
20244
|
}
|
|
20191
20245
|
function Du(t, e) {
|
|
20192
|
-
const n =
|
|
20246
|
+
const n = Fu(t, e);
|
|
20193
20247
|
if (n !== void 0) return n;
|
|
20194
20248
|
const { array: r, _indexes: i } = t, o = r.push(e);
|
|
20195
20249
|
return i[e] = o - 1;
|
|
@@ -20441,7 +20495,7 @@ const Zu = {
|
|
|
20441
20495
|
}
|
|
20442
20496
|
`
|
|
20443
20497
|
};
|
|
20444
|
-
class
|
|
20498
|
+
class Fn {
|
|
20445
20499
|
__init() {
|
|
20446
20500
|
this.helperNames = {};
|
|
20447
20501
|
}
|
|
@@ -20449,7 +20503,7 @@ class Pn {
|
|
|
20449
20503
|
this.createRequireName = null;
|
|
20450
20504
|
}
|
|
20451
20505
|
constructor(e) {
|
|
20452
|
-
this.nameManager = e,
|
|
20506
|
+
this.nameManager = e, Fn.prototype.__init.call(this), Fn.prototype.__init2.call(this);
|
|
20453
20507
|
}
|
|
20454
20508
|
getHelperName(e) {
|
|
20455
20509
|
let n = this.helperNames[e];
|
|
@@ -20636,10 +20690,10 @@ var rl = (
|
|
|
20636
20690
|
(function(t) {
|
|
20637
20691
|
var e = xt && xt.__extends || /* @__PURE__ */ function() {
|
|
20638
20692
|
var k = function(x, I) {
|
|
20639
|
-
return k = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(A,
|
|
20640
|
-
A.__proto__ =
|
|
20641
|
-
} || function(A,
|
|
20642
|
-
for (var G in
|
|
20693
|
+
return k = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(A, P) {
|
|
20694
|
+
A.__proto__ = P;
|
|
20695
|
+
} || function(A, P) {
|
|
20696
|
+
for (var G in P) P.hasOwnProperty(G) && (A[G] = P[G]);
|
|
20643
20697
|
}, k(x, I);
|
|
20644
20698
|
};
|
|
20645
20699
|
return function(x, I) {
|
|
@@ -20681,9 +20735,9 @@ var rl = (
|
|
|
20681
20735
|
var A = k.call(this) || this;
|
|
20682
20736
|
return A.name = I, A._failMsg = "is not a " + I, A;
|
|
20683
20737
|
}
|
|
20684
|
-
return x.prototype.getChecker = function(I, A,
|
|
20685
|
-
var G = this, Z = o(I, this.name), ue = Z.getChecker(I, A,
|
|
20686
|
-
return Z instanceof
|
|
20738
|
+
return x.prototype.getChecker = function(I, A, P) {
|
|
20739
|
+
var G = this, Z = o(I, this.name), ue = Z.getChecker(I, A, P);
|
|
20740
|
+
return Z instanceof F || Z instanceof x ? ue : function(ge, de) {
|
|
20687
20741
|
return ue(ge, de) ? !0 : de.fail(null, G._failMsg, 0);
|
|
20688
20742
|
};
|
|
20689
20743
|
}, x;
|
|
@@ -20703,9 +20757,9 @@ var rl = (
|
|
|
20703
20757
|
return A.value = I, A.name = JSON.stringify(I), A._failMsg = "is not " + A.name, A;
|
|
20704
20758
|
}
|
|
20705
20759
|
return x.prototype.getChecker = function(I, A) {
|
|
20706
|
-
var
|
|
20760
|
+
var P = this;
|
|
20707
20761
|
return function(G, Z) {
|
|
20708
|
-
return G ===
|
|
20762
|
+
return G === P.value ? !0 : Z.fail(null, P._failMsg, -1);
|
|
20709
20763
|
};
|
|
20710
20764
|
}, x;
|
|
20711
20765
|
}(r)
|
|
@@ -20724,12 +20778,12 @@ var rl = (
|
|
|
20724
20778
|
return A.ttype = I, A;
|
|
20725
20779
|
}
|
|
20726
20780
|
return x.prototype.getChecker = function(I, A) {
|
|
20727
|
-
var
|
|
20781
|
+
var P = this.ttype.getChecker(I, A);
|
|
20728
20782
|
return function(G, Z) {
|
|
20729
20783
|
if (!Array.isArray(G))
|
|
20730
20784
|
return Z.fail(null, "is not an array", 0);
|
|
20731
20785
|
for (var ue = 0; ue < G.length; ue++) {
|
|
20732
|
-
var ge =
|
|
20786
|
+
var ge = P(G[ue], Z);
|
|
20733
20787
|
if (!ge)
|
|
20734
20788
|
return Z.fail(ue, null, 1);
|
|
20735
20789
|
}
|
|
@@ -20756,20 +20810,20 @@ var rl = (
|
|
|
20756
20810
|
return A.ttypes = I, A;
|
|
20757
20811
|
}
|
|
20758
20812
|
return x.prototype.getChecker = function(I, A) {
|
|
20759
|
-
var
|
|
20813
|
+
var P = this.ttypes.map(function(Z) {
|
|
20760
20814
|
return Z.getChecker(I, A);
|
|
20761
20815
|
}), G = function(Z, ue) {
|
|
20762
20816
|
if (!Array.isArray(Z))
|
|
20763
20817
|
return ue.fail(null, "is not an array", 0);
|
|
20764
|
-
for (var ge = 0; ge <
|
|
20765
|
-
var de =
|
|
20818
|
+
for (var ge = 0; ge < P.length; ge++) {
|
|
20819
|
+
var de = P[ge](Z[ge], ue);
|
|
20766
20820
|
if (!de)
|
|
20767
20821
|
return ue.fail(ge, null, 1);
|
|
20768
20822
|
}
|
|
20769
20823
|
return !0;
|
|
20770
20824
|
};
|
|
20771
20825
|
return A ? function(Z, ue) {
|
|
20772
|
-
return G(Z, ue) ? Z.length <=
|
|
20826
|
+
return G(Z, ue) ? Z.length <= P.length ? !0 : ue.fail(P.length, "is extraneous", 2) : !1;
|
|
20773
20827
|
} : G;
|
|
20774
20828
|
}, x;
|
|
20775
20829
|
}(r)
|
|
@@ -20790,15 +20844,15 @@ var rl = (
|
|
|
20790
20844
|
function x(I) {
|
|
20791
20845
|
var A = k.call(this) || this;
|
|
20792
20846
|
A.ttypes = I;
|
|
20793
|
-
var
|
|
20847
|
+
var P = I.map(function(Z) {
|
|
20794
20848
|
return Z instanceof u || Z instanceof f ? Z.name : null;
|
|
20795
20849
|
}).filter(function(Z) {
|
|
20796
20850
|
return Z;
|
|
20797
|
-
}), G = I.length -
|
|
20798
|
-
return
|
|
20851
|
+
}), G = I.length - P.length;
|
|
20852
|
+
return P.length ? (G > 0 && P.push(G + " more"), A._failMsg = "is none of " + P.join(", ")) : A._failMsg = "is none of " + G + " types", A;
|
|
20799
20853
|
}
|
|
20800
20854
|
return x.prototype.getChecker = function(I, A) {
|
|
20801
|
-
var
|
|
20855
|
+
var P = this, G = this.ttypes.map(function(Z) {
|
|
20802
20856
|
return Z.getChecker(I, A);
|
|
20803
20857
|
});
|
|
20804
20858
|
return function(Z, ue) {
|
|
@@ -20807,7 +20861,7 @@ var rl = (
|
|
|
20807
20861
|
if (Se)
|
|
20808
20862
|
return !0;
|
|
20809
20863
|
}
|
|
20810
|
-
return ue.resolveUnion(ge), ue.fail(null,
|
|
20864
|
+
return ue.resolveUnion(ge), ue.fail(null, P._failMsg, 0);
|
|
20811
20865
|
};
|
|
20812
20866
|
}, x;
|
|
20813
20867
|
}(r)
|
|
@@ -20830,8 +20884,8 @@ var rl = (
|
|
|
20830
20884
|
return A.ttypes = I, A;
|
|
20831
20885
|
}
|
|
20832
20886
|
return x.prototype.getChecker = function(I, A) {
|
|
20833
|
-
var
|
|
20834
|
-
return Z.getChecker(I, A,
|
|
20887
|
+
var P = /* @__PURE__ */ new Set(), G = this.ttypes.map(function(Z) {
|
|
20888
|
+
return Z.getChecker(I, A, P);
|
|
20835
20889
|
});
|
|
20836
20890
|
return function(Z, ue) {
|
|
20837
20891
|
var ge = G.every(function(de) {
|
|
@@ -20853,14 +20907,14 @@ var rl = (
|
|
|
20853
20907
|
e(x, k);
|
|
20854
20908
|
function x(I) {
|
|
20855
20909
|
var A = k.call(this) || this;
|
|
20856
|
-
return A.members = I, A.validValues = /* @__PURE__ */ new Set(), A._failMsg = "is not a valid enum value", A.validValues = new Set(Object.keys(I).map(function(
|
|
20857
|
-
return I[
|
|
20910
|
+
return A.members = I, A.validValues = /* @__PURE__ */ new Set(), A._failMsg = "is not a valid enum value", A.validValues = new Set(Object.keys(I).map(function(P) {
|
|
20911
|
+
return I[P];
|
|
20858
20912
|
})), A;
|
|
20859
20913
|
}
|
|
20860
20914
|
return x.prototype.getChecker = function(I, A) {
|
|
20861
|
-
var
|
|
20915
|
+
var P = this;
|
|
20862
20916
|
return function(G, Z) {
|
|
20863
|
-
return
|
|
20917
|
+
return P.validValues.has(G) ? !0 : Z.fail(null, P._failMsg, 0);
|
|
20864
20918
|
};
|
|
20865
20919
|
}, x;
|
|
20866
20920
|
}(r)
|
|
@@ -20875,18 +20929,18 @@ var rl = (
|
|
|
20875
20929
|
function(k) {
|
|
20876
20930
|
e(x, k);
|
|
20877
20931
|
function x(I, A) {
|
|
20878
|
-
var
|
|
20879
|
-
return
|
|
20932
|
+
var P = k.call(this) || this;
|
|
20933
|
+
return P.enumName = I, P.prop = A, P._failMsg = "is not " + I + "." + A, P;
|
|
20880
20934
|
}
|
|
20881
20935
|
return x.prototype.getChecker = function(I, A) {
|
|
20882
|
-
var
|
|
20936
|
+
var P = this, G = o(I, this.enumName);
|
|
20883
20937
|
if (!(G instanceof j))
|
|
20884
20938
|
throw new Error("Type " + this.enumName + " used in enumlit is not an enum type");
|
|
20885
20939
|
var Z = G.members[this.prop];
|
|
20886
20940
|
if (!G.members.hasOwnProperty(this.prop))
|
|
20887
20941
|
throw new Error("Unknown value " + this.enumName + "." + this.prop + " used in enumlit");
|
|
20888
20942
|
return function(ue, ge) {
|
|
20889
|
-
return ue === Z ? !0 : ge.fail(null,
|
|
20943
|
+
return ue === Z ? !0 : ge.fail(null, P._failMsg, -1);
|
|
20890
20944
|
};
|
|
20891
20945
|
}, x;
|
|
20892
20946
|
}(r)
|
|
@@ -20898,7 +20952,7 @@ var rl = (
|
|
|
20898
20952
|
});
|
|
20899
20953
|
}
|
|
20900
20954
|
function ee(k, x) {
|
|
20901
|
-
return x instanceof
|
|
20955
|
+
return x instanceof y ? new E(k, x.ttype, !0) : new E(k, i(x), !1);
|
|
20902
20956
|
}
|
|
20903
20957
|
function z(k, x) {
|
|
20904
20958
|
return new me(k, ae(x));
|
|
@@ -20909,12 +20963,12 @@ var rl = (
|
|
|
20909
20963
|
function(k) {
|
|
20910
20964
|
e(x, k);
|
|
20911
20965
|
function x(I, A) {
|
|
20912
|
-
var
|
|
20913
|
-
return
|
|
20966
|
+
var P = k.call(this) || this;
|
|
20967
|
+
return P.bases = I, P.props = A, P.propSet = new Set(A.map(function(G) {
|
|
20914
20968
|
return G.name;
|
|
20915
|
-
})),
|
|
20969
|
+
})), P;
|
|
20916
20970
|
}
|
|
20917
|
-
return x.prototype.getChecker = function(I, A,
|
|
20971
|
+
return x.prototype.getChecker = function(I, A, P) {
|
|
20918
20972
|
var G = this, Z = this.bases.map(function(ke) {
|
|
20919
20973
|
return o(I, ke).getChecker(I, A);
|
|
20920
20974
|
}), ue = this.props.map(function(ke) {
|
|
@@ -20928,28 +20982,28 @@ var rl = (
|
|
|
20928
20982
|
if (!Z[Re](ke, Ie))
|
|
20929
20983
|
return !1;
|
|
20930
20984
|
for (var Re = 0; Re < ue.length; Re++) {
|
|
20931
|
-
var
|
|
20932
|
-
if (
|
|
20985
|
+
var bt = G.props[Re].name, Ft = ke[bt];
|
|
20986
|
+
if (Ft === void 0) {
|
|
20933
20987
|
if (de[Re])
|
|
20934
|
-
return Ie.fail(
|
|
20988
|
+
return Ie.fail(bt, "is missing", 1);
|
|
20935
20989
|
} else {
|
|
20936
|
-
var qt = ue[Re](
|
|
20990
|
+
var qt = ue[Re](Ft, Ie);
|
|
20937
20991
|
if (!qt)
|
|
20938
|
-
return Ie.fail(
|
|
20992
|
+
return Ie.fail(bt, null, 1);
|
|
20939
20993
|
}
|
|
20940
20994
|
}
|
|
20941
20995
|
return !0;
|
|
20942
20996
|
};
|
|
20943
20997
|
if (!A)
|
|
20944
20998
|
return Se;
|
|
20945
|
-
var
|
|
20946
|
-
return
|
|
20947
|
-
return
|
|
20948
|
-
}),
|
|
20999
|
+
var Fe = this.propSet;
|
|
21000
|
+
return P && (this.propSet.forEach(function(ke) {
|
|
21001
|
+
return P.add(ke);
|
|
21002
|
+
}), Fe = P), function(ke, Ie) {
|
|
20949
21003
|
if (!Se(ke, Ie))
|
|
20950
21004
|
return !1;
|
|
20951
21005
|
for (var Re in ke)
|
|
20952
|
-
if (!
|
|
21006
|
+
if (!Fe.has(Re))
|
|
20953
21007
|
return Ie.fail(Re, "is extraneous", 2);
|
|
20954
21008
|
return !0;
|
|
20955
21009
|
};
|
|
@@ -20957,11 +21011,11 @@ var rl = (
|
|
|
20957
21011
|
}(r)
|
|
20958
21012
|
);
|
|
20959
21013
|
t.TIface = me;
|
|
20960
|
-
function
|
|
20961
|
-
return new
|
|
21014
|
+
function b(k) {
|
|
21015
|
+
return new y(i(k));
|
|
20962
21016
|
}
|
|
20963
|
-
t.opt =
|
|
20964
|
-
var
|
|
21017
|
+
t.opt = b;
|
|
21018
|
+
var y = (
|
|
20965
21019
|
/** @class */
|
|
20966
21020
|
function(k) {
|
|
20967
21021
|
e(x, k);
|
|
@@ -20970,14 +21024,14 @@ var rl = (
|
|
|
20970
21024
|
return A.ttype = I, A;
|
|
20971
21025
|
}
|
|
20972
21026
|
return x.prototype.getChecker = function(I, A) {
|
|
20973
|
-
var
|
|
21027
|
+
var P = this.ttype.getChecker(I, A);
|
|
20974
21028
|
return function(G, Z) {
|
|
20975
|
-
return G === void 0 ||
|
|
21029
|
+
return G === void 0 || P(G, Z);
|
|
20976
21030
|
};
|
|
20977
21031
|
}, x;
|
|
20978
21032
|
}(r)
|
|
20979
21033
|
);
|
|
20980
|
-
t.TOptional =
|
|
21034
|
+
t.TOptional = y;
|
|
20981
21035
|
var E = (
|
|
20982
21036
|
/** @class */
|
|
20983
21037
|
/* @__PURE__ */ function() {
|
|
@@ -20999,12 +21053,12 @@ var rl = (
|
|
|
20999
21053
|
function(k) {
|
|
21000
21054
|
e(x, k);
|
|
21001
21055
|
function x(I, A) {
|
|
21002
|
-
var
|
|
21003
|
-
return
|
|
21056
|
+
var P = k.call(this) || this;
|
|
21057
|
+
return P.paramList = I, P.result = A, P;
|
|
21004
21058
|
}
|
|
21005
21059
|
return x.prototype.getChecker = function(I, A) {
|
|
21006
|
-
return function(
|
|
21007
|
-
return typeof
|
|
21060
|
+
return function(P, G) {
|
|
21061
|
+
return typeof P == "function" ? !0 : G.fail(null, "is not a function", 0);
|
|
21008
21062
|
};
|
|
21009
21063
|
}, x;
|
|
21010
21064
|
}(r)
|
|
@@ -21033,20 +21087,20 @@ var rl = (
|
|
|
21033
21087
|
return A.params = I, A;
|
|
21034
21088
|
}
|
|
21035
21089
|
return x.prototype.getChecker = function(I, A) {
|
|
21036
|
-
var
|
|
21090
|
+
var P = this, G = this.params.map(function(de) {
|
|
21037
21091
|
return de.ttype.getChecker(I, A);
|
|
21038
21092
|
}), Z = new n.NoopContext(), ue = this.params.map(function(de, Se) {
|
|
21039
21093
|
return !de.isOpt && !G[Se](void 0, Z);
|
|
21040
21094
|
}), ge = function(de, Se) {
|
|
21041
21095
|
if (!Array.isArray(de))
|
|
21042
21096
|
return Se.fail(null, "is not an array", 0);
|
|
21043
|
-
for (var
|
|
21044
|
-
var ke =
|
|
21045
|
-
if (de[
|
|
21046
|
-
if (ue[
|
|
21097
|
+
for (var Fe = 0; Fe < G.length; Fe++) {
|
|
21098
|
+
var ke = P.params[Fe];
|
|
21099
|
+
if (de[Fe] === void 0) {
|
|
21100
|
+
if (ue[Fe])
|
|
21047
21101
|
return Se.fail(ke.name, "is missing", 1);
|
|
21048
21102
|
} else {
|
|
21049
|
-
var Ie = G[
|
|
21103
|
+
var Ie = G[Fe](de[Fe], Se);
|
|
21050
21104
|
if (!Ie)
|
|
21051
21105
|
return Se.fail(ke.name, null, 1);
|
|
21052
21106
|
}
|
|
@@ -21060,55 +21114,55 @@ var rl = (
|
|
|
21060
21114
|
}(r)
|
|
21061
21115
|
);
|
|
21062
21116
|
t.TParamList = U;
|
|
21063
|
-
var
|
|
21117
|
+
var F = (
|
|
21064
21118
|
/** @class */
|
|
21065
21119
|
function(k) {
|
|
21066
21120
|
e(x, k);
|
|
21067
21121
|
function x(I, A) {
|
|
21068
|
-
var
|
|
21069
|
-
return
|
|
21122
|
+
var P = k.call(this) || this;
|
|
21123
|
+
return P.validator = I, P.message = A, P;
|
|
21070
21124
|
}
|
|
21071
21125
|
return x.prototype.getChecker = function(I, A) {
|
|
21072
|
-
var
|
|
21126
|
+
var P = this;
|
|
21073
21127
|
return function(G, Z) {
|
|
21074
|
-
return
|
|
21128
|
+
return P.validator(G) ? !0 : Z.fail(null, P.message, 0);
|
|
21075
21129
|
};
|
|
21076
21130
|
}, x;
|
|
21077
21131
|
}(r)
|
|
21078
21132
|
);
|
|
21079
|
-
t.BasicType =
|
|
21080
|
-
any: new
|
|
21133
|
+
t.BasicType = F, t.basicTypes = {
|
|
21134
|
+
any: new F(function(k) {
|
|
21081
21135
|
return !0;
|
|
21082
21136
|
}, "is invalid"),
|
|
21083
|
-
number: new
|
|
21137
|
+
number: new F(function(k) {
|
|
21084
21138
|
return typeof k == "number";
|
|
21085
21139
|
}, "is not a number"),
|
|
21086
|
-
object: new
|
|
21140
|
+
object: new F(function(k) {
|
|
21087
21141
|
return typeof k == "object" && k;
|
|
21088
21142
|
}, "is not an object"),
|
|
21089
|
-
boolean: new
|
|
21143
|
+
boolean: new F(function(k) {
|
|
21090
21144
|
return typeof k == "boolean";
|
|
21091
21145
|
}, "is not a boolean"),
|
|
21092
|
-
string: new
|
|
21146
|
+
string: new F(function(k) {
|
|
21093
21147
|
return typeof k == "string";
|
|
21094
21148
|
}, "is not a string"),
|
|
21095
|
-
symbol: new
|
|
21149
|
+
symbol: new F(function(k) {
|
|
21096
21150
|
return typeof k == "symbol";
|
|
21097
21151
|
}, "is not a symbol"),
|
|
21098
|
-
void: new
|
|
21152
|
+
void: new F(function(k) {
|
|
21099
21153
|
return k == null;
|
|
21100
21154
|
}, "is not void"),
|
|
21101
|
-
undefined: new
|
|
21155
|
+
undefined: new F(function(k) {
|
|
21102
21156
|
return k === void 0;
|
|
21103
21157
|
}, "is not undefined"),
|
|
21104
|
-
null: new
|
|
21158
|
+
null: new F(function(k) {
|
|
21105
21159
|
return k === null;
|
|
21106
21160
|
}, "is not null"),
|
|
21107
|
-
never: new
|
|
21161
|
+
never: new F(function(k) {
|
|
21108
21162
|
return !1;
|
|
21109
21163
|
}, "is unexpected"),
|
|
21110
|
-
Date: new
|
|
21111
|
-
RegExp: new
|
|
21164
|
+
Date: new F($("[object Date]"), "is not a Date"),
|
|
21165
|
+
RegExp: new F($("[object RegExp]"), "is not a RegExp")
|
|
21112
21166
|
};
|
|
21113
21167
|
var B = Object.prototype.toString;
|
|
21114
21168
|
function $(k) {
|
|
@@ -21116,11 +21170,11 @@ var rl = (
|
|
|
21116
21170
|
return typeof x == "object" && x && B.call(x) === k;
|
|
21117
21171
|
};
|
|
21118
21172
|
}
|
|
21119
|
-
typeof Buffer < "u" && (t.basicTypes.Buffer = new
|
|
21173
|
+
typeof Buffer < "u" && (t.basicTypes.Buffer = new F(function(k) {
|
|
21120
21174
|
return Buffer.isBuffer(k);
|
|
21121
21175
|
}, "is not a Buffer"));
|
|
21122
21176
|
for (var Y = function(k) {
|
|
21123
|
-
t.basicTypes[k.name] = new
|
|
21177
|
+
t.basicTypes[k.name] = new F(function(x) {
|
|
21124
21178
|
return x instanceof k;
|
|
21125
21179
|
}, "is not a " + k.name);
|
|
21126
21180
|
}, oe = 0, ce = [
|
|
@@ -21329,7 +21383,7 @@ function ma() {
|
|
|
21329
21383
|
function pa(t) {
|
|
21330
21384
|
S(), Xn(t);
|
|
21331
21385
|
}
|
|
21332
|
-
function
|
|
21386
|
+
function yt(t) {
|
|
21333
21387
|
Q(), js(t);
|
|
21334
21388
|
}
|
|
21335
21389
|
function Dn() {
|
|
@@ -21348,7 +21402,7 @@ function Xn(t) {
|
|
|
21348
21402
|
}
|
|
21349
21403
|
case s._yield:
|
|
21350
21404
|
case s.name: {
|
|
21351
|
-
a.type = s.name,
|
|
21405
|
+
a.type = s.name, yt(t);
|
|
21352
21406
|
return;
|
|
21353
21407
|
}
|
|
21354
21408
|
case s.bracketL: {
|
|
@@ -21395,7 +21449,7 @@ function ll(t, e) {
|
|
|
21395
21449
|
);
|
|
21396
21450
|
}
|
|
21397
21451
|
function ga() {
|
|
21398
|
-
he ? Rf() : le &&
|
|
21452
|
+
he ? Rf() : le && bh();
|
|
21399
21453
|
}
|
|
21400
21454
|
function Un(t, e = !1) {
|
|
21401
21455
|
if (e || Xn(t), !_(s.eq))
|
|
@@ -21409,19 +21463,19 @@ function ps() {
|
|
|
21409
21463
|
function hl() {
|
|
21410
21464
|
return l(s.name) || !!(a.type & s.IS_KEYWORD) || l(s.string) || l(s.num) || l(s.bigint) || l(s.decimal);
|
|
21411
21465
|
}
|
|
21412
|
-
function
|
|
21466
|
+
function ya() {
|
|
21413
21467
|
const t = a.snapshot();
|
|
21414
|
-
return S(), (l(s.bracketL) || l(s.braceL) || l(s.star) || l(s.ellipsis) || l(s.hash) || hl()) && !
|
|
21468
|
+
return S(), (l(s.bracketL) || l(s.braceL) || l(s.star) || l(s.ellipsis) || l(s.hash) || hl()) && !Pe() ? !0 : (a.restoreFromSnapshot(t), !1);
|
|
21415
21469
|
}
|
|
21416
21470
|
function qs(t) {
|
|
21417
|
-
for (;
|
|
21471
|
+
for (; ba(t) !== null; )
|
|
21418
21472
|
;
|
|
21419
21473
|
}
|
|
21420
|
-
function
|
|
21474
|
+
function ba(t) {
|
|
21421
21475
|
if (!l(s.name))
|
|
21422
21476
|
return null;
|
|
21423
21477
|
const e = a.contextualKeyword;
|
|
21424
|
-
if (t.indexOf(e) !== -1 &&
|
|
21478
|
+
if (t.indexOf(e) !== -1 && ya()) {
|
|
21425
21479
|
switch (e) {
|
|
21426
21480
|
case d._readonly:
|
|
21427
21481
|
a.tokens[a.tokens.length - 1].type = s._readonly;
|
|
@@ -21457,7 +21511,7 @@ function hn() {
|
|
|
21457
21511
|
Q();
|
|
21458
21512
|
}
|
|
21459
21513
|
function fl() {
|
|
21460
|
-
hn(), !
|
|
21514
|
+
hn(), !Pe() && l(s.lessThan) && jt();
|
|
21461
21515
|
}
|
|
21462
21516
|
function dl() {
|
|
21463
21517
|
S(), fn();
|
|
@@ -21466,7 +21520,7 @@ function ml() {
|
|
|
21466
21520
|
S();
|
|
21467
21521
|
}
|
|
21468
21522
|
function pl() {
|
|
21469
|
-
T(s._typeof), l(s._import) ? _a() : hn(), !
|
|
21523
|
+
T(s._typeof), l(s._import) ? _a() : hn(), !Pe() && l(s.lessThan) && jt();
|
|
21470
21524
|
}
|
|
21471
21525
|
function _a() {
|
|
21472
21526
|
T(s._import), T(s.parenL), T(s.string), T(s.parenR), _(s.dot) && hn(), l(s.lessThan) && jt();
|
|
@@ -21487,28 +21541,28 @@ function zn() {
|
|
|
21487
21541
|
}
|
|
21488
21542
|
function Ws(t) {
|
|
21489
21543
|
const e = t === s.arrow;
|
|
21490
|
-
Lt(), T(s.parenL), a.scopeDepth++,
|
|
21544
|
+
Lt(), T(s.parenL), a.scopeDepth++, yl(
|
|
21491
21545
|
!1
|
|
21492
21546
|
/* isBlockScope */
|
|
21493
21547
|
), a.scopeDepth--, (e || l(t)) && nn(t);
|
|
21494
21548
|
}
|
|
21495
|
-
function
|
|
21549
|
+
function yl(t) {
|
|
21496
21550
|
$s(s.parenR, t);
|
|
21497
21551
|
}
|
|
21498
21552
|
function Mn() {
|
|
21499
|
-
_(s.comma) ||
|
|
21553
|
+
_(s.comma) || ye();
|
|
21500
21554
|
}
|
|
21501
21555
|
function Xi() {
|
|
21502
21556
|
Ws(s.colon), Mn();
|
|
21503
21557
|
}
|
|
21504
|
-
function
|
|
21558
|
+
function bl() {
|
|
21505
21559
|
const t = a.snapshot();
|
|
21506
21560
|
S();
|
|
21507
21561
|
const e = _(s.name) && l(s.colon);
|
|
21508
21562
|
return a.restoreFromSnapshot(t), e;
|
|
21509
21563
|
}
|
|
21510
21564
|
function ka() {
|
|
21511
|
-
if (!(l(s.bracketL) &&
|
|
21565
|
+
if (!(l(s.bracketL) && bl()))
|
|
21512
21566
|
return !1;
|
|
21513
21567
|
const t = se(0);
|
|
21514
21568
|
return T(s.bracketL), Q(), fn(), T(s.bracketR), Vt(), Mn(), re(t), !0;
|
|
@@ -21525,8 +21579,8 @@ function _l() {
|
|
|
21525
21579
|
S(), l(s.parenL) || l(s.lessThan) ? Xi() : zi(!1);
|
|
21526
21580
|
return;
|
|
21527
21581
|
}
|
|
21528
|
-
const t = !!
|
|
21529
|
-
ka() || ((q(d._get) || q(d._set)) &&
|
|
21582
|
+
const t = !!ba([d._readonly]);
|
|
21583
|
+
ka() || ((q(d._get) || q(d._set)) && ya(), rn(
|
|
21530
21584
|
-1
|
|
21531
21585
|
/* Types don't need context IDs. */
|
|
21532
21586
|
), zi(t));
|
|
@@ -21549,7 +21603,7 @@ function El() {
|
|
|
21549
21603
|
Q(), T(s._in), _e();
|
|
21550
21604
|
}
|
|
21551
21605
|
function Tl() {
|
|
21552
|
-
T(s.braceL), l(s.plus) || l(s.minus) ? (S(), ve(d._readonly)) : Ee(d._readonly), T(s.bracketL), El(), Ee(d._as) && _e(), T(s.bracketR), l(s.plus) || l(s.minus) ? (S(), T(s.question)) : _(s.question), Ol(),
|
|
21606
|
+
T(s.braceL), l(s.plus) || l(s.minus) ? (S(), ve(d._readonly)) : Ee(d._readonly), T(s.bracketL), El(), Ee(d._as) && _e(), T(s.bracketR), l(s.plus) || l(s.minus) ? (S(), T(s.question)) : _(s.question), Ol(), ye(), T(s.braceR);
|
|
21553
21607
|
}
|
|
21554
21608
|
function Sl() {
|
|
21555
21609
|
for (T(s.bracketL); !_(s.bracketR) && !a.error; )
|
|
@@ -21600,7 +21654,7 @@ function Rl() {
|
|
|
21600
21654
|
S(), Bt();
|
|
21601
21655
|
return;
|
|
21602
21656
|
case s._this: {
|
|
21603
|
-
ml(), q(d._is) && !
|
|
21657
|
+
ml(), q(d._is) && !Pe() && dl();
|
|
21604
21658
|
return;
|
|
21605
21659
|
}
|
|
21606
21660
|
case s._typeof:
|
|
@@ -21631,7 +21685,7 @@ function Rl() {
|
|
|
21631
21685
|
ne();
|
|
21632
21686
|
}
|
|
21633
21687
|
function Cl() {
|
|
21634
|
-
for (Rl(); !
|
|
21688
|
+
for (Rl(); !Pe() && _(s.bracketL); )
|
|
21635
21689
|
_(s.bracketR) || (_e(), T(s.bracketR));
|
|
21636
21690
|
}
|
|
21637
21691
|
function Ll() {
|
|
@@ -21657,12 +21711,12 @@ function Yi() {
|
|
|
21657
21711
|
for (; _(s.bitwiseAND); )
|
|
21658
21712
|
gs();
|
|
21659
21713
|
}
|
|
21660
|
-
function
|
|
21714
|
+
function Pl() {
|
|
21661
21715
|
if (_(s.bitwiseOR), Yi(), l(s.bitwiseOR))
|
|
21662
21716
|
for (; _(s.bitwiseOR); )
|
|
21663
21717
|
Yi();
|
|
21664
21718
|
}
|
|
21665
|
-
function
|
|
21719
|
+
function Fl() {
|
|
21666
21720
|
return l(s.lessThan) ? !0 : l(s.parenL) && Ul();
|
|
21667
21721
|
}
|
|
21668
21722
|
function Dl() {
|
|
@@ -21698,23 +21752,23 @@ function Ol() {
|
|
|
21698
21752
|
}
|
|
21699
21753
|
function Bl() {
|
|
21700
21754
|
const t = a.snapshot();
|
|
21701
|
-
return q(d._asserts) ? (S(), Ee(d._is) ? (_e(), !0) : ps() || l(s._this) ? (S(), Ee(d._is) && _e(), !0) : (a.restoreFromSnapshot(t), !1)) : ps() || l(s._this) ? (S(), q(d._is) && !
|
|
21755
|
+
return q(d._asserts) ? (S(), Ee(d._is) ? (_e(), !0) : ps() || l(s._this) ? (S(), Ee(d._is) && _e(), !0) : (a.restoreFromSnapshot(t), !1)) : ps() || l(s._this) ? (S(), q(d._is) && !Pe() ? (S(), _e(), !0) : (a.restoreFromSnapshot(t), !1)) : !1;
|
|
21702
21756
|
}
|
|
21703
21757
|
function fn() {
|
|
21704
21758
|
const t = se(0);
|
|
21705
21759
|
T(s.colon), _e(), re(t);
|
|
21706
21760
|
}
|
|
21707
21761
|
function _e() {
|
|
21708
|
-
if (Ki(), a.inDisallowConditionalTypesContext ||
|
|
21762
|
+
if (Ki(), a.inDisallowConditionalTypesContext || Pe() || !_(s._extends))
|
|
21709
21763
|
return;
|
|
21710
21764
|
const t = a.inDisallowConditionalTypesContext;
|
|
21711
21765
|
a.inDisallowConditionalTypesContext = !0, Ki(), a.inDisallowConditionalTypesContext = t, T(s.question), _e(), T(s.colon), _e();
|
|
21712
21766
|
}
|
|
21713
21767
|
function Vl() {
|
|
21714
|
-
return q(d._abstract) &&
|
|
21768
|
+
return q(d._abstract) && be() === s._new;
|
|
21715
21769
|
}
|
|
21716
21770
|
function Ki() {
|
|
21717
|
-
if (
|
|
21771
|
+
if (Fl()) {
|
|
21718
21772
|
ss(mt.TSFunctionType);
|
|
21719
21773
|
return;
|
|
21720
21774
|
}
|
|
@@ -21725,7 +21779,7 @@ function Ki() {
|
|
|
21725
21779
|
ss(mt.TSAbstractConstructorType);
|
|
21726
21780
|
return;
|
|
21727
21781
|
}
|
|
21728
|
-
|
|
21782
|
+
Pl();
|
|
21729
21783
|
}
|
|
21730
21784
|
function jl() {
|
|
21731
21785
|
const t = se(1);
|
|
@@ -21748,10 +21802,10 @@ function ql() {
|
|
|
21748
21802
|
hn(), l(s.lessThan) && jt();
|
|
21749
21803
|
}
|
|
21750
21804
|
function Wl() {
|
|
21751
|
-
|
|
21805
|
+
yt(!1), Lt(), _(s._extends) && wa(), va();
|
|
21752
21806
|
}
|
|
21753
21807
|
function Hl() {
|
|
21754
|
-
|
|
21808
|
+
yt(!1), Lt(), T(s.eq), _e(), ye();
|
|
21755
21809
|
}
|
|
21756
21810
|
function Gl() {
|
|
21757
21811
|
if (l(s.string) ? Bt() : Q(), _(s.eq)) {
|
|
@@ -21760,7 +21814,7 @@ function Gl() {
|
|
|
21760
21814
|
}
|
|
21761
21815
|
}
|
|
21762
21816
|
function Hs() {
|
|
21763
|
-
for (
|
|
21817
|
+
for (yt(!1), T(s.braceL); !_(s.braceR) && !a.error; )
|
|
21764
21818
|
Gl(), _(s.comma);
|
|
21765
21819
|
}
|
|
21766
21820
|
function Gs() {
|
|
@@ -21769,17 +21823,17 @@ function Gs() {
|
|
|
21769
21823
|
s.braceR
|
|
21770
21824
|
);
|
|
21771
21825
|
}
|
|
21772
|
-
function
|
|
21773
|
-
|
|
21826
|
+
function ys() {
|
|
21827
|
+
yt(!1), _(s.dot) ? ys() : Gs();
|
|
21774
21828
|
}
|
|
21775
21829
|
function Ea() {
|
|
21776
|
-
q(d._global) ? Q() : l(s.string) ? at() : ne(), l(s.braceL) ? Gs() :
|
|
21830
|
+
q(d._global) ? Q() : l(s.string) ? at() : ne(), l(s.braceL) ? Gs() : ye();
|
|
21777
21831
|
}
|
|
21778
|
-
function
|
|
21779
|
-
Dn(), T(s.eq), zl(),
|
|
21832
|
+
function bs() {
|
|
21833
|
+
Dn(), T(s.eq), zl(), ye();
|
|
21780
21834
|
}
|
|
21781
21835
|
function Xl() {
|
|
21782
|
-
return q(d._require) &&
|
|
21836
|
+
return q(d._require) && be() === s.parenL;
|
|
21783
21837
|
}
|
|
21784
21838
|
function zl() {
|
|
21785
21839
|
Xl() ? Yl() : hn();
|
|
@@ -21889,14 +21943,14 @@ function Yn(t, e) {
|
|
|
21889
21943
|
return Ea(), re(n), !0;
|
|
21890
21944
|
} else if (l(s.name)) {
|
|
21891
21945
|
const n = se(e ? 2 : 1);
|
|
21892
|
-
return
|
|
21946
|
+
return ys(), re(n), !0;
|
|
21893
21947
|
}
|
|
21894
21948
|
}
|
|
21895
21949
|
break;
|
|
21896
21950
|
case d._namespace:
|
|
21897
21951
|
if (Dt(e) && l(s.name)) {
|
|
21898
21952
|
const n = se(e ? 2 : 1);
|
|
21899
|
-
return
|
|
21953
|
+
return ys(), re(n), !0;
|
|
21900
21954
|
}
|
|
21901
21955
|
break;
|
|
21902
21956
|
case d._type:
|
|
@@ -21948,13 +22002,13 @@ function Jl(t, e) {
|
|
|
21948
22002
|
mn(!1, e);
|
|
21949
22003
|
}
|
|
21950
22004
|
function eh(t, e, n) {
|
|
21951
|
-
if (!
|
|
22005
|
+
if (!Pe() && _(s.bang)) {
|
|
21952
22006
|
a.tokens[a.tokens.length - 1].type = s.nonNullAssertion;
|
|
21953
22007
|
return;
|
|
21954
22008
|
}
|
|
21955
22009
|
if (l(s.lessThan) || l(s.bitShiftL)) {
|
|
21956
22010
|
const r = a.snapshot();
|
|
21957
|
-
if (!e &&
|
|
22011
|
+
if (!e && Pa() && Ql())
|
|
21958
22012
|
return;
|
|
21959
22013
|
if (Xs(), !e && _(s.parenL) ? (a.tokens[a.tokens.length - 1].subscriptStartIndex = t, pt()) : l(s.backQuote) ? Qs() : (
|
|
21960
22014
|
// The remaining possible case is an instantiation expression, e.g.
|
|
@@ -21962,23 +22016,23 @@ function eh(t, e, n) {
|
|
|
21962
22016
|
// cause us to bail out.
|
|
21963
22017
|
// a<b>>c is not (a<b>)>c, but a<(b>>c)
|
|
21964
22018
|
(a.type === s.greaterThan || // a<b>c is (a<b)>c
|
|
21965
|
-
a.type !== s.parenL && a.type & s.IS_EXPRESSION_START && !
|
|
22019
|
+
a.type !== s.parenL && a.type & s.IS_EXPRESSION_START && !Pe()) && ne()
|
|
21966
22020
|
), a.error)
|
|
21967
22021
|
a.restoreFromSnapshot(r);
|
|
21968
22022
|
else
|
|
21969
22023
|
return;
|
|
21970
|
-
} else !e && l(s.questionDot) &&
|
|
22024
|
+
} else !e && l(s.questionDot) && be() === s.lessThan && (S(), a.tokens[t].isOptionalChainStart = !0, a.tokens[a.tokens.length - 1].subscriptStartIndex = t, jt(), T(s.parenL), pt());
|
|
21971
22025
|
Ys(t, e, n);
|
|
21972
22026
|
}
|
|
21973
22027
|
function th() {
|
|
21974
22028
|
if (_(s._import))
|
|
21975
|
-
return q(d._type) &&
|
|
22029
|
+
return q(d._type) && be() !== s.eq && ve(d._type), bs(), !0;
|
|
21976
22030
|
if (_(s.eq))
|
|
21977
|
-
return xe(),
|
|
22031
|
+
return xe(), ye(), !0;
|
|
21978
22032
|
if (Ee(d._as))
|
|
21979
|
-
return ve(d._namespace), Q(),
|
|
22033
|
+
return ve(d._namespace), Q(), ye(), !0;
|
|
21980
22034
|
if (q(d._type)) {
|
|
21981
|
-
const t =
|
|
22035
|
+
const t = be();
|
|
21982
22036
|
(t === s.braceL || t === s.star) && S();
|
|
21983
22037
|
}
|
|
21984
22038
|
return !1;
|
|
@@ -22014,7 +22068,7 @@ function rh() {
|
|
|
22014
22068
|
Q(), a.tokens[a.tokens.length - 3].identifierRole = X.ExportAccess, a.tokens[a.tokens.length - 4].isType = !0, a.tokens[a.tokens.length - 3].isType = !0, a.tokens[a.tokens.length - 2].isType = !0, a.tokens[a.tokens.length - 1].isType = !0;
|
|
22015
22069
|
}
|
|
22016
22070
|
function sh() {
|
|
22017
|
-
if (q(d._abstract) &&
|
|
22071
|
+
if (q(d._abstract) && be() === s._class)
|
|
22018
22072
|
return a.type = s._abstract, S(), Rt(!0, !0), !0;
|
|
22019
22073
|
if (q(d._interface)) {
|
|
22020
22074
|
const t = se(2);
|
|
@@ -22049,7 +22103,7 @@ function oh(t) {
|
|
|
22049
22103
|
return !1;
|
|
22050
22104
|
}
|
|
22051
22105
|
function ah(t) {
|
|
22052
|
-
Zl(t) ||
|
|
22106
|
+
Zl(t) || ye();
|
|
22053
22107
|
}
|
|
22054
22108
|
function ch() {
|
|
22055
22109
|
const t = Ee(d._declare);
|
|
@@ -22083,7 +22137,7 @@ function hh() {
|
|
|
22083
22137
|
}
|
|
22084
22138
|
function fh() {
|
|
22085
22139
|
const t = se(0);
|
|
22086
|
-
|
|
22140
|
+
Pe() || _(s.bang), Vt(), re(t);
|
|
22087
22141
|
}
|
|
22088
22142
|
function dh() {
|
|
22089
22143
|
l(s.colon) && fn();
|
|
@@ -22114,14 +22168,14 @@ function gh(t, e) {
|
|
|
22114
22168
|
return r;
|
|
22115
22169
|
return tt(t, e);
|
|
22116
22170
|
}
|
|
22117
|
-
function
|
|
22171
|
+
function yh() {
|
|
22118
22172
|
if (l(s.colon)) {
|
|
22119
22173
|
const t = a.snapshot();
|
|
22120
22174
|
nn(s.colon), Oe() && ne(), l(s.arrow) || ne(), a.error && a.restoreFromSnapshot(t);
|
|
22121
22175
|
}
|
|
22122
22176
|
return _(s.arrow);
|
|
22123
22177
|
}
|
|
22124
|
-
function
|
|
22178
|
+
function bh() {
|
|
22125
22179
|
const t = se(0);
|
|
22126
22180
|
_(s.question), Vt(), re(t);
|
|
22127
22181
|
}
|
|
@@ -22303,14 +22357,14 @@ function Ut() {
|
|
|
22303
22357
|
}
|
|
22304
22358
|
function Ah(t) {
|
|
22305
22359
|
if (l(s.question)) {
|
|
22306
|
-
const e =
|
|
22360
|
+
const e = be();
|
|
22307
22361
|
if (e === s.colon || e === s.comma || e === s.parenR)
|
|
22308
22362
|
return;
|
|
22309
22363
|
}
|
|
22310
22364
|
Ra(t);
|
|
22311
22365
|
}
|
|
22312
22366
|
function Ih() {
|
|
22313
|
-
Ko(s.question), l(s.colon) && (le ? fn() : he &&
|
|
22367
|
+
Ko(s.question), l(s.colon) && (le ? fn() : he && Pt());
|
|
22314
22368
|
}
|
|
22315
22369
|
class Rh {
|
|
22316
22370
|
constructor(e) {
|
|
@@ -22333,7 +22387,7 @@ function tt(t, e) {
|
|
|
22333
22387
|
return e && Zs(), a.type & s.IS_ASSIGN ? (S(), Ae(t), !1) : n;
|
|
22334
22388
|
}
|
|
22335
22389
|
function Ch(t) {
|
|
22336
|
-
return
|
|
22390
|
+
return Ph(t) ? !0 : (Lh(t), !1);
|
|
22337
22391
|
}
|
|
22338
22392
|
function Lh(t) {
|
|
22339
22393
|
le || he ? Ah(t) : Ra(t);
|
|
@@ -22341,12 +22395,12 @@ function Lh(t) {
|
|
|
22341
22395
|
function Ra(t) {
|
|
22342
22396
|
_(s.question) && (Ae(), T(s.colon), Ae(t));
|
|
22343
22397
|
}
|
|
22344
|
-
function
|
|
22398
|
+
function Ph(t) {
|
|
22345
22399
|
const e = a.tokens.length;
|
|
22346
22400
|
return dn() ? !0 : (vn(e, -1, t), !1);
|
|
22347
22401
|
}
|
|
22348
22402
|
function vn(t, e, n) {
|
|
22349
|
-
if (le && (s._in & s.PRECEDENCE_MASK) > e && !
|
|
22403
|
+
if (le && (s._in & s.PRECEDENCE_MASK) > e && !Pe() && (Ee(d._as) || Ee(d._satisfies))) {
|
|
22350
22404
|
const i = se(1);
|
|
22351
22405
|
_e(), re(i), ra(), vn(t, e, n);
|
|
22352
22406
|
return;
|
|
@@ -22382,17 +22436,17 @@ function zs(t, e = !1) {
|
|
|
22382
22436
|
function La(t, e = !1) {
|
|
22383
22437
|
const n = new Rh(!1);
|
|
22384
22438
|
do
|
|
22385
|
-
|
|
22439
|
+
Fh(t, e, n);
|
|
22386
22440
|
while (!n.stop && !a.error);
|
|
22387
22441
|
}
|
|
22388
|
-
function
|
|
22389
|
-
le ? eh(t, e, n) : he ?
|
|
22442
|
+
function Fh(t, e, n) {
|
|
22443
|
+
le ? eh(t, e, n) : he ? yf(t, e, n) : Ys(t, e, n);
|
|
22390
22444
|
}
|
|
22391
22445
|
function Ys(t, e, n) {
|
|
22392
22446
|
if (!e && _(s.doubleColon))
|
|
22393
22447
|
Ks(), n.stop = !0, zs(t, e);
|
|
22394
22448
|
else if (l(s.questionDot)) {
|
|
22395
|
-
if (a.tokens[t].isOptionalChainStart = !0, e &&
|
|
22449
|
+
if (a.tokens[t].isOptionalChainStart = !0, e && be() === s.parenL) {
|
|
22396
22450
|
n.stop = !0;
|
|
22397
22451
|
return;
|
|
22398
22452
|
}
|
|
@@ -22402,7 +22456,7 @@ function Ys(t, e, n) {
|
|
|
22402
22456
|
else if (_(s.bracketL))
|
|
22403
22457
|
a.tokens[a.tokens.length - 1].subscriptStartIndex = t, xe(), T(s.bracketR);
|
|
22404
22458
|
else if (!e && l(s.parenL))
|
|
22405
|
-
if (
|
|
22459
|
+
if (Pa()) {
|
|
22406
22460
|
const r = a.snapshot(), i = a.tokens.length;
|
|
22407
22461
|
S(), a.tokens[a.tokens.length - 1].subscriptStartIndex = t;
|
|
22408
22462
|
const o = en();
|
|
@@ -22414,7 +22468,7 @@ function Ys(t, e, n) {
|
|
|
22414
22468
|
}
|
|
22415
22469
|
else l(s.backQuote) ? Qs() : n.stop = !0;
|
|
22416
22470
|
}
|
|
22417
|
-
function
|
|
22471
|
+
function Pa() {
|
|
22418
22472
|
return a.tokens[a.tokens.length - 1].contextualKeyword === d._async && !Oe();
|
|
22419
22473
|
}
|
|
22420
22474
|
function pt() {
|
|
@@ -22464,12 +22518,12 @@ function at() {
|
|
|
22464
22518
|
return S(), l(s.dot) && (a.tokens[a.tokens.length - 1].type = s.name, S(), Q()), !1;
|
|
22465
22519
|
case s.name: {
|
|
22466
22520
|
const e = a.tokens.length, n = a.start, r = a.contextualKeyword;
|
|
22467
|
-
return Q(), r === d._await ? (Wh(), !1) : r === d._async && l(s._function) && !Oe() ? (S(), It(n, !1), !1) : t && r === d._async && !Oe() && l(s.name) ? (a.scopeDepth++,
|
|
22521
|
+
return Q(), r === d._await ? (Wh(), !1) : r === d._async && l(s._function) && !Oe() ? (S(), It(n, !1), !1) : t && r === d._async && !Oe() && l(s.name) ? (a.scopeDepth++, yt(!1), T(s.arrow), sn(e), !0) : l(s._do) && !Oe() ? (S(), gt(), !1) : t && !Oe() && l(s.arrow) ? (a.scopeDepth++, js(!1), T(s.arrow), sn(e), !0) : (a.tokens[a.tokens.length - 1].identifierRole = X.Access, !1);
|
|
22468
22522
|
}
|
|
22469
22523
|
case s._do:
|
|
22470
22524
|
return S(), gt(), !1;
|
|
22471
22525
|
case s.parenL:
|
|
22472
|
-
return
|
|
22526
|
+
return Fa(t);
|
|
22473
22527
|
case s.bracketL:
|
|
22474
22528
|
return S(), Ua(s.bracketR, !0), !1;
|
|
22475
22529
|
case s.braceL:
|
|
@@ -22507,7 +22561,7 @@ function Bt() {
|
|
|
22507
22561
|
function Kn() {
|
|
22508
22562
|
T(s.parenL), xe(), T(s.parenR);
|
|
22509
22563
|
}
|
|
22510
|
-
function
|
|
22564
|
+
function Fa(t) {
|
|
22511
22565
|
const e = a.snapshot(), n = a.tokens.length;
|
|
22512
22566
|
T(s.parenL);
|
|
22513
22567
|
let r = !0;
|
|
@@ -22525,13 +22579,13 @@ function Pa(t) {
|
|
|
22525
22579
|
} else
|
|
22526
22580
|
Ae(!1, !0);
|
|
22527
22581
|
}
|
|
22528
|
-
return T(s.parenR), t && Nh() && ks() ? (a.restoreFromSnapshot(e), a.scopeDepth++, $t(), ks(), sn(n), a.error ? (a.restoreFromSnapshot(e),
|
|
22582
|
+
return T(s.parenR), t && Nh() && ks() ? (a.restoreFromSnapshot(e), a.scopeDepth++, $t(), ks(), sn(n), a.error ? (a.restoreFromSnapshot(e), Fa(!1), !1) : !0) : !1;
|
|
22529
22583
|
}
|
|
22530
22584
|
function Nh() {
|
|
22531
22585
|
return l(s.colon) || !Oe();
|
|
22532
22586
|
}
|
|
22533
22587
|
function ks() {
|
|
22534
|
-
return le ?
|
|
22588
|
+
return le ? yh() : he ? Mf() : _(s.arrow);
|
|
22535
22589
|
}
|
|
22536
22590
|
function Zs() {
|
|
22537
22591
|
(le || he) && Ih();
|
|
@@ -22541,7 +22595,7 @@ function Oh() {
|
|
|
22541
22595
|
Q();
|
|
22542
22596
|
return;
|
|
22543
22597
|
}
|
|
22544
|
-
Bh(), he &&
|
|
22598
|
+
Bh(), he && bf(), _(s.parenL) && Ua(s.parenR);
|
|
22545
22599
|
}
|
|
22546
22600
|
function Bh() {
|
|
22547
22601
|
Ks(), _(s.questionDot);
|
|
@@ -22667,13 +22721,13 @@ function zh() {
|
|
|
22667
22721
|
);
|
|
22668
22722
|
}
|
|
22669
22723
|
function Yh() {
|
|
22670
|
-
S(), Q(), l(s.lessThan) && Ye(), T(s.parenL), Es(), T(s.parenR), ei(),
|
|
22724
|
+
S(), Q(), l(s.lessThan) && Ye(), T(s.parenL), Es(), T(s.parenR), ei(), ye();
|
|
22671
22725
|
}
|
|
22672
22726
|
function ws() {
|
|
22673
22727
|
l(s._class) ? zh() : l(s._function) ? Yh() : l(s._var) ? Kh() : Ee(d._module) ? _(s.dot) ? Jh() : Zh() : q(d._type) ? ef() : q(d._opaque) ? tf() : q(d._interface) ? nf() : l(s._export) ? Qh() : ne();
|
|
22674
22728
|
}
|
|
22675
22729
|
function Kh() {
|
|
22676
|
-
S(), Va(),
|
|
22730
|
+
S(), Va(), ye();
|
|
22677
22731
|
}
|
|
22678
22732
|
function Zh() {
|
|
22679
22733
|
for (l(s.string) ? at() : Q(), T(s.braceL); !l(s.braceR) && !a.error; )
|
|
@@ -22681,7 +22735,7 @@ function Zh() {
|
|
|
22681
22735
|
T(s.braceR);
|
|
22682
22736
|
}
|
|
22683
22737
|
function Qh() {
|
|
22684
|
-
T(s._export), _(s._default) ? l(s._function) || l(s._class) ? ws() : (Ne(),
|
|
22738
|
+
T(s._export), _(s._default) ? l(s._function) || l(s._class) ? ws() : (Ne(), ye()) : l(s._var) || // declare export var ...
|
|
22685
22739
|
l(s._function) || // declare export function ...
|
|
22686
22740
|
l(s._class) || // declare export class ...
|
|
22687
22741
|
q(d._opaque) ? ws() : l(s.star) || // declare export * from ''
|
|
@@ -22691,7 +22745,7 @@ function Qh() {
|
|
|
22691
22745
|
q(d._opaque) ? za() : ne();
|
|
22692
22746
|
}
|
|
22693
22747
|
function Jh() {
|
|
22694
|
-
ve(d._exports),
|
|
22748
|
+
ve(d._exports), Pt(), ye();
|
|
22695
22749
|
}
|
|
22696
22750
|
function ef() {
|
|
22697
22751
|
S(), ri();
|
|
@@ -22731,10 +22785,10 @@ function Zn() {
|
|
|
22731
22785
|
Q();
|
|
22732
22786
|
}
|
|
22733
22787
|
function ri() {
|
|
22734
|
-
Zn(), l(s.lessThan) && Ye(), rt(s.eq),
|
|
22788
|
+
Zn(), l(s.lessThan) && Ye(), rt(s.eq), ye();
|
|
22735
22789
|
}
|
|
22736
22790
|
function si(t) {
|
|
22737
|
-
ve(d._type), Zn(), l(s.lessThan) && Ye(), l(s.colon) && rt(s.colon), t || rt(s.eq),
|
|
22791
|
+
ve(d._type), Zn(), l(s.lessThan) && Ye(), l(s.colon) && rt(s.colon), t || rt(s.eq), ye();
|
|
22738
22792
|
}
|
|
22739
22793
|
function rf() {
|
|
22740
22794
|
ai(), Va(), _(s.eq) && Ne();
|
|
@@ -22764,7 +22818,7 @@ function ii() {
|
|
|
22764
22818
|
l(s.num) || l(s.string) ? at() : Q();
|
|
22765
22819
|
}
|
|
22766
22820
|
function of() {
|
|
22767
|
-
|
|
22821
|
+
be() === s.colon ? (ii(), rt()) : Ne(), T(s.bracketR), rt();
|
|
22768
22822
|
}
|
|
22769
22823
|
function af() {
|
|
22770
22824
|
ii(), T(s.bracketR), T(s.bracketR), l(s.lessThan) || l(s.parenL) ? oi() : (_(s.question), rt());
|
|
@@ -22781,11 +22835,11 @@ function On(t, e, n) {
|
|
|
22781
22835
|
let r;
|
|
22782
22836
|
for (e && l(s.braceBarL) ? (T(s.braceBarL), r = s.braceBarR) : (T(s.braceL), r = s.braceR); !l(r) && !a.error; ) {
|
|
22783
22837
|
if (n && q(d._proto)) {
|
|
22784
|
-
const i =
|
|
22838
|
+
const i = be();
|
|
22785
22839
|
i !== s.colon && i !== s.question && (S(), t = !1);
|
|
22786
22840
|
}
|
|
22787
22841
|
if (t && q(d._static)) {
|
|
22788
|
-
const i =
|
|
22842
|
+
const i = be();
|
|
22789
22843
|
i !== s.colon && i !== s.question && S();
|
|
22790
22844
|
}
|
|
22791
22845
|
if (ai(), _(s.bracketL))
|
|
@@ -22794,7 +22848,7 @@ function On(t, e, n) {
|
|
|
22794
22848
|
cf();
|
|
22795
22849
|
else {
|
|
22796
22850
|
if (q(d._get) || q(d._set)) {
|
|
22797
|
-
const i =
|
|
22851
|
+
const i = be();
|
|
22798
22852
|
(i === s.name || i === s.string || i === s.num) && S();
|
|
22799
22853
|
}
|
|
22800
22854
|
uf();
|
|
@@ -22830,7 +22884,7 @@ function df() {
|
|
|
22830
22884
|
T(s.bracketR);
|
|
22831
22885
|
}
|
|
22832
22886
|
function Bn() {
|
|
22833
|
-
const t =
|
|
22887
|
+
const t = be();
|
|
22834
22888
|
t === s.colon || t === s.question ? (Q(), _(s.question), rt()) : Ne();
|
|
22835
22889
|
}
|
|
22836
22890
|
function Es() {
|
|
@@ -22865,12 +22919,12 @@ function Oa() {
|
|
|
22865
22919
|
case s.parenL:
|
|
22866
22920
|
if (S(), !l(s.parenR) && !l(s.ellipsis))
|
|
22867
22921
|
if (l(s.name)) {
|
|
22868
|
-
const n =
|
|
22922
|
+
const n = be();
|
|
22869
22923
|
t = n !== s.question && n !== s.colon;
|
|
22870
22924
|
} else
|
|
22871
22925
|
t = !0;
|
|
22872
22926
|
if (t)
|
|
22873
|
-
if (a.noAnonFunctionType = !1, Ne(), a.noAnonFunctionType = e, a.noAnonFunctionType || !(l(s.comma) || l(s.parenR) &&
|
|
22927
|
+
if (a.noAnonFunctionType = !1, Ne(), a.noAnonFunctionType = e, a.noAnonFunctionType || !(l(s.comma) || l(s.parenR) && be() === s.arrow)) {
|
|
22874
22928
|
T(s.parenR);
|
|
22875
22929
|
return;
|
|
22876
22930
|
} else
|
|
@@ -22922,11 +22976,11 @@ function pf() {
|
|
|
22922
22976
|
function Ne() {
|
|
22923
22977
|
pf();
|
|
22924
22978
|
}
|
|
22925
|
-
function
|
|
22979
|
+
function Pt() {
|
|
22926
22980
|
rt();
|
|
22927
22981
|
}
|
|
22928
22982
|
function Va() {
|
|
22929
|
-
Q(), l(s.colon) &&
|
|
22983
|
+
Q(), l(s.colon) && Pt();
|
|
22930
22984
|
}
|
|
22931
22985
|
function ai() {
|
|
22932
22986
|
(l(s.plus) || l(s.minus)) && (S(), a.tokens[a.tokens.length - 1].isType = !0);
|
|
@@ -22934,8 +22988,8 @@ function ai() {
|
|
|
22934
22988
|
function gf(t) {
|
|
22935
22989
|
l(s.colon) && ei(), mn(!1, t);
|
|
22936
22990
|
}
|
|
22937
|
-
function
|
|
22938
|
-
if (l(s.questionDot) &&
|
|
22991
|
+
function yf(t, e, n) {
|
|
22992
|
+
if (l(s.questionDot) && be() === s.lessThan) {
|
|
22939
22993
|
if (e) {
|
|
22940
22994
|
n.stop = !0;
|
|
22941
22995
|
return;
|
|
@@ -22951,7 +23005,7 @@ function bf(t, e, n) {
|
|
|
22951
23005
|
}
|
|
22952
23006
|
Ys(t, e, n);
|
|
22953
23007
|
}
|
|
22954
|
-
function
|
|
23008
|
+
function bf() {
|
|
22955
23009
|
if (l(s.lessThan)) {
|
|
22956
23010
|
const t = a.snapshot();
|
|
22957
23011
|
At(), a.error && a.restoreFromSnapshot(t);
|
|
@@ -22986,7 +23040,7 @@ function vf(t) {
|
|
|
22986
23040
|
si(!1), re(e);
|
|
22987
23041
|
}
|
|
22988
23042
|
}
|
|
22989
|
-
|
|
23043
|
+
ye();
|
|
22990
23044
|
}
|
|
22991
23045
|
function wf() {
|
|
22992
23046
|
return q(d._type) || q(d._interface) || q(d._opaque) || q(d._enum);
|
|
@@ -23008,7 +23062,7 @@ function Tf() {
|
|
|
23008
23062
|
Be(!0);
|
|
23009
23063
|
}
|
|
23010
23064
|
function Sf() {
|
|
23011
|
-
return l(s.star) || q(d._type) &&
|
|
23065
|
+
return l(s.star) || q(d._type) && be() === s.star;
|
|
23012
23066
|
}
|
|
23013
23067
|
function xf() {
|
|
23014
23068
|
if (Ee(d._type)) {
|
|
@@ -23032,7 +23086,7 @@ function If() {
|
|
|
23032
23086
|
}
|
|
23033
23087
|
function Rf() {
|
|
23034
23088
|
const t = se(0);
|
|
23035
|
-
_(s.question), l(s.colon) &&
|
|
23089
|
+
_(s.question), l(s.colon) && Pt(), re(t);
|
|
23036
23090
|
}
|
|
23037
23091
|
function Cf() {
|
|
23038
23092
|
if (l(s._typeof) || q(d._type)) {
|
|
@@ -23044,19 +23098,19 @@ function Lf() {
|
|
|
23044
23098
|
const t = a.contextualKeyword === d._type || a.type === s._typeof;
|
|
23045
23099
|
t ? S() : Q(), q(d._as) && !Os(d._as) ? (Q(), t && !l(s.name) && !(a.type & s.IS_KEYWORD) || Q()) : (t && (l(s.name) || a.type & s.IS_KEYWORD) && Q(), Ee(d._as) && Q());
|
|
23046
23100
|
}
|
|
23047
|
-
function
|
|
23101
|
+
function Pf() {
|
|
23048
23102
|
if (l(s.lessThan)) {
|
|
23049
23103
|
const t = se(0);
|
|
23050
23104
|
Ye(), re(t);
|
|
23051
23105
|
}
|
|
23052
23106
|
}
|
|
23053
|
-
function
|
|
23054
|
-
l(s.colon) &&
|
|
23107
|
+
function Ff() {
|
|
23108
|
+
l(s.colon) && Pt();
|
|
23055
23109
|
}
|
|
23056
23110
|
function Df() {
|
|
23057
23111
|
if (l(s.colon)) {
|
|
23058
23112
|
const t = a.noAnonFunctionType;
|
|
23059
|
-
a.noAnonFunctionType = !0,
|
|
23113
|
+
a.noAnonFunctionType = !0, Pt(), a.noAnonFunctionType = t;
|
|
23060
23114
|
}
|
|
23061
23115
|
}
|
|
23062
23116
|
function Uf(t, e) {
|
|
@@ -23135,7 +23189,7 @@ function qf(t) {
|
|
|
23135
23189
|
zf();
|
|
23136
23190
|
return;
|
|
23137
23191
|
case s._function:
|
|
23138
|
-
if (
|
|
23192
|
+
if (be() === s.dot) break;
|
|
23139
23193
|
t || ne(), Zf();
|
|
23140
23194
|
return;
|
|
23141
23195
|
case s._class:
|
|
@@ -23173,7 +23227,7 @@ function qf(t) {
|
|
|
23173
23227
|
return;
|
|
23174
23228
|
case s._export:
|
|
23175
23229
|
case s._import: {
|
|
23176
|
-
const i =
|
|
23230
|
+
const i = be();
|
|
23177
23231
|
if (i === s.parenL || i === s.dot)
|
|
23178
23232
|
break;
|
|
23179
23233
|
S(), e === s._import ? Ka() : za();
|
|
@@ -23189,7 +23243,7 @@ function qf(t) {
|
|
|
23189
23243
|
a.restoreFromSnapshot(o);
|
|
23190
23244
|
} else if (a.contextualKeyword === d._using && !Ho() && // Statements like `using[0]` and `using in foo` aren't actual using
|
|
23191
23245
|
// declarations.
|
|
23192
|
-
|
|
23246
|
+
be() === s.name) {
|
|
23193
23247
|
En(!0);
|
|
23194
23248
|
return;
|
|
23195
23249
|
} else if ($a()) {
|
|
@@ -23205,7 +23259,7 @@ function qf(t) {
|
|
|
23205
23259
|
i.type === s.name && (r = i.contextualKeyword);
|
|
23206
23260
|
}
|
|
23207
23261
|
if (r == null) {
|
|
23208
|
-
|
|
23262
|
+
ye();
|
|
23209
23263
|
return;
|
|
23210
23264
|
}
|
|
23211
23265
|
_(s.colon) ? od() : ad(r);
|
|
@@ -23214,7 +23268,7 @@ function $a() {
|
|
|
23214
23268
|
if (!q(d._await))
|
|
23215
23269
|
return !1;
|
|
23216
23270
|
const t = a.snapshot();
|
|
23217
|
-
return S(), !q(d._using) ||
|
|
23271
|
+
return S(), !q(d._using) || Pe() || (S(), !l(s.name) || Pe()) ? (a.restoreFromSnapshot(t), !1) : (a.restoreFromSnapshot(t), !0);
|
|
23218
23272
|
}
|
|
23219
23273
|
function ci() {
|
|
23220
23274
|
for (; l(s.at); )
|
|
@@ -23236,10 +23290,10 @@ function Wa() {
|
|
|
23236
23290
|
_(s.parenL) && pt();
|
|
23237
23291
|
}
|
|
23238
23292
|
function Hf() {
|
|
23239
|
-
S(), Je() || (Q(),
|
|
23293
|
+
S(), Je() || (Q(), ye());
|
|
23240
23294
|
}
|
|
23241
23295
|
function Gf() {
|
|
23242
|
-
S(),
|
|
23296
|
+
S(), ye();
|
|
23243
23297
|
}
|
|
23244
23298
|
function Xf() {
|
|
23245
23299
|
S(), Be(!1), T(s._while), Kn(), _(s.semi);
|
|
@@ -23284,7 +23338,7 @@ function Qf() {
|
|
|
23284
23338
|
S(), Kn(), Be(!1), _(s._else) && Be(!1);
|
|
23285
23339
|
}
|
|
23286
23340
|
function Jf() {
|
|
23287
|
-
S(), Je() || (xe(),
|
|
23341
|
+
S(), Je() || (xe(), ye());
|
|
23288
23342
|
}
|
|
23289
23343
|
function ed() {
|
|
23290
23344
|
S(), Kn(), a.scopeDepth++;
|
|
@@ -23300,7 +23354,7 @@ function ed() {
|
|
|
23300
23354
|
a.scopes.push(new nt(t, e, !1)), a.scopeDepth--;
|
|
23301
23355
|
}
|
|
23302
23356
|
function td() {
|
|
23303
|
-
S(), xe(),
|
|
23357
|
+
S(), xe(), ye();
|
|
23304
23358
|
}
|
|
23305
23359
|
function nd() {
|
|
23306
23360
|
Xn(
|
|
@@ -23320,7 +23374,7 @@ function rd() {
|
|
|
23320
23374
|
_(s._finally) && gt();
|
|
23321
23375
|
}
|
|
23322
23376
|
function En(t) {
|
|
23323
|
-
S(), Ha(!1, t),
|
|
23377
|
+
S(), Ha(!1, t), ye();
|
|
23324
23378
|
}
|
|
23325
23379
|
function sd() {
|
|
23326
23380
|
S(), Kn(), Be(!1);
|
|
@@ -23332,7 +23386,7 @@ function od() {
|
|
|
23332
23386
|
Be(!0);
|
|
23333
23387
|
}
|
|
23334
23388
|
function ad(t) {
|
|
23335
|
-
le ? ah(t) : he ? vf(t) :
|
|
23389
|
+
le ? ah(t) : he ? vf(t) : ye();
|
|
23336
23390
|
}
|
|
23337
23391
|
function gt(t = !1, e = 0) {
|
|
23338
23392
|
const n = a.tokens.length;
|
|
@@ -23361,19 +23415,19 @@ function Ha(t, e) {
|
|
|
23361
23415
|
}
|
|
23362
23416
|
}
|
|
23363
23417
|
function cd(t) {
|
|
23364
|
-
Xn(t), le ? fh() : he &&
|
|
23418
|
+
Xn(t), le ? fh() : he && Ff();
|
|
23365
23419
|
}
|
|
23366
23420
|
function It(t, e, n = !1) {
|
|
23367
23421
|
l(s.star) && S(), e && !n && !l(s.name) && !l(s._yield) && ne();
|
|
23368
23422
|
let r = null;
|
|
23369
|
-
l(s.name) && (e || (r = a.tokens.length, a.scopeDepth++),
|
|
23423
|
+
l(s.name) && (e || (r = a.tokens.length, a.scopeDepth++), yt(!1));
|
|
23370
23424
|
const i = a.tokens.length;
|
|
23371
23425
|
a.scopeDepth++, $t(), Da(t);
|
|
23372
23426
|
const o = a.tokens.length;
|
|
23373
23427
|
a.scopes.push(new nt(i, o, !0)), a.scopeDepth--, r !== null && (a.scopes.push(new nt(r, o, !0)), a.scopeDepth--);
|
|
23374
23428
|
}
|
|
23375
23429
|
function $t(t = !1, e = 0) {
|
|
23376
|
-
le ? hh() : he &&
|
|
23430
|
+
le ? hh() : he && Pf(), T(s.parenL), e && (a.tokens[a.tokens.length - 1].contextId = e), $s(
|
|
23377
23431
|
s.parenR,
|
|
23378
23432
|
!1,
|
|
23379
23433
|
!1,
|
|
@@ -23475,14 +23529,14 @@ function no() {
|
|
|
23475
23529
|
}
|
|
23476
23530
|
}
|
|
23477
23531
|
function Tn() {
|
|
23478
|
-
if (le ? (Ko(s.bang), Vt()) : he && l(s.colon) &&
|
|
23532
|
+
if (le ? (Ko(s.bang), Vt()) : he && l(s.colon) && Pt(), l(s.eq)) {
|
|
23479
23533
|
const t = a.tokens.length;
|
|
23480
23534
|
S(), Ae(), a.tokens[t].rhsEndIndex = a.tokens.length;
|
|
23481
23535
|
}
|
|
23482
|
-
|
|
23536
|
+
ye();
|
|
23483
23537
|
}
|
|
23484
23538
|
function fd(t, e = !1) {
|
|
23485
|
-
le && (!t || e) && q(d._implements) || (l(s.name) &&
|
|
23539
|
+
le && (!t || e) && q(d._implements) || (l(s.name) && yt(!0), le ? Lt() : he && l(s.lessThan) && Ye());
|
|
23486
23540
|
}
|
|
23487
23541
|
function dd() {
|
|
23488
23542
|
let t = !1;
|
|
@@ -23490,13 +23544,13 @@ function dd() {
|
|
|
23490
23544
|
}
|
|
23491
23545
|
function za() {
|
|
23492
23546
|
const t = a.tokens.length - 1;
|
|
23493
|
-
le && th() || (
|
|
23547
|
+
le && th() || (yd() ? bd() : gd() ? (Q(), l(s.comma) && be() === s.star ? (T(s.comma), T(s.star), ve(d._as), Q()) : Ya(), on()) : _(s._default) ? md() : kd() ? pd() : (ui(), on()), a.tokens[t].rhsEndIndex = a.tokens.length);
|
|
23494
23548
|
}
|
|
23495
23549
|
function md() {
|
|
23496
23550
|
if (le && sh() || he && kf())
|
|
23497
23551
|
return;
|
|
23498
23552
|
const t = a.start;
|
|
23499
|
-
_(s._function) ? It(t, !0, !0) : q(d._async) &&
|
|
23553
|
+
_(s._function) ? It(t, !0, !0) : q(d._async) && be() === s._function ? (Ee(d._async), _(s._function), It(t, !0, !0)) : l(s._class) ? Rt(!0, !0) : l(s.at) ? (ci(), Rt(!0, !0)) : (Ae(), ye());
|
|
23500
23554
|
}
|
|
23501
23555
|
function pd() {
|
|
23502
23556
|
le ? ch() : he ? Tf() : Be(!0);
|
|
@@ -23523,12 +23577,12 @@ function Ya() {
|
|
|
23523
23577
|
_(s.comma) && ui();
|
|
23524
23578
|
}
|
|
23525
23579
|
function on() {
|
|
23526
|
-
Ee(d._from) && (at(), Za()),
|
|
23580
|
+
Ee(d._from) && (at(), Za()), ye();
|
|
23527
23581
|
}
|
|
23528
|
-
function
|
|
23582
|
+
function yd() {
|
|
23529
23583
|
return he ? Sf() : l(s.star);
|
|
23530
23584
|
}
|
|
23531
|
-
function
|
|
23585
|
+
function bd() {
|
|
23532
23586
|
he ? xf() : Ts();
|
|
23533
23587
|
}
|
|
23534
23588
|
function Ts() {
|
|
@@ -23565,20 +23619,20 @@ function Ed() {
|
|
|
23565
23619
|
q(d._module) && wd() && S();
|
|
23566
23620
|
}
|
|
23567
23621
|
function Ka() {
|
|
23568
|
-
if (le && l(s.name) &&
|
|
23569
|
-
|
|
23622
|
+
if (le && l(s.name) && be() === s.eq) {
|
|
23623
|
+
bs();
|
|
23570
23624
|
return;
|
|
23571
23625
|
}
|
|
23572
23626
|
if (le && q(d._type)) {
|
|
23573
23627
|
const t = ln();
|
|
23574
23628
|
if (t.type === s.name && t.contextualKeyword !== d._from) {
|
|
23575
|
-
if (ve(d._type),
|
|
23576
|
-
|
|
23629
|
+
if (ve(d._type), be() === s.eq) {
|
|
23630
|
+
bs();
|
|
23577
23631
|
return;
|
|
23578
23632
|
}
|
|
23579
23633
|
} else (t.type === s.star || t.type === s.braceL) && ve(d._type);
|
|
23580
23634
|
}
|
|
23581
|
-
l(s.string) || (Ed(), Sd(), ve(d._from)), at(), Za(),
|
|
23635
|
+
l(s.string) || (Ed(), Sd(), ve(d._from)), at(), Za(), ye();
|
|
23582
23636
|
}
|
|
23583
23637
|
function Td() {
|
|
23584
23638
|
return l(s.name);
|
|
@@ -23617,7 +23671,7 @@ function xd() {
|
|
|
23617
23671
|
Dn(), q(d._as) && (a.tokens[a.tokens.length - 1].identifierRole = X.ImportAccess, S(), Dn());
|
|
23618
23672
|
}
|
|
23619
23673
|
function Za() {
|
|
23620
|
-
(l(s._with) || q(d._assert) && !
|
|
23674
|
+
(l(s._with) || q(d._assert) && !Pe()) && (S(), Js(!1, !1));
|
|
23621
23675
|
}
|
|
23622
23676
|
function Ad() {
|
|
23623
23677
|
return a.pos === 0 && C.charCodeAt(0) === p.numberSign && C.charCodeAt(1) === p.exclamationMark && ea(2), Jo(), $f();
|
|
@@ -23854,7 +23908,7 @@ class Yt {
|
|
|
23854
23908
|
}
|
|
23855
23909
|
}
|
|
23856
23910
|
function Ld(t, e, n, r) {
|
|
23857
|
-
const i = e.snapshot(), o =
|
|
23911
|
+
const i = e.snapshot(), o = Pd(e);
|
|
23858
23912
|
let c = [];
|
|
23859
23913
|
const u = [], h = [];
|
|
23860
23914
|
let f = null;
|
|
@@ -23886,7 +23940,7 @@ function Ld(t, e, n, r) {
|
|
|
23886
23940
|
continue;
|
|
23887
23941
|
}
|
|
23888
23942
|
const K = e.currentIndex();
|
|
23889
|
-
if (
|
|
23943
|
+
if (Fd(e), e.matches1(s.lessThan) || e.matches1(s.parenL)) {
|
|
23890
23944
|
os(e, v);
|
|
23891
23945
|
continue;
|
|
23892
23946
|
}
|
|
@@ -23931,7 +23985,7 @@ function os(t, e) {
|
|
|
23931
23985
|
for (; Vn(t.tokenAtRelativeIndex(-1)); )
|
|
23932
23986
|
t.previousToken();
|
|
23933
23987
|
}
|
|
23934
|
-
function
|
|
23988
|
+
function Pd(t) {
|
|
23935
23989
|
const e = t.currentToken(), n = e.contextId;
|
|
23936
23990
|
if (n == null)
|
|
23937
23991
|
throw new Error("Expected context ID on class token.");
|
|
@@ -23998,7 +24052,7 @@ function Vn(t) {
|
|
|
23998
24052
|
s.hash
|
|
23999
24053
|
].includes(t.type);
|
|
24000
24054
|
}
|
|
24001
|
-
function
|
|
24055
|
+
function Fd(t) {
|
|
24002
24056
|
if (t.matches1(s.bracketL)) {
|
|
24003
24057
|
const n = t.currentToken().contextId;
|
|
24004
24058
|
if (n == null)
|
|
@@ -25556,7 +25610,7 @@ function zd(t, e) {
|
|
|
25556
25610
|
}
|
|
25557
25611
|
}
|
|
25558
25612
|
function Yd(t, e) {
|
|
25559
|
-
const n = e.transforms.includes("jsx"), r = e.transforms.includes("typescript"), i = e.transforms.includes("flow"), o = e.disableESTransforms === !0, c = Rd(t, n, r, i), u = c.tokens, h = c.scopes, f = new Vs(t, u), m = new
|
|
25613
|
+
const n = e.transforms.includes("jsx"), r = e.transforms.includes("typescript"), i = e.transforms.includes("flow"), o = e.disableESTransforms === !0, c = Rd(t, n, r, i), u = c.tokens, h = c.scopes, f = new Vs(t, u), m = new Fn(f), g = new Yt(
|
|
25560
25614
|
t,
|
|
25561
25615
|
u,
|
|
25562
25616
|
i,
|
|
@@ -25607,7 +25661,7 @@ self.addEventListener("unhandledrejection", (t) => {
|
|
|
25607
25661
|
...n !== void 0 && { stack: n }
|
|
25608
25662
|
}), t.preventDefault();
|
|
25609
25663
|
});
|
|
25610
|
-
const $e = new
|
|
25664
|
+
const $e = new Pn(), Ve = new q1((t) => self.postMessage(t));
|
|
25611
25665
|
an.current = Ve;
|
|
25612
25666
|
$e.setSceneErrorReporter(Ve);
|
|
25613
25667
|
let oo = null;
|
|
@@ -25699,4 +25753,4 @@ throw new Error("Scene code must define a render function");`, c = Object.getPro
|
|
|
25699
25753
|
}
|
|
25700
25754
|
}
|
|
25701
25755
|
self.setSceneCode = Kd;
|
|
25702
|
-
//# sourceMappingURL=viji.worker-
|
|
25756
|
+
//# sourceMappingURL=viji.worker-CtPXL0fz.js.map
|