gradio-components / pose-gradio.js
radames's picture
Upload pose-gradio.js
7530f4b
raw
history blame
71.1 kB
(function(){const p=document.createElement("link").relList;if(p&&p.supports&&p.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))F(_);new MutationObserver(_=>{for(const R of _)if(R.type==="childList")for(const j of R.addedNodes)j.tagName==="LINK"&&j.rel==="modulepreload"&&F(j)}).observe(document,{childList:!0,subtree:!0});function g(_){const R={};return _.integrity&&(R.integrity=_.integrity),_.referrerPolicy&&(R.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?R.credentials="include":_.crossOrigin==="anonymous"?R.credentials="omit":R.credentials="same-origin",R}function F(_){if(_.ep)return;_.ep=!0;const R=g(_);fetch(_.href,R)}})();const Ur=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.absolute{position:absolute}.relative{position:relative}.bottom-1{bottom:.25rem}.left-1{left:.25rem}.z-10{z-index:10}.inline{display:inline}.flex{display:flex}.hidden{display:none}.w-32{width:8rem}.w-full{width:100%}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.gap-2{gap:.5rem}.rounded-lg{border-radius:.5rem}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.font-bold{font-weight:700}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb;--tw-content: ""}:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;margin:0;line-height:inherit}
`;function te(){}function zn(c){return c()}function Mn(){return Object.create(null)}function ne(c){c.forEach(zn)}function Kn(c){return typeof c=="function"}function Mr(c,p){return c!=c?p==p:c!==p||c&&typeof c=="object"||typeof c=="function"}function Dr(c){return Object.keys(c).length===0}function et(c,p){c.appendChild(p)}function Gr(c,p,g){const F=Br(c);if(!F.getElementById(p)){const _=gt("style");_.id=p,_.textContent=g,zr(F,_)}}function Br(c){if(!c)return document;const p=c.getRootNode?c.getRootNode():c.ownerDocument;return p&&p.host?p:c.ownerDocument}function zr(c,p){return et(c.head||c,p),p.sheet}function Dn(c,p,g){c.insertBefore(p,g||null)}function Ge(c){c.parentNode&&c.parentNode.removeChild(c)}function gt(c){return document.createElement(c)}function Qt(c){return document.createTextNode(c)}function Zt(){return Qt(" ")}function Me(c,p,g,F){return c.addEventListener(p,g,F),()=>c.removeEventListener(p,g,F)}function at(c,p,g){g==null?c.removeAttribute(p):c.getAttribute(p)!==g&&c.setAttribute(p,g)}function Kr(c){return Array.from(c.childNodes)}function Gn(c,p){p=""+p,c.wholeText!==p&&(c.data=p)}let ee;function Jt(c){ee=c}function Wr(){if(!ee)throw new Error("Function called outside component initialization");return ee}function Yr(c){Wr().$$.on_mount.push(c)}const Ct=[],qt=[];let Ut=[];const Bn=[],Xr=Promise.resolve();let Be=!1;function Vr(){Be||(Be=!0,Xr.then(Wn))}function ze(c){Ut.push(c)}const De=new Set;let Ht=0;function Wn(){if(Ht!==0)return;const c=ee;do{try{for(;Ht<Ct.length;){const p=Ct[Ht];Ht++,Jt(p),$r(p.$$)}}catch(p){throw Ct.length=0,Ht=0,p}for(Jt(null),Ct.length=0,Ht=0;qt.length;)qt.pop()();for(let p=0;p<Ut.length;p+=1){const g=Ut[p];De.has(g)||(De.add(g),g())}Ut.length=0}while(Ct.length);for(;Bn.length;)Bn.pop()();Be=!1,De.clear(),Jt(c)}function $r(c){if(c.fragment!==null){c.update(),ne(c.before_update);const p=c.dirty;c.dirty=[-1],c.fragment&&c.fragment.p(c.ctx,p),c.after_update.forEach(ze)}}function Zr(c){const p=[],g=[];Ut.forEach(F=>c.indexOf(F)===-1?p.push(F):g.push(F)),g.forEach(F=>F()),Ut=p}const Qr=new Set;function Jr(c,p){c&&c.i&&(Qr.delete(c),c.i(p))}function qr(c,p,g,F){const{fragment:_,after_update:R}=c.$$;_&&_.m(p,g),F||ze(()=>{const j=c.$$.on_mount.map(zn).filter(Kn);c.$$.on_destroy?c.$$.on_destroy.push(...j):ne(j),c.$$.on_mount=[]}),R.forEach(ze)}function ti(c,p){const g=c.$$;g.fragment!==null&&(Zr(g.after_update),ne(g.on_destroy),g.fragment&&g.fragment.d(p),g.on_destroy=g.fragment=null,g.ctx=[])}function ei(c,p){c.$$.dirty[0]===-1&&(Ct.push(c),Vr(),c.$$.dirty.fill(0)),c.$$.dirty[p/31|0]|=1<<p%31}function ni(c,p,g,F,_,R,j,S=[-1]){const Q=ee;Jt(c);const k=c.$$={fragment:null,ctx:[],props:R,update:te,not_equal:_,bound:Mn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(p.context||(Q?Q.$$.context:[])),callbacks:Mn(),dirty:S,skip_bound:!1,root:p.target||Q.$$.root};j&&j(k.root);let U=!1;if(k.ctx=g?g(c,p.props||{},(D,G,...q)=>{const W=q.length?q[0]:G;return k.ctx&&_(k.ctx[D],k.ctx[D]=W)&&(!k.skip_bound&&k.bound[D]&&k.bound[D](W),U&&ei(c,D)),G}):[],k.update(),U=!0,ne(k.before_update),k.fragment=F?F(k.ctx):!1,p.target){if(p.hydrate){const D=Kr(p.target);k.fragment&&k.fragment.l(D),D.forEach(Ge)}else k.fragment&&k.fragment.c();p.intro&&Jr(c.$$.fragment),qr(c,p.target,p.anchor,p.customElement),Wn()}Jt(Q)}class ri{$destroy(){ti(this,1),this.$destroy=te}$on(p,g){if(!Kn(g))return te;const F=this.$$.callbacks[p]||(this.$$.callbacks[p]=[]);return F.push(g),()=>{const _=F.indexOf(g);_!==-1&&F.splice(_,1)}}$set(p){this.$$set&&!Dr(p)&&(this.$$.skip_bound=!0,this.$$set(p),this.$$.skip_bound=!1)}}var Mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ye={};(function(){var c;function p(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var g=typeof Object.defineProperties=="function"?Object.defineProperty:function(t,e,n){return t==Array.prototype||t==Object.prototype||(t[e]=n.value),t};function F(t){t=[typeof globalThis=="object"&&globalThis,t,typeof window=="object"&&window,typeof self=="object"&&self,typeof Mt=="object"&&Mt];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}var _=F(this);function R(t,e){if(e)t:{var n=_;t=t.split(".");for(var r=0;r<t.length-1;r++){var i=t[r];if(!(i in n))break t;n=n[i]}t=t[t.length-1],r=n[t],e=e(r),e!=r&&e!=null&&g(n,t,{configurable:!0,writable:!0,value:e})}}R("Symbol",function(t){function e(s){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new n(r+(s||"")+"_"+i++,s)}function n(s,o){this.h=s,g(this,"description",{configurable:!0,writable:!0,value:o})}if(t)return t;n.prototype.toString=function(){return this.h};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return e}),R("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var e="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<e.length;n++){var r=_[e[n]];typeof r=="function"&&typeof r.prototype[t]!="function"&&g(r.prototype,t,{configurable:!0,writable:!0,value:function(){return j(p(this))}})}return t});function j(t){return t={next:t},t[Symbol.iterator]=function(){return this},t}function S(t){var e=typeof Symbol<"u"&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:p(t)}}function Q(t){if(!(t instanceof Array)){t=S(t);for(var e,n=[];!(e=t.next()).done;)n.push(e.value);t=n}return t}var k=typeof Object.assign=="function"?Object.assign:function(t,e){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};R("Object.assign",function(t){return t||k});var U=typeof Object.create=="function"?Object.create:function(t){function e(){}return e.prototype=t,new e},D;if(typeof Object.setPrototypeOf=="function")D=Object.setPrototypeOf;else{var G;t:{var q={a:!0},W={};try{W.__proto__=q,G=W.a;break t}catch{}G=!1}D=G?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var Y=D;function nt(t,e){if(t.prototype=U(e.prototype),t.prototype.constructor=t,Y)Y(t,e);else for(var n in e)if(n!="prototype")if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(e,n);r&&Object.defineProperty(t,n,r)}else t[n]=e[n];t.za=e.prototype}function $(){this.m=!1,this.j=null,this.i=void 0,this.h=1,this.v=this.s=0,this.l=null}function ct(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}$.prototype.u=function(t){this.i=t};function J(t,e){t.l={ma:e,na:!0},t.h=t.s||t.v}$.prototype.return=function(t){this.l={return:t},this.h=this.v};function I(t,e,n){return t.h=n,{value:e}}function ft(t){this.h=new $,this.i=t}function _t(t,e){ct(t.h);var n=t.h.j;return n?rt(t,"return"in n?n.return:function(r){return{value:r,done:!0}},e,t.h.return):(t.h.return(e),X(t))}function rt(t,e,n,r){try{var i=e.call(t.h.j,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return t.h.m=!1,i;var s=i.value}catch(o){return t.h.j=null,J(t.h,o),X(t)}return t.h.j=null,r.call(t.h,s),X(t)}function X(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(n){t.h.i=void 0,J(t.h,n)}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 B(t){this.next=function(e){return ct(t.h),t.h.j?e=rt(t,t.h.j.next,e,t.h.u):(t.h.u(e),e=X(t)),e},this.throw=function(e){return ct(t.h),t.h.j?e=rt(t,t.h.j.throw,e,t.h.u):(J(t.h,e),e=X(t)),e},this.return=function(e){return _t(t,e)},this[Symbol.iterator]=function(){return this}}function l(t){function e(r){return t.next(r)}function n(r){return t.throw(r)}return new Promise(function(r,i){function s(o){o.done?r(o.value):Promise.resolve(o.value).then(e,n).then(s,i)}s(t.next())})}function f(t){return l(new B(new ft(t)))}R("Promise",function(t){function e(o){this.i=0,this.j=void 0,this.h=[],this.u=!1;var u=this.l();try{o(u.resolve,u.reject)}catch(a){u.reject(a)}}function n(){this.h=null}function r(o){return o instanceof e?o:new e(function(u){u(o)})}if(t)return t;n.prototype.i=function(o){if(this.h==null){this.h=[];var u=this;this.j(function(){u.m()})}this.h.push(o)};var i=_.setTimeout;n.prototype.j=function(o){i(o,0)},n.prototype.m=function(){for(;this.h&&this.h.length;){var o=this.h;this.h=[];for(var u=0;u<o.length;++u){var a=o[u];o[u]=null;try{a()}catch(h){this.l(h)}}}this.h=null},n.prototype.l=function(o){this.j(function(){throw o})},e.prototype.l=function(){function o(h){return function(v){a||(a=!0,h.call(u,v))}}var u=this,a=!1;return{resolve:o(this.I),reject:o(this.m)}},e.prototype.I=function(o){if(o===this)this.m(new TypeError("A Promise cannot resolve to itself"));else if(o instanceof e)this.L(o);else{t:switch(typeof o){case"object":var u=o!=null;break t;case"function":u=!0;break t;default:u=!1}u?this.F(o):this.s(o)}},e.prototype.F=function(o){var u=void 0;try{u=o.then}catch(a){this.m(a);return}typeof u=="function"?this.M(u,o):this.s(o)},e.prototype.m=function(o){this.v(2,o)},e.prototype.s=function(o){this.v(1,o)},e.prototype.v=function(o,u){if(this.i!=0)throw Error("Cannot settle("+o+", "+u+"): Promise already settled in state"+this.i);this.i=o,this.j=u,this.i===2&&this.K(),this.H()},e.prototype.K=function(){var o=this;i(function(){if(o.D()){var u=_.console;typeof u<"u"&&u.error(o.j)}},1)},e.prototype.D=function(){if(this.u)return!1;var o=_.CustomEvent,u=_.Event,a=_.dispatchEvent;return typeof a>"u"?!0:(typeof o=="function"?o=new o("unhandledrejection",{cancelable:!0}):typeof u=="function"?o=new u("unhandledrejection",{cancelable:!0}):(o=_.document.createEvent("CustomEvent"),o.initCustomEvent("unhandledrejection",!1,!0,o)),o.promise=this,o.reason=this.j,a(o))},e.prototype.H=function(){if(this.h!=null){for(var o=0;o<this.h.length;++o)s.i(this.h[o]);this.h=null}};var s=new n;return e.prototype.L=function(o){var u=this.l();o.T(u.resolve,u.reject)},e.prototype.M=function(o,u){var a=this.l();try{o.call(u,a.resolve,a.reject)}catch(h){a.reject(h)}},e.prototype.then=function(o,u){function a(w,y){return typeof w=="function"?function(T){try{h(w(T))}catch(L){v(L)}}:y}var h,v,x=new e(function(w,y){h=w,v=y});return this.T(a(o,h),a(u,v)),x},e.prototype.catch=function(o){return this.then(void 0,o)},e.prototype.T=function(o,u){function a(){switch(h.i){case 1:o(h.j);break;case 2:u(h.j);break;default:throw Error("Unexpected state: "+h.i)}}var h=this;this.h==null?s.i(a):this.h.push(a),this.u=!0},e.resolve=r,e.reject=function(o){return new e(function(u,a){a(o)})},e.race=function(o){return new e(function(u,a){for(var h=S(o),v=h.next();!v.done;v=h.next())r(v.value).T(u,a)})},e.all=function(o){var u=S(o),a=u.next();return a.done?r([]):new e(function(h,v){function x(T){return function(L){w[T]=L,y--,y==0&&h(w)}}var w=[],y=0;do w.push(void 0),y++,r(a.value).T(x(w.length-1),v),a=u.next();while(!a.done)})},e});function A(t,e){t instanceof String&&(t+="");var n=0,r=!1,i={next:function(){if(!r&&n<t.length){var s=n++;return{value:e(s,t[s]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}R("Array.prototype.keys",function(t){return t||function(){return A(this,function(e){return e})}}),R("Array.prototype.fill",function(t){return t||function(e,n,r){var i=this.length||0;for(0>n&&(n=Math.max(0,i+n)),(r==null||r>i)&&(r=i),r=Number(r),0>r&&(r=Math.max(0,i+r)),n=Number(n||0);n<r;n++)this[n]=e;return this}});function E(t){return t||Array.prototype.fill}R("Int8Array.prototype.fill",E),R("Uint8Array.prototype.fill",E),R("Uint8ClampedArray.prototype.fill",E),R("Int16Array.prototype.fill",E),R("Uint16Array.prototype.fill",E),R("Int32Array.prototype.fill",E),R("Uint32Array.prototype.fill",E),R("Float32Array.prototype.fill",E),R("Float64Array.prototype.fill",E),R("Object.is",function(t){return t||function(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}}),R("Array.prototype.includes",function(t){return t||function(e,n){var r=this;r instanceof String&&(r=String(r));var i=r.length;for(n=n||0,0>n&&(n=Math.max(n+i,0));n<i;n++){var s=r[n];if(s===e||Object.is(s,e))return!0}return!1}}),R("String.prototype.includes",function(t){return t||function(e,n){if(this==null)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return this.indexOf(e,n||0)!==-1}});var P=this||self;function m(t,e){t=t.split(".");var n=P;t[0]in n||typeof n.execScript>"u"||n.execScript("var "+t[0]);for(var r;t.length&&(r=t.shift());)t.length||e===void 0?n[r]&&n[r]!==Object.prototype[r]?n=n[r]:n=n[r]={}:n[r]=e}function d(t){var e;t:{if((e=P.navigator)&&(e=e.userAgent))break t;e=""}return e.indexOf(t)!=-1}var b=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=Array(n),i=typeof t=="string"?t.split(""):t,s=0;s<n;s++)s in i&&(r[s]=e.call(void 0,i[s],s,t));return r},O={},H=null;function it(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):"=.".indexOf(t[e-1])!=-1&&(n="=.".indexOf(t[e-2])!=-1?n-2:n-1);var r=new Uint8Array(n),i=0;return At(t,function(s){r[i++]=s}),i!==n?r.subarray(0,i):r}function At(t,e){function n(a){for(;r<t.length;){var h=t.charAt(r++),v=H[h];if(v!=null)return v;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return a}z();for(var r=0;;){var i=n(-1),s=n(0),o=n(64),u=n(64);if(u===64&&i===-1)break;e(i<<2|s>>4),o!=64&&(e(s<<4&240|o>>2),u!=64&&e(o<<6&192|u))}}function z(){if(!H){H={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));O[n]=r;for(var i=0;i<r.length;i++){var s=r[i];H[s]===void 0&&(H[s]=i)}}}}var Z=typeof Uint8Array<"u",ht=!(d("Trident")||d("MSIE"))&&typeof P.btoa=="function";function pt(t){if(!ht){var e;e===void 0&&(e=0),z(),e=O[e];for(var n=Array(Math.floor(t.length/3)),r=e[64]||"",i=0,s=0;i<t.length-2;i+=3){var o=t[i],u=t[i+1],a=t[i+2],h=e[o>>2];o=e[(o&3)<<4|u>>4],u=e[(u&15)<<2|a>>6],a=e[a&63],n[s++]=h+o+u+a}switch(h=0,a=r,t.length-i){case 2:h=t[i+1],a=e[(h&15)<<2]||r;case 1:t=t[i],n[s]=e[t>>2]+e[(t&3)<<4|h>>4]+a+r}return n.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 Lt=RegExp("[-_.]","g");function Dt(t){switch(t){case"-":return"+";case"_":return"/";case".":return"=";default:return""}}function It(t){if(!ht)return it(t);Lt.test(t)&&(t=t.replace(Lt,Dt)),t=atob(t);for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}var Nt;function Gt(){return Nt||(Nt=new Uint8Array(0))}var St={},re=typeof Uint8Array.prototype.slice=="function",K=0,tt=0;function Ke(t){var e=0>t;t=Math.abs(t);var n=t>>>0;t=Math.floor((t-n)/4294967296),e&&(n=S(We(n,t)),e=n.next().value,t=n.next().value,n=e),K=n>>>0,tt=t>>>0}var Yn=typeof BigInt=="function";function We(t,e){return e=~e,t?t=~t+1:e+=1,[t,e]}function Ye(t,e){this.i=t>>>0,this.h=e>>>0}function Xe(t){if(!t)return Ve||(Ve=new Ye(0,0));if(!/^-?\d+$/.test(t))return null;if(16>t.length)Ke(Number(t));else if(Yn)t=BigInt(t),K=Number(t&BigInt(4294967295))>>>0,tt=Number(t>>BigInt(32)&BigInt(4294967295));else{var e=+(t[0]==="-");tt=K=0;for(var n=t.length,r=e,i=(n-e)%6+e;i<=n;r=i,i+=6)r=Number(t.slice(r,i)),tt*=1e6,K=1e6*K+r,4294967296<=K&&(tt+=K/4294967296|0,K%=4294967296);e&&(e=S(We(K,tt)),t=e.next().value,e=e.next().value,K=t,tt=e)}return new Ye(K,tt)}var Ve;function $e(t,e){return Error("Invalid wire type: "+t+" (at position "+e+")")}function ge(){return Error("Failed to read varint, encoding is invalid.")}function Ze(t,e){return Error("Tried to read past the end of the data "+e+" > "+t)}function Rt(){throw Error("Invalid UTF8")}function Qe(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}var ie=void 0,me,Xn=typeof TextDecoder<"u",Je,Vn=typeof TextEncoder<"u",qe;function tn(t){if(t!==St)throw Error("illegal external caller")}function Bt(t,e){if(tn(e),this.V=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}function we(){return qe||(qe=new Bt(null,St))}function en(t){tn(St);var e=t.V;return e=e==null||Z&&e!=null&&e instanceof Uint8Array?e:typeof e=="string"?It(e):null,e==null?e:t.V=e}function $n(t){if(typeof t=="string")return{buffer:It(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===Bt)return{buffer:en(t)||Gt(),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")}function nn(t,e){this.i=null,this.m=!1,this.h=this.j=this.l=0,be(this,t,e)}function be(t,e,n){n=n===void 0?{}:n,t.S=n.S===void 0?!1:n.S,e&&(e=$n(e),t.i=e.buffer,t.m=e.C,t.l=0,t.j=t.i.length,t.h=t.l)}nn.prototype.reset=function(){this.h=this.l};function jt(t,e){if(t.h=e,e>t.j)throw Ze(t.j,e)}function zt(t){var e=t.i,n=t.h,r=e[n++],i=r&127;if(r&128&&(r=e[n++],i|=(r&127)<<7,r&128&&(r=e[n++],i|=(r&127)<<14,r&128&&(r=e[n++],i|=(r&127)<<21,r&128&&(r=e[n++],i|=r<<28,r&128&&e[n++]&128&&e[n++]&128&&e[n++]&128&&e[n++]&128&&e[n++]&128)))))throw ge();return jt(t,n),i}function rn(t,e){if(0>e)throw Error("Tried to read a negative byte length: "+e);var n=t.h,r=n+e;if(r>t.j)throw Ze(e,t.j-n);return t.h=r,n}var on=[];function Ee(){this.h=[]}Ee.prototype.length=function(){return this.h.length},Ee.prototype.end=function(){var t=this.h;return this.h=[],t};function sn(t,e,n){for(;0<n||127<e;)t.h.push(e&127|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.h.push(e)}function Ot(t,e){for(;127<e;)t.h.push(e&127|128),e>>>=7;t.h.push(e)}function _e(t,e){if(on.length){var n=on.pop();be(n,t,e),t=n}else t=new nn(t,e);this.h=t,this.j=this.h.h,this.i=this.l=-1,this.setOptions(e)}_e.prototype.setOptions=function(t){t=t===void 0?{}:t,this.ca=t.ca===void 0?!1:t.ca},_e.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};function un(t){var e=t.h;if(e.h==e.j)return!1;t.j=t.h.h;var n=zt(t.h)>>>0;if(e=n>>>3,n&=7,!(0<=n&&5>=n))throw $e(n,t.j);if(1>e)throw Error("Invalid field number: "+e+" (at position "+t.j+")");return t.l=e,t.i=n,!0}function oe(t){switch(t.i){case 0:if(t.i!=0)oe(t);else t:{t=t.h;for(var e=t.h,n=e+10,r=t.i;e<n;)if(!(r[e++]&128)){jt(t,e);break t}throw ge()}break;case 1:t=t.h,jt(t,t.h+8);break;case 2:t.i!=2?oe(t):(e=zt(t.h)>>>0,t=t.h,jt(t,t.h+e));break;case 5:t=t.h,jt(t,t.h+4);break;case 3:e=t.l;do{if(!un(t))throw Error("Unmatched start-group tag: stream EOF");if(t.i==4){if(t.l!=e)throw Error("Unmatched end-group tag");break}oe(t)}while(1);break;default:throw $e(t.i,t.j)}}var se=[];function Zn(){this.j=[],this.i=0,this.h=new Ee}function kt(t,e){e.length!==0&&(t.j.push(e),t.i+=e.length)}function Qn(t,e){if(e=e.R){kt(t,t.h.end());for(var n=0;n<e.length;n++)kt(t,en(e[n])||Gt())}}var xt=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():void 0;function Ft(t,e){return xt?t[xt]|=e:t.A!==void 0?t.A|=e:(Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}}),e)}function ln(t,e){xt?t[xt]&&(t[xt]&=~e):t.A!==void 0&&(t.A&=~e)}function V(t){var e;return xt?e=t[xt]:e=t.A,e??0}function mt(t,e){xt?t[xt]=e:t.A!==void 0?t.A=e:Object.defineProperties(t,{A:{value:e,configurable:!0,writable:!0,enumerable:!1}})}function Ae(t){return Ft(t,1),t}function Jn(t,e){mt(e,(t|0)&-51)}function ue(t,e){mt(e,(t|18)&-41)}var xe={};function le(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}var Kt,an=[];mt(an,23),Kt=Object.freeze(an);function Te(t){if(V(t.o)&2)throw Error("Cannot mutate an immutable Message")}function Se(t){var e=t.length;(e=e?t[e-1]:void 0)&&le(e)?e.g=1:(e={},t.push((e.g=1,e)))}function cn(t){var e=t.i+t.G;return t.B||(t.B=t.o[e]={})}function vt(t,e){return e===-1?null:e>=t.i?t.B?t.B[e]:void 0:t.o[e+t.G]}function wt(t,e,n,r){Te(t),Wt(t,e,n,r)}function Wt(t,e,n,r){t.j&&(t.j=void 0),e>=t.i||r?cn(t)[e]=n:(t.o[e+t.G]=n,(t=t.B)&&e in t&&delete t[e])}function Re(t,e,n,r){var i=vt(t,e);Array.isArray(i)||(i=Kt);var s=V(i);if(s&1||Ae(i),r)s&2||Ft(i,2),n&1||Object.freeze(i);else{r=!(n&2);var o=s&2;n&1||!o?r&&s&16&&!o&&ln(i,16):(i=Ae(Array.prototype.slice.call(i)),Wt(t,e,i))}return i}function je(t,e){var n=vt(t,e),r=n==null?n:typeof n=="number"||n==="NaN"||n==="Infinity"||n==="-Infinity"?Number(n):void 0;return r!=null&&r!==n&&Wt(t,e,r),r}function fn(t,e,n,r,i){t.h||(t.h={});var s=t.h[n],o=Re(t,n,3,i);if(!s){var u=o;s=[];var a=!!(V(t.o)&16);o=!!(V(u)&2);var h=u;!i&&o&&(u=Array.prototype.slice.call(u));for(var v=o,x=0;x<u.length;x++){var w=u[x],y=e,T=!1;if(T=T===void 0?!1:T,w=Array.isArray(w)?new y(w):T?new y:void 0,w!==void 0){y=w.o;var L=T=V(y);o&&(L|=2),a&&(L|=16),L!=T&&mt(y,L),y=L,v=v||!!(2&y),s.push(w)}}return t.h[n]=s,a=V(u),e=a|33,e=v?e&-9:e|8,a!=e&&(v=u,Object.isFrozen(v)&&(v=Array.prototype.slice.call(v)),mt(v,e),u=v),h!==u&&Wt(t,n,u),(i||r&&o)&&Ft(s,2),r&&Object.freeze(s),s}return i||(i=Object.isFrozen(s),r&&!i?Object.freeze(s):!r&&i&&(s=Array.prototype.slice.call(s),t.h[n]=s)),s}function Oe(t,e,n){var r=!!(V(t.o)&2);if(e=fn(t,e,n,r,r),t=Re(t,n,3,r),!(r||V(t)&8)){for(r=0;r<e.length;r++){if(n=e[r],V(n.o)&2){var i=gn(n,!1);i.j=n}else i=n;n!==i&&(e[r]=i,t[r]=i.o)}Ft(t,8)}return e}function bt(t,e,n){if(n!=null&&typeof n!="number")throw Error("Value of float/double field must be a number|null|undefined, found "+typeof n+": "+n);wt(t,e,n)}function hn(t,e,n,r,i){Te(t);var s=fn(t,n,e,!1,!1);return n=r??new n,t=Re(t,e,2,!1),i!=null?(s.splice(i,0,n),t.splice(i,0,n.o)):(s.push(n),t.push(n.o)),n.C()&&ln(t,8),n}function ae(t,e){return t??e}function Et(t,e,n){return n=n===void 0?0:n,ae(je(t,e),n)}var ce;function qn(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"object":if(t)if(Array.isArray(t)){if(V(t)&128)return t=Array.prototype.slice.call(t),Se(t),t}else{if(Z&&t!=null&&t instanceof Uint8Array)return pt(t);if(t instanceof Bt){var e=t.V;return e==null?"":typeof e=="string"?e:t.V=pt(e)}}}return t}function pn(t,e,n,r){if(t!=null){if(Array.isArray(t))t=Fe(t,e,n,r!==void 0);else if(le(t)){var i={},s;for(s in t)i[s]=pn(t[s],e,n,r);t=i}else t=e(t,r);return t}}function Fe(t,e,n,r){var i=V(t);r=r?!!(i&16):void 0,t=Array.prototype.slice.call(t);for(var s=0;s<t.length;s++)t[s]=pn(t[s],e,n,r);return n(i,t),t}function tr(t){return t.ja===xe?t.toJSON():qn(t)}function er(t,e){t&128&&Se(e)}function dn(t,e,n){if(n=n===void 0?ue:n,t!=null){if(Z&&t instanceof Uint8Array)return t.length?new Bt(new Uint8Array(t),St):we();if(Array.isArray(t)){var r=V(t);return r&2?t:e&&!(r&32)&&(r&16||r===0)?(mt(t,r|2),t):(t=Fe(t,dn,r&4?ue:n,!0),e=V(t),e&4&&e&2&&Object.freeze(t),t)}return t.ja===xe?yn(t):t}}function vn(t,e,n,r,i,s,o){if(t=t.h&&t.h[n]){if(r=V(t),r&2?r=t:(s=b(t,yn),ue(r,s),Object.freeze(s),r=s),Te(e),o=r==null?Kt:Ae([]),r!=null){for(s=!!r.length,t=0;t<r.length;t++){var u=r[t];s=s&&!(V(u.o)&2),o[t]=u.o}s=(s?8:0)|1,t=V(o),(t&s)!==s&&(Object.isFrozen(o)&&(o=Array.prototype.slice.call(o)),mt(o,t|s)),e.h||(e.h={}),e.h[n]=r}else e.h&&(e.h[n]=void 0);Wt(e,n,o,i)}else wt(e,n,dn(r,s,o),i)}function yn(t){return V(t.o)&2||(t=gn(t,!0),Ft(t.o,2)),t}function gn(t,e){var n=t.o,r=[];Ft(r,16);var i=t.constructor.h;if(i&&r.push(i),i=t.B,i){r.length=n.length,r.fill(void 0,r.length,n.length);var s={};r[r.length-1]=s}V(n)&128&&Se(r),e=e||t.C()?ue:Jn,s=t.constructor,ce=r,r=new s(r),ce=void 0,t.R&&(r.R=t.R.slice()),s=!!(V(n)&16);for(var o=i?n.length-1:n.length,u=0;u<o;u++)vn(t,r,u-t.G,n[u],!1,s,e);if(i)for(var a in i)vn(t,r,+a,i[a],!0,s,e);return r}function ut(t,e,n){t==null&&(t=ce),ce=void 0;var r=this.constructor.i||0,i=0<r,s=this.constructor.h,o=!1;if(t==null){t=s?[s]:[];var u=48,a=!0;i&&(r=0,u|=128),mt(t,u)}else{if(!Array.isArray(t)||s&&s!==t[0])throw Error();var h=u=Ft(t,0);if((a=(16&h)!==0)&&((o=(32&h)!==0)||(h|=32)),i){if(128&h)r=0;else if(0<t.length){var v=t[t.length-1];if(le(v)&&"g"in v){r=0,h|=128,delete v.g;var x=!0,w;for(w in v){x=!1;break}x&&t.pop()}}}else if(128&h)throw Error();u!==h&&mt(t,h)}this.G=(s?0:-1)-r,this.h=void 0,this.o=t;t:{if(s=this.o.length,r=s-1,s&&(s=this.o[r],le(s))){this.B=s,this.i=r-this.G;break t}e!==void 0&&-1<e?(this.i=Math.max(e,r+1-this.G),this.B=void 0):this.i=Number.MAX_VALUE}if(!i&&this.B&&"g"in this.B)throw Error('Unexpected "g" flag in sparse object of message that is not a group type.');if(n){e=a&&!o&&!0,i=this.i;var y;for(a=0;a<n.length;a++)o=n[a],o<i?(o+=this.G,(r=t[o])?mn(r,e):t[o]=Kt):(y||(y=cn(this)),(r=y[o])?mn(r,e):y[o]=Kt)}}ut.prototype.toJSON=function(){return Fe(this.o,tr,er)},ut.prototype.C=function(){return!!(V(this.o)&2)};function mn(t,e){if(Array.isArray(t)){var n=V(t),r=1;!e||n&2||(r|=16),(n&r)!==r&&mt(t,n|r)}}ut.prototype.ja=xe,ut.prototype.toString=function(){return this.o.toString()};function wn(t,e,n){if(n){var r={},i;for(i in n){var s=n[i],o=s.ra;o||(r.J=s.xa||s.oa.W,s.ia?(r.aa=xn(s.ia),o=function(u){return function(a,h,v){return u.J(a,h,v,u.aa)}}(r)):s.ka?(r.Z=Tn(s.da.P,s.ka),o=function(u){return function(a,h,v){return u.J(a,h,v,u.Z)}}(r)):o=r.J,s.ra=o),o(e,t,s.da),r={J:r.J,aa:r.aa,Z:r.Z}}}Qn(e,t)}var fe=Symbol();function bn(t,e,n){return t[fe]||(t[fe]=function(r,i){return e(r,i,n)})}function En(t){var e=t[fe];if(!e){var n=Ie(t);e=function(r,i){return Sn(r,i,n)},t[fe]=e}return e}function nr(t){var e=t.ia;if(e)return En(e);if(e=t.wa)return bn(t.da.P,e,t.ka)}function rr(t){var e=nr(t),n=t.da,r=t.oa.U;return e?function(i,s){return r(i,s,n,e)}:function(i,s){return r(i,s,n)}}function _n(t,e){var n=t[e];return typeof n=="function"&&n.length===0&&(n=n(),t[e]=n),Array.isArray(n)&&(Xt in n||Yt in n||0<n.length&&typeof n[0]=="function")?n:void 0}function An(t,e,n,r,i,s){e.P=t[0];var o=1;if(t.length>o&&typeof t[o]!="number"){var u=t[o++];n(e,u)}for(;o<t.length;){n=t[o++];for(var a=o+1;a<t.length&&typeof t[a]!="number";)a++;switch(u=t[o++],a-=o,a){case 0:r(e,n,u);break;case 1:(a=_n(t,o))?(o++,i(e,n,u,a)):r(e,n,u,t[o++]);break;case 2:a=o++,a=_n(t,a),i(e,n,u,a,t[o++]);break;case 3:s(e,n,u,t[o++],t[o++],t[o++]);break;case 4:s(e,n,u,t[o++],t[o++],t[o++],t[o++]);break;default:throw Error("unexpected number of binary field arguments: "+a)}}return e}var he=Symbol();function xn(t){var e=t[he];if(!e){var n=Le(t);e=function(r,i){return Rn(r,i,n)},t[he]=e}return e}function Tn(t,e){var n=t[he];return n||(n=function(r,i){return wn(r,i,e)},t[he]=n),n}var Yt=Symbol();function ir(t,e){t.push(e)}function or(t,e,n){t.push(e,n.W)}function sr(t,e,n,r){var i=xn(r),s=Le(r).P,o=n.W;t.push(e,function(u,a,h){return o(u,a,h,s,i)})}function ur(t,e,n,r,i,s){var o=Tn(r,s),u=n.W;t.push(e,function(a,h,v){return u(a,h,v,r,o)})}function Le(t){var e=t[Yt];return e||(e=An(t,t[Yt]=[],ir,or,sr,ur),Xt in t&&Yt in t&&(t.length=0),e)}var Xt=Symbol();function lr(t,e){t[0]=e}function ar(t,e,n,r){var i=n.U;t[e]=r?function(s,o,u){return i(s,o,u,r)}:i}function cr(t,e,n,r,i){var s=n.U,o=En(r),u=Ie(r).P;t[e]=function(a,h,v){return s(a,h,v,u,o,i)}}function fr(t,e,n,r,i,s,o){var u=n.U,a=bn(r,i,s);t[e]=function(h,v,x){return u(h,v,x,r,a,o)}}function Ie(t){var e=t[Xt];return e||(e=An(t,t[Xt]={},lr,ar,cr,fr),Xt in t&&Yt in t&&(t.length=0),e)}function Sn(t,e,n){for(;un(e)&&e.i!=4;){var r=e.l,i=n[r];if(!i){var s=n[0];s&&(s=s[r])&&(i=n[r]=rr(s))}if(!i||!i(e,t,r)){i=e,r=t,s=i.j,oe(i);var o=i;if(!o.ca){if(i=o.h.h-s,o.h.h=s,o=o.h,i==0)i=we();else{if(s=rn(o,i),o.S&&o.m)i=o.i.subarray(s,s+i);else{o=o.i;var u=s;i=s+i,i=u===i?Gt():re?o.slice(u,i):new Uint8Array(o.subarray(u,i))}i=i.length==0?we():new Bt(i,St)}(s=r.R)?s.push(i):r.R=[i]}}}return t}function Rn(t,e,n){for(var r=n.length,i=r%2==1,s=i?1:0;s<r;s+=2)(0,n[s+1])(e,t,n[s]);wn(t,e,i?n[0]:void 0)}function Vt(t,e){return{U:t,W:e}}var yt=Vt(function(t,e,n){if(t.i!==5)return!1;t=t.h;var r=t.i,i=t.h,s=r[i],o=r[i+1],u=r[i+2];return r=r[i+3],jt(t,t.h+4),o=(s<<0|o<<8|u<<16|r<<24)>>>0,t=2*(o>>31)+1,s=o>>>23&255,o&=8388607,wt(e,n,s==255?o?NaN:1/0*t:s==0?t*Math.pow(2,-149)*o:t*Math.pow(2,s-150)*(o+Math.pow(2,23))),!0},function(t,e,n){if(e=je(e,n),e!=null){Ot(t.h,8*n+5),t=t.h;var r=+e;r===0?0<1/r?K=tt=0:(tt=0,K=2147483648):isNaN(r)?(tt=0,K=2147483647):(r=(n=0>r?-2147483648:0)?-r:r,34028234663852886e22<r?(tt=0,K=(n|2139095040)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),tt=0,K=(n|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),r=Math.round(8388608*r),16777216<=r&&++e,tt=0,K=(n|e+127<<23|r&8388607)>>>0)),n=K,t.h.push(n>>>0&255),t.h.push(n>>>8&255),t.h.push(n>>>16&255),t.h.push(n>>>24&255)}}),hr=Vt(function(t,e,n){if(t.i!==0)return!1;var r=t.h,i=0,s=t=0,o=r.i,u=r.h;do{var a=o[u++];i|=(a&127)<<s,s+=7}while(32>s&&a&128);for(32<s&&(t|=(a&127)>>4),s=3;32>s&&a&128;s+=7)a=o[u++],t|=(a&127)<<s;if(jt(r,u),128>a)r=i>>>0,a=t>>>0,(t=a&2147483648)&&(r=~r+1>>>0,a=~a>>>0,r==0&&(a=a+1>>>0)),r=4294967296*a+(r>>>0);else throw ge();return wt(e,n,t?-r:r),!0},function(t,e,n){e=vt(e,n),e!=null&&(typeof e=="string"&&Xe(e),e!=null&&(Ot(t.h,8*n),typeof e=="number"?(t=t.h,Ke(e),sn(t,K,tt)):(n=Xe(e),sn(t.h,n.i,n.h))))}),pr=Vt(function(t,e,n){return t.i!==0?!1:(wt(e,n,zt(t.h)),!0)},function(t,e,n){if(e=vt(e,n),e!=null&&e!=null)if(Ot(t.h,8*n),t=t.h,n=e,0<=n)Ot(t,n);else{for(e=0;9>e;e++)t.h.push(n&127|128),n>>=7;t.h.push(1)}}),jn=Vt(function(t,e,n){if(t.i!==2)return!1;var r=zt(t.h)>>>0;t=t.h;var i=rn(t,r);if(t=t.i,Xn){var s=t,o;(o=me)||(o=me=new TextDecoder("utf-8",{fatal:!0})),t=i+r,s=i===0&&t===s.length?s:s.subarray(i,t);try{var u=o.decode(s)}catch(x){if(ie===void 0){try{o.decode(new Uint8Array([128]))}catch{}try{o.decode(new Uint8Array([97])),ie=!0}catch{ie=!1}}throw!ie&&(me=void 0),x}}else{u=i,r=u+r,i=[];for(var a=null,h,v;u<r;)h=t[u++],128>h?i.push(h):224>h?u>=r?Rt():(v=t[u++],194>h||(v&192)!==128?(u--,Rt()):i.push((h&31)<<6|v&63)):240>h?u>=r-1?Rt():(v=t[u++],(v&192)!==128||h===224&&160>v||h===237&&160<=v||((s=t[u++])&192)!==128?(u--,Rt()):i.push((h&15)<<12|(v&63)<<6|s&63)):244>=h?u>=r-2?Rt():(v=t[u++],(v&192)!==128||(h<<28)+(v-144)>>30||((s=t[u++])&192)!==128||((o=t[u++])&192)!==128?(u--,Rt()):(h=(h&7)<<18|(v&63)<<12|(s&63)<<6|o&63,h-=65536,i.push((h>>10&1023)+55296,(h&1023)+56320))):Rt(),8192<=i.length&&(a=Qe(a,i),i.length=0);u=Qe(a,i)}return wt(e,n,u),!0},function(t,e,n){if(e=vt(e,n),e!=null){var r=!1;if(r=r===void 0?!1:r,Vn){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(e))throw Error("Found an unpaired surrogate");e=(Je||(Je=new TextEncoder)).encode(e)}else{for(var i=0,s=new Uint8Array(3*e.length),o=0;o<e.length;o++){var u=e.charCodeAt(o);if(128>u)s[i++]=u;else{if(2048>u)s[i++]=u>>6|192;else{if(55296<=u&&57343>=u){if(56319>=u&&o<e.length){var a=e.charCodeAt(++o);if(56320<=a&&57343>=a){u=1024*(u-55296)+a-56320+65536,s[i++]=u>>18|240,s[i++]=u>>12&63|128,s[i++]=u>>6&63|128,s[i++]=u&63|128;continue}else o--}if(r)throw Error("Found an unpaired surrogate");u=65533}s[i++]=u>>12|224,s[i++]=u>>6&63|128}s[i++]=u&63|128}}e=i===s.length?s:s.subarray(0,i)}Ot(t.h,8*n+2),Ot(t.h,e.length),kt(t,t.h.end()),kt(t,e)}}),On=Vt(function(t,e,n,r,i){if(t.i!==2)return!1;e=hn(e,n,r),n=t.h.j,r=zt(t.h)>>>0;var s=t.h.h+r,o=s-n;if(0>=o&&(t.h.j=s,i(e,t,void 0,void 0,void 0),o=s-t.h.h),o)throw Error("Message parsing ended unexpectedly. Expected to read "+(r+" bytes, instead read "+(r-o)+" bytes, either the data ended unexpectedly or the message misreported its own length"));return t.h.h=s,t.h.j=n,!0},function(t,e,n,r,i){if(e=Oe(e,r,n),e!=null)for(r=0;r<e.length;r++){var s=t;Ot(s.h,8*n+2);var o=s.h.end();kt(s,o),o.push(s.i),s=o,i(e[r],t),o=t;var u=s.pop();for(u=o.i+o.h.length()-u;127<u;)s.push(u&127|128),u>>>=7,o.i++;s.push(u),o.i++}});function Ne(t){return function(e,n){t:{if(se.length){var r=se.pop();r.setOptions(n),be(r.h,e,n),e=r}else e=new _e(e,n);try{var i=Ie(t),s=Sn(new i.P,e,i);break t}finally{i=e.h,i.i=null,i.m=!1,i.l=0,i.j=0,i.h=0,i.S=!1,e.l=-1,e.i=-1,100>se.length&&se.push(e)}s=void 0}return s}}function ke(t){return function(){var e=new Zn;Rn(this,e,Le(t)),kt(e,e.h.end());for(var n=new Uint8Array(e.i),r=e.j,i=r.length,s=0,o=0;o<i;o++){var u=r[o];n.set(u,s),s+=u.length}return e.j=[n],n}}function Pt(t){ut.call(this,t)}nt(Pt,ut);var Fn=[Pt,1,pr,2,yt,3,jn,4,jn];Pt.prototype.l=ke(Fn);function Pe(t){ut.call(this,t,-1,dr)}nt(Pe,ut),Pe.prototype.addClassification=function(t,e){return hn(this,1,Pt,t,e),this};var dr=[1],vr=Ne([Pe,1,On,Fn]);function $t(t){ut.call(this,t)}nt($t,ut);var Ln=[$t,1,yt,2,yt,3,yt,4,yt,5,yt];$t.prototype.l=ke(Ln);function In(t){ut.call(this,t,-1,yr)}nt(In,ut);var yr=[1],gr=Ne([In,1,On,Ln]);function pe(t){ut.call(this,t)}nt(pe,ut);var Nn=[pe,1,yt,2,yt,3,yt,4,yt,5,yt,6,hr],mr=Ne(Nn);pe.prototype.l=ke(Nn);function kn(t,e,n){if(n=t.createShader(n===0?t.VERTEX_SHADER:t.FRAGMENT_SHADER),t.shaderSource(n,e),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw Error(`Could not compile WebGL shader.
`+t.getShaderInfoLog(n));return n}function wr(t){return Oe(t,Pt,1).map(function(e){var n=vt(e,1);return{index:n??0,qa:Et(e,2),label:vt(e,3)!=null?ae(vt(e,3),""):void 0,displayName:vt(e,4)!=null?ae(vt(e,4),""):void 0}})}function br(t){return{x:Et(t,1),y:Et(t,2),z:Et(t,3),visibility:je(t,4)!=null?Et(t,4):void 0}}function He(t){return Oe(gr(t),$t,1).map(br)}function Ce(t,e){this.i=t,this.h=e,this.m=0}function Pn(t,e,n){return Er(t,e),typeof t.h.canvas.transferToImageBitmap=="function"?Promise.resolve(t.h.canvas.transferToImageBitmap()):n?Promise.resolve(t.h.canvas):typeof createImageBitmap=="function"?createImageBitmap(t.h.canvas):(t.j===void 0&&(t.j=document.createElement("canvas")),new Promise(function(r){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),r(t.j)}))}function Er(t,e){var n=t.h;if(t.s===void 0){var r=kn(n,`
attribute vec2 aVertex;
attribute vec2 aTex;
varying vec2 vTex;
void main(void) {
gl_Position = vec4(aVertex, 0.0, 1.0);
vTex = aTex;
}`,0),i=kn(n,`
precision mediump float;
varying vec2 vTex;
uniform sampler2D sampler0;
void main(){
gl_FragColor = texture2D(sampler0, vTex);
}`,1),s=n.createProgram();if(n.attachShader(s,r),n.attachShader(s,i),n.linkProgram(s),!n.getProgramParameter(s,n.LINK_STATUS))throw Error(`Could not compile WebGL program.
`+n.getProgramInfoLog(s));r=t.s=s,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),t.l={O:n.getAttribLocation(r,"aVertex"),N:n.getAttribLocation(r,"aTex"),ya:i},t.v=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,t.v),n.enableVertexAttribArray(t.l.O),n.vertexAttribPointer(t.l.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),t.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,t.u),n.enableVertexAttribArray(t.l.N),n.vertexAttribPointer(t.l.N,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(i,0)}r=t.l,n.useProgram(t.s),n.canvas.width=e.width,n.canvas.height=e.height,n.viewport(0,0,e.width,e.height),n.activeTexture(n.TEXTURE0),t.i.bindTexture2d(e.glName),n.enableVertexAttribArray(r.O),n.bindBuffer(n.ARRAY_BUFFER,t.v),n.vertexAttribPointer(r.O,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.N),n.bindBuffer(n.ARRAY_BUFFER,t.u),n.vertexAttribPointer(r.N,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.O),n.disableVertexAttribArray(r.N),n.bindBuffer(n.ARRAY_BUFFER,null),t.i.bindTexture2d(0)}function _r(t){this.h=t}var Ar=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 xr(t,e){return e+t}function Hn(t,e){window[t]=e}function Tr(t){var e=document.createElement("script");return e.setAttribute("src",t),e.setAttribute("crossorigin","anonymous"),new Promise(function(n){e.addEventListener("load",function(){n()},!1),e.addEventListener("error",function(){n()},!1),document.body.appendChild(e)})}function Sr(){return f(function(t){switch(t.h){case 1:return t.s=2,I(t,WebAssembly.instantiate(Ar),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)}})}function Ue(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||xr,typeof window=="object")var e=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if(typeof location<"u")e=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.ha=e,t.options){e=S(Object.keys(t.options));for(var n=e.next();!n.done;n=e.next()){n=n.value;var r=t.options[n].default;r!==void 0&&(this.l[n]=typeof r=="function"?r():r)}}}c=Ue.prototype,c.close=function(){return this.j&&this.j.delete(),Promise.resolve()};function Rr(t){var e,n,r,i,s,o,u,a,h,v,x;return f(function(w){switch(w.h){case 1:return t.ga?(e=t.h.files===void 0?[]:typeof t.h.files=="function"?t.h.files(t.l):t.h.files,I(w,Sr(),2)):w.return();case 2:if(n=w.i,typeof window=="object")return Hn("createMediapipeSolutionsWasm",{locateFile:t.locateFile}),Hn("createMediapipeSolutionsPackedAssets",{locateFile:t.locateFile}),o=e.filter(function(y){return y.data!==void 0}),u=e.filter(function(y){return y.data===void 0}),a=Promise.all(o.map(function(y){var T=de(t,y.url);if(y.path!==void 0){var L=y.path;T=T.then(function(M){return t.overrideFile(L,M),Promise.resolve(M)})}return T})),h=Promise.all(u.map(function(y){return y.simd===void 0||y.simd&&n||!y.simd&&!n?Tr(t.locateFile(y.url,t.ha)):Promise.resolve()})).then(function(){var y,T,L;return f(function(M){if(M.h==1)return y=window.createMediapipeSolutionsWasm,T=window.createMediapipeSolutionsPackedAssets,L=t,I(M,y(T),2);L.i=M.i,M.h=0})}),v=function(){return f(function(y){return t.h.graph&&t.h.graph.url?y=I(y,de(t,t.h.graph.url),0):(y.h=0,y=void 0),y})}(),I(w,Promise.all([h,a,v]),7);if(typeof importScripts!="function")throw Error("solutions can only be loaded on a web page or in a web worker");return r=e.filter(function(y){return y.simd===void 0||y.simd&&n||!y.simd&&!n}).map(function(y){return t.locateFile(y.url,t.ha)}),importScripts.apply(null,Q(r)),i=t,I(w,createMediapipeSolutionsWasm(Module),6);case 6:i.i=w.i,t.m=new OffscreenCanvas(1,1),t.i.canvas=t.m,s=t.i.GL.createContext(t.m,{antialias:!1,alpha:!1,va:typeof WebGL2RenderingContext<"u"?2:1}),t.i.GL.makeContextCurrent(s),w.h=4;break;case 7:if(t.m=document.createElement("canvas"),x=t.m.getContext("webgl2",{}),!x&&(x=t.m.getContext("webgl",{}),!x))return alert("Failed to create WebGL canvas context when passing video frame."),w.return();t.K=x,t.i.canvas=t.m,t.i.createContext(t.m,!0,!0,{});case 4:t.j=new t.i.SolutionWasm,t.ga=!1,w.h=0}})}function jr(t){var e,n,r,i,s,o,u,a;return f(function(h){if(h.h==1){if(t.h.graph&&t.h.graph.url&&t.fa===t.h.graph.url)return h.return();if(t.u=!0,!t.h.graph||!t.h.graph.url){h.h=2;return}return t.fa=t.h.graph.url,I(h,de(t,t.h.graph.url),3)}for(h.h!=2&&(e=h.i,t.j.loadGraph(e)),n=S(Object.keys(t.D)),r=n.next();!r.done;r=n.next())i=r.value,t.j.overrideFile(i,t.D[i]);if(t.D={},t.h.listeners)for(s=S(t.h.listeners),o=s.next();!o.done;o=s.next())u=o.value,Ir(t,u);a=t.l,t.l={},t.setOptions(a),h.h=0})}c.reset=function(){var t=this;return f(function(e){t.j&&(t.j.reset(),t.s={},t.v={}),e.h=0})},c.setOptions=function(t,e){var n=this;if(e=e||this.h.options){for(var r=[],i=[],s={},o=S(Object.keys(t)),u=o.next();!u.done;s={X:s.X,Y:s.Y},u=o.next())if(u=u.value,!(u in this.l&&this.l[u]===t[u])){this.l[u]=t[u];var a=e[u];a!==void 0&&(a.onChange&&(s.X=a.onChange,s.Y=t[u],r.push(function(h){return function(){var v;return f(function(x){if(x.h==1)return I(x,h.X(h.Y),2);v=x.i,v===!0&&(n.u=!0),x.h=0})}}(s))),a.graphOptionXref&&(u=Object.assign({},{calculatorName:"",calculatorIndex:0},a.graphOptionXref,{valueNumber:a.type===1?t[u]:0,valueBoolean:a.type===0?t[u]:!1,valueString:a.type===2?t[u]:""}),i.push(u)))}(r.length!==0||i.length!==0)&&(this.u=!0,this.H=(this.H===void 0?[]:this.H).concat(i),this.F=(this.F===void 0?[]:this.F).concat(r))}};function Or(t){var e,n,r,i,s,o,u;return f(function(a){switch(a.h){case 1:if(!t.u)return a.return();if(!t.F){a.h=2;break}e=S(t.F),n=e.next();case 3:if(n.done){a.h=5;break}return r=n.value,I(a,r(),4);case 4:n=e.next(),a.h=3;break;case 5:t.F=void 0;case 2:if(t.H){for(i=new t.i.GraphOptionChangeRequestList,s=S(t.H),o=s.next();!o.done;o=s.next())u=o.value,i.push_back(u);t.j.changeOptions(i),i.delete(),t.H=void 0}t.u=!1,a.h=0}})}c.initialize=function(){var t=this;return f(function(e){return e.h==1?I(e,Rr(t),2):e.h!=3?I(e,jr(t),3):I(e,Or(t),0)})};function de(t,e){var n,r;return f(function(i){return e in t.L?i.return(t.L[e]):(n=t.locateFile(e,""),r=fetch(n).then(function(s){return s.arrayBuffer()}),t.L[e]=r,i.return(r))})}c.overrideFile=function(t,e){this.j?this.j.overrideFile(t,e):this.D[t]=e},c.clearOverriddenFiles=function(){this.D={},this.j&&this.j.clearOverriddenFiles()},c.send=function(t,e){var n=this,r,i,s,o,u,a,h,v,x;return f(function(w){switch(w.h){case 1:return n.h.inputs?(r=1e3*(e??performance.now()),I(w,n.I,2)):w.return();case 2:return I(w,n.initialize(),3);case 3:for(i=new n.i.PacketDataList,s=S(Object.keys(t)),o=s.next();!o.done;o=s.next())if(u=o.value,a=n.h.inputs[u]){t:{var y=t[u];switch(a.type){case"video":var T=n.s[a.stream];if(T||(T=new Ce(n.i,n.K),n.s[a.stream]=T),T.m===0&&(T.m=T.i.createTexture()),typeof HTMLVideoElement<"u"&&y instanceof HTMLVideoElement)var L=y.videoWidth,M=y.videoHeight;else typeof HTMLImageElement<"u"&&y instanceof HTMLImageElement?(L=y.naturalWidth,M=y.naturalHeight):(L=y.width,M=y.height);M={glName:T.m,width:L,height:M},L=T.h,L.canvas.width=M.width,L.canvas.height=M.height,L.activeTexture(L.TEXTURE0),T.i.bindTexture2d(T.m),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,L.RGBA,L.UNSIGNED_BYTE,y),T.i.bindTexture2d(0),T=M;break t;case"detections":for(T=n.s[a.stream],T||(T=new _r(n.i),n.s[a.stream]=T),T.data||(T.data=new T.h.DetectionListData),T.data.reset(y.length),M=0;M<y.length;++M){L=y[M];var C=T.data,ot=C.setBoundingBox,dt=M,lt=L.la,N=new pe;if(bt(N,1,lt.sa),bt(N,2,lt.ta),bt(N,3,lt.height),bt(N,4,lt.width),bt(N,5,lt.rotation),wt(N,6,lt.pa),lt=N.l(),ot.call(C,dt,lt),L.ea)for(C=0;C<L.ea.length;++C){N=L.ea[C],ot=T.data,dt=ot.addNormalizedLandmark,lt=M,N=Object.assign({},N,{visibility:N.visibility?N.visibility:0});var st=new $t;bt(st,1,N.x),bt(st,2,N.y),bt(st,3,N.z),N.visibility&&bt(st,4,N.visibility),N=st.l(),dt.call(ot,lt,N)}if(L.ba)for(C=0;C<L.ba.length;++C)ot=T.data,dt=ot.addClassification,lt=M,N=L.ba[C],st=new Pt,bt(st,2,N.qa),N.index&&wt(st,1,N.index),N.label&&wt(st,3,N.label),N.displayName&&wt(st,4,N.displayName),N=st.l(),dt.call(ot,lt,N)}T=T.data;break t;default:T={}}}switch(h=T,v=a.stream,a.type){case"video":i.pushTexture2d(Object.assign({},h,{stream:v,timestamp:r}));break;case"detections":x=h,x.stream=v,x.timestamp=r,i.pushDetectionList(x);break;default:throw Error("Unknown input config type: '"+a.type+"'")}}return n.j.send(i),I(w,n.I,4);case 4:i.delete(),w.h=0}})};function Fr(t,e,n){var r,i,s,o,u,a,h,v,x,w,y,T,L,M;return f(function(C){switch(C.h){case 1:if(!n)return C.return(e);for(r={},i=0,s=S(Object.keys(n)),o=s.next();!o.done;o=s.next())u=o.value,a=n[u],typeof a!="string"&&a.type==="texture"&&e[a.stream]!==void 0&&++i;1<i&&(t.M=!1),h=S(Object.keys(n)),o=h.next();case 2:if(o.done){C.h=4;break}if(v=o.value,x=n[v],typeof x=="string")return L=r,M=v,I(C,Lr(t,v,e[x]),14);if(w=e[x.stream],x.type==="detection_list"){if(w){for(var ot=w.getRectList(),dt=w.getLandmarksList(),lt=w.getClassificationsList(),N=[],st=0;st<ot.size();++st){var Tt=mr(ot.get(st)),Nr=Et(Tt,1),kr=Et(Tt,2),Pr=Et(Tt,3),Hr=Et(Tt,4),Cr=Et(Tt,5,0),ve=void 0;ve=ve===void 0?0:ve,Tt={la:{sa:Nr,ta:kr,height:Pr,width:Hr,rotation:Cr,pa:ae(vt(Tt,6),ve)},ea:He(dt.get(st)),ba:wr(vr(lt.get(st)))},N.push(Tt)}ot=N}else ot=[];r[v]=ot,C.h=7;break}if(x.type==="proto_list"){if(w){for(ot=Array(w.size()),dt=0;dt<w.size();dt++)ot[dt]=w.get(dt);w.delete()}else ot=[];r[v]=ot,C.h=7;break}if(w===void 0){C.h=3;break}if(x.type==="float_list"){r[v]=w,C.h=7;break}if(x.type==="proto"){r[v]=w,C.h=7;break}if(x.type!=="texture")throw Error("Unknown output config type: '"+x.type+"'");return y=t.v[v],y||(y=new Ce(t.i,t.K),t.v[v]=y),I(C,Pn(y,w,t.M),13);case 13:T=C.i,r[v]=T;case 7:x.transform&&r[v]&&(r[v]=x.transform(r[v])),C.h=3;break;case 14:L[M]=C.i;case 3:o=h.next(),C.h=2;break;case 4:return C.return(r)}})}function Lr(t,e,n){var r;return f(function(i){return typeof n=="number"||n instanceof Uint8Array||n instanceof t.i.Uint8BlobList?i.return(n):n instanceof t.i.Texture2dDataOut?(r=t.v[e],r||(r=new Ce(t.i,t.K),t.v[e]=r),i.return(Pn(r,n,t.M))):i.return(void 0)})}function Ir(t,e){for(var n=e.name||"$",r=[].concat(Q(e.wants)),i=new t.i.StringList,s=S(e.wants),o=s.next();!o.done;o=s.next())i.push_back(o.value);s=t.i.PacketListener.implement({onResults:function(u){for(var a={},h=0;h<e.wants.length;++h)a[r[h]]=u.get(h);var v=t.listeners[n];v&&(t.I=Fr(t,a,e.outs).then(function(x){x=v(x);for(var w=0;w<e.wants.length;++w){var y=a[r[w]];typeof y=="object"&&y.hasOwnProperty&&y.hasOwnProperty("delete")&&y.delete()}x&&(t.I=x)}))}}),t.j.attachMultiListener(i,s),i.delete()}c.onResults=function(t,e){this.listeners[e||"$"]=t},m("Solution",Ue),m("OptionType",{BOOL:0,NUMBER:1,ua:2,0:"BOOL",1:"NUMBER",2:"STRING"});function Cn(t){switch(t===void 0&&(t=0),t){case 1:return"pose_landmark_full.tflite";case 2:return"pose_landmark_heavy.tflite";default:return"pose_landmark_lite.tflite"}}function Un(t){var e=this;t=t||{},this.h=new Ue({locateFile:t.locateFile,files:function(n){return[{url:"pose_solution_packed_assets_loader.js"},{simd:!1,url:"pose_solution_wasm_bin.js"},{simd:!0,url:"pose_solution_simd_wasm_bin.js"},{data:!0,url:Cn(n.modelComplexity)}]},graph:{url:"pose_web.binarypb"},listeners:[{wants:["pose_landmarks","world_landmarks","segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:He},poseWorldLandmarks:{type:"proto",stream:"world_landmarks",transform:He},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:typeof window!="object"||window.navigator===void 0?!1:"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"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(n){var r,i,s;return f(function(o){return o.h==1?(r=Cn(n),i="third_party/mediapipe/modules/pose_landmark/"+r,I(o,de(e.h,r),2)):(s=o.i,e.h.overrideFile(i,s),o.return(!0))})}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}}}})}c=Un.prototype,c.reset=function(){this.h.reset()},c.close=function(){return this.h.close(),Promise.resolve()},c.onResults=function(t){this.h.onResults(t)},c.initialize=function(){var t=this;return f(function(e){return I(e,t.h.initialize(),0)})},c.send=function(t,e){var n=this;return f(function(r){return I(r,n.h.send(t,e),0)})},c.setOptions=function(t){this.h.setOptions(t)},m("Pose",Un),m("POSE_CONNECTIONS",[[0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]]),m("POSE_LANDMARKS",{NOSE:0,LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,LEFT_EAR:7,RIGHT_EAR:8,LEFT_RIGHT:9,RIGHT_LEFT:10,LEFT_SHOULDER:11,RIGHT_SHOULDER:12,LEFT_ELBOW:13,RIGHT_ELBOW:14,LEFT_WRIST:15,RIGHT_WRIST:16,LEFT_PINKY:17,RIGHT_PINKY:18,LEFT_INDEX:19,RIGHT_INDEX:20,LEFT_THUMB:21,RIGHT_THUMB:22,LEFT_HIP:23,RIGHT_HIP:24,LEFT_KNEE:25,RIGHT_KNEE:26,LEFT_ANKLE:27,RIGHT_ANKLE:28,LEFT_HEEL:29,RIGHT_HEEL:30,LEFT_FOOT_INDEX:31,RIGHT_FOOT_INDEX:32}),m("POSE_LANDMARKS_LEFT",{LEFT_EYE_INNER:1,LEFT_EYE:2,LEFT_EYE_OUTER:3,LEFT_EAR:7,LEFT_RIGHT:9,LEFT_SHOULDER:11,LEFT_ELBOW:13,LEFT_WRIST:15,LEFT_PINKY:17,LEFT_INDEX:19,LEFT_THUMB:21,LEFT_HIP:23,LEFT_KNEE:25,LEFT_ANKLE:27,LEFT_HEEL:29,LEFT_FOOT_INDEX:31}),m("POSE_LANDMARKS_RIGHT",{RIGHT_EYE_INNER:4,RIGHT_EYE:5,RIGHT_EYE_OUTER:6,RIGHT_EAR:8,RIGHT_LEFT:10,RIGHT_SHOULDER:12,RIGHT_ELBOW:14,RIGHT_WRIST:16,RIGHT_PINKY:18,RIGHT_INDEX:20,RIGHT_THUMB:22,RIGHT_HIP:24,RIGHT_KNEE:26,RIGHT_ANKLE:28,RIGHT_HEEL:30,RIGHT_FOOT_INDEX:32}),m("POSE_LANDMARKS_NEUTRAL",{NOSE:0}),m("VERSION","0.5.1675469404")}).call(Mt);var ii={};(function(){function c(l){var f=0;return function(){return f<l.length?{done:!1,value:l[f++]}:{done:!0}}}var p=typeof Object.defineProperties=="function"?Object.defineProperty:function(l,f,A){return l==Array.prototype||l==Object.prototype||(l[f]=A.value),l};function g(l){l=[typeof globalThis=="object"&&globalThis,l,typeof window=="object"&&window,typeof self=="object"&&self,typeof Mt=="object"&&Mt];for(var f=0;f<l.length;++f){var A=l[f];if(A&&A.Math==Math)return A}throw Error("Cannot find global object")}var F=g(this);function _(l,f){if(f)t:{var A=F;l=l.split(".");for(var E=0;E<l.length-1;E++){var P=l[E];if(!(P in A))break t;A=A[P]}l=l[l.length-1],E=A[l],f=f(E),f!=E&&f!=null&&p(A,l,{configurable:!0,writable:!0,value:f})}}_("Symbol",function(l){function f(m){if(this instanceof f)throw new TypeError("Symbol is not a constructor");return new A(E+(m||"")+"_"+P++,m)}function A(m,d){this.g=m,p(this,"description",{configurable:!0,writable:!0,value:d})}if(l)return l;A.prototype.toString=function(){return this.g};var E="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",P=0;return f}),_("Symbol.iterator",function(l){if(l)return l;l=Symbol("Symbol.iterator");for(var f="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),A=0;A<f.length;A++){var E=F[f[A]];typeof E=="function"&&typeof E.prototype[l]!="function"&&p(E.prototype,l,{configurable:!0,writable:!0,value:function(){return R(c(this))}})}return l});function R(l){return l={next:l},l[Symbol.iterator]=function(){return this},l}function j(l){var f=typeof Symbol<"u"&&Symbol.iterator&&l[Symbol.iterator];return f?f.call(l):{next:c(l)}}function S(){this.i=!1,this.g=null,this.o=void 0,this.j=1,this.m=0,this.h=null}function Q(l){if(l.i)throw new TypeError("Generator is already running");l.i=!0}S.prototype.l=function(l){this.o=l};function k(l,f){l.h={F:f,G:!0},l.j=l.m}S.prototype.return=function(l){this.h={return:l},this.j=this.m};function U(l){this.g=new S,this.h=l}function D(l,f){Q(l.g);var A=l.g.g;return A?G(l,"return"in A?A.return:function(E){return{value:E,done:!0}},f,l.g.return):(l.g.return(f),q(l))}function G(l,f,A,E){try{var P=f.call(l.g.g,A);if(!(P instanceof Object))throw new TypeError("Iterator result "+P+" is not an object");if(!P.done)return l.g.i=!1,P;var m=P.value}catch(d){return l.g.g=null,k(l.g,d),q(l)}return l.g.g=null,E.call(l.g,m),q(l)}function q(l){for(;l.g.j;)try{var f=l.h(l.g);if(f)return l.g.i=!1,{value:f.value,done:!1}}catch(A){l.g.o=void 0,k(l.g,A)}if(l.g.i=!1,l.g.h){if(f=l.g.h,l.g.h=null,f.G)throw f.F;return{value:f.return,done:!0}}return{value:void 0,done:!0}}function W(l){this.next=function(f){return Q(l.g),l.g.g?f=G(l,l.g.g.next,f,l.g.l):(l.g.l(f),f=q(l)),f},this.throw=function(f){return Q(l.g),l.g.g?f=G(l,l.g.g.throw,f,l.g.l):(k(l.g,f),f=q(l)),f},this.return=function(f){return D(l,f)},this[Symbol.iterator]=function(){return this}}function Y(l){function f(E){return l.next(E)}function A(E){return l.throw(E)}return new Promise(function(E,P){function m(d){d.done?E(d.value):Promise.resolve(d.value).then(f,A).then(m,P)}m(l.next())})}_("Promise",function(l){function f(d){this.h=0,this.i=void 0,this.g=[],this.o=!1;var b=this.j();try{d(b.resolve,b.reject)}catch(O){b.reject(O)}}function A(){this.g=null}function E(d){return d instanceof f?d:new f(function(b){b(d)})}if(l)return l;A.prototype.h=function(d){if(this.g==null){this.g=[];var b=this;this.i(function(){b.l()})}this.g.push(d)};var P=F.setTimeout;A.prototype.i=function(d){P(d,0)},A.prototype.l=function(){for(;this.g&&this.g.length;){var d=this.g;this.g=[];for(var b=0;b<d.length;++b){var O=d[b];d[b]=null;try{O()}catch(H){this.j(H)}}}this.g=null},A.prototype.j=function(d){this.i(function(){throw d})},f.prototype.j=function(){function d(H){return function(it){O||(O=!0,H.call(b,it))}}var b=this,O=!1;return{resolve:d(this.A),reject:d(this.l)}},f.prototype.A=function(d){if(d===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(d instanceof f)this.C(d);else{t:switch(typeof d){case"object":var b=d!=null;break t;case"function":b=!0;break t;default:b=!1}b?this.v(d):this.m(d)}},f.prototype.v=function(d){var b=void 0;try{b=d.then}catch(O){this.l(O);return}typeof b=="function"?this.D(b,d):this.m(d)},f.prototype.l=function(d){this.u(2,d)},f.prototype.m=function(d){this.u(1,d)},f.prototype.u=function(d,b){if(this.h!=0)throw Error("Cannot settle("+d+", "+b+"): Promise already settled in state"+this.h);this.h=d,this.i=b,this.h===2&&this.B(),this.H()},f.prototype.B=function(){var d=this;P(function(){if(d.I()){var b=F.console;typeof b<"u"&&b.error(d.i)}},1)},f.prototype.I=function(){if(this.o)return!1;var d=F.CustomEvent,b=F.Event,O=F.dispatchEvent;return typeof O>"u"?!0:(typeof d=="function"?d=new d("unhandledrejection",{cancelable:!0}):typeof b=="function"?d=new b("unhandledrejection",{cancelable:!0}):(d=F.document.createEvent("CustomEvent"),d.initCustomEvent("unhandledrejection",!1,!0,d)),d.promise=this,d.reason=this.i,O(d))},f.prototype.H=function(){if(this.g!=null){for(var d=0;d<this.g.length;++d)m.h(this.g[d]);this.g=null}};var m=new A;return f.prototype.C=function(d){var b=this.j();d.s(b.resolve,b.reject)},f.prototype.D=function(d,b){var O=this.j();try{d.call(b,O.resolve,O.reject)}catch(H){O.reject(H)}},f.prototype.then=function(d,b){function O(z,Z){return typeof z=="function"?function(ht){try{H(z(ht))}catch(pt){it(pt)}}:Z}var H,it,At=new f(function(z,Z){H=z,it=Z});return this.s(O(d,H),O(b,it)),At},f.prototype.catch=function(d){return this.then(void 0,d)},f.prototype.s=function(d,b){function O(){switch(H.h){case 1:d(H.i);break;case 2:b(H.i);break;default:throw Error("Unexpected state: "+H.h)}}var H=this;this.g==null?m.h(O):this.g.push(O),this.o=!0},f.resolve=E,f.reject=function(d){return new f(function(b,O){O(d)})},f.race=function(d){return new f(function(b,O){for(var H=j(d),it=H.next();!it.done;it=H.next())E(it.value).s(b,O)})},f.all=function(d){var b=j(d),O=b.next();return O.done?E([]):new f(function(H,it){function At(ht){return function(pt){z[ht]=pt,Z--,Z==0&&H(z)}}var z=[],Z=0;do z.push(void 0),Z++,E(O.value).s(At(z.length-1),it),O=b.next();while(!O.done)})},f});var nt=typeof Object.assign=="function"?Object.assign:function(l,f){for(var A=1;A<arguments.length;A++){var E=arguments[A];if(E)for(var P in E)Object.prototype.hasOwnProperty.call(E,P)&&(l[P]=E[P])}return l};_("Object.assign",function(l){return l||nt});var $=this||self,ct={facingMode:"user",width:640,height:480};function J(l,f){this.video=l,this.i=0,this.h=Object.assign(Object.assign({},ct),f)}J.prototype.stop=function(){var l=this,f,A,E,P;return Y(new W(new U(function(m){if(l.g){for(f=l.g.getTracks(),A=j(f),E=A.next();!E.done;E=A.next())P=E.value,P.stop();l.g=void 0}m.j=0})))},J.prototype.start=function(){var l=this,f;return Y(new W(new U(function(A){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||alert("No navigator.mediaDevices.getUserMedia exists."),f=l.h,A.return(navigator.mediaDevices.getUserMedia({video:{facingMode:f.facingMode,width:f.width,height:f.height}}).then(function(E){ft(l,E)}).catch(function(E){var P="Failed to acquire camera feed: "+E;throw console.error(P),alert(P),E}))})))};function I(l){window.requestAnimationFrame(function(){_t(l)})}function ft(l,f){l.g=f,l.video.srcObject=f,l.video.onloadedmetadata=function(){l.video.play(),I(l)}}function _t(l){var f=null;l.video.paused||l.video.currentTime===l.i||(l.i=l.video.currentTime,f=l.h.onFrame()),f?f.then(function(){I(l)}):I(l)}var rt=["Camera"],X=$;rt[0]in X||typeof X.execScript>"u"||X.execScript("var "+rt[0]);for(var B;rt.length&&(B=rt.shift());)rt.length||J===void 0?X[B]&&X[B]!==Object.prototype[B]?X=X[B]:X=X[B]={}:X[B]=J}).call(Mt);function oi(c){Gr(c,"svelte-39b13y","canvas.svelte-39b13y{border-radius:0.5rem;--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.capture-btn.svelte-39b13y{z-index:10;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(248 250 252 / var(--tw-bg-opacity));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.25rem;padding-bottom:0.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(0 0 0 / var(--tw-text-opacity));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.capture-btn.svelte-39b13y:hover{--tw-bg-opacity:1;background-color:rgb(207 250 254 / var(--tw-bg-opacity))}.container.svelte-39b13y *{color:black !important}")}function si(c){let p,g,F,_,R,j,S,Q,k,U,D,G=c[3]?"🎤":"🎤❌",q,W,Y,nt=c[5][c[4]]+"",$,ct,J,I,ft,_t,rt,X;return{c(){p=gt("div"),g=gt("video"),F=Zt(),_=gt("canvas"),R=Zt(),j=gt("div"),S=gt("div"),Q=gt("button"),Q.textContent="Snap",k=Zt(),U=gt("div"),D=gt("button"),q=Qt(G),W=Zt(),Y=gt("button"),$=Qt(nt),ct=Qt("🕒"),I=Zt(),ft=gt("canvas"),_t=Qt(`
""`),at(g,"class","hidden"),g.muted=!0,g.playsInline=!0,at(_,"width","720px"),at(_,"height","720px"),at(_,"class","w-full svelte-39b13y"),at(Q,"class","capture-btn svelte-39b13y"),at(D,"class","capture-btn svelte-39b13y"),Y.disabled=J=c[4]>0,at(Y,"class","capture-btn svelte-39b13y"),at(U,"class","flex gap-2"),at(S,"class","flex flex-col gap-2"),at(ft,"width","720px"),at(ft,"height","720px"),at(ft,"class","w-32 svelte-39b13y"),at(j,"class","flex absolute bottom-1 left-1 items-end"),at(p,"class","relative container svelte-39b13y")},m(B,l){Dn(B,p,l),et(p,g),c[9](g),et(p,F),et(p,_),c[10](_),et(p,R),et(p,j),et(j,S),et(S,Q),et(S,k),et(S,U),et(U,D),et(D,q),et(U,W),et(U,Y),et(Y,$),et(Y,ct),et(j,I),et(j,ft),c[12](ft),Dn(B,_t,l),rt||(X=[Me(Q,"click",c[6]),Me(D,"click",c[8]),Me(Y,"click",c[11])],rt=!0)},p(B,[l]){l&8&&G!==(G=B[3]?"🎤":"🎤❌")&&Gn(q,G),l&16&&nt!==(nt=B[5][B[4]]+"")&&Gn($,nt),l&16&&J!==(J=B[4]>0)&&(Y.disabled=J)},i:te,o:te,d(B){B&&Ge(p),c[9](null),c[10](null),c[12](null),B&&Ge(_t),rt=!1,ne(X)}}}function ui(c,p,g){const F=ye.Pose||window.Pose,_=ii.Camera||window.Camera,R=ye.POSE_LANDMARKS||window.POSE_LANDMARKS,j=ye.POSE_LANDMARKS_LEFT||window.POSE_LANDMARKS_LEFT,S=ye.POSE_LANDMARKS_RIGHT||window.POSE_LANDMARKS_RIGHT,Q={0:"0️⃣",1:"1️⃣",2:"2️⃣",3:"3️⃣",4:"4️⃣",5:"5️⃣"};let k,U,D,G,q,W,Y,nt,$=null,ct=!1,J=null,I=0;const ft=[{start:[S.RIGHT_SHOULDER,j.LEFT_SHOULDER],end:S.RIGHT_SHOULDER,color:[255,0,0]},{start:S.RIGHT_SHOULDER,end:S.RIGHT_ELBOW,color:[255,85,0]},{start:S.RIGHT_ELBOW,end:S.RIGHT_WRIST,color:[255,170,0]},{start:[S.RIGHT_SHOULDER,j.LEFT_SHOULDER],end:j.LEFT_SHOULDER,color:[255,255,0]},{start:j.LEFT_SHOULDER,end:j.LEFT_ELBOW,color:[170,255,0]},{start:j.LEFT_ELBOW,end:j.LEFT_WRIST,color:[85,255,0]},{start:[S.RIGHT_SHOULDER,j.LEFT_SHOULDER],end:S.RIGHT_HIP,color:[0,255,0]},{start:S.RIGHT_HIP,end:S.RIGHT_KNEE,color:[0,255,85]},{start:S.RIGHT_KNEE,end:S.RIGHT_HEEL,color:[0,255,170]},{start:[S.RIGHT_SHOULDER,j.LEFT_SHOULDER],end:j.LEFT_HIP,color:[0,255,255]},{start:j.LEFT_HIP,end:j.LEFT_KNEE,color:[0,170,255]},{start:j.LEFT_KNEE,end:j.LEFT_HEEL,color:[0,85,255]},{start:[S.RIGHT_SHOULDER,j.LEFT_SHOULDER],end:R.NOSE,color:[0,0,255]},{start:R.NOSE,end:S.RIGHT_EYE,color:[85,0,255]},{start:S.RIGHT_EYE,end:S.RIGHT_EAR,color:[170,0,255]},{start:R.NOSE,end:j.LEFT_EYE,color:[255,0,255]},{start:j.LEFT_EYE,end:j.LEFT_EAR,color:[255,0,170]}];Yr(()=>{nt=document.getElementById("canvas-root"),nt._data||(nt._data={image:null}),D=U.getContext("2d"),G=document.createElement("canvas"),q=G.getContext("2d"),G.width=U.width,G.height=U.height;const m=new F({locateFile:b=>`https://cdn.jsdelivr.net/npm/@mediapipe/pose/${b}`});m.setOptions({modelComplexity:1,smoothLandmarks:!0,enableSegmentation:!1,smoothSegmentation:!1,minDetectionConfidence:.5,minTrackingConfidence:.5}),m.onResults(_t),new _(k,{onFrame:async()=>{await m.send({image:k})},width:720,height:720}).start()});function _t(m){m.poseLandmarks&&(D.drawImage(m.image,0,0,U.width,U.height),q.clearRect(0,0,G.width,G.height),X(q,m.poseLandmarks),D.drawImage(G,0,0,U.width,U.height))}function rt(){Y=W.getContext("2d"),Y.save(),Y.fillStyle="black",Y.fillRect(0,0,W.width,W.height),Y.drawImage(G,0,0,W.width,W.height),Y.restore(),nt._data.image=W.toDataURL()}function X(m,d,b){let O=4,H=Math.min(m.canvas.width,m.canvas.height);const it=m.canvas.width,At=m.canvas.height;O*=H/512,m.globalAlpha=.6;for(const z of ft){let Z={};if(Array.isArray(z.start)){const K=d[z.start[0]],tt=d[z.start[1]];Z.x=(K.x+tt.x)/2,Z.y=(K.y+tt.y)/2}else Z=d[z.start];const ht=Z,pt=d[z.end];if(ht==null||pt==null)continue;const[Lt,Dt]=[ht.x*it,ht.y*At],[It,Nt]=[pt.x*it,pt.y*At];let Gt=Math.atan2(Nt-Dt,It-Lt),St=((Lt-It)**2+(Dt-Nt)**2)**.5,re=new Path2D;re.ellipse((Lt+It)/2,(Dt+Nt)/2,St/2,O,Gt,0,2*Math.PI),m.fillStyle=`rgb(${z.color.join(",")})`,m.fill(re)}m.globalAlpha=1,m.font="12px serif";for(const z of ft){const Z=d[z.end];if(Z==null)continue;const[ht,pt]=[Z.x*it,Z.y*At];m.beginPath(),m.arc(ht,pt,O,0,2*Math.PI),m.fillStyle=`rgb(${z.color.join(",")})`,m.fill()}}function B(m=5){clearInterval(J),J=null,g(4,I=m),J=setInterval(()=>{g(4,I--,I),I<=0&&(clearInterval(J),J=null,g(4,I=0),rt())},1e3)}function l(){if(ct&&$){$.stop(),$=null,g(3,ct=!1),console.log("Voice snap disabled");return}try{const m=window.SpeechRecognition||window.webkitSpeechRecognition;$=new m,$.continuous=!0,$.interimResults=!0,$.lang="en-US",$.start(),g(3,ct=!0),console.log("Voice snap enabled"),$.onresult=d=>{for(let b=d.resultIndex;b<d.results.length;b++){const O=d.results[b][0].transcript.trim().toLowerCase();console.log(O),d.results[b].isFinal&&O.includes("snap")&&rt()}},$.onerror=d=>{console.error(`Speech recognition error: ${d}`)}}catch(m){console.error(`Speech recognition not supported: ${m}`)}}function f(m){qt[m?"unshift":"push"](()=>{k=m,g(0,k)})}function A(m){qt[m?"unshift":"push"](()=>{U=m,g(1,U)})}const E=()=>B();function P(m){qt[m?"unshift":"push"](()=>{W=m,g(2,W)})}return[k,U,W,ct,I,Q,rt,B,l,f,A,E,P]}class li extends ri{constructor(p){super(),ni(this,p,ui,si,Mr,{},oi)}}class ai extends HTMLElement{constructor(){super()}connectedCallback(){const p=this.attachShadow({mode:"open"}),g=document.createElement("style");g.appendChild(document.createTextNode(Ur)),p.appendChild(g),new li({target:p})}}customElements.define("pose-canvas",ai);