1import{_ as U}from"./ChIpk3zr.js";import{_ as A}from"./BUeqB5Kd.js";import{d as I,eT as T,a_ as D,ak as R,aI as V,at as z,m as a,h as t,g as f,b as s,t as L,f as N,l as O,p as l,q as P,aG as $,U as j,o,k as B}from"./BP04oam5.js";import{u as E}from"./DNomgmiO.js";import{b as M}from"./BUl_MHrR.js";import{T as Q}from"./DXk7BhvL.js";import{R as S}from"./Qqm5ADP9.js";import"./DDUNl1VT.js";import"./BdM4cwzc.js";import"./C1pET1A4.js";const q={class:"w-full max-w-md px-6"},G={class:"flex flex-col items-center gap-8"},F={class:"flex flex-col items-center gap-3"},K={class:"flex items-center justify-center rounded-full size-16 bg-primary-100"},W={key:0,class:"flex flex-col items-center gap-6"},X={key:1,class:"flex flex-col items-center w-full gap-4"},H={class:"w-full p-4 rounded-lg bg-red-50"},J={class:"text-sm text-center text-red-700"},Y={key:2,class:"flex flex-col items-center gap-6"},Z={class:"relative p-4 bg-white border border-gray-200 shadow-sm rounded-xl"},ee={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/80 rounded-xl"},te={key:0,class:"text-sm text-center text-amber-600"},se={key:1,class:"text-sm text-center text-gray-400 animate-pulse"},ae=60,oe=5e3,_e=I({__name:"pair",setup(ne){const g=$(),{setDeviceAuth:h,getTabletApi:b}=E(),{getDeviceIdentifier:y}=T(),d=l(!0),n=l(""),i=l(!1),u=l(""),c=l(""),v=l(0),k=P(()=>!u.value||!c.value?"":`${g.public.baseUrl.replace(/\/$/,"")}/pair-device?di=${encodeURIComponent(u.value)}&ct=${encodeURIComponent(c.value)}`),w=()=>{if(i.value)return;if(v.value++,v.value>ae){i.value=!0,r();return}b().claim({device_identifier:u.value,claim_token:c.value}).then(e=>{r(),h(e.token,e.device_id,e.branch_id),j("/signing-device")}).catch(e=>{const m=e?.response?.status||e?.statusCode||e?.status;m!==404&&m===422&&(i.value=!0,r(),n.value="Ongeldige koppelingsdata. Genereer een nieuwe QR-code.")})},{pause:r,resume:x}=D(w,oe,{immediate:!1}),_=()=>{r(),c.value=crypto.randomUUID(),i.value=!1,n.value="",v.value=0,x()};return R(()=>{y().then(p=>{u.value=p,c.value=crypto.randomUUID(),d.value=!1,x()}).catch(()=>{n.value="Kon apparaat-ID niet ophalen.",d.value=!1})}),V(r),M(()=>{d.value||n.value||_()}),z(()=>{r()}),(p,e)=>{const m=U,C=A;return o(),a("div",q,[t("div",G,[t("div",F,[t("div",K,[f(s(Q),{class:"size-8 text-primary-600"})]),e[0]||(e[0]=t("h1",{class:"text-2xl font-bold text-gray-900"},"Apparaat koppelen",-1)),e[1]||(e[1]=t("p",{class:"text-center text-gray-500"}," Scan de QR-code met je telefoon om dit apparaat te koppelen. ",-1))]),s(d)?(o(),a("div",W,[...e[2]||(e[2]=[t("div",{class:"p-4 bg-white border border-gray-200 shadow-sm rounded-xl","aria-hidden":"true"},[t("div",{class:"size-[280px] rounded-md bg-gray-200 animate-pulse"})],-1),t("p",{class:"text-sm text-gray-500"},"Voorbereiden...",-1)])])):s(n)?(o(),a("div",X,[t("div",H,[t("p",J,L(s(n)),1)]),f(m,{"show-icon":!1,onClick:_},{default:N(()=>[...e[3]||(e[3]=[B(" Opnieuw proberen ",-1)])]),_:1})])):(o(),a("div",Y,[t("div",Z,[f(C,{value:s(k),width:280,height:280},null,8,["value"]),s(i)?(o(),a("div",ee,[t("button",{type:"button",class:"flex items-center justify-center transition-colors rounded-full size-16 bg-primary-100 hover:bg-primary-200",onClick:_},[f(s(S),{class:"size-8 text-primary-600"})])])):O("",!0)]),s(i)?(o(),a("p",te," QR-code verlopen. Druk op de knop om een nieuwe te genereren. ")):(o(),a("p",se," Wacht op koppeling... "))]))])])}}});export{_e as default}; 2//# sourceMappingURL=BCXEOU4V.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.