@richard.fadiora/liveness-detection 2.0.2 → 2.1.0
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/README.md +5 -3
- package/dist/index.es.js +1707 -1700
- package/dist/index.umd.js +11 -11
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(st,Q){typeof exports=="object"&&typeof module<"u"?Q(exports,require("react"),require("react-webcam")):typeof define=="function"&&define.amd?define(["exports","react","react-webcam"],Q):(st=typeof globalThis<"u"?globalThis:st||self,Q(st.LivenessSDK={},st.React,st.Webcam))})(this,function(st,Q,D2){"use strict";var In={exports:{}},vr={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var gi;function B2(){if(gi)return
|
|
9
|
+
*/var gi;function B2(){if(gi)return vr;gi=1;var e=Q,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,d){var l,f={},m=null,A=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(A=u.ref);for(l in u)n.call(u,l)&&!i.hasOwnProperty(l)&&(f[l]=u[l]);if(c&&c.defaultProps)for(l in u=c.defaultProps,u)f[l]===void 0&&(f[l]=u[l]);return{$$typeof:t,type:c,key:m,ref:A,props:f,_owner:s.current}}return vr.Fragment=r,vr.jsx=o,vr.jsxs=o,vr}var _r={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,31 +14,31 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var mi;function U2(){return mi||(mi=1,process.env.NODE_ENV!=="production"&&function(){var e=
|
|
18
|
-
`+
|
|
17
|
+
*/var mi;function U2(){return mi||(mi=1,process.env.NODE_ENV!=="production"&&function(){var e=Q,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),j=Symbol.iterator,ht="@@iterator";function et(a){if(a===null||typeof a!="object")return null;var h=j&&a[j]||a[ht];return typeof h=="function"?h:null}var fe=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function K(a){{for(var h=arguments.length,p=new Array(h>1?h-1:0),E=1;E<h;E++)p[E-1]=arguments[E];tt("error",a,p)}}function tt(a,h,p){{var E=fe.ReactDebugCurrentFrame,O=E.getStackAddendum();O!==""&&(h+="%s",p=p.concat([O]));var C=p.map(function(T){return String(T)});C.unshift("Warning: "+h),Function.prototype.apply.call(console[a],console,C)}}var xn=!1,ft=!1,Ur=!1,Ln=!1,ai=!1,Pn;Pn=Symbol.for("react.module.reference");function ci(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===i||ai||a===s||a===d||a===l||Ln||a===A||xn||ft||Ur||typeof a=="object"&&a!==null&&(a.$$typeof===m||a.$$typeof===f||a.$$typeof===o||a.$$typeof===c||a.$$typeof===u||a.$$typeof===Pn||a.getModuleId!==void 0))}function Vr(a,h,p){var E=a.displayName;if(E)return E;var O=h.displayName||h.name||"";return O!==""?p+"("+O+")":p}function On(a){return a.displayName||"Context"}function rt(a){if(a==null)return null;if(typeof a.tag=="number"&&K("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case n:return"Fragment";case r:return"Portal";case i:return"Profiler";case s:return"StrictMode";case d:return"Suspense";case l:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var h=a;return On(h)+".Consumer";case o:var p=a;return On(p._context)+".Provider";case u:return Vr(a,a.render,"ForwardRef");case f:var E=a.displayName||null;return E!==null?E:rt(a.type)||"Memo";case m:{var O=a,C=O._payload,T=O._init;try{return rt(T(C))}catch{return null}}}return null}var nt=Object.assign,H=0,Y,U,ge,We,M,X,He;function wt(){}wt.__reactDisabledLog=!0;function Bt(){{if(H===0){Y=console.log,U=console.info,ge=console.warn,We=console.error,M=console.group,X=console.groupCollapsed,He=console.groupEnd;var a={configurable:!0,enumerable:!0,value:wt,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}H++}}function Rn(){{if(H--,H===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:nt({},a,{value:Y}),info:nt({},a,{value:U}),warn:nt({},a,{value:ge}),error:nt({},a,{value:We}),group:nt({},a,{value:M}),groupCollapsed:nt({},a,{value:X}),groupEnd:nt({},a,{value:He})})}H<0&&K("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Gr=fe.ReactCurrentDispatcher,Et;function At(a,h,p){{if(Et===void 0)try{throw Error()}catch(O){var E=O.stack.trim().match(/\n( *(at )?)/);Et=E&&E[1]||""}return`
|
|
18
|
+
`+Et+a}}var ui=!1,Fn;{var Cc=typeof WeakMap=="function"?WeakMap:Map;Fn=new Cc}function A2(a,h){if(!a||ui)return"";{var p=Fn.get(a);if(p!==void 0)return p}var E;ui=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=Gr.current,Gr.current=null,Bt();try{if(h){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(be){E=be}Reflect.construct(a,[],T)}else{try{T.call()}catch(be){E=be}a.call(T.prototype)}}else{try{throw Error()}catch(be){E=be}a()}}catch(be){if(be&&E&&typeof be.stack=="string"){for(var k=be.stack.split(`
|
|
19
19
|
`),me=E.stack.split(`
|
|
20
|
-
`)
|
|
21
|
-
`+k[
|
|
20
|
+
`),Z=k.length-1,ne=me.length-1;Z>=1&&ne>=0&&k[Z]!==me[ne];)ne--;for(;Z>=1&&ne>=0;Z--,ne--)if(k[Z]!==me[ne]){if(Z!==1||ne!==1)do if(Z--,ne--,ne<0||k[Z]!==me[ne]){var De=`
|
|
21
|
+
`+k[Z].replace(" at new "," at ");return a.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",a.displayName)),typeof a=="function"&&Fn.set(a,De),De}while(Z>=1&&ne>=0);break}}}finally{ui=!1,Gr.current=C,Rn(),Error.prepareStackTrace=O}var yr=a?a.displayName||a.name:"",Ut=yr?At(yr):"";return typeof a=="function"&&Fn.set(a,Ut),Ut}function Ic(a,h,p){return A2(a,!1)}function jc(a){var h=a.prototype;return!!(h&&h.isReactComponent)}function Mn(a,h,p){if(a==null)return"";if(typeof a=="function")return A2(a,jc(a));if(typeof a=="string")return At(a);switch(a){case d:return At("Suspense");case l:return At("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case u:return Ic(a.render);case f:return Mn(a.type,h,p);case m:{var E=a,O=E._payload,C=E._init;try{return Mn(C(O),h,p)}catch{}}}return""}var Wr=Object.prototype.hasOwnProperty,k2={},S2=fe.ReactDebugCurrentFrame;function Cn(a){if(a){var h=a._owner,p=Mn(a.type,a._source,h?h.type:null);S2.setExtraStackFrame(p)}else S2.setExtraStackFrame(null)}function Nc(a,h,p,E,O){{var C=Function.call.bind(Wr);for(var T in a)if(C(a,T)){var k=void 0;try{if(typeof a[T]!="function"){var me=Error((E||"React class")+": "+p+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw me.name="Invariant Violation",me}k=a[T](h,T,E,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){k=Z}k&&!(k instanceof Error)&&(Cn(O),K("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",p,T,typeof k),Cn(null)),k instanceof Error&&!(k.message in k2)&&(k2[k.message]=!0,Cn(O),K("Failed %s type: %s",p,k.message),Cn(null))}}}var Dc=Array.isArray;function li(a){return Dc(a)}function Bc(a){{var h=typeof Symbol=="function"&&Symbol.toStringTag,p=h&&a[Symbol.toStringTag]||a.constructor.name||"Object";return p}}function Uc(a){try{return T2(a),!1}catch{return!0}}function T2(a){return""+a}function x2(a){if(Uc(a))return K("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Bc(a)),T2(a)}var L2=fe.ReactCurrentOwner,Vc={key:!0,ref:!0,__self:!0,__source:!0},P2,O2;function Gc(a){if(Wr.call(a,"ref")){var h=Object.getOwnPropertyDescriptor(a,"ref").get;if(h&&h.isReactWarning)return!1}return a.ref!==void 0}function Wc(a){if(Wr.call(a,"key")){var h=Object.getOwnPropertyDescriptor(a,"key").get;if(h&&h.isReactWarning)return!1}return a.key!==void 0}function Hc(a,h){typeof a.ref=="string"&&L2.current}function zc(a,h){{var p=function(){P2||(P2=!0,K("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};p.isReactWarning=!0,Object.defineProperty(a,"key",{get:p,configurable:!0})}}function Kc(a,h){{var p=function(){O2||(O2=!0,K("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};p.isReactWarning=!0,Object.defineProperty(a,"ref",{get:p,configurable:!0})}}var Yc=function(a,h,p,E,O,C,T){var k={$$typeof:t,type:a,key:h,ref:p,props:T,_owner:C};return k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(k,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(k,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k};function Xc(a,h,p,E,O){{var C,T={},k=null,me=null;p!==void 0&&(x2(p),k=""+p),Wc(h)&&(x2(h.key),k=""+h.key),Gc(h)&&(me=h.ref,Hc(h,O));for(C in h)Wr.call(h,C)&&!Vc.hasOwnProperty(C)&&(T[C]=h[C]);if(a&&a.defaultProps){var Z=a.defaultProps;for(C in Z)T[C]===void 0&&(T[C]=Z[C])}if(k||me){var ne=typeof a=="function"?a.displayName||a.name||"Unknown":a;k&&zc(T,ne),me&&Kc(T,ne)}return Yc(a,k,me,O,E,L2.current,T)}}var hi=fe.ReactCurrentOwner,R2=fe.ReactDebugCurrentFrame;function mr(a){if(a){var h=a._owner,p=Mn(a.type,a._source,h?h.type:null);R2.setExtraStackFrame(p)}else R2.setExtraStackFrame(null)}var fi;fi=!1;function di(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function F2(){{if(hi.current){var a=rt(hi.current.type);if(a)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+a+"`."}return""}}function qc(a){return""}var M2={};function Jc(a){{var h=
|
|
23
|
+
Check the render method of \``+a+"`."}return""}}function qc(a){return""}var M2={};function Jc(a){{var h=F2();if(!h){var p=typeof a=="string"?a:a.displayName||a.name;p&&(h=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+p+">.")}return h}}function C2(a,h){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var p=Jc(h);if(M2[p])return;M2[p]=!0;var E="";a&&a._owner&&a._owner!==hi.current&&(E=" It was passed a child from "+
|
|
25
|
+
Check the top-level render call using <`+p+">.")}return h}}function C2(a,h){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var p=Jc(h);if(M2[p])return;M2[p]=!0;var E="";a&&a._owner&&a._owner!==hi.current&&(E=" It was passed a child from "+rt(a._owner.type)+"."),mr(a),K('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,E),mr(null)}}function I2(a,h){{if(typeof a!="object")return;if(li(a))for(var p=0;p<a.length;p++){var E=a[p];di(E)&&C2(E,h)}else if(di(a))a._store&&(a._store.validated=!0);else if(a){var O=et(a);if(typeof O=="function"&&O!==a.entries)for(var C=O.call(a),T;!(T=C.next()).done;)di(T.value)&&C2(T.value,h)}}}function $c(a){{var h=a.type;if(h==null||typeof h=="string")return;var p;if(typeof h=="function")p=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===u||h.$$typeof===f))p=h.propTypes;else return;if(p){var E=rt(h);Nc(p,a.props,"prop",E,a)}else if(h.PropTypes!==void 0&&!fi){fi=!0;var O=rt(h);K("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&K("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Zc(a){{for(var h=Object.keys(a.props),p=0;p<h.length;p++){var E=h[p];if(E!=="children"&&E!=="key"){mr(a),K("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),mr(null);break}}a.ref!==null&&(mr(a),K("Invalid attribute `ref` supplied to `React.Fragment`."),mr(null))}}var j2={};function N2(a,h,p,E,O,C){{var T=ci(a);if(!T){var k="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var me=qc();me?k+=me:k+=F2();var Z;a===null?Z="null":li(a)?Z="array":a!==void 0&&a.$$typeof===t?(Z="<"+(rt(a.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof a,K("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,k)}var ne=Xc(a,h,p,O,C);if(ne==null)return ne;if(T){var De=h.children;if(De!==void 0)if(E)if(li(De)){for(var yr=0;yr<De.length;yr++)I2(De[yr],a);Object.freeze&&Object.freeze(De)}else K("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else I2(De,a)}if(Wr.call(h,"key")){var Ut=rt(a),be=Object.keys(h).filter(function(su){return su!=="key"}),pi=be.length>0?"{key: someKey, "+be.join(": ..., ")+": ...}":"{key: someKey}";if(!j2[Ut+pi]){var nu=be.length>0?"{"+be.join(": ..., ")+": ...}":"{}";K(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,pi,Bt,nu,Bt),j2[Bt+pi]=!0}}return a===n?Zc(re):$c(re),re}}function Qc(a,h,p){return N2(a,h,p,!0)}function eu(a,h,p){return N2(a,h,p,!1)}var tu=eu,ru=Qc;vr.Fragment=n,vr.jsx=tu,vr.jsxs=ru}()),vr}process.env.NODE_ENV==="production"?Mn.exports=B2():Mn.exports=U2();var R=Mn.exports,Ut=typeof self<"u"?self:{};function _r(e,t){e:{for(var r=["CLOSURE_FLAGS"],n=Ut,s=0;s<r.length;s++)if((n=n[r[s]])==null){r=null;break e}r=n}return(e=r&&r[e])!=null?e:t}function wt(){throw Error("Invalid UTF8")}function yi(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Gr,Cn;const V2=typeof TextDecoder<"u";let G2;const W2=typeof TextEncoder<"u";function vi(e){if(W2)e=(G2||(G2=new TextEncoder)).encode(e);else{let r=0;const n=new Uint8Array(3*e.length);for(let s=0;s<e.length;s++){var t=e.charCodeAt(s);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&s<e.length){const i=e.charCodeAt(++s);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}s--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}function _i(e){Ut.setTimeout(()=>{throw e},0)}var In,H2=_r(610401301,!1),bi=_r(748402147,!0),jn=_r(824648567,!0),Nn=_r(824656860,_r(1,!0));function wi(){var e=Ut.navigator;return e&&(e=e.userAgent)?e:""}const Ei=Ut.navigator;function Wr(e){return Wr[" "](e),e}In=Ei&&Ei.userAgentData||null,Wr[" "]=function(){};const Ai={};let br=null;function z2(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const n=new Uint8Array(r);let s=0;return function(i,o){function c(d){for(;u<i.length;){const l=i.charAt(u++),f=br[l];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l)}return d}ki();let u=0;for(;;){const d=c(-1),l=c(0),f=c(64),b=c(64);if(b===64&&d===-1)break;o(d<<2|l>>4),f!=64&&(o(l<<4&240|f>>2),b!=64&&o(f<<6&192|b))}}(e,function(i){n[s++]=i}),s!==r?n.subarray(0,s):n}function ki(){if(!br){br={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const n=e.concat(t[r].split(""));Ai[r]=n;for(let s=0;s<n.length;s++){const i=n[s];br[i]===void 0&&(br[i]=s)}}}}var K2=typeof Uint8Array<"u",Si=!(!(H2&&In&&In.brands.length>0)&&(wi().indexOf("Trident")!=-1||wi().indexOf("MSIE")!=-1))&&typeof btoa=="function";const Ti=/[-_.]/g,Y2={"-":"+",_:"/",".":"="};function X2(e){return Y2[e]||""}function xi(e){if(!Si)return z2(e);e=Ti.test(e)?e.replace(Ti,X2):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Dn(e){return K2&&e!=null&&e instanceof Uint8Array}var Vt={};function Et(){return q2||(q2=new Ye(null,Vt))}function Bn(e){Li(Vt);var t=e.g;return(t=t==null||Dn(t)?t:typeof t=="string"?xi(t):null)==null?t:e.g=t}var Ye=class{h(){return new Uint8Array(Bn(this)||0)}constructor(e,t){if(Li(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let q2,J2;function Li(e){if(e!==Vt)throw Error("illegal external caller")}function Pi(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Un(e){return Pi(e=Error(e),"warning"),e}function Gt(e,t){if(e!=null){var r=J2??(J2={}),n=r[e]||0;n>=t||(r[e]=n+1,Pi(e=Error(),"incident"),_i(e))}}function Wt(){return typeof BigInt=="function"}var Ht=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Xe(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var $2=Xe("jas",void 0,!0),Oi=Xe(void 0,"0di"),wr=Xe(void 0,"1oa"),we=Xe(void 0,Symbol()),Z2=Xe(void 0,"0ub"),Q2=Xe(void 0,"0ubs"),Vn=Xe(void 0,"0ubsb"),e1=Xe(void 0,"0actk"),zt=Xe("m_m","Pa",!0),Fi=Xe();const Ri={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Mi=Object.defineProperties,m=Ht?$2:"Ga";var At;const Ci=[];function Er(e,t){Ht||m in e||Mi(e,Ri),e[m]|=t}function ne(e,t){Ht||m in e||Mi(e,Ri),e[m]=t}function Ar(e){return Er(e,34),e}function kr(e){return Er(e,8192),e}ne(Ci,7),At=Object.freeze(Ci);var Kt={};function Ee(e,t){return t===void 0?e.h!==kt&&!!(2&(0|e.v[m])):!!(2&t)&&e.h!==kt}const kt={};function Gn(e,t){if(e!=null){if(typeof e=="string")e=e?new Ye(e,Vt):Et();else if(e.constructor!==Ye)if(Dn(e))e=e.length?new Ye(new Uint8Array(e),Vt):Et();else{if(!t)throw Error();e=void 0}}return e}class Ii{constructor(t,r,n){this.g=t,this.h=r,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var t1=Object.freeze({});function ji(e,t,r){const n=128&t?0:-1,s=e.length;var i;(i=!!s)&&(i=(i=e[s-1])!=null&&typeof i=="object"&&i.constructor===Object);const o=s+(i?-1:0);for(t=128&t?1:0;t<o;t++)r(t-n,e[t]);if(i){e=e[s-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var Ni={};function Yt(e){return 128&e?Ni:void 0}function Hr(e){return e.Na=!0,e}var r1=Hr(e=>typeof e=="number"),Di=Hr(e=>typeof e=="string"),n1=Hr(e=>typeof e=="boolean"),zr=typeof Ut.BigInt=="function"&&typeof Ut.BigInt(0)=="bigint";function Ae(e){var t=e;if(Di(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(r1(t)&&!Number.isSafeInteger(t))throw Error(String(t));return zr?BigInt(e):e=n1(e)?e?"1":"0":Di(e)?e.trim()||"0":String(e)}var Wn=Hr(e=>zr?e>=i1&&e<=a1:e[0]==="-"?Bi(e,s1):Bi(e,o1));const s1=Number.MIN_SAFE_INTEGER.toString(),i1=zr?BigInt(Number.MIN_SAFE_INTEGER):void 0,o1=Number.MAX_SAFE_INTEGER.toString(),a1=zr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Bi(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const n=e[r],s=t[r];if(n>s)return!1;if(n<s)return!0}}const c1=typeof Uint8Array.prototype.slice=="function";let u1,W=0,Q=0;function Ui(e){const t=e>>>0;W=t,Q=(e-t)/4294967296>>>0}function Xt(e){if(e<0){Ui(-e);const[t,r]=Xn(W,Q);W=t>>>0,Q=r>>>0}else Ui(e)}function Hn(e){const t=u1||(u1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),Q=0,W=t.getUint32(0,!0)}function zn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Sr(e,t)}function l1(e,t){return Ae(Wt()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Sr(e,t))}function Kn(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=zn(e,t))=="number"?r?-e:e:r?"-"+e:e}function Vi(e,t){return Wt()?Ae(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):Ae(Yn(e,t))}function Sr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else Wt()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Gi(r)+Gi(e));return r}function Gi(e){return e=String(e),"0000000".slice(e.length)+e}function Yn(e,t){if(2147483648&t)if(Wt())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,n]=Xn(e,t);e="-"+Sr(r,n)}else e=Sr(e,t);return e}function Kr(e){if(e.length<16)Xt(Number(e));else if(Wt())e=BigInt(e),W=Number(e&BigInt(4294967295))>>>0,Q=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");Q=W=0;const r=e.length;for(let n=t,s=(r-t)%6+t;s<=r;n=s,s+=6){const i=Number(e.slice(n,s));Q*=1e6,W=1e6*W+i,W>=4294967296&&(Q+=Math.trunc(W/4294967296),Q>>>=0,W>>>=0)}if(t){const[n,s]=Xn(W,Q);W=n,Q=s}}}function Xn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ue(e){return Array.prototype.slice.call(e)}const Tr=typeof BigInt=="function"?BigInt.asIntN:void 0,h1=typeof BigInt=="function"?BigInt.asUintN:void 0,St=Number.isSafeInteger,Yr=Number.isFinite,qt=Math.trunc,f1=Ae(0);function xr(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function qe(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Lr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Wi(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const d1=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Pr(e){switch(typeof e){case"bigint":return!0;case"number":return Yr(e);case"string":return d1.test(e);default:return!1}}function Jt(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Yr(e)?0|e:void 0}function Hi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return Yr(e)?e>>>0:void 0}function zi(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Kr(e),Yn(W,Q))}function qn(e){return e=qt(e),St(e)||(Xt(e),e=Kn(W,Q)),e}function Ki(e){var t=qt(Number(e));return St(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),zi(e))}function Yi(e){var t=qt(Number(e));return St(t)?Ae(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Wt()?Ae(Tr(64,BigInt(e))):Ae(zi(e)))}function Xi(e){return St(e)?e=Ae(qn(e)):(e=qt(e),St(e)?e=String(e):(Xt(e),e=Yn(W,Q)),e=Ae(e)),e}function p1(e){return e==null?e:typeof e=="bigint"?(Wn(e)?e=Number(e):(e=Tr(64,e),e=Wn(e)?Number(e):String(e)),e):Pr(e)?typeof e=="number"?qn(e):Ki(e):void 0}function Xr(e){const t=typeof e;return e==null?e:t==="bigint"?Ae(Tr(64,e)):Pr(e)?t==="string"?Yi(e):Xi(e):void 0}function qi(e){if(typeof e!="string")throw Error();return e}function Or(e){if(e!=null&&typeof e!="string")throw Error();return e}function he(e){return e==null||typeof e=="string"?e:void 0}function Jn(e,t,r,n){return e!=null&&e[zt]===Kt?e:Array.isArray(e)?((n=(r=0|e[m])|32&n|2&n)!==r&&ne(e,n),new t(e)):(r?2&n?((e=t[Oi])||(Ar((e=new t).v),e=t[Oi]=e),t=e):t=new t:t=void 0,t)}function g1(e,t,r){if(t)e:{if(!Pr(t=e))throw Un("int64");switch(typeof t){case"string":t=Yi(t);break e;case"bigint":t=Ae(Tr(64,t));break e;default:t=Xi(t)}}else t=Xr(e);return(e=t)==null?r?f1:void 0:e}const m1={};let y1=function(){try{return Wr(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class $n{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),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,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const v1=y1?(Object.setPrototypeOf($n.prototype,Map.prototype),Object.defineProperties($n.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),$n):class extends Map{constructor(){super()}};function Ji(e){return e}function Zn(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var nt=class extends v1{constructor(e,t,r=Ji,n=Ji){super(),this.J=0|e[m],this.K=t,this.S=r,this.fa=this.K?_1:n;for(let s=0;s<e.length;s++){const i=e[s],o=r(i[0],!1,!0);let c=i[1];t?c===void 0&&(c=null):c=n(i[1],!1,!0,void 0,void 0,this.J),super.set(o,c)}}V(e){return kr(Array.from(super.entries(),e))}clear(){Zn(this),super.clear()}delete(e){return Zn(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new Ii(e,b1,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new Ii(e,nt.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,n,s)=>{e.call(t,s.get(n),n,s)}):super.forEach(e,t)}set(e,t){return Zn(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function _1(e,t,r,n,s,i){return e=Jn(e,n,r,i),s&&(e=ts(e)),e}function b1(e){return[e,this.get(e)]}let w1;function $i(){return w1||(w1=new nt(Ar([]),void 0,void 0,void 0,m1))}function qr(e){return we?e[we]:void 0}function Jr(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}nt.prototype.toJSON=void 0;var Qn=class{};const E1={Ka:!0};function A1(e,t){t<100||Gt(Q2,1)}function $r(e,t,r,n){const s=n!==void 0;n=!!n;var i,o=we;!s&&Ht&&o&&(i=e[o])&&Jr(i,A1),o=[];var c=e.length;let u;i=4294967295;let d=!1;const l=!!(64&t),f=l?128&t?0:-1:void 0;1&t||(u=c&&e[c-1],u!=null&&typeof u=="object"&&u.constructor===Object?i=--c:u=void 0,!l||128&t||s||(d=!0,i=i-f+f)),t=void 0;for(var b=0;b<c;b++){let A=e[b];if(A!=null&&(A=r(A,n))!=null)if(l&&b>=i){const I=b-f;(t??(t={}))[I]=A}else o[b]=A}if(u)for(let A in u){if((c=u[A])==null||(c=r(c,n))==null)continue;let I;b=+A,l&&!Number.isNaN(b)&&(I=b+f)<i?o[I]=c:(t??(t={}))[A]=c}return t&&(d?o.push(t):o[i]=t),s&&we&&(e=qr(e))&&e instanceof Qn&&(o[we]=function(A){const I=new Qn;return Jr(A,(jt,Re,pe)=>{I[Re]=Ue(pe)}),I.da=A.da,I}(e)),o}function k1(e){return e[0]=Fr(e[0]),e[1]=Fr(e[1]),e}function Fr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Wn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[m];return e.length===0&&1&t?void 0:$r(e,t,Fr)}if(e!=null&&e[zt]===Kt)return Zi(e);if(e instanceof Ye){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(Si){for(var r="",n=0,s=t.length-10240;n<s;)r+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?t.subarray(n):t),t=btoa(r)}else{r===void 0&&(r=0),ki(),r=Ai[r],n=Array(Math.floor(t.length/3)),s=r[64]||"";let d=0,l=0;for(;d<t.length-2;d+=3){var i=t[d],o=t[d+1],c=t[d+2],u=r[i>>2];i=r[(3&i)<<4|o>>4],o=r[(15&o)<<2|c>>6],c=r[63&c],n[l++]=u+i+o+c}switch(u=0,c=s,t.length-d){case 2:c=r[(15&(u=t[d+1]))<<2]||s;case 1:t=t[d],n[l]=r[t>>2]+r[(3&t)<<4|u>>4]+c+s}t=n.join("")}e=e.g=t}return e}return e instanceof nt?e=e.size!==0?e.V(k1):void 0:void 0}return e}function Zi(e){return $r(e=e.v,0|e[m],Fr)}let S1,T1;function Tt(e,t){return Qi(e,t[0],t[1])}function Qi(e,t,r,n=0){if(e==null){var s=32;r?(e=[r],s|=128):e=[],t&&(s=-16760833&s|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(s=0|e[m],bi&&1&s)throw Error("rfarr");if(2048&s&&!(2&s)&&function(){if(bi)throw Error("carr");Gt(e1,5)}(),256&s)throw Error("farr");if(64&s)return(s|n)!==s&&ne(e,s|n),e;if(r&&(s|=128,r!==e[0]))throw Error("mid");e:{s|=64;var i=(r=e).length;if(i){var o=i-1;const u=r[o];if(u!=null&&typeof u=="object"&&u.constructor===Object){if((o-=t=128&s?0:-1)>=1024)throw Error("pvtlmt");for(var c in u)(i=+c)<o&&(r[i+t]=u[c],delete u[c]);s=-16760833&s|(1023&o)<<14;break e}}if(t){if((c=Math.max(t,i-(128&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&c)<<14}}}return ne(e,64|s|n),e}function x1(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[m];return e.length===0&&1&r?void 0:eo(e,r,t)}if(e!=null&&e[zt]===Kt)return to(e);if(e instanceof nt){if(2&(t=e.J))return e;if(!e.size)return;if(r=Ar(e.V()),e.K)for(e=0;e<r.length;e++){const n=r[e];let s=n[1];s=s==null||typeof s!="object"?void 0:s!=null&&s[zt]===Kt?to(s):Array.isArray(s)?eo(s,0|s[m],!!(32&t)):void 0,n[1]=s}return r}return e instanceof Ye?e:void 0}function eo(e,t,r){return 2&t||(!r||4096&t||16&t?e=$t(e,t,!1,r&&!(16&t)):(Er(e,34),4&t&&Object.freeze(e))),e}function es(e,t,r){return e=new e.constructor(t),r&&(e.h=kt),e.m=kt,e}function to(e){const t=e.v,r=0|t[m];return Ee(e,r)?e:rs(e,t,r)?es(e,t):$t(t,r)}function $t(e,t,r,n){return n??(n=!!(34&t)),e=$r(e,t,x1,n),n=32,r&&(n|=2),ne(e,t=16769217&t|n),e}function ts(e){const t=e.v,r=0|t[m];return Ee(e,r)?rs(e,t,r)?es(e,t,!0):new e.constructor($t(t,r,!1)):e}function Zt(e){if(e.h!==kt)return!1;var t=e.v;return Er(t=$t(t,0|t[m]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function Qt(e){if(!Zt(e)&&Ee(e,0|e.v[m]))throw Error()}function xt(e,t){t===void 0&&(t=0|e[m]),32&t&&!(4096&t)&&ne(e,4096|t)}function rs(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(ne(t,2|r),e.h=kt,!0)}const L1=Ae(0),lt={};function B(e,t,r,n,s){if((t=st(e.v,t,r,s))!==null||n&&e.m!==kt)return t}function st(e,t,r,n){if(t===-1)return null;const s=t+(r?0:-1),i=e.length-1;let o,c;if(!(i<1+(r?0:-1))){if(s>=i)if(o=e[i],o!=null&&typeof o=="object"&&o.constructor===Object)r=o[t],c=!0;else{if(s!==i)return;r=o}else r=e[s];if(n&&r!=null){if((n=n(r))==null)return n;if(!Object.is(n,r))return c?o[t]=n:e[s]=n,n}return r}}function F(e,t,r,n){Qt(e),se(e=e.v,0|e[m],t,r,n)}function se(e,t,r,n,s){const i=r+(s?0:-1);var o=e.length-1;if(o>=1+(s?0:-1)&&i>=o){const c=e[o];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=n,t}return i<=o?(e[i]=n,t):(n!==void 0&&(r>=(o=(t??(t=0|e[m]))>>14&1023||536870912)?n!=null&&(e[o+(s?0:-1)]={[r]:n}):e[i]=n),t)}function Lt(){return t1===void 0?2:4}function Pt(e,t,r,n,s){let i=e.v,o=0|i[m];n=Ee(e,o)?1:n,s=!!s||n===3,n===2&&Zt(e)&&(i=e.v,o=0|i[m]);let c=(e=ns(i,t))===At?7:0|e[m],u=ss(c,o);var d=!(4&u);if(d){4&u&&(e=Ue(e),c=0,u=Ft(u,o),o=se(i,o,t,e));let l=0,f=0;for(;l<e.length;l++){const b=r(e[l]);b!=null&&(e[f++]=b)}f<l&&(e.length=f),r=-513&(4|u),u=r&=-1025,u&=-4097}return u!==c&&(ne(e,u),2&u&&Object.freeze(e)),ro(e,u,i,o,t,n,d,s)}function ro(e,t,r,n,s,i,o,c){let u=t;return i===1||i===4&&(2&t||!(16&t)&&32&n)?Ot(t)||((t|=!e.length||o&&!(4096&t)||32&n&&!(4096&t||16&t)?2:256)!==u&&ne(e,t),Object.freeze(e)):(i===2&&Ot(t)&&(e=Ue(e),u=0,t=Ft(t,n),n=se(r,n,s,e)),Ot(t)||(c||(t|=16),t!==u&&ne(e,t))),2&t||!(4096&t||16&t)||xt(r,n),e}function ns(e,t,r){return e=st(e,t,r),Array.isArray(e)?e:At}function ss(e,t){return 2&t&&(e|=2),1|e}function Ot(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function no(e){return Gn(e,!0)}function so(e){e=Ue(e);for(let t=0;t<e.length;t++){const r=e[t]=Ue(e[t]);Array.isArray(r[1])&&(r[1]=Ar(r[1]))}return kr(e)}function ht(e,t,r,n){Qt(e),se(e=e.v,0|e[m],t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function er(e,t,r){if(2&t)throw Error();const n=Yt(t);let s=ns(e,r,n),i=s===At?7:0|s[m],o=ss(i,t);return(2&o||Ot(o)||16&o)&&(o===i||Ot(o)||ne(s,o),s=Ue(s),i=0,o=Ft(o,t),se(e,t,r,s,n)),o&=-13,o!==i&&ne(s,o),s}function is(e,t){var r=ha;return as(os(e=e.v),e,void 0,r)===t?t:-1}function os(e){if(Ht)return e[wr]??(e[wr]=new Map);if(wr in e)return e[wr];const t=new Map;return Object.defineProperty(e,wr,{value:t}),t}function io(e,t,r,n,s){const i=os(e),o=as(i,e,t,r,s);return o!==n&&(o&&(t=se(e,t,o,void 0,s)),i.set(r,n)),t}function as(e,t,r,n,s){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){const c=n[o];st(t,c,s)!=null&&(i!==0&&(r=se(t,r,i,void 0,s)),i=c)}return e.set(n,i),i}function cs(e,t,r){let n=0|e[m];const s=Yt(n),i=st(e,r,s);let o;if(i!=null&&i[zt]===Kt){if(!Ee(i))return Zt(i),i.v;o=i.v}else Array.isArray(i)&&(o=i);if(o){const c=0|o[m];2&c&&(o=$t(o,c))}return o=Tt(o,t),o!==i&&se(e,n,r,o,s),o}function oo(e,t,r,n,s){let i=!1;if((n=st(e,n,s,o=>{const c=Jn(o,r,!1,t);return i=c!==o&&c!=null,c}))!=null)return i&&!Ee(n)&&xt(e,t),n}function L(e,t,r,n){let s=e.v,i=0|s[m];if((t=oo(s,i,t,r,n))==null)return t;if(i=0|s[m],!Ee(e,i)){const o=ts(t);o!==t&&(Zt(e)&&(s=e.v,i=0|s[m]),i=se(s,i,r,t=o,n),xt(s,i))}return t}function ao(e,t,r,n,s,i,o,c){var u=Ee(e,r);i=u?1:i,o=!!o||i===3,u=c&&!u,(i===2||u)&&Zt(e)&&(r=0|(t=e.v)[m]);var d=(e=ns(t,s))===At?7:0|e[m],l=ss(d,r);if(c=!(4&l)){var f=e,b=r;const A=!!(2&l);A&&(b|=2);let I=!A,jt=!0,Re=0,pe=0;for(;Re<f.length;Re++){const j=Jn(f[Re],n,!1,b);if(j instanceof n){if(!A){const Nt=Ee(j);I&&(I=!Nt),jt&&(jt=Nt)}f[pe++]=j}}pe<Re&&(f.length=pe),l|=4,l=jt?-4097&l:4096|l,l=I?8|l:-9&l}if(l!==d&&(ne(e,l),2&l&&Object.freeze(e)),u&&!(8&l||!e.length&&(i===1||i===4&&(2&l||!(16&l)&&32&r)))){for(Ot(l)&&(e=Ue(e),l=Ft(l,r),r=se(t,r,s,e)),n=e,u=l,d=0;d<n.length;d++)(f=n[d])!==(l=ts(f))&&(n[d]=l);u|=8,ne(e,l=u=n.length?4096|u:-4097&u)}return ro(e,l,t,r,s,i,c,o)}function it(e,t,r){const n=e.v;return ao(e,n,0|n[m],t,r,Lt(),!1,!0)}function co(e){return e==null&&(e=void 0),e}function w(e,t,r,n,s){return F(e,r,n=co(n),s),n&&!Ee(n)&&xt(e.v),e}function Rr(e,t,r,n){e:{var s=n=co(n);Qt(e);const i=e.v;let o=0|i[m];if(s==null){const c=os(i);if(as(c,i,o,r)!==t)break e;c.set(r,0)}else o=io(i,o,r,t);se(i,o,t,s)}n&&!Ee(n)&&xt(e.v)}function Ft(e,t){return-273&(2&t?2|e:-3&e)}function us(e,t,r,n){var s=n;Qt(e),e=ao(e,n=e.v,0|n[m],r,t,2,!0),s=s??new r,e.push(s),t=r=e===At?7:0|e[m],(s=Ee(s))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&ne(e,r),s||xt(n)}function Me(e,t,r){return Jt(B(e,t,void 0,r))}function uo(e){return(Nn?B(e,2,void 0,void 0,Xr):Xr(B(e,2)))??L1}function Y(e,t){return B(e,t,void 0,void 0,qe)??0}function ot(e,t,r){if(r!=null){if(typeof r!="number"||!Yr(r))throw Un("int32");r|=0}F(e,t,r)}function _(e,t,r){F(e,t,xr(r))}function ke(e,t,r){ht(e,t,Or(r),"")}function Zr(e,t,r){{Qt(e);const o=e.v;let c=0|o[m];if(r==null)se(o,c,t);else{var n=e=r===At?7:0|r[m],s=Ot(e),i=s||Object.isFrozen(r);for(s||(e=0),i||(r=Ue(r),n=0,e=Ft(e,c),i=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(Nn?1024:0),s=0;s<r.length;s++){const u=r[s],d=qi(u);Object.is(u,d)||(i&&(r=Ue(r),n=0,e=Ft(e,c),i=!1),r[s]=d)}e!==n&&(i&&(r=Ue(r),e=Ft(e,c)),ne(r,e)),se(o,c,t,r)}}}function Qr(e,t,r){Qt(e),Pt(e,t,he,2,!0).push(qi(r))}var tr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function ls(e,t){if(typeof e=="string")return new tr(xi(e),t);if(Array.isArray(e))return new tr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new tr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new tr(e,!1);if(e.constructor===Ye)return t=Bn(e)||new Uint8Array(0),new tr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new tr(e,!1);throw Error()}function rr(e,t){let r,n=0,s=0,i=0;const o=e.h;let c=e.g;do r=o[c++],n|=(127&r)<<i,i+=7;while(i<32&&128&r);if(i>32)for(s|=(127&r)>>4,i=3;i<32&&128&r;i+=7)r=o[c++],s|=(127&r)<<i;if(Rt(e,c),!(128&r))return t(n>>>0,s>>>0);throw Error()}function hs(e){let t=0,r=e.g;const n=r+10,s=e.h;for(;r<n;){const i=s[r++];if(t|=i,(128&i)==0)return Rt(e,r),!!(127&t)}throw Error()}function ft(e){const t=e.h;let r=e.g,n=t[r++],s=127&n;if(128&n&&(n=t[r++],s|=(127&n)<<7,128&n&&(n=t[r++],s|=(127&n)<<14,128&n&&(n=t[r++],s|=(127&n)<<21,128&n&&(n=t[r++],s|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return Rt(e,r),s}function at(e){return ft(e)>>>0}function en(e){var t=e.h;const r=e.g;var n=t[r],s=t[r+1];const i=t[r+2];return t=t[r+3],Rt(e,e.g+4),e=2*((s=(n<<0|s<<8|i<<16|t<<24)>>>0)>>31)+1,n=s>>>23&255,s&=8388607,n==255?s?NaN:e*(1/0):n==0?1401298464324817e-60*e*s:e*Math.pow(2,n-150)*(s+8388608)}function P1(e){return ft(e)}function Rt(e,t){if(e.g=t,t>e.l)throw Error()}function lo(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function ho(e,t){if(t==0)return Et();var r=lo(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):c1?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Et():new Ye(r,Vt)}var fo=[];function po(e,t,r,n){if(nn.length){const s=nn.pop();return s.o(n),s.g.init(e,t,r,n),s}return new O1(e,t,r,n)}function go(e){e.g.clear(),e.l=-1,e.h=-1,nn.length<100&&nn.push(e)}function mo(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=at(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function tn(e){switch(e.h){case 0:e.h!=0?tn(e):hs(e.g);break;case 1:Rt(e=e.g,e.g+8);break;case 2:if(e.h!=2)tn(e);else{var t=at(e.g);Rt(e=e.g,e.g+t)}break;case 5:Rt(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!mo(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}tn(e)}break;default:throw Error()}}function Mr(e,t,r){const n=e.g.l;var s=at(e.g);let i=(s=e.g.g+s)-n;if(i<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),i=s-e.g.g),i)throw Error();return e.g.g=s,e.g.l=n,t}function fs(e){var t=at(e.g),r=lo(e=e.g,t);if(e=e.h,V2){var n,s=e;(n=Cn)||(n=Cn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,s=r===0&&t===s.length?s:s.subarray(r,t);try{var i=n.decode(s)}catch(c){if(Gr===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Gr=!0}catch{Gr=!1}}throw!Gr&&(Cn=void 0),c}}else{t=(i=r)+t,r=[];let c,u=null;for(;i<t;){var o=e[i++];o<128?r.push(o):o<224?i>=t?wt():(c=e[i++],o<194||(192&c)!=128?(i--,wt()):r.push((31&o)<<6|63&c)):o<240?i>=t-1?wt():(c=e[i++],(192&c)!=128||o===224&&c<160||o===237&&c>=160||(192&(n=e[i++]))!=128?(i--,wt()):r.push((15&o)<<12|(63&c)<<6|63&n)):o<=244?i>=t-2?wt():(c=e[i++],(192&c)!=128||c-144+(o<<28)>>30||(192&(n=e[i++]))!=128||(192&(s=e[i++]))!=128?(i--,wt()):(o=(7&o)<<18|(63&c)<<12|(63&n)<<6|63&s,o-=65536,r.push(55296+(o>>10&1023),56320+(1023&o)))):wt(),r.length>=8192&&(u=yi(u,r),r.length=0)}i=yi(u,r)}return i}function yo(e){const t=at(e.g);return ho(e.g,t)}function rn(e,t,r){var n=at(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var O1=class{constructor(e,t,r,n){if(fo.length){const s=fo.pop();s.init(e,t,r,n),e=s}else e=new class{constructor(s,i,o,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(s,i,o,c)}init(s,i,o,{Y:c=!1,ea:u=!1}={}){this.Y=c,this.ea=u,s&&(s=ls(s,this.ea),this.h=s.buffer,this.j=s.g,this.m=i||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,n);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(n)}o({ha:e=!1}={}){this.ha=e}},nn=[];function vo(e){return e?/^\d+$/.test(e)?(Kr(e),new ds(W,Q)):null:F1||(F1=new ds(0,0))}var ds=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let F1;function _o(e){return e?/^-?\d+$/.test(e)?(Kr(e),new ps(W,Q)):null:R1||(R1=new ps(0,0))}var ps=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let R1;function nr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function sr(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function sn(e,t){if(t>=0)sr(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function gs(e){var t=W;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function ir(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ce(e,t,r){sr(e.g,8*t+r)}function ms(e,t){return Ce(e,t,2),t=e.g.end(),ir(e,t),t.push(e.h),t}function ys(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function on(e,t,r){Ce(e,t,2),sr(e.g,r.length),ir(e,e.g.end()),ir(e,r)}function an(e,t,r,n){r!=null&&(t=ms(e,t),n(r,e),ys(e,t))}function Je(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var vs=Je(),bo=Je(),_s=Je(),bs=Je(),wo=Je(),Eo=Je(),M1=Je(),cn=Je(),Ao=Je(),ko=Je();function $e(e,t,r){var n=e.v;we&&we in n&&(n=n[we])&&delete n[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var y=class{constructor(e,t){this.v=Qi(e,t,void 0,2048)}toJSON(){return Zi(this)}j(){var s;var e=gc,t=this.v,r=e.g,n=we;if(Ht&&n&&((s=t[n])==null?void 0:s[r])!=null&&Gt(Z2,3),t=e.g,Fi&&we&&Fi===void 0&&(n=(r=this.v)[we])&&(n=n.da))try{n(r,t,E1)}catch(i){_i(i)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[m];return rs(this,e,t)?es(this,e,!0):new this.constructor($t(e,t,!1))}};y.prototype[zt]=Kt,y.prototype.toString=function(){return this.v.toString()};var or=class{constructor(e,t,r){this.g=e,this.h=t,e=vs,this.l=!!e&&r===e||!1}};function un(e,t){return new or(e,t,vs)}function So(e,t,r,n,s){an(e,r,Fo(t,n),s)}const C1=un(function(e,t,r,n,s){return e.h===2&&(Mr(e,cs(t,n,r),s),!0)},So),I1=un(function(e,t,r,n,s){return e.h===2&&(Mr(e,cs(t,n,r),s),!0)},So);var ln=Symbol(),hn=Symbol(),ws=Symbol(),To=Symbol(),xo=Symbol();let Lo,Po;function Mt(e,t,r,n){var s=n[e];if(s)return s;(s={}).qa=n,s.T=function(f){switch(typeof f){case"boolean":return S1||(S1=[0,void 0,!0]);case"number":return f>0?void 0:f===0?T1||(T1=[0,void 0]):[-f,void 0];case"string":return[0,f];case"object":return f}}(n[0]);var i=n[1];let o=1;i&&i.constructor===Object&&(s.ba=i,typeof(i=n[++o])=="function"&&(s.ma=!0,Lo??(Lo=i),Po??(Po=n[o+1]),i=n[o+=2]));const c={};for(;i&&Array.isArray(i)&&i.length&&typeof i[0]=="number"&&i[0]>0;){for(var u=0;u<i.length;u++)c[i[u]]=i;i=n[++o]}for(u=1;i!==void 0;){let f;typeof i=="number"&&(u+=i,i=n[++o]);var d=void 0;if(i instanceof or?f=i:(f=C1,o--),f==null?void 0:f.l){i=n[++o],d=n;var l=o;typeof i=="function"&&(i=i(),d[l]=i),d=i}for(l=u+1,typeof(i=n[++o])=="number"&&i<0&&(l-=i,i=n[++o]);u<l;u++){const b=c[u];d?r(s,u,f,d,b):t(s,u,f,b)}}return n[e]=s}function Oo(e){return Array.isArray(e)?e[0]instanceof or?e:[I1,e]:[e,void 0]}function Fo(e,t){return e instanceof y?e.v:Array.isArray(e)?Tt(e,t):void 0}function Es(e,t,r,n){const s=r.g;e[t]=n?(i,o,c)=>s(i,o,c,n):s}function As(e,t,r,n,s){const i=r.g;let o,c;e[t]=(u,d,l)=>i(u,d,l,c||(c=Mt(hn,Es,As,n).T),o||(o=ks(n)),s)}function ks(e){let t=e[ws];if(t!=null)return t;const r=Mt(hn,Es,As,e);return t=r.ma?(n,s)=>Lo(n,s,r):(n,s)=>{for(;mo(s)&&s.h!=4;){var i=s.l,o=r[i];if(o==null){var c=r.ba;c&&(c=c[i])&&(c=N1(c))!=null&&(o=r[i]=c)}if(o==null||!o(s,n,i)){if(o=(c=s).m,tn(c),c.ha)var u=void 0;else u=c.g.g-o,c.g.g=o,u=ho(c.g,u);o=void 0,c=n,u&&((o=c[we]??(c[we]=new Qn))[i]??(o[i]=[])).push(u)}}return(n=qr(n))&&(n.da=r.qa[xo]),!0},e[ws]=t,e[xo]=j1.bind(e),t}function j1(e,t,r,n){var s=this[hn];const i=this[ws],o=Tt(void 0,s.T),c=qr(e);if(c){var u=!1,d=s.ba;if(d){if(s=(l,f,b)=>{if(b.length!==0)if(d[f])for(const A of b){l=po(A);try{u=!0,i(o,l)}finally{go(l)}}else n==null||n(e,f,b)},t==null)Jr(c,s);else if(c!=null){const l=c[t];l&&s(c,t,l)}if(u){let l=0|e[m];if(2&l&&2048&l&&!(r!=null&&r.Ka))throw Error();const f=Yt(l),b=(A,I)=>{if(st(e,A,f)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}I!=null&&(l=se(e,l,A,I,f)),delete c[A]};t==null?ji(o,0|o[m],(A,I)=>{b(A,I)}):b(t,st(o,t,f))}}}}function N1(e){const t=(e=Oo(e))[0].g;if(e=e[1]){const r=ks(e),n=Mt(hn,Es,As,e).T;return(s,i,o)=>t(s,i,o,n,r)}return t}function fn(e,t,r){e[t]=r.h}function dn(e,t,r,n){let s,i;const o=r.h;e[t]=(c,u,d)=>o(c,u,d,i||(i=Mt(ln,fn,dn,n).T),s||(s=Ro(n)))}function Ro(e){let t=e[To];if(!t){const r=Mt(ln,fn,dn,e);t=(n,s)=>Mo(n,s,r),e[To]=t}return t}function Mo(e,t,r){ji(e,0|e[m],(n,s)=>{if(s!=null){var i=function(o,c){var u=o[c];if(u)return u;if((u=o.ba)&&(u=u[c])){var d=(u=Oo(u))[0].h;if(u=u[1]){const l=Ro(u),f=Mt(ln,fn,dn,u).T;u=o.ma?Po(f,l):(b,A,I)=>d(b,A,I,f,l)}else u=d;return o[c]=u}}(r,n);i?i(t,s,n):n<500||Gt(Vn,3)}}),(e=qr(e))&&Jr(e,(n,s,i)=>{for(ir(t,t.g.end()),n=0;n<i.length;n++)ir(t,Bn(i[n])||new Uint8Array(0))})}const D1=Ae(0);function ar(e,t){if(Array.isArray(t)){var r=0|t[m];if(4&r)return t;for(var n=0,s=0;n<t.length;n++){const i=e(t[n]);i!=null&&(t[s++]=i)}return s<n&&(t.length=s),(e=-1537&(5|r))!==r&&ne(t,e),2&e&&Object.freeze(t),t}}function de(e,t,r){return new or(e,t,r)}function cr(e,t,r){return new or(e,t,r)}function ae(e,t,r){se(e,0|e[m],t,r,Yt(0|e[m]))}var B1=un(function(e,t,r,n,s){if(e.h!==2)return!1;if(e=Ue(e=Mr(e,Tt([void 0,void 0],n),s)),s=Yt(n=0|t[m]),2&n)throw Error();let i=st(t,r,s);if(i instanceof nt)2&i.J?(i=i.V(),i.push(e),se(t,n,r,i,s)):i.Ma(e);else if(Array.isArray(i)){var o=0|i[m];8192&o||ne(i,o|=8192),2&o&&(i=so(i),se(t,n,r,i,s)),i.push(e)}else se(t,n,r,kr([e]),s);return!0},function(e,t,r,n,s){if(t instanceof nt)t.forEach((i,o)=>{an(e,r,Tt([o,i],n),s)});else if(Array.isArray(t)){for(let i=0;i<t.length;i++){const o=t[i];Array.isArray(o)&&an(e,r,Tt(o,n),s)}kr(t)}});function Co(e,t,r){(t=qe(t))!=null&&(Ce(e,r,5),e=e.g,Hn(t),gs(e))}function Io(e,t,r){if(t=function(n){if(n==null)return n;const s=typeof n;if(s==="bigint")return String(Tr(64,n));if(Pr(n)){if(s==="string")return Ki(n);if(s==="number")return qn(n)}}(t),t!=null&&(typeof t=="string"&&_o(t),t!=null))switch(Ce(e,r,0),typeof t){case"number":e=e.g,Xt(t),nr(e,W,Q);break;case"bigint":r=BigInt.asUintN(64,t),r=new ps(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),nr(e.g,r.h,r.g);break;default:r=_o(t),nr(e.g,r.h,r.g)}}function jo(e,t,r){(t=Jt(t))!=null&&t!=null&&(Ce(e,r,0),sn(e.g,t))}function No(e,t,r){(t=Wi(t))!=null&&(Ce(e,r,0),e.g.g.push(t?1:0))}function Do(e,t,r){(t=he(t))!=null&&on(e,r,vi(t))}function Bo(e,t,r,n,s){an(e,r,Fo(t,n),s)}function Uo(e,t,r){(t=t==null||typeof t=="string"||t instanceof Ye?t:void 0)!=null&&on(e,r,ls(t,!0).buffer)}function Vo(e,t,r){return(e.h===5||e.h===2)&&(t=er(t,0|t[m],r),e.h==2?rn(e,en,t):t.push(en(e.g)),!0)}var ee=de(function(e,t,r){return e.h===5&&(ae(t,r,en(e.g)),!0)},Co,cn),U1=cr(Vo,function(e,t,r){if((t=ar(qe,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ce(n,s,5),n=n.g,Hn(i),gs(n))}},cn),Ss=cr(Vo,function(e,t,r){if((t=ar(qe,t))!=null&&t.length){Ce(e,r,2),sr(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,Hn(t[n]),gs(r)}},cn),V1=de(function(e,t,r){return e.h===5&&(ae(t,r,(e=en(e.g))===0?void 0:e),!0)},Co,cn),dt=de(function(e,t,r){return jn?(e.h!==0?e=!1:(ae(t,r,rr(e.g,Vi)),e=!0),e):e.h===0&&(ae(t,r,rr(e.g,Kn)),!0)},Io,Eo),Ts=de(function(e,t,r){return jn?(e.h!==0?t=!1:(ae(t,r,(e=rr(e.g,Vi))===D1?void 0:e),t=!0),t):e.h===0&&(ae(t,r,(e=rr(e.g,Kn))===0?void 0:e),!0)},Io,Eo),G1=de(function(e,t,r){return jn?(e.h!==0?e=!1:(ae(t,r,rr(e.g,l1)),e=!0),e):e.h===0&&(ae(t,r,rr(e.g,zn)),!0)},function(e,t,r){if(t=function(n){if(n==null)return n;var s=typeof n;if(s==="bigint")return String(h1(64,n));if(Pr(n)){if(s==="string")return s=qt(Number(n)),St(s)&&s>=0?n=String(s):((s=n.indexOf("."))!==-1&&(n=n.substring(0,s)),(s=n[0]!=="-"&&((s=n.length)<20||s===20&&n<="18446744073709551615"))||(Kr(n),n=Sr(W,Q))),n;if(s==="number")return(n=qt(n))>=0&&St(n)||(Xt(n),n=zn(W,Q)),n}}(t),t!=null&&(typeof t=="string"&&vo(t),t!=null))switch(Ce(e,r,0),typeof t){case"number":e=e.g,Xt(t),nr(e,W,Q);break;case"bigint":r=BigInt.asUintN(64,t),r=new ds(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),nr(e.g,r.h,r.g);break;default:r=vo(t),nr(e.g,r.h,r.g)}},M1),ce=de(function(e,t,r){return e.h===0&&(ae(t,r,ft(e.g)),!0)},jo,bs),Cr=cr(function(e,t,r){return(e.h===0||e.h===2)&&(t=er(t,0|t[m],r),e.h==2?rn(e,ft,t):t.push(ft(e.g)),!0)},function(e,t,r){if((t=ar(Jt,t))!=null&&t.length){r=ms(e,r);for(let n=0;n<t.length;n++)sn(e.g,t[n]);ys(e,r)}},bs),ur=de(function(e,t,r){return e.h===0&&(ae(t,r,(e=ft(e.g))===0?void 0:e),!0)},jo,bs),X=de(function(e,t,r){return e.h===0&&(ae(t,r,hs(e.g)),!0)},No,bo),Ct=de(function(e,t,r){return e.h===0&&(ae(t,r,(e=hs(e.g))===!1?void 0:e),!0)},No,bo),fe=cr(function(e,t,r){return e.h===2&&(e=fs(e),er(t,0|t[m],r).push(e),!0)},function(e,t,r){if((t=ar(he,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&on(n,s,vi(i))}},_s),pt=de(function(e,t,r){return e.h===2&&(ae(t,r,(e=fs(e))===""?void 0:e),!0)},Do,_s),C=de(function(e,t,r){return e.h===2&&(ae(t,r,fs(e)),!0)},Do,_s),ue=function(e,t,r=vs){return new or(e,t,r)}(function(e,t,r,n,s){return e.h===2&&(n=Tt(void 0,n),er(t,0|t[m],r).push(n),Mr(e,n,s),!0)},function(e,t,r,n,s){if(Array.isArray(t)){for(let i=0;i<t.length;i++)Bo(e,t[i],r,n,s);1&(e=0|t[m])||ne(t,1|e)}}),q=un(function(e,t,r,n,s,i){if(e.h!==2)return!1;let o=0|t[m];return io(t,o,i,r,Yt(o)),Mr(e,t=cs(t,n,r),s),!0},Bo),Go=de(function(e,t,r){return e.h===2&&(ae(t,r,yo(e)),!0)},Uo,Ao),W1=cr(function(e,t,r){return(e.h===0||e.h===2)&&(t=er(t,0|t[m],r),e.h==2?rn(e,at,t):t.push(at(e.g)),!0)},function(e,t,r){if((t=ar(Hi,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ce(n,s,0),sr(n.g,i))}},wo),H1=de(function(e,t,r){return e.h===0&&(ae(t,r,(e=at(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Hi(t))!=null&&t!=null&&(Ce(e,r,0),sr(e.g,t))},wo),Se=de(function(e,t,r){return e.h===0&&(ae(t,r,ft(e.g)),!0)},function(e,t,r){(t=Jt(t))!=null&&(t=parseInt(t,10),Ce(e,r,0),sn(e.g,t))},ko);class z1{constructor(t,r){var n=Te;this.g=t,this.h=r,this.m=L,this.j=w,this.defaultValue=void 0,this.l=n.Oa!=null?Ni:void 0}register(){Wr(this)}}function Ze(e,t){return new z1(e,t)}function gt(e,t){return(r,n)=>{{const i={ea:!0};n&&Object.assign(i,n),r=po(r,void 0,void 0,i);try{const o=new e,c=o.v;ks(t)(c,r);var s=o}finally{go(r)}}return s}}function pn(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Mo(this.v,t,Mt(ln,fn,dn,e)),ir(t,t.g.end());const r=new Uint8Array(t.h),n=t.l,s=n.length;let i=0;for(let o=0;o<s;o++){const c=n[o];r.set(c,i),i+=c.length}return t.l=[r],r}}var Wo=class extends y{constructor(e){super(e)}},Ho=[0,pt,de(function(e,t,r){return e.h===2&&(ae(t,r,(e=yo(e))===Et()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof y){const n=t.Ra;return void(n?(t=n(t),t!=null&&on(e,r,ls(t,!0).buffer)):Gt(Vn,3))}if(Array.isArray(t))return void Gt(Vn,3)}Uo(e,t,r)},Ao)];let xs,zo=globalThis.trustedTypes;function Ko(e){var t;return xs===void 0&&(xs=function(){let r=null;if(!zo)return r;try{const n=s=>s;r=zo.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r}()),e=(t=xs)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function K1(e,...t){if(t.length===0)return Ko(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Ko(r)}var Yo=[0,ce,Se,X,-1,Cr,Se,-1,X],Y1=class extends y{constructor(e){super(e)}},Xo=[0,X,C,X,Se,-1,cr(function(e,t,r){return(e.h===0||e.h===2)&&(t=er(t,0|t[m],r),e.h==2?rn(e,P1,t):t.push(ft(e.g)),!0)},function(e,t,r){if((t=ar(Jt,t))!=null&&t.length){r=ms(e,r);for(let n=0;n<t.length;n++)sn(e.g,t[n]);ys(e,r)}},ko),C,-1,[0,X,-1],Se,X,-1],qo=[0,3,X,-1,2,[0,ce],[0,Se,X],[0,C,-1],[0]],Jo=[0,C,-2],$o=class extends y{constructor(e){super(e)}},Zo=[0],Qo=[0,ce,X,1,X,-4],Te=class extends y{constructor(e){super(e,2)}},ie={};ie[336783863]=[0,C,X,-1,ce,[0,[1,2,3,4,5,6,7,8,9],q,Zo,q,Xo,q,Jo,q,Qo,q,Yo,q,[0,C,-2],q,[0,C,Se],q,qo,q,[0,Se,-1,X]],[0,C],X,[0,[1,3],[2,4],q,[0,Cr],-1,q,[0,fe],-1,ue,[0,C,-1]],C];var ea=[0,Ts,-1,Ct,-3,Ts,Cr,pt,ur,Ts,-1,Ct,ur,Ct,-2,pt];function U(e,t){Qr(e,3,t)}function S(e,t){Qr(e,4,t)}var ye=class extends y{constructor(e){super(e,500)}o(e){return w(this,0,7,e)}},Ir=[-1,{}],ta=[0,C,1,Ir],ra=[0,C,fe,Ir];function Ie(e,t){us(e,1,ye,t)}function H(e,t){Qr(e,10,t)}function P(e,t){Qr(e,15,t)}var xe=class extends y{constructor(e){super(e,500)}o(e){return w(this,0,1001,e)}},na=[-500,ue,[-500,pt,-1,fe,-3,[-2,ie,X],ue,Ho,ur,-1,ta,ra,ue,[0,pt,Ct],pt,ea,ur,fe,987,fe],4,ue,[-500,C,-1,[-1,{}],998,C],ue,[-500,C,fe,-1,[-2,{},X],997,fe,-1],ur,ue,[-500,C,fe,Ir,998,fe],fe,ur,ta,ra,ue,[0,pt,-1,Ir],fe,-2,ea,pt,-1,Ct,[0,Ct,H1],978,Ir,ue,Ho];xe.prototype.g=pn(na);var X1=gt(xe,na),q1=class extends y{constructor(e){super(e)}},sa=class extends y{constructor(e){super(e)}g(){return it(this,q1,1)}},ia=[0,ue,[0,ce,ee,C,-1]],gn=gt(sa,ia),J1=class extends y{constructor(e){super(e)}},$1=class extends y{constructor(e){super(e)}},Ls=class extends y{constructor(e){super(e)}l(){return L(this,J1,2)}g(){return it(this,$1,5)}},oa=gt(class extends y{constructor(e){super(e)}},[0,fe,Cr,Ss,[0,Se,[0,ce,-3],[0,ee,-3],[0,ce,-1,[0,ue,[0,ce,-2]]],ue,[0,ee,-1,C,ee]],C,-1,dt,ue,[0,ce,ee],fe,dt]),aa=class extends y{constructor(e){super(e)}},lr=gt(class extends y{constructor(e){super(e)}},[0,ue,[0,ee,-4]]),ca=class extends y{constructor(e){super(e)}},jr=gt(class extends y{constructor(e){super(e)}},[0,ue,[0,ee,-4]]),Z1=class extends y{constructor(e){super(e)}},Q1=[0,ce,-1,Ss,Se],ua=class extends y{constructor(e){super(e)}};ua.prototype.g=pn([0,ee,-4,dt]);var ec=class extends y{constructor(e){super(e)}},tc=gt(class extends y{constructor(e){super(e)}},[0,ue,[0,1,ce,C,ia],dt]),la=class extends y{constructor(e){super(e)}},rc=class extends y{constructor(e){super(e)}na(){const e=B(this,1,void 0,void 0,no);return e??Et()}},nc=class extends y{constructor(e){super(e)}},ha=[1,2],sc=gt(class extends y{constructor(e){super(e)}},[0,ue,[0,ha,q,[0,Ss],q,[0,Go],ce,C],dt]),Ps=class extends y{constructor(e){super(e)}},fa=[0,C,ce,ee,fe,-1],da=class extends y{constructor(e){super(e)}},ic=[0,X,-1],pa=class extends y{constructor(e){super(e)}},mn=[1,2,3,4,5,6],yn=class extends y{constructor(e){super(e)}g(){return B(this,1,void 0,void 0,no)!=null}l(){return he(B(this,2))!=null}},K=class extends y{constructor(e){super(e)}g(){return Wi(B(this,2))??!1}},ga=[0,Go,C,[0,ce,dt,-1],[0,G1,dt]],te=[0,ga,X,[0,mn,q,Qo,q,Xo,q,Yo,q,Zo,q,Jo,q,qo],Se],vn=class extends y{constructor(e){super(e)}},Os=[0,te,ee,-1,ce],oc=Ze(502141897,vn);ie[502141897]=Os;var ac=gt(class extends y{constructor(e){super(e)}},[0,[0,Se,-1,U1,W1],Q1]),ma=class extends y{constructor(e){super(e)}},ya=class extends y{constructor(e){super(e)}},Fs=[0,te,ee,[0,te],X],cc=Ze(508968150,ya);ie[508968150]=[0,te,Os,Fs,ee,[0,[0,ga]]],ie[508968149]=Fs;var hr=class extends y{constructor(e){super(e)}l(){return L(this,Ps,2)}g(){F(this,2)}},va=[0,te,fa];ie[478825465]=va;var uc=class extends y{constructor(e){super(e)}},_a=class extends y{constructor(e){super(e)}},Rs=class extends y{constructor(e){super(e)}},Ms=class extends y{constructor(e){super(e)}},ba=class extends y{constructor(e){super(e)}},wa=[0,te,[0,te],va,-1],Ea=[0,te,ee,ce],Cs=[0,te,ee],Aa=[0,te,Ea,Cs,ee],lc=Ze(479097054,ba);ie[479097054]=[0,te,Aa,wa],ie[463370452]=wa,ie[464864288]=Ea;var hc=Ze(462713202,Ms);ie[462713202]=Aa,ie[474472470]=Cs;var fc=class extends y{constructor(e){super(e)}},ka=class extends y{constructor(e){super(e)}},Sa=class extends y{constructor(e){super(e)}},Ta=class extends y{constructor(e){super(e)}},Is=[0,te,ee,-1,ce],js=[0,te,ee,X];Ta.prototype.g=pn([0,te,Cs,[0,te],Os,Fs,Is,js]);var xa=class extends y{constructor(e){super(e)}},dc=Ze(456383383,xa);ie[456383383]=[0,te,fa];var La=class extends y{constructor(e){super(e)}},pc=Ze(476348187,La);ie[476348187]=[0,te,ic];var Pa=class extends y{constructor(e){super(e)}},Oa=class extends y{constructor(e){super(e)}},Fa=[0,Se,-1],gc=Ze(458105876,class extends y{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[m];return e=Ee(this,r),t=function(n,s,i,o){var c=Oa;!o&&Zt(n)&&(i=0|(s=n.v)[m]);var u=st(s,2);if(n=!1,u==null){if(o)return $i();u=[]}else if(u.constructor===nt){if(!(2&u.J)||o)return u;u=u.V()}else Array.isArray(u)?n=!!(2&(0|u[m])):u=[];if(o){if(!u.length)return $i();n||(n=!0,Ar(u))}else n&&(n=!1,kr(u),u=so(u));return!n&&32&i&&Er(u,32),i=se(s,i,2,o=new nt(u,c,g1,void 0)),n||xt(s,i),o}(this,t,r,e),!e&&Oa&&(t.ra=!0),t}});ie[458105876]=[0,Fa,B1,[!0,dt,[0,C,-1,fe]],[0,Cr,X,Se]];var Ns=class extends y{constructor(e){super(e)}},Ra=Ze(458105758,Ns);ie[458105758]=[0,te,C,Fa];var Ds=class extends y{constructor(e){super(e)}},Ma=[0,V1,-1,Ct],mc=class extends y{constructor(e){super(e)}},Ca=class extends y{constructor(e){super(e)}},Bs=[1,2];Ca.prototype.g=pn([0,Bs,q,Ma,q,[0,ue,Ma]]);var Ia=class extends y{constructor(e){super(e)}},yc=Ze(443442058,Ia);ie[443442058]=[0,te,C,ce,ee,fe,-1,X,ee],ie[514774813]=Is;var ja=class extends y{constructor(e){super(e)}},vc=Ze(516587230,ja);function Us(e,t){return t=t?t.clone():new Ps,e.displayNamesLocale!==void 0?F(t,1,Or(e.displayNamesLocale)):e.displayNamesLocale===void 0&&F(t,1),e.maxResults!==void 0?ot(t,2,e.maxResults):"maxResults"in e&&F(t,2),e.scoreThreshold!==void 0?_(t,3,e.scoreThreshold):"scoreThreshold"in e&&F(t,3),e.categoryAllowlist!==void 0?Zr(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&F(t,4),e.categoryDenylist!==void 0?Zr(t,5,e.categoryDenylist):"categoryDenylist"in e&&F(t,5),t}function Na(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Vs(e,t=-1,r=""){return{categories:e.map(n=>({index:Me(n,1)??0??-1,score:Y(n,2)??0,categoryName:he(B(n,3))??""??"",displayName:he(B(n,4))??""??""})),headIndex:t,headName:r}}function _c(e){const t={classifications:it(e,ec,1).map(r=>{var n;return Vs(((n=L(r,sa,4))==null?void 0:n.g())??[],Me(r,2)??0,he(B(r,3))??"")})};return function(r){return p1(Nn?B(r,2,void 0,void 0,Xr):B(r,2))}(e)!=null&&(t.timestampMs=Na(uo(e))),t}function Da(e){var o,c;var t=Pt(e,3,qe,Lt()),r=Pt(e,2,Jt,Lt()),n=Pt(e,1,he,Lt()),s=Pt(e,9,he,Lt());const i={categories:[],keypoints:[]};for(let u=0;u<t.length;u++)i.categories.push({score:t[u],index:r[u]??-1,categoryName:n[u]??"",displayName:s[u]??""});if((t=(o=L(e,Ls,4))==null?void 0:o.l())&&(i.boundingBox={originX:Me(t,1,lt)??0,originY:Me(t,2,lt)??0,width:Me(t,3,lt)??0,height:Me(t,4,lt)??0,angle:0}),(c=L(e,Ls,4))==null?void 0:c.g().length)for(const u of L(e,Ls,4).g())i.keypoints.push({x:B(u,1,void 0,lt,qe)??0,y:B(u,2,void 0,lt,qe)??0,score:B(u,4,void 0,lt,qe)??0,label:he(B(u,3,void 0,lt))??""});return i}function _n(e){const t=[];for(const r of it(e,ca,1))t.push({x:Y(r,1)??0,y:Y(r,2)??0,z:Y(r,3)??0,visibility:Y(r,4)??0});return t}function Nr(e){const t=[];for(const r of it(e,aa,1))t.push({x:Y(r,1)??0,y:Y(r,2)??0,z:Y(r,3)??0,visibility:Y(r,4)??0});return t}function Ba(e){return Array.from(e,t=>t>127?t-256:t)}function Ua(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,s=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],n+=e[i]*e[i],s+=t[i]*t[i];if(n<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*s)}let bn;ie[516587230]=[0,te,Is,js,ee],ie[518928384]=js;const bc=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 Va(){if(bn===void 0)try{await WebAssembly.instantiate(bc),bn=!0}catch{bn=!1}return bn}async function Dr(e,t=K1``){const r=await Va()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var It=class{};function Ga(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Wa(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,n)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",s=>{n(s)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Ha(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function v(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function za(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[n,s]=Ha(t);return!e.l||n===e.i.canvas.width&&s===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=s),[n,s]}function Ka(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let s=0;s<t.length;s++)n[s]=e.i.stringToNewUTF8(t[s]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(const s of n)e.i._free(s);e.i._free(t)}function Qe(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function mt(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(s,i,o)=>{i?(r(n,o),n=[]):n.push(s)}}It.forVisionTasks=function(e){return Dr("vision",e)},It.forTextTasks=function(e){return Dr("text",e)},It.forGenAiExperimentalTasks=function(e){return Dr("genai_experimental",e)},It.forGenAiTasks=function(e){return Dr("genai",e)},It.forAudioTasks=function(e){return Dr("audio",e)},It.isSimdSupported=function(){return Va()};async function wc(e,t,r,n){return e=await(async(s,i,o,c,u)=>{if(i&&await Wa(i),!self.ModuleFactory||o&&(await Wa(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&u&&((i=self.Module).locateFile=u.locateFile,u.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=u.mainScriptUrlOrBlob)),u=await self.ModuleFactory(self.Module||u),self.ModuleFactory=self.Module=void 0,new s(u,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:s=>s.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&s.endsWith(".data")?r.assetBinaryPath.toString():s}),await e.o(n),e}function Gs(e,t){const r=L(e.baseOptions,yn,1)||new yn;typeof t=="string"?(F(r,2,Or(t)),F(r,1)):t instanceof Uint8Array&&(F(r,1,Gn(t,!1)),F(r,2)),w(e.baseOptions,0,1,r)}function Ya(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function g(e,t){e.C=Math.max(e.C,t)}function wn(e,t){e.B=new ye,ke(e.B,2,"PassThroughCalculator"),U(e.B,"free_memory"),S(e.B,"free_memory_unused_out"),H(t,"free_memory"),Ie(t,e.B)}function fr(e,t){U(e.B,t),S(e.B,t+"_unused_out")}function En(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var Ws=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,n,s,i,o,c;if(t){const u=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((s=L(this.baseOptions,yn,1))!=null&&s.g()||(i=L(this.baseOptions,yn,1))!=null&&i.l()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(d,l){let f=L(d.baseOptions,pa,3);if(!f){var b=f=new pa,A=new $o;Rr(b,4,mn,A)}"delegate"in l&&(l.delegate==="GPU"?(l=f,b=new Y1,Rr(l,2,mn,b)):(l=f,b=new $o,Rr(l,4,mn,b))),w(d.baseOptions,0,3,f)}(this,u),u.modelAssetPath)return fetch(u.modelAssetPath.toString()).then(d=>{if(d.ok)return d.arrayBuffer();throw Error(`Failed to fetch model: ${u.modelAssetPath} (${d.status})`)}).then(d=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(d),!0,!1,!1),Gs(this,"/model.dat"),this.m(),this.L()});if(u.modelAssetBuffer instanceof Uint8Array)Gs(this,u.modelAssetBuffer);else if(u.modelAssetBuffer)return async function(d){const l=[];for(var f=0;;){const{done:b,value:A}=await d.read();if(b)break;l.push(A),f+=A.length}if(l.length===0)return new Uint8Array(0);if(l.length===1)return l[0];d=new Uint8Array(f),f=0;for(const b of l)d.set(b,f),f+=b.length;return d}(u.modelAssetBuffer).then(d=>{Gs(this,d),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=X1(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,n)=>{this.H.push(Error(n))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Ya(this)}finishProcessing(){this.g.finishProcessing(),Ya(this)}close(){this.B=void 0,this.g.closeGraph()}};function yt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Ws.prototype.close=Ws.prototype.close;class Ec{constructor(t,r,n,s){this.g=t,this.h=r,this.m=n,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Xa(e,t,r){const n=e.g;if(r=yt(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function qa(e,t){const r=e.g,n=yt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);const s=yt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);const i=yt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new Ec(r,n,s,i)}function Hs(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Ac(e,t,r,n){return Hs(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=qa(e,!0)),r=e.u):(e.A||(e.A=qa(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function Ja(e,t,r){return Hs(e,t),e=yt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),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.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function $a(e,t,r){Hs(e,t),e.B||(e.B=yt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function kc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Za=class{H(){return`
|
|
30
|
+
<%s key={someKey} {...props} />`,pi,Ut,nu,Ut),j2[Ut+pi]=!0}}return a===n?Zc(ne):$c(ne),ne}}function Qc(a,h,p){return N2(a,h,p,!0)}function eu(a,h,p){return N2(a,h,p,!1)}var tu=eu,ru=Qc;_r.Fragment=n,_r.jsx=tu,_r.jsxs=ru}()),_r}process.env.NODE_ENV==="production"?In.exports=B2():In.exports=U2();var F=In.exports,Vt=typeof self<"u"?self:{};function br(e,t){e:{for(var r=["CLOSURE_FLAGS"],n=Vt,s=0;s<r.length;s++)if((n=n[r[s]])==null){r=null;break e}r=n}return(e=r&&r[e])!=null?e:t}function kt(){throw Error("Invalid UTF8")}function yi(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Hr,jn;const V2=typeof TextDecoder<"u";let G2;const W2=typeof TextEncoder<"u";function vi(e){if(W2)e=(G2||(G2=new TextEncoder)).encode(e);else{let r=0;const n=new Uint8Array(3*e.length);for(let s=0;s<e.length;s++){var t=e.charCodeAt(s);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&s<e.length){const i=e.charCodeAt(++s);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}s--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}function _i(e){Vt.setTimeout(()=>{throw e},0)}var Nn,H2=br(610401301,!1),bi=br(748402147,!0),Dn=br(824648567,!0),Bn=br(824656860,br(1,!0));function wi(){var e=Vt.navigator;return e&&(e=e.userAgent)?e:""}const Ei=Vt.navigator;function zr(e){return zr[" "](e),e}Nn=Ei&&Ei.userAgentData||null,zr[" "]=function(){};const Ai={};let wr=null;function z2(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const n=new Uint8Array(r);let s=0;return function(i,o){function c(d){for(;u<i.length;){const l=i.charAt(u++),f=wr[l];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l)}return d}ki();let u=0;for(;;){const d=c(-1),l=c(0),f=c(64),m=c(64);if(m===64&&d===-1)break;o(d<<2|l>>4),f!=64&&(o(l<<4&240|f>>2),m!=64&&o(f<<6&192|m))}}(e,function(i){n[s++]=i}),s!==r?n.subarray(0,s):n}function ki(){if(!wr){wr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const n=e.concat(t[r].split(""));Ai[r]=n;for(let s=0;s<n.length;s++){const i=n[s];wr[i]===void 0&&(wr[i]=s)}}}}var K2=typeof Uint8Array<"u",Si=!(!(H2&&Nn&&Nn.brands.length>0)&&(wi().indexOf("Trident")!=-1||wi().indexOf("MSIE")!=-1))&&typeof btoa=="function";const Ti=/[-_.]/g,Y2={"-":"+",_:"/",".":"="};function X2(e){return Y2[e]||""}function xi(e){if(!Si)return z2(e);e=Ti.test(e)?e.replace(Ti,X2):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Un(e){return K2&&e!=null&&e instanceof Uint8Array}var Gt={};function St(){return q2||(q2=new ze(null,Gt))}function Vn(e){Li(Gt);var t=e.g;return(t=t==null||Un(t)?t:typeof t=="string"?xi(t):null)==null?t:e.g=t}var ze=class{h(){return new Uint8Array(Vn(this)||0)}constructor(e,t){if(Li(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let q2,J2;function Li(e){if(e!==Gt)throw Error("illegal external caller")}function Pi(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Gn(e){return Pi(e=Error(e),"warning"),e}function Wt(e,t){if(e!=null){var r=J2??(J2={}),n=r[e]||0;n>=t||(r[e]=n+1,Pi(e=Error(),"incident"),_i(e))}}function Ht(){return typeof BigInt=="function"}var zt=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Ke(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var $2=Ke("jas",void 0,!0),Oi=Ke(void 0,"0di"),Er=Ke(void 0,"1oa"),we=Ke(void 0,Symbol()),Z2=Ke(void 0,"0ub"),Q2=Ke(void 0,"0ubs"),Wn=Ke(void 0,"0ubsb"),e1=Ke(void 0,"0actk"),Kt=Ke("m_m","Pa",!0),Ri=Ke();const Fi={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Mi=Object.defineProperties,y=zt?$2:"Ga";var Tt;const Ci=[];function Ar(e,t){zt||y in e||Mi(e,Fi),e[y]|=t}function se(e,t){zt||y in e||Mi(e,Fi),e[y]=t}function kr(e){return Ar(e,34),e}function Sr(e){return Ar(e,8192),e}se(Ci,7),Tt=Object.freeze(Ci);var Yt={};function Ee(e,t){return t===void 0?e.h!==xt&&!!(2&(0|e.v[y])):!!(2&t)&&e.h!==xt}const xt={};function Hn(e,t){if(e!=null){if(typeof e=="string")e=e?new ze(e,Gt):St();else if(e.constructor!==ze)if(Un(e))e=e.length?new ze(new Uint8Array(e),Gt):St();else{if(!t)throw Error();e=void 0}}return e}class Ii{constructor(t,r,n){this.g=t,this.h=r,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var t1=Object.freeze({});function ji(e,t,r){const n=128&t?0:-1,s=e.length;var i;(i=!!s)&&(i=(i=e[s-1])!=null&&typeof i=="object"&&i.constructor===Object);const o=s+(i?-1:0);for(t=128&t?1:0;t<o;t++)r(t-n,e[t]);if(i){e=e[s-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var Ni={};function Xt(e){return 128&e?Ni:void 0}function Kr(e){return e.Na=!0,e}var r1=Kr(e=>typeof e=="number"),Di=Kr(e=>typeof e=="string"),n1=Kr(e=>typeof e=="boolean"),Yr=typeof Vt.BigInt=="function"&&typeof Vt.BigInt(0)=="bigint";function Ae(e){var t=e;if(Di(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(r1(t)&&!Number.isSafeInteger(t))throw Error(String(t));return Yr?BigInt(e):e=n1(e)?e?"1":"0":Di(e)?e.trim()||"0":String(e)}var zn=Kr(e=>Yr?e>=i1&&e<=a1:e[0]==="-"?Bi(e,s1):Bi(e,o1));const s1=Number.MIN_SAFE_INTEGER.toString(),i1=Yr?BigInt(Number.MIN_SAFE_INTEGER):void 0,o1=Number.MAX_SAFE_INTEGER.toString(),a1=Yr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Bi(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const n=e[r],s=t[r];if(n>s)return!1;if(n<s)return!0}}const c1=typeof Uint8Array.prototype.slice=="function";let u1,V=0,ee=0;function Ui(e){const t=e>>>0;V=t,ee=(e-t)/4294967296>>>0}function qt(e){if(e<0){Ui(-e);const[t,r]=Jn(V,ee);V=t>>>0,ee=r>>>0}else Ui(e)}function Kn(e){const t=u1||(u1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),ee=0,V=t.getUint32(0,!0)}function Yn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Tr(e,t)}function l1(e,t){return Ae(Ht()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Tr(e,t))}function Xn(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Yn(e,t))=="number"?r?-e:e:r?"-"+e:e}function Vi(e,t){return Ht()?Ae(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):Ae(qn(e,t))}function Tr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else Ht()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Gi(r)+Gi(e));return r}function Gi(e){return e=String(e),"0000000".slice(e.length)+e}function qn(e,t){if(2147483648&t)if(Ht())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,n]=Jn(e,t);e="-"+Tr(r,n)}else e=Tr(e,t);return e}function Xr(e){if(e.length<16)qt(Number(e));else if(Ht())e=BigInt(e),V=Number(e&BigInt(4294967295))>>>0,ee=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");ee=V=0;const r=e.length;for(let n=t,s=(r-t)%6+t;s<=r;n=s,s+=6){const i=Number(e.slice(n,s));ee*=1e6,V=1e6*V+i,V>=4294967296&&(ee+=Math.trunc(V/4294967296),ee>>>=0,V>>>=0)}if(t){const[n,s]=Jn(V,ee);V=n,ee=s}}}function Jn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Be(e){return Array.prototype.slice.call(e)}const xr=typeof BigInt=="function"?BigInt.asIntN:void 0,h1=typeof BigInt=="function"?BigInt.asUintN:void 0,Lt=Number.isSafeInteger,qr=Number.isFinite,Jt=Math.trunc,f1=Ae(0);function Lr(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function Ye(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Pr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Wi(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const d1=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Or(e){switch(typeof e){case"bigint":return!0;case"number":return qr(e);case"string":return d1.test(e);default:return!1}}function $t(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?0|e:void 0}function Hi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?e>>>0:void 0}function zi(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Xr(e),qn(V,ee))}function $n(e){return e=Jt(e),Lt(e)||(qt(e),e=Xn(V,ee)),e}function Ki(e){var t=Jt(Number(e));return Lt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),zi(e))}function Yi(e){var t=Jt(Number(e));return Lt(t)?Ae(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Ht()?Ae(xr(64,BigInt(e))):Ae(zi(e)))}function Xi(e){return Lt(e)?e=Ae($n(e)):(e=Jt(e),Lt(e)?e=String(e):(qt(e),e=qn(V,ee)),e=Ae(e)),e}function p1(e){return e==null?e:typeof e=="bigint"?(zn(e)?e=Number(e):(e=xr(64,e),e=zn(e)?Number(e):String(e)),e):Or(e)?typeof e=="number"?$n(e):Ki(e):void 0}function Jr(e){const t=typeof e;return e==null?e:t==="bigint"?Ae(xr(64,e)):Or(e)?t==="string"?Yi(e):Xi(e):void 0}function qi(e){if(typeof e!="string")throw Error();return e}function Rr(e){if(e!=null&&typeof e!="string")throw Error();return e}function he(e){return e==null||typeof e=="string"?e:void 0}function Zn(e,t,r,n){return e!=null&&e[Kt]===Yt?e:Array.isArray(e)?((n=(r=0|e[y])|32&n|2&n)!==r&&se(e,n),new t(e)):(r?2&n?((e=t[Oi])||(kr((e=new t).v),e=t[Oi]=e),t=e):t=new t:t=void 0,t)}function g1(e,t,r){if(t)e:{if(!Or(t=e))throw Gn("int64");switch(typeof t){case"string":t=Yi(t);break e;case"bigint":t=Ae(xr(64,t));break e;default:t=Xi(t)}}else t=Jr(e);return(e=t)==null?r?f1:void 0:e}const m1={};let y1=function(){try{return zr(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Qn{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),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,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const v1=y1?(Object.setPrototypeOf(Qn.prototype,Map.prototype),Object.defineProperties(Qn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Qn):class extends Map{constructor(){super()}};function Ji(e){return e}function es(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var it=class extends v1{constructor(e,t,r=Ji,n=Ji){super(),this.J=0|e[y],this.K=t,this.S=r,this.fa=this.K?_1:n;for(let s=0;s<e.length;s++){const i=e[s],o=r(i[0],!1,!0);let c=i[1];t?c===void 0&&(c=null):c=n(i[1],!1,!0,void 0,void 0,this.J),super.set(o,c)}}V(e){return Sr(Array.from(super.entries(),e))}clear(){es(this),super.clear()}delete(e){return es(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new Ii(e,b1,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new Ii(e,it.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,n,s)=>{e.call(t,s.get(n),n,s)}):super.forEach(e,t)}set(e,t){return es(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function _1(e,t,r,n,s,i){return e=Zn(e,n,r,i),s&&(e=ns(e)),e}function b1(e){return[e,this.get(e)]}let w1;function $i(){return w1||(w1=new it(kr([]),void 0,void 0,void 0,m1))}function $r(e){return we?e[we]:void 0}function Zr(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}it.prototype.toJSON=void 0;var ts=class{};const E1={Ka:!0};function A1(e,t){t<100||Wt(Q2,1)}function Qr(e,t,r,n){const s=n!==void 0;n=!!n;var i,o=we;!s&&zt&&o&&(i=e[o])&&Zr(i,A1),o=[];var c=e.length;let u;i=4294967295;let d=!1;const l=!!(64&t),f=l?128&t?0:-1:void 0;1&t||(u=c&&e[c-1],u!=null&&typeof u=="object"&&u.constructor===Object?i=--c:u=void 0,!l||128&t||s||(d=!0,i=i-f+f)),t=void 0;for(var m=0;m<c;m++){let A=e[m];if(A!=null&&(A=r(A,n))!=null)if(l&&m>=i){const j=m-f;(t??(t={}))[j]=A}else o[m]=A}if(u)for(let A in u){if((c=u[A])==null||(c=r(c,n))==null)continue;let j;m=+A,l&&!Number.isNaN(m)&&(j=m+f)<i?o[j]=c:(t??(t={}))[A]=c}return t&&(d?o.push(t):o[i]=t),s&&we&&(e=$r(e))&&e instanceof ts&&(o[we]=function(A){const j=new ts;return Zr(A,(ht,et,fe)=>{j[et]=Be(fe)}),j.da=A.da,j}(e)),o}function k1(e){return e[0]=Fr(e[0]),e[1]=Fr(e[1]),e}function Fr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return zn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[y];return e.length===0&&1&t?void 0:Qr(e,t,Fr)}if(e!=null&&e[Kt]===Yt)return Zi(e);if(e instanceof ze){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(Si){for(var r="",n=0,s=t.length-10240;n<s;)r+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?t.subarray(n):t),t=btoa(r)}else{r===void 0&&(r=0),ki(),r=Ai[r],n=Array(Math.floor(t.length/3)),s=r[64]||"";let d=0,l=0;for(;d<t.length-2;d+=3){var i=t[d],o=t[d+1],c=t[d+2],u=r[i>>2];i=r[(3&i)<<4|o>>4],o=r[(15&o)<<2|c>>6],c=r[63&c],n[l++]=u+i+o+c}switch(u=0,c=s,t.length-d){case 2:c=r[(15&(u=t[d+1]))<<2]||s;case 1:t=t[d],n[l]=r[t>>2]+r[(3&t)<<4|u>>4]+c+s}t=n.join("")}e=e.g=t}return e}return e instanceof it?e=e.size!==0?e.V(k1):void 0:void 0}return e}function Zi(e){return Qr(e=e.v,0|e[y],Fr)}let S1,T1;function Pt(e,t){return Qi(e,t[0],t[1])}function Qi(e,t,r,n=0){if(e==null){var s=32;r?(e=[r],s|=128):e=[],t&&(s=-16760833&s|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(s=0|e[y],bi&&1&s)throw Error("rfarr");if(2048&s&&!(2&s)&&function(){if(bi)throw Error("carr");Wt(e1,5)}(),256&s)throw Error("farr");if(64&s)return(s|n)!==s&&se(e,s|n),e;if(r&&(s|=128,r!==e[0]))throw Error("mid");e:{s|=64;var i=(r=e).length;if(i){var o=i-1;const u=r[o];if(u!=null&&typeof u=="object"&&u.constructor===Object){if((o-=t=128&s?0:-1)>=1024)throw Error("pvtlmt");for(var c in u)(i=+c)<o&&(r[i+t]=u[c],delete u[c]);s=-16760833&s|(1023&o)<<14;break e}}if(t){if((c=Math.max(t,i-(128&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&c)<<14}}}return se(e,64|s|n),e}function x1(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[y];return e.length===0&&1&r?void 0:eo(e,r,t)}if(e!=null&&e[Kt]===Yt)return to(e);if(e instanceof it){if(2&(t=e.J))return e;if(!e.size)return;if(r=kr(e.V()),e.K)for(e=0;e<r.length;e++){const n=r[e];let s=n[1];s=s==null||typeof s!="object"?void 0:s!=null&&s[Kt]===Yt?to(s):Array.isArray(s)?eo(s,0|s[y],!!(32&t)):void 0,n[1]=s}return r}return e instanceof ze?e:void 0}function eo(e,t,r){return 2&t||(!r||4096&t||16&t?e=Zt(e,t,!1,r&&!(16&t)):(Ar(e,34),4&t&&Object.freeze(e))),e}function rs(e,t,r){return e=new e.constructor(t),r&&(e.h=xt),e.m=xt,e}function to(e){const t=e.v,r=0|t[y];return Ee(e,r)?e:ss(e,t,r)?rs(e,t):Zt(t,r)}function Zt(e,t,r,n){return n??(n=!!(34&t)),e=Qr(e,t,x1,n),n=32,r&&(n|=2),se(e,t=16769217&t|n),e}function ns(e){const t=e.v,r=0|t[y];return Ee(e,r)?ss(e,t,r)?rs(e,t,!0):new e.constructor(Zt(t,r,!1)):e}function Qt(e){if(e.h!==xt)return!1;var t=e.v;return Ar(t=Zt(t,0|t[y]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function er(e){if(!Qt(e)&&Ee(e,0|e.v[y]))throw Error()}function Ot(e,t){t===void 0&&(t=0|e[y]),32&t&&!(4096&t)&&se(e,4096|t)}function ss(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(se(t,2|r),e.h=xt,!0)}const L1=Ae(0),dt={};function N(e,t,r,n,s){if((t=ot(e.v,t,r,s))!==null||n&&e.m!==xt)return t}function ot(e,t,r,n){if(t===-1)return null;const s=t+(r?0:-1),i=e.length-1;let o,c;if(!(i<1+(r?0:-1))){if(s>=i)if(o=e[i],o!=null&&typeof o=="object"&&o.constructor===Object)r=o[t],c=!0;else{if(s!==i)return;r=o}else r=e[s];if(n&&r!=null){if((n=n(r))==null)return n;if(!Object.is(n,r))return c?o[t]=n:e[s]=n,n}return r}}function R(e,t,r,n){er(e),ie(e=e.v,0|e[y],t,r,n)}function ie(e,t,r,n,s){const i=r+(s?0:-1);var o=e.length-1;if(o>=1+(s?0:-1)&&i>=o){const c=e[o];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=n,t}return i<=o?(e[i]=n,t):(n!==void 0&&(r>=(o=(t??(t=0|e[y]))>>14&1023||536870912)?n!=null&&(e[o+(s?0:-1)]={[r]:n}):e[i]=n),t)}function Rt(){return t1===void 0?2:4}function Ft(e,t,r,n,s){let i=e.v,o=0|i[y];n=Ee(e,o)?1:n,s=!!s||n===3,n===2&&Qt(e)&&(i=e.v,o=0|i[y]);let c=(e=is(i,t))===Tt?7:0|e[y],u=os(c,o);var d=!(4&u);if(d){4&u&&(e=Be(e),c=0,u=Ct(u,o),o=ie(i,o,t,e));let l=0,f=0;for(;l<e.length;l++){const m=r(e[l]);m!=null&&(e[f++]=m)}f<l&&(e.length=f),r=-513&(4|u),u=r&=-1025,u&=-4097}return u!==c&&(se(e,u),2&u&&Object.freeze(e)),ro(e,u,i,o,t,n,d,s)}function ro(e,t,r,n,s,i,o,c){let u=t;return i===1||i===4&&(2&t||!(16&t)&&32&n)?Mt(t)||((t|=!e.length||o&&!(4096&t)||32&n&&!(4096&t||16&t)?2:256)!==u&&se(e,t),Object.freeze(e)):(i===2&&Mt(t)&&(e=Be(e),u=0,t=Ct(t,n),n=ie(r,n,s,e)),Mt(t)||(c||(t|=16),t!==u&&se(e,t))),2&t||!(4096&t||16&t)||Ot(r,n),e}function is(e,t,r){return e=ot(e,t,r),Array.isArray(e)?e:Tt}function os(e,t){return 2&t&&(e|=2),1|e}function Mt(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function no(e){return Hn(e,!0)}function so(e){e=Be(e);for(let t=0;t<e.length;t++){const r=e[t]=Be(e[t]);Array.isArray(r[1])&&(r[1]=kr(r[1]))}return Sr(e)}function pt(e,t,r,n){er(e),ie(e=e.v,0|e[y],t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function tr(e,t,r){if(2&t)throw Error();const n=Xt(t);let s=is(e,r,n),i=s===Tt?7:0|s[y],o=os(i,t);return(2&o||Mt(o)||16&o)&&(o===i||Mt(o)||se(s,o),s=Be(s),i=0,o=Ct(o,t),ie(e,t,r,s,n)),o&=-13,o!==i&&se(s,o),s}function as(e,t){var r=ha;return us(cs(e=e.v),e,void 0,r)===t?t:-1}function cs(e){if(zt)return e[Er]??(e[Er]=new Map);if(Er in e)return e[Er];const t=new Map;return Object.defineProperty(e,Er,{value:t}),t}function io(e,t,r,n,s){const i=cs(e),o=us(i,e,t,r,s);return o!==n&&(o&&(t=ie(e,t,o,void 0,s)),i.set(r,n)),t}function us(e,t,r,n,s){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){const c=n[o];ot(t,c,s)!=null&&(i!==0&&(r=ie(t,r,i,void 0,s)),i=c)}return e.set(n,i),i}function ls(e,t,r){let n=0|e[y];const s=Xt(n),i=ot(e,r,s);let o;if(i!=null&&i[Kt]===Yt){if(!Ee(i))return Qt(i),i.v;o=i.v}else Array.isArray(i)&&(o=i);if(o){const c=0|o[y];2&c&&(o=Zt(o,c))}return o=Pt(o,t),o!==i&&ie(e,n,r,o,s),o}function oo(e,t,r,n,s){let i=!1;if((n=ot(e,n,s,o=>{const c=Zn(o,r,!1,t);return i=c!==o&&c!=null,c}))!=null)return i&&!Ee(n)&&Ot(e,t),n}function L(e,t,r,n){let s=e.v,i=0|s[y];if((t=oo(s,i,t,r,n))==null)return t;if(i=0|s[y],!Ee(e,i)){const o=ns(t);o!==t&&(Qt(e)&&(s=e.v,i=0|s[y]),i=ie(s,i,r,t=o,n),Ot(s,i))}return t}function ao(e,t,r,n,s,i,o,c){var u=Ee(e,r);i=u?1:i,o=!!o||i===3,u=c&&!u,(i===2||u)&&Qt(e)&&(r=0|(t=e.v)[y]);var d=(e=is(t,s))===Tt?7:0|e[y],l=os(d,r);if(c=!(4&l)){var f=e,m=r;const A=!!(2&l);A&&(m|=2);let j=!A,ht=!0,et=0,fe=0;for(;et<f.length;et++){const K=Zn(f[et],n,!1,m);if(K instanceof n){if(!A){const tt=Ee(K);j&&(j=!tt),ht&&(ht=tt)}f[fe++]=K}}fe<et&&(f.length=fe),l|=4,l=ht?-4097&l:4096|l,l=j?8|l:-9&l}if(l!==d&&(se(e,l),2&l&&Object.freeze(e)),u&&!(8&l||!e.length&&(i===1||i===4&&(2&l||!(16&l)&&32&r)))){for(Mt(l)&&(e=Be(e),l=Ct(l,r),r=ie(t,r,s,e)),n=e,u=l,d=0;d<n.length;d++)(f=n[d])!==(l=ns(f))&&(n[d]=l);u|=8,se(e,l=u=n.length?4096|u:-4097&u)}return ro(e,l,t,r,s,i,c,o)}function at(e,t,r){const n=e.v;return ao(e,n,0|n[y],t,r,Rt(),!1,!0)}function co(e){return e==null&&(e=void 0),e}function w(e,t,r,n,s){return R(e,r,n=co(n),s),n&&!Ee(n)&&Ot(e.v),e}function Mr(e,t,r,n){e:{var s=n=co(n);er(e);const i=e.v;let o=0|i[y];if(s==null){const c=cs(i);if(us(c,i,o,r)!==t)break e;c.set(r,0)}else o=io(i,o,r,t);ie(i,o,t,s)}n&&!Ee(n)&&Ot(e.v)}function Ct(e,t){return-273&(2&t?2|e:-3&e)}function hs(e,t,r,n){var s=n;er(e),e=ao(e,n=e.v,0|n[y],r,t,2,!0),s=s??new r,e.push(s),t=r=e===Tt?7:0|e[y],(s=Ee(s))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&se(e,r),s||Ot(n)}function Fe(e,t,r){return $t(N(e,t,void 0,r))}function uo(e){return(Bn?N(e,2,void 0,void 0,Jr):Jr(N(e,2)))??L1}function q(e,t){return N(e,t,void 0,void 0,Ye)??0}function ct(e,t,r){if(r!=null){if(typeof r!="number"||!qr(r))throw Gn("int32");r|=0}R(e,t,r)}function b(e,t,r){R(e,t,Lr(r))}function ke(e,t,r){pt(e,t,Rr(r),"")}function en(e,t,r){{er(e);const o=e.v;let c=0|o[y];if(r==null)ie(o,c,t);else{var n=e=r===Tt?7:0|r[y],s=Mt(e),i=s||Object.isFrozen(r);for(s||(e=0),i||(r=Be(r),n=0,e=Ct(e,c),i=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(Bn?1024:0),s=0;s<r.length;s++){const u=r[s],d=qi(u);Object.is(u,d)||(i&&(r=Be(r),n=0,e=Ct(e,c),i=!1),r[s]=d)}e!==n&&(i&&(r=Be(r),e=Ct(e,c)),se(r,e)),ie(o,c,t,r)}}}function tn(e,t,r){er(e),Ft(e,t,he,2,!0).push(qi(r))}var rr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function fs(e,t){if(typeof e=="string")return new rr(xi(e),t);if(Array.isArray(e))return new rr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new rr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new rr(e,!1);if(e.constructor===ze)return t=Vn(e)||new Uint8Array(0),new rr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new rr(e,!1);throw Error()}function nr(e,t){let r,n=0,s=0,i=0;const o=e.h;let c=e.g;do r=o[c++],n|=(127&r)<<i,i+=7;while(i<32&&128&r);if(i>32)for(s|=(127&r)>>4,i=3;i<32&&128&r;i+=7)r=o[c++],s|=(127&r)<<i;if(It(e,c),!(128&r))return t(n>>>0,s>>>0);throw Error()}function ds(e){let t=0,r=e.g;const n=r+10,s=e.h;for(;r<n;){const i=s[r++];if(t|=i,(128&i)==0)return It(e,r),!!(127&t)}throw Error()}function gt(e){const t=e.h;let r=e.g,n=t[r++],s=127&n;if(128&n&&(n=t[r++],s|=(127&n)<<7,128&n&&(n=t[r++],s|=(127&n)<<14,128&n&&(n=t[r++],s|=(127&n)<<21,128&n&&(n=t[r++],s|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return It(e,r),s}function ut(e){return gt(e)>>>0}function rn(e){var t=e.h;const r=e.g;var n=t[r],s=t[r+1];const i=t[r+2];return t=t[r+3],It(e,e.g+4),e=2*((s=(n<<0|s<<8|i<<16|t<<24)>>>0)>>31)+1,n=s>>>23&255,s&=8388607,n==255?s?NaN:e*(1/0):n==0?1401298464324817e-60*e*s:e*Math.pow(2,n-150)*(s+8388608)}function P1(e){return gt(e)}function It(e,t){if(e.g=t,t>e.l)throw Error()}function lo(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function ho(e,t){if(t==0)return St();var r=lo(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):c1?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?St():new ze(r,Gt)}var fo=[];function po(e,t,r,n){if(on.length){const s=on.pop();return s.o(n),s.g.init(e,t,r,n),s}return new O1(e,t,r,n)}function go(e){e.g.clear(),e.l=-1,e.h=-1,on.length<100&&on.push(e)}function mo(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=ut(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function nn(e){switch(e.h){case 0:e.h!=0?nn(e):ds(e.g);break;case 1:It(e=e.g,e.g+8);break;case 2:if(e.h!=2)nn(e);else{var t=ut(e.g);It(e=e.g,e.g+t)}break;case 5:It(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!mo(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}nn(e)}break;default:throw Error()}}function Cr(e,t,r){const n=e.g.l;var s=ut(e.g);let i=(s=e.g.g+s)-n;if(i<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),i=s-e.g.g),i)throw Error();return e.g.g=s,e.g.l=n,t}function ps(e){var t=ut(e.g),r=lo(e=e.g,t);if(e=e.h,V2){var n,s=e;(n=jn)||(n=jn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,s=r===0&&t===s.length?s:s.subarray(r,t);try{var i=n.decode(s)}catch(c){if(Hr===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Hr=!0}catch{Hr=!1}}throw!Hr&&(jn=void 0),c}}else{t=(i=r)+t,r=[];let c,u=null;for(;i<t;){var o=e[i++];o<128?r.push(o):o<224?i>=t?kt():(c=e[i++],o<194||(192&c)!=128?(i--,kt()):r.push((31&o)<<6|63&c)):o<240?i>=t-1?kt():(c=e[i++],(192&c)!=128||o===224&&c<160||o===237&&c>=160||(192&(n=e[i++]))!=128?(i--,kt()):r.push((15&o)<<12|(63&c)<<6|63&n)):o<=244?i>=t-2?kt():(c=e[i++],(192&c)!=128||c-144+(o<<28)>>30||(192&(n=e[i++]))!=128||(192&(s=e[i++]))!=128?(i--,kt()):(o=(7&o)<<18|(63&c)<<12|(63&n)<<6|63&s,o-=65536,r.push(55296+(o>>10&1023),56320+(1023&o)))):kt(),r.length>=8192&&(u=yi(u,r),r.length=0)}i=yi(u,r)}return i}function yo(e){const t=ut(e.g);return ho(e.g,t)}function sn(e,t,r){var n=ut(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var O1=class{constructor(e,t,r,n){if(fo.length){const s=fo.pop();s.init(e,t,r,n),e=s}else e=new class{constructor(s,i,o,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(s,i,o,c)}init(s,i,o,{Y:c=!1,ea:u=!1}={}){this.Y=c,this.ea=u,s&&(s=fs(s,this.ea),this.h=s.buffer,this.j=s.g,this.m=i||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,n);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(n)}o({ha:e=!1}={}){this.ha=e}},on=[];function vo(e){return e?/^\d+$/.test(e)?(Xr(e),new gs(V,ee)):null:R1||(R1=new gs(0,0))}var gs=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let R1;function _o(e){return e?/^-?\d+$/.test(e)?(Xr(e),new ms(V,ee)):null:F1||(F1=new ms(0,0))}var ms=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let F1;function sr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ir(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function an(e,t){if(t>=0)ir(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ys(e){var t=V;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function or(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Me(e,t,r){ir(e.g,8*t+r)}function vs(e,t){return Me(e,t,2),t=e.g.end(),or(e,t),t.push(e.h),t}function _s(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function cn(e,t,r){Me(e,t,2),ir(e.g,r.length),or(e,e.g.end()),or(e,r)}function un(e,t,r,n){r!=null&&(t=vs(e,t),n(r,e),_s(e,t))}function Xe(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var bs=Xe(),bo=Xe(),ws=Xe(),Es=Xe(),wo=Xe(),Eo=Xe(),M1=Xe(),ln=Xe(),Ao=Xe(),ko=Xe();function qe(e,t,r){var n=e.v;we&&we in n&&(n=n[we])&&delete n[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var v=class{constructor(e,t){this.v=Qi(e,t,void 0,2048)}toJSON(){return Zi(this)}j(){var s;var e=gc,t=this.v,r=e.g,n=we;if(zt&&n&&((s=t[n])==null?void 0:s[r])!=null&&Wt(Z2,3),t=e.g,Ri&&we&&Ri===void 0&&(n=(r=this.v)[we])&&(n=n.da))try{n(r,t,E1)}catch(i){_i(i)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[y];return ss(this,e,t)?rs(this,e,!0):new this.constructor(Zt(e,t,!1))}};v.prototype[Kt]=Yt,v.prototype.toString=function(){return this.v.toString()};var ar=class{constructor(e,t,r){this.g=e,this.h=t,e=bs,this.l=!!e&&r===e||!1}};function hn(e,t){return new ar(e,t,bs)}function So(e,t,r,n,s){un(e,r,Ro(t,n),s)}const C1=hn(function(e,t,r,n,s){return e.h===2&&(Cr(e,ls(t,n,r),s),!0)},So),I1=hn(function(e,t,r,n,s){return e.h===2&&(Cr(e,ls(t,n,r),s),!0)},So);var fn=Symbol(),dn=Symbol(),As=Symbol(),To=Symbol(),xo=Symbol();let Lo,Po;function jt(e,t,r,n){var s=n[e];if(s)return s;(s={}).qa=n,s.T=function(f){switch(typeof f){case"boolean":return S1||(S1=[0,void 0,!0]);case"number":return f>0?void 0:f===0?T1||(T1=[0,void 0]):[-f,void 0];case"string":return[0,f];case"object":return f}}(n[0]);var i=n[1];let o=1;i&&i.constructor===Object&&(s.ba=i,typeof(i=n[++o])=="function"&&(s.ma=!0,Lo??(Lo=i),Po??(Po=n[o+1]),i=n[o+=2]));const c={};for(;i&&Array.isArray(i)&&i.length&&typeof i[0]=="number"&&i[0]>0;){for(var u=0;u<i.length;u++)c[i[u]]=i;i=n[++o]}for(u=1;i!==void 0;){let f;typeof i=="number"&&(u+=i,i=n[++o]);var d=void 0;if(i instanceof ar?f=i:(f=C1,o--),f==null?void 0:f.l){i=n[++o],d=n;var l=o;typeof i=="function"&&(i=i(),d[l]=i),d=i}for(l=u+1,typeof(i=n[++o])=="number"&&i<0&&(l-=i,i=n[++o]);u<l;u++){const m=c[u];d?r(s,u,f,d,m):t(s,u,f,m)}}return n[e]=s}function Oo(e){return Array.isArray(e)?e[0]instanceof ar?e:[I1,e]:[e,void 0]}function Ro(e,t){return e instanceof v?e.v:Array.isArray(e)?Pt(e,t):void 0}function ks(e,t,r,n){const s=r.g;e[t]=n?(i,o,c)=>s(i,o,c,n):s}function Ss(e,t,r,n,s){const i=r.g;let o,c;e[t]=(u,d,l)=>i(u,d,l,c||(c=jt(dn,ks,Ss,n).T),o||(o=Ts(n)),s)}function Ts(e){let t=e[As];if(t!=null)return t;const r=jt(dn,ks,Ss,e);return t=r.ma?(n,s)=>Lo(n,s,r):(n,s)=>{for(;mo(s)&&s.h!=4;){var i=s.l,o=r[i];if(o==null){var c=r.ba;c&&(c=c[i])&&(c=N1(c))!=null&&(o=r[i]=c)}if(o==null||!o(s,n,i)){if(o=(c=s).m,nn(c),c.ha)var u=void 0;else u=c.g.g-o,c.g.g=o,u=ho(c.g,u);o=void 0,c=n,u&&((o=c[we]??(c[we]=new ts))[i]??(o[i]=[])).push(u)}}return(n=$r(n))&&(n.da=r.qa[xo]),!0},e[As]=t,e[xo]=j1.bind(e),t}function j1(e,t,r,n){var s=this[dn];const i=this[As],o=Pt(void 0,s.T),c=$r(e);if(c){var u=!1,d=s.ba;if(d){if(s=(l,f,m)=>{if(m.length!==0)if(d[f])for(const A of m){l=po(A);try{u=!0,i(o,l)}finally{go(l)}}else n==null||n(e,f,m)},t==null)Zr(c,s);else if(c!=null){const l=c[t];l&&s(c,t,l)}if(u){let l=0|e[y];if(2&l&&2048&l&&!(r!=null&&r.Ka))throw Error();const f=Xt(l),m=(A,j)=>{if(ot(e,A,f)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}j!=null&&(l=ie(e,l,A,j,f)),delete c[A]};t==null?ji(o,0|o[y],(A,j)=>{m(A,j)}):m(t,ot(o,t,f))}}}}function N1(e){const t=(e=Oo(e))[0].g;if(e=e[1]){const r=Ts(e),n=jt(dn,ks,Ss,e).T;return(s,i,o)=>t(s,i,o,n,r)}return t}function pn(e,t,r){e[t]=r.h}function gn(e,t,r,n){let s,i;const o=r.h;e[t]=(c,u,d)=>o(c,u,d,i||(i=jt(fn,pn,gn,n).T),s||(s=Fo(n)))}function Fo(e){let t=e[To];if(!t){const r=jt(fn,pn,gn,e);t=(n,s)=>Mo(n,s,r),e[To]=t}return t}function Mo(e,t,r){ji(e,0|e[y],(n,s)=>{if(s!=null){var i=function(o,c){var u=o[c];if(u)return u;if((u=o.ba)&&(u=u[c])){var d=(u=Oo(u))[0].h;if(u=u[1]){const l=Fo(u),f=jt(fn,pn,gn,u).T;u=o.ma?Po(f,l):(m,A,j)=>d(m,A,j,f,l)}else u=d;return o[c]=u}}(r,n);i?i(t,s,n):n<500||Wt(Wn,3)}}),(e=$r(e))&&Zr(e,(n,s,i)=>{for(or(t,t.g.end()),n=0;n<i.length;n++)or(t,Vn(i[n])||new Uint8Array(0))})}const D1=Ae(0);function cr(e,t){if(Array.isArray(t)){var r=0|t[y];if(4&r)return t;for(var n=0,s=0;n<t.length;n++){const i=e(t[n]);i!=null&&(t[s++]=i)}return s<n&&(t.length=s),(e=-1537&(5|r))!==r&&se(t,e),2&e&&Object.freeze(t),t}}function pe(e,t,r){return new ar(e,t,r)}function ur(e,t,r){return new ar(e,t,r)}function ae(e,t,r){ie(e,0|e[y],t,r,Xt(0|e[y]))}var B1=hn(function(e,t,r,n,s){if(e.h!==2)return!1;if(e=Be(e=Cr(e,Pt([void 0,void 0],n),s)),s=Xt(n=0|t[y]),2&n)throw Error();let i=ot(t,r,s);if(i instanceof it)2&i.J?(i=i.V(),i.push(e),ie(t,n,r,i,s)):i.Ma(e);else if(Array.isArray(i)){var o=0|i[y];8192&o||se(i,o|=8192),2&o&&(i=so(i),ie(t,n,r,i,s)),i.push(e)}else ie(t,n,r,Sr([e]),s);return!0},function(e,t,r,n,s){if(t instanceof it)t.forEach((i,o)=>{un(e,r,Pt([o,i],n),s)});else if(Array.isArray(t)){for(let i=0;i<t.length;i++){const o=t[i];Array.isArray(o)&&un(e,r,Pt(o,n),s)}Sr(t)}});function Co(e,t,r){(t=Ye(t))!=null&&(Me(e,r,5),e=e.g,Kn(t),ys(e))}function Io(e,t,r){if(t=function(n){if(n==null)return n;const s=typeof n;if(s==="bigint")return String(xr(64,n));if(Or(n)){if(s==="string")return Ki(n);if(s==="number")return $n(n)}}(t),t!=null&&(typeof t=="string"&&_o(t),t!=null))switch(Me(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,V,ee);break;case"bigint":r=BigInt.asUintN(64,t),r=new ms(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=_o(t),sr(e.g,r.h,r.g)}}function jo(e,t,r){(t=$t(t))!=null&&t!=null&&(Me(e,r,0),an(e.g,t))}function No(e,t,r){(t=Wi(t))!=null&&(Me(e,r,0),e.g.g.push(t?1:0))}function Do(e,t,r){(t=he(t))!=null&&cn(e,r,vi(t))}function Bo(e,t,r,n,s){un(e,r,Ro(t,n),s)}function Uo(e,t,r){(t=t==null||typeof t=="string"||t instanceof ze?t:void 0)!=null&&cn(e,r,fs(t,!0).buffer)}function Vo(e,t,r){return(e.h===5||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,rn,t):t.push(rn(e.g)),!0)}var te=pe(function(e,t,r){return e.h===5&&(ae(t,r,rn(e.g)),!0)},Co,ln),U1=ur(Vo,function(e,t,r){if((t=cr(Ye,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Me(n,s,5),n=n.g,Kn(i),ys(n))}},ln),xs=ur(Vo,function(e,t,r){if((t=cr(Ye,t))!=null&&t.length){Me(e,r,2),ir(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,Kn(t[n]),ys(r)}},ln),V1=pe(function(e,t,r){return e.h===5&&(ae(t,r,(e=rn(e.g))===0?void 0:e),!0)},Co,ln),mt=pe(function(e,t,r){return Dn?(e.h!==0?e=!1:(ae(t,r,nr(e.g,Vi)),e=!0),e):e.h===0&&(ae(t,r,nr(e.g,Xn)),!0)},Io,Eo),Ls=pe(function(e,t,r){return Dn?(e.h!==0?t=!1:(ae(t,r,(e=nr(e.g,Vi))===D1?void 0:e),t=!0),t):e.h===0&&(ae(t,r,(e=nr(e.g,Xn))===0?void 0:e),!0)},Io,Eo),G1=pe(function(e,t,r){return Dn?(e.h!==0?e=!1:(ae(t,r,nr(e.g,l1)),e=!0),e):e.h===0&&(ae(t,r,nr(e.g,Yn)),!0)},function(e,t,r){if(t=function(n){if(n==null)return n;var s=typeof n;if(s==="bigint")return String(h1(64,n));if(Or(n)){if(s==="string")return s=Jt(Number(n)),Lt(s)&&s>=0?n=String(s):((s=n.indexOf("."))!==-1&&(n=n.substring(0,s)),(s=n[0]!=="-"&&((s=n.length)<20||s===20&&n<="18446744073709551615"))||(Xr(n),n=Tr(V,ee))),n;if(s==="number")return(n=Jt(n))>=0&&Lt(n)||(qt(n),n=Yn(V,ee)),n}}(t),t!=null&&(typeof t=="string"&&vo(t),t!=null))switch(Me(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,V,ee);break;case"bigint":r=BigInt.asUintN(64,t),r=new gs(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=vo(t),sr(e.g,r.h,r.g)}},M1),ce=pe(function(e,t,r){return e.h===0&&(ae(t,r,gt(e.g)),!0)},jo,Es),Ir=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,gt,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=vs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);_s(e,r)}},Es),lr=pe(function(e,t,r){return e.h===0&&(ae(t,r,(e=gt(e.g))===0?void 0:e),!0)},jo,Es),J=pe(function(e,t,r){return e.h===0&&(ae(t,r,ds(e.g)),!0)},No,bo),Nt=pe(function(e,t,r){return e.h===0&&(ae(t,r,(e=ds(e.g))===!1?void 0:e),!0)},No,bo),de=ur(function(e,t,r){return e.h===2&&(e=ps(e),tr(t,0|t[y],r).push(e),!0)},function(e,t,r){if((t=cr(he,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&cn(n,s,vi(i))}},ws),yt=pe(function(e,t,r){return e.h===2&&(ae(t,r,(e=ps(e))===""?void 0:e),!0)},Do,ws),I=pe(function(e,t,r){return e.h===2&&(ae(t,r,ps(e)),!0)},Do,ws),ue=function(e,t,r=bs){return new ar(e,t,r)}(function(e,t,r,n,s){return e.h===2&&(n=Pt(void 0,n),tr(t,0|t[y],r).push(n),Cr(e,n,s),!0)},function(e,t,r,n,s){if(Array.isArray(t)){for(let i=0;i<t.length;i++)Bo(e,t[i],r,n,s);1&(e=0|t[y])||se(t,1|e)}}),$=hn(function(e,t,r,n,s,i){if(e.h!==2)return!1;let o=0|t[y];return io(t,o,i,r,Xt(o)),Cr(e,t=ls(t,n,r),s),!0},Bo),Go=pe(function(e,t,r){return e.h===2&&(ae(t,r,yo(e)),!0)},Uo,Ao),W1=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,ut,t):t.push(ut(e.g)),!0)},function(e,t,r){if((t=cr(Hi,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Me(n,s,0),ir(n.g,i))}},wo),H1=pe(function(e,t,r){return e.h===0&&(ae(t,r,(e=ut(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Hi(t))!=null&&t!=null&&(Me(e,r,0),ir(e.g,t))},wo),Se=pe(function(e,t,r){return e.h===0&&(ae(t,r,gt(e.g)),!0)},function(e,t,r){(t=$t(t))!=null&&(t=parseInt(t,10),Me(e,r,0),an(e.g,t))},ko);class z1{constructor(t,r){var n=Te;this.g=t,this.h=r,this.m=L,this.j=w,this.defaultValue=void 0,this.l=n.Oa!=null?Ni:void 0}register(){zr(this)}}function Je(e,t){return new z1(e,t)}function vt(e,t){return(r,n)=>{{const i={ea:!0};n&&Object.assign(i,n),r=po(r,void 0,void 0,i);try{const o=new e,c=o.v;Ts(t)(c,r);var s=o}finally{go(r)}}return s}}function mn(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Mo(this.v,t,jt(fn,pn,gn,e)),or(t,t.g.end());const r=new Uint8Array(t.h),n=t.l,s=n.length;let i=0;for(let o=0;o<s;o++){const c=n[o];r.set(c,i),i+=c.length}return t.l=[r],r}}var Wo=class extends v{constructor(e){super(e)}},Ho=[0,yt,pe(function(e,t,r){return e.h===2&&(ae(t,r,(e=yo(e))===St()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof v){const n=t.Ra;return void(n?(t=n(t),t!=null&&cn(e,r,fs(t,!0).buffer)):Wt(Wn,3))}if(Array.isArray(t))return void Wt(Wn,3)}Uo(e,t,r)},Ao)];let Ps,zo=globalThis.trustedTypes;function Ko(e){var t;return Ps===void 0&&(Ps=function(){let r=null;if(!zo)return r;try{const n=s=>s;r=zo.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r}()),e=(t=Ps)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function K1(e,...t){if(t.length===0)return Ko(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Ko(r)}var Yo=[0,ce,Se,J,-1,Ir,Se,-1,J],Y1=class extends v{constructor(e){super(e)}},Xo=[0,J,I,J,Se,-1,ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,P1,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=vs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);_s(e,r)}},ko),I,-1,[0,J,-1],Se,J,-1],qo=[0,3,J,-1,2,[0,ce],[0,Se,J],[0,I,-1],[0]],Jo=[0,I,-2],$o=class extends v{constructor(e){super(e)}},Zo=[0],Qo=[0,ce,J,1,J,-4],Te=class extends v{constructor(e){super(e,2)}},oe={};oe[336783863]=[0,I,J,-1,ce,[0,[1,2,3,4,5,6,7,8,9],$,Zo,$,Xo,$,Jo,$,Qo,$,Yo,$,[0,I,-2],$,[0,I,Se],$,qo,$,[0,Se,-1,J]],[0,I],J,[0,[1,3],[2,4],$,[0,Ir],-1,$,[0,de],-1,ue,[0,I,-1]],I];var ea=[0,Ls,-1,Nt,-3,Ls,Ir,yt,lr,Ls,-1,Nt,lr,Nt,-2,yt];function D(e,t){tn(e,3,t)}function S(e,t){tn(e,4,t)}var ye=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,7,e)}},jr=[-1,{}],ta=[0,I,1,jr],ra=[0,I,de,jr];function Ce(e,t){hs(e,1,ye,t)}function G(e,t){tn(e,10,t)}function P(e,t){tn(e,15,t)}var xe=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,1001,e)}},na=[-500,ue,[-500,yt,-1,de,-3,[-2,oe,J],ue,Ho,lr,-1,ta,ra,ue,[0,yt,Nt],yt,ea,lr,de,987,de],4,ue,[-500,I,-1,[-1,{}],998,I],ue,[-500,I,de,-1,[-2,{},J],997,de,-1],lr,ue,[-500,I,de,jr,998,de],de,lr,ta,ra,ue,[0,yt,-1,jr],de,-2,ea,yt,-1,Nt,[0,Nt,H1],978,jr,ue,Ho];xe.prototype.g=mn(na);var X1=vt(xe,na),q1=class extends v{constructor(e){super(e)}},sa=class extends v{constructor(e){super(e)}g(){return at(this,q1,1)}},ia=[0,ue,[0,ce,te,I,-1]],yn=vt(sa,ia),J1=class extends v{constructor(e){super(e)}},$1=class extends v{constructor(e){super(e)}},Os=class extends v{constructor(e){super(e)}l(){return L(this,J1,2)}g(){return at(this,$1,5)}},oa=vt(class extends v{constructor(e){super(e)}},[0,de,Ir,xs,[0,Se,[0,ce,-3],[0,te,-3],[0,ce,-1,[0,ue,[0,ce,-2]]],ue,[0,te,-1,I,te]],I,-1,mt,ue,[0,ce,te],de,mt]),aa=class extends v{constructor(e){super(e)}},hr=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,te,-4]]),ca=class extends v{constructor(e){super(e)}},Nr=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,te,-4]]),Z1=class extends v{constructor(e){super(e)}},Q1=[0,ce,-1,xs,Se],ua=class extends v{constructor(e){super(e)}};ua.prototype.g=mn([0,te,-4,mt]);var ec=class extends v{constructor(e){super(e)}},tc=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,1,ce,I,ia],mt]),la=class extends v{constructor(e){super(e)}},rc=class extends v{constructor(e){super(e)}na(){const e=N(this,1,void 0,void 0,no);return e??St()}},nc=class extends v{constructor(e){super(e)}},ha=[1,2],sc=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,ha,$,[0,xs],$,[0,Go],ce,I],mt]),Rs=class extends v{constructor(e){super(e)}},fa=[0,I,ce,te,de,-1],da=class extends v{constructor(e){super(e)}},ic=[0,J,-1],pa=class extends v{constructor(e){super(e)}},vn=[1,2,3,4,5,6],_n=class extends v{constructor(e){super(e)}g(){return N(this,1,void 0,void 0,no)!=null}l(){return he(N(this,2))!=null}},z=class extends v{constructor(e){super(e)}g(){return Wi(N(this,2))??!1}},ga=[0,Go,I,[0,ce,mt,-1],[0,G1,mt]],re=[0,ga,J,[0,vn,$,Qo,$,Xo,$,Yo,$,Zo,$,Jo,$,qo],Se],bn=class extends v{constructor(e){super(e)}},Fs=[0,re,te,-1,ce],oc=Je(502141897,bn);oe[502141897]=Fs;var ac=vt(class extends v{constructor(e){super(e)}},[0,[0,Se,-1,U1,W1],Q1]),ma=class extends v{constructor(e){super(e)}},ya=class extends v{constructor(e){super(e)}},Ms=[0,re,te,[0,re],J],cc=Je(508968150,ya);oe[508968150]=[0,re,Fs,Ms,te,[0,[0,ga]]],oe[508968149]=Ms;var fr=class extends v{constructor(e){super(e)}l(){return L(this,Rs,2)}g(){R(this,2)}},va=[0,re,fa];oe[478825465]=va;var uc=class extends v{constructor(e){super(e)}},_a=class extends v{constructor(e){super(e)}},Cs=class extends v{constructor(e){super(e)}},Is=class extends v{constructor(e){super(e)}},ba=class extends v{constructor(e){super(e)}},wa=[0,re,[0,re],va,-1],Ea=[0,re,te,ce],js=[0,re,te],Aa=[0,re,Ea,js,te],lc=Je(479097054,ba);oe[479097054]=[0,re,Aa,wa],oe[463370452]=wa,oe[464864288]=Ea;var hc=Je(462713202,Is);oe[462713202]=Aa,oe[474472470]=js;var fc=class extends v{constructor(e){super(e)}},ka=class extends v{constructor(e){super(e)}},Sa=class extends v{constructor(e){super(e)}},Ta=class extends v{constructor(e){super(e)}},Ns=[0,re,te,-1,ce],Ds=[0,re,te,J];Ta.prototype.g=mn([0,re,js,[0,re],Fs,Ms,Ns,Ds]);var xa=class extends v{constructor(e){super(e)}},dc=Je(456383383,xa);oe[456383383]=[0,re,fa];var La=class extends v{constructor(e){super(e)}},pc=Je(476348187,La);oe[476348187]=[0,re,ic];var Pa=class extends v{constructor(e){super(e)}},Oa=class extends v{constructor(e){super(e)}},Ra=[0,Se,-1],gc=Je(458105876,class extends v{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[y];return e=Ee(this,r),t=function(n,s,i,o){var c=Oa;!o&&Qt(n)&&(i=0|(s=n.v)[y]);var u=ot(s,2);if(n=!1,u==null){if(o)return $i();u=[]}else if(u.constructor===it){if(!(2&u.J)||o)return u;u=u.V()}else Array.isArray(u)?n=!!(2&(0|u[y])):u=[];if(o){if(!u.length)return $i();n||(n=!0,kr(u))}else n&&(n=!1,Sr(u),u=so(u));return!n&&32&i&&Ar(u,32),i=ie(s,i,2,o=new it(u,c,g1,void 0)),n||Ot(s,i),o}(this,t,r,e),!e&&Oa&&(t.ra=!0),t}});oe[458105876]=[0,Ra,B1,[!0,mt,[0,I,-1,de]],[0,Ir,J,Se]];var Bs=class extends v{constructor(e){super(e)}},Fa=Je(458105758,Bs);oe[458105758]=[0,re,I,Ra];var Us=class extends v{constructor(e){super(e)}},Ma=[0,V1,-1,Nt],mc=class extends v{constructor(e){super(e)}},Ca=class extends v{constructor(e){super(e)}},Vs=[1,2];Ca.prototype.g=mn([0,Vs,$,Ma,$,[0,ue,Ma]]);var Ia=class extends v{constructor(e){super(e)}},yc=Je(443442058,Ia);oe[443442058]=[0,re,I,ce,te,de,-1,J,te],oe[514774813]=Ns;var ja=class extends v{constructor(e){super(e)}},vc=Je(516587230,ja);function Gs(e,t){return t=t?t.clone():new Rs,e.displayNamesLocale!==void 0?R(t,1,Rr(e.displayNamesLocale)):e.displayNamesLocale===void 0&&R(t,1),e.maxResults!==void 0?ct(t,2,e.maxResults):"maxResults"in e&&R(t,2),e.scoreThreshold!==void 0?b(t,3,e.scoreThreshold):"scoreThreshold"in e&&R(t,3),e.categoryAllowlist!==void 0?en(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&R(t,4),e.categoryDenylist!==void 0?en(t,5,e.categoryDenylist):"categoryDenylist"in e&&R(t,5),t}function Na(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Ws(e,t=-1,r=""){return{categories:e.map(n=>({index:Fe(n,1)??0??-1,score:q(n,2)??0,categoryName:he(N(n,3))??""??"",displayName:he(N(n,4))??""??""})),headIndex:t,headName:r}}function _c(e){const t={classifications:at(e,ec,1).map(r=>{var n;return Ws(((n=L(r,sa,4))==null?void 0:n.g())??[],Fe(r,2)??0,he(N(r,3))??"")})};return function(r){return p1(Bn?N(r,2,void 0,void 0,Jr):N(r,2))}(e)!=null&&(t.timestampMs=Na(uo(e))),t}function Da(e){var o,c;var t=Ft(e,3,Ye,Rt()),r=Ft(e,2,$t,Rt()),n=Ft(e,1,he,Rt()),s=Ft(e,9,he,Rt());const i={categories:[],keypoints:[]};for(let u=0;u<t.length;u++)i.categories.push({score:t[u],index:r[u]??-1,categoryName:n[u]??"",displayName:s[u]??""});if((t=(o=L(e,Os,4))==null?void 0:o.l())&&(i.boundingBox={originX:Fe(t,1,dt)??0,originY:Fe(t,2,dt)??0,width:Fe(t,3,dt)??0,height:Fe(t,4,dt)??0,angle:0}),(c=L(e,Os,4))==null?void 0:c.g().length)for(const u of L(e,Os,4).g())i.keypoints.push({x:N(u,1,void 0,dt,Ye)??0,y:N(u,2,void 0,dt,Ye)??0,score:N(u,4,void 0,dt,Ye)??0,label:he(N(u,3,void 0,dt))??""});return i}function wn(e){const t=[];for(const r of at(e,ca,1))t.push({x:q(r,1)??0,y:q(r,2)??0,z:q(r,3)??0,visibility:q(r,4)??0});return t}function Dr(e){const t=[];for(const r of at(e,aa,1))t.push({x:q(r,1)??0,y:q(r,2)??0,z:q(r,3)??0,visibility:q(r,4)??0});return t}function Ba(e){return Array.from(e,t=>t>127?t-256:t)}function Ua(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,s=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],n+=e[i]*e[i],s+=t[i]*t[i];if(n<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*s)}let En;oe[516587230]=[0,re,Ns,Ds,te],oe[518928384]=Ds;const bc=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 Va(){if(En===void 0)try{await WebAssembly.instantiate(bc),En=!0}catch{En=!1}return En}async function Br(e,t=K1``){const r=await Va()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Dt=class{};function Ga(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Wa(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,n)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",s=>{n(s)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Ha(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function _(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function za(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[n,s]=Ha(t);return!e.l||n===e.i.canvas.width&&s===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=s),[n,s]}function Ka(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let s=0;s<t.length;s++)n[s]=e.i.stringToNewUTF8(t[s]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(const s of n)e.i._free(s);e.i._free(t)}function $e(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function _t(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(s,i,o)=>{i?(r(n,o),n=[]):n.push(s)}}Dt.forVisionTasks=function(e){return Br("vision",e)},Dt.forTextTasks=function(e){return Br("text",e)},Dt.forGenAiExperimentalTasks=function(e){return Br("genai_experimental",e)},Dt.forGenAiTasks=function(e){return Br("genai",e)},Dt.forAudioTasks=function(e){return Br("audio",e)},Dt.isSimdSupported=function(){return Va()};async function wc(e,t,r,n){return e=await(async(s,i,o,c,u)=>{if(i&&await Wa(i),!self.ModuleFactory||o&&(await Wa(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&u&&((i=self.Module).locateFile=u.locateFile,u.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=u.mainScriptUrlOrBlob)),u=await self.ModuleFactory(self.Module||u),self.ModuleFactory=self.Module=void 0,new s(u,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:s=>s.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&s.endsWith(".data")?r.assetBinaryPath.toString():s}),await e.o(n),e}function Hs(e,t){const r=L(e.baseOptions,_n,1)||new _n;typeof t=="string"?(R(r,2,Rr(t)),R(r,1)):t instanceof Uint8Array&&(R(r,1,Hn(t,!1)),R(r,2)),w(e.baseOptions,0,1,r)}function Ya(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function g(e,t){e.C=Math.max(e.C,t)}function An(e,t){e.B=new ye,ke(e.B,2,"PassThroughCalculator"),D(e.B,"free_memory"),S(e.B,"free_memory_unused_out"),G(t,"free_memory"),Ce(t,e.B)}function dr(e,t){D(e.B,t),S(e.B,t+"_unused_out")}function kn(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var zs=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,n,s,i,o,c;if(t){const u=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((s=L(this.baseOptions,_n,1))!=null&&s.g()||(i=L(this.baseOptions,_n,1))!=null&&i.l()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(d,l){let f=L(d.baseOptions,pa,3);if(!f){var m=f=new pa,A=new $o;Mr(m,4,vn,A)}"delegate"in l&&(l.delegate==="GPU"?(l=f,m=new Y1,Mr(l,2,vn,m)):(l=f,m=new $o,Mr(l,4,vn,m))),w(d.baseOptions,0,3,f)}(this,u),u.modelAssetPath)return fetch(u.modelAssetPath.toString()).then(d=>{if(d.ok)return d.arrayBuffer();throw Error(`Failed to fetch model: ${u.modelAssetPath} (${d.status})`)}).then(d=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(d),!0,!1,!1),Hs(this,"/model.dat"),this.m(),this.L()});if(u.modelAssetBuffer instanceof Uint8Array)Hs(this,u.modelAssetBuffer);else if(u.modelAssetBuffer)return async function(d){const l=[];for(var f=0;;){const{done:m,value:A}=await d.read();if(m)break;l.push(A),f+=A.length}if(l.length===0)return new Uint8Array(0);if(l.length===1)return l[0];d=new Uint8Array(f),f=0;for(const m of l)d.set(m,f),f+=m.length;return d}(u.modelAssetBuffer).then(d=>{Hs(this,d),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=X1(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,n)=>{this.H.push(Error(n))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Ya(this)}finishProcessing(){this.g.finishProcessing(),Ya(this)}close(){this.B=void 0,this.g.closeGraph()}};function bt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}zs.prototype.close=zs.prototype.close;class Ec{constructor(t,r,n,s){this.g=t,this.h=r,this.m=n,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Xa(e,t,r){const n=e.g;if(r=bt(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function qa(e,t){const r=e.g,n=bt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);const s=bt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);const i=bt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new Ec(r,n,s,i)}function Ks(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Ac(e,t,r,n){return Ks(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=qa(e,!0)),r=e.u):(e.A||(e.A=qa(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function Ja(e,t,r){return Ks(e,t),e=bt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),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.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function $a(e,t,r){Ks(e,t),e.B||(e.B=bt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function kc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Za=class{H(){return`
|
|
31
31
|
precision mediump float;
|
|
32
32
|
varying vec2 vTex;
|
|
33
33
|
uniform sampler2D inputTexture;
|
|
34
34
|
void main() {
|
|
35
35
|
gl_FragColor = texture2D(inputTexture, vTex);
|
|
36
36
|
}
|
|
37
|
-
`}m(){const e=this.g;if(this.h=
|
|
37
|
+
`}m(){const e=this.g;if(this.h=bt(e.createProgram(),"Failed to create WebGL program"),this.X=Xa(this,`
|
|
38
38
|
attribute vec2 aVertex;
|
|
39
39
|
attribute vec2 aTex;
|
|
40
40
|
varying vec2 vTex;
|
|
41
41
|
void main(void) {
|
|
42
42
|
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
43
43
|
vTex = aTex;
|
|
44
|
-
}`,e.VERTEX_SHADER),this.W=Xa(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function ct(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function zs(e){var t=ct(e,1);if(!t){if(t=ct(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=dr(e);var r=Ks(e);if($a(r,n,Qa(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let s=0,i=0;s<t.length;++s,i+=4)t[s]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function Qa(e){let t=ct(e,2);if(!t){const r=dr(e);t=t2(e);const n=zs(e),s=e2(e);r.texImage2D(r.TEXTURE_2D,0,s,e.width,e.height,0,r.RED,r.FLOAT,n),Ys(e)}return t}function dr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=yt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function e2(e){if(e=dr(e),!An)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))An=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");An=e.R16F}return An}function Ks(e){return e.l||(e.l=new Za),e.l}function t2(e){const t=dr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=ct(e,2);return r||(r=Ja(Ks(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Ys(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var An,le=class{constructor(e,t,r,n,s,i,o){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=s,this.width=i,this.height=o,this.j&&--r2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!ct(this,0)}ka(){return!!ct(this,1)}R(){return!!ct(this,2)}ja(){return(t=ct(e=this,0))||(t=zs(e),t=new Uint8Array(t.map(r=>Math.round(255*r))),e.g.push(t)),t;var e,t}ia(){return zs(this)}N(){return Qa(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=dr(this),s=Ks(this);n.activeTexture(n.TEXTURE1),r=Ja(s,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);const i=e2(this);n.texImage2D(n.TEXTURE_2D,0,i,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),$a(s,n,r),Ac(s,n,!1,()=>{t2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),Ys(this)}),kc(s),Ys(this)}}e.push(r)}return new le(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&dr(this).deleteTexture(ct(this,2)),r2=-1}};le.prototype.close=le.prototype.close,le.prototype.clone=le.prototype.clone,le.prototype.getAsWebGLTexture=le.prototype.N,le.prototype.getAsFloat32Array=le.prototype.ia,le.prototype.getAsUint8Array=le.prototype.ja,le.prototype.hasWebGLTexture=le.prototype.R,le.prototype.hasFloat32Array=le.prototype.ka,le.prototype.hasUint8Array=le.prototype.Fa;var r2=250;function Ve(...e){return e.map(([t,r])=>({start:t,end:r}))}const Sc=function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}}((n2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Ga()?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(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),v(this,n||"input_audio",i=>{v(this,s=s||"audio_header",o=>{this.i._configureAudio(i,o,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){Qe(this,"__graph_config__",t=>{e(t)}),v(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,s){const i=4*e.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(e,this.g/4),v(this,n,o=>{this.i._addAudioToInputStream(this.g,t,r,o,s)})}addGpuBufferToStream(e,t,r){v(this,t,n=>{const[s,i]=za(this,e,n);this.i._addBoundTextureToStream(n,s,i,r)})}addBoolToStream(e,t,r){v(this,t,n=>{this.i._addBoolToInputStream(e,n,r)})}addDoubleToStream(e,t,r){v(this,t,n=>{this.i._addDoubleToInputStream(e,n,r)})}addFloatToStream(e,t,r){v(this,t,n=>{this.i._addFloatToInputStream(e,n,r)})}addIntToStream(e,t,r){v(this,t,n=>{this.i._addIntToInputStream(e,n,r)})}addUintToStream(e,t,r){v(this,t,n=>{this.i._addUintToInputStream(e,n,r)})}addStringToStream(e,t,r){v(this,t,n=>{v(this,e,s=>{this.i._addStringToInputStream(s,n,r)})})}addStringRecordToStream(e,t,r){v(this,t,n=>{Ka(this,Object.keys(e),s=>{Ka(this,Object.values(e),i=>{this.i._addFlatHashMapToInputStream(s,i,Object.keys(e).length,n,r)})})})}addProtoToStream(e,t,r,n){v(this,r,s=>{v(this,t,i=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,i,s,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){v(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){v(this,t,n=>{const s=this.i._allocateBoolVector(e.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const i of e)this.i._addBoolVectorEntry(s,i);this.i._addBoolVectorToInputStream(s,n,r)})}addDoubleVectorToStream(e,t,r){v(this,t,n=>{const s=this.i._allocateDoubleVector(e.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const i of e)this.i._addDoubleVectorEntry(s,i);this.i._addDoubleVectorToInputStream(s,n,r)})}addFloatVectorToStream(e,t,r){v(this,t,n=>{const s=this.i._allocateFloatVector(e.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const i of e)this.i._addFloatVectorEntry(s,i);this.i._addFloatVectorToInputStream(s,n,r)})}addIntVectorToStream(e,t,r){v(this,t,n=>{const s=this.i._allocateIntVector(e.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const i of e)this.i._addIntVectorEntry(s,i);this.i._addIntVectorToInputStream(s,n,r)})}addUintVectorToStream(e,t,r){v(this,t,n=>{const s=this.i._allocateUintVector(e.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const i of e)this.i._addUintVectorEntry(s,i);this.i._addUintVectorToInputStream(s,n,r)})}addStringVectorToStream(e,t,r){v(this,t,n=>{const s=this.i._allocateStringVector(e.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const i of e)v(this,i,o=>{this.i._addStringVectorEntry(s,o)});this.i._addStringVectorToInputStream(s,n,r)})}addBoolToInputSidePacket(e,t){v(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){v(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){v(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){v(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){v(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){v(this,t,r=>{v(this,e,n=>{this.i._addStringToInputSidePacket(n,r)})})}addProtoToInputSidePacket(e,t,r){v(this,r,n=>{v(this,t,s=>{const i=this.i._malloc(e.length);this.i.HEAPU8.set(e,i),this.i._addProtoToInputSidePacket(i,e.length,s,n),this.i._free(i)})})}addBoolVectorToInputSidePacket(e,t){v(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputSidePacket(n,r)})}addDoubleVectorToInputSidePacket(e,t){v(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputSidePacket(n,r)})}addFloatVectorToInputSidePacket(e,t){v(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputSidePacket(n,r)})}addIntVectorToInputSidePacket(e,t){v(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputSidePacket(n,r)})}addUintVectorToInputSidePacket(e,t){v(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputSidePacket(n,r)})}addStringVectorToInputSidePacket(e,t){v(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)v(this,s,i=>{this.i._addStringVectorEntry(n,i)});this.i._addStringVectorToInputSidePacket(n,r)})}attachBoolListener(e,t){Qe(this,e,t),v(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){mt(this,e,t),v(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){Qe(this,e,t),v(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){mt(this,e,t),v(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){Qe(this,e,t),v(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){mt(this,e,t),v(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){Qe(this,e,t),v(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){mt(this,e,t),v(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){Qe(this,e,t),v(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){mt(this,e,t),v(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){Qe(this,e,t),v(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){mt(this,e,t),v(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){Qe(this,e,t),v(this,e,n=>{this.i._attachProtoListener(n,r||!1)})}attachProtoVectorListener(e,t,r){mt(this,e,t),v(this,e,n=>{this.i._attachProtoVectorListener(n,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Qe(this,e,(n,s)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,s)}),v(this,e,n=>{this.i._attachAudioListener(n,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends n2{get ga(){return this.i}pa(e,t,r){v(this,t,n=>{const[s,i]=za(this,e,n);this.ga._addBoundTextureAsImageToStream(n,s,i,r)})}Z(e,t){Qe(this,e,t),v(this,e,r=>{this.ga._attachImageListener(r)})}aa(e,t){mt(this,e,t),v(this,e,r=>{this.ga._attachImageVectorListener(r)})}}));var n2,Ge=class extends Sc{};async function x(e,t,r){return async function(n,s,i,o){return wc(n,s,i,o)}(e,r.canvas??(Ga()?void 0:document.createElement("canvas")),t,r)}function s2(e,t,r,n){if(e.U){const i=new ua;if(r!=null&&r.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var s=r.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(s.left<0||s.top<0||s.right>1||s.bottom>1)throw Error("Expected RectF values to be in [0,1].");_(i,1,(s.left+s.right)/2),_(i,2,(s.top+s.bottom)/2),_(i,4,s.right-s.left),_(i,3,s.bottom-s.top)}else _(i,1,.5),_(i,2,.5),_(i,4,1),_(i,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(_(i,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[o,c]=Ha(t);r=Y(i,3)*c/o,s=Y(i,4)*o/c,_(i,4,r),_(i,3,s)}}e.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.pa(t,e.X,n??performance.now()),e.finishProcessing()}function We(e,t,r){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");s2(e,t,r,e.C+1)}function et(e,t,r,n){var s;if(!((s=e.baseOptions)!=null&&s.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");s2(e,t,r,n)}function pr(e,t,r,n){var s=t.data;const i=t.width,o=i*(t=t.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return e=new le([s],r,!1,e.g.i.canvas,e.P,i,t),n?e.clone():e}var Le=class extends Ws{constructor(e,t,r,n){super(e),this.g=e,this.X=t,this.U=r,this.oa=n,this.P=new Za}l(e,t=!0){if("runningMode"in e&&F(this.baseOptions,2,Lr(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Le.prototype.close=Le.prototype.close;var je=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},w(e=this.h=new vn,0,1,t=new K),_(this.h,2,.5),_(this.h,3,.3)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&_(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&_(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},We(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},et(this,e,r,t),this.j}m(){var e=new xe;H(e,"image_in"),H(e,"norm_rect_in"),P(e,"detections");const t=new Te;$e(t,oc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),U(r,"IMAGE:image_in"),U(r,"NORM_RECT:norm_rect_in"),S(r,"DETECTIONS:detections"),r.o(t),Ie(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=oa(i),this.j.detections.push(Da(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.detectForVideo=je.prototype.G,je.prototype.detect=je.prototype.F,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=async function(e,t){return x(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return x(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return x(je,e,t)};var Xs=Ve([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]),qs=Ve([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]),Js=Ve([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),i2=Ve([474,475],[475,476],[476,477],[477,474]),$s=Ve([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]),Zs=Ve([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),o2=Ve([469,470],[470,471],[471,472],[472,469]),Qs=Ve([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]),a2=[...Xs,...qs,...Js,...$s,...Zs,...Qs],c2=Ve([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 u2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var z=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,w(e=this.h=new ya,0,1,t=new K),this.A=new ma,w(this.h,0,3,this.A),this.u=new vn,w(this.h,0,2,this.u),ot(this.u,4,1),_(this.u,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numFaces"in e&&ot(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&_(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return u2(this),We(this,e,t),this.j}G(e,t,r){return u2(this),et(this,e,r,t),this.j}m(){var e=new xe;H(e,"image_in"),H(e,"norm_rect"),P(e,"face_landmarks");const t=new Te;$e(t,cc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),U(r,"IMAGE:image_in"),U(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Ie(e,r),this.g.attachProtoVectorListener("face_landmarks",(n,s)=>{for(const i of n)n=jr(i),this.j.faceLandmarks.push(_n(n));g(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{g(this,n)}),this.outputFaceBlendshapes&&(P(e,"blendshapes"),S(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,s)=>{if(this.outputFaceBlendshapes)for(const i of n)n=gn(i),this.j.faceBlendshapes.push(Vs(n.g()??[]));g(this,s)}),this.g.attachEmptyPacketListener("blendshapes",n=>{g(this,n)})),this.outputFacialTransformationMatrixes&&(P(e,"face_geometry"),S(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,s)=>{if(this.outputFacialTransformationMatrixes)for(const i of n)(n=L(n=ac(i),Z1,2))&&this.j.facialTransformationMatrixes.push({rows:Me(n,1)??0??0,columns:Me(n,2)??0??0,data:Pt(n,3,qe,Lt()).slice()??[]});g(this,s)}),this.g.attachEmptyPacketListener("face_geometry",n=>{g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};z.prototype.detectForVideo=z.prototype.G,z.prototype.detect=z.prototype.F,z.prototype.setOptions=z.prototype.o,z.createFromModelPath=function(e,t){return x(z,e,{baseOptions:{modelAssetPath:t}})},z.createFromModelBuffer=function(e,t){return x(z,e,{baseOptions:{modelAssetBuffer:t}})},z.createFromOptions=function(e,t){return x(z,e,t)},z.FACE_LANDMARKS_LIPS=Xs,z.FACE_LANDMARKS_LEFT_EYE=qs,z.FACE_LANDMARKS_LEFT_EYEBROW=Js,z.FACE_LANDMARKS_LEFT_IRIS=i2,z.FACE_LANDMARKS_RIGHT_EYE=$s,z.FACE_LANDMARKS_RIGHT_EYEBROW=Zs,z.FACE_LANDMARKS_RIGHT_IRIS=o2,z.FACE_LANDMARKS_FACE_OVAL=Qs,z.FACE_LANDMARKS_CONTOURS=a2,z.FACE_LANDMARKS_TESSELATION=c2;var ei=Ve([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 l2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function h2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function f2(e,t=!0){const r=[];for(const s of e){var n=gn(s);e=[];for(const i of n.g())n=t&&Me(i,1)!=null?Me(i,1)??0:-1,e.push({score:Y(i,2)??0,index:n,categoryName:he(B(i,3))??""??"",displayName:he(B(i,4))??""??""});r.push(e)}return r}var Pe=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.j=new ba,0,1,t=new K),this.u=new Ms,w(this.j,0,2,this.u),this.D=new Rs,w(this.u,0,3,this.D),this.A=new _a,w(this.u,0,2,this.A),this.h=new uc,w(this.j,0,3,this.h),_(this.A,2,.5),_(this.u,4,.5),_(this.D,2,.5)}get baseOptions(){return L(this.j,K,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){var s,i,o,c;if(ot(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new hr,r=t,n=Us(e.cannedGesturesClassifierOptions,(s=L(this.h,hr,3))==null?void 0:s.l());w(r,0,2,n),w(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((i=L(this.h,hr,3))==null||i.g());return e.customGesturesClassifierOptions?(w(r=t=new hr,0,2,n=Us(e.customGesturesClassifierOptions,(o=L(this.h,hr,4))==null?void 0:o.l())),w(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=L(this.h,hr,4))==null||c.g()),this.l(e)}Ha(e,t){return l2(this),We(this,e,t),h2(this)}Ia(e,t,r){return l2(this),et(this,e,r,t),h2(this)}m(){var e=new xe;H(e,"image_in"),H(e,"norm_rect"),P(e,"hand_gestures"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Te;$e(t,lc,this.j);const r=new ye;ke(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),U(r,"IMAGE:image_in"),U(r,"NORM_RECT:norm_rect"),S(r,"HAND_GESTURES:hand_gestures"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ie(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n){n=jr(i);const o=[];for(const c of it(n,ca,1))o.push({x:Y(c,1)??0,y:Y(c,2)??0,z:Y(c,3)??0,visibility:Y(c,4)??0});this.landmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n){n=lr(i);const o=[];for(const c of it(n,aa,1))o.push({x:Y(c,1)??0,y:Y(c,2)??0,z:Y(c,3)??0,visibility:Y(c,4)??0});this.worldLandmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,s)=>{this.gestures.push(...f2(n,!1)),g(this,s)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{this.handedness.push(...f2(n)),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function d2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Pe.prototype.recognizeForVideo=Pe.prototype.Ia,Pe.prototype.recognize=Pe.prototype.Ha,Pe.prototype.setOptions=Pe.prototype.o,Pe.createFromModelPath=function(e,t){return x(Pe,e,{baseOptions:{modelAssetPath:t}})},Pe.createFromModelBuffer=function(e,t){return x(Pe,e,{baseOptions:{modelAssetBuffer:t}})},Pe.createFromOptions=function(e,t){return x(Pe,e,t)},Pe.HAND_CONNECTIONS=ei;var ve=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.h=new Ms,0,1,t=new K),this.u=new Rs,w(this.h,0,3,this.u),this.j=new _a,w(this.h,0,2,this.j),ot(this.j,3,1),_(this.j,2,.5),_(this.u,2,.5),_(this.h,4,.5)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numHands"in e&&ot(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],We(this,e,t),d2(this)}G(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],et(this,e,r,t),d2(this)}m(){var e=new xe;H(e,"image_in"),H(e,"norm_rect"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Te;$e(t,hc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),U(r,"IMAGE:image_in"),U(r,"NORM_RECT:norm_rect"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ie(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n)n=jr(i),this.landmarks.push(_n(n));g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n)n=lr(i),this.worldLandmarks.push(Nr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{var i=this.handedness,o=i.push;const c=[];for(const u of n){n=gn(u);const d=[];for(const l of n.g())d.push({score:Y(l,2)??0,index:Me(l,1)??0??-1,categoryName:he(B(l,3))??""??"",displayName:he(B(l,4))??""??""});c.push(d)}o.call(i,...c),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ve.prototype.detectForVideo=ve.prototype.G,ve.prototype.detect=ve.prototype.F,ve.prototype.setOptions=ve.prototype.o,ve.createFromModelPath=function(e,t){return x(ve,e,{baseOptions:{modelAssetPath:t}})},ve.createFromModelBuffer=function(e,t){return x(ve,e,{baseOptions:{modelAssetBuffer:t}})},ve.createFromOptions=function(e,t){return x(ve,e,t)},ve.HAND_CONNECTIONS=ei;var p2=Ve([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 g2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function m2(e){try{if(!e.D)return e.h;e.D(e.h)}finally{En(e)}}function kn(e,t){e=jr(e),t.push(_n(e))}var V=class extends Le{constructor(e,t){super(new Ge(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,w(e=this.j=new Ta,0,1,t=new K),this.I=new Rs,w(this.j,0,2,this.I),this.W=new fc,w(this.j,0,3,this.W),this.u=new vn,w(this.j,0,4,this.u),this.O=new ma,w(this.j,0,5,this.O),this.A=new ka,w(this.j,0,6,this.A),this.M=new Sa,w(this.j,0,7,this.M),_(this.u,2,.5),_(this.u,3,.3),_(this.O,2,.5),_(this.A,2,.5),_(this.A,3,.3),_(this.M,2,.5),_(this.I,2,.5)}get baseOptions(){return L(this.j,K,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&_(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&_(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&_(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&_(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&_(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&_(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:r,g2(this),We(this,e,n),m2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.D=typeof r=="function"?r:n,g2(this),et(this,e,s,t),m2(this)}m(){var e=new xe;H(e,"input_frames_image"),P(e,"pose_landmarks"),P(e,"pose_world_landmarks"),P(e,"face_landmarks"),P(e,"left_hand_landmarks"),P(e,"left_hand_world_landmarks"),P(e,"right_hand_landmarks"),P(e,"right_hand_world_landmarks");const t=new Te,r=new Wo;ke(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(s,i){if(i!=null)if(Array.isArray(i))F(s,2,$r(i,0,Fr));else{if(!(typeof i=="string"||i instanceof Ye||Dn(i)))throw Error("invalid value in Any.value field: "+i+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");ht(s,2,Gn(i,!1),Et())}}(r,this.j.g());const n=new ye;ke(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),us(n,8,Wo,r),U(n,"IMAGE:input_frames_image"),S(n,"POSE_LANDMARKS:pose_landmarks"),S(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),S(n,"FACE_LANDMARKS:face_landmarks"),S(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),S(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),S(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),S(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ie(e,n),wn(this,e),this.g.attachProtoListener("pose_landmarks",(s,i)=>{kn(s,this.h.poseLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("pose_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("pose_world_landmarks",(s,i)=>{var o=this.h.poseWorldLandmarks;s=lr(s),o.push(Nr(s)),g(this,i)}),this.g.attachEmptyPacketListener("pose_world_landmarks",s=>{g(this,s)}),this.outputPoseSegmentationMasks&&(S(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),fr(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(s,i)=>{this.h.poseSegmentationMasks=[pr(this,s,!0,!this.D)],g(this,i)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",s=>{this.h.poseSegmentationMasks=[],g(this,s)})),this.g.attachProtoListener("face_landmarks",(s,i)=>{kn(s,this.h.faceLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{g(this,s)}),this.outputFaceBlendshapes&&(P(e,"extra_blendshapes"),S(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(s,i)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(s=gn(s),o.push(Vs(s.g()??[]))),g(this,i)}),this.g.attachEmptyPacketListener("extra_blendshapes",s=>{g(this,s)})),this.g.attachProtoListener("left_hand_landmarks",(s,i)=>{kn(s,this.h.leftHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("left_hand_world_landmarks",(s,i)=>{var o=this.h.leftHandWorldLandmarks;s=lr(s),o.push(Nr(s)),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_landmarks",(s,i)=>{kn(s,this.h.rightHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_world_landmarks",(s,i)=>{var o=this.h.rightHandWorldLandmarks;s=lr(s),o.push(Nr(s)),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",s=>{g(this,s)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};V.prototype.detectForVideo=V.prototype.G,V.prototype.detect=V.prototype.F,V.prototype.setOptions=V.prototype.o,V.createFromModelPath=function(e,t){return x(V,e,{baseOptions:{modelAssetPath:t}})},V.createFromModelBuffer=function(e,t){return x(V,e,{baseOptions:{modelAssetBuffer:t}})},V.createFromOptions=function(e,t){return x(V,e,t)},V.HAND_CONNECTIONS=ei,V.POSE_CONNECTIONS=p2,V.FACE_LANDMARKS_LIPS=Xs,V.FACE_LANDMARKS_LEFT_EYE=qs,V.FACE_LANDMARKS_LEFT_EYEBROW=Js,V.FACE_LANDMARKS_LEFT_IRIS=i2,V.FACE_LANDMARKS_RIGHT_EYE=$s,V.FACE_LANDMARKS_RIGHT_EYEBROW=Zs,V.FACE_LANDMARKS_RIGHT_IRIS=o2,V.FACE_LANDMARKS_FACE_OVAL=Qs,V.FACE_LANDMARKS_CONTOURS=a2,V.FACE_LANDMARKS_TESSELATION=c2;var Ne=class extends Le{constructor(e,t){super(new Ge(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},w(e=this.h=new xa,0,1,t=new K)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return w(this.h,0,2,Us(e,L(this.h,Ps,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},We(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},et(this,e,r,t),this.j}m(){var e=new xe;H(e,"input_image"),H(e,"norm_rect"),P(e,"classifications");const t=new Te;$e(t,dc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),U(r,"IMAGE:input_image"),U(r,"NORM_RECT:norm_rect"),S(r,"CLASSIFICATIONS:classifications"),r.o(t),Ie(e,r),this.g.attachProtoListener("classifications",(n,s)=>{this.j=_c(tc(n)),g(this,s)}),this.g.attachEmptyPacketListener("classifications",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ne.prototype.classifyForVideo=Ne.prototype.ta,Ne.prototype.classify=Ne.prototype.sa,Ne.prototype.setOptions=Ne.prototype.o,Ne.createFromModelPath=function(e,t){return x(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return x(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return x(Ne,e,t)};var Oe=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect",!0),this.h=new La,this.embeddings={embeddings:[]},w(e=this.h,0,1,t=new K)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){var t=this.h,r=L(this.h,da,2);return r=r?r.clone():new da,e.l2Normalize!==void 0?F(r,1,Lr(e.l2Normalize)):"l2Normalize"in e&&F(r,1),e.quantize!==void 0?F(r,2,Lr(e.quantize)):"quantize"in e&&F(r,2),w(t,0,2,r),this.l(e)}za(e,t){return We(this,e,t),this.embeddings}Aa(e,t,r){return et(this,e,r,t),this.embeddings}m(){var e=new xe;H(e,"image_in"),H(e,"norm_rect"),P(e,"embeddings_out");const t=new Te;$e(t,pc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),U(r,"IMAGE:image_in"),U(r,"NORM_RECT:norm_rect"),S(r,"EMBEDDINGS:embeddings_out"),r.o(t),Ie(e,r),this.g.attachProtoListener("embeddings_out",(n,s)=>{n=sc(n),this.embeddings=function(i){return{embeddings:it(i,nc,1).map(o=>{var d,l;const c={headIndex:Me(o,3)??0??-1,headName:he(B(o,4))??""??""};var u=o.v;return oo(u,0|u[m],la,is(o,1))!==void 0?(o=Pt(o=L(o,la,is(o,1),void 0),1,qe,Lt()),c.floatEmbedding=o.slice()):(u=new Uint8Array(0),c.quantizedEmbedding=((l=(d=L(o,rc,is(o,2),void 0))==null?void 0:d.na())==null?void 0:l.h())??u),c}),timestampMs:Na(uo(i))}}(n),g(this,s)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Oe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Ua(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Ua(Ba(e.quantizedEmbedding),Ba(t.quantizedEmbedding))}return e},Oe.prototype.embedForVideo=Oe.prototype.Aa,Oe.prototype.embed=Oe.prototype.za,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(e,t){return x(Oe,e,{baseOptions:{modelAssetPath:t}})},Oe.createFromModelBuffer=function(e,t){return x(Oe,e,{baseOptions:{modelAssetBuffer:t}})},Oe.createFromOptions=function(e,t){return x(Oe,e,t)};var ti=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function Tc(e){var r,n;const t=function(s){return it(s,ye,1)}(e.ca()).filter(s=>(he(B(s,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((n=(r=L(t[0],Te,7))==null?void 0:r.j())==null?void 0:n.g())??new Map).forEach((s,i)=>{e.u[Number(i)]=he(B(s,1))??""})}function y2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function v2(e){try{const t=new ti(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{En(e)}}ti.prototype.close=ti.prototype.close;var _e=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ns,this.A=new Pa,w(this.h,0,3,this.A),w(e=this.h,0,1,t=new K)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?F(this.h,2,Or(e.displayNamesLocale)):"displayNamesLocale"in e&&F(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){Tc(this)}segment(e,t,r){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,y2(this),We(this,e,n),v2(this)}La(e,t,r,n){const s=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,y2(this),et(this,e,s,t),v2(this)}Da(){return this.u}m(){var e=new xe;H(e,"image_in"),H(e,"norm_rect");const t=new Te;$e(t,Ra,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),U(r,"IMAGE:image_in"),U(r,"NORM_RECT:norm_rect"),r.o(t),Ie(e,r),wn(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),fr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>pr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),fr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=pr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Da,_e.prototype.segmentForVideo=_e.prototype.La,_e.prototype.segment=_e.prototype.segment,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return x(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return x(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return x(_e,e,t)};var ri=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};ri.prototype.close=ri.prototype.close;var tt=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ns,this.u=new Pa,w(this.h,0,3,this.u),w(e=this.h,0,1,t=new K)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){const s=typeof r!="function"?r:{};if(this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new Ca,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var i=new Ds;ht(i,3,Lr(!0),!1),ht(i,1,xr(t.keypoint.x),0),ht(i,2,xr(t.keypoint.y),0),Rr(n,1,Bs,i)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const c=new mc;for(i of t.scribble)ht(t=new Ds,3,Lr(!0),!1),ht(t,1,xr(i.x),0),ht(t,2,xr(i.y),0),us(c,1,Ds,t);Rr(n,2,Bs,c)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",r),We(this,e,s);e:{try{const c=new ri(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{En(this)}o=void 0}return o}m(){var e=new xe;H(e,"image_in"),H(e,"roi_in"),H(e,"norm_rect_in");const t=new Te;$e(t,Ra,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),U(r,"IMAGE:image_in"),U(r,"ROI:roi_in"),U(r,"NORM_RECT:norm_rect_in"),r.o(t),Ie(e,r),wn(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),fr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>pr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),fr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=pr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};tt.prototype.segment=tt.prototype.segment,tt.prototype.setOptions=tt.prototype.o,tt.createFromModelPath=function(e,t){return x(tt,e,{baseOptions:{modelAssetPath:t}})},tt.createFromModelBuffer=function(e,t){return x(tt,e,{baseOptions:{modelAssetBuffer:t}})},tt.createFromOptions=function(e,t){return x(tt,e,t)};var De=class extends Le{constructor(e,t){super(new Ge(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},w(e=this.h=new Ia,0,1,t=new K)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?F(this.h,2,Or(e.displayNamesLocale)):"displayNamesLocale"in e&&F(this.h,2),e.maxResults!==void 0?ot(this.h,3,e.maxResults):"maxResults"in e&&F(this.h,3),e.scoreThreshold!==void 0?_(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&F(this.h,4),e.categoryAllowlist!==void 0?Zr(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&F(this.h,5),e.categoryDenylist!==void 0?Zr(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&F(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},We(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},et(this,e,r,t),this.j}m(){var e=new xe;H(e,"input_frame_gpu"),H(e,"norm_rect"),P(e,"detections");const t=new Te;$e(t,yc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),U(r,"IMAGE:input_frame_gpu"),U(r,"NORM_RECT:norm_rect"),S(r,"DETECTIONS:detections"),r.o(t),Ie(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=oa(i),this.j.detections.push(Da(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.prototype.detectForVideo=De.prototype.G,De.prototype.detect=De.prototype.F,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=async function(e,t){return x(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return x(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return x(De,e,t)};var ni=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function _2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function b2(e){try{const t=new ni(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{En(e)}}ni.prototype.close=ni.prototype.close;var Fe=class extends Le{constructor(e,t){super(new Ge(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,w(e=this.h=new ja,0,1,t=new K),this.A=new Sa,w(this.h,0,3,this.A),this.j=new ka,w(this.h,0,2,this.j),ot(this.j,4,1),_(this.j,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return L(this.h,K,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numPoses"in e&&ot(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&_(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&_(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,_2(this),We(this,e,n),b2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:n,_2(this),et(this,e,s,t),b2(this)}m(){var e=new xe;H(e,"image_in"),H(e,"norm_rect"),P(e,"normalized_landmarks"),P(e,"world_landmarks"),P(e,"segmentation_masks");const t=new Te;$e(t,vc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),U(r,"IMAGE:image_in"),U(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:normalized_landmarks"),S(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Ie(e,r),wn(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,s)=>{this.landmarks=[];for(const i of n)n=jr(i),this.landmarks.push(_n(n));g(this,s)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],g(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,s)=>{this.worldLandmarks=[];for(const i of n)n=lr(i),this.worldLandmarks.push(Nr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],g(this,n)}),this.outputSegmentationMasks&&(S(r,"SEGMENTATION_MASK:segmentation_masks"),fr(this,"segmentation_masks"),this.g.aa("segmentation_masks",(n,s)=>{this.segmentationMasks=n.map(i=>pr(this,i,!0,!this.u)),g(this,s)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Fe.prototype.detectForVideo=Fe.prototype.G,Fe.prototype.detect=Fe.prototype.F,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return x(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return x(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return x(Fe,e,t)},Fe.POSE_CONNECTIONS=p2;const xc=["Smile","Blink","Turn_Head","Thumbs_Up"],Lc=({apiUrl:e,onComplete:t,duration:r})=>{var He;const s=r||60,i=Z.useRef(null),o=Z.useRef(),c=Z.useRef(null),[u,d]=Z.useState({face:null,hand:null}),[l,f]=Z.useState("loading"),[b,A]=Z.useState(""),[I,jt]=Z.useState([]),[Re,pe]=Z.useState(0),[j,Nt]=Z.useState(s),[ut,Br]=Z.useState(!1);Z.useEffect(()=>{(async()=>{try{const D=await It.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm"),J=await z.createFromOptions(D,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO"}),ge=await ve.createFromOptions(D,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numHands:1});d({face:J,hand:ge}),Sn(),f("ready")}catch{A("Failed to load security assets. Please check your connection."),f("error")}})()},[]),Z.useEffect(()=>(l==="capturing"&&j>0?c.current=setInterval(()=>Nt(N=>N-1),1e3):j===0&&l==="capturing"&&(f("expired"),clearInterval(c.current)),()=>clearInterval(c.current)),[l,j]);const Sn=()=>{jt([...xc].sort(()=>.5-Math.random()).slice(0,3))},ii=()=>{f("capturing")},oi=()=>{pe(0),Nt(s),Br(!1),A(""),Sn(),f("ready")},Tn=(N,D,J)=>{var ge,ze;if(ut)return!1;if(J==="Thumbs_Up"&&((ge=D==null?void 0:D.landmarks)==null?void 0:ge.length)>0){const G=D.landmarks[0];return G[4].y<G[2].y&&[8,12,16,20].every(oe=>G[oe].y>G[oe-2].y)}if(((ze=N==null?void 0:N.faceLandmarks)==null?void 0:ze.length)>0){const G=N.faceLandmarks[0];switch(J){case"Smile":return G[291].x-G[61].x>.175;case"Blink":return(Math.abs(G[159].y-G[145].y)+Math.abs(G[386].y-G[374].y))/2<.01;case"Turn_Head":const Ke=(G[1].x-G[33].x)/(G[263].x-G[33].x);return Ke<.2||Ke>.8;default:return!1}}return!1},Ur=Z.useCallback(async()=>{var N,D;if(l==="capturing"&&((D=(N=i.current)==null?void 0:N.video)==null?void 0:D.readyState)===4){const J=i.current.video,ge=performance.now(),ze=u.face.detectForVideo(J,ge),G=u.hand.detectForVideo(J,ge);if(Tn(ze,G,I[Re])){Re<2?(Br(!0),setTimeout(()=>{pe(oe=>oe+1),Br(!1)},800)):ai();return}}o.current=requestAnimationFrame(Ur)},[l,Re,u,I,ut]);Z.useEffect(()=>(l==="capturing"&&(o.current=requestAnimationFrame(Ur)),()=>cancelAnimationFrame(o.current)),[l,Ur]);const ai=async()=>{var N;clearInterval(c.current),f("verifying");try{const D=i.current.video,J=[];for(let oe=0;oe<5;oe++){const Ke=performance.now(),vt=u.face.detectForVideo(D,Ke);if((N=vt.faceLandmarks)!=null&&N[0]){const _t=xn(D,vt.faceLandmarks[0]);J.push(_t.toDataURL("image/jpeg",.95))}await new Promise(_t=>setTimeout(_t,60))}const ge=new FormData;for(let oe=0;oe<J.length;oe++){const Ke=await(await fetch(J[oe])).blob();ge.append("files",Ke,`frame_${oe}.jpg`)}(await(await fetch(`${e}/v1/verify`,{method:"POST",body:ge})).json()).is_live?(f("success"),setTimeout(()=>t({success:!0,image:J[J.length-1]}),2e3)):(A("Security Check Failed. Low skin confidence score."),f("error"))}catch(D){console.log(D),A("Unable to reach verification server. "),f("error")}},xn=(N,D)=>{const J=document.createElement("canvas"),ge=J.getContext("2d"),ze=D.map(Dt=>Dt.x*N.videoWidth),G=D.map(Dt=>Dt.y*N.videoHeight),oe=Math.min(...ze),Ke=Math.max(...ze),vt=Math.min(...G),_t=Math.max(...G),Ln=Ke-oe,ci=_t-vt,bt=Ln*.25;return J.width=224,J.height=224,ge.drawImage(N,oe-bt,vt-bt,Ln+bt*2,ci+bt*2,0,0,224,224),J};return l==="loading"?R.jsx("div",{style:w2,children:"Initializing Security Assets..."}):R.jsxs("div",{style:w2,children:[l==="success"&&R.jsxs("div",{style:{padding:"40px 20px"},children:[R.jsx("div",{style:{fontSize:"50px",marginBottom:"20px"},children:"✅"}),R.jsx("h2",{style:{color:"#4CAF50"},children:"Verification Complete"}),R.jsx("p",{children:"Identity confirmed."})]}),(l==="expired"||l==="error")&&R.jsx("div",{style:si,children:R.jsxs("div",{style:Rc,children:[R.jsx("div",{style:{fontSize:"40px"},children:l==="expired"?"⏰":"❌"}),R.jsx("h3",{style:{margin:"10px 0"},children:l==="expired"?"Time Expired":"Verification Failed"}),R.jsx("p",{style:{color:"#ccc",fontSize:"14px"},children:b||"The process was interrupted or timed out."}),R.jsx("button",{onClick:oi,style:E2,children:"Try Again"})]})}),["ready","capturing","verifying"].includes(l)&&R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:Pc,children:[R.jsxs("h2",{style:{margin:0,fontSize:"1.2rem"},children:[l==="ready"&&"Identity Verification",l==="verifying"&&"Analyzing...",l==="capturing"&&R.jsx("span",{style:{color:ut?"#4CAF50":"white"},children:ut?"Great!":`${(He=I[Re])==null?void 0:He.replace("_"," ")}`})]}),l==="capturing"&&R.jsxs("div",{style:{...Oc,color:j<=10?"#ff4d4d":"white"},children:[j,"s"]})]}),R.jsxs("div",{style:Fc,children:[R.jsx(D2,{ref:i,mirrored:!0,screenshotFormat:"image/jpeg",style:{width:"100%",borderRadius:"12px",border:l==="capturing"?"2px solid #007bff":"2px solid #333",opacity:l==="ready"?.4:1,transition:"all 0.4s ease"}}),l==="ready"&&R.jsxs("div",{style:si,children:[R.jsx("button",{onClick:ii,style:E2,children:"Start Challenge"}),R.jsxs("p",{style:{marginTop:"12px",fontSize:"13px",color:"#aaa"},children:["3 steps • ",r," seconds"]})]}),l==="verifying"&&R.jsx("div",{style:si,children:R.jsx("p",{style:{marginTop:"15px",fontWeight:"bold"},children:"Securing Session..."})})]}),R.jsx("div",{style:{marginTop:"15px",minHeight:"20px"},children:R.jsxs("p",{style:{color:ut?"#4CAF50":"#888",margin:0,fontSize:"14px"},children:[l==="capturing"&&!ut&&"Please perform the action above.",ut&&"Step verified! Get ready..."]})})]})]})},w2={textAlign:"center",color:"white",background:"#121212",padding:"24px",borderRadius:"20px",width:"100%",maxWidth:"450px",margin:"0 auto",boxShadow:"0 10px 30px rgba(0,0,0,0.5)"},Pc={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px",minHeight:"40px"},Oc={fontSize:"18px",fontWeight:"800",background:"rgba(255,255,255,0.1)",padding:"4px 12px",borderRadius:"20px"},Fc={position:"relative",overflow:"hidden",borderRadius:"12px"},si={position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.75)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},Rc={background:"#1e1e1e",padding:"30px",borderRadius:"15px",border:"1px solid #333",maxWidth:"80%",textAlign:"center"},E2={padding:"12px 30px",fontSize:"16px",fontWeight:"bold",background:"#007bff",border:"none",color:"white",borderRadius:"10px",cursor:"pointer",transition:"transform 0.2s"},Mc=async(e,t,r)=>{const n=new FormData;t.forEach((i,o)=>{n.append("files",i,`frame_${o}.jpg`)}),n.append("challenge",r);const s=await fetch(`${e}/v1/verify`,{method:"POST",body:n});if(!s.ok)throw new Error("Network response was not ok");return await s.json()};rt.LivenessSDK=Lc,rt.verifyLiveness=Mc,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})});
|
|
44
|
+
}`,e.VERTEX_SHADER),this.W=Xa(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function lt(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Ys(e){var t=lt(e,1);if(!t){if(t=lt(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=pr(e);var r=Xs(e);if($a(r,n,Qa(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let s=0,i=0;s<t.length;++s,i+=4)t[s]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function Qa(e){let t=lt(e,2);if(!t){const r=pr(e);t=t2(e);const n=Ys(e),s=e2(e);r.texImage2D(r.TEXTURE_2D,0,s,e.width,e.height,0,r.RED,r.FLOAT,n),qs(e)}return t}function pr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=bt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function e2(e){if(e=pr(e),!Sn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Sn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Sn=e.R16F}return Sn}function Xs(e){return e.l||(e.l=new Za),e.l}function t2(e){const t=pr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=lt(e,2);return r||(r=Ja(Xs(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function qs(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Sn,le=class{constructor(e,t,r,n,s,i,o){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=s,this.width=i,this.height=o,this.j&&--r2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!lt(this,0)}ka(){return!!lt(this,1)}R(){return!!lt(this,2)}ja(){return(t=lt(e=this,0))||(t=Ys(e),t=new Uint8Array(t.map(r=>Math.round(255*r))),e.g.push(t)),t;var e,t}ia(){return Ys(this)}N(){return Qa(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=pr(this),s=Xs(this);n.activeTexture(n.TEXTURE1),r=Ja(s,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);const i=e2(this);n.texImage2D(n.TEXTURE_2D,0,i,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),$a(s,n,r),Ac(s,n,!1,()=>{t2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),qs(this)}),kc(s),qs(this)}}e.push(r)}return new le(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&pr(this).deleteTexture(lt(this,2)),r2=-1}};le.prototype.close=le.prototype.close,le.prototype.clone=le.prototype.clone,le.prototype.getAsWebGLTexture=le.prototype.N,le.prototype.getAsFloat32Array=le.prototype.ia,le.prototype.getAsUint8Array=le.prototype.ja,le.prototype.hasWebGLTexture=le.prototype.R,le.prototype.hasFloat32Array=le.prototype.ka,le.prototype.hasUint8Array=le.prototype.Fa;var r2=250;function Ue(...e){return e.map(([t,r])=>({start:t,end:r}))}const Sc=function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}}((n2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Ga()?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(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),_(this,n||"input_audio",i=>{_(this,s=s||"audio_header",o=>{this.i._configureAudio(i,o,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){$e(this,"__graph_config__",t=>{e(t)}),_(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,s){const i=4*e.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(e,this.g/4),_(this,n,o=>{this.i._addAudioToInputStream(this.g,t,r,o,s)})}addGpuBufferToStream(e,t,r){_(this,t,n=>{const[s,i]=za(this,e,n);this.i._addBoundTextureToStream(n,s,i,r)})}addBoolToStream(e,t,r){_(this,t,n=>{this.i._addBoolToInputStream(e,n,r)})}addDoubleToStream(e,t,r){_(this,t,n=>{this.i._addDoubleToInputStream(e,n,r)})}addFloatToStream(e,t,r){_(this,t,n=>{this.i._addFloatToInputStream(e,n,r)})}addIntToStream(e,t,r){_(this,t,n=>{this.i._addIntToInputStream(e,n,r)})}addUintToStream(e,t,r){_(this,t,n=>{this.i._addUintToInputStream(e,n,r)})}addStringToStream(e,t,r){_(this,t,n=>{_(this,e,s=>{this.i._addStringToInputStream(s,n,r)})})}addStringRecordToStream(e,t,r){_(this,t,n=>{Ka(this,Object.keys(e),s=>{Ka(this,Object.values(e),i=>{this.i._addFlatHashMapToInputStream(s,i,Object.keys(e).length,n,r)})})})}addProtoToStream(e,t,r,n){_(this,r,s=>{_(this,t,i=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,i,s,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){_(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateBoolVector(e.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const i of e)this.i._addBoolVectorEntry(s,i);this.i._addBoolVectorToInputStream(s,n,r)})}addDoubleVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateDoubleVector(e.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const i of e)this.i._addDoubleVectorEntry(s,i);this.i._addDoubleVectorToInputStream(s,n,r)})}addFloatVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateFloatVector(e.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const i of e)this.i._addFloatVectorEntry(s,i);this.i._addFloatVectorToInputStream(s,n,r)})}addIntVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateIntVector(e.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const i of e)this.i._addIntVectorEntry(s,i);this.i._addIntVectorToInputStream(s,n,r)})}addUintVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateUintVector(e.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const i of e)this.i._addUintVectorEntry(s,i);this.i._addUintVectorToInputStream(s,n,r)})}addStringVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateStringVector(e.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const i of e)_(this,i,o=>{this.i._addStringVectorEntry(s,o)});this.i._addStringVectorToInputStream(s,n,r)})}addBoolToInputSidePacket(e,t){_(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){_(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){_(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){_(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){_(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){_(this,t,r=>{_(this,e,n=>{this.i._addStringToInputSidePacket(n,r)})})}addProtoToInputSidePacket(e,t,r){_(this,r,n=>{_(this,t,s=>{const i=this.i._malloc(e.length);this.i.HEAPU8.set(e,i),this.i._addProtoToInputSidePacket(i,e.length,s,n),this.i._free(i)})})}addBoolVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputSidePacket(n,r)})}addDoubleVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputSidePacket(n,r)})}addFloatVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputSidePacket(n,r)})}addIntVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputSidePacket(n,r)})}addUintVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputSidePacket(n,r)})}addStringVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)_(this,s,i=>{this.i._addStringVectorEntry(n,i)});this.i._addStringVectorToInputSidePacket(n,r)})}attachBoolListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){$e(this,e,t),_(this,e,n=>{this.i._attachProtoListener(n,r||!1)})}attachProtoVectorListener(e,t,r){_t(this,e,t),_(this,e,n=>{this.i._attachProtoVectorListener(n,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),$e(this,e,(n,s)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,s)}),_(this,e,n=>{this.i._attachAudioListener(n,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends n2{get ga(){return this.i}pa(e,t,r){_(this,t,n=>{const[s,i]=za(this,e,n);this.ga._addBoundTextureAsImageToStream(n,s,i,r)})}Z(e,t){$e(this,e,t),_(this,e,r=>{this.ga._attachImageListener(r)})}aa(e,t){_t(this,e,t),_(this,e,r=>{this.ga._attachImageVectorListener(r)})}}));var n2,Ve=class extends Sc{};async function x(e,t,r){return async function(n,s,i,o){return wc(n,s,i,o)}(e,r.canvas??(Ga()?void 0:document.createElement("canvas")),t,r)}function s2(e,t,r,n){if(e.U){const i=new ua;if(r!=null&&r.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var s=r.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(s.left<0||s.top<0||s.right>1||s.bottom>1)throw Error("Expected RectF values to be in [0,1].");b(i,1,(s.left+s.right)/2),b(i,2,(s.top+s.bottom)/2),b(i,4,s.right-s.left),b(i,3,s.bottom-s.top)}else b(i,1,.5),b(i,2,.5),b(i,4,1),b(i,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(b(i,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[o,c]=Ha(t);r=q(i,3)*c/o,s=q(i,4)*o/c,b(i,4,r),b(i,3,s)}}e.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.pa(t,e.X,n??performance.now()),e.finishProcessing()}function Ge(e,t,r){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");s2(e,t,r,e.C+1)}function Ze(e,t,r,n){var s;if(!((s=e.baseOptions)!=null&&s.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");s2(e,t,r,n)}function gr(e,t,r,n){var s=t.data;const i=t.width,o=i*(t=t.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return e=new le([s],r,!1,e.g.i.canvas,e.P,i,t),n?e.clone():e}var Le=class extends zs{constructor(e,t,r,n){super(e),this.g=e,this.X=t,this.U=r,this.oa=n,this.P=new Za}l(e,t=!0){if("runningMode"in e&&R(this.baseOptions,2,Pr(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Le.prototype.close=Le.prototype.close;var Ie=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},w(e=this.h=new bn,0,1,t=new z),b(this.h,2,.5),b(this.h,3,.3)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&b(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&b(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},Ge(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect_in"),P(e,"detections");const t=new Te;qe(t,oc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect_in"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=oa(i),this.j.detections.push(Da(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ie.prototype.detectForVideo=Ie.prototype.G,Ie.prototype.detect=Ie.prototype.F,Ie.prototype.setOptions=Ie.prototype.o,Ie.createFromModelPath=async function(e,t){return x(Ie,e,{baseOptions:{modelAssetPath:t}})},Ie.createFromModelBuffer=function(e,t){return x(Ie,e,{baseOptions:{modelAssetBuffer:t}})},Ie.createFromOptions=function(e,t){return x(Ie,e,t)};var Js=Ue([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]),$s=Ue([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]),Zs=Ue([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),i2=Ue([474,475],[475,476],[476,477],[477,474]),Qs=Ue([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]),ei=Ue([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),o2=Ue([469,470],[470,471],[471,472],[472,469]),ti=Ue([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]),a2=[...Js,...$s,...Zs,...Qs,...ei,...ti],c2=Ue([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 u2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var W=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,w(e=this.h=new ya,0,1,t=new z),this.A=new ma,w(this.h,0,3,this.A),this.u=new bn,w(this.h,0,2,this.u),ct(this.u,4,1),b(this.u,2,.5),b(this.A,2,.5),b(this.h,4,.5)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numFaces"in e&&ct(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&b(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&b(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return u2(this),Ge(this,e,t),this.j}G(e,t,r){return u2(this),Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"face_landmarks");const t=new Te;qe(t,cc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("face_landmarks",(n,s)=>{for(const i of n)n=Nr(i),this.j.faceLandmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{g(this,n)}),this.outputFaceBlendshapes&&(P(e,"blendshapes"),S(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,s)=>{if(this.outputFaceBlendshapes)for(const i of n)n=yn(i),this.j.faceBlendshapes.push(Ws(n.g()??[]));g(this,s)}),this.g.attachEmptyPacketListener("blendshapes",n=>{g(this,n)})),this.outputFacialTransformationMatrixes&&(P(e,"face_geometry"),S(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,s)=>{if(this.outputFacialTransformationMatrixes)for(const i of n)(n=L(n=ac(i),Z1,2))&&this.j.facialTransformationMatrixes.push({rows:Fe(n,1)??0??0,columns:Fe(n,2)??0??0,data:Ft(n,3,Ye,Rt()).slice()??[]});g(this,s)}),this.g.attachEmptyPacketListener("face_geometry",n=>{g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};W.prototype.detectForVideo=W.prototype.G,W.prototype.detect=W.prototype.F,W.prototype.setOptions=W.prototype.o,W.createFromModelPath=function(e,t){return x(W,e,{baseOptions:{modelAssetPath:t}})},W.createFromModelBuffer=function(e,t){return x(W,e,{baseOptions:{modelAssetBuffer:t}})},W.createFromOptions=function(e,t){return x(W,e,t)},W.FACE_LANDMARKS_LIPS=Js,W.FACE_LANDMARKS_LEFT_EYE=$s,W.FACE_LANDMARKS_LEFT_EYEBROW=Zs,W.FACE_LANDMARKS_LEFT_IRIS=i2,W.FACE_LANDMARKS_RIGHT_EYE=Qs,W.FACE_LANDMARKS_RIGHT_EYEBROW=ei,W.FACE_LANDMARKS_RIGHT_IRIS=o2,W.FACE_LANDMARKS_FACE_OVAL=ti,W.FACE_LANDMARKS_CONTOURS=a2,W.FACE_LANDMARKS_TESSELATION=c2;var ri=Ue([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 l2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function h2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function f2(e,t=!0){const r=[];for(const s of e){var n=yn(s);e=[];for(const i of n.g())n=t&&Fe(i,1)!=null?Fe(i,1)??0:-1,e.push({score:q(i,2)??0,index:n,categoryName:he(N(i,3))??""??"",displayName:he(N(i,4))??""??""});r.push(e)}return r}var Pe=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.j=new ba,0,1,t=new z),this.u=new Is,w(this.j,0,2,this.u),this.D=new Cs,w(this.u,0,3,this.D),this.A=new _a,w(this.u,0,2,this.A),this.h=new uc,w(this.j,0,3,this.h),b(this.A,2,.5),b(this.u,4,.5),b(this.D,2,.5)}get baseOptions(){return L(this.j,z,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){var s,i,o,c;if(ct(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&b(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&b(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new fr,r=t,n=Gs(e.cannedGesturesClassifierOptions,(s=L(this.h,fr,3))==null?void 0:s.l());w(r,0,2,n),w(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((i=L(this.h,fr,3))==null||i.g());return e.customGesturesClassifierOptions?(w(r=t=new fr,0,2,n=Gs(e.customGesturesClassifierOptions,(o=L(this.h,fr,4))==null?void 0:o.l())),w(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=L(this.h,fr,4))==null||c.g()),this.l(e)}Ha(e,t){return l2(this),Ge(this,e,t),h2(this)}Ia(e,t,r){return l2(this),Ze(this,e,r,t),h2(this)}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"hand_gestures"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Te;qe(t,lc,this.j);const r=new ye;ke(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"HAND_GESTURES:hand_gestures"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n){n=Nr(i);const o=[];for(const c of at(n,ca,1))o.push({x:q(c,1)??0,y:q(c,2)??0,z:q(c,3)??0,visibility:q(c,4)??0});this.landmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n){n=hr(i);const o=[];for(const c of at(n,aa,1))o.push({x:q(c,1)??0,y:q(c,2)??0,z:q(c,3)??0,visibility:q(c,4)??0});this.worldLandmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,s)=>{this.gestures.push(...f2(n,!1)),g(this,s)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{this.handedness.push(...f2(n)),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function d2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Pe.prototype.recognizeForVideo=Pe.prototype.Ia,Pe.prototype.recognize=Pe.prototype.Ha,Pe.prototype.setOptions=Pe.prototype.o,Pe.createFromModelPath=function(e,t){return x(Pe,e,{baseOptions:{modelAssetPath:t}})},Pe.createFromModelBuffer=function(e,t){return x(Pe,e,{baseOptions:{modelAssetBuffer:t}})},Pe.createFromOptions=function(e,t){return x(Pe,e,t)},Pe.HAND_CONNECTIONS=ri;var ve=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.h=new Is,0,1,t=new z),this.u=new Cs,w(this.h,0,3,this.u),this.j=new _a,w(this.h,0,2,this.j),ct(this.j,3,1),b(this.j,2,.5),b(this.u,2,.5),b(this.h,4,.5)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numHands"in e&&ct(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&b(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&b(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ge(this,e,t),d2(this)}G(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ze(this,e,r,t),d2(this)}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Te;qe(t,hc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n)n=Nr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n)n=hr(i),this.worldLandmarks.push(Dr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{var i=this.handedness,o=i.push;const c=[];for(const u of n){n=yn(u);const d=[];for(const l of n.g())d.push({score:q(l,2)??0,index:Fe(l,1)??0??-1,categoryName:he(N(l,3))??""??"",displayName:he(N(l,4))??""??""});c.push(d)}o.call(i,...c),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ve.prototype.detectForVideo=ve.prototype.G,ve.prototype.detect=ve.prototype.F,ve.prototype.setOptions=ve.prototype.o,ve.createFromModelPath=function(e,t){return x(ve,e,{baseOptions:{modelAssetPath:t}})},ve.createFromModelBuffer=function(e,t){return x(ve,e,{baseOptions:{modelAssetBuffer:t}})},ve.createFromOptions=function(e,t){return x(ve,e,t)},ve.HAND_CONNECTIONS=ri;var p2=Ue([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 g2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function m2(e){try{if(!e.D)return e.h;e.D(e.h)}finally{kn(e)}}function Tn(e,t){e=Nr(e),t.push(wn(e))}var B=class extends Le{constructor(e,t){super(new Ve(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,w(e=this.j=new Ta,0,1,t=new z),this.I=new Cs,w(this.j,0,2,this.I),this.W=new fc,w(this.j,0,3,this.W),this.u=new bn,w(this.j,0,4,this.u),this.O=new ma,w(this.j,0,5,this.O),this.A=new ka,w(this.j,0,6,this.A),this.M=new Sa,w(this.j,0,7,this.M),b(this.u,2,.5),b(this.u,3,.3),b(this.O,2,.5),b(this.A,2,.5),b(this.A,3,.3),b(this.M,2,.5),b(this.I,2,.5)}get baseOptions(){return L(this.j,z,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&b(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&b(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&b(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&b(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&b(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&b(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&b(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:r,g2(this),Ge(this,e,n),m2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.D=typeof r=="function"?r:n,g2(this),Ze(this,e,s,t),m2(this)}m(){var e=new xe;G(e,"input_frames_image"),P(e,"pose_landmarks"),P(e,"pose_world_landmarks"),P(e,"face_landmarks"),P(e,"left_hand_landmarks"),P(e,"left_hand_world_landmarks"),P(e,"right_hand_landmarks"),P(e,"right_hand_world_landmarks");const t=new Te,r=new Wo;ke(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(s,i){if(i!=null)if(Array.isArray(i))R(s,2,Qr(i,0,Fr));else{if(!(typeof i=="string"||i instanceof ze||Un(i)))throw Error("invalid value in Any.value field: "+i+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");pt(s,2,Hn(i,!1),St())}}(r,this.j.g());const n=new ye;ke(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),hs(n,8,Wo,r),D(n,"IMAGE:input_frames_image"),S(n,"POSE_LANDMARKS:pose_landmarks"),S(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),S(n,"FACE_LANDMARKS:face_landmarks"),S(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),S(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),S(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),S(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ce(e,n),An(this,e),this.g.attachProtoListener("pose_landmarks",(s,i)=>{Tn(s,this.h.poseLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("pose_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("pose_world_landmarks",(s,i)=>{var o=this.h.poseWorldLandmarks;s=hr(s),o.push(Dr(s)),g(this,i)}),this.g.attachEmptyPacketListener("pose_world_landmarks",s=>{g(this,s)}),this.outputPoseSegmentationMasks&&(S(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),dr(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(s,i)=>{this.h.poseSegmentationMasks=[gr(this,s,!0,!this.D)],g(this,i)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",s=>{this.h.poseSegmentationMasks=[],g(this,s)})),this.g.attachProtoListener("face_landmarks",(s,i)=>{Tn(s,this.h.faceLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{g(this,s)}),this.outputFaceBlendshapes&&(P(e,"extra_blendshapes"),S(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(s,i)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(s=yn(s),o.push(Ws(s.g()??[]))),g(this,i)}),this.g.attachEmptyPacketListener("extra_blendshapes",s=>{g(this,s)})),this.g.attachProtoListener("left_hand_landmarks",(s,i)=>{Tn(s,this.h.leftHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("left_hand_world_landmarks",(s,i)=>{var o=this.h.leftHandWorldLandmarks;s=hr(s),o.push(Dr(s)),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_landmarks",(s,i)=>{Tn(s,this.h.rightHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_world_landmarks",(s,i)=>{var o=this.h.rightHandWorldLandmarks;s=hr(s),o.push(Dr(s)),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",s=>{g(this,s)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};B.prototype.detectForVideo=B.prototype.G,B.prototype.detect=B.prototype.F,B.prototype.setOptions=B.prototype.o,B.createFromModelPath=function(e,t){return x(B,e,{baseOptions:{modelAssetPath:t}})},B.createFromModelBuffer=function(e,t){return x(B,e,{baseOptions:{modelAssetBuffer:t}})},B.createFromOptions=function(e,t){return x(B,e,t)},B.HAND_CONNECTIONS=ri,B.POSE_CONNECTIONS=p2,B.FACE_LANDMARKS_LIPS=Js,B.FACE_LANDMARKS_LEFT_EYE=$s,B.FACE_LANDMARKS_LEFT_EYEBROW=Zs,B.FACE_LANDMARKS_LEFT_IRIS=i2,B.FACE_LANDMARKS_RIGHT_EYE=Qs,B.FACE_LANDMARKS_RIGHT_EYEBROW=ei,B.FACE_LANDMARKS_RIGHT_IRIS=o2,B.FACE_LANDMARKS_FACE_OVAL=ti,B.FACE_LANDMARKS_CONTOURS=a2,B.FACE_LANDMARKS_TESSELATION=c2;var je=class extends Le{constructor(e,t){super(new Ve(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},w(e=this.h=new xa,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return w(this.h,0,2,Gs(e,L(this.h,Rs,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},Ge(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"input_image"),G(e,"norm_rect"),P(e,"classifications");const t=new Te;qe(t,dc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),D(r,"IMAGE:input_image"),D(r,"NORM_RECT:norm_rect"),S(r,"CLASSIFICATIONS:classifications"),r.o(t),Ce(e,r),this.g.attachProtoListener("classifications",(n,s)=>{this.j=_c(tc(n)),g(this,s)}),this.g.attachEmptyPacketListener("classifications",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.classifyForVideo=je.prototype.ta,je.prototype.classify=je.prototype.sa,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=function(e,t){return x(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return x(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return x(je,e,t)};var Oe=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!0),this.h=new La,this.embeddings={embeddings:[]},w(e=this.h,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){var t=this.h,r=L(this.h,da,2);return r=r?r.clone():new da,e.l2Normalize!==void 0?R(r,1,Pr(e.l2Normalize)):"l2Normalize"in e&&R(r,1),e.quantize!==void 0?R(r,2,Pr(e.quantize)):"quantize"in e&&R(r,2),w(t,0,2,r),this.l(e)}za(e,t){return Ge(this,e,t),this.embeddings}Aa(e,t,r){return Ze(this,e,r,t),this.embeddings}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"embeddings_out");const t=new Te;qe(t,pc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"EMBEDDINGS:embeddings_out"),r.o(t),Ce(e,r),this.g.attachProtoListener("embeddings_out",(n,s)=>{n=sc(n),this.embeddings=function(i){return{embeddings:at(i,nc,1).map(o=>{var d,l;const c={headIndex:Fe(o,3)??0??-1,headName:he(N(o,4))??""??""};var u=o.v;return oo(u,0|u[y],la,as(o,1))!==void 0?(o=Ft(o=L(o,la,as(o,1),void 0),1,Ye,Rt()),c.floatEmbedding=o.slice()):(u=new Uint8Array(0),c.quantizedEmbedding=((l=(d=L(o,rc,as(o,2),void 0))==null?void 0:d.na())==null?void 0:l.h())??u),c}),timestampMs:Na(uo(i))}}(n),g(this,s)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Oe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Ua(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Ua(Ba(e.quantizedEmbedding),Ba(t.quantizedEmbedding))}return e},Oe.prototype.embedForVideo=Oe.prototype.Aa,Oe.prototype.embed=Oe.prototype.za,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(e,t){return x(Oe,e,{baseOptions:{modelAssetPath:t}})},Oe.createFromModelBuffer=function(e,t){return x(Oe,e,{baseOptions:{modelAssetBuffer:t}})},Oe.createFromOptions=function(e,t){return x(Oe,e,t)};var ni=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function Tc(e){var r,n;const t=function(s){return at(s,ye,1)}(e.ca()).filter(s=>(he(N(s,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((n=(r=L(t[0],Te,7))==null?void 0:r.j())==null?void 0:n.g())??new Map).forEach((s,i)=>{e.u[Number(i)]=he(N(s,1))??""})}function y2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function v2(e){try{const t=new ni(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{kn(e)}}ni.prototype.close=ni.prototype.close;var _e=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Bs,this.A=new Pa,w(this.h,0,3,this.A),w(e=this.h,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?R(this.h,2,Rr(e.displayNamesLocale)):"displayNamesLocale"in e&&R(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){Tc(this)}segment(e,t,r){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,y2(this),Ge(this,e,n),v2(this)}La(e,t,r,n){const s=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,y2(this),Ze(this,e,s,t),v2(this)}Da(){return this.u}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect");const t=new Te;qe(t,Fa,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Da,_e.prototype.segmentForVideo=_e.prototype.La,_e.prototype.segment=_e.prototype.segment,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return x(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return x(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return x(_e,e,t)};var si=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};si.prototype.close=si.prototype.close;var Qe=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Bs,this.u=new Pa,w(this.h,0,3,this.u),w(e=this.h,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){const s=typeof r!="function"?r:{};if(this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new Ca,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var i=new Us;pt(i,3,Pr(!0),!1),pt(i,1,Lr(t.keypoint.x),0),pt(i,2,Lr(t.keypoint.y),0),Mr(n,1,Vs,i)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const c=new mc;for(i of t.scribble)pt(t=new Us,3,Pr(!0),!1),pt(t,1,Lr(i.x),0),pt(t,2,Lr(i.y),0),hs(c,1,Us,t);Mr(n,2,Vs,c)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",r),Ge(this,e,s);e:{try{const c=new si(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{kn(this)}o=void 0}return o}m(){var e=new xe;G(e,"image_in"),G(e,"roi_in"),G(e,"norm_rect_in");const t=new Te;qe(t,Fa,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),D(r,"IMAGE:image_in"),D(r,"ROI:roi_in"),D(r,"NORM_RECT:norm_rect_in"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Qe.prototype.segment=Qe.prototype.segment,Qe.prototype.setOptions=Qe.prototype.o,Qe.createFromModelPath=function(e,t){return x(Qe,e,{baseOptions:{modelAssetPath:t}})},Qe.createFromModelBuffer=function(e,t){return x(Qe,e,{baseOptions:{modelAssetBuffer:t}})},Qe.createFromOptions=function(e,t){return x(Qe,e,t)};var Ne=class extends Le{constructor(e,t){super(new Ve(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},w(e=this.h=new Ia,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?R(this.h,2,Rr(e.displayNamesLocale)):"displayNamesLocale"in e&&R(this.h,2),e.maxResults!==void 0?ct(this.h,3,e.maxResults):"maxResults"in e&&R(this.h,3),e.scoreThreshold!==void 0?b(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&R(this.h,4),e.categoryAllowlist!==void 0?en(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&R(this.h,5),e.categoryDenylist!==void 0?en(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&R(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},Ge(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"input_frame_gpu"),G(e,"norm_rect"),P(e,"detections");const t=new Te;qe(t,yc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),D(r,"IMAGE:input_frame_gpu"),D(r,"NORM_RECT:norm_rect"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=oa(i),this.j.detections.push(Da(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ne.prototype.detectForVideo=Ne.prototype.G,Ne.prototype.detect=Ne.prototype.F,Ne.prototype.setOptions=Ne.prototype.o,Ne.createFromModelPath=async function(e,t){return x(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return x(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return x(Ne,e,t)};var ii=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function _2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function b2(e){try{const t=new ii(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{kn(e)}}ii.prototype.close=ii.prototype.close;var Re=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,w(e=this.h=new ja,0,1,t=new z),this.A=new Sa,w(this.h,0,3,this.A),this.j=new ka,w(this.h,0,2,this.j),ct(this.j,4,1),b(this.j,2,.5),b(this.A,2,.5),b(this.h,4,.5)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numPoses"in e&&ct(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&b(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&b(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,_2(this),Ge(this,e,n),b2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:n,_2(this),Ze(this,e,s,t),b2(this)}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"normalized_landmarks"),P(e,"world_landmarks"),P(e,"segmentation_masks");const t=new Te;qe(t,vc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:normalized_landmarks"),S(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Ce(e,r),An(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,s)=>{this.landmarks=[];for(const i of n)n=Nr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],g(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,s)=>{this.worldLandmarks=[];for(const i of n)n=hr(i),this.worldLandmarks.push(Dr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],g(this,n)}),this.outputSegmentationMasks&&(S(r,"SEGMENTATION_MASK:segmentation_masks"),dr(this,"segmentation_masks"),this.g.aa("segmentation_masks",(n,s)=>{this.segmentationMasks=n.map(i=>gr(this,i,!0,!this.u)),g(this,s)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Re.prototype.detectForVideo=Re.prototype.G,Re.prototype.detect=Re.prototype.F,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=function(e,t){return x(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return x(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return x(Re,e,t)},Re.POSE_CONNECTIONS=p2;const xc=["Smile","Blink","Turn_Head","Thumbs_Up"],Lc=({apiUrl:e,onComplete:t,onError:r,duration:n})=>{var nt;const i=n||60,o=Q.useRef(null),c=Q.useRef(),u=Q.useRef(null),[d,l]=Q.useState({face:null,hand:null}),[f,m]=Q.useState("loading"),[A,j]=Q.useState(""),[ht,et]=Q.useState([]),[fe,K]=Q.useState(0),[tt,xn]=Q.useState(i),[ft,Ur]=Q.useState(!1);Q.useEffect(()=>{(async()=>{try{const Y=await Dt.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm"),U=await W.createFromOptions(Y,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO"}),ge=await ve.createFromOptions(Y,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numHands:1});l({face:U,hand:ge}),Ln(),m("ready")}catch{j("Failed to load security assets. Please check your connection."),m("error")}})()},[]),Q.useEffect(()=>(f==="capturing"&&tt>0?u.current=setInterval(()=>xn(H=>H-1),1e3):tt===0&&f==="capturing"&&(m("expired"),clearInterval(u.current)),()=>clearInterval(u.current)),[f,tt]);const Ln=()=>{et([...xc].sort(()=>.5-Math.random()).slice(0,3))},ai=()=>{m("capturing")},Pn=()=>{K(0),xn(i),Ur(!1),j(""),Ln(),m("ready")},ci=(H,Y,U)=>{var ge,We;if(ft)return!1;if(U==="Thumbs_Up"&&((ge=Y==null?void 0:Y.landmarks)==null?void 0:ge.length)>0){const M=Y.landmarks[0];return M[4].y<M[2].y&&[8,12,16,20].every(X=>M[X].y>M[X-2].y)}if(((We=H==null?void 0:H.faceLandmarks)==null?void 0:We.length)>0){const M=H.faceLandmarks[0];switch(U){case"Smile":return M[291].x-M[61].x>.175;case"Blink":return(Math.abs(M[159].y-M[145].y)+Math.abs(M[386].y-M[374].y))/2<.01;case"Turn_Head":const He=(M[1].x-M[33].x)/(M[263].x-M[33].x);return He<.2||He>.8;default:return!1}}return!1},Vr=Q.useCallback(async()=>{var H,Y;if(f==="capturing"&&((Y=(H=o.current)==null?void 0:H.video)==null?void 0:Y.readyState)===4){const U=o.current.video,ge=performance.now(),We=d.face.detectForVideo(U,ge),M=d.hand.detectForVideo(U,ge);if(ci(We,M,ht[fe])){fe<2?(Ur(!0),setTimeout(()=>{K(X=>X+1),Ur(!1)},800)):On();return}}c.current=requestAnimationFrame(Vr)},[f,fe,d,ht,ft]);Q.useEffect(()=>(f==="capturing"&&(c.current=requestAnimationFrame(Vr)),()=>cancelAnimationFrame(c.current)),[f,Vr]);const On=async()=>{var H;clearInterval(u.current),m("verifying");try{const Y=o.current.video,U=[];for(let X=0;X<5;X++){const He=performance.now(),wt=d.face.detectForVideo(Y,He);if((H=wt.faceLandmarks)!=null&&H[0]){const Bt=rt(Y,wt.faceLandmarks[0]);U.push(Bt.toDataURL("image/jpeg",.95))}await new Promise(Bt=>setTimeout(Bt,60))}const ge=new FormData;for(let X=0;X<U.length;X++){const He=await(await fetch(U[X])).blob();ge.append("files",He,`frame_${X}.jpg`)}const M=await(await fetch(`${e}/v1/verify`,{method:"POST",body:ge})).json();if(M.is_live)m("success"),setTimeout(()=>t({success:!0,image:U[U.length-1],skinConfidence:M.skin_confidence}),2e3);else{const X=M.reason||"The system detected potential spoofing. Please ensure good lighting and try again.";j(X),setTimeout(()=>r({success:!1,reason:X,skinConfidence:null}),2e3),m("error")}}catch(Y){const U="Unable to reach verification server. Please check your connection and try again.";j(U),console.log(Y),setTimeout(()=>r({success:!1,reason:U,skinConfidence:null}),2e3),m("error")}},rt=(H,Y)=>{const U=document.createElement("canvas"),ge=U.getContext("2d"),We=Y.map(At=>At.x*H.videoWidth),M=Y.map(At=>At.y*H.videoHeight),X=Math.min(...We),He=Math.max(...We),wt=Math.min(...M),Bt=Math.max(...M),Rn=He-X,Gr=Bt-wt,Et=Rn*.25;return U.width=224,U.height=224,ge.drawImage(H,X-Et,wt-Et,Rn+Et*2,Gr+Et*2,0,0,224,224),U};return f==="loading"?F.jsx("div",{style:w2,children:"Initializing Security Assets..."}):F.jsxs("div",{style:w2,children:[f==="success"&&F.jsxs("div",{style:{padding:"40px 20px"},children:[F.jsx("div",{style:{fontSize:"50px",marginBottom:"20px"},children:"✅"}),F.jsx("h2",{style:{color:"#4CAF50"},children:"Verification Complete"}),F.jsx("p",{children:"Identity confirmed."})]}),(f==="expired"||f==="error")&&F.jsx("div",{style:oi,children:F.jsxs("div",{style:Fc,children:[F.jsx("div",{style:{fontSize:"40px"},children:f==="expired"?"⏰":"❌"}),F.jsx("h3",{style:{margin:"10px 0"},children:f==="expired"?"Time Expired":"Verification Failed"}),F.jsx("p",{style:{color:"#ccc",fontSize:"14px"},children:A||"The process was interrupted or timed out."}),F.jsx("button",{onClick:Pn,style:E2,children:"Try Again"})]})}),["ready","capturing","verifying"].includes(f)&&F.jsxs(F.Fragment,{children:[F.jsxs("div",{style:Pc,children:[F.jsxs("h2",{style:{margin:0,fontSize:"1.2rem"},children:[f==="ready"&&"Identity Verification",f==="verifying"&&"Analyzing...",f==="capturing"&&F.jsx("span",{style:{color:ft?"#4CAF50":"white"},children:ft?"Great!":`${(nt=ht[fe])==null?void 0:nt.replace("_"," ")}`})]}),f==="capturing"&&F.jsxs("div",{style:{...Oc,color:tt<=10?"#ff4d4d":"white"},children:[tt,"s"]})]}),F.jsxs("div",{style:Rc,children:[F.jsx(D2,{ref:o,mirrored:!0,screenshotFormat:"image/jpeg",style:{width:"100%",borderRadius:"12px",border:f==="capturing"?"2px solid #007bff":"2px solid #333",opacity:f==="ready"?.5:1,transition:"all 0.4s ease"}}),f==="ready"&&F.jsxs("div",{style:oi,children:[F.jsx("button",{onClick:ai,style:E2,children:"Start Challenge"}),F.jsxs("p",{style:{marginTop:"12px",fontSize:"13px",color:"#aaa"},children:["3 steps • ",n," seconds"]})]}),f==="verifying"&&F.jsx("div",{style:oi,children:F.jsx("p",{style:{marginTop:"15px",fontWeight:"bold"},children:"Securing Session..."})})]}),F.jsx("div",{style:{marginTop:"15px",minHeight:"20px"},children:F.jsxs("p",{style:{color:ft?"#4CAF50":"#888",margin:0,fontSize:"14px"},children:[f==="capturing"&&!ft&&"Please perform the action above.",ft&&"Step verified! Get ready..."]})})]})]})},w2={textAlign:"center",color:"white",background:"#121212",padding:"24px",borderRadius:"20px",width:"100%",maxWidth:"450px",margin:"0 auto",boxShadow:"0 10px 30px rgba(0,0,0,0.5)"},Pc={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px",minHeight:"40px"},Oc={fontSize:"18px",fontWeight:"800",background:"rgba(255,255,255,0.1)",padding:"4px 12px",borderRadius:"20px"},Rc={position:"relative",overflow:"hidden",borderRadius:"12px"},oi={position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.75)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},Fc={background:"#1e1e1e",padding:"30px",borderRadius:"15px",border:"1px solid #333",maxWidth:"80%",textAlign:"center"},E2={padding:"12px 30px",fontSize:"16px",fontWeight:"bold",background:"#007bff",border:"none",color:"white",borderRadius:"10px",cursor:"pointer",transition:"transform 0.2s"},Mc=async(e,t,r)=>{const n=new FormData;t.forEach((i,o)=>{n.append("files",i,`frame_${o}.jpg`)}),n.append("challenge",r);const s=await fetch(`${e}/v1/verify`,{method:"POST",body:n});if(!s.ok)throw new Error("Network response was not ok");return await s.json()};st.LivenessSDK=Lc,st.verifyLiveness=Mc,Object.defineProperty(st,Symbol.toStringTag,{value:"Module"})});
|