import{d as T}from"./index-Cp2ysxOb.js";import{d as D,F as v,G as E,o as G,u as O,c as t,g as w,I as p,a as u,b as r,O as i,V as k,X as P,N as e,M as g,e as n,L as C,t as V,P as N,_ as Q,Q as U}from"./main-2rA8bEUg.js";const W={key:0},X={class:"skeleton-wrapper"},q={class:"skeleton-counter"},z={style:{width:"90%",display:"flex","justify-content":"space-between","margin-bottom":"10px"}},A={style:{width:"90%",display:"flex","justify-content":"space-between","margin-bottom":"10px"}},H={style:{width:"90%",display:"flex","justify-content":"space-between","margin-bottom":"10px"}},J={style:{margin:"10px 0",display:"flex","justify-content":"center"}},K={key:1},Y={style:{display:"flex","justify-content":"space-between","margin-bottom":"20px"}},Z={style:{display:"flex"}},ee=["src","alt"],te={key:0},le={class:"list-wrapper"},ae={key:0,class:"text-center",style:{"margin-top":"20px"}},se={key:1,class:"empty-wrapper"},ne={key:0,class:"x-centered"},ue=D({__name:"list",setup(oe){const y=v(""),d=v(1),c=v(!0),x=v(!1),b=v(!0),h=v(""),f=v(""),_=v([]),L=async()=>{d.value++,x.value=!0;const s=await w.getPresaleRecords(d.value,{search:y.value,networkId:h.value,status:f.value});x.value=!1,_.value=[..._.value,...s.records],d.value>=s.totalPage&&(c.value=!1)},M=T(async()=>{d.value=1;const s=await w.getPresaleRecords(d.value,{search:y.value,networkId:h.value,status:f.value});_.value=s.records,d.value>=s.totalPage?c.value=!1:c.value=!0},500);E([y,h,f],M),G(async()=>{var o;const{setTitle:s}=O();if(s(t.lang.presaleList),(o=t.listProps)!=null&&o.records)_.value=t.listProps.records,b.value=!1,d.value>=t.listProps.totalPage?c.value=!1:c.value=!0;else{const a=await w.getPresaleRecords();_.value=a.records,b.value=!1,d.value>=a.totalPage?c.value=!1:c.value=!0}});const j=s=>{var o;return s=s.toLowerCase(),(o=t.imagesUrl)!=null&&o.endsWith("/")?`${t.imagesUrl}${s}.svg`:`${t.imagesUrl}/${s}.svg`};return(s,o)=>{const a=p("el-skeleton-item"),I=p("el-skeleton"),m=p("el-option"),R=p("el-select"),$=p("el-input"),B=p("el-button"),F=p("el-empty"),S=p("RouterLink");return b.value?(r(),u("div",W,[i("div",X,[(r(),u(k,null,P(12,l=>e(I,{animated:"",style:{display:"flex","flex-direction":"column","align-items":"center"},key:l},{template:g(()=>[e(a,{variant:"h3",style:{"margin-bottom":"10px",width:"150px"}}),e(a,{variant:"text",style:{"margin-bottom":"10px",width:"170px"}}),i("div",q,[e(a,{variant:"text"}),e(a,{variant:"text"}),e(a,{variant:"text"}),e(a,{variant:"text"})]),e(a,{variant:"text",style:{width:"90%","margin-bottom":"20px"}}),i("div",z,[e(a,{variant:"text",style:{width:"40%"}}),e(a,{variant:"text",style:{width:"40%"}})]),i("div",A,[e(a,{variant:"text",style:{width:"40%"}}),e(a,{variant:"text",style:{width:"40%"}})]),i("div",H,[e(a,{variant:"text",style:{width:"40%"}}),e(a,{variant:"text",style:{width:"40%"}})]),i("div",J,[e(a,{variant:"button"})])]),_:2},1024)),64))])])):(r(),u("div",K,[i("div",Y,[i("div",Z,[e(R,{modelValue:f.value,"onUpdate:modelValue":o[0]||(o[0]=l=>f.value=l),placeholder:n(t).lang.status,style:{width:"200px","margin-right":"10px"}},{default:g(()=>[e(m,{label:n(t).lang.allPresales,value:""},null,8,["label"]),e(m,{label:n(t).lang.live,value:"started"},null,8,["label"]),e(m,{label:n(t).lang.ended,value:"ended"},null,8,["label"]),e(m,{label:n(t).lang.upcoming,value:"not-started"},null,8,["label"])]),_:1},8,["modelValue","placeholder"]),e(R,{modelValue:h.value,"onUpdate:modelValue":o[1]||(o[1]=l=>h.value=l),placeholder:n(t).lang.network,filterable:""},{default:g(()=>[e(m,{label:n(t).lang.allNetworks,value:""},null,8,["label"]),(r(!0),u(k,null,P(n(t).networks,l=>(r(),C(m,{label:l.name,value:l.id,key:l.id},{default:g(()=>[i("img",{src:l.imageUrl??j(l.nativeCurrency.symbol),alt:l.name,class:"network-choose-icon"},null,8,ee),i("span",null,V(l.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e($,{modelValue:y.value,"onUpdate:modelValue":o[2]||(o[2]=l=>y.value=l),placeholder:n(t).lang.search,style:{width:"200px"}},null,8,["modelValue","placeholder"])]),_.value.length?(r(),u("div",te,[i("div",le,[(r(!0),u(k,null,P(_.value,l=>(r(),C(Q,{key:l.key,presale:l},null,8,["presale"]))),128))]),c.value?(r(),u("div",ae,[e(B,{type:"primary",onClick:L,loading:x.value},{default:g(()=>[U(V(n(t).lang.loadMore),1)]),_:1},8,["loading"])])):N("",!0)])):(r(),u("div",se,[e(F,{description:n(t).lang.noPresaleRecord},null,8,["description"]),n(t).creator?(r(),u("div",ne,[e(S,{to:"/presale/create",class:"el-button el-button--primary mx-auto"},{default:g(()=>[U(V(n(t).lang.createPresale),1)]),_:1})])):N("",!0)]))]))}}});export{ue as default};
