PageSourceSearch

https://naemo.ai/_next/static/chunks/8037.d21f4ff971e7045c.js

js naemo.ai collected 2026-09-24 14:31:47 UTC 36,966 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8037],{78037:function(e,t,n){n.r(t),n.d(t,{default:function(){return K}});var a=n(57437),r=n(98319),l=n(10136),s=n(2265),i=n(92451),d=n(10407),o=n(32489),c=n(18930),x=n(88501),u=n(99397),m=n(93448),h=n(83008),f=n(67920),p=n(54887),b=n(54696),g=n(96214),v=n(4908),w=n(53834),j=n(65696),D=n(63070),y=n(86035),k=n(27742),N=n(54886),E=n(56942),C=n(60936),z=n(31667),S=n(35902),M=n(31091),F=n(83105),T=n(72578),W=n(31047),Z=n(35596),A=n(26710);let _={gray:"bg-[#EDEDED] dark:bg-zinc-500 border-zinc-200/50 dark:border-white/10",green:"bg-[#D1EBDD] dark:bg-emerald-600 border-emerald-200/50 dark:border-emerald-500/20",red:"bg-[#F2DCDC] dark:bg-rose-600 border-rose-200/50 dark:border-rose-500/20"},Y={gray:"from-transparent to-[#EDEDED] dark:to-zinc-500",green:"from-transparent to-[#D1EBDD] dark:to-emerald-600",red:"from-transparent to-[#F2DCDC] dark:to-rose-600"},L={gray:"bg-[#8E8E93]",green:"bg-green-500",red:"bg-red-500"};function O(e){let{events:t,onCreateEvent:n,onSaveEvent:r,onDeleteEvent:l,onOpenAcademicScheduleImport:o}=e,[c,x]=(0,s.useState)(new Date),[h,f]=(0,s.useState)(null),[p,b]=(0,s.useState)("list"),[g,v]=(0,s.useState)(null),[w,O]=(0,s.useState)(""),[B,G]=(0,s.useState)("gray"),[U,R]=(0,s.useState)(""),[I,P]=(0,s.useState)(void 0),V=(0,s.useMemo)(()=>{let e=(0,j.z)((0,D.N)(c),{weekStartsOn:0}),t=(0,y.v)((0,k.V)(c),{weekStartsOn:0});return(0,N.D)({start:e,end:t})},[c]),X=(0,s.useMemo)(()=>{let e={};return t.forEach(t=>{if(!t.date)return;let n=(0,E.b)((0,C.D)(t.date)),a=t.endDate?(0,E.b)((0,C.D)(t.endDate)):n,r=a<n?n:a;(0,N.D)({start:n,end:r}).forEach(n=>{let a=(0,z.WU)(n,"yyyy-MM-dd");e[a]||(e[a]=[]),e[a].push(t)})}),e},[t]),K=(0,s.useMemo)(()=>{let e=[];for(let t=0;t<V.length;t+=7){let n=V.slice(t,t+7),a=n.map(e=>(0,z.WU)(e,"yyyy-MM-dd"));e.push({days:n,dates:a,...function(e,t){let n=new Map;e.forEach((e,a)=>{(t[e]||[]).forEach(e=>{let t=n.get(e.id);t?t.endCol=a:n.set(e.id,{event:e,startCol:a,endCol:a})})});let a=Array.from(n.values()).sort((e,t)=>{let n=Number(!!e.event.endDate&&e.event.endDate>e.event.date);return Number(!!t.event.endDate&&t.event.endDate>t.event.date)-n||e.startCol-t.startCol||t.endCol-t.startCol-(e.endCol-e.startCol)}),r=[],l=e.map(()=>0);return{events:a.map(e=>{let t=(1<<e.endCol-e.startCol+1)-1<<e.startCol,n=0;for(;(r[n]||0)&t;)n++;if(r[n]=(r[n]||0)|t,n>=4)for(let t=e.startCol;t<=e.endCol;t++)l[t]++;return{...e,row:n}}),hiddenCounts:l}}(a,X)})}return e},[V,X]),q=h&&X[h]||[],H=e=>{f(e),b("list")},J=(e,t)=>{e?(v(e.id),O(e.title),G(e.tag),R(e.date),P(e.endDate)):(v(null),O(""),G("gray"),R(t),P(void 0)),b("form")},Q=(0,z.WU)(new Date,"yyyy-MM-dd");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col h-full bg-[#FBFBF9] dark:bg-[#111] overflow-hidden select-none mobile-safe-pad-bottom",children:[(0,a.jsxs)("header",{className:"shrink-0 z-40 bg-white/80 dark:bg-[#111]/80 backdrop-blur-lg border-b border-zinc-100/30 dark:border-white/5 h-14 flex items-center justify-between px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 group",children:[(0,a.jsx)("button",{"aria-label":"이전 달",onClick:()=>x((0,S.W)(c,1)),className:"p-2 -ml-2 rounded-xl text-zinc-400 active:bg-zinc-100 dark:active:bg-white/5 transition-colors",children:(0,a.jsx)(i.Z,{size:18,strokeWidth:2.5})}),(0,a.jsx)("h1",{className:"text-[17px] font-bold text-zinc-900 dark:text-white px-1",children:(0,z.WU)(c,"yyyy년 M월")}),(0,a.jsx)("button",{"aria-label":"다음 달",onClick:()=>x((0,M.z)(c,1)),className:"p-2 rounded-xl text-zinc-400 active:bg-zinc-100 dark:active:bg-white/5 transition-colors",children:(0,a.jsx)(d.Z,{size:18,strokeWidth:2.5})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[o&&(0,a.jsx)("button",{onClick:o,className:"flex h-8 w-8 items-center justify-center rounded-full bg-zinc-100 text-zinc-700 active:scale-95 dark:bg-white/10 dark:text-white transition","aria-label":"우리학교 학사일정 가져오기",children:(0,a.jsx)(W.Z,{size:16,strokeWidth:2.2})}),(0,a.jsxs)("button",{onClick:()=>{f(Q),J(null,Q)},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-[#EDEDED] dark:bg-white text-black active:scale-95 transition",children:[(0,a.jsx)(u.Z,{size:16,strokeWidth:2}),(0,a.jsx)("span",{className:"text-[13px] font-medium text-zinc-800 dark:text-black",children:"추가"})]})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-7 border-b border-zinc-100/30 dark:border-white/5 bg-white/50 dark:bg-white/[0.01] px-3",children:["일","월","화","수","목","금","토"].map((e,t)=>(0,a.jsx)("div",{className:(0,m.cn)("py-2 text-center text-[10px] font-bold tracking-tighter uppercase",0===t?"text-rose-500/80":6===t?"text-blue-500/80":"text-zinc-400"),children:e},e))}),(0,a.jsx)("div",{className:"flex-1 min-h-0 grid overflow-hidden border-b border-zinc-100/30 dark:border-white/5 px-3 bg-white dark:bg-[#111]",style:{gridTemplateRows:"repeat(".concat(K.length,", minmax(0, 1fr))")},children:K.map(e=>(0,a.jsxs)("div",{className:"relative grid grid-cols-7 min-h-0 overflow-hidden",children:[e.days.map((t,n)=>{let r=e.dates[n],l=(0,F.z)(t),s=t.getMonth()===c.getMonth();return(0,a.jsx)("button",{type:"button","aria-label":"".concat((0,z.WU)(t,"yyyy년 M월 d일")," 일정 ").concat((X[r]||[]).length,"개"),onClick:()=>H(r),onContextMenu:e=>e.preventDefault(),className:(0,m.cn)("relative flex flex-col border-r border-b border-zinc-100/30 dark:border-white/5 p-0.5 min-h-0 overflow-hidden transition-colors active:bg-zinc-50 dark:active:bg-white/[0.02]",!s&&"bg-zinc-50/50 dark:bg-black/20 opacity-30",l&&"bg-blue-50/20 dark:bg-blue-500/[0.04]"),children:(0,a.jsx)("span",{className:(0,m.cn)("text-[10px] font-bold ml-0.5 mt-0.5 w-4 h-4 flex items-center justify-center rounded-full",l&&"today-indicator",l?"bg-blue-500 text-white":0===t.getDay()?"text-rose-500/80":6===t.getDay()?"text-blue-500/80":"text-zinc-500"),children:(0,z.WU)(t,"d")})},r)}),(0,a.jsxs)("div",{"aria-hidden":"true",className:"absolute inset-x-0 top-6 grid grid-cols-7 auto-rows-[15px] gap-y-0.5 pointer-events-none",children:[e.events.filter(e=>e.row<4).map(t=>{let{event:n,startCol:r,endCol:l,row:s}=t;return(0,a.jsxs)("div",{style:{gridColumn:"".concat(r+1," / ").concat(l+2),gridRow:s+1},className:(0,m.cn)("relative min-w-0 mx-0.5 h-[15px] rounded-[4px] px-1 text-left flex items-center overflow-hidden border-[0.5px]",_[n.tag],"text-zinc-700 dark:text-white",n.date<e.dates[0]&&"rounded-l-none ml-0",n.endDate&&n.endDate>e.dates[6]&&"rounded-r-none mr-0",e.days[l]<(0,D.N)(c)&&"opacity-30",e.days[r]>(0,k.V)(c)&&"opacity-30"),children:[(0,a.jsx)("span",{className:"text-[9px] font-bold leading-none whitespace-nowrap overflow-hidden",children:n.title}),(0,a.jsx)("div",{className:(0,m.cn)("absolute inset-y-0 right-0 w-4 pointer-events-none bg-gradient-to-r",Y[n.tag])})]},n.id)}),e.hiddenCounts.map((t,n)=>t>0&&(0,a.jsxs)("div",{style:{gridColumn:n+1,gridRow:5},className:"text-[8px] font-bold text-zinc-400 dark:text-zinc-500 ml-1 leading-none",children:["+ ",t]},e.dates[n]))]})]},e.dates[0]))})]}),(0,a.jsx)(Z.Z,{isOpen:!!h,onClose:()=>{f(null),b("list")},footer:"form"===p?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[g&&(0,a.jsx)("button",{onClick:()=>{g&&l(g),b("list")},className:"px-4 py-3 rounded-xl text-sm font-semibold text-red-500 dark:text-red-400 bg-red-50 dark:bg-red-950/30 active:bg-red-100 dark:active:bg-red-950/50 transition-colors",children:"삭제"}),(0,a.jsx)("button",{onClick:()=>{let e=w.trim();if(!e||!U)return;let t=U,a=I;a&&a<t&&([t,a]=[a,t]),g?r(g,e,B,t,a):n(t,e,B,a),b("list")},disabled:!w.trim(),className:(0,m.cn)("flex-1 py-3 rounded-xl text-sm font-bold transition active:scale-[0.98]",w.trim()?"mobile-sheet-primary bg-zinc-900 text-white dark:bg-white dark:text-zinc-900":"bg-zinc-200 dark:bg-zinc-800 text-zinc-400 dark:text-zinc-500 cursor-not-allowed"),children:"저장"})]}):void 0,children:"list"===p?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{className:"text-[16px] font-bold text-zinc-900 dark:text-zinc-100 mb-3",children:h?(0,z.WU)((0,C.D)(h),"M월 d일 (EEE)",{locale:T.ko}):""}),0===q.length?(0,a.jsx)("p",{className:"text-center text-zinc-400 dark:text-zinc-500 text-sm py-8",children:"일정이 없습니다"}):(0,a.jsx)("div",{className:"flex flex-col gap-1.5",children:q.map(e=>(0,a.jsxs)("button",{onClick:()=>J(e,h),className:"w-full flex items-center gap-2.5 px-3 py-3 rounded-xl bg-zinc-50 dark:bg-zinc-800 active:bg-zinc-100 dark:active:bg-zinc-700 text-left transition-colors",children:[(0,a.jsx)("span",{className:(0,m.cn)("w-2.5 h-2.5 rounded-full shrink-0 border",_[e.tag])}),(0,a.jsx)("span",{className:"flex-1 text-[14px] font-medium text-zinc-800 dark:text-zinc-200 truncate",children:e.title}),(0,a.jsx)(d.Z,{size:16,className:"text-zinc-300 dark:text-zinc-500 shrink-0"})]},e.id))}),(0,a.jsxs)("button",{onClick:()=>J(null,h),className:"mobile-sheet-primary w-full mt-3 mb-4 flex items-center justify-center gap-1.5 py-3.5 rounded-xl bg-zinc-900 text-white dark:bg-white dark:text-zinc-900 text-[15px] font-semibold active:scale-[0.98] transition-transform",children:[(0,a.jsx)(u.Z,{size:16})," 일정 추가"]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 mb-4",children:[(0,a.jsx)("button",{onClick:()=>b("list"),className:"-ml-1.5 p-1.5 rounded-lg text-zinc-500 dark:text-zinc-400 active:bg-zinc-100 dark:active:bg-zinc-800 transition-colors","aria-label":"뒤로",children:(0,a.jsx)(i.Z,{size:20})}),(0,a.jsx)("h3",{className:"text-[16px] font-bold text-zinc-900 dark:text-zinc-100",children:g?"일정 수정":"일정 추가"})]}),(0,a.jsx)("label",{className:"block text-xs text-zinc-400 dark:text-zinc-500 mb-2",children:"태그"}),(0,a.jsx)("div",{className:"flex items-center gap-3 mb-4",children:["gray","green","red"].map(e=>(0,a.jsx)("button",{onClick:()=>G(e),className:(0,m.cn)("w-8 h-8 rounded-full flex items-center justify-center border-2 transition",B===e?"border-zinc-800 dark:border-white scale-110":"border-transparent opacity-60 active:opacity-100"),children:(0,a.jsx)("span",{className:(0,m.cn)("w-4 h-4 rounded-full",L[e])})},e))}),(0,a.jsx)("label",{className:"block text-xs text-zinc-400 dark:text-zinc-500 mb-2",children:"내용"}),(0,a.jsx)("input",{type:"text",value:w,onChange:e=>O(e.target.value),placeholder:"일정 내용 입력...",autoFocus:!0,className:"w-full px-3.5 h-[46px] bg-zinc-100 dark:bg-zinc-800 rounded-xl text-zinc-900 dark:text-zinc-100 text-[16px] placeholder:text-zinc-400 dark:placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-blue-500/30 mb-4"}),(0,a.jsx)("label",{className:"block text-xs text-zinc-400 dark:text-zinc-500 mb-2",children:"날짜"}),(0,a.jsxs)("div",{className:"relative min-h-[46px] bg-white dark:bg-zinc-800 rounded-xl border border-zinc-200 dark:border-zinc-700 flex items-center px-3",children:[(0,a.jsx)(W.Z,{size:15,className:"text-zinc-400 dark:text-zinc-500 shrink-0 mr-1"}),(0,a.jsx)(A.h,{overlay:!0,value:U,onChange:e=>{R(e),I&&I<e&&P(void 0)},endDate:I,onEndDateChange:e=>P(e||void 0),className:"text-[15px] font-medium text-left w-full py-2.5 text-zinc-800 dark:text-zinc-100"})]}),(0,a.jsx)("div",{className:"mb-2"})]})})]})}var B=n(67650);let G={gray:"bg-[#8E8E93]",green:"bg-green-500",red:"bg-red-500"},U=e=>{let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(a)},R=e=>{if(!e)return"";let t=new Date(e);return isNaN(t.getTime())?"":"".concat(t.getMonth()+1,"월 ").concat(t.getDate(),"일")},I=e=>{let{value:t,onChange:n,endDate:r,onEndDateChange:l,className:o}
1=e,[c,x]=(0,s.useState)(!1),[u,h]=(0,s.useState)(()=>{let e=new Date(t);return isNaN(e.getTime())?new Date:e}),[f,b]=(0,s.useState)(!!r),[g,v]=(0,s.useState)(!1),[w,j]=(0,s.useState)(null),D=(0,s.useRef)(null),y=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{var t,n;let a=e.target,r=null===(t=D.current)||void 0===t?void 0:t.contains(a),l=null===(n=y.current)||void 0===n?void 0:n.contains(a);r||l||x(!1)},t=()=>x(!1);return c&&(window.addEventListener("mouseup",e),window.addEventListener("scroll",t,{capture:!0})),()=>{window.removeEventListener("mouseup",e),window.removeEventListener("scroll",t,{capture:!0})}},[c]),(0,s.useEffect)(()=>{b(!!r)},[r]),(0,s.useEffect)(()=>{if(c&&D.current){let e=D.current.getBoundingClientRect();j({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX+e.width/2})}},[c]);let k=new Date(u.getFullYear(),u.getMonth()+1,0).getDate(),N=new Date(u.getFullYear(),u.getMonth(),1).getDay(),E=Array.from({length:k},(e,t)=>t+1),C=Array.from({length:N},(e,t)=>null),z=e=>{let t=new Date(u);t.setMonth(t.getMonth()+e),h(t)},S=e=>{let a=U(new Date(u.getFullYear(),u.getMonth(),e));f&&l?g?(a<t?(l(t),n(a)):l(a),v(!1),x(!1)):(n(a),l(void 0),v(!0)):(n(a),x(!1))},M=e=>{let t=new Date;return u.getFullYear()===t.getFullYear()&&u.getMonth()===t.getMonth()&&e===t.getDate()},F=e=>{if(!f||!r)return!1;let n=U(new Date(u.getFullYear(),u.getMonth(),e));return n>t&&n<r},T=e=>U(new Date(u.getFullYear(),u.getMonth(),e))===t,W=e=>!!r&&U(new Date(u.getFullYear(),u.getMonth(),e))===r,Z=r?"".concat(R(t)," ~ ").concat(R(r)):t?R(t):"미정";return(0,a.jsxs)("div",{className:"relative h-full",children:[(0,a.jsx)("button",{ref:D,type:"button",onClick:()=>x(!c),onMouseDown:e=>e.preventDefault(),className:(0,m.cn)("px-3 py-2 bg-[#1C1C1E] rounded-lg text-sm text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",o),children:Z}),c&&w&&(0,p.createPortal)((0,a.jsxs)("div",{ref:y,style:{top:w.top,left:w.left},className:"fixed bg-[#1C1C1E] border border-white/10 rounded-2xl shadow-2xl z-[9999] p-4 w-[280px] -translate-x-1/2 animate-in fade-in slide-in-from-top-2 duration-200 calendar-picker-popup",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("button",{"aria-label":"이전 달",type:"button",onClick:()=>z(-1),onMouseDown:e=>e.preventDefault(),className:"p-1.5 hover:bg-white/10 rounded-lg transition-colors",children:(0,a.jsx)(i.Z,{size:16,className:"text-[#8E8E93]"})}),(0,a.jsxs)("span",{className:"text-sm font-semibold text-white",children:[u.getFullYear(),"년 ",u.getMonth()+1,"월"]}),(0,a.jsx)("button",{"aria-label":"다음 달",type:"button",onClick:()=>z(1),onMouseDown:e=>e.preventDefault(),className:"p-1.5 hover:bg-white/10 rounded-lg transition-colors",children:(0,a.jsx)(d.Z,{size:16,className:"text-[#8E8E93]"})})]}),f&&l&&(0,a.jsx)("div",{className:"text-center text-xs text-[#8E8E93] mb-2",children:g?"종료일을 선택하세요":"시작일을 선택하세요"}),(0,a.jsx)("div",{className:"grid grid-cols-7 gap-1 text-center text-[11px] text-[#8E8E93] mb-2 font-medium",children:["일","월","화","수","목","금","토"].map(e=>(0,a.jsx)("div",{children:e},e))}),(0,a.jsxs)("div",{className:"grid grid-cols-7 gap-1",children:[C.map((e,t)=>(0,a.jsx)("div",{className:"w-8 h-8"},"b-".concat(t))),E.map(e=>{let t=T(e),n=W(e),r=F(e);return(0,a.jsx)("button",{type:"button",onClick:()=>S(e),onMouseDown:e=>e.preventDefault(),className:(0,m.cn)("w-8 h-8 rounded-lg text-xs font-medium transition flex items-center justify-center",t||n||r||M(e)?"":"calendar-date-normal text-white/70 hover:bg-white/10"),children:!M(e)||t||n||r?t||n?(0,a.jsx)("span",{className:"calendar-date-selected w-7 h-7 flex items-center justify-center rounded-md text-xs",children:e}):r?(0,a.jsx)("span",{className:"calendar-date-inrange w-7 h-7 flex items-center justify-center rounded-md text-xs",children:e}):e:(0,a.jsx)("span",{className:"calendar-date-today w-6 h-6 flex items-center justify-center rounded-full text-xs",children:e})},e)})]}),l&&(0,a.jsxs)("div",{className:"mt-[10px] pt-[10px] border-t border-white/10 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-[#8E8E93]",children:"종료일 설정"}),(0,a.jsx)("button",{type:"button",onClick:()=>{let e=!f;b(e),!e&&l?(l(void 0),v(!1)):e&&v(!r)},onMouseDown:e=>e.preventDefault(),className:(0,m.cn)("w-11 h-6 rounded-full transition-all duration-200 relative calendar-picker-toggle",f?"bg-green-500":"bg-[#3A3A3C]"),children:(0,a.jsx)("div",{className:(0,m.cn)("absolute top-1 w-4 h-4 bg-white rounded-full transition-all duration-200 shadow-sm",f?"left-6":"left-1")})})]})]}),document.body)]})},P=e=>{let{isOpen:t,onClose:n,onSave:r,onDelete:l,initialDate:i,initialTitle:d="",initialTag:c="gray",initialEndDate:x}
1=e,[u,h]=(0,s.useState)([]),f=(0,s.useRef)(null);(0,s.useEffect)(()=>{t&&(h([{id:Math.random().toString(36).substr(2,9),title:d,tag:c||"gray",date:i,endDate:x}]),setTimeout(()=>{var e;return null===(e=f.current)||void 0===e?void 0:e.focus()},100))},[t,d,c,i,x]);let p=()=>{let e=u.filter(e=>e.title.trim());e.length>0&&(r(e.map(e=>({title:e.title.trim(),tag:e.tag,date:e.date,endDate:e.endDate}))),n())},b=e=>{"Enter"===e.key?p():"Escape"===e.key&&n()},g=(e,t,n)=>{h(a=>a.map(a=>a.id===e?{...a,[t]:n}:a))},v=e=>{h(t=>1===t.length?(n(),t):t.filter(t=>t.id!==e))};return t?(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:n,children:(0,a.jsxs)("div",{className:"bg-[#2C2C2E] rounded-2xl pt-5 pb-8 md:pb-8 px-4 md:px-5 w-full max-w-[95vw] md:max-w-[800px] shadow-2xl border border-white/10 max-h-[85vh] md:max-h-[80vh] flex flex-col overflow-hidden animate-in zoom-in-95 duration-200 md:-translate-y-12",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6 shrink-0 md:px-1",children:[(0,a.jsxs)("h3",{className:"text-lg font-bold text-white md:hidden",children:["일정 ",d?"수정":"추가"]}),(0,a.jsx)("button",{type:"button",onClick:n,onMouseDown:e=>e.preventDefault(),className:"md:hidden p-1.5 -mr-1 rounded-lg text-[#8E8E93] active:text-white transition-colors","aria-label":"닫기",children:(0,a.jsx)(o.Z,{size:22})}),(0,a.jsxs)("div",{className:"hidden md:flex items-center md:gap-2 ml-auto",children:[l?(0,a.jsx)("button",{type:"button",onClick:()=>{l(),n()},onMouseDown:e=>e.preventDefault(),className:"px-3 py-2 text-xs font-medium text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors",children:"삭제"}):(0,a.jsx)("button",{type:"button",onClick:n,onMouseDown:e=>e.preventDefault(),className:"px-3 py-2 text-xs font-medium text-[#8E8E93] hover:text-white hover:bg-white/10 rounded-lg transition-colors",children:"취소"}),(0,a.jsx)("button",{onClick:p,onMouseDown:e=>e.preventDefault(),disabled:u.some(e=>!e.title),className:"px-3 py-1.5 bg-white text-black border-none outline-none rounded-xl text-xs font-bold hover:bg-white/90 disabled:opacity-50 disabled:cursor-not-allowed transition whitespace-nowrap event-modal-save-btn",children:"저장"})]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar flex flex-col gap-6 md:gap-3 pr-1",children:u.map((e,t)=>(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-3 items-stretch md:items-end animate-in fade-in slide-in-from-top-2 duration-200 pb-4 md:pb-0 border-b md:border-0 border-white/5 last:border-0",children:[(0,a.jsxs)("div",{className:"shrink-0 flex flex-col",children:[0===t?(0,a.jsx)("label",{className:"block text-xs text-[#8E8E93] mb-2 pl-1",children:"태그"}):(0,a.jsx)("div",{className:"hidden md:block h-[24px]"}),(0,a.jsx)("div",{className:"flex gap-2 items-center h-[38px] pl-1",children:["gray","green","red"].map(t=>(0,a.jsx)("button",{type:"button",onClick:()=>g(e.id,"tag",t),onMouseDown:e=>e.preventDefault(),className:(0,m.cn)("w-7 h-7 md:w-6 md:h-6 rounded-full flex items-center justify-center border-2 transition",e.tag===t?"border-white md:scale-100 scale-110":"border-transparent opacity-60 hover:opacity-100"),children:(0,a.jsx)("span",{className:(0,m.cn)("w-4 h-4 md:w-3 md:h-3 rounded-full",G[t])})},t))})]}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 md:flex-1 md:ml-1",children:[0===t?(0,a.jsx)("label",{className:"block text-xs text-[#8E8E93] mb-2 pl-1",children:"내용"}):(0,a.jsx)("div",{className:"hidden md:block h-[24px]"}),(0,a.jsx)("input",{ref:t===u.length-1?f:null,type:"text",value:e.title,onChange:t=>g(e.id,"title",t.target.value),onKeyDown:b,placeholder:"일정 내용 입력...",className:"w-full px-3.5 py-2 md:px-3 bg-[#1C1C1E] rounded-xl md:rounded-lg text-white text-[16px] md:text-sm placeholder:text-[#5C5C5E] focus:outline-none h-[44px] md:h-[38px] border border-white/5 md:border-transparent focus:border-white/10 transition-colors event-modal-input"})]}),(0,a.jsxs)("div",{className:"w-full md:w-auto md:min-w-[180px] md:flex-none",children:[0===t?(0,a.jsx)("label",{className:"block text-xs text-[#8E8E93] mb-2 pl-1",children:"날짜"}):(0,a.jsx)("div",{className:"hidden md:block h-[24px]"}),(0,a.jsx)("div",{className:"h-[42px] md:h-[38px]",children:(0,a.jsx)(I,{value:e.date,onChange:t=>g(e.id,"date",t),endDate:e.endDate,onEndDateChange:t=>g(e.id,"endDate",t),className:"w-full justify-between flex items-center h-full event-modal-date-btn px-4 md:px-3"})})]}),(0,a.jsx)("div",{className:"hidden md:flex shrink-0 justify-end md:ml-auto",children:(0,a.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),v(e.id)},className:"p-2.5 bg-[#fafaf9] rounded-xl text-[#8E8E93] hover:text-red-400 transition-colors md:p-0 md:bg-[#fafaf9] md:h-[38px] md:w-[38px] md:flex md:items-center md:justify-center md:rounded-lg border-none",title:"삭제",children:(0,a.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-[18px] h-[18px] md:w-4 md:h-4",children:(0,a.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})})]},e.id))}),(0,a.jsxs)("div",{className:"md:hidden flex items-center gap-2 mt-5 shrink-0",children:[l&&(0,a.jsx)("button",{type:"button",onClick:()=>{l(),n()},className:"px-4 py-3 rounded-xl text-sm font-semibold text-red-400 bg-red-500/10 active:bg-red-500/20 transition-colors",children:"삭제"}),(0,a.jsx)("button",{type:"button",onClick:p,disabled:u.some(e=>!e.title),className:"flex-1 py-3 rounded-xl bg-white text-black text-sm font-bold disabled:opacity-50 active:bg-white/90 transition",children:"저장"})]})]})}):null},V=null,X=e=>{let{events:t,onAddEvent:n,onUpdateEvent:r,onDeleteEvent:l,onMoveEvent:o,onOpenAcademicScheduleImport:h,importToastCount:f,onDismissImportToast:p}
1=e,g=(0,b.Dv)(),[v,w]=(0,s.useState)(()=>g?new Date("2026-03-12"):null!=V?V:new Date);(0,s.useEffect)(()=>{g&&w(e=>2026===e.getFullYear()&&2===e.getMonth()&&12===e.getDate()?e:new Date("2026-03-12"))},[g]);let[j,D]=(0,s.useState)(null),y=v.getFullYear(),k=v.getMonth(),N=new Date(y,k,1).getDay(),E=new Date(y,k+1,0).getDate(),C=g?new Date("2026-03-12"):new Date,[z,S]=(0,s.useState)(null),M={};t.forEach(e=>{if(e.date){let t=new Date(e.date),n=new Date(e.endDate?e.endDate:e.date),a=new Date(t);for(;a<=n;){let t=(0,m.FB)(a);M[t]||(M[t]=[]),M[t].push(e),a.setDate(a.getDate()+1)}}});let F=[],T=[],W=new Date(y,k,0).getDate();for(let e=0;e<N;e++)T.push({day:W-N+e+1,isCurrentMonth:!1});for(let e=1;e<=E;e++)T.push({day:e,isCurrentMonth:!0}),7===T.length&&(F.push(T),T=[]);if(T.length>0){let e=1;for(;T.length<7;)T.push({day:e++,isCurrentMonth:!1});F.push(T)}let Z=[.5,1,1,1,1,1,.5],A=Z.reduce((e,t)=>e+t,0),_=e=>{let t=0;for(let n=0;n<e;n++)t+=Z[n];return t/A*100},Y=(e,t)=>{let n=0;for(let a=e;a<=t;a++)n+=Z[a];return n/A*100},L=e=>{let n=[],a=[];t.forEach(t=>{if(!t.date)return;let n=t.date,r=t.endDate||t.date;if(n===r)return;let l=e[0];if(n<=e[6]&&r>=l){let l=0,s=6;for(let t=0;t<7;t++)e[t]>=n&&0===l&&(l=t),e[t]===n&&(l=t);for(let t=6;t>=0;t--)if(e[t]<=r){s=t;break}if(n>e[6]||r<e[0])return;n<e[0]&&(l=0),r>e[6]&&(s=6),a.push({event:t,startCol:l,endCol:s})}}),a.sort((e,t)=>e.startCol!==t.startCol?e.startCol-t.startCol:t.endCol-t.startCol-(e.endCol-e.startCol));let r=[];return a.forEach(e=>{let t=!1,a=0;for(;!t;){let l=r[a];void 0===l||l<e.startCol?(r[a]=e.endCol,n.push({...e,rowIndex:a}),t=!0):a++}}),n},O=e=>{let{event:t,isCurrentMonth:n,onUpdateEvent:r,onDeleteEvent:l}=e;return(0,a.jsxs)("div",{draggable:!0,onDragStart:e=>{e.dataTransfer.setData("text/plain",t.id),e.dataTransfer.effectAllowed="move",e.target.style.opacity="0.5"},onDragEnd:e=>{e.target.style.opacity="1"},onClick:e=>{e.stopPropagation(),r(t)},className:(0,m.cn)("flex items-center justify-start gap-1 text-xs px-2 py-1 rounded-[4px] bg-[#2C2C2E] border border-white/5 text-[#E0E0E0] hover:bg-[#3A3A3C] transition-colors cursor-grab active:cursor-grabbing select-none shadow-sm group/event",!n&&"opacity-50"),children:[(0,a.jsx)("span",{className:(0,m.cn)("w-2 h-2 rounded-full shrink-0",G[t.tag||"gray"])}),(0,a.jsx)("span",{className:"truncate flex-1 font-semibold text-white",children:t.title}),(0,a.jsx)("button",{"aria-label":"삭제",onClick:e=>{e.stopPropagation(),l(t.id)},className:"opacity-0 group-hover/event:opacity-100 p-0.5 text-red-500/70 hover:text-red-400 transition-opacity shrink-0 event-trash-btn",children:(0,a.jsx)(c.Z,{size:12})})]})};return(0,a.jsxs)("div",{className:"flex gap-1 min-h-full flex-1 bg-[#09090b]",onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},children:[(0,a.jsxs)("div",{className:"relative flex flex-col flex-[6] rounded-xl border border-white/5 bg-[#1C1C1E] overflow-hidden",children:[(0,a.jsxs)("div",{className:"shrink-0 flex items-center justify-center relative px-6 py-3 border-b border-white/5",children:[(0,a.jsx)("button",{"aria-label":"이전 달",onClick:()=>{let e=new Date(y,k-1,1);V=e,w(e)},className:"absolute left-4 p-2 hover:bg-white/10 rounded-lg text-[#8E8E93] hover:text-white transition-colors",children:(0,a.jsx)(i.Z,{size:20})}),(0,a.jsxs)("div",{className:"text-lg font-bold text-white tracking-tight",children:[y,"년 ",k+1,"월"]}),(0,a.jsxs)("div",{className:"absolute right-4 flex items-center gap-2",children:[h&&(0,a.jsxs)("button",{type:"button",onClick:h,className:"flex items-center gap-1.5 rounded-lg border border-white/10 px-3 py-2 text-xs font-semibold text-[#E0E0E0] transition-colors hover:bg-white/10 hover:text-white",title:"우리학교 학사일정 가져오기",children:[(0,a.jsx)(x.Z,{size:14}),(0,a.jsx)("span",{className:"hidden xl:inline",children:"우리학교 학사일정 가져오기"})]}),(0,a.jsx)("button",{"aria-label":"다음 달",onClick:()=>{let e=new Date(y,k+1,1);V=e,w(e)},className:"p-2 hover:bg-white/10 rounded-lg text-[#8E8E93] hover:text-white transition-colors",children:(0,a.jsx)(d.Z,{size:20})})]})]}),(0,a.jsx)("div",{className:"shrink-0 grid grid-cols-[0.5fr_1fr_1fr_1fr_1fr_1fr_0.5fr] border-b border-white/5 bg-[#1C1C1E]",children:["일","월","화","수","목","금","토"].map((e,t)=>(0,a.jsx)("div",{className:(0,m.cn)("text-center py-2 text-xs font-semibold uppercase tracking-wider border-r border-white/5 last:border-r-0 min-w-0",0===t?"text-red-400":6===t?"text-blue-400":"text-[#8E8E93]"),children:e},e))}),(0,a.jsx)("div",{className:"flex flex-col flex-1",children:F.map((e,t)=>{let s=e.map((e,n)=>{let{day:a,isCurrentMonth:r}=e,l=y,s=k;return!r&&(0===t||1===t&&a>20?(s=k-1)<0&&(s=11,l=y-1):(s=k+1)>11&&(s=0,l=y+1)),"".concat(l,"-").concat(String(s+1).padStart(2,"0"),"-").concat(String(a).padStart(2,"0"))}),i=L(s),d=new Set(i.map(e=>
1e.event.id));return(0,a.jsxs)("div",{className:"relative grid grid-cols-[0.5fr_1fr_1fr_1fr_1fr_1fr_0.5fr] border-b border-white/5 last:border-b-0 flex-[1_0_auto] min-h-[140px] min-w-0",children:[i.map(e=>{let{event:t,startCol:n,endCol:i,rowIndex:d}=e,o=t.date<s[0],x=(t.endDate||t.date)>s[6],u=o?0:8,h=z===t.id;return(0,a.jsxs)("div",{draggable:!0,onDragStart:e=>{e.dataTransfer.setData("text/plain",t.id),e.dataTransfer.effectAllowed="move",e.target.style.opacity="0.5"},onDragEnd:e=>{e.target.style.opacity="1",S(null)},className:(0,m.cn)("absolute z-10 text-xs px-2 py-1 border border-white/5 text-[#E0E0E0] truncate transition-colors cursor-grab active:cursor-grabbing shadow-sm flex items-center justify-start gap-1 group/event min-w-0 select-none",h?"event-block-hover":"event-block-base",o?"rounded-l-none border-l-0":"rounded-l-[4px]",x?"rounded-r-none border-r-0":"rounded-r-[4px]"),style:{left:"calc(".concat(_(n),"% + ").concat(u,"px)"),width:"calc(".concat(Y(n,i),"% - ").concat(u+(x?0:8),"px)"),top:"".concat(40+30*d,"px")},onMouseEnter:()=>S(t.id),onMouseLeave:()=>S(null),onClick:e=>{e.stopPropagation(),r(t)},children:[(0,a.jsx)("span",{className:(0,m.cn)("w-2 h-2 rounded-full shrink-0",G[t.tag||"gray"])}),(0,a.jsx)("span",{className:"truncate flex-1 font-semibold text-white",children:t.title}),(0,a.jsx)("button",{"aria-label":"삭제",onClick:e=>{e.stopPropagation(),l(t.id)},className:"opacity-0 group-hover/event:opacity-100 p-0.5 text-red-500/70 hover:text-red-400 transition-opacity shrink-0 event-trash-btn",children:(0,a.jsx)(c.Z,{size:12})})]},t.id)}),e.map((e,t)=>{let{day:c,isCurrentMonth:x}=e,h=s[t],f=(M[h]||[]).filter(e=>!d.has(e.id)),p=x&&C.getFullYear()===y&&C.getMonth()===k&&c===C.getDate(),b=i.reduce((e,t)=>h>=t.event.date&&h<=(t.event.endDate||t.event.date)?Math.max(e,t.rowIndex):e,-1),g=-1!==b?(b+1)*30+8:0;return(0,a.jsxs)("div",{className:(0,m.cn)("relative p-2 border-r border-white/5 last:border-r-0 group transition-colors min-w-0",j===h&&"bg-white/10 ring-2 ring-white/20 ring-inset"),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",x&&j!==h&&D(h)},onDragLeave:()=>D(null),onDrop:e=>{e.preventDefault(),D(null);let t=e.dataTransfer.getData("text/plain");t&&x&&o(t,h)},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsx)("span",{className:(0,m.cn)("text-sm font-medium w-6 h-6 flex items-center justify-center rounded-full",p&&"today-indicator",!x&&"opacity-30",p?"bg-[#df5252] text-white":0===t?"text-red-400":6===t?"text-blue-400":"text-[#E0E0E0]"),children:c}),x&&(0,a.jsx)("button",{"aria-label":"일정 추가",onClick:()=>n(h),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-white/10 rounded text-[#8E8E93] hover:text-white transition",children:(0,a.jsx)(u.Z,{size:14,strokeWidth:3})})]}),(0,a.jsx)("div",{className:"space-y-1",style:{marginTop:g>0?"".concat(g,"px"):void 0},children:f.map(e=>(0,a.jsx)(O,{event:e,isCurrentMonth:x,onUpdateEvent:r,onDeleteEvent:l},e.id))})]},t)})]},t)})}),"number"==typeof f&&p&&(0,a.jsx)(B.h,{count:f,onClose:p,className:"absolute inset-x-0 bottom-6"})]}),(0,a.jsxs)("div",{className:"flex flex-col flex-1 rounded-xl border border-white/5 bg-[#1C1C1E] overflow-hidden",children:[(0,a.jsx)("div",{className:"shrink-0 flex items-center justify-center h-[52px]",children:(0,a.jsx)("span",{className:"text-sm font-medium text-[#E0E0E0]",children:"업무 메모"})}),(0,a.jsx)("div",{className:(0,m.cn)("flex-1 p-2 overflow-auto space-y-1 custom-scrollbar","memo"===j&&"bg-white/10 ring-2 ring-white/20 ring-inset"),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move","memo"!==j&&D("memo")},onDragLeave:()=>D(null),onDrop:e=>{e.preventDefault(),D(null);let t=e.dataTransfer.getData("text/plain");t&&o(t,"")},children:t.filter(e=>!e.date).map(e=>(0,a.jsx)(O,{event:e,isCurrentMonth:!0,onUpdateEvent:r,onDeleteEvent:l},e.id))}),(0,a.jsx)("div",{className:"p-3",children:(0,a.jsxs)("button",{onClick:()=>n(""),className:"flex items-center justify-center gap-2 w-full px-3 py-2 text-sm text-[#E0E0E0] hover:bg-white/5 rounded-lg border border-white/10 transition whitespace-nowrap",children:[(0,a.jsx)(u.Z,{size:16}),(0,a.jsx)("span",{children:"새 업무"})]})})]})]})};function K(){let e=(0,b.Dv)(),t=(0,f.XC)(),n=(0,l.N)(),{showToast:i}=(0,r.p)(),{isLoaded:d}
1=(0,v.AF)(),[o,c]=(0,s.useState)([]),[x,u]=(0,s.useState)(!1),[p,j]=(0,s.useState)(!1),[D,y]=(0,s.useState)(""),[k,N]=(0,s.useState)(null),[E,C]=(0,s.useState)(!1),[z,S]=(0,s.useState)(null),M=!e,F=(0,s.useRef)(!1);(0,s.useEffect)(()=>(F.current=!0,()=>{F.current=!1}),[]);let T=(0,s.useRef)([]),W=(0,s.useCallback)(()=>{T.current.push([...o]),T.current.length>20&&T.current.shift()},[o]);(0,s.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&"z"===e.key){e.preventDefault();let t=T.current.pop();t&&c(t)}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let Z=(0,s.useCallback)(async()=>{if(F.current){if(e){u(!0);try{let e=await (0,g.getGuestData)();if(e.scheduleEvents)c(e.scheduleEvents);else{let e=await (0,g.generateMockData)();c(e.scheduleEvents||[]),await (0,g.saveGuestData)("scheduleEvents",e.scheduleEvents||[])}}finally{F.current&&u(!1)}return}console.log("[WorkScheduleView] Loading events...");try{let e=await (0,h.X)("getScheduleEvents",{startDate:"2023-01-01",endDate:"2030-12-31"},t);if(!F.current)return;e.success?c(e.data):console.error("[WorkScheduleView] Load failed:",e.error)}finally{F.current&&u(!1)}}},[e,t]),A=(0,s.useCallback)(()=>{S(null)},[]),_=(0,s.useCallback)(e=>{S(e),Z()}
1,[Z]);(0,s.useEffect)(()=>{if(!d){console.log("[WorkScheduleView] Waiting for StudentContext...");return}u(!0),Z()},[Z,d]),(0,s.useEffect)(()=>{if(x){let e=setTimeout(()=>{F.current&&x&&(console.log("[WorkScheduleView] Safety net triggered: forcing loading to false"),u(!1))},15e3);return()=>clearTimeout(e)}},[x]);let Y=async(n,a,r,l)=>{if(e){let e={id:"guest-event-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),title:a,date:n,endDate:l,tag:r,createdAt:new Date().toISOString()},t=[...(await (0,g.getGuestData)()).scheduleEvents||[],e];await (0,g.saveGuestData)("scheduleEvents",t),c(t);return}console.log("[WorkScheduleView] Adding event:",{date:n,title:a,tag:r,endDate:l});let s="temp-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),d={id:s,title:a,date:n,endDate:l,tag:r,createdAt:new Date().toISOString()};c(e=>[...e,d]);let o=await (0,h.X)("upsertScheduleEvent",{title:a,date:n,endDate:l,tag:r},t);if(o.success&&o.data){let e=o.data;c(t=>t.map(t=>t.id===s?{id:e.id,title:e.title,date:e.date?(0,m.FB)(new Date(e.date)):"",endDate:e.endDate?(0,m.FB)(new Date(e.endDate)):void 0,tag:e.tag||"gray",createdAt:e.createdAt}:t))}else c(e=>e.filter(e=>e.id!==s)),i("일정 저장에 실패했습니다: "+(o.error||"알 수 없는 오류"),"error")},L=async(n,a,r,l,s)=>{if(e){let e=((await (0,g.getGuestData)()).scheduleEvents||[]).map(e=>e.id===n?{...e,title:a,tag:r,date:l,endDate:s}:e);await (0,g.saveGuestData)("scheduleEvents",e),c(e);return}o.find(e=>e.id===n)&&(c(e=>e.map(e=>e.id===n?{...e,title:a,tag:r,date:l,endDate:s}:e)),await (0,h.X)("upsertScheduleEvent",{id:n,title:a,date:l,endDate:s,tag:r},t))},G=async a=>{if(W(),e){if(!await n({title:"일정을 삭제할까요?",description:"삭제한 일정은 되돌릴 수 없습니다."}))return;let e=((await (0,g.getGuestData)()).scheduleEvents||[]).filter(e=>e.id!==a);await (0,g.saveGuestData)("scheduleEvents",e),c(e);return}c(e=>e.filter(e=>e.id!==a)),await (0,h.X)("deleteScheduleEvent",{id:a},t)},R=async(n,a)=>{let r;let l=o.find(e=>e.id===n);if(l&&l.date!==a){if(W(),l.endDate&&l.date){let e=new Date(l.date),t=new Date(l.endDate).getTime()-e.getTime();r=U(new Date(new Date(a).getTime()+t))}if(e){let e=((await (0,g.getGuestData)()).scheduleEvents||[]).map(e=>e.id===n?{...e,date:a,endDate:r||e.endDate}:e);await (0,g.saveGuestData)("scheduleEvents",e),c(e);return}c(e=>e.map(e=>e.id===n?{...e,date:a,endDate:r||e.endDate}:e)),await (0,h.X)("upsertScheduleEvent",{id:n,title:l.title,date:a,endDate:r||l.endDate,tag:l.tag},t)}};return(0,a.jsx)("div",{className:"h-full overflow-hidden md:overflow-y-auto custom-scrollbar transition-colors duration-300 bg-[#FBFBF9] md:bg-white md:dark:bg-[#09090b]",children:(0,a.jsx)("div",{className:"flex flex-col gap-0 md:gap-4 h-full md:min-h-full p-0 md:p-3",children:(0,a.jsx)("div",{className:"flex-1 min-h-0 flex flex-col h-full",children:x?(0,a.jsx)("div",{className:"h-full flex-1 flex items-center justify-center",children:(0,a.jsx)(w.W,{size:40})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"md:hidden flex-1 min-h-0 h-full flex flex-col",children:[(0,a.jsx)(O,{events:o,onCreateEvent:Y,onSaveEvent:L,onDeleteEvent:G,onOpenAcademicScheduleImport:M?()=>C(!0):void 0}),null!==z&&(0,a.jsx)(B.h,{count:z,onClose:A,className:"fixed inset-x-0 bottom-[calc(1.5rem+env(safe-area-inset-bottom,0px))]"})]}),(0,a.jsx)("div",{className:"hidden md:flex flex-1 flex-col",children:(0,a.jsx)(X,{events:o,onAddEvent:e=>{y(e),N(null),j(!0)},onUpdateEvent:e=>{y(e.date),N(e),j(!0)},onDeleteEvent:G,onMoveEvent:R,onOpenAcademicScheduleImport:M?()=>C(!0):void 0,importToastCount:z,onDismissImportToast:A})}),(0,a.jsx)(P,{isOpen:p,onClose:()=>j(!1),onSave:e=>{if(0!==e.length){if(k){let t=e[0];L(k.id,t.title,t.tag,t.date,t.endDate);for(let t=1;t<e.length;t++){let n=e[t];Y(n.date,n.title,n.tag,n.endDate)}}else e.forEach(e=>{Y(e.date,e.title,e.tag,e.endDate)})}},onDelete:k?()=>{G(k.id),j(!1)}:void 0,initialDate:D,initialTitle:null==k?void 0:k.title,initialTag:null==k?void 0:k.tag,initialEndDate:null==k?void 0:k.endDate}),(0,a.jsx)(B.k,{isOpen:E,onClose:()=>C(!1),onImported:_})]})})})})}}}]);

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.