import{d as p,g as l,a as g,u as h,b as e,h as c,i as _,B as x,n as y,t as v,e as i,F as b,y as u,C as f,o as a,Z as C}from"./app-9d739f6f.js";const k={class:"bg-orange-600 p-6 relative sm:flex sm:justify-center sm:items-center min-h-screen bg-dots-darker bg-center dark:bg-dots-lighter dark:bg-gray-900 selection:bg-red-500 selection:text-white"},w={class:"max-w-xl mx-auto p-6 lg:p-8 bg-white rounded-lg shadow-lg"},N={class:"flex flex-col items-center"},V={key:0,class:"mx-auto p-5 border-4 rounded-lg"},B=["src"],D={key:1},E=["disabled"],F={key:0,class:"text-red-500 mt-4"},Q={key:2,class:"text-center"},q=p({__name:"QrCode",setup(S){const s=u(null),n=u(null),r=u(null),d=()=>{f.post(route("storeNic"),{nic:s.value}).then(t=>{console.log(t),t.data&&t.status==200&&(n.value=t.data.qrCode,s.value=null)}).catch(t=>{console.log(t),r.value=t.response.data.error})};return(t,o)=>(a(),l(b,null,[g(h(C),{title:"Free Cappuccino"}),e("div",k,[e("div",w,[e("div",N,[o[2]||(o[2]=e("h3",{class:"text-center text-4xl"},"Enter your NIC number below to receive your complimentary cappuccino ",-1)),n.value?(a(),l("div",V,[e("img",{class:"mx-auto",src:n.value},null,8,B)])):c("",!0),n.value?(a(),l("div",Q,[...o[1]||(o[1]=[e("h5",{class:"mt-4 text-lg"},"Show the QR code below to the cashier to enjoy your free short cappuccino.",-1),e("h5",{class:"mt-4 text-lg"},[i("Valid only at: Barista Kandy City & Barista Kandy Diner Outlets Validity: 24"),e("sup",null,"th"),i("–28"),e("sup",null,"th"),i(" August")],-1),e("h5",{class:"mt-4 text-lg"},"Valid for one-time use only.",-1),e("br",null,null,-1),e("a",{class:"text-blue-400 underline",href:"https://barista.lk"},"Home",-1)])])):(a(),l("div",D,[_(e("input",{type:"text",placeholder:"Enter your NIC",class:"mt-3 rounded","onUpdate:modelValue":o[0]||(o[0]=m=>s.value=m)},null,512),[[x,s.value]]),e("button",{disabled:!s.value,class:y([{"opacity-60 cursor-not-allowed":!s.value},"bg-orange-500 rounded px-4 py-2 ml-3"]),type:"button",onClick:d},"Submit",10,E),r.value?(a(),l("p",F,v(r.value),1)):c("",!0)]))])])])],64))}});export{q as default};
