(function(){var h=function(a,d){this.r=new RegExp(a,d.split("u").join(""))};h.__name__=!0;h.prototype={match:function(a){this.r.global&&(this.r.lastIndex=0);this.r.m=this.r.exec(a);this.r.s=a;return null!=this.r.m}};var a=function(){};a.__name__=!0;a.main=function(){window.addEventListener("DOMContentLoaded",function(){a.div=window.document.getElementById("webcam-test");a.div.style.background="black";a.userMediaErrorDisplay=window.document.getElementById("webcam-info");null==a.userMediaErrorDisplay&& (a.userMediaErrorDisplay=window.document.createElement("p"),a.userMediaErrorDisplay.id="webcam-info",a.userMediaErrorDisplay.style.font='12pt "Open Sans", sans-serif',a.userMediaErrorDisplay.style.textAlign="center",a.userMediaErrorDisplay.style.verticalAlign="middle",a.userMediaErrorDisplay.style.color="#eeeeee",a.div.appendChild(a.userMediaErrorDisplay));a.userMediaErrorDisplay.innerHTML="";a.userMediaErrorDisplay.style.display="none";a.fpsMeter=window.document.getElementById("fps-meter");null== a.fpsMeter&&(a.fpsMeter=window.document.createElement("p"),a.fpsMeter.id="fps-meter",a.fpsMeter.style.position="absolute",a.fpsMeter.style.font='2em "Open Sans", sans-serif',a.fpsMeter.style.color="#eeeeee",a.fpsMeter.style.textAlign="right",a.div.appendChild(a.fpsMeter));a.fpsMeter.innerHTML="";a.btnStart=window.document.getElementById("webcam-start");a.btnStart.style.width="100%";a.btnStart.style.height="100%";a.btnStart.style.position="absolute";a.btnStart.style.display="block";a.btnStart.addEventListener("click", function(){a.btnStart.style.display="none";a.userMediaErrorDisplay.style.display="block";navigator.mediaDevices.getUserMedia({audio:!1,video:{width:a.div.clientWidth,height:a.div.clientHeight}}).then(a.onGetUserMedia,a.onGetUserMediaFailed)});window.addEventListener("resize",a.updateSizes)})};a.onGetUserMedia=function(b){a.video=window.document.getElementById("webcam-video");null==a.video&&(a.video=window.document.createElement("video"),a.video.id="webcam-video");a.div.style.height=a.div.clientHeight+ "px";a.video.srcObject=b;a.video.width=a.div.clientWidth;a.video.height=a.div.clientHeight;a.video.onloadedmetadata=function(b){a.video.play();a.frameCount=function(){return a.video.presentedFrames?!0:a.video.mozPaintedFrames};null==a.frameCount()?(new h("Firefox/","")).match(window.navigator.userAgent)&&(b=window.document.createElement("p"),b.innerHTML="FPS readings might not be accurate.
Please try a different browser for accurate FPS readings",b.style.font='bold 12pt "Open Sans", sans-serif', b.style.width=a.video.width+"px",b.style.textAlign="center",b.style.padding="8px",b.style.position="absolute",b.style.top=a.video.height-64+"px",b.style.color="#ee9999",a.div.appendChild(b)):a.startTime=(new Date).getTime();window.requestAnimationFrame(a.updateFPSmeter)};a.lastFrameTime=(new Date).getTime();a.div.appendChild(a.video);a.fpsMeter.style.width=a.video.width-8+"px"};a.updateFPSmeter=function(b){var d=(new Date).getTime();null!=a.frameCount()?(b=d-a.startTime,b=1E3*a.frameCount()/b,a.smoothFps+= (b-a.smoothFps)/20,a.fpsMeter.innerHTML=a.getFpsText(a.smoothFps)):a.video.currentTime!=a.lastVideoTime&&(a.frameTime+=(d-a.lastFrameTime-a.frameTime)/20,b=1E3/a.frameTime,a.fpsMeter.innerHTML=a.getFpsText(b),a.lastFrameTime=d,a.lastVideoTime=a.video.currentTime);a.div.clientWidth";var c=typeof a;"function"==c&&(a.__name__||a.__ename__)&&(c="object");switch(c){case "function":return"";case "object":if(a instanceof Array){if(a.__enum__){if(2== a.length)return a[0];c=a[0]+"(";d+="\t";for(var b=2,f=a.length;b