shopar-plugin
Version:
Plugin for the Web that seamlessly integrates into your webpage to create embedded virtual try-on and 3D preview capabilities.
1 lines • 120 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.__deeparDynamicJsModule_mediaPipe__=e():t.__deeparDynamicJsModule_mediaPipe__=e()}(self,(()=>(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{FilesetResolver:()=>oo,ImageSegmenter:()=>Ga});var n=self;function r(t,e){t=t.split(".");var r,i=n;t[0]in i||void 0===i.execScript||i.execScript("var "+t[0]);for(;t.length&&(r=t.shift());)t.length||void 0===e?i=i[r]&&i[r]!==Object.prototype[r]?i[r]:i[r]={}:i[r]=e}function i(t){return t}function s(){throw Error("Invalid UTF8")}function o(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let a,c;const h="undefined"!=typeof TextDecoder;let u;const l="undefined"!=typeof TextEncoder;function d(t){if(l)t=(u||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const s=t.charCodeAt(++i);if(56320<=s&&57343>=s){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var f,p;t:{for(var g=["CLOSURE_FLAGS"],m=n,y=0;y<g.length;y++)if(null==(m=m[g[y]])){p=null;break t}p=m}var _,v=p&&p[610401301];f=null!=v&&v;const A=n.navigator;function w(t){return!!f&&!!_&&_.brands.some((({brand:e})=>e&&-1!=e.indexOf(t)))}function E(t){var e;return(e=n.navigator)&&(e=e.userAgent)||(e=""),-1!=e.indexOf(t)}function b(){return!!f&&!!_&&0<_.brands.length}function T(){return b()?w("Chromium"):(E("Chrome")||E("CriOS"))&&!(!b()&&E("Edge"))||E("Silk")}_=A&&A.userAgentData||null;var k=!b()&&(E("Trident")||E("MSIE"));!E("Android")||T(),T(),E("Safari")&&(T()||!b()&&E("Coast")||!b()&&E("Opera")||!b()&&E("Edge")||(b()?w("Microsoft Edge"):E("Edg/"))||b()&&w("Opera"));var L={},S=null;function x(){if(!S){S={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));L[n]=r;for(var i=0;i<r.length;i++){var s=r[i];void 0===S[s]&&(S[s]=i)}}}}var F="undefined"!=typeof Uint8Array,O=!k&&"function"==typeof btoa;function M(t){if(!O){var e;void 0===e&&(e=0),x(),e=L[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let c=0,h=0;for(;c<t.length-2;c+=3){var i=t[c],s=t[c+1],o=t[c+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[h++]=a+i+s+o}switch(a=0,o=r,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||r;case 1:t=t[c],n[h]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const R=/[-_.]/g,C={"-":"+",_:"/",".":"="};function P(t){return C[t]||""}function I(t){if(!O)return function(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=S[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}x();for(var r=0;;){var i=n(-1),s=n(0),o=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|s>>4),64!=o&&(e(s<<4&240|o>>2),64!=a&&e(o<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}(t);R.test(t)&&(t=t.replace(R,P)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function N(t){return F&&null!=t&&t instanceof Uint8Array}let D;function $(){return D||=new Uint8Array(0)}var U={};let B;function G(t){if(t!==U)throw Error("illegal external caller")}function j(){return B||=new W(null,U)}function V(t){G(U);var e=t.L;return null==(e=null==e||N(e)?e:"string"==typeof e?I(e):null)?e:t.L=e}var W=class{constructor(t,e){if(G(e),this.L=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}fa(){const t=V(this);return t?new Uint8Array(t):$()}};function z(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function H(){return Error("Failed to read varint, encoding is invalid.")}function K(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function X(t){return 0==t.length?j():new W(t,U)}function Y(t){if("string"==typeof t)return{buffer:I(t),G:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),G:!1};if(t.constructor===Uint8Array)return{buffer:t,G:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),G:!1};if(t.constructor===W)return{buffer:V(t)||$(),G:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),G:!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")}const q="function"==typeof Uint8Array.prototype.slice;let J,Z=0,Q=0;function tt(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=st(n,t);t=r,n=e}Z=n>>>0,Q=t>>>0}function et(t){const e=J||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Q=0,Z=e.getUint32(0,!0)}function nt(t,e){return 4294967296*e+(t>>>0)}function rt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=nt(t,e),n?-t:t}function it(t){if(16>t.length)tt(Number(t));else if("function"==typeof BigInt)t=BigInt(t),Z=Number(t&BigInt(4294967295))>>>0,Q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Q=Z=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));Q*=1e6,Z=1e6*Z+e,4294967296<=Z&&(Q+=Math.trunc(Z/4294967296),Q>>>=0,Z>>>=0)}if(e){const[t,e]=st(Z,Q);Z=t,Q=e}}}function st(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function ot(t,e,{O:n=!1}={}){t.O=n,e&&(e=Y(e),t.h=e.buffer,t.s=e.G,t.v=0,t.l=t.h.length,t.g=t.v)}function at(t,e){if(t.g=e,e>t.l)throw K(t.l,e)}function ct(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(32>s&&128&n);for(32<s&&(i|=(127&n)>>4),s=3;32>s&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(at(t,a),128>n)return e(r>>>0,i>>>0);throw H()}function ht(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return at(t,n),!!(127&e)}throw H()}function ut(t){var e=t.h;const n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],at(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function lt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw K(e,t.l-n);return t.g=r,n}function dt(t,e){if(0==e)return j();var n=lt(t,e);return t.O&&t.s?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?$():q?t.slice(n,e):new Uint8Array(t.subarray(n,e))),X(n)}var ft=class{constructor(t,e){this.h=null,this.s=!1,this.g=this.l=this.v=0,ot(this,t,e)}m(){const t=this.h;let e=this.g,n=t[e++],r=127&n;if(128&n&&(n=t[e++],r|=(127&n)<<7,128&n&&(n=t[e++],r|=(127&n)<<14,128&n&&(n=t[e++],r|=(127&n)<<21,128&n&&(n=t[e++],r|=n<<28,128&n&&128&t[e++]&&128&t[e++]&&128&t[e++]&&128&t[e++]&&128&t[e++])))))throw H();return at(this,e),r}j(){return this.m()>>>0}A(){var t=ut(this);const e=2*(t>>31)+1,n=t>>>23&255;return t&=8388607,255==n?t?NaN:1/0*e:0==n?e*Math.pow(2,-149)*t:e*Math.pow(2,n-150)*(t+Math.pow(2,23))}C(){return this.m()}},pt=[];function gt(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=t.g.j();if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw z(n,t.l);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function mt(t){switch(t.h){case 0:0!=t.h?mt(t):ht(t.g);break;case 1:at(t=t.g,t.g+8);break;case 2:if(2!=t.h)mt(t);else{var e=t.g.j();at(t=t.g,t.g+e)}break;case 5:at(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!gt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}mt(t)}break;default:throw z(t.h,t.l)}}function yt(t,e,n){const r=t.g.l,i=t.g.j(),s=t.g.g+i;let o=s-r;if(0>=o&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function _t(t){var e=t.g.j(),n=lt(t=t.g,e);if(t=t.h,h){var r,i=t;(r=c)||(r=c=new TextDecoder("utf-8",{fatal:!0})),t=n+e,i=0===n&&t===i.length?i:i.subarray(n,t);try{var u=r.decode(i)}catch(t){if(void 0===a){try{r.decode(new Uint8Array([128]))}catch(t){}try{r.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(c=void 0),t}}else{e=(u=n)+e,n=[];let a,c=null;for(;u<e;){var l=t[u++];128>l?n.push(l):224>l?u>=e?s():(a=t[u++],194>l||128!=(192&a)?(u--,s()):n.push((31&l)<<6|63&a)):240>l?u>=e-1?s():(a=t[u++],128!=(192&a)||224===l&&160>a||237===l&&160<=a||128!=(192&(i=t[u++]))?(u--,s()):n.push((15&l)<<12|(63&a)<<6|63&i)):244>=l?u>=e-2?s():(a=t[u++],128!=(192&a)||0!=a-144+(l<<28)>>30||128!=(192&(i=t[u++]))||128!=(192&(r=t[u++]))?(u--,s()):(l=(7&l)<<18|(63&a)<<12|(63&i)<<6|63&r,l-=65536,n.push(55296+(l>>10&1023),56320+(1023&l)))):s(),8192<=n.length&&(c=o(c,n),n.length=0)}u=o(c,n)}return u}function vt(t){const e=t.g.j();return dt(t.g,e)}function At(t,e,n){var r=t.g.j();for(r=t.g.g+r;t.g.g<r;)n.push(e.call(t.g))}var wt=[];function Et(t){return t?/^\d+$/.test(t)?(it(t),new bt(Z,Q)):null:Tt||=new bt(0,0)}var bt=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Tt;function kt(t){return t?/^-?\d+$/.test(t)?(it(t),new Lt(Z,Q)):null:St||=new Lt(0,0)}var Lt=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let St;function xt(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Ft(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Ot(t,e){if(0<=e)Ft(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Mt(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Rt(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function Ct(t,e,n){Ft(t.g,8*e+n)}function Pt(t,e){return Ct(t,e,2),e=t.g.end(),Rt(t,e),e.push(t.h),e}function It(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function Nt(t,e,n){Ct(t,e,2),Ft(t.g,n.length),Rt(t,t.g.end()),Rt(t,n)}function Dt(t,e,n,r){null!=n&&(e=Pt(t,e),r(n,t),It(t,e))}class $t{constructor(t,e,n){this.g=t,this.h=e,this.l=n}}function Ut(t){return Array.prototype.slice.call(t)}const Bt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;var Gt=Bt?(t,e)=>{t[Bt]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function jt(t){const e=Wt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Ut(t)),Ht(t,1|e))}var Vt=Bt?(t,e)=>{t[Bt]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)},Wt=Bt?t=>0|t[Bt]:t=>0|t.g,zt=Bt?t=>t[Bt]:t=>t.g,Ht=Bt?(t,e)=>{t[Bt]=e}:(t,e)=>{void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Kt(t){return Gt(t,1),t}function Xt(t){return Gt(t,34),t}function Yt(t,e){Ht(e,-255&(0|t))}function qt(t,e){Ht(e,-221&(34|t))}function Jt(t){return 0==(t=t>>11&1023)?536870912:t}var Zt,Qt={};function te(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ee(t,e,n){if(null!=t)if("string"==typeof t)t=t?new W(t,U):j();else if(t.constructor!==W)if(N(t))t=n?X(t):t.length?new W(new Uint8Array(t),U):j();else{if(!e)throw Error();t=void 0}return t}const ne=[];function re(t){if(2&t)throw Error()}Ht(ne,39),Zt=Object.freeze(ne);class ie{constructor(t,e,n){this.l=0,this.g=t,this.h=e,this.m=n}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new ie(this.g,this.h,this.m)}}var se={};let oe,ae;function ce(t,e){(e=oe?e[oe]:void 0)&&(t[oe]=Ut(e))}function he(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function ue(t){return null==t?t:"number"==typeof t||"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function le(t){return null==t?t:"boolean"==typeof t||"number"==typeof t?!!t:void 0}function de(t){return"number"==typeof t&&Number.isFinite(t)||!!t&&"string"==typeof t&&isFinite(t)}function fe(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t?t:void 0}function pe(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t?t:void 0}function ge(t){if("string"!=typeof t)throw Error();return t}function me(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ye(t){return null==t||"string"==typeof t?t:void 0}function _e(t,e,n,r){var i=!1;return null==t||"object"!=typeof t||(i=Array.isArray(t))||t.K!==Qt?i?(0===(i=n=Wt(t))&&(i|=32&r),(i|=2&r)!==n&&Ht(t,i),new e(t)):(n?2&r?(t=e[ve])?e=t:(Xt((t=new e).u),e=e[ve]=t):e=new e:e=void 0,e):t}const ve="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():"di";function Ae(t){return t}function we(t,e,n){return"string"==typeof(t="number"==(e=typeof t)||"string"===e?t:n?0:void 0)&&(n=+t,Number.isSafeInteger(n))?n:t}let Ee,be;function Te(t){switch(typeof t){case"number":return 0<t?void 0:0===t?be||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function ke(t,e){return Le(t,e[0],e[1])}function Le(t,e,n){if(null==t&&(t=Ee),Ee=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-2095105&r|(1023&e)<<11)}else{if(!Array.isArray(t))throw Error();if(64&(r=Wt(t)))return ae&&delete t[ae],t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{var i=(n=t).length;if(i){const t=i-1;var s=n[t];if(te(s)){1024<=(i=t-(e=+!!(512&(r|=256))-1))&&(Se(n,e,s),i=1023),r=-2095105&r|(1023&i)<<11;break t}}e&&(s=+!!(512&r)-1,1024<(e=Math.max(e,i-s))&&(Se(n,s,{}),r|=256,e=1023),r=-2095105&r|(1023&e)<<11)}}return Ht(t,r),t}function Se(t,e,n){const r=1023+e,i=t.length;for(let s=r;s<i;s++){const r=t[s];null!=r&&r!==n&&(n[s-e]=r)}t.length=r+1,t[r]=n}function xe(t){if(2&t.g)throw Error("Cannot mutate an immutable Map")}var Fe=class extends Map{constructor(t,e,n=Ae,r=Ae){super();let i=Wt(t);i|=64,Ht(t,i),this.g=i,this.l=e,this.h=n||Ae,this.j=this.l?Oe:r||Ae;for(let s=0;s<t.length;s++){const o=t[s],a=n(o[0],!1,!0);let c=o[1];e?void 0===c&&(c=null):c=r(o[1],!1,!0,void 0,void 0,i),super.set(a,c)}}s(t=Me){return this.m(t)}m(t=Me){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){xe(this),super.clear()}delete(t){return xe(this),super.delete(this.h(t,!0,!1))}entries(){var t=this.A();return new ie(t,Re,this)}keys(){return this.C()}values(){var t=this.A();return new ie(t,Fe.prototype.get,this)}forEach(t,e){super.forEach(((n,r)=>{t.call(e,this.get(r),r,this)}))}set(t,e){return xe(this),null==(t=this.h(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.j(e,!0,!0,this.l,!1,this.g))}H(t){const e=this.h(t[0],!1,!0);t=t[1],t=this.l?void 0===t?null:t:this.j(t,!1,!0,void 0,!1,this.g),super.set(e,t)}has(t){return super.has(this.h(t,!1,!1))}get(t){t=this.h(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.l;return n?((n=this.j(e,!1,!0,n,this.v,this.g))!==e&&super.set(t,n),n):e}}A(){return Array.from(super.keys())}C(){return super.keys()}[Symbol.iterator](){return this.entries()}};function Oe(t,e,n,r,i,s){return t=_e(t,r,n,s),i&&(t=Be(t)),t}function Me(t){return t}function Re(t){return[t,this.get(t)]}function Ce(t,e,n,r,i,s){if(null!=t){if(Array.isArray(t))t=i&&0==t.length&&1&Wt(t)?void 0:s&&2&Wt(t)?t:Pe(t,e,n,void 0!==r,i,s);else if(te(t)){const o={};for(let a in t)o[a]=Ce(t[a],e,n,r,i,s);t=o}else t=e(t,r);return t}}function Pe(t,e,n,r,i,s){const o=r||n?Wt(t):0;r=r?!!(32&o):void 0;const a=Ut(t);for(let t=0;t<a.length;t++)a[t]=Ce(a[t],e,n,r,i,s);return n&&(ce(a,t),n(o,a)),a}function Ie(t){return Ce(t,Ne,void 0,void 0,!1,!1)}function Ne(t){return t.K===Qt?t.toJSON():t instanceof Fe?t.s(Ie):function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t&&!Array.isArray(t)){if(N(t))return M(t);if(t instanceof W){const e=t.L;return null==e?"":"string"==typeof e?e:t.L=M(e)}if(t instanceof Fe)return t.s()}}return t}(t)}function De(t,e,n=qt){if(null!=t){if(F&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){const r=Wt(t);return 2&r?t:!e||68&r||!(32&r||0===r)?Pe(t,De,4&r?qt:n,!0,!1,!0):(Ht(t,34|r),t)}return t.K===Qt?(e=t.u,t=2&(n=zt(e))?t:$e(t,e,n,!0)):t instanceof Fe&&(e=Xt(t.m(De)),t=new Fe(e,t.l,t.h,t.j)),t}}function $e(t,e,n,r){return t=t.constructor,Ee=e=Ue(e,n,r),e=new t(e),Ee=void 0,e}function Ue(t,e,n){const r=n||2&e?qt:Yt,i=!!(32&e);return t=function(t,e,n){const r=Ut(t);var i=r.length;const s=256&e?r[i-1]:void 0;for(i+=s?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(s){e=r[e]={};for(const t in s)e[t]=n(s[t])}return ce(r,t),r}(t,e,(t=>De(t,i,r))),Gt(t,32|(n?2:0)),t}function Be(t){const e=t.u,n=zt(e);return 2&n?$e(t,e,n,!1):t}function Ge(t,e){return je(t=t.u,zt(t),e)}function je(t,e,n,r){if(-1===n)return null;if(n>=Jt(e)){if(256&e)return t[t.length-1][n]}else{var i=t.length;if(r&&256&e&&null!=(r=t[i-1][n]))return r;if((e=n+(+!!(512&e)-1))<i)return t[e]}}function Ve(t,e,n,r){const i=t.u,s=zt(i);return re(s),We(i,s,e,n,r),t}function We(t,e,n,r,i){var s=Jt(e);if(n>=s||i){if(i=e,256&e)s=t[t.length-1];else{if(null==r)return;s=t[s+(+!!(512&e)-1)]={},i|=256}s[n]=r,i!==e&&Ht(t,i)}else t[n+(+!!(512&e)-1)]=r,256&e&&n in(t=t[t.length-1])&&delete t[n]}function ze(t,e,n,r,i){var s=2&e;let o=je(t,e,n,i);Array.isArray(o)||(o=Zt);const a=Wt(o);if(1&a||Kt(o),s)2&a||Xt(o),1&r||Object.freeze(o);else{s=!(2&r);const c=2&a;1&r||!c?s&&32&a&&!c&&Vt(o,32):(o=Kt(Ut(o)),We(t,e,n,o,i))}return o}function He(t,e){t=t.u;const n=zt(t),r=je(t,n,e),i=ue(r);return null!=i&&i!==r&&We(t,n,e,i),i}function Ke(t){t=t.u;const e=zt(t),n=je(t,e,1),r=ee(n,!0,!!(34&e));return null!=r&&r!==n&&We(t,e,1,r),r}function Xe(t,e,n){t=t.u;const r=zt(t),i=2&r;let s=ze(t,r,e,1),o=Wt(s);if(!(4&o)){Object.isFrozen(s)&&(o=0,s=Ut(s),We(t,r,e,s));let a=0,c=0;for(;a<s.length;a++){const t=n(s[a]);null!=t&&(s[c++]=t)}c<a&&(s.length=c),o|=5,i&&(o|=34),Ht(s,o),2&o&&Object.freeze(s)}return!i&&(2&o||Object.isFrozen(s))&&(s=Ut(s),Gt(s,5),We(t,r,e,s)),s}let Ye;function qe(){return Ye??=new Fe(Xt([]),void 0,void 0,void 0,se)}function Je(t){t=Ut(t);for(let e=0;e<t.length;e++){const n=t[e]=Ut(t[e]);Array.isArray(n[1])&&(n[1]=Xt(n[1]))}return t}function Ze(t,e,n){{t=t.u;const r=zt(t);if(re(r),null==n)We(t,r,e);else{if(!(4&Wt(n))){Object.isFrozen(n)&&(n=Ut(n));for(let t=0;t<n.length;t++)n[t]=ge(n[t]);Ht(n,5)}We(t,r,e,n)}}}function Qe(t,e){return tn(t=t.u,zt(t),Gi)===e?e:-1}function tn(t,e,n){let r=0;for(let i=0;i<n.length;i++){const s=n[i];null!=je(t,e,s)&&(0!==r&&We(t,e,r),r=s)}return r}function en(t,e,n,r){const i=zt(t);re(i);const s=je(t,i,n,r);let o;if(null!=s&&s.K===Qt)return(e=Be(s))!==s&&We(t,i,n,e,r),e.u;if(Array.isArray(s)){const t=Wt(s);o=2&t?Ue(s,t,!1):s,o=ke(o,e)}else o=ke(void 0,e);return o!==s&&We(t,i,n,o,r),o}function nn(t,e,n,r){t=t.u;const i=zt(t),s=je(t,i,n,r);return(e=_e(s,e,!1,i))!==s&&null!=e&&We(t,i,n,e,r),e}function rn(t,e,n,r=!1){if(null==(e=nn(t,e,n,r)))return e;t=t.u;const i=zt(t);if(!(2&i)){const s=Be(e);s!==e&&We(t,i,n,e=s,r)}return e}function sn(t,e,n,r,i){var s=!!(2&e),o=ze(t,e,r,1);if(o===Zt||!(4&Wt(o))){var a=o;o=!!(2&e);var c=!!(2&Wt(a));s=a,!o&&c&&(a=Ut(a));var h=e|(c?2:0);c=c||void 0;let u=0,l=0;for(;u<a.length;u++){const t=_e(a[u],n,!1,h);void 0!==t&&(c=c||2&zt(t.u),a[l++]=t)}return l<u&&(a.length=l),h=5|(a=Wt(n=a)),a!=(c=c?-9&h:8|h)&&(Object.isFrozen(n)&&(n=Ut(n)),Ht(n,c)),s!==(a=n)&&We(t,e,r,a),(o&&2!==i||1===i)&&Object.freeze(a),a}return 3===i||(s?2===i&&(i=Wt(o),o=Ut(o),Ht(o,i),We(t,e,r,o)):(s=Object.isFrozen(o),1===i?s||Object.freeze(o):(n=-35&(i=Wt(o)),s&&(i=0,We(t,e,r,o=Ut(o))),i!==n&&Ht(o,n)))),o}function on(t,e,n){var r=t.u;const i=zt(r);if(e=sn(r,i,e,n,(t=!!(2&i))?1:2),!(t||8&Wt(e))){for(n=0;n<e.length;n++)(t=e[n])!==(r=Be(t))&&(e[n]=r);Gt(e,8)}return e}function an(t,e,n,r,i){return null==r&&(r=void 0),Ve(t,n,r,i)}function cn(t,e,n,r){null==r&&(r=void 0),t=t.u;const i=zt(t);re(i),(n=tn(t,i,n))&&n!==e&&null!=r&&We(t,i,n),We(t,i,e,r)}function hn(t,e,n){t=t.u;const r=zt(t);re(r),t=sn(t,r,e,1,2),e=null!=n?n:new e,t.push(e),e.G()&&Vt(t,8)}function un(t,e){return fe(Ge(t,e))}function ln(t){return null==(t=Ge(t,2))||de(t)?t:void 0}function dn(t,e){return ye(Ge(t,e))}function fn(t){return t??0}function pn(t,e){return fn(He(t,e))}function gn(t,e,n){if(null!=n){if("boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);n=!!n}Ve(t,e,n)}function mn(t,e,r){if(null!=r){if("number"!=typeof r)throw he(t=Error(),"warning"),t;if(!Number.isFinite(r)){const t=Error();he(t,"incident"),function(t){n.setTimeout((()=>{throw t}),0)}(t)}}Ve(t,e,r)}function yn(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Ve(t,e,n)}function _n(t,e,n){n=ge(n),t=t.u;const r=zt(t);re(r),ze(t,r,e,2).push(n)}function vn(t,e,n){e.g?e.m(t,e.g,e.h,n,!0):e.m(t,e.h,n,!0)}Fe.prototype.toJSON=void 0;var An=class{constructor(t,e){this.u=Le(t,e)}toJSON(){return wn(this,Pe(this.u,Ne,void 0,void 0,!1,!1),!0)}l(){var t=Ds;return t.g?t.l(this,t.g,t.h,!0):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.u;return $e(this,t,zt(t),!1)}G(){return!!(2&Wt(this.u))}};function wn(t,e,n){var r=t.constructor.B,i=Jt(zt(n?t.u:e)),s=!1;if(r){if(!n){var o;if((e=Ut(e)).length&&te(o=e[e.length-1]))for(s=0;s<r.length;s++)if(r[s]>=i){Object.assign(e[e.length-1]={},o);break}s=!0}var a;i=e,n=!n,t=Jt(o=zt(t.u)),o=+!!(512&o)-1;for(let e=0;e<r.length;e++){var c=r[e];if(c<t){var h=i[c+=o];null==h?i[c]=n?Zt:Kt([]):n&&h!==Zt&&jt(h)}else{if(!a){var u=void 0;i.length&&te(u=i[i.length-1])?a=u:i.push(a={})}h=a[c],null==a[c]?a[c]=n?Zt:Kt([]):n&&h!==Zt&&jt(h)}}}if(!(r=e.length))return e;let l,d;if(te(a=e[r-1])){t:{var f=a;u={},i=!1;for(let t in f)n=f[t],Array.isArray(n)&&n!=n&&(i=!0),null!=n?u[t]=n:i=!0;if(i){for(let t in u){f=u;break t}f=null}}f!=a&&(l=!0),r--}for(;0<r&&null==(a=e[r-1]);r--)d=!0;return l||d?(e=s?e:Array.prototype.slice.call(e,0,r),s&&(e.length=r),f&&e.push(f),e):e}function En(t){return{aa:dr,S:t}}function bn(t,e){if(Array.isArray(e)){var n=Wt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),Ht(e,5|n),2&n&&Object.freeze(e),e}}An.prototype.K=Qt,An.prototype.toString=function(){return wn(this,this.u,!1).toString()};const Tn=Symbol();function kn(t){let e=t[Tn];if(!e){const n=Dn(t),r=n.m;e=r?(t,e)=>r(t,e,n):(t,e)=>{for(;gt(e)&&4!=e.h;){var r=e.m,i=n[r];if(!i){var s=n.h;s&&(s=s[r])&&(i=n[r]=Ln(s))}i&&i(e,t,r)||(r=(i=e).l,mt(i),i.Y?i=void 0:(s=i.g.g-r,i.g.g=r,i=dt(i.g,s)),r=t,i&&(oe||=Symbol(),(s=r[oe])?s.push(i):r[oe]=[i]))}(e=n.l)&&(t[ae||=Symbol()]=e)},t[Tn]=e}return e}function Ln(t){const e=function(t){if(t=t.S)return kn(t)}(t),n=t.aa.g;if(e){const r=Dn(t.S).g;return(t,i,s)=>n(t,i,s,r,e)}return(t,e,r)=>n(t,e,r)}function Sn(t,e,n,r){e.g=Te(t[0]);let i=1;if(t.length>i&&!(t[i]instanceof $t)){var s=t[i++];if(Array.isArray(s))return e.m=s[0],e.h=s[1],e;e.h=s}for(s=0;i<t.length;){const u=t[i++];var o=t[i];for("number"==typeof o?(i++,s+=o):s++,u.l&&((o=e.l)||(e.l=o=[]),o.push(s)),o=i;o<t.length&&!(t[o]instanceof $t);)o++;if(o-=i){var a=t,c=i,h=a[c];if("function"==typeof h&&(h=h(),a[c]=h),(a=Array.isArray(h))&&!(a=Pn in h||On in h)&&(a=0<h.length)){const t=Te(c=(a=h)[0]);null!=t&&t!==c&&(a[0]=t),a=null!=t}(h=a?h:void 0)?(i++,e[s]=1===o?r(u,h):r(u,h,t[i++])):e[s]=n(u,t[i++])}else e[s]=n(u)}return e}const xn=Symbol();function Fn(t){let e=t[xn];if(!e){const n=Cn(t);e=(t,e)=>Un(t,e,n),t[xn]=e}return e}const On=Symbol();function Mn(t){return t.h}function Rn(t,e){let n,r;const i=t.h;return(t,s,o)=>i(t,s,o,r||=Cn(e).g,n||=Fn(e))}function Cn(t){let e=t[On];return e||(e=Sn(t,t[On]={},Mn,Rn),Pn in t&&On in t&&(t.length=0),e)}const Pn=Symbol();function In(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function Nn(t,e,n){const r=t.g;let i,s;return(t,o,a)=>r(t,o,a,s||=Dn(e).g,i||=kn(e),n)}function Dn(t){let e=t[Pn];return e||(e=Sn(t,t[Pn]={},In,Nn),Pn in t&&On in t&&(t.length=0),e)}function $n(t,e){var n=t[e];if(n)return n;if((n=t.h)&&(n=n[e])){var r=n.S,i=n.aa.h;if(r){const t=Fn(r),e=Cn(r).g;n=(n,r,s)=>i(n,r,s,e,t)}else n=i;return t[e]=n}}function Un(t,e,n){for(var r=zt(t),i=+!!(512&r)-1,s=t.length,o=512&r?1:0,a=s+(256&r?-1:0);o<a;o++){const r=t[o];if(null==r)continue;const s=o-i,a=$n(n,s);a&&a(e,r,s)}if(256&r){r=t[s-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(s=r[t])&&(a=$n(n,i))&&a(e,s,i)}if(t=oe?t[oe]:void 0)for(Rt(e,e.g.end()),n=0;n<t.length;n++)Rt(e,V(t[n])||$())}function Bn(t,e){return new $t(t,e,!1)}function Gn(t,e){return new $t(t,e,!0)}function jn(t,e,n){We(t,zt(t),e,n)}var Vn=Bn((function(t,e,n,r,i){return 2===t.h&&(t=yt(t,ke([void 0,void 0],r),i),re(r=zt(e)),(i=je(e,r,n))instanceof Fe?0!=(2&i.g)?((i=i.m()).push(t),We(e,r,n,i)):i.H(t):Array.isArray(i)?(2&Wt(i)&&We(e,r,n,i=Je(i)),i.push(t)):We(e,r,n,[t]),!0)}),(function(t,e,n,r,i){if(e instanceof Fe)e.forEach(((e,s)=>{Dt(t,n,ke([s,e],r),i)}));else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&Dt(t,n,ke(o,r),i)}}));function Wn(t,e,n){t:if(null!=e){if(de(e)){if("string"==typeof e)break t;if("number"==typeof e)break t}e=void 0}null!=e&&("string"==typeof e&&kt(e),null!=e&&(Ct(t,n,0),"number"==typeof e?(t=t.g,tt(e),xt(t,Z,Q)):(n=kt(e),xt(t.g,n.h,n.g))))}function zn(t,e,n){null!=(e=fe(e))&&null!=e&&(Ct(t,n,0),Ot(t.g,e))}function Hn(t,e,n){null!=(e=le(e))&&(Ct(t,n,0),t.g.g.push(e?1:0))}function Kn(t,e,n){null!=(e=ye(e))&&Nt(t,n,d(e))}function Xn(t,e,n,r,i){Dt(t,n,e instanceof An?e.u:Array.isArray(e)?ke(e,r):void 0,i)}function Yn(t,e,n){null!=(e=null==e||"string"==typeof e||N(e)||e instanceof W?e:void 0)&&Nt(t,n,Y(e).buffer)}function qn(t,e,n){return(5===t.h||2===t.h)&&(e=ze(e,zt(e),n,2,!1),2==t.h?At(t,ft.prototype.A,e):e.push(t.g.A()),!0)}var Jn=Bn((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=ut(r);const i=ut(r);r=2*(i>>31)+1;const s=i>>>20&2047;return t=4294967296*(1048575&i)+t,jn(e,n,2047==s?t?NaN:1/0*r:0==s?r*Math.pow(2,-1074)*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=ue(e))&&(Ct(t,n,1),t=t.g,(n=J||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Z=n.getUint32(0,!0),Q=n.getUint32(4,!0),Mt(t,Z),Mt(t,Q))})),Zn=Bn((function(t,e,n){return 5===t.h&&(jn(e,n,t.g.A()),!0)}),(function(t,e,n){null!=(e=ue(e))&&(Ct(t,n,5),t=t.g,et(e),Mt(t,Z))})),Qn=Gn(qn,(function(t,e,n){if(null!=(e=bn(ue,e)))for(let s=0;s<e.length;s++){var r=t,i=e[s];null!=i&&(Ct(r,n,5),r=r.g,et(i),Mt(r,Z))}})),tr=Gn(qn,(function(t,e,n){if(null!=(e=bn(ue,e))&&e.length){Ct(t,n,2),Ft(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,et(e[r]),Mt(n,Z)}})),er=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,ct(t.g,rt)),!0)}),Wn),nr=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,0===(t=ct(t.g,rt))?void 0:t),!0)}),Wn),rr=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,ct(t.g,nt)),!0)}),(function(t,e,n){t:if(null!=e){if(de(e)){if("string"==typeof e)break t;if("number"==typeof e)break t}e=void 0}null!=e&&("string"==typeof e&&Et(e),null!=e&&(Ct(t,n,0),"number"==typeof e?(t=t.g,tt(e),xt(t,Z,Q)):(n=Et(e),xt(t.g,n.h,n.g))))})),ir=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,t.g.m()),!0)}),zn),sr=Gn((function(t,e,n){return(0===t.h||2===t.h)&&(e=ze(e,zt(e),n,2,!1),2==t.h?At(t,ft.prototype.m,e):e.push(t.g.m()),!0)}),(function(t,e,n){if(null!=(e=bn(fe,e))&&e.length){n=Pt(t,n);for(let n=0;n<e.length;n++)Ot(t.g,e[n]);It(t,n)}})),or=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,0===(t=t.g.m())?void 0:t),!0)}),zn),ar=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,ht(t.g)),!0)}),Hn),cr=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,!1===(t=ht(t.g))?void 0:t),!0)}),Hn),hr=Gn((function(t,e,n){if(2!==t.h)return!1;t=_t(t);const r=zt(e);return re(r),ze(e,r,n,2).push(t),!0}),(function(t,e,n){if(null!=(e=bn(ye,e)))for(let i=0;i<e.length;i++){var r=e[i];null!=r&&Nt(t,n,d(r))}})),ur=Bn((function(t,e,n){return 2===t.h&&(jn(e,n,""===(t=_t(t))?void 0:t),!0)}),Kn),lr=Bn((function(t,e,n){return 2===t.h&&(jn(e,n,_t(t)),!0)}),Kn),dr=Bn((function(t,e,n,r,i){return 2===t.h&&(yt(t,en(e,r,n,!0),i),!0)}),Xn),fr=Bn((function(t,e,n,r,i){return 2===t.h&&(yt(t,en(e,r,n),i),!0)}),Xn),pr=Gn((function(t,e,n,r,i){if(2!==t.h)return!1;r=ke(void 0,r);const s=zt(e);re(s);let o=ze(e,s,n,3);return(Object.isFrozen(o)||4&Wt(o))&&(o=Ut(o),We(e,s,n,o)),o.push(r),yt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)Xn(t,e[s],n,r,i)})),gr=Bn((function(t,e,n,r,i,s){if(2!==t.h)return!1;const o=zt(e);return re(o),(s=tn(e,o,s))&&n!==s&&We(e,o,s),yt(t,e=en(e,r,n),i),!0}),Xn),mr=Bn((function(t,e,n){return 2===t.h&&(jn(e,n,vt(t)),!0)}),Yn),yr=Gn((function(t,e,n){return(0===t.h||2===t.h)&&(e=ze(e,zt(e),n,2,!1),2==t.h?At(t,ft.prototype.j,e):e.push(t.g.j()),!0)}),(function(t,e,n){if(null!=(e=bn(pe,e)))for(let s=0;s<e.length;s++){var r=t,i=e[s];null!=i&&(Ct(r,n,0),Ft(r.g,i))}})),_r=Bn((function(t,e,n){return 0===t.h&&(jn(e,n,t.g.m()),!0)}),(function(t,e,n){null!=(e=fe(e))&&(e=parseInt(e,10),Ct(t,n,0),Ot(t.g,e))})),vr=Gn((function(t,e,n){return(0===t.h||2===t.h)&&(e=ze(e,zt(e),n,2,!1),2==t.h?At(t,ft.prototype.C,e):e.push(t.g.m()),!0)}),(function(t,e,n){if(null!=(e=bn(fe,e))&&e.length){n=Pt(t,n);for(let n=0;n<e.length;n++)Ot(t.g,e[n]);It(t,n)}}));class Ar{constructor(t,e){this.h=t,this.g=e,this.l=rn,this.m=an,this.defaultValue=void 0}}function wr(t,e){return new Ar(t,e)}function Er(t,e){return(n,r)=>{t:{if(wt.length){const t=wt.pop();t.o(r),ot(t.g,n,r),n=t}else n=new class{constructor(t,e){if(pt.length){const n=pt.pop();ot(n,t,e),t=n}else t=new ft(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({Y:t=!1}={}){this.Y=t}}(n,r);try{var i=new t;const r=i.u;kn(e)(r,n),ae&&delete r[ae];var s=i;break t}finally{(i=n.g).h=null,i.s=!1,i.v=0,i.l=0,i.g=0,i.O=!1,n.m=-1,n.h=-1,100>wt.length&&wt.push(n)}s=void 0}return s}}function br(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Un(this.u,e,Cn(t)),Rt(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var Tr,kr=[0,ur,Bn((function(t,e,n){return 2===t.h&&(jn(e,n,(t=vt(t))===j()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof An){const r=e.Aa;return void(r&&(e=r(e),null!=e&&Nt(t,n,Y(e).buffer)))}if(Array.isArray(e))return}Yn(t,e,n)}))];function Lr(t){if(void 0===Tr){var e=null,r=n.trustedTypes;if(r&&r.createPolicy){try{e=r.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch(t){n.console&&n.console.error(t.message)}Tr=e}else Tr=e}return t=(e=Tr)?e.createScriptURL(t):t,new class{constructor(t){this.g=t}toString(){return this.g+""}}(t)}var Sr=[0,lr],xr=[0,ir,_r,ar,ar,sr,_r,_r],Fr=[0,ar,ar],Or=class extends An{constructor(){super()}};Or.B=[6];var Mr=[0,ar,lr,ar,_r,_r,vr,lr,lr,fr,Fr,_r],Rr=[0,lr,lr,lr],Cr=class extends An{constructor(){super()}},Pr=[0],Ir=[0,ir],Nr=[1,2,3,4,5],Dr=class extends An{constructor(t){super(t,2)}},$r={},Ur=[-2,$r,ar];$r[336783863]=En([0,lr,ar,ar,ir,fr,[0,gr,Pr,Nr,gr,Mr,Nr,gr,Rr,Nr,gr,Ir,Nr,gr,xr,Nr],fr,Sr]);var Br=[0,ur,cr],Gr=[0,nr,nr,cr,cr,cr,cr,nr,sr,ur,or,nr,nr,cr,or,cr,cr,cr,ur],jr=[-1,{}],Vr=[0,lr,fr,2,jr],Wr=[0,lr,hr,fr,jr];function zr(t,e){e=me(e),t=t.u;const n=zt(t);re(n),We(t,n,2,""===e?void 0:e)}function Hr(t,e){_n(t,3,e)}function Kr(t,e){_n(t,4,e)}var Xr=class extends An{constructor(t){super(t,500)}o(t){return an(this,0,7,t)}};Xr.B=[3,4,5,6,8,13,17,1005];var Yr=[-500,ur,ur,hr,hr,hr,hr,fr,Ur,pr,kr,or,or,fr,Vr,fr,Wr,pr,Br,ur,fr,Gr,or,hr,hr,988],qr=[0,ur,ur,fr,jr],Jr=[-500,lr,lr,fr,[-1,{}],lr,999],Zr=[-500,lr,hr,hr,fr,[-2,{},ar],hr,998,hr],Qr=[-500,lr,hr,fr,jr,hr,999];function ti(t,e){hn(t,Xr,e)}function ei(t,e){_n(t,10,e)}function ni(t,e){_n(t,15,e)}var ri=class extends An{constructor(t){super(t,500)}o(t){return an(this,0,1001,t)}};ri.B=[1,6,7,9,10,15,16,17,14,1002];var ii=[-500,pr,Yr,pr,5,Jr,pr,Zr,or,pr,Qr,hr,or,fr,Vr,fr,Wr,pr,qr,hr,hr,hr,fr,Gr,ur,ur,cr,fr,980,jr,pr,kr],si=Er(ri,ii);ri.prototype.g=br(ii);var oi=[0,pr,[0,ir,ir,ir]],ai=class extends An{constructor(t){super(t)}},ci=[0,ir,Zn,lr,lr],hi=class extends An{constructor(t){super(t)}g(){return on(this,ai,1)}};hi.B=[1];var ui=[0,pr,ci],li=Er(hi,ui),di=[0,ir,Zn],fi=[0,ir,ir,fr,oi],pi=class extends An{constructor(t){super(t)}},gi=[0,ir,ir,ir,ir],mi=[0,Zn,Zn,Zn,Zn],yi=class extends An{constructor(t){super(t)}},_i=[0,Zn,Zn,lr,Zn],vi=class extends An{constructor(t){super(t)}h(){return rn(this,pi,2)}g(){return on(this,yi,5)}};vi.B=[5];var Ai=[0,_r,fr,gi,fr,mi,fr,fi,pr,_i],wi=class extends An{constructor(t){super(t)}};wi.B=[1,2,3,8,9];var Ei=Er(wi,[0,hr,sr,tr,fr,Ai,lr,lr,er,pr,di,hr,er]),bi=class extends An{constructor(t){super(t)}},Ti=[0,Zn,Zn,Zn,Zn,Zn],ki=class extends An{constructor(t){super(t)}};ki.B=[1];var Li=Er(ki,[0,pr,Ti]),Si=class extends An{constructor(t){super(t)}},xi=[0,Zn,Zn,Zn,Zn,Zn],Fi=class extends An{constructor(t){super(t)}};Fi.B=[1];var Oi=Er(Fi,[0,pr,xi]),Mi=class extends An{constructor(t){super(t)}};Mi.B=[3];var Ri=[0,ir,ir,tr,_r],Ci=class extends An{constructor(){super()}};Ci.prototype.g=br([0,Zn,Zn,Zn,Zn,Zn,er]);var Pi=class extends An{constructor(t){super(t)}},Ii=[0,ir,2,lr,fr,ui],Ni=class extends An{constructor(t){super(t)}};Ni.B=[1];var Di=Er(Ni,[0,pr,Ii,er]),$i=class extends An{constructor(t){super(t)}};$i.B=[1];var Ui=class extends An{constructor(t){super(t)}da(){const t=Ke(this);return null==t?j():t}},Bi=class extends An{constructor(t){super(t)}},Gi=[1,2],ji=[0,gr,[0,tr],Gi,gr,[0,mr],Gi,ir,lr],Vi=class extends An{constructor(t){super(t)}};Vi.B=[1];var Wi=Er(Vi,[0,pr,ji,er]),zi=class extends An{constructor(t){super(t)}};zi.B=[4,5];var Hi=[0,lr,ir,Zn,hr,hr],Ki=class extends An{constructor(t){super(t)}},Xi=[0,ar,ar],Yi=class extends An{constructor(t){super(t)}},qi=[1,2,3,4,5],Ji=class extends An{constructor(t){super(t)}g(){return null!=Ke(this)}h(){return null!=dn(this,2)}},Zi=[0,mr,lr,fr,[0,ir,er,er],fr,[0,rr,er]],Qi=class extends An{constructor(t){super(t)}g(){return le(Ge(this,2))??!1}},ts=[0,fr,Zi,ar,fr,[0,gr,Ir,qi,gr,Mr,qi,gr,xr,qi,gr,Pr,qi,gr,Rr,qi]],es=class extends An{constructor(t){super(t)}},ns=[0,fr,ts,Zn,Zn,ir],rs=wr(502141897,es);$r[502141897]=En(ns);var is=[0,fr,Zi];$r[512499200]=En(is);var ss=[0,fr,is];$r[515723506]=En(ss);var os=Er(class extends An{constructor(t){super(t)}},[0,fr,[0,_r,_r,Qn,yr],fr,Ri]),as=[0,fr,ts];$r[508981768]=En(as);var cs=class extends An{constructor(t){super(t)}},hs=[0,fr,ts,Zn,fr,as,ar],us=class extends An{constructor(t){super(t)}},ls=[0,fr,ts,fr,ns,fr,hs,Zn,fr,ss];$r[508968149]=En(hs);var ds=wr(508968150,us);$r[508968150]=En(ls);var fs=class extends An{constructor(t){super(t)}},ps=wr(513916220,fs);$r[513916220]=En([0,fr,ts,fr,ls,ir]);var gs=class extends An{constructor(t){super(t)}h(){return rn(this,zi,2)}g(){Ve(this,2)}},ms=[0,fr,ts,fr,Hi];$r[478825465]=En(ms);var ys=[0,fr,ts];$r[478825422]=En(ys);var _s=class extends An{constructor(t){super(t)}},vs=[0,fr,ts,fr,ys,fr,ms,fr,ms],As=class extends An{constructor(t){super(t)}},ws=[0,fr,ts,Zn,ir],Es=class extends An{constructor(t){super(t)}},bs=[0,fr,ts,Zn],Ts=class extends An{constructor(t){super(t)}},ks=[0,fr,ts,fr,ws,fr,bs,Zn],Ls=class extends An{constructor(t){super(t)}},Ss=[0,fr,ts,fr,ks,fr,vs];$r[463370452]=En(vs),$r[464864288]=En(ws),$r[474472470]=En(bs);var xs=wr(462713202,Ts);$r[462713202]=En(ks);var Fs=wr(479097054,Ls);$r[479097054]=En(Ss);var Os=class extends An{constructor(t){super(t)}},Ms=wr(456383383,Os);$r[456383383]=En([0,fr,ts,fr,Hi]);var Rs=class extends An{constructor(t){super(t)}},Cs=wr(476348187,Rs);$r[476348187]=En([0,fr,ts,fr,Xi]);var Ps=class extends An{constructor(t){super(t)}},Is=[0,_r,_r],Ns=class extends An{constructor(t){super(t)}};Ns.B=[3];var Ds=wr(458105876,class extends An{constructor(t){super(t)}g(){var t=this.u;const e=zt(t);var n=2&e;return t=function(t,e,n){var r=Ns;const i=2&e;let s=!1;if(null==n){if(i)return qe();n=[]}else if(n.constructor===Fe){if(0==(2&n.g)||i)return n;n=n.m()}else Array.isArray(n)?s=!!(2&Wt(n)):n=[];if(i){if(!n.length)return qe();s||(s=!0,Xt(n))}else s&&(s=!1,n=Je(n));return s||(64&Wt(n)?Vt(n,32):32&e&&Gt(n,32)),We(t,e,2,r=new Fe(n,r,we,void 0),!1),r}(t,e,je(t,e,2)),null==t||!n&&Ns&&(t.v=!0),t}});$r[458105876]=En([0,fr,Is,Vn,[0,er,fr,[0,lr,lr,hr]]]);var $s=class extends An{constructor(t){super(t)}},Us=wr(458105758,$s);$r[458105758]=En([0,fr,ts,lr,fr,Is]);var Bs=class extends An{constructor(t){super(t)}};Bs.B=[5,6];var Gs=wr(443442058,Bs);$r[443442058]=En([0,fr,ts,lr,ir,Zn,hr,hr]);var js=class extends An{constructor(t){super(t)}},Vs=[0,fr,ts,Zn,Zn,ir];$r[514774813]=En(Vs);var Ws=class extends An{constructor(t){super(t)}},zs=[0,fr,ts,Zn],Hs=class extends An{constructor(t){super(t)}},Ks=[0,fr,ts,fr,Vs,fr,zs,Zn];$r[518928384]=En(zs);var Xs=wr(516587230,Hs);function Ys(t,e){return e=e?e.clone():new zi,void 0!==t.displayNamesLocale?Ve(e,1,me(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ve(e,1),void 0!==t.maxResults?mn(e,2,t.maxResults):"maxResults"in t&&Ve(e,2),void 0!==t.scoreThreshold?yn(e,3,t.scoreThreshold):"scoreThreshold"in t&&Ve(e,3),void 0!==t.categoryAllowlist?Ze(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ve(e,4),void 0!==t.categoryDenylist?Ze(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ve(e,5),e}function qs(t,e=-1,n=""){return{categories:t.map((t=>({index:fn(un(t,1))??-1,score:pn(t,2)??0,categoryName:dn(t,3)??""??"",displayName:dn(t,4)??""??""}))),headIndex:e,headName:n}}function Js(t){var e=Xe(t,3,ue),n=Xe(t,2,fe);const r=Xe(t,1,ye),i=Xe(t,9,ye),s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=rn(t,vi,4)?.h())&&(s.boundingBox={originX:un(e,1)??0,originY:un(e,2)??0,width:un(e,3)??0,height:un(e,4)??0,angle:0}),rn(t,vi,4)?.g().length)for(const e of rn(t,vi,4).g())s.keypoints.push({x:He(e,1)??0,y:He(e,2)??0,score:He(e,4)??0,label:dn(e,3)??""});return s}function Zs(t){const e=[];for(const n of on(t,Si,1))e.push({x:pn(n,1)??0,y:pn(n,2)??0,z:pn(n,3)??0});return e}function Qs(t){const e=[];for(const n of on(t,bi,1))e.push({x:pn(n,1)??0,y:pn(n,2)??0,z:pn(n,3)??0});return e}function to(t){return Array.from(t,(t=>127<t?t-256:t))}function eo(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(0>=r||0>=i)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let no;$r[516587230]=En(Ks);const ro=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function io(){if(void 0===no)try{await WebAssembly.instantiate(ro),no=!0}catch{no=!1}return no}async function so(t,e){const n=await io()?"wasm_internal":"wasm_nosimd_internal";return void 0!==e?{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}:{wasmLoaderPath:Lr(`./${encodeURIComponent(t)}_${encodeURIComponent(n)}.js`),wasmBinaryPath:Lr(`./${encodeURIComponent(t)}_${encodeURIComponent(n)}.wasm`)}}var oo=class{};function ao(){const t=navigator.userAgent;return t.includes("Safari")&&!t.includes("Chrome")}async function co(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function ho(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function uo(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");return t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),e.videoWidth?(n=e.videoWidth,e=e.videoHeight):e.naturalWidth?(n=e.naturalWidth,e=e.naturalHeight):(n=e.width,e=e.height),!t.l||n===t.i.canvas.width&&e===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=e),[n,e]}function lo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function fo(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function po(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}function go(t,e){const n=rn(t.baseOptions,Ji,1)||new Ji;"string"==typeof e?(Ve(n,2,me(e)),Ve(n,1)):e instanceof Uint8Array&&(Ve(n,1,ee(e,!1,!1)),Ve(n,2)),an(t.baseOptions,0,1,n)}function mo(t){try{const e=t.I.length;if(1===e)throw Error(t.I[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.I.map((t=>t.message)).join(", "))}finally{t.I=[]}}function yo(t,e){t.H=Math.max(t.H,e)}function _o(t,e){t.A=new Xr,zr(t.A,"PassThroughCalculator"),Hr(t.A,"free_memory"),Kr(t.A,"free_memory_unused_out"),ei(e,"free_memory"),ti(e,t.A)}function vo(t,e){Hr(t.A,e),Kr(t.A,e+"_unused_out")}function Ao(t){t.g.addBoolToStream(!0,"free_memory",t.H)}oo.forVisionTasks=function(t=""){return so("vision",t)},oo.forTextTasks=function(t=""){return so("text",t)},oo.forAudioTasks=function(t=""){return so("audio",t)},oo.isSimdSupported=function(){return io()};var wo=class{constructor(t){this.g=t,this.I=[],this.H=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(rn(this.baseOptions,Ji,1)?.g()||rn(this.baseOptions,Ji,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=rn(t.baseOptions,Yi,3);if(!n){var r=n=new Yi,i=new Cr;cn(r,4,qi,i)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new Or,cn(e,2,qi,r)):(e=n,r=new Cr,cn(e,4,qi,r))),an(t.baseOptions,0,3,n)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),go(this,"/model.dat"),this.m(),this.N()}));go(this,e.modelAssetBuffer)}return this.m(),this.N(),Promise.resolve()}N(){}U(){let t;if(this.g.U((e=>{t=si(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.I.push(Error(e))})),this.g.xa(),this.g.setGraph(t,e),this.A=void 0,mo(this)}finishProcessing(){this.g.finishProcessing(),mo(this)}close(){this.A=void 0,this.g.closeGraph()}};wo.prototype.close=wo.prototype.close;const Eo={color:"white",lineWidth:4,radius:6};function bo(t){return{...Eo,fillColor:(t=t||{}).color,...t}}function To(t,e){return t instanceof Function?t(e):t}function ko(t,e,n){return Math.max(Math.min(e,n),Math.min(Math.max(e,n),t))}var Lo=class{constructor(t){this.g=t}ka(t,e){if(t){var n=this.g;e=bo(e),n.save();var r=n.canvas,i=0;for(const s of t)n.fillStyle=To(e.fillColor,{index:i,from:s}),n.strokeStyle=To(e.color,{index:i,from:s}),n.lineWidth=To(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*r.width,s.y*r.height,To(e.radius,{index:i,from:s}),0,2*Math.PI),n.fill(t),n.stroke(t),++i;n.restore()}}ja(t,e,n){if(t&&e){var r=this.g;n=bo(n),r.save();var i=r.canvas,s=0;for(const o of e){r.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(r.strokeStyle=To(n.color,{index:s,from:e,to:a}),r.lineWidth=To(n.lineWidth,{index:s,from:e,to:a}),r.moveTo(e.x*i.width,e.y*i.height),r.lineTo(a.x*i.width,a.y*i.height)),++s,r.stroke()}r.restore()}}ia(t,e){const n=this.g;e=bo(e),n.save(),n.beginPath(),n.lineWidth=To(e.lineWidth,{}),n.strokeStyle=To(e.color,{}),n.fillStyle=To(e.fillColor,{}),n.moveTo(t.originX,t.originY),n.lineTo(t.originX+t.width,t.originY),n.lineTo(t.originX+t.width,t.originY+t.height),n.lineTo(t.originX,t.originY+t.height),n.lineTo(t.originX,t.originY),n.stroke(),n.fill(),n.restore()}};function So(t,e){if(null===t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Lo.prototype.drawBoundingBox=Lo.prototype.ia,Lo.prototype.drawConnectors=Lo.prototype.ja,Lo.prototype.drawLandmarks=Lo.prototype.ka,Lo.lerp=function(t,e,n,r,i){return ko(r*(1-(t-e)/(n-e))+i*(1-(n-t)/(n-e)),r,i)},Lo.clamp=ko;class xo{constructor(t,e,n,r){this.g=t,this.h=e,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Fo(t,e,n){const r=t.h;if(n=So(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.g,n),n}function Oo(t,e){const n=t.h,r=So(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const i=So(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.s),n.vertexAttribPointer(t.s,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const s=So(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.A),n.vertexAttribPointer(t.A,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new xo(n,r,i,s)}function Mo(t,e){if(t.h){if(e!==t.h)throw Error("Cannot change GL context once initialized")}else t.h=e}function Ro(t,e,n,r){if(Mo(t,e),!t.g){const e=t.h;if(t.g=So(e.createProgram(),"Failed to create WebGL program"),t.C=Fo(t,"\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 }",e.VERTEX_SHADER),t.v=Fo(t,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n ",e.FRAGMENT_SHADER),e.linkProgram(t.g),!e.getProgramParameter(t.g,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(t.g)}`);t.s=e.getAttribLocation(t.g,"aVertex"),t.A=e.getAttribLocation(t.g,"aTex")}return n?(t.m||(t.m=Oo(t,!0)),n=t.m):(t.j||(t.j=Oo(t,!1)),n=t.j),e.useProgram(t.g),n.bind(),t=r(),n.g.bindVertexArray(null),t}function Co(t,e,n){Mo(t,e),t.l||(t.l=So(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.l),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function Po(t){t.h?.bindFramebuffer(t.h.FRAMEBUFFER,null)}var Io=class{close(){if(this.g){const t=this.h;t.deleteProgram(this.g),t.deleteShader(this.C),t.deleteShader(this.v)}this.l&&this.h.deleteFramebuffer(this.l),this.j&&this.j.close(),this.m&&this.m.close()}};function No(t,e){switch(e){case 0:return t.g.find((t=>t instanceof ImageData));case 1:return t.g.find((t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function Do(t){var e=No(t,0);if(!e){e=Uo(t);const n=Bo(t),r=new Uint8Array(t.width*t.height*4);Co(n,e,$o(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,r),Po(n),e=new ImageData(new Uint8ClampedArray(r.buffer),t.width,t.height),t.g.push(e)}return e}function $o(t){let e=No(t,2);if(!e){const n=Uo(t);e=jo(t);const r=No(t,1)||Do(t);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),Vo(t)}return e}function Uo(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return t.h||(t.h=So(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Bo(t){return t.l||(t.l=new Io),t.l}function Go(t){(t=Uo(t)).texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR)}function jo(t){const e=Uo(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=No(t,2);return n?e.bindTexture(e.TEXTURE_2D,n):(n=So(e.createTexture(),"Failed to create texture"),t.g.push(n),t.m=!0,e.bindTexture(e.TEXTURE_2D,n),Go(t)),n}function Vo(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Wo(t){const e=Uo(t);return Ro(Bo(t),e,!0,(()=>