import{i as o,H as v,g as d,T as c,h as p,Y as f,k as a,_ as F,r as _,o as b,c as I,a as u,b as T,G as g,F as w}from"./index-20f16f2f.js";import{I as S}from"./InputEvent-63c6d026.js";import"./InputResourceMultiSelect-514edc39.js";import"./InputCourseDate-b1a3edff.js";import"./InputEventColor-ff50e1eb.js";const D={name:"PageEventsNew",components:{InputEvent:S},setup(){const r=o(a.notification),n=o(a.resourceStore),m=o(a.eventStore),e=o(a.generalTimetableScope),s=v({type:"standard",resources:[n.resources.value.find(t=>t.id===e.classroom.value)].filter(t=>t!=null),startTime:d.combine(e.dateRange.value[0],new c),endTime:d.combine(e.dateRange.value[0],new c),timeLabel:null,color:"#FFFFFF",memo:""}),i=p(!1);async function l(){if(i.value){r.add("error","イベントの入力欄にエラーがあります");return}await m.mutate([{opcode:"add_event",param:f(s.value)}]),r.add("info","イベントを追加しました")}return{event:s,eventInputInvalid:i,submit:l}}},V=u("h1",null,"イベント追加",-1),k=u("button",null,"イベント追加",-1);function A(r,n,m,e,s,i){const l=_("input-event");return b(),I(w,null,[V,u("form",{onSubmit:n[2]||(n[2]=g(t=>e.submit(),["prevent"]))},[T(l,{modelValue:e.event,"onUpdate:modelValue":n[0]||(n[0]=t=>e.event=t),invalid:e.eventInputInvalid,"onUpdate:invalid":n[1]||(n[1]=t=>e.eventInputInvalid=t)},null,8,["modelValue","invalid"]),k],32)],64)}const N=F(D,[["render",A]]);export{N as default};
