1 line
43 KiB
JavaScript
1 line
43 KiB
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 r="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,r){return t==Array.prototype||t==Object.prototype||(t[e]=r.value),t};var n=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 r=t[e];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function i(t,e){if(e)t:{var i=n;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&&r(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 r="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return r?r.call(t):{next:e(t)}}function u(t){if(!(t instanceof Array)){t=a(t);for(var e,r=[];!(e=t.next()).done;)r.push(e.value);t=r}return t}i("Symbol",(function(t){function e(t,e){this.h=t,r(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.h};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function t(r){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(n+(r||"")+"_"+i++,r)}})),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=n[i[a]];"function"==typeof u&&"function"!=typeof u.prototype[t]&&r(u.prototype,t,{configurable:!0,writable:!0,value:function(){return o(e(this))}})}return t}));var s="function"==typeof Object.assign?Object.assign:function(t,e){for(var r=1;r<arguments.length;r++){var n=arguments[r];if(n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};i("Object.assign",(function(t){return t||s}));var f,l="function"==typeof Object.create?Object.create:function(t){function e(){}return e.prototype=t,new e};if("function"==typeof Object.setPrototypeOf)f=Object.setPrototypeOf;else{var h;t:{var c={};try{c.__proto__={a:!0},h=c.a;break t}catch(t){}h=!1}f=h?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var p=f;function v(t,e){if(t.prototype=l(e.prototype),t.prototype.constructor=t,p)p(t,e);else for(var r in e)if("prototype"!=r)if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(e,r);n&&Object.defineProperty(t,r,n)}else t[r]=e[r];t.za=e.prototype}function d(){this.m=!1,this.j=null,this.i=void 0,this.h=1,this.v=this.s=0,this.l=null}function y(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}function g(t,e){t.l={ma:e,na:!0},t.h=t.s||t.v}function m(t,e,r){return t.h=r,{value:e}}function b(t){this.h=new d,this.i=t}function w(t,e,r,n){try{var i=e.call(t.h.j,r);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return t.h.m=!1,i;var o=i.value}catch(e){return t.h.j=null,g(t.h,e),A(t)}return t.h.j=null,n.call(t.h,o),A(t)}function A(t){for(;t.h.h;)try{var e=t.i(t.h);if(e)return t.h.m=!1,{value:e.value,done:!1}}catch(e){t.h.i=void 0,g(t.h,e)}if(t.h.m=!1,t.h.l){if(e=t.h.l,t.h.l=null,e.na)throw e.ma;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function j(t){this.next=function(e){return y(t.h),t.h.j?e=w(t,t.h.j.next,e,t.h.u):(t.h.u(e),e=A(t)),e},this.throw=function(e){return y(t.h),t.h.j?e=w(t,t.h.j.throw,e,t.h.u):(g(t.h,e),e=A(t)),e},this.return=function(e){return function(t,e){y(t.h);var r=t.h.j;return r?w(t,"return"in r?r.return:function(t){return{value:t,done:!0}},e,t.h.return):(t.h.return(e),A(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function x(t){return function(t){function e(e){return t.next(e)}function r(e){return t.throw(e)}return new Promise((function(n,i){!function t(o){o.done?n(o.value):Promise.resolve(o.value).then(e,r).then(t,i)}(t.next())}))}(new j(new b(t)))}function E(t){return t||Array.prototype.fill}d.prototype.u=function(t){this.i=t},d.prototype.return=function(t){this.l={return:t},this.h=this.v},i("Promise",(function(t){function e(t){this.i=0,this.j=void 0,this.h=[],this.u=!1;var e=this.l();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function r(){this.h=null}function i(t){return t instanceof e?t:new e((function(e){e(t)}))}if(t)return t;r.prototype.i=function(t){if(null==this.h){this.h=[];var e=this;this.j((function(){e.m()}))}this.h.push(t)};var o=n.setTimeout;r.prototype.j=function(t){o(t,0)},r.prototype.m=function(){for(;this.h&&this.h.length;){var t=this.h;this.h=[];for(var e=0;e<t.length;++e){var r=t[e];t[e]=null;try{r()}catch(t){this.l(t)}}}this.h=null},r.prototype.l=function(t){this.j((function(){throw t}))},e.prototype.l=function(){function t(t){return function(n){r||(r=!0,t.call(e,n))}}var e=this,r=!1;return{resolve:t(this.I),reject:t(this.m)}},e.prototype.I=function(t){if(t===this)this.m(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.L(t);else{t:switch(typeof t){case"object":var r=null!=t;break t;case"function":r=!0;break t;default:r=!1}r?this.F(t):this.s(t)}},e.prototype.F=function(t){var e=void 0;try{e=t.then}catch(t){return void this.m(t)}"function"==typeof e?this.M(e,t):this.s(t)},e.prototype.m=function(t){this.v(2,t)},e.prototype.s=function(t){this.v(1,t)},e.prototype.v=function(t,e){if(0!=this.i)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.i);this.i=t,this.j=e,2===this.i&&this.K(),this.H()},e.prototype.K=function(){var t=this;o((function(){if(t.D()){var e=n.console;void 0!==e&&e.error(t.j)}}),1)},e.prototype.D=function(){if(this.u)return!1;var t=n.CustomEvent,e=n.Event,r=n.dispatchEvent;return void 0===r||("function"==typeof t?t=new t("unhandledrejection",{cancelable:!0}):"function"==typeof e?t=new e("unhandledrejection",{cancelable:!0}):(t=n.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,t),t.promise=this,t.reason=this.j,r(t))},e.prototype.H=function(){if(null!=this.h){for(var t=0;t<this.h.length;++t)u.i(this.h[t]);this.h=null}};var u=new r;return e.prototype.L=function(t){var e=this.l();t.T(e.resolve,e.reject)},e.prototype.M=function(t,e){var r=this.l();try{t.call(e,r.resolve,r.reject)}catch(t){r.reject(t)}},e.prototype.then=function(t,r){function n(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.T(n(t,i),n(r,o)),a},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.T=function(t,e){function r(){switch(n.i){case 1:t(n.j);break;case 2:e(n.j);break;default:throw Error("Unexpected state: "+n.i)}}var n=this;null==this.h?u.i(r):this.h.push(r),this.u=!0},e.resolve=i,e.reject=function(t){return new e((function(e,r){r(t)}))},e.race=function(t){return new e((function(e,r){for(var n=a(t),o=n.next();!o.done;o=n.next())i(o.value).T(e,r)}))},e.all=function(t){var r=a(t),n=r.next();return n.done?i([]):new e((function(t,e){function o(e){return function(r){a[e]=r,0==--u&&t(a)}}var a=[],u=0;do{a.push(void 0),u++,i(n.value).T(o(a.length-1),e),n=r.next()}while(!n.done)}))},e})),i("Array.prototype.keys",(function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var r=0,n=!1,i={next:function(){if(!n&&r<t.length){var i=r++;return{value:e(i,t[i]),done:!1}}return n=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(t){return t}))}})),i("Array.prototype.fill",(function(t){return t||function(t,e,r){var n=this.length||0;for(0>e&&(e=Math.max(0,n+e)),(null==r||r>n)&&(r=n),0>(r=Number(r))&&(r=Math.max(0,n+r)),e=Number(e||0);e<r;e++)this[e]=t;return this}})),i("Int8Array.prototype.fill",E),i("Uint8Array.prototype.fill",E),i("Uint8ClampedArray.prototype.fill",E),i("Int16Array.prototype.fill",E),i("Uint16Array.prototype.fill",E),i("Int32Array.prototype.fill",E),i("Uint32Array.prototype.fill",E),i("Float32Array.prototype.fill",E),i("Float64Array.prototype.fill",E),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 r=this;r instanceof String&&(r=String(r));var n=r.length;for(0>(e=e||0)&&(e=Math.max(e+n,0));e<n;e++){var i=r[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)}}));var O=this||self;function F(t,e){t=t.split(".");var r,n=O;t[0]in n||void 0===n.execScript||n.execScript("var "+t[0]);for(;t.length&&(r=t.shift());)t.length||void 0===e?n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}:n[r]=e}function S(t){var e;return(e=O.navigator)&&(e=e.userAgent)||(e=""),-1!=e.indexOf(t)}var T=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var r=t.length,n=Array(r),i="string"==typeof t?t.split(""):t,o=0;o<r;o++)o in i&&(n[o]=e.call(void 0,i[o],o,t));return n},_={},k=null;function R(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){var r=t.charAt(n++),i=k[r];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return e}U();for(var n=0;;){var i=r(-1),o=r(0),a=r(64),u=r(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){n[i++]=t})),i!==r?n.subarray(0,i):n}function U(){if(!k){k={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],r=0;5>r;r++){var n=t.concat(e[r].split(""));_[r]=n;for(var i=0;i<n.length;i++){var o=n[i];void 0===k[o]&&(k[o]=i)}}}}var C="undefined"!=typeof Uint8Array,P=!(S("Trident")||S("MSIE"))&&"function"==typeof O.btoa;function B(t){if(!P){var e;void 0===e&&(e=0),U(),e=_[e];for(var r=Array(Math.floor(t.length/3)),n=e[64]||"",i=0,o=0;i<t.length-2;i+=3){var a=t[i],u=t[i+1],s=t[i+2],f=e[a>>2];a=e[(3&a)<<4|u>>4],u=e[(15&u)<<2|s>>6],s=e[63&s],r[o++]=f+a+u+s}switch(f=0,s=n,t.length-i){case 2:s=e[(15&(f=t[i+1]))<<2]||n;case 1:t=t[i],r[o]=e[t>>2]+e[(3&t)<<4|f>>4]+s+n}return r.join("")}for(e="";10240<t.length;)e+=String.fromCharCode.apply(null,t.subarray(0,10240)),t=t.subarray(10240);return e+=String.fromCharCode.apply(null,t),btoa(e)}var M,I=RegExp("[-_.]","g");function L(t){switch(t){case"-":return"+";case"_":return"/";case".":return"=";default:return""}}function N(t){if(!P)return R(t);I.test(t)&&(t=t.replace(I,L)),t=atob(t);for(var e=new Uint8Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function D(){return M||(M=new Uint8Array(0))}var G={},z="function"==typeof Uint8Array.prototype.slice,V=0,W=0;function H(t){var e=0>t,r=(t=Math.abs(t))>>>0;t=Math.floor((t-r)/4294967296),e&&(e=(r=a(J(r,t))).next().value,t=r.next().value,r=e),V=r>>>0,W=t>>>0}var X,Y="function"==typeof BigInt;function J(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function K(t,e){this.i=t>>>0,this.h=e>>>0}function Z(t){if(!t)return X||(X=new K(0,0));if(!/^-?\d+$/.test(t))return null;if(16>t.length)H(Number(t));else if(Y)t=BigInt(t),V=Number(t&BigInt(4294967295))>>>0,W=Number(t>>BigInt(32)&BigInt(4294967295));else{var e=+("-"===t[0]);W=V=0;for(var r=t.length,n=e,i=(r-e)%6+e;i<=r;n=i,i+=6)n=Number(t.slice(n,i)),W*=1e6,4294967296<=(V=1e6*V+n)&&(W+=V/4294967296|0,V%=4294967296);e&&(t=(e=a(J(V,W))).next().value,e=e.next().value,V=t,W=e)}return new K(V,W)}function q(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function $(){return Error("Failed to read varint, encoding is invalid.")}function Q(t,e){return Error("Tried to read past the end of the data "+e+" > "+t)}function tt(){throw Error("Invalid UTF8")}function et(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var rt,nt,it,ot=void 0,at="undefined"!=typeof TextDecoder,ut="undefined"!=typeof TextEncoder;function st(t){if(t!==G)throw Error("illegal external caller")}function ft(t,e){if(st(e),this.V=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}function lt(){return it||(it=new ft(null,G))}function ht(t){st(G);var e=t.V;return null==(e=null==e||C&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?N(e):null)?e:t.V=e}function ct(t,e){this.i=null,this.m=!1,this.h=this.j=this.l=0,pt(this,t,e)}function pt(t,e,r){r=void 0===r?{}:r,t.S=void 0!==r.S&&r.S,e&&(e=function(t){if("string"==typeof t)return{buffer:N(t),C:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),C:!1};if(t.constructor===Uint8Array)return{buffer:t,C:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),C:!1};if(t.constructor===ft)return{buffer:ht(t)||D(),C:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),C:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}(e),t.i=e.buffer,t.m=e.C,t.l=0,t.j=t.i.length,t.h=t.l)}function vt(t,e){if(t.h=e,e>t.j)throw Q(t.j,e)}function dt(t){var e=t.i,r=t.h,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw $();return vt(t,r),i}function yt(t,e){if(0>e)throw Error("Tried to read a negative byte length: "+e);var r=t.h,n=r+e;if(n>t.j)throw Q(e,t.j-r);return t.h=n,r}ct.prototype.reset=function(){this.h=this.l};var gt=[];function mt(){this.h=[]}function bt(t,e,r){for(;0<r||127<e;)t.h.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.h.push(e)}function wt(t,e){for(;127<e;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function At(t,e){if(gt.length){var r=gt.pop();pt(r,t,e),t=r}else t=new ct(t,e);this.h=t,this.j=this.h.h,this.i=this.l=-1,this.setOptions(e)}function jt(t){var e=t.h;if(e.h==e.j)return!1;t.j=t.h.h;var r=dt(t.h)>>>0;if(e=r>>>3,!(0<=(r&=7)&&5>=r))throw q(r,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.l=e,t.i=r,!0}function xt(t){switch(t.i){case 0:if(0!=t.i)xt(t);else t:{for(var e=(t=t.h).h,r=e+10,n=t.i;e<r;)if(0==(128&n[e++])){vt(t,e);break t}throw $()}break;case 1:vt(t=t.h,t.h+8);break;case 2:2!=t.i?xt(t):(e=dt(t.h)>>>0,vt(t=t.h,t.h+e));break;case 5:vt(t=t.h,t.h+4);break;case 3:for(e=t.l;;){if(!jt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.l!=e)throw Error("Unmatched end-group tag");break}xt(t)}break;default:throw q(t.i,t.j)}}mt.prototype.length=function(){return this.h.length},mt.prototype.end=function(){var t=this.h;return this.h=[],t},At.prototype.setOptions=function(t){t=void 0===t?{}:t,this.ca=void 0!==t.ca&&t.ca},At.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var Et=[];function Ot(){this.j=[],this.i=0,this.h=new mt}function Ft(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}var St="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function Tt(t,e){return St?t[St]|=e:void 0!==t.A?t.A|=e:(Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}}),e)}function _t(t,e){St?t[St]&&(t[St]&=~e):void 0!==t.A&&(t.A&=~e)}function kt(t){var e;return null==(e=St?t[St]:t.A)?0:e}function Rt(t,e){St?t[St]=e:void 0!==t.A?t.A=e:Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}})}function Ut(t){return Tt(t,1),t}function Ct(t,e){Rt(e,-51&(0|t))}function Pt(t,e){Rt(e,-41&(18|t))}var Bt={};function Mt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}var It,Lt,Nt=[];function Dt(t){if(2&kt(t.o))throw Error("Cannot mutate an immutable Message")}function Gt(t){var e=t.length;(e=e?t[e-1]:void 0)&&Mt(e)?e.g=1:(e={},t.push((e.g=1,e)))}function zt(t){var e=t.i+t.G;return t.B||(t.B=t.o[e]={})}function Vt(t,e){return-1===e?null:e>=t.i?t.B?t.B[e]:void 0:t.o[e+t.G]}function Wt(t,e,r,n){Dt(t),Ht(t,e,r,n)}function Ht(t,e,r,n){t.j&&(t.j=void 0),e>=t.i||n?zt(t)[e]=r:(t.o[e+t.G]=r,(t=t.B)&&e in t&&delete t[e])}function Xt(t,e,r,n){var i=Vt(t,e);Array.isArray(i)||(i=It);var o=kt(i);if(1&o||Ut(i),n)2&o||Tt(i,2),1&r||Object.freeze(i);else{n=!(2&r);var a=2&o;1&r||!a?n&&16&o&&!a&&_t(i,16):Ht(t,e,i=Ut(Array.prototype.slice.call(i)))}return i}function Yt(t,e){var r=Vt(t,e),n=null==r?r:"number"==typeof r||"NaN"===r||"Infinity"===r||"-Infinity"===r?Number(r):void 0;return null!=n&&n!==r&&Ht(t,e,n),n}function Jt(t,e,r,n,i){t.h||(t.h={});var o=t.h[r],a=Xt(t,r,3,i);if(!o){var u=a;o=[];var s=!!(16&kt(t.o));a=!!(2&kt(u));var f=u;!i&&a&&(u=Array.prototype.slice.call(u));for(var l=a,h=0;h<u.length;h++){var c=u[h],p=e,v=!1;if(v=void 0!==v&&v,void 0!==(c=Array.isArray(c)?new p(c):v?new p:void 0)){var d=v=kt(p=c.o);a&&(d|=2),s&&(d|=16),d!=v&&Rt(p,d),p=d,l=l||!!(2&p),o.push(c)}}return t.h[r]=o,e=33|(s=kt(u)),s!=(e=l?-9&e:8|e)&&(l=u,Object.isFrozen(l)&&(l=Array.prototype.slice.call(l)),Rt(l,e),u=l),f!==u&&Ht(t,r,u),(i||n&&a)&&Tt(o,2),n&&Object.freeze(o),o}return i||(i=Object.isFrozen(o),n&&!i?Object.freeze(o):!n&&i&&(o=Array.prototype.slice.call(o),t.h[r]=o)),o}function Kt(t,e,r){var n=!!(2&kt(t.o));if(e=Jt(t,e,r,n,n),t=Xt(t,r,3,n),!(n||8&kt(t))){for(n=0;n<e.length;n++){if(2&kt((r=e[n]).o)){var i=ue(r,!1);i.j=r}else i=r;r!==i&&(e[n]=i,t[n]=i.o)}Tt(t,8)}return e}function Zt(t,e,r){if(null!=r&&"number"!=typeof r)throw Error("Value of float/double field must be a number|null|undefined, found "+typeof r+": "+r);Wt(t,e,r)}function qt(t,e,r,n,i){Dt(t);var o=Jt(t,r,e,!1,!1);return r=null!=n?n:new r,t=Xt(t,e,2,!1),null!=i?(o.splice(i,0,r),t.splice(i,0,r.o)):(o.push(r),t.push(r.o)),r.C()&&_t(t,8),r}function $t(t,e){return null==t?e:t}function Qt(t,e,r){return r=void 0===r?0:r,$t(Yt(t,e),r)}function te(t,e,r,n){if(null!=t){if(Array.isArray(t))t=ee(t,e,r,void 0!==n);else if(Mt(t)){var i,o={};for(i in t)o[i]=te(t[i],e,r,n);t=o}else t=e(t,n);return t}}function ee(t,e,r,n){var i=kt(t);n=n?!!(16&i):void 0,t=Array.prototype.slice.call(t);for(var o=0;o<t.length;o++)t[o]=te(t[o],e,r,n);return r(i,t),t}function re(t){return t.ja===Bt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"object":if(t)if(Array.isArray(t)){if(0!=(128&kt(t)))return Gt(t=Array.prototype.slice.call(t)),t}else{if(C&&null!=t&&t instanceof Uint8Array)return B(t);if(t instanceof ft){var e=t.V;return null==e?"":"string"==typeof e?e:t.V=B(e)}}}return t}(t)}function ne(t,e){128&t&&Gt(e)}function ie(t,e,r){if(r=void 0===r?Pt:r,null!=t){if(C&&t instanceof Uint8Array)return t.length?new ft(new Uint8Array(t),G):lt();if(Array.isArray(t)){var n=kt(t);return 2&n?t:!e||32&n||!(16&n||0===n)?(4&(e=kt(t=ee(t,ie,4&n?Pt:r,!0)))&&2&e&&Object.freeze(t),t):(Rt(t,2|n),t)}return t.ja===Bt?ae(t):t}}function oe(t,e,r,n,i,o,a){if(t=t.h&&t.h[r]){if(2&(n=kt(t))?n=t:(Pt(n,o=T(t,ae)),Object.freeze(o),n=o),Dt(e),a=null==n?It:Ut([]),null!=n){for(o=!!n.length,t=0;t<n.length;t++){var u=n[t];o=o&&!(2&kt(u.o)),a[t]=u.o}o=1|(o?8:0),((t=kt(a))&o)!==o&&(Object.isFrozen(a)&&(a=Array.prototype.slice.call(a)),Rt(a,t|o)),e.h||(e.h={}),e.h[r]=n}else e.h&&(e.h[r]=void 0);Ht(e,r,a,i)}else Wt(e,r,ie(n,o,a),i)}function ae(t){return 2&kt(t.o)||Tt((t=ue(t,!0)).o,2),t}function ue(t,e){var r=t.o,n=[];Tt(n,16);var i=t.constructor.h;if(i&&n.push(i),i=t.B){n.length=r.length,n.fill(void 0,n.length,r.length);var o={};n[n.length-1]=o}0!=(128&kt(r))&&Gt(n),e=e||t.C()?Pt:Ct,o=t.constructor,Lt=n,n=new o(n),Lt=void 0,t.R&&(n.R=t.R.slice()),o=!!(16&kt(r));for(var a=i?r.length-1:r.length,u=0;u<a;u++)oe(t,n,u-t.G,r[u],!1,o,e);if(i)for(var s in i)oe(t,n,+s,i[s],!0,o,e);return n}function se(t,e,r){null==t&&(t=Lt),Lt=void 0;var n,i=this.constructor.i||0,o=0<i,a=this.constructor.h,u=!1;if(null==t){var s=48,f=!0;o&&(i=0,s|=128),Rt(t=a?[a]:[],s)}else{if(!Array.isArray(t))throw Error();if(a&&a!==t[0])throw Error();var l=s=Tt(t,0);if((f=0!=(16&l))&&((u=0!=(32&l))||(l|=32)),o){if(128&l)i=0;else if(0<t.length){var h=t[t.length-1];if(Mt(h)&&"g"in h){i=0,l|=128,delete h.g;var c,p=!0;for(c in h){p=!1;break}p&&t.pop()}}}else if(128&l)throw Error();s!==l&&Rt(t,l)}if(this.G=(a?0:-1)-i,this.h=void 0,this.o=t,i=(a=this.o.length)-1,a&&Mt(a=this.o[i])?(this.B=a,this.i=i-this.G):void 0!==e&&-1<e?(this.i=Math.max(e,i+1-this.G),this.B=void 0):this.i=Number.MAX_VALUE,!o&&this.B&&"g"in this.B)throw Error('Unexpected "g" flag in sparse object of message that is not a group type.');if(r)for(e=f&&!u&&!0,o=this.i,f=0;f<r.length;f++)(u=r[f])<o?(i=t[u+=this.G])?fe(i,e):t[u]=It:(n||(n=zt(this)),(i=n[u])?fe(i,e):n[u]=It)}function fe(t,e){if(Array.isArray(t)){var r=kt(t),n=1;!e||2&r||(n|=16),(r&n)!==n&&Rt(t,r|n)}}function le(t,e,r){if(r){var n,i={};for(n in r){var o=r[n],a=o.ra;a||(i.J=o.xa||o.oa.W,o.ia?(i.aa=me(o.ia),a=function(t){return function(e,r,n){return t.J(e,r,n,t.aa)}}(i)):o.ka?(i.Z=be(o.da.P,o.ka),a=function(t){return function(e,r,n){return t.J(e,r,n,t.Z)}}(i)):a=i.J,o.ra=a),a(e,t,o.da),i={J:i.J,aa:i.aa,Z:i.Z}}}!function(t,e){if(e=e.R){Ft(t,t.h.end());for(var r=0;r<e.length;r++)Ft(t,ht(e[r])||D())}}(e,t)}Rt(Nt,23),It=Object.freeze(Nt),se.prototype.toJSON=function(){return ee(this.o,re,ne)},se.prototype.C=function(){return!!(2&kt(this.o))},se.prototype.ja=Bt,se.prototype.toString=function(){return this.o.toString()};var he=Symbol();function ce(t,e,r){return t[he]||(t[he]=function(t,n){return e(t,n,r)})}function pe(t){var e=t[he];if(!e){var r=Re(t);e=function(t,e){return Ue(t,e,r)},t[he]=e}return e}function ve(t){var e=function(t){var e=t.ia;return e?pe(e):(e=t.wa)?ce(t.da.P,e,t.ka):void 0}(t),r=t.da,n=t.oa.U;return e?function(t,i){return n(t,i,r,e)}:function(t,e){return n(t,e,r)}}function de(t,e){var r=t[e];return"function"==typeof r&&0===r.length&&(r=r(),t[e]=r),Array.isArray(r)&&(Fe in r||we in r||0<r.length&&"function"==typeof r[0])?r:void 0}function ye(t,e,r,n,i,o){e.P=t[0];var a=1;if(t.length>a&&"number"!=typeof t[a]){var u=t[a++];r(e,u)}for(;a<t.length;){r=t[a++];for(var s=a+1;s<t.length&&"number"!=typeof t[s];)s++;switch(u=t[a++],s-=a){case 0:n(e,r,u);break;case 1:(s=de(t,a))?(a++,i(e,r,u,s)):n(e,r,u,t[a++]);break;case 2:i(e,r,u,s=de(t,s=a++),t[a++]);break;case 3:o(e,r,u,t[a++],t[a++],t[a++]);break;case 4:o(e,r,u,t[a++],t[a++],t[a++],t[a++]);break;default:throw Error("unexpected number of binary field arguments: "+s)}}return e}var ge=Symbol();function me(t){var e=t[ge];if(!e){var r=Oe(t);e=function(t,e){return Ce(t,e,r)},t[ge]=e}return e}function be(t,e){var r=t[ge];return r||(r=function(t,r){return le(t,r,e)},t[ge]=r),r}var we=Symbol();function Ae(t,e){t.push(e)}function je(t,e,r){t.push(e,r.W)}function xe(t,e,r,n){var i=me(n),o=Oe(n).P,a=r.W;t.push(e,(function(t,e,r){return a(t,e,r,o,i)}))}function Ee(t,e,r,n,i,o){var a=be(n,o),u=r.W;t.push(e,(function(t,e,r){return u(t,e,r,n,a)}))}function Oe(t){var e=t[we];return e||(e=ye(t,t[we]=[],Ae,je,xe,Ee),Fe in t&&we in t&&(t.length=0),e)}var Fe=Symbol();function Se(t,e){t[0]=e}function Te(t,e,r,n){var i=r.U;t[e]=n?function(t,e,r){return i(t,e,r,n)}:i}function _e(t,e,r,n,i){var o=r.U,a=pe(n),u=Re(n).P;t[e]=function(t,e,r){return o(t,e,r,u,a,i)}}function ke(t,e,r,n,i,o,a){var u=r.U,s=ce(n,i,o);t[e]=function(t,e,r){return u(t,e,r,n,s,a)}}function Re(t){var e=t[Fe];return e||(e=ye(t,t[Fe]={},Se,Te,_e,ke),Fe in t&&we in t&&(t.length=0),e)}function Ue(t,e,r){for(;jt(e)&&4!=e.i;){var n=e.l,i=r[n];if(!i){var o=r[0];o&&(o=o[n])&&(i=r[n]=ve(o))}if(!i||!i(e,t,n)){n=t,o=(i=e).j,xt(i);var a=i;if(!a.ca){if(i=a.h.h-o,a.h.h=o,a=a.h,0==i)i=lt();else{if(o=yt(a,i),a.S&&a.m)i=a.i.subarray(o,o+i);else{a=a.i;var u=o;i=u===(i=o+i)?D():z?a.slice(u,i):new Uint8Array(a.subarray(u,i))}i=0==i.length?lt():new ft(i,G)}(o=n.R)?o.push(i):n.R=[i]}}}return t}function Ce(t,e,r){for(var n=r.length,i=1==n%2,o=i?1:0;o<n;o+=2)(0,r[o+1])(e,t,r[o]);le(t,e,i?r[0]:void 0)}function Pe(t,e){return{U:t,W:e}}var Be=Pe((function(t,e,r){if(5!==t.i)return!1;var n=(t=t.h).i,i=t.h,o=n[i],a=n[i+1],u=n[i+2];return n=n[i+3],vt(t,t.h+4),t=2*((a=(o<<0|a<<8|u<<16|n<<24)>>>0)>>31)+1,o=a>>>23&255,a&=8388607,Wt(e,r,255==o?a?NaN:1/0*t:0==o?t*Math.pow(2,-149)*a:t*Math.pow(2,o-150)*(a+Math.pow(2,23))),!0}),(function(t,e,r){if(null!=(e=Yt(e,r))){wt(t.h,8*r+5),t=t.h;var n=+e;0===n?0<1/n?V=W=0:(W=0,V=2147483648):isNaN(n)?(W=0,V=2147483647):34028234663852886e22<(n=(r=0>n?-2147483648:0)?-n:n)?(W=0,V=(2139095040|r)>>>0):11754943508222875e-54>n?(n=Math.round(n/Math.pow(2,-149)),W=0,V=(r|n)>>>0):(e=Math.floor(Math.log(n)/Math.LN2),n*=Math.pow(2,-e),16777216<=(n=Math.round(8388608*n))&&++e,W=0,V=(r|e+127<<23|8388607&n)>>>0),r=V,t.h.push(r>>>0&255),t.h.push(r>>>8&255),t.h.push(r>>>16&255),t.h.push(r>>>24&255)}})),Me=Pe((function(t,e,r){if(0!==t.i)return!1;var n=t.h,i=0,o=t=0,a=n.i,u=n.h;do{var s=a[u++];i|=(127&s)<<o,o+=7}while(32>o&&128&s);for(32<o&&(t|=(127&s)>>4),o=3;32>o&&128&s;o+=7)t|=(127&(s=a[u++]))<<o;if(vt(n,u),!(128>s))throw $();return n=i>>>0,(t=2147483648&(s=t>>>0))&&(s=~s>>>0,0==(n=1+~n>>>0)&&(s=s+1>>>0)),n=4294967296*s+(n>>>0),Wt(e,r,t?-n:n),!0}),(function(t,e,r){null!=(e=Vt(e,r))&&("string"==typeof e&&Z(e),null!=e&&(wt(t.h,8*r),"number"==typeof e?(t=t.h,H(e),bt(t,V,W)):(r=Z(e),bt(t.h,r.i,r.h))))})),Ie=Pe((function(t,e,r){return 0===t.i&&(Wt(e,r,dt(t.h)),!0)}),(function(t,e,r){if(null!=(e=Vt(e,r))&&null!=e)if(wt(t.h,8*r),t=t.h,0<=(r=e))wt(t,r);else{for(e=0;9>e;e++)t.h.push(127&r|128),r>>=7;t.h.push(1)}})),Le=Pe((function(t,e,r){if(2!==t.i)return!1;var n=dt(t.h)>>>0,i=yt(t=t.h,n);if(t=t.i,at){var o,a=t;(o=rt)||(o=rt=new TextDecoder("utf-8",{fatal:!0})),t=i+n,a=0===i&&t===a.length?a:a.subarray(i,t);try{var u=o.decode(a)}catch(t){if(void 0===ot){try{o.decode(new Uint8Array([128]))}catch(t){}try{o.decode(new Uint8Array([97])),ot=!0}catch(t){ot=!1}}throw!ot&&(rt=void 0),t}}else{n=(u=i)+n,i=[];for(var s,f,l=null;u<n;)128>(s=t[u++])?i.push(s):224>s?u>=n?tt():(f=t[u++],194>s||128!=(192&f)?(u--,tt()):i.push((31&s)<<6|63&f)):240>s?u>=n-1?tt():128!=(192&(f=t[u++]))||224===s&&160>f||237===s&&160<=f||128!=(192&(a=t[u++]))?(u--,tt()):i.push((15&s)<<12|(63&f)<<6|63&a):244>=s?u>=n-2?tt():128!=(192&(f=t[u++]))||0!=f-144+(s<<28)>>30||128!=(192&(a=t[u++]))||128!=(192&(o=t[u++]))?(u--,tt()):(s=(7&s)<<18|(63&f)<<12|(63&a)<<6|63&o,s-=65536,i.push(55296+(s>>10&1023),56320+(1023&s))):tt(),8192<=i.length&&(l=et(l,i),i.length=0);u=et(l,i)}return Wt(e,r,u),!0}),(function(t,e,r){if(null!=(e=Vt(e,r))){var n=!1;if(n=void 0!==n&&n,ut){if(n&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(nt||(nt=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(n)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=i===o.length?o:o.subarray(0,i)}wt(t.h,8*r+2),wt(t.h,e.length),Ft(t,t.h.end()),Ft(t,e)}})),Ne=Pe((function(t,e,r,n,i){if(2!==t.i)return!1;e=qt(e,r,n),r=t.h.j,n=dt(t.h)>>>0;var o=t.h.h+n,a=o-r;if(0>=a&&(t.h.j=o,i(e,t,void 0,void 0,void 0),a=o-t.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+n+" bytes, instead read "+(n-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.h.h=o,t.h.j=r,!0}),(function(t,e,r,n,i){if(null!=(e=Kt(e,n,r)))for(n=0;n<e.length;n++){var o=t;wt(o.h,8*r+2);var a=o.h.end();Ft(o,a),a.push(o.i),o=a,i(e[n],t),a=t;var u=o.pop();for(u=a.i+a.h.length()-u;127<u;)o.push(127&u|128),u>>>=7,a.i++;o.push(u),a.i++}}));function De(t){return function(e,r){t:{if(Et.length){var n=Et.pop();n.setOptions(r),pt(n.h,e,r),e=n}else e=new At(e,r);try{var i=Re(t),o=Ue(new i.P,e,i);break t}finally{(i=e.h).i=null,i.m=!1,i.l=0,i.j=0,i.h=0,i.S=!1,e.l=-1,e.i=-1,100>Et.length&&Et.push(e)}o=void 0}return o}}function Ge(t){return function(){var e=new Ot;Ce(this,e,Oe(t)),Ft(e,e.h.end());for(var r=new Uint8Array(e.i),n=e.j,i=n.length,o=0,a=0;a<i;a++){var u=n[a];r.set(u,o),o+=u.length}return e.j=[r],r}}function ze(t){se.call(this,t)}v(ze,se);var Ve=[ze,1,Ie,2,Be,3,Le,4,Le];function We(t){se.call(this,t,-1,He)}ze.prototype.l=Ge(Ve),v(We,se),We.prototype.addClassification=function(t,e){return qt(this,1,ze,t,e),this};var He=[1],Xe=De([We,1,Ne,Ve]);function Ye(t){se.call(this,t)}v(Ye,se);var Je=[Ye,1,Be,2,Be,3,Be,4,Be,5,Be];function Ke(t){se.call(this,t,-1,Ze)}Ye.prototype.l=Ge(Je),v(Ke,se);var Ze=[1],qe=De([Ke,1,Ne,Je]);function $e(t){se.call(this,t)}v($e,se);var Qe=[$e,1,Be,2,Be,3,Be,4,Be,5,Be,6,Me],tr=De(Qe);function er(t,e,r){if(r=t.createShader(0===r?t.VERTEX_SHADER:t.FRAGMENT_SHADER),t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+t.getShaderInfoLog(r));return r}function rr(t){return Kt(t,ze,1).map((function(t){var e=Vt(t,1);return{index:null==e?0:e,qa:Qt(t,2),label:null!=Vt(t,3)?$t(Vt(t,3),""):void 0,displayName:null!=Vt(t,4)?$t(Vt(t,4),""):void 0}}))}function nr(t){return{x:Qt(t,1),y:Qt(t,2),z:Qt(t,3),visibility:null!=Yt(t,4)?Qt(t,4):void 0}}function ir(t,e){this.i=t,this.h=e,this.m=0}function or(t,e,r){return function(t,e){var r=t.h;if(void 0===t.s){var n=er(r,"\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=er(r,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getProgramParameter(o,r.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+r.getProgramInfoLog(o));n=t.s=o,r.useProgram(n),i=r.getUniformLocation(n,"sampler0"),t.l={O:r.getAttribLocation(n,"aVertex"),N:r.getAttribLocation(n,"aTex"),ya:i},t.v=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,t.v),r.enableVertexAttribArray(t.l.O),r.vertexAttribPointer(t.l.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),t.u=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,t.u),r.enableVertexAttribArray(t.l.N),r.vertexAttribPointer(t.l.N,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.uniform1i(i,0)}n=t.l,r.useProgram(t.s),r.canvas.width=e.width,r.canvas.height=e.height,r.viewport(0,0,e.width,e.height),r.activeTexture(r.TEXTURE0),t.i.bindTexture2d(e.glName),r.enableVertexAttribArray(n.O),r.bindBuffer(r.ARRAY_BUFFER,t.v),r.vertexAttribPointer(n.O,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,t.u),r.vertexAttribPointer(n.N,2,r.FLOAT,!1,0,0),r.bindFramebuffer(r.DRAW_FRAMEBUFFER?r.DRAW_FRAMEBUFFER:r.FRAMEBUFFER,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.colorMask(!0,!0,!0,!0),r.drawArrays(r.TRIANGLE_FAN,0,4),r.disableVertexAttribArray(n.O),r.disableVertexAttribArray(n.N),r.bindBuffer(r.ARRAY_BUFFER,null),t.i.bindTexture2d(0)}(t,e),"function"==typeof t.h.canvas.transferToImageBitmap?Promise.resolve(t.h.canvas.transferToImageBitmap()):r?Promise.resolve(t.h.canvas):"function"==typeof createImageBitmap?createImageBitmap(t.h.canvas):(void 0===t.j&&(t.j=document.createElement("canvas")),new Promise((function(e){t.j.height=t.h.canvas.height,t.j.width=t.h.canvas.width,t.j.getContext("2d",{}).drawImage(t.h.canvas,0,0,t.h.canvas.width,t.h.canvas.height),e(t.j)})))}function ar(t){this.h=t}$e.prototype.l=Ge(Qe);var ur=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 sr(t,e){return e+t}function fr(t,e){window[t]=e}function lr(t){if(this.h=t,this.listeners={},this.l={},this.L={},this.s={},this.v={},this.M=this.u=this.ga=!0,this.I=Promise.resolve(),this.fa="",this.D={},this.locateFile=t&&t.locateFile||sr,"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.ha=e,t.options)for(var r=(e=a(Object.keys(t.options))).next();!r.done;r=e.next()){r=r.value;var n=t.options[r].default;void 0!==n&&(this.l[r]="function"==typeof n?n():n)}}function hr(t){var e,r,n,i,o,a,s,f,l,h,c;return x((function(p){switch(p.h){case 1:return t.ga?(e=void 0===t.h.files?[]:"function"==typeof t.h.files?t.h.files(t.l):t.h.files,m(p,x((function(t){switch(t.h){case 1:return t.s=2,m(t,WebAssembly.instantiate(ur),4);case 4:t.h=3,t.s=0;break;case 2:return t.s=0,t.l=null,t.return(!1);case 3:return t.return(!0)}})),2)):p.return();case 2:if(r=p.i,"object"==typeof window)return fr("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),fr("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),a=e.filter((function(t){return void 0!==t.data})),s=e.filter((function(t){return void 0===t.data})),f=Promise.all(a.map((function(e){var r=cr(t,e.url);if(void 0!==e.path){var n=e.path;r=r.then((function(e){return t.overrideFile(n,e),Promise.resolve(e)}))}return r}))),l=Promise.all(s.map((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r?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.ha)):Promise.resolve()}))).then((function(){var e,r,n;return x((function(i){if(1==i.h)return e=window.createMediapipeSolutionsWasm,r=window.createMediapipeSolutionsPackedAssets,n=t,m(i,e(r),2);n.i=i.i,i.h=0}))})),h=x((function(e){return t.h.graph&&t.h.graph.url?e=m(e,cr(t,t.h.graph.url),0):(e.h=0,e=void 0),e})),m(p,Promise.all([l,f,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return n=e.filter((function(t){return void 0===t.simd||t.simd&&r||!t.simd&&!r})).map((function(e){return t.locateFile(e.url,t.ha)})),importScripts.apply(null,u(n)),i=t,m(p,createMediapipeSolutionsWasm(Module),6);case 6:i.i=p.i,t.m=new OffscreenCanvas(1,1),t.i.canvas=t.m,o=t.i.GL.createContext(t.m,{antialias:!1,alpha:!1,va:"undefined"!=typeof WebGL2RenderingContext?2:1}),t.i.GL.makeContextCurrent(o),p.h=4;break;case 7:if(t.m=document.createElement("canvas"),!(c=t.m.getContext("webgl2",{}))&&!(c=t.m.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();t.K=c,t.i.canvas=t.m,t.i.createContext(t.m,!0,!0,{});case 4:t.j=new t.i.SolutionWasm,t.ga=!1,p.h=0}}))}function cr(t,e){var r,n;return x((function(i){return e in t.L?i.return(t.L[e]):(r=t.locateFile(e,""),n=fetch(r).then((function(t){return t.arrayBuffer()})),t.L[e]=n,i.return(n))}))}function pr(t,e,r){var n,i,o,u,s,f,l,h,c,p,v,d,y,g;return x((function(b){switch(b.h){case 1:if(!r)return b.return(e);for(n={},i=0,o=a(Object.keys(r)),u=o.next();!u.done;u=o.next())s=u.value,"string"!=typeof(f=r[s])&&"texture"===f.type&&void 0!==e[f.stream]&&++i;1<i&&(t.M=!1),l=a(Object.keys(r)),u=l.next();case 2:if(u.done){b.h=4;break}if(h=u.value,"string"==typeof(c=r[h]))return y=n,g=h,m(b,function(t,e,r){var n;return x((function(i){return"number"==typeof r||r instanceof Uint8Array||r instanceof t.i.Uint8BlobList?i.return(r):r instanceof t.i.Texture2dDataOut?((n=t.v[e])||(n=new ir(t.i,t.K),t.v[e]=n),i.return(or(n,r,t.M))):i.return(void 0)}))}(t,h,e[c]),14);if(p=e[c.stream],"detection_list"===c.type){if(p){for(var w=p.getRectList(),A=p.getLandmarksList(),j=p.getClassificationsList(),E=[],O=0;O<w.size();++O){var F=tr(w.get(O)),S=void 0;S=void 0===S?0:S,F={la:{sa:Qt(F,1),ta:Qt(F,2),height:Qt(F,3),width:Qt(F,4),rotation:Qt(F,5,0),pa:$t(Vt(F,6),S)},ea:Kt(qe(A.get(O)),Ye,1).map(nr),ba:rr(Xe(j.get(O)))},E.push(F)}w=E}else w=[];n[h]=w,b.h=7;break}if("proto_list"===c.type){if(p){for(w=Array(p.size()),A=0;A<p.size();A++)w[A]=p.get(A);p.delete()}else w=[];n[h]=w,b.h=7;break}if(void 0===p){b.h=3;break}if("float_list"===c.type){n[h]=p,b.h=7;break}if("proto"===c.type){n[h]=p,b.h=7;break}if("texture"!==c.type)throw Error("Unknown output config type: '"+c.type+"'");return(v=t.v[h])||(v=new ir(t.i,t.K),t.v[h]=v),m(b,or(v,p,t.M),13);case 13:d=b.i,n[h]=d;case 7:c.transform&&n[h]&&(n[h]=c.transform(n[h])),b.h=3;break;case 14:y[g]=b.i;case 3:u=l.next(),b.h=2;break;case 4:return b.return(n)}}))}function vr(t,e){for(var r=e.name||"$",n=[].concat(u(e.wants)),i=new t.i.StringList,o=a(e.wants),s=o.next();!s.done;s=o.next())i.push_back(s.value);o=t.i.PacketListener.implement({onResults:function(i){for(var o={},a=0;a<e.wants.length;++a)o[n[a]]=i.get(a);var u=t.listeners[r];u&&(t.I=pr(t,o,e.outs).then((function(r){r=u(r);for(var i=0;i<e.wants.length;++i){var a=o[n[i]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}r&&(t.I=r)})))}}),t.j.attachMultiListener(i,o),i.delete()}function dr(t){return void 0===t&&(t=0),1===t?"selfie_segmentation_landscape.tflite":"selfie_segmentation.tflite"}function yr(t){var e=this;t=t||{},this.h=new lr({locateFile:t.locateFile,files:function(t){return[{simd:!0,url:"selfie_segmentation_solution_simd_wasm_bin.js"},{simd:!1,url:"selfie_segmentation_solution_wasm_bin.js"},{data:!0,url:dr(t.modelSelection)}]},graph:{url:"selfie_segmentation.binarypb"},listeners:[{wants:["segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],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"}},modelSelection:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelSelection",fieldName:"int_value"},onChange:function(t){var r,n,i;return x((function(o){return 1==o.h?(r=dr(t),n="third_party/mediapipe/modules/selfie_segmentation/"+r,m(o,cr(e.h,r),2)):(i=o.i,e.h.overrideFile(n,i),o.return(!0))}))}}}})}(t=lr.prototype).close=function(){return this.j&&this.j.delete(),Promise.resolve()},t.reset=function(){var t=this;return x((function(e){t.j&&(t.j.reset(),t.s={},t.v={}),e.h=0}))},t.setOptions=function(t,e){var r=this;if(e=e||this.h.options){for(var n=[],i=[],o={},u=a(Object.keys(t)),s=u.next();!s.done;o={X:o.X,Y:o.Y},s=u.next())if(!((s=s.value)in this.l)||this.l[s]!==t[s]){this.l[s]=t[s];var f=e[s];void 0!==f&&(f.onChange&&(o.X=f.onChange,o.Y=t[s],n.push(function(t){return function(){return x((function(e){if(1==e.h)return m(e,t.X(t.Y),2);!0===e.i&&(r.u=!0),e.h=0}))}}(o))),f.graphOptionXref&&(s=Object.assign({},{calculatorName:"",calculatorIndex:0},f.graphOptionXref,{valueNumber:1===f.type?t[s]:0,valueBoolean:0===f.type&&t[s],valueString:2===f.type?t[s]:""}),i.push(s)))}0===n.length&&0===i.length||(this.u=!0,this.H=(void 0===this.H?[]:this.H).concat(i),this.F=(void 0===this.F?[]:this.F).concat(n))}},t.initialize=function(){var t=this;return x((function(e){return 1==e.h?m(e,hr(t),2):3!=e.h?m(e,function(t){var e,r,n,i,o,u,s,f;return x((function(l){if(1==l.h)return t.h.graph&&t.h.graph.url&&t.fa===t.h.graph.url?l.return():(t.u=!0,t.h.graph&&t.h.graph.url?(t.fa=t.h.graph.url,m(l,cr(t,t.h.graph.url),3)):void(l.h=2));for(2!=l.h&&(e=l.i,t.j.loadGraph(e)),r=a(Object.keys(t.D)),n=r.next();!n.done;n=r.next())i=n.value,t.j.overrideFile(i,t.D[i]);if(t.D={},t.h.listeners)for(o=a(t.h.listeners),u=o.next();!u.done;u=o.next())s=u.value,vr(t,s);f=t.l,t.l={},t.setOptions(f),l.h=0}))}(t),3):m(e,function(t){var e,r,n,i,o,u;return x((function(s){switch(s.h){case 1:if(!t.u)return s.return();if(!t.F){s.h=2;break}e=a(t.F),r=e.next();case 3:if(r.done){s.h=5;break}return m(s,(0,r.value)(),4);case 4:r=e.next(),s.h=3;break;case 5:t.F=void 0;case 2:if(t.H){for(n=new t.i.GraphOptionChangeRequestList,i=a(t.H),o=i.next();!o.done;o=i.next())u=o.value,n.push_back(u);t.j.changeOptions(n),n.delete(),t.H=void 0}t.u=!1,s.h=0}}))}(t),0)}))},t.overrideFile=function(t,e){this.j?this.j.overrideFile(t,e):this.D[t]=e},t.clearOverriddenFiles=function(){this.D={},this.j&&this.j.clearOverriddenFiles()},t.send=function(t,e){var r,n,i,o,u,s,f,l,h,c=this;return x((function(p){switch(p.h){case 1:return c.h.inputs?(r=1e3*(null==e?performance.now():e),m(p,c.I,2)):p.return();case 2:return m(p,c.initialize(),3);case 3:for(n=new c.i.PacketDataList,i=a(Object.keys(t)),o=i.next();!o.done;o=i.next())if(u=o.value,s=c.h.inputs[u]){t:{var v=t[u];switch(s.type){case"video":var d=c.s[s.stream];if(d||(d=new ir(c.i,c.K),c.s[s.stream]=d),0===d.m&&(d.m=d.i.createTexture()),"undefined"!=typeof HTMLVideoElement&&v instanceof HTMLVideoElement)var y=v.videoWidth,g=v.videoHeight;else"undefined"!=typeof HTMLImageElement&&v instanceof HTMLImageElement?(y=v.naturalWidth,g=v.naturalHeight):(y=v.width,g=v.height);g={glName:d.m,width:y,height:g},(y=d.h).canvas.width=g.width,y.canvas.height=g.height,y.activeTexture(y.TEXTURE0),d.i.bindTexture2d(d.m),y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,v),d.i.bindTexture2d(0),d=g;break t;case"detections":for((d=c.s[s.stream])||(d=new ar(c.i),c.s[s.stream]=d),d.data||(d.data=new d.h.DetectionListData),d.data.reset(v.length),g=0;g<v.length;++g){y=v[g];var b=d.data,w=b.setBoundingBox,A=g,j=y.la,x=new $e;if(Zt(x,1,j.sa),Zt(x,2,j.ta),Zt(x,3,j.height),Zt(x,4,j.width),Zt(x,5,j.rotation),Wt(x,6,j.pa),j=x.l(),w.call(b,A,j),y.ea)for(b=0;b<y.ea.length;++b){x=y.ea[b],A=(w=d.data).addNormalizedLandmark,j=g,x=Object.assign({},x,{visibility:x.visibility?x.visibility:0});var E=new Ye;Zt(E,1,x.x),Zt(E,2,x.y),Zt(E,3,x.z),x.visibility&&Zt(E,4,x.visibility),x=E.l(),A.call(w,j,x)}if(y.ba)for(b=0;b<y.ba.length;++b)A=(w=d.data).addClassification,j=g,x=y.ba[b],Zt(E=new ze,2,x.qa),x.index&&Wt(E,1,x.index),x.label&&Wt(E,3,x.label),x.displayName&&Wt(E,4,x.displayName),x=E.l(),A.call(w,j,x)}d=d.data;break t;default:d={}}}switch(f=d,l=s.stream,s.type){case"video":n.pushTexture2d(Object.assign({},f,{stream:l,timestamp:r}));break;case"detections":(h=f).stream=l,h.timestamp=r,n.pushDetectionList(h);break;default:throw Error("Unknown input config type: '"+s.type+"'")}}return c.j.send(n),m(p,c.I,4);case 4:n.delete(),p.h=0}}))},t.onResults=function(t,e){this.listeners[e||"$"]=t},F("Solution",lr),F("OptionType",{BOOL:0,NUMBER:1,ua:2,0:"BOOL",1:"NUMBER",2:"STRING"}),(t=yr.prototype).close=function(){return this.h.close(),Promise.resolve()},t.onResults=function(t){this.h.onResults(t)},t.initialize=function(){var t=this;return x((function(e){return m(e,t.h.initialize(),0)}))},t.reset=function(){this.h.reset()},t.send=function(t){var e=this;return x((function(r){return m(r,e.h.send(t),0)}))},t.setOptions=function(t){this.h.setOptions(t)},F("SelfieSegmentation",yr),F("VERSION","0.1.1675465747")}).call(this); |