73 lines
62 KiB
JavaScript
73 lines
62 KiB
JavaScript
import{d as de,u as Ae,w as pe,m as De,c as f,a as s,e as Z,b as i,j as Q,t as j,k as D,p as Be,q as Ve,v as ze,g as z,i as c,s as at,h as Ue,f as We,n as Te,l as Ge,x as W,y as oe,F as le,r as re,z as _e,o as ot,A as lt,B as rt}from"./index-ilYp-WvI.js";import{c as K,t as ie,L as ke,C as Ze,A as it,b as ct,a as ut}from"./loader-circle-w-52iWEJ.js";var me=(k=>(k.CLASSIC_CASINO="CLASSIC_CASINO",k.NEON_CYBER="NEON_CYBER",k.MINIMAL_FLAT="MINIMAL_FLAT",k.LUXURY_GOLD="LUXURY_GOLD",k.PLAYFUL_CARTOON="PLAYFUL_CARTOON",k))(me||{});/**
|
|||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const dt=K("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const qe=K("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const ft=K("CircleHelpIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const ht=K("FrownIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const mt=K("KeyRoundIcon",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const pt=K("LogInIcon",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const xt=K("LogOutIcon",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const gt=K("PhoneIcon",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const vt=K("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const Pe=K("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const yt=K("TrophyIcon",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const He=K("Volume2Icon",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const bt=K("VolumeXIcon",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
|
||
|
|
* @license lucide-vue-next v0.378.0 - ISC
|
||
|
|
*
|
||
|
|
* This source code is licensed under the ISC license.
|
||
|
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
|
*/const wt=K("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Mt={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm animate-fade-in"},_t={class:"w-full max-w-sm bg-slate-900 border border-slate-800 rounded-2xl shadow-2xl p-6 text-right relative overflow-hidden"},kt={class:"text-center mb-6"},At={class:"inline-flex items-center justify-center w-12 h-12 rounded-xl bg-blue-500/10 text-blue-400 mb-3"},Ct={class:"text-lg font-bold text-white"},$t={class:"text-xs text-slate-400 mt-1"},St={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"},It={class:"relative"},Tt=["disabled"],Pt=["disabled"],Rt={class:"flex items-center justify-between pt-2 text-xs text-slate-400"},Lt={key:0,class:"text-slate-400 font-medium"},Ft=de({__name:"AuthModal",props:{show:{type:Boolean},campaignId:{}},emits:["close","success"],setup(k,{emit:R}){const b=k,m=R,d=Ae(),M=z("MOBILE"),h=z(""),_=z(""),p=z(!1),l=z(null),C=z(60);let x=null;function y(){C.value=60,x&&clearInterval(x),x=window.setInterval(()=>{C.value>0?C.value--:x&&clearInterval(x)},1e3)}pe(()=>b.show,a=>{a?(M.value="MOBILE",_.value="",l.value=null):x&&clearInterval(x)}),De(()=>{x&&clearInterval(x)});async function r(){var t,u;const a=h.value.trim();if(!/^09[0-9]{9}$/.test(a)){l.value="لطفاً یک شماره موبایل معتبر ۱۱ رقمی (مثل ۰۹۱۲۳۴۵۶۷۸۹) وارد نمایید.";return}p.value=!0,l.value=null;try{const $=await d.requestOtp(a);if(a==="09382507041"){await d.verifyOtp(a,($==null?void 0:$.devCode)||"11111",b.campaignId),m("success"),m("close");return}M.value="OTP",y()}catch($){l.value=((u=(t=$.response)==null?void 0:t.data)==null?void 0:u.message)||"خطا در ارسال کد تأیید"}finally{p.value=!1}}async function o(){var t,u;const a=_.value.trim();if(a.length!==5){l.value="کد تأیید پیامکشده ۵ رقم است.";return}p.value=!0,l.value=null;try{await d.verifyOtp(h.value.trim(),a,b.campaignId),m("success"),m("close")}catch($){l.value=((u=(t=$.response)==null?void 0:t.data)==null?void 0:u.message)||"کد تأیید نامعتبر یا منقضی شده است."}finally{p.value=!1}}return(a,t)=>k.show?(c(),f("div",Mt,[s("div",_t,[s("button",{onClick:t[0]||(t[0]=u=>m("close")),class:"absolute top-4 left-4 p-1.5 rounded-full text-slate-400 hover:text-white hover:bg-slate-800 transition"},[Z(i(wt),{class:"w-5 h-5"})]),s("div",kt,[s("div",At,[M.value==="MOBILE"?(c(),Q(i(gt),{key:0,class:"w-6 h-6"})):(c(),Q(i(mt),{key:1,class:"w-6 h-6"}))]),s("h3",Ct,j(M.value==="MOBILE"?"ورود به گردونه شانس":"تأیید شماره همراه"),1),s("p",$t,j(M.value==="MOBILE"?"جهت دریافت شانس و ثبت جوایز، شماره همراه خود را وارد کنید.":`کد ۵ رقمی ارسال شده به ${i(ie)(h.value)} را وارد نمایید.`),1)]),l.value?(c(),f("div",St,j(l.value),1)):D("",!0),M.value==="MOBILE"?(c(),f("form",{key:1,onSubmit:Be(r,["prevent"]),class:"space-y-4"},[s("div",null,[t[4]||(t[4]=s("label",{class:"block text-xs font-medium text-slate-300 mb-1.5"},"شماره تلفن همراه",-1)),s("div",It,[Ve(s("input",{"onUpdate:modelValue":t[1]||(t[1]=u=>h.value=u),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),[[ze,h.value]])])]),s("button",{type:"submit",disabled:p.value||!h.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/25 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 transition"},[p.value?(c(),Q(i(ke),{key:0,class:"w-4 h-4 animate-spin"})):D("",!0),t[5]||(t[5]=s("span"
|
||
|
|
`);try{n=new Worker(URL.createObjectURL(new Blob([S])))}catch(T){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",T),null}w(n)}return n}}(),r={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function o(n,e){return e?e(n):n}function a(n){return n!=null}function t(n,e,v){return o(n&&a(n[e])?n[e]:r[e],v)}function u(n){return n<0?0:Math.floor(n)}function $(n,e){return Math.floor(Math.random()*(e-n))+n}function g(n){return parseInt(n,16)}function q(n){return n.map(G)}function G(n){var e=String(n).replace(/[^0-9a-f]/gi,"");return e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),{r:g(e.substring(0,2)),g:g(e.substring(2,4)),b:g(e.substring(4,6))}}function E(n){var e=t(n,"origin",Object);return e.x=t(e,"x",Number),e.y=t(e,"y",Number),e}function P(n){n.width=document.documentElement.clientWidth,n.height=document.documentElement.clientHeight}function ce(n){var e=n.getBoundingClientRect();n.width=e.width,n.height=e.height}function J(n){var e=document.createElement("canvas");return e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=n,e}function ne(n,e,v,w,S,T,I,A,L){n.save(),n.translate(e,v),n.rotate(T),n.scale(w,S),n.arc(0,0,1,I,A,L),n.restore()}function Le(n){var e=n.angle*(Math.PI/180),v=n.spread*(Math.PI/180);return{x:n.x,y:n.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:n.startVelocity*.5+Math.random()*n.startVelocity,angle2D:-e+(.5*v-Math.random()*v),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:n.color,shape:n.shape,tick:0,totalTicks:n.ticks,decay:n.decay,drift:n.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:n.gravity*3,ovalScalar:.6,scalar:n.scalar,flat:n.flat}}function se(n,e){e.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.x+10*e.scalar,e.wobbleY=e.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);var v=e.tick++/e.totalTicks,w=e.x+e.random*e.tiltCos,S=e.y+e.random*e.tiltSin,T=e.wobbleX+e.random*e.tiltCos,I=e.wobbleY+e.random*e.tiltSin;if(n.fillStyle="rgba("+e.color.r+", "+e.color.g+", "+e.color.b+", "+(1-v)+")",n.beginPath(),h&&e.shape.type==="path"&&typeof e.shape.path=="string"&&Array.isArray(e.shape.matrix))n.fill(we(e.shape.path,e.shape.matrix,e.x,e.y,Math.abs(T-w)*.1,Math.abs(I-S)*.1,Math.PI/10*e.wobble));else if(e.shape.type==="bitmap"){var A=Math.PI/10*e.wobble,L=Math.abs(T-w)*.1,O=Math.abs(I-S)*.1,V=e.shape.bitmap.width*e.scalar,N=e.shape.bitmap.height*e.scalar,B=new DOMMatrix([Math.cos(A)*L,Math.sin(A)*L,-Math.sin(A)*O,Math.cos(A)*O,e.x,e.y]);B.multiplySelf(new DOMMatrix(e.shape.matrix));var U=n.createPattern(C.transform(e.shape.bitmap),"no-repeat");U.setTransform(B),n.globalAlpha=1-v,n.fillStyle=U,n.fillRect(e.x-V/2,e.y-N/2,V,N),n.globalAlpha=1}else if(e.shape==="circle")n.ellipse?n.ellipse(e.x,e.y,Math.abs(T-w)*e.ovalScalar,Math.abs(I-S)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI):ne(n,e.x,e.y,Math.abs(T-w)*e.ovalScalar,Math.abs(I-S)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI);else if(e.shape==="star")for(var F=Math.PI/2*3,X=4*e.scalar,ee=8*e.scalar,te=e.x,ue=e.y,fe=5,ae=Math.PI/fe;fe--;)te=e.x+Math.cos(F)*ee,ue=e.y+Math.sin(F)*ee,n.lineTo(te,ue),F+=ae,te=e.x+Math.cos(F)*X,ue=e.y+Math.sin(F)*X,n.lineTo(te,ue),F+=ae;else n.moveTo(Math.floor(e.x),Math.floor(e.y)),n.lineTo(Math.floor(e.wobbleX),Math.floor(S)),n.lineTo(Math.floor(T),Math.floor(I)),n.lineTo(Math.floor(w),Math.floor(e.wobbleY));return n.closePath(),n.fill(),e.tick<e.totalTicks}function xe(n,e,v,w,S){var T=e.slice(),I=n.getContext("2d"),A,L,O=l(function(V){funct
|