@robotical/martyblocks
Version:
MartyBlocks based on Scratch for Marty the Robot by Robotical
1 lines • 64.5 kB
JavaScript
(function(){"use strict";var t;function e(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){return t==Array.prototype||t==Object.prototype||(t[e]=n.value),t};var r=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function i(t,e){if(e)t:{var i=r;t=t.split(".");for(var o=0;o<t.length-1;o++){var a=t[o];if(!(a in i))break t;i=i[a]}(e=e(o=i[t=t[t.length-1]]))!=o&&null!=e&&n(i,t,{configurable:!0,writable:!0,value:e})}}function o(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function a(t){var n="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return n?n.call(t):{next:e(t)}}function u(t){if(!(t instanceof Array)){t=a(t);for(var e,n=[];!(e=t.next()).done;)n.push(e.value);t=n}return t}i("Symbol",function(t){function e(t,e){this.g=t,n(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function t(n){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(r+(n||"")+"_"+i++,n)}}),i("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var i="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<i.length;a++){var u=r[i[a]];"function"==typeof u&&"function"!=typeof u.prototype[t]&&n(u.prototype,t,{configurable:!0,writable:!0,value:function(){return o(e(this))}})}return t});var s,c="function"==typeof Object.create?Object.create:function(t){function e(){}return e.prototype=t,new e};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var f;t:{var l={};try{l.__proto__={a:!0},f=l.a;break t}catch(t){}f=!1}s=f?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var h=s;function g(t,e){if(t.prototype=c(e.prototype),t.prototype.constructor=t,h)h(t,e);else for(var n in e)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(e,n);r&&Object.defineProperty(t,n,r)}else t[n]=e[n];t.na=e.prototype}function d(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.u=this.o=0,this.j=null}function p(t){if(t.l)throw new TypeError("Generator is already running");t.l=!0}function v(t,e){t.j={da:e,ea:!0},t.g=t.o||t.u}function y(t,e,n){return t.g=n,{value:e}}function b(t){this.g=new d,this.h=t}function m(t,e,n,r){try{var i=e.call(t.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return t.g.l=!1,i;var o=i.value}catch(e){return t.g.i=null,v(t.g,e),w(t)}return t.g.i=null,r.call(t.g,o),w(t)}function w(t){for(;t.g.g;)try{var e=t.h(t.g);if(e)return t.g.l=!1,{value:e.value,done:!1}}catch(e){t.g.h=void 0,v(t.g,e)}if(t.g.l=!1,t.g.j){if(e=t.g.j,t.g.j=null,e.ea)throw e.da;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function A(t){this.next=function(e){return p(t.g),t.g.i?e=m(t,t.g.i.next,e,t.g.s):(t.g.s(e),e=w(t)),e},this.throw=function(e){return p(t.g),t.g.i?e=m(t,t.g.i.throw,e,t.g.s):(v(t.g,e),e=w(t)),e},this.return=function(e){return function(t,e){p(t.g);var n=t.g.i;return n?m(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.g.return):(t.g.return(e),w(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function E(t){return function(t){function e(e){return t.next(e)}function n(e){return t.throw(e)}return new Promise(function(r,i){!function t(o){o.done?r(o.value):Promise.resolve(o.value).then(e,n).then(t,i)}(t.next())})}(new A(new b(t)))}d.prototype.s=function(t){this.h=t},d.prototype.return=function(t){this.j={return:t},this.g=this.u},i("Promise",function(t){function e(t){this.h=0,this.i=void 0,this.g=[],this.s=!1;var e=this.j();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.g=null}function i(t){return t instanceof e?t:new e(function(e){e(t)})}if(t)return t;n.prototype.h=function(t){if(null==this.g){this.g=[];var e=this;this.i(function(){e.l()})}this.g.push(t)};var o=r.setTimeout;n.prototype.i=function(t){o(t,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var t=this.g;this.g=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.j(t)}}}this.g=null},n.prototype.j=function(t){this.i(function(){throw t})},e.prototype.j=function(){function t(t){return function(r){n||(n=!0,t.call(e,r))}}var e=this,n=!1;return{resolve:t(this.D),reject:t(this.l)}},e.prototype.D=function(t){if(t===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.H(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.A(t):this.o(t)}},e.prototype.A=function(t){var e=void 0;try{e=t.then}catch(t){return void this.l(t)}"function"==typeof e?this.I(e,t):this.o(t)},e.prototype.l=function(t){this.u(2,t)},e.prototype.o=function(t){this.u(1,t)},e.prototype.u=function(t,e){if(0!=this.h)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.h);this.h=t,this.i=e,2===this.h&&this.G(),this.B()},e.prototype.G=function(){var t=this;o(function(){if(t.C()){var e=r.console;void 0!==e&&e.error(t.i)}},1)},e.prototype.C=function(){if(this.s)return!1;var t=r.CustomEvent,e=r.Event,n=r.dispatchEvent;return void 0===n||("function"==typeof t?t=new t("unhandledrejection",{cancelable:!0}):"function"==typeof e?t=new e("unhandledrejection",{cancelable:!0}):(t=r.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,t),t.promise=this,t.reason=this.i,n(t))},e.prototype.B=function(){if(null!=this.g){for(var t=0;t<this.g.length;++t)u.h(this.g[t]);this.g=null}};var u=new n;return e.prototype.H=function(t){var e=this.j();t.M(e.resolve,e.reject)},e.prototype.I=function(t,e){var n=this.j();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(t){o(t)}}:e}var i,o,a=new e(function(t,e){i=t,o=e});return this.M(r(t,i),r(n,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.M=function(t,e){function n(){switch(r.h){case 1:t(r.i);break;case 2:e(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?u.h(n):this.g.push(n),this.s=!0},e.resolve=i,e.reject=function(t){return new e(function(e,n){n(t)})},e.race=function(t){return new e(function(e,n){for(var r=a(t),o=r.next();!o.done;o=r.next())i(o.value).M(e,n)})},e.all=function(t){var n=a(t),r=n.next();return r.done?i([]):new e(function(t,e){function o(e){return function(n){a[e]=n,0==--u&&t(a)}}var a=[],u=0;do{a.push(void 0),u++,i(r.value).M(o(a.length-1),e),r=n.next()}while(!r.done)})},e});var j="function"==typeof Object.assign?Object.assign:function(t,e){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};i("Object.assign",function(t){return t||j}),i("Object.is",function(t){return t||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}}),i("Array.prototype.includes",function(t){return t||function(t,e){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(e=e||0)&&(e=Math.max(e+r,0));e<r;e++){var i=n[e];if(i===t||Object.is(i,t))return!0}return!1}}),i("String.prototype.includes",function(t){return t||function(t,e){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(t,e||0)}}),i("Array.prototype.keys",function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var n=0,r=!1,i={next:function(){if(!r&&n<t.length){var i=n++;return{value:e(i,t[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,function(t){return t})}});var _=this||self;function x(t,e){t=t.split(".");var n,r=_;t[0]in r||void 0===r.execScript||r.execScript("var "+t[0]);for(;t.length&&(n=t.shift());)t.length||void 0===e?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=e}function O(){throw Error("Invalid UTF8")}function T(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var F,S,C="undefined"!=typeof TextDecoder,R="undefined"!=typeof TextEncoder,k={},U=null;function P(t){var e;void 0===e&&(e=0),I(),e=k[e];for(var n=Array(Math.floor(t.length/3)),r=e[64]||"",i=0,o=0;i<t.length-2;i+=3){var a=t[i],u=t[i+1],s=t[i+2],c=e[a>>2];a=e[(3&a)<<4|u>>4],u=e[(15&u)<<2|s>>6],s=e[63&s],n[o++]=c+a+u+s}switch(c=0,s=r,t.length-i){case 2:s=e[(15&(c=t[i+1]))<<2]||r;case 1:t=t[i],n[o]=e[t>>2]+e[(3&t)<<4|c>>4]+s+r}return n.join("")}function B(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=U[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}I();for(var r=0;;){var i=n(-1),o=n(0),a=n(64),u=n(64);if(64===u&&-1===i)break;e(i<<2|o>>4),64!=a&&(e(o<<4&240|a>>2),64!=u&&e(a<<6&192|u))}}(t,function(t){r[i++]=t}),i!==n?r.subarray(0,i):r}function I(){if(!U){U={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));k[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===U[o]&&(U[o]=i)}}}}var L,D="function"==typeof Uint8Array;function M(t){return D&&null!=t&&t instanceof Uint8Array}function N(t){if(this.L=t,null!==t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}var G="function"==typeof Uint8Array.prototype.slice,W=0;function V(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function Y(){return Error("Failed to read varint, encoding is invalid.")}function H(t,e){e=void 0!==(e=void 0===e?{}:e).v&&e.v,this.h=null,this.g=this.i=this.j=0,this.v=e,t&&z(this,t)}function z(t,e){t.h=function(t,e){if(t.constructor===Uint8Array)return t;if(t.constructor===ArrayBuffer)return new Uint8Array(t);if(t.constructor===Array)return new Uint8Array(t);if(t.constructor===String)return B(t);if(t.constructor===N)return!e&&(e=t.L)&&e.constructor===Uint8Array?e:(e=null==(e=t.L)||M(e)?e:"string"==typeof e?B(e):null,(t=t.L=e)?new Uint8Array(t):L||(L=new Uint8Array(0)));if(t instanceof Uint8Array)return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, or Array of numbers")}(e,t.v),t.j=0,t.i=t.h.length,t.g=t.j}function X(t){if(t.g>t.i)throw Error("Tried to read past the end of the data "+t.g+" > "+t.i)}function J(t){var e=t.h,n=e[t.g],r=127&n;if(128>n)return t.g+=1,X(t),r;if(r|=(127&(n=e[t.g+1]))<<7,128>n)return t.g+=2,X(t),r;if(r|=(127&(n=e[t.g+2]))<<14,128>n)return t.g+=3,X(t),r;if(r|=(127&(n=e[t.g+3]))<<21,128>n)return t.g+=4,X(t),r;if(n=e[t.g+4],t.g+=5,r|=(15&n)<<28,128>n)return X(t),r;if(128<=e[t.g++]&&128<=e[t.g++]&&128<=e[t.g++]&&128<=e[t.g++]&&128<=e[t.g++])throw Y();return X(t),r}H.prototype.reset=function(){this.g=this.j};var K=[];function $(){this.g=[]}function Z(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function q(t){var e={},n=void 0!==e.W&&e.W;this.l={v:void 0!==e.v&&e.v},this.W=n,e=this.l,K.length?(n=K.pop(),e&&(n.v=e.v),t&&z(n,t),t=n):t=new H(t,e),this.g=t,this.j=this.g.g,this.h=this.i=-1}function Q(t){var e=t.g;if(e.g==e.i)return!1;t.j=t.g.g;var n=J(t.g)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw V(n,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.i=e,t.h=n,!0}function tt(t){switch(t.h){case 0:if(0!=t.h)tt(t);else t:{for(var e=(t=t.g).g,n=e+10;e<n;)if(!(128&t.h[e++])){t.g=e,X(t);break t}throw Y()}break;case 1:(t=t.g).g+=8,X(t);break;case 2:2!=t.h?tt(t):(e=J(t.g)>>>0,(t=t.g).g+=e,X(t));break;case 5:(t=t.g).g+=4,X(t);break;case 3:for(e=t.i;;){if(!Q(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.i!=e)throw Error("Unmatched end-group tag");break}tt(t)}break;default:throw V(t.h,t.j)}}$.prototype.length=function(){return this.g.length},$.prototype.end=function(){var t=this.g;return this.g=[],t},q.prototype.reset=function(){this.g.reset(),this.j=this.g.g,this.h=this.i=-1};var et=[];function nt(){this.i=[],this.h=0,this.g=new $}function rt(t,e){0!==e.length&&(t.i.push(e),t.h+=e.length)}var it="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol(void 0):void 0;function ot(t,e){Object.isFrozen(t)||(it?t[it]|=e:void 0!==t.N?t.N|=e:Object.defineProperties(t,{N:{value:e,configurable:!0,writable:!0,enumerable:!1}}))}function at(t){var e;return null==(e=it?t[it]:t.N)?0:e}function ut(t){return ot(t,1),t}function st(t){return!!Array.isArray(t)&&!!(2&at(t))}function ct(t){if(!Array.isArray(t))throw Error("cannot mark non-array as immutable");ot(t,2)}function ft(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}var lt=Object.freeze(ut([]));function ht(t){if(st(t.m))throw Error("Cannot mutate an immutable Message")}var gt,dt="undefined"!=typeof Symbol&&void 0!==Symbol.hasInstance;function pt(t){return{value:t,configurable:!1,writable:!1,enumerable:!1}}function vt(t,e,n){return-1===e?null:e>=t.i?t.g?t.g[e]:void 0:void 0!==n&&n&&t.g&&null!=(n=t.g[e])?n:t.m[e+t.h]}function yt(t,e,n,r){r=void 0!==r&&r,ht(t),e<t.i&&!r?t.m[e+t.h]=n:(t.g||(t.g=t.m[t.i+t.h]={}))[e]=n}function bt(t,e,n,r){n=void 0===n||n;var i=vt(t,e,r=void 0!==r&&r);return null==i&&(i=lt),st(t.m)?n&&(ct(i),Object.freeze(i)):(i===lt||st(i))&&yt(t,e,i=ut(i.slice()),r),i}function mt(t,e,n){return null==(t=null==(t=vt(t,e))?t:+t)?void 0===n?0:n:t}function wt(t,e,n,r){t.j||(t.j={});var i=st(t.m),o=t.j[n];if(!o){r=bt(t,n,!0,void 0!==r&&r),o=[],i=i||st(r);for(var a=0;a<r.length;a++)o[a]=new e(r[a]),i&&ct(o[a].m);i&&(ct(o),Object.freeze(o)),t.j[n]=o}return o}function At(t,e,n,r,i){var o=void 0!==o&&o;return ht(t),o=wt(t,n,e,o),n=r||new n,t=bt(t,e),null!=i?(o.splice(i,0,n),t.splice(i,0,n.m)):(o.push(n),t.push(n.m)),n}function Et(t,e){return null==(t=vt(t,e))?0:t}function jt(t,e){return null==(t=vt(t,e))?"":t}function _t(t){var e=Tt;return Ot(t,e=void 0===e?Ft:e)}function xt(t,e){if(null!=t){if(Array.isArray(t))t=Ot(t,e);else if(ft(t)){var n,r={};for(n in t)r[n]=xt(t[n],e);t=r}else t=e(t);return t}}function Ot(t,e){for(var n=t.slice(),r=0;r<n.length;r++)n[r]=xt(n[r],e);return Array.isArray(t)&&1&at(t)&&ut(n),n}function Tt(t){return t&&"object"==typeof t&&t.toJSON?t.toJSON():(t=function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"object":if(t&&!Array.isArray(t)){if(M(t))return P(t);if(t instanceof N){var e=t.L;return e=null==e||"string"==typeof e?e:D&&e instanceof Uint8Array?P(e):null,(t.L=e)||""}}}return t}(t),Array.isArray(t)?_t(t):t)}function Ft(t){return M(t)?new Uint8Array(t):t}function St(t,e,n){t||(t=gt),gt=null;var r=this.constructor.h;if(t||(t=r?[r]:[]),this.h=(r?0:-1)-(this.constructor.g||0),this.j=void 0,this.m=t,t=(r=this.m.length)-1,r&&ft(r=this.m[t])?(this.i=t-this.h,this.g=r):void 0!==e&&-1<e?(this.i=Math.max(e,t+1-this.h),this.g=void 0):this.i=Number.MAX_VALUE,n)for(e=0;e<n.length;e++)if((t=n[e])<this.i)t+=this.h,(r=this.m[t])?Array.isArray(r)&&ut(r):this.m[t]=lt;else{var i=(r=this.g||(this.g=this.m[this.i+this.h]={}))[t];i?Array.isArray(i)&&ut(i):r[t]=lt}}function Ct(){St.apply(this,arguments)}if(St.prototype.toJSON=function(){return _t(this.m)},St.prototype.toString=function(){return this.m.toString()},g(Ct,St),dt){var Rt={};Object.defineProperties(Ct,(Rt[Symbol.hasInstance]=pt(function(){throw Error("Cannot perform instanceof checks for MutableMessage")}),Rt))}function kt(t,e,n){if(n){var r,i={};for(r in n){var o=n[r],a=o.ha;a||(i.F=o.la||o.fa.P,o.aa?(i.U=Mt(o.aa),a=function(t){return function(e,n,r){return t.F(e,n,r,t.U)}}(i)):o.ca?(i.T=Nt(o.X.g,o.ca),a=function(t){return function(e,n,r){return t.F(e,n,r,t.T)}}(i)):a=i.F,o.ha=a),a(e,t,o.X),i={F:i.F,U:i.U,T:i.T}}}!function(t,e){if(e=e.ba){rt(t,t.g.end());for(var n=0;n<e.length;n++)rt(t,e[n])}}(e,t)}var Ut=Symbol();function Pt(t,e,n){return t[Ut]||(t[Ut]=function(t,r){return e(t,r,n)})}function Bt(t){var e=t[Ut];if(!e){var n=qt(t);e=function(t,e){return Qt(t,e,n)},t[Ut]=e}return e}function It(t){var e=function(t){var e=t.aa;return e?Bt(e):(e=t.ka)?Pt(t.X.g,e,t.ca):void 0}(t),n=t.X,r=t.fa.O;return e?function(t,i){return r(t,i,n,e)}:function(t,e){return r(t,e,n)}}function Lt(t,e,n,r,i,o){var a=0;for((t=t()).length&&"number"!=typeof t[0]&&(n(e,t[0]),a++);a<t.length;){n=t[a++];for(var u=a+1;u<t.length&&"number"!=typeof t[u];)u++;var s=t[a++];switch(u-=a){case 0:r(e,n,s);break;case 1:r(e,n,s,t[a++]);break;case 2:i(e,n,s,t[a++],t[a++]);break;case 3:u=t[a++];var c=t[a++],f=t[a++];Array.isArray(f)?i(e,n,s,u,c,f):o(e,n,s,u,c,f);break;case 4:o(e,n,s,t[a++],t[a++],t[a++],t[a++]);break;default:throw Error("unexpected number of binary field arguments: "+u)}}return e}var Dt=Symbol();function Mt(t){var e=t[Dt];if(!e){var n=zt(t);e=function(t,e){return ee(t,e,n)},t[Dt]=e}return e}function Nt(t,e){var n=t[Dt];return n||(n=function(t,n){return kt(t,n,e)},t[Dt]=n),n}var Gt=Symbol();function Wt(t,e){t.push(e)}function Vt(t,e,n){t.push(e,n.P)}function Yt(t,e,n,r,i){var o=Mt(i),a=n.P;t.push(e,function(t,e,n){return a(t,e,n,r,o)})}function Ht(t,e,n,r,i,o){var a=Nt(r,o),u=n.P;t.push(e,function(t,e,n){return u(t,e,n,r,a)})}function zt(t){var e=t[Gt];return e||Lt(t,t[Gt]=[],Wt,Vt,Yt,Ht)}var Xt=Symbol();function Jt(t,e){t[0]=e}function Kt(t,e,n,r){var i=n.O;t[e]=r?function(t,e,n){return i(t,e,n,r)}:i}function $t(t,e,n,r,i,o){var a=n.O,u=Bt(i);t[e]=function(t,e,n){return a(t,e,n,r,u,o)}}function Zt(t,e,n,r,i,o,a){var u=n.O,s=Pt(r,i,o);t[e]=function(t,e,n){return u(t,e,n,r,s,a)}}function qt(t){var e=t[Xt];return e||Lt(t,t[Xt]={},Jt,Kt,$t,Zt)}function Qt(t,e,n){for(;Q(e)&&4!=e.h;){var r=e.i,i=n[r];if(!i){var o=n[0];o&&(o=o[r])&&(i=n[r]=It(o))}if(!(i&&i(e,t,r)||(i=e,r=t,o=i.j,tt(i),i.W))){var a=i.g.h;i=o===(i=i.g.g)?L||(L=new Uint8Array(0)):G?a.slice(o,i):new Uint8Array(a.subarray(o,i)),(o=r.ba)?o.push(i):r.ba=[i]}}return t}function te(t,e,n){if(et.length){var r=et.pop();t&&(z(r.g,t),r.i=-1,r.h=-1),t=r}else t=new q(t);try{return Qt(new e,t,qt(n))}finally{(e=t.g).h=null,e.j=0,e.i=0,e.g=0,e.v=!1,t.i=-1,t.h=-1,100>et.length&&et.push(t)}}function ee(t,e,n){for(var r=n.length,i=1==r%2,o=i?1:0;o<r;o+=2)(0,n[o+1])(e,t,n[o]);kt(t,e,i?n[0]:void 0)}function ne(t,e){var n=new nt;ee(t,n,zt(e)),rt(n,n.g.end()),t=new Uint8Array(n.h);for(var r=(e=n.i).length,i=0,o=0;o<r;o++){var a=e[o];t.set(a,i),i+=a.length}return n.i=[t],t}function re(t,e){return{O:t,P:e}}var ie=re(function(t,e,n){if(5!==t.h)return!1;var r=(t=t.g).h[t.g],i=t.h[t.g+1],o=t.h[t.g+2],a=t.h[t.g+3];return t.g+=4,X(t),t=2*((i=(r|i<<8|o<<16|a<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,yt(e,n,255==r?i?NaN:1/0*t:0==r?t*Math.pow(2,-149)*i:t*Math.pow(2,r-150)*(i+Math.pow(2,23))),!0},function(t,e,n){if(null!=(e=vt(e,n))){Z(t.g,8*n+5),t=t.g;var r=e;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?W=0:W=2147483648:isNaN(r)?W=2147483647:34028234663852886e22<r?W=(n<<31|2139095040)>>>0:11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),W=(n<<31|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),16777216<=(r=Math.round(8388608*r))&&++e,W=(n<<31|e+127<<23|8388607&r)>>>0),n=W,t.g.push(n>>>0&255),t.g.push(n>>>8&255),t.g.push(n>>>16&255),t.g.push(n>>>24&255)}}),oe=re(function(t,e,n){if(0!==t.h)return!1;for(var r=t.g,i=128,o=0,a=t=0;4>a&&128<=i;a++)i=r.h[r.g++],X(r),o|=(127&i)<<7*a;if(128<=i&&(i=r.h[r.g++],X(r),o|=(127&i)<<28,t|=(127&i)>>4),128<=i)for(a=0;5>a&&128<=i;a++)i=r.h[r.g++],X(r),t|=(127&i)<<7*a+3;if(!(128>i))throw Y();return r=o>>>0,(t=2147483648&(i=t>>>0))&&(i=~i>>>0,0==(r=1+~r>>>0)&&(i=i+1>>>0)),r=4294967296*i+(r>>>0),yt(e,n,t?-r:r),!0},function(t,e,n){if(null!=(e=vt(e,n))&&null!=e){Z(t.g,8*n),t=t.g;var r=e;for(n=0>r,e=(r=Math.abs(r))>>>0,r=Math.floor((r-e)/4294967296),r>>>=0,n&&(r=~r>>>0,4294967295<(e=(~e>>>0)+1)&&(e=0,4294967295<++r&&(r=0))),n=W=e,e=r;0<e||127<n;)t.g.push(127&n|128),n=(n>>>7|e<<25)>>>0,e>>>=7;t.g.push(n)}}),ae=re(function(t,e,n){return 0===t.h&&(yt(e,n,J(t.g)),!0)},function(t,e,n){if(null!=(e=vt(e,n))&&null!=e)if(Z(t.g,8*n),t=t.g,0<=(n=e))Z(t,n);else{for(e=0;9>e;e++)t.g.push(127&n|128),n>>=7;t.g.push(1)}}),ue=re(function(t,e,n){if(2!==t.h)return!1;var r,i=J(t.g)>>>0,o=(t=t.g).g;if(t.g+=i,X(t),t=t.h,C)(r=F)||(r=F=new TextDecoder("utf-8",{fatal:!0})),r=r.decode(t.subarray(o,o+i));else{i=o+i;for(var a,u,s,c=[],f=null;o<i;)128>(a=t[o++])?c.push(a):224>a?o>=i?O():(u=t[o++],194>a||128!=(192&u)?(o--,O()):c.push((31&a)<<6|63&u)):240>a?o>=i-1?O():128!=(192&(u=t[o++]))||224===a&&160>u||237===a&&160<=u||128!=(192&(r=t[o++]))?(o--,O()):c.push((15&a)<<12|(63&u)<<6|63&r):244>=a?o>=i-2?O():128!=(192&(u=t[o++]))||u-144+(a<<28)>>30||128!=(192&(r=t[o++]))||128!=(192&(s=t[o++]))?(o--,O()):(a=(7&a)<<18|(63&u)<<12|(63&r)<<6|63&s,a-=65536,c.push(55296+(a>>10&1023),56320+(1023&a))):O(),8192<=c.length&&(f=T(f,c),c.length=0);r=T(f,c)}return yt(e,n,r),!0},function(t,e,n){if(null!=(e=vt(e,n))){var r=!1;if(r=void 0!==r&&r,R){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(S||(S=new TextEncoder)).encode(e)}else{for(var i=0,o=new Uint8Array(3*e.length),a=0;a<e.length;a++){var u=e.charCodeAt(a);if(128>u)o[i++]=u;else{if(2048>u)o[i++]=u>>6|192;else{if(55296<=u&&57343>=u){if(56319>=u&&a<e.length){var s=e.charCodeAt(++a);if(56320<=s&&57343>=s){u=1024*(u-55296)+s-56320+65536,o[i++]=u>>18|240,o[i++]=u>>12&63|128,o[i++]=u>>6&63|128,o[i++]=63&u|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");u=65533}o[i++]=u>>12|224,o[i++]=u>>6&63|128}o[i++]=63&u|128}}e=o.subarray(0,i)}Z(t.g,8*n+2),Z(t.g,e.length),rt(t,t.g.end()),rt(t,e)}}),se=re(function(t,e,n,r,i){if(2!==t.h)return!1;e=At(e,n,r),n=t.g.i,r=J(t.g)>>>0;var o=t.g.g+r,a=o-n;if(0>=a&&(t.g.i=o,i(e,t),a=o-t.g.g),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.g.g=o,t.g.i=n,!0},function(t,e,n,r,i){if(null!=(e=wt(e,r,n)))for(r=0;r<e.length;r++){var o=t;Z(o.g,8*n+2);var a=o.g.end();rt(o,a),a.push(o.h),o=a,i(e[r],t),a=t;var u=o.pop();for(u=a.h+a.g.length()-u;127<u;)o.push(127&u|128),u>>>=7,a.h++;o.push(u),a.h++}});function ce(){Ct.apply(this,arguments)}if(g(ce,Ct),dt){var fe={};Object.defineProperties(ce,(fe[Symbol.hasInstance]=pt(Object[Symbol.hasInstance]),fe))}function le(t){ce.call(this,t)}function he(){return[1,ae,2,ie,3,ue,4,ue]}function ge(t){ce.call(this,t,-1,pe)}function de(){return[1,se,le,he]}g(le,ce),g(ge,ce),ge.prototype.addClassification=function(t,e){return At(this,1,le,t,e),this};var pe=[1];function ve(t){ce.call(this,t)}function ye(){return[1,ie,2,ie,3,ie,4,ie,5,ie]}function be(t){ce.call(this,t,-1,we)}function me(){return[1,se,ve,ye]}g(ve,ce),g(be,ce);var we=[1];function Ae(t){ce.call(this,t)}function Ee(){return[1,ie,2,ie,3,ie,4,ie,5,ie,6,oe]}g(Ae,ce);var je=[[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]],_e=[[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]],xe=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Oe=[[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]],Te=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Fe=[[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]],Se=[].concat(u(je),u(_e),u(xe),u(Oe),u(Te),u(Fe));function Ce(t,e,n){if(n=t.createShader(0===n?t.VERTEX_SHADER:t.FRAGMENT_SHADER),t.shaderSource(n,e),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+t.getShaderInfoLog(n));return n}function Re(t){return wt(t,le,1).map(function(t){return{index:Et(t,1),ga:mt(t,2),label:null!=vt(t,3)?jt(t,3):void 0,displayName:null!=vt(t,4)?jt(t,4):void 0}})}function ke(t){return{x:mt(t,1),y:mt(t,2),z:mt(t,3),visibility:null!=vt(t,4)?mt(t,4):void 0}}function Ue(t,e){this.h=t,this.g=e,this.l=0}function Pe(t,e,n){return function(t,e){var n=t.g;if(void 0===t.o){var r=Ce(n,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",0),i=Ce(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getProgramParameter(o,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(o));r=t.o=o,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),t.j={K:n.getAttribLocation(r,"aVertex"),J:n.getAttribLocation(r,"aTex"),ma:i},t.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,t.u),n.enableVertexAttribArray(t.j.K),n.vertexAttribPointer(t.j.K,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),t.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,t.s),n.enableVertexAttribArray(t.j.J),n.vertexAttribPointer(t.j.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=t.j,n.useProgram(t.o),n.canvas.width=e.width,n.canvas.height=e.height,n.viewport(0,0,e.width,e.height),n.activeTexture(n.TEXTURE0),t.h.bindTexture2d(e.glName),n.enableVertexAttribArray(r.K),n.bindBuffer(n.ARRAY_BUFFER,t.u),n.vertexAttribPointer(r.K,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,t.s),n.vertexAttribPointer(r.J,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.K),n.disableVertexAttribArray(r.J),n.bindBuffer(n.ARRAY_BUFFER,null),t.h.bindTexture2d(0)}(t,e),"function"==typeof t.g.canvas.transferToImageBitmap?Promise.resolve(t.g.canvas.transferToImageBitmap()):n?Promise.resolve(t.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.g.canvas):(void 0===t.i&&(t.i=document.createElement("canvas")),new Promise(function(e){t.i.height=t.g.canvas.height,t.i.width=t.g.canvas.width,t.i.getContext("2d",{}).drawImage(t.g.canvas,0,0,t.g.canvas.width,t.g.canvas.height),e(t.i)}))}function Be(t){this.g=t}var Ie=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Le(t,e){return e+t}function De(t,e){window[t]=e}function Me(t){if(this.g=t,this.listeners={},this.j={},this.H={},this.o={},this.u={},this.I=this.s=this.Z=!0,this.D=Promise.resolve(),this.Y="",this.C={},this.locateFile=t&&t.locateFile||Le,"object"==typeof window)var e=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");e=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.$=e,t.options)for(var n=(e=a(Object.keys(t.options))).next();!n.done;n=e.next()){n=n.value;var r=t.options[n].default;void 0!==r&&(this.j[n]="function"==typeof r?r():r)}}function Ne(t){var e,n,r,i,o,a,s,c,f,l,h;return E(function(g){switch(g.g){case 1:return t.Z?(e=void 0===t.g.files?[]:"function"==typeof t.g.files?t.g.files(t.j):t.g.files,y(g,E(function(t){switch(t.g){case 1:return t.o=2,y(t,WebAssembly.instantiate(Ie),4);case 4:t.g=3,t.o=0;break;case 2:return t.o=0,t.j=null,t.return(!1);case 3:return t.return(!0)}}),2)):g.return();case 2:if(n=g.h,"object"==typeof window)return De("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),De("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),a=e.filter(function(t){return void 0!==t.data}),s=e.filter(function(t){return void 0===t.data}),c=Promise.all(a.map(function(e){var n=Ge(t,e.url);if(void 0!==e.path){var r=e.path;n=n.then(function(e){return t.overrideFile(r,e),Promise.resolve(e)})}return n})),f=Promise.all(s.map(function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n?function(t){var e=document.createElement("script");return e.setAttribute("src",t),e.setAttribute("crossorigin","anonymous"),new Promise(function(t){e.addEventListener("load",function(){t()},!1),e.addEventListener("error",function(){t()},!1),document.body.appendChild(e)})}(t.locateFile(e.url,t.$)):Promise.resolve()})).then(function(){var e,n,r;return E(function(i){if(1==i.g)return e=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=t,y(i,e(n),2);r.h=i.h,i.g=0})}),l=E(function(e){return t.g.graph&&t.g.graph.url?e=y(e,Ge(t,t.g.graph.url),0):(e.g=0,e=void 0),e}),y(g,Promise.all([f,c,l]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return r=e.filter(function(t){return void 0===t.simd||t.simd&&n||!t.simd&&!n}).map(function(e){return t.locateFile(e.url,t.$)}),importScripts.apply(null,u(r)),i=t,y(g,createMediapipeSolutionsWasm(Module),6);case 6:i.h=g.h,t.l=new OffscreenCanvas(1,1),t.h.canvas=t.l,o=t.h.GL.createContext(t.l,{antialias:!1,alpha:!1,ja:"undefined"!=typeof WebGL2RenderingContext?2:1}),t.h.GL.makeContextCurrent(o),g.g=4;break;case 7:if(t.l=document.createElement("canvas"),!(h=t.l.getContext("webgl2",{}))&&!(h=t.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),g.return();t.G=h,t.h.canvas=t.l,t.h.createContext(t.l,!0,!0,{});case 4:t.i=new t.h.SolutionWasm,t.Z=!1,g.g=0}})}function Ge(t,e){var n,r;return E(function(i){return e in t.H?i.return(t.H[e]):(n=t.locateFile(e,""),r=fetch(n).then(function(t){return t.arrayBuffer()}),t.H[e]=r,i.return(r))})}function We(t,e,n){var r,i,o,u,s,c,f,l,h,g,d,p,v,b;return E(function(m){switch(m.g){case 1:if(!n)return m.return(e);for(r={},i=0,o=a(Object.keys(n)),u=o.next();!u.done;u=o.next())s=u.value,"string"!=typeof(c=n[s])&&"texture"===c.type&&void 0!==e[c.stream]&&++i;1<i&&(t.I=!1),f=a(Object.keys(n)),u=f.next();case 2:if(u.done){m.g=4;break}if(l=u.value,"string"==typeof(h=n[l]))return v=r,b=l,y(m,function(t,e,n){var r;return E(function(i){return"number"==typeof n||n instanceof Uint8Array||n instanceof t.h.Uint8BlobList?i.return(n):n instanceof t.h.Texture2dDataOut?((r=t.u[e])||(r=new Ue(t.h,t.G),t.u[e]=r),i.return(Pe(r,n,t.I))):i.return(void 0)})}(t,l,e[h]),14);if(g=e[h.stream],"detection_list"===h.type){if(g){for(var w=g.getRectList(),A=g.getLandmarksList(),j=g.getClassificationsList(),_=[],x=0;x<w.size();++x){var O=te(w.get(x),Ae,Ee);O={boundingBox:{xCenter:mt(O,1),yCenter:mt(O,2),height:mt(O,3),width:mt(O,4),rotation:mt(O,5,0),rectId:Et(O,6)},landmarks:wt(te(A.get(x),be,me),ve,1).map(ke),V:Re(te(j.get(x),ge,de))},_.push(O)}w=_}else w=[];r[l]=w,m.g=7;break}if("proto_list"===h.type){if(g){for(w=Array(g.size()),A=0;A<g.size();A++)w[A]=g.get(A);g.delete()}else w=[];r[l]=w,m.g=7;break}if(void 0===g){m.g=3;break}if("float_list"===h.type){r[l]=g,m.g=7;break}if("proto"===h.type){r[l]=g,m.g=7;break}if("texture"!==h.type)throw Error("Unknown output config type: '"+h.type+"'");return(d=t.u[l])||(d=new Ue(t.h,t.G),t.u[l]=d),y(m,Pe(d,g,t.I),13);case 13:p=m.h,r[l]=p;case 7:h.transform&&r[l]&&(r[l]=h.transform(r[l])),m.g=3;break;case 14:v[b]=m.h;case 3:u=f.next(),m.g=2;break;case 4:return m.return(r)}})}function Ve(t,e){for(var n=e.name||"$",r=[].concat(u(e.wants)),i=new t.h.StringList,o=a(e.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=t.h.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<e.wants.length;++a)o[r[a]]=i.get(a);var u=t.listeners[n];u&&(t.D=We(t,o,e.outs).then(function(n){n=u(n);for(var i=0;i<e.wants.length;++i){var a=o[r[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(t.D=n)}))}}),t.i.attachMultiListener(i,o),i.delete()}function Ye(t){var e=this;t=t||{};var n={url:"face_detection_short.binarypb"},r={type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}};this.g=new Me({locateFile:t.locateFile,files:[{data:!0,url:"face_detection_short.binarypb"},{data:!0,url:"face_detection_short_range.tflite"},{simd:!0,url:"face_detection_solution_simd_wasm_bin.js"},{simd:!1,url:"face_detection_solution_wasm_bin.js"}],graph:n,listeners:[{wants:["detections","image_transformed"],outs:{image:"image_transformed",detections:{type:"detection_list",stream:"detections"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},model:{type:0,onChange:function(t){var i,o,u,s,c;return E(function(f){switch(f.g){case 1:i=a("short"===t?["face_detection_short_range.tflite"]:["face_detection_full_range_sparse.tflite"]),o=i.next();case 2:if(o.done){f.g=4;break}return u=o.value,s="third_party/mediapipe/modules/face_detection/"+u,y(f,Ge(e.g,u),5);case 5:c=f.h,e.g.overrideFile(s,c),o=i.next(),f.g=2;break;case 4:return n.url="short"===t?"face_detection_short.binarypb":"face_detection_full.binarypb",r.graphOptionXref.calculatorName="short"===t?"facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator":"facedetectionfullrangegpu__facedetectionfullrangecommon__TensorsToDetectionsCalculator",f.return(!0)}})}},minDetectionConfidence:r}})}(t=Me.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},t.reset=function(){var t=this;return E(function(e){t.i&&(t.i.reset(),t.o={},t.u={}),e.g=0})},t.setOptions=function(t,e){var n=this;if(e=e||this.g.options){for(var r=[],i=[],o={},u=a(Object.keys(t)),s=u.next();!s.done;o={R:o.R,S:o.S},s=u.next()){var c=s.value;c in this.j&&this.j[c]===t[c]||(this.j[c]=t[c],void 0!==(s=e[c])&&(s.onChange&&(o.R=s.onChange,o.S=t[c],r.push(function(t){return function(){return E(function(e){if(1==e.g)return y(e,t.R(t.S),2);!0===e.h&&(n.s=!0),e.g=0})}}(o))),s.graphOptionXref&&(c={valueNumber:1===s.type?t[c]:0,valueBoolean:0===s.type&&t[c],valueString:2===s.type?t[c]:""},s=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),s.graphOptionXref),c),i.push(s))))}0===r.length&&0===i.length||(this.s=!0,this.B=(void 0===this.B?[]:this.B).concat(i),this.A=(void 0===this.A?[]:this.A).concat(r))}},t.initialize=function(){var t=this;return E(function(e){return 1==e.g?y(e,Ne(t),2):3!=e.g?y(e,function(t){var e,n,r,i,o,u,s,c;return E(function(f){if(1==f.g)return t.g.graph&&t.g.graph.url&&t.Y===t.g.graph.url?f.return():(t.s=!0,t.g.graph&&t.g.graph.url?(t.Y=t.g.graph.url,y(f,Ge(t,t.g.graph.url),3)):void(f.g=2));for(2!=f.g&&(e=f.h,t.i.loadGraph(e)),n=a(Object.keys(t.C)),r=n.next();!r.done;r=n.next())i=r.value,t.i.overrideFile(i,t.C[i]);if(t.C={},t.g.listeners)for(o=a(t.g.listeners),u=o.next();!u.done;u=o.next())s=u.value,Ve(t,s);c=t.j,t.j={},t.setOptions(c),f.g=0})}(t),3):y(e,function(t){var e,n,r,i,o,u;return E(function(s){switch(s.g){case 1:if(!t.s)return s.return();if(!t.A){s.g=2;break}e=a(t.A),n=e.next();case 3:if(n.done){s.g=5;break}return y(s,(0,n.value)(),4);case 4:n=e.next(),s.g=3;break;case 5:t.A=void 0;case 2:if(t.B){for(r=new t.h.GraphOptionChangeRequestList,i=a(t.B),o=i.next();!o.done;o=i.next())u=o.value,r.push_back(u);t.i.changeOptions(r),r.delete(),t.B=void 0}t.s=!1,s.g=0}})}(t),0)})},t.overrideFile=function(t,e){this.i?this.i.overrideFile(t,e):this.C[t]=e},t.clearOverriddenFiles=function(){this.C={},this.i&&this.i.clearOverriddenFiles()},t.send=function(t,e){var n,r,i,o,u,s,c,f,l,h=this;return E(function(g){switch(g.g){case 1:return h.g.inputs?(n=1e3*(null==e?performance.now():e),y(g,h.D,2)):g.return();case 2:return y(g,h.initialize(),3);case 3:for(r=new h.h.PacketDataList,i=a(Object.keys(t)),o=i.next();!o.done;o=i.next())if(u=o.value,s=h.g.inputs[u]){t:{var d=t[u];switch(s.type){case"video":var p=h.o[s.stream];if(p||(p=new Ue(h.h,h.G),h.o[s.stream]=p),0===p.l&&(p.l=p.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&d instanceof HTMLVideoElement)var v=d.videoWidth,b=d.videoHeight;else"undefined"!=typeof HTMLImageElement&&d instanceof HTMLImageElement?(v=d.naturalWidth,b=d.naturalHeight):(v=d.width,b=d.height);b={glName:p.l,width:v,height:b},(v=p.g).canvas.width=b.width,v.canvas.height=b.height,v.activeTexture(v.TEXTURE0),p.h.bindTexture2d(p.l),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,d),p.h.bindTexture2d(0),p=b;break t;case"detections":for((p=h.o[s.stream])||(p=new Be(h.h),h.o[s.stream]=p),p.data||(p.data=new p.g.DetectionListData),p.data.reset(d.length),b=0;b<d.length;++b){v=d[b];var m=p.data,w=m.setBoundingBox,A=b,E=v.boundingBox,j=new Ae;if(yt(j,1,E.xCenter),yt(j,2,E.yCenter),yt(j,3,E.height),yt(j,4,E.width),yt(j,5,E.rotation),yt(j,6,E.rectId),E=ne(j,Ee),w.call(m,A,E),v.landmarks)for(m=0;m<v.landmarks.length;++m){var _=!!(j=v.landmarks[m]).visibility;A=(w=p.data).addNormalizedLandmark,E=b,j=Object.assign(Object.assign({},j),{visibility:_?j.visibility:0}),yt(_=new ve,1,j.x),yt(_,2,j.y),yt(_,3,j.z),j.visibility&&yt(_,4,j.visibility),j=ne(_,ye),A.call(w,E,j)}if(v.V)for(m=0;m<v.V.length;++m)A=(w=p.data).addClassification,E=b,j=v.V[m],yt(_=new le,2,j.ga),j.index&&yt(_,1,j.index),j.label&&yt(_,3,j.label),j.displayName&&yt(_,4,j.displayName),j=ne(_,he),A.call(w,E,j)}p=p.data;break t;default:p={}}}switch(c=p,f=s.stream,s.type){case"video":r.pushTexture2d(Object.assign(Object.assign({},c),{stream:f,timestamp:n}));break;case"detections":(l=c).stream=f,l.timestamp=n,r.pushDetectionList(l);break;default:throw Error("Unknown input config type: '"+s.type+"'")}}return h.i.send(r),y(g,h.D,4);case 4:r.delete(),g.g=0}})},t.onResults=function(t,e){this.listeners[e||"$"]=t},x("Solution",Me),x("OptionType",{BOOL:0,NUMBER:1,ia:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=Ye.prototype).close=function(){return this.g.close(),Promise.resolve()},t.onResults=function(t){this.g.onResults(t)},t.initialize=function(){var t=this;return E(function(e){return y(e,t.g.initialize(),0)})},t.reset=function(){this.g.reset()},t.send=function(t){var e=this;return E(function(n){return y(n,e.g.send(t),0)})},t.setOptions=function(t){this.g.setOptions(t)},x("FaceDetection",Ye),x("FACEDETECTION_LIPS",je),x("FACEDETECTION_LEFT_EYE",_e),x("FACEDETECTION_LEFT_EYEBROW",xe),x("FACEDETECTION_RIGHT_EYE",Oe),x("FACEDETECTION_RIGHT_EYEBROW",Te),x("FACEDETECTION_FACE_OVAL",Fe),x("FACEDETECTION_CONTOURS",Se),x("FACEDETECTION_TESSELATION",[[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],[46