@ehfuse/taskbox 0.5.163 → 0.5.164

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.js CHANGED
@@ -4,7 +4,7 @@
4
4
  `),t=document.createElement("div");return t.innerHTML=o,(t.textContent??"").replace(/\n{3,}/g,`
5
5
 
6
6
  `).trim()}function Di({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:l}){let s=(0,gt.useRef)(null),p=(0,gt.useRef)(null),m=i>0?i:0,u=(0,gt.useRef)(m),b=(0,gt.useRef)(l);b.current=l;let f=(0,gt.useRef)(null),c=(0,gt.useRef)(Date.now()+800),[d,D]=(0,gt.useState)(!1),w=Ye();(0,gt.useEffect)(()=>{if(n)return;let g=cs(o);f.current===g||f.current===o||(f.current=g,c.current=Date.now()+800,s.current?.setHtml(g))},[e,o,n]);let y=(0,gt.useRef)(-1);return(0,gt.useEffect)(()=>{if(n||w||i<=0||y.current===i||(y.current=i,Math.abs(i-u.current)<1))return;let g=p.current?.querySelector(".ehfuse-editor-container");g&&(Math.abs(g.getBoundingClientRect().height-i)<1||(g.style.height=`${i}px`,u.current=i))},[n,w,i]),(0,gt.useEffect)(()=>{if(n||w)return;let g=p.current?.querySelector(".ehfuse-editor-container");if(!g||typeof ResizeObserver>"u")return;let O,S=new ResizeObserver(q=>{let B=Math.round(q[0]?.contentRect.height??0);B<=0||(window.clearTimeout(O),O=window.setTimeout(()=>{Math.abs(B-u.current)<1||(u.current=B,b.current?.(B))},300))});return S.observe(g),()=>{window.clearTimeout(O),S.disconnect()}},[n,w]),n?(0,dn.jsxs)(Kn.Box,{sx:{position:"relative",mt:1},children:[(0,dn.jsx)(Kn.Box,{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:cs(o)}}),(0,dn.jsx)(Kn.Tooltip,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:(0,dn.jsx)(Kn.IconButton,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Bf(o)).then(()=>{D(!0),window.setTimeout(()=>D(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:d?(0,dn.jsx)(Sf.default,{sx:{fontSize:17,color:"#2f9e5b"}}):(0,dn.jsx)(yf.default,{sx:{fontSize:17}})})})]}):(0,dn.jsx)(Kn.Box,{ref:p,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:(0,dn.jsx)(Oa.EhfuseEditor,{ref:s,defaultValue:cs(o),autoHeight:w,resizable:!w,showToolbar:!w,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:Oa.minimalToolbarOptions,locale:"ko",minHeight:m||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:g=>{let O=Date.now()<c.current,S=g===f.current;f.current=g,!(O||S)&&t(g)}})})}var Ur=require("react"),Oe=require("@mui/material"),ms=a(require("@mui/icons-material/Close"),1),Ef=a(require("@mui/icons-material/AddCircle"),1),us=a(require("@mui/icons-material/AddTask"),1),Of=a(require("@mui/icons-material/Checklist"),1),Rf=a(require("@mui/icons-material/CheckCircle"),1),Pf=a(require("@mui/icons-material/Launch"),1),zf=a(require("@mui/icons-material/LinkOutlined"),1),qf=a(require("@mui/icons-material/RadioButtonUnchecked"),1);var Gn=require("react"),Xo=require("@mui/material"),vf=require("@ehfuse/mui-form-dialog"),If=require("@ehfuse/mui-form-controls"),_f=require("@ehfuse/alerts"),wf=a(require("@mui/icons-material/CheckCircle"),1),Df=a(require("@mui/icons-material/RadioButtonUnchecked"),1),Mf=require("@ehfuse/overlay-scrollbar");var wo=require("react/jsx-runtime"),Cf=[{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 Mi({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:l=!1,title:s="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:p="\uC5F0\uACB0",multiSelect:m=!1}){let u=Ye(),[b,f]=(0,Gn.useState)("related"),[c,d]=(0,Gn.useState)(""),[D,w]=(0,Gn.useState)([]);(0,Gn.useEffect)(()=>{e&&(f("related"),d(""),w([]))},[e]);let y=(0,Gn.useMemo)(()=>{let B=new Set([o.seq,...n]),E=c.trim().toLowerCase();return t.filter(z=>B.has(z.seq)||z.is_event||z.is_notice||z.linked_only?!1:E?z.title.toLowerCase().includes(E)||(z.ticket_no??"").toLowerCase().includes(E):!0).sort((z,P)=>!!z.completed!=!!P.completed?z.completed?1:-1:P.seq-z.seq)},[t,o.seq,n,c]),g=()=>{if(D.length===0){(0,_f.ErrorAlert)("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let B of D)i(B,b);r()},O=B=>{w(E=>E.includes(B)?E.filter(z=>z!==B):m?[...E,B]:[B])},S=Cf.find(B=>B.type===b)?.hint??"",q=(0,wo.jsxs)(Xo.Box,{sx:{...u?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...u?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[l?null:(0,wo.jsx)(Xo.Tabs,{value:b,onChange:(B,E)=>f(E),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Cf.map(B=>(0,wo.jsx)(Xo.Tab,{value:B.type,label:B.label},B.type))}),l?null:(0,wo.jsx)(Xo.Box,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:S}),(0,wo.jsx)(Xo.Box,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:(0,wo.jsx)(If.ClearTextField,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:c,onChange:B=>d(B.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),(0,wo.jsx)(Xo.Box,{sx:{flex:1,minHeight:0},children:(0,wo.jsx)(Mf.OverlayScrollbar,{style:{height:"100%"},contentStyle:{paddingTop:0},children:(0,wo.jsx)(Xo.Box,{sx:{display:"flex",flexDirection:"column"},children:y.length===0?(0,wo.jsx)(Xo.Box,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):y.map(B=>{let E=no(B.icon||Ue),z=D.includes(B.seq);return(0,wo.jsxs)(Xo.Box,{onClick:()=>O(B.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:z?"#e3eefb":"transparent","&:hover":{bgcolor:z?"#e3eefb":"#f7f7f5"}},children:[z?(0,wo.jsx)(wf.default,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):(0,wo.jsx)(Df.default,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),E?(0,wo.jsx)(E,{sx:{fontSize:17,flexShrink:0,color:B.icon_color||"#1e3a8a"}}):null,(0,wo.jsxs)(Xo.Box,{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:[B.ticket_no?`${B.ticket_no} `:"",B.title]}),(0,wo.jsx)(Xo.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:(0,wo.jsx)(je,{option:Ho(B)})})]},B.seq)})})})})]});return(0,wo.jsx)(vf.FormDialog,{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:s,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:q}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:(0,wo.jsx)(Xo.Button,{variant:"contained",disabled:D.length===0,onClick:g,children:p})}})}var me=require("react/jsx-runtime");function Ei({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:l=!1,onConvertToTask:s,onOpenLinkedTask:p,linkCandidates:m,linkBaseTask:u,onLinkExistingTask:b,resolveLinkedTask:f}){let[c,d]=(0,Ur.useState)(""),[D,w]=(0,Ur.useState)(!1),[y,g]=(0,Ur.useState)(null),O=Ye(),[S,q]=(0,Ur.useState)(null),[B,E]=(0,Ur.useState)(null),z=N=>{let x=N.task_seq?f?.(N.task_seq):void 0;return x?x.completed:N.checked},P=o.filter(z).length,_=()=>{c.trim()&&(t(e,c),d(""))};return(0,me.jsxs)(It,{icon:(0,me.jsx)(Of.default,{sx:{fontSize:19,display:"block"}}),title:(0,me.jsxs)(me.Fragment,{children:["\uD560\uC77C",o.length>0?(0,me.jsxs)(Oe.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[P," / ",o.length]}):null]}),titleExtra:o.length>0?(0,me.jsx)(Oe.Box,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:(0,me.jsx)(Oe.Box,{sx:{height:"100%",borderRadius:3,width:`${Math.round(P/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[(0,me.jsx)(Oe.Box,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((N,x)=>{let h=N.task_seq?f?.(N.task_seq):void 0,v=z(N),T=!!N.task_seq;return(0,me.jsxs)(Oe.Box,{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:[(0,me.jsx)(Oe.Box,{component:"span",onClick:()=>n(e,x,!v),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:v?(0,me.jsx)(Rf.default,{sx:{fontSize:18,color:"#2f80ed"}}):(0,me.jsx)(qf.default,{sx:{fontSize:18,color:"#9a9a97"}})}),y?.index===x?(0,me.jsx)(Oe.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:y.label,enterKeyHint:"done",onChange:k=>g({index:x,label:k.target.value}),onBlur:()=>{y.label.trim()&&y.label.trim()!==N.label&&i?.(e,x,y.label),g(null)},onKeyDown:k=>{k.key==="Enter"&&k.target.blur(),k.key==="Escape"&&g(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):(0,me.jsx)(Oe.Box,{component:"span",onClick:T?N.task_seq&&p?()=>p(N.task_seq):void 0:l||!i?void 0:O?()=>q({index:x,label:N.label}):()=>g({index:x,label:N.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:v?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...T?p?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:l||!i?{}:{cursor:"text"}},children:N.label}),T?(0,me.jsxs)(Oe.Box,{component:"span",onClick:N.task_seq&&p?()=>p(N.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",...p?{cursor:"pointer"}:{}},children:[(0,me.jsx)(Pf.default,{sx:{fontSize:12}}),h?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!l&&!T&&s?(0,me.jsx)(Oe.Tooltip,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:(0,me.jsx)(Oe.IconButton,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:k=>E({anchorEl:k.currentTarget,index:x,label:N.label}),sx:{display:O?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,me.jsx)(us.default,{sx:{fontSize:16}})})}):null,l?null:(0,me.jsx)(Oe.IconButton,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,x),sx:{display:O?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,me.jsx)(ms.default,{sx:{fontSize:15}})})]},`${N.label}-${x}`)})}),(0,me.jsxs)(Oe.Box,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[(0,me.jsx)(Oe.Box,{component:"input",spellCheck:!1,value:c,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:N=>d(N.target.value),onKeyDown:N=>{N.key==="Enter"&&_()},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"}}}),m&&u&&b?(0,me.jsx)(Oe.Tooltip,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:(0,me.jsx)(Oe.IconButton,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:N=>N.preventDefault(),onClick:()=>w(!0),sx:{flexShrink:0,color:"#9a9a97"},children:(0,me.jsx)(zf.default,{sx:{fontSize:20}})})}):null,(0,me.jsx)(Oe.IconButton,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!c.trim(),onMouseDown:N=>N.preventDefault(),onClick:_,sx:{flexShrink:0,color:c.trim()?"#2f80ed":"#c9c8c5"},children:(0,me.jsx)(Ef.default,{sx:{fontSize:20}})})]}),m&&u&&b?(0,me.jsx)(Mi,{open:D,task:u,tasks:m,excludeSeqs:o.map(N=>Number(N.task_seq??0)).filter(N=>N>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>w(!1),onSubmit:N=>{let x=m.find(h=>h.seq===N);b(e,N,String(x?.title??"").trim())}}):null,(0,me.jsx)(Je,{open:!!B,anchorEl:B?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>E(null),onConfirm:()=>{B&&s?.(e,B.index,B.label),E(null)}}),(0,me.jsx)(Oe.Dialog,{open:!!S,onClose:()=>q(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:(0,me.jsxs)(Oe.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[(0,me.jsx)(Oe.Box,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),(0,me.jsx)(Oe.TextField,{autoFocus:!0,fullWidth:!0,size:"medium",value:S?.label??"",onChange:N=>q(x=>x&&{...x,label:N.target.value}),onKeyDown:N=>{if(N.key!=="Enter")return;let x=S;x&&x.label.trim()&&i?.(e,x.index,x.label.trim()),q(null)}}),(0,me.jsxs)(Oe.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[!l&&s&&S&&!o[S.index]?.task_seq?(0,me.jsx)(Oe.IconButton,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{s(e,S.index,o[S.index]?.label??""),q(null)},sx:{color:"#57564f"},children:(0,me.jsx)(us.default,{sx:{fontSize:20}})}):null,!l&&S?(0,me.jsx)(Oe.IconButton,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,S.index),q(null)},sx:{color:"#e5484d"},children:(0,me.jsx)(ms.default,{sx:{fontSize:19}})}):null,(0,me.jsx)(Oe.Box,{sx:{flex:1}}),(0,me.jsx)(Oe.Button,{color:"inherit",onClick:()=>q(null),children:"\uCDE8\uC18C"}),(0,me.jsx)(Oe.Button,{variant:"contained",disabled:!S?.label.trim(),onClick:()=>{S&&S.label.trim()&&i?.(e,S.index,S.label.trim()),q(null)},children:"\uD655\uC778"})]})]})})]})}var Aa=require("react"),_t=require("@mui/material"),Lf=a(require("@mui/icons-material/Close"),1),fs=a(require("@mui/icons-material/AttachFileOutlined"),1);var Dh=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"]),Ra=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return Dh.has(o)};var Af=require("@mui/material");var Kr=require("react/jsx-runtime");function ds(e){let o=nn(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),l=n??0;return!l||e>0&&(t??0)!==e?null:{index:l,total:r??0,queue:i??[]}}function Pa(){let o=nn().useValue("attachmentUpload.progress");return(0,Kr.jsxs)(Kr.Fragment,{children:[o??0,"%"]})}function ps(){let o=nn().useValue("attachmentUpload.progress");return(0,Kr.jsx)(Af.LinearProgress,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}var To=require("react/jsx-runtime");function za(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var qa={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:l}){let[s,p]=(0,Aa.useState)(!1),m=(0,Aa.useRef)(null),u=Ye(),b=Sr(),f=yr(),c=ds(e),d=e===0,D=S=>{if(i){i(S);return}window.open(f(S.uuid??""),"_blank","noopener,noreferrer")},w=S=>{if(l){l(S);return}window.open(f(S.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},y=S=>c?S+1<c.index?"done":S+1===c.index?"uploading":"waiting":"waiting",g=(S,q,B,E={})=>(0,To.jsxs)(_t.Box,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:E.uploading?"#d5e6fb":"#e6e6e3",bgcolor:E.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[(0,To.jsxs)(_t.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[(0,To.jsx)(fs.default,{sx:{fontSize:16,color:"#9a9a97"}}),q,(0,To.jsx)(_t.Box,{component:"span",sx:{fontSize:12,color:E.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:B}),E.removeIndex!==void 0?(0,To.jsx)(_t.IconButton,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,E.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,To.jsx)(Lf.default,{sx:{fontSize:15}})}):null]}),E.uploading?(0,To.jsx)(ps,{}):null]},S),O=S=>{let q=Ra(S.name);return(0,To.jsx)(_t.Box,{component:"button",type:"button",onClick:()=>q?D(S):w(S),title:`${S.name} ${q?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...qa,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(0,To.jsxs)(It,{icon:(0,To.jsx)(fs.default,{sx:{fontSize:18,display:"block"}}),title:(0,To.jsxs)(To.Fragment,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[(0,To.jsxs)(_t.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((S,q)=>{let B=`${S.uuid||S.name}-${q}`;if(d){let E=y(q),z=E==="uploading";return g(B,(0,To.jsx)(_t.Box,{component:"span",sx:{...qa,color:E==="done"?"#37352f":"#9a9a97"},children:S.name}),z?(0,To.jsx)(Pa,{}):za(S.size),{uploading:z,removeIndex:!r&&!c?q:void 0})}return S.uuid?g(B,O(S),za(S.size),{removeIndex:r?void 0:q}):g(B,(0,To.jsx)(_t.Box,{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:{...qa,color:"#9a9a97"},children:S.name}),za(S.size),{removeIndex:r?void 0:q})}),!d&&c?c.queue.slice(c.index-1).map((S,q)=>{let B=q===0;return g(`uploading-${c.index+q}-${S.name}`,(0,To.jsx)(_t.Box,{component:"span",sx:{...qa,color:"#9a9a97"},children:S.name}),B?(0,To.jsx)(Pa,{}):za(S.size),{uploading:B})}):null]}),(0,To.jsx)(_t.Box,{onClick:()=>m.current?.click(),onDragOver:S=>{S.preventDefault(),p(!0)},onDragLeave:()=>p(!1),onDrop:S=>{S.preventDefault(),p(!1);let q=Array.from(S.dataTransfer.files);q.length>0&&t(e,q)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#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 ${b}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${b}MB)`}),(0,To.jsx)(_t.Box,{component:"input",ref:m,type:"file",multiple:!0,onChange:S=>{let q=Array.from(S.target.files??[]);q.length>0&&t(e,q),S.target.value=""},sx:{display:"none"}})]})}var Vf=require("react"),Xt=require("@mui/material"),Uf=a(require("@mui/icons-material/Add"),1);var Ri=require("react"),Gr=require("@mui/material"),Ff=require("@ehfuse/mui-form-dialog"),Hf=require("@ehfuse/mui-form-controls"),Wf=require("@ehfuse/mui-color-picker"),$f=require("@ehfuse/alerts");var pn=require("react/jsx-runtime"),Nf="#2f80ed";function xs({open:e,onClose:o,onSubmit:t}){let[n,r]=(0,Ri.useState)(""),[i,l]=(0,Ri.useState)(Nf);(0,Ri.useEffect)(()=>{e&&(r(""),l(Nf))},[e]);let s=()=>{let u=n.trim();if(!u){(0,$f.ErrorAlert)("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(u,i),o()},p=xl(i),m=(0,pn.jsxs)(Gr.Box,{children:[(0,pn.jsxs)(Gr.Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[(0,pn.jsx)(Hf.ClearTextField,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:u=>r(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),(0,pn.jsx)(Wf.ColorPicker,{value:i,onChange:u=>l(u),shape:"circle",colorSize:28})]}),(0,pn.jsxs)(Gr.Box,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",(0,pn.jsx)(je,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...p}})]})]});return(0,pn.jsx)(Ff.FormDialog,{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:m}],actions:{showCancelButton:!0,right:(0,pn.jsx)(Gr.Button,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}var bt=require("react/jsx-runtime");function Pi({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[l,s]=(0,Vf.useState)(!1),p=rn();return(0,bt.jsxs)(bt.Fragment,{children:[(0,bt.jsxs)(Xt.Menu,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...p,children:[t.map(m=>{let u=o.includes(m.key);return(0,bt.jsxs)(Xt.MenuItem,{onClick:()=>n(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[(0,bt.jsx)(Xt.Checkbox,{size:"small",checked:u,sx:{p:0}}),(0,bt.jsx)(je,{option:m})]},m.key)}),(0,bt.jsx)(Xt.Divider,{}),(0,bt.jsxs)(Xt.MenuItem,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[(0,bt.jsx)(Xt.ListItemIcon,{children:(0,bt.jsx)(Uf.default,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),(0,bt.jsx)(xs,{open:l,onClose:()=>s(!1),onSubmit:r})]})}function Kf(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 Gf(e,o){let t=(e.target_account_seqs??[]).filter(b=>b>0);if(t.length===0)return null;let n=new Set(t),r=Kf(e,o),i=new Map;for(let b of r){let f=String(b.department??"").trim();if(!f)continue;let c=i.get(f)??[];c.push(b),i.set(f,c)}let l=[],s=new Set;for(let[b,f]of i)if(f.every(d=>n.has(Number(d.account_seq??0)))){l.push(b);for(let d of f)s.add(Number(d.account_seq??0))}let p=new Map(r.map(b=>[Number(b.account_seq??0),b.name])),m=e.target_names??[],u=[];return t.forEach((b,f)=>{s.has(b)||u.push(p.get(b)??m[f]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:l,individualNames:u}}function zi(e,o){let t=Gf(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function Mh(e,o){let t=Gf(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function gs(e,o,t){let n=(e.target_account_seqs??[]).filter(u=>u>0),r=Kf(e,o),i=n.length>0?n.length:r.length,l=e.acks??[],s=t>0&&l.some(u=>u.account_seq===t),p=t>0&&Number(e.author_account_seq??0)===t,m=n.length===0||n.includes(t);return{count:l.length,total:i,acked:s,canAck:t>0&&!p&&m&&!s&&!e.completed}}function bs(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),l=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
7
- \uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(s=>s.name).join(", ")}`:null;return{accepted:i,rejected:r,message:l}}var tx=require("@ehfuse/mui-datetime-picker"),ee=require("react/jsx-runtime"),Ss="#0f9d58";function La({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:l=!1,hideBug:s=!1,leadingRow:p,hideLabel:m=!1,employees:u=[],myAccountSeq:b=0,departments:f=[],myGroupSeq:c=0,onMemberEdit:d,onAddProject:D,onAddLabelOption:w,contentSyncKey:y="create"}){let g=nn(),O=Sr(),S=e.useFormValue("manager_name"),q=e.useFormValue("receiver_names"),B=e.useFormValue("start_date"),E=!!e.useFormValue("is_event"),z=!!e.useFormValue("is_bug"),P=e.useFormValue("bug_repro")??"",_=e.useFormValue("bug_device")??"",N=e.useFormValue("bug_where")??"",x=e.useFormValue("bug_version")??"",h=e.useFormValue("event_time")??"",v=e.useFormValue("event_place")??"",T=e.useFormValue("event_address")??"",k=e.useFormValue("due_date"),R=e.useFormValue("estimated_time")??"",Z=e.useFormValue("reminder"),se=e.useFormValue("priority"),Le=e.useFormValue("content"),De=e.useFormValue("checklist")??[],Ce=e.useFormValue("tab_key"),be=e.useFormValue("sprint_seq")??0,ze=e.useFormValue("story_points")??0,Ze=t.find(A=>A.key===Ce&&A.useSprints),so=Ze?n.filter(A=>`custom-${A.group_seq}`===Ce):[],[j,$]=(0,jr.useState)(null),le=e.useFormValue("label_keys"),[I,W]=(0,jr.useState)(null),ne=e.useFormValue("visibility")||"involved",X=Number(e.useFormValue("visibility_group_seq")??0),[Qe,po]=(0,jr.useState)(null),fo=e.useFormValue("repeat_rule")||"",co=e.useFormValue("repeat_until")||"",[$e,yo]=(0,jr.useState)(null),[te,Ne]=(0,jr.useState)(null),on=e.useFormValue("target_names"),J=e.useFormValue("target_account_seqs"),Dt=g.useValue("createAttachmentFiles")??[],Mt=i?zi({author_account_seq:b,target_names:on,target_account_seqs:J},u):"";return(0,ee.jsxs)(ee.Fragment,{children:[p,i?null:(0,ee.jsx)(to.Box,{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"},...s?[]:[{value:"bug",label:"\uC624\uB958"}]].map(A=>{let ve=z?"bug":E?"event":"task",Ge=ve===A.value;return(0,ee.jsx)(to.ButtonBase,{onClick:()=>{if(ve===A.value)return;e.setFormValue("is_event",A.value==="event"),e.setFormValue("is_bug",A.value==="bug"),e.setFormValue("visibility",A.value==="bug"?"all":"involved"),e.setFormValue("visibility_group_seq",0),A.value==="bug"&&(e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until",""));let So=e.getFormValue("icon"),No=e.getFormValue("icon_color"),Et=[Ue,"event",Br].includes(So),yt=!No||No===Ss||No===Cr;Et&&e.setFormValue("icon",A.value==="event"?"event":A.value==="bug"?Br:Ue),yt&&e.setFormValue("icon_color",A.value==="event"?Ss:A.value==="bug"?Cr:"")},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)})}),(0,ee.jsx)(to.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,ee.jsxs)(to.Box,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[(0,ee.jsx)(_i,{hideProject:l,showEstimatedTime:!E,values:{tabKey:Ce,managerName:S,receiverNames:q,startDate:B,dueDate:k,reminder:Z,priority:se,estimatedTime:R,eventTime:h,eventPlace:v,eventAddress:T},onChangeEstimatedTime:A=>e.setFormValue("estimated_time",A),customTabs:t,avatarSrcByName:r,notice:i,event:E,onChangeEventTime:A=>e.setFormValue("event_time",A),onChangeEventPlace:A=>e.setFormValue("event_place",A),onChangeEventAddress:A=>e.setFormValue("event_address",A),targetSummary:Mt,onChangeProject:A=>e.setFormValue("tab_key",A),onAddProject:D,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:d,trailing:(0,ee.jsxs)(ee.Fragment,{children:[i?null:(0,ee.jsx)(fe,{icon:ne==="all"?(0,ee.jsx)(ks.default,{sx:{fontSize:17,color:"#2f80ed"}}):ne==="group"?(0,ee.jsx)(Ts.default,{sx:{fontSize:17,color:"#d9730d"}}):(0,ee.jsx)(hs.default,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:A=>po(A),children:ne==="all"?"\uC804\uCCB4\uACF5\uAC1C":ne==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${f.find(A=>A.seq===X)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}),!i&&!z?(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Zf.default,{sx:{fontSize:17,...fo?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:A=>yo(A),children:fo?Si(fo):(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uC5C6\uC74C"})}):null,!i&&!z&&fo?(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Jf.default,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:A=>Ne(A),children:co?Bt(co):(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uC790\uB3D9"})}):null,Ze&&!E&&!i?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Qf.default,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:A=>$(A),children:be>0?so.find(A=>A.seq===be)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),(0,ee.jsx)(fe,{icon:(0,ee.jsx)(ex.default,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:(0,ee.jsx)(un,{value:ze>0?String(ze):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:A=>e.setFormValue("story_points",Number(A.replace(/[^0-9.]/g,""))||0)})})]}):null,z?(0,ee.jsx)(wi,{values:{repro:P,device:_,where:N,version:x},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:E||m?null:(0,ee.jsx)(to.Box,{sx:{gridColumn:"1 / -1"},children:(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Xf.default,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:A=>W(A),children:(le??[]).length>0?(0,ee.jsx)(yn,{labelKeys:le??[],labelOptions:o}):(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ee.jsx)(It,{icon:(0,ee.jsx)(jf.default,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:(0,ee.jsx)(Di,{syncKey:y,value:Le,onChange:A=>e.setFormValue("content",A)})}),E?null:(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),E?null:(0,ee.jsx)(Ei,{taskSeq:0,checklist:De,onAdd:(A,ve)=>e.setFormValue("checklist",[...De,{label:ve,checked:!1}]),onToggle:(A,ve,Ge)=>e.setFormValue("checklist",De.map((So,No)=>No===ve?{...So,checked:Ge}:So)),onRemove:(A,ve)=>e.setFormValue("checklist",De.filter((Ge,So)=>So!==ve)),onUpdate:(A,ve,Ge)=>e.setFormValue("checklist",De.map((So,No)=>No===ve?{...So,label:Ge}:So))}),(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ee.jsx)(Oi,{taskSeq:0,attachments:Dt.map(A=>({name:A.name,size:A.size})),onAdd:(A,ve)=>{let Ge=bs(ve,O);Ge.message&&(0,ys.InfoAlert)(Ge.message),Ge.accepted.length!==0&&g.setValue("createAttachmentFiles",[...g.getValue("createAttachmentFiles")??[],...Ge.accepted])},onRemove:(A,ve)=>g.setValue("createAttachmentFiles",Dt.filter((Ge,So)=>So!==ve))}),z?null:(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ee.jsx)(It,{icon:(0,ee.jsx)(Yf.default,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:(0,ee.jsx)(ox.TextField,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),(0,ee.jsx)(to.Menu,{transitionDuration:0,anchorEl:j,open:!!j,onClose:()=>$(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...so.map(A=>({seq:A.seq,label:vt(A)}))].map(A=>(0,ee.jsx)(to.MenuItem,{onClick:()=>{e.setFormValue("sprint_seq",A.seq),$(null)},sx:{fontSize:14,minWidth:170},children:A.label},A.seq))}),(0,ee.jsx)(to.Menu,{transitionDuration:0,anchorEl:$e,open:!!$e,onClose:()=>yo(null),children:[{value:"",label:"\uC5C6\uC74C"},...$r].map(A=>(0,ee.jsx)(to.MenuItem,{selected:fo===A.value,onClick:()=>{if(yo(null),A.value===""){e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until","");return}let ve=String(e.getFormValue("due_date")??"").slice(0,10);if(!ve){(0,ys.InfoAlert)(E?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uAE30\uD55C\uC744 \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}e.setFormValue("repeat_rule",A.value),e.setFormValue("repeat_until",Bi(ve,A.value))},sx:{fontSize:14,minWidth:140},children:A.label},A.value||"none"))}),(0,ee.jsx)(tx.DatePicker,{anchorEl:te,open:!!te,onClose:()=>Ne(null),selectedDate:co?new Date(`${co}T00:00:00`):new Date,onDateChange:A=>{let ve=Ge=>String(Ge).padStart(2,"0");e.setFormValue("repeat_until",`${A.getFullYear()}-${ve(A.getMonth()+1)}-${ve(A.getDate())}`),Ne(null)}}),(0,ee.jsx)(to.Menu,{transitionDuration:0,anchorEl:Qe,open:!!Qe,onClose:()=>po(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",tip:"\uC791\uC131\uC790\xB7\uCC45\uC784\uC790\xB7\uCC38\uC870\uC790\uB9CC \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:(0,ee.jsx)(hs.default,{sx:{fontSize:17,color:"#57564f"}}),selected:ne==="involved",onPick:()=>{e.setFormValue("visibility","involved"),e.setFormValue("visibility_group_seq",0)}},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",tip:"\uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:(0,ee.jsx)(ks.default,{sx:{fontSize:17,color:"#2f80ed"}}),selected:ne==="all",onPick:()=>{e.setFormValue("visibility","all"),e.setFormValue("visibility_group_seq",0)}},...[...f].sort((A,ve)=>A.seq===c?-1:ve.seq===c?1:0).map(A=>({key:`group-${A.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${A.name}`,tip:`${A.name} \uC18C\uC18D \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:(0,ee.jsx)(Ts.default,{sx:{fontSize:17,color:"#d9730d"}}),selected:ne==="group"&&X===A.seq,onPick:()=>{e.setFormValue("visibility","group"),e.setFormValue("visibility_group_seq",A.seq)}}))].map(A=>(0,ee.jsx)(to.Tooltip,{title:A.tip,arrow:!0,disableInteractive:!0,placement:"right",children:(0,ee.jsxs)(to.MenuItem,{selected:A.selected,onClick:()=>{A.onPick(),po(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[A.icon,A.label]})},A.key))}),(0,ee.jsx)(Pi,{anchorEl:I,selectedKeys:le??[],labelOptions:o,onToggle:A=>e.setFormValue("label_keys",ai(le??[],A)),onAddLabel:(A,ve)=>w?.(A,ve),onClose:()=>W(null)})]})}var Re=require("react/jsx-runtime");function Eh({open:e,onClose:o,...t}){let{form:n,presetTitle:r="",presetContent:i="",presetVisibility:l,presetVisibilityGroupSeq:s=0,presetDueDate:p="",presetTabKey:m="",presetManager:u=null,isNotice:b=!1,defaultBug:f=!1}=t,c=nn(),d=(0,fr.useRef)(!1),[D,w]=(0,fr.useState)(0),[y,g]=(0,fr.useState)(null),O=n.useFormValue("title"),S=n.useFormValue("icon"),q=n.useFormValue("icon_color"),B=!!n.useFormValue("is_event"),E=!!n.useFormValue("is_bug"),z=Ye(),_=c.useValue("createSubmitting")??!1,N=nr(S||Ue),x=b?"\uACF5\uC9C0 \uB4F1\uB85D":B?"\uC77C\uC815 \uB4F1\uB85D":E?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",h=b?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":B?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":E?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";(0,fr.useEffect)(()=>{let k=d.current;d.current=e,!(!e||k)&&(n.setFormValues({...n.getFormValues(),title:r,icon:b?et:f?Br:Ue,icon_color:b?"#e5484d":f?Cr:"",manager_name:u?.name??"",manager_account_seq:u?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:b,is_event:!1,is_bug:f,visibility:l??(f?"all":"involved"),visibility_group_seq:l==="group"?s:0,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:go(new Date),due_date:p,reminder:"none",priority:"medium",note:"",content:i,checklist:[],tab_key:m}),c.setValue("createAttachmentFiles",[]),w(R=>R+1))},[e]);let v=(0,Re.jsxs)(uo.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[(0,Re.jsx)(uo.IconButton,{size:"small","aria-label":"\uC544\uC774\uCF58 \uBCC0\uACBD",onClick:k=>g(k.currentTarget),sx:{p:0,color:q||"#1e3a8a"},children:(0,Re.jsx)(N,{sx:{fontSize:20}})}),(0,Re.jsx)(uo.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:O,placeholder:h,onChange:k=>n.setFormValue("title",k.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}}})]}),T=(0,Re.jsx)(dr,{anchorEl:y,value:S,color:q||"#1e3a8a",onSelect:k=>n.setFormValue("icon",k),onSelectColor:k=>n.setFormValue("icon_color",k),onClose:()=>g(null)});return z?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(ix.FormDialog,{open:e,onClose:o,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:x,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:(0,Re.jsx)(uo.Button,{variant:"contained",size:"small",disableElevation:!0,disabled:_,onClick:_?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:_?"\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:(0,Re.jsx)(uo.Box,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:(0,Re.jsx)(La,{...t,contentSyncKey:`create-${D}`,leadingRow:v})})}]}),T]}):(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(uo.Drawer,{anchor:"right",open:e,onClose:o,sx:{zIndex:k=>k.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:(0,Re.jsxs)(uo.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,Re.jsxs)(uo.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[(0,Re.jsx)(uo.Tooltip,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:(0,Re.jsx)(uo.IconButton,{size:"small",onClick:k=>g(k.currentTarget),sx:{color:q||"#1e3a8a"},children:(0,Re.jsx)(N,{sx:{fontSize:20}})})}),(0,Re.jsx)(uo.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:O,placeholder:h,onChange:k=>n.setFormValue("title",k.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}}}),(0,Re.jsx)(uo.IconButton,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:(0,Re.jsx)(nx.default,{})})]}),(0,Re.jsx)(uo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,Re.jsx)(uo.Box,{sx:{flex:1,minHeight:0},children:(0,Re.jsx)(rx.default,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:(0,Re.jsx)(La,{...t,contentSyncKey:`create-${D}`})})}),(0,Re.jsx)(uo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,Re.jsxs)(uo.Box,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[(0,Re.jsx)(uo.Button,{onClick:o,color:"inherit",disabled:_,children:"\uCDE8\uC18C"}),(0,Re.jsx)(uo.Button,{onClick:n.submit,variant:"contained",disabled:_,children:_?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),T]})}var Dn=require("react"),$t=require("@mui/material"),Jx=a(require("@mui/icons-material/ShareOutlined"),1),eg=a(require("@mui/icons-material/HistoryOutlined"),1),og=a(require("@ehfuse/overlay-scrollbar"),1),tg=require("@ehfuse/mui-form-dialog"),Ls=require("@ehfuse/alerts");var Qt=require("react"),Q=require("@mui/material"),Cs=a(require("@mui/icons-material/Send"),1),lx=require("@ehfuse/mui-form-controls"),qi=a(require("@mui/icons-material/Close"),1),sx=a(require("@mui/icons-material/EditOutlined"),1),cx=a(require("@mui/icons-material/Favorite"),1),mx=a(require("@mui/icons-material/FavoriteBorderOutlined"),1),ux=a(require("@mui/icons-material/CheckCircle"),1),dx=a(require("@mui/icons-material/CheckCircleOutlineOutlined"),1),xr=a(require("@mui/icons-material/AttachFileOutlined"),1),px=a(require("@mui/icons-material/AddCircleOutline"),1),fx=a(require("@mui/icons-material/ImageOutlined"),1);var Bs=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]};var F=require("react/jsx-runtime"),Oh=5;function ax({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(m=>m.account_seq===t),l=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",s=r.length===0?l:(0,F.jsx)(Q.Box,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(m=>`${m.name} \xB7 ${m.time}`).join(`
7
+ \uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(s=>s.name).join(", ")}`:null;return{accepted:i,rejected:r,message:l}}var tx=require("@ehfuse/mui-datetime-picker"),ee=require("react/jsx-runtime"),Ss="#0f9d58";function La({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:l=!1,hideBug:s=!1,leadingRow:p,hideLabel:m=!1,employees:u=[],myAccountSeq:b=0,departments:f=[],myGroupSeq:c=0,onMemberEdit:d,onAddProject:D,onAddLabelOption:w,contentSyncKey:y="create"}){let g=nn(),O=Sr(),S=e.useFormValue("manager_name"),q=e.useFormValue("receiver_names"),B=e.useFormValue("start_date"),E=!!e.useFormValue("is_event"),z=!!e.useFormValue("is_bug"),P=e.useFormValue("bug_repro")??"",_=e.useFormValue("bug_device")??"",N=e.useFormValue("bug_where")??"",x=e.useFormValue("bug_version")??"",h=e.useFormValue("event_time")??"",v=e.useFormValue("event_place")??"",T=e.useFormValue("event_address")??"",k=e.useFormValue("due_date"),R=e.useFormValue("estimated_time")??"",Z=e.useFormValue("reminder"),se=e.useFormValue("priority"),Le=e.useFormValue("content"),De=e.useFormValue("checklist")??[],Ce=e.useFormValue("tab_key"),be=e.useFormValue("sprint_seq")??0,ze=e.useFormValue("story_points")??0,Ze=t.find(A=>A.key===Ce&&A.useSprints),so=Ze?n.filter(A=>`custom-${A.group_seq}`===Ce):[],[j,$]=(0,jr.useState)(null),le=e.useFormValue("label_keys"),[I,W]=(0,jr.useState)(null),ne=e.useFormValue("visibility")||"involved",X=Number(e.useFormValue("visibility_group_seq")??0),[Qe,po]=(0,jr.useState)(null),fo=e.useFormValue("repeat_rule")||"",co=e.useFormValue("repeat_until")||"",[$e,yo]=(0,jr.useState)(null),[te,Ne]=(0,jr.useState)(null),on=e.useFormValue("target_names"),J=e.useFormValue("target_account_seqs"),Dt=g.useValue("createAttachmentFiles")??[],Mt=i?zi({author_account_seq:b,target_names:on,target_account_seqs:J},u):"";return(0,ee.jsxs)(ee.Fragment,{children:[p,i?null:(0,ee.jsx)(to.Box,{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"},...s?[]:[{value:"bug",label:"\uC624\uB958"}]].map(A=>{let ve=z?"bug":E?"event":"task",Ge=ve===A.value;return(0,ee.jsx)(to.ButtonBase,{onClick:()=>{if(ve===A.value)return;e.setFormValue("is_event",A.value==="event"),e.setFormValue("is_bug",A.value==="bug"),e.setFormValue("visibility",A.value==="bug"?"all":"involved"),e.setFormValue("visibility_group_seq",0),A.value==="bug"&&(e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until",""));let So=e.getFormValue("icon"),No=e.getFormValue("icon_color"),Et=[Ue,"event",Br].includes(So),yt=!No||No===Ss||No===Cr;Et&&e.setFormValue("icon",A.value==="event"?"event":A.value==="bug"?Br:Ue),yt&&e.setFormValue("icon_color",A.value==="event"?Ss:A.value==="bug"?Cr:"")},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)})}),(0,ee.jsx)(to.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,ee.jsxs)(to.Box,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[(0,ee.jsx)(_i,{hideProject:l,showEstimatedTime:!E,values:{tabKey:Ce,managerName:S,receiverNames:q,startDate:B,dueDate:k,reminder:Z,priority:se,estimatedTime:R,eventTime:h,eventPlace:v,eventAddress:T},onChangeEstimatedTime:A=>e.setFormValue("estimated_time",A),customTabs:t,avatarSrcByName:r,notice:i,event:E,onChangeEventTime:A=>e.setFormValue("event_time",A),onChangeEventPlace:A=>e.setFormValue("event_place",A),onChangeEventAddress:A=>e.setFormValue("event_address",A),targetSummary:Mt,onChangeProject:A=>e.setFormValue("tab_key",A),onAddProject:D,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:d,trailing:(0,ee.jsxs)(ee.Fragment,{children:[i?null:(0,ee.jsx)(fe,{icon:ne==="all"?(0,ee.jsx)(ks.default,{sx:{fontSize:17,color:"#2f80ed"}}):ne==="group"?(0,ee.jsx)(Ts.default,{sx:{fontSize:17,color:"#d9730d"}}):(0,ee.jsx)(hs.default,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:A=>po(A),children:ne==="all"?"\uC804\uCCB4\uACF5\uAC1C":ne==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${f.find(A=>A.seq===X)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}),!i&&!z?(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Zf.default,{sx:{fontSize:17,...fo?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:A=>yo(A),children:fo?Si(fo):(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uC5C6\uC74C"})}):null,!i&&!z&&fo?(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Jf.default,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:A=>Ne(A),children:co?Bt(co):(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uC790\uB3D9"})}):null,Ze&&!E&&!i?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Qf.default,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:A=>$(A),children:be>0?so.find(A=>A.seq===be)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),(0,ee.jsx)(fe,{icon:(0,ee.jsx)(ex.default,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:(0,ee.jsx)(un,{value:ze>0?String(ze):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:A=>e.setFormValue("story_points",Number(A.replace(/[^0-9.]/g,""))||0)})})]}):null,z?(0,ee.jsx)(wi,{values:{repro:P,device:_,where:N,version:x},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:E||m?null:(0,ee.jsx)(to.Box,{sx:{gridColumn:"1 / -1"},children:(0,ee.jsx)(fe,{icon:(0,ee.jsx)(Xf.default,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:A=>W(A),children:(le??[]).length>0?(0,ee.jsx)(yn,{labelKeys:le??[],labelOptions:o}):(0,ee.jsx)(to.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ee.jsx)(It,{icon:(0,ee.jsx)(jf.default,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:(0,ee.jsx)(Di,{syncKey:y,value:Le,onChange:A=>e.setFormValue("content",A)})}),E?null:(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),E?null:(0,ee.jsx)(Ei,{taskSeq:0,checklist:De,onAdd:(A,ve)=>e.setFormValue("checklist",[...De,{label:ve,checked:!1}]),onToggle:(A,ve,Ge)=>e.setFormValue("checklist",De.map((So,No)=>No===ve?{...So,checked:Ge}:So)),onRemove:(A,ve)=>e.setFormValue("checklist",De.filter((Ge,So)=>So!==ve)),onUpdate:(A,ve,Ge)=>e.setFormValue("checklist",De.map((So,No)=>No===ve?{...So,label:Ge}:So))}),(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ee.jsx)(Oi,{taskSeq:0,attachments:Dt.map(A=>({name:A.name,size:A.size})),onAdd:(A,ve)=>{let Ge=bs(ve,O);Ge.message&&(0,ys.InfoAlert)(Ge.message),Ge.accepted.length!==0&&g.setValue("createAttachmentFiles",[...g.getValue("createAttachmentFiles")??[],...Ge.accepted])},onRemove:(A,ve)=>g.setValue("createAttachmentFiles",Dt.filter((Ge,So)=>So!==ve))}),z?null:(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(to.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ee.jsx)(It,{icon:(0,ee.jsx)(Yf.default,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:(0,ee.jsx)(ox.TextField,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),(0,ee.jsx)(to.Menu,{transitionDuration:0,anchorEl:j,open:!!j,onClose:()=>$(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...so.map(A=>({seq:A.seq,label:vt(A)}))].map(A=>(0,ee.jsx)(to.MenuItem,{onClick:()=>{e.setFormValue("sprint_seq",A.seq),$(null)},sx:{fontSize:14,minWidth:170},children:A.label},A.seq))}),(0,ee.jsx)(to.Menu,{transitionDuration:0,anchorEl:$e,open:!!$e,onClose:()=>yo(null),children:[{value:"",label:"\uC5C6\uC74C"},...$r].map(A=>(0,ee.jsx)(to.MenuItem,{selected:fo===A.value,onClick:()=>{if(yo(null),A.value===""){e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until","");return}let ve=String(e.getFormValue("due_date")??"").slice(0,10);if(!ve){(0,ys.InfoAlert)(E?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uAE30\uD55C\uC744 \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}e.setFormValue("repeat_rule",A.value),e.setFormValue("repeat_until",Bi(ve,A.value))},sx:{fontSize:14,minWidth:140},children:A.label},A.value||"none"))}),(0,ee.jsx)(tx.DatePicker,{anchorEl:te,open:!!te,onClose:()=>Ne(null),selectedDate:co?new Date(`${co}T00:00:00`):new Date,onDateChange:A=>{let ve=Ge=>String(Ge).padStart(2,"0");e.setFormValue("repeat_until",`${A.getFullYear()}-${ve(A.getMonth()+1)}-${ve(A.getDate())}`),Ne(null)}}),(0,ee.jsx)(to.Menu,{transitionDuration:0,anchorEl:Qe,open:!!Qe,onClose:()=>po(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",tip:"\uC791\uC131\uC790\xB7\uCC45\uC784\uC790\xB7\uCC38\uC870\uC790\uB9CC \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:(0,ee.jsx)(hs.default,{sx:{fontSize:17,color:"#57564f"}}),selected:ne==="involved",onPick:()=>{e.setFormValue("visibility","involved"),e.setFormValue("visibility_group_seq",0)}},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",tip:"\uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:(0,ee.jsx)(ks.default,{sx:{fontSize:17,color:"#2f80ed"}}),selected:ne==="all",onPick:()=>{e.setFormValue("visibility","all"),e.setFormValue("visibility_group_seq",0)}},...[...f].sort((A,ve)=>A.seq===c?-1:ve.seq===c?1:0).map(A=>({key:`group-${A.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${A.name}`,tip:`${A.name} \uC18C\uC18D \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:(0,ee.jsx)(Ts.default,{sx:{fontSize:17,color:"#d9730d"}}),selected:ne==="group"&&X===A.seq,onPick:()=>{e.setFormValue("visibility","group"),e.setFormValue("visibility_group_seq",A.seq)}}))].map(A=>(0,ee.jsx)(to.Tooltip,{title:A.tip,arrow:!0,disableInteractive:!0,placement:"right",children:(0,ee.jsxs)(to.MenuItem,{selected:A.selected,onClick:()=>{A.onPick(),po(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[A.icon,A.label]})},A.key))}),(0,ee.jsx)(Pi,{anchorEl:I,selectedKeys:le??[],labelOptions:o,onToggle:A=>e.setFormValue("label_keys",ai(le??[],A)),onAddLabel:(A,ve)=>w?.(A,ve),onClose:()=>W(null)})]})}var Re=require("react/jsx-runtime");function Eh({open:e,onClose:o,...t}){let{form:n,presetTitle:r="",presetContent:i="",presetVisibility:l,presetVisibilityGroupSeq:s=0,presetDueDate:p="",presetTabKey:m="",presetManager:u=null,isNotice:b=!1,defaultBug:f=!1}=t,c=nn(),d=(0,fr.useRef)(!1),[D,w]=(0,fr.useState)(0),[y,g]=(0,fr.useState)(null),O=n.useFormValue("title"),S=n.useFormValue("icon"),q=n.useFormValue("icon_color"),B=!!n.useFormValue("is_event"),E=!!n.useFormValue("is_bug"),z=Ye(),_=c.useValue("createSubmitting")??!1,N=nr(S||Ue),x=b?"\uACF5\uC9C0 \uB4F1\uB85D":B?"\uC77C\uC815 \uB4F1\uB85D":E?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",h=b?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":B?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":E?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";(0,fr.useEffect)(()=>{let k=d.current;d.current=e,!(!e||k)&&(n.setFormValues({...n.getFormValues(),title:r,icon:b?et:f?Br:Ue,icon_color:b?"#e5484d":f?Cr:"",manager_name:u?.name??"",manager_account_seq:u?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:b,is_event:!1,is_bug:f,visibility:l??(f?"all":"involved"),visibility_group_seq:l==="group"?s:0,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:go(new Date),due_date:p,reminder:"none",priority:"medium",note:"",content:i,checklist:[],tab_key:m}),c.setValue("createAttachmentFiles",[]),w(R=>R+1))},[e]);let v=(0,Re.jsxs)(uo.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[(0,Re.jsx)(uo.IconButton,{size:"small","aria-label":"\uC544\uC774\uCF58 \uBCC0\uACBD",onClick:k=>g(k.currentTarget),sx:{p:0,color:q||"#1e3a8a"},children:(0,Re.jsx)(N,{sx:{fontSize:20}})}),(0,Re.jsx)(uo.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:O,placeholder:h,onChange:k=>n.setFormValue("title",k.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}}})]}),T=(0,Re.jsx)(dr,{anchorEl:y,value:S,color:q||"#1e3a8a",onSelect:k=>n.setFormValue("icon",k),onSelectColor:k=>n.setFormValue("icon_color",k),onClose:()=>g(null)});return z?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(ix.FormDialog,{open:e,onClose:o,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:x,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:(0,Re.jsx)(uo.Button,{variant:"contained",size:"small",disableElevation:!0,disabled:_,onClick:_?void 0:n.submit,sx:{ml:2,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:_?"\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:(0,Re.jsx)(uo.Box,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:(0,Re.jsx)(La,{...t,contentSyncKey:`create-${D}`,leadingRow:v})})}]}),T]}):(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(uo.Drawer,{anchor:"right",open:e,onClose:o,sx:{zIndex:k=>k.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:(0,Re.jsxs)(uo.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,Re.jsxs)(uo.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[(0,Re.jsx)(uo.Tooltip,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:(0,Re.jsx)(uo.IconButton,{size:"small",onClick:k=>g(k.currentTarget),sx:{color:q||"#1e3a8a"},children:(0,Re.jsx)(N,{sx:{fontSize:20}})})}),(0,Re.jsx)(uo.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:O,placeholder:h,onChange:k=>n.setFormValue("title",k.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}}}),(0,Re.jsx)(uo.IconButton,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:(0,Re.jsx)(nx.default,{})})]}),(0,Re.jsx)(uo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,Re.jsx)(uo.Box,{sx:{flex:1,minHeight:0},children:(0,Re.jsx)(rx.default,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:(0,Re.jsx)(La,{...t,contentSyncKey:`create-${D}`})})}),(0,Re.jsx)(uo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,Re.jsxs)(uo.Box,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[(0,Re.jsx)(uo.Button,{onClick:o,color:"inherit",disabled:_,children:"\uCDE8\uC18C"}),(0,Re.jsx)(uo.Button,{onClick:n.submit,variant:"contained",disabled:_,children:_?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),T]})}var Dn=require("react"),$t=require("@mui/material"),Jx=a(require("@mui/icons-material/ShareOutlined"),1),eg=a(require("@mui/icons-material/HistoryOutlined"),1),og=a(require("@ehfuse/overlay-scrollbar"),1),tg=require("@ehfuse/mui-form-dialog"),Ls=require("@ehfuse/alerts");var Qt=require("react"),Q=require("@mui/material"),Cs=a(require("@mui/icons-material/Send"),1),lx=require("@ehfuse/mui-form-controls"),qi=a(require("@mui/icons-material/Close"),1),sx=a(require("@mui/icons-material/EditOutlined"),1),cx=a(require("@mui/icons-material/Favorite"),1),mx=a(require("@mui/icons-material/FavoriteBorderOutlined"),1),ux=a(require("@mui/icons-material/CheckCircle"),1),dx=a(require("@mui/icons-material/CheckCircleOutlineOutlined"),1),xr=a(require("@mui/icons-material/AttachFileOutlined"),1),px=a(require("@mui/icons-material/AddCircleOutline"),1),fx=a(require("@mui/icons-material/ImageOutlined"),1);var Bs=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]};var F=require("react/jsx-runtime"),Oh=5;function ax({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(m=>m.account_seq===t),l=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",s=r.length===0?l:(0,F.jsx)(Q.Box,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(m=>`${m.name} \xB7 ${m.time}`).join(`
8
8
  `)}),p=e==="like"?"#e5484d":"#2f80ed";return(0,F.jsx)(Q.Tooltip,{title:s,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:(0,F.jsxs)(Q.Box,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,F.jsx)(Q.IconButton,{size:"small","aria-label":`\uB313\uAE00 ${l}`,onClick:n,sx:{color:i?p:"#c9c8c5",p:.5},children:e==="like"?i?(0,F.jsx)(cx.default,{sx:{fontSize:16}}):(0,F.jsx)(mx.default,{sx:{fontSize:16}}):i?(0,F.jsx)(ux.default,{sx:{fontSize:16}}):(0,F.jsx)(dx.default,{sx:{fontSize:16}})}),r.length>0?(0,F.jsx)(Q.Box,{component:"span",sx:{fontSize:12,color:i?p:"#9a9a97",ml:-.25},children:r.length}):null]})})}function vs({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:l,onToggleReaction:s,onPreview:p,onDownload:m}){let[u,b]=(0,Qt.useState)(null),f=(0,Qt.useRef)(null),[c,d]=(0,Qt.useState)(null),[D,w]=(0,Qt.useState)(!1),y=Math.max(0,o.length-Oh),g=y>0&&!D,O=u?Math.min(u.index,y):y,S=o.map((P,_)=>({comment:P,index:_})).slice(g?O:0),q=yr(),B=P=>{if(p){p(P);return}window.open(q(P.uuid??""),"_blank","noopener,noreferrer")},E=P=>{if(m){m(P);return}window.open(q(P.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},z=ct().slots?.avatar;return(0,F.jsxs)(Q.Box,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[(0,F.jsxs)(Q.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,F.jsx)(Bn,{sx:{fontSize:18,display:"block",color:"#37352f"}}),(0,F.jsxs)(Q.Box,{sx:{fontSize:Ea,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),y>0&&(!g||O>0)?(0,F.jsx)(Q.Box,{role:"button",tabIndex:0,onClick:()=>w(P=>!P),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),w(_=>!_))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:g?`\uC774\uC804 \uB313\uAE00 ${O}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?(0,F.jsx)(Q.Box,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(0,F.jsx)(Q.Box,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:S.map(({comment:P,index:_})=>{let N=!!t&&P.author===t;return(0,F.jsxs)(Q.Box,{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 x=r?.get(P.author)??"";return z?(0,F.jsx)(Q.Box,{sx:{display:"inline-flex",flexShrink:0},children:(0,F.jsx)(z,{name:P.author,src:x||void 0,size:44})}):(0,F.jsx)(Q.Box,{sx:{display:"inline-flex",flexShrink:0},children:(0,F.jsx)(qt,{src:x,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...ar[0]},iconFontSize:24})})})(),(0,F.jsxs)(Q.Box,{sx:{flex:1,minWidth:0},children:[(0,F.jsxs)(Q.Box,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[(0,F.jsx)(Q.Box,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P.author}),(0,F.jsx)(Q.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:P.time}),N?(0,F.jsx)(Q.Box,{sx:{ml:"auto"}}):(0,F.jsxs)(Q.Box,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[(0,F.jsx)(ax,{kind:"like",reactions:P.likes,myAccountSeq:n,onToggle:()=>s?.(e,_,"like")}),(0,F.jsx)(ax,{kind:"ack",reactions:P.acks,myAccountSeq:n,onToggle:()=>s?.(e,_,"ack")})]}),N?(0,F.jsxs)(Q.Box,{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:[(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>b({index:_,text:P.text,attachments:[...P.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:(0,F.jsx)(sx.default,{sx:{fontSize:15}})}),(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:x=>d({anchorEl:x.currentTarget,index:_}),sx:{color:"#9a9a97"},children:(0,F.jsx)(qi.default,{sx:{fontSize:15}})})]}):null]}),u?.index===_?(0,F.jsxs)(Q.Box,{sx:{mt:.5},children:[(0,F.jsx)(Q.Box,{component:"textarea",autoFocus:!0,spellCheck:!1,value:u.text,onChange:x=>b({...u,text:x.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),(0,F.jsxs)(Q.Box,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[u.attachments.map((x,h)=>{let v=()=>b({...u,attachments:u.attachments.filter((T,k)=>k!==h)});return Na(x.name)&&x.uuid?(0,F.jsxs)(Q.Box,{sx:{position:"relative"},children:[(0,F.jsx)(Q.Box,{component:"img",src:q(x.uuid,{thumb:"md"}),alt:x.name,title:x.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:v,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,F.jsx)(qi.default,{sx:{fontSize:14}})})]},`kept-${x.uuid}-${h}`):(0,F.jsx)(Q.Chip,{size:"small",icon:(0,F.jsx)(xr.default,{sx:{fontSize:14}}),label:x.name,onDelete:v,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${x.uuid??x.name}-${h}`)}),u.files.map((x,h)=>{let v=()=>b({...u,files:u.files.filter((T,k)=>k!==h)});return Na(x.name)?(0,F.jsxs)(Q.Box,{sx:{position:"relative"},children:[(0,F.jsx)(Q.Box,{component:"img",src:URL.createObjectURL(x),alt:x.name,title:`${x.name} (\uC0C8 \uD30C\uC77C)`,onLoad:T=>URL.revokeObjectURL(T.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:v,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,F.jsx)(qi.default,{sx:{fontSize:14}})})]},`new-${x.name}-${h}`):(0,F.jsx)(Q.Chip,{size:"small",icon:(0,F.jsx)(xr.default,{sx:{fontSize:14}}),label:`${x.name} (\uC0C8 \uD30C\uC77C)`,onDelete:v,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${x.name}-${h}`)}),(0,F.jsx)(Q.Tooltip,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>f.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:(0,F.jsx)(px.default,{sx:{fontSize:20}})})})]}),(0,F.jsxs)(Q.Box,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[(0,F.jsx)(Q.Button,{size:"small",color:"inherit",onClick:()=>b(null),children:"\uCDE8\uC18C"}),(0,F.jsx)(Q.Button,{size:"small",variant:"contained",disabled:!u.text.trim()&&u.attachments.length===0&&u.files.length===0,onClick:()=>{i(e,_,u.text,{attachments:u.attachments,files:u.files}),b(null)},children:"\uC800\uC7A5"})]}),(0,F.jsx)(Q.Box,{component:"input",type:"file",multiple:!0,ref:f,sx:{display:"none"},onChange:x=>{let h=Array.from(x.target.files??[]);h.length>0&&b({...u,files:[...u.files,...h].slice(0,10)}),x.target.value=""}})]}):(0,F.jsxs)(Q.Box,{children:[P.text?(0,F.jsx)(Q.Box,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:P.text}):null,(P.attachments??[]).length>0?(0,F.jsx)(Q.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(P.attachments??[]).map((x,h)=>{let v=!!x.uuid;if(Na(x.name)&&v)return(0,F.jsx)(Q.Box,{component:"img",src:q(x.uuid??"",{thumb:"md"}),alt:x.name,title:`${x.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>B(x),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${x.name}-${h}`);let k=Ra(x.name);return(0,F.jsx)(Q.Chip,{size:"small",icon:(0,F.jsx)(xr.default,{sx:{fontSize:14}}),label:`${x.name} (${Bs(x.size)})`,clickable:v,onClick:v?()=>k?B(x):E(x):void 0,title:v?`${x.name} ${k?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:x.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${x.name}-${h}`)})}):null]})]})]},`${P.time}-${_}`)})}),(0,F.jsx)(Je,{open:!!c,anchorEl:c?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>d(null),onConfirm:()=>{c&&(l(e,c.index),b(null)),d(null)}})]})}function Na(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function Is({onSubmit:e}){let[o,t]=(0,Qt.useState)(""),[n,r]=(0,Qt.useState)([]),[i,l]=(0,Qt.useState)(!1),s=(0,Qt.useRef)(null),p=(0,Qt.useRef)(null),m=Ye(),u=c=>{let d=Array.from(c??[]);d.length!==0&&r(D=>[...D,...d].slice(0,10))},b=()=>{let c=o.trim();!c&&n.length===0||(e(c,n.length>0?n:void 0),t(""),r([]))},f=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>s.current?.click(),sx:{color:"#9a9a97"},children:(0,F.jsx)(xr.default,{sx:{fontSize:20}})}),(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>p.current?.click(),sx:{color:"#9a9a97"},children:(0,F.jsx)(fx.default,{sx:{fontSize:20}})})]});return(0,F.jsxs)(Q.Box,{children:[n.length>0?(0,F.jsx)(Q.Box,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((c,d)=>Na(c.name)?(0,F.jsxs)(Q.Box,{sx:{position:"relative"},children:[(0,F.jsx)(Q.Box,{component:"img",src:URL.createObjectURL(c),alt:c.name,title:c.name,onLoad:D=>URL.revokeObjectURL(D.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),(0,F.jsx)(Q.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(D=>D.filter((w,y)=>y!==d)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,F.jsx)(qi.default,{sx:{fontSize:14}})})]},`${c.name}-${d}`):(0,F.jsx)(Q.Chip,{size:"small",icon:(0,F.jsx)(xr.default,{sx:{fontSize:14}}),label:`${c.name} (${Bs(c.size)})`,onDelete:()=>r(D=>D.filter((w,y)=>y!==d)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${c.name}-${d}`))}):null,(0,F.jsxs)(Q.Box,{sx:{position:"relative",display:"flex"},onDragOver:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),l(!0))},onDragLeave:c=>{c.currentTarget.contains(c.relatedTarget)||l(!1)},onDrop:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),l(!1),u(c.dataTransfer?.files??null))},children:[i?(0,F.jsxs)(Q.Box,{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:[(0,F.jsx)(xr.default,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,(0,F.jsx)(lx.TextField,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:c=>t(c.target.value),fullWidth:!0,multiline:!0,minRows:m?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:m?15:6.5,pb:m?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),m?(0,F.jsxs)(Q.Box,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[f,(0,F.jsx)(Q.IconButton,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:b,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:(0,F.jsx)(Cs.default,{sx:{fontSize:22}})})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Q.Box,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:f}),(0,F.jsx)(Q.IconButton,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:b,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:(0,F.jsx)(Cs.default,{sx:{fontSize:22}})})]})]}),(0,F.jsx)(Q.Box,{component:"input",ref:s,type:"file",multiple:!0,onChange:c=>{u(c.target.files),c.target.value=""},sx:{display:"none"}}),(0,F.jsx)(Q.Box,{component:"input",ref:p,type:"file",accept:"image/*",multiple:!0,onChange:c=>{u(c.target.files),c.target.value=""},sx:{display:"none"}})]})}var Ha=require("react"),Eo=require("@mui/material"),Sx=a(require("@mui/icons-material/Close"),1),Bx=a(require("@mui/icons-material/ArrowBack"),1),Cx=a(require("@mui/icons-material/ShareOutlined"),1),vx=a(require("@mui/icons-material/ContentCopyOutlined"),1),Ix=a(require("@mui/icons-material/CheckCircle"),1),_x=a(require("@mui/icons-material/CheckCircleOutlineOutlined"),1),wx=a(require("@mui/icons-material/HistoryOutlined"),1),Dx=a(require("@mui/icons-material/Print"),1);var gx=require("react"),ht=require("@mui/material"),bx=require("@ehfuse/mui-form-dialog"),hx=require("@ehfuse/overlay-scrollbar");var it=require("react/jsx-runtime"),Rh={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 xx(e){return String(e??"").trim()||"\uC5C6\uC74C"}function Ph(e){if(e.kind!=="field")return Rh[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) "${xx(t)}" \u2192 "${xx(n)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function Ai({open:e,taskSeq:o,items:t,loading:n,onLoad:r,onClose:i}){let l=Ye();(0,gx.useEffect)(()=>{e&&o>0&&!t&&r?.(o)},[e,o,t,r]);let s=(0,it.jsx)(ht.Box,{sx:{height:l?"100%":420,minHeight:0},children:(0,it.jsx)(hx.OverlayScrollbar,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:(0,it.jsxs)(ht.Box,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[n&&!t?(0,it.jsxs)(ht.Box,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[(0,it.jsx)(ht.CircularProgress,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,t&&t.length===0?(0,it.jsx)(ht.Box,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(t??[]).map(p=>(0,it.jsxs)(ht.Box,{sx:{display:"flex",flexDirection:l?"column":"row",gap:l?.25:1,alignItems:l?"stretch":"baseline",minWidth:0,flexShrink:0,...l?{pb:1,borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none",pb:0}}:{}},children:[(0,it.jsx)(ht.Box,{sx:{flexShrink:0,...l?{}:{width:"10.5em"},whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:At(p.acted_time)}),(0,it.jsxs)(ht.Box,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[(0,it.jsx)(ht.Box,{component:"span",sx:{fontWeight:500},children:String(p.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),(0,it.jsx)(ht.Box,{component:"span",sx:{ml:.5},children:Ph(p)})]})]},p.seq))]})})});return(0,it.jsx)(bx.FormDialog,{open:e,onClose:i,maxWidth:"sm",fullScreen:l,mobilePresentation:l?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:l?{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:s}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:(0,it.jsx)(ht.Button,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}var Fa=require("@ehfuse/alerts");var kx=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,`