import{r as o,d as n,B as a,h as i}from"./p-03169580.js";import{t}from"./p-5a032a89.js";import"./p-4cb16df5.js";import"./p-f44f0a67.js";const e="modal-scanner .banner{background-color:var(--ion-color-secondary)}modal-scanner h1{color:#fff}modal-scanner p{margin:0 0 15px 0;color:rgba(255, 255, 255, 0.8);font-weight:normal}.modal-scanner{--width:700px;--max-width:700px}@media only screen and (max-width: 800px){.modal-scanner{--width:100%;--max-width:auto}}";let s=class{constructor(a){o(this,a);this.floodteamCloseModal=n(this,"floodteamCloseModal",7)}onReset(o){var n;if(((n=o.detail)===null||n===void 0?void 0:n.endpoint)==="bulkUpdateUsers"){const o=document.querySelector("ion-modal.modal-scanner");if(o===null||o===void 0?void 0:o.dismiss){o.dismiss()}}}async onSuccess(o){var n;if(((n=o.detail)===null||n===void 0?void 0:n.endpoint)==="bulkUpdateUsers"){const o=document.querySelector("ion-modal.modal-scanner");if(o===null||o===void 0?void 0:o.dismiss){await o.dismiss();this.presentToast()}}}async presentToast(){const o=await t.create({message:`Scanning...`,duration:2e3});o.present()}onScanSuccess(o,n){console.log(`Scan result: ${o}`,n);this.qrCodeScanner.clear()}componentDidLoad(){if(!(a===null||a===void 0?void 0:a.isBrowser))return;setTimeout((()=>{this.qrCodeScanner=new window.Html5QrcodeScanner("reader",{fps:10,qrbox:250});this.qrCodeScanner.render(this.onScanSuccess.bind(this))}),100)}render(){return[i("ion-header",null,i("ion-toolbar",null,i("ion-title",null,"Scan QR Code"),i("ion-buttons",{slot:"end"},i("ion-button",{onClick:()=>this.floodteamCloseModal.emit(),style:{"--color":"var(--ion-text-color)","--color-hover":"var(--ion-color-danger"}},i("ion-icon",{slot:"icon-only",name:"close-circle-outline"}))))),i("ion-content",null,i("div",{id:"reader"}))]}};s.style=e;export{s as modal_scanner};
//# sourceMappingURL=p-99cef958.entry.js.map