@ehfuse/taskbox 0.5.231 → 0.5.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -38,7 +38,7 @@ use chrome, FireFox or Internet Explorer 11`)}var r=e("safe-buffer"),t=e("random
38
38
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&amp;/gi,"&").replace(/\n{3,}/g,`
39
39
 
40
40
  `).trim():"";function m3(e){let p=[`[\uC5C5\uBB34] ${e.title}`],b=Vr(e.start_date),c=Vr(e.due_date);(b||c)&&p.push(`\uAE30\uAC04: ${b&&c?`${b} ~ ${c}`:b||c}`),e.manager_name&&p.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let o=or(e).name;o&&p.push(`\uC0C1\uD0DC: ${o}`);let a=eh(e.content);a&&p.push("",a);let r=String(e.note??"").trim();return r&&p.push("",`\uBE44\uACE0: ${r}`),p.join(`
41
- `)}function th(e){navigator.clipboard.writeText(e).then(()=>p3("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>h3("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function _i(e,p){let b=m3(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(c=>{c?.name!=="AbortError"&&th(b)});return}th(b)}import{Fragment as _3,jsx as Nt,jsxs as rh}from"react/jsx-runtime";function nh({task:e,myAccountSeq:p=0,onToggleCompleted:b,onChangeTitle:c,onChangeIcon:o,onChangeIconColor:a,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:l,onLoadActivity:i,onPrint:s}){let f=Bt(),[d,u]=kc(!1),[g,m]=kc(null),[v,k]=kc(null),B=e.is_notice?bt(e.icon||Kt):null,A=!!e.is_notice,L=!!e.is_event,O=A&&p>0&&(e.author_account_seq??0)===p,D=!Pn(e,p),j=!L&&(A?O:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return rh(_3,{children:[rh(ki,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Nt(as,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Nt(b3,{})}):null,j&&!t?Nt(La,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${Lr(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Nt(ki,{sx:{display:"flex",flexShrink:0,mr:1.5},children:Nt(mn,{onClick:z=>k({anchorEl:z.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!B?null:Nt(ki,{sx:{display:"flex",px:.5,color:e.icon_color||(A?"#e5484d":"#1e3a8a")},children:Nt(B,{sx:{fontSize:20}})}),g!==null?Nt(ki,{component:"input",autoFocus:!0,spellCheck:!1,value:g,onChange:z=>m(z.target.value),onBlur:()=>{g.trim()&&g.trim()!==e.title&&c(e.seq,g.trim()),m(null)},onKeyDown:z=>{z.key==="Enter"&&z.target.blur(),z.key==="Escape"&&m(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Nt(ki,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A?"\uACF5\uC9C0":L?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Nt(ki,{onClick:D?void 0:()=>m(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:D?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?Nt(La,{title:"\uD65C\uB3D9",arrow:!0,children:Nt(as,{"aria-label":"\uD65C\uB3D9",onClick:()=>u(!0),sx:{color:"#6b7280"},children:Nt(v3,{sx:{fontSize:20}})})}):null,Nt(La,{title:f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Nt(as,{"aria-label":f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>_i(e,f),sx:{color:"#6b7280"},children:f?Nt(y3,{sx:{fontSize:20}}):Nt(x3,{sx:{fontSize:20}})})}),s?Nt(La,{title:"\uC778\uC1C4",arrow:!0,children:Nt(as,{"aria-label":"\uC778\uC1C4",onClick:()=>s(e),sx:{color:"#6b7280"},children:Nt(w3,{sx:{fontSize:20}})})}):null,r&&!t?Nt(as,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Nt(g3,{})}):null]}),Nt(It,{open:!!v,anchorEl:v?.anchorEl??null,title:v?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:v?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>k(null),onConfirm:()=>{v&&b(e.seq,v.nextCompleted),k(null)}}),Nt(ja,{open:d,taskSeq:e.seq,items:n,loading:l,onLoad:i,onClose:()=>u(!1)})]})}import{useState as cn}from"react";import{Box as qt,Button as Si,ButtonBase as O3,Checkbox as A3,Divider as Wo,Menu as Mc,MenuItem as Ec}from"@mui/material";import D3 from"@mui/icons-material/ExpandLess";import P3 from"@mui/icons-material/ExpandMore";import N3 from"@mui/icons-material/ConfirmationNumberOutlined";import ch from"@mui/icons-material/Check";import j3 from"@mui/icons-material/DirectionsRunOutlined";import L3 from"@mui/icons-material/SpeedOutlined";import Rc from"@mui/icons-material/CheckCircle";import F3 from"@mui/icons-material/CheckCircleOutlineOutlined";import Oc from"@mui/icons-material/CheckCircleOutlined";import uh from"@mui/icons-material/AccessTimeOutlined";import z3 from"@mui/icons-material/AutorenewOutlined";import q3 from"@mui/icons-material/LabelOutlined";import $3 from"@mui/icons-material/PersonOutlineOutlined";import H3 from"@mui/icons-material/SubjectOutlined";import W3 from"@mui/icons-material/StickyNote2Outlined";import U3 from"@mui/icons-material/PanToolAltOutlined";import fh from"@mui/icons-material/LockOutlined";import dh from"@mui/icons-material/PublicOutlined";import hh from"@mui/icons-material/Group";import V3 from"@mui/icons-material/Repeat";import K3 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as ph,InfoAlert as G3}from"@ehfuse/alerts";import{DatePicker as X3}from"@ehfuse/mui-datetime-picker";import{useState as k3}from"react";import{TextField as S3}from"@ehfuse/mui-form-controls";import{jsx as T3}from"react/jsx-runtime";function oh({value:e,onCommit:p,onDraftChange:b,readOnly:c=!1}){let[o,a]=k3(null);return T3(S3,{value:o??e,placeholder:c?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:c}},onChange:r=>{a(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&p(o),a(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&a(null)},sx:{mt:1}})}import{useMemo as Cc,useState as Bc}from"react";import{Box as gr,Button as ah,IconButton as C3}from"@mui/material";import B3 from"@mui/icons-material/AccountTreeOutlined";import I3 from"@mui/icons-material/Add";import M3 from"@mui/icons-material/Close";import E3 from"@mui/icons-material/NextPlanOutlined";function Ho(e){return e.relations??[]}function $D(e,p,b){return Ho(e).some(c=>c.type===b&&c.task_seq===p.seq)||Ho(p).some(c=>c.type===b&&c.task_seq===e.seq)}function ih(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Sc(e,p){let b=new Map(p.map(d=>[d.seq,d]));b.set(e.seq,e);let c=new Map,o=(d,u)=>{c.has(d)||c.set(d,new Set),c.has(u)||c.set(u,new Set),c.get(d).add(u),c.get(u).add(d)};for(let d of b.values())for(let u of Ho(d))u.type==="follow_up"&&b.has(u.task_seq)&&o(d.seq,u.task_seq);let a=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let d=r.shift();for(let u of c.get(d)??[])a.has(u)||(a.add(u),r.push(u))}let t=[...a].map(d=>b.get(d)).filter(d=>!!d).sort((d,u)=>ih(d).localeCompare(ih(u))),n=new Set;for(let d of Ho(e))d.type==="related"&&n.add(d.task_seq);for(let d of b.values())d.seq!==e.seq&&Ho(d).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(d.seq);let l=[...n].map(d=>b.get(d)).filter(d=>d!==void 0&&d.seq!==e.seq),i=[...b.values()].filter(d=>d.seq!==e.seq&&Ho(d).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),s=Ho(e).find(d=>d.type==="duplicate_of")?.task_seq,f=s?b.get(s)??null:null;return{lineage:t,related:l,duplicates:i,duplicateOf:f}}function Tc(e,p){let b=Sc(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function sh(e,p){return Tc(e,p)>0}import{Fragment as R3,jsx as zt,jsxs as ln}from"react/jsx-runtime";function Ic({item:e,caption:p,onOpen:b,onUnlink:c}){let o=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Kt:nr)):null;return ln(gr,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[p?zt(gr,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:p}):null,o?zt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,ln(gr,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),zt(Et,{option:or(e),small:!0}),c?zt(C3,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:c,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:zt(M3,{sx:{fontSize:15}})}):null]})}function lh({task:e,tasks:p,readOnly:b=!1,onOpenTask:c,onLink:o,onUnlink:a,onCreateFollowUp:r}){let[t,n]=Bc(!1),[l,i]=Bc(null),[s,f]=Bc(null),d=Cc(()=>Sc(e,p),[e,p]),u=d.lineage.length>=2,g=Cc(()=>Tc(e,p),[e,p]),m=Cc(()=>{let k=new Set;for(let B of d.lineage)k.add(B.seq);for(let B of d.related)k.add(B.seq);for(let B of d.duplicates)k.add(B.seq);return d.duplicateOf&&k.add(d.duplicateOf.seq),[...k]},[d]),v=(k,B,A)=>{f({anchorEl:k,targetSeq:B,type:A})};return ln(Yr,{icon:zt(B3,{sx:{fontSize:19,display:"block"}}),title:ln(R3,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?zt(gr,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:ln(gr,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?zt(ah,{size:"small",color:"inherit",startIcon:zt(E3,{sx:{fontSize:16}}),onClick:k=>i(k.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?zt(ah,{size:"small",color:"inherit",startIcon:zt(I3,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[ln(gr,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?zt(gr,{sx:{mb:d.related.length||d.duplicates.length||d.duplicateOf?1:0},children:d.lineage.map((k,B)=>{let A=k.seq===e.seq,L=B===d.lineage.length-1;return ln(gr,{sx:{display:"flex",gap:1},children:[ln(gr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[zt(gr,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":k.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),L?null:zt(gr,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),ln(gr,{sx:{flex:1,minWidth:0,pb:L?0:.5},children:[ln(gr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[ln(gr,{component:"span",onClick:!A&&c?()=>c(k.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":k.completed?"#9a9a97":"#37352f",textDecoration:k.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[k.ticket_no?`${k.ticket_no} `:"",k.title]}),zt(Et,{option:or(k),small:!0})]}),zt(gr,{sx:{fontSize:12,color:"#9a9a97"},children:k.completed&&k.completed_time?`${k.completed_time} \uC644\uB8CC`:k.created_time??""})]})]},k.seq)})}):null,d.duplicateOf?zt(Ic,{item:d.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:c?()=>c(d.duplicateOf.seq):void 0,onUnlink:!b&&a?k=>v(k.currentTarget,d.duplicateOf.seq,"duplicate_of"):void 0}):null,d.duplicates.map(k=>zt(Ic,{item:k,caption:"\uC911\uBCF5",onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&a?B=>v(B.currentTarget,k.seq,"duplicate_of"):void 0},`dup-${k.seq}`)),d.related.map(k=>zt(Ic,{item:k,onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&a?B=>v(B.currentTarget,k.seq,"related"):void 0},`rel-${k.seq}`)),g===0?zt(gr,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?zt(ka,{open:t,task:e,tasks:p,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(k,B)=>o(e.seq,k,B)}):null,zt(It,{open:!!l,anchorEl:l,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),zt(It,{open:!!s,anchorEl:s?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>f(null),onConfirm:()=>{s&&a?.(e.seq,s.targetSeq,s.type),f(null)}})]})}import{Fragment as Br,jsx as xe,jsxs as jt}from"react/jsx-runtime";function xo({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return xe(qt,{component:"span",sx:{color:"#9a9a97"},children:e})}function mh({task:e,customTabs:p,statusOptions:b,avatarSrcByName:c,onChangeStatus:o,onChangeLabels:a,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:l,onChangeReminder:i,onMemberEdit:s,onChangePriority:f,onChangeVisibility:d,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:v,onChangeEventAddress:k,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:L,contentLoading:O=!1,onChangeContentHeight:D,onAddChecklistItem:j,onToggleChecklistItem:z,onRemoveChecklistItem:N,onUpdateChecklistItem:S,onReorderChecklist:C,onConvertChecklistToTask:E,onOpenChecklistTask:h,onLinkChecklistTask:y,resolveChecklistTask:w,relatedTasksPool:x,onOpenRelatedTask:_,onLinkRelatedTask:T,onUnlinkRelatedTask:P,onCreateFollowUpTask:q,onAddAttachments:$,onRemoveAttachment:W,onPreview:R,onDownload:H,onUpdateComment:M,onRemoveComment:I,onToggleCommentReaction:F,currentUserName:U="",myAccountSeq:X=0,noticeAdmin:V=!1,hideProject:G=!1,hideLabel:te=!1,showTitle:Y=!1,onChangeTitle:K,onToggleCompleted:ee,onChangeIcon:Q,onChangeIconColor:oe,employees:se=[],onAckConfirm:ce,onRequestConfirm:ne,onChangeBugField:ae,sprints:be=[],sprintProject:ve=!1,hideSprint:Le=!1,onChangeSprint:Ie,onChangeStoryPoints:le,onChangeResolution:Pe,onClaimTask:Me,onVerifyBug:ke}){let[Oe,we]=cn(null),[ye,Ye]=cn(null),[Te,fe]=cn(null),[Re,_e]=cn(!1),Se={[nn]:Re?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[ot,je]=cn(null),[Ae,yt]=cn(null),[ze,Fe]=cn(null),[ft,Ve]=cn(null),[De,Dt]=cn(null),[Ue,re]=cn(null),[ue,de]=cn(null),me=!!e.is_notice,He=!!e.is_event,Be=!!e.is_bug,Ne=!!Me&&$s(e,X),dt=!!Me&&Hs(e,X),$e=!!ke&&Be&&!!e.completed&&X>0&&(e.author_account_seq??0)===X&&!(e.acks??[]).some(Z=>Z.account_seq===X),Ee=!Pn(e,X),ut=!e.is_event&&(e.is_notice?X>0&&(e.author_account_seq??0)===X:(e.author_account_seq??0)===X||(e.manager_account_seq??0)===X),rt=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Kt:nr)):null,et=me?!qs(e,X):Ee,mt=Ne||dt?jt(mn,{onClick:Z=>de(Z.currentTarget),children:[xe(U3,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Ot=me?Ra(e,se):"",ht=me?jd(e,se,X):null,_t=me?null:ta(e,X),Lt=!!(_t&&_t.total>0||me&&ht),Jt=!me,J=jt(Br,{children:[xe(at,{icon:xe($3,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Sn(9),Se??null,...He?[]:[Xt(1)]],children:e.created_by?jt(Br,{children:[xe(kr,{names:[e.created_by],size:20,avatarSrcByName:c}),e.created_by]}):xe(xo,{})}),xe(at,{icon:xe(uh,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Sn(11),Se??null,...He?[]:[Xt(2)]],children:e.created_time?Lr(e.created_time):xe(xo,{})})]});return jt(Br,{children:[Y?jt(qt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[ut?xe(A3,{checked:e.completed,icon:xe(F3,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:xe(Rc,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(Z,ge)=>{ye||Ye({anchorEl:Z.currentTarget,nextCompleted:ge})},sx:{p:0,mt:.25}}):null,rt?xe(qt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(me?"#e5484d":"#1e3a8a")},children:xe(rt,{sx:{fontSize:20}})}):null,xe(qt,{sx:{flex:1,minWidth:0},children:Oe!==null?xe(qt,{component:"input",autoFocus:!0,spellCheck:!1,value:Oe,onChange:Z=>we(Z.target.value),onBlur:()=>{Oe.trim()&&Oe.trim()!==e.title&&K(e.seq,Oe.trim()),we(null)},onKeyDown:Z=>{Z.key==="Enter"&&Z.target.blur(),Z.key==="Escape"&&we(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):xe(qt,{onClick:()=>we(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),xe(It,{open:!!ye,anchorEl:ye?.anchorEl??null,title:ye?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:ye?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Ye(null),onConfirm:()=>{ye&&ee(e.seq,ye.nextCompleted),Ye(null)}})]}):null,jt(qt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[nn]:{pb:0,"& > :last-child":{mb:0}}},children:[xe(va,{hideProject:G,pinColumns:!0,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:p,avatarSrcByName:c,hideDueDate:!He&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:me,event:He,readOnly:Ee,targetSummary:Ot,onChangeProject:Z=>t(e.seq,Z),onAddProject:n,onChangeStartDate:Z=>l(e.seq,"start_date",Z),onChangeDueDate:Z=>l(e.seq,"due_date",Z),onChangeReminder:Z=>i(e.seq,Z),onChangePriority:Z=>f(e.seq,Z),onChangeEventTime:Z=>m?.(e.seq,Z),onChangeEventPlace:Z=>v?.(e.seq,Z),onChangeEventAddress:Z=>k?.(e.seq,Z),onMemberEdit:Z=>s(e,Z,null),narrowCollapsedSx:Se,reminderLocked:e.completed,managerAction:mt,leading:jt(Br,{children:[$e||mt&&(me||He)?jt(qt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[me||He?mt:null,$e?jt(Br,{children:[xe(Si,{variant:"contained",size:"large",onClick:()=>ke?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),xe(Si,{variant:"outlined",size:"large",color:"error",onClick:()=>ke?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,Be&&e.ticket_no?xe(at,{icon:xe(N3,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:Xt(1),children:xe(qt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,He?null:xe(qt,{sx:Be&&e.ticket_no||Jt||Lt?Xt(Be&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:xe(at,{icon:xe(z3,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:Ee||e.completed?void 0:Z=>je(Z),children:xe(Et,{option:or(e)})})}),me?null:(()=>{let Z=Qr(e),ge=Z==="all"?xe(dh,{sx:{fontSize:17,color:"#2f80ed"}}):Z==="group"?xe(hh,{sx:{fontSize:17,color:"#d9730d"}}):xe(fh,{sx:{fontSize:17}}),he=Z==="all"?"\uC804\uCCB4\uACF5\uAC1C":Z==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(ie=>ie.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return xe(qt,{sx:He?void 0:Xt(Be?1:2),children:xe(at,{icon:ge,label:"\uACF5\uAC1C",onClick:Ee||!d?void 0:ie=>yt(ie),children:he})})})(),!me&&!Be?xe(qt,{sx:He?void 0:Xt(1),children:xe(at,{icon:xe(V3,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:Ee||!u?void 0:Z=>Fe(Z),children:e.repeat_rule?ma(e.repeat_rule):xe(xo,{label:"\uC5C6\uC74C"})})}):null,!me&&!Be&&e.repeat_rule?xe(qt,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(K3,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:Ee||!u?void 0:Z=>Ve(Z),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:xe(xo,{})})}):null,_t&&_t.total>0?xe(qt,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(Oc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:_t.canConfirm?xe(Si,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):jt(Si,{size:"small",variant:"outlined",color:"inherit",startIcon:_t.myTime?xe(Rc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[_t.count," / ",_t.total]})})}):null,me&&ht?xe(qt,{sx:Xt(2),children:xe(at,{icon:xe(Oc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:xe(qt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ht.canAck?xe(Si,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):xe(Si,{size:"small",variant:"outlined",color:"inherit",startIcon:ht.acked?xe(Rc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ht.total>0&&ht.count>=ht.total?"\uC644\uB8CC":jt(Br,{children:[ht.count,xe(qt,{component:"span",sx:{mx:.4},children:"/"}),ht.total]})})})})}):null,ve&&!Le&&!He&&!me?jt(Br,{children:[xe(at,{icon:xe(j3,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:Ee?void 0:Z=>Dt(Z),sx:Xt(1),children:(e.sprint_seq??0)>0?be.find(Z=>Z.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":xe(xo,{label:"\uBBF8\uBC30\uC815"})}),xe(at,{icon:xe(L3,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:Xt(2),children:xe(Yn,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:Ee,onCommit:Z=>le?.(e.seq,Number(Z.replace(/[^0-9.]/g,""))||0)})})]}):null,He||te?null:xe(qt,{sx:[{gridColumn:"1 / -1"},Se??null],children:xe(at,{icon:xe(q3,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:Ee?void 0:Z=>re(Z),children:(e.label_keys??[]).length>0?xe(co,{labelKeys:e.label_keys??[],labelOptions:b}):xe(xo,{})})}),He?null:J]}),trailing:jt(Br,{children:[Be?xe(wa,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:Ee,showResolution:!!e.completed,onChangeRepro:Z=>ae?.(e.seq,"bug_repro",Z),onChangeDevice:Z=>ae?.(e.seq,"bug_device",Z),onChangeWhere:Z=>ae?.(e.seq,"bug_where",Z),onChangeVersion:Z=>ae?.(e.seq,"bug_version",Z),onChangeResolution:Z=>Pe?.(e.seq,Z)}):null,He?J:null,e.completed?jt(Br,{children:[xe(at,{icon:xe(Oc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Sn(10),Se??null,...He?[]:[Xt(1)]],children:e.completed_by?jt(Br,{children:[xe(kr,{names:[e.completed_by],size:20,avatarSrcByName:c}),e.completed_by]}):xe(xo,{})}),xe(at,{icon:xe(uh,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Sn(12),Se??null,...He?[]:[Xt(2)]],children:e.completed_time?Lr(e.completed_time):xe(xo,{})})]}):null]})}),jt(qt,{sx:{display:"none",[nn]:{display:"block",mt:1.5,mb:0}},children:[xe(Wo,{sx:{borderColor:"#e6e6e3"}}),xe(O3,{onClick:()=>_e(Z=>!Z),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:Re?jt(Br,{children:["\uC811\uAE30 ",xe(D3,{sx:{fontSize:18}})]}):jt(Br,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",xe(P3,{sx:{fontSize:18}})]})})]}),jt(qt,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3",[nn]:{mt:0,mb:1.25}}}),xe(Yr,{icon:xe(H3,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:xe(qt,{sx:{userSelect:"text"},children:O?xe(qt,{sx:{minHeight:e.content_height||180,borderRadius:1,border:"1px solid #e6e6e3",bgcolor:"#fafaf9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,color:"#9a9a97"},children:"\uB0B4\uC6A9\uC744 \uBD88\uB7EC\uC624\uB294 \uC911\u2026"}):xe(_a,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:D?Z=>D(e.seq,Z):void 0,readOnly:Ee,onChange:Z=>L(e.seq,Z)})})}),e.is_bug?null:jt(Br,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Yr,{icon:xe(W3,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:xe(qt,{sx:{userSelect:"text"},children:xe(oh,{value:e.note,readOnly:et,onCommit:Z=>B(e.seq,Z),onDraftChange:A?Z=>A(e.seq,Z):void 0})})})]}),He?null:jt(Br,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Sa,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:et,onAdd:j,onToggle:z,onRemove:N,onUpdate:S,onReorder:C,onConvertToTask:E,onOpenLinkedTask:h,resolveLinkedTask:w,myAccountSeq:X,linkCandidates:x,linkBaseTask:e,onLinkExistingTask:y})]}),x&&!He&&!me&&sh(e,x)?jt(Br,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(lh,{task:e,tasks:x,readOnly:Ee,onOpenTask:_,onLink:T,onUnlink:P,onCreateFollowUp:q})]}):null,xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Ia,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:et,onAdd:$,onRemove:W,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Zd,{taskSeq:e.seq,comments:e.comments??[],currentUserName:U,myAccountSeq:X,avatarSrcByName:c,onUpdate:M,onRemove:I,onToggleReaction:F,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(oi,{anchorEl:ot,value:e.status,options:me?qi:Be?Mo:$i,onSelect:Z=>o(e.seq,Z),onClose:()=>je(null)}),xe(Mc,{transitionDuration:0,anchorEl:ze,open:!!ze,onClose:()=>Fe(null),children:[{value:"",label:"\uC5C6\uC74C"},...es].map(Z=>xe(Ec,{selected:(e.repeat_rule??"")===Z.value,onClick:()=>{Fe(null),(async()=>{let ge=e.repeat_rule??"";if(Z.value===ge)return;if(Z.value===""){await ph({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let he=String(e.due_date??"").slice(0,10);if(!he){G3(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}ge&&!await ph({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,Z.value,ga(he,Z.value))})()},sx:{fontSize:14,minWidth:140},children:Z.label},Z.value||"none"))}),xe(X3,{anchorEl:ft,open:!!ft,onClose:()=>Ve(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:Z=>{Ve(null);let ge=pe=>String(pe).padStart(2,"0"),he=`${Z.getFullYear()}-${ge(Z.getMonth()+1)}-${ge(Z.getDate())}`,ie=e.repeat_rule??"";ie&&u?.(e.seq,ie,he)}}),xe(Mc,{transitionDuration:0,anchorEl:Ae,open:!!Ae,onClose:()=>yt(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:xe(fh,{sx:{fontSize:17,color:"#57564f"}}),selected:Qr(e)==="involved",onPick:()=>d?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:xe(dh,{sx:{fontSize:17,color:"#2f80ed"}}),selected:Qr(e)==="all",onPick:()=>d?.(e.seq,"all",0)},...g.map(Z=>({key:`group-${Z.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${Z.name}`,icon:xe(hh,{sx:{fontSize:17,color:"#d9730d"}}),selected:Qr(e)==="group"&&(e.visibility_group_seq??0)===Z.seq,onPick:()=>d?.(e.seq,"group",Z.seq)}))].map(Z=>jt(Ec,{selected:Z.selected,onClick:()=>{Z.onPick(),yt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.icon,Z.label,Z.selected?xe(ch,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.key))}),xe(Mc,{transitionDuration:0,anchorEl:De,open:!!De,onClose:()=>Dt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...be.filter(Z=>`custom-${Z.group_seq}`===String(e.tab_key??"")).map(Z=>({seq:Z.seq,label:Gr(Z)}))].map(Z=>jt(Ec,{onClick:()=>{Ie?.(e.seq,Z.seq),Dt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.label,(e.sprint_seq??0)===Z.seq?xe(ch,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.seq))}),xe(ea,{anchorEl:Te?.anchorEl??null,open:!!Te?.open,acks:e.acks??[],total:ht?.total??_t?.total??0,pendingNames:ht?.pendingNames??_t?.pendingNames??[],avatarSrcByName:c,onRequestConfirm:ne&&(ht?ht.count<ht.total:_t&&_t.count<_t.total)?()=>{ne(e.seq),fe(Z=>Z?{...Z,open:!1}:null)}:void 0,onClose:()=>fe(Z=>Z?{...Z,open:!1}:null)}),xe(Ea,{anchorEl:Ue,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:Z=>a(e.seq,Fs(e.label_keys??[],Z)),onAddLabel:r,onClose:()=>re(null)}),xe(It,{open:!!ue,anchorEl:ue,title:Ne?"\uC774 \uC5C5\uBB34\uB97C \uAC00\uC838\uC640 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC774 \uC5C5\uBB34\uC758 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>de(null),onConfirm:()=>{Me?.(e.seq),de(null)}})]})}import{Fragment as r4,jsx as Ir,jsxs as wh}from"react/jsx-runtime";function vN(){let e=new Date,p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function wN({open:e,task:p,onClose:b,onAddComment:c,onSaveFields:o,presentation:a="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,activityItems:s,activityLoading:f,onLoadActivity:d,onPrint:u,...g}){let m=Bt(),v=bh(null);p&&(v.current=p);let k=p??v.current,[B,A]=yh(!1),[L,O]=yh({}),D=Object.keys(L).length>0;gh(()=>{O({})},[p?.seq,e]);let j=bh(null);if(gh(()=>{j.current?.scrollTo({top:0})},[p?.seq]),!k)return null;let z=m&&D?{...k,...L}:k,N=z.checklist??[],S=(x,_)=>{m?O(T=>({...T,...x})):_()},C=()=>{let x=L;O({});let _=k.seq,T=x.title===void 0?void 0:String(x.title).trim();if(o){let P={...x};T!==void 0&&(T?P.title=T:delete P.title),Object.keys(P).length>0&&o(_,P),vh({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}T&&n(_,T),x.icon!==void 0&&l(_,String(x.icon)),x.icon_color!==void 0&&i?.(_,String(x.icon_color)),x.status!==void 0&&g.onChangeStatus(_,x.status),x.label_keys!==void 0&&g.onChangeLabels(_,x.label_keys??[]),x.tab_key!==void 0&&g.onChangeProject(_,String(x.tab_key??"")),x.start_date!==void 0&&g.onChangeDate(_,"start_date",String(x.start_date??"")),x.due_date!==void 0&&g.onChangeDate(_,"due_date",String(x.due_date??"")),x.reminder!==void 0&&g.onChangeReminder(_,x.reminder),x.priority!==void 0&&g.onChangePriority(_,x.priority),x.event_time!==void 0&&g.onChangeEventTime?.(_,String(x.event_time??"")),x.event_place!==void 0&&g.onChangeEventPlace?.(_,String(x.event_place??"")),x.event_address!==void 0&&g.onChangeEventAddress?.(_,String(x.event_address??"")),x.content!==void 0&&g.onChangeContent(_,String(x.content??"")),x.note!==void 0&&g.onChangeNote(_,String(x.note??"")),x.visibility!==void 0&&g.onChangeVisibility?.(_,x.visibility,Number(x.visibility_group_seq??0)),vh({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},E={...g,onChangeStatus:(x,_)=>S({status:_},()=>g.onChangeStatus(x,_)),onChangeLabels:(x,_)=>S({label_keys:_},()=>g.onChangeLabels(x,_)),onChangeProject:(x,_)=>S({tab_key:_},()=>g.onChangeProject(x,_)),onChangeDate:(x,_,T)=>S({[_]:T},()=>g.onChangeDate(x,_,T)),onChangeReminder:(x,_)=>S({reminder:_},()=>g.onChangeReminder(x,_)),onChangePriority:(x,_)=>S({priority:_},()=>g.onChangePriority(x,_)),onChangeEventTime:(x,_)=>S({event_time:_},()=>g.onChangeEventTime?.(x,_)),onChangeEventPlace:(x,_)=>S({event_place:_},()=>g.onChangeEventPlace?.(x,_)),onChangeEventAddress:(x,_)=>S({event_address:_},()=>g.onChangeEventAddress?.(x,_)),onChangeContent:(x,_)=>S({content:_},()=>g.onChangeContent(x,_)),onChangeNote:(x,_)=>S({note:_},()=>g.onChangeNote(x,_)),onMemberEdit:(x,_)=>g.onMemberEdit(x,_,m?T=>O(P=>({...P,...T})):null),onChangeNoteDraft:m?(x,_)=>S({note:_},()=>{}):void 0,onChangeVisibility:g.onChangeVisibility?(x,_,T)=>S({visibility:_,visibility_group_seq:T},()=>g.onChangeVisibility?.(x,_,T)):void 0,onAddChecklistItem:(x,_)=>S({checklist:[...N,{label:_,checked:!1}]},()=>g.onAddChecklistItem(x,_)),onToggleChecklistItem:(x,_,T)=>S({checklist:N.map((P,q)=>q===_?{...P,checked:T}:P)},()=>g.onToggleChecklistItem(x,_,T)),onRemoveChecklistItem:(x,_)=>S({checklist:N.filter((T,P)=>P!==_)},()=>g.onRemoveChecklistItem(x,_)),onUpdateChecklistItem:g.onUpdateChecklistItem?(x,_,T)=>S({checklist:N.map((P,q)=>q===_?{...P,label:T}:P)},()=>g.onUpdateChecklistItem?.(x,_,T)):void 0,onReorderChecklist:g.onReorderChecklist?(x,_)=>S({checklist:_},()=>g.onReorderChecklist?.(x,_)):void 0,onLinkChecklistTask:g.onLinkChecklistTask?(x,_,T)=>S({checklist:[...N,{label:T,checked:!1,task_seq:_}]},()=>g.onLinkChecklistTask?.(x,_,T)):void 0},h=Ir(mh,{...E,task:z,myAccountSeq:r,onChangeTitle:(x,_)=>S({title:_},()=>n(x,_)),onToggleCompleted:t,onChangeIcon:(x,_)=>S({icon:_},()=>l(x,_)),onChangeIconColor:(x,_)=>S({icon_color:_},()=>i?.(x,_)),showTitle:m}),y=Ir(Jd,{onSubmit:(x,_)=>c(z.seq,x,_)},z.seq);return m||a==="dialog"?wh(r4,{children:[Ir(t4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:z.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":z.is_event?"\uC77C\uC815":z.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...d?[{icon:Ir(Q3,{sx:{ml:2,color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>A(!0)}]:[],{icon:Ir(J3,{sx:{ml:d?0:2,color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>_i(z,!0)},{icon:Ir(Y3,{variant:"contained",size:"small",disableElevation:!0,disabled:!D,onClick:D?C:void 0,sx:{ml:1,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:""}]},fullScreen:m,maxWidth:m?void 0:"md",width:m?void 0:720,mobilePresentation:m?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:y},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:Ir(Fa,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:h})}]},k.seq),Ir(ja,{open:B,taskSeq:z.seq,items:s,loading:f,onLoad:d,onClose:()=>A(!1)})]}):Ir(Z3,{anchor:"right",open:e,onClose:b,disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:x=>x.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:wh(Fa,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[Ir(nh,{task:z,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,onClose:b,activityItems:s,activityLoading:f,onLoadActivity:d,onPrint:u}),Ir(xh,{sx:{borderColor:"#e6e6e3"}}),Ir(Fa,{sx:{flex:1,minHeight:0},children:Ir(e4,{ref:j,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:h})}),Ir(xh,{sx:{borderColor:"#37352f"}}),Ir(Fa,{sx:{flexShrink:0},children:y})]})})}import{useEffect as o4,useState as Uo}from"react";import{Box as Ar,Button as Pc,IconButton as _h}from"@mui/material";import{FormDialog as i4}from"@ehfuse/mui-form-dialog";import s4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as kh}from"@ehfuse/alerts";import{ClearTextField as Sh,DateTextField as Th,LabelSelect as Ch}from"@ehfuse/mui-form-controls";var Ac="custom-";function n4(e){return e.startsWith(Ac)}function SN(e){return e>0?`${Ac}${e}`:""}function Dc(e){if(!n4(e))return 0;let p=Number(e.slice(Ac.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as l4,jsx as Yt,jsxs as vo}from"react/jsx-runtime";var a4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function Bh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function DN({open:e,customTabs:p,sprints:b,onClose:c,onCreate:o,onUpdate:a,onChangeStatus:r,onRemove:t}){let n=p.filter(C=>C.useSprints&&!C.archived),[l,i]=Uo(""),[s,f]=Uo(""),[d,u]=Uo(""),[g,m]=Uo(""),[v,k]=Uo(""),[B,A]=Uo(!1),[L,O]=Uo(0);o4(()=>{e&&(i(n.length===1?n[0].key:""),f(""),u(""),m(""),k(""),O(0))},[e]);let D=()=>{f(""),u(""),m(""),k(""),O(0)},j=C=>{O(C.seq),i(`custom-${C.group_seq}`),f(C.name),u(C.goal),m(C.start_date),k(C.end_date)},z=async()=>{let C=Dc(l);if(!C){kh("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!s.trim()){kh("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}A(!0);try{if(L>0){a(L,{name:s.trim(),goal:d.trim(),start_date:g,end_date:v}),D();return}await o({group_seq:C,name:s.trim(),goal:d.trim(),start_date:g,end_date:v})&&D()}finally{A(!1)}},N=new Map(p.map(C=>[Dc(C.key),C.label])),S=Yt(Ar,{children:n.length===0?Yt(Ar,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):vo(l4,{children:[vo(Ar,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Yt(Ch,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:l,options:n.map(C=>({value:C.key,label:C.label})),onChange:C=>i(String(C.target.value)),disabled:L>0}),Yt(Sh,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:s,onChange:C=>f(C.target.value)}),Yt(Th,{size:"medium",label:"\uC2DC\uC791\uC77C",value:g,onChange:C=>m(C.target.value)}),Yt(Th,{size:"medium",label:"\uC885\uB8CC\uC77C",value:v,onChange:C=>k(C.target.value)}),Yt(Sh,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:d,onChange:C=>u(C.target.value),sx:{gridColumn:"1 / -1"}})]}),vo(Ar,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[L>0?Yt(Pc,{color:"inherit",onClick:D,disabled:B,children:"\uCDE8\uC18C"}):null,Yt(Pc,{variant:"contained",onClick:()=>{z()},disabled:B,children:L>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),Yt(Ar,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:b.length===0?Yt(Ar,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(C=>vo(Ar,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[vo(Ar,{sx:{minWidth:0},children:[vo(Ar,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Yt(Ar,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:C.name}),Yt(Ar,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:N.get(C.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),vo(Ar,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Bh(C.start_date)," ~ ",Bh(C.end_date)]})]}),C.goal?Yt(Ar,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:C.goal}):null]}),vo(Ar,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Yt(Ch,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:C.status,options:a4.map(E=>({value:E.value,label:E.label})),onChange:E=>r(C.seq,String(E.target.value)),sx:{width:104,flexShrink:0}}),Yt(_h,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>j(C),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Yt(s4,{sx:{fontSize:18}})}),Yt(_h,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>t(C.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Yt(yn,{style:{width:16,height:16}})})]})]},C.seq))})]})});return Yt(i4,{open:e,onClose:c,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],actions:{showCancelButton:!1,right:Yt(Pc,{variant:"contained",onClick:c,children:"\uB2EB\uAE30"})}})}import{useState as Ih}from"react";import{Box as lr,Button as Nc,Divider as c4,IconButton as u4,TextField as f4}from"@mui/material";import{FormDialog as d4}from"@ehfuse/mui-form-dialog";import h4 from"@mui/icons-material/OpenInNewOutlined";import p4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as m4}from"@ehfuse/alerts";import{jsx as Rt,jsxs as Vo}from"react/jsx-runtime";function WN({open:e,imports:p,onRegister:b,onRemove:c,onClose:o}){let[a,r]=Ih(""),[t,n]=Ih(!1),l=async()=>{let f=a.trim();if(f){n(!0);try{await b(f)&&r("")}finally{n(!1)}}},i=async f=>{await m4({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&c(f.seq)},s=Vo(lr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Vo(lr,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",Rt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",Rt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",Rt("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),Rt(lr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?Rt(lr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((f,d)=>Vo(lr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:d>0?"1px solid #efefed":"none"},children:[Rt(p4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),Rt(lr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),Rt(u4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{i(f)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Rt(yn,{sx:{fontSize:18}})})]},f.seq))}):Rt(lr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),Rt(c4,{sx:{my:1,borderColor:"#e6e6e3"}}),Rt(lr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),Vo(lr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Rt(lr,{children:Vo(lr,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",Rt("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),Rt(lr,{children:Vo(lr,{component:"span",children:[Rt("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",Rt("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Rt(lr,{children:Rt(lr,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),Rt(lr,{children:Rt(lr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})})]}),Vo(lr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[Rt(f4,{value:a,onChange:f=>r(f.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),Rt(Nc,{variant:"contained",disabled:!a.trim()||t,onClick:()=>{l()},sx:{flexShrink:0},children:t?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return Rt(d4,{open:e,onClose:o,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:s}],actions:{showCancelButton:!1,left:Rt(Nc,{variant:"outlined",startIcon:Rt(h4,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Rt(Nc,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}import{Box as eo,Button as ls,TextField as g4}from"@mui/material";import{FormDialog as b4}from"@ehfuse/mui-form-dialog";import y4 from"@mui/icons-material/ContentCopyOutlined";import Mh from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as Eh}from"@ehfuse/alerts";import{Fragment as v4,jsx as Zt,jsxs as Ko}from"react/jsx-runtime";function x4(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function JN({open:e,feed:p,feedTaskCount:b,buildFeedUrl:c,onSubscribe:o,onClose:a}){let r=c??x4,t=p.subscribed?r(p.token):"",n=()=>{navigator.clipboard.writeText(t).then(()=>Eh("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Eh("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},l=()=>{let s=t.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(s)}`,"_blank")},i=Ko(eo,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ko(eo,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Zt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?Ko(eo,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",Zt("br",{}),Zt("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",p.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):p.subscribed&&p.enabled?Ko(v4,{children:[Zt(g4,{value:t,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),Ko(eo,{sx:{display:"flex",gap:2},children:[Zt(ls,{variant:"outlined",startIcon:Zt(y4,{}),onClick:n,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Zt(ls,{variant:"contained",startIcon:Zt(Mh,{}),onClick:l,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),Ko(eo,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Zt(eo,{children:Ko("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Zt("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Zt(eo,{children:Zt("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),Zt(eo,{children:Zt("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),Zt(eo,{children:Zt("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):Zt(ls,{variant:"contained",onClick:o,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Zt(b4,{open:e,onClose:a,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:i}],actions:{showCancelButton:!1,left:Zt(ls,{variant:"outlined",startIcon:Zt(Mh,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Zt(ls,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}})}import{useEffect as w4,useMemo as jc,useState as Lc}from"react";import{Box as cs,Button as _4,Typography as k4}from"@mui/material";import{FormDialog as S4}from"@ehfuse/mui-form-dialog";import{SearchTextField as T4}from"@ehfuse/mui-form-controls";import{TreeView as C4}from"@ehfuse/tree-view";import{Fragment as O4,jsx as un,jsxs as A4}from"react/jsx-runtime";function Rh(e){return`${e.name}#${e.seq}`}function B4(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function I4(e){let p=[],b=c=>{for(let o of c.employees??[])p.push(o);for(let o of c.groups??[])b(o)};for(let c of e)b(c);return p}function M4(e,p){return p?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(p)):!0}function E4(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:Rh(e),renderLabel:un(cs,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:un(cs,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function Oh(e,p){let b=(e.groups??[]).map(o=>Oh(o,p)).filter(o=>o!==null),c=(e.employees??[]).filter(o=>M4(o,p)).map(E4);return b.length===0&&c.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...c]}}function R4({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:c,isMobile:o,onSelectionChange:a}){let[r,t]=Lc(""),n=jc(()=>e.map(i=>Oh(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),l=jc(()=>p.filter(i=>b.includes(i.seq)).map(Rh),[]);return A4(O4,{children:[un(cs,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:un(T4,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),un(cs,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:un(C4,{items:n,checkbox:!0,multiSelect:c,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:l,onChange:i=>a(i.map(B4).filter(s=>s>0)),styles:{border:"none",borderRadius:"0"}})})]})}function aj({open:e,title:p="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:c,multiple:o=!1,selectedSeqs:a,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let l=Bt(),[i,s]=Lc([]),[f,d]=Lc(0),u=jc(()=>I4(c),[c]),g=a??[];w4(()=>{e&&(s(g),d(v=>v+1))},[e]);let m=()=>{let v=u.filter(k=>i.includes(k.seq));t(o?v:v.slice(0,1)),n()};return un(S4,{open:e,onClose:n,title:`${p}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:l,mobilePresentation:l?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:un(cs,{sx:{...l?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...l?{}:{overflow:"hidden"},userSelect:"none"},children:un(R4,{groups:c,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:l,onSelectionChange:s},f)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?un(k4,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:un(_4,{variant:"contained",onClick:m,children:r})}})}import{useEffect as j5,useMemo as L5,useState as Kc}from"react";import{Box as no,Button as F5}from"@mui/material";import{FormDialog as z5}from"@ehfuse/mui-form-dialog";import{LabelSelect as Gc}from"@ehfuse/mui-form-controls";import{Box as qa}from"@mui/material";import{Bar as N4,BarChart as j4,CartesianGrid as L4,Cell as F4,ReferenceLine as z4,ResponsiveContainer as q4,Tooltip as $4,XAxis as H4,YAxis as W4}from"recharts";import{Box as D4}from"@mui/material";import{jsx as P4}from"react/jsx-runtime";function Mr({text:e,height:p}){return P4(D4,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof p=="number"?{height:p,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}var za="#2f80ed",Ah="#a9c9f5",Go="#9a9a97",Fc="#2e9e6b",to="#3d7eff",zc="#c3c8ce",us="#f2a30f",fs={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},Ti={...fs,cursor:!1};function er(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var br={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function In(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as fn,jsxs as ds}from"react/jsx-runtime";function U4(e,p){let b=p.filter(c=>c.sprint_seq===e.seq&&!c.archived&&c.completed);return{points:b.reduce((c,o)=>c+(o.story_points??0),0),count:b.length}}function Dh({sprints:e,tasks:p,height:b=200}){let o=[...e].sort((i,s)=>`${i.start_date}|${i.seq}`.localeCompare(`${s.start_date}|${s.seq}`)).map(i=>({sprint:i,...U4(i,p)})),a=o.some(i=>i.points>0),r=a?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>a?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,s)=>i+s,0)/t.length*10)/10:null,l=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:a?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?fn(Mr,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):ds(qa,{sx:er(b),children:[ds(qa,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[ds("span",{children:["\uC644\uB8CC ",a?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?ds("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",fn(qa,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),fn(qa,{sx:In(b),children:fn(q4,{width:"100%",height:"100%",children:ds(j4,{data:l,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[fn(L4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),fn(H4,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),fn(W4,{tick:{fontSize:13},width:40,allowDecimals:!1}),fn($4,{...Ti,formatter:i=>`${Number(i??0)}${r}`}),n!==null?fn(z4,{y:n,stroke:Go,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,fn(N4,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:l.map(i=>fn(F4,{fill:i.closed?za:Ah},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as V4}from"react";import{Box as Mn}from"@mui/material";import{CartesianGrid as K4,Line as Ph,LineChart as G4,ResponsiveContainer as X4,Tooltip as Y4,XAxis as Z4,YAxis as J4}from"recharts";import{jsx as Dr,jsxs as wo}from"react/jsx-runtime";function Nh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function Q4(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function e5(e){return e.slice(5).replace("-",".")}function jh({sprint:e,tasks:p,todayStr:b,height:c=200,headerLeft:o}){let a=V4(()=>{let s=Nh(e.start_date),f=Nh(e.end_date);if(!s||!f||f<s||Math.round((f.getTime()-s.getTime())/864e5)+1>366)return null;let u=p.filter(D=>D.sprint_seq===e.seq&&!D.archived);if(u.length===0)return{empty:!0};let g=u.some(D=>(D.story_points??0)>0),m=D=>g?D.story_points??0:1,v=u.reduce((D,j)=>D+m(j),0),k=new Map;for(let D of u){if(!D.completed)continue;let j=(D.completed_time??"").slice(0,10),z=/^\d{4}-\d{2}-\d{2}$/.test(j)?j:e.start_date;k.set(z,(k.get(z)??0)+m(D))}let B=[];for(let D=new Date(s);D<=f;D.setDate(D.getDate()+1))B.push(Q4(D));let A=v,L=v;return{empty:!1,data:B.map((D,j)=>{let z=B.length===1?0:v*(1-j/(B.length-1));return D<=b&&(A-=k.get(D)??0,L=Math.max(0,A)),{\uB0A0\uC9DC:e5(D),\uC774\uC0C1:Math.round(z*10)/10,\uB0A8\uC740\uB7C9:D<=b?Math.max(0,A):null}}),total:v,usePoints:g,last:L}},[e,p,b]);if(!a)return wo(Mn,{sx:er(c),children:[o?Dr(Mn,{sx:br,children:o}):null,Dr(Mr,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:c})]});if(a.empty)return wo(Mn,{sx:er(c),children:[o?Dr(Mn,{sx:br,children:o}):null,Dr(Mr,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]});let{data:r,total:t,usePoints:n,last:l}=a,i=n?"SP":"\uAC74";return wo(Mn,{sx:er(c),children:[wo(Mn,{sx:br,children:[o?Dr(Mn,{sx:{flexShrink:0},children:o}):null,wo(Mn,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[wo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),wo("span",{children:["\uD604\uC7AC"," ",Dr(Mn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:l}),i," \uB0A8\uC74C"]})]})]}),Dr(Mn,{sx:In(c),children:Dr(X4,{width:"100%",height:"100%",children:wo(G4,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Dr(K4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Dr(Z4,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Dr(J4,{tick:{fontSize:13},width:40,allowDecimals:!1}),Dr(Y4,{...fs,formatter:s=>`${Number(s??0)}${i}`}),Dr(Ph,{type:"linear",dataKey:"\uC774\uC0C1",stroke:Go,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Dr(Ph,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:za,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as Wh}from"react";import{Box as En}from"@mui/material";import{Area as Hc,AreaChart as o5,CartesianGrid as i5,Legend as s5,ResponsiveContainer as a5,Tooltip as l5,XAxis as c5,YAxis as u5}from"recharts";function ro(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function $a(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function Bj(e=new Date){return{fromDate:ro($a(1,e)),toDate:ro(e)}}var $c=864e5,hs=[0,1,2,3,5,8,13,21];function zh(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function qc(e){let p=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(p);if(!b)return null;let c=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(c)?null:c}function Ci(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function t5(e){let p=Ci(e.created_time)||Ci(e.start_date)||Ci(e.completed_time);if(!p)return null;let b=Ci(e.start_date),c=b&&b>p?b:p,o=e.completed?Ci(e.completed_time)||p:"";return{created:p,started:c,done:o}}function qh(e,p){let b=/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00`):new Date,c=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let a=c-1;a>=0;a-=1)o.push(ro(new Date(b.getTime()-a*$c)));return o}function $h(e,p,b){let c=qh(p,b),o=e.filter(zh).map(t5).filter(n=>n!==null),a=c.map(n=>{let l=0,i=0,s=0;for(let f of o)f.created>n||(f.done&&f.done<=n?l+=1:f.started<=n?i+=1:s+=1);return{day:n,done:l,inProgress:i,waiting:s}}),r=a[a.length-1],t=a.reduce((n,l)=>Math.max(n,l.done+l.inProgress+l.waiting),0);return{points:a,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function r5(e,p){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*p)-1));return e[b]}function Lh(e){if(e.length===0)return null;let p=[...e].sort((a,r)=>a-r),b=a=>Math.round(a*10)/10,c=Math.floor(p.length/2),o=p.length%2===1?p[c]:(p[c-1]+p[c])/2;return{count:p.length,median:b(o),average:b(p.reduce((a,r)=>a+r,0)/p.length),p85:b(r5(p,.85))}}function Fh(e){for(let p=hs.length-1;p>=0;p-=1)if(e>=hs[p])return p;return 0}function n5(){return hs.map((e,p)=>p===hs.length-1?`${e}\uC77C+`:`${e}~${hs[p+1]}\uC77C`)}function Hh(e,p,b){let c=qh(p,b),o=c[0],a=c[c.length-1],r=n5(),t=r.map(()=>0),n=r.map(()=>0),l=[],i=[];for(let s of e){if(!zh(s)||!s.completed)continue;let f=Ci(s.completed_time);if(!f||f<o||f>a)continue;let d=qc(s.completed_time),u=qc(s.created_time);if(d===null||u===null)continue;let g=Math.max(0,(d-u)/$c);l.push(g),t[Fh(g)]+=1;let m=qc(s.start_date);if(m===null||m>d)continue;let v=Math.max(0,(d-Math.max(m,u))/$c);i.push(v),n[Fh(v)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:Lh(l),cycle:Lh(i)}}import{jsx as Er,jsxs as _o}from"react/jsx-runtime";function f5(e){return e.slice(5).replace("-",".")}function Uh({tasks:e,todayStr:p,days:b=30,height:c=220,headerLeft:o}){let a=Wh(()=>$h(e,b,p),[e,b,p]),r=Wh(()=>a.points.map(n=>({\uB0A0\uC9DC:f5(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[a]),t=_o(En,{sx:br,children:[o?Er(En,{sx:{flexShrink:0},children:o}):null,_o(En,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[_o(En,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[_o("span",{children:["\uCD5C\uADFC ",a.points.length,"\uC77C \u2014 \uC811\uC218 ",a.currentTotal,"\uAC74 / \uC644\uB8CC ",a.currentDone,"\uAC74"]}),_o("span",{children:["\uC9C4\uD589 \uC911"," ",Er(En,{component:"span",sx:{color:to,fontWeight:700},children:a.currentWip}),"\uAC74"]})]}),Er(En,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||a.max===0?_o(En,{sx:er(c),children:[o?Er(En,{sx:br,children:o}):null,Er(Mr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]}):_o(En,{sx:er(c),children:[t,Er(En,{sx:In(c),children:Er(a5,{width:"100%",height:"100%",children:_o(o5,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Er(i5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Er(c5,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Er(u5,{tick:{fontSize:13},width:40,allowDecimals:!1}),Er(l5,{...fs,formatter:n=>`${Number(n??0)}\uAC74`}),Er(s5,{wrapperStyle:{fontSize:13.5,paddingTop:10}}),Er(Hc,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Fc,fill:Fc,fillOpacity:.9}),Er(Hc,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:to,fill:to,fillOpacity:.85}),Er(Hc,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:zc,fill:zc,fillOpacity:.9})]})})})]})}import{useMemo as Vh}from"react";import{Box as Pr}from"@mui/material";import{Bar as Kh,BarChart as d5,CartesianGrid as h5,Legend as p5,ResponsiveContainer as m5,Tooltip as g5,XAxis as b5,YAxis as y5}from"recharts";import{jsx as cr,jsxs as Zr}from"react/jsx-runtime";function Gh({label:e,color:p,summary:b}){let c=Zr(Pr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[cr(Pr,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),cr(Pr,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?Zr(Pr,{sx:{display:"contents"},children:[c,Zr("span",{children:[b.count,"\uAC74"]}),Zr("span",{children:["\uC911\uC559\uAC12"," ",cr(Pr,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),Zr("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),Zr("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):Zr(Pr,{sx:{display:"contents"},children:[c,cr(Pr,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Xh({tasks:e,todayStr:p,days:b=30,height:c=200,headerLeft:o}){let a=Vh(()=>Hh(e,b,p),[e,b,p]),r=Vh(()=>a.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:a.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:a.cycleCounts[n]})),[a]);return a.lead?Zr(Pr,{sx:er(c),children:[Zr(Pr,{sx:br,children:[o?cr(Pr,{sx:{flexShrink:0},children:o}):null,Zr(Pr,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:2,rowGap:.5,fontSize:14,color:"#000"},children:[cr(Gh,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:to,summary:a.lead}),cr(Gh,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:us,summary:a.cycle})]})]}),cr(Pr,{sx:In(c),children:cr(m5,{width:"100%",height:"100%",children:Zr(d5,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[cr(h5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),cr(b5,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),cr(y5,{tick:{fontSize:13},width:40,allowDecimals:!1}),cr(g5,{...Ti,formatter:t=>`${Number(t??0)}\uAC74`}),cr(p5,{wrapperStyle:{fontSize:13.5,paddingTop:10}}),cr(Kh,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:to,radius:[3,3,0,0]}),cr(Kh,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:us,radius:[3,3,0,0]})]})})})]}):Zr(Pr,{sx:er(c),children:[o?cr(Pr,{sx:br,children:o}):null,cr(Mr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]})}import{useMemo as ep}from"react";import{Box as Xo}from"@mui/material";import{Bar as Uc,BarChart as _5,CartesianGrid as k5,Cell as S5,Legend as T5,ReferenceLine as C5,ResponsiveContainer as B5,Tooltip as I5,XAxis as M5,YAxis as E5}from"recharts";function x5(e,p){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(p))return null;let b=new Date(`${e}T00:00:00`).getTime(),c=new Date(`${p}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(c)?null:Math.round((c-b)/864e5)}function v5(e,p,b){let c=String(e.due_date??"").slice(0,10),o=x5(p,c);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function Yh(e,p){let{todayStr:b,soonDays:c=7,includeUnassigned:o=!0,limit:a}=p,r=new Map;for(let n of e){if(n.completed||n.archived||n.is_notice||n.is_event||n.linked_only)continue;let l=Number(n.manager_account_seq??0);if(!l&&!o)continue;let i=l?String(n.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",s=r.get(l)??{accountSeq:l,name:i,overdue:0,soon:0,later:0,total:0,points:0};s[v5(n,b,c)]+=1,s.total+=1,s.points+=Number(n.story_points??0)||0,r.set(l,s)}let t=[...r.values()].sort((n,l)=>n.accountSeq===0!=(l.accountSeq===0)?n.accountSeq===0?1:-1:n.overdue!==l.overdue?l.overdue-n.overdue:n.total!==l.total?l.total-n.total:n.name.localeCompare(l.name));return typeof a=="number"&&a>0?t.slice(0,a):t}function Zh(e,p){return p>0&&e.total>=p}function Jh(e){let p=e.filter(b=>b.accountSeq>0);return p.length===0?0:p.reduce((b,c)=>b+c.total,0)/p.length}function Wc(e,p){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+p);let c=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${c(b.getMonth()+1)}-${c(b.getDate())}`}function w5(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Wc(e,-b)}function Qh(e,p){let{todayStr:b,includeUnassigned:c=!0,weeks:o=6,limit:a}=p,r=w5(b),t=Array.from({length:Math.max(1,o)},(d,u)=>{let g=Wc(r,u*7),m=Wc(g,6),[,v,k]=g.split("-");return{start:g,end:m,label:`${Number(v)}/${Number(k)}`,isCurrent:u===0}}),n=t[t.length-1].end,l=new Map;for(let d of e){if(d.completed||d.archived||d.is_notice||d.is_event||d.linked_only)continue;let u=Number(d.manager_account_seq??0);if(!u&&!c)continue;let g=u?String(d.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=l.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},v=String(d.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(v))m.noDue+=1;else if(v<b)m.overdue+=1;else if(v>n)m.beyond+=1;else{let k=t.findIndex(B=>v>=B.start&&v<=B.end);k>=0?m.byWeek[k]+=1:m.beyond+=1}l.set(u,m)}let i=[...l.values()].sort((d,u)=>d.accountSeq===0!=(u.accountSeq===0)?d.accountSeq===0?1:-1:d.overdue!==u.overdue?u.overdue-d.overdue:d.total!==u.total?u.total-d.total:d.name.localeCompare(u.name)),s=typeof a=="number"&&a>0?i.slice(0,a):i,f=s.reduce((d,u)=>Math.max(d,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:s,maxCell:f}}import{jsx as yr,jsxs as Bi}from"react/jsx-runtime";var tp="#e5484d";function rp({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:c=0,height:o=200,headerLeft:a}){let r=ep(()=>Yh(e,{todayStr:p,soonDays:b}),[e,p,b]),t=ep(()=>Jh(r),[r]),n=c>0?c:Math.max(3,Math.ceil(t*1.5)),l=r.filter(i=>i.accountSeq>0&&Zh(i,n)).length;return r.length===0?Bi(Xo,{sx:er(o),children:[a?yr(Xo,{sx:br,children:a}):null,yr(Mr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:o})]}):Bi(Xo,{sx:er(o),children:[Bi(Xo,{sx:br,children:[a,Bi(Xo,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",yr("b",{children:t.toFixed(1)}),"\uAC74 \xB7 \uACFC\uBD80\uD558 \uAE30\uC900 ",yr("b",{children:n}),"\uAC74",l>0?Bi(Xo,{component:"span",sx:{ml:1,color:tp,fontWeight:700},children:["\uCD08\uACFC ",l,"\uBA85"]}):null]})]}),yr(Xo,{sx:In(o),children:yr(B5,{width:"100%",height:"100%",children:Bi(_5,{data:r,layout:"vertical",margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:r.length>8?4:10,children:[yr(k5,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),yr(M5,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),yr(E5,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),yr(I5,{...Ti,formatter:(i,s)=>[`${Number(i)||0}\uAC74`,String(s)]}),yr(T5,{wrapperStyle:{fontSize:12}}),t>0?yr(C5,{x:t,stroke:Go,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:Go}}):null,yr(Uc,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:tp}),yr(Uc,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:us}),yr(Uc,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:to,radius:[0,3,3,0],children:r.map(i=>yr(S5,{},i.accountSeq))})]})})})]})}import{useMemo as R5}from"react";import{Box as zr,Tooltip as O5}from"@mui/material";import{OverlayScrollbar as A5}from"@ehfuse/overlay-scrollbar";import{jsx as Rr,jsxs as Wa}from"react/jsx-runtime";var np="#e5484d",D5="#2f80ed",P5="#9a9a97",Ua=30,N5=96,Ha=56;function Vc({count:e,max:p,color:b,title:c}){let o=e>0&&p>0?.18+e/p*.72:0;return Rr(O5,{title:c,arrow:!0,disableInteractive:!0,placement:"top",children:Rr(zr,{sx:{height:Ua,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function op({tasks:e,todayStr:p,weeks:b=6,height:c=200}){let o=R5(()=>Qh(e,{todayStr:p,weeks:b}),[e,p,b]);if(o.rows.length===0)return Rr(zr,{sx:er(c),children:Rr(Mr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})});let a=`${N5}px ${Ha}px repeat(${o.weeks.length}, ${Ha}px) ${Ha}px ${Ha}px`,r={height:Ua,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Rr(zr,{sx:er(c),children:Rr(A5,{style:{height:"100%"},thumb:{width:8},children:Wa(zr,{sx:{display:"grid",gridTemplateColumns:a,minWidth:"fit-content"},children:[Rr(zr,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Rr(zr,{sx:{...r,color:np},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Rr(zr,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Rr(zr,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Rr(zr,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>Wa(zr,{sx:{display:"contents"},children:[Rr(zr,{sx:{height:Ua,display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Rr(Vc,{count:t.overdue,max:o.maxCell,color:np,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,l)=>Rr(Vc,{count:n,max:o.maxCell,color:D5,title:`${t.name} \xB7 ${o.weeks[l].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[l].start)),Rr(Vc,{count:t.noDue,max:o.maxCell,color:P5,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),Wa(zr,{sx:{height:Ua,display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?Wa(zr,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{jsx as rr,jsxs as ip}from"react/jsx-runtime";var sp="min(560px, 62vh)",q5=`calc(${sp} - 4px)`,$5=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function kL({open:e,sprints:p,tasks:b,todayStr:c,initialSprintSeq:o=0,onClose:a}){let[r,t]=Kc(0),[n,l]=Kc(30);j5(()=>{if(!e)return;let v=p.find(B=>B.status==="active")??p[0],k=p.find(B=>B.seq===o)??v;t(k?.seq??0)},[e]);let i=L5(()=>p.find(v=>v.seq===r)??null,[p,r]),s={height:q5,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},f=rr(Gc,{label:"\uBAA9\uD45C",showLabel:!1,value:r?String(r):"",options:p.map(v=>({value:String(v.seq),label:Gr(v)})),onChange:v=>t(Number(v.target.value)||0),sx:{width:280,flexShrink:0}}),[d,u]=Kc("distribution"),g=rr(Gc,{label:"\uBCF4\uAE30",showLabel:!1,value:d,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:v=>u(v.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),m=rr(Gc,{label:"\uAE30\uAC04",showLabel:!1,value:String(n),options:$5,onChange:v=>l(Number(v.target.value)||30),sx:{width:280,flexShrink:0}});return rr(z5,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:sp,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:rr(no,{sx:s,children:rr(Dh,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:rr(no,{sx:s,children:i?rr(jh,{sprint:i,tasks:b,todayStr:c,height:"100%",headerLeft:f}):ip(no,{sx:er("100%"),children:[rr(no,{sx:br,children:f}),rr(Mr,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:rr(no,{sx:s,children:rr(Uh,{tasks:b,todayStr:c,days:n,height:"100%",headerLeft:m})})},{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:rr(no,{sx:s,children:d==="timeline"?ip(no,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[rr(no,{sx:br,children:g}),rr(op,{tasks:b,todayStr:c,height:"100%"})]}):rr(rp,{tasks:b,todayStr:c,height:"100%",headerLeft:g})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:rr(no,{sx:s,children:rr(Xh,{tasks:b,todayStr:c,days:n,height:"100%",headerLeft:m})})}],actions:{showCancelButton:!1,right:rr(F5,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}})}import{Checkbox as H5,Divider as W5,Menu as U5,MenuItem as Xc}from"@mui/material";import{jsx as ps,jsxs as ap}from"react/jsx-runtime";function IL({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:c,onToggle:o,onClear:a,onClose:r}){return ap(U5,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?ps(Xc,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):p.map(t=>{let n=b.includes(t.name);return ap(Xc,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[ps(H5,{size:"small",checked:n,sx:{p:0}}),ps(kr,{names:[t.name],size:20,avatarSrcByName:c}),t.name]},`${t.accountSeq}-${t.name}`)}),ps(W5,{}),ps(Xc,{disabled:b.length===0,onClick:a,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as V5}from"react";import{ButtonBase as K5,Menu as G5,MenuItem as X5}from"@mui/material";import Y5 from"@mui/icons-material/KeyboardArrowDown";import Z5 from"@mui/icons-material/Check";import{Fragment as J5,jsx as Yc,jsxs as Zc}from"react/jsx-runtime";function NL({value:e,onChange:p,options:b}){let[c,o]=V5(null),a=b??gl,r=gl.find(t=>t.value===e)?.label??"";return Zc(J5,{children:[Zc(K5,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,Yc(Y5,{sx:{fontSize:17,color:"#9a9a97"}})]}),Yc(G5,{transitionDuration:0,anchorEl:c,open:!!c,onClose:()=>o(null),children:a.map(t=>Zc(X5,{selected:t.value===e,onClick:()=>{p(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?Yc(Z5,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Jc,ButtonBase as Q5,Divider as e6,Popover as t6}from"@mui/material";import r6 from"@mui/icons-material/Check";import n6 from"@ehfuse/overlay-scrollbar";import{jsx as Yo,jsxs as cp}from"react/jsx-runtime";var lp=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function WL({anchorEl:e,value:p,color:b="",onSelect:c,onSelectColor:o,onClose:a}){return Yo(t6,{transitionDuration:0,open:!!e,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:cp(Jc,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[Yo(n6,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:Yo(Ys,{value:p||An,onChange:r=>{c(r),a()}})}),o?cp(Jc,{sx:{px:1.25,pb:1.25},children:[Yo(e6,{sx:{mb:1,borderColor:"#efefed"}}),Yo(Jc,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:lp.map(r=>{let t=(b||lp[0])===r;return Yo(Q5,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${r}`,onClick:()=>o(r),sx:{width:26,height:26,borderRadius:"50%",bgcolor:r,display:"flex",alignItems:"center",justifyContent:"center"},children:t?Yo(r6,{sx:{fontSize:15,color:"#ffffff"}}):null},r)})})]}):null]})})}import{Box as Va,ButtonBase as o6}from"@mui/material";import{DateTextField as up}from"@ehfuse/mui-form-controls";import{jsx as ms,jsxs as fp}from"react/jsx-runtime";var i6=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function dp({fromDate:e,toDate:p,onChange:b}){let c=a=>{if(a<=0){b("","");return}b(ro($a(a)),ro(new Date))},o=a=>a<=0?!e&&!p:!e||!p?!1:e===ro($a(a))&&p===ro(new Date);return fp(Va,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[ms(Va,{sx:{display:"flex",alignItems:"center",gap:1.5},children:i6.map(a=>{let r=o(a.months);return ms(o6,{onClick:()=>c(a.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:a.label},a.label)})}),fp(Va,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ms(up,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:a=>b(a.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),ms(Va,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),ms(up,{value:p,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:a=>b(e,a.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as s6}from"@mui/material";import{jsx as hp}from"react/jsx-runtime";function eF({anchorEl:e,fromDate:p,toDate:b,onChange:c,onClose:o}){return hp(s6,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:hp(dp,{fromDate:p,toDate:b,onChange:c})})}import{Box as a6,ButtonBase as l6,Tab as c6,Tabs as u6}from"@mui/material";import f6 from"@mui/icons-material/Checklist";import d6 from"@mui/icons-material/Face";import h6 from"@mui/icons-material/Publish";import p6 from"@mui/icons-material/NotificationsOutlined";import m6 from"@mui/icons-material/BugReportOutlined";import g6 from"@mui/icons-material/DescriptionOutlined";import b6 from"@mui/icons-material/Inventory2Outlined";import{jsx as dn}from"react/jsx-runtime";function pp(e,p){return p>0?`${e} (${p})`:e}var hF=[{id:"my",label:"\uC804\uCCB4",icon:dn(f6,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:dn(p6,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:dn(d6,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:dn(h6,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:dn(m6,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:dn(b6,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:dn(g6,{sx:{fontSize:18}}),hideCount:!0}];function y6(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function pF({items:e,activeTab:p,counts:b,onChange:c,compact:o=!1}){let a=nt(),r=y6(a.tabs),t=e;return o?dn(a6,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let l=p===n.id;return dn(l6,{onClick:()=>c(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:ur(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:l?a.tabs.selectedBg:a.tabs.bg,color:l?a.tabs.selectedColor:a.tabs.color,borderColor:l?a.tabs.selectedBg:a.tabs.borderColor},children:pp(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):dn(u6,{value:p,onChange:(n,l)=>c(l),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>dn(c6,{value:n.id,label:pp(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as x6,useMemo as v6,useState as Qc}from"react";import{Divider as eu,ListItemIcon as qr,Menu as tu,MenuItem as xr}from"@mui/material";import w6 from"@mui/icons-material/OpenInNewOutlined";import _6 from"@mui/icons-material/Check";import k6 from"@mui/icons-material/CheckCircleOutlined";import S6 from"@mui/icons-material/RadioButtonUnchecked";import T6 from"@mui/icons-material/SendOutlined";import C6 from"@mui/icons-material/EventOutlined";import B6 from"@mui/icons-material/PersonOutlineOutlined";import I6 from"@mui/icons-material/ViewKanbanOutlined";import M6 from"@mui/icons-material/ContentCopyOutlined";import E6 from"@mui/icons-material/NextPlanOutlined";import R6 from"@mui/icons-material/ContentPasteOutlined";import O6 from"@mui/icons-material/ShareOutlined";import A6 from"@mui/icons-material/DirectionsRunOutlined";import mp from"@mui/icons-material/ChevronRight";import D6 from"@mui/icons-material/ArchiveOutlined";import P6 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as N6}from"@ehfuse/alerts";import{Fragment as j6,jsx as ct,jsxs as fr}from"react/jsx-runtime";function WF({target:e,onClose:p,customTabs:b,sprints:c=[],myAccountSeq:o=0,onOpenDetail:a,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:l,onMemberEdit:i,onMoveProject:s,onDuplicate:f,onCreateFollowUp:d,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:v}){let k=Bt(),B=pn(),[A,L]=Qc(null),[O,D]=Qc(null),[j,z]=Qc(null);x6(()=>{e||(L(null),D(null),z(null))},[e]);let N=e?.task??null,S=!!N?.is_notice,C=!!N?.is_event,E=N?!Pn(N,o):!1,h=v6(()=>new Set(b.filter(x=>x.useSprints).map(x=>x.key)),[b]),y=async(x="one")=>{let _=N;if(p(),!_)return;await N6({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:x==="series"?`"${_.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${_.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&v(_.seq,x)},w=()=>{N&&m(N.seq,!N.archived),p()};return fr(j6,{children:[fr(tu,{open:!!e,onClose:p,transitionDuration:0,anchorReference:k?"none":"anchorPosition",anchorPosition:!k&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...k?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:k?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[fr(xr,{onClick:()=>{N&&a(N),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(w6,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),fr(xr,{disabled:S?(N?.author_account_seq??0)!==o:(N?.author_account_seq??0)!==o&&(N?.manager_account_seq??0)!==o,onClick:()=>{N&&r(N.seq,!N.completed),p()},sx:{fontSize:14},children:[ct(qr,{children:N?.completed?ct(S6,{sx:{fontSize:19}}):ct(k6,{sx:{fontSize:19}})}),N?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!S&&t?fr(xr,{disabled:!(N?.manager_account_seq??0)&&(N?.receiver_account_seqs??[]).length===0,onClick:()=>{N&&t(N),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(T6,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,C?null:ct(eu,{}),C?null:fr(xr,{disabled:E,onClick:x=>{N&&L({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(qr,{children:ct(C6,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!S&&!C&&i?fr(xr,{onClick:()=>{N&&i(N,"manager"),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(B6,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,C?null:fr(xr,{disabled:E,onClick:x=>{N&&D({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(qr,{children:ct(I6,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ct(mp,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ct(eu,{}),f?fr(xr,{disabled:E,onClick:()=>{N&&f(N.seq),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(M6,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,d&&N&&!N.is_event&&!N.is_notice?fr(xr,{onClick:()=>{N&&d(N.seq),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(E6,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,fr(xr,{onClick:()=>{N&&(u?u(N):_i(N,k)),p()},sx:{fontSize:14},children:[ct(qr,{children:k?ct(O6,{sx:{fontSize:19}}):ct(R6,{sx:{fontSize:19}})}),k?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),N&&!N.is_notice&&!N.is_event&&h.has(String(N.tab_key??""))&&g?fr(xr,{onClick:x=>z(x.currentTarget),sx:{fontSize:14},children:[ct(qr,{children:ct(A6,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ct(mp,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,fr(xr,{onClick:w,disabled:E||!N?.archived&&!(N&&Ns(N)),sx:{fontSize:14},children:[ct(qr,{children:N?.archived?ct(P6,{sx:{fontSize:19}}):ct(D6,{sx:{fontSize:19}})}),N?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ct(eu,{}),fr(xr,{disabled:E,onClick:()=>{y("one")},sx:{fontSize:14,color:"#e5484d"},children:[ct(qr,{children:ct(yn,{sx:{fontSize:19,color:"#e5484d"}})}),(N?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(N?.repeat_group_key??0)>0?fr(xr,{disabled:E,onClick:()=>{y("series")},sx:{fontSize:14,color:"#e5484d"},children:[ct(qr,{children:ct(yn,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]}),ct(Kr,{anchorEl:A?.anchorEl??null,open:!!A,date:A?.task.due_date??"",reminder:A?.task.reminder??"none",hideReminder:!!A?.task.completed,centered:k,onClose:()=>{L(null),p()},onDateChange:x=>{A&&n(A.task.seq,x)},onReminderChange:x=>{A&&l?.(A.task.seq,x)}}),fr(tu,{transitionDuration:0,anchorEl:O?.anchorEl??null,open:!!O,onClose:()=>{D(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...B,children:[ct(xr,{selected:!O?.task.tab_key,onClick:()=>{O&&s(O.task.seq,""),D(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(x=>!x.archived).map(x=>ct(xr,{selected:O?.task.tab_key===x.key,onClick:()=>{O&&s(O.task.seq,x.key),D(null),p()},sx:{fontSize:14,minWidth:170},children:x.label},x.key))]}),ct(tu,{transitionDuration:0,anchorEl:j,open:!!j,onClose:()=>z(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...c.filter(x=>`custom-${x.group_seq}`===String(N?.tab_key??"")).map(x=>({seq:x.seq,label:Gr(x)}))].map(x=>fr(xr,{onClick:()=>{N&&g?.(N.seq,x.seq),z(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[x.label,(N?.sprint_seq??0)===x.seq?ct(_6,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},x.seq))})]})}import{Checkbox as L6,Divider as F6,Menu as z6,MenuItem as gp}from"@mui/material";import{jsx as Ka,jsxs as bp}from"react/jsx-runtime";function XF({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:c,onClear:o,onClose:a}){return bp(z6,{transitionDuration:0,anchorEl:e,open:!!e,onClose:a,children:[p.map(r=>{let t=b.includes(r.key);return bp(gp,{onClick:()=>c(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Ka(L6,{size:"small",checked:t,sx:{p:0}}),Ka(Et,{option:r})]},r.key)}),Ka(F6,{}),Ka(gp,{disabled:b.length===0,onClick:()=>{o(),a()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as q6,Menu as $6,MenuItem as yp}from"@mui/material";import H6 from"@mui/icons-material/Check";import W6 from"@mui/icons-material/SettingsOutlined";import{jsx as ru,jsxs as nu}from"react/jsx-runtime";function rz(e){let{anchorEl:p,sprints:b,value:c,onSelect:o,onManage:a,onClose:r}=e;return nu($6,{transitionDuration:0,anchorEl:p,open:!!p,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:Gr(t)}))].map(t=>nu(yp,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,c===t.seq?ru(H6,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ru(q6,{}),nu(yp,{onClick:()=>{r(),a()},sx:{fontSize:14,gap:1},children:[ru(W6,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var U6={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function V6(e){return U6[e]??"tasks"}var iz={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},xp=["list","calendar","month","card","kanban","sprint","timeline"],K6=["list","card"];function sz(e){let p=V6(e);switch(p){case"notice":return{kind:p,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:p,viewOptions:xp,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:p,viewOptions:K6,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:p,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:p,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:p,viewOptions:xp,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as G6}from"react";import{useKeyboardState as X6}from"@ehfuse/keyboard-state";var vp=[{key:"g l",view:"list",label:"\uBAA9\uB85D \uBCF4\uAE30"},{key:"g b",view:"board",label:"\uD504\uB85C\uC81D\uD2B8 \uBCF4\uB4DC"},{key:"g k",view:"kanban",label:"\uC0C1\uD0DC \uBCF4\uAE30(\uCE78\uBC18)"},{key:"g c",view:"calendar",label:"\uC8FC\uAC04 \uCE98\uB9B0\uB354"},{key:"g m",view:"month",label:"\uC6D4\uAC04 \uCE98\uB9B0\uB354"},{key:"g t",view:"timeline",label:"\uD0C0\uC784\uB77C\uC778"}];function uz(e,p={}){let{enabled:b=!0}=p,{onCreateTask:c,onFocusSearch:o,onToggleHelp:a,onChangeView:r,onRefresh:t,onEscape:n}=e,l=G6(()=>{let i=[];if(c&&i.push({key:"n",callback:c,options:{preventDefault:!0}}),o&&i.push({key:"/",callback:o,options:{preventDefault:!0}}),t&&i.push({key:"r",callback:t,options:{preventDefault:!0}}),a&&i.push({key:"shift+?",callback:a,options:{preventDefault:!0}}),n&&i.push({key:"escape",callback:n,options:{allowInEditable:!0}}),r)for(let s of vp)i.push({key:s.key,callback:()=>r(s.view),options:{preventDefault:!0}});return i},[c,o,a,r,t,n]);X6(b?l:[])}var wp=[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...vp.map(e=>({keys:e.key.split(" ").map(p=>p.toUpperCase()).join(" \u2192 "),description:e.label})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}];import{Box as Ii,Button as Y6}from"@mui/material";import{FormDialog as Z6}from"@ehfuse/mui-form-dialog";import{jsx as ko,jsxs as _p}from"react/jsx-runtime";function J6({keys:e}){return ko(Ii,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>_p(Ii,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?ko(Ii,{component:"span",sx:{fontSize:12,color:"#9a9a97"},children:"\u2192"}):null,ko(Ii,{component:"span",sx:{minWidth:24,px:.75,py:.25,textAlign:"center",fontSize:12.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:p})]},`${p}-${b}`))})}function mz({open:e,onClose:p}){return ko(Z6,{open:e,onClose:p,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},sections:[{id:"shortcuts",showTitle:!1,children:ko(Ii,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1,alignItems:"center",fontSize:14,color:"#37352f"},children:wp.map(b=>_p(Ii,{sx:{display:"contents"},children:[ko(J6,{keys:b.keys}),ko("span",{children:b.description})]},b.keys))})}],actions:{showCancelButton:!1,right:ko(Y6,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}var Q6={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function e_(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function ou(e){let p=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(p)?`${p.slice(2,4)}.${p.slice(5,7)}.${p.slice(8,10)}`:"-"}function Mi(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function iu(e,p){let c=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=ou(e.due_date),a=String(e.start_date??"").slice(11,16).trim(),r=ou(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(l=>String(l).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(l=>l.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:or(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:e_(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&a?`${r} ${a}`:r,dueDate:o!=="-"&&c?`${o} ${c}`:o,priorityName:Q6[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Tt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function t_(e,p){if(e===" ")return p*.3;let b=e.codePointAt(0)??0,c=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return p*(c?1:.55)}function Ga(e,p){let b=0;for(let c of String(e??""))b+=t_(c,p);return b}function Ei(e,p){let b=String(e??"").trim();if(!b)return["-"];let c=[],o="";for(let a of b){if(a===`
41
+ `)}function th(e){navigator.clipboard.writeText(e).then(()=>p3("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>h3("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function _i(e,p){let b=m3(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(c=>{c?.name!=="AbortError"&&th(b)});return}th(b)}import{Fragment as _3,jsx as Nt,jsxs as rh}from"react/jsx-runtime";function nh({task:e,myAccountSeq:p=0,onToggleCompleted:b,onChangeTitle:c,onChangeIcon:o,onChangeIconColor:a,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:l,onLoadActivity:i,onPrint:s}){let f=Bt(),[d,u]=kc(!1),[g,m]=kc(null),[v,k]=kc(null),B=e.is_notice?bt(e.icon||Kt):null,A=!!e.is_notice,L=!!e.is_event,O=A&&p>0&&(e.author_account_seq??0)===p,D=!Pn(e,p),j=!L&&(A?O:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return rh(_3,{children:[rh(ki,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Nt(as,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Nt(b3,{})}):null,j&&!t?Nt(La,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${Lr(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Nt(ki,{sx:{display:"flex",flexShrink:0,mr:1.5},children:Nt(mn,{onClick:z=>k({anchorEl:z.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!B?null:Nt(ki,{sx:{display:"flex",px:.5,color:e.icon_color||(A?"#e5484d":"#1e3a8a")},children:Nt(B,{sx:{fontSize:20}})}),g!==null?Nt(ki,{component:"input",autoFocus:!0,spellCheck:!1,value:g,onChange:z=>m(z.target.value),onBlur:()=>{g.trim()&&g.trim()!==e.title&&c(e.seq,g.trim()),m(null)},onKeyDown:z=>{z.key==="Enter"&&z.target.blur(),z.key==="Escape"&&m(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Nt(ki,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A?"\uACF5\uC9C0":L?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Nt(ki,{onClick:D?void 0:()=>m(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:D?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?Nt(La,{title:"\uD65C\uB3D9",arrow:!0,children:Nt(as,{"aria-label":"\uD65C\uB3D9",onClick:()=>u(!0),sx:{color:"#6b7280"},children:Nt(v3,{sx:{fontSize:20}})})}):null,Nt(La,{title:f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Nt(as,{"aria-label":f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>_i(e,f),sx:{color:"#6b7280"},children:f?Nt(y3,{sx:{fontSize:20}}):Nt(x3,{sx:{fontSize:20}})})}),s?Nt(La,{title:"\uC778\uC1C4",arrow:!0,children:Nt(as,{"aria-label":"\uC778\uC1C4",onClick:()=>s(e),sx:{color:"#6b7280"},children:Nt(w3,{sx:{fontSize:20}})})}):null,r&&!t?Nt(as,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Nt(g3,{})}):null]}),Nt(It,{open:!!v,anchorEl:v?.anchorEl??null,title:v?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:v?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>k(null),onConfirm:()=>{v&&b(e.seq,v.nextCompleted),k(null)}}),Nt(ja,{open:d,taskSeq:e.seq,items:n,loading:l,onLoad:i,onClose:()=>u(!1)})]})}import{useState as cn}from"react";import{Box as qt,Button as Si,ButtonBase as O3,Checkbox as A3,Divider as Wo,Menu as Mc,MenuItem as Ec}from"@mui/material";import D3 from"@mui/icons-material/ExpandLess";import P3 from"@mui/icons-material/ExpandMore";import N3 from"@mui/icons-material/ConfirmationNumberOutlined";import ch from"@mui/icons-material/Check";import j3 from"@mui/icons-material/DirectionsRunOutlined";import L3 from"@mui/icons-material/SpeedOutlined";import Rc from"@mui/icons-material/CheckCircle";import F3 from"@mui/icons-material/CheckCircleOutlineOutlined";import Oc from"@mui/icons-material/CheckCircleOutlined";import uh from"@mui/icons-material/AccessTimeOutlined";import z3 from"@mui/icons-material/AutorenewOutlined";import q3 from"@mui/icons-material/LabelOutlined";import $3 from"@mui/icons-material/PersonOutlineOutlined";import H3 from"@mui/icons-material/SubjectOutlined";import W3 from"@mui/icons-material/StickyNote2Outlined";import U3 from"@mui/icons-material/PanToolAltOutlined";import fh from"@mui/icons-material/LockOutlined";import dh from"@mui/icons-material/PublicOutlined";import hh from"@mui/icons-material/Group";import V3 from"@mui/icons-material/Repeat";import K3 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as ph,InfoAlert as G3}from"@ehfuse/alerts";import{DatePicker as X3}from"@ehfuse/mui-datetime-picker";import{useState as k3}from"react";import{TextField as S3}from"@ehfuse/mui-form-controls";import{jsx as T3}from"react/jsx-runtime";function oh({value:e,onCommit:p,onDraftChange:b,readOnly:c=!1}){let[o,a]=k3(null);return T3(S3,{value:o??e,placeholder:c?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:c}},onChange:r=>{a(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&p(o),a(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&a(null)},sx:{mt:1}})}import{useMemo as Cc,useState as Bc}from"react";import{Box as gr,Button as ah,IconButton as C3}from"@mui/material";import B3 from"@mui/icons-material/AccountTreeOutlined";import I3 from"@mui/icons-material/Add";import M3 from"@mui/icons-material/Close";import E3 from"@mui/icons-material/NextPlanOutlined";function Ho(e){return e.relations??[]}function $D(e,p,b){return Ho(e).some(c=>c.type===b&&c.task_seq===p.seq)||Ho(p).some(c=>c.type===b&&c.task_seq===e.seq)}function ih(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Sc(e,p){let b=new Map(p.map(d=>[d.seq,d]));b.set(e.seq,e);let c=new Map,o=(d,u)=>{c.has(d)||c.set(d,new Set),c.has(u)||c.set(u,new Set),c.get(d).add(u),c.get(u).add(d)};for(let d of b.values())for(let u of Ho(d))u.type==="follow_up"&&b.has(u.task_seq)&&o(d.seq,u.task_seq);let a=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let d=r.shift();for(let u of c.get(d)??[])a.has(u)||(a.add(u),r.push(u))}let t=[...a].map(d=>b.get(d)).filter(d=>!!d).sort((d,u)=>ih(d).localeCompare(ih(u))),n=new Set;for(let d of Ho(e))d.type==="related"&&n.add(d.task_seq);for(let d of b.values())d.seq!==e.seq&&Ho(d).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(d.seq);let l=[...n].map(d=>b.get(d)).filter(d=>d!==void 0&&d.seq!==e.seq),i=[...b.values()].filter(d=>d.seq!==e.seq&&Ho(d).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),s=Ho(e).find(d=>d.type==="duplicate_of")?.task_seq,f=s?b.get(s)??null:null;return{lineage:t,related:l,duplicates:i,duplicateOf:f}}function Tc(e,p){let b=Sc(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function sh(e,p){return Tc(e,p)>0}import{Fragment as R3,jsx as zt,jsxs as ln}from"react/jsx-runtime";function Ic({item:e,caption:p,onOpen:b,onUnlink:c}){let o=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Kt:nr)):null;return ln(gr,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[p?zt(gr,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:p}):null,o?zt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,ln(gr,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),zt(Et,{option:or(e),small:!0}),c?zt(C3,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:c,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:zt(M3,{sx:{fontSize:15}})}):null]})}function lh({task:e,tasks:p,readOnly:b=!1,onOpenTask:c,onLink:o,onUnlink:a,onCreateFollowUp:r}){let[t,n]=Bc(!1),[l,i]=Bc(null),[s,f]=Bc(null),d=Cc(()=>Sc(e,p),[e,p]),u=d.lineage.length>=2,g=Cc(()=>Tc(e,p),[e,p]),m=Cc(()=>{let k=new Set;for(let B of d.lineage)k.add(B.seq);for(let B of d.related)k.add(B.seq);for(let B of d.duplicates)k.add(B.seq);return d.duplicateOf&&k.add(d.duplicateOf.seq),[...k]},[d]),v=(k,B,A)=>{f({anchorEl:k,targetSeq:B,type:A})};return ln(Yr,{icon:zt(B3,{sx:{fontSize:19,display:"block"}}),title:ln(R3,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?zt(gr,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:ln(gr,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?zt(ah,{size:"small",color:"inherit",startIcon:zt(E3,{sx:{fontSize:16}}),onClick:k=>i(k.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?zt(ah,{size:"small",color:"inherit",startIcon:zt(I3,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[ln(gr,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?zt(gr,{sx:{mb:d.related.length||d.duplicates.length||d.duplicateOf?1:0},children:d.lineage.map((k,B)=>{let A=k.seq===e.seq,L=B===d.lineage.length-1;return ln(gr,{sx:{display:"flex",gap:1},children:[ln(gr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[zt(gr,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":k.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),L?null:zt(gr,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),ln(gr,{sx:{flex:1,minWidth:0,pb:L?0:.5},children:[ln(gr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[ln(gr,{component:"span",onClick:!A&&c?()=>c(k.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":k.completed?"#9a9a97":"#37352f",textDecoration:k.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[k.ticket_no?`${k.ticket_no} `:"",k.title]}),zt(Et,{option:or(k),small:!0})]}),zt(gr,{sx:{fontSize:12,color:"#9a9a97"},children:k.completed&&k.completed_time?`${k.completed_time} \uC644\uB8CC`:k.created_time??""})]})]},k.seq)})}):null,d.duplicateOf?zt(Ic,{item:d.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:c?()=>c(d.duplicateOf.seq):void 0,onUnlink:!b&&a?k=>v(k.currentTarget,d.duplicateOf.seq,"duplicate_of"):void 0}):null,d.duplicates.map(k=>zt(Ic,{item:k,caption:"\uC911\uBCF5",onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&a?B=>v(B.currentTarget,k.seq,"duplicate_of"):void 0},`dup-${k.seq}`)),d.related.map(k=>zt(Ic,{item:k,onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&a?B=>v(B.currentTarget,k.seq,"related"):void 0},`rel-${k.seq}`)),g===0?zt(gr,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?zt(ka,{open:t,task:e,tasks:p,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(k,B)=>o(e.seq,k,B)}):null,zt(It,{open:!!l,anchorEl:l,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),zt(It,{open:!!s,anchorEl:s?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>f(null),onConfirm:()=>{s&&a?.(e.seq,s.targetSeq,s.type),f(null)}})]})}import{Fragment as Br,jsx as xe,jsxs as jt}from"react/jsx-runtime";function xo({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return xe(qt,{component:"span",sx:{color:"#9a9a97"},children:e})}function mh({task:e,customTabs:p,statusOptions:b,avatarSrcByName:c,onChangeStatus:o,onChangeLabels:a,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:l,onChangeReminder:i,onMemberEdit:s,onChangePriority:f,onChangeVisibility:d,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:v,onChangeEventAddress:k,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:L,contentLoading:O=!1,onChangeContentHeight:D,onAddChecklistItem:j,onToggleChecklistItem:z,onRemoveChecklistItem:N,onUpdateChecklistItem:S,onReorderChecklist:C,onConvertChecklistToTask:E,onOpenChecklistTask:h,onLinkChecklistTask:y,resolveChecklistTask:w,relatedTasksPool:x,onOpenRelatedTask:_,onLinkRelatedTask:T,onUnlinkRelatedTask:P,onCreateFollowUpTask:q,onAddAttachments:$,onRemoveAttachment:W,onPreview:R,onDownload:H,onUpdateComment:M,onRemoveComment:I,onToggleCommentReaction:F,currentUserName:U="",myAccountSeq:X=0,noticeAdmin:V=!1,hideProject:G=!1,hideLabel:te=!1,showTitle:Y=!1,onChangeTitle:K,onToggleCompleted:ee,onChangeIcon:Q,onChangeIconColor:oe,employees:se=[],onAckConfirm:ce,onRequestConfirm:ne,onChangeBugField:ae,sprints:be=[],sprintProject:ve=!1,hideSprint:Le=!1,onChangeSprint:Ie,onChangeStoryPoints:le,onChangeResolution:Pe,onClaimTask:Me,onVerifyBug:ke}){let[Oe,we]=cn(null),[ye,Ye]=cn(null),[Te,fe]=cn(null),[Re,_e]=cn(!1),Se={[nn]:Re?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[ot,je]=cn(null),[Ae,yt]=cn(null),[ze,Fe]=cn(null),[ft,Ve]=cn(null),[De,Dt]=cn(null),[Ue,re]=cn(null),[ue,de]=cn(null),me=!!e.is_notice,He=!!e.is_event,Be=!!e.is_bug,Ne=!!Me&&$s(e,X),dt=!!Me&&Hs(e,X),$e=!!ke&&Be&&!!e.completed&&X>0&&(e.author_account_seq??0)===X&&!(e.acks??[]).some(Z=>Z.account_seq===X),Ee=!Pn(e,X),ut=!e.is_event&&(e.is_notice?X>0&&(e.author_account_seq??0)===X:(e.author_account_seq??0)===X||(e.manager_account_seq??0)===X),rt=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Kt:nr)):null,et=me?!qs(e,X):Ee,mt=Ne||dt?jt(mn,{onClick:Z=>de(Z.currentTarget),children:[xe(U3,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Ot=me?Ra(e,se):"",ht=me?jd(e,se,X):null,_t=me?null:ta(e,X),Lt=!!(_t&&_t.total>0||me&&ht),Jt=!me,J=jt(Br,{children:[xe(at,{icon:xe($3,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Sn(9),Se??null,...He?[]:[Xt(1)]],children:e.created_by?jt(Br,{children:[xe(kr,{names:[e.created_by],size:20,avatarSrcByName:c}),e.created_by]}):xe(xo,{})}),xe(at,{icon:xe(uh,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Sn(11),Se??null,...He?[]:[Xt(2)]],children:e.created_time?Lr(e.created_time):xe(xo,{})})]});return jt(Br,{children:[Y?jt(qt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[ut?xe(A3,{checked:e.completed,icon:xe(F3,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:xe(Rc,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(Z,ge)=>{ye||Ye({anchorEl:Z.currentTarget,nextCompleted:ge})},sx:{p:0,mt:.25}}):null,rt?xe(qt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(me?"#e5484d":"#1e3a8a")},children:xe(rt,{sx:{fontSize:20}})}):null,xe(qt,{sx:{flex:1,minWidth:0},children:Oe!==null?xe(qt,{component:"input",autoFocus:!0,spellCheck:!1,value:Oe,onChange:Z=>we(Z.target.value),onBlur:()=>{Oe.trim()&&Oe.trim()!==e.title&&K(e.seq,Oe.trim()),we(null)},onKeyDown:Z=>{Z.key==="Enter"&&Z.target.blur(),Z.key==="Escape"&&we(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):xe(qt,{onClick:()=>we(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),xe(It,{open:!!ye,anchorEl:ye?.anchorEl??null,title:ye?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:ye?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Ye(null),onConfirm:()=>{ye&&ee(e.seq,ye.nextCompleted),Ye(null)}})]}):null,jt(qt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[nn]:{pb:0,"& > :last-child":{mb:0}}},children:[xe(va,{hideProject:G,pinColumns:!0,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:p,avatarSrcByName:c,hideDueDate:!He&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:me,event:He,readOnly:Ee,targetSummary:Ot,onChangeProject:Z=>t(e.seq,Z),onAddProject:n,onChangeStartDate:Z=>l(e.seq,"start_date",Z),onChangeDueDate:Z=>l(e.seq,"due_date",Z),onChangeReminder:Z=>i(e.seq,Z),onChangePriority:Z=>f(e.seq,Z),onChangeEventTime:Z=>m?.(e.seq,Z),onChangeEventPlace:Z=>v?.(e.seq,Z),onChangeEventAddress:Z=>k?.(e.seq,Z),onMemberEdit:Z=>s(e,Z,null),narrowCollapsedSx:Se,reminderLocked:e.completed,managerAction:mt,leading:jt(Br,{children:[$e||mt&&(me||He)?jt(qt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[me||He?mt:null,$e?jt(Br,{children:[xe(Si,{variant:"contained",size:"large",onClick:()=>ke?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),xe(Si,{variant:"outlined",size:"large",color:"error",onClick:()=>ke?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,Be&&e.ticket_no?xe(at,{icon:xe(N3,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:Xt(1),children:xe(qt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,He?null:xe(qt,{sx:Be&&e.ticket_no||Jt||Lt?Xt(Be&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:xe(at,{icon:xe(z3,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:Ee||e.completed?void 0:Z=>je(Z),children:xe(Et,{option:or(e)})})}),me?null:(()=>{let Z=Qr(e),ge=Z==="all"?xe(dh,{sx:{fontSize:17,color:"#2f80ed"}}):Z==="group"?xe(hh,{sx:{fontSize:17,color:"#d9730d"}}):xe(fh,{sx:{fontSize:17}}),he=Z==="all"?"\uC804\uCCB4\uACF5\uAC1C":Z==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(ie=>ie.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return xe(qt,{sx:He?void 0:Xt(Be?1:2),children:xe(at,{icon:ge,label:"\uACF5\uAC1C",onClick:Ee||!d?void 0:ie=>yt(ie),children:he})})})(),!me&&!Be?xe(qt,{sx:He?void 0:Xt(1),children:xe(at,{icon:xe(V3,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:Ee||!u?void 0:Z=>Fe(Z),children:e.repeat_rule?ma(e.repeat_rule):xe(xo,{label:"\uC5C6\uC74C"})})}):null,!me&&!Be&&e.repeat_rule?xe(qt,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(K3,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:Ee||!u?void 0:Z=>Ve(Z),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:xe(xo,{})})}):null,_t&&_t.total>0?xe(qt,{sx:He?void 0:Xt(2),children:xe(at,{icon:xe(Oc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:_t.canConfirm?xe(Si,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):jt(Si,{size:"small",variant:"outlined",color:"inherit",startIcon:_t.myTime?xe(Rc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[_t.count," / ",_t.total]})})}):null,me&&ht?xe(qt,{sx:Xt(2),children:xe(at,{icon:xe(Oc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:xe(qt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ht.canAck?xe(Si,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):xe(Si,{size:"small",variant:"outlined",color:"inherit",startIcon:ht.acked?xe(Rc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Z=>fe({anchorEl:Z.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ht.total>0&&ht.count>=ht.total?"\uC644\uB8CC":jt(Br,{children:[ht.count,xe(qt,{component:"span",sx:{mx:.4},children:"/"}),ht.total]})})})})}):null,ve&&!Le&&!He&&!me?jt(Br,{children:[xe(at,{icon:xe(j3,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:Ee?void 0:Z=>Dt(Z),sx:Xt(1),children:(e.sprint_seq??0)>0?be.find(Z=>Z.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":xe(xo,{label:"\uBBF8\uBC30\uC815"})}),xe(at,{icon:xe(L3,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:Xt(2),children:xe(Yn,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:Ee,onCommit:Z=>le?.(e.seq,Number(Z.replace(/[^0-9.]/g,""))||0)})})]}):null,He||te?null:xe(qt,{sx:[{gridColumn:"1 / -1"},Se??null],children:xe(at,{icon:xe(q3,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:Ee?void 0:Z=>re(Z),children:(e.label_keys??[]).length>0?xe(co,{labelKeys:e.label_keys??[],labelOptions:b}):xe(xo,{})})}),He?null:J]}),trailing:jt(Br,{children:[Be?xe(wa,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:Ee,showResolution:!!e.completed,onChangeRepro:Z=>ae?.(e.seq,"bug_repro",Z),onChangeDevice:Z=>ae?.(e.seq,"bug_device",Z),onChangeWhere:Z=>ae?.(e.seq,"bug_where",Z),onChangeVersion:Z=>ae?.(e.seq,"bug_version",Z),onChangeResolution:Z=>Pe?.(e.seq,Z)}):null,He?J:null,e.completed?jt(Br,{children:[xe(at,{icon:xe(Oc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Sn(10),Se??null,...He?[]:[Xt(1)]],children:e.completed_by?jt(Br,{children:[xe(kr,{names:[e.completed_by],size:20,avatarSrcByName:c}),e.completed_by]}):xe(xo,{})}),xe(at,{icon:xe(uh,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Sn(12),Se??null,...He?[]:[Xt(2)]],children:e.completed_time?Lr(e.completed_time):xe(xo,{})})]}):null]})}),jt(qt,{sx:{display:"none",[nn]:{display:"block",mt:1.5,mb:0}},children:[xe(Wo,{sx:{borderColor:"#e6e6e3"}}),xe(O3,{onClick:()=>_e(Z=>!Z),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:Re?jt(Br,{children:["\uC811\uAE30 ",xe(D3,{sx:{fontSize:18}})]}):jt(Br,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",xe(P3,{sx:{fontSize:18}})]})})]}),jt(qt,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3",[nn]:{mt:0,mb:1.25}}}),xe(Yr,{icon:xe(H3,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:xe(qt,{sx:{userSelect:"text"},children:O?xe(qt,{sx:{minHeight:e.content_height||180,borderRadius:1,border:"1px solid #e6e6e3",bgcolor:"#fafaf9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,color:"#9a9a97"},children:"\uB0B4\uC6A9\uC744 \uBD88\uB7EC\uC624\uB294 \uC911\u2026"}):xe(_a,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:D?Z=>D(e.seq,Z):void 0,readOnly:Ee,onChange:Z=>L(e.seq,Z)})})}),e.is_bug?null:jt(Br,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Yr,{icon:xe(W3,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:xe(qt,{sx:{userSelect:"text"},children:xe(oh,{value:e.note,readOnly:et,onCommit:Z=>B(e.seq,Z),onDraftChange:A?Z=>A(e.seq,Z):void 0})})})]}),He?null:jt(Br,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Sa,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:et,onAdd:j,onToggle:z,onRemove:N,onUpdate:S,onReorder:C,onConvertToTask:E,onOpenLinkedTask:h,resolveLinkedTask:w,myAccountSeq:X,linkCandidates:x,linkBaseTask:e,onLinkExistingTask:y})]}),x&&!He&&!me&&sh(e,x)?jt(Br,{children:[xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(lh,{task:e,tasks:x,readOnly:Ee,onOpenTask:_,onLink:T,onUnlink:P,onCreateFollowUp:q})]}):null,xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Ia,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:et,onAdd:$,onRemove:W,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(Wo,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Zd,{taskSeq:e.seq,comments:e.comments??[],currentUserName:U,myAccountSeq:X,avatarSrcByName:c,onUpdate:M,onRemove:I,onToggleReaction:F,onPreview:R?Z=>R({...Z,taskSeq:e.seq}):void 0,onDownload:H?Z=>H({...Z,taskSeq:e.seq}):void 0})]}),xe(oi,{anchorEl:ot,value:e.status,options:me?qi:Be?Mo:$i,onSelect:Z=>o(e.seq,Z),onClose:()=>je(null)}),xe(Mc,{transitionDuration:0,anchorEl:ze,open:!!ze,onClose:()=>Fe(null),children:[{value:"",label:"\uC5C6\uC74C"},...es].map(Z=>xe(Ec,{selected:(e.repeat_rule??"")===Z.value,onClick:()=>{Fe(null),(async()=>{let ge=e.repeat_rule??"";if(Z.value===ge)return;if(Z.value===""){await ph({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let he=String(e.due_date??"").slice(0,10);if(!he){G3(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}ge&&!await ph({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,Z.value,ga(he,Z.value))})()},sx:{fontSize:14,minWidth:140},children:Z.label},Z.value||"none"))}),xe(X3,{anchorEl:ft,open:!!ft,onClose:()=>Ve(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:Z=>{Ve(null);let ge=pe=>String(pe).padStart(2,"0"),he=`${Z.getFullYear()}-${ge(Z.getMonth()+1)}-${ge(Z.getDate())}`,ie=e.repeat_rule??"";ie&&u?.(e.seq,ie,he)}}),xe(Mc,{transitionDuration:0,anchorEl:Ae,open:!!Ae,onClose:()=>yt(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:xe(fh,{sx:{fontSize:17,color:"#57564f"}}),selected:Qr(e)==="involved",onPick:()=>d?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:xe(dh,{sx:{fontSize:17,color:"#2f80ed"}}),selected:Qr(e)==="all",onPick:()=>d?.(e.seq,"all",0)},...g.map(Z=>({key:`group-${Z.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${Z.name}`,icon:xe(hh,{sx:{fontSize:17,color:"#d9730d"}}),selected:Qr(e)==="group"&&(e.visibility_group_seq??0)===Z.seq,onPick:()=>d?.(e.seq,"group",Z.seq)}))].map(Z=>jt(Ec,{selected:Z.selected,onClick:()=>{Z.onPick(),yt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.icon,Z.label,Z.selected?xe(ch,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.key))}),xe(Mc,{transitionDuration:0,anchorEl:De,open:!!De,onClose:()=>Dt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...be.filter(Z=>`custom-${Z.group_seq}`===String(e.tab_key??"")).map(Z=>({seq:Z.seq,label:Gr(Z)}))].map(Z=>jt(Ec,{onClick:()=>{Ie?.(e.seq,Z.seq),Dt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Z.label,(e.sprint_seq??0)===Z.seq?xe(ch,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.seq))}),xe(ea,{anchorEl:Te?.anchorEl??null,open:!!Te?.open,acks:e.acks??[],total:ht?.total??_t?.total??0,pendingNames:ht?.pendingNames??_t?.pendingNames??[],avatarSrcByName:c,onRequestConfirm:ne&&(ht?ht.count<ht.total:_t&&_t.count<_t.total)?()=>{ne(e.seq),fe(Z=>Z?{...Z,open:!1}:null)}:void 0,onClose:()=>fe(Z=>Z?{...Z,open:!1}:null)}),xe(Ea,{anchorEl:Ue,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:Z=>a(e.seq,Fs(e.label_keys??[],Z)),onAddLabel:r,onClose:()=>re(null)}),xe(It,{open:!!ue,anchorEl:ue,title:Ne?"\uC774 \uC5C5\uBB34\uB97C \uAC00\uC838\uC640 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC774 \uC5C5\uBB34\uC758 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>de(null),onConfirm:()=>{Me?.(e.seq),de(null)}})]})}import{Fragment as r4,jsx as Ir,jsxs as wh}from"react/jsx-runtime";function vN(){let e=new Date,p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function wN({open:e,task:p,onClose:b,onAddComment:c,onSaveFields:o,presentation:a="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,activityItems:s,activityLoading:f,onLoadActivity:d,onPrint:u,...g}){let m=Bt(),v=bh(null);p&&(v.current=p);let k=p??v.current,[B,A]=yh(!1),[L,O]=yh({}),D=Object.keys(L).length>0;gh(()=>{O({})},[p?.seq,e]);let j=bh(null);if(gh(()=>{j.current?.scrollTo({top:0})},[p?.seq]),!k)return null;let z=m&&D?{...k,...L}:k,N=z.checklist??[],S=(x,_)=>{m?O(T=>({...T,...x})):_()},C=()=>{let x=L;O({});let _=k.seq,T=x.title===void 0?void 0:String(x.title).trim();if(o){let P={...x};T!==void 0&&(T?P.title=T:delete P.title),Object.keys(P).length>0&&o(_,P),vh({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}T&&n(_,T),x.icon!==void 0&&l(_,String(x.icon)),x.icon_color!==void 0&&i?.(_,String(x.icon_color)),x.status!==void 0&&g.onChangeStatus(_,x.status),x.label_keys!==void 0&&g.onChangeLabels(_,x.label_keys??[]),x.tab_key!==void 0&&g.onChangeProject(_,String(x.tab_key??"")),x.start_date!==void 0&&g.onChangeDate(_,"start_date",String(x.start_date??"")),x.due_date!==void 0&&g.onChangeDate(_,"due_date",String(x.due_date??"")),x.reminder!==void 0&&g.onChangeReminder(_,x.reminder),x.priority!==void 0&&g.onChangePriority(_,x.priority),x.event_time!==void 0&&g.onChangeEventTime?.(_,String(x.event_time??"")),x.event_place!==void 0&&g.onChangeEventPlace?.(_,String(x.event_place??"")),x.event_address!==void 0&&g.onChangeEventAddress?.(_,String(x.event_address??"")),x.content!==void 0&&g.onChangeContent(_,String(x.content??"")),x.note!==void 0&&g.onChangeNote(_,String(x.note??"")),x.visibility!==void 0&&g.onChangeVisibility?.(_,x.visibility,Number(x.visibility_group_seq??0)),vh({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},E={...g,onChangeStatus:(x,_)=>S({status:_},()=>g.onChangeStatus(x,_)),onChangeLabels:(x,_)=>S({label_keys:_},()=>g.onChangeLabels(x,_)),onChangeProject:(x,_)=>S({tab_key:_},()=>g.onChangeProject(x,_)),onChangeDate:(x,_,T)=>S({[_]:T},()=>g.onChangeDate(x,_,T)),onChangeReminder:(x,_)=>S({reminder:_},()=>g.onChangeReminder(x,_)),onChangePriority:(x,_)=>S({priority:_},()=>g.onChangePriority(x,_)),onChangeEventTime:(x,_)=>S({event_time:_},()=>g.onChangeEventTime?.(x,_)),onChangeEventPlace:(x,_)=>S({event_place:_},()=>g.onChangeEventPlace?.(x,_)),onChangeEventAddress:(x,_)=>S({event_address:_},()=>g.onChangeEventAddress?.(x,_)),onChangeContent:(x,_)=>S({content:_},()=>g.onChangeContent(x,_)),onChangeNote:(x,_)=>S({note:_},()=>g.onChangeNote(x,_)),onMemberEdit:(x,_)=>g.onMemberEdit(x,_,m?T=>O(P=>({...P,...T})):null),onChangeNoteDraft:m?(x,_)=>S({note:_},()=>{}):void 0,onChangeVisibility:g.onChangeVisibility?(x,_,T)=>S({visibility:_,visibility_group_seq:T},()=>g.onChangeVisibility?.(x,_,T)):void 0,onAddChecklistItem:(x,_)=>S({checklist:[...N,{label:_,checked:!1}]},()=>g.onAddChecklistItem(x,_)),onToggleChecklistItem:(x,_,T)=>S({checklist:N.map((P,q)=>q===_?{...P,checked:T}:P)},()=>g.onToggleChecklistItem(x,_,T)),onRemoveChecklistItem:(x,_)=>S({checklist:N.filter((T,P)=>P!==_)},()=>g.onRemoveChecklistItem(x,_)),onUpdateChecklistItem:g.onUpdateChecklistItem?(x,_,T)=>S({checklist:N.map((P,q)=>q===_?{...P,label:T}:P)},()=>g.onUpdateChecklistItem?.(x,_,T)):void 0,onReorderChecklist:g.onReorderChecklist?(x,_)=>S({checklist:_},()=>g.onReorderChecklist?.(x,_)):void 0,onLinkChecklistTask:g.onLinkChecklistTask?(x,_,T)=>S({checklist:[...N,{label:T,checked:!1,task_seq:_}]},()=>g.onLinkChecklistTask?.(x,_,T)):void 0},h=Ir(mh,{...E,task:z,myAccountSeq:r,onChangeTitle:(x,_)=>S({title:_},()=>n(x,_)),onToggleCompleted:t,onChangeIcon:(x,_)=>S({icon:_},()=>l(x,_)),onChangeIconColor:(x,_)=>S({icon_color:_},()=>i?.(x,_)),showTitle:m}),y=Ir(Jd,{onSubmit:(x,_)=>c(z.seq,x,_)},z.seq);return m||a==="dialog"?wh(r4,{children:[Ir(t4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:z.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":z.is_event?"\uC77C\uC815":z.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...d?[{icon:Ir(Q3,{sx:{ml:2,color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>A(!0)}]:[],{icon:Ir(J3,{sx:{ml:d?0:2,color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>_i(z,!0)},{icon:Ir(Y3,{variant:"contained",size:"small",disableElevation:!0,disabled:!D,onClick:D?C:void 0,sx:{ml:1,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:""}]},fullScreen:m,maxWidth:m?void 0:"md",width:m?void 0:720,mobilePresentation:m?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:y},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:Ir(Fa,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:h})}]},k.seq),Ir(ja,{open:B,taskSeq:z.seq,items:s,loading:f,onLoad:d,onClose:()=>A(!1)})]}):Ir(Z3,{anchor:"right",open:e,onClose:b,disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:x=>x.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:wh(Fa,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[Ir(nh,{task:z,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:i,onClose:b,activityItems:s,activityLoading:f,onLoadActivity:d,onPrint:u}),Ir(xh,{sx:{borderColor:"#e6e6e3"}}),Ir(Fa,{sx:{flex:1,minHeight:0},children:Ir(e4,{ref:j,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:h})}),Ir(xh,{sx:{borderColor:"#37352f"}}),Ir(Fa,{sx:{flexShrink:0},children:y})]})})}import{useEffect as o4,useState as Uo}from"react";import{Box as Ar,Button as Pc,IconButton as _h}from"@mui/material";import{FormDialog as i4}from"@ehfuse/mui-form-dialog";import s4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as kh}from"@ehfuse/alerts";import{ClearTextField as Sh,DateTextField as Th,LabelSelect as Ch}from"@ehfuse/mui-form-controls";var Ac="custom-";function n4(e){return e.startsWith(Ac)}function SN(e){return e>0?`${Ac}${e}`:""}function Dc(e){if(!n4(e))return 0;let p=Number(e.slice(Ac.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as l4,jsx as Yt,jsxs as vo}from"react/jsx-runtime";var a4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function Bh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function DN({open:e,customTabs:p,sprints:b,onClose:c,onCreate:o,onUpdate:a,onChangeStatus:r,onRemove:t}){let n=p.filter(C=>C.useSprints&&!C.archived),[l,i]=Uo(""),[s,f]=Uo(""),[d,u]=Uo(""),[g,m]=Uo(""),[v,k]=Uo(""),[B,A]=Uo(!1),[L,O]=Uo(0);o4(()=>{e&&(i(n.length===1?n[0].key:""),f(""),u(""),m(""),k(""),O(0))},[e]);let D=()=>{f(""),u(""),m(""),k(""),O(0)},j=C=>{O(C.seq),i(`custom-${C.group_seq}`),f(C.name),u(C.goal),m(C.start_date),k(C.end_date)},z=async()=>{let C=Dc(l);if(!C){kh("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!s.trim()){kh("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}A(!0);try{if(L>0){a(L,{name:s.trim(),goal:d.trim(),start_date:g,end_date:v}),D();return}await o({group_seq:C,name:s.trim(),goal:d.trim(),start_date:g,end_date:v})&&D()}finally{A(!1)}},N=new Map(p.map(C=>[Dc(C.key),C.label])),S=Yt(Ar,{children:n.length===0?Yt(Ar,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):vo(l4,{children:[vo(Ar,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Yt(Ch,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:l,options:n.map(C=>({value:C.key,label:C.label})),onChange:C=>i(String(C.target.value)),disabled:L>0}),Yt(Sh,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:s,onChange:C=>f(C.target.value)}),Yt(Th,{size:"medium",label:"\uC2DC\uC791\uC77C",value:g,onChange:C=>m(C.target.value)}),Yt(Th,{size:"medium",label:"\uC885\uB8CC\uC77C",value:v,onChange:C=>k(C.target.value)}),Yt(Sh,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:d,onChange:C=>u(C.target.value),sx:{gridColumn:"1 / -1"}})]}),vo(Ar,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[L>0?Yt(Pc,{color:"inherit",onClick:D,disabled:B,children:"\uCDE8\uC18C"}):null,Yt(Pc,{variant:"contained",onClick:()=>{z()},disabled:B,children:L>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),Yt(Ar,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:b.length===0?Yt(Ar,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(C=>vo(Ar,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[vo(Ar,{sx:{minWidth:0},children:[vo(Ar,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Yt(Ar,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:C.name}),Yt(Ar,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:N.get(C.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),vo(Ar,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Bh(C.start_date)," ~ ",Bh(C.end_date)]})]}),C.goal?Yt(Ar,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:C.goal}):null]}),vo(Ar,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Yt(Ch,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:C.status,options:a4.map(E=>({value:E.value,label:E.label})),onChange:E=>r(C.seq,String(E.target.value)),sx:{width:104,flexShrink:0}}),Yt(_h,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>j(C),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Yt(s4,{sx:{fontSize:18}})}),Yt(_h,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>t(C.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Yt(yn,{style:{width:16,height:16}})})]})]},C.seq))})]})});return Yt(i4,{open:e,onClose:c,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],actions:{showCancelButton:!1,right:Yt(Pc,{variant:"contained",onClick:c,children:"\uB2EB\uAE30"})}})}import{useState as Ih}from"react";import{Box as lr,Button as Nc,Divider as c4,IconButton as u4,TextField as f4}from"@mui/material";import{FormDialog as d4}from"@ehfuse/mui-form-dialog";import h4 from"@mui/icons-material/OpenInNewOutlined";import p4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as m4}from"@ehfuse/alerts";import{jsx as Rt,jsxs as Vo}from"react/jsx-runtime";function WN({open:e,imports:p,onRegister:b,onRemove:c,onClose:o}){let[a,r]=Ih(""),[t,n]=Ih(!1),l=async()=>{let f=a.trim();if(f){n(!0);try{await b(f)&&r("")}finally{n(!1)}}},i=async f=>{await m4({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&c(f.seq)},s=Vo(lr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Vo(lr,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",Rt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",Rt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",Rt("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),Rt(lr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?Rt(lr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((f,d)=>Vo(lr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:d>0?"1px solid #efefed":"none"},children:[Rt(p4,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),Rt(lr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),Rt(u4,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{i(f)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Rt(yn,{sx:{fontSize:18}})})]},f.seq))}):Rt(lr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),Rt(c4,{sx:{my:1,borderColor:"#e6e6e3"}}),Rt(lr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),Vo(lr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Rt(lr,{children:Vo(lr,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",Rt("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),Rt(lr,{children:Vo(lr,{component:"span",children:[Rt("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",Rt("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Rt(lr,{children:Rt(lr,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),Rt(lr,{children:Rt(lr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})})]}),Vo(lr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[Rt(f4,{value:a,onChange:f=>r(f.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),Rt(Nc,{variant:"contained",disabled:!a.trim()||t,onClick:()=>{l()},sx:{flexShrink:0},children:t?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return Rt(d4,{open:e,onClose:o,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:s}],actions:{showCancelButton:!1,left:Rt(Nc,{variant:"outlined",startIcon:Rt(h4,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Rt(Nc,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}import{Box as eo,Button as ls,TextField as g4}from"@mui/material";import{FormDialog as b4}from"@ehfuse/mui-form-dialog";import y4 from"@mui/icons-material/ContentCopyOutlined";import Mh from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as Eh}from"@ehfuse/alerts";import{Fragment as v4,jsx as Zt,jsxs as Ko}from"react/jsx-runtime";function x4(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function JN({open:e,feed:p,feedTaskCount:b,buildFeedUrl:c,onSubscribe:o,onClose:a}){let r=c??x4,t=p.subscribed?r(p.token):"",n=()=>{navigator.clipboard.writeText(t).then(()=>Eh("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Eh("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},l=()=>{let s=t.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(s)}`,"_blank")},i=Ko(eo,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ko(eo,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Zt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?Ko(eo,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",Zt("br",{}),Zt("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",p.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):p.subscribed&&p.enabled?Ko(v4,{children:[Zt(g4,{value:t,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),Ko(eo,{sx:{display:"flex",gap:2},children:[Zt(ls,{variant:"outlined",startIcon:Zt(y4,{}),onClick:n,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Zt(ls,{variant:"contained",startIcon:Zt(Mh,{}),onClick:l,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),Ko(eo,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Zt(eo,{children:Ko("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Zt("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Zt(eo,{children:Zt("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),Zt(eo,{children:Zt("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),Zt(eo,{children:Zt("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):Zt(ls,{variant:"contained",onClick:o,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Zt(b4,{open:e,onClose:a,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:i}],actions:{showCancelButton:!1,left:Zt(ls,{variant:"outlined",startIcon:Zt(Mh,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Zt(ls,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}})}import{useEffect as w4,useMemo as jc,useState as Lc}from"react";import{Box as cs,Button as _4,Typography as k4}from"@mui/material";import{FormDialog as S4}from"@ehfuse/mui-form-dialog";import{SearchTextField as T4}from"@ehfuse/mui-form-controls";import{TreeView as C4}from"@ehfuse/tree-view";import{Fragment as O4,jsx as un,jsxs as A4}from"react/jsx-runtime";function Rh(e){return`${e.name}#${e.seq}`}function B4(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function I4(e){let p=[],b=c=>{for(let o of c.employees??[])p.push(o);for(let o of c.groups??[])b(o)};for(let c of e)b(c);return p}function M4(e,p){return p?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(p)):!0}function E4(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:Rh(e),renderLabel:un(cs,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:un(cs,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function Oh(e,p){let b=(e.groups??[]).map(o=>Oh(o,p)).filter(o=>o!==null),c=(e.employees??[]).filter(o=>M4(o,p)).map(E4);return b.length===0&&c.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...c]}}function R4({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:c,isMobile:o,onSelectionChange:a}){let[r,t]=Lc(""),n=jc(()=>e.map(i=>Oh(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),l=jc(()=>p.filter(i=>b.includes(i.seq)).map(Rh),[]);return A4(O4,{children:[un(cs,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:un(T4,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),un(cs,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:un(C4,{items:n,checkbox:!0,multiSelect:c,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:l,onChange:i=>a(i.map(B4).filter(s=>s>0)),styles:{border:"none",borderRadius:"0"}})})]})}function aj({open:e,title:p="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:c,multiple:o=!1,selectedSeqs:a,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let l=Bt(),[i,s]=Lc([]),[f,d]=Lc(0),u=jc(()=>I4(c),[c]),g=a??[];w4(()=>{e&&(s(g),d(v=>v+1))},[e]);let m=()=>{let v=u.filter(k=>i.includes(k.seq));t(o?v:v.slice(0,1)),n()};return un(S4,{open:e,onClose:n,title:`${p}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:l,mobilePresentation:l?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:un(cs,{sx:{...l?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...l?{}:{overflow:"hidden"},userSelect:"none"},children:un(R4,{groups:c,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:l,onSelectionChange:s},f)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?un(k4,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:un(_4,{variant:"contained",onClick:m,children:r})}})}import{useEffect as j5,useMemo as L5,useState as Kc}from"react";import{Box as no,Button as F5}from"@mui/material";import{FormDialog as z5}from"@ehfuse/mui-form-dialog";import{LabelSelect as Gc}from"@ehfuse/mui-form-controls";import{Box as qa}from"@mui/material";import{Bar as N4,BarChart as j4,CartesianGrid as L4,Cell as F4,ReferenceLine as z4,ResponsiveContainer as q4,Tooltip as $4,XAxis as H4,YAxis as W4}from"recharts";import{Box as D4}from"@mui/material";import{jsx as P4}from"react/jsx-runtime";function Mr({text:e,height:p}){return P4(D4,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof p=="number"?{height:p,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}var za="#2f80ed",Ah="#a9c9f5",Go="#9a9a97",Fc="#2e9e6b",to="#3d7eff",zc="#c3c8ce",us="#f2a30f",fs={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},Ti={...fs,cursor:!1};function er(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var br={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function In(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as fn,jsxs as ds}from"react/jsx-runtime";function U4(e,p){let b=p.filter(c=>c.sprint_seq===e.seq&&!c.archived&&c.completed);return{points:b.reduce((c,o)=>c+(o.story_points??0),0),count:b.length}}function Dh({sprints:e,tasks:p,height:b=200}){let o=[...e].sort((i,s)=>`${i.start_date}|${i.seq}`.localeCompare(`${s.start_date}|${s.seq}`)).map(i=>({sprint:i,...U4(i,p)})),a=o.some(i=>i.points>0),r=a?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>a?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,s)=>i+s,0)/t.length*10)/10:null,l=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:a?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?fn(Mr,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):ds(qa,{sx:er(b),children:[ds(qa,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[ds("span",{children:["\uC644\uB8CC ",a?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?ds("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",fn(qa,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),fn(qa,{sx:In(b),children:fn(q4,{width:"100%",height:"100%",children:ds(j4,{data:l,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[fn(L4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),fn(H4,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),fn(W4,{tick:{fontSize:13},width:40,allowDecimals:!1}),fn($4,{...Ti,formatter:i=>`${Number(i??0)}${r}`}),n!==null?fn(z4,{y:n,stroke:Go,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,fn(N4,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:l.map(i=>fn(F4,{fill:i.closed?za:Ah},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as V4}from"react";import{Box as Mn}from"@mui/material";import{CartesianGrid as K4,Line as Ph,LineChart as G4,ResponsiveContainer as X4,Tooltip as Y4,XAxis as Z4,YAxis as J4}from"recharts";import{jsx as Dr,jsxs as wo}from"react/jsx-runtime";function Nh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function Q4(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function e5(e){return e.slice(5).replace("-",".")}function jh({sprint:e,tasks:p,todayStr:b,height:c=200,headerLeft:o}){let a=V4(()=>{let s=Nh(e.start_date),f=Nh(e.end_date);if(!s||!f||f<s||Math.round((f.getTime()-s.getTime())/864e5)+1>366)return null;let u=p.filter(D=>D.sprint_seq===e.seq&&!D.archived);if(u.length===0)return{empty:!0};let g=u.some(D=>(D.story_points??0)>0),m=D=>g?D.story_points??0:1,v=u.reduce((D,j)=>D+m(j),0),k=new Map;for(let D of u){if(!D.completed)continue;let j=(D.completed_time??"").slice(0,10),z=/^\d{4}-\d{2}-\d{2}$/.test(j)?j:e.start_date;k.set(z,(k.get(z)??0)+m(D))}let B=[];for(let D=new Date(s);D<=f;D.setDate(D.getDate()+1))B.push(Q4(D));let A=v,L=v;return{empty:!1,data:B.map((D,j)=>{let z=B.length===1?0:v*(1-j/(B.length-1));return D<=b&&(A-=k.get(D)??0,L=Math.max(0,A)),{\uB0A0\uC9DC:e5(D),\uC774\uC0C1:Math.round(z*10)/10,\uB0A8\uC740\uB7C9:D<=b?Math.max(0,A):null}}),total:v,usePoints:g,last:L}},[e,p,b]);if(!a)return wo(Mn,{sx:er(c),children:[o?Dr(Mn,{sx:br,children:o}):null,Dr(Mr,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:c})]});if(a.empty)return wo(Mn,{sx:er(c),children:[o?Dr(Mn,{sx:br,children:o}):null,Dr(Mr,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]});let{data:r,total:t,usePoints:n,last:l}=a,i=n?"SP":"\uAC74";return wo(Mn,{sx:er(c),children:[wo(Mn,{sx:br,children:[o?Dr(Mn,{sx:{flexShrink:0},children:o}):null,wo(Mn,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[wo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),wo("span",{children:["\uD604\uC7AC"," ",Dr(Mn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:l}),i," \uB0A8\uC74C"]})]})]}),Dr(Mn,{sx:In(c),children:Dr(X4,{width:"100%",height:"100%",children:wo(G4,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[Dr(K4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Dr(Z4,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Dr(J4,{tick:{fontSize:13},width:40,allowDecimals:!1}),Dr(Y4,{...fs,formatter:s=>`${Number(s??0)}${i}`}),Dr(Ph,{type:"linear",dataKey:"\uC774\uC0C1",stroke:Go,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),Dr(Ph,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:za,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as Wh}from"react";import{Box as En}from"@mui/material";import{Area as Hc,AreaChart as o5,CartesianGrid as i5,Legend as s5,ResponsiveContainer as a5,Tooltip as l5,XAxis as c5,YAxis as u5}from"recharts";function ro(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function $a(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function Bj(e=new Date){return{fromDate:ro($a(1,e)),toDate:ro(e)}}var $c=864e5,hs=[0,1,2,3,5,8,13,21];function zh(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function qc(e){let p=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(p);if(!b)return null;let c=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(c)?null:c}function Ci(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function t5(e){let p=Ci(e.created_time)||Ci(e.start_date)||Ci(e.completed_time);if(!p)return null;let b=Ci(e.start_date),c=b&&b>p?b:p,o=e.completed?Ci(e.completed_time)||p:"";return{created:p,started:c,done:o}}function qh(e,p){let b=/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00`):new Date,c=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let a=c-1;a>=0;a-=1)o.push(ro(new Date(b.getTime()-a*$c)));return o}function $h(e,p,b){let c=qh(p,b),o=e.filter(zh).map(t5).filter(n=>n!==null),a=c.map(n=>{let l=0,i=0,s=0;for(let f of o)f.created>n||(f.done&&f.done<=n?l+=1:f.started<=n?i+=1:s+=1);return{day:n,done:l,inProgress:i,waiting:s}}),r=a[a.length-1],t=a.reduce((n,l)=>Math.max(n,l.done+l.inProgress+l.waiting),0);return{points:a,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function r5(e,p){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*p)-1));return e[b]}function Lh(e){if(e.length===0)return null;let p=[...e].sort((a,r)=>a-r),b=a=>Math.round(a*10)/10,c=Math.floor(p.length/2),o=p.length%2===1?p[c]:(p[c-1]+p[c])/2;return{count:p.length,median:b(o),average:b(p.reduce((a,r)=>a+r,0)/p.length),p85:b(r5(p,.85))}}function Fh(e){for(let p=hs.length-1;p>=0;p-=1)if(e>=hs[p])return p;return 0}function n5(){return hs.map((e,p)=>p===hs.length-1?`${e}\uC77C+`:`${e}~${hs[p+1]}\uC77C`)}function Hh(e,p,b){let c=qh(p,b),o=c[0],a=c[c.length-1],r=n5(),t=r.map(()=>0),n=r.map(()=>0),l=[],i=[];for(let s of e){if(!zh(s)||!s.completed)continue;let f=Ci(s.completed_time);if(!f||f<o||f>a)continue;let d=qc(s.completed_time),u=qc(s.created_time);if(d===null||u===null)continue;let g=Math.max(0,(d-u)/$c);l.push(g),t[Fh(g)]+=1;let m=qc(s.start_date);if(m===null||m>d)continue;let v=Math.max(0,(d-Math.max(m,u))/$c);i.push(v),n[Fh(v)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:Lh(l),cycle:Lh(i)}}import{jsx as Er,jsxs as _o}from"react/jsx-runtime";function f5(e){return e.slice(5).replace("-",".")}function Uh({tasks:e,todayStr:p,days:b=30,height:c=220,headerLeft:o}){let a=Wh(()=>$h(e,b,p),[e,b,p]),r=Wh(()=>a.points.map(n=>({\uB0A0\uC9DC:f5(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[a]),t=_o(En,{sx:br,children:[o?Er(En,{sx:{flexShrink:0},children:o}):null,_o(En,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[_o(En,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[_o("span",{children:["\uCD5C\uADFC ",a.points.length,"\uC77C \u2014 \uC811\uC218 ",a.currentTotal,"\uAC74 / \uC644\uB8CC ",a.currentDone,"\uAC74"]}),_o("span",{children:["\uC9C4\uD589 \uC911"," ",Er(En,{component:"span",sx:{color:to,fontWeight:700},children:a.currentWip}),"\uAC74"]})]}),Er(En,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||a.max===0?_o(En,{sx:er(c),children:[o?Er(En,{sx:br,children:o}):null,Er(Mr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]}):_o(En,{sx:er(c),children:[t,Er(En,{sx:In(c),children:Er(a5,{width:"100%",height:"100%",children:_o(o5,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Er(i5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Er(c5,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Er(u5,{tick:{fontSize:13},width:40,allowDecimals:!1}),Er(l5,{...fs,formatter:n=>`${Number(n??0)}\uAC74`}),Er(s5,{wrapperStyle:{fontSize:13.5,paddingTop:10}}),Er(Hc,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Fc,fill:Fc,fillOpacity:.9}),Er(Hc,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:to,fill:to,fillOpacity:.85}),Er(Hc,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:zc,fill:zc,fillOpacity:.9})]})})})]})}import{useMemo as Vh}from"react";import{Box as Pr}from"@mui/material";import{Bar as Kh,BarChart as d5,CartesianGrid as h5,Legend as p5,ResponsiveContainer as m5,Tooltip as g5,XAxis as b5,YAxis as y5}from"recharts";import{jsx as cr,jsxs as Zr}from"react/jsx-runtime";function Gh({label:e,color:p,summary:b}){let c=Zr(Pr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[cr(Pr,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),cr(Pr,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?Zr(Pr,{sx:{display:"contents"},children:[c,Zr("span",{children:[b.count,"\uAC74"]}),Zr("span",{children:["\uC911\uC559\uAC12"," ",cr(Pr,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),Zr("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),Zr("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):Zr(Pr,{sx:{display:"contents"},children:[c,cr(Pr,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Xh({tasks:e,todayStr:p,days:b=30,height:c=200,headerLeft:o}){let a=Vh(()=>Hh(e,b,p),[e,b,p]),r=Vh(()=>a.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:a.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:a.cycleCounts[n]})),[a]);return a.lead?Zr(Pr,{sx:er(c),children:[Zr(Pr,{sx:br,children:[o?cr(Pr,{sx:{flexShrink:0},children:o}):null,Zr(Pr,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:2,rowGap:.5,fontSize:14,color:"#000"},children:[cr(Gh,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:to,summary:a.lead}),cr(Gh,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:us,summary:a.cycle})]})]}),cr(Pr,{sx:In(c),children:cr(m5,{width:"100%",height:"100%",children:Zr(d5,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[cr(h5,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),cr(b5,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),cr(y5,{tick:{fontSize:13},width:40,allowDecimals:!1}),cr(g5,{...Ti,formatter:t=>`${Number(t??0)}\uAC74`}),cr(p5,{wrapperStyle:{fontSize:13.5,paddingTop:10}}),cr(Kh,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:to,radius:[3,3,0,0]}),cr(Kh,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:us,radius:[3,3,0,0]})]})})})]}):Zr(Pr,{sx:er(c),children:[o?cr(Pr,{sx:br,children:o}):null,cr(Mr,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})]})}import{useMemo as ep}from"react";import{Box as Xo}from"@mui/material";import{Bar as Uc,BarChart as _5,CartesianGrid as k5,Cell as S5,Legend as T5,ReferenceLine as C5,ResponsiveContainer as B5,Tooltip as I5,XAxis as M5,YAxis as E5}from"recharts";function x5(e,p){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(p))return null;let b=new Date(`${e}T00:00:00`).getTime(),c=new Date(`${p}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(c)?null:Math.round((c-b)/864e5)}function v5(e,p,b){let c=String(e.due_date??"").slice(0,10),o=x5(p,c);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function Yh(e,p){let{todayStr:b,soonDays:c=7,includeUnassigned:o=!0,limit:a}=p,r=new Map;for(let n of e){if(n.completed||n.archived||n.is_notice||n.is_event||n.linked_only)continue;let l=Number(n.manager_account_seq??0);if(!l&&!o)continue;let i=l?String(n.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",s=r.get(l)??{accountSeq:l,name:i,overdue:0,soon:0,later:0,total:0,points:0};s[v5(n,b,c)]+=1,s.total+=1,s.points+=Number(n.story_points??0)||0,r.set(l,s)}let t=[...r.values()].sort((n,l)=>n.accountSeq===0!=(l.accountSeq===0)?n.accountSeq===0?1:-1:n.overdue!==l.overdue?l.overdue-n.overdue:n.total!==l.total?l.total-n.total:n.name.localeCompare(l.name));return typeof a=="number"&&a>0?t.slice(0,a):t}function Zh(e,p){return p>0&&e.total>=p}function Jh(e){let p=e.filter(b=>b.accountSeq>0);return p.length===0?0:p.reduce((b,c)=>b+c.total,0)/p.length}function Wc(e,p){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+p);let c=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${c(b.getMonth()+1)}-${c(b.getDate())}`}function w5(e){let p=new Date(`${e}T00:00:00`);if(Number.isNaN(p.getTime()))return e;let b=(p.getDay()+6)%7;return Wc(e,-b)}function Qh(e,p){let{todayStr:b,includeUnassigned:c=!0,weeks:o=6,limit:a}=p,r=w5(b),t=Array.from({length:Math.max(1,o)},(d,u)=>{let g=Wc(r,u*7),m=Wc(g,6),[,v,k]=g.split("-");return{start:g,end:m,label:`${Number(v)}/${Number(k)}`,isCurrent:u===0}}),n=t[t.length-1].end,l=new Map;for(let d of e){if(d.completed||d.archived||d.is_notice||d.is_event||d.linked_only)continue;let u=Number(d.manager_account_seq??0);if(!u&&!c)continue;let g=u?String(d.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=l.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},v=String(d.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(v))m.noDue+=1;else if(v<b)m.overdue+=1;else if(v>n)m.beyond+=1;else{let k=t.findIndex(B=>v>=B.start&&v<=B.end);k>=0?m.byWeek[k]+=1:m.beyond+=1}l.set(u,m)}let i=[...l.values()].sort((d,u)=>d.accountSeq===0!=(u.accountSeq===0)?d.accountSeq===0?1:-1:d.overdue!==u.overdue?u.overdue-d.overdue:d.total!==u.total?u.total-d.total:d.name.localeCompare(u.name)),s=typeof a=="number"&&a>0?i.slice(0,a):i,f=s.reduce((d,u)=>Math.max(d,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:s,maxCell:f}}import{jsx as yr,jsxs as Bi}from"react/jsx-runtime";var tp="#e5484d";function rp({tasks:e,todayStr:p,soonDays:b=7,overloadThreshold:c=0,height:o=200,headerLeft:a}){let r=ep(()=>Yh(e,{todayStr:p,soonDays:b}),[e,p,b]),t=ep(()=>Jh(r),[r]),n=c>0?c:Math.max(3,Math.ceil(t*1.5)),l=r.filter(i=>i.accountSeq>0&&Zh(i,n)).length;return r.length===0?Bi(Xo,{sx:er(o),children:[a?yr(Xo,{sx:br,children:a}):null,yr(Mr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:o})]}):Bi(Xo,{sx:er(o),children:[Bi(Xo,{sx:br,children:[a,Bi(Xo,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",yr("b",{children:t.toFixed(1)}),"\uAC74 \xB7 \uACFC\uBD80\uD558 \uAE30\uC900 ",yr("b",{children:n}),"\uAC74",l>0?Bi(Xo,{component:"span",sx:{ml:1,color:tp,fontWeight:700},children:["\uCD08\uACFC ",l,"\uBA85"]}):null]})]}),yr(Xo,{sx:In(o),children:yr(B5,{width:"100%",height:"100%",children:Bi(_5,{data:r,layout:"vertical",margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:r.length>8?4:10,children:[yr(k5,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),yr(M5,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),yr(E5,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),yr(I5,{...Ti,formatter:(i,s)=>[`${Number(i)||0}\uAC74`,String(s)]}),yr(T5,{wrapperStyle:{fontSize:12}}),t>0?yr(C5,{x:t,stroke:Go,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:Go}}):null,yr(Uc,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:tp}),yr(Uc,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:us}),yr(Uc,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:to,radius:[0,3,3,0],children:r.map(i=>yr(S5,{},i.accountSeq))})]})})})]})}import{useMemo as R5}from"react";import{Box as zr,Tooltip as O5}from"@mui/material";import{OverlayScrollbar as A5}from"@ehfuse/overlay-scrollbar";import{jsx as Rr,jsxs as Wa}from"react/jsx-runtime";var np="#e5484d",D5="#2f80ed",P5="#9a9a97",Ua=30,N5=96,Ha=56;function Vc({count:e,max:p,color:b,title:c}){let o=e>0&&p>0?.18+e/p*.72:0;return Rr(O5,{title:c,arrow:!0,disableInteractive:!0,placement:"top",children:Rr(zr,{sx:{height:Ua,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function op({tasks:e,todayStr:p,weeks:b=6,height:c=200}){let o=R5(()=>Qh(e,{todayStr:p,weeks:b}),[e,p,b]);if(o.rows.length===0)return Rr(zr,{sx:er(c),children:Rr(Mr,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:c})});let a=`${N5}px ${Ha}px repeat(${o.weeks.length}, ${Ha}px) ${Ha}px ${Ha}px`,r={height:Ua,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Rr(zr,{sx:er(c),children:Rr(A5,{style:{height:"100%"},thumb:{width:8},children:Wa(zr,{sx:{display:"grid",gridTemplateColumns:a,minWidth:"fit-content"},children:[Rr(zr,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Rr(zr,{sx:{...r,color:np},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Rr(zr,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Rr(zr,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Rr(zr,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>Wa(zr,{sx:{display:"contents"},children:[Rr(zr,{sx:{height:Ua,display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Rr(Vc,{count:t.overdue,max:o.maxCell,color:np,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,l)=>Rr(Vc,{count:n,max:o.maxCell,color:D5,title:`${t.name} \xB7 ${o.weeks[l].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[l].start)),Rr(Vc,{count:t.noDue,max:o.maxCell,color:P5,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),Wa(zr,{sx:{height:Ua,display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?Wa(zr,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{jsx as rr,jsxs as ip}from"react/jsx-runtime";var sp="min(560px, 62vh)",q5=`calc(${sp} - 4px)`,$5=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function kL({open:e,sprints:p,tasks:b,todayStr:c,showSprintCharts:o,initialSprintSeq:a=0,onClose:r}){let[t,n]=Kc(0),[l,i]=Kc(30);j5(()=>{if(!e)return;let B=p.find(L=>L.status==="active")??p[0],A=p.find(L=>L.seq===a)??B;n(A?.seq??0)},[e]);let s=L5(()=>p.find(B=>B.seq===t)??null,[p,t]),f={height:q5,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},d=rr(Gc,{label:"\uBAA9\uD45C",showLabel:!1,value:t?String(t):"",options:p.map(B=>({value:String(B.seq),label:Gr(B)})),onChange:B=>n(Number(B.target.value)||0),sx:{width:280,flexShrink:0}}),[u,g]=Kc("distribution"),m=rr(Gc,{label:"\uBCF4\uAE30",showLabel:!1,value:u,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:B=>g(B.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),v=o??p.length>0,k=rr(Gc,{label:"\uAE30\uAC04",showLabel:!1,value:String(l),options:$5,onChange:B=>i(Number(B.target.value)||30),sx:{width:280,flexShrink:0}});return rr(z5,{open:e,onClose:r,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:sp,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...v?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:rr(no,{sx:f,children:rr(Dh,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:rr(no,{sx:f,children:s?rr(jh,{sprint:s,tasks:b,todayStr:c,height:"100%",headerLeft:d}):ip(no,{sx:er("100%"),children:[rr(no,{sx:br,children:d}),rr(Mr,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:rr(no,{sx:f,children:rr(Uh,{tasks:b,todayStr:c,days:l,height:"100%",headerLeft:k})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:rr(no,{sx:f,children:u==="timeline"?ip(no,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[rr(no,{sx:br,children:m}),rr(op,{tasks:b,todayStr:c,height:"100%"})]}):rr(rp,{tasks:b,todayStr:c,height:"100%",headerLeft:m})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:rr(no,{sx:f,children:rr(Xh,{tasks:b,todayStr:c,days:l,height:"100%",headerLeft:k})})}],actions:{showCancelButton:!1,right:rr(F5,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Checkbox as H5,Divider as W5,Menu as U5,MenuItem as Xc}from"@mui/material";import{jsx as ps,jsxs as ap}from"react/jsx-runtime";function IL({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:c,onToggle:o,onClear:a,onClose:r}){return ap(U5,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?ps(Xc,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):p.map(t=>{let n=b.includes(t.name);return ap(Xc,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[ps(H5,{size:"small",checked:n,sx:{p:0}}),ps(kr,{names:[t.name],size:20,avatarSrcByName:c}),t.name]},`${t.accountSeq}-${t.name}`)}),ps(W5,{}),ps(Xc,{disabled:b.length===0,onClick:a,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as V5}from"react";import{ButtonBase as K5,Menu as G5,MenuItem as X5}from"@mui/material";import Y5 from"@mui/icons-material/KeyboardArrowDown";import Z5 from"@mui/icons-material/Check";import{Fragment as J5,jsx as Yc,jsxs as Zc}from"react/jsx-runtime";function NL({value:e,onChange:p,options:b}){let[c,o]=V5(null),a=b??gl,r=gl.find(t=>t.value===e)?.label??"";return Zc(J5,{children:[Zc(K5,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,Yc(Y5,{sx:{fontSize:17,color:"#9a9a97"}})]}),Yc(G5,{transitionDuration:0,anchorEl:c,open:!!c,onClose:()=>o(null),children:a.map(t=>Zc(X5,{selected:t.value===e,onClick:()=>{p(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?Yc(Z5,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Jc,ButtonBase as Q5,Divider as e6,Popover as t6}from"@mui/material";import r6 from"@mui/icons-material/Check";import n6 from"@ehfuse/overlay-scrollbar";import{jsx as Yo,jsxs as cp}from"react/jsx-runtime";var lp=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function WL({anchorEl:e,value:p,color:b="",onSelect:c,onSelectColor:o,onClose:a}){return Yo(t6,{transitionDuration:0,open:!!e,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:cp(Jc,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[Yo(n6,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:Yo(Ys,{value:p||An,onChange:r=>{c(r),a()}})}),o?cp(Jc,{sx:{px:1.25,pb:1.25},children:[Yo(e6,{sx:{mb:1,borderColor:"#efefed"}}),Yo(Jc,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:lp.map(r=>{let t=(b||lp[0])===r;return Yo(Q5,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${r}`,onClick:()=>o(r),sx:{width:26,height:26,borderRadius:"50%",bgcolor:r,display:"flex",alignItems:"center",justifyContent:"center"},children:t?Yo(r6,{sx:{fontSize:15,color:"#ffffff"}}):null},r)})})]}):null]})})}import{Box as Va,ButtonBase as o6}from"@mui/material";import{DateTextField as up}from"@ehfuse/mui-form-controls";import{jsx as ms,jsxs as fp}from"react/jsx-runtime";var i6=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function dp({fromDate:e,toDate:p,onChange:b}){let c=a=>{if(a<=0){b("","");return}b(ro($a(a)),ro(new Date))},o=a=>a<=0?!e&&!p:!e||!p?!1:e===ro($a(a))&&p===ro(new Date);return fp(Va,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[ms(Va,{sx:{display:"flex",alignItems:"center",gap:1.5},children:i6.map(a=>{let r=o(a.months);return ms(o6,{onClick:()=>c(a.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:a.label},a.label)})}),fp(Va,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ms(up,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:a=>b(a.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),ms(Va,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),ms(up,{value:p,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:a=>b(e,a.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as s6}from"@mui/material";import{jsx as hp}from"react/jsx-runtime";function eF({anchorEl:e,fromDate:p,toDate:b,onChange:c,onClose:o}){return hp(s6,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:hp(dp,{fromDate:p,toDate:b,onChange:c})})}import{Box as a6,ButtonBase as l6,Tab as c6,Tabs as u6}from"@mui/material";import f6 from"@mui/icons-material/Checklist";import d6 from"@mui/icons-material/Face";import h6 from"@mui/icons-material/Publish";import p6 from"@mui/icons-material/NotificationsOutlined";import m6 from"@mui/icons-material/BugReportOutlined";import g6 from"@mui/icons-material/DescriptionOutlined";import b6 from"@mui/icons-material/Inventory2Outlined";import{jsx as dn}from"react/jsx-runtime";function pp(e,p){return p>0?`${e} (${p})`:e}var hF=[{id:"my",label:"\uC804\uCCB4",icon:dn(f6,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:dn(p6,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:dn(d6,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:dn(h6,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:dn(m6,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:dn(b6,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:dn(g6,{sx:{fontSize:18}}),hideCount:!0}];function y6(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function pF({items:e,activeTab:p,counts:b,onChange:c,compact:o=!1}){let a=nt(),r=y6(a.tabs),t=e;return o?dn(a6,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let l=p===n.id;return dn(l6,{onClick:()=>c(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:ur(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:l?a.tabs.selectedBg:a.tabs.bg,color:l?a.tabs.selectedColor:a.tabs.color,borderColor:l?a.tabs.selectedBg:a.tabs.borderColor},children:pp(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):dn(u6,{value:p,onChange:(n,l)=>c(l),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>dn(c6,{value:n.id,label:pp(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as x6,useMemo as v6,useState as Qc}from"react";import{Divider as eu,ListItemIcon as qr,Menu as tu,MenuItem as xr}from"@mui/material";import w6 from"@mui/icons-material/OpenInNewOutlined";import _6 from"@mui/icons-material/Check";import k6 from"@mui/icons-material/CheckCircleOutlined";import S6 from"@mui/icons-material/RadioButtonUnchecked";import T6 from"@mui/icons-material/SendOutlined";import C6 from"@mui/icons-material/EventOutlined";import B6 from"@mui/icons-material/PersonOutlineOutlined";import I6 from"@mui/icons-material/ViewKanbanOutlined";import M6 from"@mui/icons-material/ContentCopyOutlined";import E6 from"@mui/icons-material/NextPlanOutlined";import R6 from"@mui/icons-material/ContentPasteOutlined";import O6 from"@mui/icons-material/ShareOutlined";import A6 from"@mui/icons-material/DirectionsRunOutlined";import mp from"@mui/icons-material/ChevronRight";import D6 from"@mui/icons-material/ArchiveOutlined";import P6 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as N6}from"@ehfuse/alerts";import{Fragment as j6,jsx as ct,jsxs as fr}from"react/jsx-runtime";function WF({target:e,onClose:p,customTabs:b,sprints:c=[],myAccountSeq:o=0,onOpenDetail:a,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:l,onMemberEdit:i,onMoveProject:s,onDuplicate:f,onCreateFollowUp:d,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:v}){let k=Bt(),B=pn(),[A,L]=Qc(null),[O,D]=Qc(null),[j,z]=Qc(null);x6(()=>{e||(L(null),D(null),z(null))},[e]);let N=e?.task??null,S=!!N?.is_notice,C=!!N?.is_event,E=N?!Pn(N,o):!1,h=v6(()=>new Set(b.filter(x=>x.useSprints).map(x=>x.key)),[b]),y=async(x="one")=>{let _=N;if(p(),!_)return;await N6({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:x==="series"?`"${_.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${_.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&v(_.seq,x)},w=()=>{N&&m(N.seq,!N.archived),p()};return fr(j6,{children:[fr(tu,{open:!!e,onClose:p,transitionDuration:0,anchorReference:k?"none":"anchorPosition",anchorPosition:!k&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...k?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:k?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[fr(xr,{onClick:()=>{N&&a(N),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(w6,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),fr(xr,{disabled:S?(N?.author_account_seq??0)!==o:(N?.author_account_seq??0)!==o&&(N?.manager_account_seq??0)!==o,onClick:()=>{N&&r(N.seq,!N.completed),p()},sx:{fontSize:14},children:[ct(qr,{children:N?.completed?ct(S6,{sx:{fontSize:19}}):ct(k6,{sx:{fontSize:19}})}),N?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!S&&t?fr(xr,{disabled:!(N?.manager_account_seq??0)&&(N?.receiver_account_seqs??[]).length===0,onClick:()=>{N&&t(N),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(T6,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,C?null:ct(eu,{}),C?null:fr(xr,{disabled:E,onClick:x=>{N&&L({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(qr,{children:ct(C6,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!S&&!C&&i?fr(xr,{onClick:()=>{N&&i(N,"manager"),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(B6,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,C?null:fr(xr,{disabled:E,onClick:x=>{N&&D({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ct(qr,{children:ct(I6,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ct(mp,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ct(eu,{}),f?fr(xr,{disabled:E,onClick:()=>{N&&f(N.seq),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(M6,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,d&&N&&!N.is_event&&!N.is_notice?fr(xr,{onClick:()=>{N&&d(N.seq),p()},sx:{fontSize:14},children:[ct(qr,{children:ct(E6,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,fr(xr,{onClick:()=>{N&&(u?u(N):_i(N,k)),p()},sx:{fontSize:14},children:[ct(qr,{children:k?ct(O6,{sx:{fontSize:19}}):ct(R6,{sx:{fontSize:19}})}),k?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),N&&!N.is_notice&&!N.is_event&&h.has(String(N.tab_key??""))&&g?fr(xr,{onClick:x=>z(x.currentTarget),sx:{fontSize:14},children:[ct(qr,{children:ct(A6,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ct(mp,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,fr(xr,{onClick:w,disabled:E||!N?.archived&&!(N&&Ns(N)),sx:{fontSize:14},children:[ct(qr,{children:N?.archived?ct(P6,{sx:{fontSize:19}}):ct(D6,{sx:{fontSize:19}})}),N?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ct(eu,{}),fr(xr,{disabled:E,onClick:()=>{y("one")},sx:{fontSize:14,color:"#e5484d"},children:[ct(qr,{children:ct(yn,{sx:{fontSize:19,color:"#e5484d"}})}),(N?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(N?.repeat_group_key??0)>0?fr(xr,{disabled:E,onClick:()=>{y("series")},sx:{fontSize:14,color:"#e5484d"},children:[ct(qr,{children:ct(yn,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]}),ct(Kr,{anchorEl:A?.anchorEl??null,open:!!A,date:A?.task.due_date??"",reminder:A?.task.reminder??"none",hideReminder:!!A?.task.completed,centered:k,onClose:()=>{L(null),p()},onDateChange:x=>{A&&n(A.task.seq,x)},onReminderChange:x=>{A&&l?.(A.task.seq,x)}}),fr(tu,{transitionDuration:0,anchorEl:O?.anchorEl??null,open:!!O,onClose:()=>{D(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...B,children:[ct(xr,{selected:!O?.task.tab_key,onClick:()=>{O&&s(O.task.seq,""),D(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(x=>!x.archived).map(x=>ct(xr,{selected:O?.task.tab_key===x.key,onClick:()=>{O&&s(O.task.seq,x.key),D(null),p()},sx:{fontSize:14,minWidth:170},children:x.label},x.key))]}),ct(tu,{transitionDuration:0,anchorEl:j,open:!!j,onClose:()=>z(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...c.filter(x=>`custom-${x.group_seq}`===String(N?.tab_key??"")).map(x=>({seq:x.seq,label:Gr(x)}))].map(x=>fr(xr,{onClick:()=>{N&&g?.(N.seq,x.seq),z(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[x.label,(N?.sprint_seq??0)===x.seq?ct(_6,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},x.seq))})]})}import{Checkbox as L6,Divider as F6,Menu as z6,MenuItem as gp}from"@mui/material";import{jsx as Ka,jsxs as bp}from"react/jsx-runtime";function XF({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:c,onClear:o,onClose:a}){return bp(z6,{transitionDuration:0,anchorEl:e,open:!!e,onClose:a,children:[p.map(r=>{let t=b.includes(r.key);return bp(gp,{onClick:()=>c(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Ka(L6,{size:"small",checked:t,sx:{p:0}}),Ka(Et,{option:r})]},r.key)}),Ka(F6,{}),Ka(gp,{disabled:b.length===0,onClick:()=>{o(),a()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as q6,Menu as $6,MenuItem as yp}from"@mui/material";import H6 from"@mui/icons-material/Check";import W6 from"@mui/icons-material/SettingsOutlined";import{jsx as ru,jsxs as nu}from"react/jsx-runtime";function rz(e){let{anchorEl:p,sprints:b,value:c,onSelect:o,onManage:a,onClose:r}=e;return nu($6,{transitionDuration:0,anchorEl:p,open:!!p,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:Gr(t)}))].map(t=>nu(yp,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,c===t.seq?ru(H6,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ru(q6,{}),nu(yp,{onClick:()=>{r(),a()},sx:{fontSize:14,gap:1},children:[ru(W6,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var U6={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function V6(e){return U6[e]??"tasks"}var iz={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},xp=["list","calendar","month","card","kanban","sprint","timeline"],K6=["list","card"];function sz(e){let p=V6(e);switch(p){case"notice":return{kind:p,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:p,viewOptions:xp,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:p,viewOptions:K6,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:p,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:p,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:p,viewOptions:xp,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as G6}from"react";import{useKeyboardState as X6}from"@ehfuse/keyboard-state";var vp=[{key:"g l",view:"list",label:"\uBAA9\uB85D \uBCF4\uAE30"},{key:"g b",view:"board",label:"\uD504\uB85C\uC81D\uD2B8 \uBCF4\uB4DC"},{key:"g k",view:"kanban",label:"\uC0C1\uD0DC \uBCF4\uAE30(\uCE78\uBC18)"},{key:"g c",view:"calendar",label:"\uC8FC\uAC04 \uCE98\uB9B0\uB354"},{key:"g m",view:"month",label:"\uC6D4\uAC04 \uCE98\uB9B0\uB354"},{key:"g t",view:"timeline",label:"\uD0C0\uC784\uB77C\uC778"}];function uz(e,p={}){let{enabled:b=!0}=p,{onCreateTask:c,onFocusSearch:o,onToggleHelp:a,onChangeView:r,onRefresh:t,onEscape:n}=e,l=G6(()=>{let i=[];if(c&&i.push({key:"n",callback:c,options:{preventDefault:!0}}),o&&i.push({key:"/",callback:o,options:{preventDefault:!0}}),t&&i.push({key:"r",callback:t,options:{preventDefault:!0}}),a&&i.push({key:"shift+?",callback:a,options:{preventDefault:!0}}),n&&i.push({key:"escape",callback:n,options:{allowInEditable:!0}}),r)for(let s of vp)i.push({key:s.key,callback:()=>r(s.view),options:{preventDefault:!0}});return i},[c,o,a,r,t,n]);X6(b?l:[])}var wp=[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...vp.map(e=>({keys:e.key.split(" ").map(p=>p.toUpperCase()).join(" \u2192 "),description:e.label})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}];import{Box as Ii,Button as Y6}from"@mui/material";import{FormDialog as Z6}from"@ehfuse/mui-form-dialog";import{jsx as ko,jsxs as _p}from"react/jsx-runtime";function J6({keys:e}){return ko(Ii,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((p,b)=>_p(Ii,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?ko(Ii,{component:"span",sx:{fontSize:12,color:"#9a9a97"},children:"\u2192"}):null,ko(Ii,{component:"span",sx:{minWidth:24,px:.75,py:.25,textAlign:"center",fontSize:12.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:p})]},`${p}-${b}`))})}function mz({open:e,onClose:p}){return ko(Z6,{open:e,onClose:p,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},sections:[{id:"shortcuts",showTitle:!1,children:ko(Ii,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1,alignItems:"center",fontSize:14,color:"#37352f"},children:wp.map(b=>_p(Ii,{sx:{display:"contents"},children:[ko(J6,{keys:b.keys}),ko("span",{children:b.description})]},b.keys))})}],actions:{showCancelButton:!1,right:ko(Y6,{variant:"contained",onClick:p,children:"\uB2EB\uAE30"})}})}var Q6={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function e_(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function ou(e){let p=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(p)?`${p.slice(2,4)}.${p.slice(5,7)}.${p.slice(8,10)}`:"-"}function Mi(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function iu(e,p){let c=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=ou(e.due_date),a=String(e.start_date??"").slice(11,16).trim(),r=ou(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(l=>String(l).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(l=>l.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:or(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:e_(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&a?`${r} ${a}`:r,dueDate:o!=="-"&&c?`${o} ${c}`:o,priorityName:Q6[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Tt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function t_(e,p){if(e===" ")return p*.3;let b=e.codePointAt(0)??0,c=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return p*(c?1:.55)}function Ga(e,p){let b=0;for(let c of String(e??""))b+=t_(c,p);return b}function Ei(e,p){let b=String(e??"").trim();if(!b)return["-"];let c=[],o="";for(let a of b){if(a===`
42
42
  `){o&&c.push(o),o="";continue}let r=`${o}${a}`;if(r.length>p&&o){c.push(o),o=a;continue}o=r}return o&&c.push(o),c.length>0?c:["-"]}function Zo(e,p,b){let c=String(e??"").replace(/\s+/g," ").trim();if(!c)return"";if(Ga(c,b)<=p)return c;let o=Ga("\u2026",b),a="",r=0;for(let t of c){let n=Ga(t,b);if(r+n+o>p)break;a+=t,r+=n}return`${a}\u2026`}var bs=595.28,ys=841.89,xs=841.89,vs=595.28,vr=28,Jr=96,$r=44,r_="'Malgun Gothic','\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo','Noto Sans KR',sans-serif",n_="'Batang','\uBC14\uD0D5','AppleMyungjo','Noto Serif KR',serif",gs="#cbd5e1",o_=[`text { font-family: ${r_}; fill: #000000; }`,`.doc-title { font-family: ${n_}; font-size: 20px; font-weight: 700; }`,".doc-sub { font-size: 10.5px; fill: #333333; }",".doc-meta { font-size: 9.5px; fill: #333333; }",".th { font-size: 9.5px; font-weight: 700; fill: #000000; }",".td { font-size: 9px; }",".td.done { fill: #555555; }",".gt { font-size: 10px; font-weight: 700; fill: #000000; }",".label { font-size: 9px; fill: #333333; }",".value { font-size: 10px; }",".section { font-size: 11.5px; font-weight: 700; fill: #000000; }",".pageno { font-size: 9px; fill: #333333; }",`.head { fill: #eef2f7; stroke: ${gs}; stroke-width: 0.5; }`,`.group { fill: #f8fafc; stroke: ${gs}; stroke-width: 0.5; }`,`.frame { fill: none; stroke: ${gs}; stroke-width: 0.5; }`,`.hline { stroke: ${gs}; stroke-width: 0.5; }`,`.vline { stroke: ${gs}; stroke-width: 0.5; }`,".bar { fill: #bfdbfe; stroke: #60a5fa; stroke-width: 0.6; }",".bar.done { fill: #e5e7eb; stroke: #cbd5e1; }",".bar.overdue { fill: #fecaca; stroke: #f87171; }"].join("");function oo(e,p,b){let c=b-vr;return[`<text x="${vr}" y="46" class="doc-title">${Tt(e.documentTitle)}</text>`,`<text x="${vr}" y="66" class="doc-sub">${Tt(e.subtitle)}</text>`,`<text x="${c}" y="42" class="doc-meta" text-anchor="end">${Tt(e.facilityName)}</text>`,`<text x="${c}" y="58" class="doc-meta" text-anchor="end">\uCD9C\uB825 ${Tt(Mi(e.printedAt))}${e.printedBy?` \xB7 ${Tt(e.printedBy)}`:""}</text>`,p?`<text x="${c}" y="74" class="doc-meta" text-anchor="end">${Tt(p)}</text>`:""].join("")}function io(e){let{width:p,height:b,body:c,pageIndex:o,pageCount:a}=e;return[`<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${b}" viewBox="0 0 ${p} ${b}">`,`<style>${o_}</style>`,`<rect x="0" y="0" width="${p}" height="${b}" fill="#ffffff" />`,c,`<text x="${p/2}" y="${b-22}" class="pageno" text-anchor="middle">${o+1} / ${a}</text>`,"</svg>"].join("")}var au=xs,Sp=vs,so=vr,ws=au-vr,ks=22,Jo=20,Qo=22,_s=5,Tp=Jr,Cp=$r,kp=Sp-46,Ss=[{key:"title",label:"\uC81C\uBAA9",width:250,align:"start"},{key:"status",label:"\uC0C1\uD0DC",width:56,align:"middle"},{key:"start",label:"\uC2DC\uC791",width:86,align:"middle"},{key:"due",label:"\uB9C8\uAC10",width:86,align:"middle"},{key:"manager",label:"\uCC45\uC784\uC790",width:62,align:"middle"},{key:"receivers",label:"\uCC38\uC870\uC790",width:122,align:"start"},{key:"priority",label:"\uC911\uC694\uB3C4",width:52,align:"middle"},{key:"project",label:"\uD504\uB85C\uC81D\uD2B8",width:72,align:"middle"}],su=Ss.reduce((e,p,b)=>(e.push(b===0?so:e[b-1]+Ss[b-1].width),e),[]);function i_(e){let p=[],b=[],c=Tp+ks,o=(a,r)=>{p.push(b),b=[],c=Cp+ks,a&&(b.push({kind:"group",label:a,count:r,continued:!0}),c+=Qo)};for(let a of e){a.label&&(c+Qo+Jo>kp&&o("",0),b.push({kind:"group",label:a.label,count:a.rows.length,continued:!1}),c+=Qo);for(let r of a.rows)c+Jo>kp&&o(a.label,a.rows.length),b.push({kind:"row",completed:r.completed,values:Ss.map(t=>{switch(t.key){case"title":return r.title;case"status":return r.statusName;case"project":return r.projectLabel||"\uAE30\uBCF8";case"manager":return r.managerName||"-";case"receivers":return r.receiverNames||"-";case"start":return r.startDate;case"due":return r.dueDate;default:return r.priorityName||"-"}})}),c+=Jo}return p.push(b),p.filter((a,r)=>r===0||a.length>0)}function s_(e,p){let b=[];b.push(`<rect x="${so}" y="${p}" width="${ws-so}" height="${ks}" class="head" />`),Ss.forEach((o,a)=>{let r=su[a],t=o.align==="middle"?r+o.width/2:r+_s;b.push(`<text x="${t}" y="${p+ks-7}" class="th" text-anchor="${o.align}">${Tt(o.label)}</text>`)});let c=p+ks;for(let o of e){if(o.kind==="group"){b.push(`<rect x="${so}" y="${c}" width="${ws-so}" height="${Qo}" class="group" />`,`<text x="${so+_s}" y="${c+Qo-7}" class="gt">${Tt(o.continued?`${o.label} (\uC774\uC5B4\uC11C)`:o.label)}</text>`,`<text x="${ws-_s}" y="${c+Qo-7}" class="gt" text-anchor="end">${o.count}\uAC74</text>`),c+=Qo;continue}Ss.forEach((a,r)=>{let t=su[r],n=a.align==="middle"?t+a.width/2:t+_s;b.push(`<text x="${n}" y="${c+Jo-6}" class="${o.completed?"td done":"td"}" text-anchor="${a.align}">${Tt(Zo(o.values[r]??"",a.width-_s*2,9))}</text>`)}),b.push(`<line x1="${so}" y1="${c+Jo}" x2="${ws}" y2="${c+Jo}" class="hline" />`),c+=Jo}return su.slice(1).forEach(o=>{b.push(`<line x1="${o}" y1="${p}" x2="${o}" y2="${c}" class="vline" />`)}),b.push(`<rect x="${so}" y="${p}" width="${ws-so}" height="${c-p}" class="frame" />`),b.join("")}async function a_(e,p){let b=i_(p),c=p.reduce((o,a)=>o+a.rows.length,0);return b.map((o,a)=>{let r=a===0?Tp:Cp,t=[a===0?oo(e,`\uC804\uCCB4 ${c}\uAC74`,au):"",s_(o,r)].join("");return io({width:au,height:Sp,body:t,pageIndex:a,pageCount:b.length})})}var cu=bs,Bp=ys,Rn=vr,Xa=cu-vr,l_=Bp-46,Ip=22,c_=68,u_=(Xa-Rn)/2,f_=14,lu=58;function Ri(e){switch(e.kind){case"title":return 34;case"props":return Math.ceil(e.pairs.length/2)*Ip+10;case"section":return 26;default:return f_}}function d_(e){let p=[{kind:"title",text:e.title,ticket:e.ticketNo}];return p.push({kind:"props",pairs:e.properties}),p.push({kind:"section",text:"\uB0B4\uC6A9"}),(e.content.trim()?e.content.split(`
43
43
  `).flatMap(c=>c.trim()?Ei(c,lu):[""]):["(\uB0B4\uC6A9 \uC5C6\uC74C)"]).forEach(c=>p.push({kind:"line",text:c,muted:!e.content.trim()})),e.checklist.length>0&&(p.push({kind:"section",text:`\uD560\uC77C (${e.checklist.filter(c=>c.checked).length}/${e.checklist.length})`}),e.checklist.forEach(c=>{Ei(c.label,lu-3).forEach((o,a)=>p.push({kind:a===0?"check":"line",text:o,checked:c.checked}))})),e.includeComments&&e.comments.length>0&&(p.push({kind:"section",text:`\uB313\uAE00 (${e.comments.length})`}),e.comments.forEach(c=>{p.push({kind:"line",text:`${c.author} \xB7 ${c.time}`,muted:!0}),Ei(c.text,lu).forEach(o=>p.push({kind:"line",text:o}))})),p}function h_(e){let p=[],b=[],c=Jr;for(let o of e){let a=Ri(o);c+a>l_&&(p.push(b),b=[],c=$r),b.push(o),c+=a}return p.push(b),p}function p_(e,p){switch(e.kind){case"title":{let b=e.ticket?`<text x="${Xa}" y="${p+16}" class="doc-meta" text-anchor="end">${Tt(e.ticket)}</text>`:"";return{markup:`<text x="${Rn}" y="${p+16}" class="section" style="font-size:14px">${Tt(e.text)}</text>${b}<line x1="${Rn}" y1="${p+24}" x2="${Xa}" y2="${p+24}" class="hline" />`,nextY:p+Ri(e)}}case"props":{let b=[];return e.pairs.forEach((c,o)=>{let a=o%2,r=Math.floor(o/2),t=Rn+a*u_,n=p+r*Ip;b.push(`<text x="${t}" y="${n+14}" class="label">${Tt(c.label)}</text>`,`<text x="${t+c_}" y="${n+14}" class="value">${Tt(Ei(c.value||"-",26)[0]??"-")}</text>`)}),{markup:b.join(""),nextY:p+Ri(e)}}case"section":return{markup:`<text x="${Rn}" y="${p+16}" class="section">${Tt(e.text)}</text><line x1="${Rn}" y1="${p+21}" x2="${Xa}" y2="${p+21}" class="hline" />`,nextY:p+Ri(e)};case"check":return{markup:`<text x="${Rn}" y="${p+10}" class="td">${e.checked?"\u2611":"\u2610"}</text><text x="${Rn+14}" y="${p+10}" class="${e.checked?"td done":"td"}">${Tt(e.text)}</text>`,nextY:p+Ri(e)};default:return{markup:`<text x="${Rn}" y="${p+10}" class="${e.muted?"td done":"td"}">${Tt(e.text)}</text>`,nextY:p+Ri(e)}}}async function m_(e,p){let b=h_(d_(p));return b.map((c,o)=>{let a=o===0?Jr:$r,r=[o===0?oo(e,"",cu):`<text x="${Rn}" y="${$r-12}" class="doc-meta">${Tt(`${p.title} (\uC774\uC5B4\uC11C)`)}</text>`];for(let t of c){let n=p_(t,a);r.push(n.markup),a=n.nextY}return io({width:cu,height:Bp,body:r.join(""),pageIndex:o,pageCount:b.length})})}var fu=xs,Rp=vs,Ya=vr,Ts=fu-vr,Mp=Rp-46,Ep=210,So=20,uu=24;function To(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let p=new Date(`${e}T00:00:00`);return Number.isNaN(p.getTime())?null:p}function Op(e,p){return Math.round((p.getTime()-e.getTime())/864e5)}function g_(e,p){let b=[];e.forEach(r=>{let t=To(r.startDate),n=To(r.dueDate);t&&b.push(t),n&&b.push(n)});let c=To(p)??new Date;if(b.length===0)return{start:c,days:30};let o=new Date(Math.min(...b.map(r=>r.getTime()))),a=new Date(Math.max(...b.map(r=>r.getTime())));return o.setDate(o.getDate()-1),a.setDate(a.getDate()+1),{start:o,days:Math.max(7,Op(o,a)+1)}}async function b_(e,p,b){let c=g_(p,b),o=Ya+Ep,r=(Ts-o)/c.days,t=To(b),n=d=>o+Op(c.start,d)*r,l=Math.max(1,Math.floor((Mp-Jr-uu)/So)),i=Math.max(1,Math.floor((Mp-$r-uu)/So)),s=[],f=0;for(;f<p.length||s.length===0;){let d=s.length===0?l:i;if(s.push(p.slice(f,f+d)),f+=d,f>=p.length)break}return s.map((d,u)=>{let g=u===0?Jr:$r,m=[u===0?oo(e,`\uC804\uCCB4 ${p.length}\uAC74`,fu):""],v=g+uu;m.push(`<line x1="${Ya}" y1="${v}" x2="${Ts}" y2="${v}" class="vline" />`);for(let k=0;k<c.days;k+=1){let B=new Date(c.start);if(B.setDate(B.getDate()+k),B.getDay()!==0&&k!==0)continue;let A=o+k*r;m.push(`<line x1="${A}" y1="${v}" x2="${A}" y2="${v+d.length*So}" class="hline" />`,`<text x="${A+2}" y="${v-6}" class="label">${B.getMonth()+1}.${B.getDate()}</text>`)}if(t&&t>=c.start){let k=n(t);k>=o&&k<=Ts&&m.push(`<line x1="${k}" y1="${v}" x2="${k}" y2="${v+d.length*So}" stroke="#f87171" stroke-width="0.8" />`)}return d.forEach((k,B)=>{let A=v+B*So,L=Zo(k.title,Ep-64,9);m.push(`<text x="${Ya}" y="${A+14}" class="${k.completed?"td done":"td"}">${Tt(L)}</text>`,`<text x="${o-6}" y="${A+14}" class="label" text-anchor="end">${Tt(k.managerName)}</text>`,`<line x1="${Ya}" y1="${A+So}" x2="${Ts}" y2="${A+So}" class="hline" />`);let O=To(k.startDate)??To(k.dueDate),D=To(k.dueDate)??To(k.startDate);if(!O||!D)return;let j=n(O),z=Math.max(j+r*.8,n(D)+r*.8),N=k.completed?"bar done":k.overdue?"bar overdue":"bar";m.push(`<rect x="${j}" y="${A+5}" width="${Math.max(3,Math.min(z,Ts)-j)}" height="${So-10}" rx="2" class="${N}" />`)}),io({width:fu,height:Rp,body:m.join(""),pageIndex:u,pageCount:s.length})})}function y_(e,p,b,c){return{title:e.title,managerName:e.managerName,startDate:String(p??"").slice(0,10),dueDate:String(b??"").slice(0,10),completed:e.completed,overdue:!e.completed&&!!b&&String(b).slice(0,10)<c}}var du=bs,Dp=ys,Oi=vr,Za=du-vr,Ap=Dp-46,Ai=30,Di=18,Pp=12;function x_(e){let p=[],b=[],c=Jr,o=(a,r)=>{p.push(b),b=[],c=$r,a&&(b.push({kind:"column",label:a,summary:r,continued:!0,gapBefore:!1}),c+=Ai)};for(let a of e){let r=b.length>0,t=r?Pp:0;if(c+t+Ai+Di>Ap?(o("",""),b.push({kind:"column",label:a.label,summary:a.summary,continued:!1,gapBefore:!1}),c+=Ai):(b.push({kind:"column",label:a.label,summary:a.summary,continued:!1,gapBefore:r}),c+=t+Ai),a.items.length===0){b.push({kind:"empty"}),c+=Di;continue}for(let n of a.items)c+Di>Ap&&o(a.label,a.summary),b.push({kind:"item",title:n.title,meta:n.meta,completed:n.completed}),c+=Di}return p.push(b),p}async function v_(e,p,b){let c=x_(p);return c.map((o,a)=>{let r=a===0?Jr:$r,t=[a===0?oo(e,b,du):""];for(let n of o){if(n.kind==="column"){n.gapBefore&&(r+=Pp),t.push(`<rect x="${Oi}" y="${r}" width="${Za-Oi}" height="${Ai-6}" class="group" />`,`<text x="${Oi+6}" y="${r+16}" class="gt">${Tt(n.continued?`${n.label} (\uC774\uC5B4\uC11C)`:n.label)}</text>`,`<text x="${Za-6}" y="${r+16}" class="label" text-anchor="end">${Tt(n.summary)}</text>`),r+=Ai;continue}if(n.kind==="empty"){t.push(`<text x="${Oi+12}" y="${r+12}" class="td done">(\uC5C5\uBB34 \uC5C6\uC74C)</text>`),r+=Di;continue}t.push(`<text x="${Oi+12}" y="${r+12}" class="${n.completed?"td done":"td"}">${Tt(Zo(n.title,Za-Oi-12-120,9))}</text>`,`<text x="${Za-6}" y="${r+12}" class="label" text-anchor="end">${Tt(n.meta)}</text>`),r+=Di}return io({width:du,height:Dp,body:t.join(""),pageIndex:a,pageCount:c.length})})}var w_=[{header:"\uADF8\uB8F9",width:16},{header:"\uC81C\uBAA9",width:44},{header:"\uC0C1\uD0DC",width:10},{header:"\uD504\uB85C\uC81D\uD2B8",width:14},{header:"\uCC45\uC784\uC790",width:10},{header:"\uCC38\uC870\uC790",width:22},{header:"\uC2DC\uC791",width:12},{header:"\uB9C8\uAC10",width:14},{header:"\uC911\uC694\uB3C4",width:8},{header:"\uD560\uC77C",width:8},{header:"\uBE44\uACE0",width:30}],__="FFEEF2F7",Ja="FFCBD5E1";function k_(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()||"\uC5C5\uBB34\uBAA9\uB85D"}async function S_(e,p){let b=await Promise.resolve().then(()=>Up(jp(),1)),c=new b.Workbook,o=c.addWorksheet("\uC5C5\uBB34\uBAA9\uB85D",{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0,fitToWidth:1,fitToHeight:0}});o.columns=w_.map(i=>({header:i.header,width:i.width})),o.spliceRows(1,0,[`${e.documentTitle}`],[`${e.subtitle} \xB7 ${e.facilityName} \xB7 \uCD9C\uB825 ${Mi(e.printedAt)}${e.printedBy?` \xB7 ${e.printedBy}`:""}`]),o.getRow(1).font={bold:!0,size:14},o.getRow(2).font={size:10,color:{argb:"FF6B7280"}};let a=o.getRow(3);a.font={bold:!0,size:10},a.eachCell(i=>{i.fill={type:"pattern",pattern:"solid",fgColor:{argb:__}},i.alignment={vertical:"middle",horizontal:"center"}}),p.forEach(i=>{i.rows.forEach(s=>{let f=o.addRow([i.label,s.title,s.statusName,s.projectLabel||"\uAE30\uBCF8",s.managerName,s.receiverNamesFull,s.startDate==="-"?"":s.startDate,s.dueDate==="-"?"":s.dueDate,s.priorityName,s.checklist,s.note]);f.font={size:10,color:{argb:s.completed?"FF9CA3AF":"FF111827"}},f.alignment={vertical:"middle",wrapText:!1}})});let r=o.rowCount;for(let i=3;i<=r;i+=1)o.getRow(i).eachCell({includeEmpty:!0},s=>{s.border={top:{style:"thin",color:{argb:Ja}},left:{style:"thin",color:{argb:Ja}},bottom:{style:"thin",color:{argb:Ja}},right:{style:"thin",color:{argb:Ja}}}});o.views=[{state:"frozen",ySplit:3}];let t=await c.xlsx.writeBuffer(),n=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),l=Mi(e.printedAt).replace(/[: ]/g,"").slice(0,13);return{blob:n,fileName:`${k_(e.documentTitle)}_${l}.xlsx`}}function T_(e){return String(e??"").replace(/<br\s*\/?>(?=.)/gi,`
44
44
  `).replace(/<\/(p|div|li|h[1-6])>/gi,`