3 lines
25 KiB
JavaScript
3 lines
25 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/wheel-classiccasinowheel-D335SDnp.js","assets/vendor-vue-DYkhP7t5.js","assets/wheel-neoncyberwheel-D_x2lhsl.js","assets/wheel-minimalflatwheel-BJTYX9FR.js","assets/wheel-luxurygoldwheel-CkWepG8h.js","assets/wheel-playfulcartoonwheel-B7xOLPYC.js","assets/wheel-rusticwoodwheel-BbKX2tGm.js","assets/wheel-galaxyspacewheel-Cpe0b0bD.js","assets/wheel-candylandwheel-B__v1BC5.js","assets/wheel-fireflamewheel-BmwUEapa.js","assets/wheel-crystalicewheel-CYDvynJx.js"])))=>i.map(i=>d[i]);
|
|||
|
|
import{u as D,a as j,_ as S}from"./index-BAVpCd0B.js";import{t as N,a as V,W as C}from"./wheel-classiccasinowheel-D335SDnp.js";import{d as B,w as J,o as Q,b as r,e,v as h,u as t,X as ee,k as _,P as te,K as se,t as v,g,H as F,I as U,J as W,L as T,C as H,A as le,R as ae,r as p,a as l,i as ne,y as K,z as L,M as G,T as oe,B as ie,S as z,N as re,E as q,V as X,c as P,O as R,j as ue,Q as de,x as ce,U as xe,W as me,Y,Z as ve,_ as pe,$ as be,a0 as fe}from"./vendor-vue-DYkhP7t5.js";import{c as he}from"./vendor-ui-B5JVzsfH.js";const ge={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm animate-fade-in"},ye={class:"w-full max-w-sm bg-slate-900 border border-slate-800 rounded-2xl shadow-2xl p-6 text-right relative overflow-hidden"},we={class:"text-center mb-6"},_e={class:"inline-flex items-center justify-center w-12 h-12 rounded-xl bg-blue-500/10 text-blue-400 mb-3"},ke={class:"text-lg font-bold text-white"},Ce={class:"text-xs text-slate-400 mt-1"},Ae={key:0,class:"mb-4 p-3 rounded-lg bg-rose-500/10 border border-rose-500/20 text-rose-400 text-xs font-medium"},Ie={class:"relative"},Ee=["disabled"],Se=["disabled"],Re={class:"flex items-center justify-between pt-2 text-xs text-slate-400"},$e={key:0,class:"text-slate-400 font-medium"},Oe=B({__name:"AuthModal",props:{show:{type:Boolean},campaignId:{}},emits:["close","success"],setup($,{emit:M}){const O=$,o=M,m=D(),b=p("MOBILE"),n=p(""),y=p(""),u=p(!1),s=p(null),w=p(60);let f=null;function A(){w.value=60,f&&clearInterval(f),f=window.setInterval(()=>{w.value>0?w.value--:f&&clearInterval(f)},1e3)}J(()=>O.show,x=>{x?(b.value="MOBILE",y.value="",s.value=null):f&&clearInterval(f)}),Q(()=>{f&&clearInterval(f)});async function I(){const x=n.value.trim();if(!/^09[0-9]{9}$/.test(x)){s.value="لطفاً یک شماره موبایل معتبر ۱۱ رقمی (مثل ۰۹۱۲۳۴۵۶۷۸۹) وارد نمایید.";return}u.value=!0,s.value=null;try{await m.requestOtp(x),b.value="OTP",A()}catch(i){s.value=i.response?.data?.message||"خطا در ارسال کد تأیید"}finally{u.value=!1}}async function c(){const x=y.value.trim();if(x.length!==5){s.value="کد تأیید پیامکشده ۵ رقم است.";return}u.value=!0,s.value=null;try{await m.verifyOtp(n.value.trim(),x,O.campaignId),o("success"),o("close")}catch(i){s.value=i.response?.data?.message||"کد تأیید نامعتبر یا منقضی شده است."}finally{u.value=!1}}return(x,i)=>$.show?(l(),r("div",ge,[e("div",ye,[e("button",{onClick:i[0]||(i[0]=d=>o("close")),class:"absolute top-4 left-4 p-1.5 rounded-full text-slate-400 hover:text-white hover:bg-slate-800 transition"},[h(t(ee),{class:"w-5 h-5"})]),e("div",we,[e("div",_e,[b.value==="MOBILE"?(l(),_(t(te),{key:0,class:"w-6 h-6"})):(l(),_(t(se),{key:1,class:"w-6 h-6"}))]),e("h3",ke,v(b.value==="MOBILE"?"ورود به گردونه شانس":"تأیید شماره همراه"),1),e("p",Ce,v(b.value==="MOBILE"?"جهت دریافت شانس و ثبت جوایز، شماره همراه خود را وارد کنید.":`کد ۵ رقمی ارسال شده به ${t(N)(n.value)} را وارد نمایید.`),1)]),s.value?(l(),r("div",Ae,v(s.value),1)):g("",!0),b.value==="MOBILE"?(l(),r("form",{key:1,onSubmit:F(I,["prevent"]),class:"space-y-4"},[e("div",null,[i[4]||(i[4]=e("label",{class:"block text-xs font-medium text-slate-300 mb-1.5"},"شماره تلفن همراه",-1)),e("div",Ie,[U(e("input",{"onUpdate:modelValue":i[1]||(i[1]=d=>n.value=d),type:"tel",inputmode:"numeric",maxlength:"11",placeholder:"۰۹۱۲۳۴۵۶۷۸۹",dir:"ltr",class:"w-full px-4 py-3 bg-slate-950 border border-slate-700 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 rounded-xl text-white text-center text-base tracking-widest outline-none transition placeholder:text-slate-600 font-mono",required:""},null,512),[[W,n.value]])])]),e("button",{type:"submit",disabled:u.value||!n.value,class:"w-full py-3 px-4 rounded-xl bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white font-semibold text-sm shadow-lg shadow-blue-500
|