var p=Object.defineProperty;var a=(e,t,o)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var n=(e,t,o)=>a(e,typeof t!="symbol"?t+"":t,o);import{$ as d,aM as F,d as c}from"./CfjfYOu4.js";class u{constructor(){n(this,"resource","/api/v2/SportFiles");n(this,"hiddenResource","/api/v2/Hidden/SportFiles")}async getSportByFilenameDate(t){try{let i=`${t.hidden?this.hiddenResource:this.resource}?filename=${t.filename}&date=${t.date}`;(t.hidden||t.protected)&&(i+="&t="+Date.now());const s=await d(i,{onResponse:({response:l})=>{l.status===204&&(l._data=null)}});return s?{sportFileContent:F(s),authRequired:!1}:{sportFileContent:null,authRequired:!1}}catch(o){return console.error("[SportFileRepo] getSportByFilenameDate() Request error caught",o),{sportFileContent:null,authRequired:o.status===401||o.status===403}}}}const f=()=>new u,y=c("sport-file",{state:()=>({sportFiles:{},sportFileScripts:{},isSportBodyUnsafeHtml:{}}),actions:{async fetchSportsFile(e){const t=`${e.date}/${e.filename}`,o=await f().getSportByFilenameDate({filename:e.filename,date:e.date,hidden:e.hidden,protected:e.protected});this.sportFiles[t]=o},setSportFileScriptsLoaded(e){const t=`${e.date}/${e.filename}`;this.sportFileScripts[t]=e.value},setSportFileBodyContent(e,t){var i,s;const o=`${e.date}/${e.filename}`;o in this.sportFiles&&((s=(i=this.sportFiles[o])==null?void 0:i.sportFileContent)!=null&&s.body)&&t&&(t!=null&&t.length)&&(this.sportFiles[o].sportFileContent.body=t)},setSportFileUnsafeHtml(e,t){const o=`${e.date}/${e.filename}`;this.isSportBodyUnsafeHtml[o]=t}},getters:{getSportByFilename:e=>(t,o)=>{var s,r;const i=`${t}/${o}`;return i in e.sportFiles&&((s=e.sportFiles[i])!=null&&s.sportFileContent)?(r=e.sportFiles[i])==null?void 0:r.sportFileContent:null},getSportFileScriptsLoaded:e=>(t,o)=>{const i=`${t}/${o}`;return i in e.sportFileScripts?e.sportFileScripts[i]??!1:!1},getSportFileAuthData:e=>(t,o)=>{var s;const i=`${t}/${o}`;return i in e.sportFiles?((s=e.sportFiles[i])==null?void 0:s.authRequired)??!1:!1},getSportFileUnsafeHtmlFlag:e=>(t,o)=>{const i=`${t}/${o}`;return i in e.isSportBodyUnsafeHtml?e.isSportBodyUnsafeHtml[i]??!1:!1}}});export{y as u};

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