import{dasx,QasL,oasw,xasg,casn,qasr,zasM,hasd,BasF,basi,e,Iasy,tasa,gasc,f,Pask,mas$,iasv,Casz,_asO}from"./index-bXlTbVTS.js";import{PasU}from"./PageBar-B0G-t4B9.js";import{Sasm}from"./SectionHead-CORorW5_.js";constA={class:"prof"},W={class:"prof__identity"},q={class:"prof__avatar","aria-hidden":"true"},H={class:"prof__name"},J={key:0,class:"prof__mobile"},Q={key:0,class:"prof__block"},j={class:"prof__specs"},G={class:"prof__spec"},K={class:"prof__spec"},X={class:"prof__spec"},Y={class:"prof__spec"},Z={key:1,class:"prof__block"},ee={class:"prof__specs"},se={class:"prof__spec"},te={class:"prof__spec"},oe={key:2,class:"prof__block"},le={key:3,class:"prof__empty"},ae=x({__name:"ProfileView",setup(ne){constS={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده",REJECTED:"رد شده"},T=L(),o=d(null),_=d(!1),h=v(()=>{vars;return((s=o.value)==null?void0:s.verificationStep)==="VERIFIED"}),B=v(()=>{vart;consts=(t=o.value)==null?void0:t.verificationStep;return!!s&&s!=="VERIFIED"&&s!=="STEP_TWO_SUBMITTED"}),C=z(),l=d(null),p=d(!1),u=s=>Number(s??0),b=s=>u(s)>0?"بدهکار":u(s)<0?"بستانکار":"",E=s=>u(s)>0?"is-debt":u(s)<0?"is-credit":"",V=s=>`${Math.abs(u(s)).toLocaleString("fa-IR",{maximumFractionDigits:3})} گرم`,D=s=>`${Math.abs(u(s)).toLocaleString("fa-IR")} ریال`,P=v(()=>{consts=l.value;if(!(s!=null&&s.at))return"";constt=newDate(s.at).toLocaleString("fa-IR",{dateStyle:"short",timeStyle:"short"});returns.source==="stored"?`آخرین ماندهی ثبتشده — ${t}`:`از ${s.provider??"حسابداری"} — ${t}`});asyncfunctionR(){p.value=!0;try{l.value=awaitg.getAccountingBalance()}catch{l.value=null}finally{p.value=!1}}returnw(async()=>{if(T.isLoggedIn){R(),_.value=!0;try{o.value=awaitg.getMe()}finally{_.value=!1}}}),(s,t)=>{constN=F("container");returni(),n("div",A,[r(U,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),r(N,{class:"prof__body"},{default:M(()=>{varI;return[e("section",W,[e("div",q,[r(y,{icon:"vuesax-linear:user",size:"30"})]),e("h2",H,a(((I=o.value)==null?void0:I.fullName)??"—"),1),o.value?(i(),n("p",J,a(o.value.mobile),1)):c("",!0),o.value?(i(),n("span",{key:1,class:f(["prof__seal",h.value?"is-ok":"is-pending"])},a(S[o.value.verificationStep]??o.value.verificationStep),3)):c("",!0)]),o.value?(i(),n("section",Q,[r(m,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",j,[e("div",G,[t[1]||(t[1]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,a(o.value.fullName),1)]),e("div",K,[t[2]||(t[2]=e("dt",null,"تلفن همراه",-1)),e("dd",null,a(o.value.mobile),1)]),e("div",X,[t[3]||(t[3]=e("dt",null,"کد ملی",-1)),e("dd",null,a(o.value.nationalCode||"-"),1)]),e("div",Y,[t[4]||(t[4]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,a(S[o.value.verificationStep]??o.value.verificationStep),1)])])])):c("",!0),l.value&&l.value.source!=="none"?(i(),n("section",Z,[r(m,{title:"ماندهی حساب",subtitle:P.value},null,8,["subtitle"]),e("dl",ee,[e("div",se,[t[5]||(t[5]=e("dt",null,"ماندهی طلا",-1)),e("dd",{class:f(E(l.value.gold))},[k(a(V(l.value.gold))+" ",1),e("small",null,a(b(l.value.gold)),1)],2)]),e("div",te,[t[6]||(t[6]=e("dt",null,"ماندهی ریالی",-1)),e("dd",{class:f(E(l.value.rial))},[k(a(D(l.value.rial))+" ",1),e("small",null,a(b(l.value.rial)),1)],2)])])])):p.value?(i(),n("section",oe,[r(m,{title:"ماندهی حساب",subtitle:"در حال دریافت از حسابداری…"}),t[7]||(t[7]=e("div",{class:"prof__specs prof__skeleton"},null,-1))])):_.value?c("",!0):(i(),n("section",le,[r(y,{icon:"vuesax-linear:user",size:"26"}),t[8]||(t[8]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))])),B.value?(i(),n("button",{key:4,type:"button",class:"prof__complete",onClick:t[0]||(t[0]=ie=>$(C).push({name:"completeProfile"}))}," تکمیل پروفایل ")):c("",!0)]}),_