"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[774],{2950:(e,t,l)=>{l.d(t,{E:()=>i,PointsNotificationProvider:()=>r});var s=l(95155),a=l(12115);let n=(0,a.createContext)(void 0);function r(e){let{children:t}=e,[l,r]=(0,a.useState)([]),[i]=(0,a.useState)(()=>"undefined"!=typeof Audio?new Audio("/sounds/notification.mp3"):null),o=(0,a.useCallback)(e=>{let t="notification-".concat(Date.now(),"-").concat(Math.random()),l={id:t,points:e};r(e=>[...e,l]),i&&(i.currentTime=0,i.play().catch(e=>console.log("Audio playback failed:",e))),setTimeout(()=>{r(e=>e.filter(e=>e.id!==t))},3200)},[i]),d=(0,a.useCallback)(e=>{r(t=>t.filter(t=>t.id!==e))},[]);return(0,a.useEffect)(()=>{let e=e=>{let t=e.detail;t&&"number"==typeof t.points&&o(t.points)};return window.addEventListener("newPoints",e),()=>window.removeEventListener("newPoints",e)},[o]),(0,s.jsx)(n.Provider,{value:{notifications:l,showPointsNotification:o,dismissNotification:d},children:t})}function i(){let e=(0,a.useContext)(n);if(!e)throw Error("usePointsNotification must be used within PointsNotificationProvider");return e}},10774:(e,t,l)=>{l.d(t,{U:()=>I});var s=l(95155),a=l(12115),n=l(52619),r=l.n(n),i=l(36489),o=l(20508),d=l(1733),c=l(2950);function u(e){let{direction:t="down"}=e,{notifications:l}=(0,c.E)();if(0===l.length)return null;let a="down"===t,n=a?"absolute top-12 left-1/2 -translate-x-1/2 z-[100] pointer-events-none":"absolute bottom-10 left-1/2 -translate-x-1/2 z-[100] pointer-events-none",r=a?"animate-float-down-fade":"animate-float-up-fade";return(0,s.jsx)(s.Fragment,{children:l.map((e,t)=>{let{id:l,points:a}=e,i=a>=0,o=(e=>{let t=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"];return Math.abs(e).toString().replace(/\d/g,e=>t[parseInt(e)])})(a),c="".concat(o).concat(i?"+":"-");return(0,s.jsx)("div",{className:n,style:{animationDelay:"".concat(150*t,"ms")},children:(0,s.jsxs)("div",{className:"relative w-14 h-14 ".concat(r," overflow-visible"),children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-[#FFA515] rounded-full shadow-[0_4px_15px_rgba(255,165,21,0.4)] border-2 border-white/20"}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-2.5 overflow-visible",children:(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 57.26 52.41",className:"w-full h-full text-black overflow-visible",children:(0,s.jsxs)(d.P.g,{animate:i?{y:a>=4?[0,0,0,0,-14,0,-8,0]:[0,0,0,0,-6,0,-4,0],rotate:[0,0,0,0,-5,5,-3,0]}:{x:[0,0,0,0,-4,4,-4,4,-2,2,0]},transition:{duration:2.5,times:i?[0,.2,.5,.7,.75,.8,.85,.9]:[0,.2,.5,.7,.73,.76,.79,.82,.85,.88,.9],ease:"easeInOut"},style:{originX:"28.63px",originY:"26.2px"},children:[(0,s.jsx)("path",{d:"M57.26,7.61v37.2a7.6,7.6,0,0,1-7.6,7.6H7.6A7.6,7.6,0,0,1,0,44.81V7.66A7.6,7.6,0,0,1,11.09.91l14,7.23a7.61,7.61,0,0,0,7,0L46.18.85A7.6,7.6,0,0,1,57.26,7.61Z",fill:"currentColor"}),(0,s.jsx)(d.P.ellipse,{cx:"19.04",cy:"30.22",rx:"7.44",ry:"2.29",fill:"#ffffff",animate:{rx:[7.44,7.2,7.2,7.2,7.2],ry:[2.29,7.2,7.2,7.2,7.2],x:[0,6,6,0,0],y:[0,-8,-8,0,0]},transition:{duration:2.5,times:[0,.2,.5,.7,1],ease:"easeInOut"},style:{originX:"19.04px",originY:"30.22px"}}),(0,s.jsx)(d.P.rect,{x:"11",y:"22",width:"16",height:"0",fill:"currentColor",animate:a>=4?{height:[0,0,0,12,12,12,12],x:[0,6,6,6,0,0,0],y:[0,-8,7.42,.22,8.22,8.22,8.22]}:i?{height:[0,0,0,0,16,0,0],x:[0,6,6,0,0,0,0],y:[0,-8,-8,0,0,0,0]}:{height:[0,0,0,8,8,8,8],x:[0,6,6,6,0,0,0],y:[0,-8,-8,-8,0,0,0]},transition:{duration:2.5,times:a>=4?[0,.2,.45,.5,.7,.85,1]:i?[0,.2,.5,.7,.75,.85,1]:[0,.2,.45,.5,.7,.85,1],ease:"easeInOut"}}),(0,s.jsx)(d.P.circle,{cx:"39.48",cy:"30.22",r:"6.18",fill:"#ffffff",animate:{r:[6.18,7.2,7.2,7.2,7.2],x:[0,6,6,0,0],y:[0,-8,-8,0,0]},transition:{duration:2.5,times:[0,.2,.5,.7,1],ease:"easeInOut"},style:{originX:"39.48px",originY:"30.22px"}}),(0,s.jsx)(d.P.rect,{x:"32",y:"22",width:"16",height:"0",fill:"currentColor",animate:a>=4?{height:[0,0,0,12,12,12,12],x:[0,6,6,6,0,0,0],y:[0,-8,7.42,.22,8.22,8.22,8.22]}:i?{height:[0,0,0,0,16,0,0],x:[0,6,6,0,0,0,0],y:[0,-8,-8,0,0,0,0]}:{height:[0,0,0,8,8,8,8],x:[0,6,6,6,0,0,0],y:[0,-8,-8,-8,0,0,0]},transition:{duration:2.5,times:a>=4?[0,.2,.45,.5,.7,.85,1]:i?[0,.2,.5,.7,.75,.85,1]:[0,.2,.45,.5,.7,.85,1],ease:"easeInOut"}})]})})}),(0,s.jsx)("div",{className:"absolute -top-5 -right-1.5 bg-white rounded-full px-2 py-1 shadow-md border border-gray-100 min-w-[28px] flex items-center justify-center",children:(0,s.jsx)("span",{className:"text-[20px] font-black leading-none ".concat(i?"text-emerald-600":"text-rose-600"),children:c})}),(0,s.jsx)("div",{className:"absolute inset-0 bg-[#FFA515] rounded-full blur-md opacity-30 -z-10"})]})},l)})})}var x=l(20063),m=l(27063),h=l(3998),v=l(3216);let f={activeBookings:0,totalPoints:0,level:"BEGINNER",levelLabel:"سطح ۱",levelIcon:"\uD83C\uDF31",coins:0,referralCode:null,referralCount:0,uniqueCafesCount:0,uniqueGamesCount:0,playmasterCount:0,playmateCount:0,name:null,username:null,avatar:null,archetype:null,awardedBadgeKeys:[],achievements:(0,v.AT)({})};var b=l(16481),j=l(96093),p=l(6490),g=l(51950),w=l(73618),N=l(95740),y=l(52056),k=l(89559),C=l(48055),A=l(6613),E=l(30814),P=l(90368),S=l(59384);function B(e){var t,l,n,r,d,c,u,B,I;let{open:q,onOpenChange:O,className:_=""}=e,F=(0,x.useRouter)(),L=(0,x.usePathname)(),{data:R}=(0,i.useSession)(),{stats:M,loading:T,error:z,refetch:D}=function(){let{data:e}=(0,i.useSession)(),[t,l]=(0,a.useState)(f),[s,n]=(0,a.useState)(!0),[r,o]=(0,a.useState)(null),d=(0,a.useCallback)(async()=>{if(!(null==e?void 0:e.user)){l(f),n(!1),o(null);return}try{var t,s,a,r,i,d,c,u,x,m,h,b,j,p,g,w,N,y,k,C,A,E,P,S,B,I,q,O,_,F,L,R,M,T,z;n(!0),o(null);let f=await fetch("/api/user/profile",{method:"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw Error("Profile request failed with status ".concat(f.status));let D=await f.json(),G=null==D?void 0:D.data,$=null==D?void 0:D.profile,K=(null==G?void 0:G.user)||(null==$?void 0:$.user),X=(null==G?void 0:G.points)||(null==$?void 0:$.points),Y=null!=(u=null!=(c=null==G?void 0:G.activeBookings)?c:null==$||null==(t=$.user)?void 0:t.activeBookings)?u:0,U=null!=(m=null!=(x=null==X?void 0:X.totalPoints)?x:null==(s=e.user)?void 0:s.points)?m:0,V=null!=(h=null==X?void 0:X.currentLevel)?h:"BEGINNER",W=null!=(b=null==X?void 0:X.levelDisplayName)?b:"سطح ۱",H=null!=(j=null==X?void 0:X.currentLevelIcon)?j:"\uD83C\uDF31",Q=null!=(p=null==K?void 0:K.coins)?p:0,Z=null!=(g=null==K?void 0:K.referralCode)?g:null,J=null!=(w=null==K?void 0:K.referralCount)?w:0,ee=null!=(N=null==K?void 0:K.uniqueCafesCount)?N:0,et=null!=(y=null==K?void 0:K.uniqueGamesCount)?y:0,el=null!=(C=null!=(k=null==K?void 0:K.playmasterCount)?k:null==G?void 0:G.playmasterCount)?C:0,es=null!=(E=null!=(A=null==K?void 0:K.playmateCount)?A:null==G?void 0:G.playmateCount)?E:0,ea=null!=(P=null==K?void 0:K.awardedBadgeKeys)?P:[],en=null!=(B=null!=(S=null==K?void 0:K.name)?S:e.user.name)?B:null,er=null!=(q=null!=(I=null==K?void 0:K.username)?I:null==(a=e.user)?void 0:a.username)?q:null,ei=null!=(_=null!=(O=null==K?void 0:K.avatar)?O:e.user.image)?_:null,eo=null!=(L=null!=(F=null==K?void 0:K.archetype)?F:null==(r=e.user)?void 0:r.archetype)?L:null,ed=(0,v.AT)({username:er,gender:null!=(M=null!=(R=null==K?void 0:K.gender)?R:null==(i=e.user)?void 0:i.gender)?M:null,ageRange:null!=(z=null!=(T=null==K?void 0:K.ageRange)?T:null==(d=e.user)?void 0:d.ageRange)?z:null,referralCount:J,uniqueCafesCount:ee,uniqueGamesCount:et,playmasterCount:el,playmateCount:es,coins:Q,currentStreakWeeks:0,distinctArchetypesCount:0,awardedBadgeKeys:ea});l({activeBookings:Y,totalPoints:U,level:V,levelLabel:W,levelIcon:H,coins:Q,referralCode:Z,referralCount:J,uniqueCafesCount:ee,uniqueGamesCount:et,playmasterCount:el,playmateCount:es,name:en,username:er,avatar:ei,archetype:eo,awardedBadgeKeys:ea,achievements:ed})}catch(e){console.error("Error fetching user stats:",e),o("خطا در دریافت اطلاعات کاربر")}finally{n(!1)}},[null==e?void 0:e.user]);return(0,a.useEffect)(()=>{d()},[d]),{stats:t,loading:s,error:r,refetch:d}}(),[G,$]=(0,a.useState)("summary"),[K,X]=(0,a.useState)(!1),[Y,U]=(0,a.useState)(!1);(0,a.useEffect)(()=>{q||$("summary")},[q]);let V=()=>{O(!1),"/dashboard"!==L&&F.push("/dashboard")},W=M.archetype||(null==R||null==(t=R.user)?void 0:t.archetype),H=W?p.aK[W]:void 0,Q=W?(0,j.i0)(W):M.avatar||(null==R||null==(l=R.user)?void 0:l.image),Z=M.name||(null==R||null==(n=R.user)?void 0:n.name)||"همبازی عزیز",J=M.username||(null==R||null==(r=R.user)?void 0:r.username),ee=(null==(d=M.achievements)?void 0:d.totalBadgesCount)||0,et=(null==(c=M.achievements)?void 0:c.earnedBadgesCount)||0,el=ee>0?Math.round(et/ee*100):0,es=null==(B=M.achievements)||null==(u=B.shadowBadges)?void 0:u[0];return(0,s.jsxs)(m.cj,{open:q,onOpenChange:e=>{e||$("summary"),O(e)},children:[(0,s.jsx)(m.h,{side:"bottom","data-testid":"quick-achievements-sheet-content",className:"max-h-[92vh] overflow-y-auto overflow-x-hidden no-scrollbar [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden bg-slate-950 border-t border-amber-500/40 text-white rounded-t-3xl p-4 sm:p-7 shadow-2xl backdrop-blur-2xl w-full max-w-full font-vazir font-farsi ".concat(_),children:"full"===G?(0,s.jsx)(b.h,{user:M,onBack:()=>$("summary")}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(m.Fm,{className:"text-right space-y-1 pb-2 border-b border-white/10",children:(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-xl bg-amber-500/20 border border-amber-500/30 flex items-center justify-center text-amber-400",children:(0,s.jsx)(N.A,{className:"w-4 h-4"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(m.qp,{className:"text-base sm:text-lg font-black text-white",children:"شناسنامه و افتخارات همبازی"}),(0,s.jsx)(m.Qs,{className:"text-xs text-slate-400",children:"خلاصه وضعیت پیشرفت شما"})]})]})})}),T?(0,s.jsxs)("div",{"data-testid":"quick-sheet-loading",className:"space-y-4 animate-pulse",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3.5 p-3.5 bg-slate-900/60 rounded-2xl border border-white/5",children:[(0,s.jsx)("div",{className:"w-14 h-14 rounded-full bg-slate-800"}),(0,s.jsxs)("div",{className:"space-y-2 flex-1",children:[(0,s.jsx)("div",{className:"h-4 w-32 bg-slate-800 rounded-md"}),(0,s.jsx)("div",{className:"h-3 w-24 bg-slate-800/60 rounded-md"})]})]}),(0,s.jsx)("div",{className:"h-20 bg-slate-900/60 rounded-2xl border border-white/5"}),(0,s.jsx)("div",{className:"h-28 bg-slate-900/60 rounded-2xl border border-white/5"}),(0,s.jsx)("div",{className:"h-12 bg-slate-900/60 rounded-xl"})]}):z?(0,s.jsxs)("div",{"data-testid":"quick-sheet-error",className:"p-5 bg-rose-950/20 border border-rose-500/30 rounded-2xl text-center space-y-4",children:[(0,s.jsx)("div",{className:"w-12 h-12 mx-auto rounded-full bg-rose-500/10 border border-rose-500/20 flex items-center justify-center text-rose-400",children:(0,s.jsx)(y.A,{className:"w-6 h-6"})}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-sm font-bold text-rose-200",children:"خطا در دریافت اطلاعات افتخارات"}),(0,s.jsx)("p",{className:"text-xs text-slate-400",children:"ارتباط با سرور برقرار نشد. لطفاً دوباره تلاش کنید."})]}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,s.jsxs)(h.$,{onClick:()=>D(),"data-testid":"quick-sheet-retry-btn",className:"bg-rose-500 hover:bg-rose-600 text-white font-bold rounded-xl h-10 px-4 text-xs flex items-center gap-2",children:[(0,s.jsx)(k.A,{className:"w-3.5 h-3.5"}),(0,s.jsx)("span",{children:"تلاش مجدد"})]}),(0,s.jsx)(h.$,{variant:"outline",onClick:V,className:"border-white/10 hover:bg-slate-900 text-slate-300 rounded-xl h-10 px-4 text-xs",children:"ورود به داشبورد"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3.5 p-3.5 bg-gradient-to-r from-slate-900/90 to-slate-900/50 border border-white/10 rounded-2xl shadow-lg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3.5 min-w-0",children:[(0,s.jsx)("div",{className:"relative flex items-center justify-center w-14 h-14 rounded-full bg-gradient-to-tr from-amber-500 via-violet-600 to-indigo-600 p-[2px] shadow-md shrink-0",children:(0,s.jsx)("div",{className:"w-full h-full rounded-full bg-slate-950 flex items-center justify-center overflow-hidden",children:Q&&!K?(0,s.jsx)("img",{src:Q,alt:"آواتار کاربر",className:"w-full h-full object-cover rounded-full",onError:()=>X(!0)}):(0,s.jsx)("div",{className:"w-full h-full rounded-full bg-violet-950/60 text-violet-400 flex items-center justify-center",children:(0,s.jsx)(o.A,{className:"w-6 h-6"})})})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm sm:text-base font-black text-white truncate",children:Z}),J?(0,s.jsxs)("div",{className:"text-xs text-amber-400/90 font-mono dir-ltr text-right truncate",children:["@",J]}):(0,s.jsx)("button",{type:"button",onClick:()=>U(!0),"data-testid":"choose-username-btn",className:"text-xs text-amber-400 hover:text-amber-300 font-bold transition-colors flex items-center gap-1 cursor-pointer",children:(0,s.jsx)("span",{children:"انتخاب نام کاربری"})})]})]}),(0,s.jsxs)("div",{className:"px-3 py-1.5 bg-violet-950/50 border border-violet-500/30 rounded-xl shrink-0 text-center",children:[(0,s.jsx)("div",{className:"text-[10px] text-violet-300/80 font-medium",children:"کهن‌الگو"}),(0,s.jsx)("div",{className:"text-xs font-black text-violet-200",children:(null==H?void 0:H.title)||M.levelLabel})]})]}),(0,s.jsx)("div",{className:"flex items-center justify-between gap-3 p-4 bg-gradient-to-r from-amber-500/15 via-amber-500/10 to-yellow-500/10 border border-amber-500/30 rounded-2xl shadow-md shadow-amber-500/10",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-xl bg-amber-500/20 border border-amber-500/40 flex items-center justify-center text-amber-400 shrink-0",children:(0,s.jsx)(C.A,{className:"w-5 h-5 animate-bounce"})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"text-sm sm:text-base font-black text-amber-300",children:[(0,g.ub)(M.coins)," سکه طلا"]}),(0,s.jsx)("div",{className:"text-[11px] text-amber-400/80 truncate",children:"اعتبار ورود به رویدادهای VIP و بازی‌های ویژه"})]})]})}),(0,s.jsxs)("div",{className:"p-4 bg-slate-900/60 border border-white/5 rounded-2xl space-y-3.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(A.A,{className:"w-4 h-4 text-amber-400"}),(0,s.jsx)("span",{className:"text-xs sm:text-sm font-bold text-white",children:"مدال‌های افتخار کلاب"})]}),(0,s.jsxs)("span",{className:"text-xs font-bold text-amber-400 font-vazir",children:[(0,g.ub)(et)," از ",(0,g.ub)(ee)," نشان"]})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"w-full h-2.5 bg-slate-800 rounded-full overflow-hidden p-[2px]",children:(0,s.jsx)("div",{className:"h-full bg-gradient-to-r from-amber-500 to-orange-500 rounded-full transition-all duration-500",style:{width:"".concat(el,"%")}})}),(0,s.jsxs)("div",{className:"flex justify-between text-[10px] text-slate-400",children:[(0,s.jsx)("span",{children:"پیشرفت کل"}),(0,s.jsxs)("span",{children:[(0,g.ub)(el),"٪"]})]})]}),(null==(I=M.achievements)?void 0:I.earnedBadges)&&M.achievements.earnedBadges.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-2 pt-1",children:M.achievements.earnedBadges.slice(0,4).map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1 bg-amber-500/10 border border-amber-500/20 rounded-lg text-[11px] text-amber-200",children:[(0,s.jsx)("span",{children:e.icon}),(0,s.jsx)("span",{className:"font-bold",children:e.title})]},e.key))}):(0,s.jsx)("p",{className:"text-[11px] text-slate-400",children:"هنوز مدالی ثبت نشده؛ با تکمیل پروفایل یا بازی اولین مدال را کسب کن!"}),es&&(0,s.jsxs)("div",{className:"p-2.5 bg-slate-950/60 border border-amber-500/20 rounded-xl flex items-center justify-between gap-2 mt-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(E.A,{className:"w-4 h-4 text-amber-400 shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("span",{className:"text-[11px] font-bold text-slate-200 block truncate",children:["هدف بعدی: ",es.title]}),(0,s.jsx)("span",{className:"text-[10px] text-slate-400 block truncate",children:es.description})]})]}),(0,s.jsx)("div",{className:"text-left shrink-0",children:(0,s.jsxs)("span",{className:"text-xs font-black text-amber-400",children:[(0,g.ub)(es.current),"/",(0,g.ub)(es.target)]})})]})]}),(0,s.jsxs)("div",{className:"space-y-2.5 pt-2",children:[(0,s.jsxs)(h.$,{onClick:()=>$("full"),"data-testid":"view-full-achievements-btn",variant:"outline",className:"w-full h-11 bg-slate-900/80 hover:bg-slate-800 border-amber-500/30 text-amber-300 hover:text-amber-200 rounded-2xl text-xs sm:text-sm font-bold flex items-center justify-center gap-2 transition-all duration-300",children:[(0,s.jsx)(A.A,{className:"w-4 h-4 text-amber-400"}),(0,s.jsx)("span",{children:"مشاهده تابلوی کامل افتخارات"}),(0,s.jsx)(P.A,{className:"w-4 h-4 text-slate-400 mr-auto"})]}),(0,s.jsxs)(h.$,{onClick:V,"data-testid":"go-to-dashboard-btn",className:"w-full h-12 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-slate-950 font-black rounded-2xl text-xs sm:text-sm flex items-center justify-center gap-2 shadow-lg shadow-amber-500/20 transition-all duration-300",children:[(0,s.jsx)(S.A,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"ورود به داشبورد"})]})]})]})]})}),(0,s.jsx)(w.s,{open:Y,onOpenChange:U,onSuccess:async()=>{await D()}})]})}function I(){var e,t;let{data:l}=(0,i.useSession)(),[n,d]=(0,a.useState)(!1),[c,x]=(0,a.useState)(!1),m=null==l||null==(e=l.user)?void 0:e.archetype,h=m?(0,j.i0)(m):null,v=(0,s.jsx)("div",{className:"w-full h-full rounded-full bg-white flex items-center justify-center overflow-hidden",children:h&&!n?(0,s.jsx)("img",{src:h,alt:"آرکیتایپ کاربر",className:"w-full h-full object-cover rounded-full",onError:()=>d(!0)}):(0,s.jsx)("div",{className:"w-full h-full rounded-full bg-violet-50 text-violet-600 flex items-center justify-center",children:(0,s.jsx)(o.A,{className:"w-5 h-5 sm:w-6 sm:h-6"})})}),f="relative flex items-center justify-center w-10 h-10 sm:w-11 sm:h-11 rounded-full bg-gradient-to-tr from-amber-500 via-violet-600 to-indigo-600 p-[2px] shadow-sm hover:shadow-md hover:scale-105 active:scale-95 transition-all duration-200 cursor-pointer";if(!(null==l?void 0:l.user))return(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsx)(r(),{href:"/auth/customer/signin",className:f,title:"حساب کاربری",children:v}),(0,s.jsx)(u,{})]});let b=null==(t=l.user)?void 0:t.role;return"ADMIN"===b||"SUPER_ADMIN"===b?(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsx)(r(),{href:"/admin-dashboard",className:f,title:"حساب کاربری",children:v}),(0,s.jsx)(u,{})]}):"CAFE_OWNER"===b?(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsx)(r(),{href:"/business-dashboard",className:f,title:"حساب کاربری",children:v}),(0,s.jsx)(u,{})]}):(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsx)("button",{type:"button",onClick:()=>x(!0),className:f,title:"حساب کاربری",children:v}),(0,s.jsx)(u,{}),(0,s.jsx)(B,{open:c,onOpenChange:x})]})}}}]);