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