1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1255],{61255:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return et}});var s=t(57437),n=t(39561),r=t(90982),o=t(30166),i=t(2265),l=t(27526),c=t(32660),d=t(56096),u=t(82431),h=t(76858),m=t(99397),p=t(98319),g=t(36950),v=t(60850),x=t(55369),j=t(50647),_=t.n(j),b=t(77261),f=t.n(b),y=t(75855),N=t(92735),w=t(98420),C=t(30401),S=t(78867),k=t(40875),I=t(40291),A=t(71719),O=t(85461),R=t(44425),D=t.n(R);function E(e,a){return[...e.map(e=>{var a,t;return{id:"member:".concat(e.id),office:e.office||"",position:e.position,name:(null===(a=e.user)||void 0===a?void 0:a.name)||(null===(t=e.user)||void 0===t?void 0:t.email)||"ì ìë",member:e,seat:null}}),...a.filter(e=>!e.holder).map(e=>{var a;return{id:"seat:".concat(e.key),office:(0,O.s4)(e),position:null===(a=e.invitation)||void 0===a?void 0:a.position,name:"".concat((0,O.oX)(e)," ì´ëí ì ìë"),member:null,seat:e}})].sort((e,a)=>{var t,s;return(null!==(t=e.position)&&void 0!==t?t:Number.MAX_SAFE_INTEGER)-(null!==(s=a.position)&&void 0!==s?s:Number.MAX_SAFE_INTEGER)})}var M=t(31235);function L(e,a){let t=Array.from(new Set(e.assignments.map(e=>{var a;return null!==(a=e.viewScope)&&void 0!==a?a:(0,x.Qs)(e)}).filter(e=>"none"!==e)));return t.includes("school")?"íêµ ì ì²´":t.filter(e=>{let s=a.classes.find(a=>"class:".concat(a.id)===e);return!s||!t.includes("grade:".concat(s.grade))}).map(e=>(function(e,a){if("school"===e)return"íêµ ì ì²´";if(e.startsWith("grade:"))return"".concat(e.slice(6),"íë
ì ì²´");let t=a.classes.find(a=>"class:".concat(a.id)===e);return t?"".concat(t.grade,"íë
").concat(t.classNum,"ë°"):"none"===e?"ì¡°í ìì":"íì¬ íë
ë ë²ì íì¸ íì"})(e,a)).join(" \xb7 ")||"ì¡°í ìì"}let H=e=>"HOMEROOM"===e.kind?"class:".concat(e.classId):"GRADE_ADMIN"===e.kind?"grade:".concat(e.grade):"MOCK_COORDINATOR"===e.kind?"mock:".concat(e.grade):e.kind;function F(e,a){var t,s;if(e.length<2)return null!==(s=e[0])&&void 0!==s?s:null;let n=e.find(e=>"HOMEROOM"===e.kind),r=e.find(e=>"GRADE_ADMIN"===e.kind);if(2!==e.length||!n||!r||(null===(t=a.classes.find(e=>e.id===n.classId))||void 0===t?void 0:t.grade)!==r.grade)return;let o=e.map(e=>{var a;return null!==(a=e.viewScope)&&void 0!==a?a:(0,x.Qs)(e)}),i=(e,t)=>e===t||"none"===t||"school"===e||e.startsWith("grade:")&&a.classes.some(a=>"class:".concat(a.id)===t&&"grade:".concat(a.grade)===e),l=o.find(e=>o.every(a=>i(e,a)));return void 0===l?void 0:{...n,viewScope:l===(0,x.Qs)(n)?null:l}}function z(e){var a,t,n;let{member:r,tone:o,detail:l,run:c,busy:d,open:u,onToggle:h,onDone:m,handle:p,rowDrag:g}=e,v=(0,i.useId)(),x=(null===(a=r.user)||void 0===a?void 0:a.name)||(null===(t=r.user)||void 0===t?void 0:t.email)||"ì´ë¦ 미ë±ë¡",j=F(r.assignments,l);return(0,s.jsxs)("tbody",{"data-office":r.office||"",children:[(0,s.jsxs)("tr",{className:D().personRow,"data-expanded":u,...g,children:[(0,s.jsx)("td",{children:(0,s.jsxs)("div",{className:D().identity,children:[p,(0,s.jsx)("span",{className:f().avatar,"data-tone":o,"aria-hidden":"true"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:x}),r.id===l.me.id&&(0,s.jsx)("span",{className:D().selfLabel,children:"ë"})]})]})}),(0,s.jsx)("td",{className:D().account,children:(null===(n=r.user)||void 0===n?void 0:n.email)||"ê³ì ì ë³´ ìì"}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{children:(j?[j]:r.assignments).filter(e=>"MOCK_COORDINATOR"!==e.kind).map(e=>(function(e,a){if("GRADE_ADMIN"===e.kind)return"".concat(e.grade,"íë
ê´ë¦¬ì");if("HOMEROOM"===e.kind){let t=a.classes.find(a=>a.id===e.classId);if(t)return"".concat(t.grade,"íë
").concat(t.classNum,"ë° ë´ì")}return(0,M.S4)(e,a)})(e,l)).join(" \xb7 ")||"미배ì "})}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:D().state,"data-state":"filled",children:"ì°¸ì¬ ì¤"})}),(0,s.jsx)("td",{className:D().actions,children:(0,s.jsx)("button",{className:D().menuButton,"aria-label":"".concat(x," ìí ìì "),"aria-expanded":u,"aria-controls":u?v:void 0,disabled:d,onClick:h,children:(0,s.jsx)(k.Z,{size:18})})})]}),u&&(0,s.jsx)("tr",{className:D().expandedRow,children:(0,s.jsx)("td",{colSpan:5,children:(0,s.jsx)("div",{id:v,role:"region","aria-label":"".concat(x," ìí "),children:(0,s.jsx)(T,{member:r,detail
1:l,busy:d,run:c,onDone:m},"".concat(r.id,":").concat(r.revision))})})})]})}function T(e){var a,t;let{member:n,detail:r,busy:o,run:l,onDone:c}=e,[d]=(0,i.useState)(()=>n.assignments.map(e=>{var a;return{kind:e.kind,grade:e.grade,classId:e.classId,title:e.title,viewScope:null!==(a=e.viewScope)&&void 0!==a?a:null}})),[u,h]=(0,i.useState)(()=>F(d,r)),m=void 0===u?d:u?[u]:[],p=e=>JSON.stringify(e.map(e=>{var a,t;return{...e,title:null!==(a=e.title)&&void 0!==a?a:null,viewScope:null!==(t=e.viewScope)&&void 0!==t?t:null}}).sort((e,a)=>H(e).localeCompare(H(a)))),g=p(m)!==p(d),v=e=>{h("none"===e?null:{kind:e.startsWith("class:")?"HOMEROOM":e.startsWith("grade:")?"GRADE_ADMIN":e.startsWith("mock:")?"MOCK_COORDINATOR":e,grade:e.startsWith("grade:")?Number(e.slice(6)):e.startsWith("mock:")?Number(e.slice(5)):null,classId:e.startsWith("class:")?e.slice(6):null,title:null,viewScope:null})},j=[...r.classes].sort((e,a)=>e.grade-a.grade||e.classNum-a.classNum);return(0,s.jsxs)("form",{className:D().scopeForm,onSubmit:async e=>{e.preventDefault(),g&&!o&&await l({action:"roles",spaceId:r.space.id,memberId:n.id,revision:n.revision,roles:m})&&c()},children:[(0,s.jsxs)("fieldset",{disabled:o,className:D().roleRows,children:[(0,s.jsx)("legend",{className:D().srOnly,children:"ìí ë° ì¡°í ë²ì ìì "}),(0,s.jsxs)("div",{className:D().scopeFields,children:[(0,s.jsxs)("label",{children:["ìí ",(0,s.jsxs)("span",{className:D().selectWrap,children:[(0,s.jsxs)("select",{"aria-label":"ìí ",value:void 0===u?"legacy":u?H(u):"none",onChange:e=>v(e.target.value),children:[void 0===u&&(0,s.jsx)("option",{value:"legacy",disabled:!0,children:"기존 ìí ì ì§"}),(0,s.jsx)("option",{value:"none",children:"ìí ìì"}),(0,s.jsx)("option",{value:"SCHOOL_ADMIN",children:"íêµ ê´ë¦¬ì"}),[1,2,3].map(e=>(0,s.jsxs)(i.Fragment,{children:[(0,s.jsxs)("option",{value:"grade:".concat(e),children:[e,"íë
ê´ë¦¬ì"]}),j.filter(a=>a.grade===e).map(a=>(0,s.jsxs)("option",{value:"class:".concat(a.id),disabled:r.members.some(e=>e.id!==n.id&&e.assignments.some(e=>"HOMEROOM"===e.kind&&e.classId===a.id)),children:[e,"íë
",a.classNum,"ë° ë´ì"]},a.id))]},e)),(0,s.jsx)("option",{value:"SCORE_COORDINATOR",children:"ì±ì ì
무 ë´ë¹"}),d.filter(e=>"MOCK_COORDINATOR"===e.kind).map(e=>(0,s.jsxs)("option",{value:H(e),children:[e.grade,"íë
모ìê³ ì¬ ë´ë¹ (기존)"]},H(e)))]}),(0,s.jsx)(k.Z,{size:16,"aria-hidden":"true"})]})]}),(0,s.jsxs)("label",{children:["ì¡°í ë²ì",(0,s.jsxs)("span",{className:D().selectWrap,children:[(0,s.jsxs)("select",{"aria-label":"ì¡°í ë²ì",value:void 0===u?"legacy":u?null!==(t=u.viewScope)&&void 0!==t?t:(0,x.Qs)(u):"none",disabled:!u,onChange:e=>{let a=e.target.value;h(e=>e?{...e,viewScope:a}:e)},children:[void 0===u&&(0,s.jsx)("option",{value:"legacy",children:L(n,r)}),(0,s.jsx)("option",{value:"school",children:"íêµ ì ì²´"}),[1,2,3].map(e=>(0,s.jsxs)(i.Fragment,{children:[(0,s.jsxs)("option",{value:"grade:".concat(e),children:[e,"íë
ì ì²´"]}),j.filter(a=>a.grade===e).map(a=>(0,s.jsxs)("option",{value:"class:".concat(a.id),children:[e,"íë
",a.classNum,"ë° ë´ì"]},a.id))]},e)),(0,s.jsx)("option",{value:"none",children:"ì¡°í ìì"}),(null==u?void 0:null===(a=u.viewScope)||void 0===a?void 0:a.startsWith("class:"))&&!j.some(e=>"class:".concat(e.id)===u.viewScope)&&(0,s.jsx)("option",{value:u.viewScope,children:"ì´ì íê¸ \xb7 ë¤ì ì íí´ ì£¼ì¸ì"})]}),(0,s.jsx)(k.Z,{size:16,"aria-hidden":"true"})]})]})]})]}),void 0===u&&(0,s.jsx)("p",{className:D().scopeHint,children:"기존 ìí ê³¼ ì¡°í ë²ìë ì ì§ë©ëë¤. ìí ì ìë¡ ì ííë©´ 기존 ìí ì 체를 ëì²´í©ëë¤."}),(null==u?void 0:u.kind)==="SCHOOL_ADMIN"&&(0,s.jsx)("p",{className:D().scopeHint,children:"íêµ ê´ë¦¬ìë 구ì±ìê³¼ ì´ëë ê´ë¦¬í ì ììµëë¤."}),(0,s.jsxs)("div",{className:D().editorFooter,children:[n.id!==r.me.id&&(0,s.jsx)("button",{className:D().danger,type:"button",disabled:o,onClick:async()=>{var e;window.confirm("".concat((null===(e=n.user)||void 0===e?void 0:e.name)||"ì ìë","ì íêµìì ë´ë³´ë¼ê¹ì? íêµ ì ê·¼ ê¶íì´ ì¢
ë£ëê³ , ë§¡ì ìí ì ì ì´ë ì½ëë¡ ì´ë¦½ëë¤."))&&await l({action:"leave",spaceId:r.space.id,memberId:n.id,revision:n.revision})&&c()},children:"íêµìì ë´ë³´ë´ê¸°"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("button",{type:"button",className:_().secondary,disabled:o,onClick:c,children:"ì·¨ì"}),(0,s.jsx)("button",{className:_().primary,disabled:o||!g,children:"ì ì¥"})]})]})]})}var Z=t(41905);let Y=[2,5,7,0,4,1,6,3],B=e=>new Date(e).toLocaleDateString("ko-KR"),P=e=>e.holder?"filled":e.invitation?e.invitation.expired?"expired":"pending":"empty";function U(e){let{detail:a,run:n,busy:r,onEditStructure:o}=e,[l,c]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1),[h,p]=(0,i.useState)(""),g=a.seats,v=E(a.members,g),[x,j]=(0,i.useState)(""),[b,f]=(0,i.useState)("all"),[y,C]=(0,i.useState)(""),S=function(e,a,t){var n;let r=E(e.members,e.seats),o=(0,i.useId)(),[l,c]=(0,i.useState)(""),[d,u]=(0,i.useState)(null),h=(0,i.useRef)(null),m=(0,i.useRef)(null),[p,g]=(0,i.useState)(null),[v,x]=(0,i.useState)(null),[j,_]=(0,i.useState)(""),b=(0,i.useRef)(!1),f=(0,i.useRef)(null),y=()=>{h.current=null,m.current=null,u(null),f.current=null,c(""),g(null),x(null)},N=async function(s,n,r,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.space.directoryRevision;
1if(!t&&!b.current&&n!==s.id){b.current=!0,y(),_("구ì±ì ë°°ì¹ë¥¼ ì ì¥íê³ ììµëë¤.");try{let t=await a({action:"move-directory",spaceId:e.space.id,entryId:s.id,directoryRevision:i,anchorId:n,placement:r,...void 0!==o?{office:o||null}:{}});_(t?void 0!==o&&(s.office||"")!==o?"".concat(s.name," \xb7 ").concat((0,M.cM)(o),"ë¡ ì´ëíìµëë¤. ë´ë¹\xb7ê¶íì ì ì§ë©ëë¤."):"구ì±ì ìì를 ì ì¥íìµëë¤.":"ì´ëì ì ì¥íì§ ëª»íìµëë¤. 목ë¡ì ìë¡ê³ 침í ë¤ ë¤ì ìëí´ ì£¼ì¸ì.")}catch(e){_("ì´ëì ì ì¥íì§ ëª»íìµëë¤. 목ë¡ì ìë¡ê³ 침í ë¤ ë¤ì ìëí´ ì£¼ì¸ì.")}finally{b.current=!1,requestAnimationFrame(()=>{var e,a;return null===(a=Array.from(document.querySelectorAll("[data-member-id]")).find(e=>e.dataset.memberId===s.id))||void 0===a?void 0:null===(e=a.querySelector("button"))||void 0===e?void 0:e.focus({preventScroll:!0})})}}},w=e=>{let a=h.current;if(!a||!f.current||!a.active&&5>Math.hypot(e.clientX-a.x,e.clientY-a.y))return;a.active=!0,c(f.current.member.id),u({x:e.clientX,y:e.clientY});let t=document.elementFromPoint(e.clientX,e.clientY),s=e.currentTarget.closest("[data-member-directory]"),n=null==t?void 0:t.closest("[data-member-id]"),r=null==t?void 0:t.closest("[data-office]");if(m.current=null,g(null),x(null),!t||!(null==s?void 0:s.contains(t)))return;if(n&&n.dataset.memberId!==f.current.member.id){let a=n.getBoundingClientRect(),t=e.clientY<a.top+a.height/2?"before":"after";m.current={memberId:n.dataset.memberId,placement:t,...r?{office:r.dataset.office}:{}},g({id:n.dataset.memberId,placement:t})}else!n&&r&&(m.current={office:r.dataset.office,placement:"after"},x(r.dataset.office));let o=e.currentTarget.parentElement;for(;o&&!(o.scrollHeight>o.clientHeight&&/auto|scroll/.test(getComputedStyle(o).overflowY));)o=o.parentElement;if(o){let a=o.getBoundingClientRect(),t=Math.max(0,a.top),s=Math.min(window.innerHeight,a.bottom);e.clientY<t+60?o.scrollTop-=18:e.clientY>s-60&&(o.scrollTop+=18)}};return{handle:a=>(0,s.jsx)("button",{type:"button",className:D().dragHandle,disabled:t,"aria-label":"".concat(a.name," ìì ì´ë"),"aria-describedby":o,"aria-keyshortcuts":"Alt+ArrowUp Alt+ArrowDown Alt+Shift+ArrowUp Alt+Shift+ArrowDown",title:"ëì´ì ì´ë \xb7 Alt + â/â ìì ë³ê²½ \xb7 Alt + Shift + â/â êµë¬´ì¤ ì´ë",onPointerDown:s=>{0!==s.button||t||b.current||(s.currentTarget.setPointerCapture(s.pointerId),h.current={x:s.clientX,y:s.clientY,active:!1},f.current={member:a,directoryRevision:e.space.directoryRevision},_(""))},onPointerMove:w,onPointerCancel:y,onLostPointerCapture:y,onPointerUp:e=>{var a,t;let s=f.current,n=m.current,o=null===(a=h.current)||void 0===a?void 0:a.active;if(y(),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),!s||!n||!o)return;let i=n.memberId||(null===(t=r.filter(e=>(e.office||"")===n.office&&e.id!==s.member.id).at(-1))||void 0===t?void 0:t.id)||null;N(s.member,i,n.placement,n.office,s.directoryRevision)},onKeyDown:e=>{if("Escape"===e.key){y();return}if(!e.altKey||!["ArrowUp","ArrowDown"].includes(e.key))return;if(e.preventDefault(),e.shiftKey){let s=M.fU.findIndex(e=>e.value===(a.office||"")),n=M.fU[s+("ArrowUp"===e.key?-1:1)];if(n){var t;let e=r.filter(e=>e.office===n.value&&e.id!==a.id).at(-1);N(a,null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null,"after",n.value)}return}let s=r.filter(e=>e.office===a.office),n=s.findIndex(e=>e.id===a.id),o=s[n+("ArrowUp"===e.key?-1:1)];o&&N(a,o.id,"ArrowUp"===e.key?"before":"after")},children:(0,s.jsx)(Z.Z,{size:16,"aria-hidden":"true"})}),rowProps:e=>({"data-member-id":e.id,"data-dragging":l===e.id,"data-drop":(null==p?void 0:p.id)===e.id?p.placement:void 0}),dropOffice:v,help:(0,s.jsxs)("div",{className:D().dragHelp,children:[(0,s.jsxs)("p",{id:o,children:["ëì´ì ìì\xb7êµë¬´ì¤ ë³ê²½ ",(0,s.jsx)("span",{children:"Alt + â/â ìì \xb7 Alt + Shift + â/â êµë¬´ì¤ ì´ë"})]}),(0,s.jsx)("span",{role:"status",children:j})]}),preview:d&&(0,s.jsxs)("div",{className:D().dragPreview,"aria-hidden":"true",style:{left:d.x+14,top:d.y+14},children:[(0,s.jsx)(Z.Z,{size:14}),null===(n=f.current)||void 0===n?void 0:n.member.name]})}}(a,async e=>{let a=await n(e);return a&&"all"!==b&&f("all"),a},r||!!y),k=x.trim().toLocaleLowerCase(),R=g.filter(e=>"expired"===P(e)).length,H=g.filter(e=>e.holder).length,F=async()=>{c(!0);try{let e=await Promise.all([t.e(1425),t.e(6919)]).then(t.bind(t,2093)),s=g.map(e=>{var t,s;return{구ë¶:"SCHOOL_ADMIN"===e.kind?"íêµ ì ì²´":"".concat(e.grade,"íë
"),ìí :(0,O.oX)(e),"ë³¼ ì ìë íì":e.holder&&a.members.some(a=>a.id===e.holder.memberId)?L(a.members.find(a=>a.id===e.holder.memberId),a):(0,O.PO)(e),"ì´ë ì½ë":(null===(t=e.invitation)||void 0===t?void 0:t.code)?(0,I.Aw)(e.invitation.code):"","ë°ë¡ ì°¸ì¬ ë§í¬":(null===(s=e.invitation)||void 0===s?void 0:s.code)?(0,A.P)(window.location.origin,e.invitation.code):"","ì¬ì© 기í":e.invitation&&!e.invitation.expired?B(e.invitation.expiresAt):"",ìí:e.holder?"ì°¸ì¬ ì¤ (".concat(e.holder.name||e.holder.email||"ì ìë",")"):e.invitation?e.invitation.expired?"ì¬ì© 기í ì§ë¨ \xb7 ì¬ë°ê¸ íì":e.invitation.code?"ìë½ ë기 ì¤":"ì¬ë°ê¸ íì":"ì´ë ì "}}),n=e.utils.json_to_sheet(s);n["!cols"]=[{wch:10},{wch:18},{wch:16},{wch:18},{wch:60},{wch:12},{wch:22}];let r=e.utils.aoa_to_sheet([["".concat(a.space.name," ë´ëª¨ íêµ íì
ì°¸ì¬ ìë´")],[],["1. ë´ëª¨ì ë¡ê·¸ì¸í ë¤ [ì¤ì ] â [ì¼ë°] â [ì½ë ì
ë ¥]ì ëë¦
ëë¤. (í´ëí°ì [ì¤ì ] â [ì½ë ì
ë ¥])"],["2. [ì´ë ì½ë] 칸ì ìë ë´ ì리ì 12ì리를 ë£ê³ [ë±ë¡í기]를 ë르면 ëì
ëë¤."],[" ë°ë¡ ì°¸ì¬ ë§í¬ë¥¼ ì´ì´ë ë©ëë¤."],[],["ì½ëë í ì¬ëë§ ì¸ ì ììµëë¤. ë´ ìí ì ì½ëë§ ì
ë ¥í´ ì£¼ì¸ì."],["ì´ì©ê¶ ì½ëì ê°ì 칸ì ë£ì¼ë©´ ë©ëë¤. ì´ë ì½ëì¸ì§ë ë´ëª¨ê° ììì ê°ë ¤ë
ëë¤."]]
1);r["!cols"]=[{wch:80}];let o=e.utils.book_new();e.utils.book_append_sheet(o,n,"ì´ë ì½ë"),e.utils.book_append_sheet(o,r,"ì°¸ì¬ ë°©ë²"),e.writeFile(o,"".concat(a.space.name," ì´ë ì½ë (").concat(new Date().toLocaleDateString("sv-SE"),").xlsx"))}finally{c(!1)}};return(0,s.jsxs)("section",{className:D().chart,"aria-busy":r,"data-member-directory":!0,children:[(0,s.jsxs)("div",{className:D().top,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:"구ì±ì"}),(0,s.jsxs)("p",{children:["ìí ",g.length,"ê° ì¤ ",H,"ê° ì°¸ì¬ \xb7 íêµ ê´ë¦¬ìê° êµ¬ì±ìê³¼ ì´ë를 ê´ë¦¬í©ëë¤."]})]}),(0,s.jsxs)("div",{className:D().topActions,children:[(0,s.jsx)("button",{className:_().secondary,disabled:r,onClick:o,children:a.classes.length?"ë° êµ¬ì± ë°ê¾¸ê¸°":"ë° êµ¬ì±í기"}),(0,s.jsxs)("button",{className:_().primary,disabled:r||l||!g.length,onClick:()=>void F(),children:[(0,s.jsx)(N.Z,{size:16}),l?"ë§ëë ì¤â¦":"ì ì²´ ì½ë ìì
ë¡ ë°ê¸°"]})]})]}),R>0&&(0,s.jsxs)("div",{className:D().banner,role:"status",children:[(0,s.jsxs)("span",{children:["ì¬ì© 기íì´ ì§ë ì½ëê° ",R,"ê° ììµëë¤. ì¬ë°ê¸íë©´ ì ì½ëê° ë§ë¤ì´ì§ëë¤."]}),(0,s.jsx)("button",{className:_().secondary,disabled:r,onClick:()=>void n({action:"reissue-expired",spaceId:a.space.id}),children:"모ë ì¬ë°ê¸"})]}),(0,s.jsxs)("div",{className:D().filters,children:[(0,s.jsxs)("label",{children:["ì´ë¦\xb7ê³ì ê²ì",(0,s.jsx)("input",{type:"search",placeholder:"ì´ë¦ ëë ì´ë©ì¼",value:x,disabled:!!y,onChange:e=>j(e.target.value)})]}),(0,s.jsxs)("label",{children:["êµë¬´ì¤",(0,s.jsxs)("select",{value:b,disabled:!!y,onChange:e=>f(e.target.value),children:[(0,s.jsx)("option",{value:"all",children:"모ë êµë¬´ì¤"}),M.fU.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]})]})]}),S.help,S.preview,(0,s.jsx)("div",{className:D().tableScroll,children:(0,s.jsxs)("table",{className:D().table,children:[(0,s.jsx)("caption",{className:D().srOnly,children:"êµë¬´ì¤ë³ 구ì±ì ë° ìí ë³ ì´ë"}),(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:D().nameColumn}),(0,s.jsx)("col",{className:D().accountColumn}),(0,s.jsx)("col",{className:D().roleColumn}),(0,s.jsx)("col",{className:D().statusColumn}),(0,s.jsx)("col",{className:D().actionColumn})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",children:"ì´ë¦"}),(0,s.jsx)("th",{scope:"col",children:"ê³ì \xb7ì´ë ì½ë"}),(0,s.jsx)("th",{scope:"col",children:"ìí "}),(0,s.jsx)("th",{scope:"col",children:"ì°¸ì¬\xb7ì´ë ìí"}),(0,s.jsx)("th",{scope:"col",children:"ê´ë¦¬"})]})}),M.fU.filter(e=>"all"===b||e.value===b).map(e=>{let t=v.filter(a=>a.office===e.value),o=t.filter(e=>{var a,t;return"".concat(e.name," ").concat((null===(t=e.member)||void 0===t?void 0:null===(a=t.user)||void 0===a?void 0:a.email)||"").toLocaleLowerCase().includes(k)}),l=new Map([...t].sort((e,a)=>e.id.localeCompare(a.id)).map((e,a)=>[e.id,Y[a%Y.length]]));return(0,s.jsxs)(i.Fragment,{children:[(0,s.jsxs)("tbody",{"data-office":e.value,"data-drop-office":S.dropOffice===e.value,children:[(0,s.jsx)("tr",{className:D().officeRow,children:(0,s.jsx)("th",{colSpan:5,scope:"rowgroup",children:(0,s.jsxs)("div",{className:D().groupHead,children:[(0,s.jsx)(w.Z,{size:17,"aria-hidden":"true"}),(0,s.jsx)("h3",{children:e.label}),(0,s.jsx)("span",{children:o.length}),e.value.startsWith("GRADE_")&&a.classes.some(a=>"GRADE_".concat(a.grade)===e.value)&&(0,s.jsxs)("button",{className:D().addSeat,disabled:r,onClick:()=>void n({action:"issue-seat",spaceId:a.space.id,kind:"GRADE_ADMIN",grade:Number(e.value.slice(6))}),children:[(0,s.jsx)(m.Z,{size:16}),"ê´ë¦¬ì ì´ë"]}),"SCHOOL"===e.value&&(0,s.jsxs)("button",{className:D().addSeat,disabled:r,onClick:()=>u(e=>!e),children:[(0,s.jsx)(m.Z,{size:16}),"ìí ì¶ê°"]})]})})}),"SCHOOL"===e.value&&d&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:5,children:(0,s.jsx)(K,{busy:r,onCancel:()=>u(!1),onAdd:async e=>{await n({action:"add-seats",spaceId:a.space.id,count:e})&&u(!1)}})})}),!o.length&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:5,className:D().empty,children:k?"ê²ì ê²°ê
1³¼ê° ììµëë¤.":""===e.value?"êµë¬´ì¤ìì ë¹¼ë ¤ë©´ ì´ê³³ì¼ë¡ ëì´ ëì¼ì¸ì.":"ë°°ì¹ë 구ì±ìì´ ììµëë¤."})})]}),o.map(e=>e.member?(0,s.jsx)(z,{member:e.member,tone:l.get(e.id),detail:a,run:n,busy:r,open:y===e.member.id,onToggle:()=>C(y===e.member.id?"":e.member.id),onDone:()=>C(""),handle:S.handle(e),rowDrag:S.rowProps(e)},e.id):(0,s.jsx)(W,{seat:e.seat,tone:l.get(e.id),detail:a,run:n,busy:r,renaming:h===e.seat.key,onRename:a=>p(a?e.seat.key:""),handle:S.handle(e),rowDrag:S.rowProps(e)},e.id))]},e.value)})]})})]})}function K(e){let{busy:a,onAdd:t,onCancel:n}=e,[r,o]=(0,i.useState)(1);return(0,s.jsxs)("form",{className:D().addForm,onSubmit:e=>{e.preventDefault(),t(r)},children:[(0,s.jsxs)("label",{children:["ëª ê°",(0,s.jsx)("input",{type:"number",min:1,max:10,value:r,autoFocus:!0,onChange:e=>o(Math.min(10,Math.max(1,Number(e.target.value)||1)))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("button",{className:_().primary,disabled:a,children:"ì¶ê°"}),(0,s.jsx)("button",{type:"button",className:_().secondary,disabled:a,onClick:n,children:"ì·¨ì"})]}),(0,s.jsx)("small",{children:"ì¶ê°í ë¤ ì´ë¦ì ëë¬ ë°ê¿ ì ììµëë¤."})]})}function W(e){var a,t,n,r,o,l,c;let{seat:d,tone:u,detail:h,run:m,busy:p,renaming:g,onRename:v,handle:x,rowDrag:j}=e,[_,b]=(0,i.useState)(!1),y=(0,i.useId)(),[N,w]=(0,i.useState)(!1),[A,R]=(0,i.useState)(d.title||""),E=(0,i.useRef)(null),M=P(d),L=h.space.id,H=(0,O.oX)(d),F=(null===(a=d.holder)||void 0===a?void 0:a.memberId)===h.me.id;(0,i.useEffect)(()=>{if(!_)return;let e=e=>{var a;(null===(a=E.current)||void 0===a?void 0:a.contains(e.target))||b(!1)},a=e=>{"Escape"===e.key&&b(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",a),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",a)}},[_]);let z=(e,a)=>{b(!1),(!a||window.confirm(a))&&m(e)},T=d.holder?{assignmentId:d.holder.assignmentId}:{invitationId:null!==(c=null===(t=d.invitation)||void 0===t?void 0:t.id)&&void 0!==c?c:""},Z=async()=>{let e=A.trim();if(!e||e===d.title){v(!1),R(d.title||"");return}await m({action:"rename-seat",spaceId:L,title:e,...T})&&v(!1)},Y=async()=>{var e;if(null===(e=d.invitation)||void 0===e?void 0:e.code)try{await navigator.clipboard.writeText((0,I.Aw)(d.invitation.code)),w(!0),window.setTimeout(()=>w(!1),1500)}catch(e){}},U=[];return"SCHOOL_ADMIN"===d.kind&&U.push({label:"ì´ë¦ ë°ê¾¸ê¸°",onClick:()=>{b(!1),v(!0)}}),("pending"===M||"expired"===M)&&(U.push({label:"ë´ê° ì´ ìí 맡기",onClick:()=>z({action:"claim-seat",spaceId:L,invitationId:d.invitation.id},"".concat(H," ìí ì ì§ì ë§¡ìê¹ì?"))}),U.push({label:"ì½ë ì¬ë°ê¸",onClick:()=>z({action:"reissue-invite",spaceId:L,invitationId:d.invitation.id},"pending"===M?"ì ì½ë를 ë§ë¤ê¹ì? ì§ê¸ ì½ëë ë ì´ì ì¸ ì ììµëë¤.":void 0)})),"SCHOOL_ADMIN"!==d.kind&&d.invitation&&U.push({label:"ì´ë ì·¨ì",danger:!0,onClick:()=>z({action:"revoke-invite",spaceId:L,invitationId:d.invitation.id},"".concat(H," ì´ë를 ì·¨ìí ê¹ì?"))}),"SCHOOL_ADMIN"===d.kind&&U.push({label:"ìí ì§ì°ê¸°",danger:!0,onClick:()=>z({action:"remove-seat",spaceId:L,...T},"".concat(H," ìí ì ì§ì¸ê¹ì? ì´ ìí ì ë§¡ì ì ìëì íêµ ê´ë¦¬ì ê¶íì´ ëë©ëë¤."))}),(0,s.jsxs)("tbody",{ref:E,"data-office":(0,O.s4)(d),children:[(0,s.jsxs)("tr",{className:D().personRow,"data-state":M,"data-expanded":_,...j,children:[(0,s.jsx)("td",{children:(0,s.jsxs)("div",{className:D().identity,children:[x,(0,s.jsx)("span",{className:f().avatar,"data-tone":u,"aria-hidden":"true"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:d.holder?d.holder.name||"ì´ë¦ 미ë±ë¡":"ì´ëí ì ìë"}),F&&(0,s.jsx)("span",{className:D().selfLabel,children:"ë"}),(null===(n=d.holder)||void 0===n?void 0:n.manager)&&(0,s.jsx)("span",{className:D().managerTag,children:"íêµ ê´ë¦¬ì"})]})]})}),(0,s.jsx)("td",{className:D().account,children:d.holder?d.holder.email||"ê³ì ì ë³´ ìì":"pending"===M&&(null===(r=d.invitation)||void 0===r?void 0:r.code)?(0,s.jsxs)("button",{className:D().code,disabled:p,onClick:()=>void Y(),"aria-label":"".concat(H," ì½ë ë³µì¬"),children:[(0,I.Aw)(d.invitation.code),N?(0,s.jsx)(C.Z,{size:14}):(0,s.jsx)(S.Z,{size:14})]}):(0,s.jsx)("span",{className:D().muted,children:"empty"===M?"ìì§ ë°ê¸ë ì½ëê° ììµëë¤":"ì½ë를 ë¤ì ë°ê¸í´ 주ì¸ì"})}),(0,s.jsx)("td",{children:g?(0,s.jsx)("input",{className:D().seatInput,"aria-label":"ìí ì´ë¦",autoFocus:!0,maxLength:30,value:A,disabled:p,onChange:e=>R(e.target.value),onBlur:()=>void Z(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Z()),"Escape"===e.key&&(R(d.title||""),v(!1))}}):"SCHOOL_ADMIN"===d.kind?(0,s.jsx)("button",{className:D().seatNameButton,disabled:p,title:"ì´ë¦ ë°ê¾¸ê¸°",onClick:()=>v(!0),children:H}):H}),(0,s.jsxs)("td",{children:[(0,s.jsx)("span",{className:D().state,"data-state":M,children:"filled"===M?"ì°¸ì¬ ì¤":"pending"===M?"ìë½ ë기 ì¤":"expired"===M?"ì¬ì© 기í ì§ë¨":"ì´ë ì "}),"pending"===M&&(null===(o=d.invitation)||void 0===o?void 0:o.code)&&(0,s.jsxs)("small",{className:D().expiry,children:[B(d.invitation.expiresAt),"ê¹ì§"]}),("expired"===M||"pending"===M&&!(null===(l=d.invitation)||void 0===l?void 0:l.code))&&(0,s.jsx)("button",{className:D().inlineAction,disabled:p,onClick:()=>void m({action:"reissue-invite",spaceId:L,invitationId:d.invitation.id}),children:"ì¬ë°ê¸"}),"empty"===M&&"SCHOOL_ADMIN"!==d.kind&&(0,s.jsx)("button",{className:D().inlineAction,disabled:p,onClick:()=>void m("HOMEROOM"===d.kind?{action:"issue-seat",spaceId:L,kind:"HOMEROOM",classId:d.classId}:{action:"issue-seat",spaceId:L,kind:"GRADE_ADMIN",grade:d.grade}),children:"ì½ë ë°ê¸"})]}),(0,s.jsx)("td",{className:D().actions,children:U.length>0&&(0,s.jsx)("button",{className:D().menuButton,"aria-label":"".concat(H," ë©ë´"),"aria-expanded":_,"aria-controls":_?y:void 0,disabled:p||g,onClick:()=>b(e=>!e),children:(0,s.jsx)(k.Z,{size:18})})})]}),_&&(0,s.jsx)("tr",{className:D().expandedRow,children:(0,s.jsx)("td",{colSpan:5,children:(0,s.jsx)("div",{id:y,className:D().rowActions,role:"group","aria-label":"".concat(H," ê´ë¦¬"),children:U.map(e=>(0,s.jsx)("button",{className:e.danger?D().danger:void 0,disabled:p,onClick:e.onClick,children:e.label},e.label))})})})]})}var q=t(21047),G=t(29633),X=t.n(G);function J(e){let{detail:a,busy:t,run:n,onCancel:o}=e,[l,c]=(0,i.useState)(null),[d,u]=(0,i.useState)(!1),h=a.classes.length>0;if((0,i.useEffect)(()=>{let e=!0;return(0,g.F)({action:"suggest-structure",spaceId:a.space.id}).then(a=>{if(!e)return;let t=a.success&&!Array.isArray(a.data)&&"structure"in a.data&&a.data.structure||[1,2,3].map(e=>({grade:e,current:0,suggested:0}));u(t.some(e=>e.suggested>0)),c(t.map(e=>{let a=e.current||e.suggested;return{grade:e.grade,on:h?e.current>0:a>0||!t.some(e=>e.suggested>0),count:a||1,suggested:e.suggested}}
1))}).catch(()=>{e&&c([1,2,3].map(e=>({grade:e,on:!0,count:1,suggested:0})))}),()=>{e=!1}},[a.space.id,h]),!l)return(0,s.jsx)(r.ContentLoadingState,{variant:"table",label:"íê¸ ì 보를 ë¶ë¬ì¤ë ì¤ì
ëë¤."});let p=(e,a)=>c(l.map(t=>t.grade===e?{...t,...a}:t)),v=l.filter(e=>e.on),x=v.reduce((e,a)=>e+a.count,0);return(0,s.jsxs)("section",{className:"".concat(_().section," ").concat(X().setup),children:[(0,s.jsx)("h2",{children:h?"ë° êµ¬ì± ë°ê¾¸ê¸°":"ì°ë¦¬ íêµë ëª ë°ì¸ê°ì?"}),(0,s.jsxs)("p",{className:X().setupNote,children:[d?"ëì´ì¤ì ë±ë¡ë ".concat(a.space.currentYear,"íë
ë íê¸ ìë¡ ì±ì ìµëë¤. ë¤ë¥´ë©´ ê³ ì³ ì£¼ì¸ì."):"íë
ë§ë¤ ë° ì를 ì
ë ¥í´ ì£¼ì¸ì."," ì°ì§ ìë íë
ì ì²´í¬ë¥¼ ëë©´ ë©ëë¤."]}),l.map(e=>(0,s.jsxs)("div",{className:X().gradeRow,children:[(0,s.jsxs)("label",{className:X().gradeToggle,children:[(0,s.jsx)("input",{type:"checkbox",checked:e.on,disabled:t,onChange:a=>p(e.grade,{on:a.target.checked})}),e.grade,"íë
",e.suggested>0&&e.suggested!==e.count&&(0,s.jsxs)("small",{children:["ëì´ì¤ ",e.suggested,"ë°"]})]}),(0,s.jsxs)("div",{className:"".concat(X().stepper," ").concat(e.on?"":X().stepperOff),children:[(0,s.jsx)("button",{type:"button","aria-label":"".concat(e.grade,"íë
ë° ì ì¤ì´ê¸°"),disabled:t||!e.on||e.count<=1,onClick:()=>p(e.grade,{count:e.count-1}),children:(0,s.jsx)(q.Z,{size:16})}),(0,s.jsx)("input",{"aria-label":"".concat(e.grade,"íë
ë° ì"),inputMode:"numeric",value:e.count,disabled:t||!e.on,onChange:a=>{let t=Number(a.target.value.replace(/\D/g,""));p(e.grade,{count:Math.min(20,Math.max(1,t||1))})}}),(0,s.jsx)("button",{type:"button","aria-label":"".concat(e.grade,"íë
ë° ì ë리기"),disabled:t||!e.on||e.count>=20,onClick:()=>p(e.grade,{count:e.count+1}),children:(0,s.jsx)(m.Z,{size:16})})]})]},e.grade)),(0,s.jsxs)("p",{className:X().setupSummary,children:[v.length?"íë
ê´ë¦¬ì ".concat(v.length,"ëª
ê³¼ ë´ì ").concat(x,"ëª
ì ìí ì ë§ë¤ê³ , ìí ë§ë¤ ì´ë ì½ë를 ë°ê¸í©ëë¤."):"í íë
ì´ì ì íí´ ì£¼ì¸ì.",h?" ì´ë¯¸ ì°¸ì¬í ì ìëê³¼ ë°ê¸ë ì½ëë ê·¸ëë¡ ë¡ëë¤.":""]}),(0,s.jsxs)("div",{className:X().setupActions,children:[(0,s.jsx)("button",{className:_().primary,disabled:t||!v.length,onClick:async()=>{await n({action:"setup-structure",spaceId:a.space.id,grades:l.map(e=>({grade:e.grade,classCount:e.on?e.count:0}))})&&(null==o||o())},children:t?"ë§ëë ì¤â¦":h?"ë° êµ¬ì± ì ì¥":"구ì±ì ìí ë§ë¤ê¸°"}),o&&h&&(0,s.jsx)("button",{className:_().secondary,disabled:t,onClick:o,children:"ì·¨ì"})]})]})}let Q=(0,o.default)(()=>Promise.all([t.e(3878),t.e(2558),t.e(3145),t.e(5708),t.e(6740)]).then(t.bind(t,25708)),{loadableGenerated:{webpack:()=>[25708]},loading:()=>(0,s.jsx)(r.ContentLoadingState,{variant:"table"})}),V=(0,o.default)(()=>t.e(7597).then(t.bind(t,17597)),{loadableGenerated:{webpack:()=>[17597]},loading:()=>(0,s.jsx)(r.ContentLoadingState,{variant:"table"})}),$=(0,o.default)(()=>t.e(9005).then(t.bind(t,49005)),{loadableGenerated:{webpack:()=>[49005]},loading:()=>(0,s.jsx)(r.ContentLoadingState,{variant:"table"})}),ee=(0,o.default)(()=>t.e(9355).then(t.bind(t,79355)),{loadableGenerated:{webpack:()=>[79355]},loading:()=>(0,s.jsx)(r.ContentLoadingState,{variant:"table"})}),ea=["default","members","uploads","classes"];function et(){var e,a;let{status:t,data:n}=(0,l.kP)(),o=(null==n?void 0:null===(e=n.user)||void 0===e?void 0:e.id)||"",[m,v]=(0,i.useState)(""),[j,b]=(0,i.useState)([]),[y,N]=(0,i.useState)(""),[w,C]=(0,i.useState)(null),[S,k]=(0,i.useState)(""),[I,A]=(0,i.useState)("default"),[O,R]=(0,i.useState)(!0),[D,E]=(0,i.useState)(!1),[M,L]=(0,i.useState)(""),[H,F]=(0,i.useState)(!1),[z,T]=(0,i.useState)(!1),Z=(0,i.useRef)(0),Y=(0,i.useRef)(!1),B=(0,i.useRef)(y);B.current=y,(0,i.useEffect)(()=>{if("loading"===t)return;Z.current++,C(null),b([]),k(""),L(""),F(!1);let e="",a="default";if("authenticated"===t&&o)try{let t=JSON.parse(sessionStorage.getItem("school-collaboration:navigation:".concat(o))||"null");t&&"string"==typeof t.spaceId&&t.spaceId.length<=100&&(e=t.spaceId,ea.includes(t.tab)&&(a=t.tab),"string"==typeof t.classId&&t.classId.length<=100&&k(t.classId))}catch(e){}N(e),A(a),v(o)},[t,o]),(0,i.useEffect)(()=>
1{if("authenticated"===t&&o&&m===o)try{sessionStorage.setItem("school-collaboration:navigation:".concat(o),JSON.stringify({spaceId:y,tab:I,classId:S}))}catch(e){}},[t,o,m,y,I,S]);let P=(0,i.useCallback)(async function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=++Z.current;R(!0),L("");try{let s=await (0,g.F)(e?{action:"detail",spaceId:e}:{action:"list"});if(t!==Z.current)return;if(!s.success){a&&"FORBIDDEN"!==s.code&&"UNAUTHORIZED"!==s.code||C(null),L(s.error),F("NOT_READY"===s.code);return}F(!1),Array.isArray(s.data)?b(s.data):"space"in s.data&&s.data.space&&C(s.data)}catch(e){t===Z.current&&(a||C(null),L("ì°ê²°ì íì¸í ë¤ ë¤ì ìëí´ ì£¼ì¸ì."))}finally{t===Z.current&&R(!1)}},[]);(0,i.useEffect)(()=>("authenticated"===t&&o&&m===o?P(y):"unauthenticated"===t&&(R(!1),C(null),b([])),()=>{Z.current++}),[t,o,m,y,P]),(0,i.useEffect)(()=>{let e=()=>{"visible"===document.visibilityState&&"authenticated"===t&&m===o&&o&&!Y.current&&P(B.current)};return window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}},[P,t,m,o]);let{showToast:K}=(0,p.pm)(),W=async e=>{if(Y.current)return!1;Y.current=!0,E(!0),L("");try{let a=await (0,g.F)(e);if(!a.success)return L(a.error),!1;let t=a.data;return!Array.isArray(t)&&"spaceId"in t&&("create"===e.action||"join"===e.action)?(C(null),N(t.spaceId),A("default")):"leave"===e.action&&(null==w?void 0:w.me.id)===e.memberId?(C(null),N(""),A("default"),k("")):await P(y),"register-roster"===e.action&&K("íêµ íì ëª
ë¨ì ë±ë¡íìµëë¤. ë´ì ì ìëì íì ëª
ë¨ê³¼ ìëì¼ë¡ ì´ì´ì§ëë¤.","success"),!0}catch(e){return L("ìì²ì ì²ë¦¬íì§ ëª»íìµëë¤. ì°ê²°ì íì¸í ë¤ ë¤ì ìëí´ ì£¼ì¸ì."),!1}finally{Y.current=!1,E(!1)}},q=null!==(a=null==w?void 0:w.classes.some(e=>["grades","mock"].some(a=>(0,x.yV)(w.me.assignments,{academicYear:w.space.currentYear,grade:e.grade,classId:e.id},a))))&&void 0!==a&&a,G=(null==w?void 0:w.me.operator)?"members":q?"uploads":"classes",X="default"!==I&&("members"!==I||(null==w?void 0:w.me.operator))&&("uploads"!==I||q)?I:G;return(0,s.jsxs)("main",{className:"".concat(_().page," ").concat(f().surface),"aria-busy":O||D,children:[(0,s.jsxs)("header",{className:_().header,children:[(0,s.jsxs)("div",{children:[y&&(0,s.jsxs)("button",{className:_().link,onClick:()=>{C(null),N(""),k(""),A("default")},disabled:D,children:[(0,s.jsx)(c.Z,{size:16})," íêµ ëª©ë¡"]}),(0,s.jsxs)("div",{className:f().schoolTitle,children:[(0,s.jsx)("span",{className:f().schoolMark,"aria-hidden":"true",children:(0,s.jsx)(d.Z,{size:22,strokeWidth:1.5})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:(null==w?void 0:w.space.name)||"íêµ íì
"}),(0,s.jsx)("p",{children:w?"".concat(w.space.currentYear,"íë
ë \xb7 íêµ ì¤ì "):"ì°ë¦¬ íêµì íê¸, 구ì±ì, íì
ìë£ë¥¼ í¨ê» ê´ë¦¬íì¸ì."})]})]})]}),"authenticated"===t&&(0,s.jsx)("button",{className:_().iconButton,onClick:()=>void P(y),disabled:D||O,"aria-label":"íêµ íì
ìë¡ê³ 침",children:(0,s.jsx)(u.Z,{size:18})})]}),M&&!H&&(0,s.jsx)("div",{role:"alert",className:_().error,children:M}),"unauthenticated"===t?(0,s.jsxs)("section",{className:_().empty,children:[(0,s.jsx)(d.Z,{size:36}),(0,s.jsx)("h2",{children:"ë¡ê·¸ì¸íê³ íêµ íì
ì ììíì¸ì"}),(0,s.jsx)("p",{children:"ë¬´ë£ ê³ì ë íêµë¥¼ ë§ë¤ê±°ë ì´ëë°ì ì°¸ì¬í ì ììµëë¤."}),(0,s.jsx)("a",{className:_().primary,href:"/",children:"ë¡ê·¸ì¸íë¬ ê°ê¸°"})]}):O&&!w?(0,s.jsx)(r.ContentLoadingState,{variant:"table",label:"íêµ ì 보를 ë¶ë¬ì¤ë ì¤ì
ëë¤."}):H?(0,s.jsxs)("section",{className:_().empty,children:[(0,s.jsx)(d.Z,{size:36}),(0,s.jsx)("h2",{children:"íêµ íì
ì ì¤ë¹íê³ ìì´ì"}),(0,s.jsx)("p",{children:"ì¤ë¹ê° ëëë©´ ìê¸ì ì ê´ê³ìì´ ì´ê³³ìì ììí ì ììµëë¤."})]}):y?w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("nav",{className:_().tabs,"aria-label":"íêµ íì
ë©ë´",children:[...w.me.operator?["members"]:[],...q?["uploads"]:[],"classes"].map(e=>(0,s.jsx)("button",{"aria-current":X===e?"page":void 0,disabled:D,onClick:()=>A(e),children:"members"===e?"구ì±ì":"uploads"===e?"íì¼ ì
ë¡ë":"íê¸\xb7íì ëª
ë¨"},e))}),"uploads"===X&&q&&(0,s.jsx)(Q,{detail:w,initialClassId:S,onRosterChange:()=>P(y,!0),onBusyChange:e=>{Y.current=e,E(e)},onOpenRoster:e=>{k(e),A("classes")}},"".concat(w.space.id,":").concat(w.me.revision,":").concat(S)),"classes"===X&&(0,s.jsx)(en,{initialClassId:S,onSelectClass:k,onUpload:e=>{k(e),A("uploads")},detail:w,run:W,busy:D,onBusyChange:e=>{Y.current=e,E(e)},onRosterChange:()=>P(y)}),"classes"===X&&w.me.operator&&(0,s.jsx)(V,{detail:w,onBusyChange:e=>{Y.current=e,E(e)},onComplete:async()=>{await P(y),A("members"),K("ì íë
ë를 ììíìµëë¤. ì ë´ë¹ì ë°°ì í´ ì£¼ì¸ì.","success")}},"".concat(w.space.id,":").concat(w.space.currentYear)),"members"===X&&w.me.operator&&(z?(0,s.jsx)(J,{detail:w,busy:D,run:W,onCancel:()=>T(!1)},w.space.id):(0,s.jsx)(U,{detail:w,run:W,busy:D,onEditStructure:()=>T(!0)})),(0,s.jsx)("footer",{className:_().actions,children:(0,s.jsx)("button",{className:_().dangerLink,disabled:D,onClick:()=>{window.confirm("ì´ íêµìì íí´í ê¹ì? ê°ì¸ ê³ì ê³¼ ê°ì¸ ìë£ë ì ì§ë©ëë¤. ë§¡ì ìí ì ì ì½ëë¡ ë¤ì ì´ë¦½ëë¤.")&&W({action:"leave",spaceId:y,memberId:w.me.id,revision:w.me.revision})},children:"íêµìì íí´"})})]}):null:(0,s.jsxs)(s.Fragment,{children:[j.length>0&&(0,s.jsxs)("section",{className:_().section,children:[(0,s.jsx)("h2",{children:"ì°¸ì¬ ì¤ì¸ íêµ"}),(0,s.jsx)("div",{className:_().list,children:j.map(e=>(0,s.jsxs)("button",{className:_().schoolRow,onClick:()=>N(e.space.id),children:[(0,s.jsx)(d.Z,{size:22}),(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:e.space.name}),(0,s.jsxs)("small",{children:[e.space.currentYear,"íë
ë",e.operator?" \xb7 íêµ ê´ë¦¬ì":""]})]}),(0,s.jsx)(h.Z,{size:18})]},e.id))})]}),(0,s.jsx)(es,{busy:D,run:W})]})]})}function es(e){let{run:a,busy:t}=e,r=(0,n.g)(),[o,l]=(0,i.useState)("choose"),[d,u]=(0,i.useState)(""),[p,g]=(0,i.useState)([]),[x,j]=(0,i.useState)(null),[b,N]=(0,i.useState)(!1),[w,C]=(0,i.useState)(""),[S,k]=(0,i.useState)(!1),[I,A]=(0,i.useState)(-1),O=(0,i.useRef)(0),R=d.trim();(0,i.useEffect)(()=>{let e=++O.current;if("create"!==o||R.length<2||R===(null==x?void 0:x.schoolName)){N(!1),R.length<2&&(g([]),C(""));return}N(!0),C("");let a=setTimeout(async()=>{try{let a=await (0,v.R2)(R);if(e!==O.current)return;g(a.data),A(-1),a.success?a.data.length||C("ê²ìë íêµê° ììµëë¤. íêµ ì´ë¦ì íì¸í´ 주ì¸ì."):C(a.error||"ë¤ì ê²ìí´ ì£¼ì¸ì.")}catch(a){e===O.current&&C("íêµë¥¼ ê²ìíì§ ëª»íìµëë¤. ë¤ì ìëí´ ì£¼ì¸ì.")}finally{e===O.current&&N(!1)}},250);return()=>clearTimeout(a)},[R,o,null==x?void 0:x.schoolName]);let D=e=>{j(e),u(e.schoolName),k(!1),g([])};if(r)return(0,s.jsxs)("section",{className:"".concat(_().section," ").concat(f().entrySection),children:[(0,s.jsx)("h2",{children:"ì´ëë°ì íêµì ì°¸ì¬í기"}),(0,s.jsx)(y.default,{})]});if("choose"===o)return(0,s.jsxs)("section",{className:_().start,children:[(0,s.jsxs)("div",{className:f().welcomeCopy,children:[(0,s.jsx)("h2",{children:"ì°ë¦¬ íêµì í¨ê» ììíì¸ì"}),(0,s.jsxs)("p",{children:["í íë
ë¶í° íêµ ì ì²´ê¹ì§, íêµë§ë¤ íëì íêµ íì
ìì í¨ê»í©ëë¤.",(0,s.jsx)("br",{}
1),"ì ë£ êµ¬ë
ìì´ ëª¨ë ì ìëì´ ì°¸ì¬í ì ììµëë¤."]})]}),(0,s.jsxs)("div",{className:f().welcomeActions,children:[(0,s.jsxs)("button",{className:_().primary,disabled:t,onClick:()=>l("create"),children:[(0,s.jsx)(m.Z,{size:16}),"íêµ ë§ë¤ê¸°"]}),(0,s.jsxs)("button",{className:_().secondary,disabled:t,onClick:()=>l("join"),children:["ì´ë ì½ëë¡ ì°¸ì¬",(0,s.jsx)(h.Z,{size:15})]})]}),(0,s.jsx)("p",{className:_().note,children:"ì´ë¯¸ íêµê° ë§ë¤ì´ì ¸ ìë¤ë©´ íêµ ê´ë¦¬ììê² ì´ë ì½ë를 ìì²íì¸ì."})]});let E=S&&R.length>=2&&!x&&(b||p.length>0||!!w);return(0,s.jsxs)("section",{className:"".concat(_().section," ").concat(f().entrySection),children:[(0,s.jsxs)("button",{className:"".concat(_().link," ").concat(f().returnLink),disabled:t,onClick:()=>l("choose"),children:[(0,s.jsx)(c.Z,{size:16})," ëìê°ê¸°"]}),(0,s.jsx)("h2",{children:"create"===o?"ì´ë íêµìì í¨ê» ì¬ì©íìëì?":"ì´ëë°ì íêµì ì°¸ì¬í기"}),"join"===o?(0,s.jsx)(y.default,{}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:_().search,children:(0,s.jsxs)("label",{children:["íêµ ì´ë¦",(0,s.jsxs)("div",{className:_().combo,children:[(0,s.jsx)("input",{role:"combobox","aria-expanded":E,"aria-controls":"school-search-list","aria-autocomplete":"list","aria-activedescendant":E&&I>=0?"school-option-".concat(I):void 0,autoComplete:"off",value:d,maxLength:80,placeholder:"íêµ ì´ë¦ì ì
ë ¥íì¸ì",disabled:t,onChange:e=>{u(e.target.value),j(null),k(!0)},onFocus:()=>k(!0),onBlur:()=>k(!1),onKeyDown:e=>{if("ArrowDown"===e.key&&p.length)e.preventDefault(),k(!0),A(e=>(e+1)%p.length);else if("ArrowUp"===e.key&&p.length)e.preventDefault(),A(e=>(e<=0?p.length:e)-1);else if("Enter"===e.key){e.preventDefault();let a=p[I>=0?I:1===p.length?0:-1];a&&D(a)}else"Escape"===e.key&&k(!1)}}),E&&(0,s.jsxs)("ul",{id:"school-search-list",role:"listbox",className:_().dropdown,children:[p.map((e,a)=>(0,s.jsxs)("li",{id:"school-option-".concat(a),role:"option","aria-selected":a===I,className:_().option,onMouseDown:a=>{a.preventDefault(),D(e)},onMouseEnter:()=>A(a),children:[(0,s.jsx)("strong",{children:e.schoolName}),(0,s.jsx)("small",{children:e.address||e.region})]},"".concat(e.officeCode,":").concat(e.schoolCode))),!p.length&&(0,s.jsx)("li",{className:_().optionHint,role:"presentation",children:b?"ì°¾ë ì¤â¦":w})]})]})]})}),x&&(0,s.jsxs)("div",{className:_().confirm,children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:x.schoolName}),(x.address||x.region)&&(0,s.jsx)("small",{children:x.address||x.region})]}),(0,s.jsx)("p",{children:"ì´ íêµì íêµ ê´ë¦¬ìë¡ ììí©ëë¤. ê°ì¤ í 본ì¸ì ë´ë¹ë ë°°ì í ì ììµëë¤."}),(0,s.jsx)("button",{className:_().primary,disabled:t,onClick:()=>void a({action:"create",schoolCode:x.schoolCode,officeCode:x.officeCode}),children:"ì´ íêµë¡ ììí기"})]})]})]})}function en(e){let{detail:a,run:t,busy:n,onBusyChange:r,onRosterChange:o,initialClassId:l,onSelectClass:c,onUpload:d}=e,[u,p]=(0,i.useState)(""),[g,v]=(0,i.useState)(1),[j,b]=(0,i.useState)(1),[y,N]=(0,i.useState)(l),[w,C]=(0,i.useState)(""),[S,k]=(0,i.useState)(""),I=a.classes.find(e=>e.id===y),A=a.enrollments.filter(e=>e.classId===y),O=I&&(a.me.operator||(0,x.Ko)(a.me.assignments,{academicYear:a.space.currentYear,grade:I.grade,classId:I.id}));return(0,s.jsxs)("section",{className:_().section,children:[(0,s.jsx)("h2",{children:"íê¸\xb7íì ëª
ë¨"}),a.me.operator&&(0,s.jsxs)("form",{className:_().inlineForm,onSubmit:e=>{e.preventDefault(),t({action:"class",spaceId:a.space.id,academicYear:a.space.currentYear,grade:g,classNum:j})},children:[(0,s.jsxs)("label",{children:["íë
",(0,s.jsx)("select",{value:g,onChange:e=>v(Number(e.target.value)),children:[1,2,3].map(e=>(0,s.jsxs)("option",{value:e,children:[e,"íë
"]},e))})]}),(0,s.jsxs)("label",{children:["ë°",(0,s.jsx)("input",{type:"number",min:1,max:99,required:!0,value:j,onChange:e=>b(Number(e.target.value))})]}),(0,s.jsxs)("button",{className:_().secondary,disabled:n,type:"submit",children:[(0,s.jsx)(m.Z,{size:16})," íê¸ ì¶ê°"]})]}),a.classes.length?(0,s.jsxs)("div",{className:_().classLayout,children:[(0,s.jsx)("div",{className:_().classList,children:a.classes.map(e=>(0,s.jsxs)("button",{"aria-pressed":y===e.id,disabled:n,onClick:()=>{N(e.id),c(e.id),p(""),C(""),k("")},children:[(0,s.jsxs)("strong",{children:[e.grade,"íë
",e.classNum,"ë°"]}),(0,s.jsxs)("span",{children:[e._count.enrollments,"ëª
"]})]},e.id))}),(0,s.jsx)("div",{children:I?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("h3",{children:[I.grade,"íë
",I.classNum,"ë°"]}),A.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:f().nextStep,children:[(0,s.jsxs)("p",{className:_().note,children:["íêµ íì ëª
ë¨ \xb7 ",A.length,"ëª
"]}),["grades","mock"].some(e=>(0,x.yV)(a.me.assignments,{academicYear:a.space.currentYear,grade:I.grade,classId:I.id},e))&&(0,s.jsxs)("button",{className:_().primary,disabled:n,onClick:()=>d(I.id),children:["ì´ ë° ì±ì ì
ë¡ë ",(0,s.jsx)(h.Z,{size:16})]})]}),(0,s.jsxs)("table",{className:_().table,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",children:"ë²í¸"}),(0,s.jsx)("th",{scope:"col",children:"ì´ë¦"}
1),a.me.operator&&(0,s.jsx)("th",{scope:"col",children:"íì ëª
ë¨ ê´ë¦¬"})]})}),(0,s.jsx)("tbody",{children:A.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:e.number}),(0,s.jsx)("td",{children:e.student.name}),a.me.operator&&(0,s.jsx)("td",{children:(0,s.jsx)("button",{className:_().link,disabled:n,"aria-label":"".concat(e.student.name," íê¸ ì´ë\xb7ì ì¶"),onClick:()=>p(e.id),children:"ì´ë\xb7ì ì¶"})})]},e.id))})]})]}):O?(0,s.jsxs)("form",{className:_().form,onSubmit:async e=>{e.preventDefault(),k("");try{await t({action:"register-roster",spaceId:a.space.id,classId:I.id,revision:I.revision,rows:function(){let e=w.trim().split(/\r?\n/).map(e=>{let a=e.trim().match(/^(\d+)[\t, ]+(.+)$/);if(!a)throw Error("ê° ì¤ì ë²í¸ì ì´ë¦ì ì
ë ¥í´ ì£¼ì¸ì. ì: 1 ê¹ë¯¼ì");return{number:Number(a[1]),name:a[2].trim()}});if(new Set(e.map(e=>e.number)).size!==e.length)throw Error("ì¤ë³µë ë²í¸ê° ììµëë¤. íì¸í´ 주ì¸ì.");return e}()})&&C("")}catch(e){k(e instanceof Error?e.message:"íì ëª
ë¨ì íì¸í´ 주ì¸ì.")}},children:[(0,s.jsx)("p",{children:"íì ëª
ë¨ì ì²ì ë±ë¡í©ëë¤. ì´ë¦ê³¼ ë²í¸ë¥¼ íì¸í ë¤ ë±ë¡í´ 주ì¸ì."}),(0,s.jsxs)("label",{children:["ë²í¸ì ì´ë¦",(0,s.jsx)("textarea",{value:w,onChange:e=>C(e.target.value),rows:9,maxLength:1e4,required:!0,placeholder:"1 ê¹ë¯¼ì\n2 ì´ìì°\n\nìì
ì ë²í¸\xb7ì´ë¦ ë ì´ì ë³µì¬í´ ë¶ì¬ ë£ì´ë ë©ëë¤."})]}),(0,s.jsx)("p",{className:_().note,children:"ë±ë¡íë©´ ë´ì ì ìëì íì ëª
ë¨ê³¼ ìëì¼ë¡ ì´ì´ì§ëë¤. ë²í¸ì ì´ë¦ì´ 모ë ê°ì íìë¼ë¦¬ ìê³ , íêµ ëª
ë¨ìë§ ìë íìì ë´ì íê¸ì ì¶ê°í©ëë¤. ì§ìì§ë ìë£ë ììµëë¤."}),S&&(0,s.jsx)("p",{className:_().error,role:"alert",children:S}),(0,s.jsx)("button",{className:_().primary,disabled:n||!w.trim(),children:"íêµ íì ëª
ë¨ ë±ë¡"})]}):(0,s.jsx)("p",{className:_().empty,children:"ë´ì ëë íêµ ê´ë¦¬ìê° íì ëª
ë¨ì ë±ë¡íë©´ ì´ê³³ì íìë©ëë¤."}),a.me.operator&&(0,s.jsx)($,{detail:a,schoolClass:I,busy:n,onBusyChange:r,onComplete:o},"".concat(I.id,":").concat(I.revision)),a.me.operator&&A.filter(e=>e.id===u).map(e=>(0,s.jsx)(ee,{detail:a,schoolClass:I,row:e,busy:n,onBusyChange:r,onClose:()=>p(""),onComplete:async()=>{p(""),await o()}},"".concat(e.id,":").concat(I.revision)))]}):(0,s.jsx)("p",{className:_().empty,children:"íì¸í íê¸ì ì ííì¸ì."})})]}):(0,s.jsx)("p",{className:_().empty,children:a.me.operator?"í¨ê» ì¬ì©í íê¸ì 먼ì ì¶ê°í´ 주ì¸ì.":"ë°°ì ë íê¸ì´ ììµëë¤. íêµ ê´ë¦¬ììê² ë´ë¹ ë°°ì ì ìì²í´ 주ì¸ì."})]})}},29633:function(e){e.exports={chart:"school-org-chart_chart__F08cp",top:"school-org-chart_top___r_eH",topActions:"school-org-chart_topActions__s2Og8",banner:"school-org-chart_banner__tzCJz",group:"school-org-chart_group___v2Ba",groupHead:"school-org-chart_groupHead__0rXAi",grid:"school-org-chart_grid__ZTyKp",seat:"school-org-chart_seat__JoSgm",seatHead:"school-org-chart_seatHead__L86Sf",seatName:"school-org-chart_seatName__U6UhN",seatNameButton:"school-org-chart_seatNameButton__LPzo_",seatInput:"school-org-chart_seatInput__qeWwy",holder:"school-org-chart_holder__pt33Z",managerTag:"school-org-chart_managerTag__ErVdz",code:"school-org-chart_code__9U3fP",state:"school-org-chart_state__b3tK_",inlineAction:"school-org-chart_inlineAction__ezMau",menuButton:"school-org-chart_menuButton__LwHpX",menu:"school-org-chart_menu__V6v9n",danger:"school-org-chart_danger__Tcqqh",addSeat:"school-org-chart_addSeat__D61bv",addForm:"school-org-chart_addForm__WeOJ_",setup:"school-org-chart_setup__aBFXy",setupNote:"school-org-chart_setupNote__2Y6vK",gradeRow:"school-org-chart_gradeRow__Ystws",gradeToggle:"school-org-chart_gradeToggle__QcNVR",stepper:"school-org-chart_stepper__v0lG3",stepperOff:"school-org-chart_stepperOff__bh06B",setupSummary:"school-org-chart_setupSummary__9m_QI",setupActions:"school-org-chart_setupActions__n_T9v"}},44425:function(e){e.exports={chart:"school-org-directory_chart__yFUad",top:"school-org-directory_top__l7DSn",topActions:"school-org-directory_topActions__2EfRJ",banner:"school-org-directory_banner__5ut1Z",group:"school-org-directory_group__zN13w",groupHead:"school-org-directory_groupHead__qLq2J",addSeat:"school-org-directory_addSeat__JYQ78",tableScroll:"school-org-directory_tableScroll__6t8sY",table:"school-org-directory_table__E8pUT",nameColumn:"school-org-directory_nameColumn__fBDSh",accountColumn:"school-org-directory_accountColumn__o0JYo",roleColumn:"school-org-directory_roleColumn__RkXnU",statusColumn:"school-org-directory_statusColumn__IKC6E",actionColumn:"school-org-directory_actionColumn__j8pl3",identity:"school-org-directory_identity__wvqiD",selfLabel:"school-org-directory_selfLabel__uEdLa",muted:"school-org-directory_muted____jQU",account:"school-org-directory_account__pWeJu",inviteAvatar:"school-org-directory_inviteAvatar__AjVCl",managerTag:"school-org-directory_managerTag__q6mUq",code:"school-org-directory_code__K2Loq",state:"school-org-directory_state__QXEAd",expiry:"school-org-directory_expiry__DEztL",inlineAction:"school-org-directory_inlineAction__aATLs",seatNameButton:"school-org-directory_seatNameButton__LFDPL",seatInput:"school-org-directory_seatInput__wZeHH",actions:"school-org-directory_actions__Z796q",menuButton:"school-org-directory_menuButton__M_ONt",personRow:"school-org-directory_personRow__65zSE",expandedRow:"school-org-directory_expandedRow__0O_ki",rowActions:"school-org-directory_rowActions__Mr1oq",danger:"school-org-directory_danger__FS6hF",addForm:"school-org-directory_addForm__iSjPb",empty:"school-org-directory_empty__crQza",srOnly:"school-org-directory_srOnly__UZO6M",officeRow:"school-org-directory_officeRow__nhC_6",filters:"school-org-directory_filters__2a20T",dragHelp:"school-org-directory_dragHelp__3xraJ",dragHandle:"school-org-directory_dragHandle__LcgYu",dragPreview:"school-org-directory_dragPreview__gU4wc",scopeSummary:"school-org-directory_scopeSummary__OYeMb",scopeForm:"school-org-directory_scopeForm__MlvDc",
1scopeIntro:"school-org-directory_scopeIntro__ThMKg",scopeFields:"school-org-directory_scopeFields__gnQtb",scopeHint:"school-org-directory_scopeHint__KuYZt",editorFooter:"school-org-directory_editorFooter__azPuK","waiting-dot":"school-org-directory_waiting-dot__vf6JU",roleRows:"school-org-directory_roleRows__GpcHt",selectWrap:"school-org-directory_selectWrap___PpoB"}}}]);
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.