@ehfuse/taskbox 0.5.142 → 0.5.143

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
@@ -5,7 +5,7 @@ var Ll="waiting",NS="replied";import{createContext as gu,useContext as hu,useMem
5
5
 
6
6
  `).trim()}function Ii({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:a}){let l=bn(null),d=bn(null),s=i>0?i:0,u=bn(s),x=bn(a);x.current=a;let p=bn(null),c=bn(Date.now()+800),[f,M]=wk(!1),C=we();tl(()=>{if(n)return;let g=rl(o);p.current===g||p.current===o||(p.current=g,c.current=Date.now()+800,l.current?.setHtml(g))},[e,o,n]);let h=bn(-1);return tl(()=>{if(n||C||i<=0||h.current===i||(h.current=i,Math.abs(i-u.current)<1))return;let g=d.current?.querySelector(".ehfuse-editor-container");g&&(Math.abs(g.getBoundingClientRect().height-i)<1||(g.style.height=`${i}px`,u.current=i))},[n,C,i]),tl(()=>{if(n||C)return;let g=d.current?.querySelector(".ehfuse-editor-container");if(!g||typeof ResizeObserver>"u")return;let I,S=new ResizeObserver(w=>{let y=Math.round(w[0]?.contentRect.height??0);y<=0||(window.clearTimeout(I),I=window.setTimeout(()=>{Math.abs(y-u.current)<1||(u.current=y,x.current?.(y))},300))});return S.observe(g),()=>{window.clearTimeout(I),S.disconnect()}},[n,C]),n?Ak(nl,{sx:{position:"relative",mt:1},children:[kn(nl,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:rl(o)}}),kn(Mk,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:kn(Dk,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(zk(o)).then(()=>{M(!0),window.setTimeout(()=>M(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:f?kn(Ok,{sx:{fontSize:17,color:"#2f9e5b"}}):kn(Ek,{sx:{fontSize:17}})})})]}):kn(nl,{ref:d,onDragOver:g=>g.stopPropagation(),onDrop:g=>g.stopPropagation(),sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:kn(Rk,{ref:l,defaultValue:rl(o),autoHeight:C,resizable:!C,showToolbar:!C,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:Pk,locale:"ko",minHeight:s||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:g=>{let I=Date.now()<c.current,S=g===p.current;p.current=g,!(I||S)&&t(g)}})})}import{useState as Dr}from"react";import{Box as To,Button as $c,Dialog as jk,IconButton as Qn,TextField as Yk,Tooltip as Kc}from"@mui/material";import Uc from"@mui/icons-material/Close";import Xk from"@mui/icons-material/AddCircle";import Vc from"@mui/icons-material/AddTask";import Qk from"@mui/icons-material/Checklist";import Zk from"@mui/icons-material/CheckCircle";import Jk from"@mui/icons-material/Launch";import eT from"@mui/icons-material/LinkOutlined";import oT from"@mui/icons-material/RadioButtonUnchecked";import{useEffect as qk,useMemo as Lk,useState as il}from"react";import{Box as Pt,Button as Nk,Tab as Fk,Tabs as Hk}from"@mui/material";import{FormDialog as Wk}from"@ehfuse/mui-form-dialog";import{ClearTextField as $k}from"@ehfuse/mui-form-controls";import{ErrorAlert as Kk}from"@ehfuse/alerts";import Uk from"@mui/icons-material/CheckCircle";import Vk from"@mui/icons-material/RadioButtonUnchecked";import{OverlayScrollbar as Gk}from"@ehfuse/overlay-scrollbar";import{jsx as po,jsxs as al}from"react/jsx-runtime";var Wc=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function _i({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:a=!1,title:l="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:d="\uC5F0\uACB0",multiSelect:s=!1}){let u=we(),[x,p]=il("related"),[c,f]=il(""),[M,C]=il([]);qk(()=>{e&&(p("related"),f(""),C([]))},[e]);let h=Lk(()=>{let y=new Set([o.seq,...n]),_=c.trim().toLowerCase();return t.filter(E=>y.has(E.seq)||E.is_event||E.is_notice?!1:_?E.title.toLowerCase().includes(_)||(E.ticket_no??"").toLowerCase().includes(_):!0).sort((E,v)=>!!E.completed!=!!v.completed?E.completed?1:-1:v.seq-E.seq)},[t,o.seq,n,c]),g=()=>{if(M.length===0){Kk("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let y of M)i(y,x);r()},I=y=>{C(_=>_.includes(y)?_.filter(E=>E!==y):s?[..._,y]:[y])},S=Wc.find(y=>y.type===x)?.hint??"",w=al(Pt,{sx:{...u?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...u?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[a?null:po(Hk,{value:x,onChange:(y,_)=>p(_),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Wc.map(y=>po(Fk,{value:y.type,label:y.label},y.type))}),a?null:po(Pt,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:S}),po(Pt,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:po($k,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:c,onChange:y=>f(y.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),po(Pt,{sx:{flex:1,minHeight:0},children:po(Gk,{style:{height:"100%"},contentStyle:{paddingTop:0},children:po(Pt,{sx:{display:"flex",flexDirection:"column"},children:h.length===0?po(Pt,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):h.map(y=>{let _=Ve(y.icon||Re),E=M.includes(y.seq);return al(Pt,{onClick:()=>I(y.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:1.25,flexShrink:0,cursor:"pointer",borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none"},bgcolor:E?"#e3eefb":"transparent","&:hover":{bgcolor:E?"#e3eefb":"#f7f7f5"}},children:[E?po(Uk,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):po(Vk,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),_?po(_,{sx:{fontSize:17,flexShrink:0,color:y.icon_color||"#1e3a8a"}}):null,al(Pt,{component:"span",sx:{flex:1,minWidth:0,fontSize:15,color:"#37352f",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,overflow:"hidden",lineHeight:1.5,wordBreak:"break-word"},children:[y.ticket_no?`${y.ticket_no} `:"",y.title]}),po(Pt,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:po(Le,{option:Io(y)})})]},y.seq)})})})})]});return po(Wk,{open:e,onClose:r,maxWidth:"sm",fullScreen:u,mobilePresentation:u?"slide":"dialog",...u?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:u?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:l,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:w}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:po(Nk,{variant:"contained",disabled:M.length===0,onClick:g,children:d})}})}import{Fragment as tT,jsx as Te,jsxs as on}from"react/jsx-runtime";function wi({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:a=!1,onConvertToTask:l,onOpenLinkedTask:d,linkCandidates:s,linkBaseTask:u,onLinkExistingTask:x,resolveLinkedTask:p}){let[c,f]=Dr(""),[M,C]=Dr(!1),[h,g]=Dr(null),I=we(),[S,w]=Dr(null),[y,_]=Dr(null),E=L=>{let m=L.task_seq?p?.(L.task_seq):void 0;return m?m.completed:L.checked},v=o.filter(E).length,D=()=>{c.trim()&&(t(e,c),f(""))};return on(Wo,{icon:Te(Qk,{sx:{fontSize:19,display:"block"}}),title:on(tT,{children:["\uD560\uC77C",o.length>0?on(To,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[v," / ",o.length]}):null]}),titleExtra:o.length>0?Te(To,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:Te(To,{sx:{height:"100%",borderRadius:3,width:`${Math.round(v/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[Te(To,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((L,m)=>{let T=L.task_seq?p?.(L.task_seq):void 0,b=E(L),k=!!L.task_seq;return on(To,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[Te(To,{component:"span",onClick:()=>n(e,m,!b),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:b?Te(Zk,{sx:{fontSize:18,color:"#2f80ed"}}):Te(oT,{sx:{fontSize:18,color:"#9a9a97"}})}),h?.index===m?Te(To,{component:"input",autoFocus:!0,spellCheck:!1,value:h.label,enterKeyHint:"done",onChange:R=>g({index:m,label:R.target.value}),onBlur:()=>{h.label.trim()&&h.label.trim()!==L.label&&i?.(e,m,h.label),g(null)},onKeyDown:R=>{R.key==="Enter"&&R.target.blur(),R.key==="Escape"&&g(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):Te(To,{component:"span",onClick:k?L.task_seq&&d?()=>d(L.task_seq):void 0:a||!i?void 0:I?()=>w({index:m,label:L.label}):()=>g({index:m,label:L.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:b?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...k?d?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:a||!i?{}:{cursor:"text"}},children:L.label}),k?on(To,{component:"span",onClick:L.task_seq&&d?()=>d(L.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...d?{cursor:"pointer"}:{}},children:[Te(Jk,{sx:{fontSize:12}}),T?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!a&&!k&&l?Te(Kc,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:Te(Qn,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:R=>_({anchorEl:R.currentTarget,index:m,label:L.label}),sx:{display:I?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Te(Vc,{sx:{fontSize:16}})})}):null,a?null:Te(Qn,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,m),sx:{display:I?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Te(Uc,{sx:{fontSize:15}})})]},`${L.label}-${m}`)})}),on(To,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[Te(To,{component:"input",spellCheck:!1,value:c,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:L=>f(L.target.value),onKeyDown:L=>{L.key==="Enter"&&D()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),s&&u&&x?Te(Kc,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:Te(Qn,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:L=>L.preventDefault(),onClick:()=>C(!0),sx:{flexShrink:0,color:"#9a9a97"},children:Te(eT,{sx:{fontSize:20}})})}):null,Te(Qn,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!c.trim(),onMouseDown:L=>L.preventDefault(),onClick:D,sx:{flexShrink:0,color:c.trim()?"#2f80ed":"#c9c8c5"},children:Te(Xk,{sx:{fontSize:20}})})]}),s&&u&&x?Te(_i,{open:M,task:u,tasks:s,excludeSeqs:o.map(L=>Number(L.task_seq??0)).filter(L=>L>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>C(!1),onSubmit:L=>{let m=s.find(T=>T.seq===L);x(e,L,String(m?.title??"").trim())}}):null,Te($e,{open:!!y,anchorEl:y?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>_(null),onConfirm:()=>{y&&l?.(e,y.index,y.label),_(null)}}),Te(jk,{open:!!S,onClose:()=>w(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:on(To,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[Te(To,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),Te(Yk,{autoFocus:!0,fullWidth:!0,size:"medium",value:S?.label??"",onChange:L=>w(m=>m&&{...m,label:L.target.value}),onKeyDown:L=>{if(L.key!=="Enter")return;let m=S;m&&m.label.trim()&&i?.(e,m.index,m.label.trim()),w(null)}}),on(To,{sx:{display:"flex",alignItems:"center",gap:1},children:[!a&&l&&S&&!o[S.index]?.task_seq?Te(Qn,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{l(e,S.index,o[S.index]?.label??""),w(null)},sx:{color:"#57564f"},children:Te(Vc,{sx:{fontSize:20}})}):null,!a&&S?Te(Qn,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,S.index),w(null)},sx:{color:"#e5484d"},children:Te(Uc,{sx:{fontSize:19}})}):null,Te(To,{sx:{flex:1}}),Te($c,{color:"inherit",onClick:()=>w(null),children:"\uCDE8\uC18C"}),Te($c,{variant:"contained",disabled:!S?.label.trim(),onClick:()=>{S&&S.label.trim()&&i?.(e,S.index,S.label.trim()),w(null)},children:"\uD655\uC778"})]})]})})]})}import{useRef as sT,useState as cT}from"react";import{Box as ut,IconButton as mT}from"@mui/material";import uT from"@mui/icons-material/Close";import Yc from"@mui/icons-material/AttachFileOutlined";var nT=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),Di=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return nT.has(o)};import{LinearProgress as rT}from"@mui/material";import{Fragment as iT,jsx as lT,jsxs as aT}from"react/jsx-runtime";function Gc(e){let o=gt(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),a=n??0;return!a||e>0&&(t??0)!==e?null:{index:a,total:r??0,queue:i??[]}}function ll(){let o=gt().useValue("attachmentUpload.progress");return aT(iT,{children:[o??0,"%"]})}function jc(){let o=gt().useValue("attachmentUpload.progress");return lT(rT,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as dT,jsx as Do,jsxs as Mr}from"react/jsx-runtime";function Mi(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var Ei={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Oi({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:a}){let[l,d]=cT(!1),s=sT(null),u=we(),x=pr(),p=dr(),c=Gc(e),f=e===0,M=S=>{if(i){i(S);return}window.open(p(S.uuid??""),"_blank","noopener,noreferrer")},C=S=>{if(a){a(S);return}window.open(p(S.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},h=S=>c?S+1<c.index?"done":S+1===c.index?"uploading":"waiting":"waiting",g=(S,w,y,_={})=>Mr(ut,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:_.uploading?"#d5e6fb":"#e6e6e3",bgcolor:_.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[Mr(ut,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Do(Yc,{sx:{fontSize:16,color:"#9a9a97"}}),w,Do(ut,{component:"span",sx:{fontSize:12,color:_.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:y}),_.removeIndex!==void 0?Do(mT,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,_.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Do(uT,{sx:{fontSize:15}})}):null]}),_.uploading?Do(jc,{}):null]},S),I=S=>{let w=Di(S.name);return Do(ut,{component:"button",type:"button",onClick:()=>w?M(S):C(S),title:`${S.name} ${w?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...Ei,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:S.name})};return Mr(Wo,{icon:Do(Yc,{sx:{fontSize:18,display:"block"}}),title:Mr(dT,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[Mr(ut,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((S,w)=>{let y=`${S.uuid||S.name}-${w}`;if(f){let _=h(w),E=_==="uploading";return g(y,Do(ut,{component:"span",sx:{...Ei,color:_==="done"?"#37352f":"#9a9a97"},children:S.name}),E?Do(ll,{}):Mi(S.size),{uploading:E,removeIndex:!r&&!c?w:void 0})}return S.uuid?g(y,I(S),Mi(S.size),{removeIndex:r?void 0:w}):g(y,Do(ut,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...Ei,color:"#9a9a97"},children:S.name}),Mi(S.size),{removeIndex:r?void 0:w})}),!f&&c?c.queue.slice(c.index-1).map((S,w)=>{let y=w===0;return g(`uploading-${c.index+w}-${S.name}`,Do(ut,{component:"span",sx:{...Ei,color:"#9a9a97"},children:S.name}),y?Do(ll,{}):Mi(S.size),{uploading:y})}):null]}),Do(ut,{onClick:()=>s.current?.click(),onDragOver:S=>{S.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:S=>{S.preventDefault(),d(!1);let w=Array.from(S.dataTransfer.files);w.length>0&&t(e,w)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:l?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:l?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:u?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`}),Do(ut,{component:"input",ref:s,type:"file",multiple:!0,onChange:S=>{let w=Array.from(S.target.files??[]);w.length>0&&t(e,w),S.target.value=""},sx:{display:"none"}})]})}import{useState as kT}from"react";import{Checkbox as TT,Divider as yT,ListItemIcon as ST,Menu as BT,MenuItem as Jc}from"@mui/material";import CT from"@mui/icons-material/Add";import{useEffect as pT,useState as Xc}from"react";import{Box as sl,Button as fT}from"@mui/material";import{FormDialog as xT}from"@ehfuse/mui-form-dialog";import{ClearTextField as gT}from"@ehfuse/mui-form-controls";import{ColorPicker as hT}from"@ehfuse/mui-color-picker";import{ErrorAlert as bT}from"@ehfuse/alerts";import{jsx as Er,jsxs as cl}from"react/jsx-runtime";var Qc="#2f80ed";function Zc({open:e,onClose:o,onSubmit:t}){let[n,r]=Xc(""),[i,a]=Xc(Qc);pT(()=>{e&&(r(""),a(Qc))},[e]);let l=()=>{let u=n.trim();if(!u){bT("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(u,i),o()},d=rs(i),s=cl(sl,{children:[cl(sl,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[Er(gT,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:u=>r(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),l())},fullWidth:!0,autoFocus:!0}),Er(hT,{value:i,onChange:u=>a(u),shape:"circle",colorSize:28})]}),cl(sl,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",Er(Le,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...d}})]})]});return Er(xT,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:s}],actions:{showCancelButton:!0,right:Er(fT,{variant:"contained",onClick:l,children:"\uCD94\uAC00"})}})}import{Fragment as vT,jsx as Zn,jsxs as Ri}from"react/jsx-runtime";function Pi({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[a,l]=kT(!1),d=nt();return Ri(vT,{children:[Ri(BT,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...d,children:[t.map(s=>{let u=o.includes(s.key);return Ri(Jc,{onClick:()=>n(s.key),sx:{fontSize:14,minWidth:170,gap:1},children:[Zn(TT,{size:"small",checked:u,sx:{p:0}}),Zn(Le,{option:s})]},s.key)}),Zn(yT,{}),Ri(Jc,{onClick:()=>l(!0),sx:{fontSize:14,color:"#787774"},children:[Zn(ST,{children:Zn(CT,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),Zn(Zc,{open:a,onClose:()=>l(!1),onSubmit:r})]})}function em(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function om(e,o){let t=(e.target_account_seqs??[]).filter(x=>x>0);if(t.length===0)return null;let n=new Set(t),r=em(e,o),i=new Map;for(let x of r){let p=String(x.department??"").trim();if(!p)continue;let c=i.get(p)??[];c.push(x),i.set(p,c)}let a=[],l=new Set;for(let[x,p]of i)if(p.every(f=>n.has(Number(f.account_seq??0)))){a.push(x);for(let f of p)l.add(Number(f.account_seq??0))}let d=new Map(r.map(x=>[Number(x.account_seq??0),x.name])),s=e.target_names??[],u=[];return t.forEach((x,p)=>{l.has(x)||u.push(d.get(x)??s[p]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:u}}function zi(e,o){let t=om(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function hR(e,o){let t=om(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function tm(e,o,t){let n=(e.target_account_seqs??[]).filter(u=>u>0),r=em(e,o),i=n.length>0?n.length:r.length,a=e.acks??[],l=t>0&&a.some(u=>u.account_seq===t),d=t>0&&Number(e.author_account_seq??0)===t,s=n.length===0||n.includes(t);return{count:a.length,total:i,acked:l,canAck:t>0&&!d&&s&&!l&&!e.completed}}function nm(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(l=>l.size>n),i=e.filter(l=>l.size<=n),a=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
7
7
  \uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(l=>l.name).join(", ")}`:null;return{accepted:i,rejected:r,message:a}}import{Fragment as Ai,jsx as Be,jsxs as Pr}from"react/jsx-runtime";var im="#0f9d58";function ml({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:a=!1,hideBug:l=!1,leadingRow:d,hideLabel:s=!1,employees:u=[],myAccountSeq:x=0,onMemberEdit:p,onAddProject:c,onAddLabelOption:f,contentSyncKey:M="create"}){let C=gt(),h=pr(),g=e.useFormValue("manager_name"),I=e.useFormValue("receiver_names"),S=e.useFormValue("start_date"),w=!!e.useFormValue("is_event"),y=!!e.useFormValue("is_bug"),_=e.useFormValue("bug_repro")??"",E=e.useFormValue("bug_device")??"",v=e.useFormValue("bug_where")??"",D=e.useFormValue("bug_version")??"",L=e.useFormValue("event_time")??"",m=e.useFormValue("event_place")??"",T=e.useFormValue("event_address")??"",b=e.useFormValue("due_date"),k=e.useFormValue("estimated_time")??"",R=e.useFormValue("reminder"),q=e.useFormValue("priority"),ae=e.useFormValue("content"),ce=e.useFormValue("checklist")??[],ie=e.useFormValue("tab_key"),ye=e.useFormValue("sprint_seq")??0,he=e.useFormValue("story_points")??0,me=t.find(A=>A.key===ie&&A.useSprints),ee=me?n.filter(A=>`custom-${A.group_seq}`===ie):[],[ze,Ae]=rm(null),H=e.useFormValue("label_keys"),[K,J]=rm(null),B=e.useFormValue("target_names"),F=e.useFormValue("target_account_seqs"),$=C.useValue("createAttachmentFiles")??[],Me=i?zi({author_account_seq:x,target_names:B,target_account_seqs:F},u):"";return Pr(Ai,{children:[d,i?null:Be(Or,{sx:{display:"flex",gap:1.25,px:2,pt:1.5,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...l?[]:[{value:"bug",label:"\uC624\uB958"}]].map(A=>{let ue=y?"bug":w?"event":"task",ge=ue===A.value;return Be(IT,{onClick:()=>{if(ue===A.value)return;e.setFormValue("is_event",A.value==="event"),e.setFormValue("is_bug",A.value==="bug"),e.setFormValue("is_open",A.value==="bug");let de=e.getFormValue("icon"),qe=e.getFormValue("icon_color"),Y=[Re,"event",fr].includes(de),Ie=!qe||qe===im||qe===xr;Y&&e.setFormValue("icon",A.value==="event"?"event":A.value==="bug"?fr:Re),Ie&&e.setFormValue("icon_color",A.value==="event"?im:A.value==="bug"?xr:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:ge?600:400,color:ge?"#ffffff":"#787774",bgcolor:ge?"#2563eb":"#f4f4f2"},children:A.label},A.label)})}),Be(Rr,{sx:{borderColor:"#e6e6e3"}}),Pr(Or,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[Be(Ci,{hideProject:a,showEstimatedTime:!w,values:{tabKey:ie,managerName:g,receiverNames:I,startDate:S,dueDate:b,reminder:R,priority:q,estimatedTime:k,eventTime:L,eventPlace:m,eventAddress:T},onChangeEstimatedTime:A=>e.setFormValue("estimated_time",A),customTabs:t,avatarSrcByName:r,notice:i,event:w,onChangeEventTime:A=>e.setFormValue("event_time",A),onChangeEventPlace:A=>e.setFormValue("event_place",A),onChangeEventAddress:A=>e.setFormValue("event_address",A),targetSummary:Me,onChangeProject:A=>e.setFormValue("tab_key",A),onAddProject:c,onChangeStartDate:A=>e.setFormValue("start_date",A),onChangeDueDate:A=>e.setFormValue("due_date",A),onChangeReminder:A=>e.setFormValue("reminder",A),onChangePriority:A=>e.setFormValue("priority",A),onMemberEdit:p,trailing:Pr(Ai,{children:[me&&!w&&!i?Pr(Ai,{children:[Be(xe,{icon:Be(OT,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:A=>Ae(A),children:ye>0?ee.find(A=>A.seq===ye)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":Be(Or,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),Be(xe,{icon:Be(RT,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:Be(Rt,{value:he>0?String(he):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:A=>e.setFormValue("story_points",Number(A.replace(/[^0-9.]/g,""))||0)})})]}):null,y?Be(vi,{values:{repro:_,device:E,where:v,version:D},onChangeRepro:A=>e.setFormValue("bug_repro",A),onChangeDevice:A=>e.setFormValue("bug_device",A),onChangeWhere:A=>e.setFormValue("bug_where",A),onChangeVersion:A=>e.setFormValue("bug_version",A)}):null]}),leading:w||s?null:Be(Or,{sx:{gridColumn:"1 / -1"},children:Be(xe,{icon:Be(ET,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:A=>J(A),children:(H??[]).length>0?Be(Wt,{labelKeys:H??[],labelOptions:o}):Be(Or,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),Be(Rr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Be(Wo,{icon:Be(DT,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:Be(Ii,{syncKey:M,value:ae,onChange:A=>e.setFormValue("content",A)})}),w?null:Be(Rr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),w?null:Be(wi,{taskSeq:0,checklist:ce,onAdd:(A,ue)=>e.setFormValue("checklist",[...ce,{label:ue,checked:!1}]),onToggle:(A,ue,ge)=>e.setFormValue("checklist",ce.map((de,qe)=>qe===ue?{...de,checked:ge}:de)),onRemove:(A,ue)=>e.setFormValue("checklist",ce.filter((ge,de)=>de!==ue)),onUpdate:(A,ue,ge)=>e.setFormValue("checklist",ce.map((de,qe)=>qe===ue?{...de,label:ge}:de))}),Be(Rr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Be(Oi,{taskSeq:0,attachments:$.map(A=>({name:A.name,size:A.size})),onAdd:(A,ue)=>{let ge=nm(ue,h);ge.message&&zT(ge.message),ge.accepted.length!==0&&C.setValue("createAttachmentFiles",[...C.getValue("createAttachmentFiles")??[],...ge.accepted])},onRemove:(A,ue)=>C.setValue("createAttachmentFiles",$.filter((ge,de)=>de!==ue))}),y?null:Pr(Ai,{children:[Be(Rr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Be(Wo,{icon:Be(MT,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:Be(PT,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),Be(_T,{transitionDuration:0,anchorEl:ze,open:!!ze,onClose:()=>Ae(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...ee.map(A=>({seq:A.seq,label:Fo(A)}))].map(A=>Be(wT,{onClick:()=>{e.setFormValue("sprint_seq",A.seq),Ae(null)},sx:{fontSize:14,minWidth:170},children:A.label},A.seq))}),Be(Pi,{anchorEl:K,selectedKeys:H??[],labelOptions:o,onToggle:A=>e.setFormValue("label_keys",Vr(H??[],A)),onAddLabel:(A,ue)=>f?.(A,ue),onClose:()=>J(null)})]})}import{Fragment as sm,jsx as Ge,jsxs as Jn}from"react/jsx-runtime";function iP({open:e,onClose:o,...t}){let{form:n,presetDueDate:r="",presetTabKey:i="",presetManager:a=null,isNotice:l=!1,defaultBug:d=!1}=t,s=gt(),u=qT(!1),[x,p]=am(0),[c,f]=am(null),M=n.useFormValue("title"),C=n.useFormValue("icon"),h=n.useFormValue("icon_color"),g=!!n.useFormValue("is_event"),I=!!n.useFormValue("is_bug"),S=we(),y=s.useValue("createSubmitting")??!1,_=Pn(C||Re),E=l?"\uACF5\uC9C0 \uB4F1\uB85D":g?"\uC77C\uC815 \uB4F1\uB85D":I?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",v=l?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":g?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":I?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";AT(()=>{let m=u.current;u.current=e,!(!e||m)&&(n.setFormValues({...n.getFormValues(),title:"",icon:l?vo:d?fr:Re,icon_color:l?"#e5484d":d?xr:"",manager_name:a?.name??"",manager_account_seq:a?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:l,is_event:!1,is_bug:d,is_open:d,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:We(new Date),due_date:r,reminder:"none",priority:"medium",note:"",content:"",checklist:[],tab_key:i}),s.setValue("createAttachmentFiles",[]),p(T=>T+1))},[e]);let D=Jn(tn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[Ge(dl,{size:"small","aria-label":"\uC544\uC774\uCF58 \uBCC0\uACBD",onClick:m=>f(m.currentTarget),sx:{p:0,color:h||"#1e3a8a"},children:Ge(_,{sx:{fontSize:20}})}),Ge(tn,{component:"input",autoFocus:!0,spellCheck:!1,value:M,placeholder:v,onChange:m=>n.setFormValue("title",m.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}})]}),L=Ge(Xn,{anchorEl:c,value:C,color:h||"#1e3a8a",onSelect:m=>n.setFormValue("icon",m),onSelectColor:m=>n.setFormValue("icon_color",m),onClose:()=>f(null)});return S?Jn(sm,{children:[Ge(WT,{open:e,onClose:o,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:E,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:Ge(ul,{variant:"contained",size:"small",disableElevation:!0,disabled:y,onClick:y?void 0:n.submit,sx:{ml:2,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"}},children:"\uC800\uC7A5"}),tooltip:y?"\uC800\uC7A5 \uC911\u2026":""}]},fullScreen:!0,mobilePresentation:"slide",tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!1},sections:[{id:"task-create",title:"",showTitle:!1,children:Ge(tn,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:Ge(ml,{...t,contentSyncKey:`create-${x}`,leadingRow:D})})}]}),L]}):Jn(sm,{children:[Ge(LT,{anchor:"right",open:e,onClose:o,sx:{zIndex:m=>m.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Jn(tn,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[Jn(tn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[Ge(NT,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:Ge(dl,{size:"small",onClick:m=>f(m.currentTarget),sx:{color:h||"#1e3a8a"},children:Ge(_,{sx:{fontSize:20}})})}),Ge(tn,{component:"input",autoFocus:!0,spellCheck:!1,value:M,placeholder:v,onChange:m=>n.setFormValue("title",m.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),Ge(dl,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:Ge(FT,{})})]}),Ge(lm,{sx:{borderColor:"#e6e6e3"}}),Ge(tn,{sx:{flex:1,minHeight:0},children:Ge(HT,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Ge(ml,{...t,contentSyncKey:`create-${x}`})})}),Ge(lm,{sx:{borderColor:"#e6e6e3"}}),Jn(tn,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[Ge(ul,{onClick:o,color:"inherit",disabled:y,children:"\uCDE8\uC18C"}),Ge(ul,{onClick:n.submit,variant:"contained",disabled:y,children:y?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),L]})}import{useEffect as wm,useRef as Dm,useState as Mm}from"react";import{Box as $i,Button as Uy,Divider as Em,Drawer as Vy}from"@mui/material";import Gy from"@mui/icons-material/ShareOutlined";import jy from"@mui/icons-material/HistoryOutlined";import Yy from"@ehfuse/overlay-scrollbar";import{FormDialog as Xy}from"@ehfuse/mui-form-dialog";import{SuccessAlert as Om}from"@ehfuse/alerts";import{useRef as fl,useState as er}from"react";import{Box as re,Button as cm,Chip as qi,IconButton as Qo,Tooltip as pm}from"@mui/material";import mm from"@mui/icons-material/Send";import{TextField as $T}from"@ehfuse/mui-form-controls";import Li from"@mui/icons-material/Close";import KT from"@mui/icons-material/EditOutlined";import UT from"@mui/icons-material/Favorite";import VT from"@mui/icons-material/FavoriteBorderOutlined";import GT from"@mui/icons-material/CheckCircle";import jT from"@mui/icons-material/CheckCircleOutlineOutlined";import or from"@mui/icons-material/AttachFileOutlined";import YT from"@mui/icons-material/AddCircleOutline";import XT from"@mui/icons-material/ImageOutlined";var pl=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};import{Fragment as dm,jsx as U,jsxs as je}from"react/jsx-runtime";var QT=5;function um({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(s=>s.account_seq===t),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",l=r.length===0?a:U(re,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(s=>`${s.name} \xB7 ${s.time}`).join(`
8
- `)}),d=e==="like"?"#e5484d":"#2f80ed";return U(pm,{title:l,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:je(re,{sx:{display:"inline-flex",alignItems:"center"},children:[U(Qo,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?d:"#c9c8c5",p:.5},children:e==="like"?i?U(UT,{sx:{fontSize:16}}):U(VT,{sx:{fontSize:16}}):i?U(GT,{sx:{fontSize:16}}):U(jT,{sx:{fontSize:16}})}),r.length>0?U(re,{component:"span",sx:{fontSize:12,color:i?d:"#9a9a97",ml:-.25},children:r.length}):null]})})}function fm({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:l,onPreview:d,onDownload:s}){let[u,x]=er(null),p=fl(null),[c,f]=er(null),[M,C]=er(!1),h=Math.max(0,o.length-QT),g=h>0&&!M,I=u?Math.min(u.index,h):h,S=o.map((v,D)=>({comment:v,index:D})).slice(g?I:0),w=dr(),y=v=>{if(d){d(v);return}window.open(w(v.uuid??""),"_blank","noopener,noreferrer")},_=v=>{if(s){s(v);return}window.open(w(v.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},E=Ao().slots?.avatar;return je(re,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[je(re,{sx:{display:"flex",alignItems:"center",gap:1},children:[U(Kt,{sx:{fontSize:18,display:"block",color:"#37352f"}}),je(re,{sx:{fontSize:ol,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),h>0&&(!g||I>0)?U(re,{role:"button",tabIndex:0,onClick:()=>C(v=>!v),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),C(D=>!D))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:g?`\uC774\uC804 \uB313\uAE00 ${I}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?U(re,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,U(re,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:S.map(({comment:v,index:D})=>{let L=!!t&&v.author===t;return je(re,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let m=r?.get(v.author)??"";return E?U(re,{sx:{display:"inline-flex",flexShrink:0},children:U(E,{name:v.author,src:m||void 0,size:44})}):U(re,{sx:{display:"inline-flex",flexShrink:0},children:U(rt,{src:m,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Ln[0]},iconFontSize:24})})})(),je(re,{sx:{flex:1,minWidth:0},children:[je(re,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[U(re,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.author}),U(re,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:v.time}),L?U(re,{sx:{ml:"auto"}}):je(re,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[U(um,{kind:"like",reactions:v.likes,myAccountSeq:n,onToggle:()=>l?.(e,D,"like")}),U(um,{kind:"ack",reactions:v.acks,myAccountSeq:n,onToggle:()=>l?.(e,D,"ack")})]}),L?je(re,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[U(Qo,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>x({index:D,text:v.text,attachments:[...v.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:U(KT,{sx:{fontSize:15}})}),U(Qo,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:m=>f({anchorEl:m.currentTarget,index:D}),sx:{color:"#9a9a97"},children:U(Li,{sx:{fontSize:15}})})]}):null]}),u?.index===D?je(re,{sx:{mt:.5},children:[U(re,{component:"textarea",autoFocus:!0,spellCheck:!1,value:u.text,onChange:m=>x({...u,text:m.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),je(re,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[u.attachments.map((m,T)=>{let b=()=>x({...u,attachments:u.attachments.filter((k,R)=>R!==T)});return Ni(m.name)&&m.uuid?je(re,{sx:{position:"relative"},children:[U(re,{component:"img",src:w(m.uuid,{thumb:"md"}),alt:m.name,title:m.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:b,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Li,{sx:{fontSize:14}})})]},`kept-${m.uuid}-${T}`):U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:m.name,onDelete:b,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${m.uuid??m.name}-${T}`)}),u.files.map((m,T)=>{let b=()=>x({...u,files:u.files.filter((k,R)=>R!==T)});return Ni(m.name)?je(re,{sx:{position:"relative"},children:[U(re,{component:"img",src:URL.createObjectURL(m),alt:m.name,title:`${m.name} (\uC0C8 \uD30C\uC77C)`,onLoad:k=>URL.revokeObjectURL(k.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:b,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Li,{sx:{fontSize:14}})})]},`new-${m.name}-${T}`):U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:`${m.name} (\uC0C8 \uD30C\uC77C)`,onDelete:b,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${m.name}-${T}`)}),U(pm,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>p.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:U(YT,{sx:{fontSize:20}})})})]}),je(re,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[U(cm,{size:"small",color:"inherit",onClick:()=>x(null),children:"\uCDE8\uC18C"}),U(cm,{size:"small",variant:"contained",disabled:!u.text.trim()&&u.attachments.length===0&&u.files.length===0,onClick:()=>{i(e,D,u.text,{attachments:u.attachments,files:u.files}),x(null)},children:"\uC800\uC7A5"})]}),U(re,{component:"input",type:"file",multiple:!0,ref:p,sx:{display:"none"},onChange:m=>{let T=Array.from(m.target.files??[]);T.length>0&&x({...u,files:[...u.files,...T].slice(0,10)}),m.target.value=""}})]}):je(re,{children:[v.text?U(re,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:v.text}):null,(v.attachments??[]).length>0?U(re,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(v.attachments??[]).map((m,T)=>{let b=!!m.uuid;if(Ni(m.name)&&b)return U(re,{component:"img",src:w(m.uuid??"",{thumb:"md"}),alt:m.name,title:`${m.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>y(m),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${m.name}-${T}`);let R=Di(m.name);return U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:`${m.name} (${pl(m.size)})`,clickable:b,onClick:b?()=>R?y(m):_(m):void 0,title:b?`${m.name} ${R?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:m.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${m.name}-${T}`)})}):null]})]})]},`${v.time}-${D}`)})}),U($e,{open:!!c,anchorEl:c?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>f(null),onConfirm:()=>{c&&(a(e,c.index),x(null)),f(null)}})]})}function Ni(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function xm({onSubmit:e}){let[o,t]=er(""),[n,r]=er([]),[i,a]=er(!1),l=fl(null),d=fl(null),s=we(),u=c=>{let f=Array.from(c??[]);f.length!==0&&r(M=>[...M,...f].slice(0,10))},x=()=>{let c=o.trim();!c&&n.length===0||(e(c,n.length>0?n:void 0),t(""),r([]))},p=je(dm,{children:[U(Qo,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>l.current?.click(),sx:{color:"#9a9a97"},children:U(or,{sx:{fontSize:20}})}),U(Qo,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>d.current?.click(),sx:{color:"#9a9a97"},children:U(XT,{sx:{fontSize:20}})})]});return je(re,{children:[n.length>0?U(re,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((c,f)=>Ni(c.name)?je(re,{sx:{position:"relative"},children:[U(re,{component:"img",src:URL.createObjectURL(c),alt:c.name,title:c.name,onLoad:M=>URL.revokeObjectURL(M.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(M=>M.filter((C,h)=>h!==f)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Li,{sx:{fontSize:14}})})]},`${c.name}-${f}`):U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:`${c.name} (${pl(c.size)})`,onDelete:()=>r(M=>M.filter((C,h)=>h!==f)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${c.name}-${f}`))}):null,je(re,{sx:{position:"relative",display:"flex"},onDragOver:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!0))},onDragLeave:c=>{c.currentTarget.contains(c.relatedTarget)||a(!1)},onDrop:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!1),u(c.dataTransfer?.files??null))},children:[i?je(re,{sx:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",gap:.75,borderRadius:1,border:"2px dashed #2f80ed",bgcolor:"rgba(47,128,237,0.08)",color:"#2f80ed",fontSize:14,fontWeight:600,pointerEvents:"none"},children:[U(or,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,U($T,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:c=>t(c.target.value),fullWidth:!0,multiline:!0,minRows:s?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:s?15:6.5,pb:s?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),s?je(re,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[p,U(Qo,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(mm,{sx:{fontSize:22}})})]}):je(dm,{children:[U(re,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:p}),U(Qo,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(mm,{sx:{fontSize:22}})})]})]}),U(re,{component:"input",ref:l,type:"file",multiple:!0,onChange:c=>{u(c.target.files),c.target.value=""},sx:{display:"none"}}),U(re,{component:"input",ref:d,type:"file",accept:"image/*",multiple:!0,onChange:c=>{u(c.target.files),c.target.value=""},sx:{display:"none"}})]})}import{useState as xl}from"react";import{Box as Wi,Checkbox as sy,IconButton as nr,Tooltip as zr}from"@mui/material";import cy from"@mui/icons-material/Close";import my from"@mui/icons-material/ArrowBack";import uy from"@mui/icons-material/ShareOutlined";import dy from"@mui/icons-material/ContentCopyOutlined";import py from"@mui/icons-material/CheckCircle";import fy from"@mui/icons-material/CheckCircleOutlineOutlined";import xy from"@mui/icons-material/HistoryOutlined";import gy from"@mui/icons-material/PrintOutlined";import{useEffect as ZT}from"react";import{Box as zt,Button as JT,CircularProgress as ey}from"@mui/material";import{FormDialog as oy}from"@ehfuse/mui-form-dialog";import{OverlayScrollbar as ty}from"@ehfuse/overlay-scrollbar";import{jsx as At,jsxs as Fi}from"react/jsx-runtime";var ny={created:"\uC5C5\uBB34\uB97C \uB4F1\uB85D\uD588\uC2B5\uB2C8\uB2E4",completed:"\uC644\uB8CC \uCC98\uB9AC\uD588\uC2B5\uB2C8\uB2E4",uncompleted:"\uC644\uB8CC\uB97C \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4",confirm_requested:"\uD655\uC778\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4",acked:"\uD655\uC778\uD588\uC2B5\uB2C8\uB2E4",claimed:"\uC5C5\uBB34\uB97C \uAC00\uC838\uAC14\uC2B5\uB2C8\uB2E4",bug_verified:"\uC218\uC815\uC744 \uD655\uC778\uD588\uC2B5\uB2C8\uB2E4(\uC885\uB8CC)",bug_reopened:"\uC7AC\uC624\uD508\uD588\uC2B5\uB2C8\uB2E4"};function gm(e){return String(e??"").trim()||"\uC5C6\uC74C"}function ry(e){if(e.kind!=="field")return ny[String(e.kind)]??"\uBCC0\uACBD\uD588\uC2B5\uB2C8\uB2E4";let o=String(e.field_label??e.field??"").trim()||"\uD56D\uBAA9",t=String(e.old_value??"").trim(),n=String(e.new_value??"").trim();return!t&&n?`${o}\uC744(\uB97C) "${n}"(\uC73C)\uB85C \uC785\uB825\uD588\uC2B5\uB2C8\uB2E4`:t&&!n?`${o}\uC744(\uB97C) \uBE44\uC6E0\uC2B5\uB2C8\uB2E4`:`${o}\uC744(\uB97C) "${gm(t)}" \u2192 "${gm(n)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function Hi({open:e,taskSeq:o,items:t,loading:n,onLoad:r,onClose:i}){let a=we();ZT(()=>{e&&o>0&&!t&&r?.(o)},[e,o,t,r]);let l=At(zt,{sx:{height:a?"100%":420,minHeight:0},children:At(ty,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Fi(zt,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[n&&!t?Fi(zt,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[At(ey,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,t&&t.length===0?At(zt,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(t??[]).map(d=>Fi(zt,{sx:{display:"flex",gap:1,alignItems:"baseline",minWidth:0,flexShrink:0},children:[At(zt,{sx:{flexShrink:0,width:"10.5em",whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:Vo(d.acted_time)}),Fi(zt,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[At(zt,{component:"span",sx:{fontWeight:500},children:String(d.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),At(zt,{component:"span",sx:{ml:.5},children:ry(d)})]})]},d.seq))]})})});return At(oy,{open:e,onClose:i,maxWidth:"sm",fullScreen:a,mobilePresentation:a?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:a?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:`\uD65C\uB3D9${t&&t.length>0?` (${t.length})`:""}`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-activity",sections:[{id:"task-activity",showTitle:!1,children:l}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:At(JT,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{InfoAlert as iy,SuccessAlert as ay}from"@ehfuse/alerts";var hm=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
8
+ `)}),d=e==="like"?"#e5484d":"#2f80ed";return U(pm,{title:l,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:je(re,{sx:{display:"inline-flex",alignItems:"center"},children:[U(Qo,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?d:"#c9c8c5",p:.5},children:e==="like"?i?U(UT,{sx:{fontSize:16}}):U(VT,{sx:{fontSize:16}}):i?U(GT,{sx:{fontSize:16}}):U(jT,{sx:{fontSize:16}})}),r.length>0?U(re,{component:"span",sx:{fontSize:12,color:i?d:"#9a9a97",ml:-.25},children:r.length}):null]})})}function fm({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:l,onPreview:d,onDownload:s}){let[u,x]=er(null),p=fl(null),[c,f]=er(null),[M,C]=er(!1),h=Math.max(0,o.length-QT),g=h>0&&!M,I=u?Math.min(u.index,h):h,S=o.map((v,D)=>({comment:v,index:D})).slice(g?I:0),w=dr(),y=v=>{if(d){d(v);return}window.open(w(v.uuid??""),"_blank","noopener,noreferrer")},_=v=>{if(s){s(v);return}window.open(w(v.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},E=Ao().slots?.avatar;return je(re,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[je(re,{sx:{display:"flex",alignItems:"center",gap:1},children:[U(Kt,{sx:{fontSize:18,display:"block",color:"#37352f"}}),je(re,{sx:{fontSize:ol,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),h>0&&(!g||I>0)?U(re,{role:"button",tabIndex:0,onClick:()=>C(v=>!v),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),C(D=>!D))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:g?`\uC774\uC804 \uB313\uAE00 ${I}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?U(re,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,U(re,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:S.map(({comment:v,index:D})=>{let L=!!t&&v.author===t;return je(re,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let m=r?.get(v.author)??"";return E?U(re,{sx:{display:"inline-flex",flexShrink:0},children:U(E,{name:v.author,src:m||void 0,size:44})}):U(re,{sx:{display:"inline-flex",flexShrink:0},children:U(rt,{src:m,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Ln[0]},iconFontSize:24})})})(),je(re,{sx:{flex:1,minWidth:0},children:[je(re,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[U(re,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v.author}),U(re,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:v.time}),L?U(re,{sx:{ml:"auto"}}):je(re,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[U(um,{kind:"like",reactions:v.likes,myAccountSeq:n,onToggle:()=>l?.(e,D,"like")}),U(um,{kind:"ack",reactions:v.acks,myAccountSeq:n,onToggle:()=>l?.(e,D,"ack")})]}),L?je(re,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[U(Qo,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>x({index:D,text:v.text,attachments:[...v.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:U(KT,{sx:{fontSize:15}})}),U(Qo,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:m=>f({anchorEl:m.currentTarget,index:D}),sx:{color:"#9a9a97"},children:U(Li,{sx:{fontSize:15}})})]}):null]}),u?.index===D?je(re,{sx:{mt:.5},children:[U(re,{component:"textarea",autoFocus:!0,spellCheck:!1,value:u.text,onChange:m=>x({...u,text:m.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),je(re,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[u.attachments.map((m,T)=>{let b=()=>x({...u,attachments:u.attachments.filter((k,R)=>R!==T)});return Ni(m.name)&&m.uuid?je(re,{sx:{position:"relative"},children:[U(re,{component:"img",src:w(m.uuid,{thumb:"md"}),alt:m.name,title:m.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:b,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Li,{sx:{fontSize:14}})})]},`kept-${m.uuid}-${T}`):U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:m.name,onDelete:b,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${m.uuid??m.name}-${T}`)}),u.files.map((m,T)=>{let b=()=>x({...u,files:u.files.filter((k,R)=>R!==T)});return Ni(m.name)?je(re,{sx:{position:"relative"},children:[U(re,{component:"img",src:URL.createObjectURL(m),alt:m.name,title:`${m.name} (\uC0C8 \uD30C\uC77C)`,onLoad:k=>URL.revokeObjectURL(k.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:b,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Li,{sx:{fontSize:14}})})]},`new-${m.name}-${T}`):U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:`${m.name} (\uC0C8 \uD30C\uC77C)`,onDelete:b,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${m.name}-${T}`)}),U(pm,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>p.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:U(YT,{sx:{fontSize:20}})})})]}),je(re,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[U(cm,{size:"small",color:"inherit",onClick:()=>x(null),children:"\uCDE8\uC18C"}),U(cm,{size:"small",variant:"contained",disabled:!u.text.trim()&&u.attachments.length===0&&u.files.length===0,onClick:()=>{i(e,D,u.text,{attachments:u.attachments,files:u.files}),x(null)},children:"\uC800\uC7A5"})]}),U(re,{component:"input",type:"file",multiple:!0,ref:p,sx:{display:"none"},onChange:m=>{let T=Array.from(m.target.files??[]);T.length>0&&x({...u,files:[...u.files,...T].slice(0,10)}),m.target.value=""}})]}):je(re,{children:[v.text?U(re,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:v.text}):null,(v.attachments??[]).length>0?U(re,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(v.attachments??[]).map((m,T)=>{let b=!!m.uuid;if(Ni(m.name)&&b)return U(re,{component:"img",src:w(m.uuid??"",{thumb:"md"}),alt:m.name,title:`${m.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>y(m),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${m.name}-${T}`);let R=Di(m.name);return U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:`${m.name} (${pl(m.size)})`,clickable:b,onClick:b?()=>R?y(m):_(m):void 0,title:b?`${m.name} ${R?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:m.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${m.name}-${T}`)})}):null]})]})]},`${v.time}-${D}`)})}),U($e,{open:!!c,anchorEl:c?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>f(null),onConfirm:()=>{c&&(a(e,c.index),x(null)),f(null)}})]})}function Ni(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function xm({onSubmit:e}){let[o,t]=er(""),[n,r]=er([]),[i,a]=er(!1),l=fl(null),d=fl(null),s=we(),u=c=>{let f=Array.from(c??[]);f.length!==0&&r(M=>[...M,...f].slice(0,10))},x=()=>{let c=o.trim();!c&&n.length===0||(e(c,n.length>0?n:void 0),t(""),r([]))},p=je(dm,{children:[U(Qo,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>l.current?.click(),sx:{color:"#9a9a97"},children:U(or,{sx:{fontSize:20}})}),U(Qo,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>d.current?.click(),sx:{color:"#9a9a97"},children:U(XT,{sx:{fontSize:20}})})]});return je(re,{children:[n.length>0?U(re,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((c,f)=>Ni(c.name)?je(re,{sx:{position:"relative"},children:[U(re,{component:"img",src:URL.createObjectURL(c),alt:c.name,title:c.name,onLoad:M=>URL.revokeObjectURL(M.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(Qo,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(M=>M.filter((C,h)=>h!==f)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Li,{sx:{fontSize:14}})})]},`${c.name}-${f}`):U(qi,{size:"small",icon:U(or,{sx:{fontSize:14}}),label:`${c.name} (${pl(c.size)})`,onDelete:()=>r(M=>M.filter((C,h)=>h!==f)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${c.name}-${f}`))}):null,je(re,{sx:{position:"relative",display:"flex"},onDragOver:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!0))},onDragLeave:c=>{c.currentTarget.contains(c.relatedTarget)||a(!1)},onDrop:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!1),u(c.dataTransfer?.files??null))},children:[i?je(re,{sx:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",gap:.75,borderRadius:1,border:"2px dashed #2f80ed",bgcolor:"rgba(47,128,237,0.08)",color:"#2f80ed",fontSize:14,fontWeight:600,pointerEvents:"none"},children:[U(or,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,U($T,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:c=>t(c.target.value),fullWidth:!0,multiline:!0,minRows:s?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:s?15:6.5,pb:s?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),s?je(re,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[p,U(Qo,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(mm,{sx:{fontSize:22}})})]}):je(dm,{children:[U(re,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:p}),U(Qo,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(mm,{sx:{fontSize:22}})})]})]}),U(re,{component:"input",ref:l,type:"file",multiple:!0,onChange:c=>{u(c.target.files),c.target.value=""},sx:{display:"none"}}),U(re,{component:"input",ref:d,type:"file",accept:"image/*",multiple:!0,onChange:c=>{u(c.target.files),c.target.value=""},sx:{display:"none"}})]})}import{useState as xl}from"react";import{Box as Wi,Checkbox as sy,IconButton as nr,Tooltip as zr}from"@mui/material";import cy from"@mui/icons-material/Close";import my from"@mui/icons-material/ArrowBack";import uy from"@mui/icons-material/ShareOutlined";import dy from"@mui/icons-material/ContentCopyOutlined";import py from"@mui/icons-material/CheckCircle";import fy from"@mui/icons-material/CheckCircleOutlineOutlined";import xy from"@mui/icons-material/HistoryOutlined";import gy from"@mui/icons-material/PrintOutlined";import{useEffect as ZT}from"react";import{Box as zt,Button as JT,CircularProgress as ey}from"@mui/material";import{FormDialog as oy}from"@ehfuse/mui-form-dialog";import{OverlayScrollbar as ty}from"@ehfuse/overlay-scrollbar";import{jsx as At,jsxs as Fi}from"react/jsx-runtime";var ny={created:"\uC5C5\uBB34\uB97C \uB4F1\uB85D\uD588\uC2B5\uB2C8\uB2E4",completed:"\uC644\uB8CC \uCC98\uB9AC\uD588\uC2B5\uB2C8\uB2E4",uncompleted:"\uC644\uB8CC\uB97C \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4",confirm_requested:"\uD655\uC778\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4",acked:"\uD655\uC778\uD588\uC2B5\uB2C8\uB2E4",claimed:"\uC5C5\uBB34\uB97C \uAC00\uC838\uAC14\uC2B5\uB2C8\uB2E4",bug_verified:"\uC218\uC815\uC744 \uD655\uC778\uD588\uC2B5\uB2C8\uB2E4(\uC885\uB8CC)",bug_reopened:"\uC7AC\uC624\uD508\uD588\uC2B5\uB2C8\uB2E4"};function gm(e){return String(e??"").trim()||"\uC5C6\uC74C"}function ry(e){if(e.kind!=="field")return ny[String(e.kind)]??"\uBCC0\uACBD\uD588\uC2B5\uB2C8\uB2E4";let o=String(e.field_label??e.field??"").trim()||"\uD56D\uBAA9",t=String(e.old_value??"").trim(),n=String(e.new_value??"").trim();return!t&&n?`${o}\uC744(\uB97C) "${n}"(\uC73C)\uB85C \uC785\uB825\uD588\uC2B5\uB2C8\uB2E4`:t&&!n?`${o}\uC744(\uB97C) \uBE44\uC6E0\uC2B5\uB2C8\uB2E4`:`${o}\uC744(\uB97C) "${gm(t)}" \u2192 "${gm(n)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function Hi({open:e,taskSeq:o,items:t,loading:n,onLoad:r,onClose:i}){let a=we();ZT(()=>{e&&o>0&&!t&&r?.(o)},[e,o,t,r]);let l=At(zt,{sx:{height:a?"100%":420,minHeight:0},children:At(ty,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Fi(zt,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[n&&!t?Fi(zt,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[At(ey,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,t&&t.length===0?At(zt,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(t??[]).map(d=>Fi(zt,{sx:{display:"flex",flexDirection:a?"column":"row",gap:a?.25:1,alignItems:a?"stretch":"baseline",minWidth:0,flexShrink:0,...a?{pb:1,borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none",pb:0}}:{}},children:[At(zt,{sx:{flexShrink:0,...a?{}:{width:"10.5em"},whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:Vo(d.acted_time)}),Fi(zt,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[At(zt,{component:"span",sx:{fontWeight:500},children:String(d.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),At(zt,{component:"span",sx:{ml:.5},children:ry(d)})]})]},d.seq))]})})});return At(oy,{open:e,onClose:i,maxWidth:"sm",fullScreen:a,mobilePresentation:a?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:a?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:`\uD65C\uB3D9${t&&t.length>0?` (${t.length})`:""}`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-activity",sections:[{id:"task-activity",showTitle:!1,children:l}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:At(JT,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{InfoAlert as iy,SuccessAlert as ay}from"@ehfuse/alerts";var hm=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
9
9
  `).replace(/<\/(p|div|li|h[1-6]|tr)>/gi,`
10
10
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&amp;/gi,"&").replace(/\n{3,}/g,`
11
11