import{J as x,C as P,c as d,o as c,a as u,w as p,d as t,n as C,j as v,F as E,k as L,l as ,ドルb as B,t as z,y as R,q as b,r as w,g as k,h as H,s as j}from"./tXL-a5uR.js";import{x as K,Z as U,a8 as V,a7 as F,a9 as Y,a4 as J,R as W,aa as Z,ab as Q,ac as X,ad as ee,ae,af as se,D as te,z as G,ag as oe,ah as le}from"./DThBoNQI.js";import{s as ie}from"./lGy7RumW.js";const re={name:"SCalendarSubscribe",components:{SBtn:W,SBaseModal:J,SExpansionPanels:Y,SExpansionPanel:F,STooltip:V,SIcon:U},props:{sport_id:{type:Number,required:!1},schedule_id:{type:Number,required:!1},location_indicator:{type:String,required:!1},...K(),isGameCenter:{type:Boolean,default:!1}},setup(l){const a="s-calendar-subscribe",_=w(null),e=w(!1),h=w(0),i=w(""),f=w([{title:"Google",value:"google",icon:Z,type:"svg"},{title:"Exchange",value:"exchange",icon:Q,type:"svg"},{title:"Apple",value:"apple",icon:X,type:"svg"},{title:"Yahoo",value:"yahoo",icon:ee,type:"svg"},{title:"Outlook",value:"outlook",icon:ae,type:"svg"},{title:"Android",value:"android",icon:se,type:"svg"},{title:"RSS",value:"rss",icon:"icon-rss",type:"icon"}]),g=w([{title:"Excel",value:"excel",icon:"icon-download",type:"icon"},{title:"Other",value:"other",icon:"icon-calendar",type:"icon"}]),S=k(()=>i.value==="outlook"?'The Microsoft Outlook App for Mac does not support subscribing to calendars at this time. See the "Having Issues?" page for more information.':""),y=k(()=>i.value==="outlook"),{themeClasses:T}=te(l,a),I=k(()=>[T.value]),A=k(()=>h.value===-1?"Subscribing Help":"Subscribe to the Schedule"),s="/api/v2/Calendar/subscribe",m=k(()=>{const o=new URLSearchParams;return["google","exchange","outlook","apple","other","yahoo"].includes(i.value)?o.set("type","ics"):i.value==="android"?o.set("type","vcal"):i.value==="rss"?o.set("type","rss"):i.value==="excel"&&o.set("type","csv"),l.sport_id&&o.set("sportId",l.sport_id),l.schedule_id&&o.set("scheduleId",l.schedule_id),l.location_indicator&&o.set("locationIndicator",l.location_indicator.toUpperCase()),i.value==="google"&&o.set("downloadFile","false"),`?${o.toString()}`}),q=o=>{i.value=o.value},N=k(()=>{var r;let o="";const n=new URLSearchParams;return n.set("type","ics"),l.sport_id&&n.set("sportId",l.sport_id),l.schedule_id&&n.set("scheduleId",l.schedule_id),l.location_indicator&&n.set("locationIndicator",l.location_indicator.toUpperCase()),G()&&(o=`${(((r=window==null?void 0:window.location)==null?void 0:r.origin)??"").replace(window.location.protocol,"webcal:")}${s}?${n.toString()}`),o}),D=()=>{var o;if(i.value&&G()){const n=((o=window==null?void 0:window.location)==null?void 0:o.origin)??"";let r=`${n}${s}${m.value}`;if(oe("Schedule Subscription",i.value,l.sport_id),i.value==="google")r=`https://www.google.com/calendar/render?cid=http%3A//${window.location.host}${s}${encodeURIComponent(m.value)}`;else if(["exchange","outlook","apple"].includes(i.value)){const M=window.navigator.userAgent;(M.match(/iP(ad|hone)/)||M.match(/Mac/))&&(r=`${n.replace(window.location.protocol,"webcal:")}${s}${m.value}`)}else if(i.value==="yahoo"){h.value=1;return}le.info("calendar subscribe download_url: ",r),window.location.href=r}},O=async()=>{var o,n;if(e.value=!1,await j(),(n=(o=_==null?void 0:_.value)==null?void 0:o.querySelector("#addToCalendarButtonId"))==null||n.focus(),G()){const r=document==null?void 0:document.getElementById("_sidearm_announcer_");r&&(r==null||r.setAttribute("aria-live","polite"),r.innerHTML="Add to Calendar modal closed")}};return H(()=>h.value,async o=>{var n,r;o===0&&(await j(),(r=(n=_==null?void 0:_.value)==null?void 0:n.querySelector("#subscribeToCalendarSectionId"))==null||r.focus())}),H(()=>e.value,o=>{o===!1&&(h.value=0,i.value="")}),{services:f,download_options:g,set_schedule_service:q,is_modal_open:e,active_step:h,show_alert:y,alert_message:S,selected_schedule_service:i,download_schedule:D,classes:I,modal_title:A,close_modal:O,component_ref:_,copy_mac_ics:N}}},ce={class:"s-calendar-subscribe__modal-content flex flex-col space-y-[32px] divide-y"},ne={key:0,class:"s-calendar-subscribe__modal-step-0"},de={key:0,class:"s-calendar-subscribe__modal-alert my-2 flex items-center rounded rounded-[10px] border p-5"},ue=["innerHTML"],pe={id:"subscribeToCalendarSectionId",class:"s-calendar-subscribe__modal-services-row-1 grid grid-cols-4 grid-rows-2 gap-[8px]","aria-label":"Subscribe to Calendar modal",role:"group"},_e=["aria-label","aria-pressed","onClick","onKeyup"],me={class:"s-calendar-subscribe__modal-services-item__label flex flex-col items-center justify-center space-y-[8px]","aria-hidden":"true"},ve=["innerHTML"],be={"data-test-id":"s-calendar-subscribe__modal-services-row-item-title",class:"s-calendar-subscribe__modal-services-item__title s-text-paragraph hover:cursor-pointer"},he={class:"s-calendar-subscribe__modal-services-label flex flex-col items-center justify-center space-y-[8px] hover:cursor-pointer","aria-hidden":"true"},fe={class:"s-calendar-subscribe__modal-services-row-2 mt-[8px] grid grid-cols-2 grid-rows-1 gap-[8px]"},ge=["aria-label","aria-pressed","onClick","onKeyup"],ye={class:"s-calendar-subscribe__modal-services-label flex flex-col items-center justify-center space-y-[8px] hover:cursor-pointer"},xe={"data-test-id":"s-calendar-subscribe__modal-services-row-service-title",class:"s-calendar-subscribe__modal-services-title text-center hover:cursor-pointer"},we={key:1,class:"s-calendar-subscribe__modal-step-1"},ke={class:"s-calendar-subscribe__modal-step-1__content mt-4 flex"},Ce=["value"],Se={key:2,class:"s-calendar-subscribe__modal-step-help"},Te={class:"s-text-paragraph p-2"},Ie={class:"s-calendar-subscribe__modal-footer flex justify-between space-x-[16px]"},Ae={key:0,class:"mr-1"},$e={key:1},Be={key:2};function Ge(l,a,_,e,h,i){const f=x("SBtn"),g=x("SIcon"),S=x("STooltip"),y=x("SExpansionPanel"),T=x("SExpansionPanels"),I=x("SBaseModal"),A=P("copy-to-clipboard");return c(),d("div",{ref:"component_ref","data-test-id":"s-calendar-subscribe__root",class:C(["s-calendar-subscribe",e.classes])},[u(f,{id:"addToCalendarButtonId","aria-haspopup":"dialog","aria-label":"Add to Calendar, opens in modal",tag:"button",size:"regular",theme:l.theme,iconLeft:"icon-plus-circle",type:_.isGameCenter?"alternate":void 0,class:C(["h-[53px] w-[53px] pr-[8px] pl-[16px] md:w-auto md:pr-[16px]",{"md:[&_svg]:!mr-0 !min-w-[46px] !w-[46px] !h-[46px] !min-h-[46px] min-[330px]:!w-[53px] min-[330px]:!h-[53px]":_.isGameCenter}]),onClick:a[0]||(a[0]=s=>e.is_modal_open=!0)},{default:p(()=>[t("span",{class:C(["hidden md:block",{"sr-only":_.isGameCenter}])}," Add To Calendar ",2)]),_:1},8,["theme","type","class"]),u(I,{_class:"s-calendar-subscribe s-calendar-subscribe__modal",backdrop:"",theme:l.theme,modalTitle:e.modal_title,active:e.is_modal_open,focusOnElementSelector:"#subscribeToCalendarSectionId",teleportDisabled:"",closeBtnAriaLabel:"Close Add to Calendar modal",onClose:e.close_modal},{footer:p(()=>[t("div",Ie,[e.active_step===0?(c(),B(f,{key:0,theme:l.theme,size:"regular",type:"priority",iconLeft:"icon-refresh",onClick:e.download_schedule},{default:p(()=>[e.selected_schedule_service==="yahoo"?(c(),d("span",Ae,"Get Calendar Address ")):v("",!0),["excel","other"].includes(e.selected_schedule_service)?(c(),d("span",$e,"Download Now ")):(c(),d("span",Be,"Subscribe Now"))]),_:1},8,["theme","onClick"])):v("",!0),e.active_step===1||e.active_step===-1?(c(),B(f,{key:1,theme:l.theme,size:"regular",type:"priority",iconLeft:"icon-arrow-left",onClick:a[4]||(a[4]=s=>e.active_step===1?e.active_step--:e.active_step=0)},{default:p(()=>a[16]||(a[16]=[b(" Back ")])),_:1},8,["theme"])):v("",!0)])]),default:p(()=>[t("div",ce,[e.active_step===0?(c(),d("div",ne,[a[6]||(a[6]=t("div",{class:"s-calendar-subscribe__modal-title s-text-paragraph my-2"}," Select the calendar service that you would like to link: ",-1)),e.show_alert?(c(),d("div",de,[u(g,{name:"icon-info",size:"small",class:"mr-[8px]"}),t("div",{class:"s-text-details flex-1",innerHTML:e.alert_message},null,8,ue)])):v("",!0),t("div",pe,[(c(!0),d(E,null,L(e.services,s=>(c(),d("div",{key:s.value,"data-test-id":"s-calendar-subscribe__modal-services-row-set-schedule-service-control",class:C(["s-calendar-subscribe__modal-services-item flex items-center justify-center rounded-[10px] border p-[16px] hover:cursor-pointer lg:p-[32px]",{"s-calendar-subscribe__modal-services-item--selected":s.value===e.selected_schedule_service}]),role:"button",tabindex:"0","aria-label":`${s.title}`,"aria-pressed":s.value===e.selected_schedule_service,onClick:m=>e.set_schedule_service(s),onKeyup:$(m=>e.set_schedule_service(s),["enter"])},[t("div",me,[s.type==="svg"?(c(),d("div",{key:0,class:"s-calendar-subscribe__modal-services-item__icon flex w-[24px] justify-center hover:cursor-pointer lg:w-[48px]",innerHTML:s.icon},null,8,ve)):(c(),B(g,{key:1,size:"large",name:s.icon,class:"s-calendar-subscribe__modal-services-item__icon"},null,8,["name"])),t("div",be,z(s.title),1)])],42,_e))),128)),t("div",{"data-test-id":"s-calendar-subscribe__modal-services-item-help",class:"s-calendar-subscribe__modal-services-item s-calendar-subscribe__modal-services-item__help flex items-center justify-center rounded-[10px] border p-[16px] hover:cursor-pointer lg:p-[32px]",role:"button","aria-label":"Having Issues",tabindex:"0",onClick:a[1]||(a[1]=s=>e.active_step=-1),onKeyup:a[2]||(a[2]=$(s=>e.active_step=-1,["enter"]))},[t("div",he,[u(g,{size:"large",name:"icon-help",class:"s-calendar-subscribe__modal-services-icon"}),a[5]||(a[5]=t("div",{class:"s-calendar-subscribe__modal-services-title text-center hover:cursor-pointer"}," Having Issues ",-1))])],32)]),t("div",fe,[(c(!0),d(E,null,L(e.download_options,s=>(c(),d("div",{key:s.value,"data-test-id":"s-calendar-subscribe__modal-services-row-set-calendar-subscribe-control",class:C(["s-calendar-subscribe__modal-services-item flex items-center justify-center rounded-[10px] border p-[16px] hover:cursor-pointer lg:p-[32px]",{"s-calendar-subscribe__modal-services-item--selected":s.value===e.selected_schedule_service}]),role:"button",tabindex:"0","aria-label":`${s.title} download option`,"aria-pressed":s.value===e.selected_schedule_service,onClick:m=>e.set_schedule_service(s),onKeyup:$(m=>e.set_schedule_service(s),["enter"])},[t("div",ye,[u(g,{size:"large",name:s.icon,class:"s-calendar-subscribe__modal-services-icon"},null,8,["name"]),t("div",xe,z(s.title),1)])],42,ge))),128))])])):v("",!0),e.active_step===1?(c(),d("div",we,[a[8]||(a[8]=t("div",{class:"s-calendar-subscribe__modal-title s-text-paragraph my-2"}," Copy the link below and paste into your calendar program to subscribe to the schedule: ",-1)),t("div",ke,[t("input",{"data-test-id":"s-calendar-subscribe__modal-step-1-content-input",type:"text",value:e.copy_mac_ics,class:"s-calendar-subscribe__modal-services-item-input-copy w-full rounded-[10px] rounded-r-none border p-2"},null,8,Ce),u(S,{theme:l.theme,direction:"top",triggers:["click"]},{text:p(()=>a[7]||(a[7]=[b(" Copied ")])),default:p(()=>[t("div",null,[R(u(f,{theme:l.theme,buttonIcon:"",icon:"icon-copy",size:"regular",class:"!rounded-l-none"},null,8,["theme"]),[[A,e.copy_mac_ics]])])]),_:1},8,["theme"])])])):v("",!0),e.active_step===-1?(c(),d("div",Se,[u(T,{initialExpanded:0,theme:l.theme,size:"regular"},{default:p(()=>[u(y,{class:"w-full",headerText:"The calendar isn't syncing to the Google Calendar App"},{default:p(()=>a[9]||(a[9]=[t("div",{class:"s-text-paragraph p-2"},[b(" The Google Calendar App does not support subscribing to non-Google calendars. You will need to subscribe using the "),t("a",{href:"http://calendar.google.com",target:"_blank"},"Google Calendar website"),b(" directly. If you use the Google Calendar subscribe option while visiting this page on a computer, it will automatically open the website with the calendar loaded into it. ")],-1)])),_:1}),u(y,{class:"w-full",headerText:"Events are missing in Google Calendar"},{default:p(()=>a[10]||(a[10]=[t("div",{class:"s-text-paragraph p-2"}," When you subscribe to a calendar for the first time with Google Calendar, it may take a few hours for Google to display all of the events. Any missing events should load in automatically within a few hours, if needed. ",-1)])),_:1}),u(y,{class:"w-full",headerText:"The calendar isn't syncing to Microsoft Outlook for Mac"},{default:p(()=>[t("div",Te,[a[11]||(a[11]=b(" The Microsoft Outlook App for Mac does not support subscribing to calendars at this time. You will need to subscribe using the ")),a[12]||(a[12]=t("a",{href:"https://outlook.live.com/",target:"_blank"},"Outlook Web App",-1)),a[13]||(a[13]=b(" in your browser. The calendar URL to subscribe to can be found by ")),t("a",{class:"underline cursor-pointer",onClick:a[3]||(a[3]=s=>e.active_step=1)},"clicking here"),a[14]||(a[14]=b(". "))])]),_:1}),u(y,{class:"w-full",headerText:"The website says an event has a different date and/or time, but my calendar app isn't showing the changes"},{default:p(()=>a[15]||(a[15]=[t("div",{class:"s-text-paragraph p-2"}," Each calendar app refreshes data at different intervals. It can take up to 8-12 hours for the app to reach out and request updated information. ",-1)])),_:1})]),_:1},8,["theme"])])):v("",!0)])]),_:1},8,["theme","modalTitle","active","onClose"])],2)}const ze=ie(re,[["render",Ge]]);export{ze as default};

AltStyle によって変換されたページ (->オリジナル) /