PageSourceSearch

https://bacctrack-7ha7hyw7.manus.space/assets/MemberFootballHomePage-Dgkjm7ew.js

js bacctrack-7ha7hyw7.manus.space collected 2026-10-03 05:02:49 UTC 18,570 bytes, 1 lines download raw bytes

1import{r as c,u as K,t as U,j as e,A as _,e as W,B as X,y as Y}from"./index-C3Qps0S4.js";import{I as A}from"./input-Dj8udylZ.js";import{S as ee}from"./skeleton-Dte_fR4v.js";import{g as ae,a as $,s as M,i as te}from"./footballUi-63-GIEDR.js";import{L as le,a as se,M as oe}from"./FootballHomeComponents-BE1VZLe4.js";import{C as E}from"./calendar-days-C-4YinGr.js";import{S as re}from"./search-DKbjFAwP.js";import{S as T}from"./sliders-horizontal-8DHyQzuu.js";import{R as ce}from"./refresh-cw-DwgqC19c.js";import"./dialog-BY1FISUw.js";import"./index-BKUanX19.js";import"./index-Dr02_Kwf.js";const B=6e4;function ne(t){return new Intl.DateTimeFormat("th-TH",{timeZone:"Asia/Bangkok",day:"numeric",month:"short"}).format(new Date(`${t}T12:00:00+07:00`))}function u({active:t,label:n,count:j,live:s,onClick:P}){return e.jsxs("button",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:43",type:"button","aria-pressed":t,onClick:P,className:`flex min-h-11 shrink-0 items-center gap-1.5 rounded-full px-3.5 text-[10px] font-black transition active:scale-[0.97] ${t?"bg-amber-400 text-zinc-950 shadow-[0_8px_24px_rgba(245,158,11,0.14)]":"bg-[#0b111c] text-zinc-400 ring-1 ring-white/[0.06] hover:text-white"}`,children:[s&&e.jsx("span",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:44",className:"h-1.5 w-1.5 rounded-full bg-red-500"}),n,e.jsx("span",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:46",className:`rounded-full px-1.5 py-0.5 text-[9px] tabular-nums ${t?"bg-black/10":"bg-white/[0.05] text-zinc-500"}`,children:j})]})}function ie(){return e.jsx("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:52","aria-label":"กำลังโหลดการแข่งขัน",className:"space-y-3",children:[0,1,2].map(t=>e.jsx(ee,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:52",className:"h-32 rounded-2xl bg-white/[0.04]"},t))})}function Pe(){const t=ae(),[n,j]=c.useState(t),[s,P]=c.useState("all"),[H,N]=c.useState(""),w=c.useDeferredValue(H.trim()),[m,y]=c.useState("all"),[f,v]=c.useState(null),[k,i]=c.useState(1),[R,V]=c.useState({}),[,Q]=K(),q=c.useMemo(()=>
1({date:n,page:k,pageSize:24,status:s,search:w||void 0,country:m==="all"?void 0:m,leagueId:f}),[m,n,w,f,k,s]),d=U.football.member.home.useQuery(q,{staleTime:s==="live"?B:5*6e4,refetchInterval:s==="live"?B:!1,refetchIntervalInBackground:!1,retry:1}),l=d.data,z=l?.matches??[],C=c.useMemo(()=>{const a=new Map;for(const o of z){const b=a.get(o.country.name)??new Map,F=`${o.league.id}:${o.league.name}`;b.set(F,[...b.get(F)??[],o]),a.set(o.country.name,b)}return Array.from(a.entries())},[z]),S=a=>{j(a),i(1)},g=a=>{P(a),i(1)},O=()=>{N(""),y("all"),v(null),i(1)},Z=!!(H.trim()||m!=="all"||f!==null),x=l?.summary??{all:0,live:0,upcoming:0,finished:0,ai:0};return e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:115",className:"mx-auto w-full max-w-3xl space-y-4 pb-3 text-zinc-100",children:[e.jsxs("header",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:116",className:"overflow-hidden rounded-3xl bg-[radial-gradient(circle_at_88%_0%,rgba(245,158,11,0.12),transparent_40%),linear-gradient(145deg,#0c1422,#080c14)] p-4 shadow-[0_24px_60px_rgba(0,0,0,0.24)] ring-1 ring-white/[0.06]",children:[e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:117",className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:118",className:"min-w-0",children:[e.jsx("h1",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:119",className:"text-2xl font-black tracking-tight text-white",children:"ฟุตบอล"}),e.jsxs("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:120",className:"mt-1.5 text-sm font-bold text-zinc-200",children:[n===t?"วันนี้มีการแข่งขัน":`${ne(n)} มีการแข่งขัน`," ",x.all.toLocaleString()," คู่"]})]}),e.jsxs("span",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:122",className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-400/[0.08] px-2.5 py-1.5 text-[9px] font-black text-emerald-300",children:[e.jsx(_,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:122",className:"h-3 w-3"})," ข้อมูลจริง"]})]}),l?.freshness.updatedAt&&e.jsxs("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:124",className:"mt-3 text-[9px] text-zinc-600",children:["อัปเดตล่าสุด ",$(l.freshness.updatedAt)," น."]}),s==="live"&&e.jsx("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:125",className:"mt-1 text-[9px] text-red-300",children:"LIVE อัปเดตทุก 60 วินาทีขณะเปิดหน้านี้"})]}),e.jsx("section",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:128","aria-label":"เลือกวันที่แข่งขัน",className:"rounded-2xl bg-[#0b111c]/95 p-2.5 ring-1 ring-white/[0.055]",children:e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:129",className:"grid grid-cols-4 gap-1.5",children:[[[M(t,-1),"เมื่อวาน"],[t,"วันนี้"],[M(t,1),"พรุ่งนี้"]].map(([a,o])=>e.jsx("button",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:134",type:"button",onClick:()=>S(a),className:`min-h-11 rounded-xl border px-1 text-[10px] font-black transition active:scale-[0.97] ${n===a?"border-amber-400/40 bg-amber-400/10 text-amber-300":"border-white/[0.06] text-zinc-500"}`,children:o},a)),e.jsxs("label",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:135",className:`relative flex min-h-11 cursor-pointer items-center justify-center rounded-xl border ${[M(t,-1),t,M(t,1)].includes(n)?"border-white/[0.06] text-zinc-500":"border-amber-400/40 bg-amber-400/10 text-amber-300"}`,children:[e.jsx(E,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:136",className:"h-4 w-4"}),e.jsx("span",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:136",className:"sr-only",children:"เลือกวันที่อื่น"}),e.jsx(A,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:137",type:"date",value:n,onChange:a=>te(a.target.value)&&S(a.target.value),"aria-label":"เลือกวันที่อื่น",className:"absolute inset-0 h-full w-full cursor-pointer opacity-0"})]})]})}),e.jsxs("nav",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:142","aria-label":"สถานะการแข่งขัน",className:"flex snap-x gap-1.5 overflow-x-auto pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[e.jsx(u,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:143",active:s==="all",label:"ทั้งหมด",count:x.all,onClick:()=>g("all")}),e.jsx(u,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:144",active:s==="live",label:"LIVE",count:x.live,live:!0,onClick:()=>g("live")}),e.jsx(u,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:145",active:s==="upcoming",label:"กำลังจะเริ่ม",count:x.upcoming,onClick:()=>g("upcoming")}),e.jsx(u,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:146",active:s==="finished",label:"จบแล้ว",count:x.finished,onClick:()=>g("finished")}),e.jsx(u,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:147",active:s==="ai",label:"AI พร้อม",count:x.ai,onClick:()=>g("ai")})]}),e.jsxs("section",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:150","aria-label":"ค้นหาและตัวกรองฟุตบอล",className:"rounded-2xl bg-[#0b111c]/95 p-3 ring-1 ring-white/[0.055]",children:[e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:151",className:"relative",children:[e.jsx(re,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:151",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-zinc-600"}),e.jsx(A,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:151",value:H,onChange:a=>{N(a.target.value.slice(0,80)),i(1)},placeholder:"ค้นหาทีม / ลีก / ประเทศ","aria-label":"ค้นหาทีม ลีก หรือประเทศ",className:"min-h-12 rounded-xl border-white/[0.08] bg-black/15 pl-9 text-[11px]"})]}),e.jsxs("details",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:152",className:"group mt-2 overflow-hidden rounded-xl border border-white/[0.06] bg-black/10",children:[e.jsxs("summary",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:153",className:"flex min-h-11 cursor-pointer list-none items-center gap-2 px-3 text-[10px] font-bold text-zinc-400",children:[e.jsx(T,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:153",className:"h-3.5 w-3.5 text-amber-300"})," ตัวกรองเพิ่มเติม ",e.jsx(W,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:153",className:"ml-auto h-4 w-4 transition-transform group-open:rotate-180"})]}),e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:154",className:"grid grid-cols-2 gap-2 border-t border-white/[0.05] p-2.5",children:[e.jsxs("label",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:155",className:"text-[9px] font-bold text-zinc-600",children:["ประเทศ",e.jsxs("select",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:155",value:m,onChange:a=>{y(a.target.value),v(null),i(1)},className:"mt-1 min-h-10 w-full rounded-lg border border-white/[0.08] bg-[#080d16] px-2 text-[10px] text-zinc-300",children:[e.jsx("option",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:155",value:"all",children:"ทุกประเทศ"}),l?.facets.countries.map(a=>e.jsx("option",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:155",value:a,children:a},a))]})]}),e.jsxs("label",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:156",className:"text-[9px] font-bold text-zinc-600",children:["ลีก",e.jsxs("select",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:156",value:f??"all",onChange:a=>{v(a.target.value==="all"?null:Number(a.target.value)),i(1)},className:"mt-1 min-h-10 w-full rounded-lg border border-white/[0.08] bg-[#080d16] px-2 text-[10px] text-zinc-300",children:[e.jsx("option",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:156",value:"all",children:"ทุกลีก"}),l?.facets.leagues.filter(a=>m==="all"||a.country===m).map(a=>e.jsx("option",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:156",value:a.id,children:a.name},a.id))]})]})]})]})]}),l?.freshness.stale&&e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:161",role:"status",className:"rounded-xl border border-amber-400/20 bg-amber-400/[0.05] p-3 text-[10px] leading-5 text-amber-100",children:["กำลังแสดง Cached Data ล่าสุด · อัปเดต ",$(l.freshness.updatedAt)," น."]}),e.jsxs("section",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:163","aria-labelledby":"member-football-match-center",className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:164",className:"flex items-end justify-between gap-3 px-1",children:[e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:165",children:[e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:165",className:"flex items-center gap-1.5 text-[9px] font-black uppercase tracking-[0.16em] text-zinc-500",children:[e.jsx(_,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:165",className:"h-3.5 w-3.5"})," ศูนย์รวมการแข่งขัน"]}),e.jsx("h2",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:165",
1id:"member-football-match-center",className:"mt-1 text-lg font-black text-white",children:"การแข่งขัน"})]}),e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:166",className:"text-right",children:[e.jsxs("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:166",className:"text-[10px] font-bold tabular-nums text-zinc-300",children:[l?.pagination.total??0," คู่"]}),e.jsxs("button",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:166",type:"button",onClick:()=>d.refetch(),disabled:d.isFetching,className:"mt-1 inline-flex min-h-10 items-center gap-1.5 rounded-lg px-2 text-[9px] font-bold text-amber-300 disabled:opacity-50",children:[e.jsx(ce,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:166",className:`h-3.5 w-3.5 ${d.isFetching?"motion-safe:animate-spin":""}`})," รีเฟรช"]})]})]}),d.isLoading?e.jsx(ie,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:169"}):d.error?e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:170",role:"alert",className:"rounded-2xl bg-red-500/[0.06] px-5 py-10 text-center",children:[e.jsx(T,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:170",className:"mx-auto h-8 w-8 text-red-300"}),e.jsx("h3",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:170",className:"mt-3 text-sm font-black text-red-100",children:"ไม่สามารถโหลดข้อมูลฟุตบอลได้"}),e.jsx("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:170",className:"mt-1 text-[10px] leading-5 text-zinc-500",children:"ระบบไม่สร้างข้อมูลทดแทน กรุณาตรวจการเชื่อมต่อแล้วลองอีกครั้ง"}),e.jsx("button",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:170",type:"button",onClick:()=>d.refetch(),className:"mt-3 min-h-11 rounded-xl bg-red-400 px-4 text-[10px] font-black text-zinc-950 active:scale-[0.97]",children:"ลองอีกครั้ง"})]}):C.length===0?e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:172",className:"rounded-2xl border border-dashed border-white/10 bg-[#0b111c]/70 px-5 py-10 text-center",children:[e.jsx(E,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:172",className:"mx-auto h-8 w-8 text-zinc-600"}),e.jsx("h3",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:172",className:"mt-3 text-sm font-black text-white",children:"ไม่พบการแข่งขันในรายการที่เลือก"}),e.jsx("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:172",className:"mt-1 text-[10px] leading-5 text-zinc-500",children:"อาจยังไม่มีข้อมูลจริง หรือเงื่อนไขการค้นหาไม่ตรงกับรายการในวันนี้"}),Z&&e.jsx("button",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:172",type:"button",onClick:O,className:"mt-3 min-h-10 rounded-xl border border-white/10 px-3 text-[10px] font-bold text-zinc-300",children:"ล้างตัวกรอง"})]}):C.map(([a,o])=>{const b=Array.from(o.values())[0]?.[0],F=Array.from(o.values()).reduce((p,h)=>p+h.length,0);return e.jsxs("section",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",className:"space-y-2.5",children:[e.jsxs("div",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",className:"flex items-center gap-2 px-1 pt-1",children:[b?.country.flag?e.jsx("img",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",src:b.country.flag,alt:`ธง ${a}`,className:"h-4 w-5 rounded-sm object-cover",loading:"lazy",referrerPolicy:"no-referrer"}):e.jsx("span",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176","aria-hidden":!0,children:"⚽"}),e.jsx("h3",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",className:"min-w-0 truncate text-[13px] font-black text-white",children:a}),e.jsxs("span",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",className:"ml-auto rounded-full border border-white/[0.07] px-2 py-1 text-[9px] font-bold text-zinc-500",children:[F," คู่"]})]}),Array.from(o.entries()).map(([p,h],G)=>{const I=h[0].league,L=R[p]??G<2;return e.jsx(le,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",leagueName:I.name,leagueLogo:I.logo,matchCount:h.length,expanded:L,onToggle:()=>V(r=>({...r,[p]:!L})),children:h.map(r=>{const J=r.analysis.ready&&(r.analysis.level==="high"||r.analysis.level==="medium")?r.analysis.level:void 0,D={match:r,aiLevel:J,onOpen:()=>Q(`/football/match/${r.fixtureId}`)};return r.status.phase==="live"?e.jsx(se,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",...D},r.fixtureId):e.jsx(oe,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:176",...D},r.fixtureId)})},p)})]},a)}),l&&l.pagination.totalPages>1&&e.jsxs("nav",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:179","aria-label":"หน้ารายการแข่งขัน",className:"flex items-center justify-between rounded-xl border border-white/[0.06] bg-[#0b111c] p-2",children:[e.jsxs("button",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:179",type:"button",disabled:!l.pagination.hasPrevious,onClick:()=>i(a=>Math.max(1,a-1)),className:"flex min-h-10 items-center gap-1 rounded-lg px-3 text-[10px] font-bold text-zinc-300 disabled:opacity-30",children:[e.jsx(X,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:179",className:"h-4 w-4"})," ก่อนหน้า"]}),e.jsxs("span",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:179",className:"text-[10px] font-bold tabular-nums text-zinc-500",children:[l.pagination.page," / ",l.pagination.totalPages]}),e.jsxs("button",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:179",type:"button",disabled:!l.pagination.hasNext,onClick:()=>i(a=>a+1),className:"flex min-h-10 items-center gap-1 rounded-lg px-3 text-[10px] font-bold text-zinc-300 disabled:opacity-30",children:["ถัดไป ",e.jsx(Y,{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:179",className:"h-4 w-4"})]})]})]}),e.jsxs("footer",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:182",className:"space-y-1.5 py-3 text-center text-[9px] leading-4 text-zinc-600",children:[e.jsx("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:182",children:"แสดงเฉพาะข้อมูลการแข่งขันจริงที่ระบบได้รับ"}),e.jsx("p",{"data-loc":"client/src/pages/MemberFootballHomePage.tsx:182",children:"ผลวิเคราะห์เป็นการประเมินทางสถิติ ไม่รับประกันผลการแข่งขันจริง"})]})]})}export{Pe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.