PageSourceSearch

https://naemo.ai/_next/static/chunks/6078.4fb7ccd8ae183183.js

js naemo.ai collected 2026-10-02 01:15:11 UTC 65,140 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6078],{46078:function(e,t,n){"use strict";n.d(t,{Z:function(){return ew}});var a=n(57437),s=n(90982),l=n(2265),i=n(71666),r=n(86909),o=n.n(r),c=n(93448);function d(e){let{title:t,action:n,children:s,className:l,icon:i,flush:r=!1}=e;return(0,a.jsxs)("div",{className:(0,c.cn)(o().theme,"bg-white dark:bg-[#191919] md:rounded-lg overflow-hidden flex flex-col md:shadow-sm dark:shadow-none",l),children:[(0,a.jsxs)("div",{className:"flex flex-wrap justify-between items-center gap-2 px-4 py-3 shrink-0",children:[(0,a.jsxs)("h3",{className:(0,c.cn)(o().title,"flex items-center gap-2"),children:[i&&(0,a.jsx)("span",{className:"text-zinc-400 dark:text-zinc-500",children:i}),t]}),n]}),(0,a.jsx)("div",{className:(0,c.cn)("flex-1 min-h-0 flex flex-col",r?"":"px-4 pb-4"),children:s})]})}function m(e){let{label:t,value:n,color:s}=e,l={rose:"text-rose-600 dark:text-rose-500",amber:"text-amber-600 dark:text-amber-500",emerald:"text-emerald-600 dark:text-emerald-500",zinc:o().secondary,purple:"text-purple-600 dark:text-purple-500",cyan:"text-cyan-600 dark:text-cyan-500"};return(0,a.jsxs)("div",{className:"bg-zinc-50 dark:bg-[#27272A] rounded-md py-3 text-center border border-zinc-100 dark:border-transparent",children:[(0,a.jsx)("div",{className:(0,c.cn)(o().metric,s?l[s]:o().body),children:n}),(0,a.jsx)("div",{className:o().label,children:t})]})}function u(e){let{message:t,actionLabel:n,onAction:s,className:l}=e;return(0,a.jsxs)("div",{className:(0,c.cn)(o().theme,o().empty,l),children:[(0,a.jsx)("p",{className:(0,c.cn)(o().secondary,o().emptyMessage),children:t}),n&&(0,a.jsx)("button",{type:"button",onClick:s,className:(0,c.cn)(o().action,o().emptyAction),children:n})]})}var h=n(66318),x=n(76435);n(90583),n(53362);let f=e=>({type:"transform",scale:e,calcStyle:e=>({transform:"translate(".concat(Math.round(e.left),"px,").concat(Math.round(e.top),"px)"),width:"".concat(Math.round(e.width),"px"),height:"".concat(Math.round(e.height),"px"),position:"absolute"}),calcDragPosition:(t,n,a,s)=>({left:(t-a)/e,top:(n-s)/e})});function p(e){let{children:t,layouts:n,onLayoutChange:s,isDraggable:l=!1,isResizable:i=!1,transformScale:r=1}=e,{width:o,containerRef:c,mounted:d}=(0,h.e4)(),m=1!==r?f(r):void 0;return(0,a.jsx)("div",{ref:c,className:"w-full",children:d&&(0,a.jsx)(x.ub,{className:"layout",layouts:n,breakpoints:{lg:1024,md:700,sm:500,xs:300,xxs:0},cols:{lg:3,md:3,sm:2,xs:1,xxs:1},rowHeight:180,margin:[16,16],containerPadding:[0,0],dragConfig:{enabled:l,handle:".dashboard-drag-handle",cancel:".no-drag",threshold:2},resizeConfig:{enabled:i},onLayoutChange:s,positionStrategy:m,width:o,children:t})})}var g=n(22606),b=n(45675),v=n(25997);function w(e){let{timetableView:t,setTimetableView:n,timetableData:s,todayInfo:i,onReload:r}=e,{openSettings:m}=(0,v.Y)();return(0,a.jsx)(d,{title:"my"===t?"나의 시간표":"학급 시간표",className:"md:h-full h-auto",action:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative flex items-center bg-zinc-100 dark:bg-zinc-800/50 p-0.5 rounded-full dashboard-timetable-toggle w-[88px] h-7 md:w-[72px] md:h-[22px]",children:[(0,a.jsx)("div",{className:(0,c.cn)("absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] bg-white dark:bg-zinc-600 rounded-full shadow-sm transition-all duration-300 ease-in-out pointer-events-none","my"===t?"left-0.5":"left-[calc(50%)]")}),(0,a.jsxs)("div",{className:"absolute inset-0.5 flex pointer-events-none z-10",children:[(0,a.jsx)("div",{className:(0,c.cn)(o().label,"flex-1 flex items-center justify-center transition-colors","my"===t&&o().activeLabel),children:"개인"}),(0,a.jsx)("div",{className:(0,c.cn)(o().label,"flex-1 flex items-center justify-center transition-colors","class"===t&&o().activeLabel),children:"학급"})]}),(0,a.jsxs)("div",{className:"absolute inset-x-0.5 top-1/2 -translate-y-1/2 h-11 md:h-[calc(100%-4px)] flex z-20",children:[(0,a.jsx)("button",{onClick:()=>{n("my")},className:"flex-1 h-full cursor-pointer bg-transparent opacity-0","aria-label":"개인 시간표 선택"}),(0,a.jsx)("button",{onClick:()=>{n("class")},className:"flex-1 h-full cursor-pointer bg-transparent opacity-0","aria-label":"학급 시간표 선택"})]})]}),(0,a.jsx)("button",{onClick:()=>m("timetable",void 0,{onClose:r}),className:"hidden md:block p-1 rounded transition-colors dashboard-timetable-edit-btn text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"시간표 설정",children:(0,a.jsx)(b.Z,{size:14})})]}),children:(0,a.jsxs)("div",{className:"grid grid-cols-6 grid-rows-[auto_repeat(7,1fr)] gap-1 text-center md:h-full h-auto pb-1 overflow-y-auto custom-scrollbar",children:[(0,a.jsx)("div",{className:(0,
1c.cn)(o().label,o().tableHeader,"py-1 rounded"),children:"교시"}),["월","화","수","목","금"].map((e,t)=>{let n=i.index===t+1;return(0,a.jsx)("div",{className:(0,c.cn)(o().label,o().tableHeader,"py-1 rounded transition-colors",n&&o().todayHeader),children:e},e)}),Array.from({length:7},(e,t)=>t+1).map(e=>(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)("div",{className:(0,c.cn)(o().meta,o().tableHeader,"flex items-center justify-center tabular-nums rounded"),children:e}),["mon","tue","wed","thu","fri"].map(t=>{let n="".concat(t,"-").concat(e),l=s[n],r=t===i.key;return(0,a.jsx)("div",{className:(0,c.cn)(o().item,o().tableCell,"rounded transition-colors px-1 flex items-center justify-center text-center min-h-[36px] md:min-h-0 min-w-0",l&&o().filledCell,r&&o().todayCell),children:(0,a.jsx)("span",{className:"whitespace-pre-wrap min-w-0 [overflow-wrap:anywhere]",children:l||""})},n)})]},e))]})})}function y(e){let{memo:t,onMemoChange:n,onMemoBlur:s}=e;return(0,a.jsx)(d,{title:"메모",className:"md:h-full md:min-h-0 h-auto min-h-[200px]",children:(0,a.jsx)("textarea",{className:"".concat(o().body," ").concat(o().input," w-full flex-1 min-h-0 md:h-full h-auto bg-transparent resize-none focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 p-0"),placeholder:"메모를 입력해 주세요.",value:t,onChange:n,onBlur:s})})}var j=n(36013);function N(e){let[t,n,a]=e.split("-").map(Number);return[t,n,a]}function k(e){let{events:t,isGuest:n}=e,s=n?j.b:(0,c.RJ)(),[l]=N(s),i=t.filter(e=>e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)),r=[];for(let e of i){let[t,n]=N(e.date),a="".concat(t,"-").concat(n),s=r[r.length-1];s&&s.key===a||(s={key:a,label:t===l?"".concat(n,"월"):"".concat(t,"년 ").concat(n,"월"),items:[]},r.push(s)),s.items.push(e)}return(0,a.jsx)(d,{title:n?"예시 일정 \xb7 3월 12일 기준":"다가오는 일정",className:"md:h-full h-auto",children:0===i.length?(0,a.jsx)(u,{message:"예정된 일정이 없어요."}):(0,a.jsx)("div",{className:"md:h-full md:overflow-y-auto h-auto overflow-visible pr-1 custom-scrollbar",children:r.map(e=>(0,a.jsxs)("section",{"aria-label":e.label,className:"mt-4 first:mt-0",children:[(0,a.jsx)("h4",{className:"".concat(o().label," pb-1"),children:e.label}),(0,a.jsx)("ul",{children:e.items.map(e=>{let t=function(e,t){let[n,a,s]=N(e),[l,i,r]=N(t);return Math.round((Date.UTC(l,i-1,r)-Date.UTC(n,a-1,s))/864e5)}(s,e.date),n=t<=7;return(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 px-0.5 py-1.5 border-b border-zinc-100 dark:border-white/[0.06] last:border-b-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:(0,c.cn)("w-1.5 h-1.5 rounded-full shrink-0","green"===e.tag?"bg-emerald-500":"red"===e.tag?"bg-rose-500":"bg-zinc-400")}),(0,a.jsx)("span",{className:(0,c.cn)("truncate",n?o().emphasis:o().item),children:e.title}),0===t&&(0,a.jsx)("span",{className:"".concat(o().badge," shrink-0 rounded px-1 py-px"),children:"오늘"})]}),(0,a.jsx)("span",{className:(0,c.cn)("tabular-nums shrink-0",n?o().label:o().meta),children:function(e){let[,t,n]=N(e.date);if(!e.endDate||e.endDate===e.date)return"".concat(t,"월 ").concat(n,"일");let[,a,s]=N(e.endDate);return a===t?"".concat(t,"월 ").concat(n,"일 ~ ").concat(s,"일"):"".concat(t,"월 ").concat(n,"일 ~ ").concat(a,"월 ").concat(s,"일")}(e)})]},e.id)})})]},e.key))})})}var z=n(46173);function C(e){let{stats:t,records:n,isGuest:s,homeroomStudents:l}=e,i=(e,t)=>{let n=e.date,a=e.endDate||e.date;return t>=n&&t<=a},r=s?"2026-03-12":(0,c.RJ)(),h=n.filter(e=>i(e,r));return(0,a.jsxs)(d,{title:"오늘의 출결 현황",className:"md:h-full h-auto",children:[(0,a.jsxs)("div",{className:"grid grid-cols-4 gap-2 mb-3 shrink-0",children:[(0,a.jsx)(m,{label:"결석",value:t.absent,color:t.absent>0?"rose":"zinc"}),(0,a.jsx)(m,{label:"지각",value:t.late,color:t.late>0?"amber":"zinc"}),(0,a.jsx)(m,{label:"조퇴",value:t.early,color:t.early>0?"amber":"zinc"}),(0,a.jsx)(m,{label:"결과",value:t.passing,color:t.passing>0?"amber":"zinc"})]}),0===h.length?(0,a.jsx)(u,{message:"특이사항이 없어요.",className:"".concat(o().attendanceEmpty," custom-scrollbar")}):(0,a.jsx)("div",{className:"min-h-0 md:flex-1 md:overflow-y-auto h-auto overflow-visible custom-scrollbar pr-1",children:(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[...h].sort((e,t)=>
1{let n=l.find(t=>t.id===e.studentId),a=l.find(e=>e.id===t.studentId),s=(null==n?void 0:n.studentNumber)?parseInt(n.studentNumber):1/0,i=(null==a?void 0:a.studentNumber)?parseInt(a.studentNumber):1/0;if(s!==i)return s-i;let r=(null==n?void 0:n.name)||e.studentName||"",o=(null==a?void 0:a.name)||t.studentName||"";return r.localeCompare(o)}).map(e=>{var t,n,s,i,r;let c=e.studentName||(null===(t=l.find(t=>t.id===e.studentId))||void 0===t?void 0:t.name)||"알 수 없음";return(0,a.jsxs)("div",{className:"bg-zinc-50 dark:bg-[#27272A] border border-zinc-100 dark:border-transparent px-3 py-2 rounded-md flex min-w-0 gap-2 justify-between items-center",children:[(0,a.jsx)("span",{className:"".concat(o().item," truncate min-w-0 max-w-[60px]"),children:c}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[e.reason&&(0,a.jsx)("span",{className:"".concat(o().meta," truncate max-w-[40px]"),children:e.reason}),(0,a.jsx)("span",{className:"".concat(o().status," shrink-0 text-[var(--ink)] dark:text-[var(--ink-dark)]"),style:{"--ink":null===(n=(0,z.on)(null!==(i=e.type)&&void 0!==i?i:""))||void 0===n?void 0:n.fg,"--ink-dark":null===(s=(0,z.on)(null!==(r=e.type)&&void 0!==r?r:""))||void 0===s?void 0:s.darkFg},children:e.type})]})]},e.id)})})})]})}var W=n(98319),D=n(10136),E=n(51817),S=n(30401),_=n(2207),H=n(18930),L=n(99397),A=n(32489),M=n(83008),Z=n(67920),O=n(4908),F=n(54696),R=n(96214),I=n(35596);let T=["반장","부반장","주번","환경부장","학습부장","체육부장","도서부장","정보부장","방송부장","우유당번"];function G(e){var t;let{isOpen:n,onClose:s,onSaved:i}=e,r=(0,Z.XC)(),o=(0,D.N)(),{showToast:d}=(0,W.pm)(),m=(0,F.Dv)(),{students:u}=(0,O.AF)(),h=(0,l.useMemo)(()=>(m?u:u.filter(e=>"담임 학급"===e.homeClassId)).sort((e,t)=>(e.number||0)-(t.number||0)),[u,m]),[x,f]=(0,l.useState)({columns:[],assignments:{}}),[p,g]=(0,l.useState)(""),[b,v]=(0,l.useState)(!1),[w,y]=(0,l.useState)(!1),[j,N]=(0,l.useState)(null),[k,z]=(0,l.useState)(""),[C,G]=(0,l.useState)(""),[P,X]=(0,l.useState)(null);(0,l.useEffect)(()=>{n&&(async()=>{v(!0);try{if(m){let e=(await (0,R.getGuestData)()).studentRoles;if(e&&e.columns&&e.columns.length>0)f(e),g(e.columns[0].id);else{let e={columns:[{id:"col-".concat(Date.now()),name:"역할1"}],assignments:{}};f(e),g(e.columns[0].id)}return}let e=await (0,M.X)("getTimetable",{type:"student-roles"},r);if(e.success&&e.data&&Object.keys(e.data).length>0){let t=e.data;if(t.columns&&t.columns.length>0)f(t),g(t.columns[0].id);else{let e={columns:[{id:"col-".concat(Date.now()),name:"역할1"}],assignments:{}};f(e),g(e.columns[0].id)}}else{let e={columns:[{id:"col-".concat(Date.now()),name:"역할1"}],assignments:{}};f(e),g(e.columns[0].id)}}catch(e){console.error("[MobileStudentRolesModal] Failed to load roles:",e)}finally{v(!1)}})()},[n,r,m]);let Y=(0,l.useMemo)(()=>x.columns.find(e=>e.id===p)||x.columns[0],[x.columns,p]),U=async(e,t)=>{if(t.stopPropagation(),x.columns.length<=1){d("역할 항목은 최소 하나가 있어야 합니다.","warning");return}if(await o({title:"이 역할 항목을 삭제할까요?",description:"이 항목에 배정된 학생들의 역할도 함께 지워집니다."})&&(f(t=>{let n={...t.assignments};return Object.keys(n).forEach(t=>{n[t]&&delete n[t][e]}),{columns:t.columns.filter(t=>t.id!==e),assignments:n}}),p===e)){let t=x.columns.filter(t=>t.id!==e);t.length>0&&g(t[0].id)}},B=e=>{N(e.id),z(e.name)},V=e=>{k.trim()&&(f(t=>({...t,columns:t.columns.map(t=>t.id===e?{...t,name:k.trim()}:t)})),N(null))},J=(e,t)=>{Y&&f(n=>({...n,assignments:{...n.assignments,[e]:{...n.assignments[e],[Y.id]:t}}}))},K=e=>{P&&Y&&J(P,e)},Q=async()=>{y(!0);try{if(m){await (0,R.saveGuestData)("studentRoles",x);let e=[];Object.entries(x.assignments).forEach(t=>{let[n,a]=t;Object.entries(a).forEach(t=>{let[a,s]=t;if(s&&s.trim()){let t=h.find(e=>e.id===n);e.push({id:"".concat(n,"-").concat(a),studentId:n,studentName:(null==t?void 0:t.name)||"",role:s})}})}),await (0,R.saveGuestData)("roleAssignments",e)}else{let e=await (0,M.X)("saveTimetable",{type:"student-roles",data:x},r);if(!e.success){d(e.error||"저장에 실패했습니다. 다시 시도해주세요.","error");return}}null==i||i(),s()}catch(e){console.error("[MobileStudentRolesModal] Failed to save roles:",e),d("저장 중 오류가 발생했습니다.","error")}finally{y(!1)}},q=(0,l.useMemo)(()=>
1{if(!C.trim())return h;let e=C.trim().toLowerCase();return h.filter(t=>t.name.toLowerCase().includes(e)||String(t.number).includes(e))},[h,C]);return(0,a.jsx)(I.Z,{isOpen:n,onClose:s,title:"학생별 역할 설정",children:(0,a.jsx)("div",{className:"flex flex-col max-h-full",children:b?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-zinc-400",children:[(0,a.jsx)(E.Z,{className:"w-8 h-8 animate-spin text-blue-500 mb-2"}),(0,a.jsx)("p",{className:"text-sm",children:"역할 정보를 불러오는 중..."})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 overflow-x-auto no-scrollbar py-1 pb-3 mb-2 border-b border-zinc-100",children:[x.columns.map(e=>{let t=e.id===((null==Y?void 0:Y.id)||p);return j===e.id?(0,a.jsxs)("div",{className:"flex items-center gap-1 bg-zinc-100 rounded-2xl px-2 py-1",children:[(0,a.jsx)("input",{type:"text",value:k,onChange:e=>z(e.target.value),autoFocus:!0,onKeyDown:t=>{"Enter"===t.key&&V(e.id),"Escape"===t.key&&N(null)},className:"w-20 bg-white text-xs px-2 py-0.5 rounded border border-zinc-200 outline-none"}),(0,a.jsx)("button",{onClick:()=>V(e.id),className:"p-1 text-emerald-600 active:scale-95",children:(0,a.jsx)(S.Z,{size:14})})]},e.id):(0,a.jsxs)("div",{onClick:()=>g(e.id),className:(0,c.cn)("flex items-center gap-1.5 px-3.5 py-1.5 rounded-2xl text-[13px] font-semibold whitespace-nowrap transition cursor-pointer active:scale-95 shadow-sm",t?"bg-zinc-900 text-white":"bg-white text-zinc-600 dark:text-zinc-400 border border-zinc-200/60"),children:[(0,a.jsx)("span",{children:e.name}),t&&(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),B(e)},className:"p-0.5 text-zinc-400 hover:text-white transition",title:"이름 변경",children:(0,a.jsx)(_.Z,{size:11})}),x.columns.length>1&&t&&(0,a.jsx)("button",{onClick:t=>U(e.id,t),className:"p-0.5 text-zinc-400 hover:text-red-400 transition",title:"열 삭제",children:(0,a.jsx)(H.Z,{size:11})})]},e.id)}),(0,a.jsxs)("button",{onClick:()=>{let e="col-".concat(Date.now()),t=x.columns.length+1;f(n=>({...n,columns:[...n.columns,{id:e,name:"역할".concat(t)}]})),g(e)},className:"flex items-center gap-1 px-3 py-1.5 rounded-2xl text-[12px] font-medium bg-zinc-100 text-zinc-600 dark:text-zinc-400 border border-dashed border-zinc-300 whitespace-nowrap active:scale-95 transition",children:[(0,a.jsx)(L.Z,{size:13}),(0,a.jsx)("span",{children:"항목 추가"})]})]}),(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"text-[11px] font-medium text-zinc-400 mb-1 px-1 flex items-center justify-between",children:[(0,a.jsx)("span",{children:"빠른 입력 칩 (학생을 탭한 후 선택)"}),P&&(0,a.jsxs)("span",{className:"text-blue-500 font-semibold",children:[null===(t=h.find(e=>e.id===P))||void 0===t?void 0:t.name," 선택됨"]})]}),(0,a.jsx)("div",{className:"flex gap-1.5 overflow-x-auto no-scrollbar py-0.5",children:T.map(e=>(0,a.jsx)("button",{onClick:()=>K(e),disabled:!P,className:(0,c.cn)("px-2.5 py-1 rounded-lg text-[11px] font-medium whitespace-nowrap transition active:scale-95",P?"bg-blue-50 text-blue-600 border border-blue-200/60 active:bg-blue-100":"bg-zinc-100 text-zinc-400 border border-transparent opacity-60"),children:e},e))})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto space-y-1.5 pr-1 max-h-full custom-scrollbar",children:0===h.length?(0,a.jsx)("div",{className:"py-10 text-center text-zinc-400 text-xs",children:"담임 학급 학생이 없습니다."}):q.map(e=>{var t;let n=Y&&(null===(t=x.assignments[e.id])||void 0===t?void 0:t[Y.id])||"",s=P===e.id;return(0,a.jsxs)("div",{onClick:()=>X(e.id),className:(0,c.cn)("flex items-center gap-2.5 p-2.5 rounded-xl border transition-all",s?"bg-blue-50/50 border-blue-300":"bg-white border-zinc-200/60"),children:[(0,a.jsx)("span",{className:"w-5 text-[11px] font-bold text-zinc-400 text-right shrink-0",children:e.number}),(0,a.jsx)("span",{className:"w-16 text-[13px] font-bold text-zinc-800 dark:text-zinc-200 truncate shrink-0",children:e.name}),(0,a.jsxs)("div",{className:"flex-1 relative",children:[(0,a.jsx)("input",{type:"text",value:n,placeholder:"역할 입력 (예: 반장, 주번)",onF
1ocus:()=>X(e.id),onChange:t=>J(e.id,t.target.value),className:"w-full h-8 px-2.5 bg-zinc-50 border border-zinc-200 rounded-lg text-[13px] text-zinc-800 dark:text-zinc-200 placeholder:text-zinc-400 focus:outline-none focus:border-blue-500 transition"}),n&&(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),J(e.id,"")},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-zinc-300 hover:text-zinc-500",children:(0,a.jsx)(A.Z,{size:12})})]})]},e.id)})}),(0,a.jsxs)("div",{className:"pt-4 mt-2 pb-4 border-t border-zinc-100 flex gap-2",children:[(0,a.jsx)("button",{onClick:s,className:"flex-1 py-3 rounded-xl border border-zinc-200 text-zinc-600 dark:text-zinc-400 text-[14px] font-semibold active:scale-[0.98] transition",children:"닫기"}),(0,a.jsxs)("button",{onClick:Q,disabled:w,className:"flex-1 py-3 rounded-xl bg-blue-600 text-white text-[14px] font-semibold active:scale-[0.98] transition disabled:opacity-50 flex items-center justify-center gap-1.5",children:[w?(0,a.jsx)(E.Z,{size:16,className:"animate-spin"}):(0,a.jsx)(S.Z,{size:16,strokeWidth:2.5}),(0,a.jsx)("span",{children:"저장하기"})]})]})]})})})}function P(e){let{roleAssignments:t,onReload:n}=e,{openSettings:s}=(0,v.Y)(),[i,r]=(0,l.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d,{title:"학생별 역할",className:"md:h-full h-auto",action:(0,a.jsx)("button",{onClick:()=>{window.innerWidth<768?r(!0):s("student-roles",void 0,{onClose:n})},className:"p-1 rounded text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",title:"역할 수정",children:(0,a.jsx)(b.Z,{size:14})}),children:0===t.length?(0,a.jsx)(u,{message:"배정된 역할이 없어요."}):(0,a.jsx)("div",{className:"md:h-full md:overflow-y-auto h-auto overflow-visible custom-scrollbar pr-1",children:(0,a.jsx)("div",{className:"grid grid-cols-2 gap-x-6",children:[...t].sort((e,t)=>e.role.localeCompare(t.role,"ko")).map(e=>(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 px-0.5 py-2 border-b border-zinc-100 dark:border-white/[0.06]",children:[(0,a.jsx)("span",{className:"".concat(o().secondary," min-w-0 flex-1 truncate"),children:e.role}),(0,a.jsx)("span",{className:"".concat(o().item," max-w-[5em] flex-none truncate text-right"),children:e.studentName})]},e.id))})})}),(0,a.jsx)(G,{isOpen:i,onClose:()=>r(!1),onSaved:n})]})}var X=n(33145),Y=n(92451),U=n(10407),B=n(60850);function V(e){var t,n;let{schoolCode:r,officeCode:m,isGuest:h=!1}=e,[x,f]=(0,l.useState)(r&&m?{schoolCode:r,officeCode:m}:null),[p,g]=(0,l.useState)(null),{showToast:v}=(0,W.pm)(),[w,y]=(0,l.useState)(()=>new Date((0,c.FB)(new Date)+"T00:00:00")),[j,N]=(0,l.useState)(null),[k,z]=(0,l.useState)(!1),[C,D]=(0,l.useState)(null),[S,_]=(0,l.useState)(0),[H,L]=(0,l.useState)(0),[A,M]=(0,l.useState)(!h&&!(r&&m)),[Z,O]=(0,l.useState)(!1),F=e=>{y(t=>{let n=new Date(t);return n.setDate(n.getDate()+e),n})},[R,I]=(0,l.useState)(!1),[T,G]=(0,l.useState)(""),[P,V]=(0,l.useState)([]),[K,Q]=(0,l.useState)(!1),[q,$]=(0,l.useState)(null),[ee,et]=(0,l.useState)(null),[en,ea]=(0,l.useState)(!1),es=(0,l.useRef)(null);(0,l.useEffect)(()=>{r&&m&&f(e=>(null==e?void 0:e.schoolCode)===r&&e.officeCode===m?e:{schoolCode:r,officeCode:m})},[r,m]),(0,l.useEffect)(()=>{let e=!1,t=async()=>{if(h||r&&m){M(!1);return}M(!0),O(!1);try{var t,n;let a=await (0,B.T9)();if(e)return;a.success?(null===(t=a.data)||void 0===t?void 0:t.neisSchoolCode)&&(null===(n=a.data)||void 0===n?void 0:n.neisOfficeCode)&&(f({schoolCode:a.data.neisSchoolCode,officeCode:a.data.neisOfficeCode}),g(a.data.schoolName||null)):O(!0)}catch(t){e||O(!0)}finally{e||M(!1)}};r&&m||t();let n=()=>t();return window.addEventListener("school-settings-updated",n),()=>{e=!0,window.removeEventListener("school-settings-updated",n)}},[r,m,h,H]),(0,l.useEffect)(()=>{if(!x)return;let e=(0,c.FB)(w).replace(/-/g,""),t=!1;return(async()=>{z(!0),D(null);try{let n=await (0,B.CZ)(x.officeCode,x.schoolCode,e);if(t)return;n.success?N(n.data):D(i.l.loadError)}catch(e){if(t)return;console.error("Failed to fetch meal:",e),D(i.l.loadError)}finally{t||z(!1)}})(),()=>{t=!0}},[x,w,S]),(0,l.useEffect)(()=>
1{if(!R||ee||T.trim().length<2){Q(!1);return}let e=!1;Q(!0);let t=setTimeout(async()=>{try{let t=await (0,B.R2)(T.trim());if(e)return;V(t.success?t.data:[]),$(t.success?0===t.data.length?i.l.noSearchResults:null:i.l.loadError)}catch(t){e||(V([]),$(i.l.loadError))}finally{e||Q(!1)}},300);return()=>{e=!0,clearTimeout(t)}},[T,R,ee]);let el=e=>{et(e),G(e.schoolName),V([]),$(null)},ei=async()=>{if(ee){ea(!0);try{(await (0,B.fk)(ee.schoolCode,ee.officeCode)).success?(f({schoolCode:ee.schoolCode,officeCode:ee.officeCode}),g(ee.schoolName),I(!1),G(""),V([]),et(null),window.dispatchEvent(new CustomEvent("school-settings-updated"))):v(i.l.saveError,"error")}catch(e){v(i.l.saveError,"error")}finally{ea(!1)}}},er=()=>{I(!0),p&&x&&(G(p),et({schoolName:p,schoolCode:x.schoolCode,officeCode:x.officeCode}))},eo=()=>{I(!1),G(""),V([]),$(null),et(null)},ec=(0,a.jsxs)("div",{className:"flex min-w-0 max-w-full flex-wrap items-center gap-1.5",children:[x&&!R&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,a.jsx)("button",{onClick:()=>F(-1),"aria-label":"이전 날",className:"p-0.5 rounded text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,a.jsx)(Y.Z,{size:15})}),(0,a.jsx)("span",{className:"".concat(o().label," min-w-[52px] text-center tabular-nums"),children:"".concat(w.getMonth()+1,"/").concat(w.getDate(),"(").concat(["일","월","화","수","목","금","토"][w.getDay()],")")}),(0,a.jsx)("button",{onClick:()=>F(1),"aria-label":"다음 날",className:"p-0.5 rounded text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",children:(0,a.jsx)(U.Z,{size:15})})]}),R&&(0,a.jsxs)("div",{className:"relative flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"text",value:T,onChange:e=>{G(e.target.value),et(null),V([]),$(null)},placeholder:"학교명 검색","aria-label":"학교명 검색",autoFocus:!0,className:"".concat(o().body," ").concat(o().input," min-h-8 w-[140px] bg-zinc-100 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded px-2 focus:outline-none focus:border-blue-500")}),K&&(0,a.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:(0,a.jsx)(E.Z,{size:10,className:"animate-spin text-zinc-400"})})]}),(P.length>0||q)&&(0,a.jsx)("div",{ref:es,className:"absolute top-[calc(100%+4px)] right-0 z-50 w-[220px] max-w-full bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-lg overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-col max-h-[180px] overflow-y-auto custom-scrollbar",children:[q&&(0,a.jsx)("p",{role:"status",className:"".concat(o().secondary," px-3 py-2"),children:q}),P.map(e=>(0,a.jsxs)("button",{onMouseDown:t=>{t.preventDefault(),el(e)},className:"text-left px-3 py-2 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors border-b border-zinc-100 dark:border-zinc-700 last:border-none",children:[(0,a.jsx)("div",{className:o().item,children:e.schoolName}),(0,a.jsx)("div",{className:o().meta,children:e.address})]},e.schoolCode))]})}),(0,a.jsx)("button",{onClick:ei,disabled:!ee||en,className:"".concat(o().action," disabled:opacity-40 disabled:cursor-not-allowed transition-colors whitespace-nowrap"),children:en?"저장 중":"저장"}),(0,a.jsx)("button",{onClick:eo,className:"".concat(o().action," min-h-8 px-1.5 rounded transition-colors"),children:"취소"})]}),(0,a.jsx)("button",{onClick:()=>{if(h){window.dispatchEvent(new CustomEvent("open-login-modal"));return}R?eo():er()},className:"min-w-11 min-h-11 md:min-w-0 md:min-h-0 flex items-center justify-center p-1 rounded transition-colors text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"학교 설정",children:(0,a.jsx)(b.Z,{size:14})})]});return x?(0,a.jsx)(d,{title:"급식",className:"md:h-full h-auto",action:ec,children:(0,a.jsx)("div",{className:"flex flex-col md:h-full h-auto",children:(0,a.jsx)("div",{className:"flex-1 md:overflow-y-auto overflow-visible custom-scrollbar",children:k?(0,a.jsx)(s.ContentLoadingState,{variant:"list",rows:3,label:i.l.loading,slowLabel:i.l.slow,className:o().loading}):C?(0,a.jsx)(u,{message:C,actionLabel:i.l.retry,onAction:()=>_(e=>e+1)}):(0,a.jsxs)("div",{className:"grid grid-cols-2 divide-x divide-zinc-100 dark:divide-zinc-800",children:[(0,a.jsx)(J,{label:"점심",icon:(0,a.jsx)(X.default,{src:"/icons/wired-lineal-804-sun.svg",alt:"점심",width:16,height:16,className:"w-4 h-4 object-contain inline-block shrink-0",unoptimized:!0}),items:null!==(t=null==j?void 0:j.lunch)&&void 0!==t?t:[],className:"pr-3"}),(0,a.jsx)(J,{label:"저녁",icon:(0,a.jsx)(X.default,{src:"/icons/wired-lineal-1821-moon-stars.svg",alt:"저녁",width:16,height:16,className:"w-4 h-4 object-contain inline-block shrink-0",unoptimized:!0}),items:null!==(n=null==j?void 0:j.dinner)&&void 0!==n?n:[],className:"pl-3"})]})})})}):(0,a.jsx)(d,{title:"급식",className:"md:h-full h-auto",action:ec,children:A?(0,a.jsx)(s.ContentLoadingState,{variant:"list",rows:2,label:i.l.loading,slowLabel:i.l.slow,className:o().loading}):Z?(0,a.jsx)(u,{message:i.l.loadError,actionLabel:i.l.retry,onAction:()=>L(e=>e+1)}):(0,a.jsx)(u,{message:h?i.l.login:i.l.school,actionLabel:h?i.l.loginAction:i.l.schoolAction,onAction:()=>h?window.dispatchEvent(new CustomEvent("open-login-modal")):er()})})}function J(e){let{label:t,icon:n,items:s,className:l}=e;return(0,a.jsxs)("div",{className:l,children:[(0,a.jsxs)("div",{className:"".concat(o().label," flex items-center gap-1 mb-1.5"),children:[(0,a.jsx)("span",{children:t}),n]}),s.length>0?(0,a.jsx)("ul",{className:"space-y-1.5",children:s.map((e,t)=>(0,a.jsx)("li",{className:"".concat(o().item," break-keep"),children:e},t))}):(0,a.jsx)("p",{className:o().secondary,children:i.l.noData})]})}var K=n(16338),Q=n(21235);let q=[{text:"주간 정서지원 면담",checked:!0},{text:"학부모 상담 완료 확인",checked:!1}
1,{text:"수행평가 결과 입력",checked:!1}];function $(e){let{isGuest:t=!1}=e,n=(0,K.o)(),s=(0,Z.XC)(),i=(0,l.useRef)(s);i.current=s;let[r,d]=(0,l.useState)(!1),m=(0,l.useRef)(new Map),[u,h]=(0,l.useState)(null),[x,f]=(0,l.useState)(()=>q.map(e=>{let{text:t,checked:n}=e;return{id:crypto.randomUUID(),text:t,checked:n}})),p=t?x:n.items;(0,l.useEffect)(()=>{d(!0)},[]),(0,l.useEffect)(()=>{if(t)return;let e=()=>{"hidden"===document.visibilityState&&K.o.getState().flushSync(i.current)},n=()=>{K.o.getState().flushSync(i.current)};return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",n),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",n)}},[t]),(0,l.useEffect)(()=>{if(u&&r){let e=m.current.get(u);e&&(e.focus(),e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px"),h(null))}},[u,p,r]),(0,l.useEffect)(()=>{r&&p.forEach(e=>{let t=m.current.get(e.id);t&&(t.style.height="auto",t.style.height="".concat(t.scrollHeight,"px"))})},[r,p.length]);let g=(0,l.useCallback)(()=>{let e=crypto.randomUUID();f(t=>[...t,{id:e,text:"",checked:!1}]),h(e)},[]),b=(0,l.useCallback)(e=>{f(t=>t.map(t=>t.id===e?{...t,checked:!t.checked}:t))},[]),v=(0,l.useCallback)((e,t)=>{f(n=>n.map(n=>n.id===e?{...n,text:t}:n))},[]),w=(0,l.useCallback)(e=>{f(t=>t.filter(t=>t.id!==e))},[]),y=(0,l.useCallback)((e,a,l)=>{if(!e.nativeEvent.isComposing){if("Enter"===e.key)e.shiftKey||(e.preventDefault(),t?g():h(n.addItem(s)));else if("Backspace"===e.key&&""===a.text){if(e.preventDefault(),t?w(a.id):n.deleteItem(a.id,s),l>0){let e=p[l-1],t=m.current.get(e.id);null==t||t.focus()}}else if("ArrowUp"===e.key){if(0===e.currentTarget.selectionStart&&l>0){e.preventDefault();let t=p[l-1],n=m.current.get(t.id);n&&(n.focus(),n.setSelectionRange(n.value.length,n.value.length))}}else if("ArrowDown"===e.key){let t=e.currentTarget;if(t.selectionStart===t.value.length&&l<p.length-1){e.preventDefault();let t=p[l+1],n=m.current.get(t.id);n&&(n.focus(),n.setSelectionRange(0,0))}}}},[t,n,s,p,g,w]),j=(0,l.useCallback)(()=>{t?g():h(n.addItem(s))},[t,n,s,g]),N=(0,l.useCallback)((e,a,l)=>{let i=l.target;i.style.height="auto",i.style.height="".concat(i.scrollHeight,"px"),t?v(e,a):n.updateItem(e,a,s)},[t,v,n,s]);return r&&(t||!n.isLoading||0!==n.items.length)?(0,a.jsxs)("div",{className:"".concat(o().theme," bg-white dark:bg-[#191919] md:rounded-lg overflow-hidden flex flex-col md:shadow-sm dark:shadow-none md:h-full h-auto"),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center px-4 py-3 shrink-0",children:[(0,a.jsx)("h3",{className:o().title,children:"체크리스트"}),(0,a.jsx)("button",{onClick:j,className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors p-1 -mr-1",title:"항목 추가",children:(0,a.jsx)(L.Z,{size:16})})]}),(0,a.jsx)("div",{className:"md:flex-1 md:min-h-0 px-4 pb-4 md:overflow-y-auto h-auto overflow-visible custom-scrollbar",children:0===p.length?(0,a.jsx)("button",{onClick:j,className:"".concat(o().action," w-full text-left min-h-11 py-1 transition-colors"),children:"항목 추가하기"}):(0,a.jsx)("div",{className:"space-y-1",children:p.map((e,l)=>(0,a.jsxs)("div",{className:"flex items-start gap-2 group",children:[(0,a.jsx)("input",{type:"checkbox",checked:e.checked,onChange:()=>t?b(e.id):n.toggleItem(e.id,s),className:"w-4 h-4 accent-[#3b82f6] cursor-pointer shrink-0 mt-0.5"}),(0,a.jsx)("textarea",{ref:t=>{t?m.current.set(e.id,t):m.current.delete(e.id)},rows:1,value:e.text,onChange:t=>N(e.id,t.target.value,t),onKeyDown:t=>y(t,e,l),className:(0,c.cn)(o().body,o().input,"flex-1 bg-transparent border-none outline-none p-0 min-w-0 resize-none overflow-hidden",e.checked&&"line-through opacity-60"),placeholder:"입력..."})]},e.id))})})]}):(0,a.jsxs)("div",{className:"bg-white dark:bg-[#191919] md:rounded-lg overflow-hidden flex flex-col md:shadow-sm dark:shadow-none md:h-full h-auto p-4 space-y-3",children:[(0,a.jsx)(Q.Od,{width:80,height:20}),(0,a.jsxs)("div",{className:"space-y-2 mt-2",children:[(0,a.jsx)(Q.Od,{height:26,className:"w-full"}),(0,a.jsx)(Q.Od,{height:26,className:"w-3/4"}),(0,a.jsx)(Q.Od,{height:26,className:"w-5/6"})]})]})}var ee=n(86267),et=n(42349),en=n(48736);function ea(e){let{onNavigate:t}=e,n=(0,Z.XC)(),r=(0,ee.X)(),[c,d]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),[x,f]=(0,l.useState)([]),[p,g]=(0,l.useState)(!1),[b,v]=(0,l.useState)(!1);(0,l.useEffect)(()=>{d(!0)},[]);let w=(0,l.useCallback)(async()=>{g(!0),v(!1);try{let e=await (0,et.X)("getWorkNotes",{},n);e.success&&e.data?f(e.data):v(!0)}
1catch(e){v(!0),console.error("Failed to load work notes:",e)}finally{g(!1)}},[n]),y=(0,l.useCallback)(()=>{h(!0),w()},[w]),j=(0,l.useCallback)(e=>{r.addLinkedNote(e.id,e.title),h(!1)},[r]),N=(0,l.useCallback)((e,t)=>{e.stopPropagation(),r.removeLinkedNote(t)},[r]),k=(0,l.useCallback)(e=>{r.setTargetNoteId(e),t?t("work-notes"):window.location.hash="work-notes"},[r,t]);if(!c)return(0,a.jsxs)("div",{className:"bg-white dark:bg-[#191919] md:rounded-lg flex flex-col md:shadow-sm dark:shadow-none md:h-full h-auto relative p-4 space-y-3",children:[(0,a.jsx)(Q.Od,{width:120,height:20}),(0,a.jsxs)("div",{className:"space-y-2 mt-2",children:[(0,a.jsx)(Q.Od,{height:28,className:"w-full"}),(0,a.jsx)(Q.Od,{height:28,className:"w-4/5"})]})]});let z=r.linkedNotes.map(e=>e.id),C=x.filter(e=>!z.includes(e.id));return(0,a.jsxs)("div",{className:"".concat(o().theme," bg-white dark:bg-[#191919] md:rounded-lg flex flex-col md:shadow-sm dark:shadow-none h-full relative"),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center px-4 py-3 shrink-0",children:[(0,a.jsx)("h3",{className:o().title,children:"업무 노트"}),(0,a.jsx)("button",{onClick:y,className:"text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 transition-colors p-1 -mr-1",title:"노트 추가",children:(0,a.jsx)(L.Z,{size:16})})]}),(0,a.jsxs)("div",{className:"md:flex-1 md:min-h-0 px-4 pb-4 md:overflow-y-auto h-auto overflow-visible custom-scrollbar relative",children:[0===r.linkedNotes.length?null:(0,a.jsx)("div",{className:"flex flex-col",children:r.linkedNotes.map(e=>(0,a.jsxs)("button",{onClick:()=>k(e.id),className:"flex items-center justify-between -mx-2 px-2 py-2 rounded-md border-b border-zinc-100 dark:border-white/[0.06] last:border-b-0 hover:bg-zinc-50 dark:hover:bg-white/[0.04] transition-colors group text-left",children:[(0,a.jsx)("span",{className:"".concat(o().item," truncate min-w-0"),children:e.title||"제목 없음"}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,a.jsx)(A.Z,{size:14,className:"text-zinc-300 hover:text-red-500 dark:text-zinc-500 dark:hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",onClick:t=>N(t,e.id)}),(0,a.jsx)(U.Z,{size:14,className:"text-zinc-300 dark:text-zinc-500"})]})]},e.id))}),m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[100]",onClick:()=>h(!1)}),(0,a.jsxs)("div",{className:"absolute inset-0 z-[101] bg-white dark:bg-[#1a1a1c] rounded-lg shadow-xl border border-zinc-200 dark:border-zinc-700 flex flex-col overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-zinc-100 dark:border-zinc-800",children:[(0,a.jsx)("span",{className:o().label,children:"노트 추가"}),(0,a.jsx)("button",{"aria-label":"닫기",onClick:()=>h(!1),className:"p-0.5 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded transition-colors",children:(0,a.jsx)(A.Z,{size:14,className:"text-zinc-400"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar py-1 px-1",children:p?(0,a.jsx)(s.ContentLoadingState,{variant:"list",rows:3,label:i.l.loading,slowLabel:i.l.slow,className:"".concat(o().loading," p-2 md:p-2")}):b?(0,a.jsx)(u,{message:i.l.loadError,actionLabel:i.l.retry,onAction:()=>void w()}):0===C.length?(0,a.jsx)("div",{className:"".concat(o().secondary," text-center py-6"),children:0===x.length?"등록된 노트가 없어요.":"모든 노트를 추가했어요."}):(0,a.jsx)("div",{children:C.map(e=>(0,a.jsxs)("button",{onClick:()=>j(e),className:"".concat(o().item," w-full flex items-center gap-2 px-2 py-1.5 rounded text-left transition-colors hover:bg-zinc-50 dark:hover:bg-zinc-800"),children:[(0,a.jsx)(en.Z,{size:14,className:"shrink-0 opacity-50"}),(0,a.jsx)("span",{className:"truncate",children:e.title||"제목 없음"}),e.isPinned&&(0,a.jsx)("span",{className:"".concat(o().label," ml-auto"),children:"PIN"})]},e.id))})})]})]})]})]})}function es(e,t){let n=new Date("".concat(e,"T00:00:00Z")).getTime();return Math.round((new Date("".concat(t,"T00:00:00Z")).getTime()-n)/864e5)}function el(e,t){let n=e.date,a=e.endDate||e.date;if(t<n){let e=es(t,n);return{status:"upcoming",diffDays:e,label:"D-".concat(e)}}if(t===n)return{status:"today",diffDays:0,label:"D-DAY"};if(t<=a)return{status:"ongoing",diffDays:0,label:"진행중"};let s=es(a,t);return{status:"past",diffDays:s,label:"D+".concat(s)}}var ei=n(48313);let er=j.b,eo=Array.from({length:10},(e,t)=>"dday-".concat(t));function ec(e){var t;let{isGuest:n,guestEvents:s,onNavigate:r}=e,m=(0,Z.XC)(),h=(0,D.N)(),{showToast:x}=(0,W.pm)(),f=(0,g.Ln)(e=>e.widgetConfig),p=(0,g.Ln)(e=>
1e.setWidgetEventConfig),b=(0,g.Ln)(e=>e.clearWidgetEventConfig),v=Array.from(new Set([...eo.filter(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.eventId}),...Object.keys(f).filter(e=>{var t;return e.startsWith("dday-")&&(null===(t=f[e])||void 0===t?void 0:t.eventId)})])),w=v.length<10,[y,j]=(0,l.useState)([]),[N,k]=(0,l.useState)(!n),[z,C]=(0,l.useState)(!1),[S,_]=(0,l.useState)(0),[H,A]=(0,l.useState)(null),[O,F]=(0,l.useState)(null),[R,I]=(0,l.useState)(null),[T,G]=(0,l.useState)(null),P=(0,l.useRef)(null),X=(0,l.useRef)(null),Y=(0,l.useCallback)(e=>{(null==e?void 0:e.parentElement)&&(e.parentElement.scrollTop=e.offsetTop)},[]),U=n?er:(0,c.RJ)(),B=n?s:y;(0,l.useEffect)(()=>{if(n)return;let e=!1,t=(0,c.RJ)(),a=new Date(t);a.setFullYear(a.getFullYear()-2);let s=new Date(t);s.setFullYear(s.getFullYear()+2);let l=e=>e.toISOString().split("T")[0];return k(!0),C(!1),(0,M.X)("getScheduleEvents",{startDate:l(a),endDate:l(s)},m).then(t=>{e||(t.success&&t.data?j(t.data):C(!0),k(!1))}).catch(()=>{e||(C(!0),k(!1))}),()=>{e=!0}},[n,S]),(0,l.useEffect)(()=>{if(!H)return;let e=e=>{var t,n;let a=e.target,s=null===(t=P.current)||void 0===t?void 0:t.contains(a),l=null===(n=X.current)||void 0===n?void 0:n.contains(a);s||l||A(null)},t=e=>{var t;null!==(t=P.current)&&void 0!==t&&t.contains(e.target)||A(null)};return document.addEventListener("mousedown",e),window.addEventListener("scroll",t,!0),window.addEventListener("resize",t),()=>{document.removeEventListener("mousedown",e),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}},[H]);let V=B.filter(e=>e.date).slice().sort((e,t)=>e.date.localeCompare(t.date)),J=null!==(t=V.find(e=>e.date>=U))&&void 0!==t?t:V[V.length-1],K=null==J?void 0:J.id,Q=[...v].sort((e,t)=>(function(e,t,n){let a=e=>{if(!e)return{priority:4,diff:0,date:"9999-99-99"};let t=el(e,n);return"today"===t.status||"ongoing"===t.status?{priority:1,diff:0,date:e.date}:"upcoming"===t.status?{priority:2,diff:t.diffDays,date:e.date}:{priority:3,diff:t.diffDays,date:e.date}},s=a(e),l=a(t);return s.priority!==l.priority?s.priority-l.priority:s.diff!==l.diff?s.diff-l.diff:s.date.localeCompare(l.date)})(V.find(t=>{var n;return t.id===(null===(n=f[e])||void 0===n?void 0:n.eventId)}),V.find(e=>{var n;return e.id===(null===(n=f[t])||void 0===n?void 0:n.eventId)}),U)),q=(e,t)=>{if(n){window.dispatchEvent(new CustomEvent("open-login-modal"));return}let a=t.currentTarget.getBoundingClientRect();F({top:a.bottom+4+330<=window.innerHeight?a.bottom+4:Math.max(8,a.top-4-330),left:Math.max(8,Math.min(a.right-220,window.innerWidth-220-8))}),A(e)},$=e=>{q(eo.find(e=>{var t;return!(null===(t=f[e])||void 0===t?void 0:t.eventId)})||"dday-".concat(v.length),e)},ee=async e=>{if(H){I(H);try{(await (0,M.X)("updateDdayWidgetEvent",{instanceId:H,eventId:e.id},m)).success?(p(H,e.id),A(null)):x(i.l.saveError,"error")}finally{I(null)}}},et=async e=>{if(n){window.dispatchEvent(new CustomEvent("open-login-modal"));return}if(await h({title:"이 일정을 D-DAY에서 뺄까요?",description:"일정 자체는 그대로 남고, D-DAY 위젯에서만 사라집니다.",confirmLabel:"빼기",tone:"default"})){G(e);try{let t=await (0,M.X)("removeDdayWidgetEvent",{instanceId:e},m);t.success?b(e):x(t.error||"삭제에 실패했습니다.","error")}finally{G(null)}}},en=H&&O&&(0,a.jsx)(ei.Z,{children:(0,a.jsx)("div",{ref:P,style:{top:O.top,left:O.left,width:220},className:"".concat(o().theme," fixed z-50 bg-white dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-lg shadow-lg overflow-hidden"),children:N?(0,a.jsx)("div",{className:"flex items-center justify-center py-6 text-zinc-400",children:(0,a.jsx)(E.Z,{size:16,className:"animate-spin"})}):z?(0,a.jsx)(u,{message:i.l.loadError,actionLabel:i.l.retry,onAction:()=>_(e=>e+1)}):0===V.length?(0,a.jsxs)("div",{className:"p-3 text-center",children:[(0,a.jsx)("p",{className:o().secondary,children:"등록된 일정이 없어요."}),(0,a.jsx)("button",{onClick:()=>r?r("work-schedule"):window.dispatchEvent(new CustomEvent("navigate-view",{detail:"work-schedule"})),className:"".concat(o().action," ").concat(o().emptyAction," mt-2"),children:"일정 관리로 이동"})]}):(0,a.jsx)("div",{className:"relative flex flex-col max-h-[320px] overflow-y-auto custom-scrollbar",children:V.map(e=>{let t=e.id===K;return(0,a.jsxs)("button",{ref:t?Y:void 0,onClick:()=>ee(e),className:"text-left px-3 py-2 hover:bg-zinc-100 dark:hover:bg-zinc-700 transition-colors border-b border-zinc-100 dark:border-zinc-700 last:border-none",children:[(0,a.jsx)("div",{className:"".concat(o().item," truncate"),children:e.title}
1),(0,a.jsxs)("div",{className:o().meta,children:[e.date,e.endDate&&e.endDate!==e.date?" ~ ".concat(e.endDate):""]})]},e.id)})})})}),ea=!n&&N,es=w?(0,a.jsx)("button",{onClick:$,disabled:!!R,className:"min-w-11 min-h-11 md:min-w-0 md:min-h-0 flex items-center justify-center p-1 rounded transition-colors text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"일정 추가",children:R?(0,a.jsx)(E.Z,{size:14,className:"animate-spin"}):(0,a.jsx)(L.Z,{size:14})}):null;return(0,a.jsxs)("div",{ref:X,className:"md:h-full h-auto",children:[(0,a.jsx)(d,{title:"D-DAY",className:"md:h-full h-auto",action:es,children:z&&!ea?(0,a.jsx)(u,{message:i.l.loadError,actionLabel:i.l.retry,onAction:()=>_(e=>e+1)}):0===v.length?ea?(0,a.jsx)(ed,{}):0===V.length?(0,a.jsx)(em,{onNavigate:r}):(0,a.jsx)(eu,{onPick:$}):(0,a.jsxs)("div",{className:"flex flex-col divide-y divide-zinc-100 dark:divide-zinc-800 h-full overflow-y-auto custom-scrollbar pr-0.5",children:[Q.map(e=>{var t;let n=null===(t=f[e])||void 0===t?void 0:t.eventId,s=V.find(e=>e.id===n);return(0,a.jsx)(eh,{event:s,loading:ea,todayStr:U,removing:T===e,onRemove:()=>et(e),onReselect:t=>q(e,t)},e)}),w&&(0,a.jsx)("div",{className:"pt-2 pb-1 px-1 shrink-0",children:(0,a.jsx)("button",{onClick:$,disabled:!!R,className:"".concat(o().action," w-full flex items-center justify-center gap-1.5 py-2 rounded-md border border-dashed border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors"),children:R?(0,a.jsx)(E.Z,{size:13,className:"animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.Z,{size:13}),(0,a.jsx)("span",{children:"일정 추가하기"})]})})})]})}),en]})}function ed(){return(0,a.jsx)(s.ContentLoadingState,{variant:"list",rows:2,label:i.l.loading,slowLabel:i.l.slow,className:o().loading})}function em(e){let{onNavigate:t}=e;return(0,a.jsx)(u,{message:"등록된 일정이 없어요.",actionLabel:"일정 관리로 이동",onAction:()=>t?t("work-schedule"):window.dispatchEvent(new CustomEvent("navigate-view",{detail:"work-schedule"}))})}function eu(e){let{onPick:t}=e;return(0,a.jsx)(u,{message:"일정을 선택해 주세요.",actionLabel:"일정 선택하기",onAction:t})}function eh(e){let{event:t,loading:n,todayStr:s,removing:l,onRemove:r,onReselect:d}=e;if(!t)return(0,a.jsx)("div",{className:"flex items-center justify-between py-2.5 px-1",children:n?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-zinc-400",children:[(0,a.jsx)(E.Z,{size:14,className:"animate-spin"}),(0,a.jsx)("span",{className:o().secondary,children:i.l.loading})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:o().secondary,children:"선택한 일정이 없어요."}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,a.jsx)("button",{onClick:d,className:"".concat(o().action," min-h-11 px-2 md:min-h-0 md:px-0"),children:"다시 선택하기"}),(0,a.jsx)("button",{onClick:r,disabled:l,className:"min-w-11 min-h-11 md:min-w-0 md:min-h-0 flex items-center justify-center p-1 rounded transition-colors text-zinc-400 hover:text-rose-500 hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"제거",children:l?(0,a.jsx)(E.Z,{size:12,className:"animate-spin"}):(0,a.jsx)(H.Z,{size:12})})]})]})});let m=el(t,s),u=new Date(t.date),h=t.endDate?new Date(t.endDate):null,x=!!(h&&t.endDate!==t.date),f="past"===m.status;return(0,a.jsxs)("div",{className:"flex items-center gap-3 py-2 px-1 group",children:[(0,a.jsxs)("div",{className:(0,c.cn)("flex-1 min-w-0 flex items-center gap-3",f&&"opacity-[0.45]"),children:[(0,a.jsx)("div",{className:"".concat(o().metric," w-20 shrink-0 text-left"),children:m.label}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:(0,c.cn)("w-1.5 h-1.5 rounded-full shrink-0","green"===t.tag?"bg-emerald-500":"red"===t.tag?"bg-rose-500":"bg-zinc-400")}),(0,a.jsx)("span",{className:"".concat(o().item," whitespace-nowrap overflow-x-hidden text-ellipsis min-w-0"),children:t.title})]}),(0,a.jsx)("div",{className:o().meta,children:x?"".concat(u.getMonth()+1,"월 ").concat(u.getDate(),"일 ~ ").concat(h.getMonth()+1,"월 ").concat(h.getDate(),"일"):"".concat(u.getMonth()+1,"월 ").concat(u.getDate(),"일")})]})]}),(0,a.jsx)("button",{onClick:r,disabled:l,className:"p-1 rounded transition-[color,opacity] text-zinc-300 hover:text-rose-500 hover:bg-zinc-100 dark:hover:bg-zinc-800 shrink-0 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100 focus-visible:opacity-100",title:"제거","aria-label":"".concat(t.title," D-DAY에서 빼기"),children:l?(0,a.jsx)(E.Z,{size:12,className:"animate-spin"}):(0,a.jsx)(H.Z,{size:12})})]})}var ex=n(27526),ef=n(45007);n(83079);var ep=(0,n(12119).$)("608d91596c966f5e041c5adc1d2c32e32f953a58");function eg(e,t){if(null===e||!Number.isFinite(e))return null;let n=Math.round(e);return"pm10"===t?n<=30?{label:"좋음",dotColor:"bg-blue-500",textColor:"text-blue-600 dar
1k:text-blue-400"}:n<=80?{label:"보통",dotColor:"bg-emerald-500",textColor:"text-emerald-600 dark:text-emerald-400"}:n<=150?{label:"나쁨",dotColor:"bg-amber-500",textColor:"text-amber-600 dark:text-amber-400"}:{label:"매우나쁨",dotColor:"bg-rose-500",textColor:"text-rose-600 dark:text-rose-400"}:n<=15?{label:"좋음",dotColor:"bg-blue-500",textColor:"text-blue-600 dark:text-blue-400"}:n<=35?{label:"보통",dotColor:"bg-emerald-500",textColor:"text-emerald-600 dark:text-emerald-400"}:n<=75?{label:"나쁨",dotColor:"bg-amber-500",textColor:"text-amber-600 dark:text-amber-400"}:{label:"매우나쁨",dotColor:"bg-rose-500",textColor:"text-rose-600 dark:text-rose-400"}}function eb(){let{status:e}=(0,ex.kP)(),[t,n]=(0,l.useState)(null),[r,m]=(0,l.useState)(!0),[h,x]=(0,l.useState)(0),[f,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if("loading"===e)return;if("unauthenticated"===e){n(null),m(!1),p(!0);return}let t=!1;return m(!0),n(null),p(!1),ep().then(e=>{t||(e.success&&e.data&&n(e.data),p("Unauthorized"===e.error),m(!1))}).catch(()=>{t||m(!1)}),()=>{t=!0}},[h,e]);let g=(null==t?void 0:t.regionName)?(0,a.jsxs)("span",{className:o().label,children:[t.regionName,t.isDefaultLocation?" \xb7 기본 지역":""]}):null,b=t?function(e,t){let n=!1===t;return 0===e?{src:n?"/lordicons/wired-lineal-1821-moon-stars-hover-pinch.json":"/lordicons/wired-lineal-804-sun-hover-rays.json",description:"맑음"}:1===e||2===e?{src:n?"/lordicons/wired-lineal-802-cloud-moon-hover-pinch.json":"/lordicons/wired-lineal-803-cloud-sun-hover-pinch.json",description:1===e?"대체로 맑음":"구름 조금"}:3===e?{src:"/lordicons/wired-lineal-801-clouds-hover-pinch.json",description:"흐림"}:[45,48].includes(e)?{src:"/lordicons/wired-lineal-814-cloud-fog-hover-pinch.json",description:"안개"}:[51,53,55,56,57,61,63,65,66,67,80,81,82].includes(e)?{src:n?"/lordicons/wired-lineal-813-cloud-rain-moon-hover-pinch.json":"/lordicons/wired-lineal-808-cloud-rain-hover-pinch.json",description:({51:"이슬비",53:"이슬비",55:"이슬비",56:"어는 이슬비",57:"어는 이슬비",61:"비",63:"비",65:"비",66:"어는 비",67:"어는 비",80:"소나기",81:"소나기",82:"소나기"})[e]}:[71,73,75,77,85,86].includes(e)?{src:"/lordicons/wired-lineal-810-cloud-snow-hover-pinch.json",description:77===e?"싸락눈":[85,86].includes(e)?"눈 소나기":"눈"}:[95,96,99].includes(e)?{src:95===e?"/lordicons/wired-lineal-806-cloud-bolt-hover-pinch.json":"/lordicons/wired-lineal-817-cloud-hail-hover-pinch.json",description:95===e?"뇌우":"우박 동반 뇌우"}:{src:"/lordicons/wired-lineal-801-clouds-hover-pinch.json",description:i.l.noData}}(t.weatherCode,t.isDay):null;return(0,a.jsx)(d,{title:"오늘의 날씨",className:"md:h-full h-auto weather-widget-card",action:g,children:r?(0,a.jsxs)("div",{className:"".concat(o().loading," flex flex-col justify-between h-full py-1"),"aria-busy":"true",children:[(0,a.jsx)(s.Q,{label:i.l.loading,slowLabel:i.l.slow}),(0,a.jsxs)("div",{className:"flex items-center justify-between my-auto px-1",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(Q.Od,{width:80,height:36}),(0,a.jsx)(Q.Od,{width:110,height:16})]}),(0,a.jsx)(Q.Od,{width:72,height:72,className:"rounded-full"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 items-center pb-0.5",children:[(0,a.jsx)(Q.Od,{width:90,height:14}),(0,a.jsx)(Q.Od,{width:90,height:14})]})]}):f?(0,a.jsx)(u,{message:i.l.login,actionLabel:i.l.loginAction,onAction:()=>window.dispatchEvent(new CustomEvent("open-login-modal"))}):t&&b?(0,a.jsxs)("div",{className:"flex flex-col justify-between h-full",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-1 my-auto gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col justify-center min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,a.jsxs)("span",{className:o().temperature,children:[Math.round(t.temp),"\xb0"]}),(0,a.jsx)("span",{className:"".concat(o().emphasis," break-keep"),children:b.description})]}),(0,a.jsxs)("div",{className:"".concat(o().label," flex flex-wrap items-center gap-1.5 mt-1.5"),children:[(0,a.jsxs)("span",{children:["최고 ",(0,a.jsxs)("strong",{className:o().status,children:[Math.round(t.tempMax),"\xb0"]})]}),(0,a.jsx)("span",{className:o().meta,children:"\xb7"}),(0,a.jsxs)("span",{children:["최저 ",(0,a.jsxs)("strong",{className:o().status,children:[Math.round(t.tempMin),"\xb0"]})]})]})]}),(0,a.jsx)("div",{className:"shrink-0 flex items-center justify-center",children:(0,a.jsx)(ef.w,{src:b.src,size:74,originalColors:!0,playOnMount:!0,trigger:"hover",target:"div"})})]}),(()=>{let e=eg(t.pm10,"pm10"),n=eg(t.pm25,"pm25");return(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 items-center pb-0.5",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1",children:[(0,a.jsx)("span",{className:o().label,children:"미세먼지"}),e&&null!==t.pm10?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:(0,
1c.cn)("w-1.5 h-1.5 rounded-full shrink-0",e.dotColor)}),(0,a.jsx)("span",{className:(0,c.cn)(o().status,e.textColor),children:e.label}),(0,a.jsxs)("span",{className:"".concat(o().meta," tabular-nums"),children:[Math.round(t.pm10),"㎍"]})]}):(0,a.jsx)("span",{className:o().meta,children:i.l.noData})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1",children:[(0,a.jsx)("span",{className:o().label,children:"초미세먼지"}),n&&null!==t.pm25?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:(0,c.cn)("w-1.5 h-1.5 rounded-full shrink-0",n.dotColor)}),(0,a.jsx)("span",{className:(0,c.cn)(o().status,n.textColor),children:n.label}),(0,a.jsxs)("span",{className:"".concat(o().meta," tabular-nums"),children:[Math.round(t.pm25),"㎍"]})]}):(0,a.jsx)("span",{className:o().meta,children:i.l.noData})]})]})})()]}):(0,a.jsx)(u,{message:i.l.loadError,actionLabel:i.l.retry,onAction:()=>x(e=>e+1)})})}var ev=n(35363);function ew(e){let{data:t,isEditing:n=!1,customLayouts:r,customVisibleWidgets:m,onLayoutChangeOverride:h,onRemoveWidget:x,transformScale:f=1}=e,b=(0,g.Ln)(),v=r||b.layouts,j=m||b.visibleWidgets,N=l.useMemo(()=>(j||[]).filter(e=>e in g.DV),[j]),z=h||b.updateLayout,W=l.useMemo(()=>{let e=(null==v?void 0:v.lg)||(null==v?void 0:v.md)||[],t=new Map;e.forEach(e=>{var n,a;t.set(e.i,{x:null!==(n=e.x)&&void 0!==n?n:0,y:null!==(a=e.y)&&void 0!==a?a:99})});let n=[...N].sort((e,n)=>{let a=t.get(e)||{x:0,y:99},s=t.get(n)||{x:0,y:99};return a.y!==s.y?a.y-s.y:a.x-s.x}),a=n.indexOf("meal"),s=n.indexOf("timetable");if(-1!==a&&-1!==s&&a!==s+1){let[e]=n.splice(a,1),t=n.indexOf("timetable");n.splice(t+1,0,e)}return n},[N,v]),[D,E]=(0,l.useState)(!1);if((0,l.useEffect)(()=>E(!0),[]),!D)return null;let S=e=>{var n,l,r;let c=null===(n=v.lg)||void 0===n?void 0:n.find(t=>t.i===e),m=null==c?void 0:c.w,h=null==c?void 0:c.h;if(["timetable","memo","schedule","attendance","roles","meal"].includes(e)){if(t.loading)return(0,a.jsx)(s.ContentLoadingState,{variant:"list",rows:3,label:i.l.loading,slowLabel:i.l.slow,className:"".concat(o().theme," ").concat(o().loading," h-full overflow-hidden rounded-lg bg-white dark:bg-[#191919]")});if(t.loadError)return(0,a.jsx)(d,{title:g.DV[e].label,className:"h-full",children:(0,a.jsx)(u,{message:i.l.loadError,actionLabel:i.l.retry,onAction:t.onReload})})}switch(e){case"weather":return(0,a.jsx)(eb,{});case"timetable":return(0,a.jsx)(w,{timetableView:t.timetableView,setTimetableView:t.setTimetableView,timetableData:t.timetableData,todayInfo:t.todayInfo,onReload:t.onReload,w:m,h:h});case"memo":return(0,a.jsx)(y,{memo:t.memo,onMemoChange:t.onMemoChange,onMemoBlur:t.onMemoBlur});case"schedule":return(0,a.jsx)(k,{events:t.scheduleEvents,isGuest:t.isGuest});case"attendance":return(0,a.jsx)(C,{stats:t.attendanceStats,records:t.attendanceRecords,isGuest:t.isGuest,homeroomStudents:t.homeroomStudents});case"roles":return(0,a.jsx)(P,{roleAssignments:t.roleAssignments,onReload:t.onReload});case"meal":return(0,a.jsx)(V,{schoolCode:null===(l=t.schoolInfo)||void 0===l?void 0:l.schoolCode,officeCode:null===(r=t.schoolInfo)||void 0===r?void 0:r.officeCode,onOpenSettings:t.onOpenSettings,isGuest:t.isGuest});case"checklist":return(0,a.jsx)($,{isGuest:t.isGuest});case"work-note-shortcut":return(0,a.jsx)(ea,{onNavigate:t.onNavigate});case"dday":return(0,a.jsx)(ec,{isGuest:t.isGuest,guestEvents:t.scheduleEvents,onNavigate:t.onNavigate});default:return null}},_=e=>(0,a.jsx)("div",{className:"md:h-full h-auto w-full relative",children:S(e)},e);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"md:hidden flex flex-col mobile-scroll-bottom [&>*+*]:border-t-8 [&>*+*]:border-[#f2f2ef] dark:[&>*+*]:border-black",children:0===W.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center rounded-2xl border-2 border-dashed border-zinc-200 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-900/20 my-4 mx-4",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-2.5 text-zinc-400",children:(0,a.jsx)(ev.Z,{size:18})}),(0,a.jsx)("p",{className:"text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-1",children:"표시할 위젯이 없습니다."}),(0,a.jsx)("p",{className:"text-xs text-zinc-400 dark:text-zinc-500 max-w-xs",children:"하단의 버튼을 눌러 위젯을 추가해보세요."})]}):W.map(e=>(0,a.jsx)("div",{className:"flex-shrink-0",children:_(e)},e))}
1),(0,a.jsx)("div",{className:(0,c.cn)("hidden md:block",n&&"dashboard-editing"),children:0===N.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center rounded-2xl border-2 border-dashed border-zinc-200 dark:border-zinc-800 bg-zinc-50/50 dark:bg-zinc-900/20 my-6",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-3 text-zinc-400",children:(0,a.jsx)(ev.Z,{size:20})}),(0,a.jsx)("p",{className:"text-sm font-semibold text-zinc-700 dark:text-zinc-200 mb-1",children:"표시 중인 위젯이 없습니다."}),(0,a.jsx)("p",{className:"text-xs text-zinc-500 dark:text-zinc-400 max-w-sm",children:n?"상단 툴바의 '+ 위젯 추가' 메뉴를 눌러 필요한 위젯을 추가해보세요.":"하단의 '위젯 추가 및 배치 편집' 버튼을 눌러 위젯을 추가해보세요."})]}):(0,a.jsx)(p,{layouts:v,onLayoutChange:(e,t)=>{n&&z(t)},isDraggable:n,isResizable:n,transformScale:f,children:N.map(e=>{let t=g.DV[e];return(0,a.jsx)("div",{"data-grid":t?{i:e,x:0,y:0,w:t.defaultW,h:t.defaultH,minW:t.minW,minH:t.minH,maxW:t.maxW,maxH:t.maxH,isResizable:n,isDraggable:n}:void 0,children:(0,a.jsxs)("div",{className:(0,c.cn)("h-full w-full relative",!n&&"transition",n&&"select-none cursor-move dashboard-drag-handle ring-2 ring-blue-500/30 rounded-xl"),children:[n&&x&&(0,a.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),x(e)},className:"no-drag absolute -top-2.5 -right-2.5 z-30 w-6 h-6 rounded-full border border-rose-500 dark:border-rose-400 bg-white dark:bg-zinc-900 text-rose-500 dark:text-rose-400 hover:bg-rose-50 dark:hover:bg-rose-950/40 hover:border-rose-600 dar
1k:hover:border-rose-300 hover:text-rose-600 dark:hover:text-rose-300 shadow-xs flex items-center justify-center transition-all duration-150 hover:scale-110 active:scale-95 cursor-pointer group",title:"위젯 숨기기","aria-label":"".concat(e," 위젯 숨기기"),children:(0,a.jsx)(A.Z,{size:12,strokeWidth:2.2,className:"transition-transform duration-200 group-hover:rotate-90"})}),n&&(0,a.jsx)("div",{className:"absolute inset-0 z-10 bg-transparent"}),(0,a.jsx)("div",{className:"h-full w-full",children:S(e)})]})},e)})})})]})}},71666:function(e,t,n){"use strict";n.d(t,{l:function(){return a}});let a={login:"로그인해 주세요.",loginAction:"로그인하기",school:"학교를 설정해 주세요.",schoolAction:"학교 설정하기",loading:"불러오는 중이에요.",slow:"불러오는 데 시간이 걸려요.",loadError:"불러오지 못했어요.",retry:"다시 불러오기",noData:"정보가 없어요.",saveError:"저장하지 못했어요.",noSearchResults:"검색 결과가 없어요."}},46173:function(e,t,n){"use strict";n.d(t,{OL:function(){return a},on:function(){return o}});let a=["조회","1교시","2교시","3교시","4교시","5교시","6교시","7교시","종례"],s={fg:"#5B429E",darkFg:"#B29FEA"},l={결석:{fg:"#C40000",darkFg:"#FF5A5A"},조퇴:s,지각:s,결과:s},i={fg:"#52525B",darkFg:"#A1A1AA"},r={질병:i,인정:i,미인정:i,기타:i},o=e=>{var t;return null!==(t=l[e])&&void 0!==t?t:r[e]}},22606:function(e,t,n){"use strict";n.d(t,{DV:function(){return l},Gj:function(){return i},Ln:function(){return u},h4:function(){return r}});var a=n(3011),s=n(89134);let l={timetable:{id:"timetable",label:"시간표",defaultW:1,defaultH:2,minW:1,minH:1},attendance:{id:"attendance",label:"출결 현황",defaultW:1,defaultH:2,minW:1,minH:1},roles:{id:"roles",label:"학생별 역할",defaultW:1,defaultH:2,minW:1,minH:1},meal:{id:"meal",label:"급식",defaultW:1,defaultH:1,minW:1,minH:1},checklist:{id:"checklist",label:"체크리스트",defaultW:1,defaultH:1,minW:1,minH:1},"work-note-shortcut":{id:"work-note-shortcut",label:"업무노트 바로가기",defaultW:1,defaultH:1,minW:1,minH:1},memo:{id:"memo",label:"메모",defaultW:1,defaultH:2,minW:1,minH:1},schedule:{id:"schedule",label:"다가오는 일정",defaultW:1,defaultH:4,minW:1,minH:1},dday:{id:"dday",label:"D-DAY",defaultW:1,defaultH:1,minW:1,minH:1},weather:{id:"weather",label:"오늘의 날씨",defaultW:1,defaultH:2,minW:1,minH:1}},i={lg:[{i:"timetable",x:0,y:0,w:1,h:2,minW:1,minH:1},{i:"attendance",x:0,y:2,w:1,h:2,minW:1,minH:1},{i:"work-note-shortcut",x:0,y:4,w:1,h:1,minW:1,minH:1},{i:"roles",x:0,y:5,w:1,h:2,minW:1,minH:1},{i:"meal",x:1,y:0,w:1,h:1,minW:1,minH:1},{i:"weather",x:1,y:1,w:1,h:1,minW:1,minH:1},{i:"checklist",x:1,y:2,w:1,h:1,minW:1,minH:1},{i:"memo",x:1,y:3,w:1,h:2,minW:1,minH:1},{i:"dday",x:2,y:0,w:1,h:1,minW:1,minH:1},{i:"schedule",x:2,y:1,w:1,h:4,minW:1,minH:1}],md:[{i:"timetable",x:0,y:0,w:1,h:2,minW:1,minH:1},{i:"attendance",x:0,y:2,w:1,h:2,minW:1,minH:1},{i:"work-note-shortcut",x:0,y:4,w:1,h:1,minW:1,minH:1},{i:"roles",x:0,y:5,w:1,h:2,minW:1,minH:1},{i:"meal",x:1,y:0,w:1,h:1,minW:1,minH:1},{i:"weather",x:1,y:1,w:1,h:1,minW:1,minH:1},{i:"checklist",x:1,y:2,w:1,h:1,minW:1,minH:1},{i:"memo",x:1,y:3,w:1,h:2,minW:1,minH:1},{i:"dday",x:2,y:0,w:1,h:1,minW:1,minH:1},{i:"schedule",x:2,y:1,w:1,h:4,minW:1,minH:1}],sm:[{i:"timetable",x:0,y:0,w:1,h:2,minW:1,minH:1},{i:"attendance",x:0,y:2,w:1,h:2,minW:1,minH:1},{i:"work-note-shortcut",x:0,y:4,w:1,h:1,minW:1,minH:1},{i:"memo",x:0,y:5,w:1,h:2,minW:1,minH:1},{i:"roles",x:0,y:7,w:1,h:2,minW:1,minH:1},{i:"meal",x:1,y:0,w:1,h:1,minW:1,minH:1},{i:"weather",x:1,y:1,w:1,h:1,minW:1,minH:1},{i:"checklist",x:1,y:2,w:1,h:1,minW:1,minH:1},{i:"dday",x:1,y:3,w:1,h:1,minW:1,minH:1},{i:"schedule",x:1,y:4,w:1,h:4,minW:1,minH:1}]},r=["timetable","attendance","meal","checklist","memo","schedule","weather","dday","work-note-shortcut"],o=new Set(Object.keys(l));function c(e){if(!Array.isArray(e))return r;let t=[],n=!1,a=!1;for(let s of e)"string"==typeof s&&("dday"===s?(n=!0,t.push("dday")):s.startsWith("dday:")?a=!0:o.has(s)&&t.push(s));return a&&!n&&t.push("dday"),Array.from(new Set(t))}function d(e,t){if(!e||"object"!=typeof e)return i;let n=new Set(t||Object.keys(l)),a={};for(let[t,s]of Object.entries(e))Array.isArray(s)?a[t]=s.filter(e=>e&&"string"==typeof e.i&&(n.has(e.i)||"dday"===e.i)).map(e=>{let t=l[e.i];if(!t)return e;let n={...e,minW:t.minW,minH:t.minH};return void 0!==t.maxW?n.maxW=t.maxW:delete n.maxW,void 0!==t.maxH?n.maxH=t.maxH:delete n.maxH,n}):a[t]=s;return a}let m={},u=(0,a.U)()((0,s.tJ)(e=>({layouts:i,visibleWidgets:r,widgetConfig:m,isLoaded:!1,updateLayout:t=>e({layouts:t}),toggleWidget:t=>e(e=>({visibleWidgets:e.visibleWidgets.includes(t)?e.visibleWidgets.filter(e=>e!==t):[...e.visibleWidgets,t]})),saveConfig:(t,n)=>{let a=c(n);e({layouts:d(t,a),visibleWidgets:a})},setConfig:(t,n)=>{let a=c(n);e({layouts:d(t,a),visibleWidgets:a})}
1,setWidgetEventConfig:(t,n)=>e(e=>({widgetConfig:{...e.widgetConfig,[t]:{eventId:n}}})),clearWidgetEventConfig:t=>e(e=>{let n={...e.widgetConfig};return delete n[t],{widgetConfig:n}}),resetLayout:()=>e({layouts:i,visibleWidgets:r}),initFromData:(t,n,a)=>{let s=c(n||r);e({layouts:d(t||i,s),visibleWidgets:s,widgetConfig:a||m,isLoaded:!0})},loadFromServer:(t,n,a)=>{let s=c(n||r);e({layouts:d(t||i,s),visibleWidgets:s,widgetConfig:a||m,isLoaded:!0})},setLoaded:t=>e({isLoaded:t}),clear:()=>e({layouts:i,visibleWidgets:r,widgetConfig:m,isLoaded:!1})}),{name:"dashboard-storage-v1",version:2,migrate:e=>{var t;return{layouts:i,visibleWidgets:r,widgetConfig:null!==(t=null==e?void 0:e.widgetConfig)&&void 0!==t?t:m}},partialize:e=>({layouts:e.layouts,visibleWidgets:e.visibleWidgets,widgetConfig:e.widgetConfig}),onRehydrateStorage:()=>e=>{e&&(e.visibleWidgets=c(e.visibleWidgets),e.layouts=d(e.layouts,e.visibleWidgets))}}))},86909:function(e){e.exports={scrollbars:"widget-typography_scrollbars__afR_n",theme:"widget-typography_theme__CTQsi",title:"widget-typography_title__dOg4_",body:"widget-typography_body__6ZVUT",item:"widget-typography_item__W0As9",emphasis:"widget-typography_emphasis__VzyhU",secondary:"widget-typography_secondary__0yLXP",action:"widget-typography_action__PIDhE",meta:"widget-typography_meta__Ae5_A",label:"widget-typography_label__YWwXk",status:"widget-typography_status__3jEHW",activeLabel:"widget-typography_activeLabel__LGmbU",input:"widget-typography_input__ufMYu",metric:"widget-typography_metric__RsOKt",temperature:"widget-typography_temperature__acavr",badge:"widget-typography_badge__p8JNg",empty:"widget-typography_empty__cv1MK",emptyMessage:"widget-typography_emptyMessage__bqQBN",attendanceEmpty:"widget-typography_attendanceEmpty__PTLDI",emptyAction:"widget-typography_emptyAction__pSg73",loading:"widget-typography_loading__9f8ir",tableHeader:"widget-typography_tableHeader___Q4XH",tableCell:"widget-typography_tableCell__Vq4EC",filledCell:"widget-typography_filledCell__dz9bP",todayHeader:"widget-typography_todayHeader__NpkA1",todayCell:"widget-typography_todayCell__Tds_Q"}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.