import{d as a,u as e,r as s,s as t,q as l,e as i,x as o,U as r,V as u,J as v,z as c,o as n,f as d,P as p,g as m,N as y,au as f,F as g,j as b,l as C,Y as k,n as _,h as x,O as h,X as w,m as L,t as B,I as N,A as j,av as I,_ as z}from"./index_1730355987.js";/* empty css                  *//* empty css                  */import{_ as P}from"./index_173035598733.js";import{p as R}from"./props_1730355987.js";const S={class:"page"},U={class:"page-body"},A={style:{"font-size":"0.4rem"}},D={class:"content_body"},T={class:"body"},F={class:"title-btn"},O=["onClick"],E={class:"left"},G={class:"title"},J={class:"right"},q={class:"gezi"},M=["onClick"],V=["onClick"],X=["onClick"],Y=z(a({__name:"index",setup(a){const z=e(),Y=s(""),$=t(),H=l(),K=R(),Q=s(0),W=s(0),Z=i((()=>a=>{let e=0,s=ua.value.rows[a]._id||0;return ea.value[`${s}_award`]?e=2:ea.value[s]>=ua.value.rows[a].value&&(e=1),e})),aa=i((()=>a=>a?a.sort((function(a,e){return e.sort-a.sort})):[]));o(W,(async()=>{va()}));const ea=s({}),sa=i((()=>JSON.parse(r.getStorage(u.PROPS_DATA)||"")||[])),ta=i((()=>(a,e)=>4==a||5==a?ea.value[e]?(ea.value[e]/1e4).toFixed(2):0:ea.value[e]?ea.value[e]:0)),la=i((()=>(a,e)=>4==a||5==a?(e/1e4).toFixed(2):e)),ia=async(a,e)=>{const s=ua.value.rows[a];if(2==e)return B("Recebido");if(1==e){const a=await c.getTaskAward({ids:[s._id]});return 0!=a.code?void B(a.txt):(B("Recebido com sucesso"),z.getUserInfo(),void(await va()))}if(0==e)for(let t=0;t<s.ruleList.length;t++){let a=s.ruleList[t];if(19==a.ruleCode){const a=await c.getGameUrl({gameId:s.ruleList[t].value});if(0!=a.code)return void B(a.txt);H.setStartGameInfo(a.data);break}if(18==a.ruleCode){const e={type:2,value:a.value};H.setSearchData(e),$.push("/search");break}if(0==a.ruleCode){$.push("/deposit");break}}};const oa=s([]);v((async()=>{await ca()}));const ra=a=>{W.value=oa.value[a.name].activity[0].activityCode,Y.value=oa.value[a.name].activity[0].imgBanner},ua=s({}),va=async()=>{c.getTaskList({activityCode:W.value}).then((a=>{if(0===a.code&&(ua.value={...a.data},ea.value=a.data.progress?a.data.progress:{},a.data.props))for(let e=0;e<a.data.props.length;e++)K.setPropsData(a.data.props[e])}))},ca=async()=>{const a=await c.getCustomClassList();0===a.code&&(oa.value=a.data.filter((a=>0!==a.activity.length)),W.value=oa.value[Q.value].activity[0].activityCode,Y.value=oa.value[Q.value].activity[0].imgBanner)};return(a,e)=>{const s=P,t=N,l=j,i=I,o=f;return n(),d("div",S,[p(s,{title:"Missoes Dirias"}),m("div",U,[p(o,{active:Q.value,"onUpdate:active":e[0]||(e[0]=a=>Q.value=a),background:"#20252a",color:"#00E7BB","title-active-color":"#00E7BB","title-inactive-color":"#8d9e9a",onClickTab:ra},{default:y((()=>[(n(!0),d(g,null,b(oa.value,((a,e)=>(n(),C(i,{key:e},{title:y((()=>[m("span",A,k(a.className),1)])),default:y((()=>[m("div",D,[m("div",T,[m("div",F,[(n(!0),d(g,null,b(a.activity,((a,e)=>(n(),d("div",{key:e,class:_({active:W.value===a.activityCode}),onClick:e=>async function(a){W.value=a.activityCode,Y.value=a.imgBanner}(a)},k(a.activityName),11,O)))),128))]),p(t,{src:x(h)(Y.value),style:{"max-height":"1.7rem"}},null,8,["src"])]),(n(!0),d(g,null,b(aa.value(ua.value.rows),((a,e)=>(n(),d("div",{key:e,class:"item-box"},[m("div",E,[m("div",G,[w(k(a.taskName)+" ",1),m("span",null," ("+k(Number(ta.value(a.ruleList[0].ruleCode,a._id))>Number(la.value(a.ruleList[0].ruleCode,a.value))?la.value(a.ruleList[0].ruleCode,a.value):ta.value(a.ruleList[0].ruleCode,a._id))+" / "+k(la.value(a.ruleList[0].ruleCode,a.value))+") ",1)])]),m("div",J,[m("div",q,[(n(!0),d(g,null,b(a.propsList,((a,e)=>{return n(),d("div",{class:"gezi-box",key:e},[p(l,{src:"perfil/gezi_01.png",width:"1.5rem"}),p(t,{class:"icon",src:x(h)((s=a.propId,sa.value.find((a=>a._id==s)).iconUrl))},null,8,["src"]),m("span",null,k(a.num/1e4),1)]);var s})),128))]),0==Z.value(e)?(n(),d("div",{key:0,class:"btn btn0",onClick:a=>ia(e,Z.value(e))}," Lr Para ",8,M)):1==Z.value(e)?(n(),d("div",{key:1,class:"btn btn1",onClick:a=>ia(e,Z.value(e))}," Receber ",8,V)):2==Z.value(e)?(n(),d("div",{key:2,class:"btn btn2",onClick:a=>ia(e,Z.value(e))}," Recebido ",8,X)):L("",!0)])])))),128))])])),_:2},1024)))),128))])),_:1},8,["active"])])])}}}),[["__scopeId","data-v-0b979b29"]]);export{Y as default};
