@ehfuse/taskbox 0.5.27 → 0.5.28

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
@@ -1,5 +1,5 @@
1
1
  var zn="waiting",mr="replied";import{createContext as vm,useContext as Im,useMemo as ll}from"react";import{Box as _m}from"@mui/material";var bi="--app-mobile-font-offset";function po(e,o=0){return`calc(${e}px + max(0px, var(${bi}, 0px) - ${o}px))`}import{jsx as al}from"react/jsx-runtime";var sl=vm({});function wm({config:e,children:o}){let t=ll(()=>e??{},[e]),n=t.mobileFontOffsetPx;return al(sl.Provider,{value:t,children:n===void 0?o:al(_m,{sx:{display:"contents",[bi]:`${n}px`},children:o})})}function Bo(){return Im(sl)}function hi(){let{buildFileUrl:e}=Bo();return ll(()=>e||((o,t)=>{let n=[];return t?.thumb&&n.push(`thumb=${t.thumb}`),t?.download&&n.push("download=1"),`/api/v1/files/${o}${n.length?`?${n.join("&")}`:""}`}),[e])}function qn(){let{uploadMaxMb:e}=Bo();return e??50}import{useGlobalForm as dp}from"@ehfuse/forma";import cl from"@mui/icons-material/DoNotDisturbAltOutlined";import ml from"@mui/icons-material/BookmarkBorderOutlined";import Dm from"@mui/icons-material/LabelOutlined";import Om from"@mui/icons-material/FlagOutlined";import Mm from"@mui/icons-material/StarBorderOutlined";import Em from"@mui/icons-material/FolderOutlined";import Pm from"@mui/icons-material/EventOutlined";import Rm from"@mui/icons-material/BuildOutlined";import zm from"@mui/icons-material/LocalShippingOutlined";import qm from"@mui/icons-material/StorefrontOutlined";import Am from"@mui/icons-material/GroupsOutlined";import Lm from"@mui/icons-material/LightbulbOutlined";import Nm from"@mui/icons-material/FavoriteBorderOutlined";import Fm from"@mui/icons-material/AssignmentOutlined";import Hm from"@mui/icons-material/HomeOutlined";import Wm from"@mui/icons-material/WorkOutline";import $m from"@mui/icons-material/SchoolOutlined";import Km from"@mui/icons-material/LocalHospitalOutlined";import Um from"@mui/icons-material/RestaurantOutlined";import Vm from"@mui/icons-material/LocalFloristOutlined";import Gm from"@mui/icons-material/DirectionsCarOutlined";import Ym from"@mui/icons-material/CampaignOutlined";import jm from"@mui/icons-material/SavingsOutlined";import Xm from"@mui/icons-material/Inventory2Outlined";import Qm from"@mui/icons-material/CleaningServicesOutlined";import ul from"@mui/icons-material/HandymanOutlined";import Jm from"@mui/icons-material/LocalPhoneOutlined";import Zm from"@mui/icons-material/EmailOutlined";import eu from"@mui/icons-material/ShoppingCartOutlined";import ou from"@mui/icons-material/BarChartOutlined";import tu from"@mui/icons-material/PrintOutlined";import nu from"@mui/icons-material/SecurityOutlined";import ru from"@mui/icons-material/AlarmOutlined";import iu from"@mui/icons-material/AttachFileOutlined";import au from"@mui/icons-material/PhotoCameraOutlined";import lu from"@mui/icons-material/ImageOutlined";import su from"@mui/icons-material/MenuBookOutlined";import cu from"@mui/icons-material/EditOutlined";import mu from"@mui/icons-material/KeyOutlined";import uu from"@mui/icons-material/LockOutlined";import du from"@mui/icons-material/LockOpenOutlined";import pu from"@mui/icons-material/SettingsOutlined";import fu from"@mui/icons-material/CloudOutlined";import xu from"@mui/icons-material/WifiOutlined";import gu from"@mui/icons-material/ComputerOutlined";import bu from"@mui/icons-material/SmartphoneOutlined";import hu from"@mui/icons-material/TvOutlined";import ku from"@mui/icons-material/AccessTimeOutlined";import Tu from"@mui/icons-material/TimerOutlined";import yu from"@mui/icons-material/MapOutlined";import Su from"@mui/icons-material/PlaceOutlined";import Bu from"@mui/icons-material/NavigationOutlined";import Cu from"@mui/icons-material/FlightOutlined";import vu from"@mui/icons-material/TrainOutlined";import Iu from"@mui/icons-material/DirectionsBusOutlined";import _u from"@mui/icons-material/DirectionsBikeOutlined";import wu from"@mui/icons-material/DirectionsWalkOutlined";import Du from"@mui/icons-material/DirectionsRunOutlined";import Ou from"@mui/icons-material/FitnessCenterOutlined";import Mu from"@mui/icons-material/SportsSoccerOutlined";import Eu from"@mui/icons-material/EmojiEventsOutlined";import Pu from"@mui/icons-material/CardGiftcardOutlined";import Ru from"@mui/icons-material/CakeOutlined";import dl from"@mui/icons-material/CoffeeOutlined";import zu from"@mui/icons-material/LocalPizzaOutlined";import qu from"@mui/icons-material/ShoppingBagOutlined";import pl from"@mui/icons-material/CreditCardOutlined";import Au from"@mui/icons-material/AccountBalanceOutlined";import Lu from"@mui/icons-material/AccountBalanceWalletOutlined";import Nu from"@mui/icons-material/AttachMoneyOutlined";import Fu from"@mui/icons-material/ReceiptLongOutlined";import Hu from"@mui/icons-material/CalculateOutlined";import Wu from"@mui/icons-material/TrendingUpOutlined";import $u from"@mui/icons-material/ListAltOutlined";import Ku from"@mui/icons-material/TaskAltOutlined";import Uu from"@mui/icons-material/DoneAllOutlined";import Vu from"@mui/icons-material/WarningAmberOutlined";import Gu from"@mui/icons-material/InfoOutlined";import Yu from"@mui/icons-material/HelpOutlined";import ju from"@mui/icons-material/SupportAgentOutlined";import Xu from"@mui/icons-material/PersonOutlined";import Qu from"@mui/icons-material/PersonAddOutlined";import Ju from"@mui/icons-material/BadgeOutlined";import Zu from"@mui/icons-material/WbSunnyOutlined";import ed from"@mui/icons-material/DarkModeOutlined";import od from"@mui/icons-material/LocalFireDepartmentOutlined";import td from"@mui/icons-material/WaterDropOutlined";import nd from"@mui/icons-material/BoltOutlined";import rd from"@mui/icons-material/AutorenewOutlined";import id from"@mui/icons-material/ScienceOutlined";import ad from"@mui/icons-material/MedicalServicesOutlined";import ld from"@mui/icons-material/NotificationsOutlined";import sd from"@mui/icons-material/SendOutlined";import cd from"@mui/icons-material/LinkOutlined";import md from"@mui/icons-material/PublicOutlined";import fl from"@mui/icons-material/ApartmentOutlined";import ud from"@mui/icons-material/PlumbingOutlined";import dd from"@mui/icons-material/ElectricalServicesOutlined";import pd from"@mui/icons-material/ChatOutlined";import fd from"@mui/icons-material/DescriptionOutlined";import xd from"@mui/icons-material/FactCheckOutlined";import gd from"@mui/icons-material/RocketLaunchOutlined";import bd from"@mui/icons-material/PaletteOutlined";import hd from"@mui/icons-material/MusicNoteOutlined";import kd from"@mui/icons-material/VideocamOutlined";import Td from"@mui/icons-material/ThumbUpOutlined";import yd from"@mui/icons-material/PushPinOutlined";import Sd from"@mui/icons-material/SearchOutlined";import Bd from"@mui/icons-material/VisibilityOutlined";import Cd from"@mui/icons-material/VerifiedOutlined";import vd from"@mui/icons-material/TrackChangesOutlined";import Id from"@mui/icons-material/ExtensionOutlined";import _d from"@mui/icons-material/CodeOutlined";import wd from"@mui/icons-material/BugReportOutlined";import Dd from"@mui/icons-material/SmartToyOutlined";import Od from"@mui/icons-material/StorageOutlined";import Md from"@mui/icons-material/QrCode2Outlined";import Ed from"@mui/icons-material/FileDownloadOutlined";import Pd from"@mui/icons-material/FileUploadOutlined";import Rd from"@mui/icons-material/MicOutlined";import zd from"@mui/icons-material/HeadphonesOutlined";import qd from"@mui/icons-material/MovieOutlined";import Ad from"@mui/icons-material/SportsEsportsOutlined";import Ld from"@mui/icons-material/BrushOutlined";import Nd from"@mui/icons-material/ArchitectureOutlined";import Fd from"@mui/icons-material/EngineeringOutlined";import Hd from"@mui/icons-material/FactoryOutlined";import Wd from"@mui/icons-material/AgricultureOutlined";import $d from"@mui/icons-material/DirectionsBoatOutlined";import Kd from"@mui/icons-material/TwoWheelerOutlined";import Ud from"@mui/icons-material/HandshakeOutlined";import Vd from"@mui/icons-material/GavelOutlined";import Gd from"@mui/icons-material/BalanceOutlined";import Yd from"@mui/icons-material/TranslateOutlined";import jd from"@mui/icons-material/PsychologyOutlined";import Xd from"@mui/icons-material/PetsOutlined";import Qd from"@mui/icons-material/CelebrationOutlined";import Jd from"@mui/icons-material/BeachAccessOutlined";import Zd from"@mui/icons-material/AcUnitOutlined";import ep from"@mui/icons-material/ForestOutlined";import op from"@mui/icons-material/LandscapeOutlined";import tp from"@mui/icons-material/HotelOutlined";import np from"@mui/icons-material/LocalLaundryServiceOutlined";import rp from"@mui/icons-material/ChairOutlined";import ip from"@mui/icons-material/LocalBarOutlined";import ap from"@mui/icons-material/LunchDiningOutlined";import lp from"@mui/icons-material/IcecreamOutlined";import sp from"@mui/icons-material/WorkspacePremiumOutlined";import cp from"@mui/icons-material/DiamondOutlined";import mp from"@mui/icons-material/VaccinesOutlined";var ki="bookmark",we="label",Ro="notifications",An="warning",Ln="#e53e3e",xl="none",Ti=[{key:xl,Icon:cl},{key:"label",Icon:Dm},{key:"bookmark",Icon:ml},{key:"flag",Icon:Om},{key:"star",Icon:Mm},{key:"folder",Icon:Em},{key:"event",Icon:Pm},{key:"build",Icon:Rm},{key:"shipping",Icon:zm},{key:"store",Icon:qm},{key:"groups",Icon:Am},{key:"idea",Icon:Lm},{key:"heart",Icon:Nm},{key:"assignment",Icon:Fm},{key:"home",Icon:Hm},{key:"work",Icon:Wm},{key:"school",Icon:$m},{key:"hospital",Icon:Km},{key:"restaurant",Icon:Um},{key:"flower",Icon:Vm},{key:"car",Icon:Gm},{key:"campaign",Icon:Ym},{key:"savings",Icon:jm},{key:"inventory",Icon:Xm},{key:"cleaning",Icon:Qm},{key:"handyman",Icon:ul},{key:"phone",Icon:Jm},{key:"email",Icon:Zm},{key:"cart",Icon:eu},{key:"chart",Icon:ou},{key:"print",Icon:tu},{key:"security",Icon:nu},{key:"alarm",Icon:ru},{key:"attach",Icon:iu},{key:"camera",Icon:au},{key:"image",Icon:lu},{key:"book",Icon:su},{key:"edit",Icon:cu},{key:"key",Icon:mu},{key:"lock",Icon:uu},{key:"unlock",Icon:du},{key:"settings",Icon:pu},{key:"cloud",Icon:fu},{key:"wifi",Icon:xu},{key:"computer",Icon:gu},{key:"smartphone",Icon:bu},{key:"tv",Icon:hu},{key:"clock",Icon:ku},{key:"timer",Icon:Tu},{key:"map",Icon:yu},{key:"place",Icon:Su},{key:"navigation",Icon:Bu},{key:"flight",Icon:Cu},{key:"train",Icon:vu},{key:"bus",Icon:Iu},{key:"bike",Icon:_u},{key:"walk",Icon:wu},{key:"run",Icon:Du},{key:"fitness",Icon:Ou},{key:"soccer",Icon:Mu},{key:"trophy",Icon:Eu},{key:"gift",Icon:Pu},{key:"cake",Icon:Ru},{key:"coffee",Icon:dl},{key:"pizza",Icon:zu},{key:"bag",Icon:qu},{key:"card",Icon:pl},{key:"bank",Icon:Au},{key:"wallet",Icon:Lu},{key:"money",Icon:Nu},{key:"receipt",Icon:Fu},{key:"calculate",Icon:Hu},{key:"trending",Icon:Wu},{key:"listalt",Icon:$u},{key:"task",Icon:Ku},{key:"doneall",Icon:Uu},{key:"warning",Icon:Vu},{key:"info",Icon:Gu},{key:"help",Icon:Yu},{key:"support",Icon:ju},{key:"person",Icon:Xu},{key:"personadd",Icon:Qu},{key:"badge",Icon:Ju},{key:"sun",Icon:Zu},{key:"moon",Icon:ed},{key:"fire",Icon:od},{key:"water",Icon:td},{key:"bolt",Icon:nd},{key:"renew",Icon:rd},{key:"science",Icon:id},{key:"medical",Icon:ad},{key:"notifications",Icon:ld},{key:"send",Icon:sd},{key:"link",Icon:cd},{key:"public",Icon:md},{key:"apartment",Icon:fl},{key:"plumbing",Icon:ud},{key:"electrical",Icon:dd},{key:"chat",Icon:pd},{key:"description",Icon:fd},{key:"factcheck",Icon:xd},{key:"rocket",Icon:gd},{key:"palette",Icon:bd},{key:"music",Icon:hd},{key:"video",Icon:kd},{key:"thumbup",Icon:Td},{key:"pin",Icon:yd},{key:"search",Icon:Sd},{key:"eye",Icon:Bd},{key:"verified",Icon:Cd},{key:"target",Icon:vd},{key:"extension",Icon:Id},{key:"code",Icon:_d},{key:"bug",Icon:wd},{key:"robot",Icon:Dd},{key:"storage",Icon:Od},{key:"qrcode",Icon:Md},{key:"download",Icon:Ed},{key:"upload",Icon:Pd},{key:"mic",Icon:Rd},{key:"headphones",Icon:zd},{key:"movie",Icon:qd},{key:"game",Icon:Ad},{key:"brush",Icon:Ld},{key:"architecture",Icon:Nd},{key:"engineering",Icon:Fd},{key:"factory",Icon:Hd},{key:"agriculture",Icon:Wd},{key:"boat",Icon:$d},{key:"motorcycle",Icon:Kd},{key:"handshake",Icon:Ud},{key:"gavel",Icon:Vd},{key:"balance",Icon:Gd},{key:"translate",Icon:Yd},{key:"psychology",Icon:jd},{key:"pets",Icon:Xd},{key:"celebration",Icon:Qd},{key:"beach",Icon:Jd},{key:"snow",Icon:Zd},{key:"forest",Icon:ep},{key:"mountain",Icon:op},{key:"hotel",Icon:tp},{key:"laundry",Icon:np},{key:"chair",Icon:rp},{key:"bar",Icon:ip},{key:"burger",Icon:ap},{key:"icecream",Icon:lp},{key:"medal",Icon:sp},{key:"diamond",Icon:cp},{key:"vaccine",Icon:mp}],up={cafe:dl,payment:pl,business:fl,construction:ul};function Me(e){return e===xl?null:Ti.find(o=>o.key===e)?.Icon??up[String(e??"")]??ml}function ur(e){return Me(e)??cl}var yi={title:"",icon:we,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,is_open:!1,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",sprint_seq:0,story_points:0,event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:"",reminder:"none",priority:"medium",label_keys:[],note:"",content:"",checklist:[],tab_key:""},Si={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function pp(e){let{formId:o="taskbox-create-form",initialValues:t,onValidate:n,onSubmit:r}=e;return dp({formId:o,initialValues:{...yi,...t},onValidate:n,onSubmit:r})}import{useGlobalFormaState as fp}from"@ehfuse/forma";var gl="taskbox-ui-state";function it(){return fp({stateId:gl,initialValues:Si})}import{useMemo as xp}from"react";import{useTheme as gp}from"@mui/material";function dn(e,o){let t=Math.max(0,Math.min(1,o));if(t<=0)return"transparent";let n=e.trim().replace("#",""),r=n.length===3?n.split("").map(m=>m+m).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=Number.parseInt(r.slice(0,2),16),a=Number.parseInt(r.slice(2,4),16),l=Number.parseInt(r.slice(4,6),16);return`rgba(${i}, ${a}, ${l}, ${t})`}function bl(e,o){let t=Math.max(0,Math.min(1,o)),n=e.trim().replace("#",""),r=n.length===3?n.split("").map(c=>c+c).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=c=>Math.round(c+(255-c)*t),a=i(Number.parseInt(r.slice(0,2),16)),l=i(Number.parseInt(r.slice(2,4),16)),m=i(Number.parseInt(r.slice(4,6),16));return`#${[a,l,m].map(c=>c.toString(16).padStart(2,"0")).join("")}`}function Bi(e,o,t){return t==="dark"?{accent:e,accentContrast:o,accentSoft:"#1d2b45",accentOnSurface:"#b3d1ff",danger:"#f87171",dangerSoft:"#3a1f22",success:"#4ade80",warning:"#fbbf24",textStrong:"#ffffff",textPrimary:"#e2e8f0",textSecondary:"#a3adbb",textMuted:"#77808d",textInverse:"#0f1216",surface:"#161a1f",surfaceSubtle:"#1e232a",surfaceHover:"#272d36",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:o,accentSoft:"#eef4ff",accentOnSurface:e,danger:"#e5484d",dangerSoft:"#fdebec",success:"#16a34a",warning:"#e8a33d",textStrong:"#000000",textPrimary:"#37352f",textSecondary:"#787774",textMuted:"#9a9a97",textInverse:"#ffffff",surface:"#ffffff",surfaceSubtle:"#fafaf9",surfaceHover:"#f4f4f2",border:"#e6e6e3",borderStrong:"#dedddb"}}function bp(e,o){let t=o==="dark";return{bg:t?bl(e.accent,.45):e.accent,color:t?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function hl(e,o){return{...e,...o??{}}}function dr(e,o="light"){let t=o==="dark",n=bp(e,o),r=e.accentOnSurface;return{mode:o,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:r,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:o==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHover,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:o==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:o==="dark"?400:700,minHeight:48,badge:{...n,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...n,borderRadius:4,width:34}},summary:{gaugeTrackColor:o==="dark"?e.borderStrong:"#ececea",gaugeBarColor:r,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:r,overdueColor:e.danger,textColor:e.textStrong},actionButton:{bg:"#2f80ed",color:"#ffffff",hoverBg:"#2470dd",bgImage:"linear-gradient(180deg, #5ba1f5 0%, #2f80ed 100%)",hoverBgImage:"linear-gradient(180deg, #4d95ee 0%, #2470dd 100%)"},tabs:{bg:o==="dark"?e.surfaceSubtle:e.surface,color:o==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:o==="dark"?e.border:e.borderStrong,selectedBg:o==="dark"?e.surfaceHover:e.textStrong,selectedColor:o==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:t?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:t?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:t?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:t?"#232a33":e.surface,borderColor:t?"#333c47":e.border,hoverBg:t?"#2b3441":e.surfaceHover,titleColor:e.textPrimary,subColor:e.textSecondary},timeline:{bg:e.surface,gridColor:e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,todayLineColor:e.accentOnSurface,barColor:e.accentOnSurface,overdueBarColor:e.danger},avatar:{ringColor:o==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:o==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function Ci(e,o){if(!o)return e;let t=o.mode??e.mode,r={...t===e.mode?e.colors:Bi(e.colors.accent,e.colors.accentContrast,t),...o.colors??{}},i=dr(r,t),{groupHeader:a,...l}=o.table??{},{badge:m,...c}=o.board??{},{badge:p,...d}=a??{};return{mode:t,colors:r,table:{...i.table,...l,groupHeader:{...i.table.groupHeader,...d,badge:hl(i.table.groupHeader.badge,p)}},board:{...i.board,...c,badge:hl(i.board.badge,m)},summary:{...i.summary,...o.summary??{}},chip:{...i.chip,...o.chip??{}},actionButton:{...i.actionButton,...o.actionButton??{}},tabs:{...i.tabs,...o.tabs??{}},avatar:{...i.avatar,...o.avatar??{}},calendar:{...i.calendar,...o.calendar??{}},card:{...i.card,...o.card??{}},timeline:{...i.timeline,...o.timeline??{}}}}function hp(e={}){let{mode:o="light",accent:t="#2563eb",accentContrast:n="#ffffff",input:r}=e;return Ci(dr(Bi(t,n,o),o),r)}function ie(){let e=gp(),{theme:o}=Bo(),t=e.palette.primary.main,n=e.palette.primary.contrastText,r=e.palette.mode==="dark"?"dark":"light";return xp(()=>Ci(dr(Bi(t,n,r),r),o),[t,n,r,o])}import{useCallback as ct,useEffect as Ul,useMemo as Ut,useRef as Gf,useState as mt}from"react";import{Box as qo,Divider as Yf,IconButton as jf,ListItemIcon as Xf,Menu as Vl,MenuItem as Or}from"@mui/material";import Gl from"@mui/icons-material/Add";import Qf from"@mui/icons-material/ArrowUpward";import Jf from"@mui/icons-material/ArrowDownward";import Zf from"@mui/icons-material/KeyboardArrowDown";import ex from"@mui/icons-material/KeyboardArrowRight";import Xi from"@mui/icons-material/Check";import ox from"@mui/icons-material/FilterList";import tx from"@mui/icons-material/InboxOutlined";import{Virtuoso as Yl}from"react-virtuoso";import nx from"@ehfuse/overlay-scrollbar";import{DatePicker as rx}from"@ehfuse/mui-datetime-picker";function kp(e){let o=String(e??"").trim().replace("T"," "),t=o.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(o)}function qe(e,o="YYYY-MM-DD"){let t=typeof e=="string"?kp(e):e;if(!e||e===""||isNaN(t.getTime()))return"";let n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),a=n.toString().slice(-2);switch(o){case"YYYY-MM-DD":return`${n}-${r}-${i}`;case"YY.MM.DD":return`${a}.${r}.${i}`;case"MM/DD/YYYY":return`${r}/${i}/${n}`;case"DD.MM.YYYY":return`${i}.${r}.${n}`;case"YYYYMMDD":return`${n}${r}${i}`;default:return o.replace(/YYYY/g,n.toString()).replace(/YY/g,a).replace(/MM/g,r).replace(/DD/g,i)}}import{Box as kl}from"@mui/material";import{jsx as yp,jsxs as Sp}from"react/jsx-runtime";var Tp={high:{label:"\uB192\uC74C",dot:"#e5484d",bgcolor:"#fdebec",color:"#c4554d"},medium:{label:"\uC911\uAC04",dot:"#2f80ed",bgcolor:"#e3eefb",color:"#1d4f91"},low:{label:"\uB0AE\uC74C",dot:"#9a9a97",bgcolor:"#efefed",color:"#57564f"}};function zo({priority:e,small:o=!1,plain:t=!1}){let n=Tp[e],r=ie(),i=r.mode==="dark",a=t||e==="low";return Sp(kl,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:a?0:o?.9:1.25,py:a?0:o?.25:.5,borderRadius:.75,fontSize:o?11.5:13,fontWeight:500,bgcolor:a?"transparent":i?dn(n.dot,r.chip.darkBgAlpha):n.bgcolor,color:a?i?r.chip.plainColor:n.color:i?r.chip.darkTextSource==="fg"?n.color:n.dot:n.color,whiteSpace:"nowrap"},children:[yp(kl,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:n.dot}}),n.label]})}import{Menu as _p,MenuItem as wp}from"@mui/material";import Dp from"@mui/icons-material/Check";function Go(){return{}}var vi=[{key:"always",name:"\uD56D\uC0C1"},{key:"often",name:"\uC790\uC8FC"},{key:"sometimes",name:"\uAC00\uB054"},{key:"once",name:"1\uD68C"},{key:"unable",name:"\uC7AC\uD604\uBD88\uAC00"}],Ii=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],_i=[{key:"fixed",name:"\uC218\uC815\uC644\uB8CC"},{key:"duplicate",name:"\uC911\uBCF5"},{key:"cannot_reproduce",name:"\uC7AC\uD604\uBD88\uAC00"},{key:"by_design",name:"\uC0AC\uC591\uB300\uB85C"},{key:"wont_fix",name:"\uC548 \uACE0\uCE68"}];function Tl(e){return vi.find(o=>o.key===e)?.name??""}function yl(e){return Ii.find(o=>o.key===e)?.name??""}function pr(e){return _i.find(o=>o.key===e)?.name??""}function wi(e,o=new Date){if(!e.is_event)return!1;let t=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;let n=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(n)){let i=new Date(`${t}T${n}:00`);return!Number.isNaN(i.getTime())&&i.getTime()<=o.getTime()}let r=new Date(`${t}T00:00:00`);return Number.isNaN(r.getTime())?!1:(r.setDate(r.getDate()+1),r.getTime()<=o.getTime())}function fr(e,o=new Date){return e.is_event?wi(e,o):!!e.completed}var Ht=[{key:"not_started",name:"\uC2DC\uC791\uC804",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"},{key:"in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"hold",name:"\uBCF4\uB958",bg:"#fbeee0",fg:"#8a5a2b",dot:"#d9730d"},{key:zn,name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:mr,name:"\uD655\uC778\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"}],Fn=Ht.filter(e=>e.key!==zn&&e.key!==mr);function xr(e){return Ht.find(o=>o.key===e)??Ht[0]}var Di={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function fo(e){if(e.is_notice)return Sl(e.status);if(e.is_bug&&e.completed){let o=pr(e.resolution)||"\uC644\uB8CC";return{...Di,name:o}}return e.completed?Di:e.is_bug?Cp(e.status):xr(e.status)}var Bp={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function Hn(e){return wi(e)?Bp:null}var Nn=[{key:"notice_scheduled",name:"\uAC8C\uC2DC\uC608\uC815",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"notice_active",name:"\uAC8C\uC2DC\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"notice_closed",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}];function Sl(e){return Nn.find(o=>o.key===e)??Nn[1]}var Oi="__closed__",Wt=[{key:"bug_received",name:"\uC811\uC218",bg:"#fdeaea",fg:"#9b2c2c",dot:"#e53e3e"},{key:"bug_confirmed",name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"bug_in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"bug_hold",name:"\uBCF4\uB958",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}],WC=[...Wt.filter(e=>e.key!=="bug_hold"),{key:Oi,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...Wt.filter(e=>e.key==="bug_hold")];function Cp(e){return Wt.find(o=>o.key===e)??Wt[0]}function Bl(e){return e.is_notice?Nn:e.is_bug?Wt:Fn}function Mi(e){return e.status===zn}var vp={in_progress:0,[zn]:1,not_started:2,hold:3,[mr]:4};function $C(e){return e.completed?9:vp[String(e.status??"")]??2}function wt(e,o){let t=new Map(o.map(r=>[r.key,r])),n=(e.label_keys??[]).map(r=>t.get(r)).filter(r=>!!r);if(e.is_event){let r=Hn({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return r?[r,...n]:n}return e.is_notice?String(e.status??"")==="notice_active"?n:[Sl(e.status),...n]:e.is_bug?[fo({...e,is_notice:!1}),...n]:e.completed?[Di,...n]:[xr(e.status),...n]}function Cl(e){return{bg:`${e}1f`,fg:e,dot:e}}function gr(e,o){return e.includes(o)?e.filter(t=>t!==o):[...e,o]}import{Box as br}from"@mui/material";import{jsx as Wn,jsxs as Ip}from"react/jsx-runtime";function De({option:e,small:o=!1}){let t=ie(),n=t.mode==="dark",r=e.key==="not_started";return Ip(br,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:r?0:o?.9:1.25,py:r?0:o?.25:.5,borderRadius:1.25,fontSize:o?11.5:13,fontWeight:500,bgcolor:r?"transparent":n?dn(e.dot,t.chip.darkBgAlpha):e.bg,color:r?n?t.chip.plainColor:e.fg:n?t.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[Wn(br,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function jC({task:e,statusOptions:o,small:t=!1}){let n=wt(e,o);return n.length===0?null:Wn(br,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Wn(De,{option:r,small:t},r.key))})}function Dt({labelKeys:e,labelOptions:o}){let t=new Map(o.map(r=>[r.key,r])),n=e.map(r=>t.get(r)).filter(r=>!!r);return n.length===0?null:Wn(br,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Wn(De,{option:r,small:!0},r.key))})}import{jsx as Ei,jsxs as Op}from"react/jsx-runtime";function hr({anchorEl:e,value:o,options:t=Ht,onSelect:n,onClose:r}){let i=Go();return Ei(_p,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,...i,children:t.map(a=>Op(wp,{onClick:()=>{n(a.key),r()},sx:{fontSize:14,minWidth:150,gap:1},children:[Ei(De,{option:a}),o===a.key?Ei(Dp,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},a.key))})}function kr(e,o){if(o<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===o)return!0;let t=(e.target_account_seqs??[]).filter(n=>n>0);return t.length===0||t.includes(o)}return Pi(e)?!0:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}function Pi(e){return e.is_notice||!e.is_open||e.completed||e.archived?!1:(e.manager_account_seq??0)===0}function Tr(e,o){return o<=0?!1:Pi(e)}function yr(e,o){return o<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||Pi(e)?!1:(e.receiver_account_seqs??[]).includes(o)||(e.author_account_seq??0)===o}function vl(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function at(e,o){return o<=0?!1:e.is_notice?(e.author_account_seq??0)===o:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}var iv=[119,121,141,143];var Ri=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uAE30\uD55C"},{value:"status",label:"\uADF8\uB8F9 : \uC0C1\uD0DC"},{value:"manager",label:"\uADF8\uB8F9 : \uCC45\uC784\uC790"},{value:"tab",label:"\uADF8\uB8F9 : \uD504\uB85C\uC81D\uD2B8"},{value:"none",label:"\uADF8\uB8F9 \uC5C6\uC74C"}];function Mp(e){let o=new Date(`${e}T00:00:00`);return o.setDate(o.getDate()+(6-o.getDay())),qe(o)}var Ep=[{key:"overdue",label:"\uC9C0\uB0A8"},{key:"today",label:"\uC624\uB298"},{key:"this_week",label:"\uC774\uBC88 \uC8FC"},{key:"later",label:"\uC774\uD6C4"},{key:"no_due",label:"\uB9C8\uAC10 \uC5C6\uC74C"}];function Pp(e,o,t){let n=e.due_date.slice(0,10);return n?n<o?"overdue":n===o?"today":n<=t?"this_week":"later":"no_due"}function zi(e,o,t,n=[],r=[],i="",a){let l=e.filter(s=>s.is_notice);if(l.length>0){let s=zi(e.filter(u=>!u.is_notice),o,t,n,r,i,a);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:l},...s]}let m=new Map,c=(s,u)=>{let f=m.get(s);f?f.push(u):m.set(s,[u])},p;if(o==="due"){let s=Mp(t);for(let u of e)c(Pp(u,t,s),u);p=Ep}else if(o==="status"){for(let s of e)c(xr(s.status).key,s);p=Ht.map(s=>({key:s.key,label:s.name}))}else if(o==="tab"){for(let s of e)c(s.tab_key?.trim()||"__none__",s);p=[...n.filter(s=>!s.archived).map(s=>({key:s.key,label:s.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...n.filter(s=>s.archived).map(s=>({key:s.key,label:`${s.label} (\uBCF4\uAD00\uB428)`}))]}else if(a?.enabled){let s=Number(a.myAccountSeq??0),u=i.trim();for(let f of e){if(!(Number(f.manager_account_seq??0)>0||String(f.manager_name??"").trim()!=="")){c("__none__",f);continue}let b=s>0&&Number(f.manager_account_seq??0)===s||!!u&&String(f.manager_name??"").trim()===u;c(b?"__manager__":"__reference__",f)}p=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let b of e)c(String(b.manager_name??"").trim()||"__none__",b);let s=i.trim(),u=[...m.keys()].filter(b=>b!=="__none__").sort((b,h)=>{if(s){if(b===s)return-1;if(h===s)return 1}return b.localeCompare(h)}),f=!!s&&u.includes(s),y=u.filter(b=>b!==s);p=[...f?[{key:s,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...y.map(b=>({key:b,label:b}))]}let d=[];for(let s of p){let u=m.get(s.key);!u||u.length===0||d.push({key:s.key,label:s.label,tasks:u})}return d}import Rp from"@mui/icons-material/NotesOutlined";import zp from"@mui/icons-material/AutorenewOutlined";import qp from"@mui/icons-material/CalendarTodayOutlined";import Ap from"@mui/icons-material/EventOutlined";import Lp from"@mui/icons-material/PersonOutlineOutlined";import _l from"@mui/icons-material/PeopleAltOutlined";import Li from"@mui/icons-material/CheckCircleOutlineOutlined";import Np from"@mui/icons-material/FlagOutlined";import Fp from"@mui/icons-material/AccessTimeOutlined";import Hp from"@mui/icons-material/StickyNote2Outlined";import Wp from"@mui/icons-material/ViewKanbanOutlined";import $p from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as so}from"react/jsx-runtime";var Kp={role_mark:"11px",completed:"44px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"120px",manager_name:"110px",receiver_names:"170px",targets:"170px",priority:"84px",ack:"104px",confirm:"100px",project:"150px",request:"100px",completed_time:"150px",note:"minmax(200px, 1.2fr)"};function Sr(e){return Ni(e).map(o=>Kp[o.id]).join(" ")}var Up={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:so(Fp,{sx:{fontSize:15}}),align:"center",sortable:!0},Vp={id:"ticket_no",label:"\uD2F0\uCF13",icon:so($p,{sx:{fontSize:15}}),align:"center"},Gp={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:so(Wp,{sx:{fontSize:15}}),projectFilter:!0},Yp={id:"targets",label:"\uB300\uC0C1\uC790",icon:so(_l,{sx:{fontSize:15}})},Il={id:"priority",label:"\uC911\uC694\uB3C4",icon:so(Np,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},jp={id:"ack",label:"\uD655\uC778",icon:so(Li,{sx:{fontSize:15}}),align:"center",ackFilter:!0},Xp={id:"confirm",label:"\uD655\uC778",icon:so(Li,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function qi(e){let o=e.findIndex(n=>n.id==="receiver_names"||n.id==="targets"),t=o>=0?o+1:e.findIndex(n=>n.id==="note");return t<0?[...e,Il]:[...e.slice(0,t),Il,...e.slice(t)]}function Ni(e){let{showProject:o=!1,showManager:t=!0,showActions:n=!0,showRequest:r=!0,notice:i=!1,bug:a=!1,confirmMode:l="none"}=e??{},m=d=>{if(!a)return d;let s=d.filter(y=>y.id!=="note"),u=s.findIndex(y=>y.id==="completed"),f=u>=0?u+1:0;return[...s.slice(0,f),Vp,...s.slice(f)]};if(i)return m(qi(Ai.filter(d=>!["manager_name","receiver_names","request"].includes(d.id)).flatMap(d=>d.id==="due_date"?[d,Yp]:d.id==="note"?[jp,d]:[d])));let c=t?Ai:Ai.filter(d=>d.id!=="manager_name");if(n)r||(c=c.filter(d=>d.id!=="request"));else{c=c.filter(s=>s.id!=="request");let d=c.findIndex(s=>s.id==="note");c=[...c.slice(0,d),Up,...c.slice(d)]}if(l==="action"){let d=c.findIndex(s=>s.id==="note");c=[...c.slice(0,d),Xp,...c.slice(d)]}if(!o)return m(qi(c));let p=c.findIndex(d=>d.id==="receiver_names");return m(qi([...c.slice(0,p+1),Gp,...c.slice(p+1)]))}var Ai=[{id:"role_mark",label:"",icon:null},{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:so(Rp,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:so(zp,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC790",icon:so(qp,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uAE30\uD55C",icon:so(Ap,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:so(Lp,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:so(_l,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:so(Li,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:so(Hp,{sx:{fontSize:15}})}];import{Button as wl,ClickAwayListener as Zp,Dialog as ef,Paper as of,Popper as tf,Typography as nf,Box as rf}from"@mui/material";import{useMediaQuery as Qp,useTheme as Jp}from"@mui/material";function He(){let{isMobile:e}=Bo(),o=Jp(),t=Qp(o.breakpoints.up("lg"));return e!==void 0?e:!t}import{Fragment as lf,jsx as Ot,jsxs as Dl}from"react/jsx-runtime";function af({title:e,content:o,confirmText:t,cancelText:n,titleFontSize:r,actionFontSize:i,actionMinHeight:a,onCancel:l,onConfirm:m}){return Dl(lf,{children:[Ot(nf,{component:"div",sx:{fontSize:r,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),o,Dl(rf,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[Ot(wl,{size:"medium",variant:"outlined",color:"inherit",onClick:l,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:n}),Ot(wl,{size:"medium",variant:"contained",color:"primary",onClick:m,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:t})]})]})}function Ue({open:e,anchorEl:o,title:t="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:n,confirmText:r="\uD655\uC778",cancelText:i="\uCDE8\uC18C",placement:a="top",minWidth:l=160,minHeight:m,titleFontSize:c=17,actionFontSize:p=16,actionMinHeight:d=44,zIndex:s=1300,onCancel:u,onConfirm:f}){let y=He(),b=Ot(af,{title:t,content:n,confirmText:r,cancelText:i,titleFontSize:c,actionFontSize:p,actionMinHeight:d,onCancel:u,onConfirm:f});return y?Ot(ef,{open:e,onClose:u,sx:{zIndex:s},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:b}):Ot(tf,{open:e,anchorEl:o,placement:a,sx:{zIndex:s},children:Ot(Zp,{onClickAway:u,children:Ot(of,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:l,minHeight:m,justifyContent:m?"space-between":"flex-start"},onClick:h=>h.stopPropagation(),onMouseDown:h=>h.stopPropagation(),children:b})})})}import{useEffect as kf,useRef as Tf,useState as Al}from"react";import{Box as be,Button as yf,Checkbox as Sf,Tooltip as Wi}from"@mui/material";import Bf from"@mui/icons-material/AlarmOutlined";import Cf from"@mui/icons-material/CheckCircle";import vf from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as sf,useState as Ol}from"react";import{Avatar as Ml}from"@mui/material";import cf from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Hi}from"react/jsx-runtime";var Fi=new Set,El=e=>e.startsWith("data:")||e.startsWith("blob:");function pn({src:e,avatarSx:o,iconFontSize:t=40}){let[n,r]=Ol(()=>e?El(e)||Fi.has(e):!1),[i,a]=Ol(!1),l={position:"relative",overflow:"hidden",borderRadius:"15px"},m=o?[l,...Array.isArray(o)?o:[o]]:l;return sf(()=>{a(!1),r(e?El(e)||Fi.has(e):!1)},[e]),!e||i?Hi(Ml,{sx:m,children:Hi(cf,{sx:{fontSize:t}})}):Hi(Ml,{src:e,imgProps:{onLoad:()=>{Fi.add(e),r(!0)},onError:()=>a(!0),style:n?void 0:{opacity:0}},sx:m})}var mf=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Br=(e,o)=>{if(!o||!o.trim())return[{text:e,highlight:!1}];try{let t=mf(o.trim()),n=new RegExp(`(${t})`,"gi");return e.split(n).map(i=>i.toLowerCase()===o.trim().toLowerCase()?{text:i,highlight:!0}:{text:i,highlight:!1}).filter(i=>i.text)}catch{return[{text:e,highlight:!1}]}};var uf=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Yo(e){let o=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(o))return"";let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?"":`${o.slice(2).replaceAll("-",".")} (${uf[t.getDay()]})`}function lt(e){let o=String(e??"").trim(),[t,n=""]=o.split(" "),r=Yo(t);return r?n?`${r} ${n.slice(0,5)}`:r:""}import{Box as Pl,Tooltip as df}from"@mui/material";import{jsx as Cr}from"react/jsx-runtime";var fn=[{bgcolor:"#dbe7ff",color:"#24408e"},{bgcolor:"#ffe4d6",color:"#8a4b21"},{bgcolor:"#dcf2e3",color:"#1f6b3a"},{bgcolor:"#f3e3f7",color:"#6d2f80"},{bgcolor:"#fdf0cf",color:"#8a6d1d"},{bgcolor:"#e0f0f6",color:"#1d5f78"},{bgcolor:"#efe6dc",color:"#6b4a2b"}];function xo({names:e,size:o=22,ringFirst:t=!1,avatarSrcByName:n}){let r=ie();return Cr(Pl,{sx:{display:"flex",alignItems:"center"},children:e.map((i,a)=>{let l=t&&a===0;return Cr(df,{title:l?`\uCC45\uC784\uC790 \xB7 ${i}`:i,arrow:!0,children:Cr(Pl,{sx:{ml:a===0?0:"-7px",zIndex:a,borderRadius:"50%",border:`2px solid ${l?r.avatar.ringColor:r.avatar.separatorColor}`,display:"inline-flex",...r.avatar.sx},children:Cr(pn,{src:n?.get(i)??"",avatarSx:{width:o,height:o,fontSize:Math.round(o/2),borderRadius:"50%",...fn[a%fn.length]},iconFontSize:Math.round(o*.6)})})},`${i}-${a}`)})})}import{Box as Rl,Button as ql}from"@mui/material";import pf from"@mui/icons-material/CheckCircle";import{Fragment as gf,jsx as $n,jsxs as zl}from"react/jsx-runtime";function ff(e){let o=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:o?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:o?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function xf(e){return{minWidth:0,px:1.25,py:.25,fontSize:13,whiteSpace:"nowrap",color:e.actionButton.color,backgroundColor:e.actionButton.bg,backgroundImage:e.actionButton.bgImage,boxShadow:"none","&:hover":{backgroundColor:e.actionButton.hoverBg,backgroundImage:e.actionButton.hoverBgImage,boxShadow:"none"},...e.actionButton.sx}}function xn({onClick:e,children:o,fullWidth:t=!1,sx:n}){let r=ie();return $n(ql,{size:"small",variant:"contained",color:"inherit",fullWidth:t,sx:[xf(r),...Array.isArray(n)?n:n?[n]:[]],onClick:i=>{i.stopPropagation(),e(i)},children:o})}function gn({canConfirm:e,count:o,total:t,myConfirmed:n=!1,onConfirm:r,onShowList:i}){let a=ie(),l=ff(a);return e?$n(xn,{onClick:()=>r(),children:"\uD655\uC778"}):zl(ql,{size:"small",variant:"outlined",color:"inherit",sx:l,onClick:m=>{m.stopPropagation(),i(m.currentTarget)},children:[n?$n(pf,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,$n(Rl,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:t>0&&o>=t?"\uC644\uB8CC":zl(gf,{children:[o,$n(Rl,{component:"span",sx:{mx:.15},children:"/"}),t]})})]})}import{SvgIcon as bf}from"@mui/material";import{jsx as vr,jsxs as hf}from"react/jsx-runtime";function Ir({sx:e,...o}){return hf(bf,{viewBox:"0 0 48 48",...o,sx:{fill:"none",...e},children:[vr("path",{d:"M24,6C13.23,6,4.5,12.93,4.5,21.46c0,5.39,3.5,10.13,8.79,12.89l-1.76,7.06a.46.46,0,0,0,.68.51L21,36.7a24,24,0,0,0,3,.2c10.77,0,19.5-6.91,19.5-15.44S34.77,6,24,6Z",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),vr("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),vr("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),vr("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as Ki,jsx as V,jsxs as bn}from"react/jsx-runtime";function Ll(e){let o=String(e??"").trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function $i(e,o){let t=String(e??"").trim()||"-";return Br(t,o).map((n,r)=>V("span",{className:n.highlight?"font-semibold text-blue-600":void 0,children:n.text},`${n.text}-${r}`))}function _r({names:e,searchText:o,avatarSrcByName:t,emphasize:n=!1}){let r=e.filter(i=>i.trim());if(r.length===0)return null;if(r.length===1){let i=r[0]??"";return bn(Ki,{children:[V(pn,{src:t?.get(i)??"",avatarSx:{width:24,height:24,borderRadius:"50%",...fn[0]},iconFontSize:15}),V(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{fontWeight:500,color:"#2f80ed"}:{}},children:$i(i,o)})]})}return V(xo,{names:r,size:22,avatarSrcByName:t})}function Nl({display:e,summary:o,searchText:t,avatarSrcByName:n}){if(!e||e.kind==="everyone")return V(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:r,individualNames:i}=e;if(r.length===0)return V(_r,{names:i,searchText:t,avatarSrcByName:n});let a=[...r,...i],l=a.join(", ");return a.length>2?V(Wi,{title:l,arrow:!0,children:V(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${a[0]}, ${a[1]} \uC678 ${a.length-2}\uBA85`})}):V(Wi,{title:l,arrow:!0,children:bn(be,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[V(be,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.join(", ")+(i.length>0?",":"")}),i.length>0?V(_r,{names:i,searchText:t,avatarSrcByName:n}):null]})})}function Fl({task:e,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:r=0,todayStr:i,showProject:a=!1,showManager:l=!0,showActions:m=!0,showRequest:c=!0,confirmMode:p="none",bugMode:d=!1,confirmInfo:s,onConfirmTask:u,projectLabel:f="",projectIcon:y="",onProjectClick:b,onRequestToggleCompleted:h,onDateClick:g,onChangeNote:B,onMemberClick:x,onClaimClick:C,onVolunteerClick:S,onStatusClick:D,onOpenDetail:O,onTaskContextMenu:$,hideBottomBorder:E=!1,completeLocked:ae=!1,unread:I=!1,notice:k=!1,noticeReadOnly:K=!1,noteLocked:N=!1,targetSummary:Z="",targetDisplay:P,onArchiveTask:oe,ackInfo:le,onAckConfirm:L,onAckListClick:H,onPriorityClick:J}){let[W,M]=Al(!1),[q,U]=Al(""),te=Tf(null);kf(()=>{if(!W)return;let F=j=>{let Pe=te.current;Pe&&(j.target instanceof Node&&Pe.contains(j.target)||Pe.blur())};return document.addEventListener("mousedown",F,!0),document.addEventListener("touchstart",F,!0),()=>{document.removeEventListener("mousedown",F,!0),document.removeEventListener("touchstart",F,!0)}},[W]);let me=[e.manager_account_seq??0,...e.receiver_account_seqs??[]].some(F=>F>0&&F!==(e.author_account_seq??0)),ne=K,_e=r>0&&!e.is_notice&&!e.is_event&&(e.manager_account_seq??0)===r,R=ne||!!e.is_notice,Y=ie(),Te=!!C&&Tr(e,r),_=!!S&&yr(e,r),xe=R&&!vl(e),ye=e.is_notice?V(gn,{canConfirm:!!le?.canAck,count:le?.count??0,total:le?.total??0,myConfirmed:!!le?.acked,onConfirm:()=>L?.(e),onShowList:F=>H?.(e,F)}):null,Xe=!e.is_notice&&!!e.due_date&&e.due_date.slice(0,10)<=i?"#e5484d":"#2f80ed";return bn(be,{onContextMenu:F=>$(e,F),sx:{display:"grid",gridTemplateColumns:Sr({showProject:a,showManager:l,showActions:m,showRequest:c,notice:k,confirmMode:p,bug:d}),minHeight:48,fontSize:15,bgcolor:Y.table.rowBg,color:Y.table.rowColor,borderBottom:E?"none":`1px solid ${Y.table.rowBorderColor}`,"&:hover":{bgcolor:Y.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${Y.table.rowBorderColor}`},"& > .cell:first-of-type":{px:0,borderRight:"none"},"& > .cell:nth-of-type(2)":{pl:1.5,pr:2},"& > .cell:last-child":{borderRight:"none",pr:2}},children:[V(be,{className:"cell",children:_e?V(be,{sx:{width:3,alignSelf:"stretch",my:.5,ml:.5,bgcolor:"#2f80ed",borderRadius:1.5}}):null}),V(be,{className:"cell",sx:{justifyContent:"center"},children:!ne&&!ae?V(Wi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${lt(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:V(Sf,{checked:e.completed,icon:V(vf,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:V(Cf,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:F=>F.stopPropagation(),onChange:(F,j)=>h({anchorEl:F.currentTarget,task:e,nextCompleted:j}),sx:{p:.5}})}):null}),d?V(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:e.ticket_no||"-"}):null,bn(be,{className:"cell",onClick:()=>O(e),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}},children:[(()=>{let F=Me(e.icon||(e.is_notice?Ro:we));if(!F)return null;let j=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return V(F,{sx:{fontSize:18,flexShrink:0,color:j}})})(),V(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:e.completed?400:Y.table.rowTitleFontWeight,color:e.completed?Y.colors.textMuted:Y.table.rowTitleColor,textDecoration:e.completed?"line-through":"none"},children:$i(e.title,n)}),(e.comment_count??e.comments?.length??0)>0?V(Ir,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,V(be,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:V(Dt,{labelKeys:e.label_keys??[],labelOptions:o})}),I?V(be,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,fr(e)&&!e.archived&&!ne&&oe?V(yf,{size:"small",variant:"outlined",color:"inherit",sx:{ml:"auto",flexShrink:0,minWidth:0,px:1.25,py:.25,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},onClick:F=>{F.stopPropagation(),oe(e)},children:"\uBCF4\uAD00"}):null]}),(()=>{let F=ne||!!e.is_event||!!e.completed;return V(be,{className:"cell",onClick:F?void 0:j=>D(e,j.currentTarget),sx:{py:.5,justifyContent:"center",...F?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:e.is_event?(()=>{let j=Hn(e);return j?V(De,{option:j}):null})():V(De,{option:fo(e)})})})(),V(be,{className:"cell",onClick:ne?void 0:F=>g(e,"start_date",F.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...ne?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:Ll(e.start_date)}),V(be,{className:"cell",onClick:ne?void 0:F=>g(e,"due_date",F.currentTarget),sx:{justifyContent:"center",gap:.5,color:Xe,fontWeight:500,whiteSpace:"nowrap",...ne?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:e.due_date?bn(Ki,{children:[Ll(e.due_date),V(Bf,{sx:{fontSize:15}})]}):null}),k?V(be,{className:"cell",onClick:ne?void 0:()=>x(e,"targets"),sx:{gap:.75,...ne?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:V(Nl,{display:P,summary:Z,searchText:n,avatarSrcByName:t})}):null,!k&&e.is_notice?V(be,{className:"cell",onClick:ne?void 0:()=>x(e,"targets"),sx:{gridColumn:l?"span 2":"auto",gap:.75,...ne?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:V(Nl,{display:P,summary:Z,searchText:n,avatarSrcByName:t})}):null,!k&&!e.is_notice&&!e.is_event&&l?V(be,{className:"cell",onClick:xe?void 0:()=>x(e,"manager"),sx:{gap:.75,...Te||_?{justifyContent:"center"}:{},...xe?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:Te?V(xn,{onClick:F=>C?.(e,F.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):_?V(xn,{onClick:F=>S?.(e,F.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):V(_r,{names:e.manager_name?[e.manager_name]:[],searchText:n,avatarSrcByName:t,emphasize:_e})}):null,!k&&!e.is_notice?V(be,{className:"cell",onClick:R?void 0:()=>x(e,"receivers"),sx:{gridColumn:e.is_event&&l?"span 2":"auto",gap:.75,...R?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:V(_r,{names:e.receiver_names,searchText:n,avatarSrcByName:t})}):null,V(be,{className:"cell",onClick:ne?void 0:F=>J?.(e,F.currentTarget),sx:{py:.5,justifyContent:"center",...ne?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:V(zo,{priority:e.priority,plain:!0})}),a?V(be,{className:"cell",onClick:ne?void 0:F=>b?.(e,F.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...ne?{}:{cursor:"pointer","&:hover":{bgcolor:Y.table.cellHoverBg}}},children:f?bn(Ki,{children:[(()=>{let F=Me(y);return F?V(F,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),V(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f})]}):null}):null,k?V(be,{className:"cell",sx:{justifyContent:"center"},children:ye}):null,!k&&m&&c?V(be,{className:"cell",sx:{justifyContent:"center"},children:e.is_notice?ye:me?V(gn,{canConfirm:!!s?.canConfirm,count:s?.count??0,total:s?.total??0,myConfirmed:!!s?.myTime,onConfirm:()=>u?.(e),onShowList:F=>H?.(e,F)}):null}):null,!k&&p==="action"?V(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:Y.table.rowSubColor},children:e.is_notice?ye:s&&s.total>0?V(gn,{canConfirm:!!s.canConfirm,count:s.count,total:s.total,myConfirmed:!!s.myTime,onConfirm:()=>u?.(e),onShowList:F=>H?.(e,F)}):"-"}):null,!k&&!m?V(be,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:Y.table.rowSubColor},children:e.completed_time||"-"}):null,d?null:V(be,{className:"cell",onClick:()=>{!N&&!W&&(U(e.note),M(!0))},sx:{color:"#6f6f6c",cursor:N?"default":"text"},children:W?V(be,{component:"input",ref:te,autoFocus:!0,spellCheck:!1,value:q,onChange:F=>U(F.target.value),onBlur:()=>{M(!1),q.trim()!==e.note&&B(e.seq,q)},onKeyDown:F=>{F.key==="Enter"&&F.target.blur(),F.key==="Escape"&&(U(e.note),M(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:Y.table.rowTitleColor,caretColor:Y.table.rowTitleColor,p:0,m:0}}):V(be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.note?$i(e.note,n):""})})]})}import{useState as If}from"react";import{Box as Kn,Button as Hl,ButtonBase as _f,Dialog as wf,Divider as Wl,Menu as Df,MenuItem as Of,Popover as Mf}from"@mui/material";import Ef from"@mui/icons-material/ChevronRight";import Pf from"@mui/icons-material/Check";import Rf from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as zf}from"@ehfuse/mui-datetime-picker";import{Fragment as Lf,jsx as _o,jsxs as $t}from"react/jsx-runtime";var qf=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],$l=[{value:"day_before",label:"1\uC77C \uC804"},{value:"two_days_before",label:"2\uC77C \uC804"},{value:"three_days_before",label:"3\uC77C \uC804"},{value:"week_before",label:"1\uC8FC\uC77C \uC804"}],Kl=[{value:"none",label:"\uC5C6\uC74C"},...qf,...$l];function Ui(e){return e?Kl:[{value:"none",label:"\uC5C6\uC74C"},...$l]}function Vi(e){return e==="same_day"?"\uB2F9\uC77C":Kl.find(o=>o.value===e)?.label??"\uC5C6\uC74C"}function Af(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function Mt({anchorEl:e,open:o,date:t,reminder:n,hideReminder:r=!1,centered:i=!1,onClose:a,onDateChange:l,onReminderChange:m}){let[c,p]=If(null),d=Go(),s=$t(Kn,{sx:{width:300,maxWidth:"100%"},children:[_o(Kn,{sx:{height:320},children:_o(zf,{selectedDate:Af(t),onSelect:u=>{l(qe(u)),a()},onClose:a,showFooter:!1,autoApply:!0})}),r?null:$t(Lf,{children:[_o(Wl,{sx:{borderColor:"#e6e6e3"}}),$t(_f,{onClick:u=>p(u.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[$t(Kn,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[_o(Rf,{sx:{fontSize:17,color:"#9a9a97"}}),"\uB9AC\uB9C8\uC778\uB354"]}),$t(Kn,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[Vi(n),_o(Ef,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),_o(Df,{transitionDuration:0,anchorEl:c,open:!!c,onClose:()=>p(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...d,children:Ui(!1).map(u=>$t(Of,{selected:u.value===n,onClick:()=>{m(u.value),p(null)},sx:{fontSize:14,minWidth:120,justifyContent:"space-between",gap:1},children:[u.label,u.value===n?_o(Pf,{sx:{fontSize:16,color:"#2f80ed"}}):null]},u.value))})]}),_o(Wl,{sx:{borderColor:"#e6e6e3"}}),$t(Kn,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[_o(Hl,{size:"small",onClick:()=>{l(qe(new Date)),a()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),_o(Hl,{size:"small",onClick:a,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return i?_o(wf,{open:o,onClose:a,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:s}):_o(Mf,{transitionDuration:0,open:o,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{borderRadius:2,boxShadow:"0 8px 24px rgba(0,0,0,0.14)"}}},children:s})}import{useEffect as Hf,useState as Yi}from"react";import{Box as Kt,Button as Wf,Switch as $f}from"@mui/material";import{FormDialog as Kf}from"@ehfuse/mui-form-dialog";import{ClearTextField as Uf}from"@ehfuse/mui-form-controls";import{ErrorAlert as Vf}from"@ehfuse/alerts";import{Box as Nf,ButtonBase as Ff}from"@mui/material";import{jsx as Gi}from"react/jsx-runtime";function wr({value:e,onChange:o}){return Gi(Nf,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:Ti.map(({key:t,Icon:n})=>{let r=t===e;return Gi(Ff,{onClick:()=>o(t),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:r?"2px solid #2563eb":"1px solid #dedddb",bgcolor:r?"#eef4ff":"#fff",color:r?"#1e3a8a":"#787774","&:hover":{bgcolor:r?"#eef4ff":"#f4f4f2"}},children:Gi(n,{sx:{fontSize:20}})},t)})})}import{jsx as st,jsxs as ji}from"react/jsx-runtime";function Dr({open:e,title:o="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:t="",initialIcon:n=ki,confirmText:r="\uCD94\uAC00",initialUseSprints:i=!1,onClose:a,onSubmit:l}){let[m,c]=Yi(""),[p,d]=Yi(ki),[s,u]=Yi(!1);Hf(()=>{e&&(c(t),d(n),u(i))},[e]);let f=()=>{let b=m.trim();if(!b){Vf("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}l(b,p,s),a()};return st(Kf,{open:e,onClose:a,maxWidth:"xs",title:o,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:ji(Kt,{children:[st(Uf,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:m,onChange:b=>c(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),f())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),st(Kt,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),st(Kt,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:st(wr,{value:p,onChange:d})}),ji(Kt,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[ji(Kt,{children:[st(Kt,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),st(Kt,{sx:{fontSize:12.5,color:"#9a9a97"},children:"\uBAA9\uD45C \uBC30\uC815\uC73C\uB85C \uBC18\uBCF5 \uC8FC\uAE30\uB97C \uAD00\uB9AC\uD569\uB2C8\uB2E4(\uAC1C\uBC1C\uD300\uC6A9)"})]}),st($f,{checked:s,onChange:(b,h)=>u(h)})]})]})}],actions:{showCancelButton:!0,right:st(Wf,{variant:"contained",onClick:f,children:r})}})}import{jsx as pe,jsxs as jo}from"react/jsx-runtime";function ix(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function jl({tasks:e,statusOptions:o,avatarSrcByName:t,searchText:n,todayStr:r,sortBy:i,sortDirection:a,onSort:l,onRequestReply:m,onToggleCompleted:c,onChangeTaskDate:p,onChangeTaskReminder:d,groupBy:s,collapsedGroupKeys:u,customTabs:f,onToggleGroup:y,hideCompleted:b=!1,onAddInGroup:h,canAddInGroup:g,renderGroupSummary:B,renderGroupTitleSummary:x,onChangeTaskProject:C,onAddProject:S,onChangeNote:D,onMemberClick:O,onClaimTask:$,onChangeTaskStatus:E,onOpenDetail:ae,onTaskContextMenu:I,onMemberFilterClick:k,activeMemberFilters:K=[],onStatusFilterClick:N,statusFilterActive:Z=!1,onAckFilterClick:P,ackFilterActive:oe=!1,onProjectFilterClick:le,projectFilterActive:L=!1,onPriorityFilterClick:H,priorityFilterActive:J=!1,columns:W,getConfirmInfo:M,onConfirmTask:q,myAccountSeq:U=0,currentUserName:te="",groupManagerByMyRole:me=!1,allowManagerVolunteer:ne=!0,noticeAdmin:_e=!1,getTargetSummary:R,getTargetDisplay:Y,onArchiveTask:Te,isTaskUnread:_,getAckInfo:xe,onAckConfirm:ye,onAckListClick:Ae,onChangeTaskPriority:Xe,onEndReached:F}){let j=ie(),Pe=Ut(()=>({showManager:!0,showActions:!0,showRequest:!0,...W}),[W]),vo=Pe.showManager??!0,yt=Pe.showActions??!0,tt=Pe.showRequest??!0,St=Pe.confirmMode??"none",Bt=Pe.notice??!1,Po=Pe.bug??!1,Ct=s!=="none",nt=Ut(()=>Ct?zi(e,s,r,f,o,te,{enabled:me,myAccountSeq:U}):[],[Ct,e,s,r,f,o,te,me,U]),lo=Ut(()=>b?nt.map(T=>({section:T,visibleTasks:T.tasks.filter(ee=>!ee.completed)})).filter(T=>T.visibleTasks.length>0):nt.map(T=>({section:T,visibleTasks:T.tasks})),[nt,b]),Ze=Ut(()=>b?e.filter(T=>!T.completed):e,[e,b]),Vo=Ut(()=>new Set(u),[u]),yo=Pe.showProject??(!Bt&&s!=="tab"),En=Ut(()=>Ni({...Pe,showProject:yo}),[Pe,yo]),ve=Sr({...Pe,showProject:yo}),v=Ut(()=>{let T=new Map;for(let ee of f)T.set(ee.key,{label:ee.archived?`${ee.label} (\uBCF4\uAD00\uB428)`:ee.label,icon:ee.icon});return T},[f]),A=Gf(null),[X,se]=mt(null),ge=e.length>0;Ul(()=>{if(!ge){se(null);return}let T=window.requestAnimationFrame(()=>{se(A.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(T)},[ge]);let[w,uo]=mt(!1);Ul(()=>{if(!X)return;let T=()=>uo(X.scrollHeight>X.clientHeight);T();let ee=new ResizeObserver(T);return ee.observe(X),X.firstElementChild&&ee.observe(X.firstElementChild),()=>ee.disconnect()},[X]);let[de,Qe]=mt(null),[Ke,eo]=mt(null),[vt,It]=mt(null),[So,_t]=mt(null),[fi,Za]=mt(!1),[xi,el]=mt(null),Pn=xi?e.find(T=>T.seq===xi.taskSeq)??null:null,[lr,gi]=mt(null),sr=lr?e.find(T=>T.seq===lr.taskSeq)??null:null,ol=ct((T,ee)=>{gi({anchorEl:ee,taskSeq:T.seq})},[]),tl=ct((T,ee)=>{el({anchorEl:ee,taskSeq:T.seq})},[]),Tm=ct((T,ee)=>{if(!ee)return;l(T,i===T&&a==="asc"?"desc":"asc")},[l,i,a]),nl=ct((T,ee,Se)=>{Qe({anchorEl:Se,taskSeq:T.seq,field:ee,date:T[ee],reminder:T.reminder,completed:T.completed})},[]),rl=ct((T,ee)=>{_t({anchorEl:ee,task:T})},[]),ym=ct(T=>{de&&(p(de.taskSeq,de.field,qe(T)),Qe(null))},[de,p]),Sm=ct(T=>{de&&(p(de.taskSeq,de.field,T),Qe(ee=>ee&&{...ee,date:T}))},[de,p]),Bm=ct(T=>{de&&(d(de.taskSeq,T),Qe(ee=>ee&&{...ee,reminder:T}))},[de,d]),il=ct((T,ee=!1)=>pe(Fl,{hideBottomBorder:ee,task:T,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:U,todayStr:r,showProject:yo,showManager:vo,showActions:yt,showRequest:tt,confirmMode:St,confirmInfo:T.is_notice?void 0:M?.(T),onConfirmTask:q,projectLabel:v.get(T.tab_key??"")?.label??"",projectIcon:v.get(T.tab_key??"")?.icon??"",onProjectClick:rl,onRequestReply:m,onRequestToggleCompleted:eo,onDateClick:nl,onChangeNote:D,onMemberClick:O,onClaimClick:$?(Se,Io)=>It({anchorEl:Io,taskSeq:Se.seq,title:Se.title,kind:"claim"}):void 0,onVolunteerClick:ne?(Se,Io)=>It({anchorEl:Io,taskSeq:Se.seq,title:Se.title,kind:"volunteer"}):void 0,onStatusClick:tl,onOpenDetail:ae,onTaskContextMenu:I,notice:Bt,bugMode:Po,noticeReadOnly:!at(T,U),noteLocked:T.is_notice?!kr(T,U):!at(T,U),completeLocked:T.is_event?!0:T.is_notice?(T.author_account_seq??0)!==U:(T.author_account_seq??0)!==U&&(T.manager_account_seq??0)!==U,targetSummary:T.is_notice?R?.(T):void 0,targetDisplay:T.is_notice?Y?.(T):void 0,onArchiveTask:Te,unread:_?.(T)??!1,ackInfo:T.is_notice?xe?.(T):void 0,onAckConfirm:ye,onAckListClick:Ae,onPriorityClick:ol},T.seq),[n,o,t,r,yo,vo,yt,tt,St,M,q,Bt,Po,U,_e,R,Y,Te,_,xe,ye,Ae,ol,v,rl,m,nl,D,O,$,tl,ae,I]);return jo(qo,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${j.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:j.table.bg,color:j.table.rowColor,...j.table.sx},children:[pe(qo,{sx:{display:"grid",gridTemplateColumns:ve,borderBottom:`1px solid ${j.table.borderColor}`,flexShrink:0,bgcolor:j.table.headerBg,"& > *":{borderRight:`1px solid ${j.table.rowBorderColor}`},"& > *:first-of-type":{px:0,borderRight:"none"},"& > *:nth-of-type(2)":{pl:1.5,pr:2},"& > *:last-child":{borderRight:"none",pr:2},...j.table.headerSx},children:En.map(T=>{let ee=i===T.id,Se=!!T.memberFilter,Io=Se&&K.includes(T.memberFilter),Rn=Se||!!T.statusFilter||!!T.ackFilter||!!T.projectFilter||!!T.priorityFilter,cr=Io||!!T.statusFilter&&Z||!!T.ackFilter&&oe||!!T.projectFilter&&L||!!T.priorityFilter&&J;return jo(qo,{onClick:rt=>{T.memberFilter?k(T.memberFilter,rt.currentTarget):T.statusFilter?N(rt.currentTarget):T.ackFilter?P?.(rt.currentTarget):T.projectFilter?le?.(rt.currentTarget):T.priorityFilter?H?.(rt.currentTarget):Tm(T.id,T.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:T.align==="center"?"center":"flex-start",gap:.5,px:1,py:1,minWidth:0,fontSize:j.table.headerFontSize,color:T.sortable||Rn?j.table.headerActiveColor:j.table.headerColor,whiteSpace:"nowrap",cursor:T.sortable||Rn?"pointer":"default",userSelect:"none",...ee?{color:j.table.headerFilteredColor}:{},...cr?{color:j.table.headerFilteredColor,fontWeight:600}:{}},children:[T.icon,T.label,cr?pe(ox,{sx:{fontSize:14}}):null,ee?a==="asc"?pe(Qf,{sx:{fontSize:13}}):pe(Jf,{sx:{fontSize:13}}):null]},T.id)})}),Ze.length===0?pe(qo,{sx:{py:8,textAlign:"center",color:j.table.emptyColor,fontSize:14},children:Po?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":Bt?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):pe(qo,{sx:{flex:1,minHeight:0},children:pe(nx,{ref:A,style:{height:"100%"},thumb:{width:8},children:X?Ct?pe(Yl,{customScrollParent:X,data:lo,computeItemKey:(T,ee)=>ee.section.key,itemContent:(T,ee)=>{let{section:Se,visibleTasks:Io}=ee,Rn=Vo.has(Se.key),cr=T===lo.length-1;return jo(qo,{children:[jo(qo,{onClick:()=>y(Se.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:j.table.groupHeader.minHeight,bgcolor:j.table.groupHeader.bg,borderBottom:`1px solid ${j.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:j.table.groupHeader.hoverBg},...j.table.groupHeader.sx},children:[Rn?pe(ex,{sx:{fontSize:20,color:j.colors.textMuted}}):pe(Zf,{sx:{fontSize:20,color:j.colors.textMuted}}),pe(qo,{component:"span",sx:{fontSize:j.table.groupHeader.labelFontSize,fontWeight:j.table.groupHeader.labelFontWeight,color:j.table.groupHeader.labelColor},children:Se.label}),x?pe(qo,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:x(Se.key,Se.tasks)}):null,h&&(!g||g(Se.key))?pe(jf,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:rt=>{rt.stopPropagation(),h(Se.key,Se.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:j.colors.textSecondary,"&:hover":{bgcolor:j.colors.surfaceHover,color:j.colors.accentOnSurface}},children:pe(Gl,{sx:{fontSize:21}})}):null,jo(qo,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[B?B(Se.key,Se.tasks):null,pe(qo,{component:"span",sx:{flexShrink:0,width:j.table.groupHeader.badge.width,py:j.table.groupHeader.badge.paddingY,borderRadius:`${j.table.groupHeader.badge.borderRadius}px`,bgcolor:j.table.groupHeader.badge.bg,border:j.table.groupHeader.badge.border,color:j.table.groupHeader.badge.color,fontSize:j.table.groupHeader.badge.fontSize,fontWeight:j.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:Io.length})]})]}),Rn?null:Io.map((rt,Cm)=>il(rt,cr&&Cm===Io.length-1&&w))]})}}):pe(Yl,{customScrollParent:X,data:Ze,computeItemKey:(T,ee)=>ee.seq,endReached:F,itemContent:(T,ee)=>il(ee,T===Ze.length-1&&w)}):null})}),pe(hr,{anchorEl:xi?.anchorEl??null,value:Pn?.status??"",options:Pn?Bl(Pn):Fn,onSelect:T=>{Pn&&E(Pn.seq,T)},onClose:()=>el(null)}),pe(Vl,{transitionDuration:0,anchorEl:lr?.anchorEl??null,open:!!lr,onClose:()=>gi(null),children:["high","medium","low"].map(T=>jo(Or,{selected:sr?.priority===T,onClick:()=>{sr&&Xe?.(sr.seq,T),gi(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[pe(zo,{priority:T,small:!0}),sr?.priority===T?pe(Xi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},T))}),jo(Vl,{anchorEl:So?.anchorEl??null,open:!!So,onClose:()=>_t(null),transitionDuration:0,children:[jo(Or,{selected:!So?.task.tab_key,onClick:()=>{So&&C(So.task.seq,""),_t(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[pe(tx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",So?.task.tab_key?null:pe(Xi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),f.filter(T=>!T.archived).map(T=>{let ee=Me(T.icon),Se=So?.task.tab_key===T.key;return jo(Or,{selected:Se,onClick:()=>{So&&C(So.task.seq,T.key),_t(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ee?pe(ee,{sx:{fontSize:17,color:"#1e3a8a"}}):null,T.label,Se?pe(Xi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},T.key)}),S?[pe(Yf,{},"add-project-divider"),jo(Or,{onClick:()=>Za(!0),sx:{fontSize:14,color:"#787774"},children:[pe(Xf,{children:pe(Gl,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),S?pe(Dr,{open:fi,onClose:()=>Za(!1),onSubmit:(T,ee)=>{let Se=So?.task.seq??0;(async()=>{let Io=await S(T,ee);Io&&Se&&C(Se,Io)})(),_t(null)}}):null,pe(rx,{anchorEl:de?.anchorEl??null,open:!!de&&de?.field==="start_date",onClose:()=>Qe(null),selectedDate:ix(de?.date??""),onDateChange:ym}),pe(Mt,{anchorEl:de?.anchorEl??null,open:!!de&&de?.field==="due_date",date:de?.date??"",reminder:de?.reminder??"none",hideReminder:!!de?.completed,onClose:()=>Qe(null),onDateChange:Sm,onReminderChange:Bm}),pe(Ue,{open:!!vt,anchorEl:vt?.anchorEl??null,title:vt?.kind==="claim"?"\uC774 \uC5C5\uBB34\uB97C \uAC00\uC838\uC640 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC774 \uC5C5\uBB34\uC758 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>It(null),onConfirm:()=>{vt&&$?.(vt.taskSeq),It(null)}}),pe(Ue,{open:!!Ke,anchorEl:Ke?.anchorEl??null,title:Ke?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:Ke?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>eo(null),onConfirm:()=>{Ke&&c(Ke.task,Ke.nextCompleted),eo(null)}})]})}import{useCallback as Xo,useMemo as dt,useRef as vx,useState as pt}from"react";import{Box as Be,ButtonBase as cs,Divider as Zl,IconButton as es,Menu as os,MenuItem as Pt}from"@mui/material";import ea from"@mui/icons-material/Add";import ts from"@mui/icons-material/MoreVert";import ns from"@mui/icons-material/EditOutlined";import rs from"@mui/icons-material/ArchiveOutlined";import is from"@mui/icons-material/UnarchiveOutlined";import Ix from"@mui/icons-material/NotificationsOutlined";import _x from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as ax}from"@mui/material";import{jsx as Xl}from"react/jsx-runtime";function ut({sx:e,...o}){return Xl(ax,{viewBox:"0 0 24 24",...o,sx:{fill:"none",...e},children:Xl("path",{d:"M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6M14 10V17M10 10V17",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{DndContext as wx,DragOverlay as Dx,PointerSensor as Ox,pointerWithin as Mx,rectIntersection as Ex,useDroppable as Px,useSensor as Rx,useSensors as zx}from"@dnd-kit/core";import{SortableContext as ms,arrayMove as as,horizontalListSortingStrategy as qx,useSortable as Ax,verticalListSortingStrategy as Lx}from"@dnd-kit/sortable";import{CSS as Nx}from"@dnd-kit/utilities";import oa from"@ehfuse/overlay-scrollbar";import{useState as ux}from"react";import{Box as Et,ButtonBase as dx,Checkbox as px,Tooltip as fx}from"@mui/material";import xx from"@mui/icons-material/AlarmOutlined";import gx from"@mui/icons-material/TimerOutlined";import{Box as Vt,Button as lx,Popover as sx}from"@mui/material";import cx from"@mui/icons-material/CheckCircle";import{jsx as Gt,jsxs as Mr}from"react/jsx-runtime";function Er({anchorEl:e,open:o,acks:t,total:n,avatarSrcByName:r,onRequestConfirm:i,onClose:a}){let l=He();return Gt(sx,{open:o&&(l||!!e),anchorEl:e,onClose:a,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...l?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:Mr(Vt,{sx:{minWidth:240,maxWidth:320,py:1},children:[Mr(Vt,{sx:{px:2,pb:.75,fontSize:po(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",t.length,"/",n]}),t.length===0?Gt(Vt,{sx:{px:2,py:1.5,fontSize:po(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(m=>Mr(Vt,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[Gt(xo,{names:[m.name],size:22,avatarSrcByName:r}),Gt(Vt,{component:"span",sx:{fontSize:po(14),color:"#37352f",whiteSpace:"nowrap"},children:m.name}),Gt(Vt,{component:"span",sx:{ml:"auto",fontSize:po(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:lt(m.time)}),Gt(cx,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},m.account_seq)),i?Gt(Vt,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:Mr(lx,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{i(),a()},sx:{fontSize:po(13)},children:["\uD655\uC778 \uC694\uCCAD (",n-t.length,"\uBA85 \uBBF8\uD655\uC778)"]})}):null]})})}function mx(e){let o=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(t=>t>0&&t!==o))]}function Ql(e,o){let t=mx(e),n=e.acks??[],r=o>0?n.find(i=>i.account_seq===o):void 0;return{myTime:r?.time??"",canConfirm:o>0&&t.includes(o)&&!r,count:n.filter(i=>t.includes(i.account_seq)).length,total:t.length}}function _1(e){let o=String(e??"").trim();return o?o.slice(5,16).replaceAll("-","."):""}import{Fragment as kx,jsx as go,jsxs as Yt}from"react/jsx-runtime";function hn(e){return{border:`1px solid ${e.borderColor}`,borderRadius:1,p:1,bgcolor:e.bg,display:"flex",flexDirection:"column",gap:.75,boxShadow:"0 1px 2px rgba(0,0,0,0.04)",...e.sx}}function bx(e){let o=e.trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function hx(){let e=new Date,o=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${o}-${t}`}function jt({task:e,statusOptions:o,showDueDate:t=!1,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,titleFontSize:a=13}){let l=ie(),c=!!e.due_date&&e.due_date.slice(0,10)<=hx()?l.colors.danger:l.colors.accentOnSurface,p=Ql(e,0),[d,s]=ux(null),u=wt(e,o),f=new Set(e.label_keys??[]),y=u.filter(h=>!f.has(h.key)),b=u.filter(h=>f.has(h.key));return Yt(kx,{children:[Yt(Et,{sx:{display:"flex",alignItems:"center",gap:.5},children:[go(px,{size:"small",checked:e.completed,onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),onChange:(h,g)=>n?.({anchorEl:h.currentTarget,taskSeq:e.seq,nextCompleted:g}),sx:{p:0}}),go(fx,{title:e.title,arrow:!0,enterDelay:300,children:Yt(Et,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:a,fontWeight:l.mode==="dark"||e.completed?400:500,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary,lineHeight:1.35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:e.completed?"line-through":"none"},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})}),(e.comment_count??e.comments?.length??0)>0?go(Ir,{sx:{fontSize:15,flexShrink:0,color:l.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?go(Et,{sx:{pl:3,mt:-.5,fontSize:12.5,color:l.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,Yt(Et,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[Yt(Et,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[y.map(h=>go(De,{option:h,small:!0},h.key)),go(zo,{priority:e.priority,small:!0}),b.map(h=>go(De,{option:h,small:!0},h.key))]}),t&&String(e.due_date??"").trim()?Yt(dx,{disabled:!i,onPointerDown:h=>h.stopPropagation(),onClick:h=>{h.stopPropagation(),i?.(e,h.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:c,whiteSpace:"nowrap","&:hover":i?{bgcolor:l.colors.border}:void 0},children:[bx(e.due_date),go(xx,{sx:{fontSize:15}})]}):null]}),t&&e.estimated_time?Yt(Et,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:l.colors.textSecondary},children:[go(gx,{sx:{fontSize:14}}),e.estimated_time]}):null,go(xo,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),p.total>0?go(Et,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:go(Et,{sx:{flexShrink:0,width:64},onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),children:go(gn,{canConfirm:!1,count:p.count,total:p.total,onConfirm:()=>{},onShowList:h=>s(h)})})}):null,go(Er,{anchorEl:d,open:!!d,acks:e.acks??[],total:p.total,onRequestConfirm:r&&p.count<p.total?()=>{r(e),s(null)}:void 0,onClose:()=>s(null)})]})}import{Box as Tx}from"@mui/material";import{useSortable as yx}from"@dnd-kit/sortable";import{CSS as Sx}from"@dnd-kit/utilities";import{jsx as Jl}from"react/jsx-runtime";function Bx(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function Pr({task:e,statusOptions:o,variant:t="card",showDueDate:n=!1,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,onCardClick:l,onCardContextMenu:m,titleFontSize:c}){let p=ie(),{attributes:d,listeners:s,setNodeRef:u,transform:f,transition:y,isDragging:b}=yx({id:String(e.seq)}),h=t==="list";return Jl(Tx,{ref:u,...d,...s,onClick:l?()=>l(e):void 0,onContextMenu:m?g=>m(e,g):void 0,sx:{...h?Bx(p.card):hn(p.card),opacity:b?.35:e.completed?.55:1,transform:Sx.Translate.toString(f),transition:y,position:"relative",cursor:"default",touchAction:"none","&:hover":h?{bgcolor:p.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:Jl(jt,{task:e,statusOptions:o,showDueDate:n,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,titleFontSize:c})})}function Cx(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function wo(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let o=Cx(e.end_date);return o?`${e.name} (~${o})`:e.name}import{jsx as Q,jsxs as Ee}from"react/jsx-runtime";var ls=2,Rr="group-",Do="colmove-",Qi="__default__",Ji=Oi,Zi="__other__",zr="sprint-",ss=`${zr}0`,Fx={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function us(e){return{flexShrink:0,width:e.width,py:e.paddingY,borderRadius:`${e.borderRadius}px`,bgcolor:e.bg,border:e.border,color:e.color,fontSize:e.fontSize,fontWeight:e.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums",...e.sx}}function Hx({column:e,tasks:o,statusOptions:t,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onAddTask:a,canAdd:l,onOpenMenu:m,onCardClick:c,onCardContextMenu:p,grow:d,summary:s,onOpenSprintMenu:u}){let f=ie(),{setNodeRef:y,isOver:b}=Px({id:`${Rr}${e.key}`}),{attributes:h,listeners:g,setNodeRef:B,transform:x,transition:C,isDragging:S}=Ax({id:`${Do}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return Ee(Be,{ref:D=>{y(D),B(D)},sx:{flex:d?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:D=>D.shadows[1],bgcolor:b?f.colors.accentSoft:f.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:Nx.Translate.toString(x),...C?{transition:`${C}, background-color 0.15s`}:{},opacity:S?.6:1},children:[Ee(Be,{...h,...g,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${f.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?Q(Be,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let D=Me(e.icon);return D?Q(D,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Q(Be,{component:"span",sx:{fontSize:f.board.columnHeaderFontSize,fontWeight:700,color:f.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),Q(Be,{component:"span",sx:{...us(f.board.badge),ml:"auto"},children:o.length}),e.sprint&&u?Q(es,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:D=>D.stopPropagation(),onClick:D=>u(D.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:Q(ts,{sx:{fontSize:18}})}):e.locked?null:Q(es,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:D=>D.stopPropagation(),onClick:D=>m({anchorEl:D.currentTarget,column:e}),sx:{color:"#9a9a97"},children:Q(ts,{sx:{fontSize:18}})})]}),s?Q(Be,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${f.card.borderColor}`,flexShrink:0},children:s}):null,Q(Be,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Q(oa,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Ee(Be,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[Q(ms,{items:o.map(D=>String(D.seq)),strategy:Lx,children:o.map(D=>Q(Pr,{task:D,statusOptions:t,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onCardClick:c,onCardContextMenu:p},D.seq))}),o.length===0&&!l?Q(Be,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,o.length===0&&l?Q(Be,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:Ee(cs,{className:"taskbox-board-add",onClick:()=>a(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.card.borderColor}`,bgcolor:f.card.bg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.card.hoverBg}},children:[Q(ea,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function ta({tasks:e,statusOptions:o,customTabs:t,mode:n="active",onToggleCompleted:r,onRequestReply:i,onChangeDueDate:a,onChangeReminder:l,onMoveTask:m,columnAxis:c="project",statusColumns:p=[],onMoveTaskStatus:d,sprintColumns:s=[],onMoveTaskSprint:u,onAddGroup:f,onAddTask:y,canAdd:b=!0,onRequestRename:h,onArchiveProject:g,onDeleteProject:B,onReorderProjects:x,onOpenDetail:C,onTaskContextMenu:S,hideCompleted:D=!1,renderColumnSummary:O,onEditSprint:$,onChangeSprintStatus:E,onRemoveSprint:ae}){let I=ie(),[k,K]=pt(null),[N,Z]=pt(null),[P,oe]=pt(null),[le,L]=pt(null),[H,J]=pt(null),[W,M]=pt(null),[q,U]=pt(null),[te,me]=pt(null),[ne,_e]=pt(null),R=vx(!1),Y=dt(()=>new Map(e.map(v=>[v.seq,v])),[e]),Te=dt(()=>{let v=e.filter(A=>A.is_notice);return v.sort((A,X)=>A.completed!==X.completed?A.completed?1:-1:X.seq-A.seq),v},[e]),_=dt(()=>t.filter(v=>!v.archived),[t]),xe=dt(()=>t.filter(v=>v.archived),[t]),ye=v=>({key:v.key,label:v.label,icon:v.icon,isDefault:!1,isArchived:v.archived}),Ae=dt(()=>new Set(p.map(v=>v.key)),[p]),Xe=dt(()=>new Set(s.map(v=>v.seq)),[s]),F=dt(()=>{if(c==="sprint")return[{key:ss,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...s.map(v=>({key:`${zr}${v.seq}`,label:wo(v),icon:"",isDefault:!1,isArchived:!1,dot:Fx[v.status],locked:!0,sprint:v}))];if(c==="status"){let v=p.map(A=>({key:A.key,label:A.name,icon:"",isDefault:!1,isArchived:!1,dot:A.dot,locked:!0}));return v.some(A=>A.key===Ji)?v:[...v,{key:Ji,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return n==="archived"?xe.map(ye):[{key:Qi,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},..._.map(ye)]},[c,p,s,n,_,xe]),j=zx(Rx(Ox,{activationConstraint:{distance:5}})),Pe=Xo(v=>{let A=String(v.active.id).startsWith(Do),X=Mx(v),se=X.length>0?X:Ex(v);if(A)return se.filter(uo=>String(uo.id).startsWith(Do));let ge=se.filter(uo=>!String(uo.id).startsWith(Do)),w=ge.filter(uo=>!String(uo.id).startsWith(Rr));return w.length>0?w:ge},[]),vo=dt(()=>{let v=new Map;for(let A of e){if(A.is_notice)continue;let X;if(c==="sprint"){let ge=A.sprint_seq??0;X=Xe.has(ge)?`${zr}${ge}`:ss}else X=c==="status"?A.completed?Ji:Ae.has(String(A.status??""))?String(A.status??""):Zi:A.tab_key?.trim()||Qi;let se=v.get(X);se?se.push(A):v.set(X,[A])}for(let A of v.values())A.sort((X,se)=>{if(X.completed!==se.completed)return X.completed?1:-1;let ge=(X.group_sort_no??0)>0,w=(se.group_sort_no??0)>0;return ge&&w?(X.group_sort_no??0)-(se.group_sort_no??0):ge!==w?ge?-1:1:X.due_date!==se.due_date?X.due_date<se.due_date?-1:1:X.seq-se.seq});return v},[e,c,Ae,Xe]),yt=dt(()=>c!=="status"||(vo.get(Zi)??[]).length===0?F:[...F,{key:Zi,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[c,F,vo]),tt=Xo(v=>q?(q.get(v)??[]).map(A=>Y.get(A)).filter(A=>!!A):vo.get(v)??[],[q,Y,vo]),St=Xo(v=>{let A=tt(v);return D?A.filter(X=>!X.completed):A},[tt,D]),Bt=Xo(v=>{let A=String(v.active.id);if(A.startsWith(Do)){_e(A.slice(Do.length));return}me(Number(A)),U(new Map(F.map(X=>[X.key,(vo.get(X.key)??[]).map(se=>se.seq)])))},[F,vo]),Po=Xo((v,A)=>{if(v.startsWith(Rr))return{key:v.slice(Rr.length),overSeq:null};let X=Number(v);for(let[se,ge]of A)if(ge.includes(X))return{key:se,overSeq:X};return null},[]),Ct=Xo(v=>{let{active:A,over:X}=v;!X||String(A.id).startsWith(Do)||U(se=>{if(!se)return se;let ge=Number(A.id),w=Po(String(X.id),se);if(!w)return se;let uo=[...se.entries()].find(([,eo])=>eo.includes(ge))?.[0];if(!uo||uo===w.key)return se;let de=new Map(se);de.set(uo,(de.get(uo)??[]).filter(eo=>eo!==ge));let Qe=[...de.get(w.key)??[]],Ke=Qe.length;if(w.overSeq!==null){let eo=Qe.indexOf(w.overSeq);eo!==-1&&(Ke=eo)}return Qe.splice(Ke,0,ge),de.set(w.key,Qe),de})},[Po]),nt=Xo(v=>{let A=String(v.active.id);if(A.startsWith(Do)){_e(null);let Ke=String(v.over?.id??"");if(!Ke.startsWith(Do))return;let eo=A.slice(Do.length),vt=Ke.slice(Do.length);if(eo===vt)return;let It=t.map(fi=>fi.key),So=It.indexOf(eo),_t=It.indexOf(vt);if(So===-1||_t===-1)return;x(as(It,So,_t));return}let X=q;if(U(null),me(null),R.current=!0,!X||!v.over)return;let se=Number(A),ge=[...X.entries()].find(([,Ke])=>Ke.includes(se));if(!ge)return;let[w,uo]=ge,de=[...uo],Qe=Po(String(v.over.id),X);if(Qe&&Qe.key===w&&Qe.overSeq!==null&&Qe.overSeq!==se){let Ke=de.indexOf(se),eo=de.indexOf(Qe.overSeq);Ke!==-1&&eo!==-1&&(de=as(de,Ke,eo))}if(c==="status"){d?.(se,w);return}if(c==="sprint"){u?.(se,Number(w.slice(zr.length))||0);return}m(se,w===Qi?"":w,de)},[t,q,Po,m,x,c,d,u]),lo=Xo(()=>{U(null),me(null),_e(null),R.current=!0},[]),Ze=Xo(v=>{if(R.current){R.current=!1;return}C(v)},[C]),Vo=te!==null?Y.get(te)??null:null,yo=ne!==null?F.find(v=>v.key===ne)??null:null,En=Xo((v,A)=>{M({anchorEl:A,taskSeq:v.seq,date:v.due_date,reminder:v.reminder})},[]),ve=N?.column??null;return Ee(Be,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${I.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:ls,bgcolor:I.colors.surfaceSubtle},children:[Ee(wx,{sensors:j,collisionDetection:Pe,onDragStart:Bt,onDragOver:Ct,onDragEnd:nt,onDragCancel:lo,children:[Q(Be,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:n==="archived"&&F.length===0?Q(Be,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Q(oa,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:Ee(Be,{sx:{display:"flex",alignItems:"flex-start",gap:ls,height:"100%",minWidth:"min-content",pb:.5},children:[n==="active"&&Te.length>0?Ee(Be,{sx:{flex:c!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:v=>v.shadows[1],bgcolor:I.card.bg,overflow:"hidden"},children:[Ee(Be,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${I.card.borderColor}`,flexShrink:0,minHeight:48},children:[Q(Ix,{sx:{fontSize:17,color:"#e8763a"}}),Q(Be,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:I.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),Ee(Be,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",Te.length,")"]})]}),Q(Be,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Q(oa,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Q(Be,{sx:{display:"flex",flexDirection:"column"},children:Te.map(v=>Ee(Be,{onClick:()=>Ze(v),onContextMenu:A=>S(v,A),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${I.card.borderColor}`,bgcolor:I.card.bg,cursor:"pointer","&:hover":{bgcolor:I.card.hoverBg}},children:[Q(jt,{task:v,statusOptions:o,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:K}),(()=>{let A=(v.target_names??[]).filter(se=>se.trim());if(A.length===0)return null;let X=A.length>2?`${A[0]}, ${A[1]} \uC678 ${A.length-2}`:A.join(", ");return Ee(Be,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[Q(_x,{sx:{fontSize:14,flexShrink:0}}),Q(Be,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:X})]})})()]},v.seq))})})})]}):null,Q(ms,{items:_.map(v=>`${Do}${v.key}`),strategy:qx,children:yt.map(v=>Q(Hx,{column:v,tasks:St(v.key),summary:O?.(v.key,tt(v.key)),onOpenSprintMenu:$||E||ae?(A,X)=>oe({anchorEl:A,sprint:X}):void 0,statusOptions:o,onRequestArchiveToggle:K,onRequestReply:i,onDueDateClick:En,onAddTask:y,canAdd:b&&c==="project",onOpenMenu:Z,onCardClick:Ze,onCardContextMenu:S,grow:c!=="project"},v.key))}),n==="active"&&c==="project"?Ee(cs,{onClick:f,sx:{flex:"0 0 270px",minWidth:270,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:2,border:"1.5px dashed #cfcfcc",borderRadius:1.5,color:"#787774",fontSize:14,"&:hover":{bgcolor:"#eef2f6",borderColor:"#9a9a97"}},children:[Q(ea,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,n==="active"&&yt.length===0&&Te.length===0?Q(Be,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:c==="project"?"\uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0C8 \uD504\uB85C\uC81D\uD2B8\uB97C \uCD94\uAC00\uD574 \uC5C5\uBB34\uB97C \uC815\uB9AC\uD558\uC138\uC694.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})}),Q(Dx,{children:Vo?Q(Be,{sx:{...hn,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Q(jt,{task:Vo,statusOptions:o,showDueDate:!0,titleFontSize:15})}):yo?Ee(Be,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:I.card.bg,border:`1px solid ${I.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let v=Me(yo.icon);return v?Q(v,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Q(Be,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:I.board.columnHeaderColor},children:yo.label}),Q(Be,{component:"span",sx:us(I.board.badge),children:(vo.get(yo.key)??[]).length})]}):null})]}),Ee(os,{transitionDuration:0,anchorEl:N?.anchorEl??null,open:!!N,onClose:()=>Z(null),children:[ve&&!ve.isArchived&&b?Ee(Pt,{onClick:()=>{ve&&y(ve.isDefault?"":ve.key),Z(null)},sx:{fontSize:14,gap:1},children:[Q(ea,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,ve&&!ve.isDefault&&!ve.isArchived?Ee(Pt,{onClick:()=>{h(ve.key,ve.label,ve.icon),Z(null)},sx:{fontSize:14,gap:1},children:[Q(ns,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,ve&&!ve.isDefault&&!ve.isArchived?Ee(Pt,{onClick:()=>{g(ve.key,!0),Z(null)},sx:{fontSize:14,gap:1},children:[Q(rs,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,ve&&ve.isArchived?Ee(Pt,{onClick:()=>{g(ve.key,!1),Z(null)},sx:{fontSize:14,gap:1},children:[Q(is,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,ve&&!ve.isDefault?Q(Zl,{}):null,ve&&!ve.isDefault?Ee(Pt,{onClick:()=>{N&&J(N),Z(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Q(ut,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),Ee(os,{transitionDuration:0,anchorEl:P?.anchorEl??null,open:!!P,onClose:()=>oe(null),children:[$?Ee(Pt,{onClick:()=>{P&&$(P.sprint.seq),oe(null)},sx:{fontSize:14,gap:1},children:[Q(ns,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,E?Ee(Pt,{onClick:()=>{P&&E(P.sprint.seq,P.sprint.status==="closed"?"active":"closed"),oe(null)},sx:{fontSize:14,gap:1},children:[P?.sprint.status==="closed"?Q(is,{sx:{fontSize:18,color:"#787774"}}):Q(rs,{sx:{fontSize:18,color:"#787774"}}),P?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,ae?Q(Zl,{}):null,ae?Ee(Pt,{onClick:()=>{P&&L(P),oe(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Q(ut,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),Q(Ue,{open:!!le,anchorEl:le?.anchorEl??null,title:`"${le?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>L(null),onConfirm:()=>{le&&ae?.(le.sprint.seq),L(null)}}),Q(Mt,{anchorEl:W?.anchorEl??null,open:!!W,date:W?.date??"",reminder:W?.reminder??"none",onClose:()=>M(null),onDateChange:v=>{W&&(a(W.taskSeq,v),M(A=>A&&{...A,date:v}))},onReminderChange:v=>{W&&(l(W.taskSeq,v),M(A=>A&&{...A,reminder:v}))}}),Q(Ue,{open:!!H,anchorEl:H?.anchorEl??null,title:`"${H?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
2
- \uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>J(null),onConfirm:()=>{H&&B(H.column.key),J(null)}}),Q(Ue,{open:!!k,anchorEl:k?.anchorEl??null,title:k?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:k?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>K(null),onConfirm:()=>{k&&r(k.taskSeq,k.nextCompleted),K(null)}})]})}import{useCallback as zt,useMemo as Un,useRef as Gx,useState as Vn}from"react";import{Box as Ve,Button as Yx,ButtonBase as ps,IconButton as ds}from"@mui/material";import jx from"@mui/icons-material/Add";import Xx from"@mui/icons-material/ChevronLeft";import Qx from"@mui/icons-material/ChevronRight";import Jx from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Zx}from"@ehfuse/mui-datetime-picker";import{DndContext as eg,DragOverlay as og,PointerSensor as tg,pointerWithin as ng,rectIntersection as rg,useDroppable as ig,useSensor as ag,useSensors as lg}from"@dnd-kit/core";import{SortableContext as sg,arrayMove as cg,verticalListSortingStrategy as mg}from"@dnd-kit/sortable";import ug from"@ehfuse/overlay-scrollbar";import{useEffect as Wx,useState as $x}from"react";function Rt(e){let{loadHolidays:o}=Bo(),[t,n]=$x(()=>new Map),r=e.join(",");return Wx(()=>{if(!o||!r){n(new Map);return}let i=!1;return o(r.split(",").map(Number)).then(a=>{if(i)return;let l=new Map;for(let m of a)l.has(m.date)||l.set(m.date,m.name);n(l)}).catch(()=>{}),()=>{i=!0}},[o,r]),t}function Kx(e){let[o,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(o,t-1,n+1)),i=a=>String(a).padStart(2,"0");return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`}function kn(e){let o=new Map;for(let t of e){let n=t.start_date;for(let r=0;r<62&&n<=t.end_date;r+=1){let i=o.get(n);i?i.push(t):o.set(n,[t]),n=Kx(n)}}for(let t of o.values())t.sort((n,r)=>(n.time||"99:99").localeCompare(r.time||"99:99")||n.title.localeCompare(r.title));return o}import{Box as na,Tooltip as Ux}from"@mui/material";import{jsx as ra,jsxs as Vx}from"react/jsx-runtime";function Tn({event:e,small:o=!1}){let t=e.time?`${e.time} ${e.title}`:e.title,n=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",r=i=>{i.stopPropagation();let[a,l,m]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${a}/${l}/${m}`,"_blank")};return ra(Ux,{title:`(${n}) ${t}`,arrow:!0,enterDelay:300,children:Vx(na,{onClick:r,onPointerDown:i=>i.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:o?.6:.8,borderRadius:.75,bgcolor:"#f1f1ef",color:"#37352f",fontSize:15,fontWeight:500,overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,minWidth:0,maxWidth:"100%",cursor:"pointer","&:hover":{bgcolor:"#ececea"}},children:[ra(na,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),ra(na,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t})]})})}import{jsx as Ce,jsxs as ft}from"react/jsx-runtime";var fs=36,dg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],qr="day-";function ia(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function aa(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function pg(e){let o=e[0],t=e[e.length-1];return o.getMonth()===t.getMonth()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4`:o.getFullYear()===t.getFullYear()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getMonth()+1}\uC6D4`:`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getFullYear()}\uB144 ${t.getMonth()+1}\uC6D4`}function fg(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function xg({dayKey:e,isToday:o,dayLabel:t,holidayName:n,tasks:r,googleEvents:i,statusOptions:a,onRequestArchiveToggle:l,onRequestReply:m,onAddSchedule:c,canAdd:p,onCardClick:d,onCardContextMenu:s,summary:u}){let f=ie(),{setNodeRef:y}=ig({id:`${qr}${e}`});return ft(Ve,{ref:y,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:o?f.calendar.todayBg:f.calendar.cellBg},children:[ft(Ve,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:fs,bgcolor:o?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:r.length>0?`1px solid ${f.calendar.borderColor}`:"none",flexShrink:0},children:[n?Ce(Ve,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}):null,o?Ce(Ve,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Ce(Ve,{component:"span",sx:{fontSize:13.5,fontWeight:o?700:400,color:n?f.colors.danger:f.mode==="dark"?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:t})]}),u?Ce(Ve,{sx:{px:1,py:1,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0},children:u}):null,Ce(Ve,{sx:{flex:1,minHeight:0,bgcolor:o?f.calendar.todayBg:f.colors.surfaceSubtle},children:Ce(ug,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:ft(Ve,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[i.length>0?Ce(Ve,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:i.map(b=>Ce(Tn,{event:b},b.uid))}):null,Ce(sg,{items:r.map(b=>String(b.seq)),strategy:mg,children:r.map(b=>Ce(Pr,{titleFontSize:15,task:b,statusOptions:a,variant:"list",onRequestArchiveToggle:l,onRequestReply:m,onCardClick:d,onCardContextMenu:s},b.seq))}),Ce(Ve,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...p?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:ft(ps,{className:"taskbox-add-schedule",onClick:()=>c(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[Ce(jx,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function xs({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onToggleCompleted:r,onMoveTask:i,onRequestReply:a,onAddSchedule:l,canAdd:m=!0,onOpenDetail:c,onTaskContextMenu:p,renderColumnSummary:d}){let s=ie(),[u,f]=Vn(()=>ia(new Date)),[y,b]=Vn(null),[h,g]=Vn(null),[B,x]=Vn(null),[C,S]=Vn(null),D=Gx(!1),O=Un(()=>Array.from({length:7},(M,q)=>aa(u,q)),[u]),$=Un(()=>new Map(e.map(M=>[M.seq,M])),[e]),E=Un(()=>[...new Set(O.map(M=>M.getFullYear()))],[O]),ae=Rt(E),I=lg(ag(tg,{activationConstraint:{distance:5}})),k=zt(M=>{let q=ng(M),U=q.length>0?q:rg(M),te=U.filter(me=>!String(me.id).startsWith(qr));return te.length>0?te:U},[]),K=Un(()=>kn(o),[o]),N=Un(()=>{let M=new Map;for(let q of e){let U=q.due_date.slice(0,10);if(!U)continue;let te=M.get(U);te?te.push(q):M.set(U,[q])}for(let q of M.values())q.sort((U,te)=>{let me=U.sort_no>0,ne=te.sort_no>0;if(me&&ne)return U.sort_no-te.sort_no;if(me!==ne)return me?-1:1;if(U.completed!==te.completed)return U.completed?1:-1;let _e=Mi(U),R=Mi(te);return _e!==R?_e?-1:1:U.seq-te.seq});return M},[e]),Z=zt(M=>B?(B.get(M)??[]).map(q=>$.get(q)).filter(q=>!!q):N.get(M)??[],[B,$,N]),P=zt(M=>{S(Number(M.active.id)),x(new Map(O.map(q=>{let U=qe(q);return[U,(N.get(U)??[]).map(te=>te.seq)]})))},[O,N]),oe=zt((M,q)=>{if(M.startsWith(qr))return{day:M.slice(qr.length),overSeq:null};let U=Number(M);for(let[te,me]of q)if(me.includes(U))return{day:te,overSeq:U};return null},[]),le=zt(M=>{let{active:q,over:U}=M;U&&x(te=>{if(!te)return te;let me=Number(q.id),ne=oe(String(U.id),te);if(!ne)return te;let _e=[...te.entries()].find(([,_])=>_.includes(me))?.[0];if(!_e||_e===ne.day)return te;let R=new Map(te);R.set(_e,(R.get(_e)??[]).filter(_=>_!==me));let Y=[...R.get(ne.day)??[]],Te=Y.length;if(ne.overSeq!==null){let _=Y.indexOf(ne.overSeq);_!==-1&&(Te=_)}return Y.splice(Te,0,me),R.set(ne.day,Y),R})},[oe]),L=zt(M=>{let{active:q,over:U}=M,te=B;if(x(null),S(null),D.current=!0,!te||!U)return;let me=Number(q.id),ne=[...te.entries()].find(([,_])=>_.includes(me));if(!ne)return;let[_e,R]=ne,Y=[...R],Te=oe(String(U.id),te);if(Te&&Te.day===_e&&Te.overSeq!==null&&Te.overSeq!==me){let _=Y.indexOf(me),xe=Y.indexOf(Te.overSeq);_!==-1&&xe!==-1&&(Y=cg(Y,_,xe))}i(me,_e,Y)},[B,i,oe]),H=zt(()=>{x(null),S(null),D.current=!0},[]),J=zt(M=>{if(D.current){D.current=!1;return}c(M)},[c]),W=C!==null?$.get(C)??null:null;return ft(Ve,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${s.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[ft(Ve,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:s.calendar.headerBg,borderBottom:`1px solid ${s.calendar.borderColor}`,flexShrink:0},children:[ft(Ve,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Ce(ds,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>f(aa(u,-7)),children:Ce(Xx,{sx:{fontSize:20,color:s.colors.textSecondary}})}),Ce(Yx,{size:"small",color:"inherit",onClick:()=>f(ia(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:s.mode==="dark"?400:500,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary},children:"\uC624\uB298"}),Ce(ds,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>f(aa(u,7)),children:Ce(Qx,{sx:{fontSize:20,color:s.colors.textSecondary}})})]}),ft(ps,{onClick:M=>g(M.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:s.mode==="dark"?400:700,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary,"&:hover":{bgcolor:s.colors.surfaceHover}},children:[pg(O),Ce(Jx,{sx:{fontSize:18,color:s.colors.textMuted}})]})]}),Ce(Ve,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:s.calendar.headerBg,borderBottom:`1px solid ${s.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${s.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:O.map(M=>{let q=M.getDay(),U=ae.has(qe(M));return Ce(Ve,{sx:{height:fs,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:q===0||U?s.colors.danger:q===6?s.colors.accentOnSurface:s.colors.textSecondary},children:dg[q]},qe(M))})}),Ce(Ve,{sx:{flex:1,minHeight:0},children:ft(eg,{sensors:I,collisionDetection:k,onDragStart:P,onDragOver:le,onDragEnd:L,onDragCancel:H,children:[Ce(Ve,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${s.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:O.map(M=>{let q=qe(M);return Ce(xg,{dayKey:q,isToday:q===n,dayLabel:fg(M),holidayName:ae.get(q)??"",summary:d?.(q,Z(q)),tasks:Z(q),googleEvents:K.get(q)??[],statusOptions:t,onRequestArchiveToggle:b,onRequestReply:a,onAddSchedule:l,canAdd:m,onCardClick:J,onCardContextMenu:p},q)})}),Ce(og,{children:W?Ce(Ve,{sx:{...hn,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Ce(jt,{task:W,statusOptions:t})}):null})]})}),Ce(Zx,{anchorEl:h,open:!!h,onClose:()=>g(null),selectedDate:u,onDateChange:M=>{f(ia(M)),g(null)}}),Ce(Ue,{open:!!y,anchorEl:y?.anchorEl??null,title:y?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:y?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>b(null),onConfirm:()=>{y&&r(y.taskSeq,y.nextCompleted),b(null)}})]})}import{useCallback as Gn,useMemo as Xt,useState as Ar}from"react";import{Box as Ge,Button as gg,ButtonBase as hs,IconButton as gs,Tooltip as bg}from"@mui/material";import hg from"@mui/icons-material/Add";import kg from"@mui/icons-material/ChevronLeft";import Tg from"@mui/icons-material/ChevronRight";import yg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Sg}from"@ehfuse/mui-datetime-picker";import{DndContext as Bg,DragOverlay as Cg,PointerSensor as vg,pointerWithin as Ig,rectIntersection as _g,useDraggable as wg,useDroppable as ks,useSensor as Dg,useSensors as Og}from"@dnd-kit/core";import Mg from"@ehfuse/overlay-scrollbar";import{jsx as Oe,jsxs as Ao}from"react/jsx-runtime";var Eg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Lr="mday-",Nr="mchip-",Ts=36,ys=15,Ss={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"};function Pg(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Fr(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Rg(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function bs(e,o){let t=Fr(e);return t.setMonth(t.getMonth()+o),t}function zg({task:e,statusOptions:o,isPreview:t=!1,onOpenDetail:n,onContextMenu:r}){let i=ie(),a=i.mode==="dark",{attributes:l,listeners:m,setNodeRef:c,isDragging:p}=wg({id:String(e.seq),disabled:t}),{setNodeRef:d}=ks({id:`${Nr}${e.seq}`,disabled:t}),s=Me(e.icon||we),[u]=wt(e,o);return Oe(bg,{title:e.title,arrow:!0,enterDelay:400,children:Ao(Ge,{ref:f=>{c(f),d(f)},...l,...m,onClick:()=>n(e),onContextMenu:f=>r(e,f),sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,flexShrink:0,borderRadius:.75,bgcolor:u?a?dn(u.dot,i.chip.darkBgAlpha):u.bg:a?i.card.bg:i.colors.surfaceHover,color:u?a?i.chip.darkTextSource==="fg"?u.fg:u.dot:u.fg:i.colors.textPrimary,fontSize:ys,fontWeight:a||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:t?.5:p?.35:e.completed?.6:1,border:t?`1px dashed ${i.colors.accent}`:"1px solid transparent",pointerEvents:t?"none":"auto",cursor:"pointer",touchAction:"none",overflow:"hidden","&:hover":{filter:"brightness(0.96)"}},children:[Oe(Ge,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:Ss[e.priority]}}),s?Oe(s,{sx:{fontSize:14,flexShrink:0,opacity:.75}}):null,Ao(Ge,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:a?i.colors.textStrong:i.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})]})})}function qg({dayKey:e,dayNumber:o,isToday:t,isOtherMonth:n,weekday:r,holidayName:i,tasks:a,googleEvents:l,statusOptions:m,previewSeq:c,onOpenDetail:p,onTaskContextMenu:d,onAddSchedule:s,canAdd:u}){let f=ie(),y=f.mode==="dark",{setNodeRef:b,isOver:h}=ks({id:`${Lr}${e}`}),g=a,B=!!i||r===0;return Ao(Ge,{ref:b,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:h?f.colors.accentSoft:t?f.calendar.todayBg:n?f.calendar.otherMonthBg:f.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...u?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[Ao(Ge,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:Ts,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:t?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:`1px solid ${f.calendar.borderColor}`},children:[i?Oe(Ge,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}):null,t?Oe(Ge,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Oe(Ge,{component:"span",sx:{fontSize:13.5,fontWeight:t?700:400,color:n?f.colors.textMuted:B?f.colors.danger:r===6?f.colors.accentOnSurface:y?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:o})]}),l.map(x=>Oe(Tn,{event:x,small:!0},x.uid)),g.map(x=>Oe(zg,{task:x,statusOptions:m,isPreview:x.seq===c,onOpenDetail:p,onContextMenu:d},x.seq)),Oe(Ge,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:Ao(hs,{className:"taskbox-month-add",onClick:()=>s(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[Oe(hg,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function Bs({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onMoveTask:r,onAddSchedule:i,canAdd:a=!0,onOpenDetail:l,onTaskContextMenu:m}){let c=ie(),p=c.mode==="dark",[d,s]=Ar(()=>Fr(new Date)),[u,f]=Ar(null),[y,b]=Ar(null),[h,g]=Ar(null),B=Xt(()=>{let L=Pg(d);return Array.from({length:42},(H,J)=>Rg(L,J))},[d]),x=Xt(()=>new Map(e.map(L=>[L.seq,L])),[e]),C=Xt(()=>kn(o),[o]),S=Xt(()=>[...new Set(B.map(L=>L.getFullYear()))],[B]),D=Rt(S),O=Xt(()=>{let L=new Map;for(let H of e){let J=H.due_date.slice(0,10);if(!J)continue;let W=L.get(J);W?W.push(H):L.set(J,[H])}for(let H of L.values())H.sort((J,W)=>{let M=J.sort_no>0,q=W.sort_no>0;return M&&q?J.sort_no-W.sort_no:M!==q?M?-1:1:J.completed!==W.completed?J.completed?1:-1:J.seq-W.seq});return L},[e]),$=Og(Dg(vg,{activationConstraint:{distance:5}})),E=Gn(L=>{let H=Ig(L),J=H.length>0?H:_g(L),W=J.filter(M=>String(M.id).startsWith(Nr));return W.length>0?W:J.filter(M=>String(M.id).startsWith(Lr))},[]),ae=Gn(L=>{b(Number(L.active.id))},[]),I=Gn(L=>{g(L.over?String(L.over.id):null)},[]),k=Xt(()=>{let L=new Map;for(let[H,J]of O)for(let W of J)L.set(W.seq,H);return L},[O]),K=y!==null?x.get(y)?.due_date.slice(0,10)??"":"",N=Xt(()=>{if(y===null||!h)return null;if(h.startsWith(Nr)){let L=Number(h.slice(Nr.length)),H=k.get(L);if(!H)return null;let J=(O.get(H)??[]).filter(M=>M.seq!==y),W=J.findIndex(M=>M.seq===L);return{day:H,index:W===-1?J.length:W}}if(h.startsWith(Lr)){let L=h.slice(Lr.length),H=(O.get(L)??[]).filter(J=>J.seq!==y);return{day:L,index:H.length}}return null},[y,k,h,O]),Z=Gn(L=>{let H=O.get(L)??[];if(y===null||!N)return H;let J=x.get(y);if(!J)return H;let W=H.filter(M=>M.seq!==y);return L===N.day?[...W.slice(0,N.index),J,...W.slice(N.index)]:L===K?W:H},[y,K,N,x,O]),P=Gn(L=>{let H=y,J=N;if(b(null),g(null),H===null||!J)return;let W=(O.get(J.day)??[]).filter(q=>q.seq!==H),M=[...W.slice(0,J.index).map(q=>q.seq),H,...W.slice(J.index).map(q=>q.seq)];r(H,J.day,M)},[y,N,r,O]),oe=y!==null?x.get(y)??null:null,le=`${d.getFullYear()}\uB144 ${d.getMonth()+1}\uC6D4`;return Ao(Ge,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${c.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[Ao(Ge,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0},children:[Ao(Ge,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Oe(gs,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>s(bs(d,-1)),children:Oe(kg,{sx:{fontSize:20,color:c.colors.textSecondary}})}),Oe(gg,{size:"small",color:"inherit",onClick:()=>s(Fr(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:c.mode==="dark"?400:500,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),Oe(gs,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>s(bs(d,1)),children:Oe(Tg,{sx:{fontSize:20,color:c.colors.textSecondary}})})]}),Ao(hs,{onClick:L=>f(L.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,"&:hover":{bgcolor:c.colors.surfaceHover}},children:[le,Oe(yg,{sx:{fontSize:18,color:c.colors.textMuted}})]})]}),Oe(Ge,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Eg.map((L,H)=>Oe(Ge,{sx:{height:Ts,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:H===0?c.colors.danger:H===6?c.colors.accentOnSurface:c.colors.textSecondary},children:L},L))}),Oe(Ge,{sx:{flex:1,minHeight:0},children:Ao(Bg,{sensors:$,collisionDetection:E,onDragStart:ae,onDragOver:I,onDragEnd:P,onDragCancel:()=>{b(null),g(null)},children:[Oe(Mg,{style:{height:"100%"},thumb:{width:8},children:Oe(Ge,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`,borderBottom:`1px solid ${c.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:B.map(L=>{let H=qe(L);return Oe(qg,{dayKey:H,dayNumber:L.getDate(),isToday:H===n,isOtherMonth:L.getMonth()!==d.getMonth(),weekday:L.getDay(),holidayName:D.get(H)??"",tasks:Z(H),googleEvents:C.get(H)??[],statusOptions:t,previewSeq:N?.day===H?y:null,onOpenDetail:l,onTaskContextMenu:m,onAddSchedule:i,canAdd:a},H)})})}),Oe(Cg,{children:oe?Ao(Ge,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:c.calendar.cellBg,border:`1px solid ${c.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:ys,fontWeight:500,color:c.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[Oe(Ge,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:Ss[oe.priority]}}),oe.title]}):null})]})}),Oe(Sg,{anchorEl:u,open:!!u,onClose:()=>f(null),selectedDate:d,onDateChange:L=>{s(Fr(L)),f(null)}})]})}import{useEffect as Ag,useMemo as Yn,useRef as Lg,useState as Cs}from"react";import{Box as oo,Button as Ng,IconButton as vs}from"@mui/material";import Fg from"@mui/icons-material/ChevronLeft";import Hg from"@mui/icons-material/ChevronRight";import Wg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as $g}from"@ehfuse/mui-datetime-picker";import{jsx as Je,jsxs as Lo}from"react/jsx-runtime";var Kg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ug={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"};function la(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Is(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function _s({task:e,statusOptions:o,onOpenDetail:t}){let n=ie(),[r]=wt(e,o),i=Me(e.icon||(e.is_notice?Ro:we));return Lo(oo,{onClick:a=>{a.stopPropagation(),t(e)},sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:1,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:r?.bg??n.colors.surfaceHover,color:r?.fg??n.colors.textPrimary,fontSize:15,fontWeight:e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:e.completed?.6:1,cursor:"pointer",overflow:"hidden"},children:[Je(oo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:Ug[e.priority]??n.colors.accentOnSurface}}),i?Je(i,{sx:{fontSize:16,flexShrink:0,opacity:.75}}):null,Lo(oo,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:n.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})]})}function ws({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onOpenDetail:r,onAddSchedule:i,showNoDueGroup:a=!1}){let l=ie(),[m,c]=Cs(()=>la(new Date)),[p,d]=Cs(!1),s=Yn(()=>{let x=new Date(m.getFullYear(),m.getMonth()+1,0).getDate();return Array.from({length:x},(C,S)=>{let D=new Date(m.getFullYear(),m.getMonth(),S+1);return{ymd:Is(D),dayNumber:S+1,weekday:D.getDay()}})},[m]),u=Yn(()=>{let x=new Map;for(let C of e){let S=C.due_date.slice(0,10);if(!S)continue;let D=x.get(S);D?D.push(C):x.set(S,[C])}for(let C of x.values())C.sort((S,D)=>S.completed!==D.completed?S.completed?1:-1:S.seq-D.seq);return x},[e]),f=Yn(()=>a?e.filter(x=>!x.due_date.slice(0,10)).sort((x,C)=>x.completed!==C.completed?x.completed?1:-1:x.seq-C.seq):[],[e,a]),y=Yn(()=>kn(o),[o]),b=Yn(()=>[m.getFullYear()],[m]),h=Rt(b),g=Lg(null),B=n.slice(0,7)===Is(m).slice(0,7);return Ag(()=>{if(!B)return;let x=O=>{let $=O?.parentElement??null;for(;$;){let E=window.getComputedStyle($);if(/(auto|scroll)/.test(E.overflowY)&&$.scrollHeight>$.clientHeight)return $;$=$.parentElement}return null},C=()=>{let O=g.current,$=x(O);if(!$||!O)return;let E=O.getBoundingClientRect().top-$.getBoundingClientRect().top+$.scrollTop;$.scrollTop=Math.max(0,E-$.clientHeight/2+O.clientHeight/2)},S=setTimeout(C,100),D=setTimeout(C,400);return()=>{clearTimeout(S),clearTimeout(D)}},[B,m]),Lo(oo,{sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:l.colors.surface},children:[Lo(oo,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[Je(vs,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>c(x=>new Date(x.getFullYear(),x.getMonth()-1,1)),children:Je(Fg,{sx:{fontSize:20,color:l.colors.textSecondary}})}),Je(Ng,{size:"small",color:"inherit",onClick:()=>c(la(new Date)),sx:{minWidth:0,px:1,fontSize:13.5,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary},children:"\uC624\uB298"}),Je(vs,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>c(x=>new Date(x.getFullYear(),x.getMonth()+1,1)),children:Je(Hg,{sx:{fontSize:20,color:l.colors.textSecondary}})}),Lo(oo,{onClick:()=>d(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:l.mode==="dark"?400:700,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary,cursor:"pointer"},children:[m.getFullYear(),"\uB144 ",m.getMonth()+1,"\uC6D4",Je(Wg,{sx:{fontSize:20,color:l.colors.textMuted}})]})]}),Lo(oo,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${l.calendar.borderColor}`},children:[f.length>0?Lo(oo,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`},children:[Lo(oo,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:l.colors.textSecondary,textAlign:"center"},children:["\uB9C8\uAC10",Je("br",{}),"\uC5C6\uC74C"]}),Je(oo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:f.map(x=>Je(_s,{task:x,statusOptions:t,onOpenDetail:r},x.seq))})]}):null,s.map(({ymd:x,dayNumber:C,weekday:S})=>{let D=h.get(x)??"",O=x===n,$=!!D||S===0,E=u.get(x)??[],ae=y.get(x)??[],I=E.length>0||ae.length>0;return Lo(oo,{ref:O?g:void 0,onClick:i?()=>i(x):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:I?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`,...i?{cursor:"pointer"}:{}},children:[Je(oo,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:Lo(oo,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Je(oo,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:26,height:26,borderRadius:"50%",fontSize:15.5,fontWeight:O?700:500,color:O?l.colors.surface:$?l.colors.danger:S===6?l.colors.accentOnSurface:l.colors.textPrimary,bgcolor:O?l.colors.accentOnSurface:"transparent"},children:C}),Je(oo,{component:"span",sx:{fontSize:12.5,color:$?l.colors.danger:S===6?l.colors.accentOnSurface:l.colors.textSecondary},children:Kg[S]})]})}),Lo(oo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[ae.map(k=>Je(Tn,{event:k},k.uid)),E.map(k=>Je(_s,{task:k,statusOptions:t,onOpenDetail:r},k.seq))]})]},x)})]}),Je($g,{open:p,centered:!0,monthOnly:!0,onClose:()=>d(!1),selectedDate:m,onDateChange:x=>{c(la(x)),d(!1)}})]})}import{useCallback as Ds,useEffect as Os,useMemo as sa,useRef as Wr,useState as $r}from"react";import{Box as Le,Tooltip as Ps}from"@mui/material";import Vg from"@ehfuse/overlay-scrollbar";import Gg from"@mui/icons-material/CheckCircle";import Yg from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as jg,PointerSensor as Xg,closestCenter as Qg,useSensor as Jg,useSensors as Zg}from"@dnd-kit/core";import{SortableContext as eb,arrayMove as ob,useSortable as tb,verticalListSortingStrategy as nb}from"@dnd-kit/sortable";import rb from"@mui/icons-material/DragIndicator";import{jsx as Re,jsxs as qt}from"react/jsx-runtime";var ca=36,ib=48,Ms=40,ab=24,lb=4,sb=14,Es=36,cb=12.5,yn=220,mb={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function Qt(e){let o=String(e??"").trim();if(!o)return null;let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?null:t}function Hr(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function ma(e,o){return Math.round((o.getTime()-e.getTime())/864e5)}function ub({task:e,dragHandle:o,onPointerDown:t,onClick:n}){let r=ie(),i=Wr(null),[a,l]=$r("");return Re(Ps,{title:a,arrow:!0,enterDelay:300,children:qt(Le,{onPointerDown:t,onClick:m=>n(e,m),onMouseEnter:()=>{let m=i.current;l(m&&m.scrollWidth>m.clientWidth?e.title:"")},sx:{width:yn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:r.mode==="dark"||e.completed?400:500,color:e.completed?r.colors.textMuted:r.mode==="dark"?r.colors.textStrong:r.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:r.colors.surfaceHover}},children:[o,Re(Le,{ref:i,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function db({id:e,showIndicator:o,children:t}){let n=ie(),{attributes:r,listeners:i,setNodeRef:a}=tb({id:e});return qt(Le,{ref:a,sx:{position:"relative"},children:[o?Re(Le,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:n.colors.accentOnSurface,zIndex:5}}):null,t({...r,...i})]})}function Rs({tasks:e,todayStr:o,onOpenDetail:t,onToggleChecklist:n,onReorderTasks:r,onTaskContextMenu:i}){let a=ie(),l=sa(()=>[...e].sort((k,K)=>{let N=(k.timeline_sort_no??0)>0,Z=(K.timeline_sort_no??0)>0;if(N&&Z)return(k.timeline_sort_no??0)-(K.timeline_sort_no??0);if(N!==Z)return N?-1:1;let P=k.due_date||k.start_date,oe=K.due_date||K.start_date;return P!==oe?P<oe?-1:1:k.seq-K.seq}),[e]),[m,c]=$r(null),[p,d]=$r(null),s=Zg(Jg(Xg,{activationConstraint:{distance:4}})),u=Ds(k=>{c(k.over?Number(k.over.id):null)},[]),f=Ds(k=>{c(null),d(null);let{active:K,over:N}=k;if(!N||K.id===N.id)return;let Z=l.map(le=>le.seq),P=Z.indexOf(Number(K.id)),oe=Z.indexOf(Number(N.id));P===-1||oe===-1||r(ob(Z,P,oe))},[l,r]),y=sa(()=>{let k=Qt(o)??new Date,K=k,N=Hr(k,21);for(let oe of l){let le=Qt(oe.start_date)??Qt(oe.due_date),L=Qt(oe.due_date)??le;le&&le<K&&(K=le),L&&L>N&&(N=L)}let Z=Hr(K,-3),P=ma(Z,Hr(N,3))+1;return Array.from({length:P},(oe,le)=>Hr(Z,le))},[l,o]),b=y[0],h=y.findIndex(k=>qe(k)===o),{dayWidths:g,dayOffsets:B,gridWidth:x}=sa(()=>{let k=y.map((Z,P)=>Z.getDate()===1||P===0?ib:ca),K=[],N=0;for(let Z of k)K.push(N),N+=Z;return{dayWidths:k,dayOffsets:K,gridWidth:N}},[y]),C=yn+x,S=Wr(null),D=k=>{S.current={x:k.clientX,y:k.clientY}},O=(k,K)=>{let N=S.current;S.current=null,!(N&&(Math.abs(K.clientX-N.x)>5||Math.abs(K.clientY-N.y)>5))&&t(k)},$=Wr(null),[E,ae]=$r(!1);Os(()=>{let k=$.current?.getScrollContainer();if(!k)return;let K=()=>ae(k.scrollHeight>k.clientHeight);K();let N=new ResizeObserver(K);return N.observe(k),()=>N.disconnect()},[l.length]);let I=Wr(!1);return Os(()=>{if(l.length===0||I.current)return;I.current=!0;let k=window.requestAnimationFrame(()=>{let K=$.current?.getScrollContainer();!K||h<0||(K.scrollLeft=Math.max(0,B[h]-ca*3))});return()=>window.cancelAnimationFrame(k)},[l.length]),Re(Le,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${a.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:a.timeline.headerBg},children:Re(Le,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:Re(Vg,{ref:$,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:qt(Le,{sx:{width:C,position:"relative",bgcolor:a.timeline.bg},children:[qt(Le,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:a.timeline.headerBg,borderBottom:`1px solid ${a.timeline.gridColor}`},children:[Re(Le,{sx:{width:yn,height:Es,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:a.timeline.headerBg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:a.colors.textSecondary},children:"\uC81C\uBAA9"}),y.map((k,K)=>{let N=k.getDay(),Z=K===h,P=k.getDate()===1||K===0;return Re(Le,{sx:{width:g[K],height:Es,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:cb,fontWeight:Z&&a.mode!=="dark"?700:400,color:Z?a.timeline.bg:N===0?a.colors.danger:N===6?a.colors.accentOnSurface:a.colors.textSecondary,bgcolor:Z?a.colors.danger:"transparent",borderRight:`1px solid ${a.timeline.gridColor}`,whiteSpace:"nowrap"},children:P?`${k.getMonth()+1}/${k.getDate()}`:k.getDate()},qe(k))})]}),Re(jg,{sensors:s,collisionDetection:Qg,onDragStart:k=>d(Number(k.active.id)),onDragOver:u,onDragEnd:f,onDragCancel:()=>{c(null),d(null)},children:Re(eb,{items:l.map(k=>String(k.seq)),strategy:nb,children:qt(Le,{sx:{position:"relative"},children:[y.map((k,K)=>{let N=k.getDay(),Z=K===h;return!Z&&N!==0&&N!==6?null:Re(Le,{sx:{position:"absolute",top:0,bottom:0,left:yn+B[K],width:g[K],bgcolor:Z?"rgba(229,72,77,0.07)":a.colors.surfaceSubtle,zIndex:0}},`stripe-${qe(k)}`)}),l.map((k,K)=>{let N=Qt(k.start_date)??Qt(k.due_date),Z=Qt(k.due_date)??N,P=N?Math.min(y.length-1,Math.max(0,ma(b,N))):0,oe=Z?Math.min(y.length-1,Math.max(P,ma(b,Z))):P,le=mb[k.priority],L=yn+B[P]+2,H=B[oe]+g[oe]-B[P]-4,J=k.checklist??[];return Re(db,{id:String(k.seq),showIndicator:m===k.seq&&p!==k.seq,children:W=>qt(Le,{sx:{borderBottom:K===l.length-1&&E?"none":`1px solid ${a.timeline.gridColor}`,position:"relative",zIndex:1,opacity:p===k.seq?.45:1},children:[qt(Le,{onContextMenu:M=>i(k,M),sx:{display:"flex",height:Ms,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[Re(ub,{task:k,dragHandle:Re(Le,{component:"span",className:"taskbox-timeline-handle",...W,onClick:M=>M.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:a.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:a.colors.accentOnSurface}},children:(()=>{let M=Me(k.icon||we)??rb;return Re(M,{sx:{fontSize:17}})})()}),onPointerDown:D,onClick:O}),Re(Ps,{title:`${k.title} (${k.start_date||"?"} ~ ${k.due_date||"?"})`,arrow:!0,enterDelay:300,children:Re(Le,{onPointerDown:D,onClick:M=>O(k,M),sx:{position:"absolute",top:(Ms-20)/2,left:L,width:Math.max(ca-4,H),height:20,borderRadius:1,bgcolor:le.bg,border:`1px solid ${le.border}`,opacity:k.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),J.map((M,q)=>Re(Le,{sx:{display:"flex",height:ab,position:"relative",mt:q===0?`${lb}px`:0,mb:q===J.length-1?`${sb}px`:0},children:Re(Le,{sx:{width:yn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:a.timeline.bg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:M.checked?a.colors.textMuted:a.colors.textPrimary},children:qt(Le,{onClick:()=>n(k.seq,q,!M.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[M.checked?Re(Gg,{sx:{fontSize:17,color:a.colors.accentOnSurface,flexShrink:0}}):Re(Yg,{sx:{fontSize:17,color:a.colors.textMuted,flexShrink:0}}),Re(Le,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:M.checked?"line-through":"none"},children:M.label})]})})},`${k.seq}-check-${q}`))]})},k.seq)}),l.length===0?Re(Le,{sx:{py:8,textAlign:"center",color:a.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as Jt}from"react/jsx-runtime";function Yw(e){switch(e.view){case"card":case"kanban":{let{view:o,...t}=e;return Jt(ta,{...t,columnAxis:o==="kanban"?"status":"project"})}case"sprint":{let{view:o,...t}=e;return Jt(ta,{...t,columnAxis:"sprint"})}case"calendar":{let{view:o,...t}=e;return Jt(xs,{...t})}case"month":{let{view:o,...t}=e;return Jt(Bs,{...t})}case"agenda":{let{view:o,...t}=e;return Jt(ws,{...t})}case"timeline":{let{view:o,...t}=e;return Jt(Rs,{...t})}default:{let{view:o,...t}=e;return Jt(jl,{...t})}}}var jw=["list","card","kanban","calendar","month","timeline"];import{Box as bo}from"@mui/material";function pb(e){let o=String(e??"").trim();if(!o)return 0;let t=0,n=!1;for(let r of o.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let i=parseFloat(r[1]),a=r[2].toLowerCase();n=!0,a==="m"||a==="\uBD84"?t+=i/60:a==="d"||a==="\uC77C"?t+=i*8:t+=i}if(!n){let r=parseFloat(o);Number.isFinite(r)&&(t+=r)}return t}function zs(e){let o=Math.round(e*10)/10;return`${o%1===0?o.toFixed(0):o.toFixed(1)}\uC2DC\uAC04`}function qs(e,o,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return 0;let n=new Date(`${e}T00:00:00`),r=new Date(`${o}T00:00:00`);if(r<n||r.getTime()-n.getTime()>3660*864e5)return 0;let i=0;for(let a=new Date(n);a<=r;a.setDate(a.getDate()+1)){let l=a.getDay();if(l===0||l===6)continue;let m=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;t.has(m)||(i+=1)}return i}function As(e){return e.reduce((o,t)=>t.completed?o:o+pb(t.estimated_time),0)}import{Fragment as fb,jsx as At,jsxs as No}from"react/jsx-runtime";function Ls(e,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return null;let t=new Date(`${e}T00:00:00`),n=new Date(`${o}T00:00:00`);return Math.round((t.getTime()-n.getTime())/864e5)}function Ns({tasks:e,todayStr:o,showProgress:t=!0,dday:n=null,workdaysLeft:r=null,showPoints:i=!0,showHours:a=!0,showOverdue:l=!0,showInfo:m=!0,inline:c=!1}){let p=ie(),d=e.filter(O=>!O.archived),s=d.filter(O=>O.completed).length,u=d.length>0?Math.round(s/d.length*100):0,f=d.filter(O=>!O.completed&&!O.is_event&&!!O.due_date&&O.due_date.slice(0,10)<o).length,y=d.reduce((O,$)=>$.completed?O:O+($.story_points??0),0),b=As(d),h=t?At(bo,{sx:{flex:c?"0 0 110px":"1 1 auto",minWidth:0,height:p.summary.gaugeHeight,borderRadius:3,bgcolor:p.summary.gaugeTrackColor},children:At(bo,{sx:{height:"100%",borderRadius:3,width:`${u}%`,bgcolor:u>=100?p.summary.gaugeCompleteColor:p.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,g=t?No(bo,{component:"span",sx:{flexShrink:0,fontSize:c?14:13,color:p.summary.textColor},children:[u,"%"]}):null,B={color:p.summary.numberColor,fontWeight:700,fontSize:c?15:14},x=d.length-s,C=No(fb,{children:[c?null:No("span",{children:["\uB0A8\uC740 ",At(bo,{component:"span",sx:B,children:x}),"\uAC74"]}),l&&f>0?No(bo,{component:"span",sx:{color:p.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",At(bo,{component:"span",sx:{fontWeight:700,fontSize:c?15:14},children:f}),"\uAC74"]}):null,i&&y>0?No("span",{children:[At(bo,{component:"span",sx:B,children:y}),"SP"]}):null,a&&b>0?No("span",{children:["\uC57D ",At(bo,{component:"span",sx:B,children:zs(b).replace("\uC2DC\uAC04","")}),"\uC2DC\uAC04"]}):null]}),S=typeof r=="number"&&Number.isFinite(r)?No("span",{children:["\uADFC\uBB34\uC77C ",At(bo,{component:"span",sx:B,children:r}),"\uC77C"]}):null,D=typeof n=="number"&&Number.isFinite(n)?At(bo,{component:"span",sx:{ml:c?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:p.summary.overdueColor,color:p.colors.textInverse,lineHeight:1.6},children:n===0?"D-day":n>0?`D-${n}`:`D+${-n}`}):null;return c?No(bo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:p.summary.textColor,whiteSpace:"nowrap",...p.summary.sx},children:[m?C:null,m?S:null,m?D:null,h,g]}):No(bo,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[t?No(bo,{sx:{display:"flex",alignItems:"center",gap:1},children:[h,g]}):null,No(bo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:p.summary.textColor},children:[C,S,D]})]})}import{useMemo as xb}from"react";import{jsx as gb}from"react/jsx-runtime";function sD({sprint:e,tasks:o,todayStr:t,...n}){let r=e.status==="closed"?null:Ls(e.end_date,t),i=r!==null&&r>=0,a=xb(()=>{if(!i)return[];let c=Number(t.slice(0,4)),p=Number(e.end_date.slice(0,4))||c,d=[];for(let s=c;s<=Math.max(c,p);s+=1)d.push(s);return d},[i,t,e.end_date]),l=Rt(a),m=i?qs(t,e.end_date,new Set(l.keys())):null;return gb(Ns,{tasks:o,todayStr:t,dday:r,workdaysLeft:m,...n})}import{useEffect as Ib,useRef as _b,useState as wb}from"react";import{Box as da}from"@mui/material";import{Children as bb}from"react";import{Box as ua,CircularProgress as hb}from"@mui/material";import{jsx as Kr}from"react/jsx-runtime";var Fs={xs:2,md:3};function Hs(){return Kr(ua,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:Kr(hb,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function Ws({children:e}){return Kr(ua,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:Fs,pb:Fs},children:bb.map(e,o=>o==null||o===!1?null:Kr(ua,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:o}))})}import{Box as gt,Button as Sb,Checkbox as Bb,Typography as Lt}from"@mui/material";import Ks from"@mui/icons-material/CheckCircle";import Cb from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as yb,jsx as $s}from"react/jsx-runtime";var kb="taskbox-search-highlight";function Tb(e,o){let t=o?.keyPrefix??"hl";return e.map((n,r)=>$s("span",{className:n.highlight?o?.highlightClassName??kb:o?.className,style:n.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:n.text},`${t}-${n.text}-${r}`))}function Ur({text:e,keyword:o,fallback:t="-",className:n,highlightClassName:r,keyPrefix:i}){let a=String(e??"").trim()||t,l=Br(a,o);return $s(yb,{children:Tb(l,{className:n,highlightClassName:r,keyPrefix:i})})}import{jsx as fe,jsxs as Sn}from"react/jsx-runtime";var vb={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:po(12.5),fontWeight:500,lineHeight:1.4},xt={fontSize:po(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function Qo({label:e,children:o}){return Sn(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[fe(gt,{sx:vb,children:e}),fe(gt,{sx:{...xt,flex:1,pt:.2},children:o})]})}function Us({task:e,statusOptions:o,projectLabel:t,searchText:n,todayStr:r,onRequestToggleCompleted:i,onOpenDetail:a,onTaskContextMenu:l,targetSummary:m="",ackInfo:c,completeLocked:p=!1,unread:d=!1,noticeReadOnly:s=!1,onAckConfirm:u,onAckListClick:f,myManaged:y=!1}){let b=e.is_event?Hn(e):fo(e),h=Yo(e.start_date),g=Yo(e.due_date),B=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<r,x=(e.receiver_names??[]).filter(Boolean);return Sn(gt,{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(e))},onContextMenu:C=>l(e,C),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",position:"relative"},children:[y?fe(gt,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,Sn(gt,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[!s&&!p?fe(Bb,{checked:e.completed,icon:fe(Cb,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:fe(Ks,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:C=>C.stopPropagation(),onChange:(C,S)=>i({anchorEl:C.currentTarget,taskSeq:e.seq,nextCompleted:S}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{let C=Me(e.icon||(e.is_notice?Ro:we));if(!C)return null;let S=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return fe(C,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:S}})})(),fe(Lt,{sx:{fontSize:po(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":"#111827",textDecoration:e.completed?"line-through":"none"},children:fe(Ur,{text:e.title,keyword:n})}),d?fe(gt,{component:"span",sx:{flexShrink:0,px:.55,fontSize:po(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),Sn(gt,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[fe(Qo,{label:b?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:Sn(gt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:[b?fe(De,{option:b,small:!0}):null,fe(zo,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?fe(Qo,{label:"\uB77C\uBCA8",children:fe(Dt,{labelKeys:e.label_keys,labelOptions:o})}):null,t?fe(Qo,{label:"\uD504\uB85C\uC81D\uD2B8",children:fe(Lt,{sx:xt,children:t})}):null,h?fe(Qo,{label:"\uC2DC\uC791",children:fe(Lt,{sx:xt,children:h})}):null,g?fe(Qo,{label:"\uB9C8\uAC10",children:Sn(Lt,{sx:{...xt,color:B?"#e5484d":xt.color,fontWeight:B?600:400},children:[g,B?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?fe(Qo,{label:"\uB300\uC0C1\uC790",children:fe(Lt,{sx:xt,children:m||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&c?fe(Qo,{label:"\uD655\uC778",children:fe(Sb,{size:"small",variant:c.canAck?"contained":"outlined",color:"inherit",startIcon:c.acked?fe(Ks,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:C=>{C.stopPropagation(),c.canAck?u?.(e):f?.(e,C.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:po(13),...c.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:c.canAck?"\uD655\uC778":`${c.count}/${c.total}`})}):null,!e.is_notice&&e.manager_name?fe(Qo,{label:"\uCC45\uC784\uC790",children:fe(Lt,{sx:xt,children:fe(Ur,{text:e.manager_name,keyword:n})})}):null,!e.is_notice&&x.length>0?fe(Qo,{label:"\uCC38\uC870\uC790",children:fe(Lt,{sx:xt,children:x.join(", ")})}):null,e.note?fe(Qo,{label:"\uBE44\uACE0",children:fe(Lt,{sx:xt,children:fe(Ur,{text:e.note,keyword:n})})}):null]})]})}import{jsx as Bn,jsxs as Db}from"react/jsx-runtime";function zD({tasks:e,statusOptions:o,customTabs:t,loading:n,searchText:r,todayStr:i,onToggleCompleted:a,onOpenDetail:l,onTaskContextMenu:m,getTargetSummary:c,getAckInfo:p,getNoticeReadOnly:d,isTaskUnread:s,getCompleteLocked:u,onAckConfirm:f,onAckListClick:y,onEndReached:b,myAccountSeq:h=0}){let g=new Map(t.map(S=>[S.key,S.label])),[B,x]=wb(null),C=_b(null);return Ib(()=>{let S=C.current;if(!b||!S)return;let D=new IntersectionObserver(O=>{O[0]?.isIntersecting&&b()});return D.observe(S),()=>D.disconnect()},[b,e.length]),e.length===0?n?Bn(Hs,{}):Bn(da,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Db(da,{sx:{minWidth:0},children:[Bn(Ws,{children:e.map(S=>Bn(Us,{myManaged:h>0&&!S.is_notice&&!S.is_event&&(S.manager_account_seq??0)===h,task:S,statusOptions:o,projectLabel:S.tab_key?g.get(S.tab_key)??"":"",searchText:r,todayStr:i,onRequestToggleCompleted:x,onOpenDetail:l,onTaskContextMenu:m,targetSummary:S.is_notice?c?.(S):void 0,ackInfo:S.is_notice?p?.(S):void 0,noticeReadOnly:S.is_notice?d?.(S):!1,unread:s?.(S)??!1,completeLocked:u?.(S)??!1,onAckConfirm:f,onAckListClick:y},S.seq))}),b?Bn(da,{ref:C,sx:{height:"1px"}}):null,Bn(Ue,{open:!!B,anchorEl:B?.anchorEl??null,title:B?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:B?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>x(null),onConfirm:()=>{B&&a(B.taskSeq,B.nextCompleted),x(null)}})]})}import{useEffect as Tk,useRef as yk,useState as Sc}from"react";import{Box as or,Button as Bc,Divider as Sk,Drawer as Bk,IconButton as Ia,Tooltip as Ck}from"@mui/material";import vk from"@mui/icons-material/Close";import Ik from"@mui/icons-material/ArrowBack";import _k from"@ehfuse/overlay-scrollbar";import{Box as pa,ButtonBase as Ob,Divider as Mb,Popover as Eb}from"@mui/material";import Pb from"@mui/icons-material/Check";import Rb from"@ehfuse/overlay-scrollbar";import{jsx as Zt,jsxs as Gs}from"react/jsx-runtime";var Vs=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function Vr({anchorEl:e,value:o,color:t="",onSelect:n,onSelectColor:r,onClose:i}){return Zt(Eb,{transitionDuration:0,open:!!e,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:Gs(pa,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[Zt(Rb,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:Zt(wr,{value:o||we,onChange:a=>{n(a),i()}})}),r?Gs(pa,{sx:{px:1.25,pb:1.25},children:[Zt(Mb,{sx:{mb:1,borderColor:"#efefed"}}),Zt(pa,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:Vs.map(a=>{let l=(t||Vs[0])===a;return Zt(Ob,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${a}`,onClick:()=>r(a),sx:{width:26,height:26,borderRadius:"50%",bgcolor:a,display:"flex",alignItems:"center",justifyContent:"center"},children:l?Zt(Pb,{sx:{fontSize:15,color:"#ffffff"}}):null},a)})})]}):null]})})}import{useState as kc}from"react";import{Box as Jn,ButtonBase as mk,Divider as Zn,Menu as uk,MenuItem as dk}from"@mui/material";import pk from"@mui/icons-material/SubjectOutlined";import fk from"@mui/icons-material/StickyNote2Outlined";import xk from"@mui/icons-material/LabelOutlined";import gk from"@mui/icons-material/DirectionsRunOutlined";import bk from"@mui/icons-material/SpeedOutlined";import{TextField as hk}from"@ehfuse/mui-form-controls";import{InfoAlert as kk}from"@ehfuse/alerts";import{useState as Nt}from"react";import{Box as tc,Divider as Zb,ListItemIcon as eh,Menu as ga,MenuItem as jn}from"@mui/material";import oh from"@mui/icons-material/Add";import Yr from"@mui/icons-material/Check";import th from"@mui/icons-material/ViewKanbanOutlined";import nh from"@mui/icons-material/CalendarTodayOutlined";import rh from"@mui/icons-material/EventOutlined";import ih from"@mui/icons-material/PersonOutlineOutlined";import Js from"@mui/icons-material/PeopleAltOutlined";import ah from"@mui/icons-material/FlagOutlined";import Zs from"@mui/icons-material/TimerOutlined";import lh from"@mui/icons-material/NotificationsNoneOutlined";import sh from"@mui/icons-material/InboxOutlined";import ch from"@mui/icons-material/PlaceOutlined";import mh from"@mui/icons-material/MapOutlined";import{DatePicker as uh,TimePicker as ec}from"@ehfuse/mui-datetime-picker";var Jo="@media (max-width: 719.95px)";function co(e){return{[Jo]:{order:e}}}import{useEffect as zb,useState as qb}from"react";import{Box as Ab}from"@mui/material";import{jsx as Lb}from"react/jsx-runtime";function bt({value:e,placeholder:o,readOnly:t,onCommit:n}){let r=ie(),[i,a]=qb(e);return zb(()=>a(e),[e]),Lb(Ab,{component:"input",spellCheck:!1,value:i,readOnly:t,placeholder:o,onChange:l=>a(l.target.value),onBlur:()=>{i.trim()!==e&&n(i.trim())},onKeyDown:l=>{l.key==="Enter"&&l.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:r.colors.textPrimary,caretColor:r.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as fa}from"@mui/material";import{jsx as Nb,jsxs as Ys}from"react/jsx-runtime";function ue({icon:e,label:o,onClick:t,sx:n,children:r}){return Ys(fa,{sx:[{display:"flex",alignItems:"center",minHeight:26,[Jo]:{minHeight:25}},...Array.isArray(n)?n:[n]],children:[Ys(fa,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,o]}),Nb(fa,{onClick:t?i=>t(i.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:t?"pointer":"default","&:hover":t?{bgcolor:"#f2f2f0"}:void 0,[Jo]:{py:.25}},children:r})]})}import{Suspense as Fb,lazy as Hb,useEffect as Wb,useState as js}from"react";import{Box as xa,Dialog as $b,DialogContent as Kb,DialogTitle as Ub,IconButton as Xs,Tooltip as Vb}from"@mui/material";import Gb from"@mui/icons-material/Close";import Yb from"@mui/icons-material/Search";import{Fragment as Jb,jsx as Fo,jsxs as Gr}from"react/jsx-runtime";function jb(e){return Fo(xa,{sx:{p:3,fontSize:14,color:"#9a9a97"},children:"\uC8FC\uC18C \uAC80\uC0C9 \uBAA8\uB4C8(react-daum-postcode)\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC785\uB825\uD574 \uC8FC\uC138\uC694."})}var Xb=Hb(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:jb})));function Qb(e){if(e.addressType!=="R")return e.address;let o="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(o+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(o+=o!==""?`, ${e.buildingName}`:e.buildingName),o!==""?`${e.address} (${o})`:e.address}function Qs({value:e,placeholder:o="\uC8FC\uC18C \uC785\uB825",readOnly:t,onCommit:n}){let[r,i]=js(e),[a,l]=js(!1),m=Bo().slots?.addressSearch;Wb(()=>i(e),[e]);let c=d=>{i(d),l(!1),d!==e&&n(d)};return Gr(Jb,{children:[Gr(xa,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[Fo(xa,{component:"input",spellCheck:!1,value:r,readOnly:t,placeholder:o,onChange:d=>i(d.target.value),onBlur:()=>{a||r.trim()!==e&&n(r.trim())},onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),!t&&l(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),t?null:Fo(Vb,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:Fo(Xs,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>l(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:Fo(Yb,{sx:{fontSize:17}})})})]}),m?Fo(m,{open:a,onComplete:c,onClose:()=>l(!1)}):Gr($b,{open:a,onClose:()=>l(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[Gr(Ub,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",Fo(Xs,{onClick:()=>l(!1),size:"small",children:Fo(Gb,{})})]}),Fo(Kb,{style:{padding:0},dividers:!0,children:a?Fo(Fb,{fallback:null,children:Fo(Xb,{onComplete:d=>{c(Qb(d))},onClose:()=>l(!1),defaultQuery:r,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as jr,jsx as G,jsxs as Ho}from"react/jsx-runtime";function dh(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function oc(e){let[o="00",t="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(o)?o:"00",minute:/^\d{2}$/.test(t)?t:"00"}}function en({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return G(tc,{component:"span",sx:{color:"#9a9a97"},children:e})}function Xr({values:e,customTabs:o,avatarSrcByName:t,showEstimatedTime:n=!1,managerLocked:r=!1,notice:i=!1,event:a=!1,readOnly:l=!1,targetSummary:m="",narrowCollapsedSx:c,reminderLocked:p=!1,managerAction:d,hideProject:s=!1,leading:u,trailing:f,onChangeProject:y,onChangeStartDate:b,onChangeDueDate:h,onChangeReminder:g,onChangePriority:B,onChangeEstimatedTime:x,onChangeEventTime:C,onChangeEventPlace:S,onChangeEventAddress:D,onMemberEdit:O,onAddProject:$}){let[E,ae]=Nt(null),[I,k]=Nt(!1),[K,N]=Nt(null),[Z,P]=Nt(null),[oe,le]=Nt(null),[L,H]=Nt(null),[J,W]=Nt(null),[M,q]=Nt(null),U=He(),te=Go(),me=R=>[co(R),...c?Array.isArray(c)?c:[c]:[]],ne=o.find(R=>R.key===e.tabKey),_e=o.filter(R=>!R.archived);return Ho(jr,{children:[Ho(tc,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",columnGap:3,rowGap:.25,px:2,[Jo]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[u,s?null:G(ue,{icon:G(th,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:l?void 0:R=>ae(R),sx:me(1),children:ne?(()=>{let R=Me(ne.icon);return Ho(jr,{children:[R?G(R,{sx:{fontSize:16,color:"#1e3a8a"}}):null,ne.label]})})():"\uAE30\uBCF8"}),i?G(ue,{icon:G(Js,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:l?void 0:()=>O("targets"),sx:co(7),children:m||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!i&&!a?G(ue,{icon:G(ih,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:r||l||!e.managerName&&d?void 0:()=>O("manager"),sx:co(7),children:e.managerName?Ho(jr,{children:[G(xo,{names:[e.managerName],size:20,avatarSrcByName:t}),e.managerName]}):d??G(en,{})}):null,a?null:G(ue,{icon:G(nh,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC790",onClick:l?void 0:R=>le(R),sx:co(2),children:e.startDate?Yo(e.startDate):G(en,{})}),i?null:G(ue,{icon:G(Js,{sx:{fontSize:17}}),label:a?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:l?void 0:()=>O("receivers"),sx:co(a?7:8),children:e.receiverNames.length>0?Ho(jr,{children:[G(xo,{names:e.receiverNames,size:20,avatarSrcByName:t}),e.receiverNames.length===1?e.receiverNames[0]:null]}):G(en,{})}),G(ue,{icon:G(rh,{sx:{fontSize:17}}),label:a?"\uB0A0\uC9DC":"\uB9C8\uAC10\uAE30\uD55C",onClick:l?void 0:R=>H(R),sx:co(3),children:e.dueDate?Yo(e.dueDate):G(en,{})}),a?G(ue,{icon:G(Zs,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:l?void 0:R=>q(R),sx:co(4),children:e.eventTime?e.eventTime:G(en,{label:"\uC885\uC77C"})}):null,a?G(ue,{icon:G(ch,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:co(5),children:G(bt,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:l,onCommit:R=>S?.(R)})}):null,n?G(ue,{icon:G(Zs,{sx:{fontSize:17}}),label:"\uC608\uC0C1\uC2DC\uAC04",onClick:l?void 0:R=>W(R),sx:me(4),children:e.estimatedTime?e.estimatedTime:G(en,{})}):null,G(ue,{icon:G(lh,{sx:{fontSize:17}}),label:"\uB9AC\uB9C8\uC778\uB354",onClick:l||p?void 0:R=>P(R),sx:me(a?8:5),children:e.reminder==="none"?G(en,{label:"\uC5C6\uC74C"}):Vi(e.reminder)}),a?G(ue,{icon:G(mh,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},co(6)],children:G(Qs,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:l,onCommit:R=>D?.(R)})}):null,a?null:G(ue,{icon:G(ah,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:l?void 0:R=>N(R),sx:me(6),children:G(zo,{priority:e.priority,small:!0})}),f]}),Ho(ga,{transitionDuration:0,anchorEl:E,open:!!E,onClose:()=>ae(null),...te,children:[Ho(jn,{selected:!e.tabKey,onClick:()=>{y(""),ae(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[G(sh,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),_e.map(R=>{let Y=Me(R.icon),Te=e.tabKey===R.key;return Ho(jn,{selected:Te,onClick:()=>{y(R.key),ae(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Y?G(Y,{sx:{fontSize:17,color:"#1e3a8a"}}):null,R.label,Te?G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.key)}),$?[G(Zb,{},"add-project-divider"),Ho(jn,{onClick:()=>k(!0),sx:{fontSize:14,color:"#787774"},children:[G(eh,{children:G(oh,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),$?G(Dr,{open:I,onClose:()=>k(!1),onSubmit:(R,Y,Te)=>{(async()=>{let _=await $(R,Y,Te);_&&y(_)})(),ae(null)}}):null,G(ga,{transitionDuration:0,anchorEl:K,open:!!K,onClose:()=>N(null),...te,children:["high","medium","low"].map(R=>Ho(jn,{selected:e.priority===R,onClick:()=>{B(R),N(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[G(zo,{priority:R,small:!0}),e.priority===R?G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R))}),G(ga,{transitionDuration:0,anchorEl:Z,open:!!Z,onClose:()=>P(null),...te,children:Ui(a&&!!e.eventTime).map(R=>Ho(jn,{selected:e.reminder===R.value,onClick:()=>{g(R.value),P(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[R.label,e.reminder===R.value?G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.value))}),n?G(ec,{anchorEl:J,open:!!J,onClose:()=>W(null),value:oc(e.estimatedTime),format:"HH:mm",minuteStep:5,autoApply:!0,centered:U,locale:"ko",onChange:(R,Y)=>{x?.(`${R}:${Y}`),W(null)}}):null,a?G(ec,{anchorEl:M,open:!!M,onClose:()=>q(null),value:oc(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:U,locale:"ko",onChange:(R,Y)=>{C?.(`${R}:${Y}`),q(null)}}):null,G(uh,{anchorEl:oe,open:!!oe,onClose:()=>le(null),selectedDate:dh(e.startDate),centered:U,onDateChange:R=>{b(qe(R)),le(null)}}),G(Mt,{anchorEl:L,open:!!L,date:e.dueDate,reminder:e.reminder,hideReminder:p,centered:U,onClose:()=>H(null),onDateChange:h,onReminderChange:g})]})}import{useState as ph}from"react";import{Box as fh,Menu as xh,MenuItem as gh}from"@mui/material";import bh from"@mui/icons-material/RepeatOutlined";import hh from"@mui/icons-material/DevicesOutlined";import kh from"@mui/icons-material/ScreenSearchDesktopOutlined";import Th from"@mui/icons-material/SellOutlined";import yh from"@mui/icons-material/TaskAltOutlined";import{Fragment as nc,jsx as Ye,jsxs as rc}from"react/jsx-runtime";function ba({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Ye(fh,{component:"span",sx:{color:"#9a9a97"},children:e})}function Qr({values:e,readOnly:o=!1,showResolution:t=!1,onChangeRepro:n,onChangeDevice:r,onChangeWhere:i,onChangeVersion:a,onChangeResolution:l}){let[m,c]=ph(null),p=m?.field==="repro"?vi:m?.field==="device"?Ii:_i,d=s=>{m?.field==="repro"?n(s):m?.field==="device"?r(s):m?.field==="resolution"&&l?.(s),c(null)};return rc(nc,{children:[rc(nc,{children:[Ye(ue,{icon:Ye(bh,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:o?void 0:s=>c({field:"repro",el:s}),children:Tl(e.repro)||Ye(ba,{label:"\uC120\uD0DD"})}),Ye(ue,{icon:Ye(hh,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:o?void 0:s=>c({field:"device",el:s}),children:yl(e.device)||Ye(ba,{label:"\uC120\uD0DD"})}),Ye(ue,{icon:Ye(kh,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:Ye(bt,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:o,onCommit:i})}),Ye(ue,{icon:Ye(Th,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:Ye(bt,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:o,onCommit:a})}),t?Ye(ue,{icon:Ye(yh,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:o?void 0:s=>c({field:"resolution",el:s}),children:pr(e.resolution)||Ye(ba,{label:"\uC120\uD0DD"})}):null]}),Ye(xh,{open:!!m,anchorEl:m?.el??null,onClose:()=>c(null),transitionDuration:0,children:p.map(s=>Ye(gh,{onClick:()=>d(s.key),sx:{fontSize:14},children:s.name},s.key))})]})}import{Box as ic}from"@mui/material";import{jsxs as ac}from"react/jsx-runtime";function Oo({icon:e,title:o,titleExtra:t,children:n}){return ac(ic,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[ac(ic,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:14.5,fontWeight:500,color:"#37352f"},children:[e,o,t]}),n]})}import{useEffect as Sh,useRef as ha,useState as Bh}from"react";import{Box as ka,IconButton as Ch,Tooltip as vh}from"@mui/material";import Ih from"@mui/icons-material/ContentCopyOutlined";import _h from"@mui/icons-material/Check";import{EhfuseEditor as wh,minimalToolbarOptions as Dh}from"@ehfuse/editor";import{jsx as on,jsxs as Mh}from"react/jsx-runtime";function Ta(e){let o=e.trim();return o?o.startsWith("<")?e:`<p>${o}</p>`:"<p></p>"}function Oh(e){let o=e.replace(/<br\s*\/?>/gi,`
2
+ \uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>J(null),onConfirm:()=>{H&&B(H.column.key),J(null)}}),Q(Ue,{open:!!k,anchorEl:k?.anchorEl??null,title:k?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:k?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>K(null),onConfirm:()=>{k&&r(k.taskSeq,k.nextCompleted),K(null)}})]})}import{useCallback as zt,useMemo as Un,useRef as Gx,useState as Vn}from"react";import{Box as Ve,Button as Yx,ButtonBase as ps,IconButton as ds}from"@mui/material";import jx from"@mui/icons-material/Add";import Xx from"@mui/icons-material/ChevronLeft";import Qx from"@mui/icons-material/ChevronRight";import Jx from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Zx}from"@ehfuse/mui-datetime-picker";import{DndContext as eg,DragOverlay as og,PointerSensor as tg,pointerWithin as ng,rectIntersection as rg,useDroppable as ig,useSensor as ag,useSensors as lg}from"@dnd-kit/core";import{SortableContext as sg,arrayMove as cg,verticalListSortingStrategy as mg}from"@dnd-kit/sortable";import ug from"@ehfuse/overlay-scrollbar";import{useEffect as Wx,useState as $x}from"react";function Rt(e){let{loadHolidays:o}=Bo(),[t,n]=$x(()=>new Map),r=e.join(",");return Wx(()=>{if(!o||!r){n(new Map);return}let i=!1;return o(r.split(",").map(Number)).then(a=>{if(i)return;let l=new Map;for(let m of a)l.has(m.date)||l.set(m.date,m.name);n(l)}).catch(()=>{}),()=>{i=!0}},[o,r]),t}function Kx(e){let[o,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(o,t-1,n+1)),i=a=>String(a).padStart(2,"0");return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`}function kn(e){let o=new Map;for(let t of e){let n=t.start_date;for(let r=0;r<62&&n<=t.end_date;r+=1){let i=o.get(n);i?i.push(t):o.set(n,[t]),n=Kx(n)}}for(let t of o.values())t.sort((n,r)=>(n.time||"99:99").localeCompare(r.time||"99:99")||n.title.localeCompare(r.title));return o}import{Box as na,Tooltip as Ux}from"@mui/material";import{jsx as ra,jsxs as Vx}from"react/jsx-runtime";function Tn({event:e,small:o=!1}){let t=e.time?`${e.time} ${e.title}`:e.title,n=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",r=i=>{i.stopPropagation();let[a,l,m]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${a}/${l}/${m}`,"_blank")};return ra(Ux,{title:`(${n}) ${t}`,arrow:!0,enterDelay:300,children:Vx(na,{onClick:r,onPointerDown:i=>i.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:o?.6:.8,borderRadius:.75,bgcolor:"#f1f1ef",color:"#37352f",fontSize:15,fontWeight:500,overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,minWidth:0,maxWidth:"100%",cursor:"pointer","&:hover":{bgcolor:"#ececea"}},children:[ra(na,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),ra(na,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t})]})})}import{jsx as Ce,jsxs as ft}from"react/jsx-runtime";var fs=36,dg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],qr="day-";function ia(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function aa(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function pg(e){let o=e[0],t=e[e.length-1];return o.getMonth()===t.getMonth()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4`:o.getFullYear()===t.getFullYear()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getMonth()+1}\uC6D4`:`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getFullYear()}\uB144 ${t.getMonth()+1}\uC6D4`}function fg(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function xg({dayKey:e,isToday:o,dayLabel:t,holidayName:n,tasks:r,googleEvents:i,statusOptions:a,onRequestArchiveToggle:l,onRequestReply:m,onAddSchedule:c,canAdd:p,onCardClick:d,onCardContextMenu:s,summary:u}){let f=ie(),{setNodeRef:y}=ig({id:`${qr}${e}`});return ft(Ve,{ref:y,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:o?f.calendar.todayBg:f.calendar.cellBg},children:[ft(Ve,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:fs,bgcolor:o?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:r.length>0?`1px solid ${f.calendar.borderColor}`:"none",flexShrink:0},children:[n?Ce(Ve,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}):null,o?Ce(Ve,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Ce(Ve,{component:"span",sx:{fontSize:13.5,fontWeight:o?700:400,color:n?f.colors.danger:f.mode==="dark"?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:t})]}),u?Ce(Ve,{sx:{px:1,py:1,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0},children:u}):null,Ce(Ve,{sx:{flex:1,minHeight:0,bgcolor:o?f.calendar.todayBg:f.colors.surfaceSubtle},children:Ce(ug,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:ft(Ve,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[i.length>0?Ce(Ve,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:i.map(b=>Ce(Tn,{event:b},b.uid))}):null,Ce(sg,{items:r.map(b=>String(b.seq)),strategy:mg,children:r.map(b=>Ce(Pr,{titleFontSize:15,task:b,statusOptions:a,variant:"list",onRequestArchiveToggle:l,onRequestReply:m,onCardClick:d,onCardContextMenu:s},b.seq))}),Ce(Ve,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...p?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:ft(ps,{className:"taskbox-add-schedule",onClick:()=>c(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[Ce(jx,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function xs({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onToggleCompleted:r,onMoveTask:i,onRequestReply:a,onAddSchedule:l,canAdd:m=!0,onOpenDetail:c,onTaskContextMenu:p,renderColumnSummary:d}){let s=ie(),[u,f]=Vn(()=>ia(new Date)),[y,b]=Vn(null),[h,g]=Vn(null),[B,x]=Vn(null),[C,S]=Vn(null),D=Gx(!1),O=Un(()=>Array.from({length:7},(M,q)=>aa(u,q)),[u]),$=Un(()=>new Map(e.map(M=>[M.seq,M])),[e]),E=Un(()=>[...new Set(O.map(M=>M.getFullYear()))],[O]),ae=Rt(E),I=lg(ag(tg,{activationConstraint:{distance:5}})),k=zt(M=>{let q=ng(M),U=q.length>0?q:rg(M),te=U.filter(me=>!String(me.id).startsWith(qr));return te.length>0?te:U},[]),K=Un(()=>kn(o),[o]),N=Un(()=>{let M=new Map;for(let q of e){let U=q.due_date.slice(0,10);if(!U)continue;let te=M.get(U);te?te.push(q):M.set(U,[q])}for(let q of M.values())q.sort((U,te)=>{let me=U.sort_no>0,ne=te.sort_no>0;if(me&&ne)return U.sort_no-te.sort_no;if(me!==ne)return me?-1:1;if(U.completed!==te.completed)return U.completed?1:-1;let _e=Mi(U),R=Mi(te);return _e!==R?_e?-1:1:U.seq-te.seq});return M},[e]),Z=zt(M=>B?(B.get(M)??[]).map(q=>$.get(q)).filter(q=>!!q):N.get(M)??[],[B,$,N]),P=zt(M=>{S(Number(M.active.id)),x(new Map(O.map(q=>{let U=qe(q);return[U,(N.get(U)??[]).map(te=>te.seq)]})))},[O,N]),oe=zt((M,q)=>{if(M.startsWith(qr))return{day:M.slice(qr.length),overSeq:null};let U=Number(M);for(let[te,me]of q)if(me.includes(U))return{day:te,overSeq:U};return null},[]),le=zt(M=>{let{active:q,over:U}=M;U&&x(te=>{if(!te)return te;let me=Number(q.id),ne=oe(String(U.id),te);if(!ne)return te;let _e=[...te.entries()].find(([,_])=>_.includes(me))?.[0];if(!_e||_e===ne.day)return te;let R=new Map(te);R.set(_e,(R.get(_e)??[]).filter(_=>_!==me));let Y=[...R.get(ne.day)??[]],Te=Y.length;if(ne.overSeq!==null){let _=Y.indexOf(ne.overSeq);_!==-1&&(Te=_)}return Y.splice(Te,0,me),R.set(ne.day,Y),R})},[oe]),L=zt(M=>{let{active:q,over:U}=M,te=B;if(x(null),S(null),D.current=!0,!te||!U)return;let me=Number(q.id),ne=[...te.entries()].find(([,_])=>_.includes(me));if(!ne)return;let[_e,R]=ne,Y=[...R],Te=oe(String(U.id),te);if(Te&&Te.day===_e&&Te.overSeq!==null&&Te.overSeq!==me){let _=Y.indexOf(me),xe=Y.indexOf(Te.overSeq);_!==-1&&xe!==-1&&(Y=cg(Y,_,xe))}i(me,_e,Y)},[B,i,oe]),H=zt(()=>{x(null),S(null),D.current=!0},[]),J=zt(M=>{if(D.current){D.current=!1;return}c(M)},[c]),W=C!==null?$.get(C)??null:null;return ft(Ve,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${s.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[ft(Ve,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:s.calendar.headerBg,borderBottom:`1px solid ${s.calendar.borderColor}`,flexShrink:0},children:[ft(Ve,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Ce(ds,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>f(aa(u,-7)),children:Ce(Xx,{sx:{fontSize:20,color:s.colors.textSecondary}})}),Ce(Yx,{size:"small",color:"inherit",onClick:()=>f(ia(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:s.mode==="dark"?400:500,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary},children:"\uC624\uB298"}),Ce(ds,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>f(aa(u,7)),children:Ce(Qx,{sx:{fontSize:20,color:s.colors.textSecondary}})})]}),ft(ps,{onClick:M=>g(M.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:s.mode==="dark"?400:700,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary,"&:hover":{bgcolor:s.colors.surfaceHover}},children:[pg(O),Ce(Jx,{sx:{fontSize:18,color:s.colors.textMuted}})]})]}),Ce(Ve,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:s.calendar.headerBg,borderBottom:`1px solid ${s.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${s.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:O.map(M=>{let q=M.getDay(),U=ae.has(qe(M));return Ce(Ve,{sx:{height:fs,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:q===0||U?s.colors.danger:q===6?s.colors.accentOnSurface:s.colors.textSecondary},children:dg[q]},qe(M))})}),Ce(Ve,{sx:{flex:1,minHeight:0},children:ft(eg,{sensors:I,collisionDetection:k,onDragStart:P,onDragOver:le,onDragEnd:L,onDragCancel:H,children:[Ce(Ve,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${s.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:O.map(M=>{let q=qe(M);return Ce(xg,{dayKey:q,isToday:q===n,dayLabel:fg(M),holidayName:ae.get(q)??"",summary:d?.(q,Z(q)),tasks:Z(q),googleEvents:K.get(q)??[],statusOptions:t,onRequestArchiveToggle:b,onRequestReply:a,onAddSchedule:l,canAdd:m,onCardClick:J,onCardContextMenu:p},q)})}),Ce(og,{children:W?Ce(Ve,{sx:{...hn,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Ce(jt,{task:W,statusOptions:t})}):null})]})}),Ce(Zx,{anchorEl:h,open:!!h,onClose:()=>g(null),selectedDate:u,onDateChange:M=>{f(ia(M)),g(null)}}),Ce(Ue,{open:!!y,anchorEl:y?.anchorEl??null,title:y?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:y?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>b(null),onConfirm:()=>{y&&r(y.taskSeq,y.nextCompleted),b(null)}})]})}import{useCallback as Gn,useMemo as Xt,useState as Ar}from"react";import{Box as Ge,Button as gg,ButtonBase as hs,IconButton as gs,Tooltip as bg}from"@mui/material";import hg from"@mui/icons-material/Add";import kg from"@mui/icons-material/ChevronLeft";import Tg from"@mui/icons-material/ChevronRight";import yg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Sg}from"@ehfuse/mui-datetime-picker";import{DndContext as Bg,DragOverlay as Cg,PointerSensor as vg,pointerWithin as Ig,rectIntersection as _g,useDraggable as wg,useDroppable as ks,useSensor as Dg,useSensors as Og}from"@dnd-kit/core";import Mg from"@ehfuse/overlay-scrollbar";import{jsx as Oe,jsxs as Ao}from"react/jsx-runtime";var Eg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Lr="mday-",Nr="mchip-",Ts=36,ys=15,Ss={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"};function Pg(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Fr(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Rg(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function bs(e,o){let t=Fr(e);return t.setMonth(t.getMonth()+o),t}function zg({task:e,statusOptions:o,isPreview:t=!1,onOpenDetail:n,onContextMenu:r}){let i=ie(),a=i.mode==="dark",{attributes:l,listeners:m,setNodeRef:c,isDragging:p}=wg({id:String(e.seq),disabled:t}),{setNodeRef:d}=ks({id:`${Nr}${e.seq}`,disabled:t}),s=Me(e.icon||we),[u]=wt(e,o);return Oe(bg,{title:e.title,arrow:!0,enterDelay:400,children:Ao(Ge,{ref:f=>{c(f),d(f)},...l,...m,onClick:()=>n(e),onContextMenu:f=>r(e,f),sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,flexShrink:0,borderRadius:.75,bgcolor:u?a?dn(u.dot,i.chip.darkBgAlpha):u.bg:a?i.card.bg:i.colors.surfaceHover,color:u?a?i.chip.darkTextSource==="fg"?u.fg:u.dot:u.fg:i.colors.textPrimary,fontSize:ys,fontWeight:a||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:t?.5:p?.35:e.completed?.6:1,border:t?`1px dashed ${i.colors.accent}`:"1px solid transparent",pointerEvents:t?"none":"auto",cursor:"pointer",touchAction:"none",overflow:"hidden","&:hover":{filter:"brightness(0.96)"}},children:[Oe(Ge,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:Ss[e.priority]}}),s?Oe(s,{sx:{fontSize:14,flexShrink:0,opacity:.75}}):null,Ao(Ge,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:a?i.colors.textStrong:i.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})]})})}function qg({dayKey:e,dayNumber:o,isToday:t,isOtherMonth:n,weekday:r,holidayName:i,tasks:a,googleEvents:l,statusOptions:m,previewSeq:c,onOpenDetail:p,onTaskContextMenu:d,onAddSchedule:s,canAdd:u}){let f=ie(),y=f.mode==="dark",{setNodeRef:b,isOver:h}=ks({id:`${Lr}${e}`}),g=a,B=!!i||r===0;return Ao(Ge,{ref:b,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:h?f.colors.accentSoft:t?f.calendar.todayBg:n?f.calendar.otherMonthBg:f.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...u?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[Ao(Ge,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:Ts,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:t?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:`1px solid ${f.calendar.borderColor}`},children:[i?Oe(Ge,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}):null,t?Oe(Ge,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Oe(Ge,{component:"span",sx:{fontSize:13.5,fontWeight:t?700:400,color:n?f.colors.textMuted:B?f.colors.danger:r===6?f.colors.accentOnSurface:y?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:o})]}),l.map(x=>Oe(Tn,{event:x,small:!0},x.uid)),g.map(x=>Oe(zg,{task:x,statusOptions:m,isPreview:x.seq===c,onOpenDetail:p,onContextMenu:d},x.seq)),Oe(Ge,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:Ao(hs,{className:"taskbox-month-add",onClick:()=>s(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[Oe(hg,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function Bs({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onMoveTask:r,onAddSchedule:i,canAdd:a=!0,onOpenDetail:l,onTaskContextMenu:m}){let c=ie(),p=c.mode==="dark",[d,s]=Ar(()=>Fr(new Date)),[u,f]=Ar(null),[y,b]=Ar(null),[h,g]=Ar(null),B=Xt(()=>{let L=Pg(d);return Array.from({length:42},(H,J)=>Rg(L,J))},[d]),x=Xt(()=>new Map(e.map(L=>[L.seq,L])),[e]),C=Xt(()=>kn(o),[o]),S=Xt(()=>[...new Set(B.map(L=>L.getFullYear()))],[B]),D=Rt(S),O=Xt(()=>{let L=new Map;for(let H of e){let J=H.due_date.slice(0,10);if(!J)continue;let W=L.get(J);W?W.push(H):L.set(J,[H])}for(let H of L.values())H.sort((J,W)=>{let M=J.sort_no>0,q=W.sort_no>0;return M&&q?J.sort_no-W.sort_no:M!==q?M?-1:1:J.completed!==W.completed?J.completed?1:-1:J.seq-W.seq});return L},[e]),$=Og(Dg(vg,{activationConstraint:{distance:5}})),E=Gn(L=>{let H=Ig(L),J=H.length>0?H:_g(L),W=J.filter(M=>String(M.id).startsWith(Nr));return W.length>0?W:J.filter(M=>String(M.id).startsWith(Lr))},[]),ae=Gn(L=>{b(Number(L.active.id))},[]),I=Gn(L=>{g(L.over?String(L.over.id):null)},[]),k=Xt(()=>{let L=new Map;for(let[H,J]of O)for(let W of J)L.set(W.seq,H);return L},[O]),K=y!==null?x.get(y)?.due_date.slice(0,10)??"":"",N=Xt(()=>{if(y===null||!h)return null;if(h.startsWith(Nr)){let L=Number(h.slice(Nr.length)),H=k.get(L);if(!H)return null;let J=(O.get(H)??[]).filter(M=>M.seq!==y),W=J.findIndex(M=>M.seq===L);return{day:H,index:W===-1?J.length:W}}if(h.startsWith(Lr)){let L=h.slice(Lr.length),H=(O.get(L)??[]).filter(J=>J.seq!==y);return{day:L,index:H.length}}return null},[y,k,h,O]),Z=Gn(L=>{let H=O.get(L)??[];if(y===null||!N)return H;let J=x.get(y);if(!J)return H;let W=H.filter(M=>M.seq!==y);return L===N.day?[...W.slice(0,N.index),J,...W.slice(N.index)]:L===K?W:H},[y,K,N,x,O]),P=Gn(L=>{let H=y,J=N;if(b(null),g(null),H===null||!J)return;let W=(O.get(J.day)??[]).filter(q=>q.seq!==H),M=[...W.slice(0,J.index).map(q=>q.seq),H,...W.slice(J.index).map(q=>q.seq)];r(H,J.day,M)},[y,N,r,O]),oe=y!==null?x.get(y)??null:null,le=`${d.getFullYear()}\uB144 ${d.getMonth()+1}\uC6D4`;return Ao(Ge,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${c.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[Ao(Ge,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0},children:[Ao(Ge,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Oe(gs,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>s(bs(d,-1)),children:Oe(kg,{sx:{fontSize:20,color:c.colors.textSecondary}})}),Oe(gg,{size:"small",color:"inherit",onClick:()=>s(Fr(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:c.mode==="dark"?400:500,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),Oe(gs,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>s(bs(d,1)),children:Oe(Tg,{sx:{fontSize:20,color:c.colors.textSecondary}})})]}),Ao(hs,{onClick:L=>f(L.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,"&:hover":{bgcolor:c.colors.surfaceHover}},children:[le,Oe(yg,{sx:{fontSize:18,color:c.colors.textMuted}})]})]}),Oe(Ge,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Eg.map((L,H)=>Oe(Ge,{sx:{height:Ts,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:H===0?c.colors.danger:H===6?c.colors.accentOnSurface:c.colors.textSecondary},children:L},L))}),Oe(Ge,{sx:{flex:1,minHeight:0},children:Ao(Bg,{sensors:$,collisionDetection:E,onDragStart:ae,onDragOver:I,onDragEnd:P,onDragCancel:()=>{b(null),g(null)},children:[Oe(Mg,{style:{height:"100%"},thumb:{width:8},children:Oe(Ge,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`,borderBottom:`1px solid ${c.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:B.map(L=>{let H=qe(L);return Oe(qg,{dayKey:H,dayNumber:L.getDate(),isToday:H===n,isOtherMonth:L.getMonth()!==d.getMonth(),weekday:L.getDay(),holidayName:D.get(H)??"",tasks:Z(H),googleEvents:C.get(H)??[],statusOptions:t,previewSeq:N?.day===H?y:null,onOpenDetail:l,onTaskContextMenu:m,onAddSchedule:i,canAdd:a},H)})})}),Oe(Cg,{children:oe?Ao(Ge,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:c.calendar.cellBg,border:`1px solid ${c.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:ys,fontWeight:500,color:c.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[Oe(Ge,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:Ss[oe.priority]}}),oe.title]}):null})]})}),Oe(Sg,{anchorEl:u,open:!!u,onClose:()=>f(null),selectedDate:d,onDateChange:L=>{s(Fr(L)),f(null)}})]})}import{useEffect as Ag,useMemo as Yn,useRef as Lg,useState as Cs}from"react";import{Box as oo,Button as Ng,IconButton as vs}from"@mui/material";import Fg from"@mui/icons-material/ChevronLeft";import Hg from"@mui/icons-material/ChevronRight";import Wg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as $g}from"@ehfuse/mui-datetime-picker";import{jsx as Je,jsxs as Lo}from"react/jsx-runtime";var Kg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ug={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"};function la(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Is(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function _s({task:e,statusOptions:o,onOpenDetail:t}){let n=ie(),[r]=wt(e,o),i=Me(e.icon||(e.is_notice?Ro:we));return Lo(oo,{onClick:a=>{a.stopPropagation(),t(e)},sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:1,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:r?.bg??n.colors.surfaceHover,color:r?.fg??n.colors.textPrimary,fontSize:15,fontWeight:e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:e.completed?.6:1,cursor:"pointer",overflow:"hidden"},children:[Je(oo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:Ug[e.priority]??n.colors.accentOnSurface}}),i?Je(i,{sx:{fontSize:16,flexShrink:0,opacity:.75}}):null,Lo(oo,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:n.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})]})}function ws({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onOpenDetail:r,onAddSchedule:i,fallbackToStartDate:a=!1}){let l=ie(),[m,c]=Cs(()=>la(new Date)),[p,d]=Cs(!1),s=Yn(()=>{let x=new Date(m.getFullYear(),m.getMonth()+1,0).getDate();return Array.from({length:x},(C,S)=>{let D=new Date(m.getFullYear(),m.getMonth(),S+1);return{ymd:Is(D),dayNumber:S+1,weekday:D.getDay()}})},[m]),u=Yn(()=>{let x=new Map;for(let C of e){let S=C.due_date.slice(0,10)||(a?C.start_date.slice(0,10):"");if(!S)continue;let D=x.get(S);D?D.push(C):x.set(S,[C])}for(let C of x.values())C.sort((S,D)=>S.completed!==D.completed?S.completed?1:-1:S.seq-D.seq);return x},[e,a]),f=Yn(()=>a?e.filter(x=>!x.due_date.slice(0,10)&&!x.start_date.slice(0,10)).sort((x,C)=>x.completed!==C.completed?x.completed?1:-1:x.seq-C.seq):[],[e,a]),y=Yn(()=>kn(o),[o]),b=Yn(()=>[m.getFullYear()],[m]),h=Rt(b),g=Lg(null),B=n.slice(0,7)===Is(m).slice(0,7);return Ag(()=>{if(!B)return;let x=O=>{let $=O?.parentElement??null;for(;$;){let E=window.getComputedStyle($);if(/(auto|scroll)/.test(E.overflowY)&&$.scrollHeight>$.clientHeight)return $;$=$.parentElement}return null},C=()=>{let O=g.current,$=x(O);if(!$||!O)return;let E=O.getBoundingClientRect().top-$.getBoundingClientRect().top+$.scrollTop;$.scrollTop=Math.max(0,E-$.clientHeight/2+O.clientHeight/2)},S=setTimeout(C,100),D=setTimeout(C,400);return()=>{clearTimeout(S),clearTimeout(D)}},[B,m]),Lo(oo,{sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:l.colors.surface},children:[Lo(oo,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[Je(vs,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>c(x=>new Date(x.getFullYear(),x.getMonth()-1,1)),children:Je(Fg,{sx:{fontSize:20,color:l.colors.textSecondary}})}),Je(Ng,{size:"small",color:"inherit",onClick:()=>c(la(new Date)),sx:{minWidth:0,px:1,fontSize:13.5,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary},children:"\uC624\uB298"}),Je(vs,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>c(x=>new Date(x.getFullYear(),x.getMonth()+1,1)),children:Je(Hg,{sx:{fontSize:20,color:l.colors.textSecondary}})}),Lo(oo,{onClick:()=>d(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:l.mode==="dark"?400:700,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary,cursor:"pointer"},children:[m.getFullYear(),"\uB144 ",m.getMonth()+1,"\uC6D4",Je(Wg,{sx:{fontSize:20,color:l.colors.textMuted}})]})]}),Lo(oo,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${l.calendar.borderColor}`},children:[f.length>0?Lo(oo,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`},children:[Lo(oo,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:l.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",Je("br",{}),"\uC5C6\uC74C"]}),Je(oo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:f.map(x=>Je(_s,{task:x,statusOptions:t,onOpenDetail:r},x.seq))})]}):null,s.map(({ymd:x,dayNumber:C,weekday:S})=>{let D=h.get(x)??"",O=x===n,$=!!D||S===0,E=u.get(x)??[],ae=y.get(x)??[],I=E.length>0||ae.length>0;return Lo(oo,{ref:O?g:void 0,onClick:i?()=>i(x):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:I?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`,...i?{cursor:"pointer"}:{}},children:[Je(oo,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:Lo(oo,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Je(oo,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:26,height:26,borderRadius:"50%",fontSize:15.5,fontWeight:O?700:500,color:O?l.colors.surface:$?l.colors.danger:S===6?l.colors.accentOnSurface:l.colors.textPrimary,bgcolor:O?l.colors.accentOnSurface:"transparent"},children:C}),Je(oo,{component:"span",sx:{fontSize:12.5,color:$?l.colors.danger:S===6?l.colors.accentOnSurface:l.colors.textSecondary},children:Kg[S]})]})}),Lo(oo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[ae.map(k=>Je(Tn,{event:k},k.uid)),E.map(k=>Je(_s,{task:k,statusOptions:t,onOpenDetail:r},k.seq))]})]},x)})]}),Je($g,{open:p,centered:!0,monthOnly:!0,onClose:()=>d(!1),selectedDate:m,onDateChange:x=>{c(la(x)),d(!1)}})]})}import{useCallback as Ds,useEffect as Os,useMemo as sa,useRef as Wr,useState as $r}from"react";import{Box as Le,Tooltip as Ps}from"@mui/material";import Vg from"@ehfuse/overlay-scrollbar";import Gg from"@mui/icons-material/CheckCircle";import Yg from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as jg,PointerSensor as Xg,closestCenter as Qg,useSensor as Jg,useSensors as Zg}from"@dnd-kit/core";import{SortableContext as eb,arrayMove as ob,useSortable as tb,verticalListSortingStrategy as nb}from"@dnd-kit/sortable";import rb from"@mui/icons-material/DragIndicator";import{jsx as Re,jsxs as qt}from"react/jsx-runtime";var ca=36,ib=48,Ms=40,ab=24,lb=4,sb=14,Es=36,cb=12.5,yn=220,mb={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function Qt(e){let o=String(e??"").trim();if(!o)return null;let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?null:t}function Hr(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function ma(e,o){return Math.round((o.getTime()-e.getTime())/864e5)}function ub({task:e,dragHandle:o,onPointerDown:t,onClick:n}){let r=ie(),i=Wr(null),[a,l]=$r("");return Re(Ps,{title:a,arrow:!0,enterDelay:300,children:qt(Le,{onPointerDown:t,onClick:m=>n(e,m),onMouseEnter:()=>{let m=i.current;l(m&&m.scrollWidth>m.clientWidth?e.title:"")},sx:{width:yn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:r.mode==="dark"||e.completed?400:500,color:e.completed?r.colors.textMuted:r.mode==="dark"?r.colors.textStrong:r.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:r.colors.surfaceHover}},children:[o,Re(Le,{ref:i,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function db({id:e,showIndicator:o,children:t}){let n=ie(),{attributes:r,listeners:i,setNodeRef:a}=tb({id:e});return qt(Le,{ref:a,sx:{position:"relative"},children:[o?Re(Le,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:n.colors.accentOnSurface,zIndex:5}}):null,t({...r,...i})]})}function Rs({tasks:e,todayStr:o,onOpenDetail:t,onToggleChecklist:n,onReorderTasks:r,onTaskContextMenu:i}){let a=ie(),l=sa(()=>[...e].sort((k,K)=>{let N=(k.timeline_sort_no??0)>0,Z=(K.timeline_sort_no??0)>0;if(N&&Z)return(k.timeline_sort_no??0)-(K.timeline_sort_no??0);if(N!==Z)return N?-1:1;let P=k.due_date||k.start_date,oe=K.due_date||K.start_date;return P!==oe?P<oe?-1:1:k.seq-K.seq}),[e]),[m,c]=$r(null),[p,d]=$r(null),s=Zg(Jg(Xg,{activationConstraint:{distance:4}})),u=Ds(k=>{c(k.over?Number(k.over.id):null)},[]),f=Ds(k=>{c(null),d(null);let{active:K,over:N}=k;if(!N||K.id===N.id)return;let Z=l.map(le=>le.seq),P=Z.indexOf(Number(K.id)),oe=Z.indexOf(Number(N.id));P===-1||oe===-1||r(ob(Z,P,oe))},[l,r]),y=sa(()=>{let k=Qt(o)??new Date,K=k,N=Hr(k,21);for(let oe of l){let le=Qt(oe.start_date)??Qt(oe.due_date),L=Qt(oe.due_date)??le;le&&le<K&&(K=le),L&&L>N&&(N=L)}let Z=Hr(K,-3),P=ma(Z,Hr(N,3))+1;return Array.from({length:P},(oe,le)=>Hr(Z,le))},[l,o]),b=y[0],h=y.findIndex(k=>qe(k)===o),{dayWidths:g,dayOffsets:B,gridWidth:x}=sa(()=>{let k=y.map((Z,P)=>Z.getDate()===1||P===0?ib:ca),K=[],N=0;for(let Z of k)K.push(N),N+=Z;return{dayWidths:k,dayOffsets:K,gridWidth:N}},[y]),C=yn+x,S=Wr(null),D=k=>{S.current={x:k.clientX,y:k.clientY}},O=(k,K)=>{let N=S.current;S.current=null,!(N&&(Math.abs(K.clientX-N.x)>5||Math.abs(K.clientY-N.y)>5))&&t(k)},$=Wr(null),[E,ae]=$r(!1);Os(()=>{let k=$.current?.getScrollContainer();if(!k)return;let K=()=>ae(k.scrollHeight>k.clientHeight);K();let N=new ResizeObserver(K);return N.observe(k),()=>N.disconnect()},[l.length]);let I=Wr(!1);return Os(()=>{if(l.length===0||I.current)return;I.current=!0;let k=window.requestAnimationFrame(()=>{let K=$.current?.getScrollContainer();!K||h<0||(K.scrollLeft=Math.max(0,B[h]-ca*3))});return()=>window.cancelAnimationFrame(k)},[l.length]),Re(Le,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${a.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:a.timeline.headerBg},children:Re(Le,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:Re(Vg,{ref:$,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:qt(Le,{sx:{width:C,position:"relative",bgcolor:a.timeline.bg},children:[qt(Le,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:a.timeline.headerBg,borderBottom:`1px solid ${a.timeline.gridColor}`},children:[Re(Le,{sx:{width:yn,height:Es,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:a.timeline.headerBg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:a.colors.textSecondary},children:"\uC81C\uBAA9"}),y.map((k,K)=>{let N=k.getDay(),Z=K===h,P=k.getDate()===1||K===0;return Re(Le,{sx:{width:g[K],height:Es,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:cb,fontWeight:Z&&a.mode!=="dark"?700:400,color:Z?a.timeline.bg:N===0?a.colors.danger:N===6?a.colors.accentOnSurface:a.colors.textSecondary,bgcolor:Z?a.colors.danger:"transparent",borderRight:`1px solid ${a.timeline.gridColor}`,whiteSpace:"nowrap"},children:P?`${k.getMonth()+1}/${k.getDate()}`:k.getDate()},qe(k))})]}),Re(jg,{sensors:s,collisionDetection:Qg,onDragStart:k=>d(Number(k.active.id)),onDragOver:u,onDragEnd:f,onDragCancel:()=>{c(null),d(null)},children:Re(eb,{items:l.map(k=>String(k.seq)),strategy:nb,children:qt(Le,{sx:{position:"relative"},children:[y.map((k,K)=>{let N=k.getDay(),Z=K===h;return!Z&&N!==0&&N!==6?null:Re(Le,{sx:{position:"absolute",top:0,bottom:0,left:yn+B[K],width:g[K],bgcolor:Z?"rgba(229,72,77,0.07)":a.colors.surfaceSubtle,zIndex:0}},`stripe-${qe(k)}`)}),l.map((k,K)=>{let N=Qt(k.start_date)??Qt(k.due_date),Z=Qt(k.due_date)??N,P=N?Math.min(y.length-1,Math.max(0,ma(b,N))):0,oe=Z?Math.min(y.length-1,Math.max(P,ma(b,Z))):P,le=mb[k.priority],L=yn+B[P]+2,H=B[oe]+g[oe]-B[P]-4,J=k.checklist??[];return Re(db,{id:String(k.seq),showIndicator:m===k.seq&&p!==k.seq,children:W=>qt(Le,{sx:{borderBottom:K===l.length-1&&E?"none":`1px solid ${a.timeline.gridColor}`,position:"relative",zIndex:1,opacity:p===k.seq?.45:1},children:[qt(Le,{onContextMenu:M=>i(k,M),sx:{display:"flex",height:Ms,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[Re(ub,{task:k,dragHandle:Re(Le,{component:"span",className:"taskbox-timeline-handle",...W,onClick:M=>M.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:a.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:a.colors.accentOnSurface}},children:(()=>{let M=Me(k.icon||we)??rb;return Re(M,{sx:{fontSize:17}})})()}),onPointerDown:D,onClick:O}),Re(Ps,{title:`${k.title} (${k.start_date||"?"} ~ ${k.due_date||"?"})`,arrow:!0,enterDelay:300,children:Re(Le,{onPointerDown:D,onClick:M=>O(k,M),sx:{position:"absolute",top:(Ms-20)/2,left:L,width:Math.max(ca-4,H),height:20,borderRadius:1,bgcolor:le.bg,border:`1px solid ${le.border}`,opacity:k.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),J.map((M,q)=>Re(Le,{sx:{display:"flex",height:ab,position:"relative",mt:q===0?`${lb}px`:0,mb:q===J.length-1?`${sb}px`:0},children:Re(Le,{sx:{width:yn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:a.timeline.bg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:M.checked?a.colors.textMuted:a.colors.textPrimary},children:qt(Le,{onClick:()=>n(k.seq,q,!M.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[M.checked?Re(Gg,{sx:{fontSize:17,color:a.colors.accentOnSurface,flexShrink:0}}):Re(Yg,{sx:{fontSize:17,color:a.colors.textMuted,flexShrink:0}}),Re(Le,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:M.checked?"line-through":"none"},children:M.label})]})})},`${k.seq}-check-${q}`))]})},k.seq)}),l.length===0?Re(Le,{sx:{py:8,textAlign:"center",color:a.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as Jt}from"react/jsx-runtime";function Yw(e){switch(e.view){case"card":case"kanban":{let{view:o,...t}=e;return Jt(ta,{...t,columnAxis:o==="kanban"?"status":"project"})}case"sprint":{let{view:o,...t}=e;return Jt(ta,{...t,columnAxis:"sprint"})}case"calendar":{let{view:o,...t}=e;return Jt(xs,{...t})}case"month":{let{view:o,...t}=e;return Jt(Bs,{...t})}case"agenda":{let{view:o,...t}=e;return Jt(ws,{...t})}case"timeline":{let{view:o,...t}=e;return Jt(Rs,{...t})}default:{let{view:o,...t}=e;return Jt(jl,{...t})}}}var jw=["list","card","kanban","calendar","month","timeline"];import{Box as bo}from"@mui/material";function pb(e){let o=String(e??"").trim();if(!o)return 0;let t=0,n=!1;for(let r of o.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let i=parseFloat(r[1]),a=r[2].toLowerCase();n=!0,a==="m"||a==="\uBD84"?t+=i/60:a==="d"||a==="\uC77C"?t+=i*8:t+=i}if(!n){let r=parseFloat(o);Number.isFinite(r)&&(t+=r)}return t}function zs(e){let o=Math.round(e*10)/10;return`${o%1===0?o.toFixed(0):o.toFixed(1)}\uC2DC\uAC04`}function qs(e,o,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return 0;let n=new Date(`${e}T00:00:00`),r=new Date(`${o}T00:00:00`);if(r<n||r.getTime()-n.getTime()>3660*864e5)return 0;let i=0;for(let a=new Date(n);a<=r;a.setDate(a.getDate()+1)){let l=a.getDay();if(l===0||l===6)continue;let m=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;t.has(m)||(i+=1)}return i}function As(e){return e.reduce((o,t)=>t.completed?o:o+pb(t.estimated_time),0)}import{Fragment as fb,jsx as At,jsxs as No}from"react/jsx-runtime";function Ls(e,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return null;let t=new Date(`${e}T00:00:00`),n=new Date(`${o}T00:00:00`);return Math.round((t.getTime()-n.getTime())/864e5)}function Ns({tasks:e,todayStr:o,showProgress:t=!0,dday:n=null,workdaysLeft:r=null,showPoints:i=!0,showHours:a=!0,showOverdue:l=!0,showInfo:m=!0,inline:c=!1}){let p=ie(),d=e.filter(O=>!O.archived),s=d.filter(O=>O.completed).length,u=d.length>0?Math.round(s/d.length*100):0,f=d.filter(O=>!O.completed&&!O.is_event&&!!O.due_date&&O.due_date.slice(0,10)<o).length,y=d.reduce((O,$)=>$.completed?O:O+($.story_points??0),0),b=As(d),h=t?At(bo,{sx:{flex:c?"0 0 110px":"1 1 auto",minWidth:0,height:p.summary.gaugeHeight,borderRadius:3,bgcolor:p.summary.gaugeTrackColor},children:At(bo,{sx:{height:"100%",borderRadius:3,width:`${u}%`,bgcolor:u>=100?p.summary.gaugeCompleteColor:p.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,g=t?No(bo,{component:"span",sx:{flexShrink:0,fontSize:c?14:13,color:p.summary.textColor},children:[u,"%"]}):null,B={color:p.summary.numberColor,fontWeight:700,fontSize:c?15:14},x=d.length-s,C=No(fb,{children:[c?null:No("span",{children:["\uB0A8\uC740 ",At(bo,{component:"span",sx:B,children:x}),"\uAC74"]}),l&&f>0?No(bo,{component:"span",sx:{color:p.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",At(bo,{component:"span",sx:{fontWeight:700,fontSize:c?15:14},children:f}),"\uAC74"]}):null,i&&y>0?No("span",{children:[At(bo,{component:"span",sx:B,children:y}),"SP"]}):null,a&&b>0?No("span",{children:["\uC57D ",At(bo,{component:"span",sx:B,children:zs(b).replace("\uC2DC\uAC04","")}),"\uC2DC\uAC04"]}):null]}),S=typeof r=="number"&&Number.isFinite(r)?No("span",{children:["\uADFC\uBB34\uC77C ",At(bo,{component:"span",sx:B,children:r}),"\uC77C"]}):null,D=typeof n=="number"&&Number.isFinite(n)?At(bo,{component:"span",sx:{ml:c?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:p.summary.overdueColor,color:p.colors.textInverse,lineHeight:1.6},children:n===0?"D-day":n>0?`D-${n}`:`D+${-n}`}):null;return c?No(bo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:p.summary.textColor,whiteSpace:"nowrap",...p.summary.sx},children:[m?C:null,m?S:null,m?D:null,h,g]}):No(bo,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[t?No(bo,{sx:{display:"flex",alignItems:"center",gap:1},children:[h,g]}):null,No(bo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:p.summary.textColor},children:[C,S,D]})]})}import{useMemo as xb}from"react";import{jsx as gb}from"react/jsx-runtime";function sD({sprint:e,tasks:o,todayStr:t,...n}){let r=e.status==="closed"?null:Ls(e.end_date,t),i=r!==null&&r>=0,a=xb(()=>{if(!i)return[];let c=Number(t.slice(0,4)),p=Number(e.end_date.slice(0,4))||c,d=[];for(let s=c;s<=Math.max(c,p);s+=1)d.push(s);return d},[i,t,e.end_date]),l=Rt(a),m=i?qs(t,e.end_date,new Set(l.keys())):null;return gb(Ns,{tasks:o,todayStr:t,dday:r,workdaysLeft:m,...n})}import{useEffect as Ib,useRef as _b,useState as wb}from"react";import{Box as da}from"@mui/material";import{Children as bb}from"react";import{Box as ua,CircularProgress as hb}from"@mui/material";import{jsx as Kr}from"react/jsx-runtime";var Fs={xs:2,md:3};function Hs(){return Kr(ua,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:Kr(hb,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function Ws({children:e}){return Kr(ua,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:Fs,pb:Fs},children:bb.map(e,o=>o==null||o===!1?null:Kr(ua,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:o}))})}import{Box as gt,Button as Sb,Checkbox as Bb,Typography as Lt}from"@mui/material";import Ks from"@mui/icons-material/CheckCircle";import Cb from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as yb,jsx as $s}from"react/jsx-runtime";var kb="taskbox-search-highlight";function Tb(e,o){let t=o?.keyPrefix??"hl";return e.map((n,r)=>$s("span",{className:n.highlight?o?.highlightClassName??kb:o?.className,style:n.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:n.text},`${t}-${n.text}-${r}`))}function Ur({text:e,keyword:o,fallback:t="-",className:n,highlightClassName:r,keyPrefix:i}){let a=String(e??"").trim()||t,l=Br(a,o);return $s(yb,{children:Tb(l,{className:n,highlightClassName:r,keyPrefix:i})})}import{jsx as fe,jsxs as Sn}from"react/jsx-runtime";var vb={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:po(12.5),fontWeight:500,lineHeight:1.4},xt={fontSize:po(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function Qo({label:e,children:o}){return Sn(gt,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[fe(gt,{sx:vb,children:e}),fe(gt,{sx:{...xt,flex:1,pt:.2},children:o})]})}function Us({task:e,statusOptions:o,projectLabel:t,searchText:n,todayStr:r,onRequestToggleCompleted:i,onOpenDetail:a,onTaskContextMenu:l,targetSummary:m="",ackInfo:c,completeLocked:p=!1,unread:d=!1,noticeReadOnly:s=!1,onAckConfirm:u,onAckListClick:f,myManaged:y=!1}){let b=e.is_event?Hn(e):fo(e),h=Yo(e.start_date),g=Yo(e.due_date),B=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<r,x=(e.receiver_names??[]).filter(Boolean);return Sn(gt,{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a(e))},onContextMenu:C=>l(e,C),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",position:"relative"},children:[y?fe(gt,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,Sn(gt,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[!s&&!p?fe(Bb,{checked:e.completed,icon:fe(Cb,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:fe(Ks,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:C=>C.stopPropagation(),onChange:(C,S)=>i({anchorEl:C.currentTarget,taskSeq:e.seq,nextCompleted:S}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{let C=Me(e.icon||(e.is_notice?Ro:we));if(!C)return null;let S=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return fe(C,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:S}})})(),fe(Lt,{sx:{fontSize:po(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":"#111827",textDecoration:e.completed?"line-through":"none"},children:fe(Ur,{text:e.title,keyword:n})}),d?fe(gt,{component:"span",sx:{flexShrink:0,px:.55,fontSize:po(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),Sn(gt,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[fe(Qo,{label:b?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:Sn(gt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:[b?fe(De,{option:b,small:!0}):null,fe(zo,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?fe(Qo,{label:"\uB77C\uBCA8",children:fe(Dt,{labelKeys:e.label_keys,labelOptions:o})}):null,t?fe(Qo,{label:"\uD504\uB85C\uC81D\uD2B8",children:fe(Lt,{sx:xt,children:t})}):null,h?fe(Qo,{label:"\uC2DC\uC791",children:fe(Lt,{sx:xt,children:h})}):null,g?fe(Qo,{label:"\uB9C8\uAC10",children:Sn(Lt,{sx:{...xt,color:B?"#e5484d":xt.color,fontWeight:B?600:400},children:[g,B?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?fe(Qo,{label:"\uB300\uC0C1\uC790",children:fe(Lt,{sx:xt,children:m||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&c?fe(Qo,{label:"\uD655\uC778",children:fe(Sb,{size:"small",variant:c.canAck?"contained":"outlined",color:"inherit",startIcon:c.acked?fe(Ks,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:C=>{C.stopPropagation(),c.canAck?u?.(e):f?.(e,C.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:po(13),...c.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:c.canAck?"\uD655\uC778":`${c.count}/${c.total}`})}):null,!e.is_notice&&e.manager_name?fe(Qo,{label:"\uCC45\uC784\uC790",children:fe(Lt,{sx:xt,children:fe(Ur,{text:e.manager_name,keyword:n})})}):null,!e.is_notice&&x.length>0?fe(Qo,{label:"\uCC38\uC870\uC790",children:fe(Lt,{sx:xt,children:x.join(", ")})}):null,e.note?fe(Qo,{label:"\uBE44\uACE0",children:fe(Lt,{sx:xt,children:fe(Ur,{text:e.note,keyword:n})})}):null]})]})}import{jsx as Bn,jsxs as Db}from"react/jsx-runtime";function zD({tasks:e,statusOptions:o,customTabs:t,loading:n,searchText:r,todayStr:i,onToggleCompleted:a,onOpenDetail:l,onTaskContextMenu:m,getTargetSummary:c,getAckInfo:p,getNoticeReadOnly:d,isTaskUnread:s,getCompleteLocked:u,onAckConfirm:f,onAckListClick:y,onEndReached:b,myAccountSeq:h=0}){let g=new Map(t.map(S=>[S.key,S.label])),[B,x]=wb(null),C=_b(null);return Ib(()=>{let S=C.current;if(!b||!S)return;let D=new IntersectionObserver(O=>{O[0]?.isIntersecting&&b()});return D.observe(S),()=>D.disconnect()},[b,e.length]),e.length===0?n?Bn(Hs,{}):Bn(da,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Db(da,{sx:{minWidth:0},children:[Bn(Ws,{children:e.map(S=>Bn(Us,{myManaged:h>0&&!S.is_notice&&!S.is_event&&(S.manager_account_seq??0)===h,task:S,statusOptions:o,projectLabel:S.tab_key?g.get(S.tab_key)??"":"",searchText:r,todayStr:i,onRequestToggleCompleted:x,onOpenDetail:l,onTaskContextMenu:m,targetSummary:S.is_notice?c?.(S):void 0,ackInfo:S.is_notice?p?.(S):void 0,noticeReadOnly:S.is_notice?d?.(S):!1,unread:s?.(S)??!1,completeLocked:u?.(S)??!1,onAckConfirm:f,onAckListClick:y},S.seq))}),b?Bn(da,{ref:C,sx:{height:"1px"}}):null,Bn(Ue,{open:!!B,anchorEl:B?.anchorEl??null,title:B?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:B?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>x(null),onConfirm:()=>{B&&a(B.taskSeq,B.nextCompleted),x(null)}})]})}import{useEffect as Tk,useRef as yk,useState as Sc}from"react";import{Box as or,Button as Bc,Divider as Sk,Drawer as Bk,IconButton as Ia,Tooltip as Ck}from"@mui/material";import vk from"@mui/icons-material/Close";import Ik from"@mui/icons-material/ArrowBack";import _k from"@ehfuse/overlay-scrollbar";import{Box as pa,ButtonBase as Ob,Divider as Mb,Popover as Eb}from"@mui/material";import Pb from"@mui/icons-material/Check";import Rb from"@ehfuse/overlay-scrollbar";import{jsx as Zt,jsxs as Gs}from"react/jsx-runtime";var Vs=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function Vr({anchorEl:e,value:o,color:t="",onSelect:n,onSelectColor:r,onClose:i}){return Zt(Eb,{transitionDuration:0,open:!!e,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:Gs(pa,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[Zt(Rb,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:Zt(wr,{value:o||we,onChange:a=>{n(a),i()}})}),r?Gs(pa,{sx:{px:1.25,pb:1.25},children:[Zt(Mb,{sx:{mb:1,borderColor:"#efefed"}}),Zt(pa,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:Vs.map(a=>{let l=(t||Vs[0])===a;return Zt(Ob,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${a}`,onClick:()=>r(a),sx:{width:26,height:26,borderRadius:"50%",bgcolor:a,display:"flex",alignItems:"center",justifyContent:"center"},children:l?Zt(Pb,{sx:{fontSize:15,color:"#ffffff"}}):null},a)})})]}):null]})})}import{useState as kc}from"react";import{Box as Jn,ButtonBase as mk,Divider as Zn,Menu as uk,MenuItem as dk}from"@mui/material";import pk from"@mui/icons-material/SubjectOutlined";import fk from"@mui/icons-material/StickyNote2Outlined";import xk from"@mui/icons-material/LabelOutlined";import gk from"@mui/icons-material/DirectionsRunOutlined";import bk from"@mui/icons-material/SpeedOutlined";import{TextField as hk}from"@ehfuse/mui-form-controls";import{InfoAlert as kk}from"@ehfuse/alerts";import{useState as Nt}from"react";import{Box as tc,Divider as Zb,ListItemIcon as eh,Menu as ga,MenuItem as jn}from"@mui/material";import oh from"@mui/icons-material/Add";import Yr from"@mui/icons-material/Check";import th from"@mui/icons-material/ViewKanbanOutlined";import nh from"@mui/icons-material/CalendarTodayOutlined";import rh from"@mui/icons-material/EventOutlined";import ih from"@mui/icons-material/PersonOutlineOutlined";import Js from"@mui/icons-material/PeopleAltOutlined";import ah from"@mui/icons-material/FlagOutlined";import Zs from"@mui/icons-material/TimerOutlined";import lh from"@mui/icons-material/NotificationsNoneOutlined";import sh from"@mui/icons-material/InboxOutlined";import ch from"@mui/icons-material/PlaceOutlined";import mh from"@mui/icons-material/MapOutlined";import{DatePicker as uh,TimePicker as ec}from"@ehfuse/mui-datetime-picker";var Jo="@media (max-width: 719.95px)";function co(e){return{[Jo]:{order:e}}}import{useEffect as zb,useState as qb}from"react";import{Box as Ab}from"@mui/material";import{jsx as Lb}from"react/jsx-runtime";function bt({value:e,placeholder:o,readOnly:t,onCommit:n}){let r=ie(),[i,a]=qb(e);return zb(()=>a(e),[e]),Lb(Ab,{component:"input",spellCheck:!1,value:i,readOnly:t,placeholder:o,onChange:l=>a(l.target.value),onBlur:()=>{i.trim()!==e&&n(i.trim())},onKeyDown:l=>{l.key==="Enter"&&l.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:r.colors.textPrimary,caretColor:r.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as fa}from"@mui/material";import{jsx as Nb,jsxs as Ys}from"react/jsx-runtime";function ue({icon:e,label:o,onClick:t,sx:n,children:r}){return Ys(fa,{sx:[{display:"flex",alignItems:"center",minHeight:26,[Jo]:{minHeight:25}},...Array.isArray(n)?n:[n]],children:[Ys(fa,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,o]}),Nb(fa,{onClick:t?i=>t(i.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:t?"pointer":"default","&:hover":t?{bgcolor:"#f2f2f0"}:void 0,[Jo]:{py:.25}},children:r})]})}import{Suspense as Fb,lazy as Hb,useEffect as Wb,useState as js}from"react";import{Box as xa,Dialog as $b,DialogContent as Kb,DialogTitle as Ub,IconButton as Xs,Tooltip as Vb}from"@mui/material";import Gb from"@mui/icons-material/Close";import Yb from"@mui/icons-material/Search";import{Fragment as Jb,jsx as Fo,jsxs as Gr}from"react/jsx-runtime";function jb(e){return Fo(xa,{sx:{p:3,fontSize:14,color:"#9a9a97"},children:"\uC8FC\uC18C \uAC80\uC0C9 \uBAA8\uB4C8(react-daum-postcode)\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC785\uB825\uD574 \uC8FC\uC138\uC694."})}var Xb=Hb(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:jb})));function Qb(e){if(e.addressType!=="R")return e.address;let o="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(o+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(o+=o!==""?`, ${e.buildingName}`:e.buildingName),o!==""?`${e.address} (${o})`:e.address}function Qs({value:e,placeholder:o="\uC8FC\uC18C \uC785\uB825",readOnly:t,onCommit:n}){let[r,i]=js(e),[a,l]=js(!1),m=Bo().slots?.addressSearch;Wb(()=>i(e),[e]);let c=d=>{i(d),l(!1),d!==e&&n(d)};return Gr(Jb,{children:[Gr(xa,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[Fo(xa,{component:"input",spellCheck:!1,value:r,readOnly:t,placeholder:o,onChange:d=>i(d.target.value),onBlur:()=>{a||r.trim()!==e&&n(r.trim())},onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),!t&&l(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),t?null:Fo(Vb,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:Fo(Xs,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>l(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:Fo(Yb,{sx:{fontSize:17}})})})]}),m?Fo(m,{open:a,onComplete:c,onClose:()=>l(!1)}):Gr($b,{open:a,onClose:()=>l(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[Gr(Ub,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",Fo(Xs,{onClick:()=>l(!1),size:"small",children:Fo(Gb,{})})]}),Fo(Kb,{style:{padding:0},dividers:!0,children:a?Fo(Fb,{fallback:null,children:Fo(Xb,{onComplete:d=>{c(Qb(d))},onClose:()=>l(!1),defaultQuery:r,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as jr,jsx as G,jsxs as Ho}from"react/jsx-runtime";function dh(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function oc(e){let[o="00",t="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(o)?o:"00",minute:/^\d{2}$/.test(t)?t:"00"}}function en({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return G(tc,{component:"span",sx:{color:"#9a9a97"},children:e})}function Xr({values:e,customTabs:o,avatarSrcByName:t,showEstimatedTime:n=!1,managerLocked:r=!1,notice:i=!1,event:a=!1,readOnly:l=!1,targetSummary:m="",narrowCollapsedSx:c,reminderLocked:p=!1,managerAction:d,hideProject:s=!1,leading:u,trailing:f,onChangeProject:y,onChangeStartDate:b,onChangeDueDate:h,onChangeReminder:g,onChangePriority:B,onChangeEstimatedTime:x,onChangeEventTime:C,onChangeEventPlace:S,onChangeEventAddress:D,onMemberEdit:O,onAddProject:$}){let[E,ae]=Nt(null),[I,k]=Nt(!1),[K,N]=Nt(null),[Z,P]=Nt(null),[oe,le]=Nt(null),[L,H]=Nt(null),[J,W]=Nt(null),[M,q]=Nt(null),U=He(),te=Go(),me=R=>[co(R),...c?Array.isArray(c)?c:[c]:[]],ne=o.find(R=>R.key===e.tabKey),_e=o.filter(R=>!R.archived);return Ho(jr,{children:[Ho(tc,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",columnGap:3,rowGap:.25,px:2,[Jo]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[u,s?null:G(ue,{icon:G(th,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:l?void 0:R=>ae(R),sx:me(1),children:ne?(()=>{let R=Me(ne.icon);return Ho(jr,{children:[R?G(R,{sx:{fontSize:16,color:"#1e3a8a"}}):null,ne.label]})})():"\uAE30\uBCF8"}),i?G(ue,{icon:G(Js,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:l?void 0:()=>O("targets"),sx:co(7),children:m||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!i&&!a?G(ue,{icon:G(ih,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:r||l||!e.managerName&&d?void 0:()=>O("manager"),sx:co(7),children:e.managerName?Ho(jr,{children:[G(xo,{names:[e.managerName],size:20,avatarSrcByName:t}),e.managerName]}):d??G(en,{})}):null,a?null:G(ue,{icon:G(nh,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC790",onClick:l?void 0:R=>le(R),sx:co(2),children:e.startDate?Yo(e.startDate):G(en,{})}),i?null:G(ue,{icon:G(Js,{sx:{fontSize:17}}),label:a?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:l?void 0:()=>O("receivers"),sx:co(a?7:8),children:e.receiverNames.length>0?Ho(jr,{children:[G(xo,{names:e.receiverNames,size:20,avatarSrcByName:t}),e.receiverNames.length===1?e.receiverNames[0]:null]}):G(en,{})}),G(ue,{icon:G(rh,{sx:{fontSize:17}}),label:a?"\uB0A0\uC9DC":"\uB9C8\uAC10\uAE30\uD55C",onClick:l?void 0:R=>H(R),sx:co(3),children:e.dueDate?Yo(e.dueDate):G(en,{})}),a?G(ue,{icon:G(Zs,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:l?void 0:R=>q(R),sx:co(4),children:e.eventTime?e.eventTime:G(en,{label:"\uC885\uC77C"})}):null,a?G(ue,{icon:G(ch,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:co(5),children:G(bt,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:l,onCommit:R=>S?.(R)})}):null,n?G(ue,{icon:G(Zs,{sx:{fontSize:17}}),label:"\uC608\uC0C1\uC2DC\uAC04",onClick:l?void 0:R=>W(R),sx:me(4),children:e.estimatedTime?e.estimatedTime:G(en,{})}):null,G(ue,{icon:G(lh,{sx:{fontSize:17}}),label:"\uB9AC\uB9C8\uC778\uB354",onClick:l||p?void 0:R=>P(R),sx:me(a?8:5),children:e.reminder==="none"?G(en,{label:"\uC5C6\uC74C"}):Vi(e.reminder)}),a?G(ue,{icon:G(mh,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},co(6)],children:G(Qs,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:l,onCommit:R=>D?.(R)})}):null,a?null:G(ue,{icon:G(ah,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:l?void 0:R=>N(R),sx:me(6),children:G(zo,{priority:e.priority,small:!0})}),f]}),Ho(ga,{transitionDuration:0,anchorEl:E,open:!!E,onClose:()=>ae(null),...te,children:[Ho(jn,{selected:!e.tabKey,onClick:()=>{y(""),ae(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[G(sh,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),_e.map(R=>{let Y=Me(R.icon),Te=e.tabKey===R.key;return Ho(jn,{selected:Te,onClick:()=>{y(R.key),ae(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Y?G(Y,{sx:{fontSize:17,color:"#1e3a8a"}}):null,R.label,Te?G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.key)}),$?[G(Zb,{},"add-project-divider"),Ho(jn,{onClick:()=>k(!0),sx:{fontSize:14,color:"#787774"},children:[G(eh,{children:G(oh,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),$?G(Dr,{open:I,onClose:()=>k(!1),onSubmit:(R,Y,Te)=>{(async()=>{let _=await $(R,Y,Te);_&&y(_)})(),ae(null)}}):null,G(ga,{transitionDuration:0,anchorEl:K,open:!!K,onClose:()=>N(null),...te,children:["high","medium","low"].map(R=>Ho(jn,{selected:e.priority===R,onClick:()=>{B(R),N(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[G(zo,{priority:R,small:!0}),e.priority===R?G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R))}),G(ga,{transitionDuration:0,anchorEl:Z,open:!!Z,onClose:()=>P(null),...te,children:Ui(a&&!!e.eventTime).map(R=>Ho(jn,{selected:e.reminder===R.value,onClick:()=>{g(R.value),P(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[R.label,e.reminder===R.value?G(Yr,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.value))}),n?G(ec,{anchorEl:J,open:!!J,onClose:()=>W(null),value:oc(e.estimatedTime),format:"HH:mm",minuteStep:5,autoApply:!0,centered:U,locale:"ko",onChange:(R,Y)=>{x?.(`${R}:${Y}`),W(null)}}):null,a?G(ec,{anchorEl:M,open:!!M,onClose:()=>q(null),value:oc(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:U,locale:"ko",onChange:(R,Y)=>{C?.(`${R}:${Y}`),q(null)}}):null,G(uh,{anchorEl:oe,open:!!oe,onClose:()=>le(null),selectedDate:dh(e.startDate),centered:U,onDateChange:R=>{b(qe(R)),le(null)}}),G(Mt,{anchorEl:L,open:!!L,date:e.dueDate,reminder:e.reminder,hideReminder:p,centered:U,onClose:()=>H(null),onDateChange:h,onReminderChange:g})]})}import{useState as ph}from"react";import{Box as fh,Menu as xh,MenuItem as gh}from"@mui/material";import bh from"@mui/icons-material/RepeatOutlined";import hh from"@mui/icons-material/DevicesOutlined";import kh from"@mui/icons-material/ScreenSearchDesktopOutlined";import Th from"@mui/icons-material/SellOutlined";import yh from"@mui/icons-material/TaskAltOutlined";import{Fragment as nc,jsx as Ye,jsxs as rc}from"react/jsx-runtime";function ba({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Ye(fh,{component:"span",sx:{color:"#9a9a97"},children:e})}function Qr({values:e,readOnly:o=!1,showResolution:t=!1,onChangeRepro:n,onChangeDevice:r,onChangeWhere:i,onChangeVersion:a,onChangeResolution:l}){let[m,c]=ph(null),p=m?.field==="repro"?vi:m?.field==="device"?Ii:_i,d=s=>{m?.field==="repro"?n(s):m?.field==="device"?r(s):m?.field==="resolution"&&l?.(s),c(null)};return rc(nc,{children:[rc(nc,{children:[Ye(ue,{icon:Ye(bh,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:o?void 0:s=>c({field:"repro",el:s}),children:Tl(e.repro)||Ye(ba,{label:"\uC120\uD0DD"})}),Ye(ue,{icon:Ye(hh,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:o?void 0:s=>c({field:"device",el:s}),children:yl(e.device)||Ye(ba,{label:"\uC120\uD0DD"})}),Ye(ue,{icon:Ye(kh,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:Ye(bt,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:o,onCommit:i})}),Ye(ue,{icon:Ye(Th,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:Ye(bt,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:o,onCommit:a})}),t?Ye(ue,{icon:Ye(yh,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:o?void 0:s=>c({field:"resolution",el:s}),children:pr(e.resolution)||Ye(ba,{label:"\uC120\uD0DD"})}):null]}),Ye(xh,{open:!!m,anchorEl:m?.el??null,onClose:()=>c(null),transitionDuration:0,children:p.map(s=>Ye(gh,{onClick:()=>d(s.key),sx:{fontSize:14},children:s.name},s.key))})]})}import{Box as ic}from"@mui/material";import{jsxs as ac}from"react/jsx-runtime";function Oo({icon:e,title:o,titleExtra:t,children:n}){return ac(ic,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[ac(ic,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:14.5,fontWeight:500,color:"#37352f"},children:[e,o,t]}),n]})}import{useEffect as Sh,useRef as ha,useState as Bh}from"react";import{Box as ka,IconButton as Ch,Tooltip as vh}from"@mui/material";import Ih from"@mui/icons-material/ContentCopyOutlined";import _h from"@mui/icons-material/Check";import{EhfuseEditor as wh,minimalToolbarOptions as Dh}from"@ehfuse/editor";import{jsx as on,jsxs as Mh}from"react/jsx-runtime";function Ta(e){let o=e.trim();return o?o.startsWith("<")?e:`<p>${o}</p>`:"<p></p>"}function Oh(e){let o=e.replace(/<br\s*\/?>/gi,`
3
3
  `).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
4
4
  `),t=document.createElement("div");return t.innerHTML=o,(t.textContent??"").replace(/\n{3,}/g,`
5
5