(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const v of document.querySelectorAll('link[rel="modulepreload"]'))_(v);new MutationObserver(v=>{for(const O of v)if(O.type==="childList")for(const S of O.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&_(S)}).observe(document,{childList:!0,subtree:!0});function p(v){const O={};return v.integrity&&(O.integrity=v.integrity),v.referrerPolicy&&(O.referrerPolicy=v.referrerPolicy),v.crossOrigin==="use-credentials"?O.credentials="include":v.crossOrigin==="anonymous"?O.credentials="omit":O.credentials="same-origin",O}function _(v){if(v.ep)return;v.ep=!0;const O=p(v);fetch(v.href,O)}})();const Bn=`*,: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%}.items-end{align-items:flex-end}.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 zt(){}function rn(i){return i()}function en(){return Object.create(null)}function ae(i){i.forEach(rn)}function on(i){return typeof i=="function"}function $n(i,u){return i!=i?u==u:i!==u||i&&typeof i=="object"||typeof i=="function"}function Vn(i){return Object.keys(i).length===0}function Et(i,u){i.appendChild(u)}function zn(i,u,p){const _=Wn(i);if(!_.getElementById(u)){const v=Mt("style");v.id=u,v.textContent=p,Yn(_,v)}}function Wn(i){if(!i)return document;const u=i.getRootNode?i.getRootNode():i.ownerDocument;return u&&u.host?u:i.ownerDocument}function Yn(i,u){return Et(i.head||i,u),u.sheet}function Xn(i,u,p){i.insertBefore(u,p||null)}function sn(i){i.parentNode&&i.parentNode.removeChild(i)}function Mt(i){return document.createElement(i)}function Hn(i){return document.createTextNode(i)}function ve(){return Hn(" ")}function Dn(i,u,p,_){return i.addEventListener(u,p,_),()=>i.removeEventListener(u,p,_)}function vt(i,u,p){p==null?i.removeAttribute(u):i.getAttribute(u)!==p&&i.setAttribute(u,p)}function Jn(i){return Array.from(i.childNodes)}let Qt;function Kt(i){Qt=i}function Kn(){if(!Qt)throw new Error("Function called outside component initialization");return Qt}function Zn(i){Kn().$$.on_mount.push(i)}const Vt=[],Zt=[];let Wt=[];const nn=[],Qn=Promise.resolve();let we=!1;function qn(){we||(we=!0,Qn.then(an))}function me(i){Wt.push(i)}const ye=new Set;let $t=0;function an(){if($t!==0)return;const i=Qt;do{try{for(;$ti.indexOf(_)===-1?u.push(_):p.push(_)),p.forEach(_=>_()),Wt=u}const n1=new Set;function r1(i,u){i&&i.i&&(n1.delete(i),i.i(u))}function i1(i,u,p,_){const{fragment:v,after_update:O}=i.$$;v&&v.m(u,p),_||me(()=>{const S=i.$$.on_mount.map(rn).filter(on);i.$$.on_destroy?i.$$.on_destroy.push(...S):ae(S),i.$$.on_mount=[]}),O.forEach(me)}function o1(i,u){const p=i.$$;p.fragment!==null&&(e1(p.after_update),ae(p.on_destroy),p.fragment&&p.fragment.d(u),p.on_destroy=p.fragment=null,p.ctx=[])}function s1(i,u){i.$$.dirty[0]===-1&&(Vt.push(i),qn(),i.$$.dirty.fill(0)),i.$$.dirty[u/31|0]|=1<{const at=q.length?q[0]:Q;return j.ctx&&v(j.ctx[K],j.ctx[K]=at)&&(!j.skip_bound&&j.bound[K]&&j.bound[K](at),U&&s1(i,K)),Q}):[],j.update(),U=!0,ae(j.before_update),j.fragment=_?_(j.ctx):!1,u.target){if(u.hydrate){const K=Jn(u.target);j.fragment&&j.fragment.l(K),K.forEach(sn)}else j.fragment&&j.fragment.c();u.intro&&r1(i.$$.fragment),i1(i,u.target,u.anchor,u.customElement),an()}Kt(L)}class u1{$destroy(){o1(this,1),this.$destroy=zt}$on(u,p){if(!on(p))return zt;const _=this.$$.callbacks[u]||(this.$$.callbacks[u]=[]);return _.push(p),()=>{const v=_.indexOf(p);v!==-1&&_.splice(v,1)}}$set(u){this.$$set&&!Vn(u)&&(this.$$.skip_bound=!0,this.$$set(u),this.$$.skip_bound=!1)}}var Yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l1={};(function(){var i;function u(t){var e=0;return function(){return e>>0)+"_",o=0;return e}),O("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"u"?!0:(typeof s=="function"?s=new s("unhandledrejection",{cancelable:!0}):typeof c=="function"?s=new c("unhandledrejection",{cancelable:!0}):(s=v.document.createEvent("CustomEvent"),s.initCustomEvent("unhandledrejection",!1,!0,s)),s.promise=this,s.reason=this.i,h(s))},e.prototype.A=function(){if(this.g!=null){for(var s=0;sn&&(n=Math.max(n+o,0));n"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 z(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}var rt,g=typeof TextDecoder<"u",m,$=typeof TextEncoder<"u";function J(t){if($)t=(m||(m=new TextEncoder)).encode(t);else{var e=void 0;e=e===void 0?!1:e;for(var n=0,r=new Uint8Array(3*t.length),o=0;ol)r[n++]=l;else{if(2048>l)r[n++]=l>>6|192;else{if(55296<=l&&57343>=l){if(56319>=l&&o=s){l=1024*(l-55296)+s-56320+65536,r[n++]=l>>18|240,r[n++]=l>>12&63|128,r[n++]=l>>6&63|128,r[n++]=l&63|128;continue}else o--}if(e)throw Error("Found an unpaired surrogate");l=65533}r[n++]=l>>12|224,r[n++]=l>>6&63|128}r[n++]=l&63|128}}t=r.subarray(0,n)}return t}var st={},wt=null;function ht(t,e){e===void 0&&(e=0),Pt(),e=st[e];for(var n=Array(Math.floor(t.length/3)),r=e[64]||"",o=0,l=0;o>2];s=e[(s&3)<<4|c>>4],c=e[(c&15)<<2|h>>6],h=e[h&63],n[l++]=d+s+c+h}switch(d=0,h=r,t.length-o){case 2:d=t[o+1],h=e[(d&15)<<2]||r;case 1:t=t[o],n[l]=e[t>>2]+e[(t&3)<<4|d>>4]+h+r}return n.join("")}function mt(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),o=0;return Xt(t,function(l){r[o++]=l}),r.subarray(0,o)}function Xt(t,e){function n(h){for(;r>4),s!=64&&(e(l<<4&240|s>>2),c!=64&&e(s<<6&192|c))}}function Pt(){if(!wt){wt={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));st[n]=r;for(var o=0;oo&&128<=e;o++)e=t.h[t.g++],n|=(e&127)<<7*o;if(128<=e&&(e=t.h[t.g++],n|=(e&127)<<28,r|=(e&127)>>4),128<=e)for(o=0;5>o&&128<=e;o++)e=t.h[t.g++],r|=(e&127)<<7*o+3;if(128>e)return t=n>>>0,e=r>>>0,(r=e&2147483648)&&(t=~t+1>>>0,e=~e>>>0,t==0&&(e=e+1>>>0)),t=4294967296*e+(t>>>0),r?-t:t;t.m=!0}Nt.prototype.i=function(){var t=this.h,e=t[this.g],n=e&127;return 128>e?(this.g+=1,n):(e=t[this.g+1],n|=(e&127)<<7,128>e?(this.g+=2,n):(e=t[this.g+2],n|=(e&127)<<14,128>e?(this.g+=3,n):(e=t[this.g+3],n|=(e&127)<<21,128>e?(this.g+=4,n):(e=t[this.g+4],n|=(e&15)<<28,128>e?(this.g+=5,n>>>0):(this.g+=5,128<=t[this.g++]&&128<=t[this.g++]&&128<=t[this.g++]&&128<=t[this.g++]&&this.g++,n)))))},Nt.prototype.o=function(){var t=this.h[this.g],e=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,n=(t<<0|e<<8|n<<16|r<<24)>>>0,t=2*(n>>31)+1,e=n>>>23&255,n&=8388607,e==255?n?NaN:1/0*t:e==0?t*Math.pow(2,-149)*n:t*Math.pow(2,e-150)*(n+Math.pow(2,23))};var Te=[];function te(){this.g=new Uint8Array(64),this.h=0}te.prototype.push=function(t){if(!(this.h+1>>=7;t.push(e)}function Ht(t){var e={},n=e.N===void 0?!1:e.N;this.o={v:e.v===void 0?!1:e.v},this.N=n,e=this.o,Te.length?(n=Te.pop(),e&&(n.v=e.v),t&&Se(n,t),t=n):t=new Nt(t,e),this.g=t,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}Ht.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};function _t(t){var e=t.g;if((e=e.g==e.j)||(e=t.j)||(e=t.g,e=e.m||0>e.g||e.g>e.j),e)return!1;t.m=t.g.g,e=t.g.i();var n=e&7;return n!=0&&n!=5&&n!=1&&n!=2&&n!=3&&n!=4?(t.j=!0,!1):(t.i=e,t.l=e>>>3,t.h=n,!0)}function It(t){switch(t.h){case 0:if(t.h!=0)It(t);else{for(t=t.g;t.h[t.g]&128;)t.g++;t.g++}break;case 1:t.h!=1?It(t):(t=t.g,t.g+=8);break;case 2:if(t.h!=2)It(t);else{var e=t.g.i();t=t.g,t.g+=e}break;case 5:t.h!=5?It(t):(t=t.g,t.g+=4);break;case 3:e=t.l;do{if(!_t(t)){t.j=!0;break}if(t.h==4){t.l!=e&&(t.j=!0);break}It(t)}while(1);break;default:t.j=!0}}function ee(t,e,n){var r=t.g.j,o=t.g.i(),l=t.g.g+o;if(t.g.j=l,n(e,t),n=l-t.g.g,n!==0)throw Error("Message parsing ended unexpectedly. Expected to read "+o+" bytes, instead read "+(o-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return t.g.g=l,t.g.j=r,e}function ct(t){return t.g.o()}function Re(t){var e=t.g.i();t=t.g;var n=t.g;t.g+=e,t=t.h;var r;if(g)(r=rt)||(r=rt=new TextDecoder("utf-8",{fatal:!1})),r=r.decode(t.subarray(n,n+e));else{e=n+e;for(var o=[],l=null,s,c,h;ns?o.push(s):224>s?n>=e?o.push(65533):(c=t[n++],194>s||(c&192)!==128?(n--,o.push(65533)):o.push((s&31)<<6|c&63)):240>s?n>=e-1?o.push(65533):(c=t[n++],(c&192)!==128||s===224&&160>c||s===237&&160<=c||((r=t[n++])&192)!==128?(n--,o.push(65533)):o.push((s&15)<<12|(c&63)<<6|r&63)):244>=s?n>=e-2?o.push(65533):(c=t[n++],(c&192)!==128||(s<<28)+(c-144)>>30||((r=t[n++])&192)!==128||((h=t[n++])&192)!==128?(n--,o.push(65533)):(s=(s&7)<<18|(c&63)<<12|(r&63)<<6|h&63,s-=65536,o.push((s>>10&1023)+55296,(s&1023)+56320))):o.push(65533),8192<=o.length&&(l=z(l,o),o.length=0);r=z(l,o)}return r}function Fe(t,e,n){var r=t.g.i();for(r=t.g.g+r;t.g.gr?1:0)?-r:r,r===0?0<1/r?bt=xt=0:(xt=0,bt=2147483648):isNaN(r)?(xt=0,bt=2147483647):34028234663852886e22>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),xt=0,bt=(n<<31|r)>>>0):(e=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-e),r=Math.round(8388608*r),16777216<=r&&++e,xt=0,bt=(n<<31|e+127<<23|r&8388607)>>>0),n=bt,t.push(n>>>0&255),t.push(n>>>8&255),t.push(n>>>16&255),t.push(n>>>24&255)}}var Me=typeof Uint8Array=="function";function Ce(t,e,n){if(t!=null)return typeof t=="object"?Me&&t instanceof Uint8Array?n(t):Pe(t,e,n):e(t)}function Pe(t,e,n){if(Array.isArray(t)){for(var r=Array(t.length),o=0;o=t.l?t.i?t.i[e]:void 0:t.h[e+t.j]}function re(t,e){var n=n===void 0?!1:n,r=X(t,e,n);return r==null&&(r=ne),r===ne&&(r=Dt([]),M(t,e,r,n)),r}function Ue(t){var e=re(t,3);if(t.m||(t.m={}),!t.m[3]){for(var n=0;n=t.l?(Ie(t),t.i[e]=n):t.h[e+t.j]=n}function Ge(t,e,n){if(n===-1)return null;if(t.g||(t.g={}),!t.g[n]){var r=X(t,n,!1);r&&(t.g[n]=new e(r))}return t.g[n]}function ie(t,e){t.g||(t.g={});var n=t.g[1];if(!n){var r=re(t,1);n=[];for(var o=0;oI,I=Math.abs(I);var B=I>>>0;for(I=Math.floor((I-B)/4294967296),I>>>=0,G&&(I=~I>>>0,B=(~B>>>0)+1,4294967295>>7|B<<25)>>>0,B>>>=7;F.push(G)}if(ce(A,N),Z=le(Z),W.call(et,ot,Z),P.O)for(et=0;etI;I++)G.push(B&127|128),B>>=7;G.push(1)}gt(F,2,X(N,2)),G=X(N,3),G!=null&&(G=J(G),jt(F.g,26),jt(F.g,G.length),Ut(F,F.g.end()),Ut(F,G)),G=X(N,4),G!=null&&(G=J(G),jt(F.g,34),jt(F.g,G.length),Ut(F,F.g.end()),Ut(F,G)),ce(N,F),A=le(A),ot.call(W,Z,A)}}w=w.data;break t;default:w={}}}switch(E=w,V=d.stream,d.type){case"video":l.pushTexture2d(Object.assign(Object.assign({},E),{stream:V,timestamp:o}));break;case"detections":R=E,R.stream=V,R.timestamp=o,l.pushDetectionList(R);break;default:throw Error("Unknown input config type: '"+d.type+"'")}}return r.i.send(l),Y(k,r.C,4);case 4:l.delete(),k.g=0}})})};function Cn(t,e,n){return it(t,function r(){var o,l,s,c,h,d,E=this,V,R,k,w,x,T,P,et;return H(r,function(W){switch(W.g){case 1:if(!n)return W.return(e);for(o={},l=0,s=C(Object.keys(n)),c=s.next();!c.done;c=s.next())h=c.value,d=n[h],typeof d!="string"&&d.type==="texture"&&e[d.stream]!==void 0&&++l;1>>0)+"_",z=0;return f}),v("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var f="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),b=0;b"u"?!0:(typeof g=="function"?g=new g("unhandledrejection",{cancelable:!0}):typeof m=="function"?g=new m("unhandledrejection",{cancelable:!0}):(g=_.document.createEvent("CustomEvent"),g.initCustomEvent("unhandledrejection",!1,!0,g)),g.promise=this,g.reason=this.i,$(g))},f.prototype.H=function(){if(this.g!=null){for(var g=0;g"u"||lt.execScript("var "+ft[0]);for(var H;ft.length&&(H=ft.shift());)ft.length||Y===void 0?lt[H]&<[H]!==Object.prototype[H]?lt=lt[H]:lt=lt[H]={}:lt[H]=Y}).call(Yt);const be=[33,7,163,144,145,153,154,155,133,173,157,157,158,159,160,161,246],_e=[263,249,390,373,374,380,381,382,362,398,384,384,385,386,387,388,466],Ee=[70,63,105,66,107],f1=[46,53,52,65,55],xe=[300,293,334,296,336],h1=[276,283,282,295,285],je=[78,191,80,81,82,13,312,311,310,415,308,324,318,402,317,14,87,178,88,95],ke=[61,185,40,39,37,0,267,269,270,409,291,375,321,405,314,17,84,181,91,146],un=[6,197,195,5,4],ln=[98,97,2,328,327],cn=[454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234],g1=[468],d1=[473],p1=[10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109];var se=(i=>(i.LANDMARKS="landmarks",i.POINTS="points",i.CRUCIBLEAI="crucibleAI",i))(se||{});const v1={landmarks:w1,points:m1,crucibleAI:y1};function y1(i,u){nt(i,u,_e,"rgb(180, 200, 10)",4,!1,!0,!0),nt(i,u,be,"rgb(10, 200, 180)",4,!1,!0,!0),nt(i,u,Ee,"rgb(10, 200, 180)",4,!1,!0,!1),nt(i,u,f1,"rgb(10, 200, 180)",4,!1,!0,!1),nt(i,u,xe,"rgb(180, 200, 10)",4,!1,!0,!1),nt(i,u,h1,"rgb(180, 200, 10)",4,!1,!0,!1),nt(i,u,ke,"rgb(10, 180, 10)",4,!1,!0,!0),nt(i,u,je,"rgb(10, 180, 10)",4,!1,!0,!0),nt(i,u,p1,"rgb(10, 200, 10)",4,!1,!0,!0),dt(i,u,g1,"rgb(250, 200, 10)",2,"square"),dt(i,u,d1,"rgb(10, 200, 250)",2,"square")}function w1(i,u){nt(i,u,_e,"magenta",4,!0,!1,!0),nt(i,u,be,"magenta",4,!0,!1,!0),nt(i,u,Ee,"yellow",4,!1,!0,!1),nt(i,u,xe,"yellow",4,!1,!0,!1),nt(i,u,ke,"cyan",4,!0,!1,!0),nt(i,u,je,"blue",4,!0,!1,!0),nt(i,u,un,"orange",4,!1,!0,!1),nt(i,u,ln,"orange",4,!1,!0,!1),nt(i,u,cn,"lime",4,!1,!0,!1)}function m1(i,u){dt(i,u,_e,"black",2),dt(i,u,be,"black",2),dt(i,u,Ee,"black",2),dt(i,u,xe,"black",2),dt(i,u,ke,"black",2),dt(i,u,je,"black",2),dt(i,u,un,"black",2),dt(i,u,ln,"black",2),dt(i,u,cn,"black",2)}function nt(i,u,p,_="lime",v=4,O=!1,S=!0,C=!1){i.save(),i.beginPath(),i.strokeStyle=_,i.fillStyle=_,i.lineJoin="round",i.lineWidth=v;for(const[L,j]of p.entries()){const U=u[j];L===0?i.moveTo(U.x*i.canvas.width,U.y*i.canvas.height):i.lineTo(U.x*i.canvas.width,U.y*i.canvas.height)}C&&i.closePath(),O&&i.fill(),S&&i.stroke(),i.restore()}function dt(i,u,p,_="black",v=2.5,O="circle",S=!0,C=!1){i.save(),i.fillStyle=_,i.lineJoin="round",i.strokeStyle=_;for(const[L,j]of p.entries()){const U=u[j];i.beginPath(),O==="circle"?(i.ellipse(U.x*i.canvas.width,U.y*i.canvas.height,v,v,0,0,2*Math.PI),i.closePath()):O==="square"&&i.rect(U.x*i.canvas.width-v,U.y*i.canvas.height-v,v*2,v*2),C&&i.stroke(),S&&i.fill()}i.restore()}function b1(i){zn(i,"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 _1(i){let u,p,_,v,O,S,C,L,j,U,K;return{c(){u=Mt("div"),p=Mt("video"),_=ve(),v=Mt("canvas"),O=ve(),S=Mt("div"),C=Mt("button"),C.textContent="Snap",L=ve(),j=Mt("canvas"),vt(p,"class","hidden"),p.muted=!0,p.playsInline=!0,vt(v,"width","712px"),vt(v,"height","712px"),vt(v,"class","w-full svelte-39b13y"),vt(C,"class","capture-btn svelte-39b13y"),vt(j,"width","712px"),vt(j,"height","712px"),vt(j,"class","w-32 svelte-39b13y"),vt(S,"class","flex absolute bottom-1 left-1 items-end"),vt(u,"class","relative container svelte-39b13y")},m(Q,q){Xn(Q,u,q),Et(u,p),i[4](p),Et(u,_),Et(u,v),i[5](v),Et(u,O),Et(u,S),Et(S,C),Et(S,L),Et(S,j),i[6](j),U||(K=Dn(C,"click",i[3]),U=!0)},p:zt,i:zt,o:zt,d(Q){Q&&sn(u),i[4](null),i[5](null),i[6](null),U=!1,K()}}}function E1(i,u,p){const _=l1.FaceMesh||window.FaceMesh,v=c1.Camera||window.Camera;let O,S,C,L,j,U,K,Q,q=se.LANDMARKS,at=5;Zn(()=>{if(Q=document.getElementById("canvas-root"),Q._data||(Q._data={image:null}),Q.dataset.mode){const yt=Q.dataset.mode;q=se[yt.toUpperCase()],at=parseInt(Q.dataset.maxNumFaces)||5}C=S.getContext("2d"),U=document.createElement("canvas"),K=U.getContext("2d"),U.width=S.width,U.height=S.height;const D=new _({locateFile:yt=>`https://cdn.jsdelivr.net/npm/@mediapipe/face_mesh/${yt}`});D.setOptions({maxNumFaces:at,refineLandmarks:!0,minDetectionConfidence:.5,minTrackingConfidence:.5}),D.onResults(ut),new v(O,{onFrame:async()=>{await D.send({image:O})},width:712,height:712}).start()});function ut(D){if(C.save(),C.clearRect(0,0,S.width,S.height),C.drawImage(D.image,0,0,S.width,S.height),K.clearRect(0,0,U.width,U.height),D.multiFaceLandmarks)for(const Ct of D.multiFaceLandmarks)v1[q](K,Ct);C.drawImage(U,0,0,S.width,S.height)}function At(){j=L.getContext("2d"),j.save(),j.fillStyle=q===se.POINTS?"white":"black",j.fillRect(0,0,L.width,L.height),j.drawImage(U,0,0,L.width,L.height),q==="points"&&(j.globalCompositeOperation="difference",j.fillStyle="white",j.fillRect(0,0,L.width,L.height),j.drawImage(U,0,0,L.width,L.height)),j.restore(),Q._data.image=L.toDataURL()}function Ot(D){Zt[D?"unshift":"push"](()=>{O=D,p(0,O)})}function St(D){Zt[D?"unshift":"push"](()=>{S=D,p(1,S)})}function Y(D){Zt[D?"unshift":"push"](()=>{L=D,p(2,L)})}return[O,S,L,At,Ot,St,Y]}class x1 extends u1{constructor(u){super(),a1(this,u,E1,_1,$n,{},b1)}}class j1 extends HTMLElement{constructor(){super()}connectedCallback(){const u=this.attachShadow({mode:"open"}),p=document.createElement("style");p.appendChild(document.createTextNode(Bn)),u.appendChild(p),new x1({target:u})}}customElements.define("face-canvas",j1);