import{dasO,gasl,vasS,oasV,casj,baso,wasp,aasr,easL,JasA,jask,Das_,_asJ}from"./index-d718011e.js";import{_asW}from"./BasicModal.vue_vue_type_style_index_0_lang-7cc4ab5d.js";import{_asX}from"./BasicMainCard-f06c4dad.js";import{_asq,uasz}from"./useBaseTable-01dc558f.js";import{_asG}from"./button.vue_vue_type_style_index_0_lang-86273660.js";import{easH,fasK,hasQ}from"./competition-f71d069a.js";import{tasY,aasZ}from"./useDataTime-5a09f654.js";import{IasC}from"./Icon-cc126d0d.js";import{_asee}from"./TextPreview.vue_vue_type_script_setup_true_lang-2590f9d7.js";import{aaste}from"./index-4e5c2990.js";import"./index-5ade1644.js";import"./isSymbol-e219d64b.js";import"./_plugin-vue_export-helper-0ed48b96.js";import"./vnode-0b482026.js";import"./index-eb860757.js";import"./DialogWrap-944b6cdf.js";import"./shallowequal-c9e151d3.js";import"./omit-86fc1094.js";import"./pickAttrs-49bc9c67.js";import"./index-12b8b726.js";import"./styleChecker-351d08aa.js";import"./FormItemContext-6bb05345.js";import"./Grid-162208a5.js";import"./index-68cba126.js";import"./index-5b828516.js";import"./index-7eae579c.js";import"./useState-d226846a.js";import"./useRefs-373e2aeb.js";import"./_flatRest-e8ea393e.js";import"./isMobile-e2e89480.js";import"./index-44f8c87e.js";import"./Col-7aad654b.js";import"./isPlainObject-63126d02.js";import"./updateLocale-dac04afb.js";import"./useMemo-9e09b0c8.js";import"./lodash-02d12c59.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-e23cf95b.js";import"./index-ba4d9879.js";import"./SearchOutlined-31f9ef0b.js";import"./index-cbb71dc1.js";import"./Badge-bf61afe1.js";import"./isNumeric-3f69e2aa.js";import"./index-9747fd4d.js";import"./index-6fc61bbd.js";import"./index-59898946.js";import"./css-aae66f86.js";import"./toArray-02b8a08a.js";import"./index-7a44352f.js";import"./textUtils-c37780ad.js";constoe=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:m=>m.record.index+1},{title:"نام مسابقه",dataIndex:"match_title",key:"match_title"},{title:"شرح مسابقه",dataIndex:"match_description",key:"match_description",slot:"match_description"},{title:"نام کاربر",dataIndex:"user_name",key:"user_name"},{title:"شماره همراه",dataIndex:"user_mobile",key:"user_mobile"},{title:"امتیاز کسب شده",dataIndex:"score",key:"score",align:"center",customRender:m=>m.record.score||0},{title:"زمان",dataIndex:"created_at",key:"created_at",customRender:m=>Y(m.record.created_at)}],ae={class:"flex justify-between items-center mb-4"},le=r("h2",null,"امتیازات و برندگان مسابقات",-1),ie={class:"flex gap-2"},re={class:"space-y-4"},ne=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),se={class:"space-y-4"},ce=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),rt=O({__name:"index",setup(m){constw=te,B=l(null),[E,de]=z(),f=l(!1),g=l(!1),n=l(void0),s=l(void0),d=l([]),h=l(!1),b=l(!1),$=l(!1),T=l({columns:oe,api:H,defaultPageLimit:20});asyncfunctiony(){try{h.value=!0;constt=awaitK();d.value=(t||[]).map(e=>({label:e.title||`مسابقه ${e.id}`,value:e.id}))}catch(t){console.error("Error loading matchs:",t),_.error("خطا در بارگذاری لیست مسابقات")}finally{h.value=!1}}functionR(){n.value=void0,f.value=!0,d.value.length===0&&y()}functionI(){f.value=!1,n.value=void0}functionF(){s.value=void0,g.value=!0,d.value.length===0&&y()}functionM(){g.value=!1,s.value=void0}functionN(){if(!s.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}constt=d.value.find(v=>v.value===s.value),e=encodeURIComponent((t==null?void0:t.label)||`مسابقه_${s.value}`),i=`/lottery?matchId=${s.value}&title=${e}`;window.open(i,"_blank","width=1200,height=800"),M()}asyncfunctionP(){if(!n.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}try{b.value=!0;constt=awaitQ(n.value);if(t.length===0){_.warning("برای این مسابقه برندهای یافت نشد");return}c