import{_ as g}from"./Ba76BwjT.js";import{_ as v}from"./Djeg5oYd.js";import{u as y}from"./DuJ0NDcC.js";import{e as k,j as b,v as w,c as a,a as s,b as i,w as q,f as r,t as E,F as B,r as C,i as u,E as I,o as e,H as N,_ as Q}from"./DpdQcRr7.js";import"./D1zzHZdQ.js";import"./BcpEzrWT.js";const j={class:"unit-page"},F={class:"page-header"},L={class:"container"},M={class:"header-content"},R={class:"container"},T={key:0,class:"box has-text-centered py-6"},V={key:1,class:"box has-text-centered py-6"},A={class:"has-text-danger"},D={key:2,class:"box has-text-centered py-6"},G={key:3,class:"quests-grid"},H=k({__name:"index",setup(S){const l=u([]),d=u(!1),c=u(null),p=async()=>{var n;d.value=!0,c.value=null;try{const t=await y("/api/user/quests",{method:"GET",params:{offset:0,limit:100}});t&&(l.value=t.items.filter(o=>o.unit==="E"))}catch(t){c.value=((n=t.data)==null?void 0:n.detail)||"予期せぬエラーが発生しました"}finally{d.value=!1}};b(()=>p());const h=w(),m=n=>h.push(`/user/quests/${n}`);return(n,t)=>{const o=I("Icon"),f=g,x=v;return e(),a("div",j,[s("div",F,[s("div",L,[s("div",M,[i(f,{to:"/user/quests",class:"back-link"},{default:q(()=>[i(o,{icon:"mdi:arrow-left",width:24,height:24})]),_:1}),t[0]||(t[0]=s("span",{class:"unit-badge"},"E",-1)),t[1]||(t[1]=s("div",{class:"header-text"},[s("h1",{class:"title is-2 mb-2"},"Modパック・リリース"),s("p",{class:"subtitle is-5"},"jarファイルへの書き出しと配布")],-1))])])]),s("div",R,[r(d)?(e(),a("div",T,[i(o,{icon:"mdi:loading",width:64,height:64,class:"has-text-primary rotating"}),t[2]||(t[2]=s("p",{class:"has-text-grey mt-3"},"クエストを読み込み中...",-1))])):r(c)?(e(),a("div",V,[i(o,{icon:"mdi:alert-circle",width:64,height:64,class:"has-text-danger mb-3"}),s("p",A,E(r(c)),1)])):r(l).length===0?(e(),a("div",D,[i(o,{icon:"mdi:alert-circle-outline",width:64,height:64,class:"has-text-grey-light mb-3"}),t[3]||(t[3]=s("p",{class:"has-text-grey"},"このユニットにはまだクエストがありません",-1))])):(e(),a("div",G,[(e(!0),a(B,null,C(r(l),_=>(e(),N(x,{key:_.id,quest:_,onClick:m},null,8,["quest"]))),128))]))])])}}}),U=Q(H,[["__scopeId","data-v-1dfdfaba"]]);export{U as default};
