import{c as r,i as a}from"./_plugin-vue_export-helper-Bah2QB50.js";import{N as s}from"./Navbar-Fg1INzmv.js";let u=r({components:{Navbar:s},inject:["i18n"],methods:{registerDevice(o){let t=document.querySelector("#pin-input").value,n=document.querySelector("#name-input").value;document.querySelector("#status").innerHTML="";let i=JSON.stringify({pin:t,name:n});fetch("./api/pin",{method:"POST",headers:{"Content-Type":"application/json"},body:i}).then(e=>e.json()).then(e=>{e.status===!0?(document.querySelector("#status").innerHTML=`<div class="alert alert-success" role="alert">${this.i18n.t("pin.pair_success")}</div>`,document.querySelector("#pin-input").value="",document.querySelector("#name-input").value=""):document.querySelector("#status").innerHTML=`<div class="alert alert-danger" role="alert">${this.i18n.t("pin.pair_failure")}</div>`})}}});a(u);
