1import{r as n,j as t}from"./react-hjugPBHt.js";import{S as w}from"./SportLayout-DOxVJwg4.js";import{U as C}from"./UpcomingEventsSection-xaJ9F5pp.js";import{u as S}from"./hooks-CGoafQaF.js";import{T as D,a as k,b as f,c as g,d as E,e as u}from"./table-CCmk8KX0.js";import{h as T}from"./react-router-BnmG33x5.js";import{k as $}from"./lucide-react-D2ezXDK7.js";import"./domelementtype-Hhjmd4mY.js";import"./react-helmet-async-BpBnby4t.js";import"./react-fast-compare-Byo-ga8C.js";import"./invariant-CEp42e9a.js";import"./shallowequal-D9o220NQ.js";import"./ShopSection-BEukjSU9.js";import"./branding-K4eTRgvQ.js";import"./@radix-ui/react-accordion-YYHDTZgn.js";import"./@radix-ui/react-context-9pAyovQH.js";import"./@radix-ui/react-collection-liLD_iFB.js";import"./@radix-ui/react-compose-refs-DUPPCC-k.js";import"./@radix-ui/react-slot-CxuMvIGs.js";import"./@radix-ui/primitive-DW48STyt.js";import"./@radix-ui/react-use-controllable-state-BPE2C3fY.js";import"./@radix-ui/react-use-callback-ref-Dd1u31eE.js";import"./@radix-ui/react-primitive-C7FeKbyB.js";import"./react-dom-DWp2JiDF.js";import"./scheduler-CzFDRTuY.js";import"./@radix-ui/react-collapsible-DuZGEXEj.js";import"./@radix-ui/react-use-layout-effect-C_RT5F2F.js";import"./@radix-ui/react-presence-CCbSYLpT.js";import"./@radix-ui/react-id-DX0MWrQ2.js";import"./@radix-ui/react-direction-BbDt4bBW.js";import"./main-QvF0XFdb.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./@radix-ui/react-toast-r75ISHYn.js";import"./@radix-ui/react-dismissable-layer-2v6z3p7o.js";import"./@radix-ui/react-use-escape-keydown-Zdsw1twz.js";import"./@radix-ui/react-portal-CmW5xNB6.js";import"./@radix-ui/react-visually-hidden-W6cWc-XS.js";import"./class-variance-authority-Dp3B9jqt.js";import"./clsx-B-dksMZM.js";import"./tailwind-merge-Dnoi3Axr.js";import"./next-themes-Bo1Io8L_.js";import"./sonner-CBPVzql-.js";import"./@radix-ui/react-tooltip-Dz0miBrH.js";import"./@radix-ui/react-popper-tN-kOCTm.js";import"./@floating-ui/react-dom-DcigoJ0U.js";import"./@floating-ui/dom-WkjZYIqi.js";import"./@floating-ui/core--P6xLIpU.js";import"./@floating-ui/utils-BPLCrzXi.js";import"./@radix-ui/react-arrow-COGtpZPl.js";import"./@radix-ui/react-use-size-CB-UdSPh.js";import"./@tanstack/query-core-BTUgESph.js";import"./@tanstack/react-query-CVvFuOeW.js";import"./react-router-dom-BcqD1g8s.js";import"./@remix-run/router-CLoMkviv.js";import"./react-ga4-CqhSH_AC.js";import"./liveBases-BeKz9ZGQ.js";import"./gameState-CKZj6Q9E.js";import"./donateLifeMonth-o_iR4RNA.js";import"./embla-carousel-react-BbWFgqq4.js";import"./embla-carousel-reactive-utils-DkegjUUZ.js";import"./embla-carousel-C8p4Yiq4.js";import"./card-ozCq-Nj-.js";import"./useTerms-CktvoGWa.js";import"./axios-D4YhIzwJ.js";import"./terms-BvIBmiEN.js";import"./useRankings-CXNInFQN.js";import"./rankings-BcE-GrPh.js";import"./sportActivity-bvcIqphl.js";const M=/^\d{4}-\d{2}$/,O=r=>r==null||r===""?"-":String(r).replace("May.","May"),P=()=>{const r=new Date,a=r.getMonth()>=6?r.getFullYear():r.getFullYear()-1;return`${a}-${String(a+1).slice(2)}`},A=r=>{const a=r.trim().match(/^(.*?)\s*\(([^)]*)\)\s*$/);return a?{label:a[1].trim(),qualifier:a[2].trim()}:{label:r.trim(),qualifier:null}},Qt=()=>{const{sportId:r}=T(),{data:a,isLoading:j}=S(r),[i,h]=n.useState([]),[y,N]=n.useState(!0);n.useEffect(()=>{if(!r)return;(async()=>{try{const s=await(await fetch(`https://api.ihsa.org/v1/sports/${r}/5-year-calendar`)).json();h(s.data||[])}catch(o){console.error("Error fetching 5-year calendar data:",o),h([])}finally{N(!1)}})()},[r]);const x=n.useMemo(()=>{var o;const e={};for(const s of i)(e[o=s.Class||""]||(e[o]=[])).push(s);return Object.entries(e).map(([s,p])=>({className:s,rows:[...p].sort((c,l)=>(c.SortOrder??0)-(l.SortOrder??0))}))},[i]),b=n.useMemo(()=>i.length?Object.keys(i[0]).filter(e=>M.test(e)).sort():[],[i]);if(j||!a)return t.jsx("div",{className:"container-xl py-8 mt-4",children:"Loading sport info..."});const m=P(),v=e=>e==="MO"?"Organization":e==="MSE"?"Solo & Ensemble":"Key Dates";return t.jsxs(w,{sportTitle:a.title,mobileAbbreviation:a.mobileAbbreviation,navItems:a.navItems,sportBasePath:a.basePath,children:[t.jsxs("div",{className:"container-xl py-8 mt-8",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"border-l-2 border-l-[#f26422] pl-4",children:[t.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-widest text-[#f26422]",children:a.title}),t.jsx("h1",{className:"mt-1 text-3xl font-bold text-[#0C2345]",children:"Calendar"}),t.jsx("p",{className:"mt-2 max-w-3xl text-gray-600",children:"State Series dates for the next five school years, including season limitations, entry deadlines, and tournament roun
1ds. Dates are set by the Board of Directors and are subject to change."})]}),t.jsxs("button",{onClick:()=>window.open(`/sports/${r}/calendar/print`,"_blank"),className:"mt-1 inline-flex shrink-0 items-center gap-2 border border-gray-300 px-4 py-2 text-sm font-medium text-[#0C2345] transition-colors hover:border-[#f26422] hover:text-[#f26422]",children:[t.jsx($,{className:"h-4 w-4"}),t.jsx("span",{className:"hidden sm:inline",children:"Print Calendar"})]})]}),t.jsx("div",{className:"mt-8",children:y?t.jsx("div",{className:"space-y-2",children:Array.from({length:8}).map((e,o)=>t.jsx("div",{className:"h-11 w-full animate-pulse bg-gray-100"},o))}):x.length===0?t.jsx("div",{className:"border border-gray-200 bg-gray-50 p-6 text-center text-sm text-gray-500",children:"No calendar dates are posted for this sport."}):x.map(({className:e,rows:o})=>t.jsx("div",{className:"mb-8 border border-gray-200 bg-white",children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs(D,{className:"w-full border-collapse",children:[t.jsx(k,{children:t.jsxs(f,{className:"border-0 hover:bg-transparent",children:[t.jsx(g,{className:"sticky left-0 z-20 border-l-4 border-l-[#f26422] bg-[#0C2345] p-3 text-left text-sm font-bold text-white",children:v(e)}),b.map(s=>t.jsx(g,{className:`whitespace-nowrap p-3 text-center text-sm font-bold text-white ${s===m?"bg-[#f26422]":"bg-[#0C2345]"}`,children:s},s))]})}),t.jsx(E,{children:o.map((s,p)=>{const{label:c,qualifier:l}=A(s.EventDescription||"");return t.jsxs(f,{className:"group border-b border-gray-100 last:border-b-0 hover:bg-transparent",children:[t.jsxs(u,{className:"sticky left-0 z-10 min-w-[15rem] bg-white p-3 align-top transition-colors group-hover:bg-[#f26422]/5",children:[t.jsx("span",{className:"block text-sm font-medium text-[#0C2345]",children:c}),l&&t.jsx("span",{className:"mt-0.5 block text-[11px] text-gray-400",children:l})]}),b.map(d=>t.jsx(u,{className:`whitespace-nowrap p-3 text-center align-top text-sm tabular-nums transition-colors group-hover:bg-[#f26422]/5 ${d===m?"bg-[#f26422]/5 font-semibold text-[#0C2345]":"text-gray-600"}`,children:O(s[d])},d))]},p)})})]})})},e))}),t.jsx("div",{className:"border-l-2 border-l-[#f26422] bg-gray-50 px-4 py-3",children:t.jsxs("p",{className:"text-sm text-gray-600",children:["All dates are subject to change. The ",m," school year is highlighted."]})})]}),t.jsx(C,{sportId:r})]})};export{Qt 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.