import{_ as w,O as y,o as l,c as a,a as t,s as o,t as n,j as g,f as u,k as _,u as m,d as v,F as h,i as f}from"./app-9daf7b25.js";const k={name:"league-info-box",props:{domain_color:String,market:Object,league:Object,registration:{type:Boolean,required:!1},selectedLeague:Number},data(){return{submittingLeague:null}},mounted(){},computed:{},methods:{chooseLeague(s){this.$emit("chooseLeague",s)},goToRegistration(s){s.private?this.$emit("accessCodeModal",s):(this.submittingLeague=s.id,y.post(route("registration.initiate.process",{league_id:s.id})))},openLeagueAccessCodeModal(s,d){this.privateLeague=s,this.privateTeam=d,this.$refs.leagueAccessCodeModal.openModal()},regularTitleEndDate(s){let d=s.registrations.find(x=>x.name.indexOf("Late")>-1),e=new Date(s.local_reg_end);return e.setHours(e.getHours()-1),s.canAddPlayer?d?d.modifier_status=="during"?{date:new Date(d.local_end_date).getTime(),message:"*late fees now apply"}:{date:e,message:null}:{date:e,message:null}:{date:new Date(d.local_end_date).getTime(),message:"*FULL - REGISTRATION CLOSED"}},priceModifierClass(s,d){return s.name.indexOf("Late")>-1?s.modifier_status!="during"?"hidden":"text-red bg-yellow-500 bg-opacity-75 font-bold":s.name=="Regular"?d.after_regular_reg?"font-bold line-through":"font-bold":s.modifier_status=="past"?"text-red line-through":"text-red"},getEndOfLateReg(s){return s.registrations.find(e=>e.name.indexOf("Late")>-1).local_display_end}}},b={class:"flex-grow mr-4"},L={class:"flex flex-wrap w-full md:w-auto items-center cursor-pointer"},M={class:"flex-grow md:mr-4"},C={class:"flex flex-wrap items-center cursor-pointer"},B={class:"w-full text-left"},D=t("div",{class:"mr-1"},"Sign up opens on",-1),S=t("div",{class:"mr-1"},"Sign up closes on",-1),T={key:0},O={key:1},F=t("svg",{class:"inline-block",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},[t("path",{class:"heroicon-ui",d:"M15.3 9.3a1 1 0 0 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4l3.3 3.29 3.3-3.3z"})],-1),N=t("span",null,"See more",-1),E=t("svg",{class:"inline-block",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},[t("path",{class:"heroicon-ui",d:"M15.3 9.3a1 1 0 0 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4l3.3 3.29 3.3-3.3z"})],-1),A=[F,N,E],H=t("svg",{class:"h-6 w-6 animate-spin inline",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),j=[H],z={key:0,class:"flex flex-wrap text-left break-words"},P={class:"w-full mb-6"},V={key:0,class:"mb-2"},I=t("span",{class:"text-gray"},"Description:",-1),U={key:1,class:"mb-2"},q=t("span",{class:"text-gray"},"Notes:",-1),G={key:2},J=t("span",{class:"text-gray mr-2"},"Sport:",-1),K={key:3},Q=t("span",{class:"text-gray mr-2"},"Location:",-1),W=["href"],X={key:4},Y=t("span",{class:"text-gray mr-2"},"League Bar:",-1),Z=["href"],R={key:5,class:"flex"},p=t("span",{class:"text-gray mr-2"},"Day & Time:",-1),$=t("span",{class:"text-gray mr-2"},"League Start Date:",-1),ee={key:0},te={key:1},le=t("span",{class:"text-gray mr-2"},"League End Date:",-1),ae={key:0},se={key:1},ie={class:"flex mt-2"},ne=t("span",{class:"text-gray mr-2"},"Price:",-1),de={class:"hidden md:inline"},oe={class:"inline md:hidden"},re=t("br",null,null,-1),ue={class:"w-full md:w-1/3 text-center px-4 mt-4"},ce=t("svg",{class:"h-6 w-6 animate-spin inline",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),ge=[ce],_e=t("svg",{class:"inline-block",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},[t("path",{class:"heroicon-ui",d:"M8.7 14.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L12 11.42l-3.3 3.3z"})],-1),me=t("span",null,"See less",-1),he=t("svg",{class:"inline-block",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},[t("path",{class:"heroicon-ui",d:"M8.7 14.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L12 11.42l-3.3 3.3z"})],-1),fe=[_e,me,he];function xe(s,d,e,x,c,r){return l(),a("div",{class:o(["mb-4 p-4 block",{"border border-gray":e.selectedLeague!=e.league.id,"border-2 border-black":e.selectedLeague==e.league.id}])},[t("div",{class:o(["flex flex-col md:flex-row items-start",{"mb-5":e.selectedLeague==e.league.id}])},[t("div",b,[t("div",L,[t("div",{class:o(["flex items-start",{"mb-5":e.selectedLeague==e.league.id}])},[t("div",M,[t("div",C,[t("div",B,n(e.league.name),1),e.league.is_registration_open?(l(),a("div",{key:1,class:o(["w-full md:flex",["text-"+e.domain_color]])},[S,t("div",null,[e.league.is_late_reg?(l(),a("span",O,n(r.getEndOfLateReg(e.league))+" "+n(r.regularTitleEndDate(e.league).message),1)):(l(),a("span",T,n(e.league.buffered_local_reg_end)+" "+n(r.regularTitleEndDate(e.league).message),1))])],2)):(l(),a("div",{key:0,class:o(["w-full flex",["text-"+e.domain_color]])},[D,t("div",null,[t("span",null,n(e.league.local_reg_start),1)])],2)),e.selectedLeague!=e.league.id?(l(),a("div",{key:2,onClick:d[0]||(d[0]=g(i=>r.chooseLeague(e.league),["prevent"])),class:"cursor-pointer text-pickleball-gray my-4 md:mt-2 md:mb-0 text-sm w-full md:w-auto text-center md:text-left",id:"toggle-league-box"},A)):u("",!0)])])],2)])]),e.league.is_registration_open?(l(),a("button",{key:0,class:o(["block flex-shrink-0 text-white px-6 py-3 rounded-full w-full md:w-[160px]",["bg-"+e.domain_color]]),onClick:d[1]||(d[1]=g(i=>r.goToRegistration(e.league),["prevent"]))},[_(t("span",null,j,512),[[m,c.submittingLeague==e.league.id]]),_(t("span",null,"Sign Up Now!",512),[[m,c.submittingLeague!=e.league.id]])],2)):u("",!0)],2),e.selectedLeague==e.league.id?(l(),a("div",z,[t("div",P,[e.league.league_detail?(l(),a("div",V,[I,v(" "+n(e.league.league_detail),1)])):u("",!0),e.league.notes?(l(),a("div",U,[q,v(" "+n(e.league.notes),1)])):u("",!0),e.league.activity?(l(),a("div",G,[J,t("span",null,n(e.league.activity.name),1)])):u("",!0),e.league.home_location?(l(),a("div",K,[Q,t("span",null,n(e.market.type==="flex"?"Home team location":e.league.home_location.name),1),e.market.type!=="flex"?(l(),a("a",{key:0,href:e.league.home_location.map_url,class:o(["ml-1",["text-"+e.domain_color]]),target:"_blank"},"map",10,W)):u("",!0)])):u("",!0),e.league.type!="flex"&&e.league.bars.length?(l(),a("div",X,[Y,t("a",{href:s.route("league-bar-league",e.league),class:"text-red underline"},"View Bars",8,Z)])):u("",!0),e.league.days_of_week_v2?(l(),a("div",R,[p,t("ul",null,[(l(!0),a(h,null,f(e.league.days_of_week_v2,i=>(l(),a("li",{key:`league-${i.fields.day_of_week}-time`},n(s.days[i.fields.day_of_week])+" "+n(i.fields.start_time)+" - "+n(i.fields.end_time),1))),128))])])):u("",!0),t("div",null,[$,e.league.start_date?(l(),a("span",te,n(e.league.local_start_date),1)):(l(),a("span",ee,"N/A"))]),t("div",null,[le,e.league.end_date?(l(),a("span",se,n(e.league.local_end_date),1)):(l(),a("span",ae,"N/A"))]),t("div",ie,[ne,t("ul",null,[(l(!0),a(h,null,f(e.league.sortedPriceModifiers,i=>(l(),a("li",de,[t("div",null,[t("p",{class:o(["inline-block",r.priceModifierClass(i,e.league)]),style:{"min-width":"90px"}},n(i.name),3),t("p",{class:o(["inline-block",r.priceModifierClass(i,e.league)]),style:{"min-width":"230px","margin-left":"-4px"}}," (until "+n(i.local_display_end)+"): ",3),t("p",{class:o(["inline-block",r.priceModifierClass(i,e.league)]),style:{"margin-left":"-4px"}},"$"+n((parseFloat(e.league.base_registration_fee)+parseFloat(i.price_modifier)).toFixed(2)),3),t("p",{class:o([r.priceModifierClass(i,e.league),"processing-fee inline-block"]),style:{"margin-left":"-4px"}}," +$"+n(e.league.processing_fee)+" Proc. Fee",3)])]))),256)),(l(!0),a(h,null,f(e.league.sortedPriceModifiers,i=>(l(),a("li",oe,[t("div",null,[t("p",{class:o(["inline-block",r.priceModifierClass(i,e.league)]),style:{"min-width":"90px"}},n(i.name)+" - $"+n((parseFloat(e.league.base_registration_fee)+parseFloat(i.price_modifier)).toFixed(2)),3),re,t("p",{class:o(["inline-block",r.priceModifierClass(i,e.league)]),style:{"min-width":"230px","margin-left":"-4px"}}," (until "+n(i.local_display_end)+") ",3)])]))),256))])]),t("div",ue,[e.league.is_registration_open?(l(),a("button",{key:0,class:o(["block text-white px-6 py-3 rounded-full w-full md:w-[160px] md:hidden",["bg-"+e.domain_color]]),onClick:d[2]||(d[2]=g(i=>r.goToRegistration(e.league),["prevent"]))},[_(t("span",null,ge,512),[[m,c.submittingLeague==e.league.id]]),_(t("span",null,"Sign Up Now!",512),[[m,c.submittingLeague!=e.league.id]])],2)):u("",!0),t("div",{onClick:d[3]||(d[3]=g(i=>r.chooseLeague(e.league),["prevent"])),class:"cursor-pointer text-pickleball-gray my-4 md:mt-2 md:mb-0 text-sm w-full md:w-auto text-center md:text-left",id:"toggle-league-box"},fe)])])])):u("",!0)],2)}const we=w(k,[["render",xe]]);export{we as L};