@ehfuse/taskbox 0.5.212 → 0.5.214

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,14 +1,91 @@
1
- var Bs="waiting",kC="replied";import{createContext as dd,useContext as pd,useMemo as vs}from"react";import{Box as fd}from"@mui/material";var va="--app-mobile-font-offset";function yo(e,o=0){return`calc(${e}px + max(0px, var(${va}, 0px) - ${o}px))`}import{jsx as Cs}from"react/jsx-runtime";var Is=dd({});function xd({config:e,children:o}){let t=vs(()=>e??{},[e]),n=t.mobileFontOffsetPx;return Cs(Is.Provider,{value:t,children:n===void 0?o:Cs(fd,{sx:{display:"contents",[va]:`${n}px`},children:o})})}function Go(){return pd(Is)}function Rr(){let{buildFileUrl:e}=Go();return vs(()=>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 Pr(){let{uploadMaxMb:e}=Go();return e??50}import{useGlobalForm as ex}from"@ehfuse/forma";import _s from"@mui/icons-material/DoNotDisturbAltOutlined";import ws from"@mui/icons-material/BookmarkBorderOutlined";import gd from"@mui/icons-material/LabelOutlined";import hd from"@mui/icons-material/FlagOutlined";import bd from"@mui/icons-material/StarBorderOutlined";import kd from"@mui/icons-material/FolderOutlined";import Td from"@mui/icons-material/EventOutlined";import yd from"@mui/icons-material/BuildOutlined";import Sd from"@mui/icons-material/LocalShippingOutlined";import Bd from"@mui/icons-material/StorefrontOutlined";import Cd from"@mui/icons-material/GroupsOutlined";import vd from"@mui/icons-material/LightbulbOutlined";import Id from"@mui/icons-material/FavoriteBorderOutlined";import _d from"@mui/icons-material/AssignmentOutlined";import wd from"@mui/icons-material/HomeOutlined";import Dd from"@mui/icons-material/WorkOutline";import Md from"@mui/icons-material/SchoolOutlined";import Ed from"@mui/icons-material/LocalHospitalOutlined";import Od from"@mui/icons-material/RestaurantOutlined";import Rd from"@mui/icons-material/LocalFloristOutlined";import Pd from"@mui/icons-material/DirectionsCarOutlined";import zd from"@mui/icons-material/CampaignOutlined";import qd from"@mui/icons-material/SavingsOutlined";import Ad from"@mui/icons-material/Inventory2Outlined";import Ld from"@mui/icons-material/CleaningServicesOutlined";import Ds from"@mui/icons-material/HandymanOutlined";import Nd from"@mui/icons-material/LocalPhoneOutlined";import Fd from"@mui/icons-material/EmailOutlined";import Hd from"@mui/icons-material/ShoppingCartOutlined";import Wd from"@mui/icons-material/BarChartOutlined";import $d from"@mui/icons-material/PrintOutlined";import Vd from"@mui/icons-material/SecurityOutlined";import Kd from"@mui/icons-material/AlarmOutlined";import Ud from"@mui/icons-material/AttachFileOutlined";import Gd from"@mui/icons-material/PhotoCameraOutlined";import jd from"@mui/icons-material/ImageOutlined";import Yd from"@mui/icons-material/MenuBookOutlined";import Xd from"@mui/icons-material/EditOutlined";import Qd from"@mui/icons-material/KeyOutlined";import Zd from"@mui/icons-material/LockOutlined";import Jd from"@mui/icons-material/LockOpenOutlined";import ep from"@mui/icons-material/SettingsOutlined";import op from"@mui/icons-material/CloudOutlined";import tp from"@mui/icons-material/WifiOutlined";import np from"@mui/icons-material/ComputerOutlined";import rp from"@mui/icons-material/SmartphoneOutlined";import ip from"@mui/icons-material/TvOutlined";import ap from"@mui/icons-material/AccessTimeOutlined";import lp from"@mui/icons-material/TimerOutlined";import sp from"@mui/icons-material/MapOutlined";import cp from"@mui/icons-material/PlaceOutlined";import mp from"@mui/icons-material/NavigationOutlined";import up from"@mui/icons-material/FlightOutlined";import dp from"@mui/icons-material/TrainOutlined";import pp from"@mui/icons-material/DirectionsBusOutlined";import fp from"@mui/icons-material/DirectionsBikeOutlined";import xp from"@mui/icons-material/DirectionsWalkOutlined";import gp from"@mui/icons-material/DirectionsRunOutlined";import hp from"@mui/icons-material/FitnessCenterOutlined";import bp from"@mui/icons-material/SportsSoccerOutlined";import kp from"@mui/icons-material/EmojiEventsOutlined";import Tp from"@mui/icons-material/CardGiftcardOutlined";import yp from"@mui/icons-material/CakeOutlined";import Ms from"@mui/icons-material/CoffeeOutlined";import Sp from"@mui/icons-material/LocalPizzaOutlined";import Bp from"@mui/icons-material/ShoppingBagOutlined";import Es from"@mui/icons-material/CreditCardOutlined";import Cp from"@mui/icons-material/AccountBalanceOutlined";import vp from"@mui/icons-material/AccountBalanceWalletOutlined";import Ip from"@mui/icons-material/AttachMoneyOutlined";import _p from"@mui/icons-material/ReceiptLongOutlined";import wp from"@mui/icons-material/CalculateOutlined";import Dp from"@mui/icons-material/TrendingUpOutlined";import Mp from"@mui/icons-material/ListAltOutlined";import Ep from"@mui/icons-material/TaskAltOutlined";import Op from"@mui/icons-material/DoneAllOutlined";import Rp from"@mui/icons-material/WarningAmberOutlined";import Pp from"@mui/icons-material/InfoOutlined";import zp from"@mui/icons-material/HelpOutlined";import qp from"@mui/icons-material/SupportAgentOutlined";import Ap from"@mui/icons-material/PersonOutlined";import Lp from"@mui/icons-material/PersonAddOutlined";import Np from"@mui/icons-material/BadgeOutlined";import Fp from"@mui/icons-material/WbSunnyOutlined";import Hp from"@mui/icons-material/DarkModeOutlined";import Wp from"@mui/icons-material/LocalFireDepartmentOutlined";import $p from"@mui/icons-material/WaterDropOutlined";import Vp from"@mui/icons-material/BoltOutlined";import Kp from"@mui/icons-material/AutorenewOutlined";import Up from"@mui/icons-material/ScienceOutlined";import Gp from"@mui/icons-material/MedicalServicesOutlined";import jp from"@mui/icons-material/NotificationsOutlined";import Yp from"@mui/icons-material/SendOutlined";import Xp from"@mui/icons-material/LinkOutlined";import Qp from"@mui/icons-material/PublicOutlined";import Os from"@mui/icons-material/ApartmentOutlined";import Zp from"@mui/icons-material/PlumbingOutlined";import Jp from"@mui/icons-material/ElectricalServicesOutlined";import ef from"@mui/icons-material/ChatOutlined";import of from"@mui/icons-material/DescriptionOutlined";import tf from"@mui/icons-material/FactCheckOutlined";import nf from"@mui/icons-material/RocketLaunchOutlined";import rf from"@mui/icons-material/PaletteOutlined";import af from"@mui/icons-material/MusicNoteOutlined";import lf from"@mui/icons-material/VideocamOutlined";import sf from"@mui/icons-material/ThumbUpOutlined";import cf from"@mui/icons-material/PushPinOutlined";import mf from"@mui/icons-material/SearchOutlined";import uf from"@mui/icons-material/VisibilityOutlined";import df from"@mui/icons-material/VerifiedOutlined";import pf from"@mui/icons-material/TrackChangesOutlined";import ff from"@mui/icons-material/ExtensionOutlined";import xf from"@mui/icons-material/CodeOutlined";import gf from"@mui/icons-material/BugReportOutlined";import hf from"@mui/icons-material/SmartToyOutlined";import bf from"@mui/icons-material/StorageOutlined";import kf from"@mui/icons-material/QrCode2Outlined";import Tf from"@mui/icons-material/FileDownloadOutlined";import yf from"@mui/icons-material/FileUploadOutlined";import Sf from"@mui/icons-material/MicOutlined";import Bf from"@mui/icons-material/HeadphonesOutlined";import Cf from"@mui/icons-material/MovieOutlined";import vf from"@mui/icons-material/SportsEsportsOutlined";import If from"@mui/icons-material/BrushOutlined";import _f from"@mui/icons-material/ArchitectureOutlined";import wf from"@mui/icons-material/EngineeringOutlined";import Df from"@mui/icons-material/FactoryOutlined";import Mf from"@mui/icons-material/AgricultureOutlined";import Ef from"@mui/icons-material/DirectionsBoatOutlined";import Of from"@mui/icons-material/TwoWheelerOutlined";import Rf from"@mui/icons-material/HandshakeOutlined";import Pf from"@mui/icons-material/GavelOutlined";import zf from"@mui/icons-material/BalanceOutlined";import qf from"@mui/icons-material/TranslateOutlined";import Af from"@mui/icons-material/PsychologyOutlined";import Lf from"@mui/icons-material/PetsOutlined";import Nf from"@mui/icons-material/CelebrationOutlined";import Ff from"@mui/icons-material/BeachAccessOutlined";import Hf from"@mui/icons-material/AcUnitOutlined";import Wf from"@mui/icons-material/ForestOutlined";import $f from"@mui/icons-material/LandscapeOutlined";import Vf from"@mui/icons-material/HotelOutlined";import Kf from"@mui/icons-material/LocalLaundryServiceOutlined";import Uf from"@mui/icons-material/ChairOutlined";import Gf from"@mui/icons-material/LocalBarOutlined";import jf from"@mui/icons-material/LunchDiningOutlined";import Yf from"@mui/icons-material/IcecreamOutlined";import Xf from"@mui/icons-material/WorkspacePremiumOutlined";import Qf from"@mui/icons-material/DiamondOutlined";import Zf from"@mui/icons-material/VaccinesOutlined";var Ia="bookmark",Wt="label",no="notifications",fo="event",zr="warning",qr="#e53e3e",Rs="none",_a=[{key:Rs,Icon:_s},{key:"label",Icon:gd},{key:"bookmark",Icon:ws},{key:"flag",Icon:hd},{key:"star",Icon:bd},{key:"folder",Icon:kd},{key:"event",Icon:Td},{key:"build",Icon:yd},{key:"shipping",Icon:Sd},{key:"store",Icon:Bd},{key:"groups",Icon:Cd},{key:"idea",Icon:vd},{key:"heart",Icon:Id},{key:"assignment",Icon:_d},{key:"home",Icon:wd},{key:"work",Icon:Dd},{key:"school",Icon:Md},{key:"hospital",Icon:Ed},{key:"restaurant",Icon:Od},{key:"flower",Icon:Rd},{key:"car",Icon:Pd},{key:"campaign",Icon:zd},{key:"savings",Icon:qd},{key:"inventory",Icon:Ad},{key:"cleaning",Icon:Ld},{key:"handyman",Icon:Ds},{key:"phone",Icon:Nd},{key:"email",Icon:Fd},{key:"cart",Icon:Hd},{key:"chart",Icon:Wd},{key:"print",Icon:$d},{key:"security",Icon:Vd},{key:"alarm",Icon:Kd},{key:"attach",Icon:Ud},{key:"camera",Icon:Gd},{key:"image",Icon:jd},{key:"book",Icon:Yd},{key:"edit",Icon:Xd},{key:"key",Icon:Qd},{key:"lock",Icon:Zd},{key:"unlock",Icon:Jd},{key:"settings",Icon:ep},{key:"cloud",Icon:op},{key:"wifi",Icon:tp},{key:"computer",Icon:np},{key:"smartphone",Icon:rp},{key:"tv",Icon:ip},{key:"clock",Icon:ap},{key:"timer",Icon:lp},{key:"map",Icon:sp},{key:"place",Icon:cp},{key:"navigation",Icon:mp},{key:"flight",Icon:up},{key:"train",Icon:dp},{key:"bus",Icon:pp},{key:"bike",Icon:fp},{key:"walk",Icon:xp},{key:"run",Icon:gp},{key:"fitness",Icon:hp},{key:"soccer",Icon:bp},{key:"trophy",Icon:kp},{key:"gift",Icon:Tp},{key:"cake",Icon:yp},{key:"coffee",Icon:Ms},{key:"pizza",Icon:Sp},{key:"bag",Icon:Bp},{key:"card",Icon:Es},{key:"bank",Icon:Cp},{key:"wallet",Icon:vp},{key:"money",Icon:Ip},{key:"receipt",Icon:_p},{key:"calculate",Icon:wp},{key:"trending",Icon:Dp},{key:"listalt",Icon:Mp},{key:"task",Icon:Ep},{key:"doneall",Icon:Op},{key:"warning",Icon:Rp},{key:"info",Icon:Pp},{key:"help",Icon:zp},{key:"support",Icon:qp},{key:"person",Icon:Ap},{key:"personadd",Icon:Lp},{key:"badge",Icon:Np},{key:"sun",Icon:Fp},{key:"moon",Icon:Hp},{key:"fire",Icon:Wp},{key:"water",Icon:$p},{key:"bolt",Icon:Vp},{key:"renew",Icon:Kp},{key:"science",Icon:Up},{key:"medical",Icon:Gp},{key:"notifications",Icon:jp},{key:"send",Icon:Yp},{key:"link",Icon:Xp},{key:"public",Icon:Qp},{key:"apartment",Icon:Os},{key:"plumbing",Icon:Zp},{key:"electrical",Icon:Jp},{key:"chat",Icon:ef},{key:"description",Icon:of},{key:"factcheck",Icon:tf},{key:"rocket",Icon:nf},{key:"palette",Icon:rf},{key:"music",Icon:af},{key:"video",Icon:lf},{key:"thumbup",Icon:sf},{key:"pin",Icon:cf},{key:"search",Icon:mf},{key:"eye",Icon:uf},{key:"verified",Icon:df},{key:"target",Icon:pf},{key:"extension",Icon:ff},{key:"code",Icon:xf},{key:"bug",Icon:gf},{key:"robot",Icon:hf},{key:"storage",Icon:bf},{key:"qrcode",Icon:kf},{key:"download",Icon:Tf},{key:"upload",Icon:yf},{key:"mic",Icon:Sf},{key:"headphones",Icon:Bf},{key:"movie",Icon:Cf},{key:"game",Icon:vf},{key:"brush",Icon:If},{key:"architecture",Icon:_f},{key:"engineering",Icon:wf},{key:"factory",Icon:Df},{key:"agriculture",Icon:Mf},{key:"boat",Icon:Ef},{key:"motorcycle",Icon:Of},{key:"handshake",Icon:Rf},{key:"gavel",Icon:Pf},{key:"balance",Icon:zf},{key:"translate",Icon:qf},{key:"psychology",Icon:Af},{key:"pets",Icon:Lf},{key:"celebration",Icon:Nf},{key:"beach",Icon:Ff},{key:"snow",Icon:Hf},{key:"forest",Icon:Wf},{key:"mountain",Icon:$f},{key:"hotel",Icon:Vf},{key:"laundry",Icon:Kf},{key:"chair",Icon:Uf},{key:"bar",Icon:Gf},{key:"burger",Icon:jf},{key:"icecream",Icon:Yf},{key:"medal",Icon:Xf},{key:"diamond",Icon:Qf},{key:"vaccine",Icon:Zf}],Jf={cafe:Ms,payment:Es,business:Os,construction:Ds};function Ce(e){return e===Rs?null:_a.find(o=>o.key===e)?.Icon??Jf[String(e??"")]??ws}function xI(e){return Ce(e)??_s}var wa={title:"",icon:Wt,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,visibility:"involved",visibility_group_seq:0,repeat_rule:"",repeat_until:"",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:""},Da={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function ox(e){let{formId:o="taskbox-create-form",initialValues:t,onValidate:n,onSubmit:r}=e;return ex({formId:o,initialValues:{...wa,...t},onValidate:n,onSubmit:r})}import{useGlobalFormaState as tx}from"@ehfuse/forma";var Ps="taskbox-ui-state";function $t(){return tx({stateId:Ps,initialValues:Da})}import{useMemo as nx}from"react";import{useTheme as rx}from"@mui/material";function ir(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(p=>p+p).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 zs(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)),p=i(Number.parseInt(r.slice(4,6),16));return`#${[a,l,p].map(c=>c.toString(16).padStart(2,"0")).join("")}`}function Ma(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",surfaceHoverStrong:"#323a45",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:"#f8f8f7",surfaceHoverStrong:"#efefed",border:"#e6e6e3",borderStrong:"#dedddb"}}function ix(e,o){let t=o==="dark";return{bg:t?zs(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 qs(e,o){return{...e,...o??{}}}function pi(e,o="light"){let t=o==="dark",n=ix(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.surfaceHoverStrong,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 Ea(e,o){if(!o)return e;let t=o.mode??e.mode,r={...t===e.mode?e.colors:Ma(e.colors.accent,e.colors.accentContrast,t),...o.colors??{}},i=pi(r,t),{groupHeader:a,...l}=o.table??{},{badge:p,...c}=o.board??{},{badge:m,...d}=a??{};return{mode:t,colors:r,table:{...i.table,...l,groupHeader:{...i.table.groupHeader,...d,badge:qs(i.table.groupHeader.badge,m)}},board:{...i.board,...c,badge:qs(i.board.badge,p)},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 ax(e={}){let{mode:o="light",accent:t="#2563eb",accentContrast:n="#ffffff",input:r}=e;return Ea(pi(Ma(t,n,o),o),r)}function se(){let e=rx(),{theme:o}=Go(),t=e.palette.primary.main,n=e.palette.primary.contrastText,r=e.palette.mode==="dark"?"dark":"light";return nx(()=>Ea(pi(Ma(t,n,r),r),o),[t,n,r,o])}import{useCallback as Ut,useEffect as Ei,useMemo as vt,useRef as Fg,useState as Gt}from"react";import{Box as Lo,Divider as Hg,IconButton as Wg,ListItemIcon as $g,Menu as hc,MenuItem as Oi}from"@mui/material";import bc from"@mui/icons-material/Add";import Vg from"@mui/icons-material/ArrowUpward";import Kg from"@mui/icons-material/ArrowDownward";import Ug from"@mui/icons-material/KeyboardArrowDown";import Gg from"@mui/icons-material/KeyboardArrowRight";import tl from"@mui/icons-material/Check";import jg from"@mui/icons-material/FilterList";import Yg from"@mui/icons-material/InboxOutlined";import{Virtuoso as Xg}from"react-virtuoso";import Qg from"@ehfuse/overlay-scrollbar";import{Box as As}from"@mui/material";import{jsx as sx,jsxs as cx}from"react/jsx-runtime";var lx={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 jo({priority:e,small:o=!1,plain:t=!1}){let n=lx[e],r=se(),i=r.mode==="dark",a=t||e==="low";return cx(As,{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?ir(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:[sx(As,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:n.dot}}),n.label]})}import{Menu as fx,MenuItem as xx}from"@mui/material";import gx from"@mui/icons-material/Check";function St(){return{}}var Oa=[{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"}],Ra=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],Pa=[{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 Ls(e){return Oa.find(o=>o.key===e)?.name??""}function Ns(e){return Ra.find(o=>o.key===e)?.name??""}function fi(e){return Pa.find(o=>o.key===e)?.name??""}function za(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 xi(e,o=new Date){return e.is_event?za(e,o):!!e.completed}var Pn=[{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"}],Lr=Pn;function gi(e){return Pn.find(o=>o.key===e)??Pn[0]}var qa={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function vo(e){if(e.is_notice)return Fs(e.status);if(e.is_bug&&e.completed){let o=fi(e.resolution)||"\uC644\uB8CC";return{...qa,name:o}}return e.completed&&e.status!=="hold"?qa:e.is_bug?ux(e.status):gi(e.status)}var mx={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function Nr(e){return za(e)?mx:null}var Ar=[{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 Fs(e){return Ar.find(o=>o.key===e)??Ar[1]}var Aa="__closed__",zn=[{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"}],$I=[...zn.filter(e=>e.key!=="bug_hold"),{key:Aa,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...zn.filter(e=>e.key==="bug_hold")];function ux(e){return zn.find(o=>o.key===e)??zn[0]}function hi(e){return e.is_notice?Ar:e.is_bug?zn:Lr}function VI(e){return e.status===Bs}var dx={in_progress:0,not_started:2,hold:3};function KI(e){return e.completed?9:dx[String(e.status??"")]??2}function ar(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=Nr({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:[Fs(e.status),...n]:e.is_bug?[vo({...e,is_notice:!1}),...n]:e.completed?[qa,...n]:[gi(e.status),...n]}function Hs(e){return{bg:`${e}1f`,fg:e,dot:e}}function bi(e,o){return e.includes(o)?e.filter(t=>t!==o):[...e,o]}import{Box as ki}from"@mui/material";import{jsx as Fr,jsxs as px}from"react/jsx-runtime";function Ae({option:e,small:o=!1}){let t=se(),n=t.mode==="dark",r=e.key==="not_started";return px(ki,{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?ir(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:[Fr(ki,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function QI({task:e,statusOptions:o,small:t=!1}){let n=ar(e,o);return n.length===0?null:Fr(ki,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Fr(Ae,{option:r,small:t},r.key))})}function hn({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:Fr(ki,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Fr(Ae,{option:r,small:!0},r.key))})}import{jsx as La,jsxs as hx}from"react/jsx-runtime";function lr({anchorEl:e,value:o,options:t=Pn,onSelect:n,onClose:r}){let i=St();return La(fx,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,...i,children:t.map(a=>hx(xx,{onClick:()=>{n(a.key),r()},sx:{fontSize:14,minWidth:150,gap:1},children:[La(Ae,{option:a}),o===a.key?La(gx,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},a.key))})}function Na(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 xo(e,o="YYYY-MM-DD"){let t=typeof e=="string"?Na(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)}}function Ws(){return xo(new Date)}var Fa=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uC77C\uC2DC"},{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 bx(e){let o=new Date(`${e}T00:00:00`);return o.setDate(o.getDate()+(6-o.getDay())),xo(o)}var kx=[{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 Tx(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 Ha(e,o,t,n=[],r=[],i="",a){let l=e.filter(u=>u.is_notice);if(l.length>0){let u=Ha(e.filter(s=>!s.is_notice),o,t,n,r,i,a);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:l},...u]}let p=new Map,c=(u,s)=>{let g=p.get(u);g?g.push(s):p.set(u,[s])},m;if(o==="due"){let u=bx(t);for(let s of e)c(Tx(s,t,u),s);m=kx}else if(o==="status"){for(let u of e)c(gi(u.status).key,u);m=Pn.map(u=>({key:u.key,label:u.name}))}else if(o==="tab"){for(let u of e)c(u.tab_key?.trim()||"__none__",u);m=[...n.filter(u=>!u.archived).map(u=>({key:u.key,label:u.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...n.filter(u=>u.archived).map(u=>({key:u.key,label:`${u.label} (\uBCF4\uAD00\uB428)`}))]}else if(a?.enabled){let u=Number(a.myAccountSeq??0),s=i.trim();for(let g of e){if(!(Number(g.manager_account_seq??0)>0||String(g.manager_name??"").trim()!=="")){c("__none__",g);continue}let S=u>0&&Number(g.manager_account_seq??0)===u||!!s&&String(g.manager_name??"").trim()===s;c(S?"__manager__":"__reference__",g)}m=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let S of e)c(String(S.manager_name??"").trim()||"__none__",S);let u=i.trim(),s=[...p.keys()].filter(S=>S!=="__none__").sort((S,b)=>{if(u){if(S===u)return-1;if(b===u)return 1}return S.localeCompare(b)}),g=!!u&&s.includes(u),T=s.filter(S=>S!==u);m=[...g?[{key:u,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...T.map(S=>({key:S,label:S}))]}let d=[];for(let u of m){let s=p.get(u.key);!s||s.length===0||d.push({key:u.key,label:u.label,tasks:s})}return d}import yx from"@mui/icons-material/NotesOutlined";import Sx from"@mui/icons-material/AutorenewOutlined";import Bx from"@mui/icons-material/CalendarTodayOutlined";import Cx from"@mui/icons-material/EventOutlined";import vx from"@mui/icons-material/PersonOutlineOutlined";import Vs from"@mui/icons-material/PeopleAltOutlined";import Va from"@mui/icons-material/CheckCircleOutlineOutlined";import Ix from"@mui/icons-material/FlagOutlined";import _x from"@mui/icons-material/AccessTimeOutlined";import wx from"@mui/icons-material/StickyNote2Outlined";import Dx from"@mui/icons-material/ViewKanbanOutlined";import Mx from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as qo}from"react/jsx-runtime";var Ex={completed:"50px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"132px",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 Ks(e){return Ka(e).map(o=>Ex[o.id]).join(" ")}var Ox={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:qo(_x,{sx:{fontSize:15}}),align:"center",sortable:!0},Rx={id:"ticket_no",label:"\uD2F0\uCF13",icon:qo(Mx,{sx:{fontSize:15}}),align:"center"},Px={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:qo(Dx,{sx:{fontSize:15}}),projectFilter:!0},zx={id:"targets",label:"\uB300\uC0C1\uC790",icon:qo(Vs,{sx:{fontSize:15}})},$s={id:"priority",label:"\uC911\uC694\uB3C4",icon:qo(Ix,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},qx={id:"ack",label:"\uD655\uC778",icon:qo(Va,{sx:{fontSize:15}}),align:"center",ackFilter:!0},Ax={id:"confirm",label:"\uD655\uC778",icon:qo(Va,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function Wa(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,$s]:[...e.slice(0,t),$s,...e.slice(t)]}function Ka(e){let{showProject:o=!1,showManager:t=!0,showActions:n=!0,showRequest:r=!0,notice:i=!1,bug:a=!1,confirmMode:l="none"}=e??{},p=d=>{if(!a)return d;let u=d.filter(T=>T.id!=="note"),s=u.findIndex(T=>T.id==="completed"),g=s>=0?s+1:0;return[...u.slice(0,g),Rx,...u.slice(g)]};if(i)return p(Wa($a.filter(d=>!["manager_name","receiver_names","request"].includes(d.id)).flatMap(d=>d.id==="due_date"?[d,zx]:d.id==="note"?[qx,d]:[d])));let c=t?$a:$a.filter(d=>d.id!=="manager_name");if(n)r||(c=c.filter(d=>d.id!=="request"));else{c=c.filter(u=>u.id!=="request");let d=c.findIndex(u=>u.id==="note");c=[...c.slice(0,d),Ox,...c.slice(d)]}if(l==="action"){let d=c.findIndex(u=>u.id==="note");c=[...c.slice(0,d),Ax,...c.slice(d)]}if(!o)return p(Wa(c));let m=c.findIndex(d=>d.id==="receiver_names");return p(Wa([...c.slice(0,m+1),Px,...c.slice(m+1)]))}var $a=[{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:qo(yx,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:qo(Sx,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC",icon:qo(Bx,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC",icon:qo(Cx,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:qo(vx,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:qo(Vs,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:qo(Va,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:qo(wx,{sx:{fontSize:15}})}];import{Button as Us,ClickAwayListener as Fx,Dialog as Hx,Paper as Wx,Popper as $x,Typography as Vx,Box as Kx}from"@mui/material";import{useMediaQuery as Lx,useTheme as Nx}from"@mui/material";function Re(){let{isMobile:e}=Go(),o=Nx(),t=Lx(o.breakpoints.up("lg"));return e!==void 0?e:!t}import{Fragment as Gx,jsx as bn,jsxs as js}from"react/jsx-runtime";function Gs(){if(typeof document>"u")return;let e=0,o=n=>{n.stopPropagation(),n.preventDefault(),t()},t=()=>{window.clearTimeout(e),document.removeEventListener("click",o,!0)};document.addEventListener("click",o,!0),e=window.setTimeout(t,350)}function Ux({title:e,content:o,confirmText:t,cancelText:n,titleFontSize:r,actionFontSize:i,actionMinHeight:a,onCancel:l,onConfirm:p}){return js(Gx,{children:[bn(Vx,{component:"div",sx:{fontSize:r,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),o,js(Kx,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[bn(Us,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{Gs(),l()},fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:n}),bn(Us,{size:"medium",variant:"contained",color:"primary",onClick:()=>{Gs(),p()},fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:t})]})]})}function Pe({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:p,titleFontSize:c=17,actionFontSize:m=16,actionMinHeight:d=44,zIndex:u=1300,onCancel:s,onConfirm:g}){let T=Re(),S=bn(Ux,{title:t,content:n,confirmText:r,cancelText:i,titleFontSize:c,actionFontSize:m,actionMinHeight:d,onCancel:s,onConfirm:g});return T?bn(Hx,{open:e,onClose:s,sx:{zIndex:u},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:S}):bn($x,{open:e,anchorEl:o,placement:a,sx:{zIndex:u},children:bn(Fx,{onClickAway:s,children:bn(Wx,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:l,minHeight:p,justifyContent:p?"space-between":"flex-start"},onClick:b=>b.stopPropagation(),onMouseDown:b=>b.stopPropagation(),children:S})})})}import{memo as hg}from"react";function st(e){let o=e.visibility;return o==="involved"||o==="group"||o==="all"?o:e.is_open?"all":"involved"}function Ti(e,o,t=0){if(o<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===o)return!0;let i=(e.target_account_seqs??[]).filter(a=>a>0);return i.length===0||i.includes(o)}if((e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o))return!0;let r=st(e);if(r==="all")return!0;if(r==="group"){let i=e.visibility_group_seq??0;return i>0&&t===i}return!1}function Ys(e){return e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)!==0?!1:st(e)!=="involved"}function yi(e,o){return o<=0||(e.author_account_seq??0)===o?!1:Ys(e)}function Si(e,o){return o<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||(e.author_account_seq??0)===o||Ys(e)?!1:(e.receiver_account_seqs??[]).includes(o)}function Xs(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function Qs(e,o){if(o<=0)return!1;let t=(e.author_account_seq??0)===o;return e.is_notice?t:t||(e.manager_account_seq??0)===o}function Vt(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 O_=[119,121,141,143];import{memo as lg,useEffect as sg,useRef as cg,useState as ic}from"react";import{Box as _e,Button as mg,Checkbox as ug,Tooltip as _i}from"@mui/material";import dg from"@mui/icons-material/PublicOutlined";import pg from"@mui/icons-material/Group";import fg from"@mui/icons-material/CheckCircle";import xg from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as jx,useState as Zs}from"react";import{Avatar as Js,Box as Yx}from"@mui/material";import Xx from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Bi}from"react/jsx-runtime";var Ua=new Set,ec=e=>e.startsWith("data:")||e.startsWith("blob:");function Qx(e){let o=e.trim();return o?([...o][0]??"").toUpperCase():""}function Jo({src:e,name:o="",avatarSx:t,iconFontSize:n=40}){let[r,i]=Zs(()=>e?ec(e)||Ua.has(e):!1),[a,l]=Zs(!1),p={position:"relative",overflow:"hidden",borderRadius:"15px"},c=t?[p,...Array.isArray(t)?t:[t]]:p;if(jx(()=>{l(!1),i(e?ec(e)||Ua.has(e):!1)},[e]),!e||a){let m=Qx(o);return Bi(Js,{sx:c,children:m?Bi(Yx,{component:"span",sx:{fontSize:"inherit",fontWeight:600,lineHeight:1,userSelect:"none"},children:m}):Bi(Xx,{sx:{fontSize:n}})})}return Bi(Js,{src:e,imgProps:{onLoad:()=>{Ua.add(e),i(!0)},onError:()=>l(!0),style:r?void 0:{opacity:0}},sx:c})}var Zx=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ci=(e,o)=>{if(!o||!o.trim())return[{text:e,highlight:!1}];try{let t=Zx(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 Jx=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function et(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("-",".")} (${Jx[t.getDay()]})`}function Yo(e){let o=String(e??"").trim(),[t,n=""]=o.split(" "),r=et(t);return r?n?`${r} ${n.slice(0,5)}`:r:""}function sr(e){let o=e.checklist??[];return o.length===0?"":`${o.filter(n=>n.checked).length}/${o.length}`}import{Box as oc,Tooltip as eg}from"@mui/material";import{jsx as vi}from"react/jsx-runtime";var cr=[{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 Ao({names:e,size:o=22,ringFirst:t=!1,avatarSrcByName:n}){let r=se();return vi(oc,{sx:{display:"flex",alignItems:"center"},children:e.map((i,a)=>{let l=t&&a===0;return vi(eg,{title:l?`\uCC45\uC784\uC790 \xB7 ${i}`:i,arrow:!0,children:vi(oc,{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:vi(Jo,{src:n?.get(i)??"",name:i,avatarSx:{width:o,height:o,fontSize:Math.round(o/2),borderRadius:"50%",...cr[a%cr.length]},iconFontSize:Math.round(o*.6)})})},`${i}-${a}`)})})}import{Box as tc,Button as rc}from"@mui/material";import og from"@mui/icons-material/CheckCircle";import{Fragment as rg,jsx as Hr,jsxs as nc}from"react/jsx-runtime";function tg(e){let o=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,gap:.5,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 ng(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 Bt({onClick:e,children:o,fullWidth:t=!1,sx:n}){let r=se();return Hr(rc,{size:"small",variant:"contained",color:"inherit",fullWidth:t,sx:[ng(r),...Array.isArray(n)?n:n?[n]:[]],onClick:i=>{i.stopPropagation(),e(i)},children:o})}function mr({canConfirm:e,count:o,total:t,myConfirmed:n=!1,onConfirm:r,onShowList:i}){let a=se(),l=tg(a);return e?Hr(Bt,{onClick:()=>r(),children:"\uD655\uC778"}):nc(rc,{size:"small",variant:"outlined",color:"inherit",sx:l,onClick:p=>{p.stopPropagation(),i(p.currentTarget)},children:[n?Hr(og,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,Hr(tc,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:t>0&&o>=t?"\uD655\uC778\uC644\uB8CC":nc(rg,{children:[o,Hr(tc,{component:"span",sx:{mx:.15},children:"/"}),t]})})]})}import{SvgIcon as ig}from"@mui/material";import{jsx as Ii,jsxs as ag}from"react/jsx-runtime";function kn({sx:e,...o}){return ag(ig,{viewBox:"0 0 48 48",...o,sx:{fill:"none",...e},children:[Ii("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"}),Ii("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Ii("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Ii("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as sc,jsx as J,jsxs as Wr}from"react/jsx-runtime";function Ga(e){let o=String(e??"").trim();if(!o)return"-";let t=o.slice(2,10).replaceAll("-","."),n=o.slice(11,16);return/^\d{2}:\d{2}$/.test(n)?`${t} ${n}`:t}function gg(e){let o=String(e.event_time??"").trim();return e.is_event&&/^\d{2}:\d{2}$/.test(o)?Ga(`${String(e.due_date??"").slice(0,10)} ${o}`):Ga(e.due_date)}function ja(e,o){let t=String(e??"").trim()||"-";return Ci(t,o).map((n,r)=>J("span",{className:n.highlight?"font-semibold text-blue-600":void 0,children:n.text},`${n.text}-${r}`))}function wi({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 Wr(sc,{children:[J(Jo,{src:t?.get(i)??"",name:i,avatarSx:{width:24,height:24,fontSize:12,borderRadius:"50%",...cr[0]},iconFontSize:15}),J(_e,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{fontWeight:500,color:"#2f80ed"}:{}},children:ja(i,o)})]})}return J(Ao,{names:r,size:22,avatarSrcByName:t})}function ac({display:e,summary:o,searchText:t,avatarSrcByName:n}){if(!e||e.kind==="everyone")return J(_e,{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 J(wi,{names:i,searchText:t,avatarSrcByName:n});let a=[...r,...i],l=a.join(", ");return a.length>2?J(_i,{title:l,arrow:!0,children:J(_e,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${a[0]}, ${a[1]} \uC678 ${a.length-2}\uBA85`})}):J(_i,{title:l,arrow:!0,children:Wr(_e,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[J(_e,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.join(", ")+(i.length>0?",":"")}),i.length>0?J(wi,{names:i,searchText:t,avatarSrcByName:n}):null]})})}var lc=lg(function({task:o,gridTemplate:t,statusOptions:n,avatarSrcByName:r,searchText:i,myAccountSeq:a=0,todayStr:l,showProject:p=!1,showManager:c=!0,showActions:m=!0,showRequest:d=!0,confirmMode:u="none",bugMode:s=!1,confirmInfo:g,onConfirmTask:T,projectLabel:S="",projectIcon:b="",onProjectClick:f,onRequestToggleCompleted:D,onDateClick:B,onChangeNote:R,onMemberClick:y,onClaimClick:I,onVolunteerClick:P,onStatusClick:_,onOpenDetail:v,onTaskContextMenu:$,hideBottomBorder:h=!1,completeLocked:x=!1,unread:C=!1,notice:L=!1,noticeReadOnly:N=!1,noteLocked:k=!1,targetSummary:w="",targetDisplay:G,onArchiveTask:ae,ackInfo:ie,onAckConfirm:be,onAckListClick:W,onPriorityClick:U}){let[de,Be]=ic(!1),[ve,j]=ic(""),F=cg(null);sg(()=>{if(!de)return;let K=uo=>{let Zo=F.current;Zo&&(uo.target instanceof Node&&Zo.contains(uo.target)||Zo.blur())};return document.addEventListener("mousedown",K,!0),document.addEventListener("touchstart",K,!0),()=>{document.removeEventListener("mousedown",K,!0),document.removeEventListener("touchstart",K,!0)}},[de]);let oe=[o.manager_account_seq??0,...o.receiver_account_seqs??[]].some(K=>K>0&&K!==(o.author_account_seq??0)),A=N,V=a>0&&!o.is_notice&&!o.is_event&&(o.manager_account_seq??0)===a,te=A||!!o.is_notice,z=se(),me=!!I&&yi(o,a),ke=!!P&&Si(o,a),He=te&&!Xs(o),Xe=o.is_notice?J(mr,{canConfirm:!!ie?.canAck,count:ie?.count??0,total:ie?.total??0,myConfirmed:!!ie?.acked,onConfirm:()=>be?.(o),onShowList:K=>W?.(o,K)}):null,we=!o.is_notice&&!o.completed&&!!o.due_date&&o.due_date.slice(0,10)<=l,to=sr(o),X=o.completed?z.colors.textPrimary:we?"#e5484d":"#2f80ed";return Wr(_e,{onContextMenu:K=>$(o,K),sx:{display:"grid",gridTemplateColumns:t,minHeight:48,position:"relative",fontSize:15,bgcolor:z.table.rowBg,color:z.table.rowColor,borderBottom:h?"none":`1px solid ${z.table.rowBorderColor}`,"&:hover":{bgcolor:z.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${z.table.rowBorderColor}`},"& > .cell:first-of-type":{px:1.5},"& > .cell:last-of-type":{borderRight:"none",pr:2}},children:[J(_e,{className:"cell",sx:{justifyContent:"center"},children:o.is_event?(()=>{let K=Ce(o.icon||fo);return K?J(K,{sx:{fontSize:19,color:o.icon_color||"#1e3a8a"}}):null})():!A&&!x?J(_i,{title:o.completed&&o.completed_by?`${o.completed_by} \xB7 ${Yo(o.completed_time)} \uC644\uB8CC`:o.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:J(ug,{checked:o.completed,icon:J(xg,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:J(fg,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:K=>K.stopPropagation(),onChange:(K,uo)=>D({anchorEl:K.currentTarget,task:o,nextCompleted:uo}),sx:{p:.5}})}):null}),s?J(_e,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:o.ticket_no||"-"}):null,Wr(_e,{className:"cell",onClick:()=>v(o),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}},children:[(()=>{if(!o.is_notice)return null;let K=Ce(o.icon||no);return K?J(K,{sx:{fontSize:18,flexShrink:0,color:o.icon_color||"#e5484d"}}):null})(),(()=>{if(o.is_notice)return null;let K=st(o);return K==="involved"?null:J(_i,{title:K==="all"?"\uC804\uCCB4\uACF5\uAC1C \u2014 \uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4":"\uBD80\uC11C\uACF5\uAC1C \u2014 \uC9C0\uC815\uD55C \uBD80\uC11C\uC758 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",arrow:!0,disableInteractive:!0,children:K==="all"?J(dg,{sx:{fontSize:15,flexShrink:0,color:"#2f80ed"}}):J(pg,{sx:{fontSize:15,flexShrink:0,color:"#d9730d"}})})})(),J(_e,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:o.completed?400:z.table.rowTitleFontWeight,color:o.completed?z.colors.textMuted:z.table.rowTitleColor,textDecoration:o.completed?"line-through":"none"},children:ja(o.title,i)}),to?J(_e,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:z.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:to}):null,(o.comment_count??o.comments?.length??0)>0?J(kn,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,J(_e,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:J(hn,{labelKeys:o.label_keys??[],labelOptions:n})}),C&&!o.completed?J(_e,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,xi(o)&&!o.archived&&!A&&ae?J(mg,{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:K=>{K.stopPropagation(),ae(o)},children:"\uBCF4\uAD00"}):null]}),(()=>{let K=A||!!o.is_event||!!o.completed;return J(_e,{className:"cell",onClick:K?void 0:uo=>_(o,uo.currentTarget),sx:{py:.5,justifyContent:"center",...K?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:o.is_event?(()=>{let uo=Nr(o);return uo?J(Ae,{option:uo}):null})():J(Ae,{option:vo(o)})})})(),J(_e,{className:"cell",onClick:A?void 0:K=>B(o,"start_date",K.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...A?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:Ga(o.start_date)}),J(_e,{className:"cell",onClick:A?void 0:K=>B(o,"due_date",K.currentTarget),sx:{justifyContent:"center",color:X,fontWeight:500,whiteSpace:"nowrap",...A?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:o.due_date?gg(o):null}),L?J(_e,{className:"cell",onClick:A?void 0:()=>y(o,"targets"),sx:{gap:.75,...A?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:J(ac,{display:G,summary:w,searchText:i,avatarSrcByName:r})}):null,!L&&o.is_notice?J(_e,{className:"cell",onClick:A?void 0:()=>y(o,"targets"),sx:{gridColumn:c?"span 2":"auto",gap:.75,...A?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:J(ac,{display:G,summary:w,searchText:i,avatarSrcByName:r})}):null,!L&&!o.is_notice&&!o.is_event&&c?J(_e,{className:"cell",onClick:He?void 0:()=>y(o,"manager"),sx:{gap:.75,...me||ke?{justifyContent:"center"}:{},...He?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:me?J(Bt,{onClick:K=>I?.(o,K.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):ke?J(Bt,{onClick:K=>P?.(o,K.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):J(wi,{names:o.manager_name?[o.manager_name]:[],searchText:i,avatarSrcByName:r,emphasize:V})}):null,!L&&!o.is_notice?J(_e,{className:"cell",onClick:te?void 0:()=>y(o,"receivers"),sx:{gridColumn:o.is_event&&c?"span 2":"auto",gap:.75,...te?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:J(wi,{names:o.receiver_names,searchText:i,avatarSrcByName:r})}):null,J(_e,{className:"cell",onClick:A?void 0:K=>U?.(o,K.currentTarget),sx:{py:.5,justifyContent:"center",...A?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:J(jo,{priority:o.priority,plain:!0})}),p?J(_e,{className:"cell",onClick:A?void 0:K=>f?.(o,K.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...A?{}:{cursor:"pointer","&:hover":{bgcolor:z.table.cellHoverBg}}},children:S?Wr(sc,{children:[(()=>{let K=Ce(b);return K?J(K,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),J(_e,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:S})]}):null}):null,L?J(_e,{className:"cell",sx:{justifyContent:"center"},children:Xe}):null,!L&&m&&d?J(_e,{className:"cell",sx:{justifyContent:"center"},children:o.is_notice?Xe:oe?J(mr,{canConfirm:!!g?.canConfirm,count:g?.count??0,total:g?.total??0,myConfirmed:!!g?.myTime,onConfirm:()=>T?.(o),onShowList:K=>W?.(o,K)}):null}):null,!L&&u==="action"?J(_e,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:z.table.rowSubColor},children:o.is_notice?Xe:g&&g.total>0?J(mr,{canConfirm:!!g.canConfirm,count:g.count,total:g.total,myConfirmed:!!g.myTime,onConfirm:()=>T?.(o),onShowList:K=>W?.(o,K)}):"-"}):null,!L&&!m?J(_e,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:z.table.rowSubColor},children:o.completed_time||"-"}):null,s?null:J(_e,{className:"cell",onClick:()=>{!k&&!de&&(j(o.note),Be(!0))},sx:{color:"#6f6f6c",cursor:k?"default":"text"},children:de?J(_e,{component:"input",ref:F,autoFocus:!0,spellCheck:!1,value:ve,onChange:K=>j(K.target.value),onBlur:()=>{Be(!1),ve.trim()!==o.note&&R(o.seq,ve)},onKeyDown:K=>{K.key==="Enter"&&K.target.blur(),K.key==="Escape"&&(j(o.note),Be(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:z.table.rowTitleColor,caretColor:z.table.rowTitleColor,p:0,m:0}}):J(_e,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.note?ja(o.note,i):""})}),V?J(_e,{component:"span",sx:{position:"absolute",left:3,top:6,bottom:6,width:3,bgcolor:"#2f80ed",borderRadius:1.5,pointerEvents:"none"}}):null]})});import{jsx as bg}from"react/jsx-runtime";var cc=hg(function(o){let n=(o.useTaskItem?o.useTaskItem(o.task.seq):void 0)??o.task,{myAccountSeq:r}=o,i=o.projectByKey.get(n.tab_key??"");return bg(lc,{hideBottomBorder:o.hideBottomBorder,gridTemplate:o.gridTemplate,task:n,statusOptions:o.statusOptions,avatarSrcByName:o.avatarSrcByName,searchText:o.searchText,myAccountSeq:r,todayStr:o.todayStr,showProject:o.showProject,showManager:o.showManager,showActions:o.showActions,showRequest:o.showRequest,confirmMode:o.confirmMode,confirmInfo:n.is_notice?void 0:o.getConfirmInfo?.(n),onConfirmTask:o.onConfirmTask,projectLabel:i?.label??"",projectIcon:i?.icon??"",onProjectClick:o.onProjectClick,onRequestReply:o.onRequestReply,onRequestToggleCompleted:o.onRequestToggleCompleted,onDateClick:o.onDateClick,onChangeNote:o.onChangeNote,onMemberClick:o.onMemberClick,onClaimClick:o.onClaimClick,onVolunteerClick:o.onVolunteerClick,onStatusClick:o.onStatusClick,onOpenDetail:o.onOpenDetail,onTaskContextMenu:o.onTaskContextMenu,notice:o.notice,bugMode:o.bugMode,noticeReadOnly:!Vt(n,r),noteLocked:n.is_notice?!Ti(n,r):!Vt(n,r),completeLocked:n.is_event?!0:n.is_notice?(n.author_account_seq??0)!==r:(n.author_account_seq??0)!==r&&(n.manager_account_seq??0)!==r,targetSummary:n.is_notice?o.getTargetSummary?.(n):void 0,targetDisplay:n.is_notice?o.getTargetDisplay?.(n):void 0,onArchiveTask:o.onArchiveTask,unread:o.isTaskUnread?.(n)??!1,ackInfo:n.is_notice?o.getAckInfo?.(n):void 0,onAckConfirm:o.onAckConfirm,onAckListClick:o.onAckListClick,onPriorityClick:o.onPriorityClick})});import{useMemo as mc,useState as Ya}from"react";import{Box as qn,Button as uc,ButtonBase as dc,Dialog as yg,Divider as Xa,Menu as Sg,MenuItem as Bg,Popover as Cg}from"@mui/material";import pc from"@mui/icons-material/ChevronRight";import vg from"@mui/icons-material/Check";import Ig from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as _g,TimePicker as wg}from"@ehfuse/mui-datetime-picker";import Dg from"@mui/icons-material/TimerOutlined";import{useEffect as kg,useState as Tg}from"react";function Ct(e){let{loadHolidays:o}=Go(),[t,n]=Tg(()=>new Map),r=e.join(",");return kg(()=>{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 p of a)l.has(p.date)||l.set(p.date,p.name);n(l)}).catch(()=>{}),()=>{i=!0}},[o,r]),t}import{Fragment as fc,jsx as Io,jsxs as ct}from"react/jsx-runtime";var Mg=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],xc=[{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"}],gc=[{value:"none",label:"\uC5C6\uC74C"},...Mg,...xc];function Qa(e){return e?gc:[{value:"none",label:"\uC5C6\uC74C"},...xc]}function Za(e){return e==="same_day"?"\uB2F9\uC77C":gc.find(o=>o.value===e)?.label??"\uC5C6\uC74C"}function Eg(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function ot({anchorEl:e,open:o,date:t,reminder:n,hideReminder:r=!1,showTime:i=!1,centered:a=!1,onClose:l,onDateChange:p,onReminderChange:c}){let[m,d]=Ya(null),[u,s]=Ya(null),g=St(),T=String(t??"").trim().slice(0,10),S=String(t??"").trim().slice(11,16),b=/^\d{2}:\d{2}$/.test(S)?S:"",f=(_,v)=>p(v?`${_} ${v}`:_),[D,B]=Ya(()=>{let _=Number(T.slice(0,4));return Number.isFinite(_)&&_>1900?_:new Date().getFullYear()}),R=mc(()=>[D-1,D,D+1],[D]),y=Ct(R),I=mc(()=>{let _=[];for(let v of y.keys()){let $=new Date(`${v}T00:00:00`);Number.isNaN($.getTime())||_.push($)}return _},[y]),P=ct(qn,{sx:{width:300,maxWidth:"100%"},children:[Io(qn,{sx:{height:320},children:Io(_g,{selectedDate:Eg(T),onSelect:_=>{f(xo(_),b),i||l()},onClose:l,showFooter:!1,autoApply:!0,holidays:I,onYearChange:_=>B(_),onMonthChange:(_,v)=>{typeof v=="number"&&B(v)}})}),i?ct(fc,{children:[Io(Xa,{sx:{borderColor:"#e6e6e3"}}),ct(dc,{onClick:_=>s(_.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[ct(qn,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Io(Dg,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC2DC\uAC01"]}),ct(qn,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[b||"\uC5C6\uC74C",Io(pc,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Io(wg,{anchorEl:u,open:!!u,onClose:()=>s(null),centered:a,value:{hour:b.slice(0,2)||"09",minute:b.slice(3,5)||"00"},format:"HH:mm",minuteStep:5,autoApply:!0,locale:"ko",onChange:(_,v)=>{f(T||xo(new Date),`${_}:${v}`),s(null)}})]}):null,r?null:ct(fc,{children:[Io(Xa,{sx:{borderColor:"#e6e6e3"}}),ct(dc,{onClick:_=>d(_.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[ct(qn,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Io(Ig,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC0AC\uC804\uC54C\uB9BC"]}),ct(qn,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[Za(n),Io(pc,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Io(Sg,{transitionDuration:0,anchorEl:m,open:!!m,onClose:()=>d(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...g,children:Qa(!!b).map(_=>ct(Bg,{selected:_.value===n,onClick:()=>{c(_.value),d(null)},sx:{fontSize:14,minWidth:120,justifyContent:"space-between",gap:1},children:[_.label,_.value===n?Io(vg,{sx:{fontSize:16,color:"#2f80ed"}}):null]},_.value))})]}),Io(Xa,{sx:{borderColor:"#e6e6e3"}}),ct(qn,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[Io(uc,{size:"small",onClick:()=>{f(xo(new Date),b),l()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),Io(uc,{size:"small",onClick:l,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return a?Io(yg,{open:o,onClose:l,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:P}):Io(Cg,{transitionDuration:0,open:o,anchorEl:e,onClose:l,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:P})}import{useEffect as Pg,useState as el}from"react";import{Box as An,Button as zg,Switch as qg}from"@mui/material";import{FormDialog as Ag}from"@ehfuse/mui-form-dialog";import{ClearTextField as Lg}from"@ehfuse/mui-form-controls";import{ErrorAlert as Ng}from"@ehfuse/alerts";import{Box as Og,ButtonBase as Rg}from"@mui/material";import{jsx as Ja}from"react/jsx-runtime";function Di({value:e,onChange:o}){return Ja(Og,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:_a.map(({key:t,Icon:n})=>{let r=t===e;return Ja(Rg,{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:Ja(n,{sx:{fontSize:20}})},t)})})}import{jsx as Kt,jsxs as ol}from"react/jsx-runtime";function Mi({open:e,title:o="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:t="",initialIcon:n=Ia,confirmText:r="\uCD94\uAC00",initialUseSprints:i=!1,onClose:a,onSubmit:l}){let[p,c]=el(""),[m,d]=el(Ia),[u,s]=el(!1);Pg(()=>{e&&(c(t),d(n),s(i))},[e]);let g=()=>{let S=p.trim();if(!S){Ng("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}l(S,m,u),a()};return Kt(Ag,{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:ol(An,{children:[Kt(Lg,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:p,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),g())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),Kt(An,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),Kt(An,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:Kt(Di,{value:m,onChange:d})}),ol(An,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[ol(An,{children:[Kt(An,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),Kt(An,{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)"})]}),Kt(qg,{checked:u,onChange:(S,b)=>s(b)})]})]})}],actions:{showCancelButton:!0,right:Kt(zg,{variant:"contained",onClick:g,children:r})}})}import{jsx as ye,jsxs as mt}from"react/jsx-runtime";var kc=48,Zg=5;function Tc({tasks:e,statusOptions:o,avatarSrcByName:t,searchText:n,todayStr:r,sortBy:i,sortDirection:a,onSort:l,onRequestReply:p,onToggleCompleted:c,onChangeTaskDate:m,onChangeTaskReminder:d,groupBy:u,collapsedGroupKeys:s,customTabs:g,onToggleGroup:T,hideCompleted:S=!1,onAddInGroup:b,canAddInGroup:f,renderGroupSummary:D,renderGroupTitleSummary:B,onChangeTaskProject:R,onAddProject:y,onChangeNote:I,onMemberClick:P,onClaimTask:_,onChangeTaskStatus:v,onOpenDetail:$,onTaskContextMenu:h,onMemberFilterClick:x,activeMemberFilters:C=[],onStatusFilterClick:L,statusFilterActive:N=!1,onAckFilterClick:k,ackFilterActive:w=!1,onProjectFilterClick:G,projectFilterActive:ae=!1,onPriorityFilterClick:ie,priorityFilterActive:be=!1,columns:W,getConfirmInfo:U,onConfirmTask:de,myAccountSeq:Be=0,currentUserName:ve="",groupManagerByMyRole:j=!1,allowManagerVolunteer:F=!0,noticeAdmin:oe=!1,getTargetSummary:A,getTargetDisplay:V,onArchiveTask:te,isTaskUnread:z,getAckInfo:me,onAckConfirm:ke,onAckListClick:He,onChangeTaskPriority:Xe,onEndReached:we,useTaskItem:to}){let X=se(),K=vt(()=>({showManager:!0,showActions:!0,showRequest:!0,...W}),[W]),uo=K.showManager??!0,Zo=K.showActions??!0,pn=K.showRequest??!0,wn=K.confirmMode??"none",E=K.notice??!1,he=K.bug??!1,Ie=u!=="none",Ne=vt(()=>Ie?Ha(e,u,r,g,o,ve,{enabled:j,myAccountSeq:Be}):[],[Ie,e,u,r,g,o,ve,j,Be]),We=vt(()=>S?e.filter(O=>!O.completed):e,[e,S]),co=vt(()=>We.filter(O=>O.completed||O.archived?!1:O.is_notice?!!me?.(O).canAck:!!U?.(O).canConfirm),[We,me,U]),Oo=vt(()=>new Set(co.map(O=>O.seq)),[co]),Dn=vt(()=>Ne.map(O=>({section:O,visibleTasks:O.tasks.filter(Q=>!Oo.has(Q.seq)&&(!S||!Q.completed))})).filter(O=>O.visibleTasks.length>0),[Ne,S,Oo]),De=vt(()=>new Set(s),[s]),H=vt(()=>{let O=[];if(Ie)for(let{section:Q,visibleTasks:Ee}of Dn){let Ht=De.has(Q.key);if(O.push({kind:"header",section:Q,visibleTasks:Ee,collapsed:Ht}),!Ht)for(let rr of Ee)O.push({kind:"task",task:rr,last:!1})}else for(let Q of We)Oo.has(Q.seq)||O.push({kind:"task",task:Q,last:!1});for(let Q=O.length-1;Q>=0;Q-=1){let Ee=O[Q];if(Ee.kind==="task"){Ee.last=!0;break}}return O},[Ie,Dn,We,De,Oo]),Y=K.showProject??(!E&&u!=="tab"),le=vt(()=>Ka({...K,showProject:Y}),[K,Y]),ge=Ks({...K,showProject:Y}),Ge=vt(()=>{let O=new Map;for(let Q of g)O.set(Q.key,{label:Q.archived?`${Q.label} (\uBCF4\uAD00\uB428)`:Q.label,icon:Q.icon});return O},[g]),$e=Fg(null),[Te,ko]=Gt(null),To=We.length>0;Ei(()=>{if(!To){ko(null);return}let O=window.requestAnimationFrame(()=>{ko($e.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(O)},[To]);let Bo=`${u}|${i}|${a}|${n}|${S?1:0}`;Ei(()=>{Te&&(Te.scrollTop=0)},[Bo,Te]);let[po,Mn]=Gt(!1);Ei(()=>{if(!Te)return;let O=()=>Mn(Te.scrollHeight>Te.clientHeight);O();let Q=new ResizeObserver(O);return Q.observe(Te),Te.firstElementChild&&Q.observe(Te.firstElementChild),()=>Q.disconnect()},[Te]),Ei(()=>{if(!Te)return;let O=Te.clientHeight,Q=new ResizeObserver(()=>{let Ee=Te.clientHeight;Ee!==O&&(O=Ee,Te.dispatchEvent(new Event("scroll")))});return Q.observe(Te),()=>Q.disconnect()},[Te]);let[qe,yt]=Gt(null),[Uo,fn]=Gt(null),[Ft,Qe]=Gt(null),[Me,Ro]=Gt(null),[mi,ui]=Gt(!1),[nr,Po]=Gt(null),En=nr?e.find(O=>O.seq===nr.taskSeq)??null:null,[On,Rn]=Gt(null),xn=On?e.find(O=>O.seq===On.taskSeq)??null:null,Sa=Ut((O,Q)=>{Rn({anchorEl:Q,taskSeq:O.seq})},[]),Co=Ut((O,Q)=>{Po({anchorEl:Q,taskSeq:O.seq})},[]),zo=Ut((O,Q)=>{if(!Q)return;l(O,i===O&&a==="asc"?"desc":"asc")},[l,i,a]),Ba=Ut((O,Q,Ee)=>{yt({anchorEl:Ee,taskSeq:O.seq,field:Q,date:O[Q],isEvent:!!O.is_event,reminder:O.reminder,completed:O.completed})},[]),Ca=Ut((O,Q)=>{Ro({anchorEl:Q,task:O})},[]),Er=Ut(O=>{qe&&(m(qe.taskSeq,qe.field,O),yt(Q=>Q&&{...Q,date:O}))},[qe,m]),M=Ut(O=>{qe&&(d(qe.taskSeq,O),yt(Q=>Q&&{...Q,reminder:O}))},[qe,d]),at=Ut((O,Q)=>{Qe({anchorEl:Q,taskSeq:O.seq,title:O.title,kind:"claim"})},[]),gn=Ut((O,Q)=>{Qe({anchorEl:Q,taskSeq:O.seq,title:O.title,kind:"volunteer"})},[]),lt=(O,Q)=>ye(cc,{task:O,hideBottomBorder:Q,gridTemplate:ge,useTaskItem:to,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:Be,todayStr:r,showProject:Y,showManager:uo,showActions:Zo,showRequest:pn,confirmMode:wn,notice:E,bugMode:he,projectByKey:Ge,getConfirmInfo:U,onConfirmTask:de,onProjectClick:Ca,onRequestReply:p,onRequestToggleCompleted:fn,onDateClick:Ba,onChangeNote:I,onMemberClick:P,onClaimClick:_?at:void 0,onVolunteerClick:F?gn:void 0,onStatusClick:Co,onOpenDetail:$,onTaskContextMenu:h,onPriorityClick:Sa,getTargetSummary:A,getTargetDisplay:V,getAckInfo:me,isTaskUnread:z,onArchiveTask:te,onAckConfirm:ke,onAckListClick:He},O.seq);return mt(Lo,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${X.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:X.table.bg,color:X.table.rowColor,...X.table.sx},children:[ye(Lo,{sx:{display:"grid",gridTemplateColumns:ge,borderBottom:`1px solid ${X.table.borderColor}`,flexShrink:0,bgcolor:X.table.headerBg,"& > *":{borderRight:`1px solid ${X.table.rowBorderColor}`},"& > *:first-of-type":{px:1.5},"& > *:last-child":{borderRight:"none",pr:2},...X.table.headerSx},children:le.map(O=>{let Q=i===O.id,Ee=!!O.memberFilter,Ht=Ee&&C.includes(O.memberFilter),rr=Ee||!!O.statusFilter||!!O.ackFilter||!!O.projectFilter||!!O.priorityFilter,di=Ht||!!O.statusFilter&&N||!!O.ackFilter&&w||!!O.projectFilter&&ae||!!O.priorityFilter&&be;return mt(Lo,{onClick:Or=>{O.memberFilter?x(O.memberFilter,Or.currentTarget):O.statusFilter?L(Or.currentTarget):O.ackFilter?k?.(Or.currentTarget):O.projectFilter?G?.(Or.currentTarget):O.priorityFilter?ie?.(Or.currentTarget):zo(O.id,O.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:O.align==="center"?"center":"flex-start",gap:.5,px:1,py:1,minWidth:0,fontSize:X.table.headerFontSize,color:O.sortable||rr?X.table.headerActiveColor:X.table.headerColor,whiteSpace:"nowrap",cursor:O.sortable||rr?"pointer":"default",userSelect:"none",...Q?{color:X.table.headerFilteredColor}:{},...di?{color:X.table.headerFilteredColor,fontWeight:600}:{}},children:[O.icon,O.label,di?ye(jg,{sx:{fontSize:14}}):null,Q?a==="asc"?ye(Vg,{sx:{fontSize:13}}):ye(Kg,{sx:{fontSize:13}}):null]},O.id)})}),co.length>0?mt(Lo,{sx:{flexShrink:0,maxHeight:`${X.table.groupHeader.minHeight+1+kc*Zg}px`,overflowY:"auto",borderBottom:"1px solid #000"},children:[mt(Lo,{sx:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:X.table.groupHeader.minHeight,bgcolor:"#fdf3f2",borderBottom:"1px solid #f2d7d4"},children:[ye(Lo,{component:"span",sx:{fontSize:X.table.groupHeader.labelFontSize,fontWeight:X.table.groupHeader.labelFontWeight,color:X.table.groupHeader.labelColor},children:"\uBBF8\uD655\uC778"}),ye(Lo,{sx:{ml:"auto",display:"flex",alignItems:"center",pr:.5},children:ye(Lo,{component:"span",sx:{flexShrink:0,width:X.table.groupHeader.badge.width,py:X.table.groupHeader.badge.paddingY,borderRadius:`${X.table.groupHeader.badge.borderRadius}px`,bgcolor:"#e5484d",color:"#fff",fontSize:X.table.groupHeader.badge.fontSize,fontWeight:X.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:co.length})})]}),co.map((O,Q)=>lt(O,Q===co.length-1))]}):null,We.length===0?ye(Lo,{sx:{py:8,textAlign:"center",color:X.table.emptyColor,fontSize:14},children:e.length>0?`\uC644\uB8CC\uB41C \uC5C5\uBB34 ${e.length}\uAC74\uC774 "\uC644\uB8CC \uC228\uAE30\uAE30"\uB85C \uAC10\uCDB0\uC838 \uC788\uC2B5\uB2C8\uB2E4.`:he?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":E?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):ye(Lo,{sx:{flex:1,minHeight:0},children:ye(Qg,{ref:$e,style:{height:"100%"},thumb:{width:8},scrollTopFab:!0,children:Te?ye(Xg,{customScrollParent:Te,data:H,computeItemKey:(O,Q)=>Q.kind==="header"?`group:${Q.section.key}`:Q.task.seq,endReached:Ie?void 0:we,defaultItemHeight:kc,increaseViewportBy:{top:600,bottom:600},itemContent:(O,Q)=>{if(Q.kind==="task")return lt(Q.task,Q.last&&po);let{section:Ee,visibleTasks:Ht,collapsed:rr}=Q;return mt(Lo,{onClick:()=>T(Ee.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:X.table.groupHeader.minHeight,bgcolor:X.table.groupHeader.bg,borderBottom:`1px solid ${X.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:X.table.groupHeader.hoverBg},...X.table.groupHeader.sx},children:[rr?ye(Gg,{sx:{fontSize:20,color:X.colors.textMuted}}):ye(Ug,{sx:{fontSize:20,color:X.colors.textMuted}}),ye(Lo,{component:"span",sx:{fontSize:X.table.groupHeader.labelFontSize,fontWeight:X.table.groupHeader.labelFontWeight,color:X.table.groupHeader.labelColor},children:Ee.label}),B?ye(Lo,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:B(Ee.key,Ee.tasks)}):null,b&&(!f||f(Ee.key))?ye(Wg,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:di=>{di.stopPropagation(),b(Ee.key,Ee.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:X.colors.textSecondary,"&:hover":{bgcolor:X.colors.surfaceHover,color:X.colors.accentOnSurface}},children:ye(bc,{sx:{fontSize:21}})}):null,mt(Lo,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[D?D(Ee.key,Ee.tasks):null,ye(Lo,{component:"span",sx:{flexShrink:0,width:X.table.groupHeader.badge.width,py:X.table.groupHeader.badge.paddingY,borderRadius:`${X.table.groupHeader.badge.borderRadius}px`,bgcolor:X.table.groupHeader.badge.bg,border:X.table.groupHeader.badge.border,color:X.table.groupHeader.badge.color,fontSize:X.table.groupHeader.badge.fontSize,fontWeight:X.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:Ht.length})]})]})}},Bo):null})}),ye(lr,{anchorEl:nr?.anchorEl??null,value:En?.status??"",options:En?hi(En):Lr,onSelect:O=>{En&&v(En.seq,O)},onClose:()=>Po(null)}),ye(hc,{transitionDuration:0,anchorEl:On?.anchorEl??null,open:!!On,onClose:()=>Rn(null),children:["high","medium","low"].map(O=>mt(Oi,{selected:xn?.priority===O,onClick:()=>{xn&&Xe?.(xn.seq,O),Rn(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[ye(jo,{priority:O,small:!0}),xn?.priority===O?ye(tl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},O))}),mt(hc,{anchorEl:Me?.anchorEl??null,open:!!Me,onClose:()=>Ro(null),transitionDuration:0,children:[mt(Oi,{selected:!Me?.task.tab_key,onClick:()=>{Me&&R(Me.task.seq,""),Ro(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ye(Yg,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",Me?.task.tab_key?null:ye(tl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),g.filter(O=>!O.archived).map(O=>{let Q=Ce(O.icon),Ee=Me?.task.tab_key===O.key;return mt(Oi,{selected:Ee,onClick:()=>{Me&&R(Me.task.seq,O.key),Ro(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Q?ye(Q,{sx:{fontSize:17,color:"#1e3a8a"}}):null,O.label,Ee?ye(tl,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},O.key)}),y?[ye(Hg,{},"add-project-divider"),mt(Oi,{onClick:()=>ui(!0),sx:{fontSize:14,color:"#787774"},children:[ye($g,{children:ye(bc,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),y?ye(Mi,{open:mi,onClose:()=>ui(!1),onSubmit:(O,Q)=>{let Ee=Me?.task.seq??0;(async()=>{let Ht=await y(O,Q);Ht&&Ee&&R(Ee,Ht)})(),Ro(null)}}):null,ye(ot,{anchorEl:qe?.anchorEl??null,open:!!qe&&qe?.field==="start_date",date:qe?.date??"",reminder:"none",hideReminder:!0,showTime:!qe?.isEvent,onClose:()=>yt(null),onDateChange:Er,onReminderChange:()=>{}}),ye(ot,{anchorEl:qe?.anchorEl??null,open:!!qe&&qe?.field==="due_date",date:qe?.date??"",showTime:!qe?.isEvent,reminder:qe?.reminder??"none",hideReminder:!!qe?.completed,onClose:()=>yt(null),onDateChange:Er,onReminderChange:M}),ye(Pe,{open:!!Ft,anchorEl:Ft?.anchorEl??null,title:Ft?.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:()=>Qe(null),onConfirm:()=>{Ft&&_?.(Ft.taskSeq),Qe(null)}}),ye(Pe,{open:!!Uo,anchorEl:Uo?.anchorEl??null,title:Uo?.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:Uo?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>fn(null),onConfirm:()=>{Uo&&c(Uo.task,Uo.nextCompleted),fn(null)}})]})}import{useCallback as wt,useMemo as Yt,useRef as Th,useState as Xt}from"react";import{Box as ze,ButtonBase as Pc,Divider as Cc,IconButton as vc,Menu as Ic,MenuItem as Tn}from"@mui/material";import al from"@mui/icons-material/Add";import _c from"@mui/icons-material/MoreVert";import wc from"@mui/icons-material/EditOutlined";import Dc from"@mui/icons-material/ArchiveOutlined";import Mc from"@mui/icons-material/UnarchiveOutlined";import yh from"@mui/icons-material/NotificationsOutlined";import Sh from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as Jg}from"@mui/material";import{jsx as yc}from"react/jsx-runtime";function It({sx:e,...o}){return yc(Jg,{viewBox:"0 0 24 24",...o,sx:{fill:"none",...e},children:yc("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 Bh,DragOverlay as Ch,PointerSensor as vh,pointerWithin as Ih,rectIntersection as _h,useDroppable as wh,useSensor as Dh,useSensors as Mh}from"@dnd-kit/core";import{SortableContext as zc,arrayMove as Ec,horizontalListSortingStrategy as Eh,useSortable as Oh,verticalListSortingStrategy as Rh}from"@dnd-kit/sortable";import{CSS as Ph}from"@dnd-kit/utilities";import ll from"@ehfuse/overlay-scrollbar";import{useState as ah}from"react";import{Box as jt,ButtonBase as lh,Checkbox as sh,Tooltip as ch}from"@mui/material";import mh from"@mui/icons-material/AlarmOutlined";import uh from"@mui/icons-material/TimerOutlined";import{Box as ut,Button as eh,Popover as oh}from"@mui/material";import th from"@mui/icons-material/CheckCircle";import{Fragment as nh,jsx as _t,jsxs as Ln}from"react/jsx-runtime";function Ri({anchorEl:e,open:o,acks:t,total:n,avatarSrcByName:r,pendingNames:i=[],onRequestConfirm:a,onClose:l}){let p=Re();return _t(oh,{open:o&&(p||!!e),anchorEl:e,onClose:l,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...p?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:Ln(ut,{sx:{minWidth:240,maxWidth:320,py:1},children:[Ln(ut,{sx:{px:2,pb:.75,fontSize:yo(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",t.length,"/",n]}),i.length>0&&t.length>0?Ln(ut,{sx:{px:2,pt:1,pb:.5,fontSize:yo(12.5),fontWeight:600,color:"#9a9a97"},children:["\uD655\uC778 ",t.length]}):null,t.length===0?i.length>0?null:_t(ut,{sx:{px:2,py:1.5,fontSize:yo(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(c=>Ln(ut,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[_t(Ao,{names:[c.name],size:22,avatarSrcByName:r}),_t(ut,{component:"span",sx:{fontSize:yo(14),color:"#37352f",whiteSpace:"nowrap"},children:c.name}),_t(ut,{component:"span",sx:{ml:"auto",fontSize:yo(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:Yo(c.time)}),_t(th,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},c.account_seq)),i.length>0?Ln(nh,{children:[Ln(ut,{sx:{mt:t.length>0?.75:0,px:2,pt:1,pb:.5,borderTop:t.length>0?"1px solid #efefed":"none",fontSize:yo(12.5),fontWeight:600,color:"#9a9a97"},children:["\uBBF8\uD655\uC778 ",i.length]}),i.map(c=>Ln(ut,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[_t(Ao,{names:[c],size:22,avatarSrcByName:r}),_t(ut,{component:"span",sx:{fontSize:yo(14),color:"#37352f",whiteSpace:"nowrap"},children:c})]},c))]}):null,a?_t(ut,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:_t(eh,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{a(),l()},sx:{fontSize:yo(13)},children:"\uD655\uC778 \uC694\uCCAD"})}):null]})})}function rh(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 ih(e){let o=new Map,t=Number(e.manager_account_seq??0);t>0&&o.set(t,String(e.manager_name??"").trim());let n=e.receiver_account_seqs??[],r=e.receiver_names??[];return n.forEach((i,a)=>{i>0&&!o.has(i)&&o.set(i,String(r[a]??"").trim())}),o}function Pi(e,o){let t=rh(e),n=e.acks??[],r=o>0?n.find(l=>l.account_seq===o):void 0,i=new Set(n.map(l=>l.account_seq)),a=ih(e);return{myTime:r?.time??"",canConfirm:o>0&&t.includes(o)&&!r,count:n.filter(l=>t.includes(l.account_seq)).length,total:t.length,pendingNames:t.filter(l=>!i.has(l)).map(l=>a.get(l)??"").filter(l=>l.length>0)}}function ND(e){let o=String(e??"").trim();return o?o.slice(5,16).replaceAll("-","."):""}import{Fragment as fh,jsx as No,jsxs as Nn}from"react/jsx-runtime";function zi(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 dh(e){let o=e.trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function ph(){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 $r({task:e,statusOptions:o,showDueDate:t=!1,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,titleFontSize:a=13}){let l=se(),p=sr(e),m=!!e.due_date&&e.due_date.slice(0,10)<=ph()?l.colors.danger:l.colors.accentOnSurface,d=Pi(e,0),[u,s]=ah(null),g=ar(e,o),T=new Set(e.label_keys??[]),S=g.filter(f=>!T.has(f.key)),b=g.filter(f=>T.has(f.key));return Nn(fh,{children:[Nn(jt,{sx:{display:"flex",alignItems:"center",gap:.5},children:[No(sh,{size:"small",checked:e.completed,onPointerDown:f=>f.stopPropagation(),onClick:f=>f.stopPropagation(),onChange:(f,D)=>n?.({anchorEl:f.currentTarget,taskSeq:e.seq,nextCompleted:D}),sx:{p:0}}),No(ch,{title:e.title,arrow:!0,enterDelay:300,children:Nn(jt,{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]})}),p?No(jt,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:l.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:p}):null,(e.comment_count??e.comments?.length??0)>0?No(kn,{sx:{fontSize:15,flexShrink:0,color:l.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?No(jt,{sx:{pl:3,mt:-.5,fontSize:12.5,color:l.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,Nn(jt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[Nn(jt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[S.map(f=>No(Ae,{option:f,small:!0},f.key)),No(jo,{priority:e.priority,small:!0}),b.map(f=>No(Ae,{option:f,small:!0},f.key))]}),t&&String(e.due_date??"").trim()?Nn(lh,{disabled:!i,onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation(),i?.(e,f.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:m,whiteSpace:"nowrap","&:hover":i?{bgcolor:l.colors.border}:void 0},children:[dh(e.due_date),No(mh,{sx:{fontSize:15}})]}):null]}),t&&(e.due_date.slice(11,16)||e.estimated_time)?Nn(jt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:l.colors.textSecondary},children:[No(uh,{sx:{fontSize:14}}),e.due_date.slice(11,16)||e.estimated_time]}):null,No(Ao,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),d.total>0?No(jt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:No(jt,{sx:{flexShrink:0,width:64},onPointerDown:f=>f.stopPropagation(),onClick:f=>f.stopPropagation(),children:No(mr,{canConfirm:!1,count:d.count,total:d.total,onConfirm:()=>{},onShowList:f=>s(f)})})}):null,No(Ri,{anchorEl:u,open:!!u,acks:e.acks??[],total:d.total,pendingNames:d.pendingNames,onRequestConfirm:r&&d.count<d.total?()=>{r(e),s(null)}:void 0,onClose:()=>s(null)})]})}import{Box as xh}from"@mui/material";import{useSortable as gh}from"@dnd-kit/sortable";import{CSS as hh}from"@dnd-kit/utilities";import{jsx as Sc}from"react/jsx-runtime";function bh(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function Bc({task:e,statusOptions:o,variant:t="card",showDueDate:n=!1,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,onCardClick:l,onCardContextMenu:p,titleFontSize:c}){let m=se(),{attributes:d,listeners:u,setNodeRef:s,transform:g,transition:T,isDragging:S}=gh({id:String(e.seq)}),b=t==="list";return Sc(xh,{ref:s,...d,...u,onClick:l?()=>l(e):void 0,onContextMenu:p?f=>p(e,f):void 0,sx:{...b?bh(m.card):zi(m.card),opacity:S?.35:e.completed?.55:1,transform:hh.Translate.toString(g),transition:T,position:"relative",cursor:"default",touchAction:"none","&:hover":b?{bgcolor:m.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:Sc($r,{task:e,statusOptions:o,showDueDate:n,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,titleFontSize:c})})}function kh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function tt(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let o=kh(e.end_date);return o?`${e.name} (~${o})`:e.name}import{jsx as ee,jsxs as Ve}from"react/jsx-runtime";var Oc=2,qi="group-",nt="colmove-",nl="__default__",rl=Aa,il="__other__",Ai="sprint-",Rc=`${Ai}0`,zh={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function qc(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 qh({column:e,tasks:o,statusOptions:t,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onAddTask:a,canAdd:l,onOpenMenu:p,onCardClick:c,onCardContextMenu:m,grow:d,summary:u,onOpenSprintMenu:s}){let g=se(),{setNodeRef:T,isOver:S}=wh({id:`${qi}${e.key}`}),{attributes:b,listeners:f,setNodeRef:D,transform:B,transition:R,isDragging:y}=Oh({id:`${nt}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return Ve(ze,{ref:I=>{T(I),D(I)},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:I=>I.shadows[1],bgcolor:S?g.colors.accentSoft:g.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:Ph.Translate.toString(B),...R?{transition:`${R}, background-color 0.15s`}:{},opacity:y?.6:1},children:[Ve(ze,{...b,...f,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${g.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?ee(ze,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let I=Ce(e.icon);return I?ee(I,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),ee(ze,{component:"span",sx:{fontSize:g.board.columnHeaderFontSize,fontWeight:700,color:g.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),ee(ze,{component:"span",sx:{...qc(g.board.badge),ml:"auto"},children:o.length}),e.sprint&&s?ee(vc,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:I=>I.stopPropagation(),onClick:I=>s(I.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:ee(_c,{sx:{fontSize:18}})}):e.locked?null:ee(vc,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:I=>I.stopPropagation(),onClick:I=>p({anchorEl:I.currentTarget,column:e}),sx:{color:"#9a9a97"},children:ee(_c,{sx:{fontSize:18}})})]}),u?ee(ze,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${g.card.borderColor}`,flexShrink:0},children:u}):null,ee(ze,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:ee(ll,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Ve(ze,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[ee(zc,{items:o.map(I=>String(I.seq)),strategy:Rh,children:o.map(I=>ee(Bc,{task:I,statusOptions:t,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onCardClick:c,onCardContextMenu:m},I.seq))}),o.length===0&&!l?ee(ze,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,o.length===0&&l?ee(ze,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:Ve(Pc,{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 ${g.card.borderColor}`,bgcolor:g.card.bg,color:g.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:g.card.hoverBg}},children:[ee(al,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function sl({tasks:e,statusOptions:o,customTabs:t,mode:n="active",onToggleCompleted:r,onRequestReply:i,onChangeDueDate:a,onChangeReminder:l,onMoveTask:p,columnAxis:c="project",statusColumns:m=[],onMoveTaskStatus:d,sprintColumns:u=[],onMoveTaskSprint:s,onAddGroup:g,onAddTask:T,canAdd:S=!0,onRequestRename:b,onArchiveProject:f,onDeleteProject:D,onReorderProjects:B,onOpenDetail:R,onTaskContextMenu:y,hideCompleted:I=!1,renderColumnSummary:P,onEditSprint:_,onChangeSprintStatus:v,onRemoveSprint:$}){let h=se(),[x,C]=Xt(null),[L,N]=Xt(null),[k,w]=Xt(null),[G,ae]=Xt(null),[ie,be]=Xt(null),[W,U]=Xt(null),[de,Be]=Xt(null),[ve,j]=Xt(null),[F,oe]=Xt(null),A=Th(!1),V=Yt(()=>new Map(e.map(H=>[H.seq,H])),[e]),te=Yt(()=>{let H=e.filter(Y=>Y.is_notice);return H.sort((Y,le)=>Y.completed!==le.completed?Y.completed?1:-1:le.seq-Y.seq),H},[e]),z=Yt(()=>t.filter(H=>!H.archived),[t]),me=Yt(()=>t.filter(H=>H.archived),[t]),ke=H=>({key:H.key,label:H.label,icon:H.icon,isDefault:!1,isArchived:H.archived}),He=Yt(()=>new Set(m.map(H=>H.key)),[m]),Xe=Yt(()=>new Set(u.map(H=>H.seq)),[u]),we=Yt(()=>{if(c==="sprint")return[{key:Rc,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...u.map(H=>({key:`${Ai}${H.seq}`,label:tt(H),icon:"",isDefault:!1,isArchived:!1,dot:zh[H.status],locked:!0,sprint:H}))];if(c==="status"){let H=m.map(Y=>({key:Y.key,label:Y.name,icon:"",isDefault:!1,isArchived:!1,dot:Y.dot,locked:!0}));return H.some(Y=>Y.key===rl)?H:[...H,{key:rl,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return n==="archived"?me.map(ke):[{key:nl,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...z.map(ke)]},[c,m,u,n,z,me]),to=Mh(Dh(vh,{activationConstraint:{distance:5}})),X=wt(H=>{let Y=String(H.active.id).startsWith(nt),le=Ih(H),ge=le.length>0?le:_h(H);if(Y)return ge.filter(Te=>String(Te.id).startsWith(nt));let Ge=ge.filter(Te=>!String(Te.id).startsWith(nt)),$e=Ge.filter(Te=>!String(Te.id).startsWith(qi));return $e.length>0?$e:Ge},[]),K=Yt(()=>{let H=new Map;for(let Y of e){if(Y.is_notice)continue;let le;if(c==="sprint"){let Ge=Y.sprint_seq??0;le=Xe.has(Ge)?`${Ai}${Ge}`:Rc}else le=c==="status"?Y.completed?rl:He.has(String(Y.status??""))?String(Y.status??""):il:Y.tab_key?.trim()||nl;let ge=H.get(le);ge?ge.push(Y):H.set(le,[Y])}for(let Y of H.values())Y.sort((le,ge)=>{if(le.completed!==ge.completed)return le.completed?1:-1;let Ge=(le.group_sort_no??0)>0,$e=(ge.group_sort_no??0)>0;return Ge&&$e?(le.group_sort_no??0)-(ge.group_sort_no??0):Ge!==$e?Ge?-1:1:le.due_date!==ge.due_date?le.due_date<ge.due_date?-1:1:le.seq-ge.seq});return H},[e,c,He,Xe]),uo=Yt(()=>c!=="status"||(K.get(il)??[]).length===0?we:[...we,{key:il,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[c,we,K]),Zo=wt(H=>de?(de.get(H)??[]).map(Y=>V.get(Y)).filter(Y=>!!Y):K.get(H)??[],[de,V,K]),pn=wt(H=>{let Y=Zo(H);return I?Y.filter(le=>!le.completed):Y},[Zo,I]),wn=wt(H=>{let Y=String(H.active.id);if(Y.startsWith(nt)){oe(Y.slice(nt.length));return}j(Number(Y)),Be(new Map(we.map(le=>[le.key,(K.get(le.key)??[]).map(ge=>ge.seq)])))},[we,K]),E=wt((H,Y)=>{if(H.startsWith(qi))return{key:H.slice(qi.length),overSeq:null};let le=Number(H);for(let[ge,Ge]of Y)if(Ge.includes(le))return{key:ge,overSeq:le};return null},[]),he=wt(H=>{let{active:Y,over:le}=H;!le||String(Y.id).startsWith(nt)||Be(ge=>{if(!ge)return ge;let Ge=Number(Y.id),$e=E(String(le.id),ge);if(!$e)return ge;let Te=[...ge.entries()].find(([,po])=>po.includes(Ge))?.[0];if(!Te||Te===$e.key)return ge;let ko=new Map(ge);ko.set(Te,(ko.get(Te)??[]).filter(po=>po!==Ge));let To=[...ko.get($e.key)??[]],Bo=To.length;if($e.overSeq!==null){let po=To.indexOf($e.overSeq);po!==-1&&(Bo=po)}return To.splice(Bo,0,Ge),ko.set($e.key,To),ko})},[E]),Ie=wt(H=>{let Y=String(H.active.id);if(Y.startsWith(nt)){oe(null);let Bo=String(H.over?.id??"");if(!Bo.startsWith(nt))return;let po=Y.slice(nt.length),Mn=Bo.slice(nt.length);if(po===Mn)return;let qe=t.map(fn=>fn.key),yt=qe.indexOf(po),Uo=qe.indexOf(Mn);if(yt===-1||Uo===-1)return;B(Ec(qe,yt,Uo));return}let le=de;if(Be(null),j(null),A.current=!0,!le||!H.over)return;let ge=Number(Y),Ge=[...le.entries()].find(([,Bo])=>Bo.includes(ge));if(!Ge)return;let[$e,Te]=Ge,ko=[...Te],To=E(String(H.over.id),le);if(To&&To.key===$e&&To.overSeq!==null&&To.overSeq!==ge){let Bo=ko.indexOf(ge),po=ko.indexOf(To.overSeq);Bo!==-1&&po!==-1&&(ko=Ec(ko,Bo,po))}if(c==="status"){d?.(ge,$e);return}if(c==="sprint"){s?.(ge,Number($e.slice(Ai.length))||0);return}p(ge,$e===nl?"":$e,ko)},[t,de,E,p,B,c,d,s]),Ne=wt(()=>{Be(null),j(null),oe(null),A.current=!0},[]),We=wt(H=>{if(A.current){A.current=!1;return}R(H)},[R]),co=ve!==null?V.get(ve)??null:null,Oo=F!==null?we.find(H=>H.key===F)??null:null,Dn=wt((H,Y)=>{U({anchorEl:Y,taskSeq:H.seq,date:H.due_date,reminder:H.reminder})},[]),De=L?.column??null;return Ve(ze,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${h.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:Oc,bgcolor:h.colors.surfaceSubtle},children:[Ve(Bh,{sensors:to,collisionDetection:X,onDragStart:wn,onDragOver:he,onDragEnd:Ie,onDragCancel:Ne,children:[ee(ze,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:n==="archived"&&we.length===0?ee(ze,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):ee(ll,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:Ve(ze,{sx:{display:"flex",alignItems:"flex-start",gap:Oc,height:"100%",minWidth:"min-content",pb:.5},children:[n==="active"&&te.length>0?Ve(ze,{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:H=>H.shadows[1],bgcolor:h.card.bg,overflow:"hidden"},children:[Ve(ze,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${h.card.borderColor}`,flexShrink:0,minHeight:48},children:[ee(yh,{sx:{fontSize:17,color:"#e8763a"}}),ee(ze,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:h.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),Ve(ze,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",te.length,")"]})]}),ee(ze,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:ee(ll,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:ee(ze,{sx:{display:"flex",flexDirection:"column"},children:te.map(H=>Ve(ze,{onClick:()=>We(H),onContextMenu:Y=>y(H,Y),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${h.card.borderColor}`,bgcolor:h.card.bg,cursor:"pointer","&:hover":{bgcolor:h.card.hoverBg}},children:[ee($r,{task:H,statusOptions:o,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:C}),(()=>{let Y=(H.target_names??[]).filter(ge=>ge.trim());if(Y.length===0)return null;let le=Y.length>2?`${Y[0]}, ${Y[1]} \uC678 ${Y.length-2}`:Y.join(", ");return Ve(ze,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[ee(Sh,{sx:{fontSize:14,flexShrink:0}}),ee(ze,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:le})]})})()]},H.seq))})})})]}):null,ee(zc,{items:z.map(H=>`${nt}${H.key}`),strategy:Eh,children:uo.map(H=>ee(qh,{column:H,tasks:pn(H.key),summary:P?.(H.key,Zo(H.key)),onOpenSprintMenu:_||v||$?(Y,le)=>w({anchorEl:Y,sprint:le}):void 0,statusOptions:o,onRequestArchiveToggle:C,onRequestReply:i,onDueDateClick:Dn,onAddTask:T,canAdd:S&&c==="project",onOpenMenu:N,onCardClick:We,onCardContextMenu:y,grow:c!=="project"},H.key))}),n==="active"&&c==="project"?Ve(Pc,{onClick:g,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:[ee(al,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,n==="active"&&uo.length===0&&te.length===0?ee(ze,{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]})})}),ee(Ch,{children:co?ee(ze,{sx:{...zi,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:ee($r,{task:co,statusOptions:o,showDueDate:!0,titleFontSize:15})}):Oo?Ve(ze,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:h.card.bg,border:`1px solid ${h.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let H=Ce(Oo.icon);return H?ee(H,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),ee(ze,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:h.board.columnHeaderColor},children:Oo.label}),ee(ze,{component:"span",sx:qc(h.board.badge),children:(K.get(Oo.key)??[]).length})]}):null})]}),Ve(Ic,{transitionDuration:0,anchorEl:L?.anchorEl??null,open:!!L,onClose:()=>N(null),children:[De&&!De.isArchived&&S?Ve(Tn,{onClick:()=>{De&&T(De.isDefault?"":De.key),N(null)},sx:{fontSize:14,gap:1},children:[ee(al,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,De&&!De.isDefault&&!De.isArchived?Ve(Tn,{onClick:()=>{b(De.key,De.label,De.icon),N(null)},sx:{fontSize:14,gap:1},children:[ee(wc,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,De&&!De.isDefault&&!De.isArchived?Ve(Tn,{onClick:()=>{f(De.key,!0),N(null)},sx:{fontSize:14,gap:1},children:[ee(Dc,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,De&&De.isArchived?Ve(Tn,{onClick:()=>{f(De.key,!1),N(null)},sx:{fontSize:14,gap:1},children:[ee(Mc,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,De&&!De.isDefault?ee(Cc,{}):null,De&&!De.isDefault?Ve(Tn,{onClick:()=>{L&&be(L),N(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[ee(It,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),Ve(Ic,{transitionDuration:0,anchorEl:k?.anchorEl??null,open:!!k,onClose:()=>w(null),children:[_?Ve(Tn,{onClick:()=>{k&&_(k.sprint.seq),w(null)},sx:{fontSize:14,gap:1},children:[ee(wc,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,v?Ve(Tn,{onClick:()=>{k&&v(k.sprint.seq,k.sprint.status==="closed"?"active":"closed"),w(null)},sx:{fontSize:14,gap:1},children:[k?.sprint.status==="closed"?ee(Mc,{sx:{fontSize:18,color:"#787774"}}):ee(Dc,{sx:{fontSize:18,color:"#787774"}}),k?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,$?ee(Cc,{}):null,$?Ve(Tn,{onClick:()=>{k&&ae(k),w(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[ee(It,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),ee(Pe,{open:!!G,anchorEl:G?.anchorEl??null,title:`"${G?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>ae(null),onConfirm:()=>{G&&$?.(G.sprint.seq),ae(null)}}),ee(ot,{anchorEl:W?.anchorEl??null,open:!!W,date:W?.date??"",reminder:W?.reminder??"none",onClose:()=>U(null),onDateChange:H=>{W&&(a(W.taskSeq,H),U(Y=>Y&&{...Y,date:H}))},onReminderChange:H=>{W&&(l(W.taskSeq,H),U(Y=>Y&&{...Y,reminder:H}))}}),ee(Pe,{open:!!ie,anchorEl:ie?.anchorEl??null,title:`"${ie?.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:()=>be(null),onConfirm:()=>{ie&&D(ie.column.key),be(null)}}),ee(Pe,{open:!!x,anchorEl:x?.anchorEl??null,title:x?.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:x?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>C(null),onConfirm:()=>{x&&r(x.taskSeq,x.nextCompleted),C(null)}})]})}import{useCallback as Zt,useMemo as Vr,useRef as Nc,useState as Kr}from"react";import{Box as mo,Button as Uh,ButtonBase as Hc,IconButton as Fc}from"@mui/material";import Gh from"@mui/icons-material/Add";import jh from"@mui/icons-material/ChevronLeft";import Yh from"@mui/icons-material/ChevronRight";import Xh from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Qh}from"@ehfuse/mui-datetime-picker";import{DndContext as Zh,DragOverlay as Jh,PointerSensor as eb,pointerWithin as ob,rectIntersection as tb,useDroppable as nb,useSensor as rb,useSensors as ib}from"@dnd-kit/core";import{SortableContext as ab,arrayMove as lb,useSortable as sb,verticalListSortingStrategy as cb}from"@dnd-kit/sortable";import{CSS as mb}from"@dnd-kit/utilities";import ub from"@ehfuse/overlay-scrollbar";function Ah(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 ur(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=Ah(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}function dr(e){let o=String((e.is_event?e.event_time:e.due_date.slice(11,16)||e.estimated_time)??"").trim();return/^\d{1,2}:\d{2}$/.test(o)?o:""}function pr(e,o){if(e.completed!==o.completed)return e.completed?1:-1;let t=dr(e),n=dr(o);if(!!t!=!!n)return t?-1:1;if(t&&n&&t!==n)return t<n?-1:1;let r=e.sort_no>0,i=o.sort_no>0;return r&&i?e.sort_no-o.sort_no:r!==i?r?-1:1:e.seq-o.seq}import{Box as cl,Tooltip as Lh}from"@mui/material";import{jsx as ml,jsxs as Nh}from"react/jsx-runtime";function fr({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,p]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${a}/${l}/${p}`,"_blank")};return ml(Lh,{title:`(${n}) ${t}`,arrow:!0,enterDelay:300,children:Nh(cl,{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:[ml(cl,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),ml(cl,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t})]})})}import{useCallback as Wh}from"react";import{Box as yn,Checkbox as $h}from"@mui/material";import{useLayoutEffect as Fh,useState as Ac}from"react";var dl=new WeakMap,ul=null;function Hh(){return typeof ResizeObserver>"u"?null:(ul||(ul=new ResizeObserver(e=>{for(let o of e){let t=dl.get(o.target);if(!t)continue;let n=o.borderBoxSize?.[0]?.inlineSize??o.target.getBoundingClientRect().width;t(n)}})),ul)}function Lc(){let[e,o]=Ac(null),[t,n]=Ac(0);return Fh(()=>{if(!e)return;n(e.getBoundingClientRect().width);let r=Hh();if(r)return dl.set(e,i=>n(a=>Math.abs(a-i)<1?a:i)),r.observe(e),()=>{r.unobserve(e),dl.delete(e)}},[e]),{ref:o,width:t}}import{jsx as Qt,jsxs as pl}from"react/jsx-runtime";var fl={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"},xr=15,Vh=150,Kh=3;function Sn({task:e,statusOptions:o,onOpenDetail:t,onContextMenu:n,isPreview:r=!1,isDragging:i=!1,isMine:a=!1,avatarSrcByName:l,showManagerAvatar:p=!1,onOpenMembers:c,setNodeRef:m,dragProps:d,trailing:u,showCheckbox:s=!1,onRequestToggleCompleted:g,showTime:T=!0,wrapTitle:S=!1}){let b=se(),f=b.mode==="dark",[D]=ar(e,o),B=String(e.manager_name??"").trim(),R=T?dr(e):"",y=sr(e),I=!e.completed&&!e.is_event&&!e.due_date.slice(0,10),P=e.is_notice||e.is_event?Ce(e.icon||(e.is_notice?no:fo)):null,_=!e.completed&&!e.is_event&&!!e.due_date&&e.due_date.slice(0,10)<Ws(),{ref:v,width:$}=Lc(),h=$>0&&$<Vh,x=h||S,C=Wh(N=>{v(N),m?.(N)},[v,m]),L=p&&!a&&!h&&!!B;return pl(yn,{ref:C,...d??{},onClick:N=>{N.stopPropagation(),t(e)},onContextMenu:n?N=>n(e,N):void 0,sx:{display:"flex",alignItems:x?"flex-start":"center",gap:.5,py:.6,px:1,flexShrink:0,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:D?f?ir(D.dot,b.chip.darkBgAlpha):D.bg:f?b.card.bg:b.colors.surfaceHover,color:D?f?b.chip.darkTextSource==="fg"?D.fg:D.dot:D.fg:b.colors.textPrimary,fontSize:xr,fontWeight:f||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:r?.5:i?.35:e.completed?.6:I?.75:1,border:r?`1px dashed ${b.colors.accent}`:"1px solid transparent",pointerEvents:r?"none":"auto",cursor:"pointer",touchAction:d?"none":"auto",overflow:"hidden","&:hover":{filter:"brightness(0.96)"},..._?{borderLeft:`3px solid ${b.colors.danger}`,pl:.75}:a?{borderLeft:"3px solid #2f80ed",pl:.75}:{}},children:[Qt(yn,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,...x?{mt:"7px"}:{},bgcolor:fl[e.priority]??b.colors.accentOnSurface}}),s&&!h&&g?Qt($h,{size:"small",checked:e.completed,onPointerDown:N=>N.stopPropagation(),onClick:N=>N.stopPropagation(),onChange:(N,k)=>g({anchorEl:N.currentTarget,taskSeq:e.seq,nextCompleted:k}),sx:{p:0,flexShrink:0}}):null,P&&!h?Qt(P,{sx:{fontSize:15,flexShrink:0,opacity:.75,...x?{mt:"3px"}:{}}}):null,pl(yn,{sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",color:f?b.colors.textStrong:b.colors.textPrimary,...I&&!f?{color:b.colors.textSecondary}:{}},children:[h&&R?Qt(yn,{component:"span",sx:{lineHeight:1.35,fontSize:xr-1,color:e.completed?b.colors.textPrimary:b.colors.danger},children:R}):null,pl(yn,{component:"span",sx:{minWidth:0,overflow:"hidden",...x?{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Kh,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.35}:{textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:[!h&&R?Qt(yn,{component:"span",sx:{mr:.5,fontSize:xr-1,color:e.completed?b.colors.textPrimary:b.colors.danger},children:R}):null,e.title,!h&&y?Qt(yn,{component:"span",sx:{ml:.5,fontSize:xr-2,color:b.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:y}):null,!h&&(e.comment_count??e.comments?.length??0)>0?Qt(kn,{sx:{fontSize:15,ml:.5,verticalAlign:"-2px",color:b.colors.textMuted}}):null]})]}),u??null,!u&&L?Qt(yn,{component:"span",onClick:c?N=>{N.stopPropagation(),c(e)}:void 0,sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:Qt(Jo,{src:l?.get(B)??"",name:B,avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}import{jsx as Oe,jsxs as Jt}from"react/jsx-runtime";var Wc=36,db=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ni="day-";function xl(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Li(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function pb(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 fb(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function xb({task:e,statusOptions:o,isMine:t,avatarSrcByName:n,onCardClick:r,onCardContextMenu:i,onRequestArchiveToggle:a,dragDisabled:l=!1}){let{attributes:p,listeners:c,setNodeRef:m,transform:d,transition:u,isDragging:s}=sb({id:String(e.seq),disabled:l});return Oe(Sn,{task:e,statusOptions:o,isMine:t,avatarSrcByName:n,showManagerAvatar:!0,wrapTitle:!0,onOpenDetail:g=>r?.(g),onContextMenu:i,showCheckbox:!0,onRequestToggleCompleted:a,isDragging:s,setNodeRef:m,dragProps:l?void 0:{...p,...c,style:{transform:mb.Translate.toString(d),transition:u}}})}function gb({dayKey:e,isToday:o,dayLabel:t,holidayName:n,tasks:r,googleEvents:i,statusOptions:a,onRequestArchiveToggle:l,onRequestReply:p,onAddSchedule:c,canAdd:m,onCardClick:d,onCardContextMenu:u,summary:s,myAccountSeq:g,avatarSrcByName:T,dragDisabled:S=!1}){let b=se(),{setNodeRef:f}=nb({id:`${Ni}${e}`,disabled:S});return Jt(mo,{ref:f,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:o?b.calendar.todayBg:b.calendar.cellBg},children:[Jt(mo,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:Wc,bgcolor:o?b.calendar.todayBg:b.calendar.dateBandBg,borderBottom:`1px solid ${b.calendar.borderColor}`,flexShrink:0},children:[n?Oe(mo,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:b.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}):null,o?Oe(mo,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:b.colors.danger,color:b.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Oe(mo,{component:"span",sx:{fontSize:13.5,fontWeight:o?700:400,color:n?b.colors.danger:b.mode==="dark"?b.colors.textStrong:b.colors.textPrimary,flexShrink:0},children:t})]}),s?Oe(mo,{sx:{px:1,py:1,borderBottom:`1px solid ${b.calendar.borderColor}`,flexShrink:0},children:s}):null,Oe(mo,{sx:{flex:1,minHeight:0,bgcolor:o?b.calendar.todayBg:b.colors.surfaceSubtle},children:Oe(ub,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Jt(mo,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[i.length>0?Oe(mo,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:i.map(D=>Oe(fr,{event:D},D.uid))}):null,Oe(ab,{items:r.map(D=>String(D.seq)),strategy:cb,children:Oe(mo,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75},children:r.map(D=>Oe(xb,{task:D,statusOptions:a,isMine:g>0&&Number(D.manager_account_seq??0)===g,avatarSrcByName:T,onCardClick:d,onCardContextMenu:u,onRequestArchiveToggle:l,dragDisabled:S},D.seq))})}),Oe(mo,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...m?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:Jt(Hc,{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 ${b.calendar.borderColor}`,bgcolor:b.calendar.cellBg,color:b.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:b.calendar.hoverBg}},children:[Oe(Gh,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function $c({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,myAccountSeq:r=0,avatarSrcByName:i,todayStr:a,onToggleCompleted:l,onMoveTask:p,onRequestReply:c,onAddSchedule:m,canAdd:d=!0,disableDrag:u=!1,onOpenDetail:s,onTaskContextMenu:g,hideCompleted:T=!1,renderColumnSummary:S}){let b=se(),[f,D]=Kr(()=>xl(new Date)),[B,R]=Kr(null),[y,I]=Kr(null),[P,_]=Kr(null),[v,$]=Kr(null),h=Nc(!1),x=Vr(()=>Array.from({length:7},(A,V)=>Li(f,V)),[f]),C=Vr(()=>new Map(e.map(A=>[A.seq,A])),[e]),L=Vr(()=>[...new Set(x.map(A=>A.getFullYear()))],[x]),N=Ct(L),k=ib(rb(eb,{activationConstraint:{distance:5}})),w=Zt(A=>{let V=ob(A),te=V.length>0?V:tb(A),z=te.filter(me=>!String(me.id).startsWith(Ni));return z.length>0?z:te},[]),G=Vr(()=>ur(o),[o]),ae=Vr(()=>{let A=new Map;for(let V of e){let te=V.due_date.slice(0,10)||(n?V.start_date.slice(0,10)||String(V.created_time??"").slice(0,10):"");if(!te)continue;let z=A.get(te);z?z.push(V):A.set(te,[V])}for(let V of A.values())V.sort(pr);return A},[e,n]),ie=Zt(A=>P?(P.get(A)??[]).map(V=>C.get(V)).filter(V=>!!V):ae.get(A)??[],[P,C,ae]),be=Zt(A=>{let V=ie(A);return T?V.filter(te=>!te.completed):V},[ie,T]),W=Zt(A=>{$(Number(A.active.id)),_(new Map(x.map(V=>{let te=xo(V);return[te,(ae.get(te)??[]).map(z=>z.seq)]})))},[x,ae]),U=Zt((A,V)=>{if(A.startsWith(Ni))return{day:A.slice(Ni.length),overSeq:null};let te=Number(A);for(let[z,me]of V)if(me.includes(te))return{day:z,overSeq:te};return null},[]),de=Zt(A=>{let{active:V,over:te}=A;te&&_(z=>{if(!z)return z;let me=Number(V.id),ke=U(String(te.id),z);if(!ke)return z;let He=[...z.entries()].find(([,X])=>X.includes(me))?.[0];if(!He||He===ke.day)return z;let Xe=new Map(z);Xe.set(He,(Xe.get(He)??[]).filter(X=>X!==me));let we=[...Xe.get(ke.day)??[]],to=we.length;if(ke.overSeq!==null){let X=we.indexOf(ke.overSeq);X!==-1&&(to=X)}return we.splice(to,0,me),Xe.set(ke.day,we),Xe})},[U]),Be=Zt(A=>{let{active:V,over:te}=A,z=P;if(_(null),$(null),h.current=!0,!z||!te)return;let me=Number(V.id),ke=[...z.entries()].find(([,X])=>X.includes(me));if(!ke)return;let[He,Xe]=ke,we=[...Xe],to=U(String(te.id),z);if(to&&to.day===He&&to.overSeq!==null&&to.overSeq!==me){let X=we.indexOf(me),K=we.indexOf(to.overSeq);X!==-1&&K!==-1&&(we=lb(we,X,K))}p(me,He,we)},[P,p,U]),ve=Zt(()=>{_(null),$(null),h.current=!0},[]),j=Zt(A=>{if(h.current){h.current=!1;return}s(A)},[s]),F=v!==null?C.get(v)??null:null,oe=Nc(null);return Jt(mo,{onTouchStart:A=>{let V=A.touches[0];oe.current=V?{x:V.clientX,y:V.clientY}:null},onTouchEnd:A=>{let V=oe.current;oe.current=null;let te=A.changedTouches[0];if(!V||!te||v!==null)return;let z=te.clientX-V.x,me=te.clientY-V.y;Math.abs(z)<60||Math.abs(z)<=Math.abs(me)||D(Li(f,z<0?7:-7))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${b.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[Jt(mo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:b.calendar.bg,borderBottom:`1px solid ${b.calendar.borderColor}`,flexShrink:0},children:[Jt(mo,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Oe(Fc,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>D(Li(f,-7)),children:Oe(jh,{sx:{fontSize:24,color:b.colors.textSecondary}})}),Oe(Uh,{size:"small",color:"inherit",onClick:()=>D(xl(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:b.mode==="dark"?400:500,color:b.mode==="dark"?b.colors.textStrong:b.colors.textPrimary},children:"\uC624\uB298"}),Oe(Fc,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>D(Li(f,7)),children:Oe(Yh,{sx:{fontSize:24,color:b.colors.textSecondary}})})]}),Jt(Hc,{onClick:A=>I(A.currentTarget),sx:{ml:"auto",display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:b.mode==="dark"?400:700,color:b.mode==="dark"?b.colors.textStrong:b.colors.textPrimary,"&:hover":{bgcolor:b.colors.surfaceHover}},children:[pb(x),Oe(Xh,{sx:{fontSize:18,color:b.colors.textMuted}})]})]}),Oe(mo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:b.calendar.headerBg,borderBottom:`1px solid ${b.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${b.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:x.map(A=>{let V=A.getDay(),te=N.has(xo(A));return Oe(mo,{sx:{height:Wc,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:V===0||te?b.colors.danger:V===6?b.colors.accentOnSurface:b.colors.textSecondary},children:db[V]},xo(A))})}),Oe(mo,{sx:{flex:1,minHeight:0},children:Jt(Zh,{sensors:k,collisionDetection:w,onDragStart:W,onDragOver:de,onDragEnd:Be,onDragCancel:ve,children:[Oe(mo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${b.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:x.map(A=>{let V=xo(A);return Oe(gb,{dayKey:V,isToday:V===a,dayLabel:fb(A),holidayName:N.get(V)??"",summary:S?.(V,ie(V)),tasks:be(V),googleEvents:G.get(V)??[],statusOptions:t,onRequestArchiveToggle:R,onRequestReply:c,onAddSchedule:m,canAdd:d,onCardClick:j,onCardContextMenu:g,myAccountSeq:r,avatarSrcByName:i,dragDisabled:u},V)})}),Oe(Jh,{children:F?Oe(mo,{sx:{boxShadow:"0 8px 20px rgba(0,0,0,0.18)",borderRadius:.75,cursor:"grabbing"},children:Oe(Sn,{task:F,statusOptions:t,onOpenDetail:()=>{},isMine:r>0&&Number(F.manager_account_seq??0)===r})}):null})]})}),Oe(Qh,{anchorEl:y,open:!!y,onClose:()=>I(null),selectedDate:f,onDateChange:A=>{D(xl(A)),I(null)}}),Oe(Pe,{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:()=>R(null),onConfirm:()=>{B&&l(B.taskSeq,B.nextCompleted),R(null)}})]})}import{useCallback as Ur,useMemo as Fn,useRef as hb,useState as Gr}from"react";import{Box as Fo,Button as bb,ButtonBase as Kc,IconButton as Vc,Tooltip as kb}from"@mui/material";import Tb from"@mui/icons-material/Add";import yb from"@mui/icons-material/ChevronLeft";import Sb from"@mui/icons-material/ChevronRight";import Bb from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Cb}from"@ehfuse/mui-datetime-picker";import{DndContext as vb,DragOverlay as Ib,PointerSensor as _b,pointerWithin as wb,rectIntersection as Db,useDraggable as Mb,useDroppable as Uc,useSensor as Eb,useSensors as Ob}from"@dnd-kit/core";import Rb from"@ehfuse/overlay-scrollbar";import{jsx as Fe,jsxs as en}from"react/jsx-runtime";var Pb=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Fi="mday-",Hi="mchip-",Gc=36;function zb(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Wi(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function qb(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function gl(e,o){let t=Wi(e);return t.setMonth(t.getMonth()+o),t}function Ab({task:e,statusOptions:o,isPreview:t=!1,isMine:n=!1,avatarSrcByName:r,onOpenDetail:i,onContextMenu:a,onRequestToggleCompleted:l,dragDisabled:p=!1}){let{attributes:c,listeners:m,setNodeRef:d,isDragging:u}=Mb({id:String(e.seq),disabled:t||p}),{setNodeRef:s}=Uc({id:`${Hi}${e.seq}`,disabled:t||p});return Fe(kb,{title:e.title,arrow:!0,enterDelay:400,children:Fe(Sn,{task:e,statusOptions:o,onOpenDetail:i,onContextMenu:a,showCheckbox:!!l,onRequestToggleCompleted:l,isPreview:t,isDragging:u,isMine:n,avatarSrcByName:r,showManagerAvatar:!0,wrapTitle:!0,setNodeRef:g=>{d(g),s(g)},dragProps:p?void 0:{...c,...m}})})}function Lb({dayKey:e,dayNumber:o,isToday:t,isOtherMonth:n,weekday:r,holidayName:i,tasks:a,googleEvents:l,statusOptions:p,previewSeq:c,myAccountSeq:m,avatarSrcByName:d,onRequestToggleCompleted:u,onOpenDetail:s,onTaskContextMenu:g,onAddSchedule:T,canAdd:S,dragDisabled:b=!1}){let f=se(),D=f.mode==="dark",{setNodeRef:B,isOver:R}=Uc({id:`${Fi}${e}`,disabled:b}),y=a,I=!!i||r===0;return en(Fo,{ref:B,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:R?f.colors.accentSoft:t?f.calendar.todayBg:n?f.calendar.otherMonthBg:f.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...S?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[en(Fo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:Gc,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:t?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:`1px solid ${f.calendar.borderColor}`},children:[i?Fe(Fo,{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?Fe(Fo,{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,Fe(Fo,{component:"span",sx:{fontSize:13.5,fontWeight:t?700:400,color:n?f.colors.textMuted:I?f.colors.danger:r===6?f.colors.accentOnSurface:D?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:o})]}),l.map(P=>Fe(fr,{event:P,small:!0},P.uid)),y.map(P=>Fe(Ab,{task:P,statusOptions:p,isPreview:P.seq===c,isMine:m>0&&Number(P.manager_account_seq??0)===m,avatarSrcByName:d,onRequestToggleCompleted:u,onOpenDetail:s,onContextMenu:g,dragDisabled:b},P.seq)),Fe(Fo,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:en(Kc,{className:"taskbox-month-add",onClick:()=>T(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:[Fe(Tb,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function jc({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,myAccountSeq:r=0,avatarSrcByName:i,onToggleCompleted:a,todayStr:l,onMoveTask:p,onAddSchedule:c,canAdd:m=!0,disableDrag:d=!1,onOpenDetail:u,onTaskContextMenu:s}){let g=se(),T=g.mode==="dark",[S,b]=Gr(()=>Wi(new Date)),[f,D]=Gr(null),[B,R]=Gr(null),[y,I]=Gr(null),[P,_]=Gr(null),v=Fn(()=>{let j=zb(S);return Array.from({length:42},(F,oe)=>qb(j,oe))},[S]),$=Fn(()=>new Map(e.map(j=>[j.seq,j])),[e]),h=Fn(()=>ur(o),[o]),x=Fn(()=>[...new Set(v.map(j=>j.getFullYear()))],[v]),C=Ct(x),L=Fn(()=>{let j=new Map;for(let F of e){let oe=F.due_date.slice(0,10)||(n?F.start_date.slice(0,10)||String(F.created_time??"").slice(0,10):"");if(!oe)continue;let A=j.get(oe);A?A.push(F):j.set(oe,[F])}for(let F of j.values())F.sort(pr);return j},[e,n]),N=Ob(Eb(_b,{activationConstraint:{distance:5}})),k=Ur(j=>{let F=wb(j),oe=F.length>0?F:Db(j),A=oe.filter(V=>String(V.id).startsWith(Hi));return A.length>0?A:oe.filter(V=>String(V.id).startsWith(Fi))},[]),w=Ur(j=>{I(Number(j.active.id))},[]),G=Ur(j=>{_(j.over?String(j.over.id):null)},[]),ae=Fn(()=>{let j=new Map;for(let[F,oe]of L)for(let A of oe)j.set(A.seq,F);return j},[L]),ie=y!==null?$.get(y)?.due_date.slice(0,10)??"":"",be=Fn(()=>{if(y===null||!P)return null;if(P.startsWith(Hi)){let j=Number(P.slice(Hi.length)),F=ae.get(j);if(!F)return null;let oe=(L.get(F)??[]).filter(V=>V.seq!==y),A=oe.findIndex(V=>V.seq===j);return{day:F,index:A===-1?oe.length:A}}if(P.startsWith(Fi)){let j=P.slice(Fi.length),F=(L.get(j)??[]).filter(oe=>oe.seq!==y);return{day:j,index:F.length}}return null},[y,ae,P,L]),W=Ur(j=>{let F=L.get(j)??[];if(y===null||!be)return F;let oe=$.get(y);if(!oe)return F;let A=F.filter(V=>V.seq!==y);return j===be.day?[...A.slice(0,be.index),oe,...A.slice(be.index)]:j===ie?A:F},[y,ie,be,$,L]),U=Ur(j=>{let F=y,oe=be;if(I(null),_(null),F===null||!oe)return;let A=(L.get(oe.day)??[]).filter(te=>te.seq!==F),V=[...A.slice(0,oe.index).map(te=>te.seq),F,...A.slice(oe.index).map(te=>te.seq)];p(F,oe.day,V)},[y,be,p,L]),de=y!==null?$.get(y)??null:null,Be=`${S.getFullYear()}\uB144 ${S.getMonth()+1}\uC6D4`,ve=hb(null);return en(Fo,{onTouchStart:j=>{let F=j.touches[0];ve.current=F?{x:F.clientX,y:F.clientY}:null},onTouchEnd:j=>{let F=ve.current;ve.current=null;let oe=j.changedTouches[0];if(!F||!oe||y!==null)return;let A=oe.clientX-F.x,V=oe.clientY-F.y;Math.abs(A)<60||Math.abs(A)<=Math.abs(V)||b(gl(S,A<0?1:-1))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${g.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[en(Fo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:g.calendar.bg,borderBottom:`1px solid ${g.calendar.borderColor}`,flexShrink:0},children:[en(Fo,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Fe(Vc,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>b(gl(S,-1)),children:Fe(yb,{sx:{fontSize:24,color:g.colors.textSecondary}})}),Fe(bb,{size:"small",color:"inherit",onClick:()=>b(Wi(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:g.mode==="dark"?400:500,color:g.mode==="dark"?g.colors.textStrong:g.colors.textPrimary},children:"\uC624\uB298"}),Fe(Vc,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>b(gl(S,1)),children:Fe(Sb,{sx:{fontSize:24,color:g.colors.textSecondary}})})]}),en(Kc,{onClick:j=>D(j.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:g.mode==="dark"?400:700,color:g.mode==="dark"?g.colors.textStrong:g.colors.textPrimary,"&:hover":{bgcolor:g.colors.surfaceHover}},children:[Be,Fe(Bb,{sx:{fontSize:18,color:g.colors.textMuted}})]})]}),Fe(Fo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:g.calendar.headerBg,borderBottom:`1px solid ${g.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${g.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Pb.map((j,F)=>Fe(Fo,{sx:{height:Gc,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:F===0?g.colors.danger:F===6?g.colors.accentOnSurface:g.colors.textSecondary},children:j},j))}),Fe(Fo,{sx:{flex:1,minHeight:0},children:en(vb,{sensors:N,collisionDetection:k,onDragStart:w,onDragOver:G,onDragEnd:U,onDragCancel:()=>{I(null),_(null)},children:[Fe(Rb,{style:{height:"100%"},thumb:{width:8},children:Fe(Fo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${g.calendar.borderColor}`,borderBottom:`1px solid ${g.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:v.map(j=>{let F=xo(j);return Fe(Lb,{dayKey:F,dayNumber:j.getDate(),isToday:F===l,isOtherMonth:j.getMonth()!==S.getMonth(),weekday:j.getDay(),holidayName:C.get(F)??"",tasks:W(F),googleEvents:h.get(F)??[],statusOptions:t,previewSeq:be?.day===F?y:null,myAccountSeq:r,avatarSrcByName:i,onRequestToggleCompleted:a?R:void 0,onOpenDetail:u,onTaskContextMenu:s,onAddSchedule:c,canAdd:m,dragDisabled:d},F)})})}),Fe(Ib,{children:de?en(Fo,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:g.calendar.cellBg,border:`1px solid ${g.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:xr,fontWeight:500,color:g.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[Fe(Fo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:fl[de.priority]}}),de.title]}):null})]})}),Fe(Pe,{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:()=>R(null),onConfirm:()=>{B&&a?.(B.taskSeq,B.nextCompleted),R(null)}}),Fe(Cb,{anchorEl:f,open:!!f,onClose:()=>D(null),selectedDate:S,onDateChange:j=>{b(Wi(j)),D(null)}})]})}import{useEffect as Hb,useMemo as jr,useRef as bl,useState as kl}from"react";import{Box as _o,Button as Wb,IconButton as Xc,useMediaQuery as $b}from"@mui/material";import Vb from"@mui/icons-material/ChevronLeft";import Kb from"@mui/icons-material/ChevronRight";import Ub from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Gb}from"@ehfuse/mui-datetime-picker";import{Box as on,Button as Nb,Dialog as Fb}from"@mui/material";import{jsx as tn,jsxs as hl}from"react/jsx-runtime";function Yc({task:e,avatarSrcByName:o,onClose:t}){let n=se(),r=e?[{label:"\uCC45\uC784\uC790",names:[String(e.manager_name??"").trim()]},{label:"\uCC38\uC870\uC790",names:e.receiver_names??[]},{label:"\uC791\uC131\uC790",names:[String(e.created_by??"").trim()]}]:[];return tn(Fb,{open:!!e,onClose:t,maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:e?hl(on,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:n.colors.surface},children:[tn(on,{sx:{fontSize:15.5,fontWeight:600,color:n.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),r.map(i=>{let a=i.names.filter(l=>!!l);return hl(on,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[tn(on,{sx:{width:56,flexShrink:0,fontSize:13.5,color:n.colors.textSecondary,pt:.5},children:i.label}),tn(on,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:a.length===0?tn(on,{sx:{fontSize:14,color:n.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):a.map(l=>hl(on,{sx:{display:"flex",alignItems:"center",gap:.75},children:[tn(Jo,{src:o?.get(l)??"",name:l,avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),tn(on,{sx:{fontSize:14.5,color:n.colors.textPrimary},children:l})]},`${i.label}-${l}`))})]},i.label)}),tn(on,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:tn(Nb,{size:"small",color:"inherit",onClick:t,children:"\uB2EB\uAE30"})})]}):null})}import{jsx as go,jsxs as Dt}from"react/jsx-runtime";var jb=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Qc(e){let o=e?.parentElement??null;for(;o;){let t=window.getComputedStyle(o);if(/(auto|scroll)/.test(t.overflowY)&&o.scrollHeight>o.clientHeight)return o;o=o.parentElement}return null}var Yb="(min-width:600px)";function Tl(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Zc(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function Jc({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onOpenDetail:r,onAddSchedule:i,myAccountSeq:a=0,avatarSrcByName:l,fallbackToStartDate:p=!1}){let c=se(),m=$b(Yb),[d,u]=kl(()=>Tl(new Date)),[s,g]=kl(!1),T=jr(()=>{let h=new Date(d.getFullYear(),d.getMonth()+1,0).getDate();return Array.from({length:h},(x,C)=>{let L=new Date(d.getFullYear(),d.getMonth(),C+1);return{ymd:Zc(L),dayNumber:C+1,weekday:L.getDay()}})},[d]),S=jr(()=>{let h=new Map;for(let x of e){let C=x.due_date.slice(0,10)||(p?x.start_date.slice(0,10)||String(x.created_time??"").slice(0,10):"");if(!C)continue;let L=h.get(C);L?L.push(x):h.set(C,[x])}for(let x of h.values())x.sort(pr);return h},[e,p]),b=jr(()=>p?e.filter(h=>!h.due_date.slice(0,10)&&!h.start_date.slice(0,10)&&!String(h.created_time??"").slice(0,10)).sort((h,x)=>h.completed!==x.completed?h.completed?1:-1:h.seq-x.seq):[],[e,p]),[f,D]=kl(null),B=jr(()=>ur(o),[o]),R=jr(()=>[d.getFullYear()],[d]),y=Ct(R),I=bl(null),P=n.slice(0,7)===Zc(d).slice(0,7);Hb(()=>{if(!P)return;let h=()=>{let L=I.current,N=Qc(L);if(!N||!L)return;let k=L.getBoundingClientRect().top-N.getBoundingClientRect().top+N.scrollTop;N.scrollTop=Math.max(0,k-N.clientHeight/2+L.clientHeight/2)},x=setTimeout(h,100),C=setTimeout(h,400);return()=>{clearTimeout(x),clearTimeout(C)}},[P,d]);let _=bl(null),v=bl(null),$=h=>{u(C=>new Date(C.getFullYear(),C.getMonth()+h,1));let x=Qc(_.current);x&&x.scrollTo({top:0,behavior:"auto"})};return Dt(_o,{ref:_,onTouchStart:h=>{let x=h.touches[0];v.current=x?{x:x.clientX,y:x.clientY}:null},onTouchEnd:h=>{let x=v.current;v.current=null;let C=h.changedTouches[0];if(!x||!C)return;let L=C.clientX-x.x,N=C.clientY-x.y;Math.abs(L)<60||Math.abs(L)<=Math.abs(N)||$(L<0?1:-1)},sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:c.colors.surface},children:[Dt(_o,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[go(Xc,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>$(-1),children:go(Vb,{sx:{fontSize:24,color:c.colors.textSecondary}})}),go(Wb,{size:"small",color:"inherit",onClick:()=>u(Tl(new Date)),sx:{minWidth:0,px:1,fontSize:15.5,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),go(Xc,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>$(1),children:go(Kb,{sx:{fontSize:24,color:c.colors.textSecondary}})}),Dt(_o,{onClick:()=>g(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,cursor:"pointer"},children:[d.getFullYear(),"\uB144 ",d.getMonth()+1,"\uC6D4",go(Ub,{sx:{fontSize:20,color:c.colors.textMuted}})]})]}),Dt(_o,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${c.calendar.borderColor}`},children:[b.length>0?Dt(_o,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${c.calendar.borderColor}`},children:[Dt(_o,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:c.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",go("br",{}),"\uC5C6\uC74C"]}),go(_o,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:b.map(h=>go(Sn,{task:h,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(h.manager_account_seq??0)===a,avatarSrcByName:l,showManagerAvatar:!0,onOpenMembers:D},h.seq))})]}):null,T.map(({ymd:h,dayNumber:x,weekday:C})=>{let L=y.get(h)??"",N=h===n,k=!!L||C===0,w=S.get(h)??[],G=B.get(h)??[],ae=w.length>0||G.length>0;return Dt(_o,{ref:N?I:void 0,onClick:i?()=>i(h):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:ae?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${c.calendar.borderColor}`,...i?{cursor:"pointer"}:{}},children:[go(_o,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:Dt(_o,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.25,"@media (min-width:600px)":{flexDirection:"row",gap:.75}},children:[go(_o,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:40,height:32,borderRadius:1,px:1.25,fontSize:22,fontWeight:500,color:N?c.colors.surface:k?c.colors.danger:C===6?c.colors.accentOnSurface:c.colors.textPrimary,bgcolor:N?c.colors.accentOnSurface:"transparent"},children:x}),go(_o,{component:"span",sx:{fontSize:13,color:k?c.colors.danger:C===6?c.colors.accentOnSurface:c.colors.textSecondary},children:jb[C]})]})}),Dt(_o,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[G.map(ie=>go(fr,{event:ie},ie.uid)),w.map(ie=>{let be=dr(ie),W=go(Sn,{task:ie,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(ie.manager_account_seq??0)===a,avatarSrcByName:l,showManagerAvatar:!0,onOpenMembers:D,showTime:!m,wrapTitle:!0},ie.seq);return m?Dt(_o,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[go(_o,{component:"span",sx:{width:44,flexShrink:0,textAlign:"right",fontSize:13.5,fontWeight:400,opacity:1,color:be?ie.completed?c.colors.textPrimary:c.colors.danger:"transparent"},children:be||"00:00"}),go(_o,{sx:{flex:1,minWidth:0},children:W})]},ie.seq):W})]})]},h)})]}),go(Yc,{task:f,avatarSrcByName:l,onClose:()=>D(null)}),go(Gb,{open:s,centered:!0,monthOnly:!0,onClose:()=>g(!1),selectedDate:d,onDateChange:h=>{u(Tl(h)),g(!1)}})]})}import{useCallback as em,useEffect as om,useMemo as yl,useRef as Vi,useState as Ki}from"react";import{Box as ro,Tooltip as rm}from"@mui/material";import Xb from"@ehfuse/overlay-scrollbar";import Qb from"@mui/icons-material/CheckCircle";import Zb from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as Jb,PointerSensor as ek,closestCenter as ok,useSensor as tk,useSensors as nk}from"@dnd-kit/core";import{SortableContext as rk,arrayMove as ik,useSortable as ak,verticalListSortingStrategy as lk}from"@dnd-kit/sortable";import sk from"@mui/icons-material/DragIndicator";import{jsx as je,jsxs as Bn}from"react/jsx-runtime";var Sl=36,ck=48,tm=40,mk=24,uk=4,dk=14,nm=36,pk=12.5,gr=220,fk={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function Hn(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 $i(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function Bl(e,o){return Math.round((o.getTime()-e.getTime())/864e5)}function xk({task:e,dragHandle:o,onPointerDown:t,onClick:n}){let r=se(),i=Vi(null),[a,l]=Ki("");return je(rm,{title:a,arrow:!0,enterDelay:300,children:Bn(ro,{onPointerDown:t,onClick:p=>n(e,p),onMouseEnter:()=>{let p=i.current;l(p&&p.scrollWidth>p.clientWidth?e.title:"")},sx:{width:gr,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,je(ro,{ref:i,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function gk({id:e,showIndicator:o,children:t}){let n=se(),{attributes:r,listeners:i,setNodeRef:a}=ak({id:e});return Bn(ro,{ref:a,sx:{position:"relative"},children:[o?je(ro,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:n.colors.accentOnSurface,zIndex:5}}):null,t({...r,...i})]})}function im({tasks:e,todayStr:o,onOpenDetail:t,onToggleChecklist:n,onReorderTasks:r,onTaskContextMenu:i}){let a=se(),l=yl(()=>[...e].sort((x,C)=>{let L=(x.timeline_sort_no??0)>0,N=(C.timeline_sort_no??0)>0;if(L&&N)return(x.timeline_sort_no??0)-(C.timeline_sort_no??0);if(L!==N)return L?-1:1;let k=x.due_date||x.start_date,w=C.due_date||C.start_date;return k!==w?k<w?-1:1:x.seq-C.seq}),[e]),[p,c]=Ki(null),[m,d]=Ki(null),u=nk(tk(ek,{activationConstraint:{distance:4}})),s=em(x=>{c(x.over?Number(x.over.id):null)},[]),g=em(x=>{c(null),d(null);let{active:C,over:L}=x;if(!L||C.id===L.id)return;let N=l.map(G=>G.seq),k=N.indexOf(Number(C.id)),w=N.indexOf(Number(L.id));k===-1||w===-1||r(ik(N,k,w))},[l,r]),T=yl(()=>{let x=Hn(o)??new Date,C=x,L=$i(x,21);for(let w of l){let G=Hn(w.start_date)??Hn(w.due_date),ae=Hn(w.due_date)??G;G&&G<C&&(C=G),ae&&ae>L&&(L=ae)}let N=$i(C,-3),k=Bl(N,$i(L,3))+1;return Array.from({length:k},(w,G)=>$i(N,G))},[l,o]),S=T[0],b=T.findIndex(x=>xo(x)===o),{dayWidths:f,dayOffsets:D,gridWidth:B}=yl(()=>{let x=T.map((N,k)=>N.getDate()===1||k===0?ck:Sl),C=[],L=0;for(let N of x)C.push(L),L+=N;return{dayWidths:x,dayOffsets:C,gridWidth:L}},[T]),R=gr+B,y=Vi(null),I=x=>{y.current={x:x.clientX,y:x.clientY}},P=(x,C)=>{let L=y.current;y.current=null,!(L&&(Math.abs(C.clientX-L.x)>5||Math.abs(C.clientY-L.y)>5))&&t(x)},_=Vi(null),[v,$]=Ki(!1);om(()=>{let x=_.current?.getScrollContainer();if(!x)return;let C=()=>$(x.scrollHeight>x.clientHeight);C();let L=new ResizeObserver(C);return L.observe(x),()=>L.disconnect()},[l.length]);let h=Vi(!1);return om(()=>{if(l.length===0||h.current)return;h.current=!0;let x=window.requestAnimationFrame(()=>{let C=_.current?.getScrollContainer();!C||b<0||(C.scrollLeft=Math.max(0,D[b]-Sl*3))});return()=>window.cancelAnimationFrame(x)},[l.length]),je(ro,{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:je(ro,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:je(Xb,{ref:_,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:Bn(ro,{sx:{width:R,position:"relative",bgcolor:a.timeline.bg},children:[Bn(ro,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:a.timeline.headerBg,borderBottom:`1px solid ${a.timeline.gridColor}`},children:[je(ro,{sx:{width:gr,height:nm,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"}),T.map((x,C)=>{let L=x.getDay(),N=C===b,k=x.getDate()===1||C===0;return je(ro,{sx:{width:f[C],height:nm,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:pk,fontWeight:N&&a.mode!=="dark"?700:400,color:N?a.timeline.bg:L===0?a.colors.danger:L===6?a.colors.accentOnSurface:a.colors.textSecondary,bgcolor:N?a.colors.danger:"transparent",borderRight:`1px solid ${a.timeline.gridColor}`,whiteSpace:"nowrap"},children:k?`${x.getMonth()+1}/${x.getDate()}`:x.getDate()},xo(x))})]}),je(Jb,{sensors:u,collisionDetection:ok,onDragStart:x=>d(Number(x.active.id)),onDragOver:s,onDragEnd:g,onDragCancel:()=>{c(null),d(null)},children:je(rk,{items:l.map(x=>String(x.seq)),strategy:lk,children:Bn(ro,{sx:{position:"relative"},children:[T.map((x,C)=>{let L=x.getDay(),N=C===b;return!N&&L!==0&&L!==6?null:je(ro,{sx:{position:"absolute",top:0,bottom:0,left:gr+D[C],width:f[C],bgcolor:N?"rgba(229,72,77,0.07)":a.colors.surfaceSubtle,zIndex:0}},`stripe-${xo(x)}`)}),l.map((x,C)=>{let L=Hn(x.start_date)??Hn(x.due_date),N=Hn(x.due_date)??L,k=L?Math.min(T.length-1,Math.max(0,Bl(S,L))):0,w=N?Math.min(T.length-1,Math.max(k,Bl(S,N))):k,G=fk[x.priority],ae=gr+D[k]+2,ie=D[w]+f[w]-D[k]-4,be=x.checklist??[];return je(gk,{id:String(x.seq),showIndicator:p===x.seq&&m!==x.seq,children:W=>Bn(ro,{sx:{borderBottom:C===l.length-1&&v?"none":`1px solid ${a.timeline.gridColor}`,position:"relative",zIndex:1,opacity:m===x.seq?.45:1},children:[Bn(ro,{onContextMenu:U=>i(x,U),sx:{display:"flex",height:tm,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[je(xk,{task:x,dragHandle:je(ro,{component:"span",className:"taskbox-timeline-handle",...W,onClick:U=>U.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:a.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:a.colors.accentOnSurface}},children:(()=>{let U=(x.is_notice||x.is_event?Ce(x.icon||(x.is_notice?no:fo)):null)??sk;return je(U,{sx:{fontSize:17}})})()}),onPointerDown:I,onClick:P}),je(rm,{title:`${x.title} (${x.start_date||"?"} ~ ${x.due_date||"?"})`,arrow:!0,enterDelay:300,children:je(ro,{onPointerDown:I,onClick:U=>P(x,U),sx:{position:"absolute",top:(tm-20)/2,left:ae,width:Math.max(Sl-4,ie),height:20,borderRadius:1,bgcolor:G.bg,border:`1px solid ${G.border}`,opacity:x.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),be.map((U,de)=>je(ro,{sx:{display:"flex",height:mk,position:"relative",mt:de===0?`${uk}px`:0,mb:de===be.length-1?`${dk}px`:0},children:je(ro,{sx:{width:gr,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:U.checked?a.colors.textMuted:a.colors.textPrimary},children:Bn(ro,{onClick:()=>n(x.seq,de,!U.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[U.checked?je(Qb,{sx:{fontSize:17,color:a.colors.accentOnSurface,flexShrink:0}}):je(Zb,{sx:{fontSize:17,color:a.colors.textMuted,flexShrink:0}}),je(ro,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:U.checked?"line-through":"none"},children:U.label})]})})},`${x.seq}-check-${de}`))]})},x.seq)}),l.length===0?je(ro,{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 Wn}from"react/jsx-runtime";function DO(e){switch(e.view){case"card":case"kanban":{let{view:o,...t}=e;return Wn(sl,{...t,columnAxis:o==="kanban"?"status":"project"})}case"sprint":{let{view:o,...t}=e;return Wn(sl,{...t,columnAxis:"sprint"})}case"calendar":{let{view:o,...t}=e;return Wn($c,{...t})}case"month":{let{view:o,...t}=e;return Wn(jc,{...t})}case"agenda":{let{view:o,...t}=e;return Wn(Jc,{...t})}case"timeline":{let{view:o,...t}=e;return Wn(im,{...t})}default:{let{view:o,...t}=e;return Wn(Tc,{...t})}}}var MO=["list","card","kanban","calendar","month","timeline"];import{Box as Xo}from"@mui/material";import{Fragment as hk,jsx as $n,jsxs as Mt}from"react/jsx-runtime";function am(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 lm({tasks:e,todayStr:o,showProgress:t=!0,dday:n=null,workdaysLeft:r=null,showPoints:i=!0,showHours:a=!0,showOverdue:l=!0,showInfo:p=!0,inline:c=!1}){let m=se(),d=e.filter(I=>!I.archived),u=d.filter(I=>I.completed).length,s=d.length>0?Math.round(u/d.length*100):0,g=d.filter(I=>!I.completed&&!I.is_event&&!!I.due_date&&I.due_date.slice(0,10)<o).length,T=d.reduce((I,P)=>P.completed?I:I+(P.story_points??0),0),S=t?$n(Xo,{sx:{flex:c?"0 0 110px":"1 1 auto",minWidth:0,height:m.summary.gaugeHeight,borderRadius:3,bgcolor:m.summary.gaugeTrackColor},children:$n(Xo,{sx:{height:"100%",borderRadius:3,width:`${s}%`,bgcolor:s>=100?m.summary.gaugeCompleteColor:m.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,b=t?Mt(Xo,{component:"span",sx:{flexShrink:0,fontSize:c?14:13,color:m.summary.textColor},children:[s,"%"]}):null,f={color:m.summary.numberColor,fontWeight:700,fontSize:c?15:14},D=d.length-u,B=Mt(hk,{children:[c?null:Mt("span",{children:["\uB0A8\uC740 ",$n(Xo,{component:"span",sx:f,children:D}),"\uAC74"]}),l&&g>0?Mt(Xo,{component:"span",sx:{color:m.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",$n(Xo,{component:"span",sx:{fontWeight:700,fontSize:c?15:14},children:g}),"\uAC74"]}):null,i&&T>0?Mt("span",{children:[$n(Xo,{component:"span",sx:f,children:T}),"SP"]}):null]}),R=typeof r=="number"&&Number.isFinite(r)?Mt("span",{children:["\uADFC\uBB34\uC77C ",$n(Xo,{component:"span",sx:f,children:r}),"\uC77C"]}):null,y=typeof n=="number"&&Number.isFinite(n)?$n(Xo,{component:"span",sx:{ml:c?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:m.summary.overdueColor,color:m.colors.textInverse,lineHeight:1.6},children:n===0?"D-day":n>0?`D-${n}`:`D+${-n}`}):null;return c?Mt(Xo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:m.summary.textColor,whiteSpace:"nowrap",...m.summary.sx},children:[p?B:null,p?R:null,p?y:null,S,b]}):Mt(Xo,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[t?Mt(Xo,{sx:{display:"flex",alignItems:"center",gap:1},children:[S,b]}):null,Mt(Xo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:m.summary.textColor},children:[B,R,y]})]})}import{useMemo as kk}from"react";function bk(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 AO(e){let o=Math.round(e*10)/10;return`${o%1===0?o.toFixed(0):o.toFixed(1)}\uC2DC\uAC04`}function sm(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 p=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;t.has(p)||(i+=1)}return i}function LO(e){return e.reduce((o,t)=>t.completed?o:o+bk(t.estimated_time),0)}import{jsx as Tk}from"react/jsx-runtime";function VO({sprint:e,tasks:o,todayStr:t,...n}){let r=e.status==="closed"?null:am(e.end_date,t),i=r!==null&&r>=0,a=kk(()=>{if(!i)return[];let c=Number(t.slice(0,4)),m=Number(e.end_date.slice(0,4))||c,d=[];for(let u=c;u<=Math.max(c,m);u+=1)d.push(u);return d},[i,t,e.end_date]),l=Ct(a),p=i?sm(t,e.end_date,new Set(l.keys())):null;return Tk(lm,{tasks:o,todayStr:t,dday:r,workdaysLeft:p,...n})}import{useEffect as Mk,useRef as Ek,useState as Ok}from"react";import{Box as vl}from"@mui/material";import{Children as yk}from"react";import{Box as Cl,CircularProgress as Sk}from"@mui/material";import{jsx as Ui}from"react/jsx-runtime";var cm={xs:2,md:3};function mm(){return Ui(Cl,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:Ui(Sk,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function um({children:e}){return Ui(Cl,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:cm,pb:cm},children:yk.map(e,o=>o==null||o===!1?null:Ui(Cl,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:o}))})}import{Box as rn,Button as Ik,Checkbox as _k,Typography as Cn}from"@mui/material";import pm from"@mui/icons-material/CheckCircle";import wk from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as vk,jsx as dm}from"react/jsx-runtime";var Bk="taskbox-search-highlight";function Ck(e,o){let t=o?.keyPrefix??"hl";return e.map((n,r)=>dm("span",{className:n.highlight?o?.highlightClassName??Bk:o?.className,style:n.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:n.text},`${t}-${n.text}-${r}`))}function Gi({text:e,keyword:o,fallback:t="-",className:n,highlightClassName:r,keyPrefix:i}){let a=String(e??"").trim()||t,l=Ci(a,o);return dm(vk,{children:Ck(l,{className:n,highlightClassName:r,keyPrefix:i})})}import{jsx as Se,jsxs as hr}from"react/jsx-runtime";var Dk={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:yo(12.5),fontWeight:500,lineHeight:1.4},nn={fontSize:yo(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function Et({label:e,children:o}){return hr(rn,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[Se(rn,{sx:Dk,children:e}),Se(rn,{sx:{...nn,flex:1,pt:.2},children:o})]})}function fm({task:e,statusOptions:o,projectLabel:t,searchText:n,todayStr:r,onRequestToggleCompleted:i,onOpenDetail:a,onTaskContextMenu:l,targetSummary:p="",ackInfo:c,completeLocked:m=!1,unread:d=!1,noticeReadOnly:u=!1,onAckConfirm:s,onAckListClick:g,myManaged:T=!1}){let S=e.is_event?Nr(e):vo(e),b=String(e.due_date??"").slice(11,16),f=e.is_event?String(e.event_time??"").trim():/^\d{2}:\d{2}$/.test(b)?b:String(e.estimated_time??"").trim(),D=et(e.start_date),B=et(e.due_date),R=D&&f&&!B?`${D} ${f}`:D,y=B&&f?`${B} ${f}`:B,I=!e.is_notice&&!e.is_event&&!String(e.due_date??"").trim(),P=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<r,_=(e.receiver_names??[]).filter(Boolean);return hr(rn,{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),a(e))},onContextMenu:v=>l(e,v),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",opacity:I?.6:1,position:"relative"},children:[T?Se(rn,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,hr(rn,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[e.is_event?(()=>{let v=Ce(e.icon||fo);return v?Se(v,{sx:{fontSize:21,flexShrink:0,mt:.2,color:e.icon_color||"#1e3a8a"}}):null})():!u&&!m?Se(_k,{checked:e.completed,icon:Se(wk,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:Se(pm,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:v=>v.stopPropagation(),onChange:(v,$)=>i({anchorEl:v.currentTarget,taskSeq:e.seq,nextCompleted:$}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{if(!e.is_notice)return null;let v=Ce(e.icon||no);return v?Se(v,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:e.icon_color||"#e5484d"}}):null})(),Se(Cn,{sx:{fontSize:yo(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":I?"#5f5e5b":"#111827",textDecoration:e.completed?"line-through":"none"},children:Se(Gi,{text:e.title,keyword:n})}),d&&!e.completed?Se(rn,{component:"span",sx:{flexShrink:0,px:.55,fontSize:yo(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),hr(rn,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[Se(Et,{label:S?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:hr(rn,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1.25},children:[S?Se(Ae,{option:S,small:!0}):null,Se(jo,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?Se(Et,{label:"\uB77C\uBCA8",children:Se(hn,{labelKeys:e.label_keys,labelOptions:o})}):null,t?Se(Et,{label:"\uD504\uB85C\uC81D\uD2B8",children:Se(Cn,{sx:nn,children:t})}):null,R?Se(Et,{label:"\uC2DC\uC791",children:Se(Cn,{sx:nn,children:R})}):null,y?Se(Et,{label:"\uB9C8\uAC10",children:hr(Cn,{sx:{...nn,color:P?"#e5484d":nn.color,fontWeight:P?600:400},children:[y,P?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?Se(Et,{label:"\uB300\uC0C1\uC790",children:Se(Cn,{sx:nn,children:p||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&c?Se(Et,{label:"\uD655\uC778",children:Se(Ik,{size:"small",variant:c.canAck?"contained":"outlined",color:"inherit",startIcon:c.acked?Se(pm,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:v=>{v.stopPropagation(),c.canAck?s?.(e):g?.(e,v.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:yo(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?Se(Et,{label:"\uCC45\uC784\uC790",children:Se(Cn,{sx:nn,children:Se(Gi,{text:e.manager_name,keyword:n})})}):null,!e.is_notice&&_.length>0?Se(Et,{label:"\uCC38\uC870\uC790",children:Se(Cn,{sx:nn,children:_.join(", ")})}):null,e.note?Se(Et,{label:"\uBE44\uACE0",children:Se(Cn,{sx:nn,children:Se(Gi,{text:e.note,keyword:n})})}):null]})]})}import{jsx as br,jsxs as Rk}from"react/jsx-runtime";function hR({tasks:e,statusOptions:o,customTabs:t,loading:n,searchText:r,todayStr:i,onToggleCompleted:a,onOpenDetail:l,onTaskContextMenu:p,getTargetSummary:c,getAckInfo:m,getNoticeReadOnly:d,isTaskUnread:u,getCompleteLocked:s,onAckConfirm:g,onAckListClick:T,onEndReached:S,myAccountSeq:b=0}){let f=new Map(t.map(y=>[y.key,y.label])),[D,B]=Ok(null),R=Ek(null);return Mk(()=>{let y=R.current;if(!S||!y)return;let I=new IntersectionObserver(P=>{P[0]?.isIntersecting&&S()});return I.observe(y),()=>I.disconnect()},[S,e.length]),e.length===0?n?br(mm,{}):br(vl,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Rk(vl,{sx:{minWidth:0},children:[br(um,{children:e.map(y=>br(fm,{myManaged:b>0&&!y.is_notice&&!y.is_event&&(y.manager_account_seq??0)===b,task:y,statusOptions:o,projectLabel:y.tab_key?f.get(y.tab_key)??"":"",searchText:r,todayStr:i,onRequestToggleCompleted:B,onOpenDetail:l,onTaskContextMenu:p,targetSummary:y.is_notice?c?.(y):void 0,ackInfo:y.is_notice?m?.(y):void 0,noticeReadOnly:y.is_notice?d?.(y):!1,unread:u?.(y)??!1,completeLocked:s?.(y)??!1,onAckConfirm:g,onAckListClick:T},y.seq))}),S?br(vl,{ref:R,sx:{height:"1px"}}):null,br(Pe,{open:!!D,anchorEl:D?.anchorEl??null,title:D?.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:D?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>B(null),onConfirm:()=>{D&&a(D.taskSeq,D.nextCompleted),B(null)}})]})}import{useState as Yr}from"react";import{Box as Ze,Checkbox as Pk,Menu as zk,MenuItem as xm,Tooltip as qk}from"@mui/material";import Ak from"@mui/icons-material/CheckCircle";import Lk from"@mui/icons-material/CheckCircleOutlineOutlined";import Nk from"@mui/icons-material/NotesOutlined";import Fk from"@mui/icons-material/AutorenewOutlined";import Hk from"@mui/icons-material/CalendarTodayOutlined";import Wk from"@mui/icons-material/EventOutlined";import $k from"@mui/icons-material/PersonOutlineOutlined";import Vk from"@mui/icons-material/PeopleAltOutlined";import Kk from"@mui/icons-material/StickyNote2Outlined";import{Fragment as jk,jsx as fe,jsxs as vn}from"react/jsx-runtime";var Il={completed:{label:"\uC644\uB8CC",width:"44px",align:"center",icon:null},title:{label:"\uC81C\uBAA9",width:"1fr",align:"left",icon:fe(Nk,{sx:{fontSize:15}})},manager_name:{label:"\uCC45\uC784\uC790",width:"112px",align:"center",icon:fe($k,{sx:{fontSize:15}})},receiver_names:{label:"\uCC38\uC870\uC790",width:"120px",align:"center",icon:fe(Vk,{sx:{fontSize:15}})},status:{label:"\uC0C1\uD0DC",width:"104px",align:"center",icon:fe(Fk,{sx:{fontSize:15}})},priority:{label:"\uC911\uC694\uB3C4",width:"88px",align:"center",icon:null},start_date:{label:"\uC2DC\uC791\uC77C\uC2DC",width:"110px",align:"center",icon:fe(Hk,{sx:{fontSize:15}})},due_date:{label:"\uB9C8\uAC10\uC77C\uC2DC",width:"110px",align:"center",icon:fe(Wk,{sx:{fontSize:15}})},note:{label:"\uBE44\uACE0",width:"1fr",align:"left",icon:fe(Kk,{sx:{fontSize:15}})}},Uk=[{id:"completed"},{id:"title"},{id:"manager_name"},{id:"due_date"},{id:"status"}],Gk=new Set(["manager_name","status","due_date"]);function gm(e){let o=String(e??"").trim();return o?o.slice(2,10).replaceAll("-","."):""}function WR(e,o){return o>0?e.filter(t=>!t.is_notice&&!t.completed&&!t.archived&&st(t)==="group"&&Number(t.visibility_group_seq??0)===o).sort((t,n)=>{let r=String(t.due_date??"").trim(),i=String(n.due_date??"").trim();return r!==i?r?i?r.localeCompare(i):-1:1:Number(t.seq)-Number(n.seq)}):[]}function $R({tasks:e,columns:o=Uk,loading:t=!1,emptyText:n="\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",myAccountSeq:r=0,avatarSrcByName:i,managerCandidates:a=[],canAssignManager:l,onOpenDetail:p,onToggleCompleted:c,onChangeStatus:m,onChangeDueDate:d,onChangeReminder:u,onChangeManager:s,onClaimTask:g}){let T=se(),[S,b]=Yr(null),[f,D]=Yr(null),[B,R]=Yr(null),[y,I]=Yr(null),[P,_]=Yr(null),v=o.map(x=>x.width??Il[x.id].width).join(" "),$=(x,C)=>fe(Jo,{src:i?.get(x)??"",name:x,avatarSx:{width:C,height:C,fontSize:Math.round(C/2),flexShrink:0,borderRadius:"50%"},iconFontSize:Math.round(C*.6)}),h=(x,C)=>{let N=Il[x.id].align==="center";switch(x.id){case"completed":if(C.is_event){let k=Ce(C.icon||fo);return fe(Ze,{className:"cell",sx:{justifyContent:"center"},children:k?fe(k,{sx:{fontSize:19,color:C.icon_color||"#1e3a8a"}}):null},x.id)}return fe(Ze,{className:"cell",sx:{justifyContent:"center",...c?{"&:hover":{bgcolor:T.table.cellHoverBg}}:{}},children:fe(qk,{title:C.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,children:fe(Pk,{checked:!!C.completed,icon:fe(Lk,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:fe(Ak,{sx:{fontSize:20,color:"#2f80ed"}}),onChange:k=>I({anchorEl:k.currentTarget,task:C}),sx:{p:.5}})})},x.id);case"title":{let k=C.is_notice?Ce(C.icon||no):null,w=C.icon_color||"#e5484d";return vn(Ze,{className:"cell",onClick:()=>p(C),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:T.table.cellHoverBg}},children:[k?fe(k,{sx:{fontSize:18,flexShrink:0,color:w}}):null,fe(Ze,{component:"span",sx:{fontSize:14.5,fontWeight:T.table.rowTitleFontWeight,color:T.table.rowTitleColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.title||"(\uC81C\uBAA9 \uC5C6\uC74C)"})]},x.id)}case"manager_name":{let k=l?l(C):!1,w=r>0&&Number(C.manager_account_seq??0)===r;return k&&s?vn(Ze,{className:"cell",onClick:G=>R({anchorEl:G.currentTarget,task:C}),sx:{gap:.75,justifyContent:"center",cursor:"pointer","&:hover":{bgcolor:T.table.cellHoverBg}},children:[C.manager_name?$(C.manager_name,22):null,fe(Ze,{component:"span",sx:{fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.manager_name||""})]},x.id):fe(Ze,{className:"cell",sx:{gap:.75,justifyContent:"center"},children:C.manager_name?vn(jk,{children:[$(C.manager_name,22),fe(Ze,{component:"span",sx:{fontSize:14,fontWeight:w?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.manager_name})]}):g?fe(Bt,{onClick:G=>_({anchorEl:G.currentTarget,taskSeq:Number(C.seq)}),children:"\uAC00\uC838\uAC00\uAE30"}):null},x.id)}case"receiver_names":return fe(Ze,{className:"cell",sx:{justifyContent:"center",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(C.receiver_names??[]).join(", ")},x.id);case"status":return fe(Ze,{className:"cell",onClick:m?k=>b({anchorEl:k.currentTarget,task:C}):void 0,sx:{py:.5,justifyContent:"center",...m?{cursor:"pointer","&:hover":{bgcolor:T.table.cellHoverBg}}:{}},children:fe(Ae,{option:vo(C)})},x.id);case"priority":return fe(Ze,{className:"cell",sx:{justifyContent:"center"},children:fe(jo,{priority:C.priority,plain:!0})},x.id);case"start_date":return fe(Ze,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14},children:gm(C.start_date)},x.id);case"due_date":return fe(Ze,{className:"cell",onClick:d?k=>D({anchorEl:k.currentTarget,taskSeq:Number(C.seq),date:String(C.due_date??"").slice(0,10),reminder:C.reminder??"none"}):void 0,sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14,...d?{cursor:"pointer","&:hover":{bgcolor:T.table.cellHoverBg}}:{}},children:gm(C.due_date)},x.id);case"note":return fe(Ze,{className:"cell",sx:{justifyContent:N?"center":"flex-start",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.note||""},x.id);default:return null}};return vn(Ze,{sx:{border:`1px solid ${T.table.borderColor}`,borderRadius:1,overflow:"hidden",bgcolor:T.table.bg,color:T.table.rowColor},children:[fe(Ze,{sx:{display:"grid",gridTemplateColumns:v,borderBottom:`1px solid ${T.table.borderColor}`,bgcolor:T.table.headerBg,"& > *":{display:"flex",alignItems:"center",gap:.5,px:1,py:1,minWidth:0,fontSize:T.table.headerFontSize,whiteSpace:"nowrap",userSelect:"none",borderRight:`1px solid ${T.table.rowBorderColor}`},"& > *:first-of-type":{px:.5},"& > *:last-child":{borderRight:"none",pr:2}},children:o.map(x=>{let C=Il[x.id];return vn(Ze,{sx:{justifyContent:C.align==="center"?"center":"flex-start",color:Gk.has(x.id)?T.table.headerActiveColor:T.table.headerColor},children:[C.icon,x.label??C.label]},x.id)})}),t?fe(Ze,{sx:{py:3,textAlign:"center",color:T.table.emptyColor,fontSize:14},children:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"}):e.length===0?fe(Ze,{sx:{py:3,textAlign:"center",color:T.table.emptyColor,fontSize:14},children:n}):e.map((x,C)=>fe(Ze,{sx:{display:"grid",gridTemplateColumns:v,minHeight:44,fontSize:15,bgcolor:T.table.rowBg,borderTop:C===0?"none":`1px solid ${T.table.rowBorderColor}`,"&:hover":{bgcolor:T.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${T.table.rowBorderColor}`},"& > .cell:first-of-type":{px:.5},"& > .cell:last-child":{borderRight:"none",pr:2}},children:o.map(L=>h(L,x))},x.seq)),fe(lr,{anchorEl:S?.anchorEl??null,value:String(S?.task.status??""),options:S?hi(S.task):void 0,onSelect:x=>{S&&m?.(Number(S.task.seq),x),b(null)},onClose:()=>b(null)}),vn(zk,{anchorEl:B?.anchorEl??null,open:!!B,onClose:()=>R(null),transitionDuration:0,children:[vn(xm,{onClick:()=>{B&&s?.(Number(B.task.seq),"",0),R(null)},sx:{fontSize:14,minWidth:170,gap:1,color:T.table.headerColor},children:[fe(Ze,{sx:{width:24,flexShrink:0}}),"\uC9C0\uC815 \uC548 \uD568"]}),a.map(x=>vn(xm,{selected:Number(B?.task.manager_account_seq??0)===Number(x.account_seq??0),onClick:()=>{B&&s?.(Number(B.task.seq),x.name,Number(x.account_seq??0)),R(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[$(x.name,24),x.name,x.role_name?fe(Ze,{component:"span",sx:{color:T.table.headerColor,fontSize:13},children:x.role_name}):null]},x.seq))]}),fe(ot,{anchorEl:f?.anchorEl??null,open:!!f,date:f?.date??"",reminder:f?.reminder??"none",hideReminder:!u,onClose:()=>D(null),onDateChange:x=>{f&&(d?.(f.taskSeq,x),D(C=>C?{...C,date:x}:null))},onReminderChange:x=>{f&&(u?.(f.taskSeq,x),D(C=>C?{...C,reminder:x}:null))}}),fe(Pe,{open:!!y,anchorEl:y?.anchorEl??null,title:y?.task.completed?"\uC644\uB8CC\uB97C \uD574\uC81C\uD560\uAE4C\uC694?":"\uC644\uB8CC \uCC98\uB9AC\uD560\uAE4C\uC694?",confirmText:y?.task.completed?"\uD574\uC81C":"\uC644\uB8CC",onCancel:()=>I(null),onConfirm:()=>{y&&c?.(y.task,!y.task.completed),I(null)}}),fe(Pe,{open:!!P,anchorEl:P?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uB97C \uB9E1\uC744\uAE4C\uC694?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>_(null),onConfirm:()=>{P&&g?.(P.taskSeq),_(null)}})]})}var Xr=[{value:"daily",label:"\uB9E4\uC77C"},{value:"weekly",label:"\uB9E4\uC8FC"},{value:"monthly",label:"\uB9E4\uC6D4"},{value:"yearly",label:"\uB9E4\uB144"}];function ji(e){return Xr.find(o=>o.value===e)?.label??"\uC5C6\uC74C"}function Yk(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let o=new Date(`${e}T00:00:00`);return Number.isNaN(o.getTime())?null:o}function Yi(e,o){let t=Yk(e);if(!t)return"";let n=new Date(t);o==="daily"?n.setMonth(n.getMonth()+1):o==="weekly"?n.setMonth(n.getMonth()+3):o==="monthly"?n.setFullYear(n.getFullYear()+1):n.setFullYear(n.getFullYear()+3);let r=i=>String(i).padStart(2,"0");return`${n.getFullYear()}-${r(n.getMonth()+1)}-${r(n.getDate())}`}import{useEffect as my,useRef as uy,useState as dy}from"react";import{Box as zt,Button as Vl,Divider as Ym,Drawer as py,IconButton as fy}from"@mui/material";import xy from"@mui/icons-material/Close";import gy from"@ehfuse/overlay-scrollbar";import{FormDialog as hy}from"@ehfuse/mui-form-dialog";import{useState as ei}from"react";import{Box as Gn,ButtonBase as J0,Divider as oi,Menu as Hl,MenuItem as Wl,Tooltip as ey}from"@mui/material";import oy from"@mui/icons-material/SubjectOutlined";import ty from"@mui/icons-material/StickyNote2Outlined";import ny from"@mui/icons-material/LabelOutlined";import ry from"@mui/icons-material/DirectionsRunOutlined";import Vm from"@mui/icons-material/LockOutlined";import Km from"@mui/icons-material/PublicOutlined";import Um from"@mui/icons-material/Group";import iy from"@mui/icons-material/Repeat";import ay from"@mui/icons-material/EventOutlined";import ly from"@mui/icons-material/SpeedOutlined";import{TextField as sy}from"@ehfuse/mui-form-controls";import{InfoAlert as Gm}from"@ehfuse/alerts";import{useState as Vn}from"react";import{Box as Bm,Divider as fT,ListItemIcon as xT,Menu as Dl,MenuItem as Qr}from"@mui/material";import gT from"@mui/icons-material/Add";import Qi from"@mui/icons-material/Check";import hT from"@mui/icons-material/ViewKanbanOutlined";import bT from"@mui/icons-material/CalendarTodayOutlined";import kT from"@mui/icons-material/EventOutlined";import TT from"@mui/icons-material/PersonOutlineOutlined";import ym from"@mui/icons-material/PeopleAltOutlined";import yT from"@mui/icons-material/FlagOutlined";import ST from"@mui/icons-material/TimerOutlined";import BT from"@mui/icons-material/NotificationsNoneOutlined";import CT from"@mui/icons-material/InboxOutlined";import vT from"@mui/icons-material/PlaceOutlined";import IT from"@mui/icons-material/MapOutlined";import{TimePicker as _T}from"@ehfuse/mui-datetime-picker";import{InfoAlert as wT}from"@ehfuse/alerts";var dt="@media (max-width: 719.95px)";function Ot(e){return{[dt]:{order:e}}}import{useEffect as Xk,useState as Qk}from"react";import{Box as Zk}from"@mui/material";import{jsx as Jk}from"react/jsx-runtime";function an({value:e,placeholder:o,readOnly:t,onCommit:n}){let r=se(),[i,a]=Qk(e);return Xk(()=>a(e),[e]),Jk(Zk,{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 _l}from"@mui/material";import{jsx as eT,jsxs as hm}from"react/jsx-runtime";function pe({icon:e,label:o,onClick:t,sx:n,children:r}){return hm(_l,{sx:[{display:"flex",alignItems:"center",minHeight:32},...Array.isArray(n)?n:[n]],children:[hm(_l,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,o]}),eT(_l,{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,[dt]:{py:.25}},children:r})]})}import{Suspense as oT,lazy as tT,useEffect as nT,useState as bm}from"react";import{Box as wl,Dialog as rT,DialogContent as iT,DialogTitle as aT,IconButton as km,Tooltip as lT}from"@mui/material";import sT from"@mui/icons-material/Close";import cT from"@mui/icons-material/Search";import{Fragment as pT,jsx as pt,jsxs as Xi}from"react/jsx-runtime";function mT(e){return pt(wl,{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 uT=tT(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:mT})));function dT(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 Tm({value:e,placeholder:o="\uC8FC\uC18C \uC785\uB825",readOnly:t,onCommit:n}){let[r,i]=bm(e),[a,l]=bm(!1),p=Go().slots?.addressSearch;nT(()=>i(e),[e]);let c=d=>{i(d),l(!1),d!==e&&n(d)};return Xi(pT,{children:[Xi(wl,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[pt(wl,{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:pt(lT,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:pt(km,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>l(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:pt(cT,{sx:{fontSize:17}})})})]}),p?pt(p,{open:a,onComplete:c,onClose:()=>l(!1)}):Xi(rT,{open:a,onClose:()=>l(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[Xi(aT,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",pt(km,{onClick:()=>l(!1),size:"small",children:pt(sT,{})})]}),pt(iT,{style:{padding:0},dividers:!0,children:a?pt(oT,{fallback:null,children:pt(uT,{onComplete:d=>{c(dT(d))},onClose:()=>l(!1),defaultQuery:r,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as Zi,jsx as ne,jsxs as ft}from"react/jsx-runtime";function Sm(e){return String(e??"").includes(" ")?Yo(e):et(e)}function DT(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 kr({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return ne(Bm,{component:"span",sx:{color:"#9a9a97"},children:e})}var io=e=>({gridColumn:`${e}`,[dt]:{gridColumn:"auto"}});function Ji({values:e,customTabs:o,avatarSrcByName:t,managerLocked:n=!1,notice:r=!1,event:i=!1,hideDueDate:a=!1,hideReminder:l=!1,beforeStart:p,pinColumns:c=!1,readOnly:m=!1,targetSummary:d="",narrowCollapsedSx:u,reminderLocked:s=!1,managerAction:g,hideProject:T=!1,leading:S,trailing:b,onChangeProject:f,onChangeStartDate:D,onChangeDueDate:B,onChangeReminder:R,onChangePriority:y,onChangeEventTime:I,onChangeEventPlace:P,onChangeEventAddress:_,onMemberEdit:v,onAddProject:$}){let[h,x]=Vn(null),[C,L]=Vn(!1),[N,k]=Vn(null),[w,G]=Vn(null),[ae,ie]=Vn(null),[be,W]=Vn(null),[U,de]=Vn(null),Be=Re(),ve=St(),j=c&&!i,F=(z,me,ke=!1)=>[Ot(z),...ke&&u?Array.isArray(u)?u:[u]:[],...j&&me?[io(me)]:[]],oe=o.find(z=>z.key===e.tabKey),A=o.filter(z=>!z.archived),V=z=>{let me=!!String(e.startDate??"").trim();if(D(z),me||r||i)return;let ke=Na(z);Number.isNaN(ke.getTime())||ke.getTime()<=Date.now()||wT("\uC2DC\uC791\uC77C\uC2DC\uAC00 \uB418\uBA74 \uCC45\uC784\uC790\uC5D0\uAC8C \uC54C\uB9BC\uC774 \uBC1C\uC1A1\uB429\uB2C8\uB2E4.")},te=ne(pe,{icon:ne(BT,{sx:{fontSize:17}}),label:"\uC0AC\uC804\uC54C\uB9BC",onClick:m||s?void 0:z=>G(z),sx:F(i?8:5,2,!0),children:e.reminder==="none"?ne(kr,{label:"\uC5C6\uC74C"}):Za(e.reminder)});return ft(Zi,{children:[ft(Bm,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gridAutoFlow:"row dense",columnGap:3,rowGap:0,px:2,[dt]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[S,T?null:ne(pe,{icon:ne(hT,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:m?void 0:z=>x(z),sx:F(1,1,!0),children:oe?(()=>{let z=Ce(oe.icon);return ft(Zi,{children:[z?ne(z,{sx:{fontSize:16,color:"#1e3a8a"}}):null,oe.label]})})():"\uAE30\uBCF8"}),r?ne(pe,{icon:ne(ym,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:m?void 0:()=>v("targets"),sx:F(7,1),children:d||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!r&&!i?ne(pe,{icon:ne(TT,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:n||m||!e.managerName&&g?void 0:()=>v("manager"),sx:F(7,1),children:e.managerName?ft(Zi,{children:[ne(Ao,{names:[e.managerName],size:20,avatarSrcByName:t}),e.managerName]}):g??ne(kr,{})}):null,p,i?null:ne(pe,{icon:ne(bT,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC2DC",onClick:m?void 0:z=>ie(z),sx:F(2,2),children:e.startDate?Sm(e.startDate):ne(kr,{})}),r?null:ne(pe,{icon:ne(ym,{sx:{fontSize:17}}),label:i?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:m?void 0:()=>v("receivers"),sx:F(i?7:8,1),children:e.receiverNames.length>0?ft(Zi,{children:[ne(Ao,{names:e.receiverNames,size:20,avatarSrcByName:t}),e.receiverNames.length===1?e.receiverNames[0]:null]}):ne(kr,{})}),a?null:ne(pe,{icon:ne(kT,{sx:{fontSize:17}}),label:i?"\uB0A0\uC9DC":"\uB9C8\uAC10\uC77C\uC2DC",onClick:m?void 0:z=>W(z),sx:F(3,2),children:e.dueDate?i?et(e.dueDate):Sm(e.dueDate):ne(kr,{})}),i?ne(pe,{icon:ne(ST,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:m?void 0:z=>de(z),sx:Ot(4),children:e.eventTime?e.eventTime:ne(kr,{label:"\uC885\uC77C"})}):null,i?ne(pe,{icon:ne(vT,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:Ot(5),children:ne(an,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:m,onCommit:z=>P?.(z)})}):null,!l&&i?te:null,i?ne(pe,{icon:ne(IT,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},Ot(6)],children:ne(Tm,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:m,onCommit:z=>_?.(z)})}):null,i?null:ne(pe,{icon:ne(yT,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:m?void 0:z=>k(z),sx:F(6,1,!0),children:ne(jo,{priority:e.priority,small:!0})}),!l&&!i?te:null,b]}),ft(Dl,{transitionDuration:0,anchorEl:h,open:!!h,onClose:()=>x(null),...ve,children:[ft(Qr,{selected:!e.tabKey,onClick:()=>{f(""),x(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ne(CT,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:ne(Qi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),A.map(z=>{let me=Ce(z.icon),ke=e.tabKey===z.key;return ft(Qr,{selected:ke,onClick:()=>{f(z.key),x(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[me?ne(me,{sx:{fontSize:17,color:"#1e3a8a"}}):null,z.label,ke?ne(Qi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},z.key)}),$?[ne(fT,{},"add-project-divider"),ft(Qr,{onClick:()=>L(!0),sx:{fontSize:14,color:"#787774"},children:[ne(xT,{children:ne(gT,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),$?ne(Mi,{open:C,onClose:()=>L(!1),onSubmit:(z,me,ke)=>{(async()=>{let He=await $(z,me,ke);He&&f(He)})(),x(null)}}):null,ne(Dl,{transitionDuration:0,anchorEl:N,open:!!N,onClose:()=>k(null),...ve,children:["high","medium","low"].map(z=>ft(Qr,{selected:e.priority===z,onClick:()=>{y(z),k(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[ne(jo,{priority:z,small:!0}),e.priority===z?ne(Qi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},z))}),ne(Dl,{transitionDuration:0,anchorEl:w,open:!!w,onClose:()=>G(null),...ve,children:Qa(i?!!e.eventTime:String(e.dueDate??"").includes(" ")).map(z=>ft(Qr,{selected:e.reminder===z.value,onClick:()=>{R(z.value),G(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[z.label,e.reminder===z.value?ne(Qi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},z.value))}),i?ne(_T,{anchorEl:U,open:!!U,onClose:()=>de(null),value:DT(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:Be,locale:"ko",onChange:(z,me)=>{I?.(`${z}:${me}`),de(null)}}):null,ne(ot,{anchorEl:ae,open:!!ae,date:e.startDate,reminder:"none",hideReminder:!0,showTime:!0,centered:Be,onClose:()=>ie(null),onDateChange:V,onReminderChange:()=>{}}),ne(ot,{anchorEl:be,open:!!be,date:e.dueDate,reminder:e.reminder,hideReminder:s||l,showTime:!i,centered:Be,onClose:()=>W(null),onDateChange:B,onReminderChange:R})]})}import{useState as MT}from"react";import{Box as ET,Menu as OT,MenuItem as RT}from"@mui/material";import PT from"@mui/icons-material/RepeatOutlined";import zT from"@mui/icons-material/DevicesOutlined";import qT from"@mui/icons-material/ScreenSearchDesktopOutlined";import AT from"@mui/icons-material/SellOutlined";import LT from"@mui/icons-material/TaskAltOutlined";import{Fragment as Cm,jsx as ho,jsxs as vm}from"react/jsx-runtime";function Ml({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return ho(ET,{component:"span",sx:{color:"#9a9a97"},children:e})}function ea({values:e,readOnly:o=!1,showResolution:t=!1,onChangeRepro:n,onChangeDevice:r,onChangeWhere:i,onChangeVersion:a,onChangeResolution:l}){let[p,c]=MT(null),m=p?.field==="repro"?Oa:p?.field==="device"?Ra:Pa,d=u=>{p?.field==="repro"?n(u):p?.field==="device"?r(u):p?.field==="resolution"&&l?.(u),c(null)};return vm(Cm,{children:[vm(Cm,{children:[ho(pe,{icon:ho(PT,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:o?void 0:u=>c({field:"repro",el:u}),children:Ls(e.repro)||ho(Ml,{label:"\uC120\uD0DD"})}),ho(pe,{icon:ho(zT,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:o?void 0:u=>c({field:"device",el:u}),children:Ns(e.device)||ho(Ml,{label:"\uC120\uD0DD"})}),ho(pe,{icon:ho(qT,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:ho(an,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:o,onCommit:i})}),ho(pe,{icon:ho(AT,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:ho(an,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:o,onCommit:a})}),t?ho(pe,{icon:ho(LT,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:o?void 0:u=>c({field:"resolution",el:u}),children:fi(e.resolution)||ho(Ml,{label:"\uC120\uD0DD"})}):null]}),ho(OT,{open:!!p,anchorEl:p?.el??null,onClose:()=>c(null),transitionDuration:0,children:m.map(u=>ho(RT,{onClick:()=>d(u.key),sx:{fontSize:14},children:u.name},u.key))})]})}import{Box as Im}from"@mui/material";import{jsxs as _m}from"react/jsx-runtime";var El=16;function rt({icon:e,title:o,titleExtra:t,children:n}){return _m(Im,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[_m(Im,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:El,fontWeight:500,color:"#37352f"},children:[e,o,t]}),n]})}import{useEffect as Ol,useRef as Kn,useState as NT}from"react";import{Box as Rl,IconButton as FT,Tooltip as HT}from"@mui/material";import WT from"@mui/icons-material/ContentCopyOutlined";import $T from"@mui/icons-material/Check";import{EhfuseEditor as VT,minimalToolbarOptions as KT}from"@ehfuse/editor";import{jsx as Un,jsxs as GT}from"react/jsx-runtime";function Pl(e){let o=e.trim();return o?o.startsWith("<")?e:`<p>${o}</p>`:"<p></p>"}function UT(e){let o=e.replace(/<br\s*\/?>/gi,`
1
+ var rp=Object.create;var Gc=Object.defineProperty;var np=Object.getOwnPropertyDescriptor;var op=Object.getOwnPropertyNames;var ip=Object.getPrototypeOf,sp=Object.prototype.hasOwnProperty;var vi=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(p,b)=>(typeof require<"u"?require:p)[b]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ap=(e,p)=>()=>(p||e((p={exports:{}}).exports,p),p.exports);var lp=(e,p,b,c)=>{if(p&&typeof p=="object"||typeof p=="function")for(let i of op(p))!sp.call(e,i)&&i!==b&&Gc(e,i,{get:()=>p[i],enumerable:!(c=np(p,i))||c.enumerable});return e};var cp=(e,p,b)=>(b=e!=null?rp(ip(e)):{},lp(p||!e||!e.__esModule?Gc(b,"default",{value:e,enumerable:!0}):b,e));var tp=ap((ep,Uc)=>{(function(e){typeof ep=="object"&&typeof Uc<"u"?Uc.exports=e():typeof define=="function"&&define.amd?define([],e):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).ExcelJS=e()})((function(){return(function e(p,b,c){function i(t,n){if(!b[t]){if(!p[t]){var l=typeof vi=="function"&&vi;if(!n&&l)return l(t,!0);if(a)return a(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var s=b[t]={exports:{}};p[t][0].call(s.exports,(function(f){return i(p[t][1][f]||f)}),s,s.exports,e,p,b,c)}return b[t].exports}for(var a=typeof vi=="function"&&vi,r=0;r<c.length;r++)i(c[r]);return i})({1:[function(e,p,b){"use strict";let c=e("fs"),i=e("fast-csv"),a=e("dayjs/plugin/customParseFormat"),r=e("dayjs/plugin/utc"),t=e("dayjs").extend(a).extend(r),n=e("../utils/stream-buf"),{fs:{exists:l}}=e("../utils/utils"),o={true:!0,false:!1,"#N/A":{error:"#N/A"},"#REF!":{error:"#REF!"},"#NAME?":{error:"#NAME?"},"#DIV/0!":{error:"#DIV/0!"},"#NULL!":{error:"#NULL!"},"#VALUE!":{error:"#VALUE!"},"#NUM!":{error:"#NUM!"}};p.exports=class{constructor(s){this.workbook=s,this.worksheet=null}async readFile(s,f){if(f=f||{},!await l(s))throw new Error("File not found: "+s);let d=c.createReadStream(s),u=await this.read(d,f);return d.close(),u}read(s,f){return f=f||{},new Promise((d,u)=>{let g=this.workbook.addWorksheet(f.sheetName),m=f.dateFormats||["YYYY-MM-DD[T]HH:mm:ssZ","YYYY-MM-DD[T]HH:mm:ss","MM-DD-YYYY","YYYY-MM-DD"],v=f.map||function(B){if(B==="")return null;let O=Number(B);if(!Number.isNaN(O)&&O!==1/0)return O;let L=m.reduce((P,j)=>{if(P)return P;let z=t(B,j,!0);return z.isValid()?z:null},null);if(L)return new Date(L.valueOf());let R=o[B];return R!==void 0?R:B},k=i.parse(f.parserOptions).on("data",B=>{g.addRow(B.map(v))}).on("end",()=>{k.emit("worksheet",g)});k.on("worksheet",d).on("error",u),s.pipe(k)})}createInputStream(){throw new Error("`CSV#createInputStream` is deprecated. You should use `CSV#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}write(s,f){return new Promise((d,u)=>{f=f||{};let g=this.workbook.getWorksheet(f.sheetName||f.sheetId),m=i.format(f.formatterOptions);s.on("finish",()=>{d()}),m.on("error",u),m.pipe(s);let{dateFormat:v,dateUTC:k}=f,B=f.map||(R=>{if(R){if(R.text||R.hyperlink)return R.hyperlink||R.text||"";if(R.formula||R.result)return R.result||"";if(R instanceof Date)return v?k?t.utc(R).format(v):t(R).format(v):k?t.utc(R).format():t(R).format();if(R.error)return R.error;if(typeof R=="object")return JSON.stringify(R)}return R}),O=f.includeEmptyRows===void 0||f.includeEmptyRows,L=1;g&&g.eachRow((R,P)=>{if(O)for(;L++<P-1;)m.write([]);let{values:j}=R;j.shift(),m.write(j.map(B)),L=P}),m.end()})}writeFile(s,f){let d={encoding:(f=f||{}).encoding||"utf8"},u=c.createWriteStream(s,d);return this.write(u,f)}async writeBuffer(s){let f=new n;return await this.write(f,s),f.read()}}},{"../utils/stream-buf":24,"../utils/utils":27,dayjs:391,"dayjs/plugin/customParseFormat":392,"dayjs/plugin/utc":393,"fast-csv":424,fs:216}],2:[function(e,p,b){"use strict";let c=e("../utils/col-cache");class i{constructor(r,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(this.worksheet=r,t)if(typeof t=="string"){let l=c.decodeAddress(t);this.nativeCol=l.col+n,this.nativeColOff=0,this.nativeRow=l.row+n,this.nativeRowOff=0}else t.nativeCol!==void 0?(this.nativeCol=t.nativeCol||0,this.nativeColOff=t.nativeColOff||0,this.nativeRow=t.nativeRow||0,this.nativeRowOff=t.nativeRowOff||0):t.col!==void 0?(this.col=t.col+n,this.row=t.row+n):(this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0);else this.nativeCol=0,this.nativeColOff=0,this.nativeRow=0,this.nativeRowOff=0}static asInstance(r){return r instanceof i||r==null?r:new i(r)}get col(){return this.nativeCol+Math.min(this.colWidth-1,this.nativeColOff)/this.colWidth}set col(r){this.nativeCol=Math.floor(r),this.nativeColOff=Math.floor((r-this.nativeCol)*this.colWidth)}get row(){return this.nativeRow+Math.min(this.rowHeight-1,this.nativeRowOff)/this.rowHeight}set row(r){this.nativeRow=Math.floor(r),this.nativeRowOff=Math.floor((r-this.nativeRow)*this.rowHeight)}get colWidth(){return this.worksheet&&this.worksheet.getColumn(this.nativeCol+1)&&this.worksheet.getColumn(this.nativeCol+1).isCustomWidth?Math.floor(1e4*this.worksheet.getColumn(this.nativeCol+1).width):64e4}get rowHeight(){return this.worksheet&&this.worksheet.getRow(this.nativeRow+1)&&this.worksheet.getRow(this.nativeRow+1).height?Math.floor(1e4*this.worksheet.getRow(this.nativeRow+1).height):18e4}get model(){return{nativeCol:this.nativeCol,nativeColOff:this.nativeColOff,nativeRow:this.nativeRow,nativeRowOff:this.nativeRowOff}}set model(r){this.nativeCol=r.nativeCol,this.nativeColOff=r.nativeColOff,this.nativeRow=r.nativeRow,this.nativeRowOff=r.nativeRowOff}}p.exports=i},{"../utils/col-cache":19}],3:[function(e,p,b){"use strict";let c=e("../utils/col-cache"),i=e("../utils/under-dash"),a=e("./enums"),{slideFormula:r}=e("../utils/shared-formula"),t=e("./note");class n{constructor(s,f,d){if(!s||!f)throw new Error("A Cell needs a Row");this._row=s,this._column=f,c.validateAddress(d),this._address=d,this._value=l.create(n.Types.Null,this),this.style=this._mergeStyle(s.style,f.style,{}),this._mergeCount=0}get worksheet(){return this._row.worksheet}get workbook(){return this._row.worksheet.workbook}destroy(){delete this.style,delete this._value,delete this._row,delete this._column,delete this._address}get numFmt(){return this.style.numFmt}set numFmt(s){this.style.numFmt=s}get font(){return this.style.font}set font(s){this.style.font=s}get alignment(){return this.style.alignment}set alignment(s){this.style.alignment=s}get border(){return this.style.border}set border(s){this.style.border=s}get fill(){return this.style.fill}set fill(s){this.style.fill=s}get protection(){return this.style.protection}set protection(s){this.style.protection=s}_mergeStyle(s,f,d){let u=s&&s.numFmt||f&&f.numFmt;u&&(d.numFmt=u);let g=s&&s.font||f&&f.font;g&&(d.font=g);let m=s&&s.alignment||f&&f.alignment;m&&(d.alignment=m);let v=s&&s.border||f&&f.border;v&&(d.border=v);let k=s&&s.fill||f&&f.fill;k&&(d.fill=k);let B=s&&s.protection||f&&f.protection;return B&&(d.protection=B),d}get address(){return this._address}get row(){return this._row.number}get col(){return this._column.number}get $col$row(){return`$${this._column.letter}$${this.row}`}get type(){return this._value.type}get effectiveType(){return this._value.effectiveType}toCsvString(){return this._value.toCsvString()}addMergeRef(){this._mergeCount++}releaseMergeRef(){this._mergeCount--}get isMerged(){return this._mergeCount>0||this.type===n.Types.Merge}merge(s,f){this._value.release(),this._value=l.create(n.Types.Merge,this,s),f||(this.style=s.style)}unmerge(){this.type===n.Types.Merge&&(this._value.release(),this._value=l.create(n.Types.Null,this),this.style=this._mergeStyle(this._row.style,this._column.style,{}))}isMergedTo(s){return this._value.type===n.Types.Merge&&this._value.isMergedTo(s)}get master(){return this.type===n.Types.Merge?this._value.master:this}get isHyperlink(){return this._value.type===n.Types.Hyperlink}get hyperlink(){return this._value.hyperlink}get value(){return this._value.value}set value(s){this.type!==n.Types.Merge?(this._value.release(),this._value=l.create(l.getType(s),this,s)):this._value.master.value=s}get note(){return this._comment&&this._comment.note}set note(s){this._comment=new t(s)}get text(){return this._value.toString()}get html(){return i.escapeHtml(this.text)}toString(){return this.text}_upgradeToHyperlink(s){this.type===n.Types.String&&(this._value=l.create(n.Types.Hyperlink,this,{text:this._value.value,hyperlink:s}))}get formula(){return this._value.formula}get result(){return this._value.result}get formulaType(){return this._value.formulaType}get fullAddress(){let{worksheet:s}=this._row;return{sheetName:s.name,address:this.address,row:this.row,col:this.col}}get name(){return this.names[0]}set name(s){this.names=[s]}get names(){return this.workbook.definedNames.getNamesEx(this.fullAddress)}set names(s){let{definedNames:f}=this.workbook;f.removeAllNames(this.fullAddress),s.forEach(d=>{f.addEx(this.fullAddress,d)})}addName(s){this.workbook.definedNames.addEx(this.fullAddress,s)}removeName(s){this.workbook.definedNames.removeEx(this.fullAddress,s)}removeAllNames(){this.workbook.definedNames.removeAllNames(this.fullAddress)}get _dataValidations(){return this.worksheet.dataValidations}get dataValidation(){return this._dataValidations.find(this.address)}set dataValidation(s){this._dataValidations.add(this.address,s)}get model(){let{model:s}=this._value;return s.style=this.style,this._comment&&(s.comment=this._comment.model),s}set model(s){this._value.release(),this._value=l.create(s.type,this),this._value.model=s,s.comment&&s.comment.type==="note"&&(this._comment=t.fromModel(s.comment)),s.style?this.style=s.style:this.style={}}}n.Types=a.ValueType;let l={getType:o=>o==null?n.Types.Null:o instanceof String||typeof o=="string"?n.Types.String:typeof o=="number"?n.Types.Number:typeof o=="boolean"?n.Types.Boolean:o instanceof Date?n.Types.Date:o.text&&o.hyperlink?n.Types.Hyperlink:o.formula||o.sharedFormula?n.Types.Formula:o.richText?n.Types.RichText:o.sharedString?n.Types.SharedString:o.error?n.Types.Error:n.Types.JSON,types:[{t:n.Types.Null,f:class{constructor(o){this.model={address:o.address,type:n.Types.Null}}get value(){return null}set value(o){}get type(){return n.Types.Null}get effectiveType(){return n.Types.Null}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return""}release(){}toString(){return""}}},{t:n.Types.Number,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.Number,value:s}}get value(){return this.model.value}set value(o){this.model.value=o}get type(){return n.Types.Number}get effectiveType(){return n.Types.Number}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:n.Types.String,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.String,value:s}}get value(){return this.model.value}set value(o){this.model.value=o}get type(){return n.Types.String}get effectiveType(){return n.Types.String}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return`"${this.model.value.replace(/"/g,'""')}"`}release(){}toString(){return this.model.value}}},{t:n.Types.Date,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.Date,value:s}}get value(){return this.model.value}set value(o){this.model.value=o}get type(){return n.Types.Date}get effectiveType(){return n.Types.Date}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return this.model.value.toISOString()}release(){}toString(){return this.model.value.toString()}}},{t:n.Types.Hyperlink,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.Hyperlink,text:s?s.text:void 0,hyperlink:s?s.hyperlink:void 0},s&&s.tooltip&&(this.model.tooltip=s.tooltip)}get value(){let o={text:this.model.text,hyperlink:this.model.hyperlink};return this.model.tooltip&&(o.tooltip=this.model.tooltip),o}set value(o){this.model={text:o.text,hyperlink:o.hyperlink},o.tooltip&&(this.model.tooltip=o.tooltip)}get text(){return this.model.text}set text(o){this.model.text=o}get hyperlink(){return this.model.hyperlink}set hyperlink(o){this.model.hyperlink=o}get type(){return n.Types.Hyperlink}get effectiveType(){return n.Types.Hyperlink}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return this.model.hyperlink}release(){}toString(){return this.model.text}}},{t:n.Types.Formula,f:class{constructor(o,s){this.cell=o,this.model={address:o.address,type:n.Types.Formula,shareType:s?s.shareType:void 0,ref:s?s.ref:void 0,formula:s?s.formula:void 0,sharedFormula:s?s.sharedFormula:void 0,result:s?s.result:void 0}}_copyModel(o){let s={},f=d=>{let u=o[d];u&&(s[d]=u)};return f("formula"),f("result"),f("ref"),f("shareType"),f("sharedFormula"),s}get value(){return this._copyModel(this.model)}set value(o){this.model=this._copyModel(o)}validate(o){switch(l.getType(o)){case n.Types.Null:case n.Types.String:case n.Types.Number:case n.Types.Date:break;case n.Types.Hyperlink:case n.Types.Formula:default:throw new Error("Cannot process that type of result value")}}get dependencies(){return{ranges:this.formula.match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g),cells:this.formula.replace(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}:[A-Z]{1,3}\d{1,4}/g,"").match(/([a-zA-Z0-9]+!)?[A-Z]{1,3}\d{1,4}/g)}}get formula(){return this.model.formula||this._getTranslatedFormula()}set formula(o){this.model.formula=o}get formulaType(){return this.model.formula?a.FormulaType.Master:this.model.sharedFormula?a.FormulaType.Shared:a.FormulaType.None}get result(){return this.model.result}set result(o){this.model.result=o}get type(){return n.Types.Formula}get effectiveType(){let o=this.model.result;return o==null?a.ValueType.Null:o instanceof String||typeof o=="string"?a.ValueType.String:typeof o=="number"?a.ValueType.Number:o instanceof Date?a.ValueType.Date:o.text&&o.hyperlink?a.ValueType.Hyperlink:o.formula?a.ValueType.Formula:a.ValueType.Null}get address(){return this.model.address}set address(o){this.model.address=o}_getTranslatedFormula(){if(!this._translatedFormula&&this.model.sharedFormula){let{worksheet:o}=this.cell,s=o.findCell(this.model.sharedFormula);this._translatedFormula=s&&r(s.formula,s.address,this.model.address)}return this._translatedFormula}toCsvString(){return""+(this.model.result||"")}release(){}toString(){return this.model.result?this.model.result.toString():""}}},{t:n.Types.Merge,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.Merge,master:s?s.address:void 0},this._master=s,s&&s.addMergeRef()}get value(){return this._master.value}set value(o){o instanceof n?(this._master&&this._master.releaseMergeRef(),o.addMergeRef(),this._master=o):this._master.value=o}isMergedTo(o){return o===this._master}get master(){return this._master}get type(){return n.Types.Merge}get effectiveType(){return this._master.effectiveType}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return""}release(){this._master.releaseMergeRef()}toString(){return this.value.toString()}}},{t:n.Types.JSON,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.String,value:JSON.stringify(s),rawValue:s}}get value(){return this.model.rawValue}set value(o){this.model.rawValue=o,this.model.value=JSON.stringify(o)}get type(){return n.Types.String}get effectiveType(){return n.Types.String}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return this.model.value}release(){}toString(){return this.model.value}}},{t:n.Types.SharedString,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.SharedString,value:s}}get value(){return this.model.value}set value(o){this.model.value=o}get type(){return n.Types.SharedString}get effectiveType(){return n.Types.SharedString}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return this.model.value.toString()}release(){}toString(){return this.model.value.toString()}}},{t:n.Types.RichText,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.String,value:s}}get value(){return this.model.value}set value(o){this.model.value=o}toString(){return this.model.value.richText.map(o=>o.text).join("")}get type(){return n.Types.RichText}get effectiveType(){return n.Types.RichText}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return`"${this.text.replace(/"/g,'""')}"`}release(){}}},{t:n.Types.Boolean,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.Boolean,value:s}}get value(){return this.model.value}set value(o){this.model.value=o}get type(){return n.Types.Boolean}get effectiveType(){return n.Types.Boolean}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return this.model.value?1:0}release(){}toString(){return this.model.value.toString()}}},{t:n.Types.Error,f:class{constructor(o,s){this.model={address:o.address,type:n.Types.Error,value:s}}get value(){return this.model.value}set value(o){this.model.value=o}get type(){return n.Types.Error}get effectiveType(){return n.Types.Error}get address(){return this.model.address}set address(o){this.model.address=o}toCsvString(){return this.toString()}release(){}toString(){return this.model.value.error.toString()}}}].reduce((o,s)=>(o[s.t]=s.f,o),[]),create(o,s,f){let d=this.types[o];if(!d)throw new Error("Could not create Value of type "+o);return new d(s,f)}};p.exports=n},{"../utils/col-cache":19,"../utils/shared-formula":23,"../utils/under-dash":26,"./enums":7,"./note":9}],4:[function(e,p,b){"use strict";let c=e("../utils/under-dash"),i=e("./enums"),a=e("../utils/col-cache");class r{constructor(n,l,o){this._worksheet=n,this._number=l,o!==!1&&(this.defn=o)}get number(){return this._number}get worksheet(){return this._worksheet}get letter(){return a.n2l(this._number)}get isCustomWidth(){return this.width!==void 0&&this.width!==9}get defn(){return{header:this._header,key:this.key,width:this.width,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel}}set defn(n){n?(this.key=n.key,this.width=n.width!==void 0?n.width:9,this.outlineLevel=n.outlineLevel,n.style?this.style=n.style:this.style={},this.header=n.header,this._hidden=!!n.hidden):(delete this._header,delete this._key,delete this.width,this.style={},this.outlineLevel=0)}get headers(){return this._header&&this._header instanceof Array?this._header:[this._header]}get header(){return this._header}set header(n){n!==void 0?(this._header=n,this.headers.forEach((l,o)=>{this._worksheet.getCell(o+1,this.number).value=l})):this._header=void 0}get key(){return this._key}set key(n){(this._key&&this._worksheet.getColumnKey(this._key))===this&&this._worksheet.deleteColumnKey(this._key),this._key=n,n&&this._worksheet.setColumnKey(this._key,this)}get hidden(){return!!this._hidden}set hidden(n){this._hidden=n}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(n){this._outlineLevel=n}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelCol)}toString(){return JSON.stringify({key:this.key,width:this.width,headers:this.headers.length?this.headers:void 0})}equivalentTo(n){return this.width===n.width&&this.hidden===n.hidden&&this.outlineLevel===n.outlineLevel&&c.isEqual(this.style,n.style)}get isDefault(){if(this.isCustomWidth||this.hidden||this.outlineLevel)return!1;let n=this.style;return!n||!(n.font||n.numFmt||n.alignment||n.border||n.fill||n.protection)}get headerCount(){return this.headers.length}eachCell(n,l){let o=this.number;l||(l=n,n=null),this._worksheet.eachRow(n,(s,f)=>{l(s.getCell(o),f)})}get values(){let n=[];return this.eachCell((l,o)=>{l&&l.type!==i.ValueType.Null&&(n[o]=l.value)}),n}set values(n){if(!n)return;let l=this.number,o=0;n.hasOwnProperty("0")&&(o=1),n.forEach((s,f)=>{this._worksheet.getCell(f+o,l).value=s})}_applyStyle(n,l){return this.style[n]=l,this.eachCell(o=>{o[n]=l}),l}get numFmt(){return this.style.numFmt}set numFmt(n){this._applyStyle("numFmt",n)}get font(){return this.style.font}set font(n){this._applyStyle("font",n)}get alignment(){return this.style.alignment}set alignment(n){this._applyStyle("alignment",n)}get protection(){return this.style.protection}set protection(n){this._applyStyle("protection",n)}get border(){return this.style.border}set border(n){this._applyStyle("border",n)}get fill(){return this.style.fill}set fill(n){this._applyStyle("fill",n)}static toModel(n){let l=[],o=null;return n&&n.forEach((s,f)=>{s.isDefault?o&&(o=null):o&&s.equivalentTo(o)?o.max=f+1:(o={min:f+1,max:f+1,width:s.width!==void 0?s.width:9,style:s.style,isCustomWidth:s.isCustomWidth,hidden:s.hidden,outlineLevel:s.outlineLevel,collapsed:s.collapsed},l.push(o))}),l.length?l:void 0}static fromModel(n,l){let o=[],s=1,f=0;for(l=(l=l||[]).sort((function(d,u){return d.min-u.min}));f<l.length;){let d=l[f++];for(;s<d.min;)o.push(new r(n,s++));for(;s<=d.max;)o.push(new r(n,s++,d))}return o.length?o:null}}p.exports=r},{"../utils/col-cache":19,"../utils/under-dash":26,"./enums":7}],5:[function(e,p,b){"use strict";p.exports=class{constructor(c){this.model=c||{}}add(c,i){return this.model[c]=i}find(c){return this.model[c]}remove(c){this.model[c]=void 0}}},{}],6:[function(e,p,b){"use strict";let c=e("../utils/under-dash"),i=e("../utils/col-cache"),a=e("../utils/cell-matrix"),r=e("./range"),t=/[$](\w+)[$](\d+)(:[$](\w+)[$](\d+))?/;p.exports=class{constructor(){this.matrixMap={}}getMatrix(n){return this.matrixMap[n]||(this.matrixMap[n]=new a)}add(n,l){let o=i.decodeEx(n);this.addEx(o,l)}addEx(n,l){let o=this.getMatrix(l);if(n.top)for(let s=n.left;s<=n.right;s++)for(let f=n.top;f<=n.bottom;f++){let d={sheetName:n.sheetName,address:i.n2l(s)+f,row:f,col:s};o.addCellEx(d)}else o.addCellEx(n)}remove(n,l){let o=i.decodeEx(n);this.removeEx(o,l)}removeEx(n,l){this.getMatrix(l).removeCellEx(n)}removeAllNames(n){c.each(this.matrixMap,l=>{l.removeCellEx(n)})}forEach(n){c.each(this.matrixMap,(l,o)=>{l.forEach(s=>{n(o,s)})})}getNames(n){return this.getNamesEx(i.decodeEx(n))}getNamesEx(n){return c.map(this.matrixMap,(l,o)=>l.findCellEx(n)&&o).filter(Boolean)}_explore(n,l){l.mark=!1;let{sheetName:o}=l,s=new r(l.row,l.col,l.row,l.col,o),f,d;function u(m,v){let k=n.findCellAt(o,m,l.col);return!(!k||!k.mark)&&(s[v]=m,k.mark=!1,!0)}for(d=l.row-1;u(d,"top");d--);for(d=l.row+1;u(d,"bottom");d++);function g(m,v){let k=[];for(d=s.top;d<=s.bottom;d++){let B=n.findCellAt(o,d,m);if(!B||!B.mark)return!1;k.push(B)}s[v]=m;for(let B=0;B<k.length;B++)k[B].mark=!1;return!0}for(f=l.col-1;g(f,"left");f--);for(f=l.col+1;g(f,"right");f++);return s}getRanges(n,l){return(l=l||this.matrixMap[n])?(l.forEach(o=>{o.mark=!0}),{name:n,ranges:l.map(o=>o.mark&&this._explore(l,o)).filter(Boolean).map(o=>o.$shortRange)}):{name:n,ranges:[]}}normaliseMatrix(n,l){n.forEachInSheet(l,(o,s,f)=>{o&&(o.row===s&&o.col===f||(o.row=s,o.col=f,o.address=i.n2l(f)+s))})}spliceRows(n,l,o,s){c.each(this.matrixMap,f=>{f.spliceRows(n,l,o,s),this.normaliseMatrix(f,n)})}spliceColumns(n,l,o,s){c.each(this.matrixMap,f=>{f.spliceColumns(n,l,o,s),this.normaliseMatrix(f,n)})}get model(){return c.map(this.matrixMap,(n,l)=>this.getRanges(l,n)).filter(n=>n.ranges.length)}set model(n){let l=this.matrixMap={};n.forEach(o=>{let s=l[o.name]=new a;o.ranges.forEach(f=>{t.test(f.split("!").pop()||"")&&s.addCell(f)})})}}},{"../utils/cell-matrix":18,"../utils/col-cache":19,"../utils/under-dash":26,"./range":10}],7:[function(e,p,b){"use strict";p.exports={ValueType:{Null:0,Merge:1,Number:2,String:3,Date:4,Hyperlink:5,Formula:6,SharedString:7,RichText:8,Boolean:9,Error:10},FormulaType:{None:0,Master:1,Shared:2},RelationshipType:{None:0,OfficeDocument:1,Worksheet:2,CalcChain:3,SharedStrings:4,Styles:5,Theme:6,Hyperlink:7},DocumentType:{Xlsx:1},ReadingOrder:{LeftToRight:1,RightToLeft:2},ErrorValue:{NotApplicable:"#N/A",Ref:"#REF!",Name:"#NAME?",DivZero:"#DIV/0!",Null:"#NULL!",Value:"#VALUE!",Num:"#NUM!"}}},{}],8:[function(e,p,b){"use strict";let c=e("../utils/col-cache"),i=e("./anchor");p.exports=class{constructor(a,r){this.worksheet=a,this.model=r}get model(){switch(this.type){case"background":return{type:this.type,imageId:this.imageId};case"image":return{type:this.type,imageId:this.imageId,hyperlinks:this.range.hyperlinks,range:{tl:this.range.tl.model,br:this.range.br&&this.range.br.model,ext:this.range.ext,editAs:this.range.editAs}};default:throw new Error("Invalid Image Type")}}set model(a){let{type:r,imageId:t,range:n,hyperlinks:l}=a;if(this.type=r,this.imageId=t,r==="image")if(typeof n=="string"){let o=c.decode(n);this.range={tl:new i(this.worksheet,{col:o.left,row:o.top},-1),br:new i(this.worksheet,{col:o.right,row:o.bottom},0),editAs:"oneCell"}}else this.range={tl:new i(this.worksheet,n.tl,0),br:n.br&&new i(this.worksheet,n.br,0),ext:n.ext,editAs:n.editAs,hyperlinks:l||n.hyperlinks}}}},{"../utils/col-cache":19,"./anchor":2}],9:[function(e,p,b){"use strict";let c=e("../utils/under-dash");class i{constructor(r){this.note=r}get model(){let r=null;return typeof this.note==="string"?r={type:"note",note:{texts:[{text:this.note}]}}:r={type:"note",note:this.note},c.deepMerge({},i.DEFAULT_CONFIGS,r)}set model(r){let{note:t}=r,{texts:n}=t;n.length===1&&Object.keys(n[0]).length===1?this.note=n[0].text:this.note=t}static fromModel(r){let t=new i;return t.model=r,t}}i.DEFAULT_CONFIGS={note:{margins:{insetmode:"auto",inset:[.13,.13,.25,.25]},protection:{locked:"True",lockText:"True"},editAs:"absolute"}},p.exports=i},{"../utils/under-dash":26}],10:[function(e,p,b){"use strict";let c=e("../utils/col-cache");class i{constructor(){this.decode(arguments)}setTLBR(r,t,n,l,o){if(arguments.length<4){let s=c.decodeAddress(r),f=c.decodeAddress(t);this.model={top:Math.min(s.row,f.row),left:Math.min(s.col,f.col),bottom:Math.max(s.row,f.row),right:Math.max(s.col,f.col),sheetName:n},this.setTLBR(s.row,s.col,f.row,f.col,o)}else this.model={top:Math.min(r,n),left:Math.min(t,l),bottom:Math.max(r,n),right:Math.max(t,l),sheetName:o}}decode(r){switch(r.length){case 5:this.setTLBR(r[0],r[1],r[2],r[3],r[4]);break;case 4:this.setTLBR(r[0],r[1],r[2],r[3]);break;case 3:this.setTLBR(r[0],r[1],r[2]);break;case 2:this.setTLBR(r[0],r[1]);break;case 1:{let t=r[0];if(t instanceof i)this.model={top:t.model.top,left:t.model.left,bottom:t.model.bottom,right:t.model.right,sheetName:t.sheetName};else if(t instanceof Array)this.decode(t);else if(t.top&&t.left&&t.bottom&&t.right)this.model={top:t.top,left:t.left,bottom:t.bottom,right:t.right,sheetName:t.sheetName};else{let n=c.decodeEx(t);n.top?this.model={top:n.top,left:n.left,bottom:n.bottom,right:n.right,sheetName:n.sheetName}:this.model={top:n.row,left:n.col,bottom:n.row,right:n.col,sheetName:n.sheetName}}break}case 0:this.model={top:0,left:0,bottom:0,right:0};break;default:throw new Error("Invalid number of arguments to _getDimensions() - "+r.length)}}get top(){return this.model.top||1}set top(r){this.model.top=r}get left(){return this.model.left||1}set left(r){this.model.left=r}get bottom(){return this.model.bottom||1}set bottom(r){this.model.bottom=r}get right(){return this.model.right||1}set right(r){this.model.right=r}get sheetName(){return this.model.sheetName}set sheetName(r){this.model.sheetName=r}get _serialisedSheetName(){let{sheetName:r}=this.model;return r?/^[a-zA-Z0-9]*$/.test(r)?r+"!":`'${r}'!`:""}expand(r,t,n,l){(!this.model.top||r<this.top)&&(this.top=r),(!this.model.left||t<this.left)&&(this.left=t),(!this.model.bottom||n>this.bottom)&&(this.bottom=n),(!this.model.right||l>this.right)&&(this.right=l)}expandRow(r){if(r){let{dimensions:t,number:n}=r;t&&this.expand(n,t.min,n,t.max)}}expandToAddress(r){let t=c.decodeEx(r);this.expand(t.row,t.col,t.row,t.col)}get tl(){return c.n2l(this.left)+this.top}get $t$l(){return`$${c.n2l(this.left)}$${this.top}`}get br(){return c.n2l(this.right)+this.bottom}get $b$r(){return`$${c.n2l(this.right)}$${this.bottom}`}get range(){return`${this._serialisedSheetName+this.tl}:${this.br}`}get $range(){return`${this._serialisedSheetName+this.$t$l}:${this.$b$r}`}get shortRange(){return this.count>1?this.range:this._serialisedSheetName+this.tl}get $shortRange(){return this.count>1?this.$range:this._serialisedSheetName+this.$t$l}get count(){return(1+this.bottom-this.top)*(1+this.right-this.left)}toString(){return this.range}intersects(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&!(r.bottom<this.top)&&!(r.top>this.bottom)&&!(r.right<this.left)&&!(r.left>this.right)}contains(r){let t=c.decodeEx(r);return this.containsEx(t)}containsEx(r){return(!r.sheetName||!this.sheetName||r.sheetName===this.sheetName)&&r.row>=this.top&&r.row<=this.bottom&&r.col>=this.left&&r.col<=this.right}forEachAddress(r){for(let t=this.left;t<=this.right;t++)for(let n=this.top;n<=this.bottom;n++)r(c.encodeAddress(n,t),n,t)}}p.exports=i},{"../utils/col-cache":19}],11:[function(e,p,b){"use strict";let c=e("../utils/under-dash"),i=e("./enums"),a=e("../utils/col-cache"),r=e("./cell");p.exports=class{constructor(t,n){this._worksheet=t,this._number=n,this._cells=[],this.style={},this.outlineLevel=0}get number(){return this._number}get worksheet(){return this._worksheet}commit(){this._worksheet._commitRow(this)}destroy(){delete this._worksheet,delete this._cells,delete this.style}findCell(t){return this._cells[t-1]}getCellEx(t){let n=this._cells[t.col-1];if(!n){let l=this._worksheet.getColumn(t.col);n=new r(this,l,t.address),this._cells[t.col-1]=n}return n}getCell(t){if(typeof t=="string"){let n=this._worksheet.getColumnKey(t);t=n?n.number:a.l2n(t)}return this._cells[t-1]||this.getCellEx({address:a.encodeAddress(this._number,t),row:this._number,col:t})}splice(t,n){let l=t+n;for(var o=arguments.length,s=new Array(o>2?o-2:0),f=2;f<o;f++)s[f-2]=arguments[f];let d=s.length-n,u=this._cells.length,g,m,v;if(d<0)for(g=t+s.length;g<=u;g++)v=this._cells[g-1],m=this._cells[g-d-1],m?(v=this.getCell(g),v.value=m.value,v.style=m.style,v._comment=m._comment):v&&(v.value=null,v.style={},v._comment=void 0);else if(d>0)for(g=u;g>=l;g--)m=this._cells[g-1],m?(v=this.getCell(g+d),v.value=m.value,v.style=m.style,v._comment=m._comment):this._cells[g+d-1]=void 0;for(g=0;g<s.length;g++)v=this.getCell(t+g),v.value=s[g],v.style={},v._comment=void 0}eachCell(t,n){if(n||(n=t,t=null),t&&t.includeEmpty){let l=this._cells.length;for(let o=1;o<=l;o++)n(this.getCell(o),o)}else this._cells.forEach((l,o)=>{l&&l.type!==i.ValueType.Null&&n(l,o+1)})}addPageBreak(t,n){let l=this._worksheet,o=Math.max(0,t-1)||0,s=Math.max(0,n-1)||16838,f={id:this._number,max:s,man:1};o&&(f.min=o),l.rowBreaks.push(f)}get values(){let t=[];return this._cells.forEach(n=>{n&&n.type!==i.ValueType.Null&&(t[n.col]=n.value)}),t}set values(t){if(this._cells=[],t)if(t instanceof Array){let n=0;t.hasOwnProperty("0")&&(n=1),t.forEach((l,o)=>{l!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,o+n),row:this._number,col:o+n}).value=l)})}else this._worksheet.eachColumnKey((n,l)=>{t[l]!==void 0&&(this.getCellEx({address:a.encodeAddress(this._number,n.number),row:this._number,col:n.number}).value=t[l])})}get hasValues(){return c.some(this._cells,t=>t&&t.type!==i.ValueType.Null)}get cellCount(){return this._cells.length}get actualCellCount(){let t=0;return this.eachCell(()=>{t++}),t}get dimensions(){let t=0,n=0;return this._cells.forEach(l=>{l&&l.type!==i.ValueType.Null&&((!t||t>l.col)&&(t=l.col),n<l.col&&(n=l.col))}),t>0?{min:t,max:n}:null}_applyStyle(t,n){return this.style[t]=n,this._cells.forEach(l=>{l&&(l[t]=n)}),n}get numFmt(){return this.style.numFmt}set numFmt(t){this._applyStyle("numFmt",t)}get font(){return this.style.font}set font(t){this._applyStyle("font",t)}get alignment(){return this.style.alignment}set alignment(t){this._applyStyle("alignment",t)}get protection(){return this.style.protection}set protection(t){this._applyStyle("protection",t)}get border(){return this.style.border}set border(t){this._applyStyle("border",t)}get fill(){return this.style.fill}set fill(t){this._applyStyle("fill",t)}get hidden(){return!!this._hidden}set hidden(t){this._hidden=t}get outlineLevel(){return this._outlineLevel||0}set outlineLevel(t){this._outlineLevel=t}get collapsed(){return!!(this._outlineLevel&&this._outlineLevel>=this._worksheet.properties.outlineLevelRow)}get model(){let t=[],n=0,l=0;return this._cells.forEach(o=>{if(o){let s=o.model;s&&((!n||n>o.col)&&(n=o.col),l<o.col&&(l=o.col),t.push(s))}}),this.height||t.length?{cells:t,number:this.number,min:n,max:l,height:this.height,style:this.style,hidden:this.hidden,outlineLevel:this.outlineLevel,collapsed:this.collapsed}:null}set model(t){if(t.number!==this._number)throw new Error("Invalid row number in model");let n;this._cells=[],t.cells.forEach(l=>{switch(l.type){case r.Types.Merge:break;default:{let o;if(l.address)o=a.decodeAddress(l.address);else if(n){let{row:s}=n,f=n.col+1;o={row:s,col:f,address:a.encodeAddress(s,f),$col$row:`$${a.n2l(f)}$${s}`}}n=o,this.getCellEx(o).model=l;break}}}),t.height?this.height=t.height:delete this.height,this.hidden=t.hidden,this.outlineLevel=t.outlineLevel||0,this.style=t.style&&JSON.parse(JSON.stringify(t.style))||{}}}},{"../utils/col-cache":19,"../utils/under-dash":26,"./cell":3,"./enums":7}],12:[function(e,p,b){"use strict";let c=e("../utils/col-cache");class i{constructor(r,t,n){this.table=r,this.column=t,this.index=n}_set(r,t){this.table.cacheState(),this.column[r]=t}get name(){return this.column.name}set name(r){this._set("name",r)}get filterButton(){return this.column.filterButton}set filterButton(r){this.column.filterButton=r}get style(){return this.column.style}set style(r){this.column.style=r}get totalsRowLabel(){return this.column.totalsRowLabel}set totalsRowLabel(r){this._set("totalsRowLabel",r)}get totalsRowFunction(){return this.column.totalsRowFunction}set totalsRowFunction(r){this._set("totalsRowFunction",r)}get totalsRowResult(){return this.column.totalsRowResult}set totalsRowResult(r){this._set("totalsRowResult",r)}get totalsRowFormula(){return this.column.totalsRowFormula}set totalsRowFormula(r){this._set("totalsRowFormula",r)}}p.exports=class{constructor(a,r){this.worksheet=a,r&&(this.table=r,this.validate(),this.store())}getFormula(a){switch(a.totalsRowFunction){case"none":return null;case"average":return`SUBTOTAL(101,${this.table.name}[${a.name}])`;case"countNums":return`SUBTOTAL(102,${this.table.name}[${a.name}])`;case"count":return`SUBTOTAL(103,${this.table.name}[${a.name}])`;case"max":return`SUBTOTAL(104,${this.table.name}[${a.name}])`;case"min":return`SUBTOTAL(105,${this.table.name}[${a.name}])`;case"stdDev":return`SUBTOTAL(106,${this.table.name}[${a.name}])`;case"var":return`SUBTOTAL(107,${this.table.name}[${a.name}])`;case"sum":return`SUBTOTAL(109,${this.table.name}[${a.name}])`;case"custom":return a.totalsRowFormula;default:throw new Error("Invalid Totals Row Function: "+a.totalsRowFunction)}}get width(){return this.table.columns.length}get height(){return this.table.rows.length}get filterHeight(){return this.height+(this.table.headerRow?1:0)}get tableHeight(){return this.filterHeight+(this.table.totalsRow?1:0)}validate(){let{table:a}=this,r=(d,u,g)=>{d[u]===void 0&&(d[u]=g)};r(a,"headerRow",!0),r(a,"totalsRow",!1),r(a,"style",{}),r(a.style,"theme","TableStyleMedium2"),r(a.style,"showFirstColumn",!1),r(a.style,"showLastColumn",!1),r(a.style,"showRowStripes",!1),r(a.style,"showColumnStripes",!1);let t=(d,u)=>{if(!d)throw new Error(u)};t(a.ref,"Table must have ref"),t(a.columns,"Table must have column definitions"),t(a.rows,"Table must have row definitions"),a.tl=c.decodeAddress(a.ref);let{row:n,col:l}=a.tl;t(n>0,"Table must be on valid row"),t(l>0,"Table must be on valid col");let{width:o,filterHeight:s,tableHeight:f}=this;a.autoFilterRef=c.encode(n,l,n+s-1,l+o-1),a.tableRef=c.encode(n,l,n+f-1,l+o-1),a.columns.forEach((d,u)=>{t(d.name,`Column ${u} must have a name`),u===0?r(d,"totalsRowLabel","Total"):(r(d,"totalsRowFunction","none"),d.totalsRowFormula=this.getFormula(d))})}store(){let a=(s,f)=>{f&&Object.keys(f).forEach(d=>{s[d]=f[d]})},{worksheet:r,table:t}=this,{row:n,col:l}=t.tl,o=0;if(t.headerRow){let s=r.getRow(n+o++);t.columns.forEach((f,d)=>{let{style:u,name:g}=f,m=s.getCell(l+d);m.value=g,a(m,u)})}if(t.rows.forEach(s=>{let f=r.getRow(n+o++);s.forEach((d,u)=>{let g=f.getCell(l+u);g.value=d,a(g,t.columns[u].style)})}),t.totalsRow){let s=r.getRow(n+o++);t.columns.forEach((f,d)=>{let u=s.getCell(l+d);if(d===0)u.value=f.totalsRowLabel;else{let g=this.getFormula(f);u.value=g?{formula:f.totalsRowFormula,result:f.totalsRowResult}:null}a(u,f.style)})}}load(a){let{table:r}=this,{row:t,col:n}=r.tl,l=0;if(r.headerRow){let o=a.getRow(t+l++);r.columns.forEach((s,f)=>{o.getCell(n+f).value=s.name})}if(r.rows.forEach(o=>{let s=a.getRow(t+l++);o.forEach((f,d)=>{s.getCell(n+d).value=f})}),r.totalsRow){let o=a.getRow(t+l++);r.columns.forEach((s,f)=>{let d=o.getCell(n+f);f===0?d.value=s.totalsRowLabel:this.getFormula(s)&&(d.value={formula:s.totalsRowFormula,result:s.totalsRowResult})})}}get model(){return this.table}set model(a){this.table=a}cacheState(){this._cache||(this._cache={ref:this.ref,width:this.width,tableHeight:this.tableHeight})}commit(){if(!this._cache)return;this.validate();let a=c.decodeAddress(this._cache.ref);if(this.ref!==this._cache.ref)for(let r=0;r<this._cache.tableHeight;r++){let t=this.worksheet.getRow(a.row+r);for(let n=0;n<this._cache.width;n++)t.getCell(a.col+n).value=null}else{for(let r=this.tableHeight;r<this._cache.tableHeight;r++){let t=this.worksheet.getRow(a.row+r);for(let n=0;n<this._cache.width;n++)t.getCell(a.col+n).value=null}for(let r=0;r<this.tableHeight;r++){let t=this.worksheet.getRow(a.row+r);for(let n=this.width;n<this._cache.width;n++)t.getCell(a.col+n).value=null}}this.store()}addRow(a,r){this.cacheState(),r===void 0?this.table.rows.push(a):this.table.rows.splice(r,0,a)}removeRows(a){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.rows.splice(a,r)}getColumn(a){let r=this.table.columns[a];return new i(this,r,a)}addColumn(a,r,t){this.cacheState(),t===void 0?(this.table.columns.push(a),this.table.rows.forEach((n,l)=>{n.push(r[l])})):(this.table.columns.splice(t,0,a),this.table.rows.forEach((n,l)=>{n.splice(t,0,r[l])}))}removeColumns(a){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cacheState(),this.table.columns.splice(a,r),this.table.rows.forEach(t=>{t.splice(a,r)})}_assign(a,r,t){this.cacheState(),a[r]=t}get ref(){return this.table.ref}set ref(a){this._assign(this.table,"ref",a)}get name(){return this.table.name}set name(a){this.table.name=a}get displayName(){return this.table.displyName||this.table.name}set displayNamename(a){this.table.displayName=a}get headerRow(){return this.table.headerRow}set headerRow(a){this._assign(this.table,"headerRow",a)}get totalsRow(){return this.table.totalsRow}set totalsRow(a){this._assign(this.table,"totalsRow",a)}get theme(){return this.table.style.name}set theme(a){this.table.style.name=a}get showFirstColumn(){return this.table.style.showFirstColumn}set showFirstColumn(a){this.table.style.showFirstColumn=a}get showLastColumn(){return this.table.style.showLastColumn}set showLastColumn(a){this.table.style.showLastColumn=a}get showRowStripes(){return this.table.style.showRowStripes}set showRowStripes(a){this.table.style.showRowStripes=a}get showColumnStripes(){return this.table.style.showColumnStripes}set showColumnStripes(a){this.table.style.showColumnStripes=a}}},{"../utils/col-cache":19}],13:[function(e,p,b){"use strict";let c=e("./worksheet"),i=e("./defined-names"),a=e("../xlsx/xlsx"),r=e("../csv/csv");p.exports=class{constructor(){this.category="",this.company="",this.created=new Date,this.description="",this.keywords="",this.manager="",this.modified=this.created,this.properties={},this.calcProperties={},this._worksheets=[],this.subject="",this.title="",this.views=[],this.media=[],this._definedNames=new i}get xlsx(){return this._xlsx||(this._xlsx=new a(this)),this._xlsx}get csv(){return this._csv||(this._csv=new r(this)),this._csv}get nextId(){for(let t=1;t<this._worksheets.length;t++)if(!this._worksheets[t])return t;return this._worksheets.length||1}addWorksheet(t,n){let l=this.nextId;n&&(typeof n=="string"?(console.trace('tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { argb: "rbg value" } }'),n={properties:{tabColor:{argb:n}}}):(n.argb||n.theme||n.indexed)&&(console.trace("tabColor argument is now deprecated. Please use workbook.addWorksheet(name, {properties: { tabColor: { ... } }"),n={properties:{tabColor:n}}));let o=this._worksheets.reduce((d,u)=>(u&&u.orderNo)>d?u.orderNo:d,0),s=Object.assign({},n,{id:l,name:t,orderNo:o+1,workbook:this}),f=new c(s);return this._worksheets[l]=f,f}removeWorksheetEx(t){delete this._worksheets[t.id]}removeWorksheet(t){let n=this.getWorksheet(t);n&&n.destroy()}getWorksheet(t){return t===void 0?this._worksheets.find(Boolean):typeof t=="number"?this._worksheets[t]:typeof t=="string"?this._worksheets.find(n=>n&&n.name===t):void 0}get worksheets(){return this._worksheets.slice(1).sort((t,n)=>t.orderNo-n.orderNo).filter(Boolean)}eachSheet(t){this.worksheets.forEach(n=>{t(n,n.id)})}get definedNames(){return this._definedNames}clearThemes(){this._themes=void 0}addImage(t){let n=this.media.length;return this.media.push(Object.assign({},t,{type:"image"})),n}getImage(t){return this.media[t]}get model(){return{creator:this.creator||"Unknown",lastModifiedBy:this.lastModifiedBy||"Unknown",lastPrinted:this.lastPrinted,created:this.created,modified:this.modified,properties:this.properties,worksheets:this.worksheets.map(t=>t.model),sheets:this.worksheets.map(t=>t.model).filter(Boolean),definedNames:this._definedNames.model,views:this.views,company:this.company,manager:this.manager,title:this.title,subject:this.subject,keywords:this.keywords,category:this.category,description:this.description,language:this.language,revision:this.revision,contentStatus:this.contentStatus,themes:this._themes,media:this.media,calcProperties:this.calcProperties}}set model(t){this.creator=t.creator,this.lastModifiedBy=t.lastModifiedBy,this.lastPrinted=t.lastPrinted,this.created=t.created,this.modified=t.modified,this.company=t.company,this.manager=t.manager,this.title=t.title,this.subject=t.subject,this.keywords=t.keywords,this.category=t.category,this.description=t.description,this.language=t.language,this.revision=t.revision,this.contentStatus=t.contentStatus,this.properties=t.properties,this.calcProperties=t.calcProperties,this._worksheets=[],t.worksheets.forEach(n=>{let{id:l,name:o,state:s}=n,f=t.sheets&&t.sheets.findIndex(d=>d.id===l);(this._worksheets[l]=new c({id:l,name:o,orderNo:f,state:s,workbook:this})).model=n}),this._definedNames.model=t.definedNames,this.views=t.views,this._themes=t.themes,this.media=t.media||[]}}},{"../csv/csv":1,"../xlsx/xlsx":144,"./defined-names":6,"./worksheet":14}],14:[function(e,p,b){"use strict";let c=e("../utils/under-dash"),i=e("../utils/col-cache"),a=e("./range"),r=e("./row"),t=e("./column"),n=e("./enums"),l=e("./image"),o=e("./table"),s=e("./data-validations"),f=e("../utils/encryptor"),{copyStyle:d}=e("../utils/copy-style");p.exports=class{constructor(u){u=u||{},this._workbook=u.workbook,this.id=u.id,this.orderNo=u.orderNo,this.name=u.name,this.state=u.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges={},this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},u.properties),this.pageSetup=Object.assign({},{margins:{left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!(!u.pageSetup||!u.pageSetup.fitToWidth&&!u.pageSetup.fitToHeight||u.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,firstPageNumber:void 0,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},u.pageSetup),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},u.headerFooter),this.dataValidations=new s,this.views=u.views||[],this.autoFilter=u.autoFilter||null,this._media=[],this.sheetProtection=null,this.tables={},this.conditionalFormattings=[]}get name(){return this._name}set name(u){if(u===void 0&&(u="sheet"+this.id),this._name!==u){if(typeof u!="string")throw new Error("The name has to be a string.");if(u==="")throw new Error("The name can't be empty.");if(u==="History")throw new Error('The name "History" is protected. Please use a different name.');if(/[*?:/\\[\]]/.test(u))throw new Error(`Worksheet name ${u} cannot include any of the following characters: * ? : \\ / [ ]`);if(/(^')|('$)/.test(u))throw new Error("The first or last character of worksheet name cannot be a single quotation mark: "+u);if(u&&u.length>31&&(console.warn(`Worksheet name ${u} exceeds 31 chars. This will be truncated`),u=u.substring(0,31)),this._workbook._worksheets.find(g=>g&&g.name.toLowerCase()===u.toLowerCase()))throw new Error("Worksheet name already exists: "+u);this._name=u}}get workbook(){return this._workbook}destroy(){this._workbook.removeWorksheetEx(this)}get dimensions(){let u=new a;return this._rows.forEach(g=>{if(g){let m=g.dimensions;m&&u.expand(g.number,m.min,g.number,m.max)}}),u}get columns(){return this._columns}set columns(u){this._headerRowCount=u.reduce((v,k)=>{let B=(k.header?1:k.headers&&k.headers.length)||0;return Math.max(v,B)},0);let g=1,m=this._columns=[];u.forEach(v=>{let k=new t(this,g++,!1);m.push(k),k.defn=v})}getColumnKey(u){return this._keys[u]}setColumnKey(u,g){this._keys[u]=g}deleteColumnKey(u){delete this._keys[u]}eachColumnKey(u){c.each(this._keys,u)}getColumn(u){if(typeof u=="string"){let g=this._keys[u];if(g)return g;u=i.l2n(u)}if(this._columns||(this._columns=[]),u>this._columns.length){let g=this._columns.length+1;for(;g<=u;)this._columns.push(new t(this,g++))}return this._columns[u-1]}spliceColumns(u,g){let m=this._rows.length;for(var v=arguments.length,k=new Array(v>2?v-2:0),B=2;B<v;B++)k[B-2]=arguments[B];if(k.length>0)for(let P=0;P<m;P++){let j=[u,g];k.forEach(N=>{j.push(N[P]||null)});let z=this.getRow(P+1);z.splice.apply(z,j)}else this._rows.forEach(P=>{P&&P.splice(u,g)});let O=k.length-g,L=u+g,R=this._columns.length;if(O<0)for(let P=u+k.length;P<=R;P++)this.getColumn(P).defn=this.getColumn(P-O).defn;else if(O>0)for(let P=R;P>=L;P--)this.getColumn(P+O).defn=this.getColumn(P).defn;for(let P=u;P<u+k.length;P++)this.getColumn(P).defn=null;this.workbook.definedNames.spliceColumns(this.name,u,g,k.length)}get lastColumn(){return this.getColumn(this.columnCount)}get columnCount(){let u=0;return this.eachRow(g=>{u=Math.max(u,g.cellCount)}),u}get actualColumnCount(){let u=[],g=0;return this.eachRow(m=>{m.eachCell(v=>{let{col:k}=v;u[k]||(u[k]=!0,g++)})}),g}_commitRow(){}get _lastRowNumber(){let u=this._rows,g=u.length;for(;g>0&&u[g-1]===void 0;)g--;return g}get _nextRow(){return this._lastRowNumber+1}get lastRow(){if(this._rows.length)return this._rows[this._rows.length-1]}findRow(u){return this._rows[u-1]}findRows(u,g){return this._rows.slice(u-1,u-1+g)}get rowCount(){return this._lastRowNumber}get actualRowCount(){let u=0;return this.eachRow(()=>{u++}),u}getRow(u){let g=this._rows[u-1];return g||(g=this._rows[u-1]=new r(this,u)),g}getRows(u,g){if(g<1)return;let m=[];for(let v=u;v<u+g;v++)m.push(this.getRow(v));return m}addRow(u){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n",m=this._nextRow,v=this.getRow(m);return v.values=u,this._setStyleOption(m,g[0]==="i"?g:"n"),v}addRows(u){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n",m=[];return u.forEach(v=>{m.push(this.addRow(v,g))}),m}insertRow(u,g){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";return this.spliceRows(u,0,g),this._setStyleOption(u,m),this.getRow(u)}insertRows(u,g){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"n";if(this.spliceRows(u,0,...g),m!=="n")for(let v=0;v<g.length;v++)m[0]==="o"&&this.findRow(g.length+u+v)!==void 0?this._copyStyle(g.length+u+v,u+v,m[1]==="+"):m[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u+v,m[1]==="+");return this.getRows(u,g.length)}_setStyleOption(u){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"n";g[0]==="o"&&this.findRow(u+1)!==void 0?this._copyStyle(u+1,u,g[1]==="+"):g[0]==="i"&&this.findRow(u-1)!==void 0&&this._copyStyle(u-1,u,g[1]==="+")}_copyStyle(u,g){let m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],v=this.getRow(u),k=this.getRow(g);k.style=d(v.style),v.eachCell({includeEmpty:m},(B,O)=>{k.getCell(O).style=d(B.style)}),k.height=v.height}duplicateRow(u,g){let m=arguments.length>2&&arguments[2]!==void 0&&arguments[2],v=this._rows[u-1],k=new Array(g).fill(v.values);this.spliceRows(u+1,m?0:g,...k);for(let B=0;B<g;B++){let O=this._rows[u+B];O.style=v.style,O.height=v.height,v.eachCell({includeEmpty:!0},(L,R)=>{O.getCell(R).style=L.style})}}spliceRows(u,g){let m=u+g;for(var v=arguments.length,k=new Array(v>2?v-2:0),B=2;B<v;B++)k[B-2]=arguments[B];let O=k.length,L=O-g,R=this._rows.length,P,j;if(L<0)for(u===R&&(this._rows[R-1]=void 0),P=m;P<=R;P++)if(j=this._rows[P-1],j){let z=this.getRow(P+L);z.values=j.values,z.style=j.style,z.height=j.height,j.eachCell({includeEmpty:!0},(N,S)=>{z.getCell(S).style=N.style}),this._rows[P-1]=void 0}else this._rows[P+L-1]=void 0;else if(L>0)for(P=R;P>=m;P--)if(j=this._rows[P-1],j){let z=this.getRow(P+L);z.values=j.values,z.style=j.style,z.height=j.height,j.eachCell({includeEmpty:!0},(N,S)=>{if(z.getCell(S).style=N.style,N._value.constructor.name==="MergeValue"){let C=this.getRow(N._row._number+O).getCell(S),E=N._value._master,h=this.getRow(E._row._number+O).getCell(E._column._number);C.merge(h)}})}else this._rows[P+L-1]=void 0;for(P=0;P<O;P++){let z=this.getRow(u+P);z.style={},z.values=k[P]}this.workbook.definedNames.spliceRows(this.name,u,g,O)}eachRow(u,g){if(g||(g=u,u=void 0),u&&u.includeEmpty){let m=this._rows.length;for(let v=1;v<=m;v++)g(this.getRow(v),v)}else this._rows.forEach(m=>{m&&m.hasValues&&g(m,m.number)})}getSheetValues(){let u=[];return this._rows.forEach(g=>{g&&(u[g.number]=g.values)}),u}findCell(u,g){let m=i.getAddress(u,g),v=this._rows[m.row-1];return v?v.findCell(m.col):void 0}getCell(u,g){let m=i.getAddress(u,g);return this.getRow(m.row).getCellEx(m)}mergeCells(){for(var u=arguments.length,g=new Array(u),m=0;m<u;m++)g[m]=arguments[m];let v=new a(g);this._mergeCellsInternal(v)}mergeCellsWithoutStyle(){for(var u=arguments.length,g=new Array(u),m=0;m<u;m++)g[m]=arguments[m];let v=new a(g);this._mergeCellsInternal(v,!0)}_mergeCellsInternal(u,g){c.each(this._merges,v=>{if(v.intersects(u))throw new Error("Cannot merge already merged cells")});let m=this.getCell(u.top,u.left);for(let v=u.top;v<=u.bottom;v++)for(let k=u.left;k<=u.right;k++)(v>u.top||k>u.left)&&this.getCell(v,k).merge(m,g);this._merges[m.address]=u}_unMergeMaster(u){let g=this._merges[u.address];if(g){for(let m=g.top;m<=g.bottom;m++)for(let v=g.left;v<=g.right;v++)this.getCell(m,v).unmerge();delete this._merges[u.address]}}get hasMerges(){return c.some(this._merges,Boolean)}unMergeCells(){for(var u=arguments.length,g=new Array(u),m=0;m<u;m++)g[m]=arguments[m];let v=new a(g);for(let k=v.top;k<=v.bottom;k++)for(let B=v.left;B<=v.right;B++){let O=this.findCell(k,B);O&&(O.type===n.ValueType.Merge?this._unMergeMaster(O.master):this._merges[O.address]&&this._unMergeMaster(O))}}fillFormula(u,g,m){let v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"shared",k=i.decode(u),{top:B,left:O,bottom:L,right:R}=k,P=R-O+1,j=i.encodeAddress(B,O),z=v==="shared",N;N=typeof m=="function"?m:Array.isArray(m)?Array.isArray(m[0])?(C,E)=>m[C-B][E-O]:(C,E)=>m[(C-B)*P+(E-O)]:()=>{};let S=!0;for(let C=B;C<=L;C++)for(let E=O;E<=R;E++)S?(this.getCell(C,E).value={shareType:v,formula:g,ref:u,result:N(C,E)},S=!1):this.getCell(C,E).value=z?{sharedFormula:j,result:N(C,E)}:N(C,E)}addImage(u,g){let m={type:"image",imageId:u,range:g};this._media.push(new l(this,m))}getImages(){return this._media.filter(u=>u.type==="image")}addBackgroundImage(u){let g={type:"background",imageId:u};this._media.push(new l(this,g))}getBackgroundImageId(){let u=this._media.find(g=>g.type==="background");return u&&u.imageId}protect(u,g){return new Promise(m=>{this.sheetProtection={sheet:!0},g&&"spinCount"in g&&(g.spinCount=Number.isFinite(g.spinCount)?Math.round(Math.max(0,g.spinCount)):1e5),u&&(this.sheetProtection.algorithmName="SHA-512",this.sheetProtection.saltValue=f.randomBytes(16).toString("base64"),this.sheetProtection.spinCount=g&&"spinCount"in g?g.spinCount:1e5,this.sheetProtection.hashValue=f.convertPasswordToHash(u,"SHA512",this.sheetProtection.saltValue,this.sheetProtection.spinCount)),g&&(this.sheetProtection=Object.assign(this.sheetProtection,g),!u&&"spinCount"in g&&delete this.sheetProtection.spinCount),m()})}unprotect(){this.sheetProtection=null}addTable(u){let g=new o(this,u);return this.tables[u.name]=g,g}getTable(u){return this.tables[u]}removeTable(u){delete this.tables[u]}getTables(){return Object.values(this.tables)}addConditionalFormatting(u){this.conditionalFormattings.push(u)}removeConditionalFormatting(u){typeof u=="number"?this.conditionalFormattings.splice(u,1):this.conditionalFormattings=u instanceof Function?this.conditionalFormattings.filter(u):[]}get tabColor(){return console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor}set tabColor(u){console.trace("worksheet.tabColor property is now deprecated. Please use worksheet.properties.tabColor"),this.properties.tabColor=u}get model(){let u={id:this.id,name:this.name,dataValidations:this.dataValidations.model,properties:this.properties,state:this.state,pageSetup:this.pageSetup,headerFooter:this.headerFooter,rowBreaks:this.rowBreaks,views:this.views,autoFilter:this.autoFilter,media:this._media.map(v=>v.model),sheetProtection:this.sheetProtection,tables:Object.values(this.tables).map(v=>v.model),conditionalFormattings:this.conditionalFormattings};u.cols=t.toModel(this.columns);let g=u.rows=[],m=u.dimensions=new a;return this._rows.forEach(v=>{let k=v&&v.model;k&&(m.expand(k.number,k.min,k.number,k.max),g.push(k))}),u.merges=[],c.each(this._merges,v=>{u.merges.push(v.range)}),u}_parseRows(u){this._rows=[],u.rows.forEach(g=>{let m=new r(this,g.number);this._rows[m.number-1]=m,m.model=g})}_parseMergeCells(u){c.each(u.mergeCells,g=>{this.mergeCellsWithoutStyle(g)})}set model(u){this.name=u.name,this._columns=t.fromModel(this,u.cols),this._parseRows(u),this._parseMergeCells(u),this.dataValidations=new s(u.dataValidations),this.properties=u.properties,this.pageSetup=u.pageSetup,this.headerFooter=u.headerFooter,this.views=u.views,this.autoFilter=u.autoFilter,this._media=u.media.map(g=>new l(this,g)),this.sheetProtection=u.sheetProtection,this.tables=u.tables.reduce((g,m)=>{let v=new o;return v.model=m,g[m.name]=v,g},{}),this.conditionalFormattings=u.conditionalFormattings}}},{"../utils/col-cache":19,"../utils/copy-style":20,"../utils/encryptor":21,"../utils/under-dash":26,"./column":4,"./data-validations":5,"./enums":7,"./image":8,"./range":10,"./row":11,"./table":12}],15:[function(e,p,b){"use strict";e("core-js/modules/es.promise"),e("core-js/modules/es.promise.finally"),e("core-js/modules/es.object.assign"),e("core-js/modules/es.object.keys"),e("core-js/modules/es.object.values"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.async-iterator"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.find-index"),e("core-js/modules/es.array.find"),e("core-js/modules/es.string.from-code-point"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.number.is-nan"),e("regenerator-runtime/runtime");let c={Workbook:e("./doc/workbook")},i=e("./doc/enums");Object.keys(i).forEach(a=>{c[a]=i[a]}),p.exports=c},{"./doc/enums":7,"./doc/workbook":13,"core-js/modules/es.array.find":359,"core-js/modules/es.array.find-index":358,"core-js/modules/es.array.includes":360,"core-js/modules/es.array.iterator":361,"core-js/modules/es.number.is-nan":363,"core-js/modules/es.object.assign":364,"core-js/modules/es.object.keys":366,"core-js/modules/es.object.values":367,"core-js/modules/es.promise":372,"core-js/modules/es.promise.finally":371,"core-js/modules/es.string.from-code-point":376,"core-js/modules/es.string.includes":377,"core-js/modules/es.symbol":381,"core-js/modules/es.symbol.async-iterator":378,"regenerator-runtime/runtime":492}],16:[function(e,p,b){"use strict";let c=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");b.bufferToString=function(i){return typeof i=="string"?i:c?c.decode(i):i.toString()}},{}],17:[function(e,p,b){"use strict";let c=typeof TextEncoder>"u"?null:new TextEncoder("utf-8"),{Buffer:i}=e("buffer");b.stringToBuffer=function(a){return typeof a!="string"?a:c?i.from(c.encode(a).buffer):i.from(a)}},{buffer:220}],18:[function(e,p,b){"use strict";let c=e("./under-dash"),i=e("./col-cache");p.exports=class{constructor(a){this.template=a,this.sheets={}}addCell(a){this.addCellEx(i.decodeEx(a))}getCell(a){return this.findCellEx(i.decodeEx(a),!0)}findCell(a){return this.findCellEx(i.decodeEx(a),!1)}findCellAt(a,r,t){let n=this.sheets[a],l=n&&n[r];return l&&l[t]}addCellEx(a){if(a.top)for(let r=a.top;r<=a.bottom;r++)for(let t=a.left;t<=a.right;t++)this.getCellAt(a.sheetName,r,t);else this.findCellEx(a,!0)}getCellEx(a){return this.findCellEx(a,!0)}findCellEx(a,r){let t=this.findSheet(a,r),n=this.findSheetRow(t,a,r);return this.findRowCell(n,a,r)}getCellAt(a,r,t){let n=this.sheets[a]||(this.sheets[a]=[]),l=n[r]||(n[r]=[]);return l[t]||(l[t]={sheetName:a,address:i.n2l(t)+r,row:r,col:t})}removeCellEx(a){let r=this.findSheet(a);if(!r)return;let t=this.findSheetRow(r,a);t&&delete t[a.col]}forEachInSheet(a,r){let t=this.sheets[a];t&&t.forEach((n,l)=>{n&&n.forEach((o,s)=>{o&&r(o,l,s)})})}forEach(a){c.each(this.sheets,(r,t)=>{this.forEachInSheet(t,a)})}map(a){let r=[];return this.forEach(t=>{r.push(a(t))}),r}findSheet(a,r){let t=a.sheetName;return this.sheets[t]?this.sheets[t]:r?this.sheets[t]=[]:void 0}findSheetRow(a,r,t){let{row:n}=r;return a&&a[n]?a[n]:t?a[n]=[]:void 0}findRowCell(a,r,t){let{col:n}=r;return a&&a[n]?a[n]:t?a[n]=this.template?Object.assign(r,JSON.parse(JSON.stringify(this.template))):r:void 0}spliceRows(a,r,t,n){let l=this.sheets[a];if(l){let o=[];for(let s=0;s<n;s++)o.push([]);l.splice(r,t,...o)}}spliceColumns(a,r,t,n){let l=this.sheets[a];if(l){let o=[];for(let s=0;s<n;s++)o.push(null);c.each(l,s=>{s.splice(r,t,...o)})}}}},{"./col-cache":19,"./under-dash":26}],19:[function(e,p,b){"use strict";let c=/^[A-Z]+\d+$/,i={_dictionary:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],_l2nFill:0,_l2n:{},_n2l:[],_level:a=>a<=26?1:a<=676?2:3,_fill(a){let r,t,n,l,o,s=1;if(a>=4)throw new Error("Out of bounds. Excel supports columns from 1 to 16384");if(this._l2nFill<1&&a>=1){for(;s<=26;)r=this._dictionary[s-1],this._n2l[s]=r,this._l2n[r]=s,s++;this._l2nFill=1}if(this._l2nFill<2&&a>=2){for(s=27;s<=702;)t=s-27,n=t%26,l=Math.floor(t/26),r=this._dictionary[l]+this._dictionary[n],this._n2l[s]=r,this._l2n[r]=s,s++;this._l2nFill=2}if(this._l2nFill<3&&a>=3){for(s=703;s<=16384;)t=s-703,n=t%26,l=Math.floor(t/26)%26,o=Math.floor(t/676),r=this._dictionary[o]+this._dictionary[l]+this._dictionary[n],this._n2l[s]=r,this._l2n[r]=s,s++;this._l2nFill=3}},l2n(a){if(this._l2n[a]||this._fill(a.length),!this._l2n[a])throw new Error("Out of bounds. Invalid column letter: "+a);return this._l2n[a]},n2l(a){if(a<1||a>16384)throw new Error(a+" is out of bounds. Excel supports columns from 1 to 16384");return this._n2l[a]||this._fill(this._level(a)),this._n2l[a]},_hash:{},validateAddress(a){if(!c.test(a))throw new Error("Invalid Address: "+a);return!0},decodeAddress(a){let r=a.length<5&&this._hash[a];if(r)return r;let t=!1,n="",l=0,o=!1,s="",f=0;for(let u,g=0;g<a.length;g++)if(u=a.charCodeAt(g),!o&&u>=65&&u<=90)t=!0,n+=a[g],l=26*l+u-64;else if(u>=48&&u<=57)o=!0,s+=a[g],f=10*f+u-48;else if(o&&t&&u!==36)break;if(t){if(l>16384)throw new Error("Out of bounds. Invalid column letter: "+n)}else l=void 0;o||(f=void 0);let d={address:a=n+s,col:l,row:f,$col$row:`$${n}$${s}`};return l<=100&&f<=100&&(this._hash[a]=d,this._hash[d.$col$row]=d),d},getAddress(a,r){if(r){let t=this.n2l(r)+a;return this.decodeAddress(t)}return this.decodeAddress(a)},decode(a){let r=a.split(":");if(r.length===2){let t=this.decodeAddress(r[0]),n=this.decodeAddress(r[1]),l={top:Math.min(t.row,n.row),left:Math.min(t.col,n.col),bottom:Math.max(t.row,n.row),right:Math.max(t.col,n.col)};return l.tl=this.n2l(l.left)+l.top,l.br=this.n2l(l.right)+l.bottom,l.dimensions=`${l.tl}:${l.br}`,l}return this.decodeAddress(a)},decodeEx(a){let r=a.match(/(?:(?:(?:'((?:[^']|'')*)')|([^'^ !]*))!)?(.*)/),t=r[1]||r[2],n=r[3],l=n.split(":");if(l.length>1){let s=this.decodeAddress(l[0]),f=this.decodeAddress(l[1]),d=Math.min(s.row,f.row),u=Math.min(s.col,f.col),g=Math.max(s.row,f.row),m=Math.max(s.col,f.col);return s=this.n2l(u)+d,f=this.n2l(m)+g,{top:d,left:u,bottom:g,right:m,sheetName:t,tl:{address:s,col:u,row:d,$col$row:`$${this.n2l(u)}$${d}`,sheetName:t},br:{address:f,col:m,row:g,$col$row:`$${this.n2l(m)}$${g}`,sheetName:t},dimensions:`${s}:${f}`}}if(n.startsWith("#"))return t?{sheetName:t,error:n}:{error:n};let o=this.decodeAddress(n);return t?{sheetName:t,...o}:o},encodeAddress:(a,r)=>i.n2l(r)+a,encode(){switch(arguments.length){case 2:return i.encodeAddress(arguments[0],arguments[1]);case 4:return`${i.encodeAddress(arguments[0],arguments[1])}:${i.encodeAddress(arguments[2],arguments[3])}`;default:throw new Error("Can only encode with 2 or 4 arguments")}},inRange(a,r){let[t,n,,l,o]=a,[s,f]=r;return s>=t&&s<=l&&f>=n&&f<=o}};p.exports=i},{}],20:[function(e,p,b){"use strict";let c=(a,r)=>({...a,...r.reduce((t,n)=>(a[n]&&(t[n]={...a[n]}),t),{})}),i=function(a,r,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];a[t]&&(r[t]=c(a[t],n))};b.copyStyle=a=>{if(!a)return a;if(r=a,Object.keys(r).length===0)return{};var r;let t={...a};return i(a,t,"font",["color"]),i(a,t,"alignment"),i(a,t,"protection"),a.border&&(i(a,t,"border"),i(a.border,t.border,"top",["color"]),i(a.border,t.border,"left",["color"]),i(a.border,t.border,"bottom",["color"]),i(a.border,t.border,"right",["color"]),i(a.border,t.border,"diagonal",["color"])),a.fill&&(i(a,t,"fill",["fgColor","bgColor","center"]),a.fill.stops&&(t.fill.stops=a.fill.stops.map(n=>c(n,["color"])))),t}},{}],21:[function(e,p,b){(function(c){(function(){"use strict";let i=e("crypto"),a={hash(r){let t=i.createHash(r);for(var n=arguments.length,l=new Array(n>1?n-1:0),o=1;o<n;o++)l[o-1]=arguments[o];return t.update(c.concat(l)),t.digest()},convertPasswordToHash(r,t,n,l){if(t=t.toLowerCase(),i.getHashes().indexOf(t)<0)throw new Error(`Hash algorithm '${t}' not supported!`);let o=c.from(r,"utf16le"),s=this.hash(t,c.from(n,"base64"),o);for(let f=0;f<l;f++){let d=c.alloc(4);d.writeUInt32LE(f,0),s=this.hash(t,s,d)}return s.toString("base64")},randomBytes:r=>i.randomBytes(r)};p.exports=a}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220,crypto:390}],22:[function(e,p,b){"use strict";let{SaxesParser:c}=e("saxes"),{PassThrough:i}=e("readable-stream"),{bufferToString:a}=e("./browser-buffer-decode");p.exports=async function*(r){r.pipe&&!r[Symbol.asyncIterator]&&(r=r.pipe(new i));let t=new c,n;t.on("error",o=>{n=o});let l=[];t.on("opentag",o=>l.push({eventType:"opentag",value:o})),t.on("text",o=>l.push({eventType:"text",value:o})),t.on("closetag",o=>l.push({eventType:"closetag",value:o}));for await(let o of r){if(t.write(a(o)),n)throw n;yield l,l=[]}}},{"./browser-buffer-decode":16,"readable-stream":491,saxes:496}],23:[function(e,p,b){"use strict";let c=e("./col-cache"),i=/(([a-z_\-0-9]*)!)?([a-z0-9_$]{2,})([(])?/gi,a=/^([$])?([a-z]+)([$])?([1-9][0-9]*)$/i;p.exports={slideFormula:function(r,t,n){let l=c.decode(t),o=c.decode(n);return r.replace(i,(s,f,d,u,g)=>{if(g)return s;let m=a.exec(u);if(m){let v=m[1],k=m[2].toUpperCase(),B=m[3],O=m[4];if(k.length>3||k.length===3&&k>"XFD")return s;let L=c.l2n(k),R=parseInt(O,10);return v||(L+=o.col-l.col),B||(R+=o.row-l.row),(f||"")+(v||"")+c.n2l(L)+(B||"")+R}return s})}}},{"./col-cache":19}],24:[function(e,p,b){(function(c,i){(function(){"use strict";let a=e("readable-stream"),r=e("./utils"),t=e("./string-buf");class n{constructor(u,g){this._data=u,this._encoding=g}get length(){return this.toBuffer().length}copy(u,g,m,v){return this.toBuffer().copy(u,g,m,v)}toBuffer(){return this._buffer||(this._buffer=i.from(this._data,this._encoding)),this._buffer}}class l{constructor(u){this._data=u}get length(){return this._data.length}copy(u,g,m,v){return this._data._buf.copy(u,g,m,v)}toBuffer(){return this._data.toBuffer()}}class o{constructor(u){this._data=u}get length(){return this._data.length}copy(u,g,m,v){this._data.copy(u,g,m,v)}toBuffer(){return this._data}}class s{constructor(u){this.size=u,this.buffer=i.alloc(u),this.iRead=0,this.iWrite=0}toBuffer(){if(this.iRead===0&&this.iWrite===this.size)return this.buffer;let u=i.alloc(this.iWrite-this.iRead);return this.buffer.copy(u,0,this.iRead,this.iWrite),u}get length(){return this.iWrite-this.iRead}get eod(){return this.iRead===this.iWrite}get full(){return this.iWrite===this.size}read(u){let g;return u===0?null:u===void 0||u>=this.length?(g=this.toBuffer(),this.iRead=this.iWrite,g):(g=i.alloc(u),this.buffer.copy(g,0,this.iRead,u),this.iRead+=u,g)}write(u,g,m){let v=Math.min(m,this.size-this.iWrite);return u.copy(this.buffer,this.iWrite,g,g+v),this.iWrite+=v,v}}let f=function(d){d=d||{},this.bufSize=d.bufSize||1048576,this.buffers=[],this.batch=d.batch||!1,this.corked=!1,this.inPos=0,this.outPos=0,this.pipes=[],this.paused=!1,this.encoding=null};r.inherits(f,a.Duplex,{toBuffer(){switch(this.buffers.length){case 0:return null;case 1:return this.buffers[0].toBuffer();default:return i.concat(this.buffers.map(d=>d.toBuffer()))}},_getWritableBuffer(){if(this.buffers.length){let u=this.buffers[this.buffers.length-1];if(!u.full)return u}let d=new s(this.bufSize);return this.buffers.push(d),d},async _pipe(d){await Promise.all(this.pipes.map((function(u){return new Promise(g=>{u.write(d.toBuffer(),()=>{g()})})})))},_writeToBuffers(d){let u=0,g=d.length;for(;u<g;)u+=this._getWritableBuffer().write(d,u,g-u)},async write(d,u,g){let m;if(u instanceof Function&&(g=u,u="utf8"),g=g||r.nop,d instanceof t)m=new l(d);else if(d instanceof i)m=new o(d);else{if(!(typeof d=="string"||d instanceof String||d instanceof ArrayBuffer))throw new Error("Chunk must be one of type String, Buffer or StringBuf.");m=new n(d,u)}if(this.pipes.length)if(this.batch)for(this._writeToBuffers(m);!this.corked&&this.buffers.length>1;)this._pipe(this.buffers.shift());else this.corked?(this._writeToBuffers(m),c.nextTick(g)):(await this._pipe(m),g());else this.paused||this.emit("data",m.toBuffer()),this._writeToBuffers(m),this.emit("readable");return!0},cork(){this.corked=!0},_flush(){if(this.pipes.length)for(;this.buffers.length;)this._pipe(this.buffers.shift())},uncork(){this.corked=!1,this._flush()},end(d,u,g){let m=v=>{v?g(v):(this._flush(),this.pipes.forEach(k=>{k.end()}),this.emit("finish"))};d?this.write(d,u,m):m()},read(d){let u;if(d){for(u=[];d&&this.buffers.length&&!this.buffers[0].eod;){let g=this.buffers[0],m=g.read(d);d-=m.length,u.push(m),g.eod&&g.full&&this.buffers.shift()}return i.concat(u)}return u=this.buffers.map(g=>g.toBuffer()).filter(Boolean),this.buffers=[],i.concat(u)},setEncoding(d){this.encoding=d},pause(){this.paused=!0},resume(){this.paused=!1},isPaused(){return!!this.paused},pipe(d){this.pipes.push(d),!this.paused&&this.buffers.length&&this.end()},unpipe(d){this.pipes=this.pipes.filter(u=>u!==d)},unshift(){throw new Error("Not Implemented")},wrap(){throw new Error("Not Implemented")}}),p.exports=f}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./string-buf":25,"./utils":27,_process:467,buffer:220,"readable-stream":491}],25:[function(e,p,b){(function(c){(function(){"use strict";p.exports=class{constructor(i){this._buf=c.alloc(i&&i.size||16384),this._encoding=i&&i.encoding||"utf8",this._inPos=0,this._buffer=void 0}get length(){return this._inPos}get capacity(){return this._buf.length}get buffer(){return this._buf}toBuffer(){return this._buffer||(this._buffer=c.alloc(this.length),this._buf.copy(this._buffer,0,0,this.length)),this._buffer}reset(i){i=i||0,this._buffer=void 0,this._inPos=i}_grow(i){let a=2*this._buf.length;for(;a<i;)a*=2;let r=c.alloc(a);this._buf.copy(r,0),this._buf=r}addText(i){this._buffer=void 0;let a=this._inPos+this._buf.write(i,this._inPos,this._encoding);for(;a>=this._buf.length-4;)this._grow(this._inPos+i.length),a=this._inPos+this._buf.write(i,this._inPos,this._encoding);this._inPos=a}addStringBuf(i){i.length&&(this._buffer=void 0,this.length+i.length>this.capacity&&this._grow(this.length+i.length),i._buf.copy(this._buf,this._inPos,0,i.length),this._inPos+=i.length)}}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220}],26:[function(e,p,b){"use strict";let{toString:c}=Object.prototype,i=/["&<>]/,a={each:function(r,t){r&&(Array.isArray(r)?r.forEach(t):Object.keys(r).forEach(n=>{t(r[n],n)}))},some:function(r,t){return!!r&&(Array.isArray(r)?r.some(t):Object.keys(r).some(n=>t(r[n],n)))},every:function(r,t){return!r||(Array.isArray(r)?r.every(t):Object.keys(r).every(n=>t(r[n],n)))},map:function(r,t){return r?Array.isArray(r)?r.map(t):Object.keys(r).map(n=>t(r[n],n)):[]},keyBy:(r,t)=>r.reduce((n,l)=>(n[l[t]]=l,n),{}),isEqual:function(r,t){let n=typeof r,l=typeof t,o=Array.isArray(r),s=Array.isArray(t),f;if(n!==l)return!1;switch(typeof r){case"object":if(o||s)return!(!o||!s)&&r.length===t.length&&r.every((d,u)=>{let g=t[u];return a.isEqual(d,g)});if(r===null||t===null)return r===t;if(f=Object.keys(r),Object.keys(t).length!==f.length)return!1;for(let d of f)if(!t.hasOwnProperty(d))return!1;return a.every(r,(d,u)=>{let g=t[u];return a.isEqual(d,g)});default:return r===t}},escapeHtml(r){let t=i.exec(r);if(!t)return r;let n="",l="",o=0,s=t.index;for(;s<r.length;s++){switch(r.charAt(s)){case'"':l="&quot;";break;case"&":l="&amp;";break;case"'":l="&apos;";break;case"<":l="&lt;";break;case">":l="&gt;";break;default:continue}o!==s&&(n+=r.substring(o,s)),o=s+1,n+=l}return o!==s?n+r.substring(o,s):n},strcmp:(r,t)=>r<t?-1:r>t?1:0,isUndefined:r=>c.call(r)==="[object Undefined]",isObject:r=>c.call(r)==="[object Object]",deepMerge(){let r=arguments[0]||{},{length:t}=arguments,n,l,o;function s(f,d){n=r[d],o=Array.isArray(f),a.isObject(f)||o?(o?(o=!1,l=n&&Array.isArray(n)?n:[]):l=n&&a.isObject(n)?n:{},r[d]=a.deepMerge(l,f)):a.isUndefined(f)||(r[d]=f)}for(let f=0;f<t;f++)a.each(arguments[f],s);return r}};p.exports=a},{}],27:[function(e,p,b){(function(c,i){(function(){"use strict";let a=e("fs"),r=/[<>&'"\x7F\x00-\x08\x0B-\x0C\x0E-\x1F]/,t={nop(){},promiseImmediate:n=>new Promise(l=>{c.setImmediate?i(()=>{l(n)}):setTimeout(()=>{l(n)},1)}),inherits:function(n,l,o,s){n.super_=l,s||(s=o,o=null),o&&Object.keys(o).forEach(d=>{Object.defineProperty(n,d,Object.getOwnPropertyDescriptor(o,d))});let f={constructor:{value:n,enumerable:!1,writable:!1,configurable:!0}};s&&Object.keys(s).forEach(d=>{f[d]=Object.getOwnPropertyDescriptor(s,d)}),n.prototype=Object.create(l.prototype,f)},dateToExcel:(n,l)=>25569+n.getTime()/864e5-(l?1462:0),excelToDate(n,l){let o=Math.round(24*(n-25569+(l?1462:0))*3600*1e3);return new Date(o)},parsePath(n){let l=n.lastIndexOf("/");return{path:n.substring(0,l),name:n.substring(l+1)}},getRelsPath(n){let l=t.parsePath(n);return`${l.path}/_rels/${l.name}.rels`},xmlEncode(n){let l=r.exec(n);if(!l)return n;let o="",s="",f=0,d=l.index;for(;d<n.length;d++){let u=n.charCodeAt(d);switch(u){case 34:s="&quot;";break;case 38:s="&amp;";break;case 39:s="&apos;";break;case 60:s="&lt;";break;case 62:s="&gt;";break;case 127:s="";break;default:if(u<=31&&(u<=8||u>=11&&u!==13)){s="";break}continue}f!==d&&(o+=n.substring(f,d)),f=d+1,s&&(o+=s)}return f!==d?o+n.substring(f,d):o},xmlDecode:n=>n.replace(/&([a-z]*);/g,l=>{switch(l){case"&lt;":return"<";case"&gt;":return">";case"&amp;":return"&";case"&apos;":return"'";case"&quot;":return'"';default:return l}}),validInt(n){let l=parseInt(n,10);return Number.isNaN(l)?0:l},isDateFmt(n){return n?(n=(n=n.replace(/\[[^\]]*]/g,"")).replace(/"[^"]*"/g,"")).match(/[ymdhMsb]+/)!==null:!1},fs:{exists:n=>new Promise(l=>{a.access(n,a.constants.F_OK,o=>{l(!o)})})},toIsoDateString:n=>n.toIsoString().subsstr(0,10),parseBoolean:n=>n===!0||n==="true"||n===1||n==="1"};p.exports=t}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},e("timers").setImmediate)},{fs:216,timers:523}],28:[function(e,p,b){"use strict";let c=e("./under-dash"),i=e("./utils");function a(n,l,o){n.push(` ${l}="${i.xmlEncode(o.toString())}"`)}function r(n,l){if(l){let o=[];c.each(l,(s,f)=>{s!==void 0&&a(o,f,s)}),n.push(o.join(""))}}class t{constructor(){this._xml=[],this._stack=[],this._rollbacks=[]}get tos(){return this._stack.length?this._stack[this._stack.length-1]:void 0}get cursor(){return this._xml.length}openXml(l){let o=this._xml;o.push("<?xml"),r(o,l),o.push(`?>
2
+ `)}openNode(l,o){let s=this.tos,f=this._xml;s&&this.open&&f.push(">"),this._stack.push(l),f.push("<"),f.push(l),r(f,o),this.leaf=!0,this.open=!0}addAttribute(l,o){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");o!==void 0&&a(this._xml,l,o)}addAttributes(l){if(!this.open)throw new Error("Cannot write attributes to node if it is not open");r(this._xml,l)}writeText(l){let o=this._xml;this.open&&(o.push(">"),this.open=!1),this.leaf=!1,o.push(i.xmlEncode(l.toString()))}writeXml(l){this.open&&(this._xml.push(">"),this.open=!1),this.leaf=!1,this._xml.push(l)}closeNode(){let l=this._stack.pop(),o=this._xml;this.leaf?o.push("/>"):(o.push("</"),o.push(l),o.push(">")),this.open=!1,this.leaf=!1}leafNode(l,o,s){this.openNode(l,o),s!==void 0&&this.writeText(s),this.closeNode()}closeAll(){for(;this._stack.length;)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let l=this._rollbacks.pop();this._xml.length>l.xml&&this._xml.splice(l.xml,this._xml.length-l.xml),this._stack.length>l.stack&&this._stack.splice(l.stack,this._stack.length-l.stack),this.leaf=l.leaf,this.open=l.open}get xml(){return this.closeAll(),this._xml.join("")}}t.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"},p.exports=t},{"./under-dash":26,"./utils":27}],29:[function(e,p,b){(function(c){(function(){"use strict";let i=e("events"),a=e("jszip"),r=e("./stream-buf"),{stringToBuffer:t}=e("./browser-buffer-encode");class n extends i.EventEmitter{constructor(o){super(),this.options=Object.assign({type:"nodebuffer",compression:"DEFLATE"},o),this.zip=new a,this.stream=new r}append(o,s){s.hasOwnProperty("base64")&&s.base64?this.zip.file(s.name,o,{base64:!0}):(c.browser&&typeof o=="string"&&(o=t(o)),this.zip.file(s.name,o))}async finalize(){let o=await this.zip.generateAsync(this.options);this.stream.end(o),this.emit("finish")}read(o){return this.stream.read(o)}setEncoding(o){return this.stream.setEncoding(o)}pause(){return this.stream.pause()}resume(){return this.stream.resume()}isPaused(){return this.stream.isPaused()}pipe(o,s){return this.stream.pipe(o,s)}unpipe(o){return this.stream.unpipe(o)}unshift(o){return this.stream.unshift(o)}wrap(o){return this.stream.wrap(o)}}p.exports={ZipWriter:n}}).call(this)}).call(this,e("_process"))},{"./browser-buffer-encode":17,"./stream-buf":24,_process:467,events:422,jszip:441}],30:[function(e,p,b){"use strict";p.exports={0:{f:"General"},1:{f:"0"},2:{f:"0.00"},3:{f:"#,##0"},4:{f:"#,##0.00"},9:{f:"0%"},10:{f:"0.00%"},11:{f:"0.00E+00"},12:{f:"# ?/?"},13:{f:"# ??/??"},14:{f:"mm-dd-yy"},15:{f:"d-mmm-yy"},16:{f:"d-mmm"},17:{f:"mmm-yy"},18:{f:"h:mm AM/PM"},19:{f:"h:mm:ss AM/PM"},20:{f:"h:mm"},21:{f:"h:mm:ss"},22:{f:'m/d/yy "h":mm'},27:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},28:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},29:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},30:{"zh-tw":"m/d/yy ","zh-cn":"m-d-yy","ja-jp":"m/d/yy","ko-kr":"mm-dd-yy"},31:{"zh-tw":'yyyy"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'yyyy"\u5E74"m"\u6708"d"\u65E5"',"ja-jp":'yyyy"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":'yyyy"\uB144" mm"\uC6D4" dd"\uC77C"'},32:{"zh-tw":'hh"\u6642"mm"\u5206"',"zh-cn":'h"\u65F6"mm"\u5206"',"ja-jp":'h"\u6642"mm"\u5206"',"ko-kr":'h"\uC2DC" mm"\uBD84"'},33:{"zh-tw":'hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'h"\u65F6"mm"\u5206"ss"\u79D2"',"ja-jp":'h"\u6642"mm"\u5206"ss"\u79D2"',"ko-kr":'h"\uC2DC" mm"\uBD84" ss"\uCD08"'},34:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"',"ja-jp":'yyyy"\u5E74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},35:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"ss"\u79D2"',"ja-jp":'m"\u6708"d"\u65E5"',"ko-kr":"yyyy-mm-dd"},36:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},37:{f:"#,##0 ;(#,##0)"},38:{f:"#,##0 ;[Red](#,##0)"},39:{f:"#,##0.00 ;(#,##0.00)"},40:{f:"#,##0.00 ;[Red](#,##0.00)"},45:{f:"mm:ss"},46:{f:"[h]:mm:ss"},47:{f:"mmss.0"},48:{f:"##0.0E+0"},49:{f:"@"},50:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},51:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},52:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":'yyyy"\u5E74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},53:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'m"\u6708"d"\u65E5"',"ko-kr":"yyyy-mm-dd"},54:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},55:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"',"ja-jp":'yyyy"\u5E74"m"\u6708"',"ko-kr":"yyyy-mm-dd"},56:{"zh-tw":'\u4E0A\u5348/\u4E0B\u5348 hh"\u6642"mm"\u5206"ss"\u79D2"',"zh-cn":'\u4E0A\u5348/\u4E0B\u5348 h"\u65F6"mm"\u5206"ss"\u79D2"',"ja-jp":'m"\u6708"d"\u65E5"',"ko-kr":"yyyy-mm-dd"},57:{"zh-tw":"[$-404]e/m/d","zh-cn":'yyyy"\u5E74"m"\u6708"',"ja-jp":"[$-411]ge.m.d","ko-kr":'yyyy"\u5E74" mm"\u6708" dd"\u65E5"'},58:{"zh-tw":'[$-404]e"\u5E74"m"\u6708"d"\u65E5"',"zh-cn":'m"\u6708"d"\u65E5"',"ja-jp":'[$-411]ggge"\u5E74"m"\u6708"d"\u65E5"',"ko-kr":"mm-dd"},59:{"th-th":"t0"},60:{"th-th":"t0.00"},61:{"th-th":"t#,##0"},62:{"th-th":"t#,##0.00"},67:{"th-th":"t0%"},68:{"th-th":"t0.00%"},69:{"th-th":"t# ?/?"},70:{"th-th":"t# ??/??"},81:{"th-th":"d/m/bb"}}},{}],31:[function(e,p,b){"use strict";p.exports={OfficeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Worksheet:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",CalcChain:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain",SharedStrings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",CoreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ExtenderProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",VmlDrawing:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Table:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"}},{}],32:[function(e,p,b){"use strict";let c=e("../../utils/parse-sax"),i=e("../../utils/xml-stream");class a{prepare(){}render(){}parseOpen(t){}parseText(t){}parseClose(t){}reconcile(t,n){}reset(){this.model=null,this.map&&Object.values(this.map).forEach(t=>{t instanceof a?t.reset():t.xform&&t.xform.reset()})}mergeModel(t){this.model=Object.assign(this.model||{},t)}async parse(t){for await(let n of t)for(let{eventType:l,value:o}of n)if(l==="opentag")this.parseOpen(o);else if(l==="text")this.parseText(o);else if(l==="closetag"&&!this.parseClose(o.name))return this.model;return this.model}async parseStream(t){return this.parse(c(t))}get xml(){return this.toXml(this.model)}toXml(t){let n=new i;return this.render(n,t),n.xml}static toAttribute(t,n){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return n}else if(l||t!==n)return t.toString()}static toStringAttribute(t,n){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,n,l)}static toStringValue(t,n){return t===void 0?n:t}static toBoolAttribute(t,n){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(t===void 0){if(l)return n}else if(l||t!==n)return t?"1":"0"}static toBoolValue(t,n){return t===void 0?n:t==="1"}static toIntAttribute(t,n){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,n,l)}static toIntValue(t,n){return t===void 0?n:parseInt(t,10)}static toFloatAttribute(t,n){let l=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return a.toAttribute(t,n,l)}static toFloatValue(t,n){return t===void 0?n:parseFloat(t)}}p.exports=a},{"../../utils/parse-sax":22,"../../utils/xml-stream":28}],33:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("../../../utils/col-cache");function a(t){try{return i.decodeEx(t),!0}catch{return!1}}function r(t){let n=[],l=!1,o="";return t.split(",").forEach(s=>{if(!s)return;let f=(s.match(/'/g)||[]).length;if(!f)return void(l?o+=s+",":a(s)&&n.push(s));let d=f%2==0;!l&&d&&a(s)?n.push(s):l&&!d?(l=!1,a(o+s)&&n.push(o+s),o=""):(l=!0,o+=s+",")}),n}p.exports=class extends c{render(t,n){t.openNode("definedName",{name:n.name,localSheetId:n.localSheetId}),t.writeText(n.ranges.join(",")),t.closeNode()}parseOpen(t){return t.name==="definedName"?(this._parsedName=t.attributes.name,this._parsedLocalSheetId=t.attributes.localSheetId,this._parsedText=[],!0):!1}parseText(t){this._parsedText.push(t)}parseClose(){return this.model={name:this._parsedName,ranges:r(this._parsedText.join(""))},this._parsedLocalSheetId!==void 0&&(this.model.localSheetId=parseInt(this._parsedLocalSheetId,10)),!1}}},{"../../../utils/col-cache":19,"../base-xform":32}],34:[function(e,p,b){"use strict";let c=e("../../../utils/utils"),i=e("../base-xform");p.exports=class extends i{render(a,r){a.leafNode("sheet",{sheetId:r.id,name:r.name,state:r.state,"r:id":r.rId})}parseOpen(a){return a.name==="sheet"&&(this.model={name:c.xmlDecode(a.attributes.name),id:parseInt(a.attributes.sheetId,10),state:a.attributes.state,rId:a.attributes["r:id"]},!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/utils":27,"../base-xform":32}],35:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{render(i,a){i.leafNode("calcPr",{calcId:171027,fullCalcOnLoad:a.fullCalcOnLoad?1:void 0})}parseOpen(i){return i.name==="calcPr"&&(this.model={},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],36:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{render(i,a){i.leafNode("workbookPr",{date1904:a.date1904?1:void 0,defaultThemeVersion:164011,filterPrivacy:1})}parseOpen(i){return i.name==="workbookPr"&&(this.model={date1904:i.attributes.date1904==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],37:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{render(i,a){let r={xWindow:a.x||0,yWindow:a.y||0,windowWidth:a.width||12e3,windowHeight:a.height||24e3,firstSheet:a.firstSheet,activeTab:a.activeTab};a.visibility&&a.visibility!=="visible"&&(r.visibility=a.visibility),i.leafNode("workbookView",r)}parseOpen(i){if(i.name==="workbookView"){let a=this.model={},r=function(n,l,o){let s=l!==void 0?a[n]=l:o;s!==void 0&&(a[n]=s)},t=function(n,l,o){let s=l!==void 0?a[n]=parseInt(l,10):o;s!==void 0&&(a[n]=s)};return t("x",i.attributes.xWindow,0),t("y",i.attributes.yWindow,0),t("width",i.attributes.windowWidth,25e3),t("height",i.attributes.windowHeight,1e4),r("visibility",i.attributes.visibility,"visible"),t("activeTab",i.attributes.activeTab,void 0),t("firstSheet",i.attributes.firstSheet,void 0),!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],38:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../../../utils/col-cache"),a=e("../../../utils/xml-stream"),r=e("../base-xform"),t=e("../static-xform"),n=e("../list-xform"),l=e("./defined-name-xform"),o=e("./sheet-xform"),s=e("./workbook-view-xform"),f=e("./workbook-properties-xform"),d=e("./workbook-calc-properties-xform");class u extends r{constructor(){super(),this.map={fileVersion:u.STATIC_XFORMS.fileVersion,workbookPr:new f,bookViews:new n({tag:"bookViews",count:!1,childXform:new s}),sheets:new n({tag:"sheets",count:!1,childXform:new o}),definedNames:new n({tag:"definedNames",count:!1,childXform:new l}),calcPr:new d}}prepare(m){m.sheets=m.worksheets;let v=[],k=0;m.sheets.forEach(B=>{if(B.pageSetup&&B.pageSetup.printArea&&B.pageSetup.printArea.split("&&").forEach(O=>{let L=O.split(":"),R={name:"_xlnm.Print_Area",ranges:[`'${B.name}'!$${L[0]}:$${L[1]}`],localSheetId:k};v.push(R)}),B.pageSetup&&(B.pageSetup.printTitlesRow||B.pageSetup.printTitlesColumn)){let O=[];if(B.pageSetup.printTitlesColumn){let R=B.pageSetup.printTitlesColumn.split(":");O.push(`'${B.name}'!$${R[0]}:$${R[1]}`)}if(B.pageSetup.printTitlesRow){let R=B.pageSetup.printTitlesRow.split(":");O.push(`'${B.name}'!$${R[0]}:$${R[1]}`)}let L={name:"_xlnm.Print_Titles",ranges:O,localSheetId:k};v.push(L)}k++}),v.length&&(m.definedNames=m.definedNames.concat(v)),(m.media||[]).forEach((B,O)=>{B.name=B.type+(O+1)})}render(m,v){m.openXml(a.StdDocAttributes),m.openNode("workbook",u.WORKBOOK_ATTRIBUTES),this.map.fileVersion.render(m),this.map.workbookPr.render(m,v.properties),this.map.bookViews.render(m,v.views),this.map.sheets.render(m,v.sheets),this.map.definedNames.render(m,v.definedNames),this.map.calcPr.render(m,v.calcProperties),m.closeNode()}parseOpen(m){return this.parser?(this.parser.parseOpen(m),!0):(m.name==="workbook"||(this.parser=this.map[m.name],this.parser&&this.parser.parseOpen(m)),!0)}parseText(m){this.parser&&this.parser.parseText(m)}parseClose(m){return this.parser?(this.parser.parseClose(m)||(this.parser=void 0),!0):m==="workbook"?(this.model={sheets:this.map.sheets.model,properties:this.map.workbookPr.model||{},views:this.map.bookViews.model,calcProperties:{}},this.map.definedNames.model&&(this.model.definedNames=this.map.definedNames.model),!1):!0}reconcile(m){let v=(m.workbookRels||[]).reduce((R,P)=>(R[P.Id]=P,R),{}),k=[],B,O=0;(m.sheets||[]).forEach(R=>{let P=v[R.rId];P&&(B=m.worksheetHash["xl/"+P.Target.replace(/^(\s|\/xl\/)+/,"")],B&&(B.name=R.name,B.id=R.id,B.state=R.state,k[O++]=B))});let L=[];c.each(m.definedNames,R=>{if(R.name==="_xlnm.Print_Area"){if(B=k[R.localSheetId],B){B.pageSetup||(B.pageSetup={});let P=i.decodeEx(R.ranges[0]);B.pageSetup.printArea=B.pageSetup.printArea?`${B.pageSetup.printArea}&&${P.dimensions}`:P.dimensions}}else if(R.name==="_xlnm.Print_Titles"){if(B=k[R.localSheetId],B){B.pageSetup||(B.pageSetup={});let P=R.ranges.join(","),j=/\$/g,z=/\$\d+:\$\d+/,N=P.match(z);if(N&&N.length){let E=N[0];B.pageSetup.printTitlesRow=E.replace(j,"")}let S=/\$[A-Z]+:\$[A-Z]+/,C=P.match(S);if(C&&C.length){let E=C[0];B.pageSetup.printTitlesColumn=E.replace(j,"")}}}else L.push(R)}),m.definedNames=L,m.media.forEach((R,P)=>{R.index=P})}}u.WORKBOOK_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x15","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},u.STATIC_XFORMS={fileVersion:new t({tag:"fileVersion",$:{appName:"xl",lastEdited:5,lowestEdited:5,rupBuild:9303}})},p.exports=u},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./defined-name-xform":33,"./sheet-xform":34,"./workbook-calc-properties-xform":35,"./workbook-properties-xform":36,"./workbook-view-xform":37}],39:[function(e,p,b){"use strict";let c=e("../strings/rich-text-xform"),i=e("../../../utils/utils"),a=e("../base-xform"),r=p.exports=function(t){this.model=t};i.inherits(r,a,{get tag(){return"r"},get richTextXform(){return this._richTextXform||(this._richTextXform=new c),this._richTextXform},render(t,n){n=n||this.model,t.openNode("comment",{ref:n.ref,authorId:0}),t.openNode("text"),n&&n.note&&n.note.texts&&n.note.texts.forEach(l=>{this.richTextXform.render(t,l)}),t.closeNode(),t.closeNode()},parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;switch(t.name){case"comment":return this.model={type:"note",note:{texts:[]},...t.attributes},!0;case"r":return this.parser=this.richTextXform,this.parser.parseOpen(t),!0;default:return!1}},parseText(t){this.parser&&this.parser.parseText(t)},parseClose(t){switch(t){case"comment":return!1;case"r":return this.model.note.texts.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(t),!0}}})},{"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],40:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../../../utils/utils"),a=e("../base-xform"),r=e("./comment-xform"),t=p.exports=function(){this.map={comment:new r}};i.inherits(t,a,{COMMENTS_ATTRIBUTES:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},{render(n,l){l=l||this.model,n.openXml(c.StdDocAttributes),n.openNode("comments",t.COMMENTS_ATTRIBUTES),n.openNode("authors"),n.leafNode("author",null,"Author"),n.closeNode(),n.openNode("commentList"),l.comments.forEach(o=>{this.map.comment.render(n,o)}),n.closeNode(),n.closeNode()},parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"commentList":return this.model={comments:[]},!0;case"comment":return this.parser=this.map.comment,this.parser.parseOpen(n),!0;default:return!1}},parseText(n){this.parser&&this.parser.parseText(n)},parseClose(n){switch(n){case"commentList":return!1;case"comment":return this.model.comments.push(this.parser.model),this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(n),!0}}})},{"../../../utils/utils":27,"../../../utils/xml-stream":28,"../base-xform":32,"./comment-xform":39}],41:[function(e,p,b){"use strict";let c=e("../../base-xform");p.exports=class extends c{constructor(i){super(),this._model=i}get tag(){return this._model&&this._model.tag}render(i,a,r){(a===r[2]||this.tag==="x:SizeWithCells"&&a===r[1])&&i.leafNode(this.tag)}parseOpen(i){return i.name===this.tag?(this.model={},this.model[this.tag]=!0,!0):!1}parseText(){}parseClose(){return!1}}},{"../../base-xform":32}],42:[function(e,p,b){"use strict";let c=e("../../base-xform");p.exports=class extends c{constructor(i){super(),this._model=i}get tag(){return this._model&&this._model.tag}render(i,a){i.leafNode(this.tag,null,a)}parseOpen(i){return i.name===this.tag?(this.text="",!0):!1}parseText(i){this.text=i}parseClose(){return!1}}},{"../../base-xform":32}],43:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"x:Anchor"}getAnchorRect(i){let a=Math.floor(i.left),r=Math.floor(68*(i.left-a)),t=Math.floor(i.top),n=Math.floor(18*(i.top-t)),l=Math.floor(i.right),o=Math.floor(68*(i.right-l)),s=Math.floor(i.bottom);return[a,r,t,n,l,o,s,Math.floor(18*(i.bottom-s))]}getDefaultRect(i){let a=i.col,r=Math.max(i.row-2,0);return[a,6,r,14,a+2,2,r+4,16]}render(i,a){let r=a.anchor?this.getAnchorRect(a.anchor):this.getDefaultRect(a.refAddress);i.leafNode("x:Anchor",null,r.join(", "))}parseOpen(i){return i.name===this.tag?(this.text="",!0):!1}parseText(i){this.text=i}parseClose(){return!1}}},{"../base-xform":32}],44:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./vml-anchor-xform"),a=e("./style/vml-protection-xform"),r=e("./style/vml-position-xform"),t=["twoCells","oneCells","absolute"];p.exports=class extends c{constructor(){super(),this.map={"x:Anchor":new i,"x:Locked":new a({tag:"x:Locked"}),"x:LockText":new a({tag:"x:LockText"}),"x:SizeWithCells":new r({tag:"x:SizeWithCells"}),"x:MoveWithCells":new r({tag:"x:MoveWithCells"})}}get tag(){return"x:ClientData"}render(n,l){let{protection:o,editAs:s}=l.note;n.openNode(this.tag,{ObjectType:"Note"}),this.map["x:MoveWithCells"].render(n,s,t),this.map["x:SizeWithCells"].render(n,s,t),this.map["x:Anchor"].render(n,l),this.map["x:Locked"].render(n,o.locked),n.leafNode("x:AutoFill",null,"False"),this.map["x:LockText"].render(n,o.lockText),n.leafNode("x:Row",null,l.refAddress.row-1),n.leafNode("x:Column",null,l.refAddress.col-1),n.closeNode()}parseOpen(n){return n.name===this.tag?(this.reset(),this.model={anchor:[],protection:{},editAs:""}):(this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)),!0}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):n===this.tag?(this.normalizeModel(),!1):!0}normalizeModel(){let n=Object.assign({},this.map["x:MoveWithCells"].model,this.map["x:SizeWithCells"].model),l=Object.keys(n).length;this.model.editAs=t[l],this.model.anchor=this.map["x:Anchor"].text,this.model.protection.locked=this.map["x:Locked"].text,this.model.protection.lockText=this.map["x:LockText"].text}}},{"../base-xform":32,"./style/vml-position-xform":41,"./style/vml-protection-xform":42,"./vml-anchor-xform":43}],45:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("./vml-shape-xform");class r extends i{constructor(){super(),this.map={"v:shape":new a}}get tag(){return"xml"}render(n,l){n.openXml(c.StdDocAttributes),n.openNode(this.tag,r.DRAWING_ATTRIBUTES),n.openNode("o:shapelayout",{"v:ext":"edit"}),n.leafNode("o:idmap",{"v:ext":"edit",data:1}),n.closeNode(),n.openNode("v:shapetype",{id:"_x0000_t202",coordsize:"21600,21600","o:spt":202,path:"m,l,21600r21600,l21600,xe"}),n.leafNode("v:stroke",{joinstyle:"miter"}),n.leafNode("v:path",{gradientshapeok:"t","o:connecttype":"rect"}),n.closeNode(),l.comments.forEach((o,s)=>{this.map["v:shape"].render(n,o,s)}),n.closeNode()}parseOpen(n){return this.parser?(this.parser.parseOpen(n),!0):(n.name===this.tag?(this.reset(),this.model={comments:[]}):(this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)),!0)}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.model.comments.push(this.parser.model),this.parser=void 0),!0):n!==this.tag}reconcile(n,l){n.anchors.forEach(o=>{o.br?this.map["xdr:twoCellAnchor"].reconcile(o,l):this.map["xdr:oneCellAnchor"].reconcile(o,l)})}}r.DRAWING_ATTRIBUTES={"xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:x":"urn:schemas-microsoft-com:office:excel"},p.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./vml-shape-xform":46}],46:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./vml-textbox-xform"),a=e("./vml-client-data-xform");class r extends c{constructor(){super(),this.map={"v:textbox":new i,"x:ClientData":new a}}get tag(){return"v:shape"}render(n,l,o){n.openNode("v:shape",r.V_SHAPE_ATTRIBUTES(l,o)),n.leafNode("v:fill",{color2:"infoBackground [80]"}),n.leafNode("v:shadow",{color:"none [81]",obscured:"t"}),n.leafNode("v:path",{"o:connecttype":"none"}),this.map["v:textbox"].render(n,l),this.map["x:ClientData"].render(n,l),n.closeNode()}parseOpen(n){return this.parser?(this.parser.parseOpen(n),!0):(n.name===this.tag?(this.reset(),this.model={margins:{insetmode:n.attributes["o:insetmode"]},anchor:"",editAs:"",protection:{}}):(this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)),!0)}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):n===this.tag?(this.model.margins.inset=this.map["v:textbox"].model&&this.map["v:textbox"].model.inset,this.model.protection=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.protection,this.model.anchor=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.anchor,this.model.editAs=this.map["x:ClientData"].model&&this.map["x:ClientData"].model.editAs,!1):!0}}r.V_SHAPE_ATTRIBUTES=(t,n)=>({id:"_x0000_s"+(1025+n),type:"#_x0000_t202",style:"position:absolute; margin-left:105.3pt;margin-top:10.5pt;width:97.8pt;height:59.1pt;z-index:1;visibility:hidden",fillcolor:"infoBackground [80]",strokecolor:"none [81]","o:insetmode":t.note.margins&&t.note.margins.insetmode}),p.exports=r},{"../base-xform":32,"./vml-client-data-xform":44,"./vml-textbox-xform":47}],47:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"v:textbox"}conversionUnit(i,a,r){return`${parseFloat(i)*a.toFixed(2)}${r}`}reverseConversionUnit(i){return(i||"").split(",").map(a=>Number(parseFloat(this.conversionUnit(parseFloat(a),.1,"")).toFixed(2)))}render(i,a){let r={style:"mso-direction-alt:auto"};if(a&&a.note){let{inset:t}=a.note&&a.note.margins;Array.isArray(t)&&(t=t.map(n=>this.conversionUnit(n,10,"mm")).join(",")),t&&(r.inset=t)}i.openNode("v:textbox",r),i.leafNode("div",{style:"text-align:left"}),i.closeNode()}parseOpen(i){return i.name===this.tag&&(this.model={inset:this.reverseConversionUnit(i.attributes.inset)}),!0}parseText(){}parseClose(i){return i!==this.tag}}},{"../base-xform":32}],48:[function(e,p,b){"use strict";let c=e("./base-xform");p.exports=class extends c{createNewModel(i){return{}}parseOpen(i){return this.parser=this.parser||this.map[i.name],this.parser?(this.parser.parseOpen(i),!0):i.name===this.tag&&(this.model=this.createNewModel(i),!0)}parseText(i){this.parser&&this.parser.parseText(i)}onParserClose(i,a){this.model[i]=a.model}parseClose(i){return this.parser?(this.parser.parseClose(i)||(this.onParserClose(i,this.parser),this.parser=void 0),!0):i!==this.tag}}},{"./base-xform":32}],49:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{render(i,a){i.openNode("HeadingPairs"),i.openNode("vt:vector",{size:2,baseType:"variant"}),i.openNode("vt:variant"),i.leafNode("vt:lpstr",void 0,"Worksheets"),i.closeNode(),i.openNode("vt:variant"),i.leafNode("vt:i4",void 0,a.length),i.closeNode(),i.closeNode(),i.closeNode()}parseOpen(i){return i.name==="HeadingPairs"}parseText(){}parseClose(i){return i!=="HeadingPairs"}}},{"../base-xform":32}],50:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{render(i,a){i.openNode("TitlesOfParts"),i.openNode("vt:vector",{size:a.length,baseType:"lpstr"}),a.forEach(r=>{i.leafNode("vt:lpstr",void 0,r.name)}),i.closeNode(),i.closeNode()}parseOpen(i){return i.name==="TitlesOfParts"}parseText(){}parseClose(i){return i!=="TitlesOfParts"}}},{"../base-xform":32}],51:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("../simple/string-xform"),r=e("./app-heading-pairs-xform"),t=e("./app-titles-of-parts-xform");class n extends i{constructor(){super(),this.map={Company:new a({tag:"Company"}),Manager:new a({tag:"Manager"}),HeadingPairs:new r,TitleOfParts:new t}}render(o,s){o.openXml(c.StdDocAttributes),o.openNode("Properties",n.PROPERTY_ATTRIBUTES),o.leafNode("Application",void 0,"Microsoft Excel"),o.leafNode("DocSecurity",void 0,"0"),o.leafNode("ScaleCrop",void 0,"false"),this.map.HeadingPairs.render(o,s.worksheets),this.map.TitleOfParts.render(o,s.worksheets),this.map.Company.render(o,s.company||""),this.map.Manager.render(o,s.manager),o.leafNode("LinksUpToDate",void 0,"false"),o.leafNode("SharedDoc",void 0,"false"),o.leafNode("HyperlinksChanged",void 0,"false"),o.leafNode("AppVersion",void 0,"16.0300"),o.closeNode()}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):o.name==="Properties"?!0:(this.parser=this.map[o.name],!!this.parser&&(this.parser.parseOpen(o),!0))}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.parser=void 0),!0):o==="Properties"?(this.model={worksheets:this.map.TitleOfParts.model,company:this.map.Company.model,manager:this.map.Manager.model},!1):!0}}n.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3,6}/,"")},n.DateAttrs={"xsi:type":"dcterms:W3CDTF"},n.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},p.exports=n},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/string-xform":119,"./app-heading-pairs-xform":49,"./app-titles-of-parts-xform":50}],52:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../base-xform");class a extends i{render(t,n){t.openXml(c.StdDocAttributes),t.openNode("Types",a.PROPERTY_ATTRIBUTES);let l={};(n.media||[]).forEach(o=>{if(o.type==="image"){let s=o.extension;l[s]||(l[s]=!0,t.leafNode("Default",{Extension:s,ContentType:"image/"+s}))}}),t.leafNode("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),t.leafNode("Default",{Extension:"xml",ContentType:"application/xml"}),t.leafNode("Override",{PartName:"/xl/workbook.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"}),n.worksheets.forEach(o=>{let s=`/xl/worksheets/sheet${o.id}.xml`;t.leafNode("Override",{PartName:s,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"})}),t.leafNode("Override",{PartName:"/xl/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}),t.leafNode("Override",{PartName:"/xl/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"}),n.sharedStrings&&n.sharedStrings.count&&t.leafNode("Override",{PartName:"/xl/sharedStrings.xml",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"}),n.tables&&n.tables.forEach(o=>{t.leafNode("Override",{PartName:"/xl/tables/"+o.target,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"})}),n.drawings&&n.drawings.forEach(o=>{t.leafNode("Override",{PartName:`/xl/drawings/${o.name}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"})}),n.commentRefs&&(t.leafNode("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),n.commentRefs.forEach(o=>{let{commentName:s}=o;t.leafNode("Override",{PartName:`/xl/${s}.xml`,ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml"})})),t.leafNode("Override",{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}),t.leafNode("Override",{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}),t.closeNode()}parseOpen(){return!1}parseText(){}parseClose(){return!1}}a.PROPERTY_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},p.exports=a},{"../../../utils/xml-stream":28,"../base-xform":32}],53:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("../simple/date-xform"),r=e("../simple/string-xform"),t=e("../simple/integer-xform");class n extends i{constructor(){super(),this.map={"dc:creator":new r({tag:"dc:creator"}),"dc:title":new r({tag:"dc:title"}),"dc:subject":new r({tag:"dc:subject"}),"dc:description":new r({tag:"dc:description"}),"dc:identifier":new r({tag:"dc:identifier"}),"dc:language":new r({tag:"dc:language"}),"cp:keywords":new r({tag:"cp:keywords"}),"cp:category":new r({tag:"cp:category"}),"cp:lastModifiedBy":new r({tag:"cp:lastModifiedBy"}),"cp:lastPrinted":new a({tag:"cp:lastPrinted",format:n.DateFormat}),"cp:revision":new t({tag:"cp:revision"}),"cp:version":new r({tag:"cp:version"}),"cp:contentStatus":new r({tag:"cp:contentStatus"}),"cp:contentType":new r({tag:"cp:contentType"}),"dcterms:created":new a({tag:"dcterms:created",attrs:n.DateAttrs,format:n.DateFormat}),"dcterms:modified":new a({tag:"dcterms:modified",attrs:n.DateAttrs,format:n.DateFormat})}}render(o,s){o.openXml(c.StdDocAttributes),o.openNode("cp:coreProperties",n.CORE_PROPERTY_ATTRIBUTES),this.map["dc:creator"].render(o,s.creator),this.map["dc:title"].render(o,s.title),this.map["dc:subject"].render(o,s.subject),this.map["dc:description"].render(o,s.description),this.map["dc:identifier"].render(o,s.identifier),this.map["dc:language"].render(o,s.language),this.map["cp:keywords"].render(o,s.keywords),this.map["cp:category"].render(o,s.category),this.map["cp:lastModifiedBy"].render(o,s.lastModifiedBy),this.map["cp:lastPrinted"].render(o,s.lastPrinted),this.map["cp:revision"].render(o,s.revision),this.map["cp:version"].render(o,s.version),this.map["cp:contentStatus"].render(o,s.contentStatus),this.map["cp:contentType"].render(o,s.contentType),this.map["dcterms:created"].render(o,s.created),this.map["dcterms:modified"].render(o,s.modified),o.closeNode()}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case"cp:coreProperties":case"coreProperties":return!0;default:if(this.parser=this.map[o.name],this.parser)return this.parser.parseOpen(o),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(o))}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){if(this.parser)return this.parser.parseClose(o)||(this.parser=void 0),!0;switch(o){case"cp:coreProperties":case"coreProperties":return this.model={creator:this.map["dc:creator"].model,title:this.map["dc:title"].model,subject:this.map["dc:subject"].model,description:this.map["dc:description"].model,identifier:this.map["dc:identifier"].model,language:this.map["dc:language"].model,keywords:this.map["cp:keywords"].model,category:this.map["cp:category"].model,lastModifiedBy:this.map["cp:lastModifiedBy"].model,lastPrinted:this.map["cp:lastPrinted"].model,revision:this.map["cp:revision"].model,contentStatus:this.map["cp:contentStatus"].model,contentType:this.map["cp:contentType"].model,created:this.map["dcterms:created"].model,modified:this.map["dcterms:modified"].model},!1;default:throw new Error("Unexpected xml node in parseClose: "+o)}}}n.DateFormat=function(l){return l.toISOString().replace(/[.]\d{3}/,"")},n.DateAttrs={"xsi:type":"dcterms:W3CDTF"},n.CORE_PROPERTY_ATTRIBUTES={"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:dcterms":"http://purl.org/dc/terms/","xmlns:dcmitype":"http://purl.org/dc/dcmitype/","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance"},p.exports=n},{"../../../utils/xml-stream":28,"../base-xform":32,"../simple/date-xform":117,"../simple/integer-xform":118,"../simple/string-xform":119}],54:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{render(i,a){i.leafNode("Relationship",a)}parseOpen(i){return i.name==="Relationship"?(this.model=i.attributes,!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],55:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("./relationship-xform");class r extends i{constructor(){super(),this.map={Relationship:new a}}render(n,l){l=l||this._values,n.openXml(c.StdDocAttributes),n.openNode("Relationships",r.RELATIONSHIPS_ATTRIBUTES),l.forEach(o=>{this.map.Relationship.render(n,o)}),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"Relationships":return this.model=[],!0;default:if(this.parser=this.map[n.name],this.parser)return this.parser.parseOpen(n),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(n))}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){if(this.parser)return this.parser.parseClose(n)||(this.model.push(this.parser.model),this.parser=void 0),!0;if(n==="Relationships")return!1;throw new Error("Unexpected xml node in parseClose: "+n)}}r.RELATIONSHIPS_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},p.exports=r},{"../../../utils/xml-stream":28,"../base-xform":32,"./relationship-xform":54}],56:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{parseOpen(i){return this.parser?(this.parser.parseOpen(i),!0):(i.name===this.tag?(this.reset(),this.model={range:{editAs:i.attributes.editAs||"oneCell"}}):(this.parser=this.map[i.name],this.parser&&this.parser.parseOpen(i)),!0)}parseText(i){this.parser&&this.parser.parseText(i)}reconcilePicture(i,a){if(i&&i.rId){let r=a.rels[i.rId].Target.match(/.*\/media\/(.+[.][a-zA-Z]{3,4})/);if(r){let t=r[1],n=a.mediaIndex[t];return a.media[n]}}}}},{"../base-xform":32}],57:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./blip-xform");p.exports=class extends c{constructor(){super(),this.map={"a:blip":new i}}get tag(){return"xdr:blipFill"}render(a,r){a.openNode(this.tag),this.map["a:blip"].render(a,r),a.openNode("a:stretch"),a.leafNode("a:fillRect"),a.closeNode(),a.closeNode()}parseOpen(a){return this.parser?(this.parser.parseOpen(a),!0):(a.name===this.tag?this.reset():(this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)),!0)}parseText(){}parseClose(a){return this.parser?(this.parser.parseClose(a)||(this.parser=void 0),!0):a===this.tag?(this.model=this.map["a:blip"].model,!1):!0}}},{"../base-xform":32,"./blip-xform":58}],58:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"a:blip"}render(i,a){i.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:embed":a.rId,cstate:"print"})}parseOpen(i){return i.name===this.tag&&(this.model={rId:i.attributes["r:embed"]}),!0}parseText(){}parseClose(i){return i!==this.tag}}},{"../base-xform":32}],59:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"xdr:cNvPicPr"}render(i){i.openNode(this.tag),i.leafNode("a:picLocks",{noChangeAspect:"1"}),i.closeNode()}parseOpen(i){switch(i.name){case this.tag:default:return!0}}parseText(){}parseClose(i){return i!==this.tag}}},{"../base-xform":32}],60:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./hlink-click-xform"),a=e("./ext-lst-xform");p.exports=class extends c{constructor(){super(),this.map={"a:hlinkClick":new i,"a:extLst":new a}}get tag(){return"xdr:cNvPr"}render(r,t){r.openNode(this.tag,{id:t.index,name:"Picture "+t.index}),this.map["a:hlinkClick"].render(r,t),this.map["a:extLst"].render(r,t),r.closeNode()}parseOpen(r){return this.parser?(this.parser.parseOpen(r),!0):(r.name===this.tag?this.reset():(this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)),!0)}parseText(){}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.parser=void 0),!0):r===this.tag?(this.model=this.map["a:hlinkClick"].model,!1):!0}}},{"../base-xform":32,"./ext-lst-xform":63,"./hlink-click-xform":65}],61:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("../simple/integer-xform");p.exports=class extends c{constructor(a){super(),this.tag=a.tag,this.map={"xdr:col":new i({tag:"xdr:col",zero:!0}),"xdr:colOff":new i({tag:"xdr:colOff",zero:!0}),"xdr:row":new i({tag:"xdr:row",zero:!0}),"xdr:rowOff":new i({tag:"xdr:rowOff",zero:!0})}}render(a,r){a.openNode(this.tag),this.map["xdr:col"].render(a,r.nativeCol),this.map["xdr:colOff"].render(a,r.nativeColOff),this.map["xdr:row"].render(a,r.nativeRow),this.map["xdr:rowOff"].render(a,r.nativeRowOff),a.closeNode()}parseOpen(a){return this.parser?(this.parser.parseOpen(a),!0):(a.name===this.tag?this.reset():(this.parser=this.map[a.name],this.parser&&this.parser.parseOpen(a)),!0)}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return this.parser?(this.parser.parseClose(a)||(this.parser=void 0),!0):a===this.tag?(this.model={nativeCol:this.map["xdr:col"].model,nativeColOff:this.map["xdr:colOff"].model,nativeRow:this.map["xdr:row"].model,nativeRowOff:this.map["xdr:rowOff"].model},!1):!0}}},{"../base-xform":32,"../simple/integer-xform":118}],62:[function(e,p,b){"use strict";let c=e("../../../utils/col-cache"),i=e("../../../utils/xml-stream"),a=e("../base-xform"),r=e("./two-cell-anchor-xform"),t=e("./one-cell-anchor-xform");class n extends a{constructor(){super(),this.map={"xdr:twoCellAnchor":new r,"xdr:oneCellAnchor":new t}}prepare(o){o.anchors.forEach((s,f)=>{s.anchorType=(function(d){return(typeof d.range=="string"?c.decode(d.range):d.range).br?"xdr:twoCellAnchor":"xdr:oneCellAnchor"})(s),this.map[s.anchorType].prepare(s,{index:f})})}get tag(){return"xdr:wsDr"}render(o,s){o.openXml(i.StdDocAttributes),o.openNode(this.tag,n.DRAWING_ATTRIBUTES),s.anchors.forEach(f=>{this.map[f.anchorType].render(o,f)}),o.closeNode()}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):(o.name===this.tag?(this.reset(),this.model={anchors:[]}):(this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o)),!0)}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.model.anchors.push(this.parser.model),this.parser=void 0),!0):o!==this.tag}reconcile(o,s){o.anchors.forEach(f=>{f.br?this.map["xdr:twoCellAnchor"].reconcile(f,s):this.map["xdr:oneCellAnchor"].reconcile(f,s)})}}n.DRAWING_ATTRIBUTES={"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"},p.exports=n},{"../../../utils/col-cache":19,"../../../utils/xml-stream":28,"../base-xform":32,"./one-cell-anchor-xform":67,"./two-cell-anchor-xform":70}],63:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"a:extLst"}render(i){i.openNode(this.tag),i.openNode("a:ext",{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}),i.leafNode("a16:creationId",{"xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main",id:"{00000000-0008-0000-0000-000002000000}"}),i.closeNode(),i.closeNode()}parseOpen(i){switch(i.name){case this.tag:default:return!0}}parseText(){}parseClose(i){return i!==this.tag}}},{"../base-xform":32}],64:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{constructor(i){super(),this.tag=i.tag,this.map={}}render(i,a){i.openNode(this.tag);let r=Math.floor(9525*a.width),t=Math.floor(9525*a.height);i.addAttribute("cx",r),i.addAttribute("cy",t),i.closeNode()}parseOpen(i){return i.name===this.tag&&(this.model={width:parseInt(i.attributes.cx||"0",10)/9525,height:parseInt(i.attributes.cy||"0",10)/9525},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],65:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"a:hlinkClick"}render(i,a){a.hyperlinks&&a.hyperlinks.rId&&i.leafNode(this.tag,{"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","r:id":a.hyperlinks.rId,tooltip:a.hyperlinks.tooltip})}parseOpen(i){return i.name===this.tag&&(this.model={hyperlinks:{rId:i.attributes["r:id"],tooltip:i.attributes.tooltip}}),!0}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],66:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./c-nv-pr-xform"),a=e("./c-nv-pic-pr-xform");p.exports=class extends c{constructor(){super(),this.map={"xdr:cNvPr":new i,"xdr:cNvPicPr":new a}}get tag(){return"xdr:nvPicPr"}render(r,t){r.openNode(this.tag),this.map["xdr:cNvPr"].render(r,t),this.map["xdr:cNvPicPr"].render(r,t),r.closeNode()}parseOpen(r){return this.parser?(this.parser.parseOpen(r),!0):(r.name===this.tag?this.reset():(this.parser=this.map[r.name],this.parser&&this.parser.parseOpen(r)),!0)}parseText(){}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.parser=void 0),!0):r===this.tag?(this.model=this.map["xdr:cNvPr"].model,!1):!0}}},{"../base-xform":32,"./c-nv-pic-pr-xform":59,"./c-nv-pr-xform":60}],67:[function(e,p,b){"use strict";let c=e("./base-cell-anchor-xform"),i=e("../static-xform"),a=e("./cell-position-xform"),r=e("./ext-xform"),t=e("./pic-xform");p.exports=class extends c{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:ext":new r({tag:"xdr:ext"}),"xdr:pic":new t,"xdr:clientData":new i({tag:"xdr:clientData"})}}get tag(){return"xdr:oneCellAnchor"}prepare(n,l){this.map["xdr:pic"].prepare(n.picture,l)}render(n,l){n.openNode(this.tag,{editAs:l.range.editAs||"oneCell"}),this.map["xdr:from"].render(n,l.range.tl),this.map["xdr:ext"].render(n,l.range.ext),this.map["xdr:pic"].render(n,l.picture),this.map["xdr:clientData"].render(n,{}),n.closeNode()}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):n===this.tag?(this.model.range.tl=this.map["xdr:from"].model,this.model.range.ext=this.map["xdr:ext"].model,this.model.picture=this.map["xdr:pic"].model,!1):!0}reconcile(n,l){n.medium=this.reconcilePicture(n.picture,l)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./ext-xform":64,"./pic-xform":68}],68:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("../static-xform"),a=e("./blip-fill-xform"),r=e("./nv-pic-pr-xform"),t=e("./sp-pr");p.exports=class extends c{constructor(){super(),this.map={"xdr:nvPicPr":new r,"xdr:blipFill":new a,"xdr:spPr":new i(t)}}get tag(){return"xdr:pic"}prepare(n,l){n.index=l.index+1}render(n,l){n.openNode(this.tag),this.map["xdr:nvPicPr"].render(n,l),this.map["xdr:blipFill"].render(n,l),this.map["xdr:spPr"].render(n,l),n.closeNode()}parseOpen(n){return this.parser?(this.parser.parseOpen(n),!0):(n.name===this.tag?this.reset():(this.parser=this.map[n.name],this.parser&&this.parser.parseOpen(n)),!0)}parseText(){}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.mergeModel(this.parser.model),this.parser=void 0),!0):n!==this.tag}}},{"../base-xform":32,"../static-xform":120,"./blip-fill-xform":57,"./nv-pic-pr-xform":66,"./sp-pr":69}],69:[function(e,p,b){"use strict";p.exports={tag:"xdr:spPr",c:[{tag:"a:xfrm",c:[{tag:"a:off",$:{x:"0",y:"0"}},{tag:"a:ext",$:{cx:"0",cy:"0"}}]},{tag:"a:prstGeom",$:{prst:"rect"},c:[{tag:"a:avLst"}]}]}},{}],70:[function(e,p,b){"use strict";let c=e("./base-cell-anchor-xform"),i=e("../static-xform"),a=e("./cell-position-xform"),r=e("./pic-xform");p.exports=class extends c{constructor(){super(),this.map={"xdr:from":new a({tag:"xdr:from"}),"xdr:to":new a({tag:"xdr:to"}),"xdr:pic":new r,"xdr:clientData":new i({tag:"xdr:clientData"})}}get tag(){return"xdr:twoCellAnchor"}prepare(t,n){this.map["xdr:pic"].prepare(t.picture,n)}render(t,n){t.openNode(this.tag,{editAs:n.range.editAs||"oneCell"}),this.map["xdr:from"].render(t,n.range.tl),this.map["xdr:to"].render(t,n.range.br),this.map["xdr:pic"].render(t,n.picture),this.map["xdr:clientData"].render(t,{}),t.closeNode()}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t===this.tag?(this.model.range.tl=this.map["xdr:from"].model,this.model.range.br=this.map["xdr:to"].model,this.model.picture=this.map["xdr:pic"].model,!1):!0}reconcile(t,n){t.medium=this.reconcilePicture(t.picture,n)}}},{"../static-xform":120,"./base-cell-anchor-xform":56,"./cell-position-xform":61,"./pic-xform":68}],71:[function(e,p,b){"use strict";let c=e("./base-xform");p.exports=class extends c{constructor(i){super(),this.tag=i.tag,this.always=!!i.always,this.count=i.count,this.empty=i.empty,this.$count=i.$count||"count",this.$=i.$,this.childXform=i.childXform,this.maxItems=i.maxItems}prepare(i,a){let{childXform:r}=this;i&&i.forEach((t,n)=>{a.index=n,r.prepare(t,a)})}render(i,a){if(this.always||a&&a.length){i.openNode(this.tag,this.$),this.count&&i.addAttribute(this.$count,a&&a.length||0);let{childXform:r}=this;(a||[]).forEach((t,n)=>{r.render(i,t,n)}),i.closeNode()}else this.empty&&i.leafNode(this.tag)}parseOpen(i){return this.parser?(this.parser.parseOpen(i),!0):i.name===this.tag?(this.model=[],!0):!!this.childXform.parseOpen(i)&&(this.parser=this.childXform,!0)}parseText(i){this.parser&&this.parser.parseText(i)}parseClose(i){if(this.parser){if(!this.parser.parseClose(i)&&(this.model.push(this.parser.model),this.parser=void 0,this.maxItems&&this.model.length>this.maxItems))throw new Error(`Max ${this.childXform.tag} count (${this.maxItems}) exceeded`);return!0}return!1}reconcile(i,a){if(i){let{childXform:r}=this;i.forEach(t=>{r.reconcile(t,a)})}}}},{"./base-xform":32}],72:[function(e,p,b){"use strict";let c=e("../../../utils/col-cache"),i=e("../base-xform");p.exports=class extends i{get tag(){return"autoFilter"}render(a,r){if(r)if(typeof r=="string")a.leafNode("autoFilter",{ref:r});else{let t=function(o){return typeof o=="string"?o:c.getAddress(o.row,o.column).address},n=t(r.from),l=t(r.to);n&&l&&a.leafNode("autoFilter",{ref:`${n}:${l}`})}}parseOpen(a){a.name==="autoFilter"&&(this.model=a.attributes.ref)}}},{"../../../utils/col-cache":19,"../base-xform":32}],73:[function(e,p,b){"use strict";let c=e("../../../utils/utils"),i=e("../base-xform"),a=e("../../../doc/range"),r=e("../../../doc/enums"),t=e("../strings/rich-text-xform");function n(l){if(l==null)return r.ValueType.Null;if(l instanceof String||typeof l=="string")return r.ValueType.String;if(typeof l=="number")return r.ValueType.Number;if(typeof l=="boolean")return r.ValueType.Boolean;if(l instanceof Date)return r.ValueType.Date;if(l.text&&l.hyperlink)return r.ValueType.Hyperlink;if(l.formula)return r.ValueType.Formula;if(l.error)return r.ValueType.Error;throw new Error("I could not understand type of value")}p.exports=class extends i{constructor(){super(),this.richTextXForm=new t}get tag(){return"c"}prepare(l,o){let s=o.styles.addStyleModel(l.style||{},(function(f){return f.type===r.ValueType.Formula?n(f.result):f.type})(l));switch(s&&(l.styleId=s),l.comment&&o.comments.push({...l.comment,ref:l.address}),l.type){case r.ValueType.String:case r.ValueType.RichText:o.sharedStrings&&(l.ssId=o.sharedStrings.add(l.value));break;case r.ValueType.Date:o.date1904&&(l.date1904=!0);break;case r.ValueType.Hyperlink:o.sharedStrings&&l.text!==void 0&&l.text!==null&&(l.ssId=o.sharedStrings.add(l.text)),o.hyperlinks.push({address:l.address,target:l.hyperlink,tooltip:l.tooltip});break;case r.ValueType.Merge:o.merges.add(l);break;case r.ValueType.Formula:if(o.date1904&&(l.date1904=!0),l.shareType==="shared"&&(l.si=o.siFormulae++),l.formula)o.formulae[l.address]=l;else if(l.sharedFormula){let f=o.formulae[l.sharedFormula];if(!f)throw new Error("Shared Formula master must exist above and or left of clone for cell "+l.address);f.si===void 0?(f.shareType="shared",f.si=o.siFormulae++,f.range=new a(f.address,l.address)):f.range&&f.range.expandToAddress(l.address),l.si=f.si}}}renderFormula(l,o){let s=null;switch(o.shareType){case"shared":s={t:"shared",ref:o.ref||o.range.range,si:o.si};break;case"array":s={t:"array",ref:o.ref};break;default:o.si!==void 0&&(s={t:"shared",si:o.si})}switch(n(o.result)){case r.ValueType.Null:l.leafNode("f",s,o.formula);break;case r.ValueType.String:l.addAttribute("t","str"),l.leafNode("f",s,o.formula),l.leafNode("v",null,o.result);break;case r.ValueType.Number:l.leafNode("f",s,o.formula),l.leafNode("v",null,o.result);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("f",s,o.formula),l.leafNode("v",null,o.result?1:0);break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("f",s,o.formula),l.leafNode("v",null,o.result.error);break;case r.ValueType.Date:l.leafNode("f",s,o.formula),l.leafNode("v",null,c.dateToExcel(o.result,o.date1904));break;default:throw new Error("I could not understand type of value")}}render(l,o){if(o.type!==r.ValueType.Null||o.styleId){switch(l.openNode("c"),l.addAttribute("r",o.address),o.styleId&&l.addAttribute("s",o.styleId),o.type){case r.ValueType.Null:break;case r.ValueType.Number:l.leafNode("v",null,o.value);break;case r.ValueType.Boolean:l.addAttribute("t","b"),l.leafNode("v",null,o.value?"1":"0");break;case r.ValueType.Error:l.addAttribute("t","e"),l.leafNode("v",null,o.value.error);break;case r.ValueType.String:case r.ValueType.RichText:o.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,o.ssId)):o.value&&o.value.richText?(l.addAttribute("t","inlineStr"),l.openNode("is"),o.value.richText.forEach(s=>{this.richTextXForm.render(l,s)}),l.closeNode("is")):(l.addAttribute("t","str"),l.leafNode("v",null,o.value));break;case r.ValueType.Date:l.leafNode("v",null,c.dateToExcel(o.value,o.date1904));break;case r.ValueType.Hyperlink:o.ssId!==void 0?(l.addAttribute("t","s"),l.leafNode("v",null,o.ssId)):(l.addAttribute("t","str"),l.leafNode("v",null,o.text));break;case r.ValueType.Formula:this.renderFormula(l,o);break;case r.ValueType.Merge:}l.closeNode()}}parseOpen(l){if(this.parser)return this.parser.parseOpen(l),!0;switch(l.name){case"c":return this.model={address:l.attributes.r},this.t=l.attributes.t,l.attributes.s&&(this.model.styleId=parseInt(l.attributes.s,10)),!0;case"f":return this.currentNode="f",this.model.si=l.attributes.si,this.model.shareType=l.attributes.t,this.model.ref=l.attributes.ref,!0;case"v":return this.currentNode="v",!0;case"t":return this.currentNode="t",!0;case"r":return this.parser=this.richTextXForm,this.parser.parseOpen(l),!0;default:return!1}}parseText(l){if(this.parser)this.parser.parseText(l);else switch(this.currentNode){case"f":this.model.formula=this.model.formula?this.model.formula+l:l;break;case"v":case"t":this.model.value&&this.model.value.richText?this.model.value.richText.text=this.model.value.richText.text?this.model.value.richText.text+l:l:this.model.value=this.model.value?this.model.value+l:l}}parseClose(l){switch(l){case"c":{let{model:o}=this;if(o.formula||o.shareType)o.type=r.ValueType.Formula,o.value&&(this.t==="str"?o.result=c.xmlDecode(o.value):this.t==="b"?o.result=parseInt(o.value,10)!==0:this.t==="e"?o.result={error:o.value}:o.result=parseFloat(o.value),o.value=void 0);else if(o.value!==void 0)switch(this.t){case"s":o.type=r.ValueType.String,o.value=parseInt(o.value,10);break;case"str":o.type=r.ValueType.String,o.value=c.xmlDecode(o.value);break;case"inlineStr":o.type=r.ValueType.String;break;case"b":o.type=r.ValueType.Boolean,o.value=parseInt(o.value,10)!==0;break;case"e":o.type=r.ValueType.Error,o.value={error:o.value};break;default:o.type=r.ValueType.Number,o.value=parseFloat(o.value)}else o.styleId?o.type=r.ValueType.Null:o.type=r.ValueType.Merge;return!1}case"f":case"v":case"is":return this.currentNode=void 0,!0;case"t":return this.parser?(this.parser.parseClose(l),!0):(this.currentNode=void 0,!0);case"r":return this.model.value=this.model.value||{},this.model.value.richText=this.model.value.richText||[],this.model.value.richText.push(this.parser.model),this.parser=void 0,this.currentNode=void 0,!0;default:return!!this.parser&&(this.parser.parseClose(l),!0)}}reconcile(l,o){let s=l.styleId&&o.styles&&o.styles.getStyleModel(l.styleId);switch(s&&(l.style=s),l.styleId!==void 0&&(l.styleId=void 0),l.type){case r.ValueType.String:typeof l.value=="number"&&o.sharedStrings&&(l.value=o.sharedStrings.getString(l.value)),l.value.richText&&(l.type=r.ValueType.RichText);break;case r.ValueType.Number:s&&c.isDateFmt(s.numFmt)&&(l.type=r.ValueType.Date,l.value=c.excelToDate(l.value,o.date1904));break;case r.ValueType.Formula:l.result!==void 0&&s&&c.isDateFmt(s.numFmt)&&(l.result=c.excelToDate(l.result,o.date1904)),l.shareType==="shared"&&(l.ref?o.formulae[l.si]=l.address:(l.sharedFormula=o.formulae[l.si],delete l.shareType),delete l.si)}let f=o.hyperlinkMap[l.address];f&&(l.type===r.ValueType.Formula?(l.text=l.result,l.result=void 0):(l.text=l.value,l.value=void 0),l.type=r.ValueType.Hyperlink,l.hyperlink=f);let d=o.commentsMap&&o.commentsMap[l.address];d&&(l.comment=d)}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/utils":27,"../base-xform":32,"../strings/rich-text-xform":122}],74:[function(e,p,b){"use strict";let c=e("../../base-xform");p.exports=class extends c{get tag(){return"x14:cfIcon"}render(i,a){i.leafNode(this.tag,{iconSet:a.iconSet,iconId:a.iconId})}parseOpen(i){let{attributes:a}=i;this.model={iconSet:a.iconSet,iconId:c.toIntValue(a.iconId)}}parseClose(i){return i!==this.tag}}},{"../../base-xform":32}],75:[function(e,p,b){"use strict";let{v4:c}=e("uuid"),i=e("../../base-xform"),a=e("../../composite-xform"),r=e("./databar-ext-xform"),t=e("./icon-set-ext-xform"),n={"3Triangles":!0,"3Stars":!0,"5Boxes":!0};class l extends a{constructor(){super(),this.map={"x14:dataBar":this.databarXform=new r,"x14:iconSet":this.iconSetXform=new t}}get tag(){return"x14:cfRule"}static isExt(s){return s.type==="dataBar"?r.isExt(s):!(s.type!=="iconSet"||!s.custom&&!n[s.iconSet])}prepare(s){l.isExt(s)&&(s.x14Id=`{${c()}}`.toUpperCase())}render(s,f){if(l.isExt(f))switch(f.type){case"dataBar":this.renderDataBar(s,f);break;case"iconSet":this.renderIconSet(s,f)}}renderDataBar(s,f){s.openNode(this.tag,{type:"dataBar",id:f.x14Id}),this.databarXform.render(s,f),s.closeNode()}renderIconSet(s,f){s.openNode(this.tag,{type:"iconSet",priority:f.priority,id:f.x14Id||`{${c()}}`}),this.iconSetXform.render(s,f),s.closeNode()}createNewModel(s){let{attributes:f}=s;return{type:f.type,x14Id:f.id,priority:i.toIntValue(f.priority)}}onParserClose(s,f){Object.assign(this.model,f.model)}}p.exports=l},{"../../base-xform":32,"../../composite-xform":48,"./databar-ext-xform":79,"./icon-set-ext-xform":81,uuid:528}],76:[function(e,p,b){"use strict";let c=e("../../composite-xform"),i=e("./f-ext-xform");p.exports=class extends c{constructor(){super(),this.map={"xm:f":this.fExtXform=new i}}get tag(){return"x14:cfvo"}render(a,r){a.openNode(this.tag,{type:r.type}),r.value!==void 0&&this.fExtXform.render(a,r.value),a.closeNode()}createNewModel(a){return{type:a.attributes.type}}onParserClose(a,r){a==="xm:f"&&(this.model.value=r.model?parseFloat(r.model):0)}}},{"../../composite-xform":48,"./f-ext-xform":80}],77:[function(e,p,b){"use strict";let c=e("../../composite-xform"),i=e("./sqref-ext-xform"),a=e("./cf-rule-ext-xform");p.exports=class extends c{constructor(){super(),this.map={"xm:sqref":this.sqRef=new i,"x14:cfRule":this.cfRule=new a}}get tag(){return"x14:conditionalFormatting"}prepare(r,t){r.rules.forEach(n=>{this.cfRule.prepare(n,t)})}render(r,t){t.rules.some(a.isExt)&&(r.openNode(this.tag,{"xmlns:xm":"http://schemas.microsoft.com/office/excel/2006/main"}),t.rules.filter(a.isExt).forEach(n=>this.cfRule.render(r,n)),this.sqRef.render(r,t.ref),r.closeNode())}createNewModel(){return{rules:[]}}onParserClose(r,t){switch(r){case"xm:sqref":this.model.ref=t.model;break;case"x14:cfRule":this.model.rules.push(t.model)}}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./sqref-ext-xform":82}],78:[function(e,p,b){"use strict";let c=e("../../composite-xform"),i=e("./cf-rule-ext-xform"),a=e("./conditional-formatting-ext-xform");p.exports=class extends c{constructor(){super(),this.map={"x14:conditionalFormatting":this.cfXform=new a}}get tag(){return"x14:conditionalFormattings"}hasContent(r){return r.hasExtContent===void 0&&(r.hasExtContent=r.some(t=>t.rules.some(i.isExt))),r.hasExtContent}prepare(r,t){r.forEach(n=>{this.cfXform.prepare(n,t)})}render(r,t){this.hasContent(t)&&(r.openNode(this.tag),t.forEach(n=>this.cfXform.render(r,n)),r.closeNode())}createNewModel(){return[]}onParserClose(r,t){this.model.push(t.model)}}},{"../../composite-xform":48,"./cf-rule-ext-xform":75,"./conditional-formatting-ext-xform":77}],79:[function(e,p,b){"use strict";let c=e("../../base-xform"),i=e("../../composite-xform"),a=e("../../style/color-xform"),r=e("./cfvo-ext-xform");p.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new r,"x14:borderColor":this.borderColorXform=new a("x14:borderColor"),"x14:negativeBorderColor":this.negativeBorderColorXform=new a("x14:negativeBorderColor"),"x14:negativeFillColor":this.negativeFillColorXform=new a("x14:negativeFillColor"),"x14:axisColor":this.axisColorXform=new a("x14:axisColor")}}static isExt(t){return!t.gradient}get tag(){return"x14:dataBar"}render(t,n){t.openNode(this.tag,{minLength:c.toIntAttribute(n.minLength,0,!0),maxLength:c.toIntAttribute(n.maxLength,100,!0),border:c.toBoolAttribute(n.border,!1),gradient:c.toBoolAttribute(n.gradient,!0),negativeBarColorSameAsPositive:c.toBoolAttribute(n.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:c.toBoolAttribute(n.negativeBarBorderColorSameAsPositive,!0),axisPosition:c.toAttribute(n.axisPosition,"auto"),direction:c.toAttribute(n.direction,"leftToRight")}),n.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),this.borderColorXform.render(t,n.borderColor),this.negativeBorderColorXform.render(t,n.negativeBorderColor),this.negativeFillColorXform.render(t,n.negativeFillColor),this.axisColorXform.render(t,n.axisColor),t.closeNode()}createNewModel(t){let{attributes:n}=t;return{cfvo:[],minLength:c.toIntValue(n.minLength,0),maxLength:c.toIntValue(n.maxLength,100),border:c.toBoolValue(n.border,!1),gradient:c.toBoolValue(n.gradient,!0),negativeBarColorSameAsPositive:c.toBoolValue(n.negativeBarColorSameAsPositive,!0),negativeBarBorderColorSameAsPositive:c.toBoolValue(n.negativeBarBorderColorSameAsPositive,!0),axisPosition:c.toStringValue(n.axisPosition,"auto"),direction:c.toStringValue(n.direction,"leftToRight")}}onParserClose(t,n){let[,l]=t.split(":");l==="cfvo"?this.model.cfvo.push(n.model):this.model[l]=n.model}}},{"../../base-xform":32,"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-ext-xform":76}],80:[function(e,p,b){"use strict";let c=e("../../base-xform");p.exports=class extends c{get tag(){return"xm:f"}render(i,a){i.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(i){this.model+=i}parseClose(i){return i!==this.tag}}},{"../../base-xform":32}],81:[function(e,p,b){"use strict";let c=e("../../base-xform"),i=e("../../composite-xform"),a=e("./cfvo-ext-xform"),r=e("./cf-icon-ext-xform");p.exports=class extends i{constructor(){super(),this.map={"x14:cfvo":this.cfvoXform=new a,"x14:cfIcon":this.cfIconXform=new r}}get tag(){return"x14:iconSet"}render(t,n){t.openNode(this.tag,{iconSet:c.toStringAttribute(n.iconSet),reverse:c.toBoolAttribute(n.reverse,!1),showValue:c.toBoolAttribute(n.showValue,!0),custom:c.toBoolAttribute(n.icons,!1)}),n.cfvo.forEach(l=>{this.cfvoXform.render(t,l)}),n.icons&&n.icons.forEach((l,o)=>{l.iconId=o,this.cfIconXform.render(t,l)}),t.closeNode()}createNewModel(t){let{attributes:n}=t;return{cfvo:[],iconSet:c.toStringValue(n.iconSet,"3TrafficLights"),reverse:c.toBoolValue(n.reverse,!1),showValue:c.toBoolValue(n.showValue,!0)}}onParserClose(t,n){let[,l]=t.split(":");switch(l){case"cfvo":this.model.cfvo.push(n.model);break;case"cfIcon":this.model.icons||(this.model.icons=[]),this.model.icons.push(n.model);break;default:this.model[l]=n.model}}}},{"../../base-xform":32,"../../composite-xform":48,"./cf-icon-ext-xform":74,"./cfvo-ext-xform":76}],82:[function(e,p,b){"use strict";let c=e("../../base-xform");p.exports=class extends c{get tag(){return"xm:sqref"}render(i,a){i.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(i){this.model+=i}parseClose(i){return i!==this.tag}}},{"../../base-xform":32}],83:[function(e,p,b){"use strict";let c=e("../../base-xform"),i=e("../../composite-xform"),a=e("../../../../doc/range"),r=e("./databar-xform"),t=e("./ext-lst-ref-xform"),n=e("./formula-xform"),l=e("./color-scale-xform"),o=e("./icon-set-xform"),s={"3Triangles":!0,"3Stars":!0,"5Boxes":!0},f=u=>{let{type:g,operator:m}=u;switch(g){case"containsText":case"containsBlanks":case"notContainsBlanks":case"containsErrors":case"notContainsErrors":return{type:"containsText",operator:g};default:return{type:g,operator:m}}};class d extends i{constructor(){super(),this.map={dataBar:this.databarXform=new r,extLst:this.extLstRefXform=new t,formula:this.formulaXform=new n,colorScale:this.colorScaleXform=new l,iconSet:this.iconSetXform=new o}}get tag(){return"cfRule"}static isPrimitive(g){return g.type!=="iconSet"||!g.custom&&!s[g.iconSet]}render(g,m){switch(m.type){case"expression":this.renderExpression(g,m);break;case"cellIs":this.renderCellIs(g,m);break;case"top10":this.renderTop10(g,m);break;case"aboveAverage":this.renderAboveAverage(g,m);break;case"dataBar":this.renderDataBar(g,m);break;case"colorScale":this.renderColorScale(g,m);break;case"iconSet":this.renderIconSet(g,m);break;case"containsText":this.renderText(g,m);break;case"timePeriod":this.renderTimePeriod(g,m)}}renderExpression(g,m){g.openNode(this.tag,{type:"expression",dxfId:m.dxfId,priority:m.priority}),this.formulaXform.render(g,m.formulae[0]),g.closeNode()}renderCellIs(g,m){g.openNode(this.tag,{type:"cellIs",dxfId:m.dxfId,priority:m.priority,operator:m.operator}),m.formulae.forEach(v=>{this.formulaXform.render(g,v)}),g.closeNode()}renderTop10(g,m){g.leafNode(this.tag,{type:"top10",dxfId:m.dxfId,priority:m.priority,percent:c.toBoolAttribute(m.percent,!1),bottom:c.toBoolAttribute(m.bottom,!1),rank:c.toIntValue(m.rank,10,!0)})}renderAboveAverage(g,m){g.leafNode(this.tag,{type:"aboveAverage",dxfId:m.dxfId,priority:m.priority,aboveAverage:c.toBoolAttribute(m.aboveAverage,!0)})}renderDataBar(g,m){g.openNode(this.tag,{type:"dataBar",priority:m.priority}),this.databarXform.render(g,m),this.extLstRefXform.render(g,m),g.closeNode()}renderColorScale(g,m){g.openNode(this.tag,{type:"colorScale",priority:m.priority}),this.colorScaleXform.render(g,m),g.closeNode()}renderIconSet(g,m){d.isPrimitive(m)&&(g.openNode(this.tag,{type:"iconSet",priority:m.priority}),this.iconSetXform.render(g,m),g.closeNode())}renderText(g,m){g.openNode(this.tag,{type:m.operator,dxfId:m.dxfId,priority:m.priority,operator:c.toStringAttribute(m.operator,"containsText")});let v=(k=>{if(k.formulae&&k.formulae[0])return k.formulae[0];let B=new a(k.ref),{tl:O}=B;switch(k.operator){case"containsText":return`NOT(ISERROR(SEARCH("${k.text}",${O})))`;case"containsBlanks":return`LEN(TRIM(${O}))=0`;case"notContainsBlanks":return`LEN(TRIM(${O}))>0`;case"containsErrors":return`ISERROR(${O})`;case"notContainsErrors":return`NOT(ISERROR(${O}))`;default:return}})(m);v&&this.formulaXform.render(g,v),g.closeNode()}renderTimePeriod(g,m){g.openNode(this.tag,{type:"timePeriod",dxfId:m.dxfId,priority:m.priority,timePeriod:m.timePeriod});let v=(k=>{if(k.formulae&&k.formulae[0])return k.formulae[0];let B=new a(k.ref),{tl:O}=B;switch(k.timePeriod){case"thisWeek":return`AND(TODAY()-ROUNDDOWN(${O},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${O},0)-TODAY()<=7-WEEKDAY(TODAY()))`;case"lastWeek":return`AND(TODAY()-ROUNDDOWN(${O},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${O},0)<(WEEKDAY(TODAY())+7))`;case"nextWeek":return`AND(ROUNDDOWN(${O},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${O},0)-TODAY()<(15-WEEKDAY(TODAY())))`;case"yesterday":return`FLOOR(${O},1)=TODAY()-1`;case"today":return`FLOOR(${O},1)=TODAY()`;case"tomorrow":return`FLOOR(${O},1)=TODAY()+1`;case"last7Days":return`AND(TODAY()-FLOOR(${O},1)<=6,FLOOR(${O},1)<=TODAY())`;case"lastMonth":return`AND(MONTH(${O})=MONTH(EDATE(TODAY(),0-1)),YEAR(${O})=YEAR(EDATE(TODAY(),0-1)))`;case"thisMonth":return`AND(MONTH(${O})=MONTH(TODAY()),YEAR(${O})=YEAR(TODAY()))`;case"nextMonth":return`AND(MONTH(${O})=MONTH(EDATE(TODAY(),0+1)),YEAR(${O})=YEAR(EDATE(TODAY(),0+1)))`;default:return}})(m);v&&this.formulaXform.render(g,v),g.closeNode()}createNewModel(g){let{attributes:m}=g;return{...f(m),dxfId:c.toIntValue(m.dxfId),priority:c.toIntValue(m.priority),timePeriod:m.timePeriod,percent:c.toBoolValue(m.percent),bottom:c.toBoolValue(m.bottom),rank:c.toIntValue(m.rank),aboveAverage:c.toBoolValue(m.aboveAverage)}}onParserClose(g,m){switch(g){case"dataBar":case"extLst":case"colorScale":case"iconSet":Object.assign(this.model,m.model);break;case"formula":this.model.formulae=this.model.formulae||[],this.model.formulae.push(m.model)}}}p.exports=d},{"../../../../doc/range":10,"../../base-xform":32,"../../composite-xform":48,"./color-scale-xform":85,"./databar-xform":88,"./ext-lst-ref-xform":89,"./formula-xform":90,"./icon-set-xform":91}],84:[function(e,p,b){"use strict";let c=e("../../base-xform");p.exports=class extends c{get tag(){return"cfvo"}render(i,a){i.leafNode(this.tag,{type:a.type,val:a.value})}parseOpen(i){this.model={type:i.attributes.type,value:c.toFloatValue(i.attributes.val)}}parseClose(i){return i!==this.tag}}},{"../../base-xform":32}],85:[function(e,p,b){"use strict";let c=e("../../composite-xform"),i=e("../../style/color-xform"),a=e("./cfvo-xform");p.exports=class extends c{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return"colorScale"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(n=>{this.cfvoXform.render(r,n)}),t.color.forEach(n=>{this.colorXform.render(r,n)}),r.closeNode()}createNewModel(r){return{cfvo:[],color:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],86:[function(e,p,b){"use strict";let c=e("../../composite-xform"),i=e("./cf-rule-xform");p.exports=class extends c{constructor(){super(),this.map={cfRule:new i}}get tag(){return"conditionalFormatting"}render(a,r){r.rules.some(i.isPrimitive)&&(a.openNode(this.tag,{sqref:r.ref}),r.rules.forEach(t=>{i.isPrimitive(t)&&(t.ref=r.ref,this.map.cfRule.render(a,t))}),a.closeNode())}createNewModel(a){let{attributes:r}=a;return{ref:r.sqref,rules:[]}}onParserClose(a,r){this.model.rules.push(r.model)}}},{"../../composite-xform":48,"./cf-rule-xform":83}],87:[function(e,p,b){"use strict";let c=e("../../base-xform"),i=e("./conditional-formatting-xform");p.exports=class extends c{constructor(){super(),this.cfXform=new i}get tag(){return"conditionalFormatting"}reset(){this.model=[]}prepare(a,r){let t=a.reduce((n,l)=>Math.max(n,...l.rules.map(o=>o.priority||0)),1);a.forEach(n=>{n.rules.forEach(l=>{l.priority||(l.priority=t++),l.style&&(l.dxfId=r.styles.addDxfStyle(l.style))})})}render(a,r){r.forEach(t=>{this.cfXform.render(a,t)})}parseOpen(a){return this.parser?(this.parser.parseOpen(a),!0):a.name==="conditionalFormatting"?(this.parser=this.cfXform,this.parser.parseOpen(a),!0):!1}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){return!!this.parser&&(!!this.parser.parseClose(a)||(this.model.push(this.parser.model),this.parser=void 0,!1))}reconcile(a,r){a.forEach(t=>{t.rules.forEach(n=>{n.dxfId!==void 0&&(n.style=r.styles.getDxfStyle(n.dxfId),delete n.dxfId)})})}}},{"../../base-xform":32,"./conditional-formatting-xform":86}],88:[function(e,p,b){"use strict";let c=e("../../composite-xform"),i=e("../../style/color-xform"),a=e("./cfvo-xform");p.exports=class extends c{constructor(){super(),this.map={cfvo:this.cfvoXform=new a,color:this.colorXform=new i}}get tag(){return"dataBar"}render(r,t){r.openNode(this.tag),t.cfvo.forEach(n=>{this.cfvoXform.render(r,n)}),this.colorXform.render(r,t.color),r.closeNode()}createNewModel(){return{cfvo:[]}}onParserClose(r,t){switch(r){case"cfvo":this.model.cfvo.push(t.model);break;case"color":this.model.color=t.model}}}},{"../../composite-xform":48,"../../style/color-xform":128,"./cfvo-xform":84}],89:[function(e,p,b){"use strict";let c=e("../../base-xform"),i=e("../../composite-xform");class a extends c{get tag(){return"x14:id"}render(n,l){n.leafNode(this.tag,null,l)}parseOpen(){this.model=""}parseText(n){this.model+=n}parseClose(n){return n!==this.tag}}class r extends i{constructor(){super(),this.map={"x14:id":this.idXform=new a}}get tag(){return"ext"}render(n,l){n.openNode(this.tag,{uri:"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.idXform.render(n,l.x14Id),n.closeNode()}createNewModel(){return{}}onParserClose(n,l){this.model.x14Id=l.model}}p.exports=class extends i{constructor(){super(),this.map={ext:new r}}get tag(){return"extLst"}render(t,n){t.openNode(this.tag),this.map.ext.render(t,n),t.closeNode()}createNewModel(){return{}}onParserClose(t,n){Object.assign(this.model,n.model)}}},{"../../base-xform":32,"../../composite-xform":48}],90:[function(e,p,b){"use strict";let c=e("../../base-xform");p.exports=class extends c{get tag(){return"formula"}render(i,a){i.leafNode(this.tag,null,a)}parseOpen(){this.model=""}parseText(i){this.model+=i}parseClose(i){return i!==this.tag}}},{"../../base-xform":32}],91:[function(e,p,b){"use strict";let c=e("../../base-xform"),i=e("../../composite-xform"),a=e("./cfvo-xform");p.exports=class extends i{constructor(){super(),this.map={cfvo:this.cfvoXform=new a}}get tag(){return"iconSet"}render(r,t){r.openNode(this.tag,{iconSet:c.toStringAttribute(t.iconSet,"3TrafficLights"),reverse:c.toBoolAttribute(t.reverse,!1),showValue:c.toBoolAttribute(t.showValue,!0)}),t.cfvo.forEach(n=>{this.cfvoXform.render(r,n)}),r.closeNode()}createNewModel(r){let{attributes:t}=r;return{iconSet:c.toStringValue(t.iconSet,"3TrafficLights"),reverse:c.toBoolValue(t.reverse),showValue:c.toBoolValue(t.showValue),cfvo:[]}}onParserClose(r,t){this.model[r].push(t.model)}}},{"../../base-xform":32,"../../composite-xform":48,"./cfvo-xform":84}],92:[function(e,p,b){"use strict";let c=e("../../../utils/utils"),i=e("../base-xform");p.exports=class extends i{get tag(){return"col"}prepare(a,r){let t=r.styles.addStyleModel(a.style||{});t&&(a.styleId=t)}render(a,r){a.openNode("col"),a.addAttribute("min",r.min),a.addAttribute("max",r.max),r.width&&a.addAttribute("width",r.width),r.styleId&&a.addAttribute("style",r.styleId),r.hidden&&a.addAttribute("hidden","1"),r.bestFit&&a.addAttribute("bestFit","1"),r.outlineLevel&&a.addAttribute("outlineLevel",r.outlineLevel),r.collapsed&&a.addAttribute("collapsed","1"),a.addAttribute("customWidth","1"),a.closeNode()}parseOpen(a){if(a.name==="col"){let r=this.model={min:parseInt(a.attributes.min||"0",10),max:parseInt(a.attributes.max||"0",10),width:a.attributes.width===void 0?void 0:parseFloat(a.attributes.width||"0")};return a.attributes.style&&(r.styleId=parseInt(a.attributes.style,10)),c.parseBoolean(a.attributes.hidden)&&(r.hidden=!0),c.parseBoolean(a.attributes.bestFit)&&(r.bestFit=!0),a.attributes.outlineLevel&&(r.outlineLevel=parseInt(a.attributes.outlineLevel,10)),c.parseBoolean(a.attributes.collapsed)&&(r.collapsed=!0),!0}return!1}parseText(){}parseClose(){return!1}reconcile(a,r){a.styleId&&(a.style=r.styles.getStyleModel(a.styleId))}}},{"../../../utils/utils":27,"../base-xform":32}],93:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../../../utils/utils"),a=e("../../../utils/col-cache"),r=e("../base-xform"),t=e("../../../doc/range");function n(o,s,f,d){let u=s[f];u!==void 0?o[f]=u:d!==void 0&&(o[f]=d)}function l(o,s,f,d){let u=s[f];u!==void 0?o[f]=i.parseBoolean(u):d!==void 0&&(o[f]=d)}p.exports=class extends r{get tag(){return"dataValidations"}render(o,s){let f=(function(d){let u=c.map(d,(v,k)=>({address:k,dataValidation:v,marked:!1})).sort((v,k)=>c.strcmp(v.address,k.address)),g=c.keyBy(u,"address"),m=(v,k,B)=>{for(let O=0;O<k;O++){let L=a.encodeAddress(v.row+O,B);if(!d[L]||!c.isEqual(d[v.address],d[L]))return!1}return!0};return u.map(v=>{if(!v.marked){let k=a.decodeEx(v.address);if(k.dimensions)return g[k.dimensions].marked=!0,{...v.dataValidation,sqref:v.address};let B=1,O=a.encodeAddress(k.row+B,k.col);for(;d[O]&&c.isEqual(v.dataValidation,d[O]);)B++,O=a.encodeAddress(k.row+B,k.col);let L=1;for(;m(k,B,k.col+L);)L++;for(let R=0;R<B;R++)for(let P=0;P<L;P++)O=a.encodeAddress(k.row+R,k.col+P),g[O].marked=!0;if(B>1||L>1){let R=k.row+(B-1),P=k.col+(L-1);return{...v.dataValidation,sqref:`${v.address}:${a.encodeAddress(R,P)}`}}return{...v.dataValidation,sqref:v.address}}return null}).filter(Boolean)})(s);f.length&&(o.openNode("dataValidations",{count:f.length}),f.forEach(d=>{o.openNode("dataValidation"),d.type!=="any"&&(o.addAttribute("type",d.type),d.operator&&d.type!=="list"&&d.operator!=="between"&&o.addAttribute("operator",d.operator),d.allowBlank&&o.addAttribute("allowBlank","1")),d.showInputMessage&&o.addAttribute("showInputMessage","1"),d.promptTitle&&o.addAttribute("promptTitle",d.promptTitle),d.prompt&&o.addAttribute("prompt",d.prompt),d.showErrorMessage&&o.addAttribute("showErrorMessage","1"),d.errorStyle&&o.addAttribute("errorStyle",d.errorStyle),d.errorTitle&&o.addAttribute("errorTitle",d.errorTitle),d.error&&o.addAttribute("error",d.error),o.addAttribute("sqref",d.sqref),(d.formulae||[]).forEach((u,g)=>{o.openNode("formula"+(g+1)),d.type==="date"?o.writeText(i.dateToExcel(new Date(u))):o.writeText(u),o.closeNode()}),o.closeNode()}),o.closeNode())}parseOpen(o){switch(o.name){case"dataValidations":return this.model={},!0;case"dataValidation":{this._address=o.attributes.sqref;let s={type:o.attributes.type||"any",formulae:[]};switch(o.attributes.type&&l(s,o.attributes,"allowBlank"),l(s,o.attributes,"showInputMessage"),l(s,o.attributes,"showErrorMessage"),s.type){case"any":case"list":case"custom":break;default:n(s,o.attributes,"operator","between")}return n(s,o.attributes,"promptTitle"),n(s,o.attributes,"prompt"),n(s,o.attributes,"errorStyle"),n(s,o.attributes,"errorTitle"),n(s,o.attributes,"error"),this._dataValidation=s,!0}case"formula1":case"formula2":return this._formula=[],!0;default:return!1}}parseText(o){this._formula&&this._formula.push(o)}parseClose(o){switch(o){case"dataValidations":return!1;case"dataValidation":return this._dataValidation.formulae&&this._dataValidation.formulae.length||(delete this._dataValidation.formulae,delete this._dataValidation.operator),(this._address.split(/\s+/g)||[]).forEach(s=>{s.includes(":")?new t(s).forEachAddress(f=>{this.model[f]=this._dataValidation}):this.model[s]=this._dataValidation}),!0;case"formula1":case"formula2":{let s=this._formula.join("");switch(this._dataValidation.type){case"whole":case"textLength":s=parseInt(s,10);break;case"decimal":s=parseFloat(s);break;case"date":s=i.excelToDate(parseFloat(s))}return this._dataValidation.formulae.push(s),this._formula=void 0,!0}default:return!0}}}},{"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/utils":27,"../base-xform":32}],94:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"dimension"}render(i,a){a&&i.leafNode("dimension",{ref:a})}parseOpen(i){return i.name==="dimension"&&(this.model=i.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],95:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"drawing"}render(i,a){a&&i.leafNode(this.tag,{"r:id":a.rId})}parseOpen(i){return i.name===this.tag?(this.model={rId:i.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],96:[function(e,p,b){"use strict";let c=e("../composite-xform"),i=e("./cf-ext/conditional-formattings-ext-xform");class a extends c{constructor(){super(),this.map={"x14:conditionalFormattings":this.conditionalFormattings=new i}}get tag(){return"ext"}hasContent(t){return this.conditionalFormattings.hasContent(t.conditionalFormattings)}prepare(t,n){this.conditionalFormattings.prepare(t.conditionalFormattings,n)}render(t,n){t.openNode("ext",{uri:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"}),this.conditionalFormattings.render(t,n.conditionalFormattings),t.closeNode()}createNewModel(){return{}}onParserClose(t,n){this.model[t]=n.model}}p.exports=class extends c{constructor(){super(),this.map={ext:this.ext=new a}}get tag(){return"extLst"}prepare(r,t){this.ext.prepare(r,t)}hasContent(r){return this.ext.hasContent(r)}render(r,t){this.hasContent(t)&&(r.openNode("extLst"),this.ext.render(r,t),r.closeNode())}createNewModel(){return{}}onParserClose(r,t){Object.assign(this.model,t.model)}}},{"../composite-xform":48,"./cf-ext/conditional-formattings-ext-xform":78}],97:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"headerFooter"}render(i,a){if(a){i.addRollback();let r=!1;i.openNode("headerFooter"),a.differentFirst&&(i.addAttribute("differentFirst","1"),r=!0),a.differentOddEven&&(i.addAttribute("differentOddEven","1"),r=!0),a.oddHeader&&typeof a.oddHeader=="string"&&(i.leafNode("oddHeader",null,a.oddHeader),r=!0),a.oddFooter&&typeof a.oddFooter=="string"&&(i.leafNode("oddFooter",null,a.oddFooter),r=!0),a.evenHeader&&typeof a.evenHeader=="string"&&(i.leafNode("evenHeader",null,a.evenHeader),r=!0),a.evenFooter&&typeof a.evenFooter=="string"&&(i.leafNode("evenFooter",null,a.evenFooter),r=!0),a.firstHeader&&typeof a.firstHeader=="string"&&(i.leafNode("firstHeader",null,a.firstHeader),r=!0),a.firstFooter&&typeof a.firstFooter=="string"&&(i.leafNode("firstFooter",null,a.firstFooter),r=!0),r?(i.closeNode(),i.commit()):i.rollback()}}parseOpen(i){switch(i.name){case"headerFooter":return this.model={},i.attributes.differentFirst&&(this.model.differentFirst=parseInt(i.attributes.differentFirst,0)===1),i.attributes.differentOddEven&&(this.model.differentOddEven=parseInt(i.attributes.differentOddEven,0)===1),!0;case"oddHeader":return this.currentNode="oddHeader",!0;case"oddFooter":return this.currentNode="oddFooter",!0;case"evenHeader":return this.currentNode="evenHeader",!0;case"evenFooter":return this.currentNode="evenFooter",!0;case"firstHeader":return this.currentNode="firstHeader",!0;case"firstFooter":return this.currentNode="firstFooter",!0;default:return!1}}parseText(i){switch(this.currentNode){case"oddHeader":this.model.oddHeader=i;break;case"oddFooter":this.model.oddFooter=i;break;case"evenHeader":this.model.evenHeader=i;break;case"evenFooter":this.model.evenFooter=i;break;case"firstHeader":this.model.firstHeader=i;break;case"firstFooter":this.model.firstFooter=i}}parseClose(){switch(this.currentNode){case"oddHeader":case"oddFooter":case"evenHeader":case"evenFooter":case"firstHeader":case"firstFooter":return this.currentNode=void 0,!0;default:return!1}}}},{"../base-xform":32}],98:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"hyperlink"}render(i,a){this.isInternalLink(a)?i.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip,location:a.target}):i.leafNode("hyperlink",{ref:a.address,"r:id":a.rId,tooltip:a.tooltip})}parseOpen(i){return i.name==="hyperlink"&&(this.model={address:i.attributes.ref,rId:i.attributes["r:id"],tooltip:i.attributes.tooltip},i.attributes.location&&(this.model.target=i.attributes.location),!0)}parseText(){}parseClose(){return!1}isInternalLink(i){return i.target&&/^[^!]+![a-zA-Z]+[\d]+$/.test(i.target)}}},{"../base-xform":32}],99:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"mergeCell"}render(i,a){i.leafNode("mergeCell",{ref:a})}parseOpen(i){return i.name==="mergeCell"&&(this.model=i.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],100:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../../../doc/range"),a=e("../../../utils/col-cache"),r=e("../../../doc/enums");p.exports=class{constructor(){this.merges={}}add(t){if(this.merges[t.master])this.merges[t.master].expandToAddress(t.address);else{let n=`${t.master}:${t.address}`;this.merges[t.master]=new i(n)}}get mergeCells(){return c.map(this.merges,t=>t.range)}reconcile(t,n){c.each(t,l=>{let o=a.decode(l);for(let s=o.top;s<=o.bottom;s++){let f=n[s-1];for(let d=o.left;d<=o.right;d++){let u=f.cells[d-1];u?u.type===r.ValueType.Merge&&(u.master=o.tl):f.cells[d]={type:r.ValueType.Null,address:a.encodeAddress(s,d)}}}})}getMasterAddress(t){let n=this.hash[t];return n&&n.tl}}},{"../../../doc/enums":7,"../../../doc/range":10,"../../../utils/col-cache":19,"../../../utils/under-dash":26}],101:[function(e,p,b){"use strict";let c=e("../base-xform"),i=a=>a!==void 0;p.exports=class extends c{get tag(){return"outlinePr"}render(a,r){return!(!r||!i(r.summaryBelow)&&!i(r.summaryRight))&&(a.leafNode(this.tag,{summaryBelow:i(r.summaryBelow)?Number(r.summaryBelow):void 0,summaryRight:i(r.summaryRight)?Number(r.summaryRight):void 0}),!0)}parseOpen(a){return a.name===this.tag&&(this.model={summaryBelow:i(a.attributes.summaryBelow)?!!Number(a.attributes.summaryBelow):void 0,summaryRight:i(a.attributes.summaryRight)?!!Number(a.attributes.summaryRight):void 0},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],102:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"brk"}render(i,a){i.leafNode("brk",a)}parseOpen(i){return i.name==="brk"&&(this.model=i.attributes.ref,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],103:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../base-xform");p.exports=class extends i{get tag(){return"pageMargins"}render(a,r){if(r){let t={left:r.left,right:r.right,top:r.top,bottom:r.bottom,header:r.header,footer:r.footer};c.some(t,n=>n!==void 0)&&a.leafNode(this.tag,t)}}parseOpen(a){return a.name===this.tag?(this.model={left:parseFloat(a.attributes.left||.7),right:parseFloat(a.attributes.right||.7),top:parseFloat(a.attributes.top||.75),bottom:parseFloat(a.attributes.bottom||.75),header:parseFloat(a.attributes.header||.3),footer:parseFloat(a.attributes.footer||.3)},!0):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],104:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"pageSetUpPr"}render(i,a){return!(!a||!a.fitToPage)&&(i.leafNode(this.tag,{fitToPage:a.fitToPage?"1":void 0}),!0)}parseOpen(i){return i.name===this.tag&&(this.model={fitToPage:i.attributes.fitToPage==="1"},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],105:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../base-xform");function a(l){return l?"1":void 0}function r(l){if(l==="overThenDown")return l}function t(l){switch(l){case"atEnd":case"asDisplyed":return l;default:return}}function n(l){switch(l){case"dash":case"blank":case"NA":return l;default:return}}p.exports=class extends i{get tag(){return"pageSetup"}render(l,o){if(o){let s={paperSize:o.paperSize,orientation:o.orientation,horizontalDpi:o.horizontalDpi,verticalDpi:o.verticalDpi,pageOrder:r(o.pageOrder),blackAndWhite:a(o.blackAndWhite),draft:a(o.draft),cellComments:t(o.cellComments),errors:n(o.errors),scale:o.scale,fitToWidth:o.fitToWidth,fitToHeight:o.fitToHeight,firstPageNumber:o.firstPageNumber,useFirstPageNumber:a(o.firstPageNumber),usePrinterDefaults:a(o.usePrinterDefaults),copies:o.copies};c.some(s,f=>f!==void 0)&&l.leafNode(this.tag,s)}}parseOpen(l){if(l.name===this.tag)return this.model={paperSize:(o=l.attributes.paperSize,o!==void 0?parseInt(o,10):void 0),orientation:l.attributes.orientation||"portrait",horizontalDpi:parseInt(l.attributes.horizontalDpi||"4294967295",10),verticalDpi:parseInt(l.attributes.verticalDpi||"4294967295",10),pageOrder:l.attributes.pageOrder||"downThenOver",blackAndWhite:l.attributes.blackAndWhite==="1",draft:l.attributes.draft==="1",cellComments:l.attributes.cellComments||"None",errors:l.attributes.errors||"displayed",scale:parseInt(l.attributes.scale||"100",10),fitToWidth:parseInt(l.attributes.fitToWidth||"1",10),fitToHeight:parseInt(l.attributes.fitToHeight||"1",10),firstPageNumber:parseInt(l.attributes.firstPageNumber||"1",10),useFirstPageNumber:l.attributes.useFirstPageNumber==="1",usePrinterDefaults:l.attributes.usePrinterDefaults==="1",copies:parseInt(l.attributes.copies||"1",10)},!0;return!1;var o}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],106:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"picture"}render(i,a){a&&i.leafNode(this.tag,{"r:id":a.rId})}parseOpen(i){return i.name===this.tag?(this.model={rId:i.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],107:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../base-xform");function a(r){return r?"1":void 0}p.exports=class extends i{get tag(){return"printOptions"}render(r,t){if(t){let n={headings:a(t.showRowColHeaders),gridLines:a(t.showGridLines),horizontalCentered:a(t.horizontalCentered),verticalCentered:a(t.verticalCentered)};c.some(n,l=>l!==void 0)&&r.leafNode(this.tag,n)}}parseOpen(r){return r.name===this.tag?(this.model={showRowColHeaders:r.attributes.headings==="1",showGridLines:r.attributes.gridLines==="1",horizontalCentered:r.attributes.horizontalCentered==="1",verticalCentered:r.attributes.verticalCentered==="1"},!0):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],108:[function(e,p,b){"use strict";let c=e("./page-breaks-xform"),i=e("../list-xform");p.exports=class extends i{constructor(){super({tag:"rowBreaks",count:!0,childXform:new c})}render(a,r){if(r&&r.length){a.openNode(this.tag,this.$),this.count&&(a.addAttribute(this.$count,r.length),a.addAttribute("manualBreakCount",r.length));let{childXform:t}=this;r.forEach(n=>{t.render(a,n)}),a.closeNode()}else this.empty&&a.leafNode(this.tag)}}},{"../list-xform":71,"./page-breaks-xform":102}],109:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("../../../utils/utils"),a=e("./cell-xform");p.exports=class extends c{constructor(r){super(),this.maxItems=r&&r.maxItems,this.map={c:new a}}get tag(){return"row"}prepare(r,t){let n=t.styles.addStyleModel(r.style);n&&(r.styleId=n);let l=this.map.c;r.cells.forEach(o=>{l.prepare(o,t)})}render(r,t,n){r.openNode("row"),r.addAttribute("r",t.number),t.height&&(r.addAttribute("ht",t.height),r.addAttribute("customHeight","1")),t.hidden&&r.addAttribute("hidden","1"),t.min>0&&t.max>0&&t.min<=t.max&&r.addAttribute("spans",`${t.min}:${t.max}`),t.styleId&&(r.addAttribute("s",t.styleId),r.addAttribute("customFormat","1")),r.addAttribute("x14ac:dyDescent","0.25"),t.outlineLevel&&r.addAttribute("outlineLevel",t.outlineLevel),t.collapsed&&r.addAttribute("collapsed","1");let l=this.map.c;t.cells.forEach(o=>{l.render(r,o,n)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;if(r.name==="row"){this.numRowsSeen+=1;let t=r.attributes.spans?r.attributes.spans.split(":").map(l=>parseInt(l,10)):[void 0,void 0],n=this.model={number:parseInt(r.attributes.r,10),min:t[0],max:t[1],cells:[]};return r.attributes.s&&(n.styleId=parseInt(r.attributes.s,10)),i.parseBoolean(r.attributes.hidden)&&(n.hidden=!0),i.parseBoolean(r.attributes.bestFit)&&(n.bestFit=!0),r.attributes.ht&&(n.height=parseFloat(r.attributes.ht)),r.attributes.outlineLevel&&(n.outlineLevel=parseInt(r.attributes.outlineLevel,10)),i.parseBoolean(r.attributes.collapsed)&&(n.collapsed=!0),!0}return this.parser=this.map[r.name],!!this.parser&&(this.parser.parseOpen(r),!0)}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){if(this.model.cells.push(this.parser.model),this.maxItems&&this.model.cells.length>this.maxItems)throw new Error(`Max column count (${this.maxItems}) exceeded`);this.parser=void 0}return!0}return!1}reconcile(r,t){r.style=r.styleId?t.styles.getStyleModel(r.styleId):{},r.styleId!==void 0&&(r.styleId=void 0);let n=this.map.c;r.cells.forEach(l=>{n.reconcile(l,t)})}}},{"../../../utils/utils":27,"../base-xform":32,"./cell-xform":73}],110:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../base-xform");p.exports=class extends i{get tag(){return"sheetFormatPr"}render(a,r){if(r){let t={defaultRowHeight:r.defaultRowHeight,outlineLevelRow:r.outlineLevelRow,outlineLevelCol:r.outlineLevelCol,"x14ac:dyDescent":r.dyDescent};r.defaultColWidth&&(t.defaultColWidth=r.defaultColWidth),r.defaultRowHeight&&r.defaultRowHeight===15||(t.customHeight="1"),c.some(t,n=>n!==void 0)&&a.leafNode("sheetFormatPr",t)}}parseOpen(a){return a.name==="sheetFormatPr"&&(this.model={defaultRowHeight:parseFloat(a.attributes.defaultRowHeight||"0"),dyDescent:parseFloat(a.attributes["x14ac:dyDescent"]||"0"),outlineLevelRow:parseInt(a.attributes.outlineLevelRow||"0",10),outlineLevelCol:parseInt(a.attributes.outlineLevelCol||"0",10)},a.attributes.defaultColWidth&&(this.model.defaultColWidth=parseFloat(a.attributes.defaultColWidth)),!0)}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],111:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("../style/color-xform"),a=e("./page-setup-properties-xform"),r=e("./outline-properties-xform");p.exports=class extends c{constructor(){super(),this.map={tabColor:new i("tabColor"),pageSetUpPr:new a,outlinePr:new r}}get tag(){return"sheetPr"}render(t,n){if(n){t.addRollback(),t.openNode("sheetPr");let l=!1;l=this.map.tabColor.render(t,n.tabColor)||l,l=this.map.pageSetUpPr.render(t,n.pageSetup)||l,l=this.map.outlinePr.render(t,n.outlineProperties)||l,l?(t.closeNode(),t.commit()):t.rollback()}}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name===this.tag?(this.reset(),!0):!!this.map[t.name]&&(this.parser=this.map[t.name],this.parser.parseOpen(t),!0)}parseText(t){return!!this.parser&&(this.parser.parseText(t),!0)}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):(this.map.tabColor.model||this.map.pageSetUpPr.model||this.map.outlinePr.model?(this.model={},this.map.tabColor.model&&(this.model.tabColor=this.map.tabColor.model),this.map.pageSetUpPr.model&&(this.model.pageSetup=this.map.pageSetUpPr.model),this.map.outlinePr.model&&(this.model.outlineProperties=this.map.outlinePr.model)):this.model=null,!1)}}},{"../base-xform":32,"../style/color-xform":128,"./outline-properties-xform":101,"./page-setup-properties-xform":104}],112:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../base-xform");function a(t,n){return t?n:void 0}function r(t,n){return t===n||void 0}p.exports=class extends i{get tag(){return"sheetProtection"}render(t,n){if(n){let l={sheet:a(n.sheet,"1"),selectLockedCells:n.selectLockedCells===!1?"1":void 0,selectUnlockedCells:n.selectUnlockedCells===!1?"1":void 0,formatCells:a(n.formatCells,"0"),formatColumns:a(n.formatColumns,"0"),formatRows:a(n.formatRows,"0"),insertColumns:a(n.insertColumns,"0"),insertRows:a(n.insertRows,"0"),insertHyperlinks:a(n.insertHyperlinks,"0"),deleteColumns:a(n.deleteColumns,"0"),deleteRows:a(n.deleteRows,"0"),sort:a(n.sort,"0"),autoFilter:a(n.autoFilter,"0"),pivotTables:a(n.pivotTables,"0")};n.sheet&&(l.algorithmName=n.algorithmName,l.hashValue=n.hashValue,l.saltValue=n.saltValue,l.spinCount=n.spinCount,l.objects=a(n.objects===!1,"1"),l.scenarios=a(n.scenarios===!1,"1")),c.some(l,o=>o!==void 0)&&t.leafNode(this.tag,l)}}parseOpen(t){return t.name===this.tag?(this.model={sheet:r(t.attributes.sheet,"1"),objects:t.attributes.objects!=="1"&&void 0,scenarios:t.attributes.scenarios!=="1"&&void 0,selectLockedCells:t.attributes.selectLockedCells!=="1"&&void 0,selectUnlockedCells:t.attributes.selectUnlockedCells!=="1"&&void 0,formatCells:r(t.attributes.formatCells,"0"),formatColumns:r(t.attributes.formatColumns,"0"),formatRows:r(t.attributes.formatRows,"0"),insertColumns:r(t.attributes.insertColumns,"0"),insertRows:r(t.attributes.insertRows,"0"),insertHyperlinks:r(t.attributes.insertHyperlinks,"0"),deleteColumns:r(t.attributes.deleteColumns,"0"),deleteRows:r(t.attributes.deleteRows,"0"),sort:r(t.attributes.sort,"0"),autoFilter:r(t.attributes.autoFilter,"0"),pivotTables:r(t.attributes.pivotTables,"0")},t.attributes.algorithmName&&(this.model.algorithmName=t.attributes.algorithmName,this.model.hashValue=t.attributes.hashValue,this.model.saltValue=t.attributes.saltValue,this.model.spinCount=parseInt(t.attributes.spinCount,10)),!0):!1}parseText(){}parseClose(){return!1}}},{"../../../utils/under-dash":26,"../base-xform":32}],113:[function(e,p,b){"use strict";let c=e("../../../utils/col-cache"),i=e("../base-xform"),a={frozen:"frozen",frozenSplit:"frozen",split:"split"};p.exports=class extends i{get tag(){return"sheetView"}prepare(r){switch(r.state){case"frozen":case"split":break;default:r.state="normal"}}render(r,t){r.openNode("sheetView",{workbookViewId:t.workbookViewId||0});let n=function(d,u,g){g&&r.addAttribute(d,u)},l,o,s,f;switch(n("rightToLeft","1",t.rightToLeft===!0),n("tabSelected","1",t.tabSelected),n("showRuler","0",t.showRuler===!1),n("showRowColHeaders","0",t.showRowColHeaders===!1),n("showGridLines","0",t.showGridLines===!1),n("zoomScale",t.zoomScale,t.zoomScale),n("zoomScaleNormal",t.zoomScaleNormal,t.zoomScaleNormal),n("view",t.style,t.style),t.state){case"frozen":o=t.xSplit||0,s=t.ySplit||0,l=t.topLeftCell||c.getAddress(s+1,o+1).address,f=(t.xSplit&&t.ySplit?"bottomRight":t.xSplit&&"topRight")||"bottomLeft",r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:l,activePane:f,state:"frozen"}),r.leafNode("selection",{pane:f,activeCell:t.activeCell,sqref:t.activeCell});break;case"split":t.activePane==="topLeft"&&(t.activePane=void 0),r.leafNode("pane",{xSplit:t.xSplit||void 0,ySplit:t.ySplit||void 0,topLeftCell:t.topLeftCell,activePane:t.activePane}),r.leafNode("selection",{pane:t.activePane,activeCell:t.activeCell,sqref:t.activeCell});break;case"normal":t.activeCell&&r.leafNode("selection",{activeCell:t.activeCell,sqref:t.activeCell})}r.closeNode()}parseOpen(r){switch(r.name){case"sheetView":return this.sheetView={workbookViewId:parseInt(r.attributes.workbookViewId,10),rightToLeft:r.attributes.rightToLeft==="1",tabSelected:r.attributes.tabSelected==="1",showRuler:r.attributes.showRuler!=="0",showRowColHeaders:r.attributes.showRowColHeaders!=="0",showGridLines:r.attributes.showGridLines!=="0",zoomScale:parseInt(r.attributes.zoomScale||"100",10),zoomScaleNormal:parseInt(r.attributes.zoomScaleNormal||"100",10),style:r.attributes.view},this.pane=void 0,this.selections={},!0;case"pane":return this.pane={xSplit:parseInt(r.attributes.xSplit||"0",10),ySplit:parseInt(r.attributes.ySplit||"0",10),topLeftCell:r.attributes.topLeftCell,activePane:r.attributes.activePane||"topLeft",state:r.attributes.state},!0;case"selection":{let t=r.attributes.pane||"topLeft";return this.selections[t]={pane:t,activeCell:r.attributes.activeCell},!0}default:return!1}}parseText(){}parseClose(r){let t,n;return r==="sheetView"?(this.sheetView&&this.pane?(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:a[this.pane.state]||"split",xSplit:this.pane.xSplit,ySplit:this.pane.ySplit,topLeftCell:this.pane.topLeftCell,showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},this.model.state==="split"&&(t.activePane=this.pane.activePane),n=this.selections[this.pane.activePane],n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)):(t=this.model={workbookViewId:this.sheetView.workbookViewId,rightToLeft:this.sheetView.rightToLeft,state:"normal",showRuler:this.sheetView.showRuler,showRowColHeaders:this.sheetView.showRowColHeaders,showGridLines:this.sheetView.showGridLines,zoomScale:this.sheetView.zoomScale,zoomScaleNormal:this.sheetView.zoomScaleNormal},n=this.selections.topLeft,n&&n.activeCell&&(t.activeCell=n.activeCell),this.sheetView.style&&(t.style=this.sheetView.style)),!1):!0}reconcile(){}}},{"../../../utils/col-cache":19,"../base-xform":32}],114:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"tablePart"}render(i,a){a&&i.leafNode(this.tag,{"r:id":a.rId})}parseOpen(i){return i.name===this.tag?(this.model={rId:i.attributes["r:id"]},!0):!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],115:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../../../utils/col-cache"),a=e("../../../utils/xml-stream"),r=e("../../rel-type"),t=e("./merges"),n=e("../base-xform"),l=e("../list-xform"),o=e("./row-xform"),s=e("./col-xform"),f=e("./dimension-xform"),d=e("./hyperlink-xform"),u=e("./merge-cell-xform"),g=e("./data-validations-xform"),m=e("./sheet-properties-xform"),v=e("./sheet-format-properties-xform"),k=e("./sheet-view-xform"),B=e("./sheet-protection-xform"),O=e("./page-margins-xform"),L=e("./page-setup-xform"),R=e("./print-options-xform"),P=e("./auto-filter-xform"),j=e("./picture-xform"),z=e("./drawing-xform"),N=e("./table-part-xform"),S=e("./row-breaks-xform"),C=e("./header-footer-xform"),E=e("./cf/conditional-formattings-xform"),h=e("./ext-lst-xform"),y=(x,_)=>{if(!_||!_.length)return x;if(!x||!x.length)return _;let T={},D={};return x.forEach(q=>{T[q.ref]=q,q.rules.forEach($=>{let{x14Id:W}=$;W&&(D[W]=$)})}),_.forEach(q=>{q.rules.forEach($=>{let W=D[$.x14Id];W?((A,H)=>{Object.keys(H).forEach(M=>{let I=A[M],F=H[M];I===void 0&&F!==void 0&&(A[M]=F)})})(W,$):T[q.ref]?T[q.ref].rules.push($):x.push({ref:q.ref,rules:[$]})})}),x};class w extends n{constructor(_){super();let{maxRows:T,maxCols:D,ignoreNodes:q}=_||{};this.ignoreNodes=q||[],this.map={sheetPr:new m,dimension:new f,sheetViews:new l({tag:"sheetViews",count:!1,childXform:new k}),sheetFormatPr:new v,cols:new l({tag:"cols",count:!1,childXform:new s}),sheetData:new l({tag:"sheetData",count:!1,empty:!0,childXform:new o({maxItems:D}),maxItems:T}),autoFilter:new P,mergeCells:new l({tag:"mergeCells",count:!0,childXform:new u}),rowBreaks:new S,hyperlinks:new l({tag:"hyperlinks",count:!1,childXform:new d}),pageMargins:new O,dataValidations:new g,pageSetup:new L,headerFooter:new C,printOptions:new R,picture:new j,drawing:new z,sheetProtection:new B,tableParts:new l({tag:"tableParts",count:!0,childXform:new N}),conditionalFormatting:new E,extLst:new h}}prepare(_,T){T.merges=new t,_.hyperlinks=T.hyperlinks=[],_.comments=T.comments=[],T.formulae={},T.siFormulae=0,this.map.cols.prepare(_.cols,T),this.map.sheetData.prepare(_.rows,T),this.map.conditionalFormatting.prepare(_.conditionalFormattings,T),_.mergeCells=T.merges.mergeCells;let D=_.rels=[];function q(A){return"rId"+(A.length+1)}if(_.hyperlinks.forEach(A=>{let H=q(D);A.rId=H,D.push({Id:H,Type:r.Hyperlink,Target:A.target,TargetMode:"External"})}),_.comments.length>0){let A={Id:q(D),Type:r.Comments,Target:`../comments${_.id}.xml`};D.push(A);let H={Id:q(D),Type:r.VmlDrawing,Target:`../drawings/vmlDrawing${_.id}.vml`};D.push(H),_.comments.forEach(M=>{M.refAddress=i.decodeAddress(M.ref)}),T.commentRefs.push({commentName:"comments"+_.id,vmlDrawing:"vmlDrawing"+_.id})}let $=[],W;_.media.forEach(A=>{if(A.type==="background"){let H=q(D);W=T.media[A.imageId],D.push({Id:H,Type:r.Image,Target:`../media/${W.name}.${W.extension}`}),_.background={rId:H},_.image=T.media[A.imageId]}else if(A.type==="image"){let{drawing:H}=_;W=T.media[A.imageId],H||(H=_.drawing={rId:q(D),name:"drawing"+ ++T.drawingsCount,anchors:[],rels:[]},T.drawings.push(H),D.push({Id:H.rId,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/${H.name}.xml`}));let M=this.preImageId===A.imageId?$[A.imageId]:$[H.rels.length];M||(M=q(H.rels),$[H.rels.length]=M,H.rels.push({Id:M,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/${W.name}.${W.extension}`}));let I={picture:{rId:M},range:A.range};if(A.hyperlinks&&A.hyperlinks.hyperlink){let F=q(H.rels);$[H.rels.length]=F,I.picture.hyperlinks={tooltip:A.hyperlinks.tooltip,rId:F},H.rels.push({Id:F,Type:r.Hyperlink,Target:A.hyperlinks.hyperlink,TargetMode:"External"})}this.preImageId=A.imageId,H.anchors.push(I)}}),_.tables.forEach(A=>{let H=q(D);A.rId=H,D.push({Id:H,Type:r.Table,Target:"../tables/"+A.target}),A.columns.forEach(M=>{let{style:I}=M;I&&(M.dxfId=T.styles.addDxfStyle(I))})}),this.map.extLst.prepare(_,T)}render(_,T){_.openXml(a.StdDocAttributes),_.openNode("worksheet",w.WORKSHEET_ATTRIBUTES);let D=T.properties?{defaultRowHeight:T.properties.defaultRowHeight,dyDescent:T.properties.dyDescent,outlineLevelCol:T.properties.outlineLevelCol,outlineLevelRow:T.properties.outlineLevelRow}:void 0;T.properties&&T.properties.defaultColWidth&&(D.defaultColWidth=T.properties.defaultColWidth);let q={outlineProperties:T.properties&&T.properties.outlineProperties,tabColor:T.properties&&T.properties.tabColor,pageSetup:T.pageSetup&&T.pageSetup.fitToPage?{fitToPage:T.pageSetup.fitToPage}:void 0},$=T.pageSetup&&T.pageSetup.margins,W={showRowColHeaders:T.pageSetup&&T.pageSetup.showRowColHeaders,showGridLines:T.pageSetup&&T.pageSetup.showGridLines,horizontalCentered:T.pageSetup&&T.pageSetup.horizontalCentered,verticalCentered:T.pageSetup&&T.pageSetup.verticalCentered},A=T.sheetProtection;this.map.sheetPr.render(_,q),this.map.dimension.render(_,T.dimensions),this.map.sheetViews.render(_,T.views),this.map.sheetFormatPr.render(_,D),this.map.cols.render(_,T.cols),this.map.sheetData.render(_,T.rows),this.map.sheetProtection.render(_,A),this.map.autoFilter.render(_,T.autoFilter),this.map.mergeCells.render(_,T.mergeCells),this.map.conditionalFormatting.render(_,T.conditionalFormattings),this.map.dataValidations.render(_,T.dataValidations),this.map.hyperlinks.render(_,T.hyperlinks),this.map.printOptions.render(_,W),this.map.pageMargins.render(_,$),this.map.pageSetup.render(_,T.pageSetup),this.map.headerFooter.render(_,T.headerFooter),this.map.rowBreaks.render(_,T.rowBreaks),this.map.drawing.render(_,T.drawing),this.map.picture.render(_,T.background),this.map.tableParts.render(_,T.tables),this.map.extLst.render(_,T),T.rels&&T.rels.forEach(H=>{H.Type===r.VmlDrawing&&_.leafNode("legacyDrawing",{"r:id":H.Id})}),_.closeNode()}parseOpen(_){return this.parser?(this.parser.parseOpen(_),!0):_.name==="worksheet"?(c.each(this.map,T=>{T.reset()}),!0):(this.map[_.name]&&!this.ignoreNodes.includes(_.name)&&(this.parser=this.map[_.name],this.parser.parseOpen(_)),!0)}parseText(_){this.parser&&this.parser.parseText(_)}parseClose(_){if(this.parser)return this.parser.parseClose(_)||(this.parser=void 0),!0;if(_==="worksheet"){let T=this.map.sheetFormatPr.model||{};this.map.sheetPr.model&&this.map.sheetPr.model.tabColor&&(T.tabColor=this.map.sheetPr.model.tabColor),this.map.sheetPr.model&&this.map.sheetPr.model.outlineProperties&&(T.outlineProperties=this.map.sheetPr.model.outlineProperties);let D={fitToPage:this.map.sheetPr.model&&this.map.sheetPr.model.pageSetup&&this.map.sheetPr.model.pageSetup.fitToPage||!1,margins:this.map.pageMargins.model},q=Object.assign(D,this.map.pageSetup.model,this.map.printOptions.model),$=y(this.map.conditionalFormatting.model,this.map.extLst.model&&this.map.extLst.model["x14:conditionalFormattings"]);return this.model={dimensions:this.map.dimension.model,cols:this.map.cols.model,rows:this.map.sheetData.model,mergeCells:this.map.mergeCells.model,hyperlinks:this.map.hyperlinks.model,dataValidations:this.map.dataValidations.model,properties:T,views:this.map.sheetViews.model,pageSetup:q,headerFooter:this.map.headerFooter.model,background:this.map.picture.model,drawing:this.map.drawing.model,tables:this.map.tableParts.model,conditionalFormattings:$},this.map.autoFilter.model&&(this.model.autoFilter=this.map.autoFilter.model),this.map.sheetProtection.model&&(this.model.sheetProtection=this.map.sheetProtection.model),!1}else return!0}reconcile(_,T){let D=(_.relationships||[]).reduce(($,W)=>{if($[W.Id]=W,W.Type===r.Comments&&(_.comments=T.comments[W.Target].comments),W.Type===r.VmlDrawing&&_.comments&&_.comments.length){let A=T.vmlDrawings[W.Target].comments;_.comments.forEach((H,M)=>{H.note=Object.assign({},H.note,A[M])})}return $},{});if(T.commentsMap=(_.comments||[]).reduce(($,W)=>(W.ref&&($[W.ref]=W),$),{}),T.hyperlinkMap=(_.hyperlinks||[]).reduce(($,W)=>(W.rId&&($[W.address]=D[W.rId].Target),$),{}),T.formulae={},_.rows=_.rows&&_.rows.filter(Boolean)||[],_.rows.forEach($=>{$.cells=$.cells&&$.cells.filter(Boolean)||[]}),this.map.cols.reconcile(_.cols,T),this.map.sheetData.reconcile(_.rows,T),this.map.conditionalFormatting.reconcile(_.conditionalFormattings,T),_.media=[],_.drawing){let $=D[_.drawing.rId].Target.match(/\/drawings\/([a-zA-Z0-9]+)[.][a-zA-Z]{3,4}$/);if($){let W=$[1];T.drawings[W].anchors.forEach(A=>{if(A.medium){let H={type:"image",imageId:A.medium.index,range:A.range,hyperlinks:A.picture.hyperlinks};_.media.push(H)}})}}let q=_.background&&D[_.background.rId];if(q){let $=q.Target.split("/media/")[1],W=T.mediaIndex&&T.mediaIndex[$];W!==void 0&&_.media.push({type:"background",imageId:W})}_.tables=(_.tables||[]).map($=>{let W=D[$.rId];return T.tables[W.Target]}),delete _.relationships,delete _.hyperlinks,delete _.comments}}w.WORKSHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"},p.exports=w},{"../../../utils/col-cache":19,"../../../utils/under-dash":26,"../../../utils/xml-stream":28,"../../rel-type":31,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":72,"./cf/conditional-formattings-xform":87,"./col-xform":92,"./data-validations-xform":93,"./dimension-xform":94,"./drawing-xform":95,"./ext-lst-xform":96,"./header-footer-xform":97,"./hyperlink-xform":98,"./merge-cell-xform":99,"./merges":100,"./page-margins-xform":103,"./page-setup-xform":105,"./picture-xform":106,"./print-options-xform":107,"./row-breaks-xform":108,"./row-xform":109,"./sheet-format-properties-xform":110,"./sheet-properties-xform":111,"./sheet-protection-xform":112,"./sheet-view-xform":113,"./table-part-xform":114}],116:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{constructor(i){super(),this.tag=i.tag,this.attr=i.attr}render(i,a){a&&(i.openNode(this.tag),i.closeNode())}parseOpen(i){i.name===this.tag&&(this.model=!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],117:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{constructor(i){super(),this.tag=i.tag,this.attr=i.attr,this.attrs=i.attrs,this._format=i.format||function(a){try{return Number.isNaN(a.getTime())?"":a.toISOString()}catch{return""}},this._parse=i.parse||function(a){return new Date(a)}}render(i,a){a&&(i.openNode(this.tag),this.attrs&&i.addAttributes(this.attrs),this.attr?i.addAttribute(this.attr,this._format(a)):i.writeText(this._format(a)),i.closeNode())}parseOpen(i){i.name===this.tag&&(this.attr?this.model=this._parse(i.attributes[this.attr]):this.text=[])}parseText(i){this.attr||this.text.push(i)}parseClose(){return this.attr||(this.model=this._parse(this.text.join(""))),!1}}},{"../base-xform":32}],118:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{constructor(i){super(),this.tag=i.tag,this.attr=i.attr,this.attrs=i.attrs,this.zero=i.zero}render(i,a){(a||this.zero)&&(i.openNode(this.tag),this.attrs&&i.addAttributes(this.attrs),this.attr?i.addAttribute(this.attr,a):i.writeText(a),i.closeNode())}parseOpen(i){return i.name===this.tag&&(this.attr?this.model=parseInt(i.attributes[this.attr],10):this.text=[],!0)}parseText(i){this.attr||this.text.push(i)}parseClose(){return this.attr||(this.model=parseInt(this.text.join("")||0,10)),!1}}},{"../base-xform":32}],119:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{constructor(i){super(),this.tag=i.tag,this.attr=i.attr,this.attrs=i.attrs}render(i,a){a!==void 0&&(i.openNode(this.tag),this.attrs&&i.addAttributes(this.attrs),this.attr?i.addAttribute(this.attr,a):i.writeText(a),i.closeNode())}parseOpen(i){i.name===this.tag&&(this.attr?this.model=i.attributes[this.attr]:this.text=[])}parseText(i){this.attr||this.text.push(i)}parseClose(){return this.attr||(this.model=this.text.join("")),!1}}},{"../base-xform":32}],120:[function(e,p,b){"use strict";let c=e("./base-xform"),i=e("../../utils/xml-stream");p.exports=class extends c{constructor(a){super(),this._model=a}render(a){if(!this._xml){let r=new i;(function t(n,l){n.openNode(l.tag,l.$),l.c&&l.c.forEach(o=>{t(n,o)}),l.t&&n.writeText(l.t),n.closeNode()})(r,this._model),this._xml=r.xml}a.writeXml(this._xml)}parseOpen(){return!0}parseText(){}parseClose(a){return a!==this._model.tag}}},{"../../utils/xml-stream":28,"./base-xform":32}],121:[function(e,p,b){"use strict";let c=e("./text-xform"),i=e("./rich-text-xform"),a=e("../base-xform");p.exports=class extends a{constructor(){super(),this.map={r:new i,t:new c}}get tag(){return"rPh"}render(r,t){if(r.openNode(this.tag,{sb:t.sb||0,eb:t.eb||0}),t&&t.hasOwnProperty("richText")&&t.richText){let{r:n}=this.map;t.richText.forEach(l=>{n.render(r,l)})}else t&&this.map.t.render(r,t.text);r.closeNode()}parseOpen(r){let{name:t}=r;return this.parser?(this.parser.parseOpen(r),!0):t===this.tag?(this.model={sb:parseInt(r.attributes.sb,10),eb:parseInt(r.attributes.eb,10)},!0):(this.parser=this.map[t],!!this.parser&&(this.parser.parseOpen(r),!0))}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser){if(!this.parser.parseClose(r)){switch(r){case"r":{let t=this.model.richText;t||(t=this.model.richText=[]),t.push(this.parser.model);break}case"t":this.model.text=this.parser.model}this.parser=void 0}return!0}return r!==this.tag}}},{"../base-xform":32,"./rich-text-xform":122,"./text-xform":125}],122:[function(e,p,b){"use strict";let c=e("./text-xform"),i=e("../style/font-xform"),a=e("../base-xform");class r extends a{constructor(n){super(),this.model=n}get tag(){return"r"}get textXform(){return this._textXform||(this._textXform=new c)}get fontXform(){return this._fontXform||(this._fontXform=new i(r.FONT_OPTIONS))}render(n,l){l=l||this.model,n.openNode("r"),l.font&&this.fontXform.render(n,l.font),this.textXform.render(n,l.text),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case"r":return this.model={},!0;case"t":return this.parser=this.textXform,this.parser.parseOpen(n),!0;case"rPr":return this.parser=this.fontXform,this.parser.parseOpen(n),!0;default:return!1}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){switch(n){case"r":return!1;case"t":return this.model.text=this.parser.model,this.parser=void 0,!0;case"rPr":return this.model.font=this.parser.model,this.parser=void 0,!0;default:return this.parser&&this.parser.parseClose(n),!0}}}r.FONT_OPTIONS={tagName:"rPr",fontNameTag:"rFont"},p.exports=r},{"../base-xform":32,"../style/font-xform":131,"./text-xform":125}],123:[function(e,p,b){"use strict";let c=e("./text-xform"),i=e("./rich-text-xform"),a=e("./phonetic-text-xform"),r=e("../base-xform");p.exports=class extends r{constructor(t){super(),this.model=t,this.map={r:new i,t:new c,rPh:new a}}get tag(){return"si"}render(t,n){t.openNode(this.tag),n&&n.hasOwnProperty("richText")&&n.richText?n.richText.length?n.richText.forEach(l=>{this.map.r.render(t,l)}):this.map.t.render(t,""):n!=null&&this.map.t.render(t,n),t.closeNode()}parseOpen(t){let{name:n}=t;return this.parser?(this.parser.parseOpen(t),!0):n===this.tag?(this.model={},!0):(this.parser=this.map[n],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser){if(!this.parser.parseClose(t)){switch(t){case"r":{let n=this.model.richText;n||(n=this.model.richText=[]),n.push(this.parser.model);break}case"t":this.model=this.parser.model}this.parser=void 0}return!0}return t!==this.tag}}},{"../base-xform":32,"./phonetic-text-xform":121,"./rich-text-xform":122,"./text-xform":125}],124:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("./shared-string-xform");p.exports=class extends i{constructor(r){super(),this.model=r||{values:[],count:0},this.hash=Object.create(null),this.rich=Object.create(null)}get sharedStringXform(){return this._sharedStringXform||(this._sharedStringXform=new a)}get values(){return this.model.values}get uniqueCount(){return this.model.values.length}get count(){return this.model.count}getString(r){return this.model.values[r]}add(r){return r.richText?this.addRichText(r):this.addText(r)}addText(r){let t=this.hash[r];return t===void 0&&(t=this.hash[r]=this.model.values.length,this.model.values.push(r)),this.model.count++,t}addRichText(r){let t=this.sharedStringXform.toXml(r),n=this.rich[t];return n===void 0&&(n=this.rich[t]=this.model.values.length,this.model.values.push(r)),this.model.count++,n}render(r,t){t=t||this._values,r.openXml(c.StdDocAttributes),r.openNode("sst",{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:t.count,uniqueCount:t.values.length});let n=this.sharedStringXform;t.values.forEach(l=>{n.render(r,l)}),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"sst":return!0;case"si":return this.parser=this.sharedStringXform,this.parser.parseOpen(r),!0;default:throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(r))}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){if(this.parser)return this.parser.parseClose(r)||(this.model.values.push(this.parser.model),this.model.count++,this.parser=void 0),!0;if(r==="sst")return!1;throw new Error("Unexpected xml node in parseClose: "+r)}}},{"../../../utils/xml-stream":28,"../base-xform":32,"./shared-string-xform":123}],125:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"t"}render(i,a){i.openNode("t"),/^\s|\n|\s$/.test(a)&&i.addAttribute("xml:space","preserve"),i.writeText(a),i.closeNode()}get model(){return this._text.join("").replace(/_x([0-9A-F]{4})_/g,(i,a)=>String.fromCharCode(parseInt(a,16)))}parseOpen(i){return i.name==="t"?(this._text=[],!0):!1}parseText(i){this._text.push(i)}parseClose(){return!1}}},{"../base-xform":32}],126:[function(e,p,b){"use strict";let c=e("../../../doc/enums"),i=e("../../../utils/utils"),a=e("../base-xform"),r={horizontalValues:["left","center","right","fill","centerContinuous","distributed","justify"].reduce((n,l)=>(n[l]=!0,n),{}),horizontal(n){return this.horizontalValues[n]?n:void 0},verticalValues:["top","middle","bottom","distributed","justify"].reduce((n,l)=>(n[l]=!0,n),{}),vertical(n){return n==="middle"?"center":this.verticalValues[n]?n:void 0},wrapText:n=>!!n||void 0,shrinkToFit:n=>!!n||void 0,textRotation(n){return n==="vertical"||(n=i.validInt(n))>=-90&&n<=90?n:void 0},indent:n=>(n=i.validInt(n),Math.max(0,n)),readingOrder(n){switch(n){case"ltr":return c.ReadingOrder.LeftToRight;case"rtl":return c.ReadingOrder.RightToLeft;default:return}}},t={toXml(n){if(n=r.textRotation(n)){if(n==="vertical")return 255;let l=Math.round(n);if(l>=0&&l<=90)return l;if(l<0&&l>=-90)return 90-l}},toModel(n){let l=i.validInt(n);if(l!==void 0){if(l===255)return"vertical";if(l>=0&&l<=90)return l;if(l>90&&l<=180)return 90-l}}};p.exports=class extends a{get tag(){return"alignment"}render(n,l){n.addRollback(),n.openNode("alignment");let o=!1;function s(f,d){d&&(n.addAttribute(f,d),o=!0)}s("horizontal",r.horizontal(l.horizontal)),s("vertical",r.vertical(l.vertical)),s("wrapText",!!r.wrapText(l.wrapText)&&"1"),s("shrinkToFit",!!r.shrinkToFit(l.shrinkToFit)&&"1"),s("indent",r.indent(l.indent)),s("textRotation",t.toXml(l.textRotation)),s("readingOrder",r.readingOrder(l.readingOrder)),n.closeNode(),o?n.commit():n.rollback()}parseOpen(n){let l={},o=!1;function s(f,d,u){f&&(l[d]=u,o=!0)}s(n.attributes.horizontal,"horizontal",n.attributes.horizontal),s(n.attributes.vertical,"vertical",n.attributes.vertical==="center"?"middle":n.attributes.vertical),s(n.attributes.wrapText,"wrapText",i.parseBoolean(n.attributes.wrapText)),s(n.attributes.shrinkToFit,"shrinkToFit",i.parseBoolean(n.attributes.shrinkToFit)),s(n.attributes.indent,"indent",parseInt(n.attributes.indent,10)),s(n.attributes.textRotation,"textRotation",t.toModel(n.attributes.textRotation)),s(n.attributes.readingOrder,"readingOrder",n.attributes.readingOrder==="2"?"rtl":"ltr"),this.model=o?l:null}parseText(){}parseClose(){return!1}}},{"../../../doc/enums":7,"../../../utils/utils":27,"../base-xform":32}],127:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("../../../utils/utils"),a=e("./color-xform");class r extends c{constructor(n){super(),this.name=n,this.map={color:new a}}get tag(){return this.name}render(n,l,o){let s=l&&l.color||o||this.defaultColor;n.openNode(this.name),l&&l.style&&(n.addAttribute("style",l.style),s&&this.map.color.render(n,s)),n.closeNode()}parseOpen(n){if(this.parser)return this.parser.parseOpen(n),!0;switch(n.name){case this.name:{let{style:l}=n.attributes;return this.model=l?{style:l}:void 0,!0}case"color":return this.parser=this.map.color,this.parser.parseOpen(n),!0;default:return!1}}parseText(n){this.parser&&this.parser.parseText(n)}parseClose(n){return this.parser?(this.parser.parseClose(n)||(this.parser=void 0),!0):(n===this.name&&this.map.color.model&&(this.model||(this.model={}),this.model.color=this.map.color.model),!1)}validStyle(n){return r.validStyleValues[n]}}r.validStyleValues=["thin","dashed","dotted","dashDot","hair","dashDotDot","slantDashDot","mediumDashed","mediumDashDotDot","mediumDashDot","medium","double","thick"].reduce((t,n)=>(t[n]=!0,t),{}),p.exports=class extends c{constructor(){super(),this.map={top:new r("top"),left:new r("left"),bottom:new r("bottom"),right:new r("right"),diagonal:new r("diagonal")}}render(t,n){let{color:l}=n;function o(s,f){s&&!s.color&&n.color&&(s={...s,color:n.color}),f.render(t,s,l)}t.openNode("border"),n.diagonal&&n.diagonal.style&&(n.diagonal.up&&t.addAttribute("diagonalUp","1"),n.diagonal.down&&t.addAttribute("diagonalDown","1")),o(n.left,this.map.left),o(n.right,this.map.right),o(n.top,this.map.top),o(n.bottom,this.map.bottom),o(n.diagonal,this.map.diagonal),t.closeNode()}parseOpen(t){return this.parser?(this.parser.parseOpen(t),!0):t.name==="border"?(this.reset(),this.diagonalUp=i.parseBoolean(t.attributes.diagonalUp),this.diagonalDown=i.parseBoolean(t.attributes.diagonalDown),!0):(this.parser=this.map[t.name],!!this.parser&&(this.parser.parseOpen(t),!0))}parseText(t){this.parser&&this.parser.parseText(t)}parseClose(t){if(this.parser)return this.parser.parseClose(t)||(this.parser=void 0),!0;if(t==="border"){let n=this.model={},l=function(o,s,f){s&&(f&&Object.assign(s,f),n[o]=s)};l("left",this.map.left.model),l("right",this.map.right.model),l("top",this.map.top.model),l("bottom",this.map.bottom.model),l("diagonal",this.map.diagonal.model,{up:this.diagonalUp,down:this.diagonalDown})}return!1}}},{"../../../utils/utils":27,"../base-xform":32,"./color-xform":128}],128:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{constructor(i){super(),this.name=i||"color"}get tag(){return this.name}render(i,a){return!!a&&(i.openNode(this.name),a.argb?i.addAttribute("rgb",a.argb):a.theme!==void 0?(i.addAttribute("theme",a.theme),a.tint!==void 0&&i.addAttribute("tint",a.tint)):a.indexed!==void 0?i.addAttribute("indexed",a.indexed):i.addAttribute("auto","1"),i.closeNode(),!0)}parseOpen(i){return i.name===this.name&&(i.attributes.rgb?this.model={argb:i.attributes.rgb}:i.attributes.theme?(this.model={theme:parseInt(i.attributes.theme,10)},i.attributes.tint&&(this.model.tint=parseFloat(i.attributes.tint))):i.attributes.indexed?this.model={indexed:parseInt(i.attributes.indexed,10)}:this.model=void 0,!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],129:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./alignment-xform"),a=e("./border-xform"),r=e("./fill-xform"),t=e("./font-xform"),n=e("./numfmt-xform"),l=e("./protection-xform");p.exports=class extends c{constructor(){super(),this.map={alignment:new i,border:new a,fill:new r,font:new t,numFmt:new n,protection:new l}}get tag(){return"dxf"}render(o,s){if(o.openNode(this.tag),s.font&&this.map.font.render(o,s.font),s.numFmt&&s.numFmtId){let f={id:s.numFmtId,formatCode:s.numFmt};this.map.numFmt.render(o,f)}s.fill&&this.map.fill.render(o,s.fill),s.alignment&&this.map.alignment.render(o,s.alignment),s.border&&this.map.border.render(o,s.border),s.protection&&this.map.protection.render(o,s.protection),o.closeNode()}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):o.name===this.tag?(this.reset(),!0):(this.parser=this.map[o.name],this.parser&&this.parser.parseOpen(o),!0)}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return this.parser?(this.parser.parseClose(o)||(this.parser=void 0),!0):o!==this.tag||(this.model={alignment:this.map.alignment.model,border:this.map.border.model,fill:this.map.fill.model,font:this.map.font.model,numFmt:this.map.numFmt.model,protection:this.map.protection.model},!1)}}},{"../base-xform":32,"./alignment-xform":126,"./border-xform":127,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./protection-xform":133}],130:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./color-xform");class a extends c{constructor(){super(),this.map={color:new i}}get tag(){return"stop"}render(o,s){o.openNode("stop"),o.addAttribute("position",s.position),this.map.color.render(o,s.color),o.closeNode()}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case"stop":return this.model={position:parseFloat(o.attributes.position)},!0;case"color":return this.parser=this.map.color,this.parser.parseOpen(o),!0;default:return!1}}parseText(){}parseClose(o){return!!this.parser&&(this.parser.parseClose(o)||(this.model.color=this.parser.model,this.parser=void 0),!0)}}class r extends c{constructor(){super(),this.map={fgColor:new i("fgColor"),bgColor:new i("bgColor")}}get name(){return"pattern"}get tag(){return"patternFill"}render(o,s){o.openNode("patternFill"),o.addAttribute("patternType",s.pattern),s.fgColor&&this.map.fgColor.render(o,s.fgColor),s.bgColor&&this.map.bgColor.render(o,s.bgColor),o.closeNode()}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):o.name==="patternFill"?(this.model={type:"pattern",pattern:o.attributes.patternType},!0):(this.parser=this.map[o.name],!!this.parser&&(this.parser.parseOpen(o),!0))}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return!!this.parser&&(this.parser.parseClose(o)||(this.parser.model&&(this.model[o]=this.parser.model),this.parser=void 0),!0)}}class t extends c{constructor(){super(),this.map={stop:new a}}get name(){return"gradient"}get tag(){return"gradientFill"}render(o,s){switch(o.openNode("gradientFill"),s.gradient){case"angle":o.addAttribute("degree",s.degree);break;case"path":o.addAttribute("type","path"),s.center.left&&(o.addAttribute("left",s.center.left),s.center.right===void 0&&o.addAttribute("right",s.center.left)),s.center.right&&o.addAttribute("right",s.center.right),s.center.top&&(o.addAttribute("top",s.center.top),s.center.bottom===void 0&&o.addAttribute("bottom",s.center.top)),s.center.bottom&&o.addAttribute("bottom",s.center.bottom)}let f=this.map.stop;s.stops.forEach(d=>{f.render(o,d)}),o.closeNode()}parseOpen(o){if(this.parser)return this.parser.parseOpen(o),!0;switch(o.name){case"gradientFill":{let s=this.model={stops:[]};return o.attributes.degree?(s.gradient="angle",s.degree=parseInt(o.attributes.degree,10)):o.attributes.type==="path"&&(s.gradient="path",s.center={left:o.attributes.left?parseFloat(o.attributes.left):0,top:o.attributes.top?parseFloat(o.attributes.top):0},o.attributes.right!==o.attributes.left&&(s.center.right=o.attributes.right?parseFloat(o.attributes.right):0),o.attributes.bottom!==o.attributes.top&&(s.center.bottom=o.attributes.bottom?parseFloat(o.attributes.bottom):0)),!0}case"stop":return this.parser=this.map.stop,this.parser.parseOpen(o),!0;default:return!1}}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return!!this.parser&&(this.parser.parseClose(o)||(this.model.stops.push(this.parser.model),this.parser=void 0),!0)}}class n extends c{constructor(){super(),this.map={patternFill:new r,gradientFill:new t}}get tag(){return"fill"}render(o,s){switch(o.addRollback(),o.openNode("fill"),s.type){case"pattern":this.map.patternFill.render(o,s);break;case"gradient":this.map.gradientFill.render(o,s);break;default:return void o.rollback()}o.closeNode(),o.commit()}parseOpen(o){return this.parser?(this.parser.parseOpen(o),!0):o.name==="fill"?(this.model={},!0):(this.parser=this.map[o.name],!!this.parser&&(this.parser.parseOpen(o),!0))}parseText(o){this.parser&&this.parser.parseText(o)}parseClose(o){return!!this.parser&&(this.parser.parseClose(o)||(this.model=this.parser.model,this.model.type=this.parser.name,this.parser=void 0),!0)}validStyle(o){return n.validPatternValues[o]}}n.validPatternValues=["none","solid","darkVertical","darkGray","mediumGray","lightGray","gray125","gray0625","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","lightGrid"].reduce((l,o)=>(l[o]=!0,l),{}),n.StopXform=a,n.PatternFillXform=r,n.GradientFillXform=t,p.exports=n},{"../base-xform":32,"./color-xform":128}],131:[function(e,p,b){"use strict";let c=e("./color-xform"),i=e("../simple/boolean-xform"),a=e("../simple/integer-xform"),r=e("../simple/string-xform"),t=e("./underline-xform"),n=e("../../../utils/under-dash"),l=e("../base-xform");class o extends l{constructor(f){super(),this.options=f||o.OPTIONS,this.map={b:{prop:"bold",xform:new i({tag:"b",attr:"val"})},i:{prop:"italic",xform:new i({tag:"i",attr:"val"})},u:{prop:"underline",xform:new t},charset:{prop:"charset",xform:new a({tag:"charset",attr:"val"})},color:{prop:"color",xform:new c},condense:{prop:"condense",xform:new i({tag:"condense",attr:"val"})},extend:{prop:"extend",xform:new i({tag:"extend",attr:"val"})},family:{prop:"family",xform:new a({tag:"family",attr:"val"})},outline:{prop:"outline",xform:new i({tag:"outline",attr:"val"})},vertAlign:{prop:"vertAlign",xform:new r({tag:"vertAlign",attr:"val"})},scheme:{prop:"scheme",xform:new r({tag:"scheme",attr:"val"})},shadow:{prop:"shadow",xform:new i({tag:"shadow",attr:"val"})},strike:{prop:"strike",xform:new i({tag:"strike",attr:"val"})},sz:{prop:"size",xform:new a({tag:"sz",attr:"val"})}},this.map[this.options.fontNameTag]={prop:"name",xform:new r({tag:this.options.fontNameTag,attr:"val"})}}get tag(){return this.options.tagName}render(f,d){let{map:u}=this;f.openNode(this.options.tagName),n.each(this.map,(g,m)=>{u[m].xform.render(f,d[g.prop])}),f.closeNode()}parseOpen(f){return this.parser?(this.parser.parseOpen(f),!0):this.map[f.name]?(this.parser=this.map[f.name].xform,this.parser.parseOpen(f)):f.name===this.options.tagName?(this.model={},!0):!1}parseText(f){this.parser&&this.parser.parseText(f)}parseClose(f){if(this.parser&&!this.parser.parseClose(f)){let d=this.map[f];return this.parser.model&&(this.model[d.prop]=this.parser.model),this.parser=void 0,!0}return f!==this.options.tagName}}o.OPTIONS={tagName:"font",fontNameTag:"name"},p.exports=o},{"../../../utils/under-dash":26,"../base-xform":32,"../simple/boolean-xform":116,"../simple/integer-xform":118,"../simple/string-xform":119,"./color-xform":128,"./underline-xform":136}],132:[function(e,p,b){"use strict";let c=e("../../../utils/under-dash"),i=e("../../defaultnumformats"),a=e("../base-xform"),r=(function(){let n={};return c.each(i,(l,o)=>{l.f&&(n[l.f]=parseInt(o,10))}),n})();class t extends a{constructor(l,o){super(),this.id=l,this.formatCode=o}get tag(){return"numFmt"}render(l,o){l.leafNode("numFmt",{numFmtId:o.id,formatCode:o.formatCode})}parseOpen(l){return l.name==="numFmt"?(this.model={id:parseInt(l.attributes.numFmtId,10),formatCode:l.attributes.formatCode.replace(/[\\](.)/g,"$1")},!0):!1}parseText(){}parseClose(){return!1}}t.getDefaultFmtId=function(n){return r[n]},t.getDefaultFmtCode=function(n){return i[n]&&i[n].f},p.exports=t},{"../../../utils/under-dash":26,"../../defaultnumformats":30,"../base-xform":32}],133:[function(e,p,b){"use strict";let c=e("../base-xform"),i={boolean:(a,r)=>a===void 0?r:a};p.exports=class extends c{get tag(){return"protection"}render(a,r){a.addRollback(),a.openNode("protection");let t=!1;function n(l,o){o!==void 0&&(a.addAttribute(l,o),t=!0)}n("locked",i.boolean(r.locked,!0)?void 0:"0"),n("hidden",i.boolean(r.hidden,!1)?"1":void 0),a.closeNode(),t?a.commit():a.rollback()}parseOpen(a){let r={locked:a.attributes.locked!=="0",hidden:a.attributes.hidden==="1"},t=!r.locked||r.hidden;this.model=t?r:null}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],134:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./alignment-xform"),a=e("./protection-xform");p.exports=class extends c{constructor(r){super(),this.xfId=!(!r||!r.xfId),this.map={alignment:new i,protection:new a}}get tag(){return"xf"}render(r,t){r.openNode("xf",{numFmtId:t.numFmtId||0,fontId:t.fontId||0,fillId:t.fillId||0,borderId:t.borderId||0}),this.xfId&&r.addAttribute("xfId",t.xfId||0),t.numFmtId&&r.addAttribute("applyNumberFormat","1"),t.fontId&&r.addAttribute("applyFont","1"),t.fillId&&r.addAttribute("applyFill","1"),t.borderId&&r.addAttribute("applyBorder","1"),t.alignment&&r.addAttribute("applyAlignment","1"),t.protection&&r.addAttribute("applyProtection","1"),t.alignment&&this.map.alignment.render(r,t.alignment),t.protection&&this.map.protection.render(r,t.protection),r.closeNode()}parseOpen(r){if(this.parser)return this.parser.parseOpen(r),!0;switch(r.name){case"xf":return this.model={numFmtId:parseInt(r.attributes.numFmtId,10),fontId:parseInt(r.attributes.fontId,10),fillId:parseInt(r.attributes.fillId,10),borderId:parseInt(r.attributes.borderId,10)},this.xfId&&(this.model.xfId=parseInt(r.attributes.xfId,10)),!0;case"alignment":return this.parser=this.map.alignment,this.parser.parseOpen(r),!0;case"protection":return this.parser=this.map.protection,this.parser.parseOpen(r),!0;default:return!1}}parseText(r){this.parser&&this.parser.parseText(r)}parseClose(r){return this.parser?(this.parser.parseClose(r)||(this.map.protection===this.parser?this.model.protection=this.parser.model:this.model.alignment=this.parser.model,this.parser=void 0),!0):r!=="xf"}}},{"../base-xform":32,"./alignment-xform":126,"./protection-xform":133}],135:[function(e,p,b){"use strict";let c=e("../../../doc/enums"),i=e("../../../utils/xml-stream"),a=e("../base-xform"),r=e("../static-xform"),t=e("../list-xform"),n=e("./font-xform"),l=e("./fill-xform"),o=e("./border-xform"),s=e("./numfmt-xform"),f=e("./style-xform"),d=e("./dxf-xform");class u extends a{constructor(m){super(),this.map={numFmts:new t({tag:"numFmts",count:!0,childXform:new s}),fonts:new t({tag:"fonts",count:!0,childXform:new n,$:{"x14ac:knownFonts":1}}),fills:new t({tag:"fills",count:!0,childXform:new l}),borders:new t({tag:"borders",count:!0,childXform:new o}),cellStyleXfs:new t({tag:"cellStyleXfs",count:!0,childXform:new f}),cellXfs:new t({tag:"cellXfs",count:!0,childXform:new f({xfId:!0})}),dxfs:new t({tag:"dxfs",always:!0,count:!0,childXform:new d}),numFmt:new s,font:new n,fill:new l,border:new o,style:new f({xfId:!0}),cellStyles:u.STATIC_XFORMS.cellStyles,tableStyles:u.STATIC_XFORMS.tableStyles,extLst:u.STATIC_XFORMS.extLst},m&&this.init()}initIndex(){this.index={style:{},numFmt:{},numFmtNextId:164,font:{},border:{},fill:{}}}init(){this.model={styles:[],numFmts:[],fonts:[],borders:[],fills:[],dxfs:[]},this.initIndex(),this._addBorder({}),this._addStyle({numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}),this._addFill({type:"pattern",pattern:"none"}),this._addFill({type:"pattern",pattern:"gray125"}),this.weakMap=new WeakMap}render(m,v){v=v||this.model,m.openXml(i.StdDocAttributes),m.openNode("styleSheet",u.STYLESHEET_ATTRIBUTES),this.index?(v.numFmts&&v.numFmts.length&&(m.openNode("numFmts",{count:v.numFmts.length}),v.numFmts.forEach(k=>{m.writeXml(k)}),m.closeNode()),v.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),m.openNode("fonts",{count:v.fonts.length,"x14ac:knownFonts":1}),v.fonts.forEach(k=>{m.writeXml(k)}),m.closeNode(),m.openNode("fills",{count:v.fills.length}),v.fills.forEach(k=>{m.writeXml(k)}),m.closeNode(),m.openNode("borders",{count:v.borders.length}),v.borders.forEach(k=>{m.writeXml(k)}),m.closeNode(),this.map.cellStyleXfs.render(m,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),m.openNode("cellXfs",{count:v.styles.length}),v.styles.forEach(k=>{m.writeXml(k)}),m.closeNode()):(this.map.numFmts.render(m,v.numFmts),this.map.fonts.render(m,v.fonts),this.map.fills.render(m,v.fills),this.map.borders.render(m,v.borders),this.map.cellStyleXfs.render(m,[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}]),this.map.cellXfs.render(m,v.styles)),u.STATIC_XFORMS.cellStyles.render(m),this.map.dxfs.render(m,v.dxfs),u.STATIC_XFORMS.tableStyles.render(m),u.STATIC_XFORMS.extLst.render(m),m.closeNode()}parseOpen(m){return this.parser?(this.parser.parseOpen(m),!0):m.name==="styleSheet"?(this.initIndex(),!0):(this.parser=this.map[m.name],this.parser&&this.parser.parseOpen(m),!0)}parseText(m){this.parser&&this.parser.parseText(m)}parseClose(m){if(this.parser)return this.parser.parseClose(m)||(this.parser=void 0),!0;switch(m){case"styleSheet":{this.model={};let v=(k,B)=>{B.model&&B.model.length&&(this.model[k]=B.model)};if(v("numFmts",this.map.numFmts),v("fonts",this.map.fonts),v("fills",this.map.fills),v("borders",this.map.borders),v("styles",this.map.cellXfs),v("dxfs",this.map.dxfs),this.index={model:[],numFmt:[]},this.model.numFmts){let k=this.index.numFmt;this.model.numFmts.forEach(B=>{k[B.id]=B.formatCode})}return!1}default:return!0}}addStyleModel(m,v){if(!m)return 0;if(this.model.fonts.length||this._addFont({size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}),this.weakMap&&this.weakMap.has(m))return this.weakMap.get(m);let k={};if(v=v||c.ValueType.Number,m.numFmt)k.numFmtId=this._addNumFmtStr(m.numFmt);else switch(v){case c.ValueType.Number:k.numFmtId=this._addNumFmtStr("General");break;case c.ValueType.Date:k.numFmtId=this._addNumFmtStr("mm-dd-yy")}m.font&&(k.fontId=this._addFont(m.font)),m.border&&(k.borderId=this._addBorder(m.border)),m.fill&&(k.fillId=this._addFill(m.fill)),m.alignment&&(k.alignment=m.alignment),m.protection&&(k.protection=m.protection);let B=this._addStyle(k);return this.weakMap&&this.weakMap.set(m,B),B}getStyleModel(m){let v=this.model.styles[m];if(!v)return null;let k=this.index.model[m];if(k)return k;if(k=this.index.model[m]={},v.numFmtId){let O=this.index.numFmt[v.numFmtId]||s.getDefaultFmtCode(v.numFmtId);O&&(k.numFmt=O)}function B(O,L,R){if(R||R===0){let P=L[R];P&&(k[O]=P)}}return B("font",this.model.fonts,v.fontId),B("border",this.model.borders,v.borderId),B("fill",this.model.fills,v.fillId),v.alignment&&(k.alignment=v.alignment),v.protection&&(k.protection=v.protection),k}addDxfStyle(m){return m.numFmt&&(m.numFmtId=this._addNumFmtStr(m.numFmt)),this.model.dxfs.push(m),this.model.dxfs.length-1}getDxfStyle(m){return this.model.dxfs[m]}_addStyle(m){let v=this.map.style.toXml(m),k=this.index.style[v];return k===void 0&&(k=this.index.style[v]=this.model.styles.length,this.model.styles.push(v)),k}_addNumFmtStr(m){let v=s.getDefaultFmtId(m);if(v!==void 0||(v=this.index.numFmt[m],v!==void 0))return v;v=this.index.numFmt[m]=164+this.model.numFmts.length;let k=this.map.numFmt.toXml({id:v,formatCode:m});return this.model.numFmts.push(k),v}_addFont(m){let v=this.map.font.toXml(m),k=this.index.font[v];return k===void 0&&(k=this.index.font[v]=this.model.fonts.length,this.model.fonts.push(v)),k}_addBorder(m){let v=this.map.border.toXml(m),k=this.index.border[v];return k===void 0&&(k=this.index.border[v]=this.model.borders.length,this.model.borders.push(v)),k}_addFill(m){let v=this.map.fill.toXml(m),k=this.index.fill[v];return k===void 0&&(k=this.index.fill[v]=this.model.fills.length,this.model.fills.push(v)),k}}u.STYLESHEET_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"x14ac x16r2","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"},u.STATIC_XFORMS={cellStyles:new r({tag:"cellStyles",$:{count:1},c:[{tag:"cellStyle",$:{name:"Normal",xfId:0,builtinId:0}}]}),dxfs:new r({tag:"dxfs",$:{count:0}}),tableStyles:new r({tag:"tableStyles",$:{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}}),extLst:new r({tag:"extLst",c:[{tag:"ext",$:{uri:"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}","xmlns:x14":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"},c:[{tag:"x14:slicerStyles",$:{defaultSlicerStyle:"SlicerStyleLight1"}}]},{tag:"ext",$:{uri:"{9260A510-F301-46a8-8635-F512D64BE5F5}","xmlns:x15":"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"},c:[{tag:"x15:timelineStyles",$:{defaultTimelineStyle:"TimeSlicerStyleLight1"}}]}]})},u.Mock=class extends u{constructor(){super(),this.model={styles:[{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}],numFmts:[],fonts:[{size:11,color:{theme:1},name:"Calibri",family:2,scheme:"minor"}],borders:[{}],fills:[{type:"pattern",pattern:"none"},{type:"pattern",pattern:"gray125"}]}}parseStream(g){return g.autodrain(),Promise.resolve()}addStyleModel(g,m){return m===c.ValueType.Date?this.dateStyleId:0}get dateStyleId(){if(!this._dateStyleId){let g={numFmtId:s.getDefaultFmtId("mm-dd-yy")};this._dateStyleId=this.model.styles.length,this.model.styles.push(g)}return this._dateStyleId}getStyleModel(){return{}}},p.exports=u},{"../../../doc/enums":7,"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"../static-xform":120,"./border-xform":127,"./dxf-xform":129,"./fill-xform":130,"./font-xform":131,"./numfmt-xform":132,"./style-xform":134}],136:[function(e,p,b){"use strict";let c=e("../base-xform");class i extends c{constructor(r){super(),this.model=r}get tag(){return"u"}render(r,t){if((t=t||this.model)===!0)r.leafNode("u");else{let n=i.Attributes[t];n&&r.leafNode("u",n)}}parseOpen(r){r.name==="u"&&(this.model=r.attributes.val||!0)}parseText(){}parseClose(){return!1}}i.Attributes={single:{},double:{val:"double"},singleAccounting:{val:"singleAccounting"},doubleAccounting:{val:"doubleAccounting"}},p.exports=i},{"../base-xform":32}],137:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("./filter-column-xform");p.exports=class extends c{constructor(){super(),this.map={filterColumn:new i}}get tag(){return"autoFilter"}prepare(a){a.columns.forEach((r,t)=>{this.map.filterColumn.prepare(r,{index:t})})}render(a,r){return a.openNode(this.tag,{ref:r.autoFilterRef}),r.columns.forEach(t=>{this.map.filterColumn.render(a,t)}),a.closeNode(),!0}parseOpen(a){if(this.parser)return this.parser.parseOpen(a),!0;switch(a.name){case this.tag:return this.model={autoFilterRef:a.attributes.ref,columns:[]},!0;default:if(this.parser=this.map[a.name],this.parser)return this.parseOpen(a),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(a))}}parseText(a){this.parser&&this.parser.parseText(a)}parseClose(a){if(this.parser)return this.parser.parseClose(a)||(this.model.columns.push(this.parser.model),this.parser=void 0),!0;if(a===this.tag)return!1;throw new Error("Unexpected xml node in parseClose: "+a)}}},{"../base-xform":32,"./filter-column-xform":139}],138:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"customFilter"}render(i,a){i.leafNode(this.tag,{val:a.val,operator:a.operator})}parseOpen(i){return i.name===this.tag&&(this.model={val:i.attributes.val,operator:i.attributes.operator},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],139:[function(e,p,b){"use strict";let c=e("../base-xform"),i=e("../list-xform"),a=e("./custom-filter-xform"),r=e("./filter-xform");p.exports=class extends c{constructor(){super(),this.map={customFilters:new i({tag:"customFilters",count:!1,empty:!0,childXform:new a}),filters:new i({tag:"filters",count:!1,empty:!0,childXform:new r})}}get tag(){return"filterColumn"}prepare(t,n){t.colId=n.index.toString()}render(t,n){return n.customFilters?(t.openNode(this.tag,{colId:n.colId,hiddenButton:n.filterButton?"0":"1"}),this.map.customFilters.render(t,n.customFilters),t.closeNode(),!0):(t.leafNode(this.tag,{colId:n.colId,hiddenButton:n.filterButton?"0":"1"}),!0)}parseOpen(t){if(this.parser)return this.parser.parseOpen(t),!0;let{attributes:n}=t;switch(t.name){case this.tag:return this.model={filterButton:n.hiddenButton==="0"},!0;default:if(this.parser=this.map[t.name],this.parser)return this.parseOpen(t),!0;throw new Error("Unexpected xml node in parseOpen: "+JSON.stringify(t))}}parseText(){}parseClose(t){return this.parser?(this.parser.parseClose(t)||(this.parser=void 0),!0):t===this.tag?(this.model.customFilters=this.map.customFilters.model,!1):!0}}},{"../base-xform":32,"../list-xform":71,"./custom-filter-xform":138,"./filter-xform":140}],140:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"filter"}render(i,a){i.leafNode(this.tag,{val:a.val})}parseOpen(i){return i.name===this.tag&&(this.model={val:i.attributes.val},!0)}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],141:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"tableColumn"}prepare(i,a){i.id=a.index+1}render(i,a){return i.leafNode(this.tag,{id:a.id.toString(),name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId}),!0}parseOpen(i){if(i.name===this.tag){let{attributes:a}=i;return this.model={name:a.name,totalsRowLabel:a.totalsRowLabel,totalsRowFunction:a.totalsRowFunction,dxfId:a.dxfId},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],142:[function(e,p,b){"use strict";let c=e("../base-xform");p.exports=class extends c{get tag(){return"tableStyleInfo"}render(i,a){return i.leafNode(this.tag,{name:a.theme?a.theme:void 0,showFirstColumn:a.showFirstColumn?"1":"0",showLastColumn:a.showLastColumn?"1":"0",showRowStripes:a.showRowStripes?"1":"0",showColumnStripes:a.showColumnStripes?"1":"0"}),!0}parseOpen(i){if(i.name===this.tag){let{attributes:a}=i;return this.model={theme:a.name?a.name:null,showFirstColumn:a.showFirstColumn==="1",showLastColumn:a.showLastColumn==="1",showRowStripes:a.showRowStripes==="1",showColumnStripes:a.showColumnStripes==="1"},!0}return!1}parseText(){}parseClose(){return!1}}},{"../base-xform":32}],143:[function(e,p,b){"use strict";let c=e("../../../utils/xml-stream"),i=e("../base-xform"),a=e("../list-xform"),r=e("./auto-filter-xform"),t=e("./table-column-xform"),n=e("./table-style-info-xform");class l extends i{constructor(){super(),this.map={autoFilter:new r,tableColumns:new a({tag:"tableColumns",count:!0,empty:!0,childXform:new t}),tableStyleInfo:new n}}prepare(s,f){this.map.autoFilter.prepare(s),this.map.tableColumns.prepare(s.columns,f)}get tag(){return"table"}render(s,f){s.openXml(c.StdDocAttributes),s.openNode(this.tag,{...l.TABLE_ATTRIBUTES,id:f.id,name:f.name,displayName:f.displayName||f.name,ref:f.tableRef,totalsRowCount:f.totalsRow?"1":void 0,totalsRowShown:f.totalsRow?void 0:"1",headerRowCount:f.headerRow?"1":"0"}),this.map.autoFilter.render(s,f),this.map.tableColumns.render(s,f.columns),this.map.tableStyleInfo.render(s,f.style),s.closeNode()}parseOpen(s){if(this.parser)return this.parser.parseOpen(s),!0;let{name:f,attributes:d}=s;return f===this.tag?(this.reset(),this.model={name:d.name,displayName:d.displayName||d.name,tableRef:d.ref,totalsRow:d.totalsRowCount==="1",headerRow:d.headerRowCount==="1"}):(this.parser=this.map[s.name],this.parser&&this.parser.parseOpen(s)),!0}parseText(s){this.parser&&this.parser.parseText(s)}parseClose(s){return this.parser?(this.parser.parseClose(s)||(this.parser=void 0),!0):s===this.tag?(this.model.columns=this.map.tableColumns.model,this.map.autoFilter.model&&(this.model.autoFilterRef=this.map.autoFilter.model.autoFilterRef,this.map.autoFilter.model.columns.forEach((f,d)=>{this.model.columns[d].filterButton=f.filterButton})),this.model.style=this.map.tableStyleInfo.model,!1):!0}reconcile(s,f){s.columns.forEach(d=>{d.dxfId!==void 0&&(d.style=f.styles.getDxfStyle(d.dxfId))})}}l.TABLE_ATTRIBUTES={xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"},p.exports=l},{"../../../utils/xml-stream":28,"../base-xform":32,"../list-xform":71,"./auto-filter-xform":137,"./table-column-xform":141,"./table-style-info-xform":142}],144:[function(e,p,b){(function(c,i){(function(){"use strict";let a=e("fs"),r=e("jszip"),{PassThrough:t}=e("readable-stream"),n=e("../utils/zip-stream"),l=e("../utils/stream-buf"),o=e("../utils/utils"),s=e("../utils/xml-stream"),{bufferToString:f}=e("../utils/browser-buffer-decode"),d=e("./xform/style/styles-xform"),u=e("./xform/core/core-xform"),g=e("./xform/strings/shared-strings-xform"),m=e("./xform/core/relationships-xform"),v=e("./xform/core/content-types-xform"),k=e("./xform/core/app-xform"),B=e("./xform/book/workbook-xform"),O=e("./xform/sheet/worksheet-xform"),L=e("./xform/drawing/drawing-xform"),R=e("./xform/table/table-xform"),P=e("./xform/comment/comments-xform"),j=e("./xform/comment/vml-notes-xform"),z=e("./xml/theme1");class N{constructor(C){this.workbook=C}async readFile(C,E){if(!await o.fs.exists(C))throw new Error("File not found: "+C);let h=a.createReadStream(C);try{let y=await this.read(h,E);return h.close(),y}catch(y){throw h.close(),y}}parseRels(C){return new m().parseStream(C)}parseWorkbook(C){return new B().parseStream(C)}parseSharedStrings(C){return new g().parseStream(C)}reconcile(C,E){let h=new B,y=new O(E),w=new L,x=new R;h.reconcile(C);let _={media:C.media,mediaIndex:C.mediaIndex};Object.keys(C.drawings).forEach(q=>{let $=C.drawings[q],W=C.drawingRels[q];W&&(_.rels=W.reduce((A,H)=>(A[H.Id]=H,A),{}),($.anchors||[]).forEach(A=>{let H=A.picture&&A.picture.hyperlinks;H&&_.rels[H.rId]&&(H.hyperlink=_.rels[H.rId].Target,delete H.rId)}),w.reconcile($,_))});let T={styles:C.styles};Object.values(C.tables).forEach(q=>{x.reconcile(q,T)});let D={styles:C.styles,sharedStrings:C.sharedStrings,media:C.media,mediaIndex:C.mediaIndex,date1904:C.properties&&C.properties.date1904,drawings:C.drawings,comments:C.comments,tables:C.tables,vmlDrawings:C.vmlDrawings};C.worksheets.forEach(q=>{q.relationships=C.worksheetRels[q.sheetNo],y.reconcile(q,D)}),delete C.worksheetHash,delete C.worksheetRels,delete C.globalRels,delete C.sharedStrings,delete C.workbookRels,delete C.sheetDefs,delete C.styles,delete C.mediaIndex,delete C.drawings,delete C.drawingRels,delete C.vmlDrawings}async _processWorksheetEntry(C,E,h,y,w){let x=new O(y),_=await x.parseStream(C);_.sheetNo=h,E.worksheetHash[w]=_,E.worksheets.push(_)}async _processCommentEntry(C,E,h){let y=new P,w=await y.parseStream(C);E.comments[`../${h}.xml`]=w}async _processTableEntry(C,E,h){let y=new R,w=await y.parseStream(C);E.tables[`../tables/${h}.xml`]=w}async _processWorksheetRelsEntry(C,E,h){let y=new m,w=await y.parseStream(C);E.worksheetRels[h]=w}async _processMediaEntry(C,E,h){let y=h.lastIndexOf(".");if(y>=1){let w=h.substr(y+1),x=h.substr(0,y);await new Promise((_,T)=>{let D=new l;D.on("finish",()=>{E.mediaIndex[h]=E.media.length,E.mediaIndex[x]=E.media.length;let q={type:"image",name:x,extension:w,buffer:D.toBuffer()};E.media.push(q),_()}),C.on("error",q=>{T(q)}),C.pipe(D)})}}async _processDrawingEntry(C,E,h){let y=new L,w=await y.parseStream(C);E.drawings[h]=w}async _processDrawingRelsEntry(C,E,h){let y=new m,w=await y.parseStream(C);E.drawingRels[h]=w}async _processVmlDrawingEntry(C,E,h){let y=new j,w=await y.parseStream(C);E.vmlDrawings[`../drawings/${h}.vml`]=w}async _processThemeEntry(C,E,h){await new Promise((y,w)=>{let x=new l;C.on("error",w),x.on("error",w),x.on("finish",()=>{E.themes[h]=x.read().toString(),y()}),C.pipe(x)})}createInputStream(){throw new Error("`XLSX#createInputStream` is deprecated. You should use `XLSX#read` instead. This method will be removed in version 5.0. Please follow upgrade instruction: https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md")}async read(C,E){!C[Symbol.asyncIterator]&&C.pipe&&(C=C.pipe(new t));let h=[];for await(let y of C)h.push(y);return this.load(i.concat(h),E)}async load(C,E){let h;h=E&&E.base64?i.from(C.toString(),"base64"):C;let y={worksheets:[],worksheetHash:{},worksheetRels:[],themes:{},media:[],mediaIndex:{},drawings:{},drawingRels:{},comments:{},tables:{},vmlDrawings:{}},w=await r.loadAsync(h);for(let x of Object.values(w.files))if(!x.dir){let _,T=x.name;if(T[0]==="/"&&(T=T.substr(1)),T.match(/xl\/media\//)||T.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/))_=new t,_.write(await x.async("nodebuffer"));else{let D;_=new t({writableObjectMode:!0,readableObjectMode:!0}),D=c.browser?f(await x.async("nodebuffer")):await x.async("string");let q=16384;for(let $=0;$<D.length;$+=q)_.write(D.substring($,$+q))}switch(_.end(),T){case"_rels/.rels":y.globalRels=await this.parseRels(_);break;case"xl/workbook.xml":{let D=await this.parseWorkbook(_);y.sheets=D.sheets,y.definedNames=D.definedNames,y.views=D.views,y.properties=D.properties,y.calcProperties=D.calcProperties;break}case"xl/_rels/workbook.xml.rels":y.workbookRels=await this.parseRels(_);break;case"xl/sharedStrings.xml":y.sharedStrings=new g,await y.sharedStrings.parseStream(_);break;case"xl/styles.xml":y.styles=new d,await y.styles.parseStream(_);break;case"docProps/app.xml":{let D=new k,q=await D.parseStream(_);y.company=q.company,y.manager=q.manager;break}case"docProps/core.xml":{let D=new u,q=await D.parseStream(_);Object.assign(y,q);break}default:{let D=T.match(/xl\/worksheets\/sheet(\d+)[.]xml/);if(D){await this._processWorksheetEntry(_,y,D[1],E,T);break}if(D=T.match(/xl\/worksheets\/_rels\/sheet(\d+)[.]xml.rels/),D){await this._processWorksheetRelsEntry(_,y,D[1]);break}if(D=T.match(/xl\/theme\/([a-zA-Z0-9]+)[.]xml/),D){await this._processThemeEntry(_,y,D[1]);break}if(D=T.match(/xl\/media\/([a-zA-Z0-9]+[.][a-zA-Z0-9]{3,4})$/),D){await this._processMediaEntry(_,y,D[1]);break}if(D=T.match(/xl\/drawings\/([a-zA-Z0-9]+)[.]xml/),D){await this._processDrawingEntry(_,y,D[1]);break}if(D=T.match(/xl\/(comments\d+)[.]xml/),D){await this._processCommentEntry(_,y,D[1]);break}if(D=T.match(/xl\/tables\/(table\d+)[.]xml/),D){await this._processTableEntry(_,y,D[1]);break}if(D=T.match(/xl\/drawings\/_rels\/([a-zA-Z0-9]+)[.]xml[.]rels/),D){await this._processDrawingRelsEntry(_,y,D[1]);break}if(D=T.match(/xl\/drawings\/(vmlDrawing\d+)[.]vml/),D){await this._processVmlDrawingEntry(_,y,D[1]);break}}}}return this.reconcile(y,E),this.workbook.model=y,this.workbook}async addMedia(C,E){await Promise.all(E.media.map(async h=>{if(h.type==="image"){let y=`xl/media/${h.name}.${h.extension}`;if(h.filename){let w=await(function(x,_){return new Promise((T,D)=>{a.readFile(x,_,(q,$)=>{q?D(q):T($)})})})(h.filename);return C.append(w,{name:y})}if(h.buffer)return C.append(h.buffer,{name:y});if(h.base64){let w=h.base64,x=w.substring(w.indexOf(",")+1);return C.append(x,{name:y,base64:!0})}}throw new Error("Unsupported media")}))}addDrawings(C,E){let h=new L,y=new m;E.worksheets.forEach(w=>{let{drawing:x}=w;if(x){h.prepare(x,{});let _=h.toXml(x);C.append(_,{name:`xl/drawings/${x.name}.xml`}),_=y.toXml(x.rels),C.append(_,{name:`xl/drawings/_rels/${x.name}.xml.rels`})}})}addTables(C,E){let h=new R;E.worksheets.forEach(y=>{let{tables:w}=y;w.forEach(x=>{h.prepare(x,{});let _=h.toXml(x);C.append(_,{name:"xl/tables/"+x.target})})})}async addContentTypes(C,E){let h=new v().toXml(E);C.append(h,{name:"[Content_Types].xml"})}async addApp(C,E){let h=new k().toXml(E);C.append(h,{name:"docProps/app.xml"})}async addCore(C,E){let h=new u;C.append(h.toXml(E),{name:"docProps/core.xml"})}async addThemes(C,E){let h=E.themes||{theme1:z};Object.keys(h).forEach(y=>{let w=h[y],x=`xl/theme/${y}.xml`;C.append(w,{name:x})})}async addOfficeRels(C){let E=new m().toXml([{Id:"rId1",Type:N.RelType.OfficeDocument,Target:"xl/workbook.xml"},{Id:"rId2",Type:N.RelType.CoreProperties,Target:"docProps/core.xml"},{Id:"rId3",Type:N.RelType.ExtenderProperties,Target:"docProps/app.xml"}]);C.append(E,{name:"_rels/.rels"})}async addWorkbookRels(C,E){let h=1,y=[{Id:"rId"+h++,Type:N.RelType.Styles,Target:"styles.xml"},{Id:"rId"+h++,Type:N.RelType.Theme,Target:"theme/theme1.xml"}];E.sharedStrings.count&&y.push({Id:"rId"+h++,Type:N.RelType.SharedStrings,Target:"sharedStrings.xml"}),E.worksheets.forEach(x=>{x.rId="rId"+h++,y.push({Id:x.rId,Type:N.RelType.Worksheet,Target:`worksheets/sheet${x.id}.xml`})});let w=new m().toXml(y);C.append(w,{name:"xl/_rels/workbook.xml.rels"})}async addSharedStrings(C,E){E.sharedStrings&&E.sharedStrings.count&&C.append(E.sharedStrings.xml,{name:"xl/sharedStrings.xml"})}async addStyles(C,E){let{xml:h}=E.styles;h&&C.append(h,{name:"xl/styles.xml"})}async addWorkbook(C,E){let h=new B;C.append(h.toXml(E),{name:"xl/workbook.xml"})}async addWorksheets(C,E){let h=new O,y=new m,w=new P,x=new j;E.worksheets.forEach(_=>{let T=new s;h.render(T,_),C.append(T.xml,{name:`xl/worksheets/sheet${_.id}.xml`}),_.rels&&_.rels.length&&(T=new s,y.render(T,_.rels),C.append(T.xml,{name:`xl/worksheets/_rels/sheet${_.id}.xml.rels`})),_.comments.length>0&&(T=new s,w.render(T,_),C.append(T.xml,{name:`xl/comments${_.id}.xml`}),T=new s,x.render(T,_),C.append(T.xml,{name:`xl/drawings/vmlDrawing${_.id}.vml`}))})}_finalize(C){return new Promise((E,h)=>{C.on("finish",()=>{E(this)}),C.on("error",h),C.finalize()})}prepareModel(C,E){C.creator=C.creator||"ExcelJS",C.lastModifiedBy=C.lastModifiedBy||"ExcelJS",C.created=C.created||new Date,C.modified=C.modified||new Date,C.useSharedStrings=E.useSharedStrings===void 0||E.useSharedStrings,C.useStyles=E.useStyles===void 0||E.useStyles,C.sharedStrings=new g,C.styles=C.useStyles?new d(!0):new d.Mock;let h=new B,y=new O;h.prepare(C);let w={sharedStrings:C.sharedStrings,styles:C.styles,date1904:C.properties.date1904,drawingsCount:0,media:C.media};w.drawings=C.drawings=[],w.commentRefs=C.commentRefs=[];let x=0;C.tables=[],C.worksheets.forEach(_=>{_.tables.forEach(T=>{x++,T.target=`table${x}.xml`,T.id=x,C.tables.push(T)}),y.prepare(_,w)})}async write(C,E){E=E||{};let{model:h}=this.workbook,y=new n.ZipWriter(E.zip);return y.pipe(C),this.prepareModel(h,E),await this.addContentTypes(y,h),await this.addOfficeRels(y,h),await this.addWorkbookRels(y,h),await this.addWorksheets(y,h),await this.addSharedStrings(y,h),await this.addDrawings(y,h),await this.addTables(y,h),await Promise.all([this.addThemes(y,h),this.addStyles(y,h)]),await this.addMedia(y,h),await Promise.all([this.addApp(y,h),this.addCore(y,h)]),await this.addWorkbook(y,h),this._finalize(y)}writeFile(C,E){let h=a.createWriteStream(C);return new Promise((y,w)=>{h.on("finish",()=>{y()}),h.on("error",x=>{w(x)}),this.write(h,E).then(()=>{h.end()}).catch(x=>{w(x)})})}async writeBuffer(C){let E=new l;return await this.write(E,C),E.read()}}N.RelType=e("./rel-type"),p.exports=N}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"../utils/browser-buffer-decode":16,"../utils/stream-buf":24,"../utils/utils":27,"../utils/xml-stream":28,"../utils/zip-stream":29,"./rel-type":31,"./xform/book/workbook-xform":38,"./xform/comment/comments-xform":40,"./xform/comment/vml-notes-xform":45,"./xform/core/app-xform":51,"./xform/core/content-types-xform":52,"./xform/core/core-xform":53,"./xform/core/relationships-xform":55,"./xform/drawing/drawing-xform":62,"./xform/sheet/worksheet-xform":115,"./xform/strings/shared-strings-xform":124,"./xform/style/styles-xform":135,"./xform/table/table-xform":143,"./xml/theme1":145,_process:467,buffer:220,fs:216,jszip:441,"readable-stream":491}],145:[function(e,p,b){"use strict";p.exports=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
+ <a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/> <a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/> <a:font script="Hans" typeface="\u5B8B\u4F53"/> <a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF"/> <a:font script="Hang" typeface="\uB9D1\uC740 \uACE0\uB515"/> <a:font script="Hans" typeface="\u5B8B\u4F53"/> <a:font script="Hant" typeface="\u65B0\u7D30\u660E\u9AD4"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:prstDash val="solid"/> </a:ln> </a:lnStyleLst> <a:effectStyleLst> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="38000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> </a:effectStyle> <a:effectStyle> <a:effectLst> <a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"> <a:srgbClr val="000000"> <a:alpha val="35000"/> </a:srgbClr> </a:outerShdw> </a:effectLst> <a:scene3d> <a:camera prst="orthographicFront"> <a:rot lat="0" lon="0" rev="0"/> </a:camera> <a:lightRig rig="threePt" dir="t"> <a:rot lat="0" lon="0" rev="1200000"/> </a:lightRig> </a:scene3d> <a:sp3d> <a:bevelT w="63500" h="25400"/> </a:sp3d> </a:effectStyle> </a:effectStyleLst> <a:bgFillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="40000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="40000"> <a:schemeClr val="phClr"> <a:tint val="45000"/> <a:shade val="99000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="20000"/> <a:satMod val="255000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="-80000" r="50000" b="180000"/> </a:path> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="80000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:shade val="30000"/> <a:satMod val="200000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:path path="circle"> <a:fillToRect l="50000" t="50000" r="50000" b="50000"/> </a:path> </a:gradFill> </a:bgFillStyleLst> </a:fmtScheme> </a:themeElements> <a:objectDefaults> <a:spDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="1"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="3"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="2"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="lt1"/> </a:fontRef> </a:style> </a:spDef> <a:lnDef> <a:spPr/> <a:bodyPr/> <a:lstStyle/> <a:style> <a:lnRef idx="2"> <a:schemeClr val="accent1"/> </a:lnRef> <a:fillRef idx="0"> <a:schemeClr val="accent1"/> </a:fillRef> <a:effectRef idx="1"> <a:schemeClr val="accent1"/> </a:effectRef> <a:fontRef idx="minor"> <a:schemeClr val="tx1"/> </a:fontRef> </a:style> </a:lnDef> </a:objectDefaults> <a:extraClrSchemeLst/> </a:theme>`},{}],146:[function(e,p,b){(function(c){(function(){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CsvFormatterStream=void 0;let i=e("stream"),a=e("./formatter");class r extends i.Transform{constructor(n){super({writableObjectMode:n.objectMode}),this.hasWrittenBOM=!1,this.formatterOptions=n,this.rowFormatter=new a.RowFormatter(n),this.hasWrittenBOM=!n.writeBOM}transform(n){return this.rowFormatter.rowTransform=n,this}_transform(n,l,o){let s=!1;try{this.hasWrittenBOM||(this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0),this.rowFormatter.format(n,(f,d)=>f?(s=!0,o(f)):(d&&d.forEach(u=>{this.push(c.from(u,"utf8"))}),s=!0,o()))}catch(f){if(s)throw f;o(f)}}_flush(n){this.rowFormatter.finish((l,o)=>l?n(l):(o&&o.forEach(s=>{this.push(c.from(s,"utf8"))}),n()))}}b.CsvFormatterStream=r}).call(this)}).call(this,e("buffer").Buffer)},{"./formatter":150,buffer:220,stream:505}],147:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.FormatterOptions=void 0,b.FormatterOptions=class{constructor(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var i;this.objectMode=!0,this.delimiter=",",this.rowDelimiter=`
4
+ `,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,c||{}),c?.quoteHeaders===void 0&&(this.quoteHeaders=this.quoteColumns),c?.quote===!0?this.quote='"':c?.quote===!1&&(this.quote=""),typeof c?.escape!="string"&&(this.escape=this.quote),this.shouldWriteHeaders=!!this.headers&&((i=c.writeHeaders)===null||i===void 0||i),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}},{}],148:[function(e,p,b){"use strict";var c=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(b,"__esModule",{value:!0}),b.FieldFormatter=void 0;let i=c(e("lodash.isboolean")),a=c(e("lodash.isnil")),r=c(e("lodash.escaperegexp"));b.FieldFormatter=class{constructor(t){this._headers=null,this.formatterOptions=t,t.headers!==null&&(this.headers=t.headers),this.REPLACE_REGEXP=new RegExp(t.quote,"g");let n=`[${t.delimiter}${r.default(t.rowDelimiter)}|\r|
5
+ ]`;this.ESCAPE_REGEXP=new RegExp(n)}set headers(t){this._headers=t}shouldQuote(t,n){let l=n?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;return i.default(l)?l:Array.isArray(l)?l[t]:this._headers!==null&&l[this._headers[t]]}format(t,n,l){let o=(""+(a.default(t)?"":t)).replace(/\0/g,""),{formatterOptions:s}=this;return s.quote!==""&&o.indexOf(s.quote)!==-1?this.quoteField(o.replace(this.REPLACE_REGEXP,s.escapedQuote)):o.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(n,l)?this.quoteField(o):o}quoteField(t){let{quote:n}=this.formatterOptions;return`${n}${t}${n}`}}},{"lodash.escaperegexp":442,"lodash.isboolean":444,"lodash.isnil":447}],149:[function(e,p,b){"use strict";var c=function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(b,"__esModule",{value:!0}),b.RowFormatter=void 0;let i=c(e("lodash.isfunction")),a=c(e("lodash.isequal")),r=e("./FieldFormatter"),t=e("../types");class n{constructor(o){this.rowCount=0,this.formatterOptions=o,this.fieldFormatter=new r.FieldFormatter(o),this.headers=o.headers,this.shouldWriteHeaders=o.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null&&(this.fieldFormatter.headers=this.headers),o.transform&&(this.rowTransform=o.transform)}static isRowHashArray(o){return!!Array.isArray(o)&&Array.isArray(o[0])&&o[0].length===2}static isRowArray(o){return Array.isArray(o)&&!this.isRowHashArray(o)}static gatherHeaders(o){return n.isRowHashArray(o)?o.map(s=>s[0]):Array.isArray(o)?o:Object.keys(o)}static createTransform(o){return t.isSyncTransform(o)?(s,f)=>{let d=null;try{d=o(s)}catch(u){return f(u)}return f(null,d)}:(s,f)=>{o(s,f)}}set rowTransform(o){if(!i.default(o))throw new TypeError("The transform should be a function");this._rowTransform=n.createTransform(o)}format(o,s){this.callTransformer(o,(f,d)=>{if(f)return s(f);if(!o)return s(null);let u=[];if(d){let{shouldFormatColumns:g,headers:m}=this.checkHeaders(d);if(this.shouldWriteHeaders&&m&&!this.hasWrittenHeaders&&(u.push(this.formatColumns(m,!0)),this.hasWrittenHeaders=!0),g){let v=this.gatherColumns(d);u.push(this.formatColumns(v,!1))}}return s(null,u)})}finish(o){let s=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return o(new Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));s.push(this.formatColumns(this.headers,!0))}return this.formatterOptions.includeEndRowDelimiter&&s.push(this.formatterOptions.rowDelimiter),o(null,s)}checkHeaders(o){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let s=n.gatherHeaders(o);return this.headers=s,this.fieldFormatter.headers=s,this.shouldWriteHeaders?{shouldFormatColumns:!a.default(s,o),headers:s}:{shouldFormatColumns:!0,headers:null}}gatherColumns(o){if(this.headers===null)throw new Error("Headers is currently null");return Array.isArray(o)?n.isRowHashArray(o)?this.headers.map((s,f)=>{let d=o[f];return d?d[1]:""}):n.isRowArray(o)&&!this.shouldWriteHeaders?o:this.headers.map((s,f)=>o[f]):this.headers.map(s=>o[s])}callTransformer(o,s){return this._rowTransform?this._rowTransform(o,s):s(null,o)}formatColumns(o,s){let f=o.map((u,g)=>this.fieldFormatter.format(u,g,s)).join(this.formatterOptions.delimiter),{rowCount:d}=this;return this.rowCount+=1,d?[this.formatterOptions.rowDelimiter,f].join(""):f}}b.RowFormatter=n},{"../types":152,"./FieldFormatter":148,"lodash.isequal":445,"lodash.isfunction":446}],150:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.FieldFormatter=b.RowFormatter=void 0;var c=e("./RowFormatter");Object.defineProperty(b,"RowFormatter",{enumerable:!0,get:function(){return c.RowFormatter}});var i=e("./FieldFormatter");Object.defineProperty(b,"FieldFormatter",{enumerable:!0,get:function(){return i.FieldFormatter}})},{"./FieldFormatter":148,"./RowFormatter":149}],151:[function(e,p,b){(function(c){(function(){"use strict";var i=Object.create?function(g,m,v,k){k===void 0&&(k=v),Object.defineProperty(g,k,{enumerable:!0,get:function(){return m[v]}})}:function(g,m,v,k){k===void 0&&(k=v),g[k]=m[v]},a=Object.create?function(g,m){Object.defineProperty(g,"default",{enumerable:!0,value:m})}:function(g,m){g.default=m},r=function(g){if(g&&g.__esModule)return g;var m={};if(g!=null)for(var v in g)v!=="default"&&Object.prototype.hasOwnProperty.call(g,v)&&i(m,g,v);return a(m,g),m},t=function(g,m){for(var v in g)v==="default"||Object.prototype.hasOwnProperty.call(m,v)||i(m,g,v)};Object.defineProperty(b,"__esModule",{value:!0}),b.writeToPath=b.writeToString=b.writeToBuffer=b.writeToStream=b.write=b.format=b.FormatterOptions=b.CsvFormatterStream=void 0;let n=e("util"),l=e("stream"),o=r(e("fs")),s=e("./FormatterOptions"),f=e("./CsvFormatterStream");t(e("./types"),b);var d=e("./CsvFormatterStream");Object.defineProperty(b,"CsvFormatterStream",{enumerable:!0,get:function(){return d.CsvFormatterStream}});var u=e("./FormatterOptions");Object.defineProperty(b,"FormatterOptions",{enumerable:!0,get:function(){return u.FormatterOptions}}),b.format=g=>new f.CsvFormatterStream(new s.FormatterOptions(g)),b.write=(g,m)=>{let v=b.format(m),k=n.promisify((B,O)=>{v.write(B,void 0,O)});return g.reduce((B,O)=>B.then(()=>k(O)),Promise.resolve()).then(()=>v.end()).catch(B=>{v.emit("error",B)}),v},b.writeToStream=(g,m,v)=>b.write(m,v).pipe(g),b.writeToBuffer=function(g){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=[],k=new l.Writable({write(B,O,L){v.push(B),L()}});return new Promise((B,O)=>{k.on("error",O).on("finish",()=>B(c.concat(v))),b.write(g,m).pipe(k)})},b.writeToString=(g,m)=>b.writeToBuffer(g,m).then(v=>v.toString()),b.writeToPath=(g,m,v)=>{let k=o.createWriteStream(g,{encoding:"utf8"});return b.write(m,v).pipe(k)}}).call(this)}).call(this,e("buffer").Buffer)},{"./CsvFormatterStream":146,"./FormatterOptions":147,"./types":152,buffer:220,fs:216,stream:505,util:527}],152:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.isSyncTransform=void 0,b.isSyncTransform=c=>c.length===1},{}],153:[function(e,p,b){(function(c){(function(){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CsvParserStream=void 0;let i=e("string_decoder"),a=e("stream"),r=e("./transforms"),t=e("./parser");class n extends a.Transform{constructor(o){super({objectMode:o.objectMode}),this.lines="",this.rowCount=0,this.parsedRowCount=0,this.parsedLineCount=0,this.endEmitted=!1,this.headersEmitted=!1,this.parserOptions=o,this.parser=new t.Parser(o),this.headerTransformer=new r.HeaderTransformer(o),this.decoder=new i.StringDecoder(o.encoding),this.rowTransformerValidator=new r.RowTransformerValidator}get hasHitRowLimit(){return this.parserOptions.limitRows&&this.rowCount>=this.parserOptions.maxRows}get shouldEmitRows(){return this.parsedRowCount>this.parserOptions.skipRows}get shouldSkipLine(){return this.parsedLineCount<=this.parserOptions.skipLines}transform(o){return this.rowTransformerValidator.rowTransform=o,this}validate(o){return this.rowTransformerValidator.rowValidator=o,this}emit(o){if(o==="end")return this.endEmitted||(this.endEmitted=!0,super.emit("end",this.rowCount)),!1;for(var s=arguments.length,f=new Array(s>1?s-1:0),d=1;d<s;d++)f[d-1]=arguments[d];return super.emit(o,...f)}_transform(o,s,f){if(this.hasHitRowLimit)return f();let d=n.wrapDoneCallback(f);try{let{lines:u}=this,g=u+this.decoder.write(o),m=this.parse(g,!0);return this.processRows(m,d)}catch(u){return d(u)}}_flush(o){let s=n.wrapDoneCallback(o);if(this.hasHitRowLimit)return s();try{let f=this.lines+this.decoder.end(),d=this.parse(f,!1);return this.processRows(d,s)}catch(f){return s(f)}}parse(o,s){if(!o)return[];let{line:f,rows:d}=this.parser.parse(o,s);return this.lines=f,d}processRows(o,s){let f=o.length,d=u=>{let g=k=>k?s(k):u%100!=0?d(u+1):void c(()=>d(u+1));if(this.checkAndEmitHeaders(),u>=f||this.hasHitRowLimit)return s();if(this.parsedLineCount+=1,this.shouldSkipLine)return g();let m=o[u];this.rowCount+=1,this.parsedRowCount+=1;let v=this.rowCount;return this.transformRow(m,(k,B)=>{if(k)return this.rowCount-=1,g(k);if(!B)return g(new Error("expected transform result"));if(B.isValid){if(B.row)return this.pushRow(B.row,g)}else this.emit("data-invalid",B.row,v,B.reason);return g()})};d(0)}transformRow(o,s){try{this.headerTransformer.transform(o,(f,d)=>f?s(f):d?d.isValid?d.row?this.shouldEmitRows?this.rowTransformerValidator.transformAndValidate(d.row,s):this.skipRow(s):(this.rowCount-=1,this.parsedRowCount-=1,s(null,{row:null,isValid:!0})):this.shouldEmitRows?s(null,{isValid:!1,row:o}):this.skipRow(s):s(new Error("Expected result from header transform")))}catch(f){s(f)}}checkAndEmitHeaders(){!this.headersEmitted&&this.headerTransformer.headers&&(this.headersEmitted=!0,this.emit("headers",this.headerTransformer.headers))}skipRow(o){return this.rowCount-=1,o(null,{row:null,isValid:!0})}pushRow(o,s){try{this.parserOptions.objectMode?this.push(o):this.push(JSON.stringify(o)),s()}catch(f){s(f)}}static wrapDoneCallback(o){let s=!1;return function(f){if(f){if(s)throw f;return s=!0,void o(f)}for(var d=arguments.length,u=new Array(d>1?d-1:0),g=1;g<d;g++)u[g-1]=arguments[g];o(...u)}}}b.CsvParserStream=n}).call(this)}).call(this,e("timers").setImmediate)},{"./parser":165,"./transforms":168,stream:505,string_decoder:218,timers:523}],154:[function(e,p,b){"use strict";var c=function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(b,"__esModule",{value:!0}),b.ParserOptions=void 0;let i=c(e("lodash.escaperegexp")),a=c(e("lodash.isnil"));b.ParserOptions=class{constructor(r){var t;if(this.objectMode=!0,this.delimiter=",",this.ignoreEmpty=!1,this.quote='"',this.escape=null,this.escapeChar=this.quote,this.comment=null,this.supportsComments=!1,this.ltrim=!1,this.rtrim=!1,this.trim=!1,this.headers=null,this.renameHeaders=!1,this.strictColumnHandling=!1,this.discardUnmappedColumns=!1,this.carriageReturn="\r",this.encoding="utf8",this.limitRows=!1,this.maxRows=0,this.skipLines=0,this.skipRows=0,Object.assign(this,r||{}),this.delimiter.length>1)throw new Error("delimiter option must be one character long");this.escapedDelimiter=i.default(this.delimiter),this.escapeChar=(t=this.escape)!==null&&t!==void 0?t:this.quote,this.supportsComments=!a.default(this.comment),this.NEXT_TOKEN_REGEXP=new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`),this.maxRows>0&&(this.limitRows=!0)}}},{"lodash.escaperegexp":442,"lodash.isnil":447}],155:[function(e,p,b){"use strict";var c=Object.create?function(d,u,g,m){m===void 0&&(m=g),Object.defineProperty(d,m,{enumerable:!0,get:function(){return u[g]}})}:function(d,u,g,m){m===void 0&&(m=g),d[m]=u[g]},i=Object.create?function(d,u){Object.defineProperty(d,"default",{enumerable:!0,value:u})}:function(d,u){d.default=u},a=function(d){if(d&&d.__esModule)return d;var u={};if(d!=null)for(var g in d)g!=="default"&&Object.prototype.hasOwnProperty.call(d,g)&&c(u,d,g);return i(u,d),u},r=function(d,u){for(var g in d)g==="default"||Object.prototype.hasOwnProperty.call(u,g)||c(u,d,g)};Object.defineProperty(b,"__esModule",{value:!0}),b.parseString=b.parseFile=b.parseStream=b.parse=b.ParserOptions=b.CsvParserStream=void 0;let t=a(e("fs")),n=e("stream"),l=e("./ParserOptions"),o=e("./CsvParserStream");r(e("./types"),b);var s=e("./CsvParserStream");Object.defineProperty(b,"CsvParserStream",{enumerable:!0,get:function(){return s.CsvParserStream}});var f=e("./ParserOptions");Object.defineProperty(b,"ParserOptions",{enumerable:!0,get:function(){return f.ParserOptions}}),b.parse=d=>new o.CsvParserStream(new l.ParserOptions(d)),b.parseStream=(d,u)=>d.pipe(new o.CsvParserStream(new l.ParserOptions(u))),b.parseFile=function(d){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.createReadStream(d).pipe(new o.CsvParserStream(new l.ParserOptions(u)))},b.parseString=(d,u)=>{let g=new n.Readable;return g.push(d),g.push(null),g.pipe(new o.CsvParserStream(new l.ParserOptions(u)))}},{"./CsvParserStream":153,"./ParserOptions":154,"./types":169,fs:216,stream:505}],156:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Parser=void 0;let c=e("./Scanner"),i=e("./RowParser"),a=e("./Token");class r{constructor(n){this.parserOptions=n,this.rowParser=new i.RowParser(this.parserOptions)}static removeBOM(n){return n&&n.charCodeAt(0)===65279?n.slice(1):n}parse(n,l){let o=new c.Scanner({line:r.removeBOM(n),parserOptions:this.parserOptions,hasMoreData:l});return this.parserOptions.supportsComments?this.parseWithComments(o):this.parseWithoutComments(o)}parseWithoutComments(n){let l=[],o=!0;for(;o;)o=this.parseRow(n,l);return{line:n.line,rows:l}}parseWithComments(n){let{parserOptions:l}=this,o=[];for(let s=n.nextCharacterToken;s!==null;s=n.nextCharacterToken)if(a.Token.isTokenComment(s,l)){if(n.advancePastLine()===null)return{line:n.lineFromCursor,rows:o};if(!n.hasMoreCharacters)return{line:n.lineFromCursor,rows:o};n.truncateToCursor()}else if(!this.parseRow(n,o))break;return{line:n.line,rows:o}}parseRow(n,l){if(!n.nextNonSpaceToken)return!1;let o=this.rowParser.parse(n);return o!==null&&(this.parserOptions.ignoreEmpty&&i.RowParser.isEmptyRow(o)||l.push(o),!0)}}b.Parser=r},{"./RowParser":157,"./Scanner":158,"./Token":159}],157:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.RowParser=void 0;let c=e("./column"),i=e("./Token");b.RowParser=class{constructor(a){this.parserOptions=a,this.columnParser=new c.ColumnParser(a)}static isEmptyRow(a){return a.join("").replace(/\s+/g,"")===""}parse(a){let{parserOptions:r}=this,{hasMoreData:t}=a,n=a,l=[],o=this.getStartToken(n,l);for(;o;){if(i.Token.isTokenRowDelimiter(o))return n.advancePastToken(o),!n.hasMoreCharacters&&i.Token.isTokenCarriageReturn(o,r)&&t?null:(n.truncateToCursor(),l);if(!this.shouldSkipColumnParse(n,o,l)){let s=this.columnParser.parse(n);if(s===null)return null;l.push(s)}o=n.nextNonSpaceToken}return t?null:(n.truncateToCursor(),l)}getStartToken(a,r){let t=a.nextNonSpaceToken;return t!==null&&i.Token.isTokenDelimiter(t,this.parserOptions)?(r.push(""),a.nextNonSpaceToken):t}shouldSkipColumnParse(a,r,t){let{parserOptions:n}=this;if(i.Token.isTokenDelimiter(r,n)){a.advancePastToken(r);let l=a.nextCharacterToken;if(!a.hasMoreCharacters||l!==null&&i.Token.isTokenRowDelimiter(l)||l!==null&&i.Token.isTokenDelimiter(l,n))return t.push(""),!0}return!1}}},{"./Token":159,"./column":164}],158:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Scanner=void 0;let c=e("./Token"),i=/((?:\r\n)|\n|\r)/;b.Scanner=class{constructor(a){this.cursor=0,this.line=a.line,this.lineLength=this.line.length,this.parserOptions=a.parserOptions,this.hasMoreData=a.hasMoreData,this.cursor=a.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:a}=this,r=this.parserOptions.NEXT_TOKEN_REGEXP;if(a.search(r)===-1)return null;let t=r.exec(a);if(t==null)return null;let n=t[1],l=this.cursor+(t.index||0);return new c.Token({token:n,startCursor:l,endCursor:l+n.length-1})}get nextCharacterToken(){let{cursor:a,lineLength:r}=this;return r<=a?null:new c.Token({token:this.line[a],startCursor:a,endCursor:a})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let a=i.exec(this.lineFromCursor);return a?(this.cursor+=(a.index||0)+a[0].length,this):this.hasMoreData?null:(this.cursor=this.lineLength,this)}advanceTo(a){return this.cursor=a,this}advanceToToken(a){return this.cursor=a.startCursor,this}advancePastToken(a){return this.cursor=a.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}},{"./Token":159}],159:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Token=void 0,b.Token=class{constructor(c){this.token=c.token,this.startCursor=c.startCursor,this.endCursor=c.endCursor}static isTokenRowDelimiter(c){let i=c.token;return i==="\r"||i===`
6
+ `||i===`\r
7
+ `}static isTokenCarriageReturn(c,i){return c.token===i.carriageReturn}static isTokenComment(c,i){return i.supportsComments&&!!c&&c.token===i.comment}static isTokenEscapeCharacter(c,i){return c.token===i.escapeChar}static isTokenQuote(c,i){return c.token===i.quote}static isTokenDelimiter(c,i){return c.token===i.delimiter}}},{}],160:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ColumnFormatter=void 0,b.ColumnFormatter=class{constructor(c){c.trim?this.format=i=>i.trim():c.ltrim?this.format=i=>i.trimLeft():c.rtrim?this.format=i=>i.trimRight():this.format=i=>i}}},{}],161:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ColumnParser=void 0;let c=e("./NonQuotedColumnParser"),i=e("./QuotedColumnParser"),a=e("../Token");b.ColumnParser=class{constructor(r){this.parserOptions=r,this.quotedColumnParser=new i.QuotedColumnParser(r),this.nonQuotedColumnParser=new c.NonQuotedColumnParser(r)}parse(r){let{nextNonSpaceToken:t}=r;return t!==null&&a.Token.isTokenQuote(t,this.parserOptions)?(r.advanceToToken(t),this.quotedColumnParser.parse(r)):this.nonQuotedColumnParser.parse(r)}}},{"../Token":159,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],162:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.NonQuotedColumnParser=void 0;let c=e("./ColumnFormatter"),i=e("../Token");b.NonQuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new c.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;let{parserOptions:r}=this,t=[],n=a.nextCharacterToken;for(;n&&!i.Token.isTokenDelimiter(n,r)&&!i.Token.isTokenRowDelimiter(n);n=a.nextCharacterToken)t.push(n.token),a.advancePastToken(n);return this.columnFormatter.format(t.join(""))}}},{"../Token":159,"./ColumnFormatter":160}],163:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.QuotedColumnParser=void 0;let c=e("./ColumnFormatter"),i=e("../Token");b.QuotedColumnParser=class{constructor(a){this.parserOptions=a,this.columnFormatter=new c.ColumnFormatter(a)}parse(a){if(!a.hasMoreCharacters)return null;let r=a.cursor,{foundClosingQuote:t,col:n}=this.gatherDataBetweenQuotes(a);if(!t){if(a.advanceTo(r),!a.hasMoreData)throw new Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${a.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn(a),n}gatherDataBetweenQuotes(a){let{parserOptions:r}=this,t=!1,n=!1,l=[],o=a.nextCharacterToken;for(;!n&&o!==null;o=a.nextCharacterToken){let s=i.Token.isTokenQuote(o,r);if(!t&&s)t=!0;else if(t)if(i.Token.isTokenEscapeCharacter(o,r)){a.advancePastToken(o);let f=a.nextCharacterToken;f!==null&&(i.Token.isTokenQuote(f,r)||i.Token.isTokenEscapeCharacter(f,r))?(l.push(f.token),o=f):s?n=!0:l.push(o.token)}else s?n=!0:l.push(o.token);a.advancePastToken(o)}return{col:this.columnFormatter.format(l.join("")),foundClosingQuote:n}}checkForMalformedColumn(a){let{parserOptions:r}=this,{nextNonSpaceToken:t}=a;if(t){let n=i.Token.isTokenDelimiter(t,r),l=i.Token.isTokenRowDelimiter(t);if(!n&&!l){let o=a.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw new Error(`Parse Error: expected: '${r.escapedDelimiter}' OR new line got: '${t.token}'. at '${o}`)}a.advanceToToken(t)}else a.hasMoreData||a.advancePastLine()}}},{"../Token":159,"./ColumnFormatter":160}],164:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.ColumnFormatter=b.QuotedColumnParser=b.NonQuotedColumnParser=b.ColumnParser=void 0;var c=e("./ColumnParser");Object.defineProperty(b,"ColumnParser",{enumerable:!0,get:function(){return c.ColumnParser}});var i=e("./NonQuotedColumnParser");Object.defineProperty(b,"NonQuotedColumnParser",{enumerable:!0,get:function(){return i.NonQuotedColumnParser}});var a=e("./QuotedColumnParser");Object.defineProperty(b,"QuotedColumnParser",{enumerable:!0,get:function(){return a.QuotedColumnParser}});var r=e("./ColumnFormatter");Object.defineProperty(b,"ColumnFormatter",{enumerable:!0,get:function(){return r.ColumnFormatter}})},{"./ColumnFormatter":160,"./ColumnParser":161,"./NonQuotedColumnParser":162,"./QuotedColumnParser":163}],165:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.QuotedColumnParser=b.NonQuotedColumnParser=b.ColumnParser=b.Token=b.Scanner=b.RowParser=b.Parser=void 0;var c=e("./Parser");Object.defineProperty(b,"Parser",{enumerable:!0,get:function(){return c.Parser}});var i=e("./RowParser");Object.defineProperty(b,"RowParser",{enumerable:!0,get:function(){return i.RowParser}});var a=e("./Scanner");Object.defineProperty(b,"Scanner",{enumerable:!0,get:function(){return a.Scanner}});var r=e("./Token");Object.defineProperty(b,"Token",{enumerable:!0,get:function(){return r.Token}});var t=e("./column");Object.defineProperty(b,"ColumnParser",{enumerable:!0,get:function(){return t.ColumnParser}}),Object.defineProperty(b,"NonQuotedColumnParser",{enumerable:!0,get:function(){return t.NonQuotedColumnParser}}),Object.defineProperty(b,"QuotedColumnParser",{enumerable:!0,get:function(){return t.QuotedColumnParser}})},{"./Parser":156,"./RowParser":157,"./Scanner":158,"./Token":159,"./column":164}],166:[function(e,p,b){"use strict";var c=function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(b,"__esModule",{value:!0}),b.HeaderTransformer=void 0;let i=c(e("lodash.isundefined")),a=c(e("lodash.isfunction")),r=c(e("lodash.uniq")),t=c(e("lodash.groupby"));b.HeaderTransformer=class{constructor(n){this.headers=null,this.receivedHeaders=!1,this.shouldUseFirstRow=!1,this.processedFirstRow=!1,this.headersLength=0,this.parserOptions=n,n.headers===!0?this.shouldUseFirstRow=!0:Array.isArray(n.headers)?this.setHeaders(n.headers):a.default(n.headers)&&(this.headersTransform=n.headers)}transform(n,l){return this.shouldMapRow(n)?l(null,this.processRow(n)):l(null,{row:null,isValid:!0})}shouldMapRow(n){let{parserOptions:l}=this;if(!this.headersTransform&&l.renameHeaders&&!this.processedFirstRow){if(!this.receivedHeaders)throw new Error("Error renaming headers: new headers must be provided in an array");return this.processedFirstRow=!0,!1}if(!this.receivedHeaders&&Array.isArray(n)){if(this.headersTransform)this.setHeaders(this.headersTransform(n));else{if(!this.shouldUseFirstRow)return!0;this.setHeaders(n)}return!1}return!0}processRow(n){if(!this.headers)return{row:n,isValid:!0};let{parserOptions:l}=this;if(!l.discardUnmappedColumns&&n.length>this.headersLength){if(!l.strictColumnHandling)throw new Error(`Unexpected Error: column header mismatch expected: ${this.headersLength} columns got: ${n.length}`);return{row:n,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${n.length}`}}return l.strictColumnHandling&&n.length<this.headersLength?{row:n,isValid:!1,reason:`Column header mismatch expected: ${this.headersLength} columns got: ${n.length}`}:{row:this.mapHeaders(n),isValid:!0}}mapHeaders(n){let l={},{headers:o,headersLength:s}=this;for(let f=0;f<s;f+=1){let d=o[f];if(!i.default(d)){let u=n[f];i.default(u)?l[d]="":l[d]=u}}return l}setHeaders(n){var l;let o=n.filter(s=>!!s);if(r.default(o).length!==o.length){let s=t.default(o),f=Object.keys(s).filter(d=>s[d].length>1);throw new Error("Duplicate headers found "+JSON.stringify(f))}this.headers=n,this.receivedHeaders=!0,this.headersLength=((l=this.headers)===null||l===void 0?void 0:l.length)||0}}},{"lodash.groupby":443,"lodash.isfunction":446,"lodash.isundefined":448,"lodash.uniq":449}],167:[function(e,p,b){"use strict";var c=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(b,"__esModule",{value:!0}),b.RowTransformerValidator=void 0;let i=c(e("lodash.isfunction")),a=e("../types");class r{constructor(){this._rowTransform=null,this._rowValidator=null}static createTransform(n){return a.isSyncTransform(n)?(l,o)=>{let s=null;try{s=n(l)}catch(f){return o(f)}return o(null,s)}:n}static createValidator(n){return a.isSyncValidate(n)?(l,o)=>{o(null,{row:l,isValid:n(l)})}:(l,o)=>{n(l,(s,f,d)=>s?o(s):o(null,f?{row:l,isValid:f,reason:d}:{row:l,isValid:!1,reason:d}))}}set rowTransform(n){if(!i.default(n))throw new TypeError("The transform should be a function");this._rowTransform=r.createTransform(n)}set rowValidator(n){if(!i.default(n))throw new TypeError("The validate should be a function");this._rowValidator=r.createValidator(n)}transformAndValidate(n,l){return this.callTransformer(n,(o,s)=>o?l(o):s?this.callValidator(s,(f,d)=>f?l(f):d&&!d.isValid?l(null,{row:s,isValid:!1,reason:d.reason}):l(null,{row:s,isValid:!0})):l(null,{row:null,isValid:!0}))}callTransformer(n,l){return this._rowTransform?this._rowTransform(n,l):l(null,n)}callValidator(n,l){return this._rowValidator?this._rowValidator(n,l):l(null,{row:n,isValid:!0})}}b.RowTransformerValidator=r},{"../types":169,"lodash.isfunction":446}],168:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.HeaderTransformer=b.RowTransformerValidator=void 0;var c=e("./RowTransformerValidator");Object.defineProperty(b,"RowTransformerValidator",{enumerable:!0,get:function(){return c.RowTransformerValidator}});var i=e("./HeaderTransformer");Object.defineProperty(b,"HeaderTransformer",{enumerable:!0,get:function(){return i.HeaderTransformer}})},{"./HeaderTransformer":166,"./RowTransformerValidator":167}],169:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.isSyncValidate=b.isSyncTransform=void 0,b.isSyncTransform=c=>c.length===1,b.isSyncValidate=c=>c.length===1},{}],170:[function(e,p,b){"use strict";let c=b;c.bignum=e("bn.js"),c.define=e("./asn1/api").define,c.base=e("./asn1/base"),c.constants=e("./asn1/constants"),c.decoders=e("./asn1/decoders"),c.encoders=e("./asn1/encoders")},{"./asn1/api":171,"./asn1/base":173,"./asn1/constants":177,"./asn1/decoders":179,"./asn1/encoders":182,"bn.js":184}],171:[function(e,p,b){"use strict";let c=e("./encoders"),i=e("./decoders"),a=e("inherits");function r(t,n){this.name=t,this.body=n,this.decoders={},this.encoders={}}b.define=function(t,n){return new r(t,n)},r.prototype._createNamed=function(t){let n=this.name;function l(o){this._initNamed(o,n)}return a(l,t),l.prototype._initNamed=function(o,s){t.call(this,o,s)},new l(this)},r.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},r.prototype.decode=function(t,n,l){return this._getDecoder(n).decode(t,l)},r.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(c[t])),this.encoders[t]},r.prototype.encode=function(t,n,l){return this._getEncoder(n).encode(t,l)}},{"./decoders":179,"./encoders":182,inherits:440}],172:[function(e,p,b){"use strict";let c=e("inherits"),i=e("../base/reporter").Reporter,a=e("safer-buffer").Buffer;function r(n,l){i.call(this,l),a.isBuffer(n)?(this.base=n,this.offset=0,this.length=n.length):this.error("Input not Buffer")}function t(n,l){if(Array.isArray(n))this.length=0,this.value=n.map((function(o){return t.isEncoderBuffer(o)||(o=new t(o,l)),this.length+=o.length,o}),this);else if(typeof n=="number"){if(!(0<=n&&n<=255))return l.error("non-byte EncoderBuffer value");this.value=n,this.length=1}else if(typeof n=="string")this.value=n,this.length=a.byteLength(n);else{if(!a.isBuffer(n))return l.error("Unsupported type: "+typeof n);this.value=n,this.length=n.length}}c(r,i),b.DecoderBuffer=r,r.isDecoderBuffer=function(n){return n instanceof r?!0:typeof n=="object"&&a.isBuffer(n.base)&&n.constructor.name==="DecoderBuffer"&&typeof n.offset=="number"&&typeof n.length=="number"&&typeof n.save=="function"&&typeof n.restore=="function"&&typeof n.isEmpty=="function"&&typeof n.readUInt8=="function"&&typeof n.skip=="function"&&typeof n.raw=="function"},r.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},r.prototype.restore=function(n){let l=new r(this.base);return l.offset=n.offset,l.length=this.offset,this.offset=n.offset,i.prototype.restore.call(this,n.reporter),l},r.prototype.isEmpty=function(){return this.offset===this.length},r.prototype.readUInt8=function(n){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(n||"DecoderBuffer overrun")},r.prototype.skip=function(n,l){if(!(this.offset+n<=this.length))return this.error(l||"DecoderBuffer overrun");let o=new r(this.base);return o._reporterState=this._reporterState,o.offset=this.offset,o.length=this.offset+n,this.offset+=n,o},r.prototype.raw=function(n){return this.base.slice(n?n.offset:this.offset,this.length)},b.EncoderBuffer=t,t.isEncoderBuffer=function(n){return n instanceof t?!0:typeof n=="object"&&n.constructor.name==="EncoderBuffer"&&typeof n.length=="number"&&typeof n.join=="function"},t.prototype.join=function(n,l){return n||(n=a.alloc(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach((function(o){o.join(n,l),l+=o.length})):(typeof this.value=="number"?n[l]=this.value:typeof this.value=="string"?n.write(this.value,l):a.isBuffer(this.value)&&this.value.copy(n,l),l+=this.length)),n}},{"../base/reporter":175,inherits:440,"safer-buffer":495}],173:[function(e,p,b){"use strict";let c=b;c.Reporter=e("./reporter").Reporter,c.DecoderBuffer=e("./buffer").DecoderBuffer,c.EncoderBuffer=e("./buffer").EncoderBuffer,c.Node=e("./node")},{"./buffer":172,"./node":174,"./reporter":175}],174:[function(e,p,b){"use strict";let c=e("../base/reporter").Reporter,i=e("../base/buffer").EncoderBuffer,a=e("../base/buffer").DecoderBuffer,r=e("minimalistic-assert"),t=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],n=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(t);function l(s,f,d){let u={};this._baseState=u,u.name=d,u.enc=s,u.parent=f||null,u.children=null,u.tag=null,u.args=null,u.reverseArgs=null,u.choice=null,u.optional=!1,u.any=!1,u.obj=!1,u.use=null,u.useDecoder=null,u.key=null,u.default=null,u.explicit=null,u.implicit=null,u.contains=null,u.parent||(u.children=[],this._wrap())}p.exports=l;let o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){let s=this._baseState,f={};o.forEach((function(u){f[u]=s[u]}));let d=new this.constructor(f.parent);return d._baseState=f,d},l.prototype._wrap=function(){let s=this._baseState;n.forEach((function(f){this[f]=function(){let d=new this.constructor(this);return s.children.push(d),d[f].apply(d,arguments)}}),this)},l.prototype._init=function(s){let f=this._baseState;r(f.parent===null),s.call(this),f.children=f.children.filter((function(d){return d._baseState.parent===this}),this),r.equal(f.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(s){let f=this._baseState,d=s.filter((function(u){return u instanceof this.constructor}),this);s=s.filter((function(u){return!(u instanceof this.constructor)}),this),d.length!==0&&(r(f.children===null),f.children=d,d.forEach((function(u){u._baseState.parent=this}),this)),s.length!==0&&(r(f.args===null),f.args=s,f.reverseArgs=s.map((function(u){if(typeof u!="object"||u.constructor!==Object)return u;let g={};return Object.keys(u).forEach((function(m){m==(0|m)&&(m|=0);let v=u[m];g[v]=m})),g})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(s){l.prototype[s]=function(){let f=this._baseState;throw new Error(s+" not implemented for encoding: "+f.enc)}})),t.forEach((function(s){l.prototype[s]=function(){let f=this._baseState,d=Array.prototype.slice.call(arguments);return r(f.tag===null),f.tag=s,this._useArgs(d),this}})),l.prototype.use=function(s){r(s);let f=this._baseState;return r(f.use===null),f.use=s,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(s){let f=this._baseState;return r(f.default===null),f.default=s,f.optional=!0,this},l.prototype.explicit=function(s){let f=this._baseState;return r(f.explicit===null&&f.implicit===null),f.explicit=s,this},l.prototype.implicit=function(s){let f=this._baseState;return r(f.explicit===null&&f.implicit===null),f.implicit=s,this},l.prototype.obj=function(){let s=this._baseState,f=Array.prototype.slice.call(arguments);return s.obj=!0,f.length!==0&&this._useArgs(f),this},l.prototype.key=function(s){let f=this._baseState;return r(f.key===null),f.key=s,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(s){let f=this._baseState;return r(f.choice===null),f.choice=s,this._useArgs(Object.keys(s).map((function(d){return s[d]}))),this},l.prototype.contains=function(s){let f=this._baseState;return r(f.use===null),f.contains=s,this},l.prototype._decode=function(s,f){let d=this._baseState;if(d.parent===null)return s.wrapResult(d.children[0]._decode(s,f));let u,g=d.default,m=!0,v=null;if(d.key!==null&&(v=s.enterKey(d.key)),d.optional){let k=null;if(d.explicit!==null?k=d.explicit:d.implicit!==null?k=d.implicit:d.tag!==null&&(k=d.tag),k!==null||d.any){if(m=this._peekTag(s,k,d.any),s.isError(m))return m}else{let B=s.save();try{d.choice===null?this._decodeGeneric(d.tag,s,f):this._decodeChoice(s,f),m=!0}catch{m=!1}s.restore(B)}}if(d.obj&&m&&(u=s.enterObject()),m){if(d.explicit!==null){let B=this._decodeTag(s,d.explicit);if(s.isError(B))return B;s=B}let k=s.offset;if(d.use===null&&d.choice===null){let B;d.any&&(B=s.save());let O=this._decodeTag(s,d.implicit!==null?d.implicit:d.tag,d.any);if(s.isError(O))return O;d.any?g=s.raw(B):s=O}if(f&&f.track&&d.tag!==null&&f.track(s.path(),k,s.length,"tagged"),f&&f.track&&d.tag!==null&&f.track(s.path(),s.offset,s.length,"content"),d.any||(g=d.choice===null?this._decodeGeneric(d.tag,s,f):this._decodeChoice(s,f)),s.isError(g))return g;if(d.any||d.choice!==null||d.children===null||d.children.forEach((function(B){B._decode(s,f)})),d.contains&&(d.tag==="octstr"||d.tag==="bitstr")){let B=new a(g);g=this._getUse(d.contains,s._reporterState.obj)._decode(B,f)}}return d.obj&&m&&(g=s.leaveObject(u)),d.key===null||g===null&&m!==!0?v!==null&&s.exitKey(v):s.leaveKey(v,d.key,g),g},l.prototype._decodeGeneric=function(s,f,d){let u=this._baseState;return s==="seq"||s==="set"?null:s==="seqof"||s==="setof"?this._decodeList(f,s,u.args[0],d):/str$/.test(s)?this._decodeStr(f,s,d):s==="objid"&&u.args?this._decodeObjid(f,u.args[0],u.args[1],d):s==="objid"?this._decodeObjid(f,null,null,d):s==="gentime"||s==="utctime"?this._decodeTime(f,s,d):s==="null_"?this._decodeNull(f,d):s==="bool"?this._decodeBool(f,d):s==="objDesc"?this._decodeStr(f,s,d):s==="int"||s==="enum"?this._decodeInt(f,u.args&&u.args[0],d):u.use!==null?this._getUse(u.use,f._reporterState.obj)._decode(f,d):f.error("unknown tag: "+s)},l.prototype._getUse=function(s,f){let d=this._baseState;return d.useDecoder=this._use(s,f),r(d.useDecoder._baseState.parent===null),d.useDecoder=d.useDecoder._baseState.children[0],d.implicit!==d.useDecoder._baseState.implicit&&(d.useDecoder=d.useDecoder.clone(),d.useDecoder._baseState.implicit=d.implicit),d.useDecoder},l.prototype._decodeChoice=function(s,f){let d=this._baseState,u=null,g=!1;return Object.keys(d.choice).some((function(m){let v=s.save(),k=d.choice[m];try{let B=k._decode(s,f);if(s.isError(B))return!1;u={type:m,value:B},g=!0}catch{return s.restore(v),!1}return!0}),this),g?u:s.error("Choice not matched")},l.prototype._createEncoderBuffer=function(s){return new i(s,this.reporter)},l.prototype._encode=function(s,f,d){let u=this._baseState;if(u.default!==null&&u.default===s)return;let g=this._encodeValue(s,f,d);return g===void 0||this._skipDefault(g,f,d)?void 0:g},l.prototype._encodeValue=function(s,f,d){let u=this._baseState;if(u.parent===null)return u.children[0]._encode(s,f||new c);let g=null;if(this.reporter=f,u.optional&&s===void 0){if(u.default===null)return;s=u.default}let m=null,v=!1;if(u.any)g=this._createEncoderBuffer(s);else if(u.choice)g=this._encodeChoice(s,f);else if(u.contains)m=this._getUse(u.contains,d)._encode(s,f),v=!0;else if(u.children)m=u.children.map((function(k){if(k._baseState.tag==="null_")return k._encode(null,f,s);if(k._baseState.key===null)return f.error("Child should have a key");let B=f.enterKey(k._baseState.key);if(typeof s!="object")return f.error("Child expected, but input is not object");let O=k._encode(s[k._baseState.key],f,s);return f.leaveKey(B),O}),this).filter((function(k){return k})),m=this._createEncoderBuffer(m);else if(u.tag==="seqof"||u.tag==="setof"){if(!u.args||u.args.length!==1)return f.error("Too many args for : "+u.tag);if(!Array.isArray(s))return f.error("seqof/setof, but data is not Array");let k=this.clone();k._baseState.implicit=null,m=this._createEncoderBuffer(s.map((function(B){let O=this._baseState;return this._getUse(O.args[0],s)._encode(B,f)}),k))}else u.use!==null?g=this._getUse(u.use,d)._encode(s,f):(m=this._encodePrimitive(u.tag,s),v=!0);if(!u.any&&u.choice===null){let k=u.implicit!==null?u.implicit:u.tag,B=u.implicit===null?"universal":"context";k===null?u.use===null&&f.error("Tag could be omitted only for .use()"):u.use===null&&(g=this._encodeComposite(k,v,B,m))}return u.explicit!==null&&(g=this._encodeComposite(u.explicit,!1,"context",g)),g},l.prototype._encodeChoice=function(s,f){let d=this._baseState,u=d.choice[s.type];return u||r(!1,s.type+" not found in "+JSON.stringify(Object.keys(d.choice))),u._encode(s.value,f)},l.prototype._encodePrimitive=function(s,f){let d=this._baseState;if(/str$/.test(s))return this._encodeStr(f,s);if(s==="objid"&&d.args)return this._encodeObjid(f,d.reverseArgs[0],d.args[1]);if(s==="objid")return this._encodeObjid(f,null,null);if(s==="gentime"||s==="utctime")return this._encodeTime(f,s);if(s==="null_")return this._encodeNull();if(s==="int"||s==="enum")return this._encodeInt(f,d.args&&d.reverseArgs[0]);if(s==="bool")return this._encodeBool(f);if(s==="objDesc")return this._encodeStr(f,s);throw new Error("Unsupported tag: "+s)},l.prototype._isNumstr=function(s){return/^[0-9 ]*$/.test(s)},l.prototype._isPrintstr=function(s){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(s)}},{"../base/buffer":172,"../base/reporter":175,"minimalistic-assert":453}],175:[function(e,p,b){"use strict";let c=e("inherits");function i(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}function a(r,t){this.path=r,this.rethrow(t)}b.Reporter=i,i.prototype.isError=function(r){return r instanceof a},i.prototype.save=function(){let r=this._reporterState;return{obj:r.obj,pathLen:r.path.length}},i.prototype.restore=function(r){let t=this._reporterState;t.obj=r.obj,t.path=t.path.slice(0,r.pathLen)},i.prototype.enterKey=function(r){return this._reporterState.path.push(r)},i.prototype.exitKey=function(r){let t=this._reporterState;t.path=t.path.slice(0,r-1)},i.prototype.leaveKey=function(r,t,n){let l=this._reporterState;this.exitKey(r),l.obj!==null&&(l.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){let r=this._reporterState,t=r.obj;return r.obj={},t},i.prototype.leaveObject=function(r){let t=this._reporterState,n=t.obj;return t.obj=r,n},i.prototype.error=function(r){let t,n=this._reporterState,l=r instanceof a;if(t=l?r:new a(n.path.map((function(o){return"["+JSON.stringify(o)+"]"})).join(""),r.message||r,r.stack),!n.options.partial)throw t;return l||n.errors.push(t),t},i.prototype.wrapResult=function(r){let t=this._reporterState;return t.options.partial?{result:this.isError(r)?null:r,errors:t.errors}:r},c(a,Error),a.prototype.rethrow=function(r){if(this.message=r+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:440}],176:[function(e,p,b){"use strict";function c(i){let a={};return Object.keys(i).forEach((function(r){(0|r)==r&&(r|=0);let t=i[r];a[t]=r})),a}b.tagClass={0:"universal",1:"application",2:"context",3:"private"},b.tagClassByName=c(b.tagClass),b.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},b.tagByName=c(b.tag)},{}],177:[function(e,p,b){"use strict";let c=b;c._reverse=function(i){let a={};return Object.keys(i).forEach((function(r){(0|r)==r&&(r|=0);let t=i[r];a[t]=r})),a},c.der=e("./der")},{"./der":176}],178:[function(e,p,b){"use strict";let c=e("inherits"),i=e("bn.js"),a=e("../base/buffer").DecoderBuffer,r=e("../base/node"),t=e("../constants/der");function n(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new l,this.tree._init(f.body)}function l(f){r.call(this,"der",f)}function o(f,d){let u=f.readUInt8(d);if(f.isError(u))return u;let g=t.tagClass[u>>6],m=(32&u)==0;if((31&u)==31){let v=u;for(u=0;(128&v)==128;){if(v=f.readUInt8(d),f.isError(v))return v;u<<=7,u|=127&v}}else u&=31;return{cls:g,primitive:m,tag:u,tagStr:t.tag[u]}}function s(f,d,u){let g=f.readUInt8(u);if(f.isError(g))return g;if(!d&&g===128)return null;if((128&g)==0)return g;let m=127&g;if(m>4)return f.error("length octect is too long");g=0;for(let v=0;v<m;v++){g<<=8;let k=f.readUInt8(u);if(f.isError(k))return k;g|=k}return g}p.exports=n,n.prototype.decode=function(f,d){return a.isDecoderBuffer(f)||(f=new a(f,d)),this.tree._decode(f,d)},c(l,r),l.prototype._peekTag=function(f,d,u){if(f.isEmpty())return!1;let g=f.save(),m=o(f,'Failed to peek tag: "'+d+'"');return f.isError(m)?m:(f.restore(g),m.tag===d||m.tagStr===d||m.tagStr+"of"===d||u)},l.prototype._decodeTag=function(f,d,u){let g=o(f,'Failed to decode tag of "'+d+'"');if(f.isError(g))return g;let m=s(f,g.primitive,'Failed to get length of "'+d+'"');if(f.isError(m))return m;if(!u&&g.tag!==d&&g.tagStr!==d&&g.tagStr+"of"!==d)return f.error('Failed to match tag: "'+d+'"');if(g.primitive||m!==null)return f.skip(m,'Failed to match body of: "'+d+'"');let v=f.save(),k=this._skipUntilEnd(f,'Failed to skip indefinite length body: "'+this.tag+'"');return f.isError(k)?k:(m=f.offset-v.offset,f.restore(v),f.skip(m,'Failed to match body of: "'+d+'"'))},l.prototype._skipUntilEnd=function(f,d){for(;;){let u=o(f,d);if(f.isError(u))return u;let g=s(f,u.primitive,d);if(f.isError(g))return g;let m;if(m=u.primitive||g!==null?f.skip(g):this._skipUntilEnd(f,d),f.isError(m))return m;if(u.tagStr==="end")break}},l.prototype._decodeList=function(f,d,u,g){let m=[];for(;!f.isEmpty();){let v=this._peekTag(f,"end");if(f.isError(v))return v;let k=u.decode(f,"der",g);if(f.isError(k)&&v)break;m.push(k)}return m},l.prototype._decodeStr=function(f,d){if(d==="bitstr"){let u=f.readUInt8();return f.isError(u)?u:{unused:u,data:f.raw()}}if(d==="bmpstr"){let u=f.raw();if(u.length%2==1)return f.error("Decoding of string type: bmpstr length mismatch");let g="";for(let m=0;m<u.length/2;m++)g+=String.fromCharCode(u.readUInt16BE(2*m));return g}if(d==="numstr"){let u=f.raw().toString("ascii");return this._isNumstr(u)?u:f.error("Decoding of string type: numstr unsupported characters")}if(d==="octstr"||d==="objDesc")return f.raw();if(d==="printstr"){let u=f.raw().toString("ascii");return this._isPrintstr(u)?u:f.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(d)?f.raw().toString():f.error("Decoding of string type: "+d+" unsupported")},l.prototype._decodeObjid=function(f,d,u){let g,m=[],v=0,k=0;for(;!f.isEmpty();)k=f.readUInt8(),v<<=7,v|=127&k,(128&k)==0&&(m.push(v),v=0);128&k&&m.push(v);let B=m[0]/40|0,O=m[0]%40;if(g=u?m:[B,O].concat(m.slice(1)),d){let L=d[g.join(" ")];L===void 0&&(L=d[g.join(".")]),L!==void 0&&(g=L)}return g},l.prototype._decodeTime=function(f,d){let u=f.raw().toString(),g,m,v,k,B,O;if(d==="gentime")g=0|u.slice(0,4),m=0|u.slice(4,6),v=0|u.slice(6,8),k=0|u.slice(8,10),B=0|u.slice(10,12),O=0|u.slice(12,14);else{if(d!=="utctime")return f.error("Decoding "+d+" time is not supported yet");g=0|u.slice(0,2),m=0|u.slice(2,4),v=0|u.slice(4,6),k=0|u.slice(6,8),B=0|u.slice(8,10),O=0|u.slice(10,12),g=g<70?2e3+g:1900+g}return Date.UTC(g,m-1,v,k,B,O,0)},l.prototype._decodeNull=function(){return null},l.prototype._decodeBool=function(f){let d=f.readUInt8();return f.isError(d)?d:d!==0},l.prototype._decodeInt=function(f,d){let u=f.raw(),g=new i(u);return d&&(g=d[g.toString(10)]||g),g},l.prototype._use=function(f,d){return typeof f=="function"&&(f=f(d)),f._getDecoder("der").tree}},{"../base/buffer":172,"../base/node":174,"../constants/der":176,"bn.js":184,inherits:440}],179:[function(e,p,b){"use strict";let c=b;c.der=e("./der"),c.pem=e("./pem")},{"./der":178,"./pem":180}],180:[function(e,p,b){"use strict";let c=e("inherits"),i=e("safer-buffer").Buffer,a=e("./der");function r(t){a.call(this,t),this.enc="pem"}c(r,a),p.exports=r,r.prototype.decode=function(t,n){let l=t.toString().split(/[\r\n]+/g),o=n.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,f=-1,d=-1;for(let m=0;m<l.length;m++){let v=l[m].match(s);if(v!==null&&v[2]===o){if(f!==-1){if(v[1]!=="END")break;d=m;break}if(v[1]!=="BEGIN")break;f=m}}if(f===-1||d===-1)throw new Error("PEM section not found for: "+o);let u=l.slice(f+1,d).join("");u.replace(/[^a-z0-9+/=]+/gi,"");let g=i.from(u,"base64");return a.prototype.decode.call(this,g,n)}},{"./der":178,inherits:440,"safer-buffer":495}],181:[function(e,p,b){"use strict";let c=e("inherits"),i=e("safer-buffer").Buffer,a=e("../base/node"),r=e("../constants/der");function t(o){this.enc="der",this.name=o.name,this.entity=o,this.tree=new n,this.tree._init(o.body)}function n(o){a.call(this,"der",o)}function l(o){return o<10?"0"+o:o}p.exports=t,t.prototype.encode=function(o,s){return this.tree._encode(o,s).join()},c(n,a),n.prototype._encodeComposite=function(o,s,f,d){let u=(function(v,k,B,O){let L;if(v==="seqof"?v="seq":v==="setof"&&(v="set"),r.tagByName.hasOwnProperty(v))L=r.tagByName[v];else{if(typeof v!="number"||(0|v)!==v)return O.error("Unknown tag: "+v);L=v}return L>=31?O.error("Multi-octet tag encoding unsupported"):(k||(L|=32),L|=r.tagClassByName[B||"universal"]<<6,L)})(o,s,f,this.reporter);if(d.length<128){let v=i.alloc(2);return v[0]=u,v[1]=d.length,this._createEncoderBuffer([v,d])}let g=1;for(let v=d.length;v>=256;v>>=8)g++;let m=i.alloc(2+g);m[0]=u,m[1]=128|g;for(let v=1+g,k=d.length;k>0;v--,k>>=8)m[v]=255&k;return this._createEncoderBuffer([m,d])},n.prototype._encodeStr=function(o,s){if(s==="bitstr")return this._createEncoderBuffer([0|o.unused,o.data]);if(s==="bmpstr"){let f=i.alloc(2*o.length);for(let d=0;d<o.length;d++)f.writeUInt16BE(o.charCodeAt(d),2*d);return this._createEncoderBuffer(f)}return s==="numstr"?this._isNumstr(o)?this._createEncoderBuffer(o):this.reporter.error("Encoding of string type: numstr supports only digits and space"):s==="printstr"?this._isPrintstr(o)?this._createEncoderBuffer(o):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(s)||s==="objDesc"?this._createEncoderBuffer(o):this.reporter.error("Encoding of string type: "+s+" unsupported")},n.prototype._encodeObjid=function(o,s,f){if(typeof o=="string"){if(!s)return this.reporter.error("string objid given, but no values map found");if(!s.hasOwnProperty(o))return this.reporter.error("objid not found in values map");o=s[o].split(/[\s.]+/g);for(let m=0;m<o.length;m++)o[m]|=0}else if(Array.isArray(o)){o=o.slice();for(let m=0;m<o.length;m++)o[m]|=0}if(!Array.isArray(o))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(o));if(!f){if(o[1]>=40)return this.reporter.error("Second objid identifier OOB");o.splice(0,2,40*o[0]+o[1])}let d=0;for(let m=0;m<o.length;m++){let v=o[m];for(d++;v>=128;v>>=7)d++}let u=i.alloc(d),g=u.length-1;for(let m=o.length-1;m>=0;m--){let v=o[m];for(u[g--]=127&v;(v>>=7)>0;)u[g--]=128|127&v}return this._createEncoderBuffer(u)},n.prototype._encodeTime=function(o,s){let f,d=new Date(o);return s==="gentime"?f=[l(d.getUTCFullYear()),l(d.getUTCMonth()+1),l(d.getUTCDate()),l(d.getUTCHours()),l(d.getUTCMinutes()),l(d.getUTCSeconds()),"Z"].join(""):s==="utctime"?f=[l(d.getUTCFullYear()%100),l(d.getUTCMonth()+1),l(d.getUTCDate()),l(d.getUTCHours()),l(d.getUTCMinutes()),l(d.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+s+" time is not supported yet"),this._encodeStr(f,"octstr")},n.prototype._encodeNull=function(){return this._createEncoderBuffer("")},n.prototype._encodeInt=function(o,s){if(typeof o=="string"){if(!s)return this.reporter.error("String int or enum given, but no values map");if(!s.hasOwnProperty(o))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(o));o=s[o]}if(typeof o!="number"&&!i.isBuffer(o)){let u=o.toArray();!o.sign&&128&u[0]&&u.unshift(0),o=i.from(u)}if(i.isBuffer(o)){let u=o.length;o.length===0&&u++;let g=i.alloc(u);return o.copy(g),o.length===0&&(g[0]=0),this._createEncoderBuffer(g)}if(o<128)return this._createEncoderBuffer(o);if(o<256)return this._createEncoderBuffer([0,o]);let f=1;for(let u=o;u>=256;u>>=8)f++;let d=new Array(f);for(let u=d.length-1;u>=0;u--)d[u]=255&o,o>>=8;return 128&d[0]&&d.unshift(0),this._createEncoderBuffer(i.from(d))},n.prototype._encodeBool=function(o){return this._createEncoderBuffer(o?255:0)},n.prototype._use=function(o,s){return typeof o=="function"&&(o=o(s)),o._getEncoder("der").tree},n.prototype._skipDefault=function(o,s,f){let d=this._baseState,u;if(d.default===null)return!1;let g=o.join();if(d.defaultBuffer===void 0&&(d.defaultBuffer=this._encodeValue(d.default,s,f).join()),g.length!==d.defaultBuffer.length)return!1;for(u=0;u<g.length;u++)if(g[u]!==d.defaultBuffer[u])return!1;return!0}},{"../base/node":174,"../constants/der":176,inherits:440,"safer-buffer":495}],182:[function(e,p,b){"use strict";let c=b;c.der=e("./der"),c.pem=e("./pem")},{"./der":181,"./pem":183}],183:[function(e,p,b){"use strict";let c=e("inherits"),i=e("./der");function a(r){i.call(this,r),this.enc="pem"}c(a,i),p.exports=a,a.prototype.encode=function(r,t){let n=i.prototype.encode.call(this,r).toString("base64"),l=["-----BEGIN "+t.label+"-----"];for(let o=0;o<n.length;o+=64)l.push(n.slice(o,o+64));return l.push("-----END "+t.label+"-----"),l.join(`
8
+ `)}},{"./der":181,inherits:440}],184:[function(e,p,b){"use strict";(function(c,i){function a(S,C){if(!S)throw new Error(C||"Assertion failed")}function r(S,C){S.super_=C;var E=function(){};E.prototype=C.prototype,S.prototype=new E,S.prototype.constructor=S}function t(S,C,E){if(t.isBN(S))return S;this.negative=0,this.words=null,this.length=0,this.red=null,S!==null&&(C!=="le"&&C!=="be"||(E=C,C=10),this._init(S||0,C||10,E||"be"))}var n;typeof c=="object"?c.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{n=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:e("buffer").Buffer}catch{}function l(S,C){var E=S.charCodeAt(C);return E>=65&&E<=70?E-55:E>=97&&E<=102?E-87:E-48&15}function o(S,C,E){var h=l(S,E);return E-1>=C&&(h|=l(S,E-1)<<4),h}function s(S,C,E,h){for(var y=0,w=Math.min(S.length,E),x=C;x<w;x++){var _=S.charCodeAt(x)-48;y*=h,y+=_>=49?_-49+10:_>=17?_-17+10:_}return y}t.isBN=function(S){return S instanceof t||S!==null&&typeof S=="object"&&S.constructor.wordSize===t.wordSize&&Array.isArray(S.words)},t.max=function(S,C){return S.cmp(C)>0?S:C},t.min=function(S,C){return S.cmp(C)<0?S:C},t.prototype._init=function(S,C,E){if(typeof S=="number")return this._initNumber(S,C,E);if(typeof S=="object")return this._initArray(S,C,E);C==="hex"&&(C=16),a(C===(0|C)&&C>=2&&C<=36);var h=0;(S=S.toString().replace(/\s+/g,""))[0]==="-"&&(h++,this.negative=1),h<S.length&&(C===16?this._parseHex(S,h,E):(this._parseBase(S,C,h),E==="le"&&this._initArray(this.toArray(),C,E)))},t.prototype._initNumber=function(S,C,E){S<0&&(this.negative=1,S=-S),S<67108864?(this.words=[67108863&S],this.length=1):S<4503599627370496?(this.words=[67108863&S,S/67108864&67108863],this.length=2):(a(S<9007199254740992),this.words=[67108863&S,S/67108864&67108863,1],this.length=3),E==="le"&&this._initArray(this.toArray(),C,E)},t.prototype._initArray=function(S,C,E){if(a(typeof S.length=="number"),S.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(S.length/3),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var y,w,x=0;if(E==="be")for(h=S.length-1,y=0;h>=0;h-=3)w=S[h]|S[h-1]<<8|S[h-2]<<16,this.words[y]|=w<<x&67108863,this.words[y+1]=w>>>26-x&67108863,(x+=24)>=26&&(x-=26,y++);else if(E==="le")for(h=0,y=0;h<S.length;h+=3)w=S[h]|S[h+1]<<8|S[h+2]<<16,this.words[y]|=w<<x&67108863,this.words[y+1]=w>>>26-x&67108863,(x+=24)>=26&&(x-=26,y++);return this.strip()},t.prototype._parseHex=function(S,C,E){this.length=Math.ceil((S.length-C)/6),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var y,w=0,x=0;if(E==="be")for(h=S.length-1;h>=C;h-=2)y=o(S,C,h)<<w,this.words[x]|=67108863&y,w>=18?(w-=18,x+=1,this.words[x]|=y>>>26):w+=8;else for(h=(S.length-C)%2==0?C+1:C;h<S.length;h+=2)y=o(S,C,h)<<w,this.words[x]|=67108863&y,w>=18?(w-=18,x+=1,this.words[x]|=y>>>26):w+=8;this.strip()},t.prototype._parseBase=function(S,C,E){this.words=[0],this.length=1;for(var h=0,y=1;y<=67108863;y*=C)h++;h--,y=y/C|0;for(var w=S.length-E,x=w%h,_=Math.min(w,w-x)+E,T=0,D=E;D<_;D+=h)T=s(S,D,D+h,C),this.imuln(y),this.words[0]+T<67108864?this.words[0]+=T:this._iaddn(T);if(x!==0){var q=1;for(T=s(S,D,S.length,C),D=0;D<x;D++)q*=C;this.imuln(q),this.words[0]+T<67108864?this.words[0]+=T:this._iaddn(T)}this.strip()},t.prototype.copy=function(S){S.words=new Array(this.length);for(var C=0;C<this.length;C++)S.words[C]=this.words[C];S.length=this.length,S.negative=this.negative,S.red=this.red},t.prototype.clone=function(){var S=new t(null);return this.copy(S),S},t.prototype._expand=function(S){for(;this.length<S;)this.words[this.length++]=0;return this},t.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},t.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(S,C,E){E.negative=C.negative^S.negative;var h=S.length+C.length|0;E.length=h,h=h-1|0;var y=0|S.words[0],w=0|C.words[0],x=y*w,_=67108863&x,T=x/67108864|0;E.words[0]=_;for(var D=1;D<h;D++){for(var q=T>>>26,$=67108863&T,W=Math.min(D,C.length-1),A=Math.max(0,D-S.length+1);A<=W;A++){var H=D-A|0;q+=(x=(y=0|S.words[H])*(w=0|C.words[A])+$)/67108864|0,$=67108863&x}E.words[D]=0|$,T=0|q}return T!==0?E.words[D]=0|T:E.length--,E.strip()}t.prototype.toString=function(S,C){var E;if(C=0|C||1,(S=S||10)===16||S==="hex"){E="";for(var h=0,y=0,w=0;w<this.length;w++){var x=this.words[w],_=(16777215&(x<<h|y)).toString(16);E=(y=x>>>24-h&16777215)!==0||w!==this.length-1?f[6-_.length]+_+E:_+E,(h+=2)>=26&&(h-=26,w--)}for(y!==0&&(E=y.toString(16)+E);E.length%C!=0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(S===(0|S)&&S>=2&&S<=36){var T=d[S],D=u[S];E="";var q=this.clone();for(q.negative=0;!q.isZero();){var $=q.modn(D).toString(S);E=(q=q.idivn(D)).isZero()?$+E:f[T-$.length]+$+E}for(this.isZero()&&(E="0"+E);E.length%C!=0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var S=this.words[0];return this.length===2?S+=67108864*this.words[1]:this.length===3&&this.words[2]===1?S+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-S:S},t.prototype.toJSON=function(){return this.toString(16)},t.prototype.toBuffer=function(S,C){return a(n!==void 0),this.toArrayLike(n,S,C)},t.prototype.toArray=function(S,C){return this.toArrayLike(Array,S,C)},t.prototype.toArrayLike=function(S,C,E){var h=this.byteLength(),y=E||Math.max(1,h);a(h<=y,"byte array longer than desired length"),a(y>0,"Requested array length <= 0"),this.strip();var w,x,_=C==="le",T=new S(y),D=this.clone();if(_){for(x=0;!D.isZero();x++)w=D.andln(255),D.iushrn(8),T[x]=w;for(;x<y;x++)T[x]=0}else{for(x=0;x<y-h;x++)T[x]=0;for(x=0;!D.isZero();x++)w=D.andln(255),D.iushrn(8),T[y-x-1]=w}return T},Math.clz32?t.prototype._countBits=function(S){return 32-Math.clz32(S)}:t.prototype._countBits=function(S){var C=S,E=0;return C>=4096&&(E+=13,C>>>=13),C>=64&&(E+=7,C>>>=7),C>=8&&(E+=4,C>>>=4),C>=2&&(E+=2,C>>>=2),E+C},t.prototype._zeroBits=function(S){if(S===0)return 26;var C=S,E=0;return(8191&C)==0&&(E+=13,C>>>=13),(127&C)==0&&(E+=7,C>>>=7),(15&C)==0&&(E+=4,C>>>=4),(3&C)==0&&(E+=2,C>>>=2),(1&C)==0&&E++,E},t.prototype.bitLength=function(){var S=this.words[this.length-1],C=this._countBits(S);return 26*(this.length-1)+C},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var S=0,C=0;C<this.length;C++){var E=this._zeroBits(this.words[C]);if(S+=E,E!==26)break}return S},t.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},t.prototype.toTwos=function(S){return this.negative!==0?this.abs().inotn(S).iaddn(1):this.clone()},t.prototype.fromTwos=function(S){return this.testn(S-1)?this.notn(S).iaddn(1).ineg():this.clone()},t.prototype.isNeg=function(){return this.negative!==0},t.prototype.neg=function(){return this.clone().ineg()},t.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},t.prototype.iuor=function(S){for(;this.length<S.length;)this.words[this.length++]=0;for(var C=0;C<S.length;C++)this.words[C]=this.words[C]|S.words[C];return this.strip()},t.prototype.ior=function(S){return a((this.negative|S.negative)==0),this.iuor(S)},t.prototype.or=function(S){return this.length>S.length?this.clone().ior(S):S.clone().ior(this)},t.prototype.uor=function(S){return this.length>S.length?this.clone().iuor(S):S.clone().iuor(this)},t.prototype.iuand=function(S){var C;C=this.length>S.length?S:this;for(var E=0;E<C.length;E++)this.words[E]=this.words[E]&S.words[E];return this.length=C.length,this.strip()},t.prototype.iand=function(S){return a((this.negative|S.negative)==0),this.iuand(S)},t.prototype.and=function(S){return this.length>S.length?this.clone().iand(S):S.clone().iand(this)},t.prototype.uand=function(S){return this.length>S.length?this.clone().iuand(S):S.clone().iuand(this)},t.prototype.iuxor=function(S){var C,E;this.length>S.length?(C=this,E=S):(C=S,E=this);for(var h=0;h<E.length;h++)this.words[h]=C.words[h]^E.words[h];if(this!==C)for(;h<C.length;h++)this.words[h]=C.words[h];return this.length=C.length,this.strip()},t.prototype.ixor=function(S){return a((this.negative|S.negative)==0),this.iuxor(S)},t.prototype.xor=function(S){return this.length>S.length?this.clone().ixor(S):S.clone().ixor(this)},t.prototype.uxor=function(S){return this.length>S.length?this.clone().iuxor(S):S.clone().iuxor(this)},t.prototype.inotn=function(S){a(typeof S=="number"&&S>=0);var C=0|Math.ceil(S/26),E=S%26;this._expand(C),E>0&&C--;for(var h=0;h<C;h++)this.words[h]=67108863&~this.words[h];return E>0&&(this.words[h]=~this.words[h]&67108863>>26-E),this.strip()},t.prototype.notn=function(S){return this.clone().inotn(S)},t.prototype.setn=function(S,C){a(typeof S=="number"&&S>=0);var E=S/26|0,h=S%26;return this._expand(E+1),this.words[E]=C?this.words[E]|1<<h:this.words[E]&~(1<<h),this.strip()},t.prototype.iadd=function(S){var C,E,h;if(this.negative!==0&&S.negative===0)return this.negative=0,C=this.isub(S),this.negative^=1,this._normSign();if(this.negative===0&&S.negative!==0)return S.negative=0,C=this.isub(S),S.negative=1,C._normSign();this.length>S.length?(E=this,h=S):(E=S,h=this);for(var y=0,w=0;w<h.length;w++)C=(0|E.words[w])+(0|h.words[w])+y,this.words[w]=67108863&C,y=C>>>26;for(;y!==0&&w<E.length;w++)C=(0|E.words[w])+y,this.words[w]=67108863&C,y=C>>>26;if(this.length=E.length,y!==0)this.words[this.length]=y,this.length++;else if(E!==this)for(;w<E.length;w++)this.words[w]=E.words[w];return this},t.prototype.add=function(S){var C;return S.negative!==0&&this.negative===0?(S.negative=0,C=this.sub(S),S.negative^=1,C):S.negative===0&&this.negative!==0?(this.negative=0,C=S.sub(this),this.negative=1,C):this.length>S.length?this.clone().iadd(S):S.clone().iadd(this)},t.prototype.isub=function(S){if(S.negative!==0){S.negative=0;var C=this.iadd(S);return S.negative=1,C._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(S),this.negative=1,this._normSign();var E,h,y=this.cmp(S);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;y>0?(E=this,h=S):(E=S,h=this);for(var w=0,x=0;x<h.length;x++)w=(C=(0|E.words[x])-(0|h.words[x])+w)>>26,this.words[x]=67108863&C;for(;w!==0&&x<E.length;x++)w=(C=(0|E.words[x])+w)>>26,this.words[x]=67108863&C;if(w===0&&x<E.length&&E!==this)for(;x<E.length;x++)this.words[x]=E.words[x];return this.length=Math.max(this.length,x),E!==this&&(this.negative=1),this.strip()},t.prototype.sub=function(S){return this.clone().isub(S)};var m=function(S,C,E){var h,y,w,x=S.words,_=C.words,T=E.words,D=0,q=0|x[0],$=8191&q,W=q>>>13,A=0|x[1],H=8191&A,M=A>>>13,I=0|x[2],F=8191&I,U=I>>>13,X=0|x[3],V=8191&X,G=X>>>13,ee=0|x[4],Z=8191&ee,K=ee>>>13,Q=0|x[5],J=8191&Q,ne=Q>>>13,ie=0|x[6],le=8191&ie,re=ie>>>13,se=0|x[7],be=8191&se,ye=se>>>13,Fe=0|x[8],Ce=8191&Fe,ae=Fe>>>13,De=0|x[9],Be=8191&De,ke=De>>>13,Re=0|_[0],we=8191&Re,ve=Re>>>13,Ze=0|_[1],Se=8191&Ze,de=Ze>>>13,Ee=0|_[2],_e=8191&Ee,Ie=Ee>>>13,ot=0|_[3],Le=8191&ot,Ae=ot>>>13,vt=0|_[4],ze=8191&vt,qe=vt>>>13,dt=0|_[5],Ue=8191&dt,Oe=dt>>>13,Ft=0|_[6],He=8191&Ft,te=Ft>>>13,ue=0|_[7],fe=8191&ue,me=ue>>>13,Je=0|_[8],Me=8191&Je,Ne=Je>>>13,ht=0|_[9],je=8191&ht,Pe=ht>>>13;E.negative=S.negative^C.negative,E.length=19;var ft=(D+(h=Math.imul($,we))|0)+((8191&(y=(y=Math.imul($,ve))+Math.imul(W,we)|0))<<13)|0;D=((w=Math.imul(W,ve))+(y>>>13)|0)+(ft>>>26)|0,ft&=67108863,h=Math.imul(H,we),y=(y=Math.imul(H,ve))+Math.imul(M,we)|0,w=Math.imul(M,ve);var rt=(D+(h=h+Math.imul($,Se)|0)|0)+((8191&(y=(y=y+Math.imul($,de)|0)+Math.imul(W,Se)|0))<<13)|0;D=((w=w+Math.imul(W,de)|0)+(y>>>13)|0)+(rt>>>26)|0,rt&=67108863,h=Math.imul(F,we),y=(y=Math.imul(F,ve))+Math.imul(U,we)|0,w=Math.imul(U,ve),h=h+Math.imul(H,Se)|0,y=(y=y+Math.imul(H,de)|0)+Math.imul(M,Se)|0,w=w+Math.imul(M,de)|0;var et=(D+(h=h+Math.imul($,_e)|0)|0)+((8191&(y=(y=y+Math.imul($,Ie)|0)+Math.imul(W,_e)|0))<<13)|0;D=((w=w+Math.imul(W,Ie)|0)+(y>>>13)|0)+(et>>>26)|0,et&=67108863,h=Math.imul(V,we),y=(y=Math.imul(V,ve))+Math.imul(G,we)|0,w=Math.imul(G,ve),h=h+Math.imul(F,Se)|0,y=(y=y+Math.imul(F,de)|0)+Math.imul(U,Se)|0,w=w+Math.imul(U,de)|0,h=h+Math.imul(H,_e)|0,y=(y=y+Math.imul(H,Ie)|0)+Math.imul(M,_e)|0,w=w+Math.imul(M,Ie)|0;var yt=(D+(h=h+Math.imul($,Le)|0)|0)+((8191&(y=(y=y+Math.imul($,Ae)|0)+Math.imul(W,Le)|0))<<13)|0;D=((w=w+Math.imul(W,Ae)|0)+(y>>>13)|0)+(yt>>>26)|0,yt&=67108863,h=Math.imul(Z,we),y=(y=Math.imul(Z,ve))+Math.imul(K,we)|0,w=Math.imul(K,ve),h=h+Math.imul(V,Se)|0,y=(y=y+Math.imul(V,de)|0)+Math.imul(G,Se)|0,w=w+Math.imul(G,de)|0,h=h+Math.imul(F,_e)|0,y=(y=y+Math.imul(F,Ie)|0)+Math.imul(U,_e)|0,w=w+Math.imul(U,Ie)|0,h=h+Math.imul(H,Le)|0,y=(y=y+Math.imul(H,Ae)|0)+Math.imul(M,Le)|0,w=w+Math.imul(M,Ae)|0;var lt=(D+(h=h+Math.imul($,ze)|0)|0)+((8191&(y=(y=y+Math.imul($,qe)|0)+Math.imul(W,ze)|0))<<13)|0;D=((w=w+Math.imul(W,qe)|0)+(y>>>13)|0)+(lt>>>26)|0,lt&=67108863,h=Math.imul(J,we),y=(y=Math.imul(J,ve))+Math.imul(ne,we)|0,w=Math.imul(ne,ve),h=h+Math.imul(Z,Se)|0,y=(y=y+Math.imul(Z,de)|0)+Math.imul(K,Se)|0,w=w+Math.imul(K,de)|0,h=h+Math.imul(V,_e)|0,y=(y=y+Math.imul(V,Ie)|0)+Math.imul(G,_e)|0,w=w+Math.imul(G,Ie)|0,h=h+Math.imul(F,Le)|0,y=(y=y+Math.imul(F,Ae)|0)+Math.imul(U,Le)|0,w=w+Math.imul(U,Ae)|0,h=h+Math.imul(H,ze)|0,y=(y=y+Math.imul(H,qe)|0)+Math.imul(M,ze)|0,w=w+Math.imul(M,qe)|0;var mt=(D+(h=h+Math.imul($,Ue)|0)|0)+((8191&(y=(y=y+Math.imul($,Oe)|0)+Math.imul(W,Ue)|0))<<13)|0;D=((w=w+Math.imul(W,Oe)|0)+(y>>>13)|0)+(mt>>>26)|0,mt&=67108863,h=Math.imul(le,we),y=(y=Math.imul(le,ve))+Math.imul(re,we)|0,w=Math.imul(re,ve),h=h+Math.imul(J,Se)|0,y=(y=y+Math.imul(J,de)|0)+Math.imul(ne,Se)|0,w=w+Math.imul(ne,de)|0,h=h+Math.imul(Z,_e)|0,y=(y=y+Math.imul(Z,Ie)|0)+Math.imul(K,_e)|0,w=w+Math.imul(K,Ie)|0,h=h+Math.imul(V,Le)|0,y=(y=y+Math.imul(V,Ae)|0)+Math.imul(G,Le)|0,w=w+Math.imul(G,Ae)|0,h=h+Math.imul(F,ze)|0,y=(y=y+Math.imul(F,qe)|0)+Math.imul(U,ze)|0,w=w+Math.imul(U,qe)|0,h=h+Math.imul(H,Ue)|0,y=(y=y+Math.imul(H,Oe)|0)+Math.imul(M,Ue)|0,w=w+Math.imul(M,Oe)|0;var er=(D+(h=h+Math.imul($,He)|0)|0)+((8191&(y=(y=y+Math.imul($,te)|0)+Math.imul(W,He)|0))<<13)|0;D=((w=w+Math.imul(W,te)|0)+(y>>>13)|0)+(er>>>26)|0,er&=67108863,h=Math.imul(be,we),y=(y=Math.imul(be,ve))+Math.imul(ye,we)|0,w=Math.imul(ye,ve),h=h+Math.imul(le,Se)|0,y=(y=y+Math.imul(le,de)|0)+Math.imul(re,Se)|0,w=w+Math.imul(re,de)|0,h=h+Math.imul(J,_e)|0,y=(y=y+Math.imul(J,Ie)|0)+Math.imul(ne,_e)|0,w=w+Math.imul(ne,Ie)|0,h=h+Math.imul(Z,Le)|0,y=(y=y+Math.imul(Z,Ae)|0)+Math.imul(K,Le)|0,w=w+Math.imul(K,Ae)|0,h=h+Math.imul(V,ze)|0,y=(y=y+Math.imul(V,qe)|0)+Math.imul(G,ze)|0,w=w+Math.imul(G,qe)|0,h=h+Math.imul(F,Ue)|0,y=(y=y+Math.imul(F,Oe)|0)+Math.imul(U,Ue)|0,w=w+Math.imul(U,Oe)|0,h=h+Math.imul(H,He)|0,y=(y=y+Math.imul(H,te)|0)+Math.imul(M,He)|0,w=w+Math.imul(M,te)|0;var Nt=(D+(h=h+Math.imul($,fe)|0)|0)+((8191&(y=(y=y+Math.imul($,me)|0)+Math.imul(W,fe)|0))<<13)|0;D=((w=w+Math.imul(W,me)|0)+(y>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,h=Math.imul(Ce,we),y=(y=Math.imul(Ce,ve))+Math.imul(ae,we)|0,w=Math.imul(ae,ve),h=h+Math.imul(be,Se)|0,y=(y=y+Math.imul(be,de)|0)+Math.imul(ye,Se)|0,w=w+Math.imul(ye,de)|0,h=h+Math.imul(le,_e)|0,y=(y=y+Math.imul(le,Ie)|0)+Math.imul(re,_e)|0,w=w+Math.imul(re,Ie)|0,h=h+Math.imul(J,Le)|0,y=(y=y+Math.imul(J,Ae)|0)+Math.imul(ne,Le)|0,w=w+Math.imul(ne,Ae)|0,h=h+Math.imul(Z,ze)|0,y=(y=y+Math.imul(Z,qe)|0)+Math.imul(K,ze)|0,w=w+Math.imul(K,qe)|0,h=h+Math.imul(V,Ue)|0,y=(y=y+Math.imul(V,Oe)|0)+Math.imul(G,Ue)|0,w=w+Math.imul(G,Oe)|0,h=h+Math.imul(F,He)|0,y=(y=y+Math.imul(F,te)|0)+Math.imul(U,He)|0,w=w+Math.imul(U,te)|0,h=h+Math.imul(H,fe)|0,y=(y=y+Math.imul(H,me)|0)+Math.imul(M,fe)|0,w=w+Math.imul(M,me)|0;var Ut=(D+(h=h+Math.imul($,Me)|0)|0)+((8191&(y=(y=y+Math.imul($,Ne)|0)+Math.imul(W,Me)|0))<<13)|0;D=((w=w+Math.imul(W,Ne)|0)+(y>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,h=Math.imul(Be,we),y=(y=Math.imul(Be,ve))+Math.imul(ke,we)|0,w=Math.imul(ke,ve),h=h+Math.imul(Ce,Se)|0,y=(y=y+Math.imul(Ce,de)|0)+Math.imul(ae,Se)|0,w=w+Math.imul(ae,de)|0,h=h+Math.imul(be,_e)|0,y=(y=y+Math.imul(be,Ie)|0)+Math.imul(ye,_e)|0,w=w+Math.imul(ye,Ie)|0,h=h+Math.imul(le,Le)|0,y=(y=y+Math.imul(le,Ae)|0)+Math.imul(re,Le)|0,w=w+Math.imul(re,Ae)|0,h=h+Math.imul(J,ze)|0,y=(y=y+Math.imul(J,qe)|0)+Math.imul(ne,ze)|0,w=w+Math.imul(ne,qe)|0,h=h+Math.imul(Z,Ue)|0,y=(y=y+Math.imul(Z,Oe)|0)+Math.imul(K,Ue)|0,w=w+Math.imul(K,Oe)|0,h=h+Math.imul(V,He)|0,y=(y=y+Math.imul(V,te)|0)+Math.imul(G,He)|0,w=w+Math.imul(G,te)|0,h=h+Math.imul(F,fe)|0,y=(y=y+Math.imul(F,me)|0)+Math.imul(U,fe)|0,w=w+Math.imul(U,me)|0,h=h+Math.imul(H,Me)|0,y=(y=y+Math.imul(H,Ne)|0)+Math.imul(M,Me)|0,w=w+Math.imul(M,Ne)|0;var Y=(D+(h=h+Math.imul($,je)|0)|0)+((8191&(y=(y=y+Math.imul($,Pe)|0)+Math.imul(W,je)|0))<<13)|0;D=((w=w+Math.imul(W,Pe)|0)+(y>>>13)|0)+(Y>>>26)|0,Y&=67108863,h=Math.imul(Be,Se),y=(y=Math.imul(Be,de))+Math.imul(ke,Se)|0,w=Math.imul(ke,de),h=h+Math.imul(Ce,_e)|0,y=(y=y+Math.imul(Ce,Ie)|0)+Math.imul(ae,_e)|0,w=w+Math.imul(ae,Ie)|0,h=h+Math.imul(be,Le)|0,y=(y=y+Math.imul(be,Ae)|0)+Math.imul(ye,Le)|0,w=w+Math.imul(ye,Ae)|0,h=h+Math.imul(le,ze)|0,y=(y=y+Math.imul(le,qe)|0)+Math.imul(re,ze)|0,w=w+Math.imul(re,qe)|0,h=h+Math.imul(J,Ue)|0,y=(y=y+Math.imul(J,Oe)|0)+Math.imul(ne,Ue)|0,w=w+Math.imul(ne,Oe)|0,h=h+Math.imul(Z,He)|0,y=(y=y+Math.imul(Z,te)|0)+Math.imul(K,He)|0,w=w+Math.imul(K,te)|0,h=h+Math.imul(V,fe)|0,y=(y=y+Math.imul(V,me)|0)+Math.imul(G,fe)|0,w=w+Math.imul(G,me)|0,h=h+Math.imul(F,Me)|0,y=(y=y+Math.imul(F,Ne)|0)+Math.imul(U,Me)|0,w=w+Math.imul(U,Ne)|0;var ce=(D+(h=h+Math.imul(H,je)|0)|0)+((8191&(y=(y=y+Math.imul(H,Pe)|0)+Math.imul(M,je)|0))<<13)|0;D=((w=w+Math.imul(M,Pe)|0)+(y>>>13)|0)+(ce>>>26)|0,ce&=67108863,h=Math.imul(Be,_e),y=(y=Math.imul(Be,Ie))+Math.imul(ke,_e)|0,w=Math.imul(ke,Ie),h=h+Math.imul(Ce,Le)|0,y=(y=y+Math.imul(Ce,Ae)|0)+Math.imul(ae,Le)|0,w=w+Math.imul(ae,Ae)|0,h=h+Math.imul(be,ze)|0,y=(y=y+Math.imul(be,qe)|0)+Math.imul(ye,ze)|0,w=w+Math.imul(ye,qe)|0,h=h+Math.imul(le,Ue)|0,y=(y=y+Math.imul(le,Oe)|0)+Math.imul(re,Ue)|0,w=w+Math.imul(re,Oe)|0,h=h+Math.imul(J,He)|0,y=(y=y+Math.imul(J,te)|0)+Math.imul(ne,He)|0,w=w+Math.imul(ne,te)|0,h=h+Math.imul(Z,fe)|0,y=(y=y+Math.imul(Z,me)|0)+Math.imul(K,fe)|0,w=w+Math.imul(K,me)|0,h=h+Math.imul(V,Me)|0,y=(y=y+Math.imul(V,Ne)|0)+Math.imul(G,Me)|0,w=w+Math.imul(G,Ne)|0;var ge=(D+(h=h+Math.imul(F,je)|0)|0)+((8191&(y=(y=y+Math.imul(F,Pe)|0)+Math.imul(U,je)|0))<<13)|0;D=((w=w+Math.imul(U,Pe)|0)+(y>>>13)|0)+(ge>>>26)|0,ge&=67108863,h=Math.imul(Be,Le),y=(y=Math.imul(Be,Ae))+Math.imul(ke,Le)|0,w=Math.imul(ke,Ae),h=h+Math.imul(Ce,ze)|0,y=(y=y+Math.imul(Ce,qe)|0)+Math.imul(ae,ze)|0,w=w+Math.imul(ae,qe)|0,h=h+Math.imul(be,Ue)|0,y=(y=y+Math.imul(be,Oe)|0)+Math.imul(ye,Ue)|0,w=w+Math.imul(ye,Oe)|0,h=h+Math.imul(le,He)|0,y=(y=y+Math.imul(le,te)|0)+Math.imul(re,He)|0,w=w+Math.imul(re,te)|0,h=h+Math.imul(J,fe)|0,y=(y=y+Math.imul(J,me)|0)+Math.imul(ne,fe)|0,w=w+Math.imul(ne,me)|0,h=h+Math.imul(Z,Me)|0,y=(y=y+Math.imul(Z,Ne)|0)+Math.imul(K,Me)|0,w=w+Math.imul(K,Ne)|0;var he=(D+(h=h+Math.imul(V,je)|0)|0)+((8191&(y=(y=y+Math.imul(V,Pe)|0)+Math.imul(G,je)|0))<<13)|0;D=((w=w+Math.imul(G,Pe)|0)+(y>>>13)|0)+(he>>>26)|0,he&=67108863,h=Math.imul(Be,ze),y=(y=Math.imul(Be,qe))+Math.imul(ke,ze)|0,w=Math.imul(ke,qe),h=h+Math.imul(Ce,Ue)|0,y=(y=y+Math.imul(Ce,Oe)|0)+Math.imul(ae,Ue)|0,w=w+Math.imul(ae,Oe)|0,h=h+Math.imul(be,He)|0,y=(y=y+Math.imul(be,te)|0)+Math.imul(ye,He)|0,w=w+Math.imul(ye,te)|0,h=h+Math.imul(le,fe)|0,y=(y=y+Math.imul(le,me)|0)+Math.imul(re,fe)|0,w=w+Math.imul(re,me)|0,h=h+Math.imul(J,Me)|0,y=(y=y+Math.imul(J,Ne)|0)+Math.imul(ne,Me)|0,w=w+Math.imul(ne,Ne)|0;var oe=(D+(h=h+Math.imul(Z,je)|0)|0)+((8191&(y=(y=y+Math.imul(Z,Pe)|0)+Math.imul(K,je)|0))<<13)|0;D=((w=w+Math.imul(K,Pe)|0)+(y>>>13)|0)+(oe>>>26)|0,oe&=67108863,h=Math.imul(Be,Ue),y=(y=Math.imul(Be,Oe))+Math.imul(ke,Ue)|0,w=Math.imul(ke,Oe),h=h+Math.imul(Ce,He)|0,y=(y=y+Math.imul(Ce,te)|0)+Math.imul(ae,He)|0,w=w+Math.imul(ae,te)|0,h=h+Math.imul(be,fe)|0,y=(y=y+Math.imul(be,me)|0)+Math.imul(ye,fe)|0,w=w+Math.imul(ye,me)|0,h=h+Math.imul(le,Me)|0,y=(y=y+Math.imul(le,Ne)|0)+Math.imul(re,Me)|0,w=w+Math.imul(re,Ne)|0;var pe=(D+(h=h+Math.imul(J,je)|0)|0)+((8191&(y=(y=y+Math.imul(J,Pe)|0)+Math.imul(ne,je)|0))<<13)|0;D=((w=w+Math.imul(ne,Pe)|0)+(y>>>13)|0)+(pe>>>26)|0,pe&=67108863,h=Math.imul(Be,He),y=(y=Math.imul(Be,te))+Math.imul(ke,He)|0,w=Math.imul(ke,te),h=h+Math.imul(Ce,fe)|0,y=(y=y+Math.imul(Ce,me)|0)+Math.imul(ae,fe)|0,w=w+Math.imul(ae,me)|0,h=h+Math.imul(be,Me)|0,y=(y=y+Math.imul(be,Ne)|0)+Math.imul(ye,Me)|0,w=w+Math.imul(ye,Ne)|0;var Te=(D+(h=h+Math.imul(le,je)|0)|0)+((8191&(y=(y=y+Math.imul(le,Pe)|0)+Math.imul(re,je)|0))<<13)|0;D=((w=w+Math.imul(re,Pe)|0)+(y>>>13)|0)+(Te>>>26)|0,Te&=67108863,h=Math.imul(Be,fe),y=(y=Math.imul(Be,me))+Math.imul(ke,fe)|0,w=Math.imul(ke,me),h=h+Math.imul(Ce,Me)|0,y=(y=y+Math.imul(Ce,Ne)|0)+Math.imul(ae,Me)|0,w=w+Math.imul(ae,Ne)|0;var tt=(D+(h=h+Math.imul(be,je)|0)|0)+((8191&(y=(y=y+Math.imul(be,Pe)|0)+Math.imul(ye,je)|0))<<13)|0;D=((w=w+Math.imul(ye,Pe)|0)+(y>>>13)|0)+(tt>>>26)|0,tt&=67108863,h=Math.imul(Be,Me),y=(y=Math.imul(Be,Ne))+Math.imul(ke,Me)|0,w=Math.imul(ke,Ne);var Ke=(D+(h=h+Math.imul(Ce,je)|0)|0)+((8191&(y=(y=y+Math.imul(Ce,Pe)|0)+Math.imul(ae,je)|0))<<13)|0;D=((w=w+Math.imul(ae,Pe)|0)+(y>>>13)|0)+(Ke>>>26)|0,Ke&=67108863;var Ve=(D+(h=Math.imul(Be,je))|0)+((8191&(y=(y=Math.imul(Be,Pe))+Math.imul(ke,je)|0))<<13)|0;return D=((w=Math.imul(ke,Pe))+(y>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,T[0]=ft,T[1]=rt,T[2]=et,T[3]=yt,T[4]=lt,T[5]=mt,T[6]=er,T[7]=Nt,T[8]=Ut,T[9]=Y,T[10]=ce,T[11]=ge,T[12]=he,T[13]=oe,T[14]=pe,T[15]=Te,T[16]=tt,T[17]=Ke,T[18]=Ve,D!==0&&(T[19]=D,E.length++),E};function v(S,C,E){return new k().mulp(S,C,E)}function k(S,C){this.x=S,this.y=C}Math.imul||(m=g),t.prototype.mulTo=function(S,C){var E=this.length+S.length;return this.length===10&&S.length===10?m(this,S,C):E<63?g(this,S,C):E<1024?(function(h,y,w){w.negative=y.negative^h.negative,w.length=h.length+y.length;for(var x=0,_=0,T=0;T<w.length-1;T++){var D=_;_=0;for(var q=67108863&x,$=Math.min(T,y.length-1),W=Math.max(0,T-h.length+1);W<=$;W++){var A=T-W,H=(0|h.words[A])*(0|y.words[W]),M=67108863&H;q=67108863&(M=M+q|0),_+=(D=(D=D+(H/67108864|0)|0)+(M>>>26)|0)>>>26,D&=67108863}w.words[T]=q,x=D,D=_}return x!==0?w.words[T]=x:w.length--,w.strip()})(this,S,C):v(this,S,C)},k.prototype.makeRBT=function(S){for(var C=new Array(S),E=t.prototype._countBits(S)-1,h=0;h<S;h++)C[h]=this.revBin(h,E,S);return C},k.prototype.revBin=function(S,C,E){if(S===0||S===E-1)return S;for(var h=0,y=0;y<C;y++)h|=(1&S)<<C-y-1,S>>=1;return h},k.prototype.permute=function(S,C,E,h,y,w){for(var x=0;x<w;x++)h[x]=C[S[x]],y[x]=E[S[x]]},k.prototype.transform=function(S,C,E,h,y,w){this.permute(w,S,C,E,h,y);for(var x=1;x<y;x<<=1)for(var _=x<<1,T=Math.cos(2*Math.PI/_),D=Math.sin(2*Math.PI/_),q=0;q<y;q+=_)for(var $=T,W=D,A=0;A<x;A++){var H=E[q+A],M=h[q+A],I=E[q+A+x],F=h[q+A+x],U=$*I-W*F;F=$*F+W*I,I=U,E[q+A]=H+I,h[q+A]=M+F,E[q+A+x]=H-I,h[q+A+x]=M-F,A!==_&&(U=T*$-D*W,W=T*W+D*$,$=U)}},k.prototype.guessLen13b=function(S,C){var E=1|Math.max(C,S),h=1&E,y=0;for(E=E/2|0;E;E>>>=1)y++;return 1<<y+1+h},k.prototype.conjugate=function(S,C,E){if(!(E<=1))for(var h=0;h<E/2;h++){var y=S[h];S[h]=S[E-h-1],S[E-h-1]=y,y=C[h],C[h]=-C[E-h-1],C[E-h-1]=-y}},k.prototype.normalize13b=function(S,C){for(var E=0,h=0;h<C/2;h++){var y=8192*Math.round(S[2*h+1]/C)+Math.round(S[2*h]/C)+E;S[h]=67108863&y,E=y<67108864?0:y/67108864|0}return S},k.prototype.convert13b=function(S,C,E,h){for(var y=0,w=0;w<C;w++)y+=0|S[w],E[2*w]=8191&y,y>>>=13,E[2*w+1]=8191&y,y>>>=13;for(w=2*C;w<h;++w)E[w]=0;a(y===0),a((-8192&y)==0)},k.prototype.stub=function(S){for(var C=new Array(S),E=0;E<S;E++)C[E]=0;return C},k.prototype.mulp=function(S,C,E){var h=2*this.guessLen13b(S.length,C.length),y=this.makeRBT(h),w=this.stub(h),x=new Array(h),_=new Array(h),T=new Array(h),D=new Array(h),q=new Array(h),$=new Array(h),W=E.words;W.length=h,this.convert13b(S.words,S.length,x,h),this.convert13b(C.words,C.length,D,h),this.transform(x,w,_,T,h,y),this.transform(D,w,q,$,h,y);for(var A=0;A<h;A++){var H=_[A]*q[A]-T[A]*$[A];T[A]=_[A]*$[A]+T[A]*q[A],_[A]=H}return this.conjugate(_,T,h),this.transform(_,T,W,w,h,y),this.conjugate(W,w,h),this.normalize13b(W,h),E.negative=S.negative^C.negative,E.length=S.length+C.length,E.strip()},t.prototype.mul=function(S){var C=new t(null);return C.words=new Array(this.length+S.length),this.mulTo(S,C)},t.prototype.mulf=function(S){var C=new t(null);return C.words=new Array(this.length+S.length),v(this,S,C)},t.prototype.imul=function(S){return this.clone().mulTo(S,this)},t.prototype.imuln=function(S){a(typeof S=="number"),a(S<67108864);for(var C=0,E=0;E<this.length;E++){var h=(0|this.words[E])*S,y=(67108863&h)+(67108863&C);C>>=26,C+=h/67108864|0,C+=y>>>26,this.words[E]=67108863&y}return C!==0&&(this.words[E]=C,this.length++),this},t.prototype.muln=function(S){return this.clone().imuln(S)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(S){var C=(function(w){for(var x=new Array(w.bitLength()),_=0;_<x.length;_++){var T=_/26|0,D=_%26;x[_]=(w.words[T]&1<<D)>>>D}return x})(S);if(C.length===0)return new t(1);for(var E=this,h=0;h<C.length&&C[h]===0;h++,E=E.sqr());if(++h<C.length)for(var y=E.sqr();h<C.length;h++,y=y.sqr())C[h]!==0&&(E=E.mul(y));return E},t.prototype.iushln=function(S){a(typeof S=="number"&&S>=0);var C,E=S%26,h=(S-E)/26,y=67108863>>>26-E<<26-E;if(E!==0){var w=0;for(C=0;C<this.length;C++){var x=this.words[C]&y,_=(0|this.words[C])-x<<E;this.words[C]=_|w,w=x>>>26-E}w&&(this.words[C]=w,this.length++)}if(h!==0){for(C=this.length-1;C>=0;C--)this.words[C+h]=this.words[C];for(C=0;C<h;C++)this.words[C]=0;this.length+=h}return this.strip()},t.prototype.ishln=function(S){return a(this.negative===0),this.iushln(S)},t.prototype.iushrn=function(S,C,E){var h;a(typeof S=="number"&&S>=0),h=C?(C-C%26)/26:0;var y=S%26,w=Math.min((S-y)/26,this.length),x=67108863^67108863>>>y<<y,_=E;if(h-=w,h=Math.max(0,h),_){for(var T=0;T<w;T++)_.words[T]=this.words[T];_.length=w}if(w!==0)if(this.length>w)for(this.length-=w,T=0;T<this.length;T++)this.words[T]=this.words[T+w];else this.words[0]=0,this.length=1;var D=0;for(T=this.length-1;T>=0&&(D!==0||T>=h);T--){var q=0|this.words[T];this.words[T]=D<<26-y|q>>>y,D=q&x}return _&&D!==0&&(_.words[_.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},t.prototype.ishrn=function(S,C,E){return a(this.negative===0),this.iushrn(S,C,E)},t.prototype.shln=function(S){return this.clone().ishln(S)},t.prototype.ushln=function(S){return this.clone().iushln(S)},t.prototype.shrn=function(S){return this.clone().ishrn(S)},t.prototype.ushrn=function(S){return this.clone().iushrn(S)},t.prototype.testn=function(S){a(typeof S=="number"&&S>=0);var C=S%26,E=(S-C)/26,h=1<<C;return!(this.length<=E)&&!!(this.words[E]&h)},t.prototype.imaskn=function(S){a(typeof S=="number"&&S>=0);var C=S%26,E=(S-C)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(C!==0&&E++,this.length=Math.min(E,this.length),C!==0){var h=67108863^67108863>>>C<<C;this.words[this.length-1]&=h}return this.strip()},t.prototype.maskn=function(S){return this.clone().imaskn(S)},t.prototype.iaddn=function(S){return a(typeof S=="number"),a(S<67108864),S<0?this.isubn(-S):this.negative!==0?this.length===1&&(0|this.words[0])<S?(this.words[0]=S-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(S),this.negative=1,this):this._iaddn(S)},t.prototype._iaddn=function(S){this.words[0]+=S;for(var C=0;C<this.length&&this.words[C]>=67108864;C++)this.words[C]-=67108864,C===this.length-1?this.words[C+1]=1:this.words[C+1]++;return this.length=Math.max(this.length,C+1),this},t.prototype.isubn=function(S){if(a(typeof S=="number"),a(S<67108864),S<0)return this.iaddn(-S);if(this.negative!==0)return this.negative=0,this.iaddn(S),this.negative=1,this;if(this.words[0]-=S,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var C=0;C<this.length&&this.words[C]<0;C++)this.words[C]+=67108864,this.words[C+1]-=1;return this.strip()},t.prototype.addn=function(S){return this.clone().iaddn(S)},t.prototype.subn=function(S){return this.clone().isubn(S)},t.prototype.iabs=function(){return this.negative=0,this},t.prototype.abs=function(){return this.clone().iabs()},t.prototype._ishlnsubmul=function(S,C,E){var h,y,w=S.length+E;this._expand(w);var x=0;for(h=0;h<S.length;h++){y=(0|this.words[h+E])+x;var _=(0|S.words[h])*C;x=((y-=67108863&_)>>26)-(_/67108864|0),this.words[h+E]=67108863&y}for(;h<this.length-E;h++)x=(y=(0|this.words[h+E])+x)>>26,this.words[h+E]=67108863&y;if(x===0)return this.strip();for(a(x===-1),x=0,h=0;h<this.length;h++)x=(y=-(0|this.words[h])+x)>>26,this.words[h]=67108863&y;return this.negative=1,this.strip()},t.prototype._wordDiv=function(S,C){var E=(this.length,S.length),h=this.clone(),y=S,w=0|y.words[y.length-1];(E=26-this._countBits(w))!==0&&(y=y.ushln(E),h.iushln(E),w=0|y.words[y.length-1]);var x,_=h.length-y.length;if(C!=="mod"){(x=new t(null)).length=_+1,x.words=new Array(x.length);for(var T=0;T<x.length;T++)x.words[T]=0}var D=h.clone()._ishlnsubmul(y,1,_);D.negative===0&&(h=D,x&&(x.words[_]=1));for(var q=_-1;q>=0;q--){var $=67108864*(0|h.words[y.length+q])+(0|h.words[y.length+q-1]);for($=Math.min($/w|0,67108863),h._ishlnsubmul(y,$,q);h.negative!==0;)$--,h.negative=0,h._ishlnsubmul(y,1,q),h.isZero()||(h.negative^=1);x&&(x.words[q]=$)}return x&&x.strip(),h.strip(),C!=="div"&&E!==0&&h.iushrn(E),{div:x||null,mod:h}},t.prototype.divmod=function(S,C,E){return a(!S.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&S.negative===0?(w=this.neg().divmod(S,C),C!=="mod"&&(h=w.div.neg()),C!=="div"&&(y=w.mod.neg(),E&&y.negative!==0&&y.iadd(S)),{div:h,mod:y}):this.negative===0&&S.negative!==0?(w=this.divmod(S.neg(),C),C!=="mod"&&(h=w.div.neg()),{div:h,mod:w.mod}):(this.negative&S.negative)!=0?(w=this.neg().divmod(S.neg(),C),C!=="div"&&(y=w.mod.neg(),E&&y.negative!==0&&y.isub(S)),{div:w.div,mod:y}):S.length>this.length||this.cmp(S)<0?{div:new t(0),mod:this}:S.length===1?C==="div"?{div:this.divn(S.words[0]),mod:null}:C==="mod"?{div:null,mod:new t(this.modn(S.words[0]))}:{div:this.divn(S.words[0]),mod:new t(this.modn(S.words[0]))}:this._wordDiv(S,C);var h,y,w},t.prototype.div=function(S){return this.divmod(S,"div",!1).div},t.prototype.mod=function(S){return this.divmod(S,"mod",!1).mod},t.prototype.umod=function(S){return this.divmod(S,"mod",!0).mod},t.prototype.divRound=function(S){var C=this.divmod(S);if(C.mod.isZero())return C.div;var E=C.div.negative!==0?C.mod.isub(S):C.mod,h=S.ushrn(1),y=S.andln(1),w=E.cmp(h);return w<0||y===1&&w===0?C.div:C.div.negative!==0?C.div.isubn(1):C.div.iaddn(1)},t.prototype.modn=function(S){a(S<=67108863);for(var C=(1<<26)%S,E=0,h=this.length-1;h>=0;h--)E=(C*E+(0|this.words[h]))%S;return E},t.prototype.idivn=function(S){a(S<=67108863);for(var C=0,E=this.length-1;E>=0;E--){var h=(0|this.words[E])+67108864*C;this.words[E]=h/S|0,C=h%S}return this.strip()},t.prototype.divn=function(S){return this.clone().idivn(S)},t.prototype.egcd=function(S){a(S.negative===0),a(!S.isZero());var C=this,E=S.clone();C=C.negative!==0?C.umod(S):C.clone();for(var h=new t(1),y=new t(0),w=new t(0),x=new t(1),_=0;C.isEven()&&E.isEven();)C.iushrn(1),E.iushrn(1),++_;for(var T=E.clone(),D=C.clone();!C.isZero();){for(var q=0,$=1;(C.words[0]&$)==0&&q<26;++q,$<<=1);if(q>0)for(C.iushrn(q);q-- >0;)(h.isOdd()||y.isOdd())&&(h.iadd(T),y.isub(D)),h.iushrn(1),y.iushrn(1);for(var W=0,A=1;(E.words[0]&A)==0&&W<26;++W,A<<=1);if(W>0)for(E.iushrn(W);W-- >0;)(w.isOdd()||x.isOdd())&&(w.iadd(T),x.isub(D)),w.iushrn(1),x.iushrn(1);C.cmp(E)>=0?(C.isub(E),h.isub(w),y.isub(x)):(E.isub(C),w.isub(h),x.isub(y))}return{a:w,b:x,gcd:E.iushln(_)}},t.prototype._invmp=function(S){a(S.negative===0),a(!S.isZero());var C=this,E=S.clone();C=C.negative!==0?C.umod(S):C.clone();for(var h,y=new t(1),w=new t(0),x=E.clone();C.cmpn(1)>0&&E.cmpn(1)>0;){for(var _=0,T=1;(C.words[0]&T)==0&&_<26;++_,T<<=1);if(_>0)for(C.iushrn(_);_-- >0;)y.isOdd()&&y.iadd(x),y.iushrn(1);for(var D=0,q=1;(E.words[0]&q)==0&&D<26;++D,q<<=1);if(D>0)for(E.iushrn(D);D-- >0;)w.isOdd()&&w.iadd(x),w.iushrn(1);C.cmp(E)>=0?(C.isub(E),y.isub(w)):(E.isub(C),w.isub(y))}return(h=C.cmpn(1)===0?y:w).cmpn(0)<0&&h.iadd(S),h},t.prototype.gcd=function(S){if(this.isZero())return S.abs();if(S.isZero())return this.abs();var C=this.clone(),E=S.clone();C.negative=0,E.negative=0;for(var h=0;C.isEven()&&E.isEven();h++)C.iushrn(1),E.iushrn(1);for(;;){for(;C.isEven();)C.iushrn(1);for(;E.isEven();)E.iushrn(1);var y=C.cmp(E);if(y<0){var w=C;C=E,E=w}else if(y===0||E.cmpn(1)===0)break;C.isub(E)}return E.iushln(h)},t.prototype.invm=function(S){return this.egcd(S).a.umod(S)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(S){return this.words[0]&S},t.prototype.bincn=function(S){a(typeof S=="number");var C=S%26,E=(S-C)/26,h=1<<C;if(this.length<=E)return this._expand(E+1),this.words[E]|=h,this;for(var y=h,w=E;y!==0&&w<this.length;w++){var x=0|this.words[w];y=(x+=y)>>>26,x&=67108863,this.words[w]=x}return y!==0&&(this.words[w]=y,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(S){var C,E=S<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;if(this.strip(),this.length>1)C=1;else{E&&(S=-S),a(S<=67108863,"Number is too big");var h=0|this.words[0];C=h===S?0:h<S?-1:1}return this.negative!==0?0|-C:C},t.prototype.cmp=function(S){if(this.negative!==0&&S.negative===0)return-1;if(this.negative===0&&S.negative!==0)return 1;var C=this.ucmp(S);return this.negative!==0?0|-C:C},t.prototype.ucmp=function(S){if(this.length>S.length)return 1;if(this.length<S.length)return-1;for(var C=0,E=this.length-1;E>=0;E--){var h=0|this.words[E],y=0|S.words[E];if(h!==y){h<y?C=-1:h>y&&(C=1);break}}return C},t.prototype.gtn=function(S){return this.cmpn(S)===1},t.prototype.gt=function(S){return this.cmp(S)===1},t.prototype.gten=function(S){return this.cmpn(S)>=0},t.prototype.gte=function(S){return this.cmp(S)>=0},t.prototype.ltn=function(S){return this.cmpn(S)===-1},t.prototype.lt=function(S){return this.cmp(S)===-1},t.prototype.lten=function(S){return this.cmpn(S)<=0},t.prototype.lte=function(S){return this.cmp(S)<=0},t.prototype.eqn=function(S){return this.cmpn(S)===0},t.prototype.eq=function(S){return this.cmp(S)===0},t.red=function(S){return new z(S)},t.prototype.toRed=function(S){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),S.convertTo(this)._forceRed(S)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(S){return this.red=S,this},t.prototype.forceRed=function(S){return a(!this.red,"Already a number in reduction context"),this._forceRed(S)},t.prototype.redAdd=function(S){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,S)},t.prototype.redIAdd=function(S){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,S)},t.prototype.redSub=function(S){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,S)},t.prototype.redISub=function(S){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,S)},t.prototype.redShl=function(S){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,S)},t.prototype.redMul=function(S){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,S),this.red.mul(this,S)},t.prototype.redIMul=function(S){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,S),this.red.imul(this,S)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(S){return a(this.red&&!S.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,S)};var B={k256:null,p224:null,p192:null,p25519:null};function O(S,C){this.name=S,this.p=new t(C,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function L(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function R(){O.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P(){O.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function j(){O.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function z(S){if(typeof S=="string"){var C=t._prime(S);this.m=C.p,this.prime=C}else a(S.gtn(1),"modulus must be greater than 1"),this.m=S,this.prime=null}function N(S){z.call(this,S),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}O.prototype._tmp=function(){var S=new t(null);return S.words=new Array(Math.ceil(this.n/13)),S},O.prototype.ireduce=function(S){var C,E=S;do this.split(E,this.tmp),C=(E=(E=this.imulK(E)).iadd(this.tmp)).bitLength();while(C>this.n);var h=C<this.n?-1:E.ucmp(this.p);return h===0?(E.words[0]=0,E.length=1):h>0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},O.prototype.split=function(S,C){S.iushrn(this.n,0,C)},O.prototype.imulK=function(S){return S.imul(this.k)},r(L,O),L.prototype.split=function(S,C){for(var E=Math.min(S.length,9),h=0;h<E;h++)C.words[h]=S.words[h];if(C.length=E,S.length<=9)return S.words[0]=0,void(S.length=1);var y=S.words[9];for(C.words[C.length++]=4194303&y,h=10;h<S.length;h++){var w=0|S.words[h];S.words[h-10]=(4194303&w)<<4|y>>>22,y=w}y>>>=22,S.words[h-10]=y,y===0&&S.length>10?S.length-=10:S.length-=9},L.prototype.imulK=function(S){S.words[S.length]=0,S.words[S.length+1]=0,S.length+=2;for(var C=0,E=0;E<S.length;E++){var h=0|S.words[E];C+=977*h,S.words[E]=67108863&C,C=64*h+(C/67108864|0)}return S.words[S.length-1]===0&&(S.length--,S.words[S.length-1]===0&&S.length--),S},r(R,O),r(P,O),r(j,O),j.prototype.imulK=function(S){for(var C=0,E=0;E<S.length;E++){var h=19*(0|S.words[E])+C,y=67108863&h;h>>>=26,S.words[E]=y,C=h}return C!==0&&(S.words[S.length++]=C),S},t._prime=function(S){if(B[S])return B[S];var C;if(S==="k256")C=new L;else if(S==="p224")C=new R;else if(S==="p192")C=new P;else{if(S!=="p25519")throw new Error("Unknown prime "+S);C=new j}return B[S]=C,C},z.prototype._verify1=function(S){a(S.negative===0,"red works only with positives"),a(S.red,"red works only with red numbers")},z.prototype._verify2=function(S,C){a((S.negative|C.negative)==0,"red works only with positives"),a(S.red&&S.red===C.red,"red works only with red numbers")},z.prototype.imod=function(S){return this.prime?this.prime.ireduce(S)._forceRed(this):S.umod(this.m)._forceRed(this)},z.prototype.neg=function(S){return S.isZero()?S.clone():this.m.sub(S)._forceRed(this)},z.prototype.add=function(S,C){this._verify2(S,C);var E=S.add(C);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},z.prototype.iadd=function(S,C){this._verify2(S,C);var E=S.iadd(C);return E.cmp(this.m)>=0&&E.isub(this.m),E},z.prototype.sub=function(S,C){this._verify2(S,C);var E=S.sub(C);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},z.prototype.isub=function(S,C){this._verify2(S,C);var E=S.isub(C);return E.cmpn(0)<0&&E.iadd(this.m),E},z.prototype.shl=function(S,C){return this._verify1(S),this.imod(S.ushln(C))},z.prototype.imul=function(S,C){return this._verify2(S,C),this.imod(S.imul(C))},z.prototype.mul=function(S,C){return this._verify2(S,C),this.imod(S.mul(C))},z.prototype.isqr=function(S){return this.imul(S,S.clone())},z.prototype.sqr=function(S){return this.mul(S,S)},z.prototype.sqrt=function(S){if(S.isZero())return S.clone();var C=this.m.andln(3);if(a(C%2==1),C===3){var E=this.m.add(new t(1)).iushrn(2);return this.pow(S,E)}for(var h=this.m.subn(1),y=0;!h.isZero()&&h.andln(1)===0;)y++,h.iushrn(1);a(!h.isZero());var w=new t(1).toRed(this),x=w.redNeg(),_=this.m.subn(1).iushrn(1),T=this.m.bitLength();for(T=new t(2*T*T).toRed(this);this.pow(T,_).cmp(x)!==0;)T.redIAdd(x);for(var D=this.pow(T,h),q=this.pow(S,h.addn(1).iushrn(1)),$=this.pow(S,h),W=y;$.cmp(w)!==0;){for(var A=$,H=0;A.cmp(w)!==0;H++)A=A.redSqr();a(H<W);var M=this.pow(D,new t(1).iushln(W-H-1));q=q.redMul(M),D=M.redSqr(),$=$.redMul(D),W=H}return q},z.prototype.invm=function(S){var C=S._invmp(this.m);return C.negative!==0?(C.negative=0,this.imod(C).redNeg()):this.imod(C)},z.prototype.pow=function(S,C){if(C.isZero())return new t(1).toRed(this);if(C.cmpn(1)===0)return S.clone();var E=new Array(16);E[0]=new t(1).toRed(this),E[1]=S;for(var h=2;h<E.length;h++)E[h]=this.mul(E[h-1],S);var y=E[0],w=0,x=0,_=C.bitLength()%26;for(_===0&&(_=26),h=C.length-1;h>=0;h--){for(var T=C.words[h],D=_-1;D>=0;D--){var q=T>>D&1;y!==E[0]&&(y=this.sqr(y)),q!==0||w!==0?(w<<=1,w|=q,(++x===4||h===0&&D===0)&&(y=this.mul(y,E[w]),x=0,w=0)):x=0}_=26}return y},z.prototype.convertTo=function(S){var C=S.umod(this.m);return C===S?C.clone():C},z.prototype.convertFrom=function(S){var C=S.clone();return C.red=null,C},t.mont=function(S){return new N(S)},r(N,z),N.prototype.convertTo=function(S){return this.imod(S.ushln(this.shift))},N.prototype.convertFrom=function(S){var C=this.imod(S.mul(this.rinv));return C.red=null,C},N.prototype.imul=function(S,C){if(S.isZero()||C.isZero())return S.words[0]=0,S.length=1,S;var E=S.imul(C),h=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=E.isub(h).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},N.prototype.mul=function(S,C){if(S.isZero()||C.isZero())return new t(0)._forceRed(this);var E=S.mul(C),h=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=E.isub(h).iushrn(this.shift),w=y;return y.cmp(this.m)>=0?w=y.isub(this.m):y.cmpn(0)<0&&(w=y.iadd(this.m)),w._forceRed(this)},N.prototype.invm=function(S){return this.imod(S._invmp(this.m).mul(this.r2))._forceRed(this)}})(p===void 0||p)},{buffer:188}],185:[function(e,p,b){"use strict";b.byteLength=function(s){var f=l(s),d=f[0],u=f[1];return 3*(d+u)/4-u},b.toByteArray=function(s){var f,d,u=l(s),g=u[0],m=u[1],v=new a((function(O,L,R){return 3*(L+R)/4-R})(0,g,m)),k=0,B=m>0?g-4:g;for(d=0;d<B;d+=4)f=i[s.charCodeAt(d)]<<18|i[s.charCodeAt(d+1)]<<12|i[s.charCodeAt(d+2)]<<6|i[s.charCodeAt(d+3)],v[k++]=f>>16&255,v[k++]=f>>8&255,v[k++]=255&f;return m===2&&(f=i[s.charCodeAt(d)]<<2|i[s.charCodeAt(d+1)]>>4,v[k++]=255&f),m===1&&(f=i[s.charCodeAt(d)]<<10|i[s.charCodeAt(d+1)]<<4|i[s.charCodeAt(d+2)]>>2,v[k++]=f>>8&255,v[k++]=255&f),v},b.fromByteArray=function(s){for(var f,d=s.length,u=d%3,g=[],m=0,v=d-u;m<v;m+=16383)g.push(o(s,m,m+16383>v?v:m+16383));return u===1?(f=s[d-1],g.push(c[f>>2]+c[f<<4&63]+"==")):u===2&&(f=(s[d-2]<<8)+s[d-1],g.push(c[f>>10]+c[f>>4&63]+c[f<<2&63]+"=")),g.join("")};for(var c=[],i=[],a=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=r.length;t<n;++t)c[t]=r[t],i[r.charCodeAt(t)]=t;function l(s){var f=s.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var d=s.indexOf("=");return d===-1&&(d=f),[d,d===f?0:4-d%4]}function o(s,f,d){for(var u,g,m=[],v=f;v<d;v+=3)u=(s[v]<<16&16711680)+(s[v+1]<<8&65280)+(255&s[v+2]),m.push(c[(g=u)>>18&63]+c[g>>12&63]+c[g>>6&63]+c[63&g]);return m.join("")}i[45]=62,i[95]=63},{}],186:[function(e,p,b){"use strict";(function(c,i){function a(h,y){if(!h)throw new Error(y||"Assertion failed")}function r(h,y){h.super_=y;var w=function(){};w.prototype=y.prototype,h.prototype=new w,h.prototype.constructor=h}function t(h,y,w){if(t.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&(y!=="le"&&y!=="be"||(w=y,y=10),this._init(h||0,y||10,w||"be"))}var n;typeof c=="object"?c.exports=t:(void 0).BN=t,t.BN=t,t.wordSize=26;try{n=typeof window<"u"&&window.Buffer!==void 0?window.Buffer:e("buffer").Buffer}catch{}function l(h,y){var w=h.charCodeAt(y);return w>=48&&w<=57?w-48:w>=65&&w<=70?w-55:w>=97&&w<=102?w-87:void a(!1,"Invalid character in "+h)}function o(h,y,w){var x=l(h,w);return w-1>=y&&(x|=l(h,w-1)<<4),x}function s(h,y,w,x){for(var _=0,T=0,D=Math.min(h.length,w),q=y;q<D;q++){var $=h.charCodeAt(q)-48;_*=x,T=$>=49?$-49+10:$>=17?$-17+10:$,a($>=0&&T<x,"Invalid character"),_+=T}return _}function f(h,y){h.words=y.words,h.length=y.length,h.negative=y.negative,h.red=y.red}if(t.isBN=function(h){return h instanceof t||h!==null&&typeof h=="object"&&h.constructor.wordSize===t.wordSize&&Array.isArray(h.words)},t.max=function(h,y){return h.cmp(y)>0?h:y},t.min=function(h,y){return h.cmp(y)<0?h:y},t.prototype._init=function(h,y,w){if(typeof h=="number")return this._initNumber(h,y,w);if(typeof h=="object")return this._initArray(h,y,w);y==="hex"&&(y=16),a(y===(0|y)&&y>=2&&y<=36);var x=0;(h=h.toString().replace(/\s+/g,""))[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,w):(this._parseBase(h,y,x),w==="le"&&this._initArray(this.toArray(),y,w)))},t.prototype._initNumber=function(h,y,w){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[67108863&h],this.length=1):h<4503599627370496?(this.words=[67108863&h,h/67108864&67108863],this.length=2):(a(h<9007199254740992),this.words=[67108863&h,h/67108864&67108863,1],this.length=3),w==="le"&&this._initArray(this.toArray(),y,w)},t.prototype._initArray=function(h,y,w){if(a(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,T,D=0;if(w==="be")for(x=h.length-1,_=0;x>=0;x-=3)T=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=T<<D&67108863,this.words[_+1]=T>>>26-D&67108863,(D+=24)>=26&&(D-=26,_++);else if(w==="le")for(x=0,_=0;x<h.length;x+=3)T=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=T<<D&67108863,this.words[_+1]=T>>>26-D&67108863,(D+=24)>=26&&(D-=26,_++);return this._strip()},t.prototype._parseHex=function(h,y,w){this.length=Math.ceil((h.length-y)/6),this.words=new Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,T=0,D=0;if(w==="be")for(x=h.length-1;x>=y;x-=2)_=o(h,y,x)<<T,this.words[D]|=67108863&_,T>=18?(T-=18,D+=1,this.words[D]|=_>>>26):T+=8;else for(x=(h.length-y)%2==0?y+1:y;x<h.length;x+=2)_=o(h,y,x)<<T,this.words[D]|=67108863&_,T>=18?(T-=18,D+=1,this.words[D]|=_>>>26):T+=8;this._strip()},t.prototype._parseBase=function(h,y,w){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var T=h.length-w,D=T%x,q=Math.min(T,T-D)+w,$=0,W=w;W<q;W+=x)$=s(h,W,W+x,y),this.imuln(_),this.words[0]+$<67108864?this.words[0]+=$:this._iaddn($);if(D!==0){var A=1;for($=s(h,W,h.length,y),W=0;W<D;W++)A*=y;this.imuln(A),this.words[0]+$<67108864?this.words[0]+=$:this._iaddn($)}this._strip()},t.prototype.copy=function(h){h.words=new Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},t.prototype._move=function(h){f(h,this)},t.prototype.clone=function(){var h=new t(null);return this.copy(h),h},t.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},t.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},t.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{t.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{t.prototype.inspect=d}else t.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];t.prototype.toString=function(h,y){var w;if(y=0|y||1,(h=h||10)===16||h==="hex"){w="";for(var x=0,_=0,T=0;T<this.length;T++){var D=this.words[T],q=(16777215&(D<<x|_)).toString(16);_=D>>>24-x&16777215,(x+=2)>=26&&(x-=26,T--),w=_!==0||T!==this.length-1?u[6-q.length]+q+w:q+w}for(_!==0&&(w=_.toString(16)+w);w.length%y!=0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(h===(0|h)&&h>=2&&h<=36){var $=g[h],W=m[h];w="";var A=this.clone();for(A.negative=0;!A.isZero();){var H=A.modrn(W).toString(h);w=(A=A.idivn(W)).isZero()?H+w:u[$-H.length]+H+w}for(this.isZero()&&(w="0"+w);w.length%y!=0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}a(!1,"Base should be between 2 and 36")},t.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=67108864*this.words[1]:this.length===3&&this.words[2]===1?h+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},t.prototype.toJSON=function(){return this.toString(16,2)},n&&(t.prototype.toBuffer=function(h,y){return this.toArrayLike(n,h,y)}),t.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)};function v(h,y,w){w.negative=y.negative^h.negative;var x=h.length+y.length|0;w.length=x,x=x-1|0;var _=0|h.words[0],T=0|y.words[0],D=_*T,q=67108863&D,$=D/67108864|0;w.words[0]=q;for(var W=1;W<x;W++){for(var A=$>>>26,H=67108863&$,M=Math.min(W,y.length-1),I=Math.max(0,W-h.length+1);I<=M;I++){var F=W-I|0;A+=(D=(_=0|h.words[F])*(T=0|y.words[I])+H)/67108864|0,H=67108863&D}w.words[W]=0|H,$=0|A}return $!==0?w.words[W]=0|$:w.length--,w._strip()}t.prototype.toArrayLike=function(h,y,w){this._strip();var x=this.byteLength(),_=w||Math.max(1,x);a(x<=_,"byte array longer than desired length"),a(_>0,"Requested array length <= 0");var T=(function(D,q){return D.allocUnsafe?D.allocUnsafe(q):new D(q)})(h,_);return this["_toArrayLike"+(y==="le"?"LE":"BE")](T,x),T},t.prototype._toArrayLikeLE=function(h,y){for(var w=0,x=0,_=0,T=0;_<this.length;_++){var D=this.words[_]<<T|x;h[w++]=255&D,w<h.length&&(h[w++]=D>>8&255),w<h.length&&(h[w++]=D>>16&255),T===6?(w<h.length&&(h[w++]=D>>24&255),x=0,T=0):(x=D>>>24,T+=2)}if(w<h.length)for(h[w++]=x;w<h.length;)h[w++]=0},t.prototype._toArrayLikeBE=function(h,y){for(var w=h.length-1,x=0,_=0,T=0;_<this.length;_++){var D=this.words[_]<<T|x;h[w--]=255&D,w>=0&&(h[w--]=D>>8&255),w>=0&&(h[w--]=D>>16&255),T===6?(w>=0&&(h[w--]=D>>24&255),x=0,T=0):(x=D>>>24,T+=2)}if(w>=0)for(h[w--]=x;w>=0;)h[w--]=0},Math.clz32?t.prototype._countBits=function(h){return 32-Math.clz32(h)}:t.prototype._countBits=function(h){var y=h,w=0;return y>=4096&&(w+=13,y>>>=13),y>=64&&(w+=7,y>>>=7),y>=8&&(w+=4,y>>>=4),y>=2&&(w+=2,y>>>=2),w+y},t.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,w=0;return(8191&y)==0&&(w+=13,y>>>=13),(127&y)==0&&(w+=7,y>>>=7),(15&y)==0&&(w+=4,y>>>=4),(3&y)==0&&(w+=2,y>>>=2),(1&y)==0&&w++,w},t.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return 26*(this.length-1)+y},t.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var w=this._zeroBits(this.words[y]);if(h+=w,w!==26)break}return h},t.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},t.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},t.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},t.prototype.isNeg=function(){return this.negative!==0},t.prototype.neg=function(){return this.clone().ineg()},t.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},t.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this._strip()},t.prototype.ior=function(h){return a((this.negative|h.negative)==0),this.iuor(h)},t.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},t.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},t.prototype.iuand=function(h){var y;y=this.length>h.length?h:this;for(var w=0;w<y.length;w++)this.words[w]=this.words[w]&h.words[w];return this.length=y.length,this._strip()},t.prototype.iand=function(h){return a((this.negative|h.negative)==0),this.iuand(h)},t.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},t.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},t.prototype.iuxor=function(h){var y,w;this.length>h.length?(y=this,w=h):(y=h,w=this);for(var x=0;x<w.length;x++)this.words[x]=y.words[x]^w.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this._strip()},t.prototype.ixor=function(h){return a((this.negative|h.negative)==0),this.iuxor(h)},t.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},t.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},t.prototype.inotn=function(h){a(typeof h=="number"&&h>=0);var y=0|Math.ceil(h/26),w=h%26;this._expand(y),w>0&&y--;for(var x=0;x<y;x++)this.words[x]=67108863&~this.words[x];return w>0&&(this.words[x]=~this.words[x]&67108863>>26-w),this._strip()},t.prototype.notn=function(h){return this.clone().inotn(h)},t.prototype.setn=function(h,y){a(typeof h=="number"&&h>=0);var w=h/26|0,x=h%26;return this._expand(w+1),this.words[w]=y?this.words[w]|1<<x:this.words[w]&~(1<<x),this._strip()},t.prototype.iadd=function(h){var y,w,x;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();this.length>h.length?(w=this,x=h):(w=h,x=this);for(var _=0,T=0;T<x.length;T++)y=(0|w.words[T])+(0|x.words[T])+_,this.words[T]=67108863&y,_=y>>>26;for(;_!==0&&T<w.length;T++)y=(0|w.words[T])+_,this.words[T]=67108863&y,_=y>>>26;if(this.length=w.length,_!==0)this.words[this.length]=_,this.length++;else if(w!==this)for(;T<w.length;T++)this.words[T]=w.words[T];return this},t.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},t.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var w,x,_=this.cmp(h);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;_>0?(w=this,x=h):(w=h,x=this);for(var T=0,D=0;D<x.length;D++)T=(y=(0|w.words[D])-(0|x.words[D])+T)>>26,this.words[D]=67108863&y;for(;T!==0&&D<w.length;D++)T=(y=(0|w.words[D])+T)>>26,this.words[D]=67108863&y;if(T===0&&D<w.length&&w!==this)for(;D<w.length;D++)this.words[D]=w.words[D];return this.length=Math.max(this.length,D),w!==this&&(this.negative=1),this._strip()},t.prototype.sub=function(h){return this.clone().isub(h)};var k=function(h,y,w){var x,_,T,D=h.words,q=y.words,$=w.words,W=0,A=0|D[0],H=8191&A,M=A>>>13,I=0|D[1],F=8191&I,U=I>>>13,X=0|D[2],V=8191&X,G=X>>>13,ee=0|D[3],Z=8191&ee,K=ee>>>13,Q=0|D[4],J=8191&Q,ne=Q>>>13,ie=0|D[5],le=8191&ie,re=ie>>>13,se=0|D[6],be=8191&se,ye=se>>>13,Fe=0|D[7],Ce=8191&Fe,ae=Fe>>>13,De=0|D[8],Be=8191&De,ke=De>>>13,Re=0|D[9],we=8191&Re,ve=Re>>>13,Ze=0|q[0],Se=8191&Ze,de=Ze>>>13,Ee=0|q[1],_e=8191&Ee,Ie=Ee>>>13,ot=0|q[2],Le=8191&ot,Ae=ot>>>13,vt=0|q[3],ze=8191&vt,qe=vt>>>13,dt=0|q[4],Ue=8191&dt,Oe=dt>>>13,Ft=0|q[5],He=8191&Ft,te=Ft>>>13,ue=0|q[6],fe=8191&ue,me=ue>>>13,Je=0|q[7],Me=8191&Je,Ne=Je>>>13,ht=0|q[8],je=8191&ht,Pe=ht>>>13,ft=0|q[9],rt=8191&ft,et=ft>>>13;w.negative=h.negative^y.negative,w.length=19;var yt=(W+(x=Math.imul(H,Se))|0)+((8191&(_=(_=Math.imul(H,de))+Math.imul(M,Se)|0))<<13)|0;W=((T=Math.imul(M,de))+(_>>>13)|0)+(yt>>>26)|0,yt&=67108863,x=Math.imul(F,Se),_=(_=Math.imul(F,de))+Math.imul(U,Se)|0,T=Math.imul(U,de);var lt=(W+(x=x+Math.imul(H,_e)|0)|0)+((8191&(_=(_=_+Math.imul(H,Ie)|0)+Math.imul(M,_e)|0))<<13)|0;W=((T=T+Math.imul(M,Ie)|0)+(_>>>13)|0)+(lt>>>26)|0,lt&=67108863,x=Math.imul(V,Se),_=(_=Math.imul(V,de))+Math.imul(G,Se)|0,T=Math.imul(G,de),x=x+Math.imul(F,_e)|0,_=(_=_+Math.imul(F,Ie)|0)+Math.imul(U,_e)|0,T=T+Math.imul(U,Ie)|0;var mt=(W+(x=x+Math.imul(H,Le)|0)|0)+((8191&(_=(_=_+Math.imul(H,Ae)|0)+Math.imul(M,Le)|0))<<13)|0;W=((T=T+Math.imul(M,Ae)|0)+(_>>>13)|0)+(mt>>>26)|0,mt&=67108863,x=Math.imul(Z,Se),_=(_=Math.imul(Z,de))+Math.imul(K,Se)|0,T=Math.imul(K,de),x=x+Math.imul(V,_e)|0,_=(_=_+Math.imul(V,Ie)|0)+Math.imul(G,_e)|0,T=T+Math.imul(G,Ie)|0,x=x+Math.imul(F,Le)|0,_=(_=_+Math.imul(F,Ae)|0)+Math.imul(U,Le)|0,T=T+Math.imul(U,Ae)|0;var er=(W+(x=x+Math.imul(H,ze)|0)|0)+((8191&(_=(_=_+Math.imul(H,qe)|0)+Math.imul(M,ze)|0))<<13)|0;W=((T=T+Math.imul(M,qe)|0)+(_>>>13)|0)+(er>>>26)|0,er&=67108863,x=Math.imul(J,Se),_=(_=Math.imul(J,de))+Math.imul(ne,Se)|0,T=Math.imul(ne,de),x=x+Math.imul(Z,_e)|0,_=(_=_+Math.imul(Z,Ie)|0)+Math.imul(K,_e)|0,T=T+Math.imul(K,Ie)|0,x=x+Math.imul(V,Le)|0,_=(_=_+Math.imul(V,Ae)|0)+Math.imul(G,Le)|0,T=T+Math.imul(G,Ae)|0,x=x+Math.imul(F,ze)|0,_=(_=_+Math.imul(F,qe)|0)+Math.imul(U,ze)|0,T=T+Math.imul(U,qe)|0;var Nt=(W+(x=x+Math.imul(H,Ue)|0)|0)+((8191&(_=(_=_+Math.imul(H,Oe)|0)+Math.imul(M,Ue)|0))<<13)|0;W=((T=T+Math.imul(M,Oe)|0)+(_>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,x=Math.imul(le,Se),_=(_=Math.imul(le,de))+Math.imul(re,Se)|0,T=Math.imul(re,de),x=x+Math.imul(J,_e)|0,_=(_=_+Math.imul(J,Ie)|0)+Math.imul(ne,_e)|0,T=T+Math.imul(ne,Ie)|0,x=x+Math.imul(Z,Le)|0,_=(_=_+Math.imul(Z,Ae)|0)+Math.imul(K,Le)|0,T=T+Math.imul(K,Ae)|0,x=x+Math.imul(V,ze)|0,_=(_=_+Math.imul(V,qe)|0)+Math.imul(G,ze)|0,T=T+Math.imul(G,qe)|0,x=x+Math.imul(F,Ue)|0,_=(_=_+Math.imul(F,Oe)|0)+Math.imul(U,Ue)|0,T=T+Math.imul(U,Oe)|0;var Ut=(W+(x=x+Math.imul(H,He)|0)|0)+((8191&(_=(_=_+Math.imul(H,te)|0)+Math.imul(M,He)|0))<<13)|0;W=((T=T+Math.imul(M,te)|0)+(_>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,x=Math.imul(be,Se),_=(_=Math.imul(be,de))+Math.imul(ye,Se)|0,T=Math.imul(ye,de),x=x+Math.imul(le,_e)|0,_=(_=_+Math.imul(le,Ie)|0)+Math.imul(re,_e)|0,T=T+Math.imul(re,Ie)|0,x=x+Math.imul(J,Le)|0,_=(_=_+Math.imul(J,Ae)|0)+Math.imul(ne,Le)|0,T=T+Math.imul(ne,Ae)|0,x=x+Math.imul(Z,ze)|0,_=(_=_+Math.imul(Z,qe)|0)+Math.imul(K,ze)|0,T=T+Math.imul(K,qe)|0,x=x+Math.imul(V,Ue)|0,_=(_=_+Math.imul(V,Oe)|0)+Math.imul(G,Ue)|0,T=T+Math.imul(G,Oe)|0,x=x+Math.imul(F,He)|0,_=(_=_+Math.imul(F,te)|0)+Math.imul(U,He)|0,T=T+Math.imul(U,te)|0;var Y=(W+(x=x+Math.imul(H,fe)|0)|0)+((8191&(_=(_=_+Math.imul(H,me)|0)+Math.imul(M,fe)|0))<<13)|0;W=((T=T+Math.imul(M,me)|0)+(_>>>13)|0)+(Y>>>26)|0,Y&=67108863,x=Math.imul(Ce,Se),_=(_=Math.imul(Ce,de))+Math.imul(ae,Se)|0,T=Math.imul(ae,de),x=x+Math.imul(be,_e)|0,_=(_=_+Math.imul(be,Ie)|0)+Math.imul(ye,_e)|0,T=T+Math.imul(ye,Ie)|0,x=x+Math.imul(le,Le)|0,_=(_=_+Math.imul(le,Ae)|0)+Math.imul(re,Le)|0,T=T+Math.imul(re,Ae)|0,x=x+Math.imul(J,ze)|0,_=(_=_+Math.imul(J,qe)|0)+Math.imul(ne,ze)|0,T=T+Math.imul(ne,qe)|0,x=x+Math.imul(Z,Ue)|0,_=(_=_+Math.imul(Z,Oe)|0)+Math.imul(K,Ue)|0,T=T+Math.imul(K,Oe)|0,x=x+Math.imul(V,He)|0,_=(_=_+Math.imul(V,te)|0)+Math.imul(G,He)|0,T=T+Math.imul(G,te)|0,x=x+Math.imul(F,fe)|0,_=(_=_+Math.imul(F,me)|0)+Math.imul(U,fe)|0,T=T+Math.imul(U,me)|0;var ce=(W+(x=x+Math.imul(H,Me)|0)|0)+((8191&(_=(_=_+Math.imul(H,Ne)|0)+Math.imul(M,Me)|0))<<13)|0;W=((T=T+Math.imul(M,Ne)|0)+(_>>>13)|0)+(ce>>>26)|0,ce&=67108863,x=Math.imul(Be,Se),_=(_=Math.imul(Be,de))+Math.imul(ke,Se)|0,T=Math.imul(ke,de),x=x+Math.imul(Ce,_e)|0,_=(_=_+Math.imul(Ce,Ie)|0)+Math.imul(ae,_e)|0,T=T+Math.imul(ae,Ie)|0,x=x+Math.imul(be,Le)|0,_=(_=_+Math.imul(be,Ae)|0)+Math.imul(ye,Le)|0,T=T+Math.imul(ye,Ae)|0,x=x+Math.imul(le,ze)|0,_=(_=_+Math.imul(le,qe)|0)+Math.imul(re,ze)|0,T=T+Math.imul(re,qe)|0,x=x+Math.imul(J,Ue)|0,_=(_=_+Math.imul(J,Oe)|0)+Math.imul(ne,Ue)|0,T=T+Math.imul(ne,Oe)|0,x=x+Math.imul(Z,He)|0,_=(_=_+Math.imul(Z,te)|0)+Math.imul(K,He)|0,T=T+Math.imul(K,te)|0,x=x+Math.imul(V,fe)|0,_=(_=_+Math.imul(V,me)|0)+Math.imul(G,fe)|0,T=T+Math.imul(G,me)|0,x=x+Math.imul(F,Me)|0,_=(_=_+Math.imul(F,Ne)|0)+Math.imul(U,Me)|0,T=T+Math.imul(U,Ne)|0;var ge=(W+(x=x+Math.imul(H,je)|0)|0)+((8191&(_=(_=_+Math.imul(H,Pe)|0)+Math.imul(M,je)|0))<<13)|0;W=((T=T+Math.imul(M,Pe)|0)+(_>>>13)|0)+(ge>>>26)|0,ge&=67108863,x=Math.imul(we,Se),_=(_=Math.imul(we,de))+Math.imul(ve,Se)|0,T=Math.imul(ve,de),x=x+Math.imul(Be,_e)|0,_=(_=_+Math.imul(Be,Ie)|0)+Math.imul(ke,_e)|0,T=T+Math.imul(ke,Ie)|0,x=x+Math.imul(Ce,Le)|0,_=(_=_+Math.imul(Ce,Ae)|0)+Math.imul(ae,Le)|0,T=T+Math.imul(ae,Ae)|0,x=x+Math.imul(be,ze)|0,_=(_=_+Math.imul(be,qe)|0)+Math.imul(ye,ze)|0,T=T+Math.imul(ye,qe)|0,x=x+Math.imul(le,Ue)|0,_=(_=_+Math.imul(le,Oe)|0)+Math.imul(re,Ue)|0,T=T+Math.imul(re,Oe)|0,x=x+Math.imul(J,He)|0,_=(_=_+Math.imul(J,te)|0)+Math.imul(ne,He)|0,T=T+Math.imul(ne,te)|0,x=x+Math.imul(Z,fe)|0,_=(_=_+Math.imul(Z,me)|0)+Math.imul(K,fe)|0,T=T+Math.imul(K,me)|0,x=x+Math.imul(V,Me)|0,_=(_=_+Math.imul(V,Ne)|0)+Math.imul(G,Me)|0,T=T+Math.imul(G,Ne)|0,x=x+Math.imul(F,je)|0,_=(_=_+Math.imul(F,Pe)|0)+Math.imul(U,je)|0,T=T+Math.imul(U,Pe)|0;var he=(W+(x=x+Math.imul(H,rt)|0)|0)+((8191&(_=(_=_+Math.imul(H,et)|0)+Math.imul(M,rt)|0))<<13)|0;W=((T=T+Math.imul(M,et)|0)+(_>>>13)|0)+(he>>>26)|0,he&=67108863,x=Math.imul(we,_e),_=(_=Math.imul(we,Ie))+Math.imul(ve,_e)|0,T=Math.imul(ve,Ie),x=x+Math.imul(Be,Le)|0,_=(_=_+Math.imul(Be,Ae)|0)+Math.imul(ke,Le)|0,T=T+Math.imul(ke,Ae)|0,x=x+Math.imul(Ce,ze)|0,_=(_=_+Math.imul(Ce,qe)|0)+Math.imul(ae,ze)|0,T=T+Math.imul(ae,qe)|0,x=x+Math.imul(be,Ue)|0,_=(_=_+Math.imul(be,Oe)|0)+Math.imul(ye,Ue)|0,T=T+Math.imul(ye,Oe)|0,x=x+Math.imul(le,He)|0,_=(_=_+Math.imul(le,te)|0)+Math.imul(re,He)|0,T=T+Math.imul(re,te)|0,x=x+Math.imul(J,fe)|0,_=(_=_+Math.imul(J,me)|0)+Math.imul(ne,fe)|0,T=T+Math.imul(ne,me)|0,x=x+Math.imul(Z,Me)|0,_=(_=_+Math.imul(Z,Ne)|0)+Math.imul(K,Me)|0,T=T+Math.imul(K,Ne)|0,x=x+Math.imul(V,je)|0,_=(_=_+Math.imul(V,Pe)|0)+Math.imul(G,je)|0,T=T+Math.imul(G,Pe)|0;var oe=(W+(x=x+Math.imul(F,rt)|0)|0)+((8191&(_=(_=_+Math.imul(F,et)|0)+Math.imul(U,rt)|0))<<13)|0;W=((T=T+Math.imul(U,et)|0)+(_>>>13)|0)+(oe>>>26)|0,oe&=67108863,x=Math.imul(we,Le),_=(_=Math.imul(we,Ae))+Math.imul(ve,Le)|0,T=Math.imul(ve,Ae),x=x+Math.imul(Be,ze)|0,_=(_=_+Math.imul(Be,qe)|0)+Math.imul(ke,ze)|0,T=T+Math.imul(ke,qe)|0,x=x+Math.imul(Ce,Ue)|0,_=(_=_+Math.imul(Ce,Oe)|0)+Math.imul(ae,Ue)|0,T=T+Math.imul(ae,Oe)|0,x=x+Math.imul(be,He)|0,_=(_=_+Math.imul(be,te)|0)+Math.imul(ye,He)|0,T=T+Math.imul(ye,te)|0,x=x+Math.imul(le,fe)|0,_=(_=_+Math.imul(le,me)|0)+Math.imul(re,fe)|0,T=T+Math.imul(re,me)|0,x=x+Math.imul(J,Me)|0,_=(_=_+Math.imul(J,Ne)|0)+Math.imul(ne,Me)|0,T=T+Math.imul(ne,Ne)|0,x=x+Math.imul(Z,je)|0,_=(_=_+Math.imul(Z,Pe)|0)+Math.imul(K,je)|0,T=T+Math.imul(K,Pe)|0;var pe=(W+(x=x+Math.imul(V,rt)|0)|0)+((8191&(_=(_=_+Math.imul(V,et)|0)+Math.imul(G,rt)|0))<<13)|0;W=((T=T+Math.imul(G,et)|0)+(_>>>13)|0)+(pe>>>26)|0,pe&=67108863,x=Math.imul(we,ze),_=(_=Math.imul(we,qe))+Math.imul(ve,ze)|0,T=Math.imul(ve,qe),x=x+Math.imul(Be,Ue)|0,_=(_=_+Math.imul(Be,Oe)|0)+Math.imul(ke,Ue)|0,T=T+Math.imul(ke,Oe)|0,x=x+Math.imul(Ce,He)|0,_=(_=_+Math.imul(Ce,te)|0)+Math.imul(ae,He)|0,T=T+Math.imul(ae,te)|0,x=x+Math.imul(be,fe)|0,_=(_=_+Math.imul(be,me)|0)+Math.imul(ye,fe)|0,T=T+Math.imul(ye,me)|0,x=x+Math.imul(le,Me)|0,_=(_=_+Math.imul(le,Ne)|0)+Math.imul(re,Me)|0,T=T+Math.imul(re,Ne)|0,x=x+Math.imul(J,je)|0,_=(_=_+Math.imul(J,Pe)|0)+Math.imul(ne,je)|0,T=T+Math.imul(ne,Pe)|0;var Te=(W+(x=x+Math.imul(Z,rt)|0)|0)+((8191&(_=(_=_+Math.imul(Z,et)|0)+Math.imul(K,rt)|0))<<13)|0;W=((T=T+Math.imul(K,et)|0)+(_>>>13)|0)+(Te>>>26)|0,Te&=67108863,x=Math.imul(we,Ue),_=(_=Math.imul(we,Oe))+Math.imul(ve,Ue)|0,T=Math.imul(ve,Oe),x=x+Math.imul(Be,He)|0,_=(_=_+Math.imul(Be,te)|0)+Math.imul(ke,He)|0,T=T+Math.imul(ke,te)|0,x=x+Math.imul(Ce,fe)|0,_=(_=_+Math.imul(Ce,me)|0)+Math.imul(ae,fe)|0,T=T+Math.imul(ae,me)|0,x=x+Math.imul(be,Me)|0,_=(_=_+Math.imul(be,Ne)|0)+Math.imul(ye,Me)|0,T=T+Math.imul(ye,Ne)|0,x=x+Math.imul(le,je)|0,_=(_=_+Math.imul(le,Pe)|0)+Math.imul(re,je)|0,T=T+Math.imul(re,Pe)|0;var tt=(W+(x=x+Math.imul(J,rt)|0)|0)+((8191&(_=(_=_+Math.imul(J,et)|0)+Math.imul(ne,rt)|0))<<13)|0;W=((T=T+Math.imul(ne,et)|0)+(_>>>13)|0)+(tt>>>26)|0,tt&=67108863,x=Math.imul(we,He),_=(_=Math.imul(we,te))+Math.imul(ve,He)|0,T=Math.imul(ve,te),x=x+Math.imul(Be,fe)|0,_=(_=_+Math.imul(Be,me)|0)+Math.imul(ke,fe)|0,T=T+Math.imul(ke,me)|0,x=x+Math.imul(Ce,Me)|0,_=(_=_+Math.imul(Ce,Ne)|0)+Math.imul(ae,Me)|0,T=T+Math.imul(ae,Ne)|0,x=x+Math.imul(be,je)|0,_=(_=_+Math.imul(be,Pe)|0)+Math.imul(ye,je)|0,T=T+Math.imul(ye,Pe)|0;var Ke=(W+(x=x+Math.imul(le,rt)|0)|0)+((8191&(_=(_=_+Math.imul(le,et)|0)+Math.imul(re,rt)|0))<<13)|0;W=((T=T+Math.imul(re,et)|0)+(_>>>13)|0)+(Ke>>>26)|0,Ke&=67108863,x=Math.imul(we,fe),_=(_=Math.imul(we,me))+Math.imul(ve,fe)|0,T=Math.imul(ve,me),x=x+Math.imul(Be,Me)|0,_=(_=_+Math.imul(Be,Ne)|0)+Math.imul(ke,Me)|0,T=T+Math.imul(ke,Ne)|0,x=x+Math.imul(Ce,je)|0,_=(_=_+Math.imul(Ce,Pe)|0)+Math.imul(ae,je)|0,T=T+Math.imul(ae,Pe)|0;var Ve=(W+(x=x+Math.imul(be,rt)|0)|0)+((8191&(_=(_=_+Math.imul(be,et)|0)+Math.imul(ye,rt)|0))<<13)|0;W=((T=T+Math.imul(ye,et)|0)+(_>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,x=Math.imul(we,Me),_=(_=Math.imul(we,Ne))+Math.imul(ve,Me)|0,T=Math.imul(ve,Ne),x=x+Math.imul(Be,je)|0,_=(_=_+Math.imul(Be,Pe)|0)+Math.imul(ke,je)|0,T=T+Math.imul(ke,Pe)|0;var Ye=(W+(x=x+Math.imul(Ce,rt)|0)|0)+((8191&(_=(_=_+Math.imul(Ce,et)|0)+Math.imul(ae,rt)|0))<<13)|0;W=((T=T+Math.imul(ae,et)|0)+(_>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,x=Math.imul(we,je),_=(_=Math.imul(we,Pe))+Math.imul(ve,je)|0,T=Math.imul(ve,Pe);var zt=(W+(x=x+Math.imul(Be,rt)|0)|0)+((8191&(_=(_=_+Math.imul(Be,et)|0)+Math.imul(ke,rt)|0))<<13)|0;W=((T=T+Math.imul(ke,et)|0)+(_>>>13)|0)+(zt>>>26)|0,zt&=67108863;var Vt=(W+(x=Math.imul(we,rt))|0)+((8191&(_=(_=Math.imul(we,et))+Math.imul(ve,rt)|0))<<13)|0;return W=((T=Math.imul(ve,et))+(_>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,$[0]=yt,$[1]=lt,$[2]=mt,$[3]=er,$[4]=Nt,$[5]=Ut,$[6]=Y,$[7]=ce,$[8]=ge,$[9]=he,$[10]=oe,$[11]=pe,$[12]=Te,$[13]=tt,$[14]=Ke,$[15]=Ve,$[16]=Ye,$[17]=zt,$[18]=Vt,W!==0&&($[19]=W,w.length++),w};function B(h,y,w){w.negative=y.negative^h.negative,w.length=h.length+y.length;for(var x=0,_=0,T=0;T<w.length-1;T++){var D=_;_=0;for(var q=67108863&x,$=Math.min(T,y.length-1),W=Math.max(0,T-h.length+1);W<=$;W++){var A=T-W,H=(0|h.words[A])*(0|y.words[W]),M=67108863&H;q=67108863&(M=M+q|0),_+=(D=(D=D+(H/67108864|0)|0)+(M>>>26)|0)>>>26,D&=67108863}w.words[T]=q,x=D,D=_}return x!==0?w.words[T]=x:w.length--,w._strip()}function O(h,y,w){return B(h,y,w)}function L(h,y){this.x=h,this.y=y}Math.imul||(k=v),t.prototype.mulTo=function(h,y){var w=this.length+h.length;return this.length===10&&h.length===10?k(this,h,y):w<63?v(this,h,y):w<1024?B(this,h,y):O(this,h,y)},L.prototype.makeRBT=function(h){for(var y=new Array(h),w=t.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,w,h);return y},L.prototype.revBin=function(h,y,w){if(h===0||h===w-1)return h;for(var x=0,_=0;_<y;_++)x|=(1&h)<<y-_-1,h>>=1;return x},L.prototype.permute=function(h,y,w,x,_,T){for(var D=0;D<T;D++)x[D]=y[h[D]],_[D]=w[h[D]]},L.prototype.transform=function(h,y,w,x,_,T){this.permute(T,h,y,w,x,_);for(var D=1;D<_;D<<=1)for(var q=D<<1,$=Math.cos(2*Math.PI/q),W=Math.sin(2*Math.PI/q),A=0;A<_;A+=q)for(var H=$,M=W,I=0;I<D;I++){var F=w[A+I],U=x[A+I],X=w[A+I+D],V=x[A+I+D],G=H*X-M*V;V=H*V+M*X,X=G,w[A+I]=F+X,x[A+I]=U+V,w[A+I+D]=F-X,x[A+I+D]=U-V,I!==q&&(G=$*H-W*M,M=$*M+W*H,H=G)}},L.prototype.guessLen13b=function(h,y){var w=1|Math.max(y,h),x=1&w,_=0;for(w=w/2|0;w;w>>>=1)_++;return 1<<_+1+x},L.prototype.conjugate=function(h,y,w){if(!(w<=1))for(var x=0;x<w/2;x++){var _=h[x];h[x]=h[w-x-1],h[w-x-1]=_,_=y[x],y[x]=-y[w-x-1],y[w-x-1]=-_}},L.prototype.normalize13b=function(h,y){for(var w=0,x=0;x<y/2;x++){var _=8192*Math.round(h[2*x+1]/y)+Math.round(h[2*x]/y)+w;h[x]=67108863&_,w=_<67108864?0:_/67108864|0}return h},L.prototype.convert13b=function(h,y,w,x){for(var _=0,T=0;T<y;T++)_+=0|h[T],w[2*T]=8191&_,_>>>=13,w[2*T+1]=8191&_,_>>>=13;for(T=2*y;T<x;++T)w[T]=0;a(_===0),a((-8192&_)==0)},L.prototype.stub=function(h){for(var y=new Array(h),w=0;w<h;w++)y[w]=0;return y},L.prototype.mulp=function(h,y,w){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),T=this.stub(x),D=new Array(x),q=new Array(x),$=new Array(x),W=new Array(x),A=new Array(x),H=new Array(x),M=w.words;M.length=x,this.convert13b(h.words,h.length,D,x),this.convert13b(y.words,y.length,W,x),this.transform(D,T,q,$,x,_),this.transform(W,T,A,H,x,_);for(var I=0;I<x;I++){var F=q[I]*A[I]-$[I]*H[I];$[I]=q[I]*H[I]+$[I]*A[I],q[I]=F}return this.conjugate(q,$,x),this.transform(q,$,M,T,x,_),this.conjugate(M,T,x),this.normalize13b(M,x),w.negative=h.negative^y.negative,w.length=h.length+y.length,w._strip()},t.prototype.mul=function(h){var y=new t(null);return y.words=new Array(this.length+h.length),this.mulTo(h,y)},t.prototype.mulf=function(h){var y=new t(null);return y.words=new Array(this.length+h.length),O(this,h,y)},t.prototype.imul=function(h){return this.clone().mulTo(h,this)},t.prototype.imuln=function(h){var y=h<0;y&&(h=-h),a(typeof h=="number"),a(h<67108864);for(var w=0,x=0;x<this.length;x++){var _=(0|this.words[x])*h,T=(67108863&_)+(67108863&w);w>>=26,w+=_/67108864|0,w+=T>>>26,this.words[x]=67108863&T}return w!==0&&(this.words[x]=w,this.length++),y?this.ineg():this},t.prototype.muln=function(h){return this.clone().imuln(h)},t.prototype.sqr=function(){return this.mul(this)},t.prototype.isqr=function(){return this.imul(this.clone())},t.prototype.pow=function(h){var y=(function(T){for(var D=new Array(T.bitLength()),q=0;q<D.length;q++){var $=q/26|0,W=q%26;D[q]=T.words[$]>>>W&1}return D})(h);if(y.length===0)return new t(1);for(var w=this,x=0;x<y.length&&y[x]===0;x++,w=w.sqr());if(++x<y.length)for(var _=w.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(w=w.mul(_));return w},t.prototype.iushln=function(h){a(typeof h=="number"&&h>=0);var y,w=h%26,x=(h-w)/26,_=67108863>>>26-w<<26-w;if(w!==0){var T=0;for(y=0;y<this.length;y++){var D=this.words[y]&_,q=(0|this.words[y])-D<<w;this.words[y]=q|T,T=D>>>26-w}T&&(this.words[y]=T,this.length++)}if(x!==0){for(y=this.length-1;y>=0;y--)this.words[y+x]=this.words[y];for(y=0;y<x;y++)this.words[y]=0;this.length+=x}return this._strip()},t.prototype.ishln=function(h){return a(this.negative===0),this.iushln(h)},t.prototype.iushrn=function(h,y,w){var x;a(typeof h=="number"&&h>=0),x=y?(y-y%26)/26:0;var _=h%26,T=Math.min((h-_)/26,this.length),D=67108863^67108863>>>_<<_,q=w;if(x-=T,x=Math.max(0,x),q){for(var $=0;$<T;$++)q.words[$]=this.words[$];q.length=T}if(T!==0)if(this.length>T)for(this.length-=T,$=0;$<this.length;$++)this.words[$]=this.words[$+T];else this.words[0]=0,this.length=1;var W=0;for($=this.length-1;$>=0&&(W!==0||$>=x);$--){var A=0|this.words[$];this.words[$]=W<<26-_|A>>>_,W=A&D}return q&&W!==0&&(q.words[q.length++]=W),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},t.prototype.ishrn=function(h,y,w){return a(this.negative===0),this.iushrn(h,y,w)},t.prototype.shln=function(h){return this.clone().ishln(h)},t.prototype.ushln=function(h){return this.clone().iushln(h)},t.prototype.shrn=function(h){return this.clone().ishrn(h)},t.prototype.ushrn=function(h){return this.clone().iushrn(h)},t.prototype.testn=function(h){a(typeof h=="number"&&h>=0);var y=h%26,w=(h-y)/26,x=1<<y;return!(this.length<=w)&&!!(this.words[w]&x)},t.prototype.imaskn=function(h){a(typeof h=="number"&&h>=0);var y=h%26,w=(h-y)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(y!==0&&w++,this.length=Math.min(w,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this._strip()},t.prototype.maskn=function(h){return this.clone().imaskn(h)},t.prototype.iaddn=function(h){return a(typeof h=="number"),a(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(0|this.words[0])<=h?(this.words[0]=h-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},t.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},t.prototype.isubn=function(h){if(a(typeof h=="number"),a(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this._strip()},t.prototype.addn=function(h){return this.clone().iaddn(h)},t.prototype.subn=function(h){return this.clone().isubn(h)},t.prototype.iabs=function(){return this.negative=0,this},t.prototype.abs=function(){return this.clone().iabs()},t.prototype._ishlnsubmul=function(h,y,w){var x,_,T=h.length+w;this._expand(T);var D=0;for(x=0;x<h.length;x++){_=(0|this.words[x+w])+D;var q=(0|h.words[x])*y;D=((_-=67108863&q)>>26)-(q/67108864|0),this.words[x+w]=67108863&_}for(;x<this.length-w;x++)D=(_=(0|this.words[x+w])+D)>>26,this.words[x+w]=67108863&_;if(D===0)return this._strip();for(a(D===-1),D=0,x=0;x<this.length;x++)D=(_=-(0|this.words[x])+D)>>26,this.words[x]=67108863&_;return this.negative=1,this._strip()},t.prototype._wordDiv=function(h,y){var w=(this.length,h.length),x=this.clone(),_=h,T=0|_.words[_.length-1];(w=26-this._countBits(T))!==0&&(_=_.ushln(w),x.iushln(w),T=0|_.words[_.length-1]);var D,q=x.length-_.length;if(y!=="mod"){(D=new t(null)).length=q+1,D.words=new Array(D.length);for(var $=0;$<D.length;$++)D.words[$]=0}var W=x.clone()._ishlnsubmul(_,1,q);W.negative===0&&(x=W,D&&(D.words[q]=1));for(var A=q-1;A>=0;A--){var H=67108864*(0|x.words[_.length+A])+(0|x.words[_.length+A-1]);for(H=Math.min(H/T|0,67108863),x._ishlnsubmul(_,H,A);x.negative!==0;)H--,x.negative=0,x._ishlnsubmul(_,1,A),x.isZero()||(x.negative^=1);D&&(D.words[A]=H)}return D&&D._strip(),x._strip(),y!=="div"&&w!==0&&x.iushrn(w),{div:D||null,mod:x}},t.prototype.divmod=function(h,y,w){return a(!h.isZero()),this.isZero()?{div:new t(0),mod:new t(0)}:this.negative!==0&&h.negative===0?(T=this.neg().divmod(h,y),y!=="mod"&&(x=T.div.neg()),y!=="div"&&(_=T.mod.neg(),w&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(T=this.divmod(h.neg(),y),y!=="mod"&&(x=T.div.neg()),{div:x,mod:T.mod}):(this.negative&h.negative)!=0?(T=this.neg().divmod(h.neg(),y),y!=="div"&&(_=T.mod.neg(),w&&_.negative!==0&&_.isub(h)),{div:T.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new t(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new t(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new t(this.modrn(h.words[0]))}:this._wordDiv(h,y);var x,_,T},t.prototype.div=function(h){return this.divmod(h,"div",!1).div},t.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},t.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},t.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var w=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),T=w.cmp(x);return T<0||_===1&&T===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},t.prototype.modrn=function(h){var y=h<0;y&&(h=-h),a(h<=67108863);for(var w=(1<<26)%h,x=0,_=this.length-1;_>=0;_--)x=(w*x+(0|this.words[_]))%h;return y?-x:x},t.prototype.modn=function(h){return this.modrn(h)},t.prototype.idivn=function(h){var y=h<0;y&&(h=-h),a(h<=67108863);for(var w=0,x=this.length-1;x>=0;x--){var _=(0|this.words[x])+67108864*w;this.words[x]=_/h|0,w=_%h}return this._strip(),y?this.ineg():this},t.prototype.divn=function(h){return this.clone().idivn(h)},t.prototype.egcd=function(h){a(h.negative===0),a(!h.isZero());var y=this,w=h.clone();y=y.negative!==0?y.umod(h):y.clone();for(var x=new t(1),_=new t(0),T=new t(0),D=new t(1),q=0;y.isEven()&&w.isEven();)y.iushrn(1),w.iushrn(1),++q;for(var $=w.clone(),W=y.clone();!y.isZero();){for(var A=0,H=1;(y.words[0]&H)==0&&A<26;++A,H<<=1);if(A>0)for(y.iushrn(A);A-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd($),_.isub(W)),x.iushrn(1),_.iushrn(1);for(var M=0,I=1;(w.words[0]&I)==0&&M<26;++M,I<<=1);if(M>0)for(w.iushrn(M);M-- >0;)(T.isOdd()||D.isOdd())&&(T.iadd($),D.isub(W)),T.iushrn(1),D.iushrn(1);y.cmp(w)>=0?(y.isub(w),x.isub(T),_.isub(D)):(w.isub(y),T.isub(x),D.isub(_))}return{a:T,b:D,gcd:w.iushln(q)}},t.prototype._invmp=function(h){a(h.negative===0),a(!h.isZero());var y=this,w=h.clone();y=y.negative!==0?y.umod(h):y.clone();for(var x,_=new t(1),T=new t(0),D=w.clone();y.cmpn(1)>0&&w.cmpn(1)>0;){for(var q=0,$=1;(y.words[0]&$)==0&&q<26;++q,$<<=1);if(q>0)for(y.iushrn(q);q-- >0;)_.isOdd()&&_.iadd(D),_.iushrn(1);for(var W=0,A=1;(w.words[0]&A)==0&&W<26;++W,A<<=1);if(W>0)for(w.iushrn(W);W-- >0;)T.isOdd()&&T.iadd(D),T.iushrn(1);y.cmp(w)>=0?(y.isub(w),_.isub(T)):(w.isub(y),T.isub(_))}return(x=y.cmpn(1)===0?_:T).cmpn(0)<0&&x.iadd(h),x},t.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),w=h.clone();y.negative=0,w.negative=0;for(var x=0;y.isEven()&&w.isEven();x++)y.iushrn(1),w.iushrn(1);for(;;){for(;y.isEven();)y.iushrn(1);for(;w.isEven();)w.iushrn(1);var _=y.cmp(w);if(_<0){var T=y;y=w,w=T}else if(_===0||w.cmpn(1)===0)break;y.isub(w)}return w.iushln(x)},t.prototype.invm=function(h){return this.egcd(h).a.umod(h)},t.prototype.isEven=function(){return(1&this.words[0])==0},t.prototype.isOdd=function(){return(1&this.words[0])==1},t.prototype.andln=function(h){return this.words[0]&h},t.prototype.bincn=function(h){a(typeof h=="number");var y=h%26,w=(h-y)/26,x=1<<y;if(this.length<=w)return this._expand(w+1),this.words[w]|=x,this;for(var _=x,T=w;_!==0&&T<this.length;T++){var D=0|this.words[T];_=(D+=_)>>>26,D&=67108863,this.words[T]=D}return _!==0&&(this.words[T]=_,this.length++),this},t.prototype.isZero=function(){return this.length===1&&this.words[0]===0},t.prototype.cmpn=function(h){var y,w=h<0;if(this.negative!==0&&!w)return-1;if(this.negative===0&&w)return 1;if(this._strip(),this.length>1)y=1;else{w&&(h=-h),a(h<=67108863,"Number is too big");var x=0|this.words[0];y=x===h?0:x<h?-1:1}return this.negative!==0?0|-y:y},t.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?0|-y:y},t.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,w=this.length-1;w>=0;w--){var x=0|this.words[w],_=0|h.words[w];if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},t.prototype.gtn=function(h){return this.cmpn(h)===1},t.prototype.gt=function(h){return this.cmp(h)===1},t.prototype.gten=function(h){return this.cmpn(h)>=0},t.prototype.gte=function(h){return this.cmp(h)>=0},t.prototype.ltn=function(h){return this.cmpn(h)===-1},t.prototype.lt=function(h){return this.cmp(h)===-1},t.prototype.lten=function(h){return this.cmpn(h)<=0},t.prototype.lte=function(h){return this.cmp(h)<=0},t.prototype.eqn=function(h){return this.cmpn(h)===0},t.prototype.eq=function(h){return this.cmp(h)===0},t.red=function(h){return new C(h)},t.prototype.toRed=function(h){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},t.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},t.prototype._forceRed=function(h){return this.red=h,this},t.prototype.forceRed=function(h){return a(!this.red,"Already a number in reduction context"),this._forceRed(h)},t.prototype.redAdd=function(h){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},t.prototype.redIAdd=function(h){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},t.prototype.redSub=function(h){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},t.prototype.redISub=function(h){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},t.prototype.redShl=function(h){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},t.prototype.redMul=function(h){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},t.prototype.redIMul=function(h){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},t.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},t.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},t.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},t.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},t.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},t.prototype.redPow=function(h){return a(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var R={k256:null,p224:null,p192:null,p25519:null};function P(h,y){this.name=h,this.p=new t(y,16),this.n=this.p.bitLength(),this.k=new t(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function j(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function z(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function N(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(h){if(typeof h=="string"){var y=t._prime(h);this.m=y.p,this.prime=y}else a(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}function E(h){C.call(this,h),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new t(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}P.prototype._tmp=function(){var h=new t(null);return h.words=new Array(Math.ceil(this.n/13)),h},P.prototype.ireduce=function(h){var y,w=h;do this.split(w,this.tmp),y=(w=(w=this.imulK(w)).iadd(this.tmp)).bitLength();while(y>this.n);var x=y<this.n?-1:w.ucmp(this.p);return x===0?(w.words[0]=0,w.length=1):x>0?w.isub(this.p):w.strip!==void 0?w.strip():w._strip(),w},P.prototype.split=function(h,y){h.iushrn(this.n,0,y)},P.prototype.imulK=function(h){return h.imul(this.k)},r(j,P),j.prototype.split=function(h,y){for(var w=Math.min(h.length,9),x=0;x<w;x++)y.words[x]=h.words[x];if(y.length=w,h.length<=9)return h.words[0]=0,void(h.length=1);var _=h.words[9];for(y.words[y.length++]=4194303&_,x=10;x<h.length;x++){var T=0|h.words[x];h.words[x-10]=(4194303&T)<<4|_>>>22,_=T}_>>>=22,h.words[x-10]=_,_===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,w=0;w<h.length;w++){var x=0|h.words[w];y+=977*x,h.words[w]=67108863&y,y=64*x+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h},r(z,P),r(N,P),r(S,P),S.prototype.imulK=function(h){for(var y=0,w=0;w<h.length;w++){var x=19*(0|h.words[w])+y,_=67108863&x;x>>>=26,h.words[w]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},t._prime=function(h){if(R[h])return R[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new z;else if(h==="p192")y=new N;else{if(h!=="p25519")throw new Error("Unknown prime "+h);y=new S}return R[h]=y,y},C.prototype._verify1=function(h){a(h.negative===0,"red works only with positives"),a(h.red,"red works only with red numbers")},C.prototype._verify2=function(h,y){a((h.negative|y.negative)==0,"red works only with positives"),a(h.red&&h.red===y.red,"red works only with red numbers")},C.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(f(h,h.umod(this.m)._forceRed(this)),h)},C.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},C.prototype.add=function(h,y){this._verify2(h,y);var w=h.add(y);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},C.prototype.iadd=function(h,y){this._verify2(h,y);var w=h.iadd(y);return w.cmp(this.m)>=0&&w.isub(this.m),w},C.prototype.sub=function(h,y){this._verify2(h,y);var w=h.sub(y);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},C.prototype.isub=function(h,y){this._verify2(h,y);var w=h.isub(y);return w.cmpn(0)<0&&w.iadd(this.m),w},C.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},C.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},C.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},C.prototype.isqr=function(h){return this.imul(h,h.clone())},C.prototype.sqr=function(h){return this.mul(h,h)},C.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(a(y%2==1),y===3){var w=this.m.add(new t(1)).iushrn(2);return this.pow(h,w)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);a(!x.isZero());var T=new t(1).toRed(this),D=T.redNeg(),q=this.m.subn(1).iushrn(1),$=this.m.bitLength();for($=new t(2*$*$).toRed(this);this.pow($,q).cmp(D)!==0;)$.redIAdd(D);for(var W=this.pow($,x),A=this.pow(h,x.addn(1).iushrn(1)),H=this.pow(h,x),M=_;H.cmp(T)!==0;){for(var I=H,F=0;I.cmp(T)!==0;F++)I=I.redSqr();a(F<M);var U=this.pow(W,new t(1).iushln(M-F-1));A=A.redMul(U),W=U.redSqr(),H=H.redMul(W),M=F}return A},C.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},C.prototype.pow=function(h,y){if(y.isZero())return new t(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var w=new Array(16);w[0]=new t(1).toRed(this),w[1]=h;for(var x=2;x<w.length;x++)w[x]=this.mul(w[x-1],h);var _=w[0],T=0,D=0,q=y.bitLength()%26;for(q===0&&(q=26),x=y.length-1;x>=0;x--){for(var $=y.words[x],W=q-1;W>=0;W--){var A=$>>W&1;_!==w[0]&&(_=this.sqr(_)),A!==0||T!==0?(T<<=1,T|=A,(++D===4||x===0&&W===0)&&(_=this.mul(_,w[T]),D=0,T=0)):D=0}q=26}return _},C.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},C.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},t.mont=function(h){return new E(h)},r(E,C),E.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},E.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},E.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var w=h.imul(y),x=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=w.isub(x).iushrn(this.shift),T=_;return _.cmp(this.m)>=0?T=_.isub(this.m):_.cmpn(0)<0&&(T=_.iadd(this.m)),T._forceRed(this)},E.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new t(0)._forceRed(this);var w=h.mul(y),x=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=w.isub(x).iushrn(this.shift),T=_;return _.cmp(this.m)>=0?T=_.isub(this.m):_.cmpn(0)<0&&(T=_.iadd(this.m)),T._forceRed(this)},E.prototype.invm=function(h){return this.imod(h._invmp(this.m).mul(this.r2))._forceRed(this)}})(p===void 0||p)},{buffer:188}],187:[function(e,p,b){"use strict";var c;function i(r){this.rand=r}if(p.exports=function(r){return c||(c=new i(null)),c.generate(r)},p.exports.Rand=i,i.prototype.generate=function(r){return this._rand(r)},i.prototype._rand=function(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},typeof self=="object")self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(r){var t=new Uint8Array(r);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(r){var t=new Uint8Array(r);return self.msCrypto.getRandomValues(t),t}:typeof window=="object"&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=e("crypto");if(typeof a.randomBytes!="function")throw new Error("Not supported");i.prototype._rand=function(r){return a.randomBytes(r)}}catch{}},{crypto:188}],188:[function(e,p,b){},{}],189:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer;function i(o){c.isBuffer(o)||(o=c.from(o));for(var s=o.length/4|0,f=new Array(s),d=0;d<s;d++)f[d]=o.readUInt32BE(4*d);return f}function a(o){for(;0<o.length;o++)o[0]=0}function r(o,s,f,d,u){for(var g,m,v,k,B=f[0],O=f[1],L=f[2],R=f[3],P=o[0]^s[0],j=o[1]^s[1],z=o[2]^s[2],N=o[3]^s[3],S=4,C=1;C<u;C++)g=B[P>>>24]^O[j>>>16&255]^L[z>>>8&255]^R[255&N]^s[S++],m=B[j>>>24]^O[z>>>16&255]^L[N>>>8&255]^R[255&P]^s[S++],v=B[z>>>24]^O[N>>>16&255]^L[P>>>8&255]^R[255&j]^s[S++],k=B[N>>>24]^O[P>>>16&255]^L[j>>>8&255]^R[255&z]^s[S++],P=g,j=m,z=v,N=k;return g=(d[P>>>24]<<24|d[j>>>16&255]<<16|d[z>>>8&255]<<8|d[255&N])^s[S++],m=(d[j>>>24]<<24|d[z>>>16&255]<<16|d[N>>>8&255]<<8|d[255&P])^s[S++],v=(d[z>>>24]<<24|d[N>>>16&255]<<16|d[P>>>8&255]<<8|d[255&j])^s[S++],k=(d[N>>>24]<<24|d[P>>>16&255]<<16|d[j>>>8&255]<<8|d[255&z])^s[S++],[g>>>=0,m>>>=0,v>>>=0,k>>>=0]}var t=[0,1,2,4,8,16,32,64,128,27,54],n=(function(){for(var o=new Array(256),s=0;s<256;s++)o[s]=s<128?s<<1:s<<1^283;for(var f=[],d=[],u=[[],[],[],[]],g=[[],[],[],[]],m=0,v=0,k=0;k<256;++k){var B=v^v<<1^v<<2^v<<3^v<<4;B=B>>>8^255&B^99,f[m]=B,d[B]=m;var O=o[m],L=o[O],R=o[L],P=257*o[B]^16843008*B;u[0][m]=P<<24|P>>>8,u[1][m]=P<<16|P>>>16,u[2][m]=P<<8|P>>>24,u[3][m]=P,P=16843009*R^65537*L^257*O^16843008*m,g[0][B]=P<<24|P>>>8,g[1][B]=P<<16|P>>>16,g[2][B]=P<<8|P>>>24,g[3][B]=P,m===0?m=v=1:(m=O^o[o[o[R^O]]],v^=o[o[v]])}return{SBOX:f,INV_SBOX:d,SUB_MIX:u,INV_SUB_MIX:g}})();function l(o){this._key=i(o),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var o=this._key,s=o.length,f=s+6,d=4*(f+1),u=[],g=0;g<s;g++)u[g]=o[g];for(g=s;g<d;g++){var m=u[g-1];g%s==0?(m=m<<8|m>>>24,m=n.SBOX[m>>>24]<<24|n.SBOX[m>>>16&255]<<16|n.SBOX[m>>>8&255]<<8|n.SBOX[255&m],m^=t[g/s|0]<<24):s>6&&g%s==4&&(m=n.SBOX[m>>>24]<<24|n.SBOX[m>>>16&255]<<16|n.SBOX[m>>>8&255]<<8|n.SBOX[255&m]),u[g]=u[g-s]^m}for(var v=[],k=0;k<d;k++){var B=d-k,O=u[B-(k%4?0:4)];v[k]=k<4||B<=4?O:n.INV_SUB_MIX[0][n.SBOX[O>>>24]]^n.INV_SUB_MIX[1][n.SBOX[O>>>16&255]]^n.INV_SUB_MIX[2][n.SBOX[O>>>8&255]]^n.INV_SUB_MIX[3][n.SBOX[255&O]]}this._nRounds=f,this._keySchedule=u,this._invKeySchedule=v},l.prototype.encryptBlockRaw=function(o){return r(o=i(o),this._keySchedule,n.SUB_MIX,n.SBOX,this._nRounds)},l.prototype.encryptBlock=function(o){var s=this.encryptBlockRaw(o),f=c.allocUnsafe(16);return f.writeUInt32BE(s[0],0),f.writeUInt32BE(s[1],4),f.writeUInt32BE(s[2],8),f.writeUInt32BE(s[3],12),f},l.prototype.decryptBlock=function(o){var s=(o=i(o))[1];o[1]=o[3],o[3]=s;var f=r(o,this._invKeySchedule,n.INV_SUB_MIX,n.INV_SBOX,this._nRounds),d=c.allocUnsafe(16);return d.writeUInt32BE(f[0],0),d.writeUInt32BE(f[3],4),d.writeUInt32BE(f[2],8),d.writeUInt32BE(f[1],12),d},l.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},p.exports.AES=l},{"safe-buffer":494}],190:[function(e,p,b){"use strict";var c=e("./aes"),i=e("safe-buffer").Buffer,a=e("cipher-base"),r=e("inherits"),t=e("./ghash"),n=e("buffer-xor"),l=e("./incr32");function o(s,f,d,u){a.call(this);var g=i.alloc(4,0);this._cipher=new c.AES(f);var m=this._cipher.encryptBlock(g);this._ghash=new t(m),d=(function(v,k,B){if(k.length===12)return v._finID=i.concat([k,i.from([0,0,0,1])]),i.concat([k,i.from([0,0,0,2])]);var O=new t(B),L=k.length,R=L%16;O.update(k),R&&(R=16-R,O.update(i.alloc(R,0))),O.update(i.alloc(8,0));var P=8*L,j=i.alloc(8);j.writeUIntBE(P,0,8),O.update(j),v._finID=O.state;var z=i.from(v._finID);return l(z),z})(this,d,m),this._prev=i.from(d),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=s,this._authTag=null,this._called=!1}r(o,a),o.prototype._update=function(s){if(!this._called&&this._alen){var f=16-this._alen%16;f<16&&(f=i.alloc(f,0),this._ghash.update(f))}this._called=!0;var d=this._mode.encrypt(this,s);return this._decrypt?this._ghash.update(s):this._ghash.update(d),this._len+=s.length,d},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var s=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&(function(f,d){var u=0;f.length!==d.length&&u++;for(var g=Math.min(f.length,d.length),m=0;m<g;++m)u+=f[m]^d[m];return u})(s,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=s,this._cipher.scrub()},o.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},o.prototype.setAuthTag=function(s){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=s},o.prototype.setAAD=function(s){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(s),this._alen+=s.length},p.exports=o},{"./aes":189,"./ghash":194,"./incr32":195,"buffer-xor":219,"cipher-base":221,inherits:440,"safe-buffer":494}],191:[function(e,p,b){"use strict";var c=e("./encrypter"),i=e("./decrypter"),a=e("./modes/list.json");b.createCipher=b.Cipher=c.createCipher,b.createCipheriv=b.Cipheriv=c.createCipheriv,b.createDecipher=b.Decipher=i.createDecipher,b.createDecipheriv=b.Decipheriv=i.createDecipheriv,b.listCiphers=b.getCiphers=function(){return Object.keys(a)}},{"./decrypter":192,"./encrypter":193,"./modes/list.json":203}],192:[function(e,p,b){"use strict";var c=e("./authCipher"),i=e("safe-buffer").Buffer,a=e("./modes"),r=e("./streamCipher"),t=e("cipher-base"),n=e("./aes"),l=e("evp_bytestokey");function o(d,u,g){t.call(this),this._cache=new s,this._last=void 0,this._cipher=new n.AES(u),this._prev=i.from(g),this._mode=d,this._autopadding=!0}function s(){this.cache=i.allocUnsafe(0)}function f(d,u,g){var m=a[d.toLowerCase()];if(!m)throw new TypeError("invalid suite type");if(typeof g=="string"&&(g=i.from(g)),m.mode!=="GCM"&&g.length!==m.iv)throw new TypeError("invalid iv length "+g.length);if(typeof u=="string"&&(u=i.from(u)),u.length!==m.key/8)throw new TypeError("invalid key length "+u.length);return m.type==="stream"?new r(m.module,u,g,!0):m.type==="auth"?new c(m.module,u,g,!0):new o(m.module,u,g)}e("inherits")(o,t),o.prototype._update=function(d){var u,g;this._cache.add(d);for(var m=[];u=this._cache.get(this._autopadding);)g=this._mode.decrypt(this,u),m.push(g);return i.concat(m)},o.prototype._final=function(){var d=this._cache.flush();if(this._autopadding)return(function(u){var g=u[15];if(g<1||g>16)throw new Error("unable to decrypt data");for(var m=-1;++m<g;)if(u[m+(16-g)]!==g)throw new Error("unable to decrypt data");if(g!==16)return u.slice(0,16-g)})(this._mode.decrypt(this,d));if(d)throw new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(d){return this._autopadding=!!d,this},s.prototype.add=function(d){this.cache=i.concat([this.cache,d])},s.prototype.get=function(d){var u;if(d){if(this.cache.length>16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u}else if(this.cache.length>=16)return u=this.cache.slice(0,16),this.cache=this.cache.slice(16),u;return null},s.prototype.flush=function(){if(this.cache.length)return this.cache},b.createDecipher=function(d,u){var g=a[d.toLowerCase()];if(!g)throw new TypeError("invalid suite type");var m=l(u,!1,g.key,g.iv);return f(d,m.key,m.iv)},b.createDecipheriv=f},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],193:[function(e,p,b){"use strict";var c=e("./modes"),i=e("./authCipher"),a=e("safe-buffer").Buffer,r=e("./streamCipher"),t=e("cipher-base"),n=e("./aes"),l=e("evp_bytestokey");function o(u,g,m){t.call(this),this._cache=new f,this._cipher=new n.AES(g),this._prev=a.from(m),this._mode=u,this._autopadding=!0}e("inherits")(o,t),o.prototype._update=function(u){var g,m;this._cache.add(u);for(var v=[];g=this._cache.get();)m=this._mode.encrypt(this,g),v.push(m);return a.concat(v)};var s=a.alloc(16,16);function f(){this.cache=a.allocUnsafe(0)}function d(u,g,m){var v=c[u.toLowerCase()];if(!v)throw new TypeError("invalid suite type");if(typeof g=="string"&&(g=a.from(g)),g.length!==v.key/8)throw new TypeError("invalid key length "+g.length);if(typeof m=="string"&&(m=a.from(m)),v.mode!=="GCM"&&m.length!==v.iv)throw new TypeError("invalid iv length "+m.length);return v.type==="stream"?new r(v.module,g,m):v.type==="auth"?new i(v.module,g,m):new o(v.module,g,m)}o.prototype._final=function(){var u=this._cache.flush();if(this._autopadding)return u=this._mode.encrypt(this,u),this._cipher.scrub(),u;if(!u.equals(s))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(u){return this._autopadding=!!u,this},f.prototype.add=function(u){this.cache=a.concat([this.cache,u])},f.prototype.get=function(){if(this.cache.length>15){var u=this.cache.slice(0,16);return this.cache=this.cache.slice(16),u}return null},f.prototype.flush=function(){for(var u=16-this.cache.length,g=a.allocUnsafe(u),m=-1;++m<u;)g.writeUInt8(u,m);return a.concat([this.cache,g])},b.createCipheriv=d,b.createCipher=function(u,g){var m=c[u.toLowerCase()];if(!m)throw new TypeError("invalid suite type");var v=l(g,!1,m.key,m.iv);return d(u,v.key,v.iv)}},{"./aes":189,"./authCipher":190,"./modes":202,"./streamCipher":205,"cipher-base":221,evp_bytestokey:423,inherits:440,"safe-buffer":494}],194:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=c.alloc(16,0);function a(t){var n=c.allocUnsafe(16);return n.writeUInt32BE(t[0]>>>0,0),n.writeUInt32BE(t[1]>>>0,4),n.writeUInt32BE(t[2]>>>0,8),n.writeUInt32BE(t[3]>>>0,12),n}function r(t){this.h=t,this.state=c.alloc(16,0),this.cache=c.allocUnsafe(0)}r.prototype.ghash=function(t){for(var n=-1;++n<t.length;)this.state[n]^=t[n];this._multiply()},r.prototype._multiply=function(){for(var t,n,l,o=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],s=[0,0,0,0],f=-1;++f<128;){for((this.state[~~(f/8)]&1<<7-f%8)!=0&&(s[0]^=o[0],s[1]^=o[1],s[2]^=o[2],s[3]^=o[3]),l=(1&o[3])!=0,n=3;n>0;n--)o[n]=o[n]>>>1|(1&o[n-1])<<31;o[0]=o[0]>>>1,l&&(o[0]=o[0]^225<<24)}this.state=a(s)},r.prototype.update=function(t){var n;for(this.cache=c.concat([this.cache,t]);this.cache.length>=16;)n=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(n)},r.prototype.final=function(t,n){return this.cache.length&&this.ghash(c.concat([this.cache,i],16)),this.ghash(a([0,t,0,n])),this.state},p.exports=r},{"safe-buffer":494}],195:[function(e,p,b){"use strict";p.exports=function(c){for(var i,a=c.length;a--;){if((i=c.readUInt8(a))!==255){i++,c.writeUInt8(i,a);break}c.writeUInt8(0,a)}}},{}],196:[function(e,p,b){"use strict";var c=e("buffer-xor");b.encrypt=function(i,a){var r=c(a,i._prev);return i._prev=i._cipher.encryptBlock(r),i._prev},b.decrypt=function(i,a){var r=i._prev;i._prev=a;var t=i._cipher.decryptBlock(a);return c(t,r)}},{"buffer-xor":219}],197:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("buffer-xor");function a(r,t,n){var l=t.length,o=i(t,r._cache);return r._cache=r._cache.slice(l),r._prev=c.concat([r._prev,n?t:o]),o}b.encrypt=function(r,t,n){for(var l,o=c.allocUnsafe(0);t.length;){if(r._cache.length===0&&(r._cache=r._cipher.encryptBlock(r._prev),r._prev=c.allocUnsafe(0)),!(r._cache.length<=t.length)){o=c.concat([o,a(r,t,n)]);break}l=r._cache.length,o=c.concat([o,a(r,t.slice(0,l),n)]),t=t.slice(l)}return o}},{"buffer-xor":219,"safe-buffer":494}],198:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer;function i(r,t,n){for(var l,o,s=-1,f=0;++s<8;)l=t&1<<7-s?128:0,f+=(128&(o=r._cipher.encryptBlock(r._prev)[0]^l))>>s%8,r._prev=a(r._prev,n?l:o);return f}function a(r,t){var n=r.length,l=-1,o=c.allocUnsafe(r.length);for(r=c.concat([r,c.from([t])]);++l<n;)o[l]=r[l]<<1|r[l+1]>>7;return o}b.encrypt=function(r,t,n){for(var l=t.length,o=c.allocUnsafe(l),s=-1;++s<l;)o[s]=i(r,t[s],n);return o}},{"safe-buffer":494}],199:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer;function i(a,r,t){var n=a._cipher.encryptBlock(a._prev)[0]^r;return a._prev=c.concat([a._prev.slice(1),c.from([t?r:n])]),n}b.encrypt=function(a,r,t){for(var n=r.length,l=c.allocUnsafe(n),o=-1;++o<n;)l[o]=i(a,r[o],t);return l}},{"safe-buffer":494}],200:[function(e,p,b){"use strict";var c=e("buffer-xor"),i=e("safe-buffer").Buffer,a=e("../incr32");function r(t){var n=t._cipher.encryptBlockRaw(t._prev);return a(t._prev),n}b.encrypt=function(t,n){var l=Math.ceil(n.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*l)]);for(var s=0;s<l;s++){var f=r(t),d=o+16*s;t._cache.writeUInt32BE(f[0],d+0),t._cache.writeUInt32BE(f[1],d+4),t._cache.writeUInt32BE(f[2],d+8),t._cache.writeUInt32BE(f[3],d+12)}var u=t._cache.slice(0,n.length);return t._cache=t._cache.slice(n.length),c(n,u)}},{"../incr32":195,"buffer-xor":219,"safe-buffer":494}],201:[function(e,p,b){"use strict";b.encrypt=function(c,i){return c._cipher.encryptBlock(i)},b.decrypt=function(c,i){return c._cipher.decryptBlock(i)}},{}],202:[function(e,p,b){"use strict";var c={ECB:e("./ecb"),CBC:e("./cbc"),CFB:e("./cfb"),CFB8:e("./cfb8"),CFB1:e("./cfb1"),OFB:e("./ofb"),CTR:e("./ctr"),GCM:e("./ctr")},i=e("./list.json");for(var a in i)i[a].module=c[i[a].mode];p.exports=i},{"./cbc":196,"./cfb":197,"./cfb1":198,"./cfb8":199,"./ctr":200,"./ecb":201,"./list.json":203,"./ofb":204}],203:[function(e,p,b){p.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],204:[function(e,p,b){(function(c){(function(){"use strict";var i=e("buffer-xor");function a(r){return r._prev=r._cipher.encryptBlock(r._prev),r._prev}b.encrypt=function(r,t){for(;r._cache.length<t.length;)r._cache=c.concat([r._cache,a(r)]);var n=r._cache.slice(0,t.length);return r._cache=r._cache.slice(t.length),i(t,n)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220,"buffer-xor":219}],205:[function(e,p,b){"use strict";var c=e("./aes"),i=e("safe-buffer").Buffer,a=e("cipher-base");function r(t,n,l,o){a.call(this),this._cipher=new c.AES(n),this._prev=i.from(l),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=o,this._mode=t}e("inherits")(r,a),r.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},r.prototype._final=function(){this._cipher.scrub()},p.exports=r},{"./aes":189,"cipher-base":221,inherits:440,"safe-buffer":494}],206:[function(e,p,b){"use strict";var c=e("browserify-des"),i=e("browserify-aes/browser"),a=e("browserify-aes/modes"),r=e("browserify-des/modes"),t=e("evp_bytestokey");function n(o,s,f){if(o=o.toLowerCase(),a[o])return i.createCipheriv(o,s,f);if(r[o])return new c({key:s,iv:f,mode:o});throw new TypeError("invalid suite type")}function l(o,s,f){if(o=o.toLowerCase(),a[o])return i.createDecipheriv(o,s,f);if(r[o])return new c({key:s,iv:f,mode:o,decrypt:!0});throw new TypeError("invalid suite type")}b.createCipher=b.Cipher=function(o,s){var f,d;if(o=o.toLowerCase(),a[o])f=a[o].key,d=a[o].iv;else{if(!r[o])throw new TypeError("invalid suite type");f=8*r[o].key,d=r[o].iv}var u=t(s,!1,f,d);return n(o,u.key,u.iv)},b.createCipheriv=b.Cipheriv=n,b.createDecipher=b.Decipher=function(o,s){var f,d;if(o=o.toLowerCase(),a[o])f=a[o].key,d=a[o].iv;else{if(!r[o])throw new TypeError("invalid suite type");f=8*r[o].key,d=r[o].iv}var u=t(s,!1,f,d);return l(o,u.key,u.iv)},b.createDecipheriv=b.Decipheriv=l,b.listCiphers=b.getCiphers=function(){return Object.keys(r).concat(i.getCiphers())}},{"browserify-aes/browser":191,"browserify-aes/modes":202,"browserify-des":207,"browserify-des/modes":208,evp_bytestokey:423}],207:[function(e,p,b){"use strict";var c=e("cipher-base"),i=e("des.js"),a=e("inherits"),r=e("safe-buffer").Buffer,t={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function n(l){c.call(this);var o,s=l.mode.toLowerCase(),f=t[s];o=l.decrypt?"decrypt":"encrypt";var d=l.key;r.isBuffer(d)||(d=r.from(d)),s!=="des-ede"&&s!=="des-ede-cbc"||(d=r.concat([d,d.slice(0,8)]));var u=l.iv;r.isBuffer(u)||(u=r.from(u)),this._des=f.create({key:d,iv:u,type:o})}t.des=t["des-cbc"],t.des3=t["des-ede3-cbc"],p.exports=n,a(n,c),n.prototype._update=function(l){return r.from(this._des.update(l))},n.prototype._final=function(){return r.from(this._des.final())}},{"cipher-base":221,"des.js":394,inherits:440,"safe-buffer":494}],208:[function(e,p,b){"use strict";b["des-ecb"]={key:8,iv:0},b["des-cbc"]=b.des={key:8,iv:8},b["des-ede3-cbc"]=b.des3={key:24,iv:8},b["des-ede3"]={key:24,iv:0},b["des-ede-cbc"]={key:16,iv:8},b["des-ede"]={key:16,iv:0}},{}],209:[function(e,p,b){(function(c){(function(){"use strict";var i=e("bn.js"),a=e("randombytes");function r(n){var l,o=n.modulus.byteLength();do l=new i(a(o));while(l.cmp(n.modulus)>=0||!l.umod(n.prime1)||!l.umod(n.prime2));return l}function t(n,l){var o=(function(L){var R=r(L);return{blinder:R.toRed(i.mont(L.modulus)).redPow(new i(L.publicExponent)).fromRed(),unblinder:R.invm(L.modulus)}})(l),s=l.modulus.byteLength(),f=new i(n).mul(o.blinder).umod(l.modulus),d=f.toRed(i.mont(l.prime1)),u=f.toRed(i.mont(l.prime2)),g=l.coefficient,m=l.prime1,v=l.prime2,k=d.redPow(l.exponent1).fromRed(),B=u.redPow(l.exponent2).fromRed(),O=k.isub(B).imul(g).umod(m).imul(v);return B.iadd(O).imul(o.unblinder).umod(l.modulus).toArrayLike(c,"be",s)}t.getr=r,p.exports=t}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":186,buffer:220,randombytes:475}],210:[function(e,p,b){"use strict";p.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":211}],211:[function(e,p,b){p.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],212:[function(e,p,b){p.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],213:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("create-hash"),a=e("readable-stream"),r=e("inherits"),t=e("./sign"),n=e("./verify"),l=e("./algorithms.json");function o(u){a.Writable.call(this);var g=l[u];if(!g)throw new Error("Unknown message digest");this._hashType=g.hash,this._hash=i(g.hash),this._tag=g.id,this._signType=g.sign}function s(u){a.Writable.call(this);var g=l[u];if(!g)throw new Error("Unknown message digest");this._hash=i(g.hash),this._tag=g.id,this._signType=g.sign}function f(u){return new o(u)}function d(u){return new s(u)}Object.keys(l).forEach((function(u){l[u].id=c.from(l[u].id,"hex"),l[u.toLowerCase()]=l[u]})),r(o,a.Writable),o.prototype._write=function(u,g,m){this._hash.update(u),m()},o.prototype.update=function(u,g){return typeof u=="string"&&(u=c.from(u,g)),this._hash.update(u),this},o.prototype.sign=function(u,g){this.end();var m=this._hash.digest(),v=t(m,u,this._hashType,this._signType,this._tag);return g?v.toString(g):v},r(s,a.Writable),s.prototype._write=function(u,g,m){this._hash.update(u),m()},s.prototype.update=function(u,g){return typeof u=="string"&&(u=c.from(u,g)),this._hash.update(u),this},s.prototype.verify=function(u,g,m){typeof g=="string"&&(g=c.from(g,m)),this.end();var v=this._hash.digest();return n(g,v,u,this._signType,this._tag)},p.exports={Sign:f,Verify:d,createSign:f,createVerify:d}},{"./algorithms.json":211,"./sign":214,"./verify":215,"create-hash":386,inherits:440,"readable-stream":491,"safe-buffer":494}],214:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("create-hmac"),a=e("browserify-rsa"),r=e("elliptic").ec,t=e("bn.js"),n=e("parse-asn1"),l=e("./curves.json");function o(u,g,m,v){if((u=c.from(u.toArray())).length<g.byteLength()){var k=c.alloc(g.byteLength()-u.length);u=c.concat([k,u])}var B=m.length,O=(function(P,j){P=(P=s(P,j)).mod(j);var z=c.from(P.toArray());if(z.length<j.byteLength()){var N=c.alloc(j.byteLength()-z.length);z=c.concat([N,z])}return z})(m,g),L=c.alloc(B);L.fill(1);var R=c.alloc(B);return R=i(v,R).update(L).update(c.from([0])).update(u).update(O).digest(),L=i(v,R).update(L).digest(),{k:R=i(v,R).update(L).update(c.from([1])).update(u).update(O).digest(),v:L=i(v,R).update(L).digest()}}function s(u,g){var m=new t(u),v=(u.length<<3)-g.bitLength();return v>0&&m.ishrn(v),m}function f(u,g,m){var v,k;do{for(v=c.alloc(0);8*v.length<u.bitLength();)g.v=i(m,g.k).update(g.v).digest(),v=c.concat([v,g.v]);k=s(v,u),g.k=i(m,g.k).update(g.v).update(c.from([0])).digest(),g.v=i(m,g.k).update(g.v).digest()}while(k.cmp(u)!==-1);return k}function d(u,g,m,v){return u.toRed(t.mont(m)).redPow(g).fromRed().mod(v)}p.exports=function(u,g,m,v,k){var B=n(g);if(B.curve){if(v!=="ecdsa"&&v!=="ecdsa/rsa")throw new Error("wrong private key type");return(function(P,j){var z=l[j.curve.join(".")];if(!z)throw new Error("unknown curve "+j.curve.join("."));var N=new r(z).keyFromPrivate(j.privateKey).sign(P);return c.from(N.toDER())})(u,B)}if(B.type==="dsa"){if(v!=="dsa")throw new Error("wrong private key type");return(function(P,j,z){for(var N,S=j.params.priv_key,C=j.params.p,E=j.params.q,h=j.params.g,y=new t(0),w=s(P,E).mod(E),x=!1,_=o(S,E,P,z);x===!1;)N=f(E,_,z),y=d(h,N,C,E),(x=N.invm(E).imul(w.add(S.mul(y))).mod(E)).cmpn(0)===0&&(x=!1,y=new t(0));return(function(T,D){T=T.toArray(),D=D.toArray(),128&T[0]&&(T=[0].concat(T)),128&D[0]&&(D=[0].concat(D));var q=[48,T.length+D.length+4,2,T.length];return q=q.concat(T,[2,D.length],D),c.from(q)})(y,x)})(u,B,m)}if(v!=="rsa"&&v!=="ecdsa/rsa")throw new Error("wrong private key type");u=c.concat([k,u]);for(var O=B.modulus.byteLength(),L=[0,1];u.length+L.length+1<O;)L.push(255);L.push(0);for(var R=-1;++R<u.length;)L.push(u[R]);return a(L,B)},p.exports.getKey=o,p.exports.makeKey=f},{"./curves.json":212,"bn.js":186,"browserify-rsa":209,"create-hmac":388,elliptic:405,"parse-asn1":459,"safe-buffer":494}],215:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("bn.js"),a=e("elliptic").ec,r=e("parse-asn1"),t=e("./curves.json");function n(l,o){if(l.cmpn(0)<=0)throw new Error("invalid sig");if(l.cmp(o)>=o)throw new Error("invalid sig")}p.exports=function(l,o,s,f,d){var u=r(s);if(u.type==="ec"){if(f!=="ecdsa"&&f!=="ecdsa/rsa")throw new Error("wrong public key type");return(function(L,R,P){var j=t[P.data.algorithm.curve.join(".")];if(!j)throw new Error("unknown curve "+P.data.algorithm.curve.join("."));var z=new a(j),N=P.data.subjectPrivateKey.data;return z.verify(R,L,N)})(l,o,u)}if(u.type==="dsa"){if(f!=="dsa")throw new Error("wrong public key type");return(function(L,R,P){var j=P.data.p,z=P.data.q,N=P.data.g,S=P.data.pub_key,C=r.signature.decode(L,"der"),E=C.s,h=C.r;n(E,z),n(h,z);var y=i.mont(j),w=E.invm(z);return N.toRed(y).redPow(new i(R).mul(w).mod(z)).fromRed().mul(S.toRed(y).redPow(h.mul(w).mod(z)).fromRed()).mod(j).mod(z).cmp(h)===0})(l,o,u)}if(f!=="rsa"&&f!=="ecdsa/rsa")throw new Error("wrong public key type");o=c.concat([d,o]);for(var g=u.modulus.byteLength(),m=[1],v=0;o.length+m.length+2<g;)m.push(255),v++;m.push(0);for(var k=-1;++k<o.length;)m.push(o[k]);m=c.from(m);var B=i.mont(u.modulus);l=(l=new i(l).toRed(B)).redPow(new i(u.publicExponent)),l=c.from(l.fromRed().toArray());var O=v<8?1:0;for(g=Math.min(l.length,m.length),l.length!==m.length&&(O=1),k=-1;++k<g;)O|=l[k]^m[k];return O===0}},{"./curves.json":212,"bn.js":186,elliptic:405,"parse-asn1":459,"safe-buffer":494}],216:[function(e,p,b){},{}],217:[function(e,p,b){"use strict";var c=e("buffer"),i=c.Buffer;function a(t,n){for(var l in t)n[l]=t[l]}function r(t,n,l){return i(t,n,l)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?p.exports=c:(a(c,b),b.Buffer=r),a(i,r),r.from=function(t,n,l){if(typeof t=="number")throw new TypeError("Argument must not be a number");return i(t,n,l)},r.alloc=function(t,n,l){if(typeof t!="number")throw new TypeError("Argument must be a number");var o=i(t);return n!==void 0?typeof l=="string"?o.fill(n,l):o.fill(n):o.fill(0),o},r.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return i(t)},r.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(t)}},{buffer:220}],218:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=c.isEncoding||function(u){switch((u=""+u)&&u.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(u){var g;switch(this.encoding=(function(m){var v=(function(k){if(!k)return"utf8";for(var B;;)switch(k){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return k;default:if(B)return;k=(""+k).toLowerCase(),B=!0}})(m);if(typeof v!="string"&&(c.isEncoding===i||!i(m)))throw new Error("Unknown encoding: "+m);return v||m})(u),this.encoding){case"utf16le":this.text=n,this.end=l,g=4;break;case"utf8":this.fillLast=t,g=4;break;case"base64":this.text=o,this.end=s,g=3;break;default:return this.write=f,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(g)}function r(u){return u<=127?0:u>>5==6?2:u>>4==14?3:u>>3==30?4:u>>6==2?-1:-2}function t(u){var g=this.lastTotal-this.lastNeed,m=(function(v,k,B){if((192&k[0])!=128)return v.lastNeed=0,"\uFFFD";if(v.lastNeed>1&&k.length>1){if((192&k[1])!=128)return v.lastNeed=1,"\uFFFD";if(v.lastNeed>2&&k.length>2&&(192&k[2])!=128)return v.lastNeed=2,"\uFFFD"}})(this,u);return m!==void 0?m:this.lastNeed<=u.length?(u.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(u.copy(this.lastChar,g,0,u.length),void(this.lastNeed-=u.length))}function n(u,g){if((u.length-g)%2==0){var m=u.toString("utf16le",g);if(m){var v=m.charCodeAt(m.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],m.slice(0,-1)}return m}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",g,u.length-1)}function l(u){var g=u&&u.length?this.write(u):"";if(this.lastNeed){var m=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,m)}return g}function o(u,g){var m=(u.length-g)%3;return m===0?u.toString("base64",g):(this.lastNeed=3-m,this.lastTotal=3,m===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",g,u.length-m))}function s(u){var g=u&&u.length?this.write(u):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function f(u){return u.toString(this.encoding)}function d(u){return u&&u.length?this.write(u):""}b.StringDecoder=a,a.prototype.write=function(u){if(u.length===0)return"";var g,m;if(this.lastNeed){if((g=this.fillLast(u))===void 0)return"";m=this.lastNeed,this.lastNeed=0}else m=0;return m<u.length?g?g+this.text(u,m):this.text(u,m):g||""},a.prototype.end=function(u){var g=u&&u.length?this.write(u):"";return this.lastNeed?g+"\uFFFD":g},a.prototype.text=function(u,g){var m=(function(k,B,O){var L=B.length-1;if(L<O)return 0;var R=r(B[L]);return R>=0?(R>0&&(k.lastNeed=R-1),R):--L<O||R===-2?0:(R=r(B[L]))>=0?(R>0&&(k.lastNeed=R-2),R):--L<O||R===-2?0:(R=r(B[L]))>=0?(R>0&&(R===2?R=0:k.lastNeed=R-3),R):0})(this,u,g);if(!this.lastNeed)return u.toString("utf8",g);this.lastTotal=m;var v=u.length-(m-this.lastNeed);return u.copy(this.lastChar,0,v),u.toString("utf8",g,v)},a.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length}},{"safe-buffer":217}],219:[function(e,p,b){(function(c){(function(){"use strict";p.exports=function(i,a){for(var r=Math.min(i.length,a.length),t=new c(r),n=0;n<r;++n)t[n]=i[n]^a[n];return t}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:220}],220:[function(e,p,b){(function(c){(function(){"use strict";var i=e("base64-js"),a=e("ieee754");b.Buffer=t,b.SlowBuffer=function(M){return+M!=M&&(M=0),t.alloc(+M)},b.INSPECT_MAX_BYTES=50;function r(M){if(M>2147483647)throw new RangeError('The value "'+M+'" is invalid for option "size"');var I=new Uint8Array(M);return I.__proto__=t.prototype,I}function t(M,I,F){if(typeof M=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return o(M)}return n(M,I,F)}function n(M,I,F){if(typeof M=="string")return(function(V,G){if(typeof G=="string"&&G!==""||(G="utf8"),!t.isEncoding(G))throw new TypeError("Unknown encoding: "+G);var ee=0|d(V,G),Z=r(ee),K=Z.write(V,G);return K!==ee&&(Z=Z.slice(0,K)),Z})(M,I);if(ArrayBuffer.isView(M))return s(M);if(M==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(A(M,ArrayBuffer)||M&&A(M.buffer,ArrayBuffer))return(function(V,G,ee){if(G<0||V.byteLength<G)throw new RangeError('"offset" is outside of buffer bounds');if(V.byteLength<G+(ee||0))throw new RangeError('"length" is outside of buffer bounds');var Z;return Z=G===void 0&&ee===void 0?new Uint8Array(V):ee===void 0?new Uint8Array(V,G):new Uint8Array(V,G,ee),Z.__proto__=t.prototype,Z})(M,I,F);if(typeof M=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var U=M.valueOf&&M.valueOf();if(U!=null&&U!==M)return t.from(U,I,F);var X=(function(V){if(t.isBuffer(V)){var G=0|f(V.length),ee=r(G);return ee.length===0||V.copy(ee,0,0,G),ee}if(V.length!==void 0)return typeof V.length!="number"||H(V.length)?r(0):s(V);if(V.type==="Buffer"&&Array.isArray(V.data))return s(V.data)})(M);if(X)return X;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof M[Symbol.toPrimitive]=="function")return t.from(M[Symbol.toPrimitive]("string"),I,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M)}function l(M){if(typeof M!="number")throw new TypeError('"size" argument must be of type number');if(M<0)throw new RangeError('The value "'+M+'" is invalid for option "size"')}function o(M){return l(M),r(M<0?0:0|f(M))}function s(M){for(var I=M.length<0?0:0|f(M.length),F=r(I),U=0;U<I;U+=1)F[U]=255&M[U];return F}function f(M){if(M>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|M}function d(M,I){if(t.isBuffer(M))return M.length;if(ArrayBuffer.isView(M)||A(M,ArrayBuffer))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);var F=M.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&F===0)return 0;for(var X=!1;;)switch(I){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return q(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*F;case"hex":return F>>>1;case"base64":return $(M).length;default:if(X)return U?-1:q(M).length;I=(""+I).toLowerCase(),X=!0}}function u(M,I,F){var U=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0)<=(I>>>=0))return"";for(M||(M="utf8");;)switch(M){case"hex":return C(this,I,F);case"utf8":case"utf-8":return z(this,I,F);case"ascii":return N(this,I,F);case"latin1":case"binary":return S(this,I,F);case"base64":return j(this,I,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,I,F);default:if(U)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),U=!0}}function g(M,I,F){var U=M[I];M[I]=M[F],M[F]=U}function m(M,I,F,U,X){if(M.length===0)return-1;if(typeof F=="string"?(U=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),H(F=+F)&&(F=X?0:M.length-1),F<0&&(F=M.length+F),F>=M.length){if(X)return-1;F=M.length-1}else if(F<0){if(!X)return-1;F=0}if(typeof I=="string"&&(I=t.from(I,U)),t.isBuffer(I))return I.length===0?-1:v(M,I,F,U,X);if(typeof I=="number")return I&=255,typeof Uint8Array.prototype.indexOf=="function"?X?Uint8Array.prototype.indexOf.call(M,I,F):Uint8Array.prototype.lastIndexOf.call(M,I,F):v(M,[I],F,U,X);throw new TypeError("val must be string, number or Buffer")}function v(M,I,F,U,X){var V,G=1,ee=M.length,Z=I.length;if(U!==void 0&&((U=String(U).toLowerCase())==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(M.length<2||I.length<2)return-1;G=2,ee/=2,Z/=2,F/=2}function K(ie,le){return G===1?ie[le]:ie.readUInt16BE(le*G)}if(X){var Q=-1;for(V=F;V<ee;V++)if(K(M,V)===K(I,Q===-1?0:V-Q)){if(Q===-1&&(Q=V),V-Q+1===Z)return Q*G}else Q!==-1&&(V-=V-Q),Q=-1}else for(F+Z>ee&&(F=ee-Z),V=F;V>=0;V--){for(var J=!0,ne=0;ne<Z;ne++)if(K(M,V+ne)!==K(I,ne)){J=!1;break}if(J)return V}return-1}function k(M,I,F,U){F=Number(F)||0;var X=M.length-F;U?(U=Number(U))>X&&(U=X):U=X;var V=I.length;U>V/2&&(U=V/2);for(var G=0;G<U;++G){var ee=parseInt(I.substr(2*G,2),16);if(H(ee))return G;M[F+G]=ee}return G}function B(M,I,F,U){return W(q(I,M.length-F),M,F,U)}function O(M,I,F,U){return W((function(X){for(var V=[],G=0;G<X.length;++G)V.push(255&X.charCodeAt(G));return V})(I),M,F,U)}function L(M,I,F,U){return O(M,I,F,U)}function R(M,I,F,U){return W($(I),M,F,U)}function P(M,I,F,U){return W((function(X,V){for(var G,ee,Z,K=[],Q=0;Q<X.length&&!((V-=2)<0);++Q)G=X.charCodeAt(Q),ee=G>>8,Z=G%256,K.push(Z),K.push(ee);return K})(I,M.length-F),M,F,U)}function j(M,I,F){return I===0&&F===M.length?i.fromByteArray(M):i.fromByteArray(M.slice(I,F))}function z(M,I,F){F=Math.min(M.length,F);for(var U=[],X=I;X<F;){var V,G,ee,Z,K=M[X],Q=null,J=K>239?4:K>223?3:K>191?2:1;if(X+J<=F)switch(J){case 1:K<128&&(Q=K);break;case 2:(192&(V=M[X+1]))==128&&(Z=(31&K)<<6|63&V)>127&&(Q=Z);break;case 3:V=M[X+1],G=M[X+2],(192&V)==128&&(192&G)==128&&(Z=(15&K)<<12|(63&V)<<6|63&G)>2047&&(Z<55296||Z>57343)&&(Q=Z);break;case 4:V=M[X+1],G=M[X+2],ee=M[X+3],(192&V)==128&&(192&G)==128&&(192&ee)==128&&(Z=(15&K)<<18|(63&V)<<12|(63&G)<<6|63&ee)>65535&&Z<1114112&&(Q=Z)}Q===null?(Q=65533,J=1):Q>65535&&(Q-=65536,U.push(Q>>>10&1023|55296),Q=56320|1023&Q),U.push(Q),X+=J}return(function(ne){var ie=ne.length;if(ie<=4096)return String.fromCharCode.apply(String,ne);for(var le="",re=0;re<ie;)le+=String.fromCharCode.apply(String,ne.slice(re,re+=4096));return le})(U)}b.kMaxLength=2147483647,t.TYPED_ARRAY_SUPPORT=(function(){try{var M=new Uint8Array(1);return M.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},M.foo()===42}catch{return!1}})(),t.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),typeof Symbol<"u"&&Symbol.species!=null&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),t.poolSize=8192,t.from=function(M,I,F){return n(M,I,F)},t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,t.alloc=function(M,I,F){return(function(U,X,V){return l(U),U<=0?r(U):X!==void 0?typeof V=="string"?r(U).fill(X,V):r(U).fill(X):r(U)})(M,I,F)},t.allocUnsafe=function(M){return o(M)},t.allocUnsafeSlow=function(M){return o(M)},t.isBuffer=function(M){return M!=null&&M._isBuffer===!0&&M!==t.prototype},t.compare=function(M,I){if(A(M,Uint8Array)&&(M=t.from(M,M.offset,M.byteLength)),A(I,Uint8Array)&&(I=t.from(I,I.offset,I.byteLength)),!t.isBuffer(M)||!t.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(M===I)return 0;for(var F=M.length,U=I.length,X=0,V=Math.min(F,U);X<V;++X)if(M[X]!==I[X]){F=M[X],U=I[X];break}return F<U?-1:U<F?1:0},t.isEncoding=function(M){switch(String(M).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(M,I){if(!Array.isArray(M))throw new TypeError('"list" argument must be an Array of Buffers');if(M.length===0)return t.alloc(0);var F;if(I===void 0)for(I=0,F=0;F<M.length;++F)I+=M[F].length;var U=t.allocUnsafe(I),X=0;for(F=0;F<M.length;++F){var V=M[F];if(A(V,Uint8Array)&&(V=t.from(V)),!t.isBuffer(V))throw new TypeError('"list" argument must be an Array of Buffers');V.copy(U,X),X+=V.length}return U},t.byteLength=d,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var M=this.length;if(M%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var I=0;I<M;I+=2)g(this,I,I+1);return this},t.prototype.swap32=function(){var M=this.length;if(M%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var I=0;I<M;I+=4)g(this,I,I+3),g(this,I+1,I+2);return this},t.prototype.swap64=function(){var M=this.length;if(M%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var I=0;I<M;I+=8)g(this,I,I+7),g(this,I+1,I+6),g(this,I+2,I+5),g(this,I+3,I+4);return this},t.prototype.toString=function(){var M=this.length;return M===0?"":arguments.length===0?z(this,0,M):u.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(M){if(!t.isBuffer(M))throw new TypeError("Argument must be a Buffer");return this===M||t.compare(this,M)===0},t.prototype.inspect=function(){var M="",I=b.INSPECT_MAX_BYTES;return M=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(M+=" ... "),"<Buffer "+M+">"},t.prototype.compare=function(M,I,F,U,X){if(A(M,Uint8Array)&&(M=t.from(M,M.offset,M.byteLength)),!t.isBuffer(M))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof M);if(I===void 0&&(I=0),F===void 0&&(F=M?M.length:0),U===void 0&&(U=0),X===void 0&&(X=this.length),I<0||F>M.length||U<0||X>this.length)throw new RangeError("out of range index");if(U>=X&&I>=F)return 0;if(U>=X)return-1;if(I>=F)return 1;if(this===M)return 0;for(var V=(X>>>=0)-(U>>>=0),G=(F>>>=0)-(I>>>=0),ee=Math.min(V,G),Z=this.slice(U,X),K=M.slice(I,F),Q=0;Q<ee;++Q)if(Z[Q]!==K[Q]){V=Z[Q],G=K[Q];break}return V<G?-1:G<V?1:0},t.prototype.includes=function(M,I,F){return this.indexOf(M,I,F)!==-1},t.prototype.indexOf=function(M,I,F){return m(this,M,I,F,!0)},t.prototype.lastIndexOf=function(M,I,F){return m(this,M,I,F,!1)},t.prototype.write=function(M,I,F,U){if(I===void 0)U="utf8",F=this.length,I=0;else if(F===void 0&&typeof I=="string")U=I,F=this.length,I=0;else{if(!isFinite(I))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");I>>>=0,isFinite(F)?(F>>>=0,U===void 0&&(U="utf8")):(U=F,F=void 0)}var X=this.length-I;if((F===void 0||F>X)&&(F=X),M.length>0&&(F<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");for(var V=!1;;)switch(U){case"hex":return k(this,M,I,F);case"utf8":case"utf-8":return B(this,M,I,F);case"ascii":return O(this,M,I,F);case"latin1":case"binary":return L(this,M,I,F);case"base64":return R(this,M,I,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,M,I,F);default:if(V)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),V=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(M,I,F){var U="";F=Math.min(M.length,F);for(var X=I;X<F;++X)U+=String.fromCharCode(127&M[X]);return U}function S(M,I,F){var U="";F=Math.min(M.length,F);for(var X=I;X<F;++X)U+=String.fromCharCode(M[X]);return U}function C(M,I,F){var U=M.length;(!I||I<0)&&(I=0),(!F||F<0||F>U)&&(F=U);for(var X="",V=I;V<F;++V)X+=D(M[V]);return X}function E(M,I,F){for(var U=M.slice(I,F),X="",V=0;V<U.length;V+=2)X+=String.fromCharCode(U[V]+256*U[V+1]);return X}function h(M,I,F){if(M%1!=0||M<0)throw new RangeError("offset is not uint");if(M+I>F)throw new RangeError("Trying to access beyond buffer length")}function y(M,I,F,U,X,V){if(!t.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>X||I<V)throw new RangeError('"value" argument is out of bounds');if(F+U>M.length)throw new RangeError("Index out of range")}function w(M,I,F,U,X,V){if(F+U>M.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function x(M,I,F,U,X){return I=+I,F>>>=0,X||w(M,0,F,4),a.write(M,I,F,U,23,4),F+4}function _(M,I,F,U,X){return I=+I,F>>>=0,X||w(M,0,F,8),a.write(M,I,F,U,52,8),F+8}t.prototype.slice=function(M,I){var F=this.length;(M=~~M)<0?(M+=F)<0&&(M=0):M>F&&(M=F),(I=I===void 0?F:~~I)<0?(I+=F)<0&&(I=0):I>F&&(I=F),I<M&&(I=M);var U=this.subarray(M,I);return U.__proto__=t.prototype,U},t.prototype.readUIntLE=function(M,I,F){M>>>=0,I>>>=0,F||h(M,I,this.length);for(var U=this[M],X=1,V=0;++V<I&&(X*=256);)U+=this[M+V]*X;return U},t.prototype.readUIntBE=function(M,I,F){M>>>=0,I>>>=0,F||h(M,I,this.length);for(var U=this[M+--I],X=1;I>0&&(X*=256);)U+=this[M+--I]*X;return U},t.prototype.readUInt8=function(M,I){return M>>>=0,I||h(M,1,this.length),this[M]},t.prototype.readUInt16LE=function(M,I){return M>>>=0,I||h(M,2,this.length),this[M]|this[M+1]<<8},t.prototype.readUInt16BE=function(M,I){return M>>>=0,I||h(M,2,this.length),this[M]<<8|this[M+1]},t.prototype.readUInt32LE=function(M,I){return M>>>=0,I||h(M,4,this.length),(this[M]|this[M+1]<<8|this[M+2]<<16)+16777216*this[M+3]},t.prototype.readUInt32BE=function(M,I){return M>>>=0,I||h(M,4,this.length),16777216*this[M]+(this[M+1]<<16|this[M+2]<<8|this[M+3])},t.prototype.readIntLE=function(M,I,F){M>>>=0,I>>>=0,F||h(M,I,this.length);for(var U=this[M],X=1,V=0;++V<I&&(X*=256);)U+=this[M+V]*X;return U>=(X*=128)&&(U-=Math.pow(2,8*I)),U},t.prototype.readIntBE=function(M,I,F){M>>>=0,I>>>=0,F||h(M,I,this.length);for(var U=I,X=1,V=this[M+--U];U>0&&(X*=256);)V+=this[M+--U]*X;return V>=(X*=128)&&(V-=Math.pow(2,8*I)),V},t.prototype.readInt8=function(M,I){return M>>>=0,I||h(M,1,this.length),128&this[M]?-1*(255-this[M]+1):this[M]},t.prototype.readInt16LE=function(M,I){M>>>=0,I||h(M,2,this.length);var F=this[M]|this[M+1]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt16BE=function(M,I){M>>>=0,I||h(M,2,this.length);var F=this[M+1]|this[M]<<8;return 32768&F?4294901760|F:F},t.prototype.readInt32LE=function(M,I){return M>>>=0,I||h(M,4,this.length),this[M]|this[M+1]<<8|this[M+2]<<16|this[M+3]<<24},t.prototype.readInt32BE=function(M,I){return M>>>=0,I||h(M,4,this.length),this[M]<<24|this[M+1]<<16|this[M+2]<<8|this[M+3]},t.prototype.readFloatLE=function(M,I){return M>>>=0,I||h(M,4,this.length),a.read(this,M,!0,23,4)},t.prototype.readFloatBE=function(M,I){return M>>>=0,I||h(M,4,this.length),a.read(this,M,!1,23,4)},t.prototype.readDoubleLE=function(M,I){return M>>>=0,I||h(M,8,this.length),a.read(this,M,!0,52,8)},t.prototype.readDoubleBE=function(M,I){return M>>>=0,I||h(M,8,this.length),a.read(this,M,!1,52,8)},t.prototype.writeUIntLE=function(M,I,F,U){M=+M,I>>>=0,F>>>=0,U||y(this,M,I,F,Math.pow(2,8*F)-1,0);var X=1,V=0;for(this[I]=255&M;++V<F&&(X*=256);)this[I+V]=M/X&255;return I+F},t.prototype.writeUIntBE=function(M,I,F,U){M=+M,I>>>=0,F>>>=0,U||y(this,M,I,F,Math.pow(2,8*F)-1,0);var X=F-1,V=1;for(this[I+X]=255&M;--X>=0&&(V*=256);)this[I+X]=M/V&255;return I+F},t.prototype.writeUInt8=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,1,255,0),this[I]=255&M,I+1},t.prototype.writeUInt16LE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,2,65535,0),this[I]=255&M,this[I+1]=M>>>8,I+2},t.prototype.writeUInt16BE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,2,65535,0),this[I]=M>>>8,this[I+1]=255&M,I+2},t.prototype.writeUInt32LE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,4,4294967295,0),this[I+3]=M>>>24,this[I+2]=M>>>16,this[I+1]=M>>>8,this[I]=255&M,I+4},t.prototype.writeUInt32BE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,4,4294967295,0),this[I]=M>>>24,this[I+1]=M>>>16,this[I+2]=M>>>8,this[I+3]=255&M,I+4},t.prototype.writeIntLE=function(M,I,F,U){if(M=+M,I>>>=0,!U){var X=Math.pow(2,8*F-1);y(this,M,I,F,X-1,-X)}var V=0,G=1,ee=0;for(this[I]=255&M;++V<F&&(G*=256);)M<0&&ee===0&&this[I+V-1]!==0&&(ee=1),this[I+V]=(M/G>>0)-ee&255;return I+F},t.prototype.writeIntBE=function(M,I,F,U){if(M=+M,I>>>=0,!U){var X=Math.pow(2,8*F-1);y(this,M,I,F,X-1,-X)}var V=F-1,G=1,ee=0;for(this[I+V]=255&M;--V>=0&&(G*=256);)M<0&&ee===0&&this[I+V+1]!==0&&(ee=1),this[I+V]=(M/G>>0)-ee&255;return I+F},t.prototype.writeInt8=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,1,127,-128),M<0&&(M=255+M+1),this[I]=255&M,I+1},t.prototype.writeInt16LE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,2,32767,-32768),this[I]=255&M,this[I+1]=M>>>8,I+2},t.prototype.writeInt16BE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,2,32767,-32768),this[I]=M>>>8,this[I+1]=255&M,I+2},t.prototype.writeInt32LE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,4,2147483647,-2147483648),this[I]=255&M,this[I+1]=M>>>8,this[I+2]=M>>>16,this[I+3]=M>>>24,I+4},t.prototype.writeInt32BE=function(M,I,F){return M=+M,I>>>=0,F||y(this,M,I,4,2147483647,-2147483648),M<0&&(M=4294967295+M+1),this[I]=M>>>24,this[I+1]=M>>>16,this[I+2]=M>>>8,this[I+3]=255&M,I+4},t.prototype.writeFloatLE=function(M,I,F){return x(this,M,I,!0,F)},t.prototype.writeFloatBE=function(M,I,F){return x(this,M,I,!1,F)},t.prototype.writeDoubleLE=function(M,I,F){return _(this,M,I,!0,F)},t.prototype.writeDoubleBE=function(M,I,F){return _(this,M,I,!1,F)},t.prototype.copy=function(M,I,F,U){if(!t.isBuffer(M))throw new TypeError("argument should be a Buffer");if(F||(F=0),U||U===0||(U=this.length),I>=M.length&&(I=M.length),I||(I=0),U>0&&U<F&&(U=F),U===F||M.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(F<0||F>=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),M.length-I<U-F&&(U=M.length-I+F);var X=U-F;if(this===M&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(I,F,U);else if(this===M&&F<I&&I<U)for(var V=X-1;V>=0;--V)M[V+I]=this[V+F];else Uint8Array.prototype.set.call(M,this.subarray(F,U),I);return X},t.prototype.fill=function(M,I,F,U){if(typeof M=="string"){if(typeof I=="string"?(U=I,I=0,F=this.length):typeof F=="string"&&(U=F,F=this.length),U!==void 0&&typeof U!="string")throw new TypeError("encoding must be a string");if(typeof U=="string"&&!t.isEncoding(U))throw new TypeError("Unknown encoding: "+U);if(M.length===1){var X=M.charCodeAt(0);(U==="utf8"&&X<128||U==="latin1")&&(M=X)}}else typeof M=="number"&&(M&=255);if(I<0||this.length<I||this.length<F)throw new RangeError("Out of range index");if(F<=I)return this;var V;if(I>>>=0,F=F===void 0?this.length:F>>>0,M||(M=0),typeof M=="number")for(V=I;V<F;++V)this[V]=M;else{var G=t.isBuffer(M)?M:t.from(M,U),ee=G.length;if(ee===0)throw new TypeError('The value "'+M+'" is invalid for argument "value"');for(V=0;V<F-I;++V)this[V+I]=G[V%ee]}return this};var T=/[^+/0-9A-Za-z-_]/g;function D(M){return M<16?"0"+M.toString(16):M.toString(16)}function q(M,I){var F;I=I||1/0;for(var U=M.length,X=null,V=[],G=0;G<U;++G){if((F=M.charCodeAt(G))>55295&&F<57344){if(!X){if(F>56319){(I-=3)>-1&&V.push(239,191,189);continue}if(G+1===U){(I-=3)>-1&&V.push(239,191,189);continue}X=F;continue}if(F<56320){(I-=3)>-1&&V.push(239,191,189),X=F;continue}F=65536+(X-55296<<10|F-56320)}else X&&(I-=3)>-1&&V.push(239,191,189);if(X=null,F<128){if((I-=1)<0)break;V.push(F)}else if(F<2048){if((I-=2)<0)break;V.push(F>>6|192,63&F|128)}else if(F<65536){if((I-=3)<0)break;V.push(F>>12|224,F>>6&63|128,63&F|128)}else{if(!(F<1114112))throw new Error("Invalid code point");if((I-=4)<0)break;V.push(F>>18|240,F>>12&63|128,F>>6&63|128,63&F|128)}}return V}function $(M){return i.toByteArray((function(I){if((I=(I=I.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;I.length%4!=0;)I+="=";return I})(M))}function W(M,I,F,U){for(var X=0;X<U&&!(X+F>=I.length||X>=M.length);++X)I[X+F]=M[X];return X}function A(M,I){return M instanceof I||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===I.name}function H(M){return M!=M}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":185,buffer:220,ieee754:439}],221:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("stream").Transform,a=e("string_decoder").StringDecoder;function r(t){i.call(this),this.hashMode=typeof t=="string",this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(r,i),r.prototype.update=function(t,n,l){typeof t=="string"&&(t=c.from(t,n));var o=this._update(t);return this.hashMode?this:(l&&(o=this._toString(o,l)),o)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(t,n,l){var o;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(s){o=s}finally{l(o)}},r.prototype._flush=function(t){var n;try{this.push(this.__final())}catch(l){n=l}t(n)},r.prototype._finalOrDigest=function(t){var n=this.__final()||c.alloc(0);return t&&(n=this._toString(n,t,!0)),n},r.prototype._toString=function(t,n,l){if(this._decoder||(this._decoder=new a(n),this._encoding=n),this._encoding!==n)throw new Error("can't switch encodings");var o=this._decoder.write(t);return l&&(o+=this._decoder.end()),o},p.exports=r},{inherits:440,"safe-buffer":494,stream:505,string_decoder:218}],222:[function(e,p,b){"use strict";var c=e("../internals/is-callable"),i=e("../internals/try-to-string"),a=TypeError;p.exports=function(r){if(c(r))return r;throw new a(i(r)+" is not a function")}},{"../internals/is-callable":285,"../internals/try-to-string":349}],223:[function(e,p,b){"use strict";var c=e("../internals/is-constructor"),i=e("../internals/try-to-string"),a=TypeError;p.exports=function(r){if(c(r))return r;throw new a(i(r)+" is not a constructor")}},{"../internals/is-constructor":286,"../internals/try-to-string":349}],224:[function(e,p,b){"use strict";var c=e("../internals/is-callable"),i=String,a=TypeError;p.exports=function(r){if(typeof r=="object"||c(r))return r;throw new a("Can't set "+i(r)+" as a prototype")}},{"../internals/is-callable":285}],225:[function(e,p,b){"use strict";var c=e("../internals/well-known-symbol"),i=e("../internals/object-create"),a=e("../internals/object-define-property").f,r=c("unscopables"),t=Array.prototype;t[r]===void 0&&a(t,r,{configurable:!0,value:i(null)}),p.exports=function(n){t[r][n]=!0}},{"../internals/object-create":306,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],226:[function(e,p,b){"use strict";var c=e("../internals/object-is-prototype-of"),i=TypeError;p.exports=function(a,r){if(c(r,a))return a;throw new i("Incorrect invocation")}},{"../internals/object-is-prototype-of":314}],227:[function(e,p,b){"use strict";var c=e("../internals/is-object"),i=String,a=TypeError;p.exports=function(r){if(c(r))return r;throw new a(i(r)+" is not an object")}},{"../internals/is-object":289}],228:[function(e,p,b){"use strict";var c=e("../internals/to-indexed-object"),i=e("../internals/to-absolute-index"),a=e("../internals/length-of-array-like"),r=function(t){return function(n,l,o){var s,f=c(n),d=a(f),u=i(o,d);if(t&&l!=l){for(;d>u;)if((s=f[u++])!=s)return!0}else for(;d>u;u++)if((t||u in f)&&f[u]===l)return t||u||0;return!t&&-1}};p.exports={includes:r(!0),indexOf:r(!1)}},{"../internals/length-of-array-like":299,"../internals/to-absolute-index":340,"../internals/to-indexed-object":341}],229:[function(e,p,b){"use strict";var c=e("../internals/function-bind-context"),i=e("../internals/function-uncurry-this"),a=e("../internals/indexed-object"),r=e("../internals/to-object"),t=e("../internals/length-of-array-like"),n=e("../internals/array-species-create"),l=i([].push),o=function(s){var f=s===1,d=s===2,u=s===3,g=s===4,m=s===6,v=s===7,k=s===5||m;return function(B,O,L,R){for(var P,j,z=r(B),N=a(z),S=c(O,L),C=t(N),E=0,h=R||n,y=f?h(B,C):d||v?h(B,0):void 0;C>E;E++)if((k||E in N)&&(j=S(P=N[E],E,z),s))if(f)y[E]=j;else if(j)switch(s){case 3:return!0;case 5:return P;case 6:return E;case 2:l(y,P)}else switch(s){case 4:return!1;case 7:l(y,P)}return m?-1:u||g?g:y}};p.exports={forEach:o(0),map:o(1),filter:o(2),some:o(3),every:o(4),find:o(5),findIndex:o(6),filterReject:o(7)}},{"../internals/array-species-create":233,"../internals/function-bind-context":262,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/length-of-array-like":299,"../internals/to-object":344}],230:[function(e,p,b){"use strict";var c=e("../internals/to-absolute-index"),i=e("../internals/length-of-array-like"),a=e("../internals/create-property"),r=Array,t=Math.max;p.exports=function(n,l,o){for(var s=i(n),f=c(l,s),d=c(o===void 0?s:o,s),u=r(t(d-f,0)),g=0;f<d;f++,g++)a(u,g,n[f]);return u.length=g,u}},{"../internals/create-property":243,"../internals/length-of-array-like":299,"../internals/to-absolute-index":340}],231:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this");p.exports=c([].slice)},{"../internals/function-uncurry-this":268}],232:[function(e,p,b){"use strict";var c=e("../internals/is-array"),i=e("../internals/is-constructor"),a=e("../internals/is-object"),r=e("../internals/well-known-symbol")("species"),t=Array;p.exports=function(n){var l;return c(n)&&(l=n.constructor,(i(l)&&(l===t||c(l.prototype))||a(l)&&(l=l[r])===null)&&(l=void 0)),l===void 0?t:l}},{"../internals/is-array":284,"../internals/is-constructor":286,"../internals/is-object":289,"../internals/well-known-symbol":357}],233:[function(e,p,b){"use strict";var c=e("../internals/array-species-constructor");p.exports=function(i,a){return new(c(i))(a===0?0:a)}},{"../internals/array-species-constructor":232}],234:[function(e,p,b){"use strict";var c=e("../internals/well-known-symbol")("iterator"),i=!1;try{var a=0,r={next:function(){return{done:!!a++}},return:function(){i=!0}};r[c]=function(){return this},Array.from(r,(function(){throw 2}))}catch{}p.exports=function(t,n){try{if(!n&&!i)return!1}catch{return!1}var l=!1;try{var o={};o[c]=function(){return{next:function(){return{done:l=!0}}}},t(o)}catch{}return l}},{"../internals/well-known-symbol":357}],235:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=c({}.toString),a=c("".slice);p.exports=function(r){return a(i(r),8,-1)}},{"../internals/function-uncurry-this":268}],236:[function(e,p,b){"use strict";var c=e("../internals/to-string-tag-support"),i=e("../internals/is-callable"),a=e("../internals/classof-raw"),r=e("../internals/well-known-symbol")("toStringTag"),t=Object,n=a((function(){return arguments})())==="Arguments";p.exports=c?a:function(l){var o,s,f;return l===void 0?"Undefined":l===null?"Null":typeof(s=(function(d,u){try{return d[u]}catch{}})(o=t(l),r))=="string"?s:n?a(o):(f=a(o))==="Object"&&i(o.callee)?"Arguments":f}},{"../internals/classof-raw":235,"../internals/is-callable":285,"../internals/to-string-tag-support":347,"../internals/well-known-symbol":357}],237:[function(e,p,b){"use strict";var c=e("../internals/has-own-property"),i=e("../internals/own-keys"),a=e("../internals/object-get-own-property-descriptor"),r=e("../internals/object-define-property");p.exports=function(t,n,l){for(var o=i(n),s=r.f,f=a.f,d=0;d<o.length;d++){var u=o[d];c(t,u)||l&&c(l,u)||s(t,u,f(n,u))}}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/object-get-own-property-descriptor":309,"../internals/own-keys":321}],238:[function(e,p,b){"use strict";var c=e("../internals/well-known-symbol")("match");p.exports=function(i){var a=/./;try{"/./"[i](a)}catch{try{return a[c]=!1,"/./"[i](a)}catch{}}return!1}},{"../internals/well-known-symbol":357}],239:[function(e,p,b){"use strict";var c=e("../internals/fails");p.exports=!c((function(){function i(){}return i.prototype.constructor=null,Object.getPrototypeOf(new i)!==i.prototype}))},{"../internals/fails":260}],240:[function(e,p,b){"use strict";p.exports=function(c,i){return{value:c,done:i}}},{}],241:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/create-property-descriptor");p.exports=c?function(r,t,n){return i.f(r,t,a(1,n))}:function(r,t,n){return r[t]=n,r}},{"../internals/create-property-descriptor":242,"../internals/descriptors":247,"../internals/object-define-property":308}],242:[function(e,p,b){"use strict";p.exports=function(c,i){return{enumerable:!(1&c),configurable:!(2&c),writable:!(4&c),value:i}}},{}],243:[function(e,p,b){"use strict";var c=e("../internals/to-property-key"),i=e("../internals/object-define-property"),a=e("../internals/create-property-descriptor");p.exports=function(r,t,n){var l=c(t);l in r?i.f(r,l,a(0,n)):r[l]=n}},{"../internals/create-property-descriptor":242,"../internals/object-define-property":308,"../internals/to-property-key":346}],244:[function(e,p,b){"use strict";var c=e("../internals/make-built-in"),i=e("../internals/object-define-property");p.exports=function(a,r,t){return t.get&&c(t.get,r,{getter:!0}),t.set&&c(t.set,r,{setter:!0}),i.f(a,r,t)}},{"../internals/make-built-in":300,"../internals/object-define-property":308}],245:[function(e,p,b){"use strict";var c=e("../internals/is-callable"),i=e("../internals/object-define-property"),a=e("../internals/make-built-in"),r=e("../internals/define-global-property");p.exports=function(t,n,l,o){o||(o={});var s=o.enumerable,f=o.name!==void 0?o.name:n;if(c(l)&&a(l,f,o),o.global)s?t[n]=l:r(n,l);else{try{o.unsafe?t[n]&&(s=!0):delete t[n]}catch{}s?t[n]=l:i.f(t,n,{value:l,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},{"../internals/define-global-property":246,"../internals/is-callable":285,"../internals/make-built-in":300,"../internals/object-define-property":308}],246:[function(e,p,b){"use strict";var c=e("../internals/global"),i=Object.defineProperty;p.exports=function(a,r){try{i(c,a,{value:r,configurable:!0,writable:!0})}catch{c[a]=r}return r}},{"../internals/global":274}],247:[function(e,p,b){"use strict";var c=e("../internals/fails");p.exports=!c((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}))},{"../internals/fails":260}],248:[function(e,p,b){"use strict";var c=typeof document=="object"&&document.all,i=c===void 0&&c!==void 0;p.exports={all:c,IS_HTMLDDA:i}},{}],249:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/is-object"),a=c.document,r=i(a)&&i(a.createElement);p.exports=function(t){return r?a.createElement(t):{}}},{"../internals/global":274,"../internals/is-object":289}],250:[function(e,p,b){"use strict";var c=e("../internals/engine-is-deno"),i=e("../internals/engine-is-node");p.exports=!c&&!i&&typeof window=="object"&&typeof document=="object"},{"../internals/engine-is-deno":251,"../internals/engine-is-node":254}],251:[function(e,p,b){"use strict";p.exports=typeof Deno=="object"&&Deno&&typeof Deno.version=="object"},{}],252:[function(e,p,b){"use strict";var c=e("../internals/engine-user-agent");p.exports=/ipad|iphone|ipod/i.test(c)&&typeof Pebble<"u"},{"../internals/engine-user-agent":256}],253:[function(e,p,b){"use strict";var c=e("../internals/engine-user-agent");p.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(c)},{"../internals/engine-user-agent":256}],254:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/classof-raw");p.exports=i(c.process)==="process"},{"../internals/classof-raw":235,"../internals/global":274}],255:[function(e,p,b){"use strict";var c=e("../internals/engine-user-agent");p.exports=/web0s(?!.*chrome)/i.test(c)},{"../internals/engine-user-agent":256}],256:[function(e,p,b){"use strict";p.exports=typeof navigator<"u"&&String(navigator.userAgent)||""},{}],257:[function(e,p,b){"use strict";var c,i,a=e("../internals/global"),r=e("../internals/engine-user-agent"),t=a.process,n=a.Deno,l=t&&t.versions||n&&n.version,o=l&&l.v8;o&&(i=(c=o.split("."))[0]>0&&c[0]<4?1:+(c[0]+c[1])),!i&&r&&(!(c=r.match(/Edge\/(\d+)/))||c[1]>=74)&&(c=r.match(/Chrome\/(\d+)/))&&(i=+c[1]),p.exports=i},{"../internals/engine-user-agent":256,"../internals/global":274}],258:[function(e,p,b){"use strict";p.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],259:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/object-get-own-property-descriptor").f,a=e("../internals/create-non-enumerable-property"),r=e("../internals/define-built-in"),t=e("../internals/define-global-property"),n=e("../internals/copy-constructor-properties"),l=e("../internals/is-forced");p.exports=function(o,s){var f,d,u,g,m,v=o.target,k=o.global,B=o.stat;if(f=k?c:B?c[v]||t(v,{}):(c[v]||{}).prototype)for(d in s){if(g=s[d],u=o.dontCallGetSet?(m=i(f,d))&&m.value:f[d],!l(k?d:v+(B?".":"#")+d,o.forced)&&u!==void 0){if(typeof g==typeof u)continue;n(g,u)}(o.sham||u&&u.sham)&&a(g,"sham",!0),r(f,d,g,o)}}},{"../internals/copy-constructor-properties":237,"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/define-global-property":246,"../internals/global":274,"../internals/is-forced":287,"../internals/object-get-own-property-descriptor":309}],260:[function(e,p,b){"use strict";p.exports=function(c){try{return!!c()}catch{return!0}}},{}],261:[function(e,p,b){"use strict";var c=e("../internals/function-bind-native"),i=Function.prototype,a=i.apply,r=i.call;p.exports=typeof Reflect=="object"&&Reflect.apply||(c?r.bind(a):function(){return r.apply(a,arguments)})},{"../internals/function-bind-native":263}],262:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this-clause"),i=e("../internals/a-callable"),a=e("../internals/function-bind-native"),r=c(c.bind);p.exports=function(t,n){return i(t),n===void 0?t:a?r(t,n):function(){return t.apply(n,arguments)}}},{"../internals/a-callable":222,"../internals/function-bind-native":263,"../internals/function-uncurry-this-clause":267}],263:[function(e,p,b){"use strict";var c=e("../internals/fails");p.exports=!c((function(){var i=function(){}.bind();return typeof i!="function"||i.hasOwnProperty("prototype")}))},{"../internals/fails":260}],264:[function(e,p,b){"use strict";var c=e("../internals/function-bind-native"),i=Function.prototype.call;p.exports=c?i.bind(i):function(){return i.apply(i,arguments)}},{"../internals/function-bind-native":263}],265:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/has-own-property"),a=Function.prototype,r=c&&Object.getOwnPropertyDescriptor,t=i(a,"name"),n=t&&function(){}.name==="something",l=t&&(!c||c&&r(a,"name").configurable);p.exports={EXISTS:t,PROPER:n,CONFIGURABLE:l}},{"../internals/descriptors":247,"../internals/has-own-property":275}],266:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/a-callable");p.exports=function(a,r,t){try{return c(i(Object.getOwnPropertyDescriptor(a,r)[t]))}catch{}}},{"../internals/a-callable":222,"../internals/function-uncurry-this":268}],267:[function(e,p,b){"use strict";var c=e("../internals/classof-raw"),i=e("../internals/function-uncurry-this");p.exports=function(a){if(c(a)==="Function")return i(a)}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268}],268:[function(e,p,b){"use strict";var c=e("../internals/function-bind-native"),i=Function.prototype,a=i.call,r=c&&i.bind.bind(a,a);p.exports=c?r:function(t){return function(){return a.apply(t,arguments)}}},{"../internals/function-bind-native":263}],269:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/is-callable"),a=function(r){return i(r)?r:void 0};p.exports=function(r,t){return arguments.length<2?a(c[r]):c[r]&&c[r][t]}},{"../internals/global":274,"../internals/is-callable":285}],270:[function(e,p,b){"use strict";var c=e("../internals/classof"),i=e("../internals/get-method"),a=e("../internals/is-null-or-undefined"),r=e("../internals/iterators"),t=e("../internals/well-known-symbol")("iterator");p.exports=function(n){if(!a(n))return i(n,t)||i(n,"@@iterator")||r[c(n)]}},{"../internals/classof":236,"../internals/get-method":273,"../internals/is-null-or-undefined":288,"../internals/iterators":298,"../internals/well-known-symbol":357}],271:[function(e,p,b){"use strict";var c=e("../internals/function-call"),i=e("../internals/a-callable"),a=e("../internals/an-object"),r=e("../internals/try-to-string"),t=e("../internals/get-iterator-method"),n=TypeError;p.exports=function(l,o){var s=arguments.length<2?t(l):o;if(i(s))return a(c(s,l));throw new n(r(l)+" is not iterable")}},{"../internals/a-callable":222,"../internals/an-object":227,"../internals/function-call":264,"../internals/get-iterator-method":270,"../internals/try-to-string":349}],272:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/is-array"),a=e("../internals/is-callable"),r=e("../internals/classof-raw"),t=e("../internals/to-string"),n=c([].push);p.exports=function(l){if(a(l))return l;if(i(l)){for(var o=l.length,s=[],f=0;f<o;f++){var d=l[f];typeof d=="string"?n(s,d):typeof d!="number"&&r(d)!=="Number"&&r(d)!=="String"||n(s,t(d))}var u=s.length,g=!0;return function(m,v){if(g)return g=!1,v;if(i(this))return v;for(var k=0;k<u;k++)if(s[k]===m)return v}}}},{"../internals/classof-raw":235,"../internals/function-uncurry-this":268,"../internals/is-array":284,"../internals/is-callable":285,"../internals/to-string":348}],273:[function(e,p,b){"use strict";var c=e("../internals/a-callable"),i=e("../internals/is-null-or-undefined");p.exports=function(a,r){var t=a[r];return i(t)?void 0:c(t)}},{"../internals/a-callable":222,"../internals/is-null-or-undefined":288}],274:[function(e,p,b){(function(c){(function(){"use strict";var i=function(a){return a&&a.Math===Math&&a};p.exports=i(typeof globalThis=="object"&&globalThis)||i(typeof window=="object"&&window)||i(typeof self=="object"&&self)||i(typeof c=="object"&&c)||(function(){return this})()||this||Function("return this")()}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],275:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/to-object"),a=c({}.hasOwnProperty);p.exports=Object.hasOwn||function(r,t){return a(i(r),t)}},{"../internals/function-uncurry-this":268,"../internals/to-object":344}],276:[function(e,p,b){"use strict";p.exports={}},{}],277:[function(e,p,b){"use strict";p.exports=function(c,i){try{arguments.length===1?console.error(c):console.error(c,i)}catch{}}},{}],278:[function(e,p,b){"use strict";var c=e("../internals/get-built-in");p.exports=c("document","documentElement")},{"../internals/get-built-in":269}],279:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/fails"),a=e("../internals/document-create-element");p.exports=!c&&!i((function(){return Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a!==7}))},{"../internals/descriptors":247,"../internals/document-create-element":249,"../internals/fails":260}],280:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/fails"),a=e("../internals/classof-raw"),r=Object,t=c("".split);p.exports=i((function(){return!r("z").propertyIsEnumerable(0)}))?function(n){return a(n)==="String"?t(n,""):r(n)}:r},{"../internals/classof-raw":235,"../internals/fails":260,"../internals/function-uncurry-this":268}],281:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/is-callable"),a=e("../internals/shared-store"),r=c(Function.toString);i(a.inspectSource)||(a.inspectSource=function(t){return r(t)}),p.exports=a.inspectSource},{"../internals/function-uncurry-this":268,"../internals/is-callable":285,"../internals/shared-store":333}],282:[function(e,p,b){"use strict";var c,i,a,r=e("../internals/weak-map-basic-detection"),t=e("../internals/global"),n=e("../internals/is-object"),l=e("../internals/create-non-enumerable-property"),o=e("../internals/has-own-property"),s=e("../internals/shared-store"),f=e("../internals/shared-key"),d=e("../internals/hidden-keys"),u=t.TypeError,g=t.WeakMap;if(r||s.state){var m=s.state||(s.state=new g);m.get=m.get,m.has=m.has,m.set=m.set,c=function(k,B){if(m.has(k))throw new u("Object already initialized");return B.facade=k,m.set(k,B),B},i=function(k){return m.get(k)||{}},a=function(k){return m.has(k)}}else{var v=f("state");d[v]=!0,c=function(k,B){if(o(k,v))throw new u("Object already initialized");return B.facade=k,l(k,v,B),B},i=function(k){return o(k,v)?k[v]:{}},a=function(k){return o(k,v)}}p.exports={set:c,get:i,has:a,enforce:function(k){return a(k)?i(k):c(k,{})},getterFor:function(k){return function(B){var O;if(!n(B)||(O=i(B)).type!==k)throw new u("Incompatible receiver, "+k+" required");return O}}}},{"../internals/create-non-enumerable-property":241,"../internals/global":274,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/is-object":289,"../internals/shared-key":332,"../internals/shared-store":333,"../internals/weak-map-basic-detection":354}],283:[function(e,p,b){"use strict";var c=e("../internals/well-known-symbol"),i=e("../internals/iterators"),a=c("iterator"),r=Array.prototype;p.exports=function(t){return t!==void 0&&(i.Array===t||r[a]===t)}},{"../internals/iterators":298,"../internals/well-known-symbol":357}],284:[function(e,p,b){"use strict";var c=e("../internals/classof-raw");p.exports=Array.isArray||function(i){return c(i)==="Array"}},{"../internals/classof-raw":235}],285:[function(e,p,b){"use strict";var c=e("../internals/document-all"),i=c.all;p.exports=c.IS_HTMLDDA?function(a){return typeof a=="function"||a===i}:function(a){return typeof a=="function"}},{"../internals/document-all":248}],286:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/fails"),a=e("../internals/is-callable"),r=e("../internals/classof"),t=e("../internals/get-built-in"),n=e("../internals/inspect-source"),l=function(){},o=[],s=t("Reflect","construct"),f=/^\s*(?:class|function)\b/,d=c(f.exec),u=!f.test(l),g=function(v){if(!a(v))return!1;try{return s(l,o,v),!0}catch{return!1}},m=function(v){if(!a(v))return!1;switch(r(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return u||!!d(f,n(v))}catch{return!0}};m.sham=!0,p.exports=!s||i((function(){var v;return g(g.call)||!g(Object)||!g((function(){v=!0}))||v}))?m:g},{"../internals/classof":236,"../internals/fails":260,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/inspect-source":281,"../internals/is-callable":285}],287:[function(e,p,b){"use strict";var c=e("../internals/fails"),i=e("../internals/is-callable"),a=/#|\.prototype\./,r=function(s,f){var d=n[t(s)];return d===o||d!==l&&(i(f)?c(f):!!f)},t=r.normalize=function(s){return String(s).replace(a,".").toLowerCase()},n=r.data={},l=r.NATIVE="N",o=r.POLYFILL="P";p.exports=r},{"../internals/fails":260,"../internals/is-callable":285}],288:[function(e,p,b){"use strict";p.exports=function(c){return c==null}},{}],289:[function(e,p,b){"use strict";var c=e("../internals/is-callable"),i=e("../internals/document-all"),a=i.all;p.exports=i.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:c(r)||r===a}:function(r){return typeof r=="object"?r!==null:c(r)}},{"../internals/document-all":248,"../internals/is-callable":285}],290:[function(e,p,b){"use strict";p.exports=!1},{}],291:[function(e,p,b){"use strict";var c=e("../internals/is-object"),i=e("../internals/classof-raw"),a=e("../internals/well-known-symbol")("match");p.exports=function(r){var t;return c(r)&&((t=r[a])!==void 0?!!t:i(r)==="RegExp")}},{"../internals/classof-raw":235,"../internals/is-object":289,"../internals/well-known-symbol":357}],292:[function(e,p,b){"use strict";var c=e("../internals/get-built-in"),i=e("../internals/is-callable"),a=e("../internals/object-is-prototype-of"),r=e("../internals/use-symbol-as-uid"),t=Object;p.exports=r?function(n){return typeof n=="symbol"}:function(n){var l=c("Symbol");return i(l)&&a(l.prototype,t(n))}},{"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/object-is-prototype-of":314,"../internals/use-symbol-as-uid":351}],293:[function(e,p,b){"use strict";var c=e("../internals/function-bind-context"),i=e("../internals/function-call"),a=e("../internals/an-object"),r=e("../internals/try-to-string"),t=e("../internals/is-array-iterator-method"),n=e("../internals/length-of-array-like"),l=e("../internals/object-is-prototype-of"),o=e("../internals/get-iterator"),s=e("../internals/get-iterator-method"),f=e("../internals/iterator-close"),d=TypeError,u=function(m,v){this.stopped=m,this.result=v},g=u.prototype;p.exports=function(m,v,k){var B,O,L,R,P,j,z,N=k&&k.that,S=!(!k||!k.AS_ENTRIES),C=!(!k||!k.IS_RECORD),E=!(!k||!k.IS_ITERATOR),h=!(!k||!k.INTERRUPTED),y=c(v,N),w=function(_){return B&&f(B,"normal",_),new u(!0,_)},x=function(_){return S?(a(_),h?y(_[0],_[1],w):y(_[0],_[1])):h?y(_,w):y(_)};if(C)B=m.iterator;else if(E)B=m;else{if(!(O=s(m)))throw new d(r(m)+" is not iterable");if(t(O)){for(L=0,R=n(m);R>L;L++)if((P=x(m[L]))&&l(g,P))return P;return new u(!1)}B=o(m,O)}for(j=C?m.next:B.next;!(z=i(j,B)).done;){try{P=x(z.value)}catch(_){f(B,"throw",_)}if(typeof P=="object"&&P&&l(g,P))return P}return new u(!1)}},{"../internals/an-object":227,"../internals/function-bind-context":262,"../internals/function-call":264,"../internals/get-iterator":271,"../internals/get-iterator-method":270,"../internals/is-array-iterator-method":283,"../internals/iterator-close":294,"../internals/length-of-array-like":299,"../internals/object-is-prototype-of":314,"../internals/try-to-string":349}],294:[function(e,p,b){"use strict";var c=e("../internals/function-call"),i=e("../internals/an-object"),a=e("../internals/get-method");p.exports=function(r,t,n){var l,o;i(r);try{if(!(l=a(r,"return"))){if(t==="throw")throw n;return n}l=c(l,r)}catch(s){o=!0,l=s}if(t==="throw")throw n;if(o)throw l;return i(l),n}},{"../internals/an-object":227,"../internals/function-call":264,"../internals/get-method":273}],295:[function(e,p,b){"use strict";var c=e("../internals/iterators-core").IteratorPrototype,i=e("../internals/object-create"),a=e("../internals/create-property-descriptor"),r=e("../internals/set-to-string-tag"),t=e("../internals/iterators"),n=function(){return this};p.exports=function(l,o,s,f){var d=o+" Iterator";return l.prototype=i(c,{next:a(+!f,s)}),r(l,d,!1,!0),t[d]=n,l}},{"../internals/create-property-descriptor":242,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-create":306,"../internals/set-to-string-tag":331}],296:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/function-call"),a=e("../internals/is-pure"),r=e("../internals/function-name"),t=e("../internals/is-callable"),n=e("../internals/iterator-create-constructor"),l=e("../internals/object-get-prototype-of"),o=e("../internals/object-set-prototype-of"),s=e("../internals/set-to-string-tag"),f=e("../internals/create-non-enumerable-property"),d=e("../internals/define-built-in"),u=e("../internals/well-known-symbol"),g=e("../internals/iterators"),m=e("../internals/iterators-core"),v=r.PROPER,k=r.CONFIGURABLE,B=m.IteratorPrototype,O=m.BUGGY_SAFARI_ITERATORS,L=u("iterator"),R=function(){return this};p.exports=function(P,j,z,N,S,C,E){n(z,j,N);var h,y,w,x=function(A){if(A===S&&$)return $;if(!O&&A&&A in D)return D[A];switch(A){case"keys":case"values":case"entries":return function(){return new z(this,A)}}return function(){return new z(this)}},_=j+" Iterator",T=!1,D=P.prototype,q=D[L]||D["@@iterator"]||S&&D[S],$=!O&&q||x(S),W=j==="Array"&&D.entries||q;if(W&&(h=l(W.call(new P)))!==Object.prototype&&h.next&&(a||l(h)===B||(o?o(h,B):t(h[L])||d(h,L,R)),s(h,_,!0,!0),a&&(g[_]=R)),v&&S==="values"&&q&&q.name!=="values"&&(!a&&k?f(D,"name","values"):(T=!0,$=function(){return i(q,this)})),S)if(y={values:x("values"),keys:C?$:x("keys"),entries:x("entries")},E)for(w in y)(O||T||!(w in D))&&d(D,w,y[w]);else c({target:j,proto:!0,forced:O||T},y);return a&&!E||D[L]===$||d(D,L,$,{name:S}),g[j]=$,y}},{"../internals/create-non-enumerable-property":241,"../internals/define-built-in":245,"../internals/export":259,"../internals/function-call":264,"../internals/function-name":265,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/iterator-create-constructor":295,"../internals/iterators":298,"../internals/iterators-core":297,"../internals/object-get-prototype-of":313,"../internals/object-set-prototype-of":318,"../internals/set-to-string-tag":331,"../internals/well-known-symbol":357}],297:[function(e,p,b){"use strict";var c,i,a,r=e("../internals/fails"),t=e("../internals/is-callable"),n=e("../internals/is-object"),l=e("../internals/object-create"),o=e("../internals/object-get-prototype-of"),s=e("../internals/define-built-in"),f=e("../internals/well-known-symbol"),d=e("../internals/is-pure"),u=f("iterator"),g=!1;[].keys&&("next"in(a=[].keys())?(i=o(o(a)))!==Object.prototype&&(c=i):g=!0),!n(c)||r((function(){var m={};return c[u].call(m)!==m}))?c={}:d&&(c=l(c)),t(c[u])||s(c,u,(function(){return this})),p.exports={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:g}},{"../internals/define-built-in":245,"../internals/fails":260,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-get-prototype-of":313,"../internals/well-known-symbol":357}],298:[function(e,p,b){arguments[4][276][0].apply(b,arguments)},{dup:276}],299:[function(e,p,b){"use strict";var c=e("../internals/to-length");p.exports=function(i){return c(i.length)}},{"../internals/to-length":343}],300:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/fails"),a=e("../internals/is-callable"),r=e("../internals/has-own-property"),t=e("../internals/descriptors"),n=e("../internals/function-name").CONFIGURABLE,l=e("../internals/inspect-source"),o=e("../internals/internal-state"),s=o.enforce,f=o.get,d=String,u=Object.defineProperty,g=c("".slice),m=c("".replace),v=c([].join),k=t&&!i((function(){return u((function(){}),"length",{value:8}).length!==8})),B=String(String).split("String"),O=p.exports=function(L,R,P){g(d(R),0,7)==="Symbol("&&(R="["+m(d(R),/^Symbol\(([^)]*)\)/,"$1")+"]"),P&&P.getter&&(R="get "+R),P&&P.setter&&(R="set "+R),(!r(L,"name")||n&&L.name!==R)&&(t?u(L,"name",{value:R,configurable:!0}):L.name=R),k&&P&&r(P,"arity")&&L.length!==P.arity&&u(L,"length",{value:P.arity});try{P&&r(P,"constructor")&&P.constructor?t&&u(L,"prototype",{writable:!1}):L.prototype&&(L.prototype=void 0)}catch{}var j=s(L);return r(j,"source")||(j.source=v(B,typeof R=="string"?R:"")),L};Function.prototype.toString=O((function(){return a(this)&&f(this).source||l(this)}),"toString")},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-name":265,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/inspect-source":281,"../internals/internal-state":282,"../internals/is-callable":285}],301:[function(e,p,b){"use strict";var c=Math.ceil,i=Math.floor;p.exports=Math.trunc||function(a){var r=+a;return(r>0?i:c)(r)}},{}],302:[function(e,p,b){"use strict";var c,i,a,r,t,n=e("../internals/global"),l=e("../internals/function-bind-context"),o=e("../internals/object-get-own-property-descriptor").f,s=e("../internals/task").set,f=e("../internals/queue"),d=e("../internals/engine-is-ios"),u=e("../internals/engine-is-ios-pebble"),g=e("../internals/engine-is-webos-webkit"),m=e("../internals/engine-is-node"),v=n.MutationObserver||n.WebKitMutationObserver,k=n.document,B=n.process,O=n.Promise,L=o(n,"queueMicrotask"),R=L&&L.value;if(!R){var P=new f,j=function(){var z,N;for(m&&(z=B.domain)&&z.exit();N=P.get();)try{N()}catch(S){throw P.head&&c(),S}z&&z.enter()};d||m||g||!v||!k?!u&&O&&O.resolve?((r=O.resolve(void 0)).constructor=O,t=l(r.then,r),c=function(){t(j)}):m?c=function(){B.nextTick(j)}:(s=l(s,n),c=function(){s(j)}):(i=!0,a=k.createTextNode(""),new v(j).observe(a,{characterData:!0}),c=function(){a.data=i=!i}),R=function(z){P.head||c(),P.add(z)}}p.exports=R},{"../internals/engine-is-ios":253,"../internals/engine-is-ios-pebble":252,"../internals/engine-is-node":254,"../internals/engine-is-webos-webkit":255,"../internals/function-bind-context":262,"../internals/global":274,"../internals/object-get-own-property-descriptor":309,"../internals/queue":328,"../internals/task":339}],303:[function(e,p,b){"use strict";var c=e("../internals/a-callable"),i=TypeError,a=function(r){var t,n;this.promise=new r((function(l,o){if(t!==void 0||n!==void 0)throw new i("Bad Promise constructor");t=l,n=o})),this.resolve=c(t),this.reject=c(n)};p.exports.f=function(r){return new a(r)}},{"../internals/a-callable":222}],304:[function(e,p,b){"use strict";var c=e("../internals/is-regexp"),i=TypeError;p.exports=function(a){if(c(a))throw new i("The method doesn't accept regular expressions");return a}},{"../internals/is-regexp":291}],305:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/function-uncurry-this"),a=e("../internals/function-call"),r=e("../internals/fails"),t=e("../internals/object-keys"),n=e("../internals/object-get-own-property-symbols"),l=e("../internals/object-property-is-enumerable"),o=e("../internals/to-object"),s=e("../internals/indexed-object"),f=Object.assign,d=Object.defineProperty,u=i([].concat);p.exports=!f||r((function(){if(c&&f({b:1},f(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var g={},m={},v=Symbol("assign detection");return g[v]=7,"abcdefghijklmnopqrst".split("").forEach((function(k){m[k]=k})),f({},g)[v]!==7||t(f({},m)).join("")!=="abcdefghijklmnopqrst"}))?function(g,m){for(var v=o(g),k=arguments.length,B=1,O=n.f,L=l.f;k>B;)for(var R,P=s(arguments[B++]),j=O?u(t(P),O(P)):t(P),z=j.length,N=0;z>N;)R=j[N++],c&&!a(L,P,R)||(v[R]=P[R]);return v}:f},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/indexed-object":280,"../internals/object-get-own-property-symbols":312,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-object":344}],306:[function(e,p,b){"use strict";var c,i=e("../internals/an-object"),a=e("../internals/object-define-properties"),r=e("../internals/enum-bug-keys"),t=e("../internals/hidden-keys"),n=e("../internals/html"),l=e("../internals/document-create-element"),o=e("../internals/shared-key"),s=o("IE_PROTO"),f=function(){},d=function(m){return"<script>"+m+"<\/script>"},u=function(m){m.write(d("")),m.close();var v=m.parentWindow.Object;return m=null,v},g=function(){try{c=new ActiveXObject("htmlfile")}catch{}var m,v;g=typeof document<"u"?document.domain&&c?u(c):((v=l("iframe")).style.display="none",n.appendChild(v),v.src="javascript:",(m=v.contentWindow.document).open(),m.write(d("document.F=Object")),m.close(),m.F):u(c);for(var k=r.length;k--;)delete g.prototype[r[k]];return g()};t[s]=!0,p.exports=Object.create||function(m,v){var k;return m!==null?(f.prototype=i(m),k=new f,f.prototype=null,k[s]=m):k=g(),v===void 0?k:a.f(k,v)}},{"../internals/an-object":227,"../internals/document-create-element":249,"../internals/enum-bug-keys":258,"../internals/hidden-keys":276,"../internals/html":278,"../internals/object-define-properties":307,"../internals/shared-key":332}],307:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/v8-prototype-define-bug"),a=e("../internals/object-define-property"),r=e("../internals/an-object"),t=e("../internals/to-indexed-object"),n=e("../internals/object-keys");b.f=c&&!i?Object.defineProperties:function(l,o){r(l);for(var s,f=t(o),d=n(o),u=d.length,g=0;u>g;)a.f(l,s=d[g++],f[s]);return l}},{"../internals/an-object":227,"../internals/descriptors":247,"../internals/object-define-property":308,"../internals/object-keys":316,"../internals/to-indexed-object":341,"../internals/v8-prototype-define-bug":352}],308:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/ie8-dom-define"),a=e("../internals/v8-prototype-define-bug"),r=e("../internals/an-object"),t=e("../internals/to-property-key"),n=TypeError,l=Object.defineProperty,o=Object.getOwnPropertyDescriptor;b.f=c?a?function(s,f,d){if(r(s),f=t(f),r(d),typeof s=="function"&&f==="prototype"&&"value"in d&&"writable"in d&&!d.writable){var u=o(s,f);u&&u.writable&&(s[f]=d.value,d={configurable:"configurable"in d?d.configurable:u.configurable,enumerable:"enumerable"in d?d.enumerable:u.enumerable,writable:!1})}return l(s,f,d)}:l:function(s,f,d){if(r(s),f=t(f),r(d),i)try{return l(s,f,d)}catch{}if("get"in d||"set"in d)throw new n("Accessors not supported");return"value"in d&&(s[f]=d.value),s}},{"../internals/an-object":227,"../internals/descriptors":247,"../internals/ie8-dom-define":279,"../internals/to-property-key":346,"../internals/v8-prototype-define-bug":352}],309:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/function-call"),a=e("../internals/object-property-is-enumerable"),r=e("../internals/create-property-descriptor"),t=e("../internals/to-indexed-object"),n=e("../internals/to-property-key"),l=e("../internals/has-own-property"),o=e("../internals/ie8-dom-define"),s=Object.getOwnPropertyDescriptor;b.f=c?s:function(f,d){if(f=t(f),d=n(d),o)try{return s(f,d)}catch{}if(l(f,d))return r(!i(a.f,f,d),f[d])}},{"../internals/create-property-descriptor":242,"../internals/descriptors":247,"../internals/function-call":264,"../internals/has-own-property":275,"../internals/ie8-dom-define":279,"../internals/object-property-is-enumerable":317,"../internals/to-indexed-object":341,"../internals/to-property-key":346}],310:[function(e,p,b){"use strict";var c=e("../internals/classof-raw"),i=e("../internals/to-indexed-object"),a=e("../internals/object-get-own-property-names").f,r=e("../internals/array-slice-simple"),t=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];p.exports.f=function(n){return t&&c(n)==="Window"?(function(l){try{return a(l)}catch{return r(t)}})(n):a(i(n))}},{"../internals/array-slice-simple":230,"../internals/classof-raw":235,"../internals/object-get-own-property-names":311,"../internals/to-indexed-object":341}],311:[function(e,p,b){"use strict";var c=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys").concat("length","prototype");b.f=Object.getOwnPropertyNames||function(a){return c(a,i)}},{"../internals/enum-bug-keys":258,"../internals/object-keys-internal":315}],312:[function(e,p,b){"use strict";b.f=Object.getOwnPropertySymbols},{}],313:[function(e,p,b){"use strict";var c=e("../internals/has-own-property"),i=e("../internals/is-callable"),a=e("../internals/to-object"),r=e("../internals/shared-key"),t=e("../internals/correct-prototype-getter"),n=r("IE_PROTO"),l=Object,o=l.prototype;p.exports=t?l.getPrototypeOf:function(s){var f=a(s);if(c(f,n))return f[n];var d=f.constructor;return i(d)&&f instanceof d?d.prototype:f instanceof l?o:null}},{"../internals/correct-prototype-getter":239,"../internals/has-own-property":275,"../internals/is-callable":285,"../internals/shared-key":332,"../internals/to-object":344}],314:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this");p.exports=c({}.isPrototypeOf)},{"../internals/function-uncurry-this":268}],315:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=e("../internals/has-own-property"),a=e("../internals/to-indexed-object"),r=e("../internals/array-includes").indexOf,t=e("../internals/hidden-keys"),n=c([].push);p.exports=function(l,o){var s,f=a(l),d=0,u=[];for(s in f)!i(t,s)&&i(f,s)&&n(u,s);for(;o.length>d;)i(f,s=o[d++])&&(~r(u,s)||n(u,s));return u}},{"../internals/array-includes":228,"../internals/function-uncurry-this":268,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/to-indexed-object":341}],316:[function(e,p,b){"use strict";var c=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys");p.exports=Object.keys||function(a){return c(a,i)}},{"../internals/enum-bug-keys":258,"../internals/object-keys-internal":315}],317:[function(e,p,b){"use strict";var c={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!c.call({1:2},1);b.f=a?function(r){var t=i(this,r);return!!t&&t.enumerable}:c},{}],318:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this-accessor"),i=e("../internals/an-object"),a=e("../internals/a-possible-prototype");p.exports=Object.setPrototypeOf||("__proto__"in{}?(function(){var r,t=!1,n={};try{(r=c(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch{}return function(l,o){return i(l),a(o),t?r(l,o):l.__proto__=o,l}})():void 0)},{"../internals/a-possible-prototype":224,"../internals/an-object":227,"../internals/function-uncurry-this-accessor":266}],319:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/fails"),a=e("../internals/function-uncurry-this"),r=e("../internals/object-get-prototype-of"),t=e("../internals/object-keys"),n=e("../internals/to-indexed-object"),l=a(e("../internals/object-property-is-enumerable").f),o=a([].push),s=c&&i((function(){var d=Object.create(null);return d[2]=2,!l(d,2)})),f=function(d){return function(u){for(var g,m=n(u),v=t(m),k=s&&r(m)===null,B=v.length,O=0,L=[];B>O;)g=v[O++],c&&!(k?g in m:l(m,g))||o(L,d?[g,m[g]]:m[g]);return L}};p.exports={entries:f(!0),values:f(!1)}},{"../internals/descriptors":247,"../internals/fails":260,"../internals/function-uncurry-this":268,"../internals/object-get-prototype-of":313,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/to-indexed-object":341}],320:[function(e,p,b){"use strict";var c=e("../internals/function-call"),i=e("../internals/is-callable"),a=e("../internals/is-object"),r=TypeError;p.exports=function(t,n){var l,o;if(n==="string"&&i(l=t.toString)&&!a(o=c(l,t))||i(l=t.valueOf)&&!a(o=c(l,t))||n!=="string"&&i(l=t.toString)&&!a(o=c(l,t)))return o;throw new r("Can't convert object to primitive value")}},{"../internals/function-call":264,"../internals/is-callable":285,"../internals/is-object":289}],321:[function(e,p,b){"use strict";var c=e("../internals/get-built-in"),i=e("../internals/function-uncurry-this"),a=e("../internals/object-get-own-property-names"),r=e("../internals/object-get-own-property-symbols"),t=e("../internals/an-object"),n=i([].concat);p.exports=c("Reflect","ownKeys")||function(l){var o=a.f(t(l)),s=r.f;return s?n(o,s(l)):o}},{"../internals/an-object":227,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/object-get-own-property-names":311,"../internals/object-get-own-property-symbols":312}],322:[function(e,p,b){"use strict";var c=e("../internals/global");p.exports=c},{"../internals/global":274}],323:[function(e,p,b){"use strict";p.exports=function(c){try{return{error:!1,value:c()}}catch(i){return{error:!0,value:i}}}},{}],324:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/promise-native-constructor"),a=e("../internals/is-callable"),r=e("../internals/is-forced"),t=e("../internals/inspect-source"),n=e("../internals/well-known-symbol"),l=e("../internals/engine-is-browser"),o=e("../internals/engine-is-deno"),s=e("../internals/is-pure"),f=e("../internals/engine-v8-version"),d=i&&i.prototype,u=n("species"),g=!1,m=a(c.PromiseRejectionEvent),v=r("Promise",(function(){var k=t(i),B=k!==String(i);if(!B&&f===66||s&&(!d.catch||!d.finally))return!0;if(!f||f<51||!/native code/.test(k)){var O=new i((function(R){R(1)})),L=function(R){R((function(){}),(function(){}))};if((O.constructor={})[u]=L,!(g=O.then((function(){}))instanceof L))return!0}return!B&&(l||o)&&!m}));p.exports={CONSTRUCTOR:v,REJECTION_EVENT:m,SUBCLASSING:g}},{"../internals/engine-is-browser":250,"../internals/engine-is-deno":251,"../internals/engine-v8-version":257,"../internals/global":274,"../internals/inspect-source":281,"../internals/is-callable":285,"../internals/is-forced":287,"../internals/is-pure":290,"../internals/promise-native-constructor":325,"../internals/well-known-symbol":357}],325:[function(e,p,b){"use strict";var c=e("../internals/global");p.exports=c.Promise},{"../internals/global":274}],326:[function(e,p,b){"use strict";var c=e("../internals/an-object"),i=e("../internals/is-object"),a=e("../internals/new-promise-capability");p.exports=function(r,t){if(c(r),i(t)&&t.constructor===r)return t;var n=a.f(r);return(0,n.resolve)(t),n.promise}},{"../internals/an-object":227,"../internals/is-object":289,"../internals/new-promise-capability":303}],327:[function(e,p,b){"use strict";var c=e("../internals/promise-native-constructor"),i=e("../internals/check-correctness-of-iteration"),a=e("../internals/promise-constructor-detection").CONSTRUCTOR;p.exports=a||!i((function(r){c.all(r).then(void 0,(function(){}))}))},{"../internals/check-correctness-of-iteration":234,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325}],328:[function(e,p,b){"use strict";var c=function(){this.head=null,this.tail=null};c.prototype={add:function(i){var a={item:i,next:null},r=this.tail;r?r.next=a:this.head=a,this.tail=a},get:function(){var i=this.head;if(i)return(this.head=i.next)===null&&(this.tail=null),i.item}},p.exports=c},{}],329:[function(e,p,b){"use strict";var c=e("../internals/is-null-or-undefined"),i=TypeError;p.exports=function(a){if(c(a))throw new i("Can't call method on "+a);return a}},{"../internals/is-null-or-undefined":288}],330:[function(e,p,b){"use strict";var c=e("../internals/get-built-in"),i=e("../internals/define-built-in-accessor"),a=e("../internals/well-known-symbol"),r=e("../internals/descriptors"),t=a("species");p.exports=function(n){var l=c(n);r&&l&&!l[t]&&i(l,t,{configurable:!0,get:function(){return this}})}},{"../internals/define-built-in-accessor":244,"../internals/descriptors":247,"../internals/get-built-in":269,"../internals/well-known-symbol":357}],331:[function(e,p,b){"use strict";var c=e("../internals/object-define-property").f,i=e("../internals/has-own-property"),a=e("../internals/well-known-symbol")("toStringTag");p.exports=function(r,t,n){r&&!n&&(r=r.prototype),r&&!i(r,a)&&c(r,a,{configurable:!0,value:t})}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/well-known-symbol":357}],332:[function(e,p,b){"use strict";var c=e("../internals/shared"),i=e("../internals/uid"),a=c("keys");p.exports=function(r){return a[r]||(a[r]=i(r))}},{"../internals/shared":334,"../internals/uid":350}],333:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/define-global-property"),a=c["__core-js_shared__"]||i("__core-js_shared__",{});p.exports=a},{"../internals/define-global-property":246,"../internals/global":274}],334:[function(e,p,b){"use strict";var c=e("../internals/is-pure"),i=e("../internals/shared-store");(p.exports=function(a,r){return i[a]||(i[a]=r!==void 0?r:{})})("versions",[]).push({version:"3.33.0",mode:c?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE",source:"https://github.com/zloirock/core-js"})},{"../internals/is-pure":290,"../internals/shared-store":333}],335:[function(e,p,b){"use strict";var c=e("../internals/an-object"),i=e("../internals/a-constructor"),a=e("../internals/is-null-or-undefined"),r=e("../internals/well-known-symbol")("species");p.exports=function(t,n){var l,o=c(t).constructor;return o===void 0||a(l=c(o)[r])?n:i(l)}},{"../internals/a-constructor":223,"../internals/an-object":227,"../internals/is-null-or-undefined":288,"../internals/well-known-symbol":357}],336:[function(e,p,b){"use strict";var c=e("../internals/engine-v8-version"),i=e("../internals/fails"),a=e("../internals/global").String;p.exports=!!Object.getOwnPropertySymbols&&!i((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&c&&c<41}))},{"../internals/engine-v8-version":257,"../internals/fails":260,"../internals/global":274}],337:[function(e,p,b){"use strict";var c=e("../internals/function-call"),i=e("../internals/get-built-in"),a=e("../internals/well-known-symbol"),r=e("../internals/define-built-in");p.exports=function(){var t=i("Symbol"),n=t&&t.prototype,l=n&&n.valueOf,o=a("toPrimitive");n&&!n[o]&&r(n,o,(function(s){return c(l,this)}),{arity:1})}},{"../internals/define-built-in":245,"../internals/function-call":264,"../internals/get-built-in":269,"../internals/well-known-symbol":357}],338:[function(e,p,b){"use strict";var c=e("../internals/symbol-constructor-detection");p.exports=c&&!!Symbol.for&&!!Symbol.keyFor},{"../internals/symbol-constructor-detection":336}],339:[function(e,p,b){"use strict";var c,i,a,r,t=e("../internals/global"),n=e("../internals/function-apply"),l=e("../internals/function-bind-context"),o=e("../internals/is-callable"),s=e("../internals/has-own-property"),f=e("../internals/fails"),d=e("../internals/html"),u=e("../internals/array-slice"),g=e("../internals/document-create-element"),m=e("../internals/validate-arguments-length"),v=e("../internals/engine-is-ios"),k=e("../internals/engine-is-node"),B=t.setImmediate,O=t.clearImmediate,L=t.process,R=t.Dispatch,P=t.Function,j=t.MessageChannel,z=t.String,N=0,S={};f((function(){c=t.location}));var C=function(w){if(s(S,w)){var x=S[w];delete S[w],x()}},E=function(w){return function(){C(w)}},h=function(w){C(w.data)},y=function(w){t.postMessage(z(w),c.protocol+"//"+c.host)};B&&O||(B=function(w){m(arguments.length,1);var x=o(w)?w:P(w),_=u(arguments,1);return S[++N]=function(){n(x,void 0,_)},i(N),N},O=function(w){delete S[w]},k?i=function(w){L.nextTick(E(w))}:R&&R.now?i=function(w){R.now(E(w))}:j&&!v?(r=(a=new j).port2,a.port1.onmessage=h,i=l(r.postMessage,r)):t.addEventListener&&o(t.postMessage)&&!t.importScripts&&c&&c.protocol!=="file:"&&!f(y)?(i=y,t.addEventListener("message",h,!1)):i="onreadystatechange"in g("script")?function(w){d.appendChild(g("script")).onreadystatechange=function(){d.removeChild(this),C(w)}}:function(w){setTimeout(E(w),0)}),p.exports={set:B,clear:O}},{"../internals/array-slice":231,"../internals/document-create-element":249,"../internals/engine-is-ios":253,"../internals/engine-is-node":254,"../internals/fails":260,"../internals/function-apply":261,"../internals/function-bind-context":262,"../internals/global":274,"../internals/has-own-property":275,"../internals/html":278,"../internals/is-callable":285,"../internals/validate-arguments-length":353}],340:[function(e,p,b){"use strict";var c=e("../internals/to-integer-or-infinity"),i=Math.max,a=Math.min;p.exports=function(r,t){var n=c(r);return n<0?i(n+t,0):a(n,t)}},{"../internals/to-integer-or-infinity":342}],341:[function(e,p,b){"use strict";var c=e("../internals/indexed-object"),i=e("../internals/require-object-coercible");p.exports=function(a){return c(i(a))}},{"../internals/indexed-object":280,"../internals/require-object-coercible":329}],342:[function(e,p,b){"use strict";var c=e("../internals/math-trunc");p.exports=function(i){var a=+i;return a!=a||a===0?0:c(a)}},{"../internals/math-trunc":301}],343:[function(e,p,b){"use strict";var c=e("../internals/to-integer-or-infinity"),i=Math.min;p.exports=function(a){return a>0?i(c(a),9007199254740991):0}},{"../internals/to-integer-or-infinity":342}],344:[function(e,p,b){"use strict";var c=e("../internals/require-object-coercible"),i=Object;p.exports=function(a){return i(c(a))}},{"../internals/require-object-coercible":329}],345:[function(e,p,b){"use strict";var c=e("../internals/function-call"),i=e("../internals/is-object"),a=e("../internals/is-symbol"),r=e("../internals/get-method"),t=e("../internals/ordinary-to-primitive"),n=e("../internals/well-known-symbol"),l=TypeError,o=n("toPrimitive");p.exports=function(s,f){if(!i(s)||a(s))return s;var d,u=r(s,o);if(u){if(f===void 0&&(f="default"),d=c(u,s,f),!i(d)||a(d))return d;throw new l("Can't convert object to primitive value")}return f===void 0&&(f="number"),t(s,f)}},{"../internals/function-call":264,"../internals/get-method":273,"../internals/is-object":289,"../internals/is-symbol":292,"../internals/ordinary-to-primitive":320,"../internals/well-known-symbol":357}],346:[function(e,p,b){"use strict";var c=e("../internals/to-primitive"),i=e("../internals/is-symbol");p.exports=function(a){var r=c(a,"string");return i(r)?r:r+""}},{"../internals/is-symbol":292,"../internals/to-primitive":345}],347:[function(e,p,b){"use strict";var c={};c[e("../internals/well-known-symbol")("toStringTag")]="z",p.exports=String(c)==="[object z]"},{"../internals/well-known-symbol":357}],348:[function(e,p,b){"use strict";var c=e("../internals/classof"),i=String;p.exports=function(a){if(c(a)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return i(a)}},{"../internals/classof":236}],349:[function(e,p,b){"use strict";var c=String;p.exports=function(i){try{return c(i)}catch{return"Object"}}},{}],350:[function(e,p,b){"use strict";var c=e("../internals/function-uncurry-this"),i=0,a=Math.random(),r=c(1 .toString);p.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+r(++i+a,36)}},{"../internals/function-uncurry-this":268}],351:[function(e,p,b){"use strict";var c=e("../internals/symbol-constructor-detection");p.exports=c&&!Symbol.sham&&typeof Symbol.iterator=="symbol"},{"../internals/symbol-constructor-detection":336}],352:[function(e,p,b){"use strict";var c=e("../internals/descriptors"),i=e("../internals/fails");p.exports=c&&i((function(){return Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype!==42}))},{"../internals/descriptors":247,"../internals/fails":260}],353:[function(e,p,b){"use strict";var c=TypeError;p.exports=function(i,a){if(i<a)throw new c("Not enough arguments");return i}},{}],354:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/is-callable"),a=c.WeakMap;p.exports=i(a)&&/native code/.test(String(a))},{"../internals/global":274,"../internals/is-callable":285}],355:[function(e,p,b){"use strict";var c=e("../internals/path"),i=e("../internals/has-own-property"),a=e("../internals/well-known-symbol-wrapped"),r=e("../internals/object-define-property").f;p.exports=function(t){var n=c.Symbol||(c.Symbol={});i(n,t)||r(n,t,{value:a.f(t)})}},{"../internals/has-own-property":275,"../internals/object-define-property":308,"../internals/path":322,"../internals/well-known-symbol-wrapped":356}],356:[function(e,p,b){"use strict";var c=e("../internals/well-known-symbol");b.f=c},{"../internals/well-known-symbol":357}],357:[function(e,p,b){"use strict";var c=e("../internals/global"),i=e("../internals/shared"),a=e("../internals/has-own-property"),r=e("../internals/uid"),t=e("../internals/symbol-constructor-detection"),n=e("../internals/use-symbol-as-uid"),l=c.Symbol,o=i("wks"),s=n?l.for||l:l&&l.withoutSetter||r;p.exports=function(f){return a(o,f)||(o[f]=t&&a(l,f)?l[f]:s("Symbol."+f)),o[f]}},{"../internals/global":274,"../internals/has-own-property":275,"../internals/shared":334,"../internals/symbol-constructor-detection":336,"../internals/uid":350,"../internals/use-symbol-as-uid":351}],358:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/array-iteration").findIndex,a=e("../internals/add-to-unscopables"),r=!0;"findIndex"in[]&&Array(1).findIndex((function(){r=!1})),c({target:"Array",proto:!0,forced:r},{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),a("findIndex")},{"../internals/add-to-unscopables":225,"../internals/array-iteration":229,"../internals/export":259}],359:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/array-iteration").find,a=e("../internals/add-to-unscopables"),r=!0;"find"in[]&&Array(1).find((function(){r=!1})),c({target:"Array",proto:!0,forced:r},{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),a("find")},{"../internals/add-to-unscopables":225,"../internals/array-iteration":229,"../internals/export":259}],360:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/array-includes").includes,a=e("../internals/fails"),r=e("../internals/add-to-unscopables");c({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),r("includes")},{"../internals/add-to-unscopables":225,"../internals/array-includes":228,"../internals/export":259,"../internals/fails":260}],361:[function(e,p,b){"use strict";var c=e("../internals/to-indexed-object"),i=e("../internals/add-to-unscopables"),a=e("../internals/iterators"),r=e("../internals/internal-state"),t=e("../internals/object-define-property").f,n=e("../internals/iterator-define"),l=e("../internals/create-iter-result-object"),o=e("../internals/is-pure"),s=e("../internals/descriptors"),f=r.set,d=r.getterFor("Array Iterator");p.exports=n(Array,"Array",(function(g,m){f(this,{type:"Array Iterator",target:c(g),index:0,kind:m})}),(function(){var g=d(this),m=g.target,v=g.kind,k=g.index++;if(!m||k>=m.length)return g.target=void 0,l(void 0,!0);switch(v){case"keys":return l(k,!1);case"values":return l(m[k],!1)}return l([k,m[k]],!1)}),"values");var u=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!o&&s&&u.name!=="values")try{t(u,"name",{value:"values"})}catch{}},{"../internals/add-to-unscopables":225,"../internals/create-iter-result-object":240,"../internals/descriptors":247,"../internals/internal-state":282,"../internals/is-pure":290,"../internals/iterator-define":296,"../internals/iterators":298,"../internals/object-define-property":308,"../internals/to-indexed-object":341}],362:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/get-built-in"),a=e("../internals/function-apply"),r=e("../internals/function-call"),t=e("../internals/function-uncurry-this"),n=e("../internals/fails"),l=e("../internals/is-callable"),o=e("../internals/is-symbol"),s=e("../internals/array-slice"),f=e("../internals/get-json-replacer-function"),d=e("../internals/symbol-constructor-detection"),u=String,g=i("JSON","stringify"),m=t(/./.exec),v=t("".charAt),k=t("".charCodeAt),B=t("".replace),O=t(1 .toString),L=/[\uD800-\uDFFF]/g,R=/^[\uD800-\uDBFF]$/,P=/^[\uDC00-\uDFFF]$/,j=!d||n((function(){var C=i("Symbol")("stringify detection");return g([C])!=="[null]"||g({a:C})!=="{}"||g(Object(C))!=="{}"})),z=n((function(){return g("\uDF06\uD834")!=='"\\udf06\\ud834"'||g("\uDEAD")!=='"\\udead"'})),N=function(C,E){var h=s(arguments),y=f(E);if(l(y)||C!==void 0&&!o(C))return h[1]=function(w,x){if(l(y)&&(x=r(y,this,u(w),x)),!o(x))return x},a(g,null,h)},S=function(C,E,h){var y=v(h,E-1),w=v(h,E+1);return m(R,C)&&!m(P,w)||m(P,C)&&!m(R,y)?"\\u"+O(k(C,0),16):C};g&&c({target:"JSON",stat:!0,arity:3,forced:j||z},{stringify:function(C,E,h){var y=s(arguments),w=a(j?N:g,null,y);return z&&typeof w=="string"?B(w,L,S):w}})},{"../internals/array-slice":231,"../internals/export":259,"../internals/fails":260,"../internals/function-apply":261,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/get-built-in":269,"../internals/get-json-replacer-function":272,"../internals/is-callable":285,"../internals/is-symbol":292,"../internals/symbol-constructor-detection":336}],363:[function(e,p,b){"use strict";e("../internals/export")({target:"Number",stat:!0},{isNaN:function(c){return c!=c}})},{"../internals/export":259}],364:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/object-assign");c({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},{"../internals/export":259,"../internals/object-assign":305}],365:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/symbol-constructor-detection"),a=e("../internals/fails"),r=e("../internals/object-get-own-property-symbols"),t=e("../internals/to-object");c({target:"Object",stat:!0,forced:!i||a((function(){r.f(1)}))},{getOwnPropertySymbols:function(n){var l=r.f;return l?l(t(n)):[]}})},{"../internals/export":259,"../internals/fails":260,"../internals/object-get-own-property-symbols":312,"../internals/symbol-constructor-detection":336,"../internals/to-object":344}],366:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/to-object"),a=e("../internals/object-keys");c({target:"Object",stat:!0,forced:e("../internals/fails")((function(){a(1)}))},{keys:function(r){return a(i(r))}})},{"../internals/export":259,"../internals/fails":260,"../internals/object-keys":316,"../internals/to-object":344}],367:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/object-to-array").values;c({target:"Object",stat:!0},{values:function(a){return i(a)}})},{"../internals/export":259,"../internals/object-to-array":319}],368:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/function-call"),a=e("../internals/a-callable"),r=e("../internals/new-promise-capability"),t=e("../internals/perform"),n=e("../internals/iterate");c({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{all:function(l){var o=this,s=r.f(o),f=s.resolve,d=s.reject,u=t((function(){var g=a(o.resolve),m=[],v=0,k=1;n(l,(function(B){var O=v++,L=!1;k++,i(g,o,B).then((function(R){L||(L=!0,m[O]=R,--k||f(m))}),d)})),--k||f(m)}));return u.error&&d(u.value),s.promise}})},{"../internals/a-callable":222,"../internals/export":259,"../internals/function-call":264,"../internals/iterate":293,"../internals/new-promise-capability":303,"../internals/perform":323,"../internals/promise-statics-incorrect-iteration":327}],369:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/is-pure"),a=e("../internals/promise-constructor-detection").CONSTRUCTOR,r=e("../internals/promise-native-constructor"),t=e("../internals/get-built-in"),n=e("../internals/is-callable"),l=e("../internals/define-built-in"),o=r&&r.prototype;if(c({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(f){return this.then(void 0,f)}}),!i&&n(r)){var s=t("Promise").prototype.catch;o.catch!==s&&l(o,"catch",s,{unsafe:!0})}},{"../internals/define-built-in":245,"../internals/export":259,"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325}],370:[function(e,p,b){"use strict";var c,i,a,r=e("../internals/export"),t=e("../internals/is-pure"),n=e("../internals/engine-is-node"),l=e("../internals/global"),o=e("../internals/function-call"),s=e("../internals/define-built-in"),f=e("../internals/object-set-prototype-of"),d=e("../internals/set-to-string-tag"),u=e("../internals/set-species"),g=e("../internals/a-callable"),m=e("../internals/is-callable"),v=e("../internals/is-object"),k=e("../internals/an-instance"),B=e("../internals/species-constructor"),O=e("../internals/task").set,L=e("../internals/microtask"),R=e("../internals/host-report-errors"),P=e("../internals/perform"),j=e("../internals/queue"),z=e("../internals/internal-state"),N=e("../internals/promise-native-constructor"),S=e("../internals/promise-constructor-detection"),C=e("../internals/new-promise-capability"),E=S.CONSTRUCTOR,h=S.REJECTION_EVENT,y=S.SUBCLASSING,w=z.getterFor("Promise"),x=z.set,_=N&&N.prototype,T=N,D=_,q=l.TypeError,$=l.document,W=l.process,A=C.f,H=A,M=!!($&&$.createEvent&&l.dispatchEvent),I=function(J){var ne;return!(!v(J)||!m(ne=J.then))&&ne},F=function(J,ne){var ie,le,re,se=ne.value,be=ne.state===1,ye=be?J.ok:J.fail,Fe=J.resolve,Ce=J.reject,ae=J.domain;try{ye?(be||(ne.rejection===2&&ee(ne),ne.rejection=1),ye===!0?ie=se:(ae&&ae.enter(),ie=ye(se),ae&&(ae.exit(),re=!0)),ie===J.promise?Ce(new q("Promise-chain cycle")):(le=I(ie))?o(le,ie,Fe,Ce):Fe(ie)):Ce(se)}catch(De){ae&&!re&&ae.exit(),Ce(De)}},U=function(J,ne){J.notified||(J.notified=!0,L((function(){for(var ie,le=J.reactions;ie=le.get();)F(ie,J);J.notified=!1,ne&&!J.rejection&&V(J)})))},X=function(J,ne,ie){var le,re;M?((le=$.createEvent("Event")).promise=ne,le.reason=ie,le.initEvent(J,!1,!0),l.dispatchEvent(le)):le={promise:ne,reason:ie},!h&&(re=l["on"+J])?re(le):J==="unhandledrejection"&&R("Unhandled promise rejection",ie)},V=function(J){o(O,l,(function(){var ne,ie=J.facade,le=J.value;if(G(J)&&(ne=P((function(){n?W.emit("unhandledRejection",le,ie):X("unhandledrejection",ie,le)})),J.rejection=n||G(J)?2:1,ne.error))throw ne.value}))},G=function(J){return J.rejection!==1&&!J.parent},ee=function(J){o(O,l,(function(){var ne=J.facade;n?W.emit("rejectionHandled",ne):X("rejectionhandled",ne,J.value)}))},Z=function(J,ne,ie){return function(le){J(ne,le,ie)}},K=function(J,ne,ie){J.done||(J.done=!0,ie&&(J=ie),J.value=ne,J.state=2,U(J,!0))},Q=function(J,ne,ie){if(!J.done){J.done=!0,ie&&(J=ie);try{if(J.facade===ne)throw new q("Promise can't be resolved itself");var le=I(ne);le?L((function(){var re={done:!1};try{o(le,ne,Z(Q,re,J),Z(K,re,J))}catch(se){K(re,se,J)}})):(J.value=ne,J.state=1,U(J,!1))}catch(re){K({done:!1},re,J)}}};if(E&&(D=(T=function(J){k(this,D),g(J),o(c,this);var ne=w(this);try{J(Z(Q,ne),Z(K,ne))}catch(ie){K(ne,ie)}}).prototype,(c=function(J){x(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new j,rejection:!1,state:0,value:void 0})}).prototype=s(D,"then",(function(J,ne){var ie=w(this),le=A(B(this,T));return ie.parent=!0,le.ok=!m(J)||J,le.fail=m(ne)&&ne,le.domain=n?W.domain:void 0,ie.state===0?ie.reactions.add(le):L((function(){F(le,ie)})),le.promise})),i=function(){var J=new c,ne=w(J);this.promise=J,this.resolve=Z(Q,ne),this.reject=Z(K,ne)},C.f=A=function(J){return J===T||J===void 0?new i(J):H(J)},!t&&m(N)&&_!==Object.prototype)){a=_.then,y||s(_,"then",(function(J,ne){var ie=this;return new T((function(le,re){o(a,ie,le,re)})).then(J,ne)}),{unsafe:!0});try{delete _.constructor}catch{}f&&f(_,D)}r({global:!0,constructor:!0,wrap:!0,forced:E},{Promise:T}),d(T,"Promise",!1,!0),u("Promise")},{"../internals/a-callable":222,"../internals/an-instance":226,"../internals/define-built-in":245,"../internals/engine-is-node":254,"../internals/export":259,"../internals/function-call":264,"../internals/global":274,"../internals/host-report-errors":277,"../internals/internal-state":282,"../internals/is-callable":285,"../internals/is-object":289,"../internals/is-pure":290,"../internals/microtask":302,"../internals/new-promise-capability":303,"../internals/object-set-prototype-of":318,"../internals/perform":323,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325,"../internals/queue":328,"../internals/set-species":330,"../internals/set-to-string-tag":331,"../internals/species-constructor":335,"../internals/task":339}],371:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/is-pure"),a=e("../internals/promise-native-constructor"),r=e("../internals/fails"),t=e("../internals/get-built-in"),n=e("../internals/is-callable"),l=e("../internals/species-constructor"),o=e("../internals/promise-resolve"),s=e("../internals/define-built-in"),f=a&&a.prototype;if(c({target:"Promise",proto:!0,real:!0,forced:!!a&&r((function(){f.finally.call({then:function(){}},(function(){}))}))},{finally:function(u){var g=l(this,t("Promise")),m=n(u);return this.then(m?function(v){return o(g,u()).then((function(){return v}))}:u,m?function(v){return o(g,u()).then((function(){throw v}))}:u)}}),!i&&n(a)){var d=t("Promise").prototype.finally;f.finally!==d&&s(f,"finally",d,{unsafe:!0})}},{"../internals/define-built-in":245,"../internals/export":259,"../internals/fails":260,"../internals/get-built-in":269,"../internals/is-callable":285,"../internals/is-pure":290,"../internals/promise-native-constructor":325,"../internals/promise-resolve":326,"../internals/species-constructor":335}],372:[function(e,p,b){"use strict";e("../modules/es.promise.constructor"),e("../modules/es.promise.all"),e("../modules/es.promise.catch"),e("../modules/es.promise.race"),e("../modules/es.promise.reject"),e("../modules/es.promise.resolve")},{"../modules/es.promise.all":368,"../modules/es.promise.catch":369,"../modules/es.promise.constructor":370,"../modules/es.promise.race":373,"../modules/es.promise.reject":374,"../modules/es.promise.resolve":375}],373:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/function-call"),a=e("../internals/a-callable"),r=e("../internals/new-promise-capability"),t=e("../internals/perform"),n=e("../internals/iterate");c({target:"Promise",stat:!0,forced:e("../internals/promise-statics-incorrect-iteration")},{race:function(l){var o=this,s=r.f(o),f=s.reject,d=t((function(){var u=a(o.resolve);n(l,(function(g){i(u,o,g).then(s.resolve,f)}))}));return d.error&&f(d.value),s.promise}})},{"../internals/a-callable":222,"../internals/export":259,"../internals/function-call":264,"../internals/iterate":293,"../internals/new-promise-capability":303,"../internals/perform":323,"../internals/promise-statics-incorrect-iteration":327}],374:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/function-call"),a=e("../internals/new-promise-capability");c({target:"Promise",stat:!0,forced:e("../internals/promise-constructor-detection").CONSTRUCTOR},{reject:function(r){var t=a.f(this);return i(t.reject,void 0,r),t.promise}})},{"../internals/export":259,"../internals/function-call":264,"../internals/new-promise-capability":303,"../internals/promise-constructor-detection":324}],375:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/get-built-in"),a=e("../internals/is-pure"),r=e("../internals/promise-native-constructor"),t=e("../internals/promise-constructor-detection").CONSTRUCTOR,n=e("../internals/promise-resolve"),l=i("Promise"),o=a&&!t;c({target:"Promise",stat:!0,forced:a||t},{resolve:function(s){return n(o&&this===l?r:this,s)}})},{"../internals/export":259,"../internals/get-built-in":269,"../internals/is-pure":290,"../internals/promise-constructor-detection":324,"../internals/promise-native-constructor":325,"../internals/promise-resolve":326}],376:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/function-uncurry-this"),a=e("../internals/to-absolute-index"),r=RangeError,t=String.fromCharCode,n=String.fromCodePoint,l=i([].join);c({target:"String",stat:!0,arity:1,forced:!!n&&n.length!==1},{fromCodePoint:function(o){for(var s,f=[],d=arguments.length,u=0;d>u;){if(s=+arguments[u++],a(s,1114111)!==s)throw new r(s+" is not a valid code point");f[u]=s<65536?t(s):t(55296+((s-=65536)>>10),s%1024+56320)}return l(f,"")}})},{"../internals/export":259,"../internals/function-uncurry-this":268,"../internals/to-absolute-index":340}],377:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/function-uncurry-this"),a=e("../internals/not-a-regexp"),r=e("../internals/require-object-coercible"),t=e("../internals/to-string"),n=e("../internals/correct-is-regexp-logic"),l=i("".indexOf);c({target:"String",proto:!0,forced:!n("includes")},{includes:function(o){return!!~l(t(r(this)),t(a(o)),arguments.length>1?arguments[1]:void 0)}})},{"../internals/correct-is-regexp-logic":238,"../internals/export":259,"../internals/function-uncurry-this":268,"../internals/not-a-regexp":304,"../internals/require-object-coercible":329,"../internals/to-string":348}],378:[function(e,p,b){"use strict";e("../internals/well-known-symbol-define")("asyncIterator")},{"../internals/well-known-symbol-define":355}],379:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/global"),a=e("../internals/function-call"),r=e("../internals/function-uncurry-this"),t=e("../internals/is-pure"),n=e("../internals/descriptors"),l=e("../internals/symbol-constructor-detection"),o=e("../internals/fails"),s=e("../internals/has-own-property"),f=e("../internals/object-is-prototype-of"),d=e("../internals/an-object"),u=e("../internals/to-indexed-object"),g=e("../internals/to-property-key"),m=e("../internals/to-string"),v=e("../internals/create-property-descriptor"),k=e("../internals/object-create"),B=e("../internals/object-keys"),O=e("../internals/object-get-own-property-names"),L=e("../internals/object-get-own-property-names-external"),R=e("../internals/object-get-own-property-symbols"),P=e("../internals/object-get-own-property-descriptor"),j=e("../internals/object-define-property"),z=e("../internals/object-define-properties"),N=e("../internals/object-property-is-enumerable"),S=e("../internals/define-built-in"),C=e("../internals/define-built-in-accessor"),E=e("../internals/shared"),h=e("../internals/shared-key"),y=e("../internals/hidden-keys"),w=e("../internals/uid"),x=e("../internals/well-known-symbol"),_=e("../internals/well-known-symbol-wrapped"),T=e("../internals/well-known-symbol-define"),D=e("../internals/symbol-define-to-primitive"),q=e("../internals/set-to-string-tag"),$=e("../internals/internal-state"),W=e("../internals/array-iteration").forEach,A=h("hidden"),H=$.set,M=$.getterFor("Symbol"),I=Object.prototype,F=i.Symbol,U=F&&F.prototype,X=i.RangeError,V=i.TypeError,G=i.QObject,ee=P.f,Z=j.f,K=L.f,Q=N.f,J=r([].push),ne=E("symbols"),ie=E("op-symbols"),le=E("wks"),re=!G||!G.prototype||!G.prototype.findChild,se=function(Re,we,ve){var Ze=ee(I,we);Ze&&delete I[we],Z(Re,we,ve),Ze&&Re!==I&&Z(I,we,Ze)},be=n&&o((function(){return k(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a!==7}))?se:Z,ye=function(Re,we){var ve=ne[Re]=k(U);return H(ve,{type:"Symbol",tag:Re,description:we}),n||(ve.description=we),ve},Fe=function(Re,we,ve){Re===I&&Fe(ie,we,ve),d(Re);var Ze=g(we);return d(ve),s(ne,Ze)?(ve.enumerable?(s(Re,A)&&Re[A][Ze]&&(Re[A][Ze]=!1),ve=k(ve,{enumerable:v(0,!1)})):(s(Re,A)||Z(Re,A,v(1,{})),Re[A][Ze]=!0),be(Re,Ze,ve)):Z(Re,Ze,ve)},Ce=function(Re,we){d(Re);var ve=u(we),Ze=B(ve).concat(ke(ve));return W(Ze,(function(Se){n&&!a(ae,ve,Se)||Fe(Re,Se,ve[Se])})),Re},ae=function(Re){var we=g(Re),ve=a(Q,this,we);return!(this===I&&s(ne,we)&&!s(ie,we))&&(!(ve||!s(this,we)||!s(ne,we)||s(this,A)&&this[A][we])||ve)},De=function(Re,we){var ve=u(Re),Ze=g(we);if(ve!==I||!s(ne,Ze)||s(ie,Ze)){var Se=ee(ve,Ze);return!Se||!s(ne,Ze)||s(ve,A)&&ve[A][Ze]||(Se.enumerable=!0),Se}},Be=function(Re){var we=K(u(Re)),ve=[];return W(we,(function(Ze){s(ne,Ze)||s(y,Ze)||J(ve,Ze)})),ve},ke=function(Re){var we=Re===I,ve=K(we?ie:u(Re)),Ze=[];return W(ve,(function(Se){!s(ne,Se)||we&&!s(I,Se)||J(Ze,ne[Se])})),Ze};l||(S(U=(F=function(){if(f(U,this))throw new V("Symbol is not a constructor");var Re=arguments.length&&arguments[0]!==void 0?m(arguments[0]):void 0,we=w(Re),ve=function(Ze){this===I&&a(ve,ie,Ze),s(this,A)&&s(this[A],we)&&(this[A][we]=!1);var Se=v(1,Ze);try{be(this,we,Se)}catch(de){if(!(de instanceof X))throw de;se(this,we,Se)}};return n&&re&&be(I,we,{configurable:!0,set:ve}),ye(we,Re)}).prototype,"toString",(function(){return M(this).tag})),S(F,"withoutSetter",(function(Re){return ye(w(Re),Re)})),N.f=ae,j.f=Fe,z.f=Ce,P.f=De,O.f=L.f=Be,R.f=ke,_.f=function(Re){return ye(x(Re),Re)},n&&(C(U,"description",{configurable:!0,get:function(){return M(this).description}}),t||S(I,"propertyIsEnumerable",ae,{unsafe:!0}))),c({global:!0,constructor:!0,wrap:!0,forced:!l,sham:!l},{Symbol:F}),W(B(le),(function(Re){T(Re)})),c({target:"Symbol",stat:!0,forced:!l},{useSetter:function(){re=!0},useSimple:function(){re=!1}}),c({target:"Object",stat:!0,forced:!l,sham:!n},{create:function(Re,we){return we===void 0?k(Re):Ce(k(Re),we)},defineProperty:Fe,defineProperties:Ce,getOwnPropertyDescriptor:De}),c({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:Be}),D(),q(F,"Symbol"),y[A]=!0},{"../internals/an-object":227,"../internals/array-iteration":229,"../internals/create-property-descriptor":242,"../internals/define-built-in":245,"../internals/define-built-in-accessor":244,"../internals/descriptors":247,"../internals/export":259,"../internals/fails":260,"../internals/function-call":264,"../internals/function-uncurry-this":268,"../internals/global":274,"../internals/has-own-property":275,"../internals/hidden-keys":276,"../internals/internal-state":282,"../internals/is-pure":290,"../internals/object-create":306,"../internals/object-define-properties":307,"../internals/object-define-property":308,"../internals/object-get-own-property-descriptor":309,"../internals/object-get-own-property-names":311,"../internals/object-get-own-property-names-external":310,"../internals/object-get-own-property-symbols":312,"../internals/object-is-prototype-of":314,"../internals/object-keys":316,"../internals/object-property-is-enumerable":317,"../internals/set-to-string-tag":331,"../internals/shared":334,"../internals/shared-key":332,"../internals/symbol-constructor-detection":336,"../internals/symbol-define-to-primitive":337,"../internals/to-indexed-object":341,"../internals/to-property-key":346,"../internals/to-string":348,"../internals/uid":350,"../internals/well-known-symbol":357,"../internals/well-known-symbol-define":355,"../internals/well-known-symbol-wrapped":356}],380:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/get-built-in"),a=e("../internals/has-own-property"),r=e("../internals/to-string"),t=e("../internals/shared"),n=e("../internals/symbol-registry-detection"),l=t("string-to-symbol-registry"),o=t("symbol-to-string-registry");c({target:"Symbol",stat:!0,forced:!n},{for:function(s){var f=r(s);if(a(l,f))return l[f];var d=i("Symbol")(f);return l[f]=d,o[d]=f,d}})},{"../internals/export":259,"../internals/get-built-in":269,"../internals/has-own-property":275,"../internals/shared":334,"../internals/symbol-registry-detection":338,"../internals/to-string":348}],381:[function(e,p,b){"use strict";e("../modules/es.symbol.constructor"),e("../modules/es.symbol.for"),e("../modules/es.symbol.key-for"),e("../modules/es.json.stringify"),e("../modules/es.object.get-own-property-symbols")},{"../modules/es.json.stringify":362,"../modules/es.object.get-own-property-symbols":365,"../modules/es.symbol.constructor":379,"../modules/es.symbol.for":380,"../modules/es.symbol.key-for":382}],382:[function(e,p,b){"use strict";var c=e("../internals/export"),i=e("../internals/has-own-property"),a=e("../internals/is-symbol"),r=e("../internals/try-to-string"),t=e("../internals/shared"),n=e("../internals/symbol-registry-detection"),l=t("symbol-to-string-registry");c({target:"Symbol",stat:!0,forced:!n},{keyFor:function(o){if(!a(o))throw new TypeError(r(o)+" is not a symbol");if(i(l,o))return l[o]}})},{"../internals/export":259,"../internals/has-own-property":275,"../internals/is-symbol":292,"../internals/shared":334,"../internals/symbol-registry-detection":338,"../internals/try-to-string":349}],383:[function(e,p,b){"use strict";function c(i){return Object.prototype.toString.call(i)}b.isArray=function(i){return Array.isArray?Array.isArray(i):c(i)==="[object Array]"},b.isBoolean=function(i){return typeof i=="boolean"},b.isNull=function(i){return i===null},b.isNullOrUndefined=function(i){return i==null},b.isNumber=function(i){return typeof i=="number"},b.isString=function(i){return typeof i=="string"},b.isSymbol=function(i){return typeof i=="symbol"},b.isUndefined=function(i){return i===void 0},b.isRegExp=function(i){return c(i)==="[object RegExp]"},b.isObject=function(i){return typeof i=="object"&&i!==null},b.isDate=function(i){return c(i)==="[object Date]"},b.isError=function(i){return c(i)==="[object Error]"||i instanceof Error},b.isFunction=function(i){return typeof i=="function"},b.isPrimitive=function(i){return i===null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||typeof i=="symbol"||i===void 0},b.isBuffer=e("buffer").Buffer.isBuffer},{buffer:220}],384:[function(e,p,b){(function(c){(function(){"use strict";var i=e("elliptic"),a=e("bn.js");p.exports=function(l){return new t(l)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function t(l){this.curveType=r[l],this.curveType||(this.curveType={name:l}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function n(l,o,s){Array.isArray(l)||(l=l.toArray());var f=new c(l);if(s&&f.length<s){var d=new c(s-f.length);d.fill(0),f=c.concat([d,f])}return o?f.toString(o):f}r.p224=r.secp224r1,r.p256=r.secp256r1=r.prime256v1,r.p192=r.secp192r1=r.prime192v1,r.p384=r.secp384r1,r.p521=r.secp521r1,t.prototype.generateKeys=function(l,o){return this.keys=this.curve.genKeyPair(),this.getPublicKey(l,o)},t.prototype.computeSecret=function(l,o,s){return o=o||"utf8",c.isBuffer(l)||(l=new c(l,o)),n(this.curve.keyFromPublic(l).getPublic().mul(this.keys.getPrivate()).getX(),s,this.curveType.byteLength)},t.prototype.getPublicKey=function(l,o){var s=this.keys.getPublic(o==="compressed",!0);return o==="hybrid"&&(s[s.length-1]%2?s[0]=7:s[0]=6),n(s,l)},t.prototype.getPrivateKey=function(l){return n(this.keys.getPrivate(),l)},t.prototype.setPublicKey=function(l,o){return o=o||"utf8",c.isBuffer(l)||(l=new c(l,o)),this.keys._importPublic(l),this},t.prototype.setPrivateKey=function(l,o){o=o||"utf8",c.isBuffer(l)||(l=new c(l,o));var s=new a(l);return s=s.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(s),this}}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":385,buffer:220,elliptic:405}],385:[function(e,p,b){arguments[4][184][0].apply(b,arguments)},{buffer:188,dup:184}],386:[function(e,p,b){"use strict";var c=e("inherits"),i=e("md5.js"),a=e("ripemd160"),r=e("sha.js"),t=e("cipher-base");function n(l){t.call(this,"digest"),this._hash=l}c(n,t),n.prototype._update=function(l){this._hash.update(l)},n.prototype._final=function(){return this._hash.digest()},p.exports=function(l){return(l=l.toLowerCase())==="md5"?new i:l==="rmd160"||l==="ripemd160"?new a:new n(r(l))}},{"cipher-base":221,inherits:440,"md5.js":450,ripemd160:493,"sha.js":498}],387:[function(e,p,b){"use strict";var c=e("md5.js");p.exports=function(i){return new c().update(i).digest()}},{"md5.js":450}],388:[function(e,p,b){"use strict";var c=e("inherits"),i=e("./legacy"),a=e("cipher-base"),r=e("safe-buffer").Buffer,t=e("create-hash/md5"),n=e("ripemd160"),l=e("sha.js"),o=r.alloc(128);function s(f,d){a.call(this,"digest"),typeof d=="string"&&(d=r.from(d));var u=f==="sha512"||f==="sha384"?128:64;this._alg=f,this._key=d,d.length>u?d=(f==="rmd160"?new n:l(f)).update(d).digest():d.length<u&&(d=r.concat([d,o],u));for(var g=this._ipad=r.allocUnsafe(u),m=this._opad=r.allocUnsafe(u),v=0;v<u;v++)g[v]=54^d[v],m[v]=92^d[v];this._hash=f==="rmd160"?new n:l(f),this._hash.update(g)}c(s,a),s.prototype._update=function(f){this._hash.update(f)},s.prototype._final=function(){var f=this._hash.digest();return(this._alg==="rmd160"?new n:l(this._alg)).update(this._opad).update(f).digest()},p.exports=function(f,d){return(f=f.toLowerCase())==="rmd160"||f==="ripemd160"?new s("rmd160",d):f==="md5"?new i(t,d):new s(f,d)}},{"./legacy":389,"cipher-base":221,"create-hash/md5":387,inherits:440,ripemd160:493,"safe-buffer":494,"sha.js":498}],389:[function(e,p,b){"use strict";var c=e("inherits"),i=e("safe-buffer").Buffer,a=e("cipher-base"),r=i.alloc(128);function t(n,l){a.call(this,"digest"),typeof l=="string"&&(l=i.from(l)),this._alg=n,this._key=l,l.length>64?l=n(l):l.length<64&&(l=i.concat([l,r],64));for(var o=this._ipad=i.allocUnsafe(64),s=this._opad=i.allocUnsafe(64),f=0;f<64;f++)o[f]=54^l[f],s[f]=92^l[f];this._hash=[o]}c(t,a),t.prototype._update=function(n){this._hash.push(n)},t.prototype._final=function(){var n=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,n]))},p.exports=t},{"cipher-base":221,inherits:440,"safe-buffer":494}],390:[function(e,p,b){"use strict";b.randomBytes=b.rng=b.pseudoRandomBytes=b.prng=e("randombytes"),b.createHash=b.Hash=e("create-hash"),b.createHmac=b.Hmac=e("create-hmac");var c=e("browserify-sign/algos"),i=Object.keys(c),a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);b.getHashes=function(){return a};var r=e("pbkdf2");b.pbkdf2=r.pbkdf2,b.pbkdf2Sync=r.pbkdf2Sync;var t=e("browserify-cipher");b.Cipher=t.Cipher,b.createCipher=t.createCipher,b.Cipheriv=t.Cipheriv,b.createCipheriv=t.createCipheriv,b.Decipher=t.Decipher,b.createDecipher=t.createDecipher,b.Decipheriv=t.Decipheriv,b.createDecipheriv=t.createDecipheriv,b.getCiphers=t.getCiphers,b.listCiphers=t.listCiphers;var n=e("diffie-hellman");b.DiffieHellmanGroup=n.DiffieHellmanGroup,b.createDiffieHellmanGroup=n.createDiffieHellmanGroup,b.getDiffieHellman=n.getDiffieHellman,b.createDiffieHellman=n.createDiffieHellman,b.DiffieHellman=n.DiffieHellman;var l=e("browserify-sign");b.createSign=l.createSign,b.Sign=l.Sign,b.createVerify=l.createVerify,b.Verify=l.Verify,b.createECDH=e("create-ecdh");var o=e("public-encrypt");b.publicEncrypt=o.publicEncrypt,b.privateEncrypt=o.privateEncrypt,b.publicDecrypt=o.publicDecrypt,b.privateDecrypt=o.privateDecrypt;var s=e("randomfill");b.randomFill=s.randomFill,b.randomFillSync=s.randomFillSync,b.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(`
9
+ `))},b.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":206,"browserify-sign":213,"browserify-sign/algos":210,"create-ecdh":384,"create-hash":386,"create-hmac":388,"diffie-hellman":400,pbkdf2:460,"public-encrypt":468,randombytes:475,randomfill:476}],391:[function(e,p,b){"use strict";(function(c,i){typeof b=="object"&&p!==void 0?p.exports=i():(c=typeof globalThis<"u"?globalThis:c||self).dayjs=i()})(void 0,(function(){var c=6e4,i=36e5,a="millisecond",r="second",t="minute",n="hour",l="day",o="week",s="month",f="quarter",d="year",u="date",g="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,k={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(h){var y=["th","st","nd","rd"],w=h%100;return"["+h+(y[(w-20)%10]||y[w]||y[0])+"]"}},B=function(h,y,w){var x=String(h);return!x||x.length>=y?h:""+Array(y+1-x.length).join(w)+h},O={s:B,z:function(h){var y=-h.utcOffset(),w=Math.abs(y),x=Math.floor(w/60),_=w%60;return(y<=0?"+":"-")+B(x,2,"0")+":"+B(_,2,"0")},m:function h(y,w){if(y.date()<w.date())return-h(w,y);var x=12*(w.year()-y.year())+(w.month()-y.month()),_=y.clone().add(x,s),T=w-_<0,D=y.clone().add(x+(T?-1:1),s);return+(-(x+(w-_)/(T?_-D:D-_))||0)},a:function(h){return h<0?Math.ceil(h)||0:Math.floor(h)},p:function(h){return{M:s,y:d,w:o,d:l,D:u,h:n,m:t,s:r,ms:a,Q:f}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(h){return h===void 0}},L="en",R={};R[L]=k;var P="$isDayjsObject",j=function(h){return h instanceof C||!(!h||!h[P])},z=function h(y,w,x){var _;if(!y)return L;if(typeof y=="string"){var T=y.toLowerCase();R[T]&&(_=T),w&&(R[T]=w,_=T);var D=y.split("-");if(!_&&D.length>1)return h(D[0])}else{var q=y.name;R[q]=y,_=q}return!x&&_&&(L=_),_||!x&&L},N=function(h,y){if(j(h))return h.clone();var w=typeof y=="object"?y:{};return w.date=h,w.args=arguments,new C(w)},S=O;S.l=z,S.i=j,S.w=function(h,y){return N(h,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var C=(function(){function h(w){this.$L=z(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[P]=!0}var y=h.prototype;return y.parse=function(w){this.$d=(function(x){var _=x.date,T=x.utc;if(_===null)return new Date(NaN);if(S.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var D=_.match(m);if(D){var q=D[2]-1||0,$=(D[7]||"0").substring(0,3);return T?new Date(Date.UTC(D[1],q,D[3]||1,D[4]||0,D[5]||0,D[6]||0,$)):new Date(D[1],q,D[3]||1,D[4]||0,D[5]||0,D[6]||0,$)}}return new Date(_)})(w),this.init()},y.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return this.$d.toString()!==g},y.isSame=function(w,x){var _=N(w);return this.startOf(x)<=_&&_<=this.endOf(x)},y.isAfter=function(w,x){return N(w)<this.startOf(x)},y.isBefore=function(w,x){return this.endOf(x)<N(w)},y.$g=function(w,x,_){return S.u(w)?this[x]:this.set(_,w)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(w,x){var _=this,T=!!S.u(x)||x,D=S.p(w),q=function(U,X){var V=S.w(_.$u?Date.UTC(_.$y,X,U):new Date(_.$y,X,U),_);return T?V:V.endOf(l)},$=function(U,X){return S.w(_.toDate()[U].apply(_.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(X)),_)},W=this.$W,A=this.$M,H=this.$D,M="set"+(this.$u?"UTC":"");switch(D){case d:return T?q(1,0):q(31,11);case s:return T?q(1,A):q(0,A+1);case o:var I=this.$locale().weekStart||0,F=(W<I?W+7:W)-I;return q(T?H-F:H+(6-F),A);case l:case u:return $(M+"Hours",0);case n:return $(M+"Minutes",1);case t:return $(M+"Seconds",2);case r:return $(M+"Milliseconds",3);default:return this.clone()}},y.endOf=function(w){return this.startOf(w,!1)},y.$set=function(w,x){var _,T=S.p(w),D="set"+(this.$u?"UTC":""),q=(_={},_[l]=D+"Date",_[u]=D+"Date",_[s]=D+"Month",_[d]=D+"FullYear",_[n]=D+"Hours",_[t]=D+"Minutes",_[r]=D+"Seconds",_[a]=D+"Milliseconds",_)[T],$=T===l?this.$D+(x-this.$W):x;if(T===s||T===d){var W=this.clone().set(u,1);W.$d[q]($),W.init(),this.$d=W.set(u,Math.min(this.$D,W.daysInMonth())).$d}else q&&this.$d[q]($);return this.init(),this},y.set=function(w,x){return this.clone().$set(w,x)},y.get=function(w){return this[S.p(w)]()},y.add=function(w,x){var _,T=this;w=Number(w);var D=S.p(x),q=function(A){var H=N(T);return S.w(H.date(H.date()+Math.round(A*w)),T)};if(D===s)return this.set(s,this.$M+w);if(D===d)return this.set(d,this.$y+w);if(D===l)return q(1);if(D===o)return q(7);var $=(_={},_[t]=c,_[n]=i,_[r]=1e3,_)[D]||1,W=this.$d.getTime()+w*$;return S.w(W,this)},y.subtract=function(w,x){return this.add(-1*w,x)},y.format=function(w){var x=this,_=this.$locale();if(!this.isValid())return _.invalidDate||g;var T=w||"YYYY-MM-DDTHH:mm:ssZ",D=S.z(this),q=this.$H,$=this.$m,W=this.$M,A=_.weekdays,H=_.months,M=_.meridiem,I=function(X,V,G,ee){return X&&(X[V]||X(x,T))||G[V].slice(0,ee)},F=function(X){return S.s(q%12||12,X,"0")},U=M||function(X,V,G){var ee=X<12?"AM":"PM";return G?ee.toLowerCase():ee};return T.replace(v,(function(X,V){return V||(function(G){switch(G){case"YY":return String(x.$y).slice(-2);case"YYYY":return S.s(x.$y,4,"0");case"M":return W+1;case"MM":return S.s(W+1,2,"0");case"MMM":return I(_.monthsShort,W,H,3);case"MMMM":return I(H,W);case"D":return x.$D;case"DD":return S.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return I(_.weekdaysMin,x.$W,A,2);case"ddd":return I(_.weekdaysShort,x.$W,A,3);case"dddd":return A[x.$W];case"H":return String(q);case"HH":return S.s(q,2,"0");case"h":return F(1);case"hh":return F(2);case"a":return U(q,$,!0);case"A":return U(q,$,!1);case"m":return String($);case"mm":return S.s($,2,"0");case"s":return String(x.$s);case"ss":return S.s(x.$s,2,"0");case"SSS":return S.s(x.$ms,3,"0");case"Z":return D}return null})(X)||D.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(w,x,_){var T,D=this,q=S.p(x),$=N(w),W=($.utcOffset()-this.utcOffset())*c,A=this-$,H=function(){return S.m(D,$)};switch(q){case d:T=H()/12;break;case s:T=H();break;case f:T=H()/3;break;case o:T=(A-W)/6048e5;break;case l:T=(A-W)/864e5;break;case n:T=A/i;break;case t:T=A/c;break;case r:T=A/1e3;break;default:T=A}return _?T:S.a(T)},y.daysInMonth=function(){return this.endOf(s).$D},y.$locale=function(){return R[this.$L]},y.locale=function(w,x){if(!w)return this.$L;var _=this.clone(),T=z(w,x,!0);return T&&(_.$L=T),_},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},h})(),E=C.prototype;return N.prototype=E,[["$ms",a],["$s",r],["$m",t],["$H",n],["$W",l],["$M",s],["$y",d],["$D",u]].forEach((function(h){E[h[1]]=function(y){return this.$g(y,h[0],h[1])}})),N.extend=function(h,y){return h.$i||(h(y,C,N),h.$i=!0),N},N.locale=z,N.isDayjs=j,N.unix=function(h){return N(1e3*h)},N.en=R[L],N.Ls=R,N.p={},N}))},{}],392:[function(e,p,b){"use strict";(function(c,i){typeof b=="object"&&p!==void 0?p.exports=i():(c=typeof globalThis<"u"?globalThis:c||self).dayjs_plugin_customParseFormat=i()})(void 0,(function(){var c={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d\d/,r=/\d\d?/,t=/\d*[^-_:/,()\s\d]+/,n={},l=function(m){return(m=+m)+(m>68?1900:2e3)},o=function(m){return function(v){this[m]=+v}},s=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var k=v.match(/([+-]|\d\d)/g),B=60*k[1]+(+k[2]||0);return B===0?0:k[0]==="+"?-B:B})(m)}],f=function(m){var v=n[m];return v&&(v.indexOf?v:v.s.concat(v.f))},d=function(m,v){var k,B=n.meridiem;if(B){for(var O=1;O<=24;O+=1)if(m.indexOf(B(O,0,v))>-1){k=O>12;break}}else k=m===(v?"pm":"PM");return k},u={A:[t,function(m){this.afternoon=d(m,!1)}],a:[t,function(m){this.afternoon=d(m,!0)}],S:[/\d/,function(m){this.milliseconds=100*+m}],SS:[a,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[r,o("seconds")],ss:[r,o("seconds")],m:[r,o("minutes")],mm:[r,o("minutes")],H:[r,o("hours")],h:[r,o("hours")],HH:[r,o("hours")],hh:[r,o("hours")],D:[r,o("day")],DD:[a,o("day")],Do:[t,function(m){var v=n.ordinal,k=m.match(/\d+/);if(this.day=k[0],v)for(var B=1;B<=31;B+=1)v(B).replace(/\[|\]/g,"")===m&&(this.day=B)}],M:[r,o("month")],MM:[a,o("month")],MMM:[t,function(m){var v=f("months"),k=(f("monthsShort")||v.map((function(B){return B.slice(0,3)}))).indexOf(m)+1;if(k<1)throw new Error;this.month=k%12||k}],MMMM:[t,function(m){var v=f("months").indexOf(m)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,o("year")],YY:[a,function(m){this.year=l(m)}],YYYY:[/\d{4}/,o("year")],Z:s,ZZ:s};function g(m){var v,k;v=m,k=n&&n.formats;for(var B=(m=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(N,S,C){var E=C&&C.toUpperCase();return S||k[C]||c[C]||k[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(h,y,w){return y||w.slice(1)}))}))).match(i),O=B.length,L=0;L<O;L+=1){var R=B[L],P=u[R],j=P&&P[0],z=P&&P[1];B[L]=z?{regex:j,parser:z}:R.replace(/^\[|\]$/g,"")}return function(N){for(var S={},C=0,E=0;C<O;C+=1){var h=B[C];if(typeof h=="string")E+=h.length;else{var y=h.regex,w=h.parser,x=N.slice(E),_=y.exec(x)[0];w.call(S,_),N=N.replace(_,"")}}return(function(T){var D=T.afternoon;if(D!==void 0){var q=T.hours;D?q<12&&(T.hours+=12):q===12&&(T.hours=0),delete T.afternoon}})(S),S}}return function(m,v,k){k.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(l=m.parseTwoDigitYear);var B=v.prototype,O=B.parse;B.parse=function(L){var R=L.date,P=L.utc,j=L.args;this.$u=P;var z=j[1];if(typeof z=="string"){var N=j[2]===!0,S=j[3]===!0,C=N||S,E=j[2];S&&(E=j[2]),n=this.$locale(),!N&&E&&(n=k.Ls[E]),this.$d=(function(x,_,T){try{if(["x","X"].indexOf(_)>-1)return new Date((_==="X"?1e3:1)*x);var D=g(_)(x),q=D.year,$=D.month,W=D.day,A=D.hours,H=D.minutes,M=D.seconds,I=D.milliseconds,F=D.zone,U=new Date,X=W||(q||$?1:U.getDate()),V=q||U.getFullYear(),G=0;q&&!$||(G=$>0?$-1:U.getMonth());var ee=A||0,Z=H||0,K=M||0,Q=I||0;return F?new Date(Date.UTC(V,G,X,ee,Z,K,Q+60*F.offset*1e3)):T?new Date(Date.UTC(V,G,X,ee,Z,K,Q)):new Date(V,G,X,ee,Z,K,Q)}catch{return new Date("")}})(R,z,P),this.init(),E&&E!==!0&&(this.$L=this.locale(E).$L),C&&R!=this.format(z)&&(this.$d=new Date("")),n={}}else if(z instanceof Array)for(var h=z.length,y=1;y<=h;y+=1){j[1]=z[y-1];var w=k.apply(this,j);if(w.isValid()){this.$d=w.$d,this.$L=w.$L,this.init();break}y===h&&(this.$d=new Date(""))}else O.call(this,L)}}}))},{}],393:[function(e,p,b){"use strict";(function(c,i){typeof b=="object"&&p!==void 0?p.exports=i():(c=typeof globalThis<"u"?globalThis:c||self).dayjs_plugin_utc=i()})(void 0,(function(){var c="minute",i=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(r,t,n){var l=t.prototype;n.utc=function(m){var v={date:m,utc:!0,args:arguments};return new t(v)},l.utc=function(m){var v=n(this.toDate(),{locale:this.$L,utc:!0});return m?v.add(this.utcOffset(),c):v},l.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1})};var o=l.parse;l.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),o.call(this,m)};var s=l.init;l.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else s.call(this)};var f=l.utcOffset;l.utcOffset=function(m,v){var k=this.$utils().u;if(k(m))return this.$u?0:k(this.$offset)?f.call(this):this.$offset;if(typeof m=="string"&&(m=(function(R){R===void 0&&(R="");var P=R.match(i);if(!P)return null;var j=(""+P[0]).match(a)||["-",0,0],z=j[0],N=60*+j[1]+ +j[2];return N===0?0:z==="+"?N:-N})(m))===null)return this;var B=Math.abs(m)<=16?60*m:m,O=this;if(v)return O.$offset=B,O.$u=m===0,O;if(m!==0){var L=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(O=this.local().add(B+L,c)).$offset=B,O.$x.$localOffset=L}else O=this.utc();return O};var d=l.format;l.format=function(m){var v=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,v)},l.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var u=l.toDate;l.toDate=function(m){return m==="s"&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():u.call(this)};var g=l.diff;l.diff=function(m,v,k){if(m&&this.$u===m.$u)return g.call(this,m,v,k);var B=this.local(),O=n(m).local();return g.call(B,O,v,k)}}}))},{}],394:[function(e,p,b){"use strict";b.utils=e("./des/utils"),b.Cipher=e("./des/cipher"),b.DES=e("./des/des"),b.CBC=e("./des/cbc"),b.EDE=e("./des/ede")},{"./des/cbc":395,"./des/cipher":396,"./des/des":397,"./des/ede":398,"./des/utils":399}],395:[function(e,p,b){"use strict";var c=e("minimalistic-assert"),i=e("inherits"),a={};function r(t){c.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var n=0;n<this.iv.length;n++)this.iv[n]=t[n]}b.instantiate=function(t){function n(f){t.call(this,f),this._cbcInit()}i(n,t);for(var l=Object.keys(a),o=0;o<l.length;o++){var s=l[o];n.prototype[s]=a[s]}return n.create=function(f){return new n(f)},n},a._cbcInit=function(){var t=new r(this.options.iv);this._cbcState=t},a._update=function(t,n,l,o){var s=this._cbcState,f=this.constructor.super_.prototype,d=s.iv;if(this.type==="encrypt"){for(var u=0;u<this.blockSize;u++)d[u]^=t[n+u];for(f._update.call(this,d,0,l,o),u=0;u<this.blockSize;u++)d[u]=l[o+u]}else{for(f._update.call(this,t,n,l,o),u=0;u<this.blockSize;u++)l[o+u]^=d[u];for(u=0;u<this.blockSize;u++)d[u]=t[n+u]}}},{inherits:440,"minimalistic-assert":453}],396:[function(e,p,b){"use strict";var c=e("minimalistic-assert");function i(a){this.options=a,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=a.padding!==!1}p.exports=i,i.prototype._init=function(){},i.prototype.update=function(a){return a.length===0?[]:this.type==="decrypt"?this._updateDecrypt(a):this._updateEncrypt(a)},i.prototype._buffer=function(a,r){for(var t=Math.min(this.buffer.length-this.bufferOff,a.length-r),n=0;n<t;n++)this.buffer[this.bufferOff+n]=a[r+n];return this.bufferOff+=t,t},i.prototype._flushBuffer=function(a,r){return this._update(this.buffer,0,a,r),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(a){var r=0,t=0,n=(this.bufferOff+a.length)/this.blockSize|0,l=new Array(n*this.blockSize);this.bufferOff!==0&&(r+=this._buffer(a,r),this.bufferOff===this.buffer.length&&(t+=this._flushBuffer(l,t)));for(var o=a.length-(a.length-r)%this.blockSize;r<o;r+=this.blockSize)this._update(a,r,l,t),t+=this.blockSize;for(;r<a.length;r++,this.bufferOff++)this.buffer[this.bufferOff]=a[r];return l},i.prototype._updateDecrypt=function(a){for(var r=0,t=0,n=Math.ceil((this.bufferOff+a.length)/this.blockSize)-1,l=new Array(n*this.blockSize);n>0;n--)r+=this._buffer(a,r),t+=this._flushBuffer(l,t);return r+=this._buffer(a,r),l},i.prototype.final=function(a){var r,t;return a&&(r=this.update(a)),t=this.type==="encrypt"?this._finalEncrypt():this._finalDecrypt(),r?r.concat(t):t},i.prototype._pad=function(a,r){if(r===0)return!1;for(;r<a.length;)a[r++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var a=new Array(this.blockSize);return this._update(this.buffer,0,a,0),a},i.prototype._unpad=function(a){return a},i.prototype._finalDecrypt=function(){c.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var a=new Array(this.blockSize);return this._flushBuffer(a,0),this._unpad(a)}},{"minimalistic-assert":453}],397:[function(e,p,b){"use strict";var c=e("minimalistic-assert"),i=e("inherits"),a=e("./utils"),r=e("./cipher");function t(){this.tmp=new Array(2),this.keys=null}function n(o){r.call(this,o);var s=new t;this._desState=s,this.deriveKeys(s,o.key)}i(n,r),p.exports=n,n.create=function(o){return new n(o)};var l=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];n.prototype.deriveKeys=function(o,s){o.keys=new Array(32),c.equal(s.length,this.blockSize,"Invalid key length");var f=a.readUInt32BE(s,0),d=a.readUInt32BE(s,4);a.pc1(f,d,o.tmp,0),f=o.tmp[0],d=o.tmp[1];for(var u=0;u<o.keys.length;u+=2){var g=l[u>>>1];f=a.r28shl(f,g),d=a.r28shl(d,g),a.pc2(f,d,o.keys,u)}},n.prototype._update=function(o,s,f,d){var u=this._desState,g=a.readUInt32BE(o,s),m=a.readUInt32BE(o,s+4);a.ip(g,m,u.tmp,0),g=u.tmp[0],m=u.tmp[1],this.type==="encrypt"?this._encrypt(u,g,m,u.tmp,0):this._decrypt(u,g,m,u.tmp,0),g=u.tmp[0],m=u.tmp[1],a.writeUInt32BE(f,g,d),a.writeUInt32BE(f,m,d+4)},n.prototype._pad=function(o,s){if(this.padding===!1)return!1;for(var f=o.length-s,d=s;d<o.length;d++)o[d]=f;return!0},n.prototype._unpad=function(o){if(this.padding===!1)return o;for(var s=o[o.length-1],f=o.length-s;f<o.length;f++)c.equal(o[f],s);return o.slice(0,o.length-s)},n.prototype._encrypt=function(o,s,f,d,u){for(var g=s,m=f,v=0;v<o.keys.length;v+=2){var k=o.keys[v],B=o.keys[v+1];a.expand(m,o.tmp,0),k^=o.tmp[0],B^=o.tmp[1];var O=a.substitute(k,B),L=m;m=(g^a.permute(O))>>>0,g=L}a.rip(m,g,d,u)},n.prototype._decrypt=function(o,s,f,d,u){for(var g=f,m=s,v=o.keys.length-2;v>=0;v-=2){var k=o.keys[v],B=o.keys[v+1];a.expand(g,o.tmp,0),k^=o.tmp[0],B^=o.tmp[1];var O=a.substitute(k,B),L=g;g=(m^a.permute(O))>>>0,m=L}a.rip(g,m,d,u)}},{"./cipher":396,"./utils":399,inherits:440,"minimalistic-assert":453}],398:[function(e,p,b){"use strict";var c=e("minimalistic-assert"),i=e("inherits"),a=e("./cipher"),r=e("./des");function t(l,o){c.equal(o.length,24,"Invalid key length");var s=o.slice(0,8),f=o.slice(8,16),d=o.slice(16,24);this.ciphers=l==="encrypt"?[r.create({type:"encrypt",key:s}),r.create({type:"decrypt",key:f}),r.create({type:"encrypt",key:d})]:[r.create({type:"decrypt",key:d}),r.create({type:"encrypt",key:f}),r.create({type:"decrypt",key:s})]}function n(l){a.call(this,l);var o=new t(this.type,this.options.key);this._edeState=o}i(n,a),p.exports=n,n.create=function(l){return new n(l)},n.prototype._update=function(l,o,s,f){var d=this._edeState;d.ciphers[0]._update(l,o,s,f),d.ciphers[1]._update(s,f,s,f),d.ciphers[2]._update(s,f,s,f)},n.prototype._pad=r.prototype._pad,n.prototype._unpad=r.prototype._unpad},{"./cipher":396,"./des":397,inherits:440,"minimalistic-assert":453}],399:[function(e,p,b){"use strict";b.readUInt32BE=function(r,t){return(r[0+t]<<24|r[1+t]<<16|r[2+t]<<8|r[3+t])>>>0},b.writeUInt32BE=function(r,t,n){r[0+n]=t>>>24,r[1+n]=t>>>16&255,r[2+n]=t>>>8&255,r[3+n]=255&t},b.ip=function(r,t,n,l){for(var o=0,s=0,f=6;f>=0;f-=2){for(var d=0;d<=24;d+=8)o<<=1,o|=t>>>d+f&1;for(d=0;d<=24;d+=8)o<<=1,o|=r>>>d+f&1}for(f=6;f>=0;f-=2){for(d=1;d<=25;d+=8)s<<=1,s|=t>>>d+f&1;for(d=1;d<=25;d+=8)s<<=1,s|=r>>>d+f&1}n[l+0]=o>>>0,n[l+1]=s>>>0},b.rip=function(r,t,n,l){for(var o=0,s=0,f=0;f<4;f++)for(var d=24;d>=0;d-=8)o<<=1,o|=t>>>d+f&1,o<<=1,o|=r>>>d+f&1;for(f=4;f<8;f++)for(d=24;d>=0;d-=8)s<<=1,s|=t>>>d+f&1,s<<=1,s|=r>>>d+f&1;n[l+0]=o>>>0,n[l+1]=s>>>0},b.pc1=function(r,t,n,l){for(var o=0,s=0,f=7;f>=5;f--){for(var d=0;d<=24;d+=8)o<<=1,o|=t>>d+f&1;for(d=0;d<=24;d+=8)o<<=1,o|=r>>d+f&1}for(d=0;d<=24;d+=8)o<<=1,o|=t>>d+f&1;for(f=1;f<=3;f++){for(d=0;d<=24;d+=8)s<<=1,s|=t>>d+f&1;for(d=0;d<=24;d+=8)s<<=1,s|=r>>d+f&1}for(d=0;d<=24;d+=8)s<<=1,s|=r>>d+f&1;n[l+0]=o>>>0,n[l+1]=s>>>0},b.r28shl=function(r,t){return r<<t&268435455|r>>>28-t};var c=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];b.pc2=function(r,t,n,l){for(var o=0,s=0,f=c.length>>>1,d=0;d<f;d++)o<<=1,o|=r>>>c[d]&1;for(d=f;d<c.length;d++)s<<=1,s|=t>>>c[d]&1;n[l+0]=o>>>0,n[l+1]=s>>>0},b.expand=function(r,t,n){var l=0,o=0;l=(1&r)<<5|r>>>27;for(var s=23;s>=15;s-=4)l<<=6,l|=r>>>s&63;for(s=11;s>=3;s-=4)o|=r>>>s&63,o<<=6;o|=(31&r)<<1|r>>>31,t[n+0]=l>>>0,t[n+1]=o>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];b.substitute=function(r,t){for(var n=0,l=0;l<4;l++)n<<=4,n|=i[64*l+(r>>>18-6*l&63)];for(l=0;l<4;l++)n<<=4,n|=i[256+64*l+(t>>>18-6*l&63)];return n>>>0};var a=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];b.permute=function(r){for(var t=0,n=0;n<a.length;n++)t<<=1,t|=r>>>a[n]&1;return t>>>0},b.padSplit=function(r,t,n){for(var l=r.toString(2);l.length<t;)l="0"+l;for(var o=[],s=0;s<t;s+=n)o.push(l.slice(s,s+n));return o.join(" ")}},{}],400:[function(e,p,b){(function(c){(function(){"use strict";var i=e("./lib/generatePrime"),a=e("./lib/primes.json"),r=e("./lib/dh"),t={binary:!0,hex:!0,base64:!0};b.DiffieHellmanGroup=b.createDiffieHellmanGroup=b.getDiffieHellman=function(n){var l=new c(a[n].prime,"hex"),o=new c(a[n].gen,"hex");return new r(l,o)},b.createDiffieHellman=b.DiffieHellman=function n(l,o,s,f){return c.isBuffer(o)||t[o]===void 0?n(l,"binary",o,s):(o=o||"binary",f=f||"binary",s=s||new c([2]),c.isBuffer(s)||(s=new c(s,f)),typeof l=="number"?new r(i(l,s),s,!0):(c.isBuffer(l)||(l=new c(l,o)),new r(l,s,!0)))}}).call(this)}).call(this,e("buffer").Buffer)},{"./lib/dh":401,"./lib/generatePrime":402,"./lib/primes.json":403,buffer:220}],401:[function(e,p,b){(function(c){(function(){"use strict";var i=e("bn.js"),a=new(e("miller-rabin")),r=new i(24),t=new i(11),n=new i(10),l=new i(3),o=new i(7),s=e("./generatePrime"),f=e("randombytes");function d(k,B){return B=B||"utf8",c.isBuffer(k)||(k=new c(k,B)),this._pub=new i(k),this}function u(k,B){return B=B||"utf8",c.isBuffer(k)||(k=new c(k,B)),this._priv=new i(k),this}p.exports=m;var g={};function m(k,B,O){this.setGenerator(B),this.__prime=new i(k),this._prime=i.mont(this.__prime),this._primeLen=k.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,O?(this.setPublicKey=d,this.setPrivateKey=u):this._primeCode=8}function v(k,B){var O=new c(k.toArray());return B?O.toString(B):O}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=(function(k,B){var O=B.toString("hex"),L=[O,k.toString(16)].join("_");if(L in g)return g[L];var R,P=0;if(k.isEven()||!s.simpleSieve||!s.fermatTest(k)||!a.test(k))return P+=1,P+=O==="02"||O==="05"?8:4,g[L]=P,P;switch(a.test(k.shrn(1))||(P+=2),O){case"02":k.mod(r).cmp(t)&&(P+=8);break;case"05":(R=k.mod(n)).cmp(l)&&R.cmp(o)&&(P+=8);break;default:P+=4}return g[L]=P,P})(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new i(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(k){var B=(k=(k=new i(k)).toRed(this._prime)).redPow(this._priv).fromRed(),O=new c(B.toArray()),L=this.getPrime();if(O.length<L.length){var R=new c(L.length-O.length);R.fill(0),O=c.concat([R,O])}return O},m.prototype.getPublicKey=function(k){return v(this._pub,k)},m.prototype.getPrivateKey=function(k){return v(this._priv,k)},m.prototype.getPrime=function(k){return v(this.__prime,k)},m.prototype.getGenerator=function(k){return v(this._gen,k)},m.prototype.setGenerator=function(k,B){return B=B||"utf8",c.isBuffer(k)||(k=new c(k,B)),this.__gen=k,this._gen=new i(k),this}}).call(this)}).call(this,e("buffer").Buffer)},{"./generatePrime":402,"bn.js":404,buffer:220,"miller-rabin":451,randombytes:475}],402:[function(e,p,b){"use strict";var c=e("randombytes");p.exports=k,k.simpleSieve=m,k.fermatTest=v;var i=e("bn.js"),a=new i(24),r=new(e("miller-rabin")),t=new i(1),n=new i(2),l=new i(5),o=(new i(16),new i(8),new i(10)),s=new i(3),f=(new i(7),new i(11)),d=new i(4),u=(new i(12),null);function g(){if(u!==null)return u;var B=[];B[0]=2;for(var O=1,L=3;L<1048576;L+=2){for(var R=Math.ceil(Math.sqrt(L)),P=0;P<O&&B[P]<=R&&L%B[P]!=0;P++);O!==P&&B[P]<=R||(B[O++]=L)}return u=B,B}function m(B){for(var O=g(),L=0;L<O.length;L++)if(B.modn(O[L])===0)return B.cmpn(O[L])===0;return!0}function v(B){var O=i.mont(B);return n.toRed(O).redPow(B.subn(1)).fromRed().cmpn(1)===0}function k(B,O){if(B<16)return new i(O===2||O===5?[140,123]:[140,39]);var L,R;for(O=new i(O);;){for(L=new i(c(Math.ceil(B/8)));L.bitLength()>B;)L.ishrn(1);if(L.isEven()&&L.iadd(t),L.testn(1)||L.iadd(n),O.cmp(n)){if(!O.cmp(l))for(;L.mod(o).cmp(s);)L.iadd(d)}else for(;L.mod(a).cmp(f);)L.iadd(d);if(m(R=L.shrn(1))&&m(L)&&v(R)&&v(L)&&r.test(R)&&r.test(L))return L}}},{"bn.js":404,"miller-rabin":451,randombytes:475}],403:[function(e,p,b){p.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],404:[function(e,p,b){arguments[4][184][0].apply(b,arguments)},{buffer:188,dup:184}],405:[function(e,p,b){"use strict";var c=b;c.version=e("../package.json").version,c.utils=e("./elliptic/utils"),c.rand=e("brorand"),c.curve=e("./elliptic/curve"),c.curves=e("./elliptic/curves"),c.ec=e("./elliptic/ec"),c.eddsa=e("./elliptic/eddsa")},{"../package.json":421,"./elliptic/curve":408,"./elliptic/curves":411,"./elliptic/ec":412,"./elliptic/eddsa":415,"./elliptic/utils":419,brorand:187}],406:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("../utils"),a=i.getNAF,r=i.getJSF,t=i.assert;function n(o,s){this.type=o,this.p=new c(s.p,16),this.red=s.prime?c.red(s.prime):c.mont(this.p),this.zero=new c(0).toRed(this.red),this.one=new c(1).toRed(this.red),this.two=new c(2).toRed(this.red),this.n=s.n&&new c(s.n,16),this.g=s.g&&this.pointFromJSON(s.g,s.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var f=this.n&&this.p.div(this.n);!f||f.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(o,s){this.curve=o,this.type=s,this.precomputed=null}p.exports=n,n.prototype.point=function(){throw new Error("Not implemented")},n.prototype.validate=function(){throw new Error("Not implemented")},n.prototype._fixedNafMul=function(o,s){t(o.precomputed);var f=o._getDoubles(),d=a(s,1,this._bitLength),u=(1<<f.step+1)-(f.step%2==0?2:1);u/=3;var g,m,v=[];for(g=0;g<d.length;g+=f.step){m=0;for(var k=g+f.step-1;k>=g;k--)m=(m<<1)+d[k];v.push(m)}for(var B=this.jpoint(null,null,null),O=this.jpoint(null,null,null),L=u;L>0;L--){for(g=0;g<v.length;g++)(m=v[g])===L?O=O.mixedAdd(f.points[g]):m===-L&&(O=O.mixedAdd(f.points[g].neg()));B=B.add(O)}return B.toP()},n.prototype._wnafMul=function(o,s){var f=4,d=o._getNAFPoints(f);f=d.wnd;for(var u=d.points,g=a(s,f,this._bitLength),m=this.jpoint(null,null,null),v=g.length-1;v>=0;v--){for(var k=0;v>=0&&g[v]===0;v--)k++;if(v>=0&&k++,m=m.dblp(k),v<0)break;var B=g[v];t(B!==0),m=o.type==="affine"?B>0?m.mixedAdd(u[B-1>>1]):m.mixedAdd(u[-B-1>>1].neg()):B>0?m.add(u[B-1>>1]):m.add(u[-B-1>>1].neg())}return o.type==="affine"?m.toP():m},n.prototype._wnafMulAdd=function(o,s,f,d,u){var g,m,v,k=this._wnafT1,B=this._wnafT2,O=this._wnafT3,L=0;for(g=0;g<d;g++){var R=(v=s[g])._getNAFPoints(o);k[g]=R.wnd,B[g]=R.points}for(g=d-1;g>=1;g-=2){var P=g-1,j=g;if(k[P]===1&&k[j]===1){var z=[s[P],null,null,s[j]];s[P].y.cmp(s[j].y)===0?(z[1]=s[P].add(s[j]),z[2]=s[P].toJ().mixedAdd(s[j].neg())):s[P].y.cmp(s[j].y.redNeg())===0?(z[1]=s[P].toJ().mixedAdd(s[j]),z[2]=s[P].add(s[j].neg())):(z[1]=s[P].toJ().mixedAdd(s[j]),z[2]=s[P].toJ().mixedAdd(s[j].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],S=r(f[P],f[j]);for(L=Math.max(S[0].length,L),O[P]=new Array(L),O[j]=new Array(L),m=0;m<L;m++){var C=0|S[0][m],E=0|S[1][m];O[P][m]=N[3*(C+1)+(E+1)],O[j][m]=0,B[P]=z}}else O[P]=a(f[P],k[P],this._bitLength),O[j]=a(f[j],k[j],this._bitLength),L=Math.max(O[P].length,L),L=Math.max(O[j].length,L)}var h=this.jpoint(null,null,null),y=this._wnafT4;for(g=L;g>=0;g--){for(var w=0;g>=0;){var x=!0;for(m=0;m<d;m++)y[m]=0|O[m][g],y[m]!==0&&(x=!1);if(!x)break;w++,g--}if(g>=0&&w++,h=h.dblp(w),g<0)break;for(m=0;m<d;m++){var _=y[m];_!==0&&(_>0?v=B[m][_-1>>1]:_<0&&(v=B[m][-_-1>>1].neg()),h=v.type==="affine"?h.mixedAdd(v):h.add(v))}}for(g=0;g<d;g++)B[g]=null;return u?h:h.toP()},n.BasePoint=l,l.prototype.eq=function(){throw new Error("Not implemented")},l.prototype.validate=function(){return this.curve.validate(this)},n.prototype.decodePoint=function(o,s){o=i.toArray(o,s);var f=this.p.byteLength();if((o[0]===4||o[0]===6||o[0]===7)&&o.length-1==2*f)return o[0]===6?t(o[o.length-1]%2==0):o[0]===7&&t(o[o.length-1]%2==1),this.point(o.slice(1,1+f),o.slice(1+f,1+2*f));if((o[0]===2||o[0]===3)&&o.length-1===f)return this.pointFromX(o.slice(1,1+f),o[0]===3);throw new Error("Unknown point format")},l.prototype.encodeCompressed=function(o){return this.encode(o,!0)},l.prototype._encode=function(o){var s=this.curve.p.byteLength(),f=this.getX().toArray("be",s);return o?[this.getY().isEven()?2:3].concat(f):[4].concat(f,this.getY().toArray("be",s))},l.prototype.encode=function(o,s){return i.encode(this._encode(s),o)},l.prototype.precompute=function(o){if(this.precomputed)return this;var s={doubles:null,naf:null,beta:null};return s.naf=this._getNAFPoints(8),s.doubles=this._getDoubles(4,o),s.beta=this._getBeta(),this.precomputed=s,this},l.prototype._hasDoubles=function(o){if(!this.precomputed)return!1;var s=this.precomputed.doubles;return!!s&&s.points.length>=Math.ceil((o.bitLength()+1)/s.step)},l.prototype._getDoubles=function(o,s){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var f=[this],d=this,u=0;u<s;u+=o){for(var g=0;g<o;g++)d=d.dbl();f.push(d)}return{step:o,points:f}},l.prototype._getNAFPoints=function(o){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var s=[this],f=(1<<o)-1,d=f===1?null:this.dbl(),u=1;u<f;u++)s[u]=s[u-1].add(d);return{wnd:o,points:s}},l.prototype._getBeta=function(){return null},l.prototype.dblp=function(o){for(var s=this,f=0;f<o;f++)s=s.dbl();return s}},{"../utils":419,"bn.js":420}],407:[function(e,p,b){"use strict";var c=e("../utils"),i=e("bn.js"),a=e("inherits"),r=e("./base"),t=c.assert;function n(o){this.twisted=(0|o.a)!=1,this.mOneA=this.twisted&&(0|o.a)==-1,this.extended=this.mOneA,r.call(this,"edwards",o),this.a=new i(o.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(o.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(o.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),t(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(0|o.c)==1}function l(o,s,f,d,u){r.BasePoint.call(this,o,"projective"),s===null&&f===null&&d===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(s,16),this.y=new i(f,16),this.z=d?new i(d,16):this.curve.one,this.t=u&&new i(u,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(n,r),p.exports=n,n.prototype._mulA=function(o){return this.mOneA?o.redNeg():this.a.redMul(o)},n.prototype._mulC=function(o){return this.oneC?o:this.c.redMul(o)},n.prototype.jpoint=function(o,s,f,d){return this.point(o,s,f,d)},n.prototype.pointFromX=function(o,s){(o=new i(o,16)).red||(o=o.toRed(this.red));var f=o.redSqr(),d=this.c2.redSub(this.a.redMul(f)),u=this.one.redSub(this.c2.redMul(this.d).redMul(f)),g=d.redMul(u.redInvm()),m=g.redSqrt();if(m.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");var v=m.fromRed().isOdd();return(s&&!v||!s&&v)&&(m=m.redNeg()),this.point(o,m)},n.prototype.pointFromY=function(o,s){(o=new i(o,16)).red||(o=o.toRed(this.red));var f=o.redSqr(),d=f.redSub(this.c2),u=f.redMul(this.d).redMul(this.c2).redSub(this.a),g=d.redMul(u.redInvm());if(g.cmp(this.zero)===0){if(s)throw new Error("invalid point");return this.point(this.zero,o)}var m=g.redSqrt();if(m.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");return m.fromRed().isOdd()!==s&&(m=m.redNeg()),this.point(m,o)},n.prototype.validate=function(o){if(o.isInfinity())return!0;o.normalize();var s=o.x.redSqr(),f=o.y.redSqr(),d=s.redMul(this.a).redAdd(f),u=this.c2.redMul(this.one.redAdd(this.d.redMul(s).redMul(f)));return d.cmp(u)===0},a(l,r.BasePoint),n.prototype.pointFromJSON=function(o){return l.fromJSON(this,o)},n.prototype.point=function(o,s,f,d){return new l(this,o,s,f,d)},l.fromJSON=function(o,s){return new l(o,s[0],s[1],s[2])},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},l.prototype._extDbl=function(){var o=this.x.redSqr(),s=this.y.redSqr(),f=this.z.redSqr();f=f.redIAdd(f);var d=this.curve._mulA(o),u=this.x.redAdd(this.y).redSqr().redISub(o).redISub(s),g=d.redAdd(s),m=g.redSub(f),v=d.redSub(s),k=u.redMul(m),B=g.redMul(v),O=u.redMul(v),L=m.redMul(g);return this.curve.point(k,B,L,O)},l.prototype._projDbl=function(){var o,s,f,d,u,g,m=this.x.redAdd(this.y).redSqr(),v=this.x.redSqr(),k=this.y.redSqr();if(this.curve.twisted){var B=(d=this.curve._mulA(v)).redAdd(k);this.zOne?(o=m.redSub(v).redSub(k).redMul(B.redSub(this.curve.two)),s=B.redMul(d.redSub(k)),f=B.redSqr().redSub(B).redSub(B)):(u=this.z.redSqr(),g=B.redSub(u).redISub(u),o=m.redSub(v).redISub(k).redMul(g),s=B.redMul(d.redSub(k)),f=B.redMul(g))}else d=v.redAdd(k),u=this.curve._mulC(this.z).redSqr(),g=d.redSub(u).redSub(u),o=this.curve._mulC(m.redISub(d)).redMul(g),s=this.curve._mulC(d).redMul(v.redISub(k)),f=d.redMul(g);return this.curve.point(o,s,f)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(o){var s=this.y.redSub(this.x).redMul(o.y.redSub(o.x)),f=this.y.redAdd(this.x).redMul(o.y.redAdd(o.x)),d=this.t.redMul(this.curve.dd).redMul(o.t),u=this.z.redMul(o.z.redAdd(o.z)),g=f.redSub(s),m=u.redSub(d),v=u.redAdd(d),k=f.redAdd(s),B=g.redMul(m),O=v.redMul(k),L=g.redMul(k),R=m.redMul(v);return this.curve.point(B,O,R,L)},l.prototype._projAdd=function(o){var s,f,d=this.z.redMul(o.z),u=d.redSqr(),g=this.x.redMul(o.x),m=this.y.redMul(o.y),v=this.curve.d.redMul(g).redMul(m),k=u.redSub(v),B=u.redAdd(v),O=this.x.redAdd(this.y).redMul(o.x.redAdd(o.y)).redISub(g).redISub(m),L=d.redMul(k).redMul(O);return this.curve.twisted?(s=d.redMul(B).redMul(m.redSub(this.curve._mulA(g))),f=k.redMul(B)):(s=d.redMul(B).redMul(m.redSub(g)),f=this.curve._mulC(k).redMul(B)),this.curve.point(L,s,f)},l.prototype.add=function(o){return this.isInfinity()?o:o.isInfinity()?this:this.curve.extended?this._extAdd(o):this._projAdd(o)},l.prototype.mul=function(o){return this._hasDoubles(o)?this.curve._fixedNafMul(this,o):this.curve._wnafMul(this,o)},l.prototype.mulAdd=function(o,s,f){return this.curve._wnafMulAdd(1,[this,s],[o,f],2,!1)},l.prototype.jmulAdd=function(o,s,f){return this.curve._wnafMulAdd(1,[this,s],[o,f],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var o=this.z.redInvm();return this.x=this.x.redMul(o),this.y=this.y.redMul(o),this.t&&(this.t=this.t.redMul(o)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(o){return this===o||this.getX().cmp(o.getX())===0&&this.getY().cmp(o.getY())===0},l.prototype.eqXToP=function(o){var s=o.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(s)===0)return!0;for(var f=o.clone(),d=this.curve.redN.redMul(this.z);;){if(f.iadd(this.curve.n),f.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(d),this.x.cmp(s)===0)return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],408:[function(e,p,b){"use strict";var c=b;c.base=e("./base"),c.short=e("./short"),c.mont=e("./mont"),c.edwards=e("./edwards")},{"./base":406,"./edwards":407,"./mont":409,"./short":410}],409:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("inherits"),a=e("./base"),r=e("../utils");function t(l){a.call(this,"mont",l),this.a=new c(l.a,16).toRed(this.red),this.b=new c(l.b,16).toRed(this.red),this.i4=new c(4).toRed(this.red).redInvm(),this.two=new c(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function n(l,o,s){a.BasePoint.call(this,l,"projective"),o===null&&s===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new c(o,16),this.z=new c(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(t,a),p.exports=t,t.prototype.validate=function(l){var o=l.normalize().x,s=o.redSqr(),f=s.redMul(o).redAdd(s.redMul(this.a)).redAdd(o);return f.redSqrt().redSqr().cmp(f)===0},i(n,a.BasePoint),t.prototype.decodePoint=function(l,o){return this.point(r.toArray(l,o),1)},t.prototype.point=function(l,o){return new n(this,l,o)},t.prototype.pointFromJSON=function(l){return n.fromJSON(this,l)},n.prototype.precompute=function(){},n.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},n.fromJSON=function(l,o){return new n(l,o[0],o[1]||l.one)},n.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},n.prototype.isInfinity=function(){return this.z.cmpn(0)===0},n.prototype.dbl=function(){var l=this.x.redAdd(this.z).redSqr(),o=this.x.redSub(this.z).redSqr(),s=l.redSub(o),f=l.redMul(o),d=s.redMul(o.redAdd(this.curve.a24.redMul(s)));return this.curve.point(f,d)},n.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.diffAdd=function(l,o){var s=this.x.redAdd(this.z),f=this.x.redSub(this.z),d=l.x.redAdd(l.z),u=l.x.redSub(l.z).redMul(s),g=d.redMul(f),m=o.z.redMul(u.redAdd(g).redSqr()),v=o.x.redMul(u.redISub(g).redSqr());return this.curve.point(m,v)},n.prototype.mul=function(l){for(var o=l.clone(),s=this,f=this.curve.point(null,null),d=[];o.cmpn(0)!==0;o.iushrn(1))d.push(o.andln(1));for(var u=d.length-1;u>=0;u--)d[u]===0?(s=s.diffAdd(f,this),f=f.dbl()):(f=s.diffAdd(f,this),s=s.dbl());return f},n.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},n.prototype.eq=function(l){return this.getX().cmp(l.getX())===0},n.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},n.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],410:[function(e,p,b){"use strict";var c=e("../utils"),i=e("bn.js"),a=e("inherits"),r=e("./base"),t=c.assert;function n(s){r.call(this,"short",s),this.a=new i(s.a,16).toRed(this.red),this.b=new i(s.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(s),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(s,f,d,u){r.BasePoint.call(this,s,"affine"),f===null&&d===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(f,16),this.y=new i(d,16),u&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function o(s,f,d,u){r.BasePoint.call(this,s,"jacobian"),f===null&&d===null&&u===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(f,16),this.y=new i(d,16),this.z=new i(u,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(n,r),p.exports=n,n.prototype._getEndomorphism=function(s){if(this.zeroA&&this.g&&this.n&&this.p.modn(3)===1){var f,d;if(s.beta)f=new i(s.beta,16).toRed(this.red);else{var u=this._getEndoRoots(this.p);f=(f=u[0].cmp(u[1])<0?u[0]:u[1]).toRed(this.red)}if(s.lambda)d=new i(s.lambda,16);else{var g=this._getEndoRoots(this.n);this.g.mul(g[0]).x.cmp(this.g.x.redMul(f))===0?d=g[0]:(d=g[1],t(this.g.mul(d).x.cmp(this.g.x.redMul(f))===0))}return{beta:f,lambda:d,basis:s.basis?s.basis.map((function(m){return{a:new i(m.a,16),b:new i(m.b,16)}})):this._getEndoBasis(d)}}},n.prototype._getEndoRoots=function(s){var f=s===this.p?this.red:i.mont(s),d=new i(2).toRed(f).redInvm(),u=d.redNeg(),g=new i(3).toRed(f).redNeg().redSqrt().redMul(d);return[u.redAdd(g).fromRed(),u.redSub(g).fromRed()]},n.prototype._getEndoBasis=function(s){for(var f,d,u,g,m,v,k,B,O,L=this.n.ushrn(Math.floor(this.n.bitLength()/2)),R=s,P=this.n.clone(),j=new i(1),z=new i(0),N=new i(0),S=new i(1),C=0;R.cmpn(0)!==0;){var E=P.div(R);B=P.sub(E.mul(R)),O=N.sub(E.mul(j));var h=S.sub(E.mul(z));if(!u&&B.cmp(L)<0)f=k.neg(),d=j,u=B.neg(),g=O;else if(u&&++C==2)break;k=B,P=R,R=B,N=j,j=O,S=z,z=h}m=B.neg(),v=O;var y=u.sqr().add(g.sqr());return m.sqr().add(v.sqr()).cmp(y)>=0&&(m=f,v=d),u.negative&&(u=u.neg(),g=g.neg()),m.negative&&(m=m.neg(),v=v.neg()),[{a:u,b:g},{a:m,b:v}]},n.prototype._endoSplit=function(s){var f=this.endo.basis,d=f[0],u=f[1],g=u.b.mul(s).divRound(this.n),m=d.b.neg().mul(s).divRound(this.n),v=g.mul(d.a),k=m.mul(u.a),B=g.mul(d.b),O=m.mul(u.b);return{k1:s.sub(v).sub(k),k2:B.add(O).neg()}},n.prototype.pointFromX=function(s,f){(s=new i(s,16)).red||(s=s.toRed(this.red));var d=s.redSqr().redMul(s).redIAdd(s.redMul(this.a)).redIAdd(this.b),u=d.redSqrt();if(u.redSqr().redSub(d).cmp(this.zero)!==0)throw new Error("invalid point");var g=u.fromRed().isOdd();return(f&&!g||!f&&g)&&(u=u.redNeg()),this.point(s,u)},n.prototype.validate=function(s){if(s.inf)return!0;var f=s.x,d=s.y,u=this.a.redMul(f),g=f.redSqr().redMul(f).redIAdd(u).redIAdd(this.b);return d.redSqr().redISub(g).cmpn(0)===0},n.prototype._endoWnafMulAdd=function(s,f,d){for(var u=this._endoWnafT1,g=this._endoWnafT2,m=0;m<s.length;m++){var v=this._endoSplit(f[m]),k=s[m],B=k._getBeta();v.k1.negative&&(v.k1.ineg(),k=k.neg(!0)),v.k2.negative&&(v.k2.ineg(),B=B.neg(!0)),u[2*m]=k,u[2*m+1]=B,g[2*m]=v.k1,g[2*m+1]=v.k2}for(var O=this._wnafMulAdd(1,u,g,2*m,d),L=0;L<2*m;L++)u[L]=null,g[L]=null;return O},a(l,r.BasePoint),n.prototype.point=function(s,f,d){return new l(this,s,f,d)},n.prototype.pointFromJSON=function(s,f){return l.fromJSON(this,s,f)},l.prototype._getBeta=function(){if(this.curve.endo){var s=this.precomputed;if(s&&s.beta)return s.beta;var f=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(s){var d=this.curve,u=function(g){return d.point(g.x.redMul(d.endo.beta),g.y)};s.beta=f,f.precomputed={beta:null,naf:s.naf&&{wnd:s.naf.wnd,points:s.naf.points.map(u)},doubles:s.doubles&&{step:s.doubles.step,points:s.doubles.points.map(u)}}}return f}},l.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},l.fromJSON=function(s,f,d){typeof f=="string"&&(f=JSON.parse(f));var u=s.point(f[0],f[1],d);if(!f[2])return u;function g(v){return s.point(v[0],v[1],d)}var m=f[2];return u.precomputed={beta:null,doubles:m.doubles&&{step:m.doubles.step,points:[u].concat(m.doubles.points.map(g))},naf:m.naf&&{wnd:m.naf.wnd,points:[u].concat(m.naf.points.map(g))}},u},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(s){if(this.inf)return s;if(s.inf)return this;if(this.eq(s))return this.dbl();if(this.neg().eq(s))return this.curve.point(null,null);if(this.x.cmp(s.x)===0)return this.curve.point(null,null);var f=this.y.redSub(s.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(s.x).redInvm()));var d=f.redSqr().redISub(this.x).redISub(s.x),u=f.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,u)},l.prototype.dbl=function(){if(this.inf)return this;var s=this.y.redAdd(this.y);if(s.cmpn(0)===0)return this.curve.point(null,null);var f=this.curve.a,d=this.x.redSqr(),u=s.redInvm(),g=d.redAdd(d).redIAdd(d).redIAdd(f).redMul(u),m=g.redSqr().redISub(this.x.redAdd(this.x)),v=g.redMul(this.x.redSub(m)).redISub(this.y);return this.curve.point(m,v)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(s){return s=new i(s,16),this.isInfinity()?this:this._hasDoubles(s)?this.curve._fixedNafMul(this,s):this.curve.endo?this.curve._endoWnafMulAdd([this],[s]):this.curve._wnafMul(this,s)},l.prototype.mulAdd=function(s,f,d){var u=[this,f],g=[s,d];return this.curve.endo?this.curve._endoWnafMulAdd(u,g):this.curve._wnafMulAdd(1,u,g,2)},l.prototype.jmulAdd=function(s,f,d){var u=[this,f],g=[s,d];return this.curve.endo?this.curve._endoWnafMulAdd(u,g,!0):this.curve._wnafMulAdd(1,u,g,2,!0)},l.prototype.eq=function(s){return this===s||this.inf===s.inf&&(this.inf||this.x.cmp(s.x)===0&&this.y.cmp(s.y)===0)},l.prototype.neg=function(s){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(s&&this.precomputed){var d=this.precomputed,u=function(g){return g.neg()};f.precomputed={naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(u)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(u)}}}return f},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(o,r.BasePoint),n.prototype.jpoint=function(s,f,d){return new o(this,s,f,d)},o.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var s=this.z.redInvm(),f=s.redSqr(),d=this.x.redMul(f),u=this.y.redMul(f).redMul(s);return this.curve.point(d,u)},o.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},o.prototype.add=function(s){if(this.isInfinity())return s;if(s.isInfinity())return this;var f=s.z.redSqr(),d=this.z.redSqr(),u=this.x.redMul(f),g=s.x.redMul(d),m=this.y.redMul(f.redMul(s.z)),v=s.y.redMul(d.redMul(this.z)),k=u.redSub(g),B=m.redSub(v);if(k.cmpn(0)===0)return B.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=k.redSqr(),L=O.redMul(k),R=u.redMul(O),P=B.redSqr().redIAdd(L).redISub(R).redISub(R),j=B.redMul(R.redISub(P)).redISub(m.redMul(L)),z=this.z.redMul(s.z).redMul(k);return this.curve.jpoint(P,j,z)},o.prototype.mixedAdd=function(s){if(this.isInfinity())return s.toJ();if(s.isInfinity())return this;var f=this.z.redSqr(),d=this.x,u=s.x.redMul(f),g=this.y,m=s.y.redMul(f).redMul(this.z),v=d.redSub(u),k=g.redSub(m);if(v.cmpn(0)===0)return k.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var B=v.redSqr(),O=B.redMul(v),L=d.redMul(B),R=k.redSqr().redIAdd(O).redISub(L).redISub(L),P=k.redMul(L.redISub(R)).redISub(g.redMul(O)),j=this.z.redMul(v);return this.curve.jpoint(R,P,j)},o.prototype.dblp=function(s){if(s===0)return this;if(this.isInfinity())return this;if(!s)return this.dbl();var f;if(this.curve.zeroA||this.curve.threeA){var d=this;for(f=0;f<s;f++)d=d.dbl();return d}var u=this.curve.a,g=this.curve.tinv,m=this.x,v=this.y,k=this.z,B=k.redSqr().redSqr(),O=v.redAdd(v);for(f=0;f<s;f++){var L=m.redSqr(),R=O.redSqr(),P=R.redSqr(),j=L.redAdd(L).redIAdd(L).redIAdd(u.redMul(B)),z=m.redMul(R),N=j.redSqr().redISub(z.redAdd(z)),S=z.redISub(N),C=j.redMul(S);C=C.redIAdd(C).redISub(P);var E=O.redMul(k);f+1<s&&(B=B.redMul(P)),m=N,k=E,O=C}return this.curve.jpoint(m,O.redMul(g),k)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},o.prototype._zeroDbl=function(){var s,f,d;if(this.zOne){var u=this.x.redSqr(),g=this.y.redSqr(),m=g.redSqr(),v=this.x.redAdd(g).redSqr().redISub(u).redISub(m);v=v.redIAdd(v);var k=u.redAdd(u).redIAdd(u),B=k.redSqr().redISub(v).redISub(v),O=m.redIAdd(m);O=(O=O.redIAdd(O)).redIAdd(O),s=B,f=k.redMul(v.redISub(B)).redISub(O),d=this.y.redAdd(this.y)}else{var L=this.x.redSqr(),R=this.y.redSqr(),P=R.redSqr(),j=this.x.redAdd(R).redSqr().redISub(L).redISub(P);j=j.redIAdd(j);var z=L.redAdd(L).redIAdd(L),N=z.redSqr(),S=P.redIAdd(P);S=(S=S.redIAdd(S)).redIAdd(S),s=N.redISub(j).redISub(j),f=z.redMul(j.redISub(s)).redISub(S),d=(d=this.y.redMul(this.z)).redIAdd(d)}return this.curve.jpoint(s,f,d)},o.prototype._threeDbl=function(){var s,f,d;if(this.zOne){var u=this.x.redSqr(),g=this.y.redSqr(),m=g.redSqr(),v=this.x.redAdd(g).redSqr().redISub(u).redISub(m);v=v.redIAdd(v);var k=u.redAdd(u).redIAdd(u).redIAdd(this.curve.a),B=k.redSqr().redISub(v).redISub(v);s=B;var O=m.redIAdd(m);O=(O=O.redIAdd(O)).redIAdd(O),f=k.redMul(v.redISub(B)).redISub(O),d=this.y.redAdd(this.y)}else{var L=this.z.redSqr(),R=this.y.redSqr(),P=this.x.redMul(R),j=this.x.redSub(L).redMul(this.x.redAdd(L));j=j.redAdd(j).redIAdd(j);var z=P.redIAdd(P),N=(z=z.redIAdd(z)).redAdd(z);s=j.redSqr().redISub(N),d=this.y.redAdd(this.z).redSqr().redISub(R).redISub(L);var S=R.redSqr();S=(S=(S=S.redIAdd(S)).redIAdd(S)).redIAdd(S),f=j.redMul(z.redISub(s)).redISub(S)}return this.curve.jpoint(s,f,d)},o.prototype._dbl=function(){var s=this.curve.a,f=this.x,d=this.y,u=this.z,g=u.redSqr().redSqr(),m=f.redSqr(),v=d.redSqr(),k=m.redAdd(m).redIAdd(m).redIAdd(s.redMul(g)),B=f.redAdd(f),O=(B=B.redIAdd(B)).redMul(v),L=k.redSqr().redISub(O.redAdd(O)),R=O.redISub(L),P=v.redSqr();P=(P=(P=P.redIAdd(P)).redIAdd(P)).redIAdd(P);var j=k.redMul(R).redISub(P),z=d.redAdd(d).redMul(u);return this.curve.jpoint(L,j,z)},o.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var s=this.x.redSqr(),f=this.y.redSqr(),d=this.z.redSqr(),u=f.redSqr(),g=s.redAdd(s).redIAdd(s),m=g.redSqr(),v=this.x.redAdd(f).redSqr().redISub(s).redISub(u),k=(v=(v=(v=v.redIAdd(v)).redAdd(v).redIAdd(v)).redISub(m)).redSqr(),B=u.redIAdd(u);B=(B=(B=B.redIAdd(B)).redIAdd(B)).redIAdd(B);var O=g.redIAdd(v).redSqr().redISub(m).redISub(k).redISub(B),L=f.redMul(O);L=(L=L.redIAdd(L)).redIAdd(L);var R=this.x.redMul(k).redISub(L);R=(R=R.redIAdd(R)).redIAdd(R);var P=this.y.redMul(O.redMul(B.redISub(O)).redISub(v.redMul(k)));P=(P=(P=P.redIAdd(P)).redIAdd(P)).redIAdd(P);var j=this.z.redAdd(v).redSqr().redISub(d).redISub(k);return this.curve.jpoint(R,P,j)},o.prototype.mul=function(s,f){return s=new i(s,f),this.curve._wnafMul(this,s)},o.prototype.eq=function(s){if(s.type==="affine")return this.eq(s.toJ());if(this===s)return!0;var f=this.z.redSqr(),d=s.z.redSqr();if(this.x.redMul(d).redISub(s.x.redMul(f)).cmpn(0)!==0)return!1;var u=f.redMul(this.z),g=d.redMul(s.z);return this.y.redMul(g).redISub(s.y.redMul(u)).cmpn(0)===0},o.prototype.eqXToP=function(s){var f=this.z.redSqr(),d=s.toRed(this.curve.red).redMul(f);if(this.x.cmp(d)===0)return!0;for(var u=s.clone(),g=this.curve.redN.redMul(f);;){if(u.iadd(this.curve.n),u.cmp(this.curve.p)>=0)return!1;if(d.redIAdd(g),this.x.cmp(d)===0)return!0}},o.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},o.prototype.isInfinity=function(){return this.z.cmpn(0)===0}},{"../utils":419,"./base":406,"bn.js":420,inherits:440}],411:[function(e,p,b){"use strict";var c,i=b,a=e("hash.js"),r=e("./curve"),t=e("./utils").assert;function n(o){o.type==="short"?this.curve=new r.short(o):o.type==="edwards"?this.curve=new r.edwards(o):this.curve=new r.mont(o),this.g=this.curve.g,this.n=this.curve.n,this.hash=o.hash,t(this.g.validate(),"Invalid curve"),t(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(o,s){Object.defineProperty(i,o,{configurable:!0,enumerable:!0,get:function(){var f=new n(s);return Object.defineProperty(i,o,{configurable:!0,enumerable:!0,value:f}),f}})}i.PresetCurve=n,l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{c=e("./precomputed/secp256k1")}catch{c=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})},{"./curve":408,"./precomputed/secp256k1":418,"./utils":419,"hash.js":426}],412:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("hmac-drbg"),a=e("../utils"),r=e("../curves"),t=e("brorand"),n=a.assert,l=e("./key"),o=e("./signature");function s(f){if(!(this instanceof s))return new s(f);typeof f=="string"&&(n(Object.prototype.hasOwnProperty.call(r,f),"Unknown curve "+f),f=r[f]),f instanceof r.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}p.exports=s,s.prototype.keyPair=function(f){return new l(this,f)},s.prototype.keyFromPrivate=function(f,d){return l.fromPrivate(this,f,d)},s.prototype.keyFromPublic=function(f,d){return l.fromPublic(this,f,d)},s.prototype.genKeyPair=function(f){f||(f={});for(var d=new i({hash:this.hash,pers:f.pers,persEnc:f.persEnc||"utf8",entropy:f.entropy||t(this.hash.hmacStrength),entropyEnc:f.entropy&&f.entropyEnc||"utf8",nonce:this.n.toArray()}),u=this.n.byteLength(),g=this.n.sub(new c(2));;){var m=new c(d.generate(u));if(!(m.cmp(g)>0))return m.iaddn(1),this.keyFromPrivate(m)}},s.prototype._truncateToN=function(f,d){var u=8*f.byteLength()-this.n.bitLength();return u>0&&(f=f.ushrn(u)),!d&&f.cmp(this.n)>=0?f.sub(this.n):f},s.prototype.sign=function(f,d,u,g){typeof u=="object"&&(g=u,u=null),g||(g={}),d=this.keyFromPrivate(d,u),f=this._truncateToN(new c(f,16));for(var m=this.n.byteLength(),v=d.getPrivate().toArray("be",m),k=f.toArray("be",m),B=new i({hash:this.hash,entropy:v,nonce:k,pers:g.pers,persEnc:g.persEnc||"utf8"}),O=this.n.sub(new c(1)),L=0;;L++){var R=g.k?g.k(L):new c(B.generate(this.n.byteLength()));if(!((R=this._truncateToN(R,!0)).cmpn(1)<=0||R.cmp(O)>=0)){var P=this.g.mul(R);if(!P.isInfinity()){var j=P.getX(),z=j.umod(this.n);if(z.cmpn(0)!==0){var N=R.invm(this.n).mul(z.mul(d.getPrivate()).iadd(f));if((N=N.umod(this.n)).cmpn(0)!==0){var S=(P.getY().isOdd()?1:0)|(j.cmp(z)!==0?2:0);return g.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),S^=1),new o({r:z,s:N,recoveryParam:S})}}}}}},s.prototype.verify=function(f,d,u,g){f=this._truncateToN(new c(f,16)),u=this.keyFromPublic(u,g);var m=(d=new o(d,"hex")).r,v=d.s;if(m.cmpn(1)<0||m.cmp(this.n)>=0||v.cmpn(1)<0||v.cmp(this.n)>=0)return!1;var k,B=v.invm(this.n),O=B.mul(f).umod(this.n),L=B.mul(m).umod(this.n);return this.curve._maxwellTrick?!(k=this.g.jmulAdd(O,u.getPublic(),L)).isInfinity()&&k.eqXToP(m):!(k=this.g.mulAdd(O,u.getPublic(),L)).isInfinity()&&k.getX().umod(this.n).cmp(m)===0},s.prototype.recoverPubKey=function(f,d,u,g){n((3&u)===u,"The recovery param is more than two bits"),d=new o(d,g);var m=this.n,v=new c(f),k=d.r,B=d.s,O=1&u,L=u>>1;if(k.cmp(this.curve.p.umod(this.curve.n))>=0&&L)throw new Error("Unable to find sencond key candinate");k=L?this.curve.pointFromX(k.add(this.curve.n),O):this.curve.pointFromX(k,O);var R=d.r.invm(m),P=m.sub(v).mul(R).umod(m),j=B.mul(R).umod(m);return this.g.mulAdd(P,k,j)},s.prototype.getKeyRecoveryParam=function(f,d,u,g){if((d=new o(d,g)).recoveryParam!==null)return d.recoveryParam;for(var m=0;m<4;m++){var v;try{v=this.recoverPubKey(f,d,m)}catch{continue}if(v.eq(u))return m}throw new Error("Unable to find valid recovery factor")}},{"../curves":411,"../utils":419,"./key":413,"./signature":414,"bn.js":420,brorand:187,"hmac-drbg":438}],413:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("../utils").assert;function a(r,t){this.ec=r,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}p.exports=a,a.fromPublic=function(r,t,n){return t instanceof a?t:new a(r,{pub:t,pubEnc:n})},a.fromPrivate=function(r,t,n){return t instanceof a?t:new a(r,{priv:t,privEnc:n})},a.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(r,t){return typeof r=="string"&&(t=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,r):this.pub},a.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(r,t){this.priv=new c(r,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(r,t){if(r.x||r.y)return this.ec.curve.type==="mont"?i(r.x,"Need x coordinate"):this.ec.curve.type!=="short"&&this.ec.curve.type!=="edwards"||i(r.x&&r.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(r.x,r.y));this.pub=this.ec.curve.decodePoint(r,t)},a.prototype.derive=function(r){return r.validate()||i(r.validate(),"public point not validated"),r.mul(this.priv).getX()},a.prototype.sign=function(r,t,n){return this.ec.sign(r,this,t,n)},a.prototype.verify=function(r,t){return this.ec.verify(r,t,this)},a.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":419,"bn.js":420}],414:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("../utils"),a=i.assert;function r(s,f){if(s instanceof r)return s;this._importDER(s,f)||(a(s.r&&s.s,"Signature without r or s"),this.r=new c(s.r,16),this.s=new c(s.s,16),s.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=s.recoveryParam)}function t(){this.place=0}function n(s,f){var d=s[f.place++];if(!(128&d))return d;var u=15&d;if(u===0||u>4)return!1;for(var g=0,m=0,v=f.place;m<u;m++,v++)g<<=8,g|=s[v],g>>>=0;return!(g<=127)&&(f.place=v,g)}function l(s){for(var f=0,d=s.length-1;!s[f]&&!(128&s[f+1])&&f<d;)f++;return f===0?s:s.slice(f)}function o(s,f){if(f<128)s.push(f);else{var d=1+(Math.log(f)/Math.LN2>>>3);for(s.push(128|d);--d;)s.push(f>>>(d<<3)&255);s.push(f)}}p.exports=r,r.prototype._importDER=function(s,f){s=i.toArray(s,f);var d=new t;if(s[d.place++]!==48)return!1;var u=n(s,d);if(u===!1||u+d.place!==s.length||s[d.place++]!==2)return!1;var g=n(s,d);if(g===!1)return!1;var m=s.slice(d.place,g+d.place);if(d.place+=g,s[d.place++]!==2)return!1;var v=n(s,d);if(v===!1||s.length!==v+d.place)return!1;var k=s.slice(d.place,v+d.place);if(m[0]===0){if(!(128&m[1]))return!1;m=m.slice(1)}if(k[0]===0){if(!(128&k[1]))return!1;k=k.slice(1)}return this.r=new c(m),this.s=new c(k),this.recoveryParam=null,!0},r.prototype.toDER=function(s){var f=this.r.toArray(),d=this.s.toArray();for(128&f[0]&&(f=[0].concat(f)),128&d[0]&&(d=[0].concat(d)),f=l(f),d=l(d);!(d[0]||128&d[1]);)d=d.slice(1);var u=[2];o(u,f.length),(u=u.concat(f)).push(2),o(u,d.length);var g=u.concat(d),m=[48];return o(m,g.length),m=m.concat(g),i.encode(m,s)}},{"../utils":419,"bn.js":420}],415:[function(e,p,b){"use strict";var c=e("hash.js"),i=e("../curves"),a=e("../utils"),r=a.assert,t=a.parseBytes,n=e("./key"),l=e("./signature");function o(s){if(r(s==="ed25519","only tested with ed25519 so far"),!(this instanceof o))return new o(s);s=i[s].curve,this.curve=s,this.g=s.g,this.g.precompute(s.n.bitLength()+1),this.pointClass=s.point().constructor,this.encodingLength=Math.ceil(s.n.bitLength()/8),this.hash=c.sha512}p.exports=o,o.prototype.sign=function(s,f){s=t(s);var d=this.keyFromSecret(f),u=this.hashInt(d.messagePrefix(),s),g=this.g.mul(u),m=this.encodePoint(g),v=this.hashInt(m,d.pubBytes(),s).mul(d.priv()),k=u.add(v).umod(this.curve.n);return this.makeSignature({R:g,S:k,Rencoded:m})},o.prototype.verify=function(s,f,d){s=t(s),f=this.makeSignature(f);var u=this.keyFromPublic(d),g=this.hashInt(f.Rencoded(),u.pubBytes(),s),m=this.g.mul(f.S());return f.R().add(u.pub().mul(g)).eq(m)},o.prototype.hashInt=function(){for(var s=this.hash(),f=0;f<arguments.length;f++)s.update(arguments[f]);return a.intFromLE(s.digest()).umod(this.curve.n)},o.prototype.keyFromPublic=function(s){return n.fromPublic(this,s)},o.prototype.keyFromSecret=function(s){return n.fromSecret(this,s)},o.prototype.makeSignature=function(s){return s instanceof l?s:new l(this,s)},o.prototype.encodePoint=function(s){var f=s.getY().toArray("le",this.encodingLength);return f[this.encodingLength-1]|=s.getX().isOdd()?128:0,f},o.prototype.decodePoint=function(s){var f=(s=a.parseBytes(s)).length-1,d=s.slice(0,f).concat(-129&s[f]),u=(128&s[f])!=0,g=a.intFromLE(d);return this.curve.pointFromY(g,u)},o.prototype.encodeInt=function(s){return s.toArray("le",this.encodingLength)},o.prototype.decodeInt=function(s){return a.intFromLE(s)},o.prototype.isPoint=function(s){return s instanceof this.pointClass}},{"../curves":411,"../utils":419,"./key":416,"./signature":417,"hash.js":426}],416:[function(e,p,b){"use strict";var c=e("../utils"),i=c.assert,a=c.parseBytes,r=c.cachedProperty;function t(n,l){this.eddsa=n,this._secret=a(l.secret),n.isPoint(l.pub)?this._pub=l.pub:this._pubBytes=a(l.pub)}t.fromPublic=function(n,l){return l instanceof t?l:new t(n,{pub:l})},t.fromSecret=function(n,l){return l instanceof t?l:new t(n,{secret:l})},t.prototype.secret=function(){return this._secret},r(t,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),r(t,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),r(t,"privBytes",(function(){var n=this.eddsa,l=this.hash(),o=n.encodingLength-1,s=l.slice(0,n.encodingLength);return s[0]&=248,s[o]&=127,s[o]|=64,s})),r(t,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),r(t,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),r(t,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),t.prototype.sign=function(n){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(n,this)},t.prototype.verify=function(n,l){return this.eddsa.verify(n,l,this)},t.prototype.getSecret=function(n){return i(this._secret,"KeyPair is public only"),c.encode(this.secret(),n)},t.prototype.getPublic=function(n){return c.encode(this.pubBytes(),n)},p.exports=t},{"../utils":419}],417:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("../utils"),a=i.assert,r=i.cachedProperty,t=i.parseBytes;function n(l,o){this.eddsa=l,typeof o!="object"&&(o=t(o)),Array.isArray(o)&&(o={R:o.slice(0,l.encodingLength),S:o.slice(l.encodingLength)}),a(o.R&&o.S,"Signature without R or S"),l.isPoint(o.R)&&(this._R=o.R),o.S instanceof c&&(this._S=o.S),this._Rencoded=Array.isArray(o.R)?o.R:o.Rencoded,this._Sencoded=Array.isArray(o.S)?o.S:o.Sencoded}r(n,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),r(n,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),r(n,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),r(n,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},n.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},p.exports=n},{"../utils":419,"bn.js":420}],418:[function(e,p,b){"use strict";p.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],419:[function(e,p,b){"use strict";var c=b,i=e("bn.js"),a=e("minimalistic-assert"),r=e("minimalistic-crypto-utils");c.assert=a,c.toArray=r.toArray,c.zero2=r.zero2,c.toHex=r.toHex,c.encode=r.encode,c.getNAF=function(t,n,l){var o=new Array(Math.max(t.bitLength(),l)+1);o.fill(0);for(var s=1<<n+1,f=t.clone(),d=0;d<o.length;d++){var u,g=f.andln(s-1);f.isOdd()?(u=g>(s>>1)-1?(s>>1)-g:g,f.isubn(u)):u=0,o[d]=u,f.iushrn(1)}return o},c.getJSF=function(t,n){var l=[[],[]];t=t.clone(),n=n.clone();for(var o,s=0,f=0;t.cmpn(-s)>0||n.cmpn(-f)>0;){var d,u,g=t.andln(3)+s&3,m=n.andln(3)+f&3;g===3&&(g=-1),m===3&&(m=-1),d=(1&g)==0?0:(o=t.andln(7)+s&7)!==3&&o!==5||m!==2?g:-g,l[0].push(d),u=(1&m)==0?0:(o=n.andln(7)+f&7)!==3&&o!==5||g!==2?m:-m,l[1].push(u),2*s===d+1&&(s=1-s),2*f===u+1&&(f=1-f),t.iushrn(1),n.iushrn(1)}return l},c.cachedProperty=function(t,n,l){var o="_"+n;t.prototype[n]=function(){return this[o]!==void 0?this[o]:this[o]=l.call(this)}},c.parseBytes=function(t){return typeof t=="string"?c.toArray(t,"hex"):t},c.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":420,"minimalistic-assert":453,"minimalistic-crypto-utils":454}],420:[function(e,p,b){arguments[4][184][0].apply(b,arguments)},{buffer:188,dup:184}],421:[function(e,p,b){p.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}},{}],422:[function(e,p,b){"use strict";var c=Object.create||function(R){var P=function(){};return P.prototype=R,new P},i=Object.keys||function(R){var P=[];for(var j in R)Object.prototype.hasOwnProperty.call(R,j)&&P.push(j);return j},a=Function.prototype.bind||function(R){var P=this;return function(){return P.apply(R,arguments)}};function r(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=c(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}p.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0;var t,n=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),t=l.x===0}catch{t=!1}function o(R){return R._maxListeners===void 0?r.defaultMaxListeners:R._maxListeners}function s(R,P,j){if(P)R.call(j);else for(var z=R.length,N=L(R,z),S=0;S<z;++S)N[S].call(j)}function f(R,P,j,z){if(P)R.call(j,z);else for(var N=R.length,S=L(R,N),C=0;C<N;++C)S[C].call(j,z)}function d(R,P,j,z,N){if(P)R.call(j,z,N);else for(var S=R.length,C=L(R,S),E=0;E<S;++E)C[E].call(j,z,N)}function u(R,P,j,z,N,S){if(P)R.call(j,z,N,S);else for(var C=R.length,E=L(R,C),h=0;h<C;++h)E[h].call(j,z,N,S)}function g(R,P,j,z){if(P)R.apply(j,z);else for(var N=R.length,S=L(R,N),C=0;C<N;++C)S[C].apply(j,z)}function m(R,P,j,z){var N,S,C;if(typeof j!="function")throw new TypeError('"listener" argument must be a function');if((S=R._events)?(S.newListener&&(R.emit("newListener",P,j.listener?j.listener:j),S=R._events),C=S[P]):(S=R._events=c(null),R._eventsCount=0),C){if(typeof C=="function"?C=S[P]=z?[j,C]:[C,j]:z?C.unshift(j):C.push(j),!C.warned&&(N=o(R))&&N>0&&C.length>N){C.warned=!0;var E=new Error("Possible EventEmitter memory leak detected. "+C.length+' "'+String(P)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');E.name="MaxListenersExceededWarning",E.emitter=R,E.type=P,E.count=C.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",E.name,E.message)}}else C=S[P]=j,++R._eventsCount;return R}function v(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var R=new Array(arguments.length),P=0;P<R.length;++P)R[P]=arguments[P];this.listener.apply(this.target,R)}}function k(R,P,j){var z={fired:!1,wrapFn:void 0,target:R,type:P,listener:j},N=a.call(v,z);return N.listener=j,z.wrapFn=N,N}function B(R,P,j){var z=R._events;if(!z)return[];var N=z[P];return N?typeof N=="function"?j?[N.listener||N]:[N]:j?(function(S){for(var C=new Array(S.length),E=0;E<C.length;++E)C[E]=S[E].listener||S[E];return C})(N):L(N,N.length):[]}function O(R){var P=this._events;if(P){var j=P[R];if(typeof j=="function")return 1;if(j)return j.length}return 0}function L(R,P){for(var j=new Array(P),z=0;z<P;++z)j[z]=R[z];return j}t?Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(R){if(typeof R!="number"||R<0||R!=R)throw new TypeError('"defaultMaxListeners" must be a positive number');n=R}}):r.defaultMaxListeners=n,r.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||isNaN(R))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=R,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(R){var P,j,z,N,S,C,E=R==="error";if(C=this._events)E=E&&C.error==null;else if(!E)return!1;if(E){if(arguments.length>1&&(P=arguments[1]),P instanceof Error)throw P;var h=new Error('Unhandled "error" event. ('+P+")");throw h.context=P,h}if(!(j=C[R]))return!1;var y=typeof j=="function";switch(z=arguments.length){case 1:s(j,y,this);break;case 2:f(j,y,this,arguments[1]);break;case 3:d(j,y,this,arguments[1],arguments[2]);break;case 4:u(j,y,this,arguments[1],arguments[2],arguments[3]);break;default:for(N=new Array(z-1),S=1;S<z;S++)N[S-1]=arguments[S];g(j,y,this,N)}return!0},r.prototype.addListener=function(R,P){return m(this,R,P,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(R,P){return m(this,R,P,!0)},r.prototype.once=function(R,P){if(typeof P!="function")throw new TypeError('"listener" argument must be a function');return this.on(R,k(this,R,P)),this},r.prototype.prependOnceListener=function(R,P){if(typeof P!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(R,k(this,R,P)),this},r.prototype.removeListener=function(R,P){var j,z,N,S,C;if(typeof P!="function")throw new TypeError('"listener" argument must be a function');if(!(z=this._events))return this;if(!(j=z[R]))return this;if(j===P||j.listener===P)--this._eventsCount==0?this._events=c(null):(delete z[R],z.removeListener&&this.emit("removeListener",R,j.listener||P));else if(typeof j!="function"){for(N=-1,S=j.length-1;S>=0;S--)if(j[S]===P||j[S].listener===P){C=j[S].listener,N=S;break}if(N<0)return this;N===0?j.shift():(function(E,h){for(var y=h,w=y+1,x=E.length;w<x;y+=1,w+=1)E[y]=E[w];E.pop()})(j,N),j.length===1&&(z[R]=j[0]),z.removeListener&&this.emit("removeListener",R,C||P)}return this},r.prototype.removeAllListeners=function(R){var P,j,z;if(!(j=this._events))return this;if(!j.removeListener)return arguments.length===0?(this._events=c(null),this._eventsCount=0):j[R]&&(--this._eventsCount==0?this._events=c(null):delete j[R]),this;if(arguments.length===0){var N,S=i(j);for(z=0;z<S.length;++z)(N=S[z])!=="removeListener"&&this.removeAllListeners(N);return this.removeAllListeners("removeListener"),this._events=c(null),this._eventsCount=0,this}if(typeof(P=j[R])=="function")this.removeListener(R,P);else if(P)for(z=P.length-1;z>=0;z--)this.removeListener(R,P[z]);return this},r.prototype.listeners=function(R){return B(this,R,!0)},r.prototype.rawListeners=function(R){return B(this,R,!1)},r.listenerCount=function(R,P){return typeof R.listenerCount=="function"?R.listenerCount(P):O.call(R,P)},r.prototype.listenerCount=O,r.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],423:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("md5.js");p.exports=function(a,r,t,n){if(c.isBuffer(a)||(a=c.from(a,"binary")),r&&(c.isBuffer(r)||(r=c.from(r,"binary")),r.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var l=t/8,o=c.alloc(l),s=c.alloc(n||0),f=c.alloc(0);l>0||n>0;){var d=new i;d.update(f),d.update(a),r&&d.update(r),f=d.digest();var u=0;if(l>0){var g=o.length-l;u=Math.min(l,f.length),f.copy(o,g,0,u),l-=u}if(u<f.length&&n>0){var m=s.length-n,v=Math.min(n,f.length-u);f.copy(s,m,u,u+v),n-=v}}return f.fill(0),{key:o,iv:s}}},{"md5.js":450,"safe-buffer":494}],424:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CsvParserStream=b.ParserOptions=b.parseFile=b.parseStream=b.parseString=b.parse=b.FormatterOptions=b.CsvFormatterStream=b.writeToPath=b.writeToString=b.writeToBuffer=b.writeToStream=b.write=b.format=void 0;var c=e("@fast-csv/format");Object.defineProperty(b,"format",{enumerable:!0,get:function(){return c.format}}),Object.defineProperty(b,"write",{enumerable:!0,get:function(){return c.write}}),Object.defineProperty(b,"writeToStream",{enumerable:!0,get:function(){return c.writeToStream}}),Object.defineProperty(b,"writeToBuffer",{enumerable:!0,get:function(){return c.writeToBuffer}}),Object.defineProperty(b,"writeToString",{enumerable:!0,get:function(){return c.writeToString}}),Object.defineProperty(b,"writeToPath",{enumerable:!0,get:function(){return c.writeToPath}}),Object.defineProperty(b,"CsvFormatterStream",{enumerable:!0,get:function(){return c.CsvFormatterStream}}),Object.defineProperty(b,"FormatterOptions",{enumerable:!0,get:function(){return c.FormatterOptions}});var i=e("@fast-csv/parse");Object.defineProperty(b,"parse",{enumerable:!0,get:function(){return i.parse}}),Object.defineProperty(b,"parseString",{enumerable:!0,get:function(){return i.parseString}}),Object.defineProperty(b,"parseStream",{enumerable:!0,get:function(){return i.parseStream}}),Object.defineProperty(b,"parseFile",{enumerable:!0,get:function(){return i.parseFile}}),Object.defineProperty(b,"ParserOptions",{enumerable:!0,get:function(){return i.ParserOptions}}),Object.defineProperty(b,"CsvParserStream",{enumerable:!0,get:function(){return i.CsvParserStream}})},{"@fast-csv/format":151,"@fast-csv/parse":155}],425:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("readable-stream").Transform;function a(r){i.call(this),this._block=c.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(a,i),a.prototype._transform=function(r,t,n){var l=null;try{this.update(r,t)}catch(o){l=o}n(l)},a.prototype._flush=function(r){var t=null;try{this.push(this.digest())}catch(n){t=n}r(t)},a.prototype.update=function(r,t){if((function(d,u){if(!c.isBuffer(d)&&typeof d!="string")throw new TypeError(u+" must be a string or a buffer")})(r,"Data"),this._finalized)throw new Error("Digest already called");c.isBuffer(r)||(r=c.from(r,t));for(var n=this._block,l=0;this._blockOffset+r.length-l>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)n[o++]=r[l++];this._update(),this._blockOffset=0}for(;l<r.length;)n[this._blockOffset++]=r[l++];for(var s=0,f=8*r.length;f>0;++s)this._length[s]+=f,(f=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*f);return this},a.prototype._update=function(){throw new Error("_update is not implemented")},a.prototype.digest=function(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();r!==void 0&&(t=t.toString(r)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},a.prototype._digest=function(){throw new Error("_digest is not implemented")},p.exports=a},{inherits:440,"readable-stream":491,"safe-buffer":494}],426:[function(e,p,b){"use strict";var c=b;c.utils=e("./hash/utils"),c.common=e("./hash/common"),c.sha=e("./hash/sha"),c.ripemd=e("./hash/ripemd"),c.hmac=e("./hash/hmac"),c.sha1=c.sha.sha1,c.sha256=c.sha.sha256,c.sha224=c.sha.sha224,c.sha384=c.sha.sha384,c.sha512=c.sha.sha512,c.ripemd160=c.ripemd.ripemd160},{"./hash/common":427,"./hash/hmac":428,"./hash/ripemd":429,"./hash/sha":430,"./hash/utils":437}],427:[function(e,p,b){"use strict";var c=e("./utils"),i=e("minimalistic-assert");function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}b.BlockHash=a,a.prototype.update=function(r,t){if(r=c.toArray(r,t),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){var n=(r=this.pending).length%this._delta8;this.pending=r.slice(r.length-n,r.length),this.pending.length===0&&(this.pending=null),r=c.join32(r,0,r.length-n,this.endian);for(var l=0;l<r.length;l+=this._delta32)this._update(r,l,l+this._delta32)}return this},a.prototype.digest=function(r){return this.update(this._pad()),i(this.pending===null),this._digest(r)},a.prototype._pad=function(){var r=this.pendingTotal,t=this._delta8,n=t-(r+this.padLength)%t,l=new Array(n+this.padLength);l[0]=128;for(var o=1;o<n;o++)l[o]=0;if(r<<=3,this.endian==="big"){for(var s=8;s<this.padLength;s++)l[o++]=0;l[o++]=0,l[o++]=0,l[o++]=0,l[o++]=0,l[o++]=r>>>24&255,l[o++]=r>>>16&255,l[o++]=r>>>8&255,l[o++]=255&r}else for(l[o++]=255&r,l[o++]=r>>>8&255,l[o++]=r>>>16&255,l[o++]=r>>>24&255,l[o++]=0,l[o++]=0,l[o++]=0,l[o++]=0,s=8;s<this.padLength;s++)l[o++]=0;return l}},{"./utils":437,"minimalistic-assert":453}],428:[function(e,p,b){"use strict";var c=e("./utils"),i=e("minimalistic-assert");function a(r,t,n){if(!(this instanceof a))return new a(r,t,n);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(c.toArray(t,n))}p.exports=a,a.prototype._init=function(r){r.length>this.blockSize&&(r=new this.Hash().update(r).digest()),i(r.length<=this.blockSize);for(var t=r.length;t<this.blockSize;t++)r.push(0);for(t=0;t<r.length;t++)r[t]^=54;for(this.inner=new this.Hash().update(r),t=0;t<r.length;t++)r[t]^=106;this.outer=new this.Hash().update(r)},a.prototype.update=function(r,t){return this.inner.update(r,t),this},a.prototype.digest=function(r){return this.outer.update(this.inner.digest()),this.outer.digest(r)}},{"./utils":437,"minimalistic-assert":453}],429:[function(e,p,b){"use strict";var c=e("./utils"),i=e("./common"),a=c.rotl32,r=c.sum32,t=c.sum32_3,n=c.sum32_4,l=i.BlockHash;function o(){if(!(this instanceof o))return new o;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function s(k,B,O,L){return k<=15?B^O^L:k<=31?B&O|~B&L:k<=47?(B|~O)^L:k<=63?B&L|O&~L:B^(O|~L)}function f(k){return k<=15?0:k<=31?1518500249:k<=47?1859775393:k<=63?2400959708:2840853838}function d(k){return k<=15?1352829926:k<=31?1548603684:k<=47?1836072691:k<=63?2053994217:0}c.inherits(o,l),b.ripemd160=o,o.blockSize=512,o.outSize=160,o.hmacStrength=192,o.padLength=64,o.prototype._update=function(k,B){for(var O=this.h[0],L=this.h[1],R=this.h[2],P=this.h[3],j=this.h[4],z=O,N=L,S=R,C=P,E=j,h=0;h<80;h++){var y=r(a(n(O,s(h,L,R,P),k[u[h]+B],f(h)),m[h]),j);O=j,j=P,P=a(R,10),R=L,L=y,y=r(a(n(z,s(79-h,N,S,C),k[g[h]+B],d(h)),v[h]),E),z=E,E=C,C=a(S,10),S=N,N=y}y=t(this.h[1],R,C),this.h[1]=t(this.h[2],P,E),this.h[2]=t(this.h[3],j,z),this.h[3]=t(this.h[4],O,N),this.h[4]=t(this.h[0],L,S),this.h[0]=y},o.prototype._digest=function(k){return k==="hex"?c.toHex32(this.h,"little"):c.split32(this.h,"little")};var u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":427,"./utils":437}],430:[function(e,p,b){"use strict";b.sha1=e("./sha/1"),b.sha224=e("./sha/224"),b.sha256=e("./sha/256"),b.sha384=e("./sha/384"),b.sha512=e("./sha/512")},{"./sha/1":431,"./sha/224":432,"./sha/256":433,"./sha/384":434,"./sha/512":435}],431:[function(e,p,b){"use strict";var c=e("../utils"),i=e("../common"),a=e("./common"),r=c.rotl32,t=c.sum32,n=c.sum32_5,l=a.ft_1,o=i.BlockHash,s=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;o.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}c.inherits(f,o),p.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(d,u){for(var g=this.W,m=0;m<16;m++)g[m]=d[u+m];for(;m<g.length;m++)g[m]=r(g[m-3]^g[m-8]^g[m-14]^g[m-16],1);var v=this.h[0],k=this.h[1],B=this.h[2],O=this.h[3],L=this.h[4];for(m=0;m<g.length;m++){var R=~~(m/20),P=n(r(v,5),l(R,k,B,O),L,g[m],s[R]);L=O,O=B,B=r(k,30),k=v,v=P}this.h[0]=t(this.h[0],v),this.h[1]=t(this.h[1],k),this.h[2]=t(this.h[2],B),this.h[3]=t(this.h[3],O),this.h[4]=t(this.h[4],L)},f.prototype._digest=function(d){return d==="hex"?c.toHex32(this.h,"big"):c.split32(this.h,"big")}},{"../common":427,"../utils":437,"./common":436}],432:[function(e,p,b){"use strict";var c=e("../utils"),i=e("./256");function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}c.inherits(a,i),p.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(r){return r==="hex"?c.toHex32(this.h.slice(0,7),"big"):c.split32(this.h.slice(0,7),"big")}},{"../utils":437,"./256":433}],433:[function(e,p,b){"use strict";var c=e("../utils"),i=e("../common"),a=e("./common"),r=e("minimalistic-assert"),t=c.sum32,n=c.sum32_4,l=c.sum32_5,o=a.ch32,s=a.maj32,f=a.s0_256,d=a.s1_256,u=a.g0_256,g=a.g1_256,m=i.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function k(){if(!(this instanceof k))return new k;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}c.inherits(k,m),p.exports=k,k.blockSize=512,k.outSize=256,k.hmacStrength=192,k.padLength=64,k.prototype._update=function(B,O){for(var L=this.W,R=0;R<16;R++)L[R]=B[O+R];for(;R<L.length;R++)L[R]=n(g(L[R-2]),L[R-7],u(L[R-15]),L[R-16]);var P=this.h[0],j=this.h[1],z=this.h[2],N=this.h[3],S=this.h[4],C=this.h[5],E=this.h[6],h=this.h[7];for(r(this.k.length===L.length),R=0;R<L.length;R++){var y=l(h,d(S),o(S,C,E),this.k[R],L[R]),w=t(f(P),s(P,j,z));h=E,E=C,C=S,S=t(N,y),N=z,z=j,j=P,P=t(y,w)}this.h[0]=t(this.h[0],P),this.h[1]=t(this.h[1],j),this.h[2]=t(this.h[2],z),this.h[3]=t(this.h[3],N),this.h[4]=t(this.h[4],S),this.h[5]=t(this.h[5],C),this.h[6]=t(this.h[6],E),this.h[7]=t(this.h[7],h)},k.prototype._digest=function(B){return B==="hex"?c.toHex32(this.h,"big"):c.split32(this.h,"big")}},{"../common":427,"../utils":437,"./common":436,"minimalistic-assert":453}],434:[function(e,p,b){"use strict";var c=e("../utils"),i=e("./512");function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}c.inherits(a,i),p.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(r){return r==="hex"?c.toHex32(this.h.slice(0,12),"big"):c.split32(this.h.slice(0,12),"big")}},{"../utils":437,"./512":435}],435:[function(e,p,b){"use strict";var c=e("../utils"),i=e("../common"),a=e("minimalistic-assert"),r=c.rotr64_hi,t=c.rotr64_lo,n=c.shr64_hi,l=c.shr64_lo,o=c.sum64,s=c.sum64_hi,f=c.sum64_lo,d=c.sum64_4_hi,u=c.sum64_4_lo,g=c.sum64_5_hi,m=c.sum64_5_lo,v=i.BlockHash,k=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function B(){if(!(this instanceof B))return new B;v.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=k,this.W=new Array(160)}function O(w,x,_,T,D){var q=w&_^~w&D;return q<0&&(q+=4294967296),q}function L(w,x,_,T,D,q){var $=x&T^~x&q;return $<0&&($+=4294967296),$}function R(w,x,_,T,D){var q=w&_^w&D^_&D;return q<0&&(q+=4294967296),q}function P(w,x,_,T,D,q){var $=x&T^x&q^T&q;return $<0&&($+=4294967296),$}function j(w,x){var _=r(w,x,28)^r(x,w,2)^r(x,w,7);return _<0&&(_+=4294967296),_}function z(w,x){var _=t(w,x,28)^t(x,w,2)^t(x,w,7);return _<0&&(_+=4294967296),_}function N(w,x){var _=r(w,x,14)^r(w,x,18)^r(x,w,9);return _<0&&(_+=4294967296),_}function S(w,x){var _=t(w,x,14)^t(w,x,18)^t(x,w,9);return _<0&&(_+=4294967296),_}function C(w,x){var _=r(w,x,1)^r(w,x,8)^n(w,x,7);return _<0&&(_+=4294967296),_}function E(w,x){var _=t(w,x,1)^t(w,x,8)^l(w,x,7);return _<0&&(_+=4294967296),_}function h(w,x){var _=r(w,x,19)^r(x,w,29)^n(w,x,6);return _<0&&(_+=4294967296),_}function y(w,x){var _=t(w,x,19)^t(x,w,29)^l(w,x,6);return _<0&&(_+=4294967296),_}c.inherits(B,v),p.exports=B,B.blockSize=1024,B.outSize=512,B.hmacStrength=192,B.padLength=128,B.prototype._prepareBlock=function(w,x){for(var _=this.W,T=0;T<32;T++)_[T]=w[x+T];for(;T<_.length;T+=2){var D=h(_[T-4],_[T-3]),q=y(_[T-4],_[T-3]),$=_[T-14],W=_[T-13],A=C(_[T-30],_[T-29]),H=E(_[T-30],_[T-29]),M=_[T-32],I=_[T-31];_[T]=d(D,q,$,W,A,H,M,I),_[T+1]=u(D,q,$,W,A,H,M,I)}},B.prototype._update=function(w,x){this._prepareBlock(w,x);var _=this.W,T=this.h[0],D=this.h[1],q=this.h[2],$=this.h[3],W=this.h[4],A=this.h[5],H=this.h[6],M=this.h[7],I=this.h[8],F=this.h[9],U=this.h[10],X=this.h[11],V=this.h[12],G=this.h[13],ee=this.h[14],Z=this.h[15];a(this.k.length===_.length);for(var K=0;K<_.length;K+=2){var Q=ee,J=Z,ne=N(I,F),ie=S(I,F),le=O(I,F,U,X,V),re=L(I,F,U,X,V,G),se=this.k[K],be=this.k[K+1],ye=_[K],Fe=_[K+1],Ce=g(Q,J,ne,ie,le,re,se,be,ye,Fe),ae=m(Q,J,ne,ie,le,re,se,be,ye,Fe);Q=j(T,D),J=z(T,D),ne=R(T,D,q,$,W),ie=P(T,D,q,$,W,A);var De=s(Q,J,ne,ie),Be=f(Q,J,ne,ie);ee=V,Z=G,V=U,G=X,U=I,X=F,I=s(H,M,Ce,ae),F=f(M,M,Ce,ae),H=W,M=A,W=q,A=$,q=T,$=D,T=s(Ce,ae,De,Be),D=f(Ce,ae,De,Be)}o(this.h,0,T,D),o(this.h,2,q,$),o(this.h,4,W,A),o(this.h,6,H,M),o(this.h,8,I,F),o(this.h,10,U,X),o(this.h,12,V,G),o(this.h,14,ee,Z)},B.prototype._digest=function(w){return w==="hex"?c.toHex32(this.h,"big"):c.split32(this.h,"big")}},{"../common":427,"../utils":437,"minimalistic-assert":453}],436:[function(e,p,b){"use strict";var c=e("../utils").rotr32;function i(t,n,l){return t&n^~t&l}function a(t,n,l){return t&n^t&l^n&l}function r(t,n,l){return t^n^l}b.ft_1=function(t,n,l,o){return t===0?i(n,l,o):t===1||t===3?r(n,l,o):t===2?a(n,l,o):void 0},b.ch32=i,b.maj32=a,b.p32=r,b.s0_256=function(t){return c(t,2)^c(t,13)^c(t,22)},b.s1_256=function(t){return c(t,6)^c(t,11)^c(t,25)},b.g0_256=function(t){return c(t,7)^c(t,18)^t>>>3},b.g1_256=function(t){return c(t,17)^c(t,19)^t>>>10}},{"../utils":437}],437:[function(e,p,b){"use strict";var c=e("minimalistic-assert"),i=e("inherits");function a(l,o){return(64512&l.charCodeAt(o))==55296&&!(o<0||o+1>=l.length)&&(64512&l.charCodeAt(o+1))==56320}function r(l){return(l>>>24|l>>>8&65280|l<<8&16711680|(255&l)<<24)>>>0}function t(l){return l.length===1?"0"+l:l}function n(l){return l.length===7?"0"+l:l.length===6?"00"+l:l.length===5?"000"+l:l.length===4?"0000"+l:l.length===3?"00000"+l:l.length===2?"000000"+l:l.length===1?"0000000"+l:l}b.inherits=i,b.toArray=function(l,o){if(Array.isArray(l))return l.slice();if(!l)return[];var s=[];if(typeof l=="string")if(o){if(o==="hex")for((l=l.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(l="0"+l),d=0;d<l.length;d+=2)s.push(parseInt(l[d]+l[d+1],16))}else for(var f=0,d=0;d<l.length;d++){var u=l.charCodeAt(d);u<128?s[f++]=u:u<2048?(s[f++]=u>>6|192,s[f++]=63&u|128):a(l,d)?(u=65536+((1023&u)<<10)+(1023&l.charCodeAt(++d)),s[f++]=u>>18|240,s[f++]=u>>12&63|128,s[f++]=u>>6&63|128,s[f++]=63&u|128):(s[f++]=u>>12|224,s[f++]=u>>6&63|128,s[f++]=63&u|128)}else for(d=0;d<l.length;d++)s[d]=0|l[d];return s},b.toHex=function(l){for(var o="",s=0;s<l.length;s++)o+=t(l[s].toString(16));return o},b.htonl=r,b.toHex32=function(l,o){for(var s="",f=0;f<l.length;f++){var d=l[f];o==="little"&&(d=r(d)),s+=n(d.toString(16))}return s},b.zero2=t,b.zero8=n,b.join32=function(l,o,s,f){var d=s-o;c(d%4==0);for(var u=new Array(d/4),g=0,m=o;g<u.length;g++,m+=4){var v;v=f==="big"?l[m]<<24|l[m+1]<<16|l[m+2]<<8|l[m+3]:l[m+3]<<24|l[m+2]<<16|l[m+1]<<8|l[m],u[g]=v>>>0}return u},b.split32=function(l,o){for(var s=new Array(4*l.length),f=0,d=0;f<l.length;f++,d+=4){var u=l[f];o==="big"?(s[d]=u>>>24,s[d+1]=u>>>16&255,s[d+2]=u>>>8&255,s[d+3]=255&u):(s[d+3]=u>>>24,s[d+2]=u>>>16&255,s[d+1]=u>>>8&255,s[d]=255&u)}return s},b.rotr32=function(l,o){return l>>>o|l<<32-o},b.rotl32=function(l,o){return l<<o|l>>>32-o},b.sum32=function(l,o){return l+o>>>0},b.sum32_3=function(l,o,s){return l+o+s>>>0},b.sum32_4=function(l,o,s,f){return l+o+s+f>>>0},b.sum32_5=function(l,o,s,f,d){return l+o+s+f+d>>>0},b.sum64=function(l,o,s,f){var d=l[o],u=f+l[o+1]>>>0,g=(u<f?1:0)+s+d;l[o]=g>>>0,l[o+1]=u},b.sum64_hi=function(l,o,s,f){return(o+f>>>0<o?1:0)+l+s>>>0},b.sum64_lo=function(l,o,s,f){return o+f>>>0},b.sum64_4_hi=function(l,o,s,f,d,u,g,m){var v=0,k=o;return v+=(k=k+f>>>0)<o?1:0,v+=(k=k+u>>>0)<u?1:0,l+s+d+g+(v+=(k=k+m>>>0)<m?1:0)>>>0},b.sum64_4_lo=function(l,o,s,f,d,u,g,m){return o+f+u+m>>>0},b.sum64_5_hi=function(l,o,s,f,d,u,g,m,v,k){var B=0,O=o;return B+=(O=O+f>>>0)<o?1:0,B+=(O=O+u>>>0)<u?1:0,B+=(O=O+m>>>0)<m?1:0,l+s+d+g+v+(B+=(O=O+k>>>0)<k?1:0)>>>0},b.sum64_5_lo=function(l,o,s,f,d,u,g,m,v,k){return o+f+u+m+k>>>0},b.rotr64_hi=function(l,o,s){return(o<<32-s|l>>>s)>>>0},b.rotr64_lo=function(l,o,s){return(l<<32-s|o>>>s)>>>0},b.shr64_hi=function(l,o,s){return l>>>s},b.shr64_lo=function(l,o,s){return(l<<32-s|o>>>s)>>>0}},{inherits:440,"minimalistic-assert":453}],438:[function(e,p,b){"use strict";var c=e("hash.js"),i=e("minimalistic-crypto-utils"),a=e("minimalistic-assert");function r(t){if(!(this instanceof r))return new r(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=i.toArray(t.entropy,t.entropyEnc||"hex"),l=i.toArray(t.nonce,t.nonceEnc||"hex"),o=i.toArray(t.pers,t.persEnc||"hex");a(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,l,o)}p.exports=r,r.prototype._init=function(t,n,l){var o=t.concat(n).concat(l);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(o),this._reseed=1,this.reseedInterval=281474976710656},r.prototype._hmac=function(){return new c.hmac(this.hash,this.K)},r.prototype._update=function(t){var n=this._hmac().update(this.V).update([0]);t&&(n=n.update(t)),this.K=n.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},r.prototype.reseed=function(t,n,l,o){typeof n!="string"&&(o=l,l=n,n=null),t=i.toArray(t,n),l=i.toArray(l,o),a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(l||[])),this._reseed=1},r.prototype.generate=function(t,n,l,o){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof n!="string"&&(o=l,l=n,n=null),l&&(l=i.toArray(l,o||"hex"),this._update(l));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var f=s.slice(0,t);return this._update(l),this._reseed++,i.encode(f,n)}},{"hash.js":426,"minimalistic-assert":453,"minimalistic-crypto-utils":454}],439:[function(e,p,b){"use strict";b.read=function(c,i,a,r,t){var n,l,o=8*t-r-1,s=(1<<o)-1,f=s>>1,d=-7,u=a?t-1:0,g=a?-1:1,m=c[i+u];for(u+=g,n=m&(1<<-d)-1,m>>=-d,d+=o;d>0;n=256*n+c[i+u],u+=g,d-=8);for(l=n&(1<<-d)-1,n>>=-d,d+=r;d>0;l=256*l+c[i+u],u+=g,d-=8);if(n===0)n=1-f;else{if(n===s)return l?NaN:1/0*(m?-1:1);l+=Math.pow(2,r),n-=f}return(m?-1:1)*l*Math.pow(2,n-r)},b.write=function(c,i,a,r,t,n){var l,o,s,f=8*n-t-1,d=(1<<f)-1,u=d>>1,g=t===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:n-1,v=r?1:-1,k=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(o=isNaN(i)?1:0,l=d):(l=Math.floor(Math.log(i)/Math.LN2),i*(s=Math.pow(2,-l))<1&&(l--,s*=2),(i+=l+u>=1?g/s:g*Math.pow(2,1-u))*s>=2&&(l++,s/=2),l+u>=d?(o=0,l=d):l+u>=1?(o=(i*s-1)*Math.pow(2,t),l+=u):(o=i*Math.pow(2,u-1)*Math.pow(2,t),l=0));t>=8;c[a+m]=255&o,m+=v,o/=256,t-=8);for(l=l<<t|o,f+=t;f>0;c[a+m]=255&l,m+=v,l/=256,f-=8);c[a+m-v]|=128*k}},{}],440:[function(e,p,b){"use strict";typeof Object.create=="function"?p.exports=function(c,i){i&&(c.super_=i,c.prototype=Object.create(i.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:p.exports=function(c,i){if(i){c.super_=i;var a=function(){};a.prototype=i.prototype,c.prototype=new a,c.prototype.constructor=c}}},{}],441:[function(e,p,b){(function(c,i,a,r,t,n,l,o){(function(){"use strict";(function(s){typeof b=="object"&&p!==void 0?p.exports=s():(typeof window<"u"?window:i!==void 0?i:typeof self<"u"?self:this).JSZip=s()})((function(){return(function s(f,d,u){function g(k,B){if(!d[k]){if(!f[k]){var O=typeof e=="function"&&e;if(!B&&O)return O(k,!0);if(m)return m(k,!0);var L=new Error("Cannot find module '"+k+"'");throw L.code="MODULE_NOT_FOUND",L}var R=d[k]={exports:{}};f[k][0].call(R.exports,(function(P){return g(f[k][1][P]||P)}),R,R.exports,s,f,d,u)}return d[k].exports}for(var m=typeof e=="function"&&e,v=0;v<u.length;v++)g(u[v]);return g})({1:[function(s,f,d){var u=s("./utils"),g=s("./support"),m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";d.encode=function(v){for(var k,B,O,L,R,P,j,z=[],N=0,S=v.length,C=S,E=u.getTypeOf(v)!=="string";N<v.length;)C=S-N,O=E?(k=v[N++],B=N<S?v[N++]:0,N<S?v[N++]:0):(k=v.charCodeAt(N++),B=N<S?v.charCodeAt(N++):0,N<S?v.charCodeAt(N++):0),L=k>>2,R=(3&k)<<4|B>>4,P=1<C?(15&B)<<2|O>>6:64,j=2<C?63&O:64,z.push(m.charAt(L)+m.charAt(R)+m.charAt(P)+m.charAt(j));return z.join("")},d.decode=function(v){var k,B,O,L,R,P,j=0,z=0,N="data:";if(v.substr(0,N.length)===N)throw new Error("Invalid base64 input, it looks like a data url.");var S,C=3*(v=v.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(v.charAt(v.length-1)===m.charAt(64)&&C--,v.charAt(v.length-2)===m.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(S=g.uint8array?new Uint8Array(0|C):new Array(0|C);j<v.length;)k=m.indexOf(v.charAt(j++))<<2|(L=m.indexOf(v.charAt(j++)))>>4,B=(15&L)<<4|(R=m.indexOf(v.charAt(j++)))>>2,O=(3&R)<<6|(P=m.indexOf(v.charAt(j++))),S[z++]=k,R!==64&&(S[z++]=B),P!==64&&(S[z++]=O);return S}},{"./support":30,"./utils":32}],2:[function(s,f,d){var u=s("./external"),g=s("./stream/DataWorker"),m=s("./stream/Crc32Probe"),v=s("./stream/DataLengthProbe");function k(B,O,L,R,P){this.compressedSize=B,this.uncompressedSize=O,this.crc32=L,this.compression=R,this.compressedContent=P}k.prototype={getContentWorker:function(){var B=new g(u.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new v("data_length")),O=this;return B.on("end",(function(){if(this.streamInfo.data_length!==O.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),B},getCompressedWorker:function(){return new g(u.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},k.createWorkerFrom=function(B,O,L){return B.pipe(new m).pipe(new v("uncompressedSize")).pipe(O.compressWorker(L)).pipe(new v("compressedSize")).withStreamInfo("compression",O)},f.exports=k},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(s,f,d){var u=s("./stream/GenericWorker");d.STORE={magic:"\0\0",compressWorker:function(){return new u("STORE compression")},uncompressWorker:function(){return new u("STORE decompression")}},d.DEFLATE=s("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(s,f,d){var u=s("./utils"),g=(function(){for(var m,v=[],k=0;k<256;k++){m=k;for(var B=0;B<8;B++)m=1&m?3988292384^m>>>1:m>>>1;v[k]=m}return v})();f.exports=function(m,v){return m!==void 0&&m.length?u.getTypeOf(m)!=="string"?(function(k,B,O,L){var R=g,P=0+O;k^=-1;for(var j=0;j<P;j++)k=k>>>8^R[255&(k^B[j])];return-1^k})(0|v,m,m.length):(function(k,B,O,L){var R=g,P=0+O;k^=-1;for(var j=0;j<P;j++)k=k>>>8^R[255&(k^B.charCodeAt(j))];return-1^k})(0|v,m,m.length):0}},{"./utils":32}],5:[function(s,f,d){d.base64=!1,d.binary=!1,d.dir=!1,d.createFolders=!0,d.date=null,d.compression=null,d.compressionOptions=null,d.comment=null,d.unixPermissions=null,d.dosPermissions=null},{}],6:[function(s,f,d){var u;u=typeof Promise<"u"?Promise:s("lie"),f.exports={Promise:u}},{lie:37}],7:[function(s,f,d){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",g=s("pako"),m=s("./utils"),v=s("./stream/GenericWorker"),k=u?"uint8array":"array";function B(O,L){v.call(this,"FlateWorker/"+O),this._pako=null,this._pakoAction=O,this._pakoOptions=L,this.meta={}}d.magic="\b\0",m.inherits(B,v),B.prototype.processChunk=function(O){this.meta=O.meta,this._pako===null&&this._createPako(),this._pako.push(m.transformTo(k,O.data),!1)},B.prototype.flush=function(){v.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},B.prototype.cleanUp=function(){v.prototype.cleanUp.call(this),this._pako=null},B.prototype._createPako=function(){this._pako=new g[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var O=this;this._pako.onData=function(L){O.push({data:L,meta:O.meta})}},d.compressWorker=function(O){return new B("Deflate",O)},d.uncompressWorker=function(){return new B("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(s,f,d){function u(R,P){var j,z="";for(j=0;j<P;j++)z+=String.fromCharCode(255&R),R>>>=8;return z}function g(R,P,j,z,N,S){var C,E,h=R.file,y=R.compression,w=S!==k.utf8encode,x=m.transformTo("string",S(h.name)),_=m.transformTo("string",k.utf8encode(h.name)),T=h.comment,D=m.transformTo("string",S(T)),q=m.transformTo("string",k.utf8encode(T)),$=_.length!==h.name.length,W=q.length!==T.length,A="",H="",M="",I=h.dir,F=h.date,U={crc32:0,compressedSize:0,uncompressedSize:0};P&&!j||(U.crc32=R.crc32,U.compressedSize=R.compressedSize,U.uncompressedSize=R.uncompressedSize);var X=0;P&&(X|=8),w||!$&&!W||(X|=2048);var V=0,G=0;I&&(V|=16),N==="UNIX"?(G=798,V|=(function(Z,K){var Q=Z;return Z||(Q=K?16893:33204),(65535&Q)<<16})(h.unixPermissions,I)):(G=20,V|=(function(Z){return 63&(Z||0)})(h.dosPermissions)),C=F.getUTCHours(),C<<=6,C|=F.getUTCMinutes(),C<<=5,C|=F.getUTCSeconds()/2,E=F.getUTCFullYear()-1980,E<<=4,E|=F.getUTCMonth()+1,E<<=5,E|=F.getUTCDate(),$&&(H=u(1,1)+u(B(x),4)+_,A+="up"+u(H.length,2)+H),W&&(M=u(1,1)+u(B(D),4)+q,A+="uc"+u(M.length,2)+M);var ee="";return ee+=`
10
+ \0`,ee+=u(X,2),ee+=y.magic,ee+=u(C,2),ee+=u(E,2),ee+=u(U.crc32,4),ee+=u(U.compressedSize,4),ee+=u(U.uncompressedSize,4),ee+=u(x.length,2),ee+=u(A.length,2),{fileRecord:O.LOCAL_FILE_HEADER+ee+x+A,dirRecord:O.CENTRAL_FILE_HEADER+u(G,2)+ee+u(D.length,2)+"\0\0\0\0"+u(V,4)+u(z,4)+x+A+D}}var m=s("../utils"),v=s("../stream/GenericWorker"),k=s("../utf8"),B=s("../crc32"),O=s("../signature");function L(R,P,j,z){v.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=P,this.zipPlatform=j,this.encodeFileName=z,this.streamFiles=R,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}m.inherits(L,v),L.prototype.push=function(R){var P=R.meta.percent||0,j=this.entriesCount,z=this._sources.length;this.accumulate?this.contentBuffer.push(R):(this.bytesWritten+=R.data.length,v.prototype.push.call(this,{data:R.data,meta:{currentFile:this.currentFile,percent:j?(P+100*(j-z-1))/j:100}}))},L.prototype.openedSource=function(R){this.currentSourceOffset=this.bytesWritten,this.currentFile=R.file.name;var P=this.streamFiles&&!R.file.dir;if(P){var j=g(R,P,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:j.fileRecord,meta:{percent:0}})}else this.accumulate=!0},L.prototype.closedSource=function(R){this.accumulate=!1;var P=this.streamFiles&&!R.file.dir,j=g(R,P,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(j.dirRecord),P)this.push({data:(function(z){return O.DATA_DESCRIPTOR+u(z.crc32,4)+u(z.compressedSize,4)+u(z.uncompressedSize,4)})(R),meta:{percent:100}});else for(this.push({data:j.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},L.prototype.flush=function(){for(var R=this.bytesWritten,P=0;P<this.dirRecords.length;P++)this.push({data:this.dirRecords[P],meta:{percent:100}});var j=this.bytesWritten-R,z=(function(N,S,C,E,h){var y=m.transformTo("string",h(E));return O.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(N,2)+u(N,2)+u(S,4)+u(C,4)+u(y.length,2)+y})(this.dirRecords.length,j,R,this.zipComment,this.encodeFileName);this.push({data:z,meta:{percent:100}})},L.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},L.prototype.registerPrevious=function(R){this._sources.push(R);var P=this;return R.on("data",(function(j){P.processChunk(j)})),R.on("end",(function(){P.closedSource(P.previous.streamInfo),P._sources.length?P.prepareNextSource():P.end()})),R.on("error",(function(j){P.error(j)})),this},L.prototype.resume=function(){return!!v.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},L.prototype.error=function(R){var P=this._sources;if(!v.prototype.error.call(this,R))return!1;for(var j=0;j<P.length;j++)try{P[j].error(R)}catch{}return!0},L.prototype.lock=function(){v.prototype.lock.call(this);for(var R=this._sources,P=0;P<R.length;P++)R[P].lock()},f.exports=L},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(s,f,d){var u=s("../compressions"),g=s("./ZipFileWorker");d.generateWorker=function(m,v,k){var B=new g(v.streamFiles,k,v.platform,v.encodeFileName),O=0;try{m.forEach((function(L,R){O++;var P=(function(S,C){var E=S||C,h=u[E];if(!h)throw new Error(E+" is not a valid compression method !");return h})(R.options.compression,v.compression),j=R.options.compressionOptions||v.compressionOptions||{},z=R.dir,N=R.date;R._compressWorker(P,j).withStreamInfo("file",{name:L,dir:z,date:N,comment:R.comment||"",unixPermissions:R.unixPermissions,dosPermissions:R.dosPermissions}).pipe(B)})),B.entriesCount=O}catch(L){B.error(L)}return B}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(s,f,d){function u(){if(!(this instanceof u))return new u;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var g=new u;for(var m in this)typeof this[m]!="function"&&(g[m]=this[m]);return g}}(u.prototype=s("./object")).loadAsync=s("./load"),u.support=s("./support"),u.defaults=s("./defaults"),u.version="3.10.1",u.loadAsync=function(g,m){return new u().loadAsync(g,m)},u.external=s("./external"),f.exports=u},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(s,f,d){var u=s("./utils"),g=s("./external"),m=s("./utf8"),v=s("./zipEntries"),k=s("./stream/Crc32Probe"),B=s("./nodejsUtils");function O(L){return new g.Promise((function(R,P){var j=L.decompressed.getContentWorker().pipe(new k);j.on("error",(function(z){P(z)})).on("end",(function(){j.streamInfo.crc32!==L.decompressed.crc32?P(new Error("Corrupted zip : CRC32 mismatch")):R()})).resume()}))}f.exports=function(L,R){var P=this;return R=u.extend(R||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:m.utf8decode}),B.isNode&&B.isStream(L)?g.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):u.prepareContent("the loaded zip file",L,!0,R.optimizedBinaryString,R.base64).then((function(j){var z=new v(R);return z.load(j),z})).then((function(j){var z=[g.Promise.resolve(j)],N=j.files;if(R.checkCRC32)for(var S=0;S<N.length;S++)z.push(O(N[S]));return g.Promise.all(z)})).then((function(j){for(var z=j.shift(),N=z.files,S=0;S<N.length;S++){var C=N[S],E=C.fileNameStr,h=u.resolve(C.fileNameStr);P.file(h,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:R.createFolders}),C.dir||(P.file(h).unsafeOriginalName=E)}return z.zipComment.length&&(P.comment=z.zipComment),P}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(s,f,d){var u=s("../utils"),g=s("../stream/GenericWorker");function m(v,k){g.call(this,"Nodejs stream input adapter for "+v),this._upstreamEnded=!1,this._bindStream(k)}u.inherits(m,g),m.prototype._bindStream=function(v){var k=this;(this._stream=v).pause(),v.on("data",(function(B){k.push({data:B,meta:{percent:0}})})).on("error",(function(B){k.isPaused?this.generatedError=B:k.error(B)})).on("end",(function(){k.isPaused?k._upstreamEnded=!0:k.end()}))},m.prototype.pause=function(){return!!g.prototype.pause.call(this)&&(this._stream.pause(),!0)},m.prototype.resume=function(){return!!g.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},f.exports=m},{"../stream/GenericWorker":28,"../utils":32}],13:[function(s,f,d){var u=s("readable-stream").Readable;function g(m,v,k){u.call(this,v),this._helper=m;var B=this;m.on("data",(function(O,L){B.push(O)||B._helper.pause(),k&&k(L)})).on("error",(function(O){B.emit("error",O)})).on("end",(function(){B.push(null)}))}s("../utils").inherits(g,u),g.prototype._read=function(){this._helper.resume()},f.exports=g},{"../utils":32,"readable-stream":16}],14:[function(s,f,d){f.exports={isNode:a!==void 0,newBufferFrom:function(u,g){if(a.from&&a.from!==Uint8Array.from)return a.from(u,g);if(typeof u=="number")throw new Error('The "data" argument must not be a number');return new a(u,g)},allocBuffer:function(u){if(a.alloc)return a.alloc(u);var g=new a(u);return g.fill(0),g},isBuffer:function(u){return a.isBuffer(u)},isStream:function(u){return u&&typeof u.on=="function"&&typeof u.pause=="function"&&typeof u.resume=="function"}}},{}],15:[function(s,f,d){function u(h,y,w){var x,_=m.getTypeOf(y),T=m.extend(w||{},B);T.date=T.date||new Date,T.compression!==null&&(T.compression=T.compression.toUpperCase()),typeof T.unixPermissions=="string"&&(T.unixPermissions=parseInt(T.unixPermissions,8)),T.unixPermissions&&16384&T.unixPermissions&&(T.dir=!0),T.dosPermissions&&16&T.dosPermissions&&(T.dir=!0),T.dir&&(h=N(h)),T.createFolders&&(x=z(h))&&S.call(this,x,!0);var D=_==="string"&&T.binary===!1&&T.base64===!1;w&&w.binary!==void 0||(T.binary=!D),(y instanceof O&&y.uncompressedSize===0||T.dir||!y||y.length===0)&&(T.base64=!1,T.binary=!0,y="",T.compression="STORE",_="string");var q;q=y instanceof O||y instanceof v?y:P.isNode&&P.isStream(y)?new j(h,y):m.prepareContent(h,y,T.binary,T.optimizedBinaryString,T.base64);var $=new L(h,q,T);this.files[h]=$}var g=s("./utf8"),m=s("./utils"),v=s("./stream/GenericWorker"),k=s("./stream/StreamHelper"),B=s("./defaults"),O=s("./compressedObject"),L=s("./zipObject"),R=s("./generate"),P=s("./nodejsUtils"),j=s("./nodejs/NodejsStreamInputAdapter"),z=function(h){h.slice(-1)==="/"&&(h=h.substring(0,h.length-1));var y=h.lastIndexOf("/");return 0<y?h.substring(0,y):""},N=function(h){return h.slice(-1)!=="/"&&(h+="/"),h},S=function(h,y){return y=y!==void 0?y:B.createFolders,h=N(h),this.files[h]||u.call(this,h,null,{dir:!0,createFolders:y}),this.files[h]};function C(h){return Object.prototype.toString.call(h)==="[object RegExp]"}var E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(h){var y,w,x;for(y in this.files)x=this.files[y],(w=y.slice(this.root.length,y.length))&&y.slice(0,this.root.length)===this.root&&h(w,x)},filter:function(h){var y=[];return this.forEach((function(w,x){h(w,x)&&y.push(x)})),y},file:function(h,y,w){if(arguments.length!==1)return h=this.root+h,u.call(this,h,y,w),this;if(C(h)){var x=h;return this.filter((function(T,D){return!D.dir&&x.test(T)}))}var _=this.files[this.root+h];return _&&!_.dir?_:null},folder:function(h){if(!h)return this;if(C(h))return this.filter((function(_,T){return T.dir&&h.test(_)}));var y=this.root+h,w=S.call(this,y),x=this.clone();return x.root=w.name,x},remove:function(h){h=this.root+h;var y=this.files[h];if(y||(h.slice(-1)!=="/"&&(h+="/"),y=this.files[h]),y&&!y.dir)delete this.files[h];else for(var w=this.filter((function(_,T){return T.name.slice(0,h.length)===h})),x=0;x<w.length;x++)delete this.files[w[x].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(h){var y,w={};try{if((w=m.extend(h||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:g.utf8encode})).type=w.type.toLowerCase(),w.compression=w.compression.toUpperCase(),w.type==="binarystring"&&(w.type="string"),!w.type)throw new Error("No output type specified.");m.checkSupport(w.type),w.platform!=="darwin"&&w.platform!=="freebsd"&&w.platform!=="linux"&&w.platform!=="sunos"||(w.platform="UNIX"),w.platform==="win32"&&(w.platform="DOS");var x=w.comment||this.comment||"";y=R.generateWorker(this,w,x)}catch(_){(y=new v("error")).error(_)}return new k(y,w.type||"string",w.mimeType)},generateAsync:function(h,y){return this.generateInternalStream(h).accumulate(y)},generateNodeStream:function(h,y){return(h=h||{}).type||(h.type="nodebuffer"),this.generateInternalStream(h).toNodejsStream(y)}};f.exports=E},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(s,f,d){f.exports=s("stream")},{stream:void 0}],17:[function(s,f,d){var u=s("./DataReader");function g(m){u.call(this,m);for(var v=0;v<this.data.length;v++)m[v]=255&m[v]}s("../utils").inherits(g,u),g.prototype.byteAt=function(m){return this.data[this.zero+m]},g.prototype.lastIndexOfSignature=function(m){for(var v=m.charCodeAt(0),k=m.charCodeAt(1),B=m.charCodeAt(2),O=m.charCodeAt(3),L=this.length-4;0<=L;--L)if(this.data[L]===v&&this.data[L+1]===k&&this.data[L+2]===B&&this.data[L+3]===O)return L-this.zero;return-1},g.prototype.readAndCheckSignature=function(m){var v=m.charCodeAt(0),k=m.charCodeAt(1),B=m.charCodeAt(2),O=m.charCodeAt(3),L=this.readData(4);return v===L[0]&&k===L[1]&&B===L[2]&&O===L[3]},g.prototype.readData=function(m){if(this.checkOffset(m),m===0)return[];var v=this.data.slice(this.zero+this.index,this.zero+this.index+m);return this.index+=m,v},f.exports=g},{"../utils":32,"./DataReader":18}],18:[function(s,f,d){var u=s("../utils");function g(m){this.data=m,this.length=m.length,this.index=0,this.zero=0}g.prototype={checkOffset:function(m){this.checkIndex(this.index+m)},checkIndex:function(m){if(this.length<this.zero+m||m<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+m+"). Corrupted zip ?")},setIndex:function(m){this.checkIndex(m),this.index=m},skip:function(m){this.setIndex(this.index+m)},byteAt:function(){},readInt:function(m){var v,k=0;for(this.checkOffset(m),v=this.index+m-1;v>=this.index;v--)k=(k<<8)+this.byteAt(v);return this.index+=m,k},readString:function(m){return u.transformTo("string",this.readData(m))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var m=this.readInt(4);return new Date(Date.UTC(1980+(m>>25&127),(m>>21&15)-1,m>>16&31,m>>11&31,m>>5&63,(31&m)<<1))}},f.exports=g},{"../utils":32}],19:[function(s,f,d){var u=s("./Uint8ArrayReader");function g(m){u.call(this,m)}s("../utils").inherits(g,u),g.prototype.readData=function(m){this.checkOffset(m);var v=this.data.slice(this.zero+this.index,this.zero+this.index+m);return this.index+=m,v},f.exports=g},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(s,f,d){var u=s("./DataReader");function g(m){u.call(this,m)}s("../utils").inherits(g,u),g.prototype.byteAt=function(m){return this.data.charCodeAt(this.zero+m)},g.prototype.lastIndexOfSignature=function(m){return this.data.lastIndexOf(m)-this.zero},g.prototype.readAndCheckSignature=function(m){return m===this.readData(4)},g.prototype.readData=function(m){this.checkOffset(m);var v=this.data.slice(this.zero+this.index,this.zero+this.index+m);return this.index+=m,v},f.exports=g},{"../utils":32,"./DataReader":18}],21:[function(s,f,d){var u=s("./ArrayReader");function g(m){u.call(this,m)}s("../utils").inherits(g,u),g.prototype.readData=function(m){if(this.checkOffset(m),m===0)return new Uint8Array(0);var v=this.data.subarray(this.zero+this.index,this.zero+this.index+m);return this.index+=m,v},f.exports=g},{"../utils":32,"./ArrayReader":17}],22:[function(s,f,d){var u=s("../utils"),g=s("../support"),m=s("./ArrayReader"),v=s("./StringReader"),k=s("./NodeBufferReader"),B=s("./Uint8ArrayReader");f.exports=function(O){var L=u.getTypeOf(O);return u.checkSupport(L),L!=="string"||g.uint8array?L==="nodebuffer"?new k(O):g.uint8array?new B(u.transformTo("uint8array",O)):new m(u.transformTo("array",O)):new v(O)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(s,f,d){d.LOCAL_FILE_HEADER="PK",d.CENTRAL_FILE_HEADER="PK",d.CENTRAL_DIRECTORY_END="PK",d.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",d.ZIP64_CENTRAL_DIRECTORY_END="PK",d.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(s,f,d){var u=s("./GenericWorker"),g=s("../utils");function m(v){u.call(this,"ConvertWorker to "+v),this.destType=v}g.inherits(m,u),m.prototype.processChunk=function(v){this.push({data:g.transformTo(this.destType,v.data),meta:v.meta})},f.exports=m},{"../utils":32,"./GenericWorker":28}],25:[function(s,f,d){var u=s("./GenericWorker"),g=s("../crc32");function m(){u.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s("../utils").inherits(m,u),m.prototype.processChunk=function(v){this.streamInfo.crc32=g(v.data,this.streamInfo.crc32||0),this.push(v)},f.exports=m},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(s,f,d){var u=s("../utils"),g=s("./GenericWorker");function m(v){g.call(this,"DataLengthProbe for "+v),this.propName=v,this.withStreamInfo(v,0)}u.inherits(m,g),m.prototype.processChunk=function(v){if(v){var k=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=k+v.data.length}g.prototype.processChunk.call(this,v)},f.exports=m},{"../utils":32,"./GenericWorker":28}],27:[function(s,f,d){var u=s("../utils"),g=s("./GenericWorker");function m(v){g.call(this,"DataWorker");var k=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,v.then((function(B){k.dataIsReady=!0,k.data=B,k.max=B&&B.length||0,k.type=u.getTypeOf(B),k.isPaused||k._tickAndRepeat()}),(function(B){k.error(B)}))}u.inherits(m,g),m.prototype.cleanUp=function(){g.prototype.cleanUp.call(this),this.data=null},m.prototype.resume=function(){return!!g.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,u.delay(this._tickAndRepeat,[],this)),!0)},m.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(u.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},m.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var v=null,k=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":v=this.data.substring(this.index,k);break;case"uint8array":v=this.data.subarray(this.index,k);break;case"array":case"nodebuffer":v=this.data.slice(this.index,k)}return this.index=k,this.push({data:v,meta:{percent:this.max?this.index/this.max*100:0}})},f.exports=m},{"../utils":32,"./GenericWorker":28}],28:[function(s,f,d){function u(g){this.name=g||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}u.prototype={push:function(g){this.emit("data",g)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(g){this.emit("error",g)}return!0},error:function(g){return!this.isFinished&&(this.isPaused?this.generatedError=g:(this.isFinished=!0,this.emit("error",g),this.previous&&this.previous.error(g),this.cleanUp()),!0)},on:function(g,m){return this._listeners[g].push(m),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(g,m){if(this._listeners[g])for(var v=0;v<this._listeners[g].length;v++)this._listeners[g][v].call(this,m)},pipe:function(g){return g.registerPrevious(this)},registerPrevious:function(g){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=g.streamInfo,this.mergeStreamInfo(),this.previous=g;var m=this;return g.on("data",(function(v){m.processChunk(v)})),g.on("end",(function(){m.end()})),g.on("error",(function(v){m.error(v)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var g=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),g=!0),this.previous&&this.previous.resume(),!g},flush:function(){},processChunk:function(g){this.push(g)},withStreamInfo:function(g,m){return this.extraStreamInfo[g]=m,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var g in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,g)&&(this.streamInfo[g]=this.extraStreamInfo[g])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var g="Worker "+this.name;return this.previous?this.previous+" -> "+g:g}},f.exports=u},{}],29:[function(s,f,d){var u=s("../utils"),g=s("./ConvertWorker"),m=s("./GenericWorker"),v=s("../base64"),k=s("../support"),B=s("../external"),O=null;if(k.nodestream)try{O=s("../nodejs/NodejsStreamOutputAdapter")}catch{}function L(R,P,j){var z=P;switch(P){case"blob":case"arraybuffer":z="uint8array";break;case"base64":z="string"}try{this._internalType=z,this._outputType=P,this._mimeType=j,u.checkSupport(z),this._worker=R.pipe(new g(z)),R.lock()}catch(N){this._worker=new m("error"),this._worker.error(N)}}L.prototype={accumulate:function(R){return(function(P,j){return new B.Promise((function(z,N){var S=[],C=P._internalType,E=P._outputType,h=P._mimeType;P.on("data",(function(y,w){S.push(y),j&&j(w)})).on("error",(function(y){S=[],N(y)})).on("end",(function(){try{var y=(function(w,x,_){switch(w){case"blob":return u.newBlob(u.transformTo("arraybuffer",x),_);case"base64":return v.encode(x);default:return u.transformTo(w,x)}})(E,(function(w,x){var _,T=0,D=null,q=0;for(_=0;_<x.length;_++)q+=x[_].length;switch(w){case"string":return x.join("");case"array":return Array.prototype.concat.apply([],x);case"uint8array":for(D=new Uint8Array(q),_=0;_<x.length;_++)D.set(x[_],T),T+=x[_].length;return D;case"nodebuffer":return a.concat(x);default:throw new Error("concat : unsupported type '"+w+"'")}})(C,S),h);z(y)}catch(w){N(w)}S=[]})).resume()}))})(this,R)},on:function(R,P){var j=this;return R==="data"?this._worker.on(R,(function(z){P.call(j,z.data,z.meta)})):this._worker.on(R,(function(){u.delay(P,arguments,j)})),this},resume:function(){return u.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(R){if(u.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new O(this,{objectMode:this._outputType!=="nodebuffer"},R)}},f.exports=L},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(s,f,d){if(d.base64=!0,d.array=!0,d.string=!0,d.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",d.nodebuffer=a!==void 0,d.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")d.blob=!1;else{var u=new ArrayBuffer(0);try{d.blob=new Blob([u],{type:"application/zip"}).size===0}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);g.append(u),d.blob=g.getBlob("application/zip").size===0}catch{d.blob=!1}}}try{d.nodestream=!!s("readable-stream").Readable}catch{d.nodestream=!1}},{"readable-stream":16}],31:[function(s,f,d){for(var u=s("./utils"),g=s("./support"),m=s("./nodejsUtils"),v=s("./stream/GenericWorker"),k=new Array(256),B=0;B<256;B++)k[B]=252<=B?6:248<=B?5:240<=B?4:224<=B?3:192<=B?2:1;function O(){v.call(this,"utf-8 decode"),this.leftOver=null}function L(){v.call(this,"utf-8 encode")}k[254]=k[254]=1,d.utf8encode=function(R){return g.nodebuffer?m.newBufferFrom(R,"utf-8"):(function(P){var j,z,N,S,C,E=P.length,h=0;for(S=0;S<E;S++)(64512&(z=P.charCodeAt(S)))==55296&&S+1<E&&(64512&(N=P.charCodeAt(S+1)))==56320&&(z=65536+(z-55296<<10)+(N-56320),S++),h+=z<128?1:z<2048?2:z<65536?3:4;for(j=g.uint8array?new Uint8Array(h):new Array(h),S=C=0;C<h;S++)(64512&(z=P.charCodeAt(S)))==55296&&S+1<E&&(64512&(N=P.charCodeAt(S+1)))==56320&&(z=65536+(z-55296<<10)+(N-56320),S++),z<128?j[C++]=z:(z<2048?j[C++]=192|z>>>6:(z<65536?j[C++]=224|z>>>12:(j[C++]=240|z>>>18,j[C++]=128|z>>>12&63),j[C++]=128|z>>>6&63),j[C++]=128|63&z);return j})(R)},d.utf8decode=function(R){return g.nodebuffer?u.transformTo("nodebuffer",R).toString("utf-8"):(function(P){var j,z,N,S,C=P.length,E=new Array(2*C);for(j=z=0;j<C;)if((N=P[j++])<128)E[z++]=N;else if(4<(S=k[N]))E[z++]=65533,j+=S-1;else{for(N&=S===2?31:S===3?15:7;1<S&&j<C;)N=N<<6|63&P[j++],S--;1<S?E[z++]=65533:N<65536?E[z++]=N:(N-=65536,E[z++]=55296|N>>10&1023,E[z++]=56320|1023&N)}return E.length!==z&&(E.subarray?E=E.subarray(0,z):E.length=z),u.applyFromCharCode(E)})(R=u.transformTo(g.uint8array?"uint8array":"array",R))},u.inherits(O,v),O.prototype.processChunk=function(R){var P=u.transformTo(g.uint8array?"uint8array":"array",R.data);if(this.leftOver&&this.leftOver.length){if(g.uint8array){var j=P;(P=new Uint8Array(j.length+this.leftOver.length)).set(this.leftOver,0),P.set(j,this.leftOver.length)}else P=this.leftOver.concat(P);this.leftOver=null}var z=(function(S,C){var E;for((C=C||S.length)>S.length&&(C=S.length),E=C-1;0<=E&&(192&S[E])==128;)E--;return E<0||E===0?C:E+k[S[E]]>C?E:C})(P),N=P;z!==P.length&&(g.uint8array?(N=P.subarray(0,z),this.leftOver=P.subarray(z,P.length)):(N=P.slice(0,z),this.leftOver=P.slice(z,P.length))),this.push({data:d.utf8decode(N),meta:R.meta})},O.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:d.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},d.Utf8DecodeWorker=O,u.inherits(L,v),L.prototype.processChunk=function(R){this.push({data:d.utf8encode(R.data),meta:R.meta})},d.Utf8EncodeWorker=L},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(s,f,d){var u=s("./support"),g=s("./base64"),m=s("./nodejsUtils"),v=s("./external");function k(j){return j}function B(j,z){for(var N=0;N<j.length;++N)z[N]=255&j.charCodeAt(N);return z}s("setimmediate"),d.newBlob=function(j,z){d.checkSupport("blob");try{return new Blob([j],{type:z})}catch{try{var N=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return N.append(j),N.getBlob(z)}catch{throw new Error("Bug : can't construct the Blob.")}}};var O={stringifyByChunk:function(j,z,N){var S=[],C=0,E=j.length;if(E<=N)return String.fromCharCode.apply(null,j);for(;C<E;)z==="array"||z==="nodebuffer"?S.push(String.fromCharCode.apply(null,j.slice(C,Math.min(C+N,E)))):S.push(String.fromCharCode.apply(null,j.subarray(C,Math.min(C+N,E)))),C+=N;return S.join("")},stringifyByChar:function(j){for(var z="",N=0;N<j.length;N++)z+=String.fromCharCode(j[N]);return z},applyCanBeUsed:{uint8array:(function(){try{return u.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return u.nodebuffer&&String.fromCharCode.apply(null,m.allocBuffer(1)).length===1}catch{return!1}})()}};function L(j){var z=65536,N=d.getTypeOf(j),S=!0;if(N==="uint8array"?S=O.applyCanBeUsed.uint8array:N==="nodebuffer"&&(S=O.applyCanBeUsed.nodebuffer),S)for(;1<z;)try{return O.stringifyByChunk(j,N,z)}catch{z=Math.floor(z/2)}return O.stringifyByChar(j)}function R(j,z){for(var N=0;N<j.length;N++)z[N]=j[N];return z}d.applyFromCharCode=L;var P={};P.string={string:k,array:function(j){return B(j,new Array(j.length))},arraybuffer:function(j){return P.string.uint8array(j).buffer},uint8array:function(j){return B(j,new Uint8Array(j.length))},nodebuffer:function(j){return B(j,m.allocBuffer(j.length))}},P.array={string:L,array:k,arraybuffer:function(j){return new Uint8Array(j).buffer},uint8array:function(j){return new Uint8Array(j)},nodebuffer:function(j){return m.newBufferFrom(j)}},P.arraybuffer={string:function(j){return L(new Uint8Array(j))},array:function(j){return R(new Uint8Array(j),new Array(j.byteLength))},arraybuffer:k,uint8array:function(j){return new Uint8Array(j)},nodebuffer:function(j){return m.newBufferFrom(new Uint8Array(j))}},P.uint8array={string:L,array:function(j){return R(j,new Array(j.length))},arraybuffer:function(j){return j.buffer},uint8array:k,nodebuffer:function(j){return m.newBufferFrom(j)}},P.nodebuffer={string:L,array:function(j){return R(j,new Array(j.length))},arraybuffer:function(j){return P.nodebuffer.uint8array(j).buffer},uint8array:function(j){return R(j,new Uint8Array(j.length))},nodebuffer:k},d.transformTo=function(j,z){if(z=z||"",!j)return z;d.checkSupport(j);var N=d.getTypeOf(z);return P[N][j](z)},d.resolve=function(j){for(var z=j.split("/"),N=[],S=0;S<z.length;S++){var C=z[S];C==="."||C===""&&S!==0&&S!==z.length-1||(C===".."?N.pop():N.push(C))}return N.join("/")},d.getTypeOf=function(j){return typeof j=="string"?"string":Object.prototype.toString.call(j)==="[object Array]"?"array":u.nodebuffer&&m.isBuffer(j)?"nodebuffer":u.uint8array&&j instanceof Uint8Array?"uint8array":u.arraybuffer&&j instanceof ArrayBuffer?"arraybuffer":void 0},d.checkSupport=function(j){if(!u[j.toLowerCase()])throw new Error(j+" is not supported by this platform")},d.MAX_VALUE_16BITS=65535,d.MAX_VALUE_32BITS=-1,d.pretty=function(j){var z,N,S="";for(N=0;N<(j||"").length;N++)S+="\\x"+((z=j.charCodeAt(N))<16?"0":"")+z.toString(16).toUpperCase();return S},d.delay=function(j,z,N){o((function(){j.apply(N||null,z||[])}))},d.inherits=function(j,z){function N(){}N.prototype=z.prototype,j.prototype=new N},d.extend=function(){var j,z,N={};for(j=0;j<arguments.length;j++)for(z in arguments[j])Object.prototype.hasOwnProperty.call(arguments[j],z)&&N[z]===void 0&&(N[z]=arguments[j][z]);return N},d.prepareContent=function(j,z,N,S,C){return v.Promise.resolve(z).then((function(E){return u.blob&&(E instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(E))!==-1)&&typeof FileReader<"u"?new v.Promise((function(h,y){var w=new FileReader;w.onload=function(x){h(x.target.result)},w.onerror=function(x){y(x.target.error)},w.readAsArrayBuffer(E)})):E})).then((function(E){var h=d.getTypeOf(E);return h?(h==="arraybuffer"?E=d.transformTo("uint8array",E):h==="string"&&(C?E=g.decode(E):N&&S!==!0&&(E=(function(y){return B(y,u.uint8array?new Uint8Array(y.length):new Array(y.length))})(E))),E):v.Promise.reject(new Error("Can't read the data of '"+j+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(s,f,d){var u=s("./reader/readerFor"),g=s("./utils"),m=s("./signature"),v=s("./zipEntry"),k=s("./support");function B(O){this.files=[],this.loadOptions=O}B.prototype={checkSignature:function(O){if(!this.reader.readAndCheckSignature(O)){this.reader.index-=4;var L=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+g.pretty(L)+", expected "+g.pretty(O)+")")}},isSignature:function(O,L){var R=this.reader.index;this.reader.setIndex(O);var P=this.reader.readString(4)===L;return this.reader.setIndex(R),P},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var O=this.reader.readData(this.zipCommentLength),L=k.uint8array?"uint8array":"array",R=g.transformTo(L,O);this.zipComment=this.loadOptions.decodeFileName(R)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var O,L,R,P=this.zip64EndOfCentralSize-44;0<P;)O=this.reader.readInt(2),L=this.reader.readInt(4),R=this.reader.readData(L),this.zip64ExtensibleData[O]={id:O,length:L,value:R}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var O,L;for(O=0;O<this.files.length;O++)L=this.files[O],this.reader.setIndex(L.localHeaderOffset),this.checkSignature(m.LOCAL_FILE_HEADER),L.readLocalPart(this.reader),L.handleUTF8(),L.processAttributes()},readCentralDir:function(){var O;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(m.CENTRAL_FILE_HEADER);)(O=new v({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(O);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var O=this.reader.lastIndexOfSignature(m.CENTRAL_DIRECTORY_END);if(O<0)throw this.isSignature(0,m.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(O);var L=O;if(this.checkSignature(m.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===g.MAX_VALUE_16BITS||this.diskWithCentralDirStart===g.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===g.MAX_VALUE_16BITS||this.centralDirRecords===g.MAX_VALUE_16BITS||this.centralDirSize===g.MAX_VALUE_32BITS||this.centralDirOffset===g.MAX_VALUE_32BITS){if(this.zip64=!0,(O=this.reader.lastIndexOfSignature(m.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(O),this.checkSignature(m.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,m.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(m.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(m.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var R=this.centralDirOffset+this.centralDirSize;this.zip64&&(R+=20,R+=12+this.zip64EndOfCentralSize);var P=L-R;if(0<P)this.isSignature(L,m.CENTRAL_FILE_HEADER)||(this.reader.zero=P);else if(P<0)throw new Error("Corrupted zip: missing "+Math.abs(P)+" bytes.")},prepareReader:function(O){this.reader=u(O)},load:function(O){this.prepareReader(O),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},f.exports=B},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(s,f,d){var u=s("./reader/readerFor"),g=s("./utils"),m=s("./compressedObject"),v=s("./crc32"),k=s("./utf8"),B=s("./compressions"),O=s("./support");function L(R,P){this.options=R,this.loadOptions=P}L.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(R){var P,j;if(R.skip(22),this.fileNameLength=R.readInt(2),j=R.readInt(2),this.fileName=R.readData(this.fileNameLength),R.skip(j),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((P=(function(z){for(var N in B)if(Object.prototype.hasOwnProperty.call(B,N)&&B[N].magic===z)return B[N];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+g.pretty(this.compressionMethod)+" unknown (inner file : "+g.transformTo("string",this.fileName)+")");this.decompressed=new m(this.compressedSize,this.uncompressedSize,this.crc32,P,R.readData(this.compressedSize))},readCentralPart:function(R){this.versionMadeBy=R.readInt(2),R.skip(2),this.bitFlag=R.readInt(2),this.compressionMethod=R.readString(2),this.date=R.readDate(),this.crc32=R.readInt(4),this.compressedSize=R.readInt(4),this.uncompressedSize=R.readInt(4);var P=R.readInt(2);if(this.extraFieldsLength=R.readInt(2),this.fileCommentLength=R.readInt(2),this.diskNumberStart=R.readInt(2),this.internalFileAttributes=R.readInt(2),this.externalFileAttributes=R.readInt(4),this.localHeaderOffset=R.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");R.skip(P),this.readExtraFields(R),this.parseZIP64ExtraField(R),this.fileComment=R.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var R=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),R==0&&(this.dosPermissions=63&this.externalFileAttributes),R==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var R=u(this.extraFields[1].value);this.uncompressedSize===g.MAX_VALUE_32BITS&&(this.uncompressedSize=R.readInt(8)),this.compressedSize===g.MAX_VALUE_32BITS&&(this.compressedSize=R.readInt(8)),this.localHeaderOffset===g.MAX_VALUE_32BITS&&(this.localHeaderOffset=R.readInt(8)),this.diskNumberStart===g.MAX_VALUE_32BITS&&(this.diskNumberStart=R.readInt(4))}},readExtraFields:function(R){var P,j,z,N=R.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});R.index+4<N;)P=R.readInt(2),j=R.readInt(2),z=R.readData(j),this.extraFields[P]={id:P,length:j,value:z};R.setIndex(N)},handleUTF8:function(){var R=O.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=k.utf8decode(this.fileName),this.fileCommentStr=k.utf8decode(this.fileComment);else{var P=this.findExtraFieldUnicodePath();if(P!==null)this.fileNameStr=P;else{var j=g.transformTo(R,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(j)}var z=this.findExtraFieldUnicodeComment();if(z!==null)this.fileCommentStr=z;else{var N=g.transformTo(R,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(N)}}},findExtraFieldUnicodePath:function(){var R=this.extraFields[28789];if(R){var P=u(R.value);return P.readInt(1)!==1||v(this.fileName)!==P.readInt(4)?null:k.utf8decode(P.readData(R.length-5))}return null},findExtraFieldUnicodeComment:function(){var R=this.extraFields[25461];if(R){var P=u(R.value);return P.readInt(1)!==1||v(this.fileComment)!==P.readInt(4)?null:k.utf8decode(P.readData(R.length-5))}return null}},f.exports=L},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(s,f,d){function u(P,j,z){this.name=P,this.dir=z.dir,this.date=z.date,this.comment=z.comment,this.unixPermissions=z.unixPermissions,this.dosPermissions=z.dosPermissions,this._data=j,this._dataBinary=z.binary,this.options={compression:z.compression,compressionOptions:z.compressionOptions}}var g=s("./stream/StreamHelper"),m=s("./stream/DataWorker"),v=s("./utf8"),k=s("./compressedObject"),B=s("./stream/GenericWorker");u.prototype={internalStream:function(P){var j=null,z="string";try{if(!P)throw new Error("No output type specified.");var N=(z=P.toLowerCase())==="string"||z==="text";z!=="binarystring"&&z!=="text"||(z="string"),j=this._decompressWorker();var S=!this._dataBinary;S&&!N&&(j=j.pipe(new v.Utf8EncodeWorker)),!S&&N&&(j=j.pipe(new v.Utf8DecodeWorker))}catch(C){(j=new B("error")).error(C)}return new g(j,z,"")},async:function(P,j){return this.internalStream(P).accumulate(j)},nodeStream:function(P,j){return this.internalStream(P||"nodebuffer").toNodejsStream(j)},_compressWorker:function(P,j){if(this._data instanceof k&&this._data.compression.magic===P.magic)return this._data.getCompressedWorker();var z=this._decompressWorker();return this._dataBinary||(z=z.pipe(new v.Utf8EncodeWorker)),k.createWorkerFrom(z,P,j)},_decompressWorker:function(){return this._data instanceof k?this._data.getContentWorker():this._data instanceof B?this._data:new m(this._data)}};for(var O=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],L=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},R=0;R<O.length;R++)u.prototype[O[R]]=L;f.exports=u},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(s,f,d){(function(u){var g,m,v=u.MutationObserver||u.WebKitMutationObserver;if(v){var k=0,B=new v(P),O=u.document.createTextNode("");B.observe(O,{characterData:!0}),g=function(){O.data=k=++k%2}}else if(u.setImmediate||u.MessageChannel===void 0)g="document"in u&&"onreadystatechange"in u.document.createElement("script")?function(){var j=u.document.createElement("script");j.onreadystatechange=function(){P(),j.onreadystatechange=null,j.parentNode.removeChild(j),j=null},u.document.documentElement.appendChild(j)}:function(){setTimeout(P,0)};else{var L=new u.MessageChannel;L.port1.onmessage=P,g=function(){L.port2.postMessage(0)}}var R=[];function P(){var j,z;m=!0;for(var N=R.length;N;){for(z=R,R=[],j=-1;++j<N;)z[j]();N=R.length}m=!1}f.exports=function(j){R.push(j)!==1||m||g()}}).call(this,i!==void 0?i:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(s,f,d){var u=s("immediate");function g(){}var m={},v=["REJECTED"],k=["FULFILLED"],B=["PENDING"];function O(N){if(typeof N!="function")throw new TypeError("resolver must be a function");this.state=B,this.queue=[],this.outcome=void 0,N!==g&&j(this,N)}function L(N,S,C){this.promise=N,typeof S=="function"&&(this.onFulfilled=S,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function R(N,S,C){u((function(){var E;try{E=S(C)}catch(h){return m.reject(N,h)}E===N?m.reject(N,new TypeError("Cannot resolve promise with itself")):m.resolve(N,E)}))}function P(N){var S=N&&N.then;if(N&&(typeof N=="object"||typeof N=="function")&&typeof S=="function")return function(){S.apply(N,arguments)}}function j(N,S){var C=!1;function E(w){C||(C=!0,m.reject(N,w))}function h(w){C||(C=!0,m.resolve(N,w))}var y=z((function(){S(h,E)}));y.status==="error"&&E(y.value)}function z(N,S){var C={};try{C.value=N(S),C.status="success"}catch(E){C.status="error",C.value=E}return C}(f.exports=O).prototype.finally=function(N){if(typeof N!="function")return this;var S=this.constructor;return this.then((function(C){return S.resolve(N()).then((function(){return C}))}),(function(C){return S.resolve(N()).then((function(){throw C}))}))},O.prototype.catch=function(N){return this.then(null,N)},O.prototype.then=function(N,S){if(typeof N!="function"&&this.state===k||typeof S!="function"&&this.state===v)return this;var C=new this.constructor(g);return this.state!==B?R(C,this.state===k?N:S,this.outcome):this.queue.push(new L(C,N,S)),C},L.prototype.callFulfilled=function(N){m.resolve(this.promise,N)},L.prototype.otherCallFulfilled=function(N){R(this.promise,this.onFulfilled,N)},L.prototype.callRejected=function(N){m.reject(this.promise,N)},L.prototype.otherCallRejected=function(N){R(this.promise,this.onRejected,N)},m.resolve=function(N,S){var C=z(P,S);if(C.status==="error")return m.reject(N,C.value);var E=C.value;if(E)j(N,E);else{N.state=k,N.outcome=S;for(var h=-1,y=N.queue.length;++h<y;)N.queue[h].callFulfilled(S)}return N},m.reject=function(N,S){N.state=v,N.outcome=S;for(var C=-1,E=N.queue.length;++C<E;)N.queue[C].callRejected(S);return N},O.resolve=function(N){return N instanceof this?N:m.resolve(new this(g),N)},O.reject=function(N){var S=new this(g);return m.reject(S,N)},O.all=function(N){var S=this;if(Object.prototype.toString.call(N)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=N.length,E=!1;if(!C)return this.resolve([]);for(var h=new Array(C),y=0,w=-1,x=new this(g);++w<C;)_(N[w],w);return x;function _(T,D){S.resolve(T).then((function(q){h[D]=q,++y!==C||E||(E=!0,m.resolve(x,h))}),(function(q){E||(E=!0,m.reject(x,q))}))}},O.race=function(N){if(Object.prototype.toString.call(N)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=N.length,C=!1;if(!S)return this.resolve([]);for(var E,h=-1,y=new this(g);++h<S;)E=N[h],this.resolve(E).then((function(w){C||(C=!0,m.resolve(y,w))}),(function(w){C||(C=!0,m.reject(y,w))}));return y}},{immediate:36}],38:[function(s,f,d){var u={};(0,s("./lib/utils/common").assign)(u,s("./lib/deflate"),s("./lib/inflate"),s("./lib/zlib/constants")),f.exports=u},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(s,f,d){var u=s("./zlib/deflate"),g=s("./utils/common"),m=s("./utils/strings"),v=s("./zlib/messages"),k=s("./zlib/zstream"),B=Object.prototype.toString;function O(R){if(!(this instanceof O))return new O(R);this.options=g.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},R||{});var P=this.options;P.raw&&0<P.windowBits?P.windowBits=-P.windowBits:P.gzip&&0<P.windowBits&&P.windowBits<16&&(P.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var j=u.deflateInit2(this.strm,P.level,P.method,P.windowBits,P.memLevel,P.strategy);if(j!==0)throw new Error(v[j]);if(P.header&&u.deflateSetHeader(this.strm,P.header),P.dictionary){var z;if(z=typeof P.dictionary=="string"?m.string2buf(P.dictionary):B.call(P.dictionary)==="[object ArrayBuffer]"?new Uint8Array(P.dictionary):P.dictionary,(j=u.deflateSetDictionary(this.strm,z))!==0)throw new Error(v[j]);this._dict_set=!0}}function L(R,P){var j=new O(P);if(j.push(R,!0),j.err)throw j.msg||v[j.err];return j.result}O.prototype.push=function(R,P){var j,z,N=this.strm,S=this.options.chunkSize;if(this.ended)return!1;z=P===~~P?P:P===!0?4:0,typeof R=="string"?N.input=m.string2buf(R):B.call(R)==="[object ArrayBuffer]"?N.input=new Uint8Array(R):N.input=R,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new g.Buf8(S),N.next_out=0,N.avail_out=S),(j=u.deflate(N,z))!==1&&j!==0)return this.onEnd(j),!(this.ended=!0);N.avail_out!==0&&(N.avail_in!==0||z!==4&&z!==2)||(this.options.to==="string"?this.onData(m.buf2binstring(g.shrinkBuf(N.output,N.next_out))):this.onData(g.shrinkBuf(N.output,N.next_out)))}while((0<N.avail_in||N.avail_out===0)&&j!==1);return z===4?(j=u.deflateEnd(this.strm),this.onEnd(j),this.ended=!0,j===0):z!==2||(this.onEnd(0),!(N.avail_out=0))},O.prototype.onData=function(R){this.chunks.push(R)},O.prototype.onEnd=function(R){R===0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=g.flattenChunks(this.chunks)),this.chunks=[],this.err=R,this.msg=this.strm.msg},d.Deflate=O,d.deflate=L,d.deflateRaw=function(R,P){return(P=P||{}).raw=!0,L(R,P)},d.gzip=function(R,P){return(P=P||{}).gzip=!0,L(R,P)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(s,f,d){var u=s("./zlib/inflate"),g=s("./utils/common"),m=s("./utils/strings"),v=s("./zlib/constants"),k=s("./zlib/messages"),B=s("./zlib/zstream"),O=s("./zlib/gzheader"),L=Object.prototype.toString;function R(j){if(!(this instanceof R))return new R(j);this.options=g.assign({chunkSize:16384,windowBits:0,to:""},j||{});var z=this.options;z.raw&&0<=z.windowBits&&z.windowBits<16&&(z.windowBits=-z.windowBits,z.windowBits===0&&(z.windowBits=-15)),!(0<=z.windowBits&&z.windowBits<16)||j&&j.windowBits||(z.windowBits+=32),15<z.windowBits&&z.windowBits<48&&(15&z.windowBits)==0&&(z.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new B,this.strm.avail_out=0;var N=u.inflateInit2(this.strm,z.windowBits);if(N!==v.Z_OK)throw new Error(k[N]);this.header=new O,u.inflateGetHeader(this.strm,this.header)}function P(j,z){var N=new R(z);if(N.push(j,!0),N.err)throw N.msg||k[N.err];return N.result}R.prototype.push=function(j,z){var N,S,C,E,h,y,w=this.strm,x=this.options.chunkSize,_=this.options.dictionary,T=!1;if(this.ended)return!1;S=z===~~z?z:z===!0?v.Z_FINISH:v.Z_NO_FLUSH,typeof j=="string"?w.input=m.binstring2buf(j):L.call(j)==="[object ArrayBuffer]"?w.input=new Uint8Array(j):w.input=j,w.next_in=0,w.avail_in=w.input.length;do{if(w.avail_out===0&&(w.output=new g.Buf8(x),w.next_out=0,w.avail_out=x),(N=u.inflate(w,v.Z_NO_FLUSH))===v.Z_NEED_DICT&&_&&(y=typeof _=="string"?m.string2buf(_):L.call(_)==="[object ArrayBuffer]"?new Uint8Array(_):_,N=u.inflateSetDictionary(this.strm,y)),N===v.Z_BUF_ERROR&&T===!0&&(N=v.Z_OK,T=!1),N!==v.Z_STREAM_END&&N!==v.Z_OK)return this.onEnd(N),!(this.ended=!0);w.next_out&&(w.avail_out!==0&&N!==v.Z_STREAM_END&&(w.avail_in!==0||S!==v.Z_FINISH&&S!==v.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=m.utf8border(w.output,w.next_out),E=w.next_out-C,h=m.buf2string(w.output,C),w.next_out=E,w.avail_out=x-E,E&&g.arraySet(w.output,w.output,C,E,0),this.onData(h)):this.onData(g.shrinkBuf(w.output,w.next_out)))),w.avail_in===0&&w.avail_out===0&&(T=!0)}while((0<w.avail_in||w.avail_out===0)&&N!==v.Z_STREAM_END);return N===v.Z_STREAM_END&&(S=v.Z_FINISH),S===v.Z_FINISH?(N=u.inflateEnd(this.strm),this.onEnd(N),this.ended=!0,N===v.Z_OK):S!==v.Z_SYNC_FLUSH||(this.onEnd(v.Z_OK),!(w.avail_out=0))},R.prototype.onData=function(j){this.chunks.push(j)},R.prototype.onEnd=function(j){j===v.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=g.flattenChunks(this.chunks)),this.chunks=[],this.err=j,this.msg=this.strm.msg},d.Inflate=R,d.inflate=P,d.inflateRaw=function(j,z){return(z=z||{}).raw=!0,P(j,z)},d.ungzip=P},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(s,f,d){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";d.assign=function(v){for(var k=Array.prototype.slice.call(arguments,1);k.length;){var B=k.shift();if(B){if(typeof B!="object")throw new TypeError(B+"must be non-object");for(var O in B)B.hasOwnProperty(O)&&(v[O]=B[O])}}return v},d.shrinkBuf=function(v,k){return v.length===k?v:v.subarray?v.subarray(0,k):(v.length=k,v)};var g={arraySet:function(v,k,B,O,L){if(k.subarray&&v.subarray)v.set(k.subarray(B,B+O),L);else for(var R=0;R<O;R++)v[L+R]=k[B+R]},flattenChunks:function(v){var k,B,O,L,R,P;for(k=O=0,B=v.length;k<B;k++)O+=v[k].length;for(P=new Uint8Array(O),k=L=0,B=v.length;k<B;k++)R=v[k],P.set(R,L),L+=R.length;return P}},m={arraySet:function(v,k,B,O,L){for(var R=0;R<O;R++)v[L+R]=k[B+R]},flattenChunks:function(v){return[].concat.apply([],v)}};d.setTyped=function(v){v?(d.Buf8=Uint8Array,d.Buf16=Uint16Array,d.Buf32=Int32Array,d.assign(d,g)):(d.Buf8=Array,d.Buf16=Array,d.Buf32=Array,d.assign(d,m))},d.setTyped(u)},{}],42:[function(s,f,d){var u=s("./common"),g=!0,m=!0;try{String.fromCharCode.apply(null,[0])}catch{g=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{m=!1}for(var v=new u.Buf8(256),k=0;k<256;k++)v[k]=252<=k?6:248<=k?5:240<=k?4:224<=k?3:192<=k?2:1;function B(O,L){if(L<65537&&(O.subarray&&m||!O.subarray&&g))return String.fromCharCode.apply(null,u.shrinkBuf(O,L));for(var R="",P=0;P<L;P++)R+=String.fromCharCode(O[P]);return R}v[254]=v[254]=1,d.string2buf=function(O){var L,R,P,j,z,N=O.length,S=0;for(j=0;j<N;j++)(64512&(R=O.charCodeAt(j)))==55296&&j+1<N&&(64512&(P=O.charCodeAt(j+1)))==56320&&(R=65536+(R-55296<<10)+(P-56320),j++),S+=R<128?1:R<2048?2:R<65536?3:4;for(L=new u.Buf8(S),j=z=0;z<S;j++)(64512&(R=O.charCodeAt(j)))==55296&&j+1<N&&(64512&(P=O.charCodeAt(j+1)))==56320&&(R=65536+(R-55296<<10)+(P-56320),j++),R<128?L[z++]=R:(R<2048?L[z++]=192|R>>>6:(R<65536?L[z++]=224|R>>>12:(L[z++]=240|R>>>18,L[z++]=128|R>>>12&63),L[z++]=128|R>>>6&63),L[z++]=128|63&R);return L},d.buf2binstring=function(O){return B(O,O.length)},d.binstring2buf=function(O){for(var L=new u.Buf8(O.length),R=0,P=L.length;R<P;R++)L[R]=O.charCodeAt(R);return L},d.buf2string=function(O,L){var R,P,j,z,N=L||O.length,S=new Array(2*N);for(R=P=0;R<N;)if((j=O[R++])<128)S[P++]=j;else if(4<(z=v[j]))S[P++]=65533,R+=z-1;else{for(j&=z===2?31:z===3?15:7;1<z&&R<N;)j=j<<6|63&O[R++],z--;1<z?S[P++]=65533:j<65536?S[P++]=j:(j-=65536,S[P++]=55296|j>>10&1023,S[P++]=56320|1023&j)}return B(S,P)},d.utf8border=function(O,L){var R;for((L=L||O.length)>O.length&&(L=O.length),R=L-1;0<=R&&(192&O[R])==128;)R--;return R<0||R===0?L:R+v[O[R]]>L?R:L}},{"./common":41}],43:[function(s,f,d){f.exports=function(u,g,m,v){for(var k=65535&u|0,B=u>>>16&65535|0,O=0;m!==0;){for(m-=O=2e3<m?2e3:m;B=B+(k=k+g[v++]|0)|0,--O;);k%=65521,B%=65521}return k|B<<16|0}},{}],44:[function(s,f,d){f.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(s,f,d){var u=(function(){for(var g,m=[],v=0;v<256;v++){g=v;for(var k=0;k<8;k++)g=1&g?3988292384^g>>>1:g>>>1;m[v]=g}return m})();f.exports=function(g,m,v,k){var B=u,O=k+v;g^=-1;for(var L=k;L<O;L++)g=g>>>8^B[255&(g^m[L])];return-1^g}},{}],46:[function(s,f,d){var u,g=s("../utils/common"),m=s("./trees"),v=s("./adler32"),k=s("./crc32"),B=s("./messages"),O=-2,L=258,R=262,P=113;function j(A,H){return A.msg=B[H],H}function z(A){return(A<<1)-(4<A?9:0)}function N(A){for(var H=A.length;0<=--H;)A[H]=0}function S(A){var H=A.state,M=H.pending;M>A.avail_out&&(M=A.avail_out),M!==0&&(g.arraySet(A.output,H.pending_buf,H.pending_out,M,A.next_out),A.next_out+=M,H.pending_out+=M,A.total_out+=M,A.avail_out-=M,H.pending-=M,H.pending===0&&(H.pending_out=0))}function C(A,H){m._tr_flush_block(A,0<=A.block_start?A.block_start:-1,A.strstart-A.block_start,H),A.block_start=A.strstart,S(A.strm)}function E(A,H){A.pending_buf[A.pending++]=H}function h(A,H){A.pending_buf[A.pending++]=H>>>8&255,A.pending_buf[A.pending++]=255&H}function y(A,H){var M,I,F=A.max_chain_length,U=A.strstart,X=A.prev_length,V=A.nice_match,G=A.strstart>A.w_size-R?A.strstart-(A.w_size-R):0,ee=A.window,Z=A.w_mask,K=A.prev,Q=A.strstart+L,J=ee[U+X-1],ne=ee[U+X];A.prev_length>=A.good_match&&(F>>=2),V>A.lookahead&&(V=A.lookahead);do if(ee[(M=H)+X]===ne&&ee[M+X-1]===J&&ee[M]===ee[U]&&ee[++M]===ee[U+1]){U+=2,M++;do;while(ee[++U]===ee[++M]&&ee[++U]===ee[++M]&&ee[++U]===ee[++M]&&ee[++U]===ee[++M]&&ee[++U]===ee[++M]&&ee[++U]===ee[++M]&&ee[++U]===ee[++M]&&ee[++U]===ee[++M]&&U<Q);if(I=L-(Q-U),U=Q-L,X<I){if(A.match_start=H,V<=(X=I))break;J=ee[U+X-1],ne=ee[U+X]}}while((H=K[H&Z])>G&&--F!=0);return X<=A.lookahead?X:A.lookahead}function w(A){var H,M,I,F,U,X,V,G,ee,Z,K=A.w_size;do{if(F=A.window_size-A.lookahead-A.strstart,A.strstart>=K+(K-R)){for(g.arraySet(A.window,A.window,K,K,0),A.match_start-=K,A.strstart-=K,A.block_start-=K,H=M=A.hash_size;I=A.head[--H],A.head[H]=K<=I?I-K:0,--M;);for(H=M=K;I=A.prev[--H],A.prev[H]=K<=I?I-K:0,--M;);F+=K}if(A.strm.avail_in===0)break;if(X=A.strm,V=A.window,G=A.strstart+A.lookahead,Z=void 0,(ee=F)<(Z=X.avail_in)&&(Z=ee),M=Z===0?0:(X.avail_in-=Z,g.arraySet(V,X.input,X.next_in,Z,G),X.state.wrap===1?X.adler=v(X.adler,V,Z,G):X.state.wrap===2&&(X.adler=k(X.adler,V,Z,G)),X.next_in+=Z,X.total_in+=Z,Z),A.lookahead+=M,A.lookahead+A.insert>=3)for(U=A.strstart-A.insert,A.ins_h=A.window[U],A.ins_h=(A.ins_h<<A.hash_shift^A.window[U+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[U+3-1])&A.hash_mask,A.prev[U&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=U,U++,A.insert--,!(A.lookahead+A.insert<3)););}while(A.lookahead<R&&A.strm.avail_in!==0)}function x(A,H){for(var M,I;;){if(A.lookahead<R){if(w(A),A.lookahead<R&&H===0)return 1;if(A.lookahead===0)break}if(M=0,A.lookahead>=3&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+3-1])&A.hash_mask,M=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),M!==0&&A.strstart-M<=A.w_size-R&&(A.match_length=y(A,M)),A.match_length>=3)if(I=m._tr_tally(A,A.strstart-A.match_start,A.match_length-3),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=3){for(A.match_length--;A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+3-1])&A.hash_mask,M=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart,--A.match_length!=0;);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else I=m._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(I&&(C(A,!1),A.strm.avail_out===0))return 1}return A.insert=A.strstart<2?A.strstart:2,H===4?(C(A,!0),A.strm.avail_out===0?3:4):A.last_lit&&(C(A,!1),A.strm.avail_out===0)?1:2}function _(A,H){for(var M,I,F;;){if(A.lookahead<R){if(w(A),A.lookahead<R&&H===0)return 1;if(A.lookahead===0)break}if(M=0,A.lookahead>=3&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+3-1])&A.hash_mask,M=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=2,M!==0&&A.prev_length<A.max_lazy_match&&A.strstart-M<=A.w_size-R&&(A.match_length=y(A,M),A.match_length<=5&&(A.strategy===1||A.match_length===3&&4096<A.strstart-A.match_start)&&(A.match_length=2)),A.prev_length>=3&&A.match_length<=A.prev_length){for(F=A.strstart+A.lookahead-3,I=m._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-3),A.lookahead-=A.prev_length-1,A.prev_length-=2;++A.strstart<=F&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+3-1])&A.hash_mask,M=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),--A.prev_length!=0;);if(A.match_available=0,A.match_length=2,A.strstart++,I&&(C(A,!1),A.strm.avail_out===0))return 1}else if(A.match_available){if((I=m._tr_tally(A,0,A.window[A.strstart-1]))&&C(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return 1}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(I=m._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<2?A.strstart:2,H===4?(C(A,!0),A.strm.avail_out===0?3:4):A.last_lit&&(C(A,!1),A.strm.avail_out===0)?1:2}function T(A,H,M,I,F){this.good_length=A,this.max_lazy=H,this.nice_length=M,this.max_chain=I,this.func=F}function D(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new g.Buf16(1146),this.dyn_dtree=new g.Buf16(122),this.bl_tree=new g.Buf16(78),N(this.dyn_ltree),N(this.dyn_dtree),N(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new g.Buf16(16),this.heap=new g.Buf16(573),N(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new g.Buf16(573),N(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function q(A){var H;return A&&A.state?(A.total_in=A.total_out=0,A.data_type=2,(H=A.state).pending=0,H.pending_out=0,H.wrap<0&&(H.wrap=-H.wrap),H.status=H.wrap?42:P,A.adler=H.wrap===2?0:1,H.last_flush=0,m._tr_init(H),0):j(A,O)}function $(A){var H=q(A);return H===0&&(function(M){M.window_size=2*M.w_size,N(M.head),M.max_lazy_match=u[M.level].max_lazy,M.good_match=u[M.level].good_length,M.nice_match=u[M.level].nice_length,M.max_chain_length=u[M.level].max_chain,M.strstart=0,M.block_start=0,M.lookahead=0,M.insert=0,M.match_length=M.prev_length=2,M.match_available=0,M.ins_h=0})(A.state),H}function W(A,H,M,I,F,U){if(!A)return O;var X=1;if(H===-1&&(H=6),I<0?(X=0,I=-I):15<I&&(X=2,I-=16),F<1||9<F||M!==8||I<8||15<I||H<0||9<H||U<0||4<U)return j(A,O);I===8&&(I=9);var V=new D;return(A.state=V).strm=A,V.wrap=X,V.gzhead=null,V.w_bits=I,V.w_size=1<<V.w_bits,V.w_mask=V.w_size-1,V.hash_bits=F+7,V.hash_size=1<<V.hash_bits,V.hash_mask=V.hash_size-1,V.hash_shift=~~((V.hash_bits+3-1)/3),V.window=new g.Buf8(2*V.w_size),V.head=new g.Buf16(V.hash_size),V.prev=new g.Buf16(V.w_size),V.lit_bufsize=1<<F+6,V.pending_buf_size=4*V.lit_bufsize,V.pending_buf=new g.Buf8(V.pending_buf_size),V.d_buf=1*V.lit_bufsize,V.l_buf=3*V.lit_bufsize,V.level=H,V.strategy=U,V.method=M,$(A)}u=[new T(0,0,0,0,(function(A,H){var M=65535;for(M>A.pending_buf_size-5&&(M=A.pending_buf_size-5);;){if(A.lookahead<=1){if(w(A),A.lookahead===0&&H===0)return 1;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var I=A.block_start+M;if((A.strstart===0||A.strstart>=I)&&(A.lookahead=A.strstart-I,A.strstart=I,C(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-R&&(C(A,!1),A.strm.avail_out===0))return 1}return A.insert=0,H===4?(C(A,!0),A.strm.avail_out===0?3:4):(A.strstart>A.block_start&&(C(A,!1),A.strm.avail_out),1)})),new T(4,4,8,4,x),new T(4,5,16,8,x),new T(4,6,32,32,x),new T(4,4,16,16,_),new T(8,16,32,32,_),new T(8,16,128,128,_),new T(8,32,128,256,_),new T(32,128,258,1024,_),new T(32,258,258,4096,_)],d.deflateInit=function(A,H){return W(A,H,8,15,8,0)},d.deflateInit2=W,d.deflateReset=$,d.deflateResetKeep=q,d.deflateSetHeader=function(A,H){return A&&A.state?A.state.wrap!==2?O:(A.state.gzhead=H,0):O},d.deflate=function(A,H){var M,I,F,U;if(!A||!A.state||5<H||H<0)return A?j(A,O):O;if(I=A.state,!A.output||!A.input&&A.avail_in!==0||I.status===666&&H!==4)return j(A,A.avail_out===0?-5:O);if(I.strm=A,M=I.last_flush,I.last_flush=H,I.status===42)if(I.wrap===2)A.adler=0,E(I,31),E(I,139),E(I,8),I.gzhead?(E(I,(I.gzhead.text?1:0)+(I.gzhead.hcrc?2:0)+(I.gzhead.extra?4:0)+(I.gzhead.name?8:0)+(I.gzhead.comment?16:0)),E(I,255&I.gzhead.time),E(I,I.gzhead.time>>8&255),E(I,I.gzhead.time>>16&255),E(I,I.gzhead.time>>24&255),E(I,I.level===9?2:2<=I.strategy||I.level<2?4:0),E(I,255&I.gzhead.os),I.gzhead.extra&&I.gzhead.extra.length&&(E(I,255&I.gzhead.extra.length),E(I,I.gzhead.extra.length>>8&255)),I.gzhead.hcrc&&(A.adler=k(A.adler,I.pending_buf,I.pending,0)),I.gzindex=0,I.status=69):(E(I,0),E(I,0),E(I,0),E(I,0),E(I,0),E(I,I.level===9?2:2<=I.strategy||I.level<2?4:0),E(I,3),I.status=P);else{var X=8+(I.w_bits-8<<4)<<8;X|=(2<=I.strategy||I.level<2?0:I.level<6?1:I.level===6?2:3)<<6,I.strstart!==0&&(X|=32),X+=31-X%31,I.status=P,h(I,X),I.strstart!==0&&(h(I,A.adler>>>16),h(I,65535&A.adler)),A.adler=1}if(I.status===69)if(I.gzhead.extra){for(F=I.pending;I.gzindex<(65535&I.gzhead.extra.length)&&(I.pending!==I.pending_buf_size||(I.gzhead.hcrc&&I.pending>F&&(A.adler=k(A.adler,I.pending_buf,I.pending-F,F)),S(A),F=I.pending,I.pending!==I.pending_buf_size));)E(I,255&I.gzhead.extra[I.gzindex]),I.gzindex++;I.gzhead.hcrc&&I.pending>F&&(A.adler=k(A.adler,I.pending_buf,I.pending-F,F)),I.gzindex===I.gzhead.extra.length&&(I.gzindex=0,I.status=73)}else I.status=73;if(I.status===73)if(I.gzhead.name){F=I.pending;do{if(I.pending===I.pending_buf_size&&(I.gzhead.hcrc&&I.pending>F&&(A.adler=k(A.adler,I.pending_buf,I.pending-F,F)),S(A),F=I.pending,I.pending===I.pending_buf_size)){U=1;break}U=I.gzindex<I.gzhead.name.length?255&I.gzhead.name.charCodeAt(I.gzindex++):0,E(I,U)}while(U!==0);I.gzhead.hcrc&&I.pending>F&&(A.adler=k(A.adler,I.pending_buf,I.pending-F,F)),U===0&&(I.gzindex=0,I.status=91)}else I.status=91;if(I.status===91)if(I.gzhead.comment){F=I.pending;do{if(I.pending===I.pending_buf_size&&(I.gzhead.hcrc&&I.pending>F&&(A.adler=k(A.adler,I.pending_buf,I.pending-F,F)),S(A),F=I.pending,I.pending===I.pending_buf_size)){U=1;break}U=I.gzindex<I.gzhead.comment.length?255&I.gzhead.comment.charCodeAt(I.gzindex++):0,E(I,U)}while(U!==0);I.gzhead.hcrc&&I.pending>F&&(A.adler=k(A.adler,I.pending_buf,I.pending-F,F)),U===0&&(I.status=103)}else I.status=103;if(I.status===103&&(I.gzhead.hcrc?(I.pending+2>I.pending_buf_size&&S(A),I.pending+2<=I.pending_buf_size&&(E(I,255&A.adler),E(I,A.adler>>8&255),A.adler=0,I.status=P)):I.status=P),I.pending!==0){if(S(A),A.avail_out===0)return I.last_flush=-1,0}else if(A.avail_in===0&&z(H)<=z(M)&&H!==4)return j(A,-5);if(I.status===666&&A.avail_in!==0)return j(A,-5);if(A.avail_in!==0||I.lookahead!==0||H!==0&&I.status!==666){var V=I.strategy===2?(function(G,ee){for(var Z;;){if(G.lookahead===0&&(w(G),G.lookahead===0)){if(ee===0)return 1;break}if(G.match_length=0,Z=m._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++,Z&&(C(G,!1),G.strm.avail_out===0))return 1}return G.insert=0,ee===4?(C(G,!0),G.strm.avail_out===0?3:4):G.last_lit&&(C(G,!1),G.strm.avail_out===0)?1:2})(I,H):I.strategy===3?(function(G,ee){for(var Z,K,Q,J,ne=G.window;;){if(G.lookahead<=L){if(w(G),G.lookahead<=L&&ee===0)return 1;if(G.lookahead===0)break}if(G.match_length=0,G.lookahead>=3&&0<G.strstart&&(K=ne[Q=G.strstart-1])===ne[++Q]&&K===ne[++Q]&&K===ne[++Q]){J=G.strstart+L;do;while(K===ne[++Q]&&K===ne[++Q]&&K===ne[++Q]&&K===ne[++Q]&&K===ne[++Q]&&K===ne[++Q]&&K===ne[++Q]&&K===ne[++Q]&&Q<J);G.match_length=L-(J-Q),G.match_length>G.lookahead&&(G.match_length=G.lookahead)}if(G.match_length>=3?(Z=m._tr_tally(G,1,G.match_length-3),G.lookahead-=G.match_length,G.strstart+=G.match_length,G.match_length=0):(Z=m._tr_tally(G,0,G.window[G.strstart]),G.lookahead--,G.strstart++),Z&&(C(G,!1),G.strm.avail_out===0))return 1}return G.insert=0,ee===4?(C(G,!0),G.strm.avail_out===0?3:4):G.last_lit&&(C(G,!1),G.strm.avail_out===0)?1:2})(I,H):u[I.level].func(I,H);if(V!==3&&V!==4||(I.status=666),V===1||V===3)return A.avail_out===0&&(I.last_flush=-1),0;if(V===2&&(H===1?m._tr_align(I):H!==5&&(m._tr_stored_block(I,0,0,!1),H===3&&(N(I.head),I.lookahead===0&&(I.strstart=0,I.block_start=0,I.insert=0))),S(A),A.avail_out===0))return I.last_flush=-1,0}return H!==4?0:I.wrap<=0?1:(I.wrap===2?(E(I,255&A.adler),E(I,A.adler>>8&255),E(I,A.adler>>16&255),E(I,A.adler>>24&255),E(I,255&A.total_in),E(I,A.total_in>>8&255),E(I,A.total_in>>16&255),E(I,A.total_in>>24&255)):(h(I,A.adler>>>16),h(I,65535&A.adler)),S(A),0<I.wrap&&(I.wrap=-I.wrap),I.pending!==0?0:1)},d.deflateEnd=function(A){var H;return A&&A.state?(H=A.state.status)!==42&&H!==69&&H!==73&&H!==91&&H!==103&&H!==P&&H!==666?j(A,O):(A.state=null,H===P?j(A,-3):0):O},d.deflateSetDictionary=function(A,H){var M,I,F,U,X,V,G,ee,Z=H.length;if(!A||!A.state||(U=(M=A.state).wrap)===2||U===1&&M.status!==42||M.lookahead)return O;for(U===1&&(A.adler=v(A.adler,H,Z,0)),M.wrap=0,Z>=M.w_size&&(U===0&&(N(M.head),M.strstart=0,M.block_start=0,M.insert=0),ee=new g.Buf8(M.w_size),g.arraySet(ee,H,Z-M.w_size,M.w_size,0),H=ee,Z=M.w_size),X=A.avail_in,V=A.next_in,G=A.input,A.avail_in=Z,A.next_in=0,A.input=H,w(M);M.lookahead>=3;){for(I=M.strstart,F=M.lookahead-2;M.ins_h=(M.ins_h<<M.hash_shift^M.window[I+3-1])&M.hash_mask,M.prev[I&M.w_mask]=M.head[M.ins_h],M.head[M.ins_h]=I,I++,--F;);M.strstart=I,M.lookahead=2,w(M)}return M.strstart+=M.lookahead,M.block_start=M.strstart,M.insert=M.lookahead,M.lookahead=0,M.match_length=M.prev_length=2,M.match_available=0,A.next_in=V,A.input=G,A.avail_in=X,M.wrap=U,0},d.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(s,f,d){f.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(s,f,d){f.exports=function(u,g){var m,v,k,B,O,L,R,P,j,z,N,S,C,E,h,y,w,x,_,T,D,q,$,W,A;m=u.state,v=u.next_in,W=u.input,k=v+(u.avail_in-5),B=u.next_out,A=u.output,O=B-(g-u.avail_out),L=B+(u.avail_out-257),R=m.dmax,P=m.wsize,j=m.whave,z=m.wnext,N=m.window,S=m.hold,C=m.bits,E=m.lencode,h=m.distcode,y=(1<<m.lenbits)-1,w=(1<<m.distbits)-1;e:do{C<15&&(S+=W[v++]<<C,C+=8,S+=W[v++]<<C,C+=8),x=E[S&y];t:for(;;){if(S>>>=_=x>>>24,C-=_,(_=x>>>16&255)==0)A[B++]=65535&x;else{if(!(16&_)){if((64&_)==0){x=E[(65535&x)+(S&(1<<_)-1)];continue t}if(32&_){m.mode=12;break e}u.msg="invalid literal/length code",m.mode=30;break e}T=65535&x,(_&=15)&&(C<_&&(S+=W[v++]<<C,C+=8),T+=S&(1<<_)-1,S>>>=_,C-=_),C<15&&(S+=W[v++]<<C,C+=8,S+=W[v++]<<C,C+=8),x=h[S&w];r:for(;;){if(S>>>=_=x>>>24,C-=_,!(16&(_=x>>>16&255))){if((64&_)==0){x=h[(65535&x)+(S&(1<<_)-1)];continue r}u.msg="invalid distance code",m.mode=30;break e}if(D=65535&x,C<(_&=15)&&(S+=W[v++]<<C,(C+=8)<_&&(S+=W[v++]<<C,C+=8)),R<(D+=S&(1<<_)-1)){u.msg="invalid distance too far back",m.mode=30;break e}if(S>>>=_,C-=_,(_=B-O)<D){if(j<(_=D-_)&&m.sane){u.msg="invalid distance too far back",m.mode=30;break e}if($=N,(q=0)===z){if(q+=P-_,_<T){for(T-=_;A[B++]=N[q++],--_;);q=B-D,$=A}}else if(z<_){if(q+=P+z-_,(_-=z)<T){for(T-=_;A[B++]=N[q++],--_;);if(q=0,z<T){for(T-=_=z;A[B++]=N[q++],--_;);q=B-D,$=A}}}else if(q+=z-_,_<T){for(T-=_;A[B++]=N[q++],--_;);q=B-D,$=A}for(;2<T;)A[B++]=$[q++],A[B++]=$[q++],A[B++]=$[q++],T-=3;T&&(A[B++]=$[q++],1<T&&(A[B++]=$[q++]))}else{for(q=B-D;A[B++]=A[q++],A[B++]=A[q++],A[B++]=A[q++],2<(T-=3););T&&(A[B++]=A[q++],1<T&&(A[B++]=A[q++]))}break}}break}}while(v<k&&B<L);v-=T=C>>3,S&=(1<<(C-=T<<3))-1,u.next_in=v,u.next_out=B,u.avail_in=v<k?k-v+5:5-(v-k),u.avail_out=B<L?L-B+257:257-(B-L),m.hold=S,m.bits=C}},{}],49:[function(s,f,d){var u=s("../utils/common"),g=s("./adler32"),m=s("./crc32"),v=s("./inffast"),k=s("./inftrees"),B=-2;function O(y){return(y>>>24&255)+(y>>>8&65280)+((65280&y)<<8)+((255&y)<<24)}function L(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new u.Buf16(320),this.work=new u.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function R(y){var w;return y&&y.state?(w=y.state,y.total_in=y.total_out=w.total=0,y.msg="",w.wrap&&(y.adler=1&w.wrap),w.mode=1,w.last=0,w.havedict=0,w.dmax=32768,w.head=null,w.hold=0,w.bits=0,w.lencode=w.lendyn=new u.Buf32(852),w.distcode=w.distdyn=new u.Buf32(592),w.sane=1,w.back=-1,0):B}function P(y){var w;return y&&y.state?((w=y.state).wsize=0,w.whave=0,w.wnext=0,R(y)):B}function j(y,w){var x,_;return y&&y.state?(_=y.state,w<0?(x=0,w=-w):(x=1+(w>>4),w<48&&(w&=15)),w&&(w<8||15<w)?B:(_.window!==null&&_.wbits!==w&&(_.window=null),_.wrap=x,_.wbits=w,P(y))):B}function z(y,w){var x,_;return y?(_=new L,(y.state=_).window=null,(x=j(y,w))!==0&&(y.state=null),x):B}var N,S,C=!0;function E(y){if(C){var w;for(N=new u.Buf32(512),S=new u.Buf32(32),w=0;w<144;)y.lens[w++]=8;for(;w<256;)y.lens[w++]=9;for(;w<280;)y.lens[w++]=7;for(;w<288;)y.lens[w++]=8;for(k(1,y.lens,0,288,N,0,y.work,{bits:9}),w=0;w<32;)y.lens[w++]=5;k(2,y.lens,0,32,S,0,y.work,{bits:5}),C=!1}y.lencode=N,y.lenbits=9,y.distcode=S,y.distbits=5}function h(y,w,x,_){var T,D=y.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new u.Buf8(D.wsize)),_>=D.wsize?(u.arraySet(D.window,w,x-D.wsize,D.wsize,0),D.wnext=0,D.whave=D.wsize):(_<(T=D.wsize-D.wnext)&&(T=_),u.arraySet(D.window,w,x-_,T,D.wnext),(_-=T)?(u.arraySet(D.window,w,x-_,_,0),D.wnext=_,D.whave=D.wsize):(D.wnext+=T,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=T))),0}d.inflateReset=P,d.inflateReset2=j,d.inflateResetKeep=R,d.inflateInit=function(y){return z(y,15)},d.inflateInit2=z,d.inflate=function(y,w){var x,_,T,D,q,$,W,A,H,M,I,F,U,X,V,G,ee,Z,K,Q,J,ne,ie,le,re=0,se=new u.Buf8(4),be=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!y||!y.state||!y.output||!y.input&&y.avail_in!==0)return B;(x=y.state).mode===12&&(x.mode=13),q=y.next_out,T=y.output,W=y.avail_out,D=y.next_in,_=y.input,$=y.avail_in,A=x.hold,H=x.bits,M=$,I=W,ne=0;e:for(;;)switch(x.mode){case 1:if(x.wrap===0){x.mode=13;break}for(;H<16;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(2&x.wrap&&A===35615){se[x.check=0]=255&A,se[1]=A>>>8&255,x.check=m(x.check,se,2,0),H=A=0,x.mode=2;break}if(x.flags=0,x.head&&(x.head.done=!1),!(1&x.wrap)||(((255&A)<<8)+(A>>8))%31){y.msg="incorrect header check",x.mode=30;break}if((15&A)!=8){y.msg="unknown compression method",x.mode=30;break}if(H-=4,J=8+(15&(A>>>=4)),x.wbits===0)x.wbits=J;else if(J>x.wbits){y.msg="invalid window size",x.mode=30;break}x.dmax=1<<J,y.adler=x.check=1,x.mode=512&A?10:12,H=A=0;break;case 2:for(;H<16;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(x.flags=A,(255&x.flags)!=8){y.msg="unknown compression method",x.mode=30;break}if(57344&x.flags){y.msg="unknown header flags set",x.mode=30;break}x.head&&(x.head.text=A>>8&1),512&x.flags&&(se[0]=255&A,se[1]=A>>>8&255,x.check=m(x.check,se,2,0)),H=A=0,x.mode=3;case 3:for(;H<32;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}x.head&&(x.head.time=A),512&x.flags&&(se[0]=255&A,se[1]=A>>>8&255,se[2]=A>>>16&255,se[3]=A>>>24&255,x.check=m(x.check,se,4,0)),H=A=0,x.mode=4;case 4:for(;H<16;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}x.head&&(x.head.xflags=255&A,x.head.os=A>>8),512&x.flags&&(se[0]=255&A,se[1]=A>>>8&255,x.check=m(x.check,se,2,0)),H=A=0,x.mode=5;case 5:if(1024&x.flags){for(;H<16;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}x.length=A,x.head&&(x.head.extra_len=A),512&x.flags&&(se[0]=255&A,se[1]=A>>>8&255,x.check=m(x.check,se,2,0)),H=A=0}else x.head&&(x.head.extra=null);x.mode=6;case 6:if(1024&x.flags&&($<(F=x.length)&&(F=$),F&&(x.head&&(J=x.head.extra_len-x.length,x.head.extra||(x.head.extra=new Array(x.head.extra_len)),u.arraySet(x.head.extra,_,D,F,J)),512&x.flags&&(x.check=m(x.check,_,F,D)),$-=F,D+=F,x.length-=F),x.length))break e;x.length=0,x.mode=7;case 7:if(2048&x.flags){if($===0)break e;for(F=0;J=_[D+F++],x.head&&J&&x.length<65536&&(x.head.name+=String.fromCharCode(J)),J&&F<$;);if(512&x.flags&&(x.check=m(x.check,_,F,D)),$-=F,D+=F,J)break e}else x.head&&(x.head.name=null);x.length=0,x.mode=8;case 8:if(4096&x.flags){if($===0)break e;for(F=0;J=_[D+F++],x.head&&J&&x.length<65536&&(x.head.comment+=String.fromCharCode(J)),J&&F<$;);if(512&x.flags&&(x.check=m(x.check,_,F,D)),$-=F,D+=F,J)break e}else x.head&&(x.head.comment=null);x.mode=9;case 9:if(512&x.flags){for(;H<16;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(A!==(65535&x.check)){y.msg="header crc mismatch",x.mode=30;break}H=A=0}x.head&&(x.head.hcrc=x.flags>>9&1,x.head.done=!0),y.adler=x.check=0,x.mode=12;break;case 10:for(;H<32;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}y.adler=x.check=O(A),H=A=0,x.mode=11;case 11:if(x.havedict===0)return y.next_out=q,y.avail_out=W,y.next_in=D,y.avail_in=$,x.hold=A,x.bits=H,2;y.adler=x.check=1,x.mode=12;case 12:if(w===5||w===6)break e;case 13:if(x.last){A>>>=7&H,H-=7&H,x.mode=27;break}for(;H<3;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}switch(x.last=1&A,H-=1,3&(A>>>=1)){case 0:x.mode=14;break;case 1:if(E(x),x.mode=20,w!==6)break;A>>>=2,H-=2;break e;case 2:x.mode=17;break;case 3:y.msg="invalid block type",x.mode=30}A>>>=2,H-=2;break;case 14:for(A>>>=7&H,H-=7&H;H<32;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if((65535&A)!=(A>>>16^65535)){y.msg="invalid stored block lengths",x.mode=30;break}if(x.length=65535&A,H=A=0,x.mode=15,w===6)break e;case 15:x.mode=16;case 16:if(F=x.length){if($<F&&(F=$),W<F&&(F=W),F===0)break e;u.arraySet(T,_,D,F,q),$-=F,D+=F,W-=F,q+=F,x.length-=F;break}x.mode=12;break;case 17:for(;H<14;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(x.nlen=257+(31&A),A>>>=5,H-=5,x.ndist=1+(31&A),A>>>=5,H-=5,x.ncode=4+(15&A),A>>>=4,H-=4,286<x.nlen||30<x.ndist){y.msg="too many length or distance symbols",x.mode=30;break}x.have=0,x.mode=18;case 18:for(;x.have<x.ncode;){for(;H<3;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}x.lens[be[x.have++]]=7&A,A>>>=3,H-=3}for(;x.have<19;)x.lens[be[x.have++]]=0;if(x.lencode=x.lendyn,x.lenbits=7,ie={bits:x.lenbits},ne=k(0,x.lens,0,19,x.lencode,0,x.work,ie),x.lenbits=ie.bits,ne){y.msg="invalid code lengths set",x.mode=30;break}x.have=0,x.mode=19;case 19:for(;x.have<x.nlen+x.ndist;){for(;G=(re=x.lencode[A&(1<<x.lenbits)-1])>>>16&255,ee=65535&re,!((V=re>>>24)<=H);){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(ee<16)A>>>=V,H-=V,x.lens[x.have++]=ee;else{if(ee===16){for(le=V+2;H<le;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(A>>>=V,H-=V,x.have===0){y.msg="invalid bit length repeat",x.mode=30;break}J=x.lens[x.have-1],F=3+(3&A),A>>>=2,H-=2}else if(ee===17){for(le=V+3;H<le;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}H-=V,J=0,F=3+(7&(A>>>=V)),A>>>=3,H-=3}else{for(le=V+7;H<le;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}H-=V,J=0,F=11+(127&(A>>>=V)),A>>>=7,H-=7}if(x.have+F>x.nlen+x.ndist){y.msg="invalid bit length repeat",x.mode=30;break}for(;F--;)x.lens[x.have++]=J}}if(x.mode===30)break;if(x.lens[256]===0){y.msg="invalid code -- missing end-of-block",x.mode=30;break}if(x.lenbits=9,ie={bits:x.lenbits},ne=k(1,x.lens,0,x.nlen,x.lencode,0,x.work,ie),x.lenbits=ie.bits,ne){y.msg="invalid literal/lengths set",x.mode=30;break}if(x.distbits=6,x.distcode=x.distdyn,ie={bits:x.distbits},ne=k(2,x.lens,x.nlen,x.ndist,x.distcode,0,x.work,ie),x.distbits=ie.bits,ne){y.msg="invalid distances set",x.mode=30;break}if(x.mode=20,w===6)break e;case 20:x.mode=21;case 21:if(6<=$&&258<=W){y.next_out=q,y.avail_out=W,y.next_in=D,y.avail_in=$,x.hold=A,x.bits=H,v(y,I),q=y.next_out,T=y.output,W=y.avail_out,D=y.next_in,_=y.input,$=y.avail_in,A=x.hold,H=x.bits,x.mode===12&&(x.back=-1);break}for(x.back=0;G=(re=x.lencode[A&(1<<x.lenbits)-1])>>>16&255,ee=65535&re,!((V=re>>>24)<=H);){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(G&&(240&G)==0){for(Z=V,K=G,Q=ee;G=(re=x.lencode[Q+((A&(1<<Z+K)-1)>>Z)])>>>16&255,ee=65535&re,!(Z+(V=re>>>24)<=H);){if($===0)break e;$--,A+=_[D++]<<H,H+=8}A>>>=Z,H-=Z,x.back+=Z}if(A>>>=V,H-=V,x.back+=V,x.length=ee,G===0){x.mode=26;break}if(32&G){x.back=-1,x.mode=12;break}if(64&G){y.msg="invalid literal/length code",x.mode=30;break}x.extra=15&G,x.mode=22;case 22:if(x.extra){for(le=x.extra;H<le;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}x.length+=A&(1<<x.extra)-1,A>>>=x.extra,H-=x.extra,x.back+=x.extra}x.was=x.length,x.mode=23;case 23:for(;G=(re=x.distcode[A&(1<<x.distbits)-1])>>>16&255,ee=65535&re,!((V=re>>>24)<=H);){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if((240&G)==0){for(Z=V,K=G,Q=ee;G=(re=x.distcode[Q+((A&(1<<Z+K)-1)>>Z)])>>>16&255,ee=65535&re,!(Z+(V=re>>>24)<=H);){if($===0)break e;$--,A+=_[D++]<<H,H+=8}A>>>=Z,H-=Z,x.back+=Z}if(A>>>=V,H-=V,x.back+=V,64&G){y.msg="invalid distance code",x.mode=30;break}x.offset=ee,x.extra=15&G,x.mode=24;case 24:if(x.extra){for(le=x.extra;H<le;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}x.offset+=A&(1<<x.extra)-1,A>>>=x.extra,H-=x.extra,x.back+=x.extra}if(x.offset>x.dmax){y.msg="invalid distance too far back",x.mode=30;break}x.mode=25;case 25:if(W===0)break e;if(F=I-W,x.offset>F){if((F=x.offset-F)>x.whave&&x.sane){y.msg="invalid distance too far back",x.mode=30;break}U=F>x.wnext?(F-=x.wnext,x.wsize-F):x.wnext-F,F>x.length&&(F=x.length),X=x.window}else X=T,U=q-x.offset,F=x.length;for(W<F&&(F=W),W-=F,x.length-=F;T[q++]=X[U++],--F;);x.length===0&&(x.mode=21);break;case 26:if(W===0)break e;T[q++]=x.length,W--,x.mode=21;break;case 27:if(x.wrap){for(;H<32;){if($===0)break e;$--,A|=_[D++]<<H,H+=8}if(I-=W,y.total_out+=I,x.total+=I,I&&(y.adler=x.check=x.flags?m(x.check,T,I,q-I):g(x.check,T,I,q-I)),I=W,(x.flags?A:O(A))!==x.check){y.msg="incorrect data check",x.mode=30;break}H=A=0}x.mode=28;case 28:if(x.wrap&&x.flags){for(;H<32;){if($===0)break e;$--,A+=_[D++]<<H,H+=8}if(A!==(4294967295&x.total)){y.msg="incorrect length check",x.mode=30;break}H=A=0}x.mode=29;case 29:ne=1;break e;case 30:ne=-3;break e;case 31:return-4;default:return B}return y.next_out=q,y.avail_out=W,y.next_in=D,y.avail_in=$,x.hold=A,x.bits=H,(x.wsize||I!==y.avail_out&&x.mode<30&&(x.mode<27||w!==4))&&h(y,y.output,y.next_out,I-y.avail_out)?(x.mode=31,-4):(M-=y.avail_in,I-=y.avail_out,y.total_in+=M,y.total_out+=I,x.total+=I,x.wrap&&I&&(y.adler=x.check=x.flags?m(x.check,T,I,y.next_out-I):g(x.check,T,I,y.next_out-I)),y.data_type=x.bits+(x.last?64:0)+(x.mode===12?128:0)+(x.mode===20||x.mode===15?256:0),(M==0&&I===0||w===4)&&ne===0&&(ne=-5),ne)},d.inflateEnd=function(y){if(!y||!y.state)return B;var w=y.state;return w.window&&(w.window=null),y.state=null,0},d.inflateGetHeader=function(y,w){var x;return y&&y.state?(2&(x=y.state).wrap)==0?B:((x.head=w).done=!1,0):B},d.inflateSetDictionary=function(y,w){var x,_=w.length;return y&&y.state?(x=y.state).wrap!==0&&x.mode!==11?B:x.mode===11&&g(1,w,_,0)!==x.check?-3:h(y,w,_,_)?(x.mode=31,-4):(x.havedict=1,0):B},d.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(s,f,d){var u=s("../utils/common"),g=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],m=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],v=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],k=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];f.exports=function(B,O,L,R,P,j,z,N){var S,C,E,h,y,w,x,_,T,D=N.bits,q=0,$=0,W=0,A=0,H=0,M=0,I=0,F=0,U=0,X=0,V=null,G=0,ee=new u.Buf16(16),Z=new u.Buf16(16),K=null,Q=0;for(q=0;q<=15;q++)ee[q]=0;for($=0;$<R;$++)ee[O[L+$]]++;for(H=D,A=15;1<=A&&ee[A]===0;A--);if(A<H&&(H=A),A===0)return P[j++]=20971520,P[j++]=20971520,N.bits=1,0;for(W=1;W<A&&ee[W]===0;W++);for(H<W&&(H=W),q=F=1;q<=15;q++)if(F<<=1,(F-=ee[q])<0)return-1;if(0<F&&(B===0||A!==1))return-1;for(Z[1]=0,q=1;q<15;q++)Z[q+1]=Z[q]+ee[q];for($=0;$<R;$++)O[L+$]!==0&&(z[Z[O[L+$]]++]=$);if(w=B===0?(V=K=z,19):B===1?(V=g,G-=257,K=m,Q-=257,256):(V=v,K=k,-1),q=W,y=j,I=$=X=0,E=-1,h=(U=1<<(M=H))-1,B===1&&852<U||B===2&&592<U)return 1;for(;;){for(x=q-I,T=z[$]<w?(_=0,z[$]):z[$]>w?(_=K[Q+z[$]],V[G+z[$]]):(_=96,0),S=1<<q-I,W=C=1<<M;P[y+(X>>I)+(C-=S)]=x<<24|_<<16|T|0,C!==0;);for(S=1<<q-1;X&S;)S>>=1;if(S!==0?(X&=S-1,X+=S):X=0,$++,--ee[q]==0){if(q===A)break;q=O[L+z[$]]}if(H<q&&(X&h)!==E){for(I===0&&(I=H),y+=W,F=1<<(M=q-I);M+I<A&&!((F-=ee[M+I])<=0);)M++,F<<=1;if(U+=1<<M,B===1&&852<U||B===2&&592<U)return 1;P[E=X&h]=H<<24|M<<16|y-j|0}}return X!==0&&(P[y+X]=q-I<<24|64<<16|0),N.bits=H,0}},{"../utils/common":41}],51:[function(s,f,d){f.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(s,f,d){var u=s("../utils/common");function g(K){for(var Q=K.length;0<=--Q;)K[Q]=0}var m=256,v=286,k=30,B=15,O=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],L=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],j=new Array(576);g(j);var z=new Array(60);g(z);var N=new Array(512);g(N);var S=new Array(256);g(S);var C=new Array(29);g(C);var E,h,y,w=new Array(k);function x(K,Q,J,ne,ie){this.static_tree=K,this.extra_bits=Q,this.extra_base=J,this.elems=ne,this.max_length=ie,this.has_stree=K&&K.length}function _(K,Q){this.dyn_tree=K,this.max_code=0,this.stat_desc=Q}function T(K){return K<256?N[K]:N[256+(K>>>7)]}function D(K,Q){K.pending_buf[K.pending++]=255&Q,K.pending_buf[K.pending++]=Q>>>8&255}function q(K,Q,J){K.bi_valid>16-J?(K.bi_buf|=Q<<K.bi_valid&65535,D(K,K.bi_buf),K.bi_buf=Q>>16-K.bi_valid,K.bi_valid+=J-16):(K.bi_buf|=Q<<K.bi_valid&65535,K.bi_valid+=J)}function $(K,Q,J){q(K,J[2*Q],J[2*Q+1])}function W(K,Q){for(var J=0;J|=1&K,K>>>=1,J<<=1,0<--Q;);return J>>>1}function A(K,Q,J){var ne,ie,le=new Array(16),re=0;for(ne=1;ne<=B;ne++)le[ne]=re=re+J[ne-1]<<1;for(ie=0;ie<=Q;ie++){var se=K[2*ie+1];se!==0&&(K[2*ie]=W(le[se]++,se))}}function H(K){var Q;for(Q=0;Q<v;Q++)K.dyn_ltree[2*Q]=0;for(Q=0;Q<k;Q++)K.dyn_dtree[2*Q]=0;for(Q=0;Q<19;Q++)K.bl_tree[2*Q]=0;K.dyn_ltree[512]=1,K.opt_len=K.static_len=0,K.last_lit=K.matches=0}function M(K){8<K.bi_valid?D(K,K.bi_buf):0<K.bi_valid&&(K.pending_buf[K.pending++]=K.bi_buf),K.bi_buf=0,K.bi_valid=0}function I(K,Q,J,ne){var ie=2*Q,le=2*J;return K[ie]<K[le]||K[ie]===K[le]&&ne[Q]<=ne[J]}function F(K,Q,J){for(var ne=K.heap[J],ie=J<<1;ie<=K.heap_len&&(ie<K.heap_len&&I(Q,K.heap[ie+1],K.heap[ie],K.depth)&&ie++,!I(Q,ne,K.heap[ie],K.depth));)K.heap[J]=K.heap[ie],J=ie,ie<<=1;K.heap[J]=ne}function U(K,Q,J){var ne,ie,le,re,se=0;if(K.last_lit!==0)for(;ne=K.pending_buf[K.d_buf+2*se]<<8|K.pending_buf[K.d_buf+2*se+1],ie=K.pending_buf[K.l_buf+se],se++,ne===0?$(K,ie,Q):($(K,(le=S[ie])+m+1,Q),(re=O[le])!==0&&q(K,ie-=C[le],re),$(K,le=T(--ne),J),(re=L[le])!==0&&q(K,ne-=w[le],re)),se<K.last_lit;);$(K,256,Q)}function X(K,Q){var J,ne,ie,le=Q.dyn_tree,re=Q.stat_desc.static_tree,se=Q.stat_desc.has_stree,be=Q.stat_desc.elems,ye=-1;for(K.heap_len=0,K.heap_max=573,J=0;J<be;J++)le[2*J]!==0?(K.heap[++K.heap_len]=ye=J,K.depth[J]=0):le[2*J+1]=0;for(;K.heap_len<2;)le[2*(ie=K.heap[++K.heap_len]=ye<2?++ye:0)]=1,K.depth[ie]=0,K.opt_len--,se&&(K.static_len-=re[2*ie+1]);for(Q.max_code=ye,J=K.heap_len>>1;1<=J;J--)F(K,le,J);for(ie=be;J=K.heap[1],K.heap[1]=K.heap[K.heap_len--],F(K,le,1),ne=K.heap[1],K.heap[--K.heap_max]=J,K.heap[--K.heap_max]=ne,le[2*ie]=le[2*J]+le[2*ne],K.depth[ie]=(K.depth[J]>=K.depth[ne]?K.depth[J]:K.depth[ne])+1,le[2*J+1]=le[2*ne+1]=ie,K.heap[1]=ie++,F(K,le,1),2<=K.heap_len;);K.heap[--K.heap_max]=K.heap[1],(function(Fe,Ce){var ae,De,Be,ke,Re,we,ve=Ce.dyn_tree,Ze=Ce.max_code,Se=Ce.stat_desc.static_tree,de=Ce.stat_desc.has_stree,Ee=Ce.stat_desc.extra_bits,_e=Ce.stat_desc.extra_base,Ie=Ce.stat_desc.max_length,ot=0;for(ke=0;ke<=B;ke++)Fe.bl_count[ke]=0;for(ve[2*Fe.heap[Fe.heap_max]+1]=0,ae=Fe.heap_max+1;ae<573;ae++)Ie<(ke=ve[2*ve[2*(De=Fe.heap[ae])+1]+1]+1)&&(ke=Ie,ot++),ve[2*De+1]=ke,Ze<De||(Fe.bl_count[ke]++,Re=0,_e<=De&&(Re=Ee[De-_e]),we=ve[2*De],Fe.opt_len+=we*(ke+Re),de&&(Fe.static_len+=we*(Se[2*De+1]+Re)));if(ot!==0){do{for(ke=Ie-1;Fe.bl_count[ke]===0;)ke--;Fe.bl_count[ke]--,Fe.bl_count[ke+1]+=2,Fe.bl_count[Ie]--,ot-=2}while(0<ot);for(ke=Ie;ke!==0;ke--)for(De=Fe.bl_count[ke];De!==0;)Ze<(Be=Fe.heap[--ae])||(ve[2*Be+1]!==ke&&(Fe.opt_len+=(ke-ve[2*Be+1])*ve[2*Be],ve[2*Be+1]=ke),De--)}})(K,Q),A(le,ye,K.bl_count)}function V(K,Q,J){var ne,ie,le=-1,re=Q[1],se=0,be=7,ye=4;for(re===0&&(be=138,ye=3),Q[2*(J+1)+1]=65535,ne=0;ne<=J;ne++)ie=re,re=Q[2*(ne+1)+1],++se<be&&ie===re||(se<ye?K.bl_tree[2*ie]+=se:ie!==0?(ie!==le&&K.bl_tree[2*ie]++,K.bl_tree[32]++):se<=10?K.bl_tree[34]++:K.bl_tree[36]++,le=ie,ye=(se=0)===re?(be=138,3):ie===re?(be=6,3):(be=7,4))}function G(K,Q,J){var ne,ie,le=-1,re=Q[1],se=0,be=7,ye=4;for(re===0&&(be=138,ye=3),ne=0;ne<=J;ne++)if(ie=re,re=Q[2*(ne+1)+1],!(++se<be&&ie===re)){if(se<ye)for(;$(K,ie,K.bl_tree),--se!=0;);else ie!==0?(ie!==le&&($(K,ie,K.bl_tree),se--),$(K,16,K.bl_tree),q(K,se-3,2)):se<=10?($(K,17,K.bl_tree),q(K,se-3,3)):($(K,18,K.bl_tree),q(K,se-11,7));le=ie,ye=(se=0)===re?(be=138,3):ie===re?(be=6,3):(be=7,4)}}g(w);var ee=!1;function Z(K,Q,J,ne){q(K,0+(ne?1:0),3),(function(ie,le,re,se){M(ie),D(ie,re),D(ie,~re),u.arraySet(ie.pending_buf,ie.window,le,re,ie.pending),ie.pending+=re})(K,Q,J)}d._tr_init=function(K){ee||((function(){var Q,J,ne,ie,le,re=new Array(16);for(ie=ne=0;ie<28;ie++)for(C[ie]=ne,Q=0;Q<1<<O[ie];Q++)S[ne++]=ie;for(S[ne-1]=ie,ie=le=0;ie<16;ie++)for(w[ie]=le,Q=0;Q<1<<L[ie];Q++)N[le++]=ie;for(le>>=7;ie<k;ie++)for(w[ie]=le<<7,Q=0;Q<1<<L[ie]-7;Q++)N[256+le++]=ie;for(J=0;J<=B;J++)re[J]=0;for(Q=0;Q<=143;)j[2*Q+1]=8,Q++,re[8]++;for(;Q<=255;)j[2*Q+1]=9,Q++,re[9]++;for(;Q<=279;)j[2*Q+1]=7,Q++,re[7]++;for(;Q<=287;)j[2*Q+1]=8,Q++,re[8]++;for(A(j,287,re),Q=0;Q<k;Q++)z[2*Q+1]=5,z[2*Q]=W(Q,5);E=new x(j,O,257,v,B),h=new x(z,L,0,k,B),y=new x(new Array(0),R,0,19,7)})(),ee=!0),K.l_desc=new _(K.dyn_ltree,E),K.d_desc=new _(K.dyn_dtree,h),K.bl_desc=new _(K.bl_tree,y),K.bi_buf=0,K.bi_valid=0,H(K)},d._tr_stored_block=Z,d._tr_flush_block=function(K,Q,J,ne){var ie,le,re=0;0<K.level?(K.strm.data_type===2&&(K.strm.data_type=(function(se){var be,ye=4093624447;for(be=0;be<=31;be++,ye>>>=1)if(1&ye&&se.dyn_ltree[2*be]!==0)return 0;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return 1;for(be=32;be<m;be++)if(se.dyn_ltree[2*be]!==0)return 1;return 0})(K)),X(K,K.l_desc),X(K,K.d_desc),re=(function(se){var be;for(V(se,se.dyn_ltree,se.l_desc.max_code),V(se,se.dyn_dtree,se.d_desc.max_code),X(se,se.bl_desc),be=18;3<=be&&se.bl_tree[2*P[be]+1]===0;be--);return se.opt_len+=3*(be+1)+5+5+4,be})(K),ie=K.opt_len+3+7>>>3,(le=K.static_len+3+7>>>3)<=ie&&(ie=le)):ie=le=J+5,J+4<=ie&&Q!==-1?Z(K,Q,J,ne):K.strategy===4||le===ie?(q(K,2+(ne?1:0),3),U(K,j,z)):(q(K,4+(ne?1:0),3),(function(se,be,ye,Fe){var Ce;for(q(se,be-257,5),q(se,ye-1,5),q(se,Fe-4,4),Ce=0;Ce<Fe;Ce++)q(se,se.bl_tree[2*P[Ce]+1],3);G(se,se.dyn_ltree,be-1),G(se,se.dyn_dtree,ye-1)})(K,K.l_desc.max_code+1,K.d_desc.max_code+1,re+1),U(K,K.dyn_ltree,K.dyn_dtree)),H(K),ne&&M(K)},d._tr_tally=function(K,Q,J){return K.pending_buf[K.d_buf+2*K.last_lit]=Q>>>8&255,K.pending_buf[K.d_buf+2*K.last_lit+1]=255&Q,K.pending_buf[K.l_buf+K.last_lit]=255&J,K.last_lit++,Q===0?K.dyn_ltree[2*J]++:(K.matches++,Q--,K.dyn_ltree[2*(S[J]+m+1)]++,K.dyn_dtree[2*T(Q)]++),K.last_lit===K.lit_bufsize-1},d._tr_align=function(K){q(K,2,3),$(K,256,j),(function(Q){Q.bi_valid===16?(D(Q,Q.bi_buf),Q.bi_buf=0,Q.bi_valid=0):8<=Q.bi_valid&&(Q.pending_buf[Q.pending++]=255&Q.bi_buf,Q.bi_buf>>=8,Q.bi_valid-=8)})(K)}},{"../utils/common":41}],53:[function(s,f,d){f.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(s,f,d){(function(u){(function(g,m){if(!g.setImmediate){var v,k,B,O,L=1,R={},P=!1,j=g.document,z=Object.getPrototypeOf&&Object.getPrototypeOf(g);z=z&&z.setTimeout?z:g,v={}.toString.call(g.process)==="[object process]"?function(E){c.nextTick((function(){S(E)}))}:(function(){if(g.postMessage&&!g.importScripts){var E=!0,h=g.onmessage;return g.onmessage=function(){E=!1},g.postMessage("","*"),g.onmessage=h,E}})()?(O="setImmediate$"+Math.random()+"$",g.addEventListener?g.addEventListener("message",C,!1):g.attachEvent("onmessage",C),function(E){g.postMessage(O+E,"*")}):g.MessageChannel?((B=new MessageChannel).port1.onmessage=function(E){S(E.data)},function(E){B.port2.postMessage(E)}):j&&"onreadystatechange"in j.createElement("script")?(k=j.documentElement,function(E){var h=j.createElement("script");h.onreadystatechange=function(){S(E),h.onreadystatechange=null,k.removeChild(h),h=null},k.appendChild(h)}):function(E){setTimeout(S,0,E)},z.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var h=new Array(arguments.length-1),y=0;y<h.length;y++)h[y]=arguments[y+1];var w={callback:E,args:h};return R[L]=w,v(L),L++},z.clearImmediate=N}function N(E){delete R[E]}function S(E){if(P)setTimeout(S,0,E);else{var h=R[E];if(h){P=!0;try{(function(y){var w=y.callback,x=y.args;switch(x.length){case 0:w();break;case 1:w(x[0]);break;case 2:w(x[0],x[1]);break;case 3:w(x[0],x[1],x[2]);break;default:w.apply(void 0,x)}})(h)}finally{N(E),P=!1}}}}function C(E){E.source===g&&typeof E.data=="string"&&E.data.indexOf(O)===0&&S(+E.data.slice(O.length))}})(typeof self>"u"?u===void 0?this:u:self)}).call(this,i!==void 0?i:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)}))}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],e("timers").setImmediate)},{_process:467,buffer:220,timers:523}],442:[function(e,p,b){(function(c){(function(){"use strict";var i=/[\\^$.*+?()[\]{}|]/g,a=RegExp(i.source),r=typeof c=="object"&&c&&c.Object===Object&&c,t=typeof self=="object"&&self&&self.Object===Object&&self,n=r||t||Function("return this")(),l=Object.prototype.toString,o=n.Symbol,s=o?o.prototype:void 0,f=s?s.toString:void 0;function d(u){if(typeof u=="string")return u;if((function(m){return typeof m=="symbol"||(function(v){return!!v&&typeof v=="object"})(m)&&l.call(m)=="[object Symbol]"})(u))return f?f.call(u):"";var g=u+"";return g=="0"&&1/u==-1/0?"-0":g}p.exports=function(u){var g;return(u=(g=u)==null?"":d(g))&&a.test(u)?u.replace(i,"\\$&"):u}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],443:[function(e,p,b){(function(c){(function(){"use strict";var i="[object Arguments]",a="[object Map]",r="[object Object]",t="[object Set]",n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,o=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[i]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g["[object Function]"]=g[a]=g["[object Number]"]=g[r]=g["[object RegExp]"]=g[t]=g["[object String]"]=g["[object WeakMap]"]=!1;var m=typeof c=="object"&&c&&c.Object===Object&&c,v=typeof self=="object"&&self&&self.Object===Object&&self,k=m||v||Function("return this")(),B=typeof b=="object"&&b&&!b.nodeType&&b,O=B&&typeof p=="object"&&p&&!p.nodeType&&p,L=O&&O.exports===B&&m.process,R=(function(){try{return L&&L.binding("util")}catch{}})(),P=R&&R.isTypedArray;function j(Y,ce,ge,he){for(var oe=-1,pe=Y?Y.length:0;++oe<pe;){var Te=Y[oe];ce(he,Te,ge(Te),Y)}return he}function z(Y,ce){for(var ge=-1,he=Y?Y.length:0;++ge<he;)if(ce(Y[ge],ge,Y))return!0;return!1}function N(Y){var ce=!1;if(Y!=null&&typeof Y.toString!="function")try{ce=!!(Y+"")}catch{}return ce}function S(Y){var ce=-1,ge=Array(Y.size);return Y.forEach((function(he,oe){ge[++ce]=[oe,he]})),ge}function C(Y){var ce=-1,ge=Array(Y.size);return Y.forEach((function(he){ge[++ce]=he})),ge}var E,h,y,w=Array.prototype,x=Function.prototype,_=Object.prototype,T=k["__core-js_shared__"],D=(E=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",q=x.toString,$=_.hasOwnProperty,W=_.toString,A=RegExp("^"+q.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=k.Symbol,M=k.Uint8Array,I=_.propertyIsEnumerable,F=w.splice,U=(h=Object.keys,y=Object,function(Y){return h(y(Y))}),X=qe(k,"DataView"),V=qe(k,"Map"),G=qe(k,"Promise"),ee=qe(k,"Set"),Z=qe(k,"WeakMap"),K=qe(Object,"create"),Q=fe(X),J=fe(V),ne=fe(G),ie=fe(ee),le=fe(Z),re=H?H.prototype:void 0,se=re?re.valueOf:void 0,be=re?re.toString:void 0;function ye(Y){var ce=-1,ge=Y?Y.length:0;for(this.clear();++ce<ge;){var he=Y[ce];this.set(he[0],he[1])}}function Fe(Y){var ce=-1,ge=Y?Y.length:0;for(this.clear();++ce<ge;){var he=Y[ce];this.set(he[0],he[1])}}function Ce(Y){var ce=-1,ge=Y?Y.length:0;for(this.clear();++ce<ge;){var he=Y[ce];this.set(he[0],he[1])}}function ae(Y){var ce=-1,ge=Y?Y.length:0;for(this.__data__=new Ce;++ce<ge;)this.add(Y[ce])}function De(Y){this.__data__=new Fe(Y)}function Be(Y,ce){var ge=Pe(Y)||je(Y)?(function(Te,tt){for(var Ke=-1,Ve=Array(Te);++Ke<Te;)Ve[Ke]=tt(Ke);return Ve})(Y.length,String):[],he=ge.length,oe=!!he;for(var pe in Y)!ce&&!$.call(Y,pe)||oe&&(pe=="length"||Ue(pe,he))||ge.push(pe);return ge}function ke(Y,ce){for(var ge=Y.length;ge--;)if(ht(Y[ge][0],ce))return ge;return-1}function Re(Y,ce,ge,he){return Ze(Y,(function(oe,pe,Te){ce(he,oe,ge(oe),Te)})),he}ye.prototype.clear=function(){this.__data__=K?K(null):{}},ye.prototype.delete=function(Y){return this.has(Y)&&delete this.__data__[Y]},ye.prototype.get=function(Y){var ce=this.__data__;if(K){var ge=ce[Y];return ge==="__lodash_hash_undefined__"?void 0:ge}return $.call(ce,Y)?ce[Y]:void 0},ye.prototype.has=function(Y){var ce=this.__data__;return K?ce[Y]!==void 0:$.call(ce,Y)},ye.prototype.set=function(Y,ce){return this.__data__[Y]=K&&ce===void 0?"__lodash_hash_undefined__":ce,this},Fe.prototype.clear=function(){this.__data__=[]},Fe.prototype.delete=function(Y){var ce=this.__data__,ge=ke(ce,Y);return!(ge<0)&&(ge==ce.length-1?ce.pop():F.call(ce,ge,1),!0)},Fe.prototype.get=function(Y){var ce=this.__data__,ge=ke(ce,Y);return ge<0?void 0:ce[ge][1]},Fe.prototype.has=function(Y){return ke(this.__data__,Y)>-1},Fe.prototype.set=function(Y,ce){var ge=this.__data__,he=ke(ge,Y);return he<0?ge.push([Y,ce]):ge[he][1]=ce,this},Ce.prototype.clear=function(){this.__data__={hash:new ye,map:new(V||Fe),string:new ye}},Ce.prototype.delete=function(Y){return ze(this,Y).delete(Y)},Ce.prototype.get=function(Y){return ze(this,Y).get(Y)},Ce.prototype.has=function(Y){return ze(this,Y).has(Y)},Ce.prototype.set=function(Y,ce){return ze(this,Y).set(Y,ce),this},ae.prototype.add=ae.prototype.push=function(Y){return this.__data__.set(Y,"__lodash_hash_undefined__"),this},ae.prototype.has=function(Y){return this.__data__.has(Y)},De.prototype.clear=function(){this.__data__=new Fe},De.prototype.delete=function(Y){return this.__data__.delete(Y)},De.prototype.get=function(Y){return this.__data__.get(Y)},De.prototype.has=function(Y){return this.__data__.has(Y)},De.prototype.set=function(Y,ce){var ge=this.__data__;if(ge instanceof Fe){var he=ge.__data__;if(!V||he.length<199)return he.push([Y,ce]),this;ge=this.__data__=new Ce(he)}return ge.set(Y,ce),this};var we,ve,Ze=(we=function(Y,ce){return Y&&Se(Y,ce,Nt)},function(Y,ce){if(Y==null)return Y;if(!ft(Y))return we(Y,ce);for(var ge=Y.length,he=ve?ge:-1,oe=Object(Y);(ve?he--:++he<ge)&&ce(oe[he],he,oe)!==!1;);return Y}),Se=(function(Y){return function(ce,ge,he){for(var oe=-1,pe=Object(ce),Te=he(ce),tt=Te.length;tt--;){var Ke=Te[Y?tt:++oe];if(ge(pe[Ke],Ke,pe)===!1)break}return ce}})();function de(Y,ce){for(var ge=0,he=(ce=Oe(ce,Y)?[ce]:Ae(ce)).length;Y!=null&&ge<he;)Y=Y[ue(ce[ge++])];return ge&&ge==he?Y:void 0}function Ee(Y,ce){return Y!=null&&ce in Object(Y)}function _e(Y,ce,ge,he,oe){return Y===ce||(Y==null||ce==null||!yt(Y)&&!lt(ce)?Y!=Y&&ce!=ce:(function(pe,Te,tt,Ke,Ve,Ye){var zt=Pe(pe),Vt=Pe(Te),wt="[object Array]",Ct="[object Array]";zt||(wt=(wt=dt(pe))==i?r:wt),Vt||(Ct=(Ct=dt(Te))==i?r:Ct);var cr=wt==r&&!N(pe),Dr=Ct==r&&!N(Te),Pr=wt==Ct;if(Pr&&!cr)return Ye||(Ye=new De),zt||er(pe)?vt(pe,Te,tt,Ke,Ve,Ye):(function(xt,St,Na,bo,gs,Cr,Sn){switch(Na){case"[object DataView]":if(xt.byteLength!=St.byteLength||xt.byteOffset!=St.byteOffset)return!1;xt=xt.buffer,St=St.buffer;case"[object ArrayBuffer]":return!(xt.byteLength!=St.byteLength||!bo(new M(xt),new M(St)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ht(+xt,+St);case"[object Error]":return xt.name==St.name&&xt.message==St.message;case"[object RegExp]":case"[object String]":return xt==St+"";case a:var Zn=S;case t:var xi=2&Cr;if(Zn||(Zn=C),xt.size!=St.size&&!xi)return!1;var bs=Sn.get(xt);if(bs)return bs==St;Cr|=1,Sn.set(xt,St);var Ho=vt(Zn(xt),Zn(St),bo,gs,Cr,Sn);return Sn.delete(xt),Ho;case"[object Symbol]":if(se)return se.call(xt)==se.call(St)}return!1})(pe,Te,wt,tt,Ke,Ve,Ye);if(!(2&Ve)){var on=cr&&$.call(pe,"__wrapped__"),go=Dr&&$.call(Te,"__wrapped__");if(on||go){var ms=on?pe.value():pe,$o=go?Te.value():Te;return Ye||(Ye=new De),tt(ms,$o,Ke,Ve,Ye)}}return Pr?(Ye||(Ye=new De),(function(xt,St,Na,bo,gs,Cr){var Sn=2&gs,Zn=Nt(xt),xi=Zn.length,bs=Nt(St).length;if(xi!=bs&&!Sn)return!1;for(var Ho=xi;Ho--;){var Jn=Zn[Ho];if(!(Sn?Jn in St:$.call(St,Jn)))return!1}var Vc=Cr.get(xt);if(Vc&&Cr.get(St))return Vc==St;var ys=!0;Cr.set(xt,St),Cr.set(St,xt);for(var ja=Sn;++Ho<xi;){Jn=Zn[Ho];var xs=xt[Jn],vs=St[Jn];if(bo)var Kc=Sn?bo(vs,xs,Jn,St,xt,Cr):bo(xs,vs,Jn,xt,St,Cr);if(!(Kc===void 0?xs===vs||Na(xs,vs,bo,gs,Cr):Kc)){ys=!1;break}ja||(ja=Jn=="constructor")}if(ys&&!ja){var ws=xt.constructor,_s=St.constructor;ws==_s||!("constructor"in xt)||!("constructor"in St)||typeof ws=="function"&&ws instanceof ws&&typeof _s=="function"&&_s instanceof _s||(ys=!1)}return Cr.delete(xt),Cr.delete(St),ys})(pe,Te,tt,Ke,Ve,Ye)):!1})(Y,ce,_e,ge,he,oe))}function Ie(Y){return!(!yt(Y)||(function(ce){return!!D&&D in ce})(Y))&&(rt(Y)||N(Y)?A:d).test(fe(Y))}function ot(Y){return typeof Y=="function"?Y:Y==null?Ut:typeof Y=="object"?Pe(Y)?(function(he,oe){return Oe(he)&&Ft(oe)?He(ue(he),oe):function(pe){var Te=(function(tt,Ke,Ve){var Ye=tt==null?void 0:de(tt,Ke);return Ye===void 0?Ve:Ye})(pe,he);return Te===void 0&&Te===oe?(function(tt,Ke){return tt!=null&&(function(Ve,Ye,zt){Ye=Oe(Ye,Ve)?[Ye]:Ae(Ye);for(var Vt,wt=-1,Ct=Ye.length;++wt<Ct;){var cr=ue(Ye[wt]);if(!(Vt=Ve!=null&&zt(Ve,cr)))break;Ve=Ve[cr]}return Vt||!!(Ct=Ve?Ve.length:0)&&et(Ct)&&Ue(cr,Ct)&&(Pe(Ve)||je(Ve))})(tt,Ke,Ee)})(pe,he):_e(oe,Te,void 0,3)}})(Y[0],Y[1]):(function(he){var oe=(function(pe){for(var Te=Nt(pe),tt=Te.length;tt--;){var Ke=Te[tt],Ve=pe[Ke];Te[tt]=[Ke,Ve,Ft(Ve)]}return Te})(he);return oe.length==1&&oe[0][2]?He(oe[0][0],oe[0][1]):function(pe){return pe===he||(function(Te,tt,Ke,Ve){var Ye=Ke.length,zt=Ye,Vt=!Ve;if(Te==null)return!zt;for(Te=Object(Te);Ye--;){var wt=Ke[Ye];if(Vt&&wt[2]?wt[1]!==Te[wt[0]]:!(wt[0]in Te))return!1}for(;++Ye<zt;){var Ct=(wt=Ke[Ye])[0],cr=Te[Ct],Dr=wt[1];if(Vt&&wt[2]){if(cr===void 0&&!(Ct in Te))return!1}else{var Pr=new De;if(Ve)var on=Ve(cr,Dr,Ct,Te,tt,Pr);if(!(on===void 0?_e(Dr,cr,Ve,3,Pr):on))return!1}}return!0})(pe,he,oe)}})(Y):Oe(ce=Y)?(ge=ue(ce),function(he){return he?.[ge]}):(function(he){return function(oe){return de(oe,he)}})(ce);var ce,ge}function Le(Y){if(ge=(ce=Y)&&ce.constructor,he=typeof ge=="function"&&ge.prototype||_,ce!==he)return U(Y);var ce,ge,he,oe=[];for(var pe in Object(Y))$.call(Y,pe)&&pe!="constructor"&&oe.push(pe);return oe}function Ae(Y){return Pe(Y)?Y:te(Y)}function vt(Y,ce,ge,he,oe,pe){var Te=2&oe,tt=Y.length,Ke=ce.length;if(tt!=Ke&&!(Te&&Ke>tt))return!1;var Ve=pe.get(Y);if(Ve&&pe.get(ce))return Ve==ce;var Ye=-1,zt=!0,Vt=1&oe?new ae:void 0;for(pe.set(Y,ce),pe.set(ce,Y);++Ye<tt;){var wt=Y[Ye],Ct=ce[Ye];if(he)var cr=Te?he(Ct,wt,Ye,ce,Y,pe):he(wt,Ct,Ye,Y,ce,pe);if(cr!==void 0){if(cr)continue;zt=!1;break}if(Vt){if(!z(ce,(function(Dr,Pr){if(!Vt.has(Pr)&&(wt===Dr||ge(wt,Dr,he,oe,pe)))return Vt.add(Pr)}))){zt=!1;break}}else if(wt!==Ct&&!ge(wt,Ct,he,oe,pe)){zt=!1;break}}return pe.delete(Y),pe.delete(ce),zt}function ze(Y,ce){var ge,he,oe=Y.__data__;return((he=typeof(ge=ce))=="string"||he=="number"||he=="symbol"||he=="boolean"?ge!=="__proto__":ge===null)?oe[typeof ce=="string"?"string":"hash"]:oe.map}function qe(Y,ce){var ge=(function(he,oe){return he?.[oe]})(Y,ce);return Ie(ge)?ge:void 0}var dt=function(Y){return W.call(Y)};function Ue(Y,ce){return!!(ce=ce??9007199254740991)&&(typeof Y=="number"||u.test(Y))&&Y>-1&&Y%1==0&&Y<ce}function Oe(Y,ce){if(Pe(Y))return!1;var ge=typeof Y;return!(ge!="number"&&ge!="symbol"&&ge!="boolean"&&Y!=null&&!mt(Y))||l.test(Y)||!n.test(Y)||ce!=null&&Y in Object(ce)}function Ft(Y){return Y==Y&&!yt(Y)}function He(Y,ce){return function(ge){return ge!=null&&ge[Y]===ce&&(ce!==void 0||Y in Object(ge))}}(X&&dt(new X(new ArrayBuffer(1)))!="[object DataView]"||V&&dt(new V)!=a||G&&dt(G.resolve())!="[object Promise]"||ee&&dt(new ee)!=t||Z&&dt(new Z)!="[object WeakMap]")&&(dt=function(Y){var ce=W.call(Y),ge=ce==r?Y.constructor:void 0,he=ge?fe(ge):void 0;if(he)switch(he){case Q:return"[object DataView]";case J:return a;case ne:return"[object Promise]";case ie:return t;case le:return"[object WeakMap]"}return ce});var te=Ne((function(Y){var ce;Y=(ce=Y)==null?"":(function(he){if(typeof he=="string")return he;if(mt(he))return be?be.call(he):"";var oe=he+"";return oe=="0"&&1/he==-1/0?"-0":oe})(ce);var ge=[];return o.test(Y)&&ge.push(""),Y.replace(s,(function(he,oe,pe,Te){ge.push(pe?Te.replace(f,"$1"):oe||he)})),ge}));function ue(Y){if(typeof Y=="string"||mt(Y))return Y;var ce=Y+"";return ce=="0"&&1/Y==-1/0?"-0":ce}function fe(Y){if(Y!=null){try{return q.call(Y)}catch{}try{return Y+""}catch{}}return""}var me,Je,Me=(me=function(Y,ce,ge){$.call(Y,ge)?Y[ge].push(ce):Y[ge]=[ce]},function(Y,ce){var ge=Pe(Y)?j:Re,he=Je?Je():{};return ge(Y,me,ot(ce),he)});function Ne(Y,ce){if(typeof Y!="function"||ce&&typeof ce!="function")throw new TypeError("Expected a function");var ge=function(){var he=arguments,oe=ce?ce.apply(this,he):he[0],pe=ge.cache;if(pe.has(oe))return pe.get(oe);var Te=Y.apply(this,he);return ge.cache=pe.set(oe,Te),Te};return ge.cache=new(Ne.Cache||Ce),ge}function ht(Y,ce){return Y===ce||Y!=Y&&ce!=ce}function je(Y){return(function(ce){return lt(ce)&&ft(ce)})(Y)&&$.call(Y,"callee")&&(!I.call(Y,"callee")||W.call(Y)==i)}Ne.Cache=Ce;var Pe=Array.isArray;function ft(Y){return Y!=null&&et(Y.length)&&!rt(Y)}function rt(Y){var ce=yt(Y)?W.call(Y):"";return ce=="[object Function]"||ce=="[object GeneratorFunction]"}function et(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=9007199254740991}function yt(Y){var ce=typeof Y;return!!Y&&(ce=="object"||ce=="function")}function lt(Y){return!!Y&&typeof Y=="object"}function mt(Y){return typeof Y=="symbol"||lt(Y)&&W.call(Y)=="[object Symbol]"}var er=P?(function(Y){return function(ce){return Y(ce)}})(P):function(Y){return lt(Y)&&et(Y.length)&&!!g[W.call(Y)]};function Nt(Y){return ft(Y)?Be(Y):Le(Y)}function Ut(Y){return Y}p.exports=Me}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],444:[function(e,p,b){"use strict";var c=Object.prototype.toString;p.exports=function(i){return i===!0||i===!1||(function(a){return!!a&&typeof a=="object"})(i)&&c.call(i)=="[object Boolean]"}},{}],445:[function(e,p,b){(function(c){(function(){"use strict";var i="[object Arguments]",a="[object Map]",r="[object Object]",t="[object Set]",n=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o[i]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o[a]=o["[object Number]"]=o[r]=o["[object RegExp]"]=o[t]=o["[object String]"]=o["[object WeakMap]"]=!1;var s=typeof c=="object"&&c&&c.Object===Object&&c,f=typeof self=="object"&&self&&self.Object===Object&&self,d=s||f||Function("return this")(),u=typeof b=="object"&&b&&!b.nodeType&&b,g=u&&typeof p=="object"&&p&&!p.nodeType&&p,m=g&&g.exports===u,v=m&&s.process,k=(function(){try{return v&&v.binding&&v.binding("util")}catch{}})(),B=k&&k.isTypedArray;function O(te,ue){for(var fe=-1,me=te==null?0:te.length;++fe<me;)if(ue(te[fe],fe,te))return!0;return!1}function L(te){var ue=-1,fe=Array(te.size);return te.forEach((function(me,Je){fe[++ue]=[Je,me]})),fe}function R(te){var ue=-1,fe=Array(te.size);return te.forEach((function(me){fe[++ue]=me})),fe}var P,j,z,N=Array.prototype,S=Function.prototype,C=Object.prototype,E=d["__core-js_shared__"],h=S.toString,y=C.hasOwnProperty,w=(P=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",x=C.toString,_=RegExp("^"+h.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=m?d.Buffer:void 0,D=d.Symbol,q=d.Uint8Array,$=C.propertyIsEnumerable,W=N.splice,A=D?D.toStringTag:void 0,H=Object.getOwnPropertySymbols,M=T?T.isBuffer:void 0,I=(j=Object.keys,z=Object,function(te){return j(z(te))}),F=de(d,"DataView"),U=de(d,"Map"),X=de(d,"Promise"),V=de(d,"Set"),G=de(d,"WeakMap"),ee=de(Object,"create"),Z=ot(F),K=ot(U),Q=ot(X),J=ot(V),ne=ot(G),ie=D?D.prototype:void 0,le=ie?ie.valueOf:void 0;function re(te){var ue=-1,fe=te==null?0:te.length;for(this.clear();++ue<fe;){var me=te[ue];this.set(me[0],me[1])}}function se(te){var ue=-1,fe=te==null?0:te.length;for(this.clear();++ue<fe;){var me=te[ue];this.set(me[0],me[1])}}function be(te){var ue=-1,fe=te==null?0:te.length;for(this.clear();++ue<fe;){var me=te[ue];this.set(me[0],me[1])}}function ye(te){var ue=-1,fe=te==null?0:te.length;for(this.__data__=new be;++ue<fe;)this.add(te[ue])}function Fe(te){var ue=this.__data__=new se(te);this.size=ue.size}function Ce(te,ue){var fe=vt(te),me=!fe&&Ae(te),Je=!fe&&!me&&ze(te),Me=!fe&&!me&&!Je&&Ft(te),Ne=fe||me||Je||Me,ht=Ne?(function(ft,rt){for(var et=-1,yt=Array(ft);++et<ft;)yt[et]=rt(et);return yt})(te.length,String):[],je=ht.length;for(var Pe in te)!ue&&!y.call(te,Pe)||Ne&&(Pe=="length"||Je&&(Pe=="offset"||Pe=="parent")||Me&&(Pe=="buffer"||Pe=="byteLength"||Pe=="byteOffset")||Ie(Pe,je))||ht.push(Pe);return ht}function ae(te,ue){for(var fe=te.length;fe--;)if(Le(te[fe][0],ue))return fe;return-1}function De(te){return te==null?te===void 0?"[object Undefined]":"[object Null]":A&&A in Object(te)?(function(ue){var fe=y.call(ue,A),me=ue[A];try{ue[A]=void 0;var Je=!0}catch{}var Me=x.call(ue);return Je&&(fe?ue[A]=me:delete ue[A]),Me})(te):(function(ue){return x.call(ue)})(te)}function Be(te){return Oe(te)&&De(te)==i}function ke(te,ue,fe,me,Je){return te===ue||(te==null||ue==null||!Oe(te)&&!Oe(ue)?te!=te&&ue!=ue:(function(Me,Ne,ht,je,Pe,ft){var rt=vt(Me),et=vt(Ne),yt=rt?"[object Array]":_e(Me),lt=et?"[object Array]":_e(Ne),mt=(yt=yt==i?r:yt)==r,er=(lt=lt==i?r:lt)==r,Nt=yt==lt;if(Nt&&ze(Me)){if(!ze(Ne))return!1;rt=!0,mt=!1}if(Nt&&!mt)return ft||(ft=new Fe),rt||Ft(Me)?ve(Me,Ne,ht,je,Pe,ft):(function(he,oe,pe,Te,tt,Ke,Ve){switch(pe){case"[object DataView]":if(he.byteLength!=oe.byteLength||he.byteOffset!=oe.byteOffset)return!1;he=he.buffer,oe=oe.buffer;case"[object ArrayBuffer]":return!(he.byteLength!=oe.byteLength||!Ke(new q(he),new q(oe)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Le(+he,+oe);case"[object Error]":return he.name==oe.name&&he.message==oe.message;case"[object RegExp]":case"[object String]":return he==oe+"";case a:var Ye=L;case t:var zt=1&Te;if(Ye||(Ye=R),he.size!=oe.size&&!zt)return!1;var Vt=Ve.get(he);if(Vt)return Vt==oe;Te|=2,Ve.set(he,oe);var wt=ve(Ye(he),Ye(oe),Te,tt,Ke,Ve);return Ve.delete(he),wt;case"[object Symbol]":if(le)return le.call(he)==le.call(oe)}return!1})(Me,Ne,yt,ht,je,Pe,ft);if(!(1&ht)){var Ut=mt&&y.call(Me,"__wrapped__"),Y=er&&y.call(Ne,"__wrapped__");if(Ut||Y){var ce=Ut?Me.value():Me,ge=Y?Ne.value():Ne;return ft||(ft=new Fe),Pe(ce,ge,ht,je,ft)}}return Nt?(ft||(ft=new Fe),(function(he,oe,pe,Te,tt,Ke){var Ve=1&pe,Ye=Ze(he),zt=Ye.length,Vt=Ze(oe).length;if(zt!=Vt&&!Ve)return!1;for(var wt=zt;wt--;){var Ct=Ye[wt];if(!(Ve?Ct in oe:y.call(oe,Ct)))return!1}var cr=Ke.get(he);if(cr&&Ke.get(oe))return cr==oe;var Dr=!0;Ke.set(he,oe),Ke.set(oe,he);for(var Pr=Ve;++wt<zt;){Ct=Ye[wt];var on=he[Ct],go=oe[Ct];if(Te)var ms=Ve?Te(go,on,Ct,oe,he,Ke):Te(on,go,Ct,he,oe,Ke);if(!(ms===void 0?on===go||tt(on,go,pe,Te,Ke):ms)){Dr=!1;break}Pr||(Pr=Ct=="constructor")}if(Dr&&!Pr){var $o=he.constructor,xt=oe.constructor;$o==xt||!("constructor"in he)||!("constructor"in oe)||typeof $o=="function"&&$o instanceof $o&&typeof xt=="function"&&xt instanceof xt||(Dr=!1)}return Ke.delete(he),Ke.delete(oe),Dr})(Me,Ne,ht,je,Pe,ft)):!1})(te,ue,fe,me,ke,Je))}function Re(te){return!(!Ue(te)||(function(ue){return!!w&&w in ue})(te))&&(qe(te)?_:n).test(ot(te))}function we(te){if(fe=(ue=te)&&ue.constructor,me=typeof fe=="function"&&fe.prototype||C,ue!==me)return I(te);var ue,fe,me,Je=[];for(var Me in Object(te))y.call(te,Me)&&Me!="constructor"&&Je.push(Me);return Je}function ve(te,ue,fe,me,Je,Me){var Ne=1&fe,ht=te.length,je=ue.length;if(ht!=je&&!(Ne&&je>ht))return!1;var Pe=Me.get(te);if(Pe&&Me.get(ue))return Pe==ue;var ft=-1,rt=!0,et=2&fe?new ye:void 0;for(Me.set(te,ue),Me.set(ue,te);++ft<ht;){var yt=te[ft],lt=ue[ft];if(me)var mt=Ne?me(lt,yt,ft,ue,te,Me):me(yt,lt,ft,te,ue,Me);if(mt!==void 0){if(mt)continue;rt=!1;break}if(et){if(!O(ue,(function(er,Nt){if(Ut=Nt,!et.has(Ut)&&(yt===er||Je(yt,er,fe,me,Me)))return et.push(Nt);var Ut}))){rt=!1;break}}else if(yt!==lt&&!Je(yt,lt,fe,me,Me)){rt=!1;break}}return Me.delete(te),Me.delete(ue),rt}function Ze(te){return(function(ue,fe,me){var Je=fe(ue);return vt(ue)?Je:(function(Me,Ne){for(var ht=-1,je=Ne.length,Pe=Me.length;++ht<je;)Me[Pe+ht]=Ne[ht];return Me})(Je,me(ue))})(te,He,Ee)}function Se(te,ue){var fe,me,Je=te.__data__;return((me=typeof(fe=ue))=="string"||me=="number"||me=="symbol"||me=="boolean"?fe!=="__proto__":fe===null)?Je[typeof ue=="string"?"string":"hash"]:Je.map}function de(te,ue){var fe=(function(me,Je){return me?.[Je]})(te,ue);return Re(fe)?fe:void 0}re.prototype.clear=function(){this.__data__=ee?ee(null):{},this.size=0},re.prototype.delete=function(te){var ue=this.has(te)&&delete this.__data__[te];return this.size-=ue?1:0,ue},re.prototype.get=function(te){var ue=this.__data__;if(ee){var fe=ue[te];return fe==="__lodash_hash_undefined__"?void 0:fe}return y.call(ue,te)?ue[te]:void 0},re.prototype.has=function(te){var ue=this.__data__;return ee?ue[te]!==void 0:y.call(ue,te)},re.prototype.set=function(te,ue){var fe=this.__data__;return this.size+=this.has(te)?0:1,fe[te]=ee&&ue===void 0?"__lodash_hash_undefined__":ue,this},se.prototype.clear=function(){this.__data__=[],this.size=0},se.prototype.delete=function(te){var ue=this.__data__,fe=ae(ue,te);return!(fe<0)&&(fe==ue.length-1?ue.pop():W.call(ue,fe,1),--this.size,!0)},se.prototype.get=function(te){var ue=this.__data__,fe=ae(ue,te);return fe<0?void 0:ue[fe][1]},se.prototype.has=function(te){return ae(this.__data__,te)>-1},se.prototype.set=function(te,ue){var fe=this.__data__,me=ae(fe,te);return me<0?(++this.size,fe.push([te,ue])):fe[me][1]=ue,this},be.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(U||se),string:new re}},be.prototype.delete=function(te){var ue=Se(this,te).delete(te);return this.size-=ue?1:0,ue},be.prototype.get=function(te){return Se(this,te).get(te)},be.prototype.has=function(te){return Se(this,te).has(te)},be.prototype.set=function(te,ue){var fe=Se(this,te),me=fe.size;return fe.set(te,ue),this.size+=fe.size==me?0:1,this},ye.prototype.add=ye.prototype.push=function(te){return this.__data__.set(te,"__lodash_hash_undefined__"),this},ye.prototype.has=function(te){return this.__data__.has(te)},Fe.prototype.clear=function(){this.__data__=new se,this.size=0},Fe.prototype.delete=function(te){var ue=this.__data__,fe=ue.delete(te);return this.size=ue.size,fe},Fe.prototype.get=function(te){return this.__data__.get(te)},Fe.prototype.has=function(te){return this.__data__.has(te)},Fe.prototype.set=function(te,ue){var fe=this.__data__;if(fe instanceof se){var me=fe.__data__;if(!U||me.length<199)return me.push([te,ue]),this.size=++fe.size,this;fe=this.__data__=new be(me)}return fe.set(te,ue),this.size=fe.size,this};var Ee=H?function(te){return te==null?[]:(te=Object(te),(function(ue,fe){for(var me=-1,Je=ue==null?0:ue.length,Me=0,Ne=[];++me<Je;){var ht=ue[me];fe(ht,me,ue)&&(Ne[Me++]=ht)}return Ne})(H(te),(function(ue){return $.call(te,ue)})))}:function(){return[]},_e=De;function Ie(te,ue){return!!(ue=ue??9007199254740991)&&(typeof te=="number"||l.test(te))&&te>-1&&te%1==0&&te<ue}function ot(te){if(te!=null){try{return h.call(te)}catch{}try{return te+""}catch{}}return""}function Le(te,ue){return te===ue||te!=te&&ue!=ue}(F&&_e(new F(new ArrayBuffer(1)))!="[object DataView]"||U&&_e(new U)!=a||X&&_e(X.resolve())!="[object Promise]"||V&&_e(new V)!=t||G&&_e(new G)!="[object WeakMap]")&&(_e=function(te){var ue=De(te),fe=ue==r?te.constructor:void 0,me=fe?ot(fe):"";if(me)switch(me){case Z:return"[object DataView]";case K:return a;case Q:return"[object Promise]";case J:return t;case ne:return"[object WeakMap]"}return ue});var Ae=Be((function(){return arguments})())?Be:function(te){return Oe(te)&&y.call(te,"callee")&&!$.call(te,"callee")},vt=Array.isArray,ze=M||function(){return!1};function qe(te){if(!Ue(te))return!1;var ue=De(te);return ue=="[object Function]"||ue=="[object GeneratorFunction]"||ue=="[object AsyncFunction]"||ue=="[object Proxy]"}function dt(te){return typeof te=="number"&&te>-1&&te%1==0&&te<=9007199254740991}function Ue(te){var ue=typeof te;return te!=null&&(ue=="object"||ue=="function")}function Oe(te){return te!=null&&typeof te=="object"}var Ft=B?(function(te){return function(ue){return te(ue)}})(B):function(te){return Oe(te)&&dt(te.length)&&!!o[De(te)]};function He(te){return(ue=te)!=null&&dt(ue.length)&&!qe(ue)?Ce(te):we(te);var ue}p.exports=function(te,ue){return ke(te,ue)}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],446:[function(e,p,b){(function(c){(function(){"use strict";var i=typeof c=="object"&&c&&c.Object===Object&&c,a=typeof self=="object"&&self&&self.Object===Object&&self,r=i||a||Function("return this")(),t=Object.prototype,n=t.hasOwnProperty,l=t.toString,o=r.Symbol,s=o?o.toStringTag:void 0;function f(d){return d==null?d===void 0?"[object Undefined]":"[object Null]":s&&s in Object(d)?(function(u){var g=n.call(u,s),m=u[s];try{u[s]=void 0;var v=!0}catch{}var k=l.call(u);return v&&(g?u[s]=m:delete u[s]),k})(d):(function(u){return l.call(u)})(d)}p.exports=function(d){if(!(function(g){var m=typeof g;return g!=null&&(m=="object"||m=="function")})(d))return!1;var u=f(d);return u=="[object Function]"||u=="[object GeneratorFunction]"||u=="[object AsyncFunction]"||u=="[object Proxy]"}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],447:[function(e,p,b){"use strict";p.exports=function(c){return c==null}},{}],448:[function(e,p,b){"use strict";p.exports=function(c){return c===void 0}},{}],449:[function(e,p,b){(function(c){(function(){"use strict";var i=/^\[object .+?Constructor\]$/,a=typeof c=="object"&&c&&c.Object===Object&&c,r=typeof self=="object"&&self&&self.Object===Object&&self,t=a||r||Function("return this")();function n(q,$){return!!(q&&q.length)&&(function(W,A,H){if(A!=A)return(function(F,U,X,V){for(var G=F.length,ee=X+(V?1:-1);V?ee--:++ee<G;)if(U(F[ee],ee,F))return ee;return-1})(W,o,H);for(var M=H-1,I=W.length;++M<I;)if(W[M]===A)return M;return-1})(q,$,0)>-1}function l(q,$,W){for(var A=-1,H=q?q.length:0;++A<H;)if(W($,q[A]))return!0;return!1}function o(q){return q!=q}function s(q,$){return q.has($)}function f(q){var $=-1,W=Array(q.size);return q.forEach((function(A){W[++$]=A})),W}var d,u=Array.prototype,g=Function.prototype,m=Object.prototype,v=t["__core-js_shared__"],k=(d=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",B=g.toString,O=m.hasOwnProperty,L=m.toString,R=RegExp("^"+B.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=u.splice,j=T(t,"Map"),z=T(t,"Set"),N=T(Object,"create");function S(q){var $=-1,W=q?q.length:0;for(this.clear();++$<W;){var A=q[$];this.set(A[0],A[1])}}function C(q){var $=-1,W=q?q.length:0;for(this.clear();++$<W;){var A=q[$];this.set(A[0],A[1])}}function E(q){var $=-1,W=q?q.length:0;for(this.clear();++$<W;){var A=q[$];this.set(A[0],A[1])}}function h(q){var $=-1,W=q?q.length:0;for(this.__data__=new E;++$<W;)this.add(q[$])}function y(q,$){for(var W,A,H=q.length;H--;)if((W=q[H][0])===(A=$)||W!=W&&A!=A)return H;return-1}function w(q){return!(!D(q)||($=q,k&&k in $))&&((function(W){var A=D(W)?L.call(W):"";return A=="[object Function]"||A=="[object GeneratorFunction]"})(q)||(function(W){var A=!1;if(W!=null&&typeof W.toString!="function")try{A=!!(W+"")}catch{}return A})(q)?R:i).test((function(W){if(W!=null){try{return B.call(W)}catch{}try{return W+""}catch{}}return""})(q));var $}S.prototype.clear=function(){this.__data__=N?N(null):{}},S.prototype.delete=function(q){return this.has(q)&&delete this.__data__[q]},S.prototype.get=function(q){var $=this.__data__;if(N){var W=$[q];return W==="__lodash_hash_undefined__"?void 0:W}return O.call($,q)?$[q]:void 0},S.prototype.has=function(q){var $=this.__data__;return N?$[q]!==void 0:O.call($,q)},S.prototype.set=function(q,$){return this.__data__[q]=N&&$===void 0?"__lodash_hash_undefined__":$,this},C.prototype.clear=function(){this.__data__=[]},C.prototype.delete=function(q){var $=this.__data__,W=y($,q);return!(W<0)&&(W==$.length-1?$.pop():P.call($,W,1),!0)},C.prototype.get=function(q){var $=this.__data__,W=y($,q);return W<0?void 0:$[W][1]},C.prototype.has=function(q){return y(this.__data__,q)>-1},C.prototype.set=function(q,$){var W=this.__data__,A=y(W,q);return A<0?W.push([q,$]):W[A][1]=$,this},E.prototype.clear=function(){this.__data__={hash:new S,map:new(j||C),string:new S}},E.prototype.delete=function(q){return _(this,q).delete(q)},E.prototype.get=function(q){return _(this,q).get(q)},E.prototype.has=function(q){return _(this,q).has(q)},E.prototype.set=function(q,$){return _(this,q).set(q,$),this},h.prototype.add=h.prototype.push=function(q){return this.__data__.set(q,"__lodash_hash_undefined__"),this},h.prototype.has=function(q){return this.__data__.has(q)};var x=z&&1/f(new z([,-0]))[1]==1/0?function(q){return new z(q)}:function(){};function _(q,$){var W,A,H=q.__data__;return((A=typeof(W=$))=="string"||A=="number"||A=="symbol"||A=="boolean"?W!=="__proto__":W===null)?H[typeof $=="string"?"string":"hash"]:H.map}function T(q,$){var W=(function(A,H){return A?.[H]})(q,$);return w(W)?W:void 0}function D(q){var $=typeof q;return!!q&&($=="object"||$=="function")}p.exports=function(q){return q&&q.length?(function($,W,A){var H=-1,M=n,I=$.length,F=!0,U=[],X=U;if(A)F=!1,M=l;else if(I>=200){var V=W?null:x($);if(V)return f(V);F=!1,M=s,X=new h}else X=W?[]:U;e:for(;++H<I;){var G=$[H],ee=W?W(G):G;if(G=A||G!==0?G:0,F&&ee==ee){for(var Z=X.length;Z--;)if(X[Z]===ee)continue e;W&&X.push(ee),U.push(G)}else M(X,ee,A)||(X!==U&&X.push(ee),U.push(G))}return U})(q):[]}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],450:[function(e,p,b){"use strict";var c=e("inherits"),i=e("hash-base"),a=e("safe-buffer").Buffer,r=new Array(16);function t(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function n(d,u){return d<<u|d>>>32-u}function l(d,u,g,m,v,k,B){return n(d+(u&g|~u&m)+v+k|0,B)+u|0}function o(d,u,g,m,v,k,B){return n(d+(u&m|g&~m)+v+k|0,B)+u|0}function s(d,u,g,m,v,k,B){return n(d+(u^g^m)+v+k|0,B)+u|0}function f(d,u,g,m,v,k,B){return n(d+(g^(u|~m))+v+k|0,B)+u|0}c(t,i),t.prototype._update=function(){for(var d=r,u=0;u<16;++u)d[u]=this._block.readInt32LE(4*u);var g=this._a,m=this._b,v=this._c,k=this._d;g=l(g,m,v,k,d[0],3614090360,7),k=l(k,g,m,v,d[1],3905402710,12),v=l(v,k,g,m,d[2],606105819,17),m=l(m,v,k,g,d[3],3250441966,22),g=l(g,m,v,k,d[4],4118548399,7),k=l(k,g,m,v,d[5],1200080426,12),v=l(v,k,g,m,d[6],2821735955,17),m=l(m,v,k,g,d[7],4249261313,22),g=l(g,m,v,k,d[8],1770035416,7),k=l(k,g,m,v,d[9],2336552879,12),v=l(v,k,g,m,d[10],4294925233,17),m=l(m,v,k,g,d[11],2304563134,22),g=l(g,m,v,k,d[12],1804603682,7),k=l(k,g,m,v,d[13],4254626195,12),v=l(v,k,g,m,d[14],2792965006,17),g=o(g,m=l(m,v,k,g,d[15],1236535329,22),v,k,d[1],4129170786,5),k=o(k,g,m,v,d[6],3225465664,9),v=o(v,k,g,m,d[11],643717713,14),m=o(m,v,k,g,d[0],3921069994,20),g=o(g,m,v,k,d[5],3593408605,5),k=o(k,g,m,v,d[10],38016083,9),v=o(v,k,g,m,d[15],3634488961,14),m=o(m,v,k,g,d[4],3889429448,20),g=o(g,m,v,k,d[9],568446438,5),k=o(k,g,m,v,d[14],3275163606,9),v=o(v,k,g,m,d[3],4107603335,14),m=o(m,v,k,g,d[8],1163531501,20),g=o(g,m,v,k,d[13],2850285829,5),k=o(k,g,m,v,d[2],4243563512,9),v=o(v,k,g,m,d[7],1735328473,14),g=s(g,m=o(m,v,k,g,d[12],2368359562,20),v,k,d[5],4294588738,4),k=s(k,g,m,v,d[8],2272392833,11),v=s(v,k,g,m,d[11],1839030562,16),m=s(m,v,k,g,d[14],4259657740,23),g=s(g,m,v,k,d[1],2763975236,4),k=s(k,g,m,v,d[4],1272893353,11),v=s(v,k,g,m,d[7],4139469664,16),m=s(m,v,k,g,d[10],3200236656,23),g=s(g,m,v,k,d[13],681279174,4),k=s(k,g,m,v,d[0],3936430074,11),v=s(v,k,g,m,d[3],3572445317,16),m=s(m,v,k,g,d[6],76029189,23),g=s(g,m,v,k,d[9],3654602809,4),k=s(k,g,m,v,d[12],3873151461,11),v=s(v,k,g,m,d[15],530742520,16),g=f(g,m=s(m,v,k,g,d[2],3299628645,23),v,k,d[0],4096336452,6),k=f(k,g,m,v,d[7],1126891415,10),v=f(v,k,g,m,d[14],2878612391,15),m=f(m,v,k,g,d[5],4237533241,21),g=f(g,m,v,k,d[12],1700485571,6),k=f(k,g,m,v,d[3],2399980690,10),v=f(v,k,g,m,d[10],4293915773,15),m=f(m,v,k,g,d[1],2240044497,21),g=f(g,m,v,k,d[8],1873313359,6),k=f(k,g,m,v,d[15],4264355552,10),v=f(v,k,g,m,d[6],2734768916,15),m=f(m,v,k,g,d[13],1309151649,21),g=f(g,m,v,k,d[4],4149444226,6),k=f(k,g,m,v,d[11],3174756917,10),v=f(v,k,g,m,d[2],718787259,15),m=f(m,v,k,g,d[9],3951481745,21),this._a=this._a+g|0,this._b=this._b+m|0,this._c=this._c+v|0,this._d=this._d+k|0},t.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var d=a.allocUnsafe(16);return d.writeInt32LE(this._a,0),d.writeInt32LE(this._b,4),d.writeInt32LE(this._c,8),d.writeInt32LE(this._d,12),d},p.exports=t},{"hash-base":425,inherits:440,"safe-buffer":494}],451:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("brorand");function a(r){this.rand=r||new i.Rand}p.exports=a,a.create=function(r){return new a(r)},a.prototype._randbelow=function(r){var t=r.bitLength(),n=Math.ceil(t/8);do var l=new c(this.rand.generate(n));while(l.cmp(r)>=0);return l},a.prototype._randrange=function(r,t){var n=t.sub(r);return r.add(this._randbelow(n))},a.prototype.test=function(r,t,n){var l=r.bitLength(),o=c.mont(r),s=new c(1).toRed(o);t||(t=Math.max(1,l/48|0));for(var f=r.subn(1),d=0;!f.testn(d);d++);for(var u=r.shrn(d),g=f.toRed(o);t>0;t--){var m=this._randrange(new c(2),f);n&&n(m);var v=m.toRed(o).redPow(u);if(v.cmp(s)!==0&&v.cmp(g)!==0){for(var k=1;k<d;k++){if((v=v.redSqr()).cmp(s)===0)return!1;if(v.cmp(g)===0)break}if(k===d)return!1}}return!0},a.prototype.getDivisor=function(r,t){var n=r.bitLength(),l=c.mont(r),o=new c(1).toRed(l);t||(t=Math.max(1,n/48|0));for(var s=r.subn(1),f=0;!s.testn(f);f++);for(var d=r.shrn(f),u=s.toRed(l);t>0;t--){var g=this._randrange(new c(2),s),m=r.gcd(g);if(m.cmpn(1)!==0)return m;var v=g.toRed(l).redPow(d);if(v.cmp(o)!==0&&v.cmp(u)!==0){for(var k=1;k<f;k++){if((v=v.redSqr()).cmp(o)===0)return v.fromRed().subn(1).gcd(r);if(v.cmp(u)===0)break}if(k===f)return(v=v.redSqr()).fromRed().subn(1).gcd(r)}}return!1}},{"bn.js":452,brorand:187}],452:[function(e,p,b){arguments[4][184][0].apply(b,arguments)},{buffer:188,dup:184}],453:[function(e,p,b){"use strict";function c(i,a){if(!i)throw new Error(a||"Assertion failed")}p.exports=c,c.equal=function(i,a,r){if(i!=a)throw new Error(r||"Assertion failed: "+i+" != "+a)}},{}],454:[function(e,p,b){"use strict";var c=b;function i(r){return r.length===1?"0"+r:r}function a(r){for(var t="",n=0;n<r.length;n++)t+=i(r[n].toString(16));return t}c.toArray=function(r,t){if(Array.isArray(r))return r.slice();if(!r)return[];var n=[];if(typeof r!="string"){for(var l=0;l<r.length;l++)n[l]=0|r[l];return n}if(t==="hex")for((r=r.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(r="0"+r),l=0;l<r.length;l+=2)n.push(parseInt(r[l]+r[l+1],16));else for(l=0;l<r.length;l++){var o=r.charCodeAt(l),s=o>>8,f=255&o;s?n.push(s,f):n.push(f)}return n},c.zero2=i,c.toHex=a,c.encode=function(r,t){return t==="hex"?a(r):r}},{}],455:[function(e,p,b){p.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],456:[function(e,p,b){"use strict";var c=e("asn1.js");b.certificate=e("./certificate");var i=c.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));b.RSAPrivateKey=i;var a=c.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));b.RSAPublicKey=a;var r=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(t),this.key("subjectPublicKey").bitstr())}));b.PublicKey=r;var t=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),n=c.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(t),this.key("subjectPrivateKey").octstr())}));b.PrivateKey=n;var l=c.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));b.EncryptedPrivateKey=l;var o=c.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));b.DSAPrivateKey=o,b.DSAparam=c.define("DSAparam",(function(){this.int()}));var s=c.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())}));b.ECPrivateKey=s;var f=c.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));b.signature=c.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},{"./certificate":457,"asn1.js":170}],457:[function(e,p,b){"use strict";var c=e("asn1.js"),i=c.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),a=c.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),r=c.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),t=c.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())})),n=c.define("RelativeDistinguishedName",(function(){this.setof(a)})),l=c.define("RDNSequence",(function(){this.seqof(n)})),o=c.define("Name",(function(){this.choice({rdnSequence:this.use(l)})})),s=c.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),f=c.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=c.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(r),this.key("issuer").use(o),this.key("validity").use(s),this.key("subject").use(o),this.key("subjectPublicKeyInfo").use(t),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),u=c.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(r),this.key("signatureValue").bitstr())}));p.exports=u},{"asn1.js":170}],458:[function(e,p,b){"use strict";var c=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,r=e("evp_bytestokey"),t=e("browserify-aes"),n=e("safe-buffer").Buffer;p.exports=function(l,o){var s,f=l.toString(),d=f.match(c);if(d){var u="aes"+d[1],g=n.from(d[2],"hex"),m=n.from(d[3].replace(/[\r\n]/g,""),"base64"),v=r(o,g.slice(0,8),parseInt(d[1],10)).key,k=[],B=t.createDecipheriv(u,v,g);k.push(B.update(m)),k.push(B.final()),s=n.concat(k)}else{var O=f.match(a);s=n.from(O[2].replace(/[\r\n]/g,""),"base64")}return{tag:f.match(i)[1],data:s}}},{"browserify-aes":191,evp_bytestokey:423,"safe-buffer":494}],459:[function(e,p,b){"use strict";var c=e("./asn1"),i=e("./aesid.json"),a=e("./fixProc"),r=e("browserify-aes"),t=e("pbkdf2"),n=e("safe-buffer").Buffer;function l(o){var s;typeof o!="object"||n.isBuffer(o)||(s=o.passphrase,o=o.key),typeof o=="string"&&(o=n.from(o));var f,d,u=a(o,s),g=u.tag,m=u.data;switch(g){case"CERTIFICATE":d=c.certificate.decode(m,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(d||(d=c.PublicKey.decode(m,"der")),f=d.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPublicKey.decode(d.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return d.subjectPrivateKey=d.subjectPublicKey,{type:"ec",data:d};case"1.2.840.10040.4.1":return d.algorithm.params.pub_key=c.DSAparam.decode(d.subjectPublicKey.data,"der"),{type:"dsa",data:d.algorithm.params};default:throw new Error("unknown key id "+f)}case"ENCRYPTED PRIVATE KEY":m=(function(v,k){var B=v.algorithm.decrypt.kde.kdeparams.salt,O=parseInt(v.algorithm.decrypt.kde.kdeparams.iters.toString(),10),L=i[v.algorithm.decrypt.cipher.algo.join(".")],R=v.algorithm.decrypt.cipher.iv,P=v.subjectPrivateKey,j=parseInt(L.split("-")[1],10)/8,z=t.pbkdf2Sync(k,B,O,j,"sha1"),N=r.createDecipheriv(L,z,R),S=[];return S.push(N.update(P)),S.push(N.final()),n.concat(S)})(m=c.EncryptedPrivateKey.decode(m,"der"),s);case"PRIVATE KEY":switch(f=(d=c.PrivateKey.decode(m,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return c.RSAPrivateKey.decode(d.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:d.algorithm.curve,privateKey:c.ECPrivateKey.decode(d.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return d.algorithm.params.priv_key=c.DSAparam.decode(d.subjectPrivateKey,"der"),{type:"dsa",params:d.algorithm.params};default:throw new Error("unknown key id "+f)}case"RSA PUBLIC KEY":return c.RSAPublicKey.decode(m,"der");case"RSA PRIVATE KEY":return c.RSAPrivateKey.decode(m,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:c.DSAPrivateKey.decode(m,"der")};case"EC PRIVATE KEY":return{curve:(m=c.ECPrivateKey.decode(m,"der")).parameters.value,privateKey:m.privateKey};default:throw new Error("unknown key type "+g)}}p.exports=l,l.signature=c.signature},{"./aesid.json":455,"./asn1":456,"./fixProc":458,"browserify-aes":191,pbkdf2:460,"safe-buffer":494}],460:[function(e,p,b){"use strict";b.pbkdf2=e("./lib/async"),b.pbkdf2Sync=e("./lib/sync")},{"./lib/async":461,"./lib/sync":464}],461:[function(e,p,b){(function(c){(function(){"use strict";var i,a,r=e("safe-buffer").Buffer,t=e("./precondition"),n=e("./default-encoding"),l=e("./sync"),o=e("./to-buffer"),s=c.crypto&&c.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function u(){return a||(a=c.process&&c.process.nextTick?c.process.nextTick:c.queueMicrotask?c.queueMicrotask:c.setImmediate?c.setImmediate:c.setTimeout)}function g(m,v,k,B,O){return s.importKey("raw",m,{name:"PBKDF2"},!1,["deriveBits"]).then((function(L){return s.deriveBits({name:"PBKDF2",salt:v,iterations:k,hash:{name:O}},L,B<<3)})).then((function(L){return r.from(L)}))}p.exports=function(m,v,k,B,O,L){typeof O=="function"&&(L=O,O=void 0);var R=f[(O=O||"sha1").toLowerCase()];if(R&&typeof c.Promise=="function"){if(t(k,B),m=o(m,n,"Password"),v=o(v,n,"Salt"),typeof L!="function")throw new Error("No callback provided to pbkdf2");(function(P,j){P.then((function(z){u()((function(){j(null,z)}))}),(function(z){u()((function(){j(z)}))}))})((function(P){if(c.process&&!c.process.browser||!s||!s.importKey||!s.deriveBits)return Promise.resolve(!1);if(d[P]!==void 0)return d[P];var j=g(i=i||r.alloc(8),i,10,128,P).then((function(){return!0})).catch((function(){return!1}));return d[P]=j,j})(R).then((function(P){return P?g(m,v,k,B,R):l(m,v,k,B,O)})),L)}else u()((function(){var P;try{P=l(m,v,k,B,O)}catch(j){return L(j)}L(null,P)}))}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-encoding":462,"./precondition":463,"./sync":464,"./to-buffer":465,"safe-buffer":494}],462:[function(e,p,b){(function(c,i){(function(){"use strict";var a;i.process&&i.process.browser?a="utf-8":i.process&&i.process.version?a=parseInt(c.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":a="utf-8",p.exports=a}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{_process:467}],463:[function(e,p,b){"use strict";var c=Math.pow(2,30)-1;p.exports=function(i,a){if(typeof i!="number")throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if(typeof a!="number")throw new TypeError("Key length not a number");if(a<0||a>c||a!=a)throw new TypeError("Bad key length")}},{}],464:[function(e,p,b){"use strict";var c=e("create-hash/md5"),i=e("ripemd160"),a=e("sha.js"),r=e("safe-buffer").Buffer,t=e("./precondition"),n=e("./default-encoding"),l=e("./to-buffer"),o=r.alloc(128),s={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(d,u,g){var m=(function(R){function P(j){return a(R).update(j).digest()}return R==="rmd160"||R==="ripemd160"?function(j){return new i().update(j).digest()}:R==="md5"?c:P})(d),v=d==="sha512"||d==="sha384"?128:64;u.length>v?u=m(u):u.length<v&&(u=r.concat([u,o],v));for(var k=r.allocUnsafe(v+s[d]),B=r.allocUnsafe(v+s[d]),O=0;O<v;O++)k[O]=54^u[O],B[O]=92^u[O];var L=r.allocUnsafe(v+g+4);k.copy(L,0,0,v),this.ipad1=L,this.ipad2=k,this.opad=B,this.alg=d,this.blocksize=v,this.hash=m,this.size=s[d]}f.prototype.run=function(d,u){return d.copy(u,this.blocksize),this.hash(u).copy(this.opad,this.blocksize),this.hash(this.opad)},p.exports=function(d,u,g,m,v){t(g,m);var k=new f(v=v||"sha1",d=l(d,n,"Password"),(u=l(u,n,"Salt")).length),B=r.allocUnsafe(m),O=r.allocUnsafe(u.length+4);u.copy(O,0,0,u.length);for(var L=0,R=s[v],P=Math.ceil(m/R),j=1;j<=P;j++){O.writeUInt32BE(j,u.length);for(var z=k.run(O,k.ipad1),N=z,S=1;S<g;S++){N=k.run(N,k.ipad2);for(var C=0;C<R;C++)z[C]^=N[C]}z.copy(B,L),L+=R}return B}},{"./default-encoding":462,"./precondition":463,"./to-buffer":465,"create-hash/md5":387,ripemd160:493,"safe-buffer":494,"sha.js":498}],465:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer;p.exports=function(i,a,r){if(c.isBuffer(i))return i;if(typeof i=="string")return c.from(i,a);if(ArrayBuffer.isView(i))return c.from(i.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},{"safe-buffer":494}],466:[function(e,p,b){(function(c){(function(){"use strict";c===void 0||!c.version||c.version.indexOf("v0.")===0||c.version.indexOf("v1.")===0&&c.version.indexOf("v1.8.")!==0?p.exports={nextTick:function(i,a,r,t){if(typeof i!="function")throw new TypeError('"callback" argument must be a function');var n,l,o=arguments.length;switch(o){case 0:case 1:return c.nextTick(i);case 2:return c.nextTick((function(){i.call(null,a)}));case 3:return c.nextTick((function(){i.call(null,a,r)}));case 4:return c.nextTick((function(){i.call(null,a,r,t)}));default:for(n=new Array(o-1),l=0;l<n.length;)n[l++]=arguments[l];return c.nextTick((function(){i.apply(null,n)}))}}}:p.exports=c}).call(this)}).call(this,e("_process"))},{_process:467}],467:[function(e,p,b){"use strict";var c,i,a=p.exports={};function r(){throw new Error("setTimeout has not been defined")}function t(){throw new Error("clearTimeout has not been defined")}function n(v){if(c===setTimeout)return setTimeout(v,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(v,0);try{return c(v,0)}catch{try{return c.call(null,v,0)}catch{return c.call(this,v,0)}}}(function(){try{c=typeof setTimeout=="function"?setTimeout:r}catch{c=r}try{i=typeof clearTimeout=="function"?clearTimeout:t}catch{i=t}})();var l,o=[],s=!1,f=-1;function d(){s&&l&&(s=!1,l.length?o=l.concat(o):f=-1,o.length&&u())}function u(){if(!s){var v=n(d);s=!0;for(var k=o.length;k;){for(l=o,o=[];++f<k;)l&&l[f].run();f=-1,k=o.length}l=null,s=!1,(function(B){if(i===clearTimeout)return clearTimeout(B);if((i===t||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(B);try{i(B)}catch{try{return i.call(null,B)}catch{return i.call(this,B)}}})(v)}}function g(v,k){this.fun=v,this.array=k}function m(){}a.nextTick=function(v){var k=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)k[B-1]=arguments[B];o.push(new g(v,k)),o.length!==1||s||n(u)},g.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(v){return[]},a.binding=function(v){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(v){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],468:[function(e,p,b){"use strict";b.publicEncrypt=e("./publicEncrypt"),b.privateDecrypt=e("./privateDecrypt"),b.privateEncrypt=function(c,i){return b.publicEncrypt(c,i,!0)},b.publicDecrypt=function(c,i){return b.privateDecrypt(c,i,!0)}},{"./privateDecrypt":471,"./publicEncrypt":472}],469:[function(e,p,b){"use strict";var c=e("create-hash"),i=e("safe-buffer").Buffer;function a(r){var t=i.allocUnsafe(4);return t.writeUInt32BE(r,0),t}p.exports=function(r,t){for(var n,l=i.alloc(0),o=0;l.length<t;)n=a(o++),l=i.concat([l,c("sha1").update(r).update(n).digest()]);return l.slice(0,t)}},{"create-hash":386,"safe-buffer":494}],470:[function(e,p,b){arguments[4][184][0].apply(b,arguments)},{buffer:188,dup:184}],471:[function(e,p,b){"use strict";var c=e("parse-asn1"),i=e("./mgf"),a=e("./xor"),r=e("bn.js"),t=e("browserify-rsa"),n=e("create-hash"),l=e("./withPublic"),o=e("safe-buffer").Buffer;p.exports=function(s,f,d){var u;u=s.padding?s.padding:d?1:4;var g,m=c(s),v=m.modulus.byteLength();if(f.length>v||new r(f).cmp(m.modulus)>=0)throw new Error("decryption error");g=d?l(new r(f),m):t(f,m);var k=o.alloc(v-g.length);if(g=o.concat([k,g],v),u===4)return(function(B,O){var L=B.modulus.byteLength(),R=n("sha1").update(o.alloc(0)).digest(),P=R.length;if(O[0]!==0)throw new Error("decryption error");var j=O.slice(1,P+1),z=O.slice(P+1),N=a(j,i(z,P)),S=a(z,i(N,L-P-1));if((function(E,h){E=o.from(E),h=o.from(h);var y=0,w=E.length;E.length!==h.length&&(y++,w=Math.min(E.length,h.length));for(var x=-1;++x<w;)y+=E[x]^h[x];return y})(R,S.slice(0,P)))throw new Error("decryption error");for(var C=P;S[C]===0;)C++;if(S[C++]!==1)throw new Error("decryption error");return S.slice(C)})(m,g);if(u===1)return(function(B,O,L){for(var R=O.slice(0,2),P=2,j=0;O[P++]!==0;)if(P>=O.length){j++;break}var z=O.slice(2,P-1);if((R.toString("hex")!=="0002"&&!L||R.toString("hex")!=="0001"&&L)&&j++,z.length<8&&j++,j)throw new Error("decryption error");return O.slice(P)})(0,g,d);if(u===3)return g;throw new Error("unknown padding")}},{"./mgf":469,"./withPublic":473,"./xor":474,"bn.js":470,"browserify-rsa":209,"create-hash":386,"parse-asn1":459,"safe-buffer":494}],472:[function(e,p,b){"use strict";var c=e("parse-asn1"),i=e("randombytes"),a=e("create-hash"),r=e("./mgf"),t=e("./xor"),n=e("bn.js"),l=e("./withPublic"),o=e("browserify-rsa"),s=e("safe-buffer").Buffer;p.exports=function(f,d,u){var g;g=f.padding?f.padding:u?1:4;var m,v=c(f);if(g===4)m=(function(k,B){var O=k.modulus.byteLength(),L=B.length,R=a("sha1").update(s.alloc(0)).digest(),P=R.length,j=2*P;if(L>O-j-2)throw new Error("message too long");var z=s.alloc(O-L-j-2),N=O-P-1,S=i(P),C=t(s.concat([R,z,s.alloc(1,1),B],N),r(S,N)),E=t(S,r(C,P));return new n(s.concat([s.alloc(1),E,C],O))})(v,d);else if(g===1)m=(function(k,B,O){var L,R=B.length,P=k.modulus.byteLength();if(R>P-11)throw new Error("message too long");return L=O?s.alloc(P-R-3,255):(function(j){for(var z,N=s.allocUnsafe(j),S=0,C=i(2*j),E=0;S<j;)E===C.length&&(C=i(2*j),E=0),(z=C[E++])&&(N[S++]=z);return N})(P-R-3),new n(s.concat([s.from([0,O?1:2]),L,s.alloc(1),B],P))})(v,d,u);else{if(g!==3)throw new Error("unknown padding");if((m=new n(d)).cmp(v.modulus)>=0)throw new Error("data too long for modulus")}return u?o(m,v):l(m,v)}},{"./mgf":469,"./withPublic":473,"./xor":474,"bn.js":470,"browserify-rsa":209,"create-hash":386,"parse-asn1":459,randombytes:475,"safe-buffer":494}],473:[function(e,p,b){"use strict";var c=e("bn.js"),i=e("safe-buffer").Buffer;p.exports=function(a,r){return i.from(a.toRed(c.mont(r.modulus)).redPow(new c(r.publicExponent)).fromRed().toArray())}},{"bn.js":470,"safe-buffer":494}],474:[function(e,p,b){"use strict";p.exports=function(c,i){for(var a=c.length,r=-1;++r<a;)c[r]^=i[r];return c}},{}],475:[function(e,p,b){(function(c,i){(function(){"use strict";var a=e("safe-buffer").Buffer,r=i.crypto||i.msCrypto;r&&r.getRandomValues?p.exports=function(t,n){if(t>4294967295)throw new RangeError("requested too many random bytes");var l=a.allocUnsafe(t);if(t>0)if(t>65536)for(var o=0;o<t;o+=65536)r.getRandomValues(l.slice(o,o+65536));else r.getRandomValues(l);return typeof n=="function"?c.nextTick((function(){n(null,l)})):l}:p.exports=function(){throw new Error(`Secure random number generation is not supported by this browser.
11
+ Use Chrome, Firefox or Internet Explorer 11`)}}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{_process:467,"safe-buffer":494}],476:[function(e,p,b){(function(c,i){(function(){"use strict";function a(){throw new Error(`secure random number generation not supported by this browser
12
+ use chrome, FireFox or Internet Explorer 11`)}var r=e("safe-buffer"),t=e("randombytes"),n=r.Buffer,l=r.kMaxLength,o=i.crypto||i.msCrypto,s=Math.pow(2,32)-1;function f(g,m){if(typeof g!="number"||g!=g)throw new TypeError("offset must be a number");if(g>s||g<0)throw new TypeError("offset must be a uint32");if(g>l||g>m)throw new RangeError("offset out of range")}function d(g,m,v){if(typeof g!="number"||g!=g)throw new TypeError("size must be a number");if(g>s||g<0)throw new TypeError("size must be a uint32");if(g+m>v||g>l)throw new RangeError("buffer too small")}function u(g,m,v,k){if(c.browser){var B=g.buffer,O=new Uint8Array(B,m,v);return o.getRandomValues(O),k?void c.nextTick((function(){k(null,g)})):g}if(!k)return t(v).copy(g,m),g;t(v,(function(L,R){if(L)return k(L);R.copy(g,m),k(null,g)}))}o&&o.getRandomValues||!c.browser?(b.randomFill=function(g,m,v,k){if(!(n.isBuffer(g)||g instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof m=="function")k=m,m=0,v=g.length;else if(typeof v=="function")k=v,v=g.length-m;else if(typeof k!="function")throw new TypeError('"cb" argument must be a function');return f(m,g.length),d(v,m,g.length),u(g,m,v,k)},b.randomFillSync=function(g,m,v){if(m===void 0&&(m=0),!(n.isBuffer(g)||g instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return f(m,g.length),v===void 0&&(v=g.length-m),d(v,m,g.length),u(g,m,v)}):(b.randomFill=a,b.randomFillSync=a)}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{_process:467,randombytes:475,"safe-buffer":494}],477:[function(e,p,b){"use strict";var c={};function i(r,t,n){n||(n=Error);var l=(function(o){var s,f;function d(u,g,m){return o.call(this,(function(v,k,B){return typeof t=="string"?t:t(v,k,B)})(u,g,m))||this}return f=o,(s=d).prototype=Object.create(f.prototype),s.prototype.constructor=s,s.__proto__=f,d})(n);l.prototype.name=n.name,l.prototype.code=r,c[r]=l}function a(r,t){if(Array.isArray(r)){var n=r.length;return r=r.map((function(l){return String(l)})),n>2?"one of ".concat(t," ").concat(r.slice(0,n-1).join(", "),", or ")+r[n-1]:n===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}i("ERR_INVALID_OPT_VALUE",(function(r,t){return'The value "'+t+'" is invalid for option "'+r+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(r,t,n){var l,o,s,f;if(typeof t=="string"&&(o="not ",t.substr(!s||s<0?0:+s,o.length)===o)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(u,g,m){return(m===void 0||m>u.length)&&(m=u.length),u.substring(m-g.length,m)===g})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(a(t,"type"));else{var d=(function(u,g,m){return typeof m!="number"&&(m=0),!(m+g.length>u.length)&&u.indexOf(g,m)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(d," ").concat(l," ").concat(a(t,"type"))}return f+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(r){return"The "+r+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(r){return"Cannot call "+r+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(r){return"Unknown encoding: "+r}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),p.exports.codes=c},{}],478:[function(e,p,b){(function(c){(function(){"use strict";var i=Object.keys||function(d){var u=[];for(var g in d)u.push(g);return u};p.exports=o;var a=e("./_stream_readable"),r=e("./_stream_writable");e("inherits")(o,a);for(var t=i(r.prototype),n=0;n<t.length;n++){var l=t[n];o.prototype[l]||(o.prototype[l]=r.prototype[l])}function o(d){if(!(this instanceof o))return new o(d);a.call(this,d),r.call(this,d),this.allowHalfOpen=!0,d&&(d.readable===!1&&(this.readable=!1),d.writable===!1&&(this.writable=!1),d.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||c.nextTick(f,this)}function f(d){d.end()}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":480,"./_stream_writable":482,_process:467,inherits:440}],479:[function(e,p,b){"use strict";p.exports=i;var c=e("./_stream_transform");function i(a){if(!(this instanceof i))return new i(a);c.call(this,a)}e("inherits")(i,c),i.prototype._transform=function(a,r,t){t(null,a)}},{"./_stream_transform":481,inherits:440}],480:[function(e,p,b){(function(c,i){(function(){"use strict";var a;p.exports=N,N.ReadableState=z,e("events").EventEmitter;var r=function(M,I){return M.listeners(I).length},t=e("./internal/streams/stream"),n=e("buffer").Buffer,l=(i!==void 0?i:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},o,s=e("util");o=s&&s.debuglog?s.debuglog("stream"):function(){};var f,d,u,g=e("./internal/streams/buffer_list"),m=e("./internal/streams/destroy"),v=e("./internal/streams/state").getHighWaterMark,k=e("../errors").codes,B=k.ERR_INVALID_ARG_TYPE,O=k.ERR_STREAM_PUSH_AFTER_EOF,L=k.ERR_METHOD_NOT_IMPLEMENTED,R=k.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(N,t);var P=m.errorOrDestroy,j=["error","close","destroy","pause","resume"];function z(M,I,F){a=a||e("./_stream_duplex"),M=M||{},typeof F!="boolean"&&(F=I instanceof a),this.objectMode=!!M.objectMode,F&&(this.objectMode=this.objectMode||!!M.readableObjectMode),this.highWaterMark=v(this,M,"readableHighWaterMark",F),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.destroyed=!1,this.defaultEncoding=M.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,M.encoding&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(M.encoding),this.encoding=M.encoding)}function N(M){if(a=a||e("./_stream_duplex"),!(this instanceof N))return new N(M);var I=this instanceof a;this._readableState=new z(M,this,I),this.readable=!0,M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy)),t.call(this)}function S(M,I,F,U,X){o("readableAddChunk",I);var V,G=M._readableState;if(I===null)G.reading=!1,(function(ee,Z){if(o("onEofChunk"),!Z.ended){if(Z.decoder){var K=Z.decoder.end();K&&K.length&&(Z.buffer.push(K),Z.length+=Z.objectMode?1:K.length)}Z.ended=!0,Z.sync?h(ee):(Z.needReadable=!1,Z.emittedReadable||(Z.emittedReadable=!0,y(ee)))}})(M,G);else if(X||(V=(function(ee,Z){var K;Q=Z,n.isBuffer(Q)||Q instanceof l||typeof Z=="string"||Z===void 0||ee.objectMode||(K=new B("chunk",["string","Buffer","Uint8Array"],Z));var Q;return K})(G,I)),V)P(M,V);else if(G.objectMode||I&&I.length>0)if(typeof I=="string"||G.objectMode||Object.getPrototypeOf(I)===n.prototype||(I=(function(ee){return n.from(ee)})(I)),U)G.endEmitted?P(M,new R):C(M,G,I,!0);else if(G.ended)P(M,new O);else{if(G.destroyed)return!1;G.reading=!1,G.decoder&&!F?(I=G.decoder.write(I),G.objectMode||I.length!==0?C(M,G,I,!1):w(M,G)):C(M,G,I,!1)}else U||(G.reading=!1,w(M,G));return!G.ended&&(G.length<G.highWaterMark||G.length===0)}function C(M,I,F,U){I.flowing&&I.length===0&&!I.sync?(I.awaitDrain=0,M.emit("data",F)):(I.length+=I.objectMode?1:F.length,U?I.buffer.unshift(F):I.buffer.push(F),I.needReadable&&h(M)),w(M,I)}Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(M){this._readableState&&(this._readableState.destroyed=M)}}),N.prototype.destroy=m.destroy,N.prototype._undestroy=m.undestroy,N.prototype._destroy=function(M,I){I(M)},N.prototype.push=function(M,I){var F,U=this._readableState;return U.objectMode?F=!0:typeof M=="string"&&((I=I||U.defaultEncoding)!==U.encoding&&(M=n.from(M,I),I=""),F=!0),S(this,M,I,!1,F)},N.prototype.unshift=function(M){return S(this,M,null,!0,!1)},N.prototype.isPaused=function(){return this._readableState.flowing===!1},N.prototype.setEncoding=function(M){f||(f=e("string_decoder/").StringDecoder);var I=new f(M);this._readableState.decoder=I,this._readableState.encoding=this._readableState.decoder.encoding;for(var F=this._readableState.buffer.head,U="";F!==null;)U+=I.write(F.data),F=F.next;return this._readableState.buffer.clear(),U!==""&&this._readableState.buffer.push(U),this._readableState.length=U.length,this};function E(M,I){return M<=0||I.length===0&&I.ended?0:I.objectMode?1:M!=M?I.flowing&&I.length?I.buffer.head.data.length:I.length:(M>I.highWaterMark&&(I.highWaterMark=(function(F){return F>=1073741824?F=1073741824:(F--,F|=F>>>1,F|=F>>>2,F|=F>>>4,F|=F>>>8,F|=F>>>16,F++),F})(M)),M<=I.length?M:I.ended?I.length:(I.needReadable=!0,0))}function h(M){var I=M._readableState;o("emitReadable",I.needReadable,I.emittedReadable),I.needReadable=!1,I.emittedReadable||(o("emitReadable",I.flowing),I.emittedReadable=!0,c.nextTick(y,M))}function y(M){var I=M._readableState;o("emitReadable_",I.destroyed,I.length,I.ended),I.destroyed||!I.length&&!I.ended||(M.emit("readable"),I.emittedReadable=!1),I.needReadable=!I.flowing&&!I.ended&&I.length<=I.highWaterMark,q(M)}function w(M,I){I.readingMore||(I.readingMore=!0,c.nextTick(x,M,I))}function x(M,I){for(;!I.reading&&!I.ended&&(I.length<I.highWaterMark||I.flowing&&I.length===0);){var F=I.length;if(o("maybeReadMore read 0"),M.read(0),F===I.length)break}I.readingMore=!1}function _(M){var I=M._readableState;I.readableListening=M.listenerCount("readable")>0,I.resumeScheduled&&!I.paused?I.flowing=!0:M.listenerCount("data")>0&&M.resume()}function T(M){o("readable nexttick read 0"),M.read(0)}function D(M,I){o("resume",I.reading),I.reading||M.read(0),I.resumeScheduled=!1,M.emit("resume"),q(M),I.flowing&&!I.reading&&M.read(0)}function q(M){var I=M._readableState;for(o("flow",I.flowing);I.flowing&&M.read()!==null;);}function $(M,I){return I.length===0?null:(I.objectMode?F=I.buffer.shift():!M||M>=I.length?(F=I.decoder?I.buffer.join(""):I.buffer.length===1?I.buffer.first():I.buffer.concat(I.length),I.buffer.clear()):F=I.buffer.consume(M,I.decoder),F);var F}function W(M){var I=M._readableState;o("endReadable",I.endEmitted),I.endEmitted||(I.ended=!0,c.nextTick(A,I,M))}function A(M,I){if(o("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&M.length===0&&(M.endEmitted=!0,I.readable=!1,I.emit("end"),M.autoDestroy)){var F=I._writableState;(!F||F.autoDestroy&&F.finished)&&I.destroy()}}function H(M,I){for(var F=0,U=M.length;F<U;F++)if(M[F]===I)return F;return-1}N.prototype.read=function(M){o("read",M),M=parseInt(M,10);var I=this._readableState,F=M;if(M!==0&&(I.emittedReadable=!1),M===0&&I.needReadable&&((I.highWaterMark!==0?I.length>=I.highWaterMark:I.length>0)||I.ended))return o("read: emitReadable",I.length,I.ended),I.length===0&&I.ended?W(this):h(this),null;if((M=E(M,I))===0&&I.ended)return I.length===0&&W(this),null;var U,X=I.needReadable;return o("need readable",X),(I.length===0||I.length-M<I.highWaterMark)&&o("length less than watermark",X=!0),I.ended||I.reading?o("reading or ended",X=!1):X&&(o("do read"),I.reading=!0,I.sync=!0,I.length===0&&(I.needReadable=!0),this._read(I.highWaterMark),I.sync=!1,I.reading||(M=E(F,I))),(U=M>0?$(M,I):null)===null?(I.needReadable=I.length<=I.highWaterMark,M=0):(I.length-=M,I.awaitDrain=0),I.length===0&&(I.ended||(I.needReadable=!0),F!==M&&I.ended&&W(this)),U!==null&&this.emit("data",U),U},N.prototype._read=function(M){P(this,new L("_read()"))},N.prototype.pipe=function(M,I){var F=this,U=this._readableState;switch(U.pipesCount){case 0:U.pipes=M;break;case 1:U.pipes=[U.pipes,M];break;default:U.pipes.push(M)}U.pipesCount+=1,o("pipe count=%d opts=%j",U.pipesCount,I);var X=(!I||I.end!==!1)&&M!==c.stdout&&M!==c.stderr?G:ie;function V(le,re){o("onunpipe"),le===F&&re&&re.hasUnpiped===!1&&(re.hasUnpiped=!0,o("cleanup"),M.removeListener("close",J),M.removeListener("finish",ne),M.removeListener("drain",ee),M.removeListener("error",Q),M.removeListener("unpipe",V),F.removeListener("end",G),F.removeListener("end",ie),F.removeListener("data",K),Z=!0,!U.awaitDrain||M._writableState&&!M._writableState.needDrain||ee())}function G(){o("onend"),M.end()}U.endEmitted?c.nextTick(X):F.once("end",X),M.on("unpipe",V);var ee=(function(le){return function(){var re=le._readableState;o("pipeOnDrain",re.awaitDrain),re.awaitDrain&&re.awaitDrain--,re.awaitDrain===0&&r(le,"data")&&(re.flowing=!0,q(le))}})(F);M.on("drain",ee);var Z=!1;function K(le){o("ondata");var re=M.write(le);o("dest.write",re),re===!1&&((U.pipesCount===1&&U.pipes===M||U.pipesCount>1&&H(U.pipes,M)!==-1)&&!Z&&(o("false write response, pause",U.awaitDrain),U.awaitDrain++),F.pause())}function Q(le){o("onerror",le),ie(),M.removeListener("error",Q),r(M,"error")===0&&P(M,le)}function J(){M.removeListener("finish",ne),ie()}function ne(){o("onfinish"),M.removeListener("close",J),ie()}function ie(){o("unpipe"),F.unpipe(M)}return F.on("data",K),(function(le,re,se){if(typeof le.prependListener=="function")return le.prependListener(re,se);le._events&&le._events[re]?Array.isArray(le._events[re])?le._events[re].unshift(se):le._events[re]=[se,le._events[re]]:le.on(re,se)})(M,"error",Q),M.once("close",J),M.once("finish",ne),M.emit("pipe",F),U.flowing||(o("pipe resume"),F.resume()),M},N.prototype.unpipe=function(M){var I=this._readableState,F={hasUnpiped:!1};if(I.pipesCount===0)return this;if(I.pipesCount===1)return M&&M!==I.pipes||(M||(M=I.pipes),I.pipes=null,I.pipesCount=0,I.flowing=!1,M&&M.emit("unpipe",this,F)),this;if(!M){var U=I.pipes,X=I.pipesCount;I.pipes=null,I.pipesCount=0,I.flowing=!1;for(var V=0;V<X;V++)U[V].emit("unpipe",this,{hasUnpiped:!1});return this}var G=H(I.pipes,M);return G===-1||(I.pipes.splice(G,1),I.pipesCount-=1,I.pipesCount===1&&(I.pipes=I.pipes[0]),M.emit("unpipe",this,F)),this},N.prototype.on=function(M,I){var F=t.prototype.on.call(this,M,I),U=this._readableState;return M==="data"?(U.readableListening=this.listenerCount("readable")>0,U.flowing!==!1&&this.resume()):M==="readable"&&(U.endEmitted||U.readableListening||(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,o("on readable",U.length,U.reading),U.length?h(this):U.reading||c.nextTick(T,this))),F},N.prototype.addListener=N.prototype.on,N.prototype.removeListener=function(M,I){var F=t.prototype.removeListener.call(this,M,I);return M==="readable"&&c.nextTick(_,this),F},N.prototype.removeAllListeners=function(M){var I=t.prototype.removeAllListeners.apply(this,arguments);return M!=="readable"&&M!==void 0||c.nextTick(_,this),I},N.prototype.resume=function(){var M=this._readableState;return M.flowing||(o("resume"),M.flowing=!M.readableListening,(function(I,F){F.resumeScheduled||(F.resumeScheduled=!0,c.nextTick(D,I,F))})(this,M)),M.paused=!1,this},N.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},N.prototype.wrap=function(M){var I=this,F=this._readableState,U=!1;for(var X in M.on("end",(function(){if(o("wrapped end"),F.decoder&&!F.ended){var G=F.decoder.end();G&&G.length&&I.push(G)}I.push(null)})),M.on("data",(function(G){o("wrapped data"),F.decoder&&(G=F.decoder.write(G)),F.objectMode&&G==null||(F.objectMode||G&&G.length)&&(I.push(G)||(U=!0,M.pause()))})),M)this[X]===void 0&&typeof M[X]=="function"&&(this[X]=(function(G){return function(){return M[G].apply(M,arguments)}})(X));for(var V=0;V<j.length;V++)M.on(j[V],this.emit.bind(this,j[V]));return this._read=function(G){o("wrapped _read",G),U&&(U=!1,M.resume())},this},typeof Symbol=="function"&&(N.prototype[Symbol.asyncIterator]=function(){return d===void 0&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(N.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(N.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(M){this._readableState&&(this._readableState.flowing=M)}}),N._fromList=$,Object.defineProperty(N.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(N.from=function(M,I){return u===void 0&&(u=e("./internal/streams/from")),u(N,M,I)})}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":477,"./_stream_duplex":478,"./internal/streams/async_iterator":483,"./internal/streams/buffer_list":484,"./internal/streams/destroy":485,"./internal/streams/from":487,"./internal/streams/state":489,"./internal/streams/stream":490,_process:467,buffer:220,events:422,inherits:440,"string_decoder/":522,util:188}],481:[function(e,p,b){"use strict";p.exports=o;var c=e("../errors").codes,i=c.ERR_METHOD_NOT_IMPLEMENTED,a=c.ERR_MULTIPLE_CALLBACK,r=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,t=c.ERR_TRANSFORM_WITH_LENGTH_0,n=e("./_stream_duplex");function l(d,u){var g=this._transformState;g.transforming=!1;var m=g.writecb;if(m===null)return this.emit("error",new a);g.writechunk=null,g.writecb=null,u!=null&&this.push(u),m(d);var v=this._readableState;v.reading=!1,(v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}function o(d){if(!(this instanceof o))return new o(d);n.call(this,d),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",s)}function s(){var d=this;typeof this._flush!="function"||this._readableState.destroyed?f(this,null,null):this._flush((function(u,g){f(d,u,g)}))}function f(d,u,g){if(u)return d.emit("error",u);if(g!=null&&d.push(g),d._writableState.length)throw new t;if(d._transformState.transforming)throw new r;return d.push(null)}e("inherits")(o,n),o.prototype.push=function(d,u){return this._transformState.needTransform=!1,n.prototype.push.call(this,d,u)},o.prototype._transform=function(d,u,g){g(new i("_transform()"))},o.prototype._write=function(d,u,g){var m=this._transformState;if(m.writecb=g,m.writechunk=d,m.writeencoding=u,!m.transforming){var v=this._readableState;(m.needTransform||v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}},o.prototype._read=function(d){var u=this._transformState;u.writechunk===null||u.transforming?u.needTransform=!0:(u.transforming=!0,this._transform(u.writechunk,u.writeencoding,u.afterTransform))},o.prototype._destroy=function(d,u){n.prototype._destroy.call(this,d,(function(g){u(g)}))}},{"../errors":477,"./_stream_duplex":478,inherits:440}],482:[function(e,p,b){(function(c,i){(function(){"use strict";function a(x){var _=this;this.next=null,this.entry=null,this.finish=function(){(function(T,D,q){var $=T.entry;for(T.entry=null;$;){var W=$.callback;D.pendingcb--,W(q),$=$.next}D.corkedRequestsFree.next=T})(_,x)}}var r;p.exports=N,N.WritableState=z;var t={deprecate:e("util-deprecate")},n=e("./internal/streams/stream"),l=e("buffer").Buffer,o=(i!==void 0?i:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},s,f=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,u=e("../errors").codes,g=u.ERR_INVALID_ARG_TYPE,m=u.ERR_METHOD_NOT_IMPLEMENTED,v=u.ERR_MULTIPLE_CALLBACK,k=u.ERR_STREAM_CANNOT_PIPE,B=u.ERR_STREAM_DESTROYED,O=u.ERR_STREAM_NULL_VALUES,L=u.ERR_STREAM_WRITE_AFTER_END,R=u.ERR_UNKNOWN_ENCODING,P=f.errorOrDestroy;function j(){}function z(x,_,T){r=r||e("./_stream_duplex"),x=x||{},typeof T!="boolean"&&(T=_ instanceof r),this.objectMode=!!x.objectMode,T&&(this.objectMode=this.objectMode||!!x.writableObjectMode),this.highWaterMark=d(this,x,"writableHighWaterMark",T),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var D=x.decodeStrings===!1;this.decodeStrings=!D,this.defaultEncoding=x.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){(function($,W){var A=$._writableState,H=A.sync,M=A.writecb;if(typeof M!="function")throw new v;if((function(F){F.writing=!1,F.writecb=null,F.length-=F.writelen,F.writelen=0})(A),W)(function(F,U,X,V,G){--U.pendingcb,X?(c.nextTick(G,V),c.nextTick(w,F,U),F._writableState.errorEmitted=!0,P(F,V)):(G(V),F._writableState.errorEmitted=!0,P(F,V),w(F,U))})($,A,H,W,M);else{var I=h(A)||$.destroyed;I||A.corked||A.bufferProcessing||!A.bufferedRequest||E($,A),H?c.nextTick(C,$,A,I,M):C($,A,I,M)}})(_,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=x.emitClose!==!1,this.autoDestroy=!!x.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function N(x){var _=this instanceof(r=r||e("./_stream_duplex"));if(!_&&!s.call(N,this))return new N(x);this._writableState=new z(x,this,_),this.writable=!0,x&&(typeof x.write=="function"&&(this._write=x.write),typeof x.writev=="function"&&(this._writev=x.writev),typeof x.destroy=="function"&&(this._destroy=x.destroy),typeof x.final=="function"&&(this._final=x.final)),n.call(this)}function S(x,_,T,D,q,$,W){_.writelen=D,_.writecb=W,_.writing=!0,_.sync=!0,_.destroyed?_.onwrite(new B("write")):T?x._writev(q,_.onwrite):x._write(q,$,_.onwrite),_.sync=!1}function C(x,_,T,D){T||(function(q,$){$.length===0&&$.needDrain&&($.needDrain=!1,q.emit("drain"))})(x,_),_.pendingcb--,D(),w(x,_)}function E(x,_){_.bufferProcessing=!0;var T=_.bufferedRequest;if(x._writev&&T&&T.next){var D=_.bufferedRequestCount,q=new Array(D),$=_.corkedRequestsFree;$.entry=T;for(var W=0,A=!0;T;)q[W]=T,T.isBuf||(A=!1),T=T.next,W+=1;q.allBuffers=A,S(x,_,!0,_.length,q,"",$.finish),_.pendingcb++,_.lastBufferedRequest=null,$.next?(_.corkedRequestsFree=$.next,$.next=null):_.corkedRequestsFree=new a(_),_.bufferedRequestCount=0}else{for(;T;){var H=T.chunk,M=T.encoding,I=T.callback;if(S(x,_,!1,_.objectMode?1:H.length,H,M,I),T=T.next,_.bufferedRequestCount--,_.writing)break}T===null&&(_.lastBufferedRequest=null)}_.bufferedRequest=T,_.bufferProcessing=!1}function h(x){return x.ending&&x.length===0&&x.bufferedRequest===null&&!x.finished&&!x.writing}function y(x,_){x._final((function(T){_.pendingcb--,T&&P(x,T),_.prefinished=!0,x.emit("prefinish"),w(x,_)}))}function w(x,_){var T=h(_);if(T&&((function(q,$){$.prefinished||$.finalCalled||(typeof q._final!="function"||$.destroyed?($.prefinished=!0,q.emit("prefinish")):($.pendingcb++,$.finalCalled=!0,c.nextTick(y,q,$)))})(x,_),_.pendingcb===0&&(_.finished=!0,x.emit("finish"),_.autoDestroy))){var D=x._readableState;(!D||D.autoDestroy&&D.endEmitted)&&x.destroy()}return T}e("inherits")(N,n),z.prototype.getBuffer=function(){for(var x=this.bufferedRequest,_=[];x;)_.push(x),x=x.next;return _},(function(){try{Object.defineProperty(z.prototype,"buffer",{get:t.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(N,Symbol.hasInstance,{value:function(x){return!!s.call(this,x)||this===N&&x&&x._writableState instanceof z}})):s=function(x){return x instanceof this},N.prototype.pipe=function(){P(this,new k)},N.prototype.write=function(x,_,T){var D,q=this._writableState,$=!1,W=!q.objectMode&&(D=x,l.isBuffer(D)||D instanceof o);return W&&!l.isBuffer(x)&&(x=(function(A){return l.from(A)})(x)),typeof _=="function"&&(T=_,_=null),W?_="buffer":_||(_=q.defaultEncoding),typeof T!="function"&&(T=j),q.ending?(function(A,H){var M=new L;P(A,M),c.nextTick(H,M)})(this,T):(W||(function(A,H,M,I){var F;return M===null?F=new O:typeof M=="string"||H.objectMode||(F=new g("chunk",["string","Buffer"],M)),!F||(P(A,F),c.nextTick(I,F),!1)})(this,q,x,T))&&(q.pendingcb++,$=(function(A,H,M,I,F,U){if(!M){var X=(function(Z,K,Q){return Z.objectMode||Z.decodeStrings===!1||typeof K!="string"||(K=l.from(K,Q)),K})(H,I,F);I!==X&&(M=!0,F="buffer",I=X)}var V=H.objectMode?1:I.length;H.length+=V;var G=H.length<H.highWaterMark;if(G||(H.needDrain=!0),H.writing||H.corked){var ee=H.lastBufferedRequest;H.lastBufferedRequest={chunk:I,encoding:F,isBuf:M,callback:U,next:null},ee?ee.next=H.lastBufferedRequest:H.bufferedRequest=H.lastBufferedRequest,H.bufferedRequestCount+=1}else S(A,H,!1,V,I,F,U);return G})(this,q,W,x,_,T)),$},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){var x=this._writableState;x.corked&&(x.corked--,x.writing||x.corked||x.bufferProcessing||!x.bufferedRequest||E(this,x))},N.prototype.setDefaultEncoding=function(x){if(typeof x=="string"&&(x=x.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((x+"").toLowerCase())>-1))throw new R(x);return this._writableState.defaultEncoding=x,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),N.prototype._write=function(x,_,T){T(new m("_write()"))},N.prototype._writev=null,N.prototype.end=function(x,_,T){var D=this._writableState;return typeof x=="function"?(T=x,x=null,_=null):typeof _=="function"&&(T=_,_=null),x!=null&&this.write(x,_),D.corked&&(D.corked=1,this.uncork()),D.ending||(function(q,$,W){$.ending=!0,w(q,$),W&&($.finished?c.nextTick(W):q.once("finish",W)),$.ended=!0,q.writable=!1})(this,D,T),this},Object.defineProperty(N.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(x){this._writableState&&(this._writableState.destroyed=x)}}),N.prototype.destroy=f.destroy,N.prototype._undestroy=f.undestroy,N.prototype._destroy=function(x,_){_(x)}}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":477,"./_stream_duplex":478,"./internal/streams/destroy":485,"./internal/streams/state":489,"./internal/streams/stream":490,_process:467,buffer:220,inherits:440,"util-deprecate":524}],483:[function(e,p,b){(function(c){(function(){"use strict";var i;function a(B,O,L){return(O=(function(R){var P=(function(j,z){if(typeof j!="object"||j===null)return j;var N=j[Symbol.toPrimitive];if(N!==void 0){var S=N.call(j,z||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(z==="string"?String:Number)(j)})(R,"string");return typeof P=="symbol"?P:String(P)})(O))in B?Object.defineProperty(B,O,{value:L,enumerable:!0,configurable:!0,writable:!0}):B[O]=L,B}var r=e("./end-of-stream"),t=Symbol("lastResolve"),n=Symbol("lastReject"),l=Symbol("error"),o=Symbol("ended"),s=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function u(B,O){return{value:B,done:O}}function g(B){var O=B[t];if(O!==null){var L=B[d].read();L!==null&&(B[s]=null,B[t]=null,B[n]=null,O(u(L,!1)))}}function m(B){c.nextTick(g,B)}var v=Object.getPrototypeOf((function(){})),k=Object.setPrototypeOf((a(i={get stream(){return this[d]},next:function(){var B=this,O=this[l];if(O!==null)return Promise.reject(O);if(this[o])return Promise.resolve(u(void 0,!0));if(this[d].destroyed)return new Promise((function(j,z){c.nextTick((function(){B[l]?z(B[l]):j(u(void 0,!0))}))}));var L,R=this[s];if(R)L=new Promise((function(j,z){return function(N,S){j.then((function(){z[o]?N(u(void 0,!0)):z[f](N,S)}),S)}})(R,this));else{var P=this[d].read();if(P!==null)return Promise.resolve(u(P,!1));L=new Promise(this[f])}return this[s]=L,L}},Symbol.asyncIterator,(function(){return this})),a(i,"return",(function(){var B=this;return new Promise((function(O,L){B[d].destroy(null,(function(R){R?L(R):O(u(void 0,!0))}))}))})),i),v);p.exports=function(B){var O,L=Object.create(k,(a(O={},d,{value:B,writable:!0}),a(O,t,{value:null,writable:!0}),a(O,n,{value:null,writable:!0}),a(O,l,{value:null,writable:!0}),a(O,o,{value:B._readableState.endEmitted,writable:!0}),a(O,f,{value:function(R,P){var j=L[d].read();j?(L[s]=null,L[t]=null,L[n]=null,R(u(j,!1))):(L[t]=R,L[n]=P)},writable:!0}),O));return L[s]=null,r(B,(function(R){if(R&&R.code!=="ERR_STREAM_PREMATURE_CLOSE"){var P=L[n];return P!==null&&(L[s]=null,L[t]=null,L[n]=null,P(R)),void(L[l]=R)}var j=L[t];j!==null&&(L[s]=null,L[t]=null,L[n]=null,j(u(void 0,!0))),L[o]=!0})),B.on("readable",m.bind(null,L)),L}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":486,_process:467}],484:[function(e,p,b){"use strict";function c(s,f){var d=Object.keys(s);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);f&&(u=u.filter((function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable}))),d.push.apply(d,u)}return d}function i(s){for(var f=1;f<arguments.length;f++){var d=arguments[f]!=null?arguments[f]:{};f%2?c(Object(d),!0).forEach((function(u){a(s,u,d[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(d)):c(Object(d)).forEach((function(u){Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(d,u))}))}return s}function a(s,f,d){return(f=t(f))in s?Object.defineProperty(s,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):s[f]=d,s}function r(s,f){for(var d=0;d<f.length;d++){var u=f[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(s,t(u.key),u)}}function t(s){var f=(function(d,u){if(typeof d!="object"||d===null)return d;var g=d[Symbol.toPrimitive];if(g!==void 0){var m=g.call(d,u||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(d)})(s,"string");return typeof f=="symbol"?f:String(f)}var n=e("buffer").Buffer,l=e("util").inspect,o=l&&l.custom||"inspect";p.exports=(function(){function s(){(function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")})(this,s),this.head=null,this.tail=null,this.length=0}var f,d,u;return f=s,(d=[{key:"push",value:function(g){var m={data:g,next:null};this.length>0?this.tail.next=m:this.head=m,this.tail=m,++this.length}},{key:"unshift",value:function(g){var m={data:g,next:this.head};this.length===0&&(this.tail=m),this.head=m,++this.length}},{key:"shift",value:function(){if(this.length!==0){var g=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,g}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(g){if(this.length===0)return"";for(var m=this.head,v=""+m.data;m=m.next;)v+=g+m.data;return v}},{key:"concat",value:function(g){if(this.length===0)return n.alloc(0);for(var m,v,k,B=n.allocUnsafe(g>>>0),O=this.head,L=0;O;)m=O.data,v=B,k=L,n.prototype.copy.call(m,v,k),L+=O.data.length,O=O.next;return B}},{key:"consume",value:function(g,m){var v;return g<this.head.data.length?(v=this.head.data.slice(0,g),this.head.data=this.head.data.slice(g)):v=g===this.head.data.length?this.shift():m?this._getString(g):this._getBuffer(g),v}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(g){var m=this.head,v=1,k=m.data;for(g-=k.length;m=m.next;){var B=m.data,O=g>B.length?B.length:g;if(O===B.length?k+=B:k+=B.slice(0,g),(g-=O)==0){O===B.length?(++v,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=B.slice(O));break}++v}return this.length-=v,k}},{key:"_getBuffer",value:function(g){var m=n.allocUnsafe(g),v=this.head,k=1;for(v.data.copy(m),g-=v.data.length;v=v.next;){var B=v.data,O=g>B.length?B.length:g;if(B.copy(m,m.length-g,0,O),(g-=O)==0){O===B.length?(++k,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=B.slice(O));break}++k}return this.length-=k,m}},{key:o,value:function(g,m){return l(this,i(i({},m),{},{depth:0,customInspect:!1}))}}])&&r(f.prototype,d),u&&r(f,u),Object.defineProperty(f,"prototype",{writable:!1}),s})()},{buffer:220,util:188}],485:[function(e,p,b){(function(c){(function(){"use strict";function i(t,n){r(t,n),a(t)}function a(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,n){t.emit("error",n)}p.exports={destroy:function(t,n){var l=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(r,this,t)):c.nextTick(r,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(f){!n&&f?l._writableState?l._writableState.errorEmitted?c.nextTick(a,l):(l._writableState.errorEmitted=!0,c.nextTick(i,l,f)):c.nextTick(i,l,f):n?(c.nextTick(a,l),n(f)):c.nextTick(a,l)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,n){var l=t._readableState,o=t._writableState;l&&l.autoDestroy||o&&o.autoDestroy?t.destroy(n):t.emit("error",n)}}}).call(this)}).call(this,e("_process"))},{_process:467}],486:[function(e,p,b){"use strict";var c=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}p.exports=function a(r,t,n){if(typeof t=="function")return a(r,null,t);t||(t={}),n=(function(B){var O=!1;return function(){if(!O){O=!0;for(var L=arguments.length,R=new Array(L),P=0;P<L;P++)R[P]=arguments[P];B.apply(this,R)}}})(n||i);var l=t.readable||t.readable!==!1&&r.readable,o=t.writable||t.writable!==!1&&r.writable,s=function(){r.writable||d()},f=r._writableState&&r._writableState.finished,d=function(){o=!1,f=!0,l||n.call(r)},u=r._readableState&&r._readableState.endEmitted,g=function(){l=!1,u=!0,o||n.call(r)},m=function(B){n.call(r,B)},v=function(){var B;return l&&!u?(r._readableState&&r._readableState.ended||(B=new c),n.call(r,B)):o&&!f?(r._writableState&&r._writableState.ended||(B=new c),n.call(r,B)):void 0},k=function(){r.req.on("finish",d)};return(function(B){return B.setHeader&&typeof B.abort=="function"})(r)?(r.on("complete",d),r.on("abort",v),r.req?k():r.on("request",k)):o&&!r._writableState&&(r.on("end",s),r.on("close",s)),r.on("end",g),r.on("finish",d),t.error!==!1&&r.on("error",m),r.on("close",v),function(){r.removeListener("complete",d),r.removeListener("abort",v),r.removeListener("request",k),r.req&&r.req.removeListener("finish",d),r.removeListener("end",s),r.removeListener("close",s),r.removeListener("finish",d),r.removeListener("end",g),r.removeListener("error",m),r.removeListener("close",v)}}},{"../../../errors":477}],487:[function(e,p,b){"use strict";p.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],488:[function(e,p,b){"use strict";var c,i=e("../../../errors").codes,a=i.ERR_MISSING_ARGS,r=i.ERR_STREAM_DESTROYED;function t(f){if(f)throw f}function n(f,d,u,g){g=(function(k){var B=!1;return function(){B||(B=!0,k.apply(void 0,arguments))}})(g);var m=!1;f.on("close",(function(){m=!0})),c===void 0&&(c=e("./end-of-stream")),c(f,{readable:d,writable:u},(function(k){if(k)return g(k);m=!0,g()}));var v=!1;return function(k){if(!m&&!v)return v=!0,(function(B){return B.setHeader&&typeof B.abort=="function"})(f)?f.abort():typeof f.destroy=="function"?f.destroy():void g(k||new r("pipe"))}}function l(f){f()}function o(f,d){return f.pipe(d)}function s(f){return f.length?typeof f[f.length-1]!="function"?t:f.pop():t}p.exports=function(){for(var f=arguments.length,d=new Array(f),u=0;u<f;u++)d[u]=arguments[u];var g,m=s(d);if(Array.isArray(d[0])&&(d=d[0]),d.length<2)throw new a("streams");var v=d.map((function(k,B){var O=B<d.length-1;return n(k,O,B>0,(function(L){g||(g=L),L&&v.forEach(l),O||(v.forEach(l),m(g))}))}));return d.reduce(o)}},{"../../../errors":477,"./end-of-stream":486}],489:[function(e,p,b){"use strict";var c=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;p.exports={getHighWaterMark:function(i,a,r,t){var n=(function(l,o,s){return l.highWaterMark!=null?l.highWaterMark:o?l[s]:null})(a,t,r);if(n!=null){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new c(t?r:"highWaterMark",n);return Math.floor(n)}return i.objectMode?16:16384}}},{"../../../errors":477}],490:[function(e,p,b){"use strict";p.exports=e("events").EventEmitter},{events:422}],491:[function(e,p,b){"use strict";(b=p.exports=e("./lib/_stream_readable.js")).Stream=b,b.Readable=b,b.Writable=e("./lib/_stream_writable.js"),b.Duplex=e("./lib/_stream_duplex.js"),b.Transform=e("./lib/_stream_transform.js"),b.PassThrough=e("./lib/_stream_passthrough.js"),b.finished=e("./lib/internal/streams/end-of-stream.js"),b.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":478,"./lib/_stream_passthrough.js":479,"./lib/_stream_readable.js":480,"./lib/_stream_transform.js":481,"./lib/_stream_writable.js":482,"./lib/internal/streams/end-of-stream.js":486,"./lib/internal/streams/pipeline.js":488}],492:[function(e,p,b){"use strict";var c=(function(i){var a=Object.prototype,r=a.hasOwnProperty,t=Object.defineProperty||function(w,x,_){w[x]=_.value},n=typeof Symbol=="function"?Symbol:{},l=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function f(w,x,_){return Object.defineProperty(w,x,{value:_,enumerable:!0,configurable:!0,writable:!0}),w[x]}try{f({},"")}catch{f=function(x,_,T){return x[_]=T}}function d(w,x,_,T){var D=x&&x.prototype instanceof m?x:m,q=Object.create(D.prototype),$=new E(T||[]);return t(q,"_invoke",{value:z(w,_,$)}),q}function u(w,x,_){try{return{type:"normal",arg:w.call(x,_)}}catch(T){return{type:"throw",arg:T}}}i.wrap=d;var g={};function m(){}function v(){}function k(){}var B={};f(B,l,(function(){return this}));var O=Object.getPrototypeOf,L=O&&O(O(h([])));L&&L!==a&&r.call(L,l)&&(B=L);var R=k.prototype=m.prototype=Object.create(B);function P(w){["next","throw","return"].forEach((function(x){f(w,x,(function(_){return this._invoke(x,_)}))}))}function j(w,x){var _;t(this,"_invoke",{value:function(T,D){function q(){return new x((function($,W){(function A(H,M,I,F){var U=u(w[H],w,M);if(U.type!=="throw"){var X=U.arg,V=X.value;return V&&typeof V=="object"&&r.call(V,"__await")?x.resolve(V.__await).then((function(G){A("next",G,I,F)}),(function(G){A("throw",G,I,F)})):x.resolve(V).then((function(G){X.value=G,I(X)}),(function(G){return A("throw",G,I,F)}))}F(U.arg)})(T,D,$,W)}))}return _=_?_.then(q,q):q()}})}function z(w,x,_){var T="suspendedStart";return function(D,q){if(T==="executing")throw new Error("Generator is already running");if(T==="completed"){if(D==="throw")throw q;return y()}for(_.method=D,_.arg=q;;){var $=_.delegate;if($){var W=N($,_);if(W){if(W===g)continue;return W}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(T==="suspendedStart")throw T="completed",_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);T="executing";var A=u(w,x,_);if(A.type==="normal"){if(T=_.done?"completed":"suspendedYield",A.arg===g)continue;return{value:A.arg,done:_.done}}A.type==="throw"&&(T="completed",_.method="throw",_.arg=A.arg)}}}function N(w,x){var _=x.method,T=w.iterator[_];if(T===void 0)return x.delegate=null,_==="throw"&&w.iterator.return&&(x.method="return",x.arg=void 0,N(w,x),x.method==="throw")||_!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var D=u(T,w.iterator,x.arg);if(D.type==="throw")return x.method="throw",x.arg=D.arg,x.delegate=null,g;var q=D.arg;return q?q.done?(x[w.resultName]=q.value,x.next=w.nextLoc,x.method!=="return"&&(x.method="next",x.arg=void 0),x.delegate=null,g):q:(x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,g)}function S(w){var x={tryLoc:w[0]};1 in w&&(x.catchLoc=w[1]),2 in w&&(x.finallyLoc=w[2],x.afterLoc=w[3]),this.tryEntries.push(x)}function C(w){var x=w.completion||{};x.type="normal",delete x.arg,w.completion=x}function E(w){this.tryEntries=[{tryLoc:"root"}],w.forEach(S,this),this.reset(!0)}function h(w){if(w){var x=w[l];if(x)return x.call(w);if(typeof w.next=="function")return w;if(!isNaN(w.length)){var _=-1,T=function D(){for(;++_<w.length;)if(r.call(w,_))return D.value=w[_],D.done=!1,D;return D.value=void 0,D.done=!0,D};return T.next=T}}return{next:y}}function y(){return{value:void 0,done:!0}}return v.prototype=k,t(R,"constructor",{value:k,configurable:!0}),t(k,"constructor",{value:v,configurable:!0}),v.displayName=f(k,s,"GeneratorFunction"),i.isGeneratorFunction=function(w){var x=typeof w=="function"&&w.constructor;return!!x&&(x===v||(x.displayName||x.name)==="GeneratorFunction")},i.mark=function(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,k):(w.__proto__=k,f(w,s,"GeneratorFunction")),w.prototype=Object.create(R),w},i.awrap=function(w){return{__await:w}},P(j.prototype),f(j.prototype,o,(function(){return this})),i.AsyncIterator=j,i.async=function(w,x,_,T,D){D===void 0&&(D=Promise);var q=new j(d(w,x,_,T),D);return i.isGeneratorFunction(x)?q:q.next().then((function($){return $.done?$.value:q.next()}))},P(R),f(R,s,"Generator"),f(R,l,(function(){return this})),f(R,"toString",(function(){return"[object Generator]"})),i.keys=function(w){var x=Object(w),_=[];for(var T in x)_.push(T);return _.reverse(),function D(){for(;_.length;){var q=_.pop();if(q in x)return D.value=q,D.done=!1,D}return D.done=!0,D}},i.values=h,E.prototype={constructor:E,reset:function(w){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!w)for(var x in this)x.charAt(0)==="t"&&r.call(this,x)&&!isNaN(+x.slice(1))&&(this[x]=void 0)},stop:function(){this.done=!0;var w=this.tryEntries[0].completion;if(w.type==="throw")throw w.arg;return this.rval},dispatchException:function(w){if(this.done)throw w;var x=this;function _(A,H){return q.type="throw",q.arg=w,x.next=A,H&&(x.method="next",x.arg=void 0),!!H}for(var T=this.tryEntries.length-1;T>=0;--T){var D=this.tryEntries[T],q=D.completion;if(D.tryLoc==="root")return _("end");if(D.tryLoc<=this.prev){var $=r.call(D,"catchLoc"),W=r.call(D,"finallyLoc");if($&&W){if(this.prev<D.catchLoc)return _(D.catchLoc,!0);if(this.prev<D.finallyLoc)return _(D.finallyLoc)}else if($){if(this.prev<D.catchLoc)return _(D.catchLoc,!0)}else{if(!W)throw new Error("try statement without catch or finally");if(this.prev<D.finallyLoc)return _(D.finallyLoc)}}}},abrupt:function(w,x){for(var _=this.tryEntries.length-1;_>=0;--_){var T=this.tryEntries[_];if(T.tryLoc<=this.prev&&r.call(T,"finallyLoc")&&this.prev<T.finallyLoc){var D=T;break}}D&&(w==="break"||w==="continue")&&D.tryLoc<=x&&x<=D.finallyLoc&&(D=null);var q=D?D.completion:{};return q.type=w,q.arg=x,D?(this.method="next",this.next=D.finallyLoc,g):this.complete(q)},complete:function(w,x){if(w.type==="throw")throw w.arg;return w.type==="break"||w.type==="continue"?this.next=w.arg:w.type==="return"?(this.rval=this.arg=w.arg,this.method="return",this.next="end"):w.type==="normal"&&x&&(this.next=x),g},finish:function(w){for(var x=this.tryEntries.length-1;x>=0;--x){var _=this.tryEntries[x];if(_.finallyLoc===w)return this.complete(_.completion,_.afterLoc),C(_),g}},catch:function(w){for(var x=this.tryEntries.length-1;x>=0;--x){var _=this.tryEntries[x];if(_.tryLoc===w){var T=_.completion;if(T.type==="throw"){var D=T.arg;C(_)}return D}}throw new Error("illegal catch attempt")},delegateYield:function(w,x,_){return this.delegate={iterator:h(w),resultName:x,nextLoc:_},this.method==="next"&&(this.arg=void 0),g}},i})(typeof p=="object"?p.exports:{});try{regeneratorRuntime=c}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},{}],493:[function(e,p,b){"use strict";var c=e("buffer").Buffer,i=e("inherits"),a=e("hash-base"),r=new Array(16),t=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],n=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],o=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],s=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function d(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function u(O,L){return O<<L|O>>>32-L}function g(O,L,R,P,j,z,N,S){return u(O+(L^R^P)+z+N|0,S)+j|0}function m(O,L,R,P,j,z,N,S){return u(O+(L&R|~L&P)+z+N|0,S)+j|0}function v(O,L,R,P,j,z,N,S){return u(O+((L|~R)^P)+z+N|0,S)+j|0}function k(O,L,R,P,j,z,N,S){return u(O+(L&P|R&~P)+z+N|0,S)+j|0}function B(O,L,R,P,j,z,N,S){return u(O+(L^(R|~P))+z+N|0,S)+j|0}i(d,a),d.prototype._update=function(){for(var O=r,L=0;L<16;++L)O[L]=this._block.readInt32LE(4*L);for(var R=0|this._a,P=0|this._b,j=0|this._c,z=0|this._d,N=0|this._e,S=0|this._a,C=0|this._b,E=0|this._c,h=0|this._d,y=0|this._e,w=0;w<80;w+=1){var x,_;w<16?(x=g(R,P,j,z,N,O[t[w]],s[0],l[w]),_=B(S,C,E,h,y,O[n[w]],f[0],o[w])):w<32?(x=m(R,P,j,z,N,O[t[w]],s[1],l[w]),_=k(S,C,E,h,y,O[n[w]],f[1],o[w])):w<48?(x=v(R,P,j,z,N,O[t[w]],s[2],l[w]),_=v(S,C,E,h,y,O[n[w]],f[2],o[w])):w<64?(x=k(R,P,j,z,N,O[t[w]],s[3],l[w]),_=m(S,C,E,h,y,O[n[w]],f[3],o[w])):(x=B(R,P,j,z,N,O[t[w]],s[4],l[w]),_=g(S,C,E,h,y,O[n[w]],f[4],o[w])),R=N,N=z,z=u(j,10),j=P,P=x,S=y,y=h,h=u(E,10),E=C,C=_}var T=this._b+j+h|0;this._b=this._c+z+y|0,this._c=this._d+N+S|0,this._d=this._e+R+C|0,this._e=this._a+P+E|0,this._a=T},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var O=c.alloc?c.alloc(20):new c(20);return O.writeInt32LE(this._a,0),O.writeInt32LE(this._b,4),O.writeInt32LE(this._c,8),O.writeInt32LE(this._d,12),O.writeInt32LE(this._e,16),O},p.exports=d},{buffer:220,"hash-base":425,inherits:440}],494:[function(e,p,b){"use strict";var c=e("buffer"),i=c.Buffer;function a(t,n){for(var l in t)n[l]=t[l]}function r(t,n,l){return i(t,n,l)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?p.exports=c:(a(c,b),b.Buffer=r),r.prototype=Object.create(i.prototype),a(i,r),r.from=function(t,n,l){if(typeof t=="number")throw new TypeError("Argument must not be a number");return i(t,n,l)},r.alloc=function(t,n,l){if(typeof t!="number")throw new TypeError("Argument must be a number");var o=i(t);return n!==void 0?typeof l=="string"?o.fill(n,l):o.fill(n):o.fill(0),o},r.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return i(t)},r.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return c.SlowBuffer(t)}},{buffer:220}],495:[function(e,p,b){(function(c){(function(){"use strict";var i,a=e("buffer"),r=a.Buffer,t={};for(i in a)a.hasOwnProperty(i)&&i!=="SlowBuffer"&&i!=="Buffer"&&(t[i]=a[i]);var n=t.Buffer={};for(i in r)r.hasOwnProperty(i)&&i!=="allocUnsafe"&&i!=="allocUnsafeSlow"&&(n[i]=r[i]);if(t.Buffer.prototype=r.prototype,n.from&&n.from!==Uint8Array.from||(n.from=function(l,o,s){if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof l);if(l&&l.length===void 0)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);return r(l,o,s)}),n.alloc||(n.alloc=function(l,o,s){if(typeof l!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof l);if(l<0||l>=2*(1<<30))throw new RangeError('The value "'+l+'" is invalid for option "size"');var f=r(l);return o&&o.length!==0?typeof s=="string"?f.fill(o,s):f.fill(o):f.fill(0),f}),!t.kStringMaxLength)try{t.kStringMaxLength=c.binding("buffer").kStringMaxLength}catch{}t.constants||(t.constants={MAX_LENGTH:t.kMaxLength},t.kStringMaxLength&&(t.constants.MAX_STRING_LENGTH=t.kStringMaxLength)),p.exports=t}).call(this)}).call(this,e("_process"))},{_process:467,buffer:220}],496:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});let c=e("xmlchars/xml/1.0/ed5"),i=e("xmlchars/xml/1.1/ed2"),a=e("xmlchars/xmlns/1.0/ed3");var r=c.isS,t=c.isChar,n=c.isNameStartChar,l=c.isNameChar,o=c.S_LIST,s=c.NAME_RE,f=i.isChar,d=a.isNCNameStartChar,u=a.isNCNameChar,g=a.NC_NAME_RE;let m="http://www.w3.org/XML/1998/namespace",v="http://www.w3.org/2000/xmlns/",k={__proto__:null,xml:m,xmlns:v},B={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},O=h=>h===34||h===39,L=[34,39],R=[...L,91,62],P=[...L,60,93],j=[61,63,...o],z=[...o,62,38,60];function N(h,y,w){switch(y){case"xml":w!==m&&h.fail(`xml prefix must be bound to ${m}.`);break;case"xmlns":w!==v&&h.fail(`xmlns prefix must be bound to ${v}.`)}switch(w){case v:h.fail(y===""?`the default namespace may not be set to ${w}.`:`may not assign a prefix (even "xmlns") to the URI ${v}.`);break;case m:switch(y){case"xml":break;case"":h.fail(`the default namespace may not be set to ${w}.`);break;default:h.fail("may not assign the xml namespace to another prefix.")}}}let S=h=>g.test(h),C=h=>s.test(h);b.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];let E={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};b.SaxesParser=class{constructor(h){this.opt=h??{},this.fragmentOpt=!!this.opt.fragment;let y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,y){this.nameStartCheck=d,this.nameCheck=u,this.isName=S,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},k);let w=this.opt.additionalNamespaces;w!=null&&((function(x,_){for(let T of Object.keys(_))N(x,T,_[T])})(this,w),Object.assign(this.ns,w))}else this.nameStartCheck=n,this.nameCheck=l,this.isName=C,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var h;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];let{fragmentOpt:y}=this;this.state=y?13:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=y,this.xmlDeclPossible=!y,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:w}=this.opt;if(w===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");w="1.0"}this.setXMLVersion(w),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(B),(h=this.readyHandler)===null||h===void 0||h.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(h,y){this[E[h]]=y}off(h){this[E[h]]=void 0}makeError(h){var y;let w=(y=this.fileName)!==null&&y!==void 0?y:"";return this.trackPosition&&(w.length>0&&(w+=":"),w+=`${this.line}:${this.column}`),w.length>0&&(w+=": "),new Error(w+h)}fail(h){let y=this.makeError(h),w=this.errorHandler;if(w===void 0)throw y;return w(y),this}write(h){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let y=!1;h===null?(y=!0,h=""):typeof h=="object"&&(h=h.toString()),this.carriedFromPrevious!==void 0&&(h=`${this.carriedFromPrevious}${h}`,this.carriedFromPrevious=void 0);let w=h.length,x=h.charCodeAt(w-1);!y&&(x===13||x>=55296&&x<=56319)&&(this.carriedFromPrevious=h[w-1],w--,h=h.slice(0,w));let{stateTable:_}=this;for(this.chunk=h,this.i=0;this.i<w;)_[this.state].call(this);return this.chunkPosition+=w,y?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:h,i:y}=this;if(this.prevI=y,this.i=y+1,y>=h.length)return-1;let w=h.charCodeAt(y);if(this.column++,w<55296){if(w>=32||w===9)return w;switch(w){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:return h.charCodeAt(y+1)===10&&(this.i=y+2),this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail("disallowed character."),w}}if(w>56319)return w>=57344&&w<=65533||this.fail("disallowed character."),w;let x=65536+1024*(w-55296)+(h.charCodeAt(y+1)-56320);return this.i=y+2,x>1114111&&this.fail("disallowed character."),x}getCode11(){let{chunk:h,i:y}=this;if(this.prevI=y,this.i=y+1,y>=h.length)return-1;let w=h.charCodeAt(y);if(this.column++,w<55296){if(w>31&&w<127||w>159&&w!==8232||w===9)return w;switch(w){case 10:return this.line++,this.column=0,this.positionAtNewLine=this.position,10;case 13:{let _=h.charCodeAt(y+1);_!==10&&_!==133||(this.i=y+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,-2;default:return this.fail("disallowed character."),w}}if(w>56319)return w>=57344&&w<=65533||this.fail("disallowed character."),w;let x=65536+1024*(w-55296)+(h.charCodeAt(y+1)-56320);return this.i=y+2,x>1114111&&this.fail("disallowed character."),x}getCodeNorm(){let h=this.getCode();return h===-2?10:h}unget(){this.i=this.prevI,this.column--}captureTo(h){let{i:y}=this,{chunk:w}=this;for(;;){let x=this.getCode(),_=x===-2,T=_?10:x;if(T===-1||h.includes(T))return this.text+=w.slice(y,this.prevI),T;_&&(this.text+=w.slice(y,this.prevI)+`
13
+ `,y=this.i)}}captureToChar(h){let{i:y}=this,{chunk:w}=this;for(;;){let x=this.getCode();switch(x){case-2:this.text+=w.slice(y,this.prevI)+`
14
+ `,y=this.i,x=10;break;case-1:return this.text+=w.slice(y),!1}if(x===h)return this.text+=w.slice(y,this.prevI),!0}}captureNameChars(){let{chunk:h,i:y}=this;for(;;){let w=this.getCode();if(w===-1)return this.name+=h.slice(y),-1;if(!l(w))return this.name+=h.slice(y,this.prevI),w===-2?10:w}}skipSpaces(){for(;;){let h=this.getCodeNorm();if(h===-1||!r(h))return h}}setXMLVersion(h){this.currentXMLVersion=h,h==="1.0"?(this.isChar=t,this.getCode=this.getCode10):(this.isChar=f,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){let h=this.i,y=this.skipSpaces();switch(this.prevI!==h&&(this.xmlDeclPossible=!1),y){case 60:if(this.state=15,this.text.length!==0)throw new Error("no-empty text at start");break;case-1:break;default:this.unget(),this.state=13,this.xmlDeclPossible=!1}}sDoctype(){var h;let y=this.captureTo(R);switch(y){case 62:(h=this.doctypeHandler)===null||h===void 0||h.call(this,this.text),this.text="",this.state=13,this.doctype=!0;break;case-1:break;default:this.text+=String.fromCodePoint(y),y===91?this.state=4:O(y)&&(this.state=3,this.q=y)}}sDoctypeQuote(){let h=this.q;this.captureToChar(h)&&(this.text+=String.fromCodePoint(h),this.q=null,this.state=2)}sDTD(){let h=this.captureTo(P);h!==-1&&(this.text+=String.fromCodePoint(h),h===93?this.state=2:h===60?this.state=6:O(h)&&(this.state=5,this.q=h))}sDTDQuoted(){let h=this.q;this.captureToChar(h)&&(this.text+=String.fromCodePoint(h),this.state=4,this.q=null)}sDTDOpenWaka(){let h=this.getCodeNorm();switch(this.text+=String.fromCodePoint(h),h){case 33:this.state=7,this.openWakaBang="";break;case 63:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){let h=String.fromCodePoint(this.getCodeNorm()),y=this.openWakaBang+=h;this.text+=h,y!=="-"&&(this.state=y==="--"?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){let h=this.getCodeNorm();this.text+=String.fromCodePoint(h),this.state=h===45?10:8}sDTDCommentEnded(){let h=this.getCodeNorm();this.text+=String.fromCodePoint(h),h===62?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(63)&&(this.text+="?",this.state=12)}sDTDPIEnding(){let h=this.getCodeNorm();this.text+=String.fromCodePoint(h),h===62&&(this.state=4)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:h}=this,{chunk:y}=this;e:for(;;)switch(this.getCode()){case-2:this.entity+=y.slice(h,this.prevI)+`
15
+ `,h=this.i;break;case 59:{let{entityReturnState:w}=this,x=this.entity+y.slice(h,this.prevI),_;this.state=w,x===""?(this.fail("empty entity name."),_="&;"):(_=this.parseEntity(x),this.entity=""),w===13&&this.textHandler===void 0||(this.text+=_);break e}case-1:this.entity+=y.slice(h);break e}}sOpenWaka(){let h=this.getCode();if(n(h))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(h){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case 63:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=13,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang="";break;case"--":this.state=17,this.openWakaBang="";break;case"DOCTYPE":this.state=2,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var h;let y=this.getCodeNorm();y===45?(this.state=19,(h=this.commentHandler)===null||h===void 0||h.call(this,this.text),this.text=""):(this.text+="-"+String.fromCodePoint(y),this.state=17)}sCommentEnded(){let h=this.getCodeNorm();h!==62?(this.fail("malformed comment."),this.text+="--"+String.fromCodePoint(h),this.state=17):this.state=13}sCData(){this.captureToChar(93)&&(this.state=21)}sCDataEnding(){let h=this.getCodeNorm();h===93?this.state=22:(this.text+="]"+String.fromCodePoint(h),this.state=20)}sCDataEnding2(){var h;let y=this.getCodeNorm();switch(y){case 62:(h=this.cdataHandler)===null||h===void 0||h.call(this,this.text),this.text="",this.state=13;break;case 93:this.text+="]";break;default:this.text+="]]"+String.fromCodePoint(y),this.state=20}}sPIFirstChar(){let h=this.getCodeNorm();this.nameStartCheck(h)?(this.piTarget+=String.fromCodePoint(h),this.state=24):h===63||r(h)?(this.fail("processing instruction without a target."),this.state=h===63?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(h),this.state=24)}sPIRest(){let{chunk:h,i:y}=this;for(;;){let w=this.getCodeNorm();if(w===-1)return void(this.piTarget+=h.slice(y));if(!this.nameCheck(w)){this.piTarget+=h.slice(y,this.prevI);let x=w===63;x||r(w)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=x?33:27):this.state=x?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(w));break}}}sPIBody(){if(this.text.length===0){let h=this.getCodeNorm();h===63?this.state=26:r(h)||(this.text=String.fromCodePoint(h))}else this.captureToChar(63)&&(this.state=26)}sPIEnding(){var h;let y=this.getCodeNorm();if(y===62){let{piTarget:w}=this;w.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(h=this.piHandler)===null||h===void 0||h.call(this,{target:w,body:this.text}),this.piTarget=this.text="",this.state=13}else y===63?this.text+="?":(this.text+="?"+String.fromCodePoint(y),this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let h=this.skipSpaces();h!==63?h!==-1&&(this.state=28,this.name=String.fromCodePoint(h)):this.state=33}sXMLDeclName(){let h=this.captureTo(j);if(h===63)return this.state=33,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(r(h)||h===61){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail("expected one of "+this.xmlDeclExpects.join(", "))}this.state=h===61?30:29}}sXMLDeclEq(){let h=this.getCodeNorm();if(h===63)return this.state=33,void this.fail("XML declaration is incomplete.");r(h)||(h!==61&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){let h=this.getCodeNorm();if(h===63)return this.state=33,void this.fail("XML declaration is incomplete.");r(h)||(O(h)?this.q=h:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){let h=this.captureTo([this.q,63]);if(h===63)return this.state=33,this.text="",void this.fail("XML declaration is incomplete.");if(h===-1)return;let y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let w=y;this.xmlDecl.version=w,/^1\.[0-9]+$/.test(w)?this.opt.forceXMLVersion||this.setXMLVersion(w):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(y)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=y;break;case"standalone":y!=="yes"&&y!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=y}this.name="",this.state=32}sXMLDeclSeparator(){let h=this.getCodeNorm();h!==63?(r(h)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=33}sXMLDeclEnding(){var h;this.getCodeNorm()===62?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(h=this.xmldeclHandler)===null||h===void 0||h.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=13):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var h;let y=this.captureNameChars();if(y===-1)return;let w=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=w.ns=Object.create(null)),(h=this.openTagStartHandler)===null||h===void 0||h.call(this,w),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),y){case 62:this.openTag();break;case 47:this.state=35;break;default:r(y)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===62?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){let h=this.skipSpaces();h!==-1&&(n(h)?(this.unget(),this.state=37):h===62?this.openTag():h===47?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){let h=this.captureNameChars();h===61?this.state=39:r(h)?this.state=38:h===62?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):h!==-1&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){let h=this.skipSpaces();switch(h){case-1:return;case 61:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",h===62?this.openTag():n(h)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){let h=this.getCodeNorm();O(h)?(this.q=h,this.state=40):r(h)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){let{q:h,chunk:y}=this,{i:w}=this;for(;;)switch(this.getCode()){case h:return this.pushAttrib(this.name,this.text+y.slice(w,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=y.slice(w,this.prevI),this.state=14,void(this.entityReturnState=40);case 10:case-2:case 9:this.text+=y.slice(w,this.prevI)+" ",w=this.i;break;case 60:return this.text+=y.slice(w,this.prevI),void this.fail("disallowed character.");case-1:return void(this.text+=y.slice(w))}}sAttribValueClosed(){let h=this.getCodeNorm();r(h)?this.state=36:h===62?this.openTag():h===47?this.state=35:n(h)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){let h=this.captureTo(z);switch(h){case 38:this.state=14,this.entityReturnState=42;break;case 60:this.fail("disallowed character.");break;case-1:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",h===62?this.openTag():this.state=36}}sCloseTag(){let h=this.captureNameChars();h===62?this.closeTag():r(h)?this.state=44:h!==-1&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case 62:this.closeTag();break;case-1:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:h,forbiddenState:y}=this,{chunk:w,textHandler:x}=this;e:for(;;)switch(this.getCode()){case 60:if(this.state=15,x!==void 0){let{text:_}=this,T=w.slice(h,this.prevI);_.length!==0?(x(_+T),this.text=""):T.length!==0&&x(T)}y=0;break e;case 38:this.state=14,this.entityReturnState=13,x!==void 0&&(this.text+=w.slice(h,this.prevI)),y=0;break e;case 93:switch(y){case 0:y=1;break;case 1:y=2;break;case 2:break;default:throw new Error("impossible state")}break;case 62:y===2&&this.fail('the string "]]>" is disallowed in char data.'),y=0;break;case-2:x!==void 0&&(this.text+=w.slice(h,this.prevI)+`
16
+ `),h=this.i,y=0;break;case-1:x!==void 0&&(this.text+=w.slice(h));break e;default:y=0}this.forbiddenState=y}handleTextOutsideRoot(){let{i:h}=this,{chunk:y,textHandler:w}=this,x=!1;e:for(;;){let _=this.getCode();switch(_){case 60:if(this.state=15,w!==void 0){let{text:T}=this,D=y.slice(h,this.prevI);T.length!==0?(w(T+D),this.text=""):D.length!==0&&w(D)}break e;case 38:this.state=14,this.entityReturnState=13,w!==void 0&&(this.text+=y.slice(h,this.prevI)),x=!0;break e;case-2:w!==void 0&&(this.text+=y.slice(h,this.prevI)+`
17
+ `),h=this.i;break;case-1:w!==void 0&&(this.text+=y.slice(h));break e;default:r(_)||(x=!0)}}x&&(this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(h,y){var w;let{prefix:x,local:_}=this.qname(h),T={name:h,prefix:x,local:_,value:y};if(this.attribList.push(T),(w=this.attributeHandler)===null||w===void 0||w.call(this,T),x==="xmlns"){let D=y.trim();this.currentXMLVersion==="1.0"&&D===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[_]=D,N(this,_,D)}else if(h==="xmlns"){let D=y.trim();this.topNS[""]=D,N(this,"",D)}}pushAttribPlain(h,y){var w;let x={name:h,value:y};this.attribList.push(x),(w=this.attributeHandler)===null||w===void 0||w.call(this,x)}end(){var h,y;this.sawRoot||this.fail("document must contain a root element.");let{tags:w}=this;for(;w.length>0;){let _=w.pop();this.fail("unclosed tag: "+_.name)}this.state!==0&&this.state!==13&&this.fail("unexpected end.");let{text:x}=this;return x.length!==0&&((h=this.textHandler)===null||h===void 0||h.call(this,x),this.text=""),this._closed=!0,(y=this.endHandler)===null||y===void 0||y.call(this),this._init(),this}resolve(h){var y,w;let x=this.topNS[h];if(x!==void 0)return x;let{tags:_}=this;for(let T=_.length-1;T>=0;T--)if(x=_[T].ns[h],x!==void 0)return x;return x=this.ns[h],x!==void 0?x:(w=(y=this.opt).resolvePrefix)===null||w===void 0?void 0:w.call(y,h)}qname(h){let y=h.indexOf(":");if(y===-1)return{prefix:"",local:h};let w=h.slice(y+1),x=h.slice(0,y);return(x===""||w===""||w.includes(":"))&&this.fail(`malformed name: ${h}.`),{prefix:x,local:w}}processAttribsNS(){var h;let{attribList:y}=this,w=this.tag;{let{prefix:T,local:D}=this.qname(w.name);w.prefix=T,w.local=D;let q=w.uri=(h=this.resolve(T))!==null&&h!==void 0?h:"";T!==""&&(T==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),q===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(T)}.`),w.uri=T))}if(y.length===0)return;let{attributes:x}=w,_=new Set;for(let T of y){let{name:D,prefix:q,local:$}=T,W,A;q===""?(W=D==="xmlns"?v:"",A=D):(W=this.resolve(q),W===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(q)}.`),W=q),A=`{${W}}${$}`),_.has(A)&&this.fail(`duplicate attribute: ${A}.`),_.add(A),T.uri=W,x[D]=T}this.attribList=[]}processAttribsPlain(){let{attribList:h}=this,y=this.tag.attributes;for(let{name:w,value:x}of h)y[w]!==void 0&&this.fail(`duplicate attribute: ${w}.`),y[w]=x;this.attribList=[]}openTag(){var h;this.processAttribs();let{tags:y}=this,w=this.tag;w.isSelfClosing=!1,(h=this.openTagHandler)===null||h===void 0||h.call(this,w),y.push(w),this.state=13,this.name=""}openSelfClosingTag(){var h,y,w;this.processAttribs();let{tags:x}=this,_=this.tag;_.isSelfClosing=!0,(h=this.openTagHandler)===null||h===void 0||h.call(this,_),(y=this.closeTagHandler)===null||y===void 0||y.call(this,_),(this.tag=(w=x[x.length-1])!==null&&w!==void 0?w:null)===null&&(this.closedRoot=!0),this.state=13,this.name=""}closeTag(){let{tags:h,name:y}=this;if(this.state=13,this.name="",y==="")return this.fail("weird empty close tag."),void(this.text+="</>");let w=this.closeTagHandler,x=h.length;for(;x-- >0;){let _=this.tag=h.pop();if(this.topNS=_.ns,w?.(_),_.name===y)break;this.fail("unexpected close tag.")}x===0?this.closedRoot=!0:x<0&&(this.fail(`unmatched closing tag: ${y}.`),this.text+=`</${y}>`)}parseEntity(h){if(h[0]!=="#"){let w=this.ENTITIES[h];return w!==void 0?w:(this.fail(this.isName(h)?"undefined entity.":"disallowed character in entity name."),`&${h};`)}let y=NaN;return h[1]==="x"&&/^#x[0-9a-f]+$/i.test(h)?y=parseInt(h.slice(2),16):/^#[0-9]+$/.test(h)&&(y=parseInt(h.slice(1),10)),this.isChar(y)?String.fromCodePoint(y):(this.fail("malformed character entity."),`&${h};`)}}},{"xmlchars/xml/1.0/ed5":543,"xmlchars/xml/1.1/ed2":544,"xmlchars/xmlns/1.0/ed3":545}],497:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer;function i(a,r){this._block=c.alloc(a),this._finalSize=r,this._blockSize=a,this._len=0}i.prototype.update=function(a,r){typeof a=="string"&&(r=r||"utf8",a=c.from(a,r));for(var t=this._block,n=this._blockSize,l=a.length,o=this._len,s=0;s<l;){for(var f=o%n,d=Math.min(l-s,n-f),u=0;u<d;u++)t[f+u]=a[s+u];s+=d,(o+=d)%n==0&&this._update(t)}return this._len+=l,this},i.prototype.digest=function(a){var r=this._len%this._blockSize;this._block[r]=128,this._block.fill(0,r+1),r>=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var n=(4294967295&t)>>>0,l=(t-n)/4294967296;this._block.writeUInt32BE(l,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return a?o.toString(a):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},p.exports=i},{"safe-buffer":494}],498:[function(e,p,b){"use strict";var c=p.exports=function(i){i=i.toLowerCase();var a=c[i];if(!a)throw new Error(i+" is not supported (we accept pull requests)");return new a};c.sha=e("./sha"),c.sha1=e("./sha1"),c.sha224=e("./sha224"),c.sha256=e("./sha256"),c.sha384=e("./sha384"),c.sha512=e("./sha512")},{"./sha":499,"./sha1":500,"./sha224":501,"./sha256":502,"./sha384":503,"./sha512":504}],499:[function(e,p,b){"use strict";var c=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,r=[1518500249,1859775393,-1894007588,-899497514],t=new Array(80);function n(){this.init(),this._w=t,i.call(this,64,56)}function l(s){return s<<30|s>>>2}function o(s,f,d,u){return s===0?f&d|~f&u:s===2?f&d|f&u|d&u:f^d^u}c(n,i),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(s){for(var f,d=this._w,u=0|this._a,g=0|this._b,m=0|this._c,v=0|this._d,k=0|this._e,B=0;B<16;++B)d[B]=s.readInt32BE(4*B);for(;B<80;++B)d[B]=d[B-3]^d[B-8]^d[B-14]^d[B-16];for(var O=0;O<80;++O){var L=~~(O/20),R=0|((f=u)<<5|f>>>27)+o(L,g,m,v)+k+d[O]+r[L];k=v,v=m,m=l(g),g=u,u=R}this._a=u+this._a|0,this._b=g+this._b|0,this._c=m+this._c|0,this._d=v+this._d|0,this._e=k+this._e|0},n.prototype._hash=function(){var s=a.allocUnsafe(20);return s.writeInt32BE(0|this._a,0),s.writeInt32BE(0|this._b,4),s.writeInt32BE(0|this._c,8),s.writeInt32BE(0|this._d,12),s.writeInt32BE(0|this._e,16),s},p.exports=n},{"./hash":497,inherits:440,"safe-buffer":494}],500:[function(e,p,b){"use strict";var c=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,r=[1518500249,1859775393,-1894007588,-899497514],t=new Array(80);function n(){this.init(),this._w=t,i.call(this,64,56)}function l(f){return f<<5|f>>>27}function o(f){return f<<30|f>>>2}function s(f,d,u,g){return f===0?d&u|~d&g:f===2?d&u|d&g|u&g:d^u^g}c(n,i),n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},n.prototype._update=function(f){for(var d,u=this._w,g=0|this._a,m=0|this._b,v=0|this._c,k=0|this._d,B=0|this._e,O=0;O<16;++O)u[O]=f.readInt32BE(4*O);for(;O<80;++O)u[O]=(d=u[O-3]^u[O-8]^u[O-14]^u[O-16])<<1|d>>>31;for(var L=0;L<80;++L){var R=~~(L/20),P=l(g)+s(R,m,v,k)+B+u[L]+r[R]|0;B=k,k=v,v=o(m),m=g,g=P}this._a=g+this._a|0,this._b=m+this._b|0,this._c=v+this._c|0,this._d=k+this._d|0,this._e=B+this._e|0},n.prototype._hash=function(){var f=a.allocUnsafe(20);return f.writeInt32BE(0|this._a,0),f.writeInt32BE(0|this._b,4),f.writeInt32BE(0|this._c,8),f.writeInt32BE(0|this._d,12),f.writeInt32BE(0|this._e,16),f},p.exports=n},{"./hash":497,inherits:440,"safe-buffer":494}],501:[function(e,p,b){"use strict";var c=e("inherits"),i=e("./sha256"),a=e("./hash"),r=e("safe-buffer").Buffer,t=new Array(64);function n(){this.init(),this._w=t,a.call(this,64,56)}c(n,i),n.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},n.prototype._hash=function(){var l=r.allocUnsafe(28);return l.writeInt32BE(this._a,0),l.writeInt32BE(this._b,4),l.writeInt32BE(this._c,8),l.writeInt32BE(this._d,12),l.writeInt32BE(this._e,16),l.writeInt32BE(this._f,20),l.writeInt32BE(this._g,24),l},p.exports=n},{"./hash":497,"./sha256":502,inherits:440,"safe-buffer":494}],502:[function(e,p,b){"use strict";var c=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],t=new Array(64);function n(){this.init(),this._w=t,i.call(this,64,56)}function l(u,g,m){return m^u&(g^m)}function o(u,g,m){return u&g|m&(u|g)}function s(u){return(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10)}function f(u){return(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7)}function d(u){return(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3}c(n,i),n.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},n.prototype._update=function(u){for(var g,m=this._w,v=0|this._a,k=0|this._b,B=0|this._c,O=0|this._d,L=0|this._e,R=0|this._f,P=0|this._g,j=0|this._h,z=0;z<16;++z)m[z]=u.readInt32BE(4*z);for(;z<64;++z)m[z]=0|(((g=m[z-2])>>>17|g<<15)^(g>>>19|g<<13)^g>>>10)+m[z-7]+d(m[z-15])+m[z-16];for(var N=0;N<64;++N){var S=j+f(L)+l(L,R,P)+r[N]+m[N]|0,C=s(v)+o(v,k,B)|0;j=P,P=R,R=L,L=O+S|0,O=B,B=k,k=v,v=S+C|0}this._a=v+this._a|0,this._b=k+this._b|0,this._c=B+this._c|0,this._d=O+this._d|0,this._e=L+this._e|0,this._f=R+this._f|0,this._g=P+this._g|0,this._h=j+this._h|0},n.prototype._hash=function(){var u=a.allocUnsafe(32);return u.writeInt32BE(this._a,0),u.writeInt32BE(this._b,4),u.writeInt32BE(this._c,8),u.writeInt32BE(this._d,12),u.writeInt32BE(this._e,16),u.writeInt32BE(this._f,20),u.writeInt32BE(this._g,24),u.writeInt32BE(this._h,28),u},p.exports=n},{"./hash":497,inherits:440,"safe-buffer":494}],503:[function(e,p,b){"use strict";var c=e("inherits"),i=e("./sha512"),a=e("./hash"),r=e("safe-buffer").Buffer,t=new Array(160);function n(){this.init(),this._w=t,a.call(this,128,112)}c(n,i),n.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},n.prototype._hash=function(){var l=r.allocUnsafe(48);function o(s,f,d){l.writeInt32BE(s,d),l.writeInt32BE(f,d+4)}return o(this._ah,this._al,0),o(this._bh,this._bl,8),o(this._ch,this._cl,16),o(this._dh,this._dl,24),o(this._eh,this._el,32),o(this._fh,this._fl,40),l},p.exports=n},{"./hash":497,"./sha512":504,inherits:440,"safe-buffer":494}],504:[function(e,p,b){"use strict";var c=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,r=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],t=new Array(160);function n(){this.init(),this._w=t,i.call(this,128,112)}function l(k,B,O){return O^k&(B^O)}function o(k,B,O){return k&B|O&(k|B)}function s(k,B){return(k>>>28|B<<4)^(B>>>2|k<<30)^(B>>>7|k<<25)}function f(k,B){return(k>>>14|B<<18)^(k>>>18|B<<14)^(B>>>9|k<<23)}function d(k,B){return(k>>>1|B<<31)^(k>>>8|B<<24)^k>>>7}function u(k,B){return(k>>>1|B<<31)^(k>>>8|B<<24)^(k>>>7|B<<25)}function g(k,B){return(k>>>19|B<<13)^(B>>>29|k<<3)^k>>>6}function m(k,B){return(k>>>19|B<<13)^(B>>>29|k<<3)^(k>>>6|B<<26)}function v(k,B){return k>>>0<B>>>0?1:0}c(n,i),n.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},n.prototype._update=function(k){for(var B=this._w,O=0|this._ah,L=0|this._bh,R=0|this._ch,P=0|this._dh,j=0|this._eh,z=0|this._fh,N=0|this._gh,S=0|this._hh,C=0|this._al,E=0|this._bl,h=0|this._cl,y=0|this._dl,w=0|this._el,x=0|this._fl,_=0|this._gl,T=0|this._hl,D=0;D<32;D+=2)B[D]=k.readInt32BE(4*D),B[D+1]=k.readInt32BE(4*D+4);for(;D<160;D+=2){var q=B[D-30],$=B[D-30+1],W=d(q,$),A=u($,q),H=g(q=B[D-4],$=B[D-4+1]),M=m($,q),I=B[D-14],F=B[D-14+1],U=B[D-32],X=B[D-32+1],V=A+F|0,G=W+I+v(V,A)|0;G=(G=G+H+v(V=V+M|0,M)|0)+U+v(V=V+X|0,X)|0,B[D]=G,B[D+1]=V}for(var ee=0;ee<160;ee+=2){G=B[ee],V=B[ee+1];var Z=o(O,L,R),K=o(C,E,h),Q=s(O,C),J=s(C,O),ne=f(j,w),ie=f(w,j),le=r[ee],re=r[ee+1],se=l(j,z,N),be=l(w,x,_),ye=T+ie|0,Fe=S+ne+v(ye,T)|0;Fe=(Fe=(Fe=Fe+se+v(ye=ye+be|0,be)|0)+le+v(ye=ye+re|0,re)|0)+G+v(ye=ye+V|0,V)|0;var Ce=J+K|0,ae=Q+Z+v(Ce,J)|0;S=N,T=_,N=z,_=x,z=j,x=w,j=P+Fe+v(w=y+ye|0,y)|0,P=R,y=h,R=L,h=E,L=O,E=C,O=Fe+ae+v(C=ye+Ce|0,ye)|0}this._al=this._al+C|0,this._bl=this._bl+E|0,this._cl=this._cl+h|0,this._dl=this._dl+y|0,this._el=this._el+w|0,this._fl=this._fl+x|0,this._gl=this._gl+_|0,this._hl=this._hl+T|0,this._ah=this._ah+O+v(this._al,C)|0,this._bh=this._bh+L+v(this._bl,E)|0,this._ch=this._ch+R+v(this._cl,h)|0,this._dh=this._dh+P+v(this._dl,y)|0,this._eh=this._eh+j+v(this._el,w)|0,this._fh=this._fh+z+v(this._fl,x)|0,this._gh=this._gh+N+v(this._gl,_)|0,this._hh=this._hh+S+v(this._hl,T)|0},n.prototype._hash=function(){var k=a.allocUnsafe(64);function B(O,L,R){k.writeInt32BE(O,R),k.writeInt32BE(L,R+4)}return B(this._ah,this._al,0),B(this._bh,this._bl,8),B(this._ch,this._cl,16),B(this._dh,this._dl,24),B(this._eh,this._el,32),B(this._fh,this._fl,40),B(this._gh,this._gl,48),B(this._hh,this._hl,56),k},p.exports=n},{"./hash":497,inherits:440,"safe-buffer":494}],505:[function(e,p,b){"use strict";p.exports=i;var c=e("events").EventEmitter;function i(){c.call(this)}e("inherits")(i,c),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(a,r){var t=this;function n(g){a.writable&&a.write(g)===!1&&t.pause&&t.pause()}function l(){t.readable&&t.resume&&t.resume()}t.on("data",n),a.on("drain",l),a._isStdio||r&&r.end===!1||(t.on("end",s),t.on("close",f));var o=!1;function s(){o||(o=!0,a.end())}function f(){o||(o=!0,typeof a.destroy=="function"&&a.destroy())}function d(g){if(u(),c.listenerCount(this,"error")===0)throw g}function u(){t.removeListener("data",n),a.removeListener("drain",l),t.removeListener("end",s),t.removeListener("close",f),t.removeListener("error",d),a.removeListener("error",d),t.removeListener("end",u),t.removeListener("close",u),a.removeListener("close",u)}return t.on("error",d),a.on("error",d),t.on("end",u),t.on("close",u),a.on("close",u),a.emit("pipe",t),a}},{events:422,inherits:440,"readable-stream/duplex.js":507,"readable-stream/passthrough.js":516,"readable-stream/readable.js":517,"readable-stream/transform.js":518,"readable-stream/writable.js":519}],506:[function(e,p,b){"use strict";var c={}.toString;p.exports=Array.isArray||function(i){return c.call(i)=="[object Array]"}},{}],507:[function(e,p,b){"use strict";p.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":508}],508:[function(e,p,b){"use strict";var c=e("process-nextick-args"),i=Object.keys||function(u){var g=[];for(var m in u)g.push(m);return g};p.exports=s;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var r=e("./_stream_readable"),t=e("./_stream_writable");a.inherits(s,r);for(var n=i(t.prototype),l=0;l<n.length;l++){var o=n[l];s.prototype[o]||(s.prototype[o]=t.prototype[o])}function s(u){if(!(this instanceof s))return new s(u);r.call(this,u),t.call(this,u),u&&u.readable===!1&&(this.readable=!1),u&&u.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,u&&u.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||c.nextTick(d,this)}function d(u){u.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),s.prototype._destroy=function(u,g){this.push(null),this.end(),c.nextTick(g,u)}},{"./_stream_readable":510,"./_stream_writable":512,"core-util-is":383,inherits:440,"process-nextick-args":466}],509:[function(e,p,b){"use strict";p.exports=a;var c=e("./_stream_transform"),i=Object.create(e("core-util-is"));function a(r){if(!(this instanceof a))return new a(r);c.call(this,r)}i.inherits=e("inherits"),i.inherits(a,c),a.prototype._transform=function(r,t,n){n(null,r)}},{"./_stream_transform":511,"core-util-is":383,inherits:440}],510:[function(e,p,b){(function(c,i){(function(){"use strict";var a=e("process-nextick-args");p.exports=O;var r,t=e("isarray");O.ReadableState=B,e("events").EventEmitter;var n=function(T,D){return T.listeners(D).length},l=e("./internal/streams/stream"),o=e("safe-buffer").Buffer,s=(i!==void 0?i:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},f=Object.create(e("core-util-is"));f.inherits=e("inherits");var d=e("util"),u=void 0;u=d&&d.debuglog?d.debuglog("stream"):function(){};var g,m=e("./internal/streams/BufferList"),v=e("./internal/streams/destroy");f.inherits(O,l);var k=["error","close","destroy","pause","resume"];function B(T,D){T=T||{};var q=D instanceof(r=r||e("./_stream_duplex"));this.objectMode=!!T.objectMode,q&&(this.objectMode=this.objectMode||!!T.readableObjectMode);var $=T.highWaterMark,W=T.readableHighWaterMark,A=this.objectMode?16:16384;this.highWaterMark=$||$===0?$:q&&(W||W===0)?W:A,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=T.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,T.encoding&&(g||(g=e("string_decoder/").StringDecoder),this.decoder=new g(T.encoding),this.encoding=T.encoding)}function O(T){if(r=r||e("./_stream_duplex"),!(this instanceof O))return new O(T);this._readableState=new B(T,this),this.readable=!0,T&&(typeof T.read=="function"&&(this._read=T.read),typeof T.destroy=="function"&&(this._destroy=T.destroy)),l.call(this)}function L(T,D,q,$,W){var A,H=T._readableState;return D===null?(H.reading=!1,(function(M,I){if(!I.ended){if(I.decoder){var F=I.decoder.end();F&&F.length&&(I.buffer.push(F),I.length+=I.objectMode?1:F.length)}I.ended=!0,j(M)}})(T,H)):(W||(A=(function(M,I){var F;U=I,o.isBuffer(U)||U instanceof s||typeof I=="string"||I===void 0||M.objectMode||(F=new TypeError("Invalid non-string/buffer chunk"));var U;return F})(H,D)),A?T.emit("error",A):H.objectMode||D&&D.length>0?(typeof D=="string"||H.objectMode||Object.getPrototypeOf(D)===o.prototype||(D=(function(M){return o.from(M)})(D)),$?H.endEmitted?T.emit("error",new Error("stream.unshift() after end event")):R(T,H,D,!0):H.ended?T.emit("error",new Error("stream.push() after EOF")):(H.reading=!1,H.decoder&&!q?(D=H.decoder.write(D),H.objectMode||D.length!==0?R(T,H,D,!1):N(T,H)):R(T,H,D,!1))):$||(H.reading=!1)),(function(M){return!M.ended&&(M.needReadable||M.length<M.highWaterMark||M.length===0)})(H)}function R(T,D,q,$){D.flowing&&D.length===0&&!D.sync?(T.emit("data",q),T.read(0)):(D.length+=D.objectMode?1:q.length,$?D.buffer.unshift(q):D.buffer.push(q),D.needReadable&&j(T)),N(T,D)}Object.defineProperty(O.prototype,"destroyed",{get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(T){this._readableState&&(this._readableState.destroyed=T)}}),O.prototype.destroy=v.destroy,O.prototype._undestroy=v.undestroy,O.prototype._destroy=function(T,D){this.push(null),D(T)},O.prototype.push=function(T,D){var q,$=this._readableState;return $.objectMode?q=!0:typeof T=="string"&&((D=D||$.defaultEncoding)!==$.encoding&&(T=o.from(T,D),D=""),q=!0),L(this,T,D,!1,q)},O.prototype.unshift=function(T){return L(this,T,null,!0,!1)},O.prototype.isPaused=function(){return this._readableState.flowing===!1},O.prototype.setEncoding=function(T){return g||(g=e("string_decoder/").StringDecoder),this._readableState.decoder=new g(T),this._readableState.encoding=T,this};function P(T,D){return T<=0||D.length===0&&D.ended?0:D.objectMode?1:T!=T?D.flowing&&D.length?D.buffer.head.data.length:D.length:(T>D.highWaterMark&&(D.highWaterMark=(function(q){return q>=8388608?q=8388608:(q--,q|=q>>>1,q|=q>>>2,q|=q>>>4,q|=q>>>8,q|=q>>>16,q++),q})(T)),T<=D.length?T:D.ended?D.length:(D.needReadable=!0,0))}function j(T){var D=T._readableState;D.needReadable=!1,D.emittedReadable||(u("emitReadable",D.flowing),D.emittedReadable=!0,D.sync?a.nextTick(z,T):z(T))}function z(T){u("emit readable"),T.emit("readable"),h(T)}function N(T,D){D.readingMore||(D.readingMore=!0,a.nextTick(S,T,D))}function S(T,D){for(var q=D.length;!D.reading&&!D.flowing&&!D.ended&&D.length<D.highWaterMark&&(u("maybeReadMore read 0"),T.read(0),q!==D.length);)q=D.length;D.readingMore=!1}function C(T){u("readable nexttick read 0"),T.read(0)}function E(T,D){D.reading||(u("resume read 0"),T.read(0)),D.resumeScheduled=!1,D.awaitDrain=0,T.emit("resume"),h(T),D.flowing&&!D.reading&&T.read(0)}function h(T){var D=T._readableState;for(u("flow",D.flowing);D.flowing&&T.read()!==null;);}function y(T,D){return D.length===0?null:(D.objectMode?q=D.buffer.shift():!T||T>=D.length?(q=D.decoder?D.buffer.join(""):D.buffer.length===1?D.buffer.head.data:D.buffer.concat(D.length),D.buffer.clear()):q=(function($,W,A){var H;return $<W.head.data.length?(H=W.head.data.slice(0,$),W.head.data=W.head.data.slice($)):H=$===W.head.data.length?W.shift():A?(function(M,I){var F=I.head,U=1,X=F.data;for(M-=X.length;F=F.next;){var V=F.data,G=M>V.length?V.length:M;if(G===V.length?X+=V:X+=V.slice(0,M),(M-=G)===0){G===V.length?(++U,F.next?I.head=F.next:I.head=I.tail=null):(I.head=F,F.data=V.slice(G));break}++U}return I.length-=U,X})($,W):(function(M,I){var F=o.allocUnsafe(M),U=I.head,X=1;for(U.data.copy(F),M-=U.data.length;U=U.next;){var V=U.data,G=M>V.length?V.length:M;if(V.copy(F,F.length-M,0,G),(M-=G)===0){G===V.length?(++X,U.next?I.head=U.next:I.head=I.tail=null):(I.head=U,U.data=V.slice(G));break}++X}return I.length-=X,F})($,W),H})(T,D.buffer,D.decoder),q);var q}function w(T){var D=T._readableState;if(D.length>0)throw new Error('"endReadable()" called on non-empty stream');D.endEmitted||(D.ended=!0,a.nextTick(x,D,T))}function x(T,D){T.endEmitted||T.length!==0||(T.endEmitted=!0,D.readable=!1,D.emit("end"))}function _(T,D){for(var q=0,$=T.length;q<$;q++)if(T[q]===D)return q;return-1}O.prototype.read=function(T){u("read",T),T=parseInt(T,10);var D=this._readableState,q=T;if(T!==0&&(D.emittedReadable=!1),T===0&&D.needReadable&&(D.length>=D.highWaterMark||D.ended))return u("read: emitReadable",D.length,D.ended),D.length===0&&D.ended?w(this):j(this),null;if((T=P(T,D))===0&&D.ended)return D.length===0&&w(this),null;var $,W=D.needReadable;return u("need readable",W),(D.length===0||D.length-T<D.highWaterMark)&&u("length less than watermark",W=!0),D.ended||D.reading?u("reading or ended",W=!1):W&&(u("do read"),D.reading=!0,D.sync=!0,D.length===0&&(D.needReadable=!0),this._read(D.highWaterMark),D.sync=!1,D.reading||(T=P(q,D))),($=T>0?y(T,D):null)===null?(D.needReadable=!0,T=0):D.length-=T,D.length===0&&(D.ended||(D.needReadable=!0),q!==T&&D.ended&&w(this)),$!==null&&this.emit("data",$),$},O.prototype._read=function(T){this.emit("error",new Error("_read() is not implemented"))},O.prototype.pipe=function(T,D){var q=this,$=this._readableState;switch($.pipesCount){case 0:$.pipes=T;break;case 1:$.pipes=[$.pipes,T];break;default:$.pipes.push(T)}$.pipesCount+=1,u("pipe count=%d opts=%j",$.pipesCount,D);var W=(!D||D.end!==!1)&&T!==c.stdout&&T!==c.stderr?H:ee;function A(Z,K){u("onunpipe"),Z===q&&K&&K.hasUnpiped===!1&&(K.hasUnpiped=!0,u("cleanup"),T.removeListener("close",V),T.removeListener("finish",G),T.removeListener("drain",M),T.removeListener("error",X),T.removeListener("unpipe",A),q.removeListener("end",H),q.removeListener("end",ee),q.removeListener("data",U),I=!0,!$.awaitDrain||T._writableState&&!T._writableState.needDrain||M())}function H(){u("onend"),T.end()}$.endEmitted?a.nextTick(W):q.once("end",W),T.on("unpipe",A);var M=(function(Z){return function(){var K=Z._readableState;u("pipeOnDrain",K.awaitDrain),K.awaitDrain&&K.awaitDrain--,K.awaitDrain===0&&n(Z,"data")&&(K.flowing=!0,h(Z))}})(q);T.on("drain",M);var I=!1,F=!1;function U(Z){u("ondata"),F=!1,T.write(Z)!==!1||F||(($.pipesCount===1&&$.pipes===T||$.pipesCount>1&&_($.pipes,T)!==-1)&&!I&&(u("false write response, pause",$.awaitDrain),$.awaitDrain++,F=!0),q.pause())}function X(Z){u("onerror",Z),ee(),T.removeListener("error",X),n(T,"error")===0&&T.emit("error",Z)}function V(){T.removeListener("finish",G),ee()}function G(){u("onfinish"),T.removeListener("close",V),ee()}function ee(){u("unpipe"),q.unpipe(T)}return q.on("data",U),(function(Z,K,Q){if(typeof Z.prependListener=="function")return Z.prependListener(K,Q);Z._events&&Z._events[K]?t(Z._events[K])?Z._events[K].unshift(Q):Z._events[K]=[Q,Z._events[K]]:Z.on(K,Q)})(T,"error",X),T.once("close",V),T.once("finish",G),T.emit("pipe",q),$.flowing||(u("pipe resume"),q.resume()),T},O.prototype.unpipe=function(T){var D=this._readableState,q={hasUnpiped:!1};if(D.pipesCount===0)return this;if(D.pipesCount===1)return T&&T!==D.pipes||(T||(T=D.pipes),D.pipes=null,D.pipesCount=0,D.flowing=!1,T&&T.emit("unpipe",this,q)),this;if(!T){var $=D.pipes,W=D.pipesCount;D.pipes=null,D.pipesCount=0,D.flowing=!1;for(var A=0;A<W;A++)$[A].emit("unpipe",this,{hasUnpiped:!1});return this}var H=_(D.pipes,T);return H===-1||(D.pipes.splice(H,1),D.pipesCount-=1,D.pipesCount===1&&(D.pipes=D.pipes[0]),T.emit("unpipe",this,q)),this},O.prototype.on=function(T,D){var q=l.prototype.on.call(this,T,D);if(T==="data")this._readableState.flowing!==!1&&this.resume();else if(T==="readable"){var $=this._readableState;$.endEmitted||$.readableListening||($.readableListening=$.needReadable=!0,$.emittedReadable=!1,$.reading?$.length&&j(this):a.nextTick(C,this))}return q},O.prototype.addListener=O.prototype.on,O.prototype.resume=function(){var T=this._readableState;return T.flowing||(u("resume"),T.flowing=!0,(function(D,q){q.resumeScheduled||(q.resumeScheduled=!0,a.nextTick(E,D,q))})(this,T)),this},O.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this},O.prototype.wrap=function(T){var D=this,q=this._readableState,$=!1;for(var W in T.on("end",(function(){if(u("wrapped end"),q.decoder&&!q.ended){var H=q.decoder.end();H&&H.length&&D.push(H)}D.push(null)})),T.on("data",(function(H){u("wrapped data"),q.decoder&&(H=q.decoder.write(H)),q.objectMode&&H==null||(q.objectMode||H&&H.length)&&(D.push(H)||($=!0,T.pause()))})),T)this[W]===void 0&&typeof T[W]=="function"&&(this[W]=(function(H){return function(){return T[H].apply(T,arguments)}})(W));for(var A=0;A<k.length;A++)T.on(k[A],this.emit.bind(this,k[A]));return this._read=function(H){u("wrapped _read",H),$&&($=!1,T.resume())},this},Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),O._fromList=y}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./_stream_duplex":508,"./internal/streams/BufferList":513,"./internal/streams/destroy":514,"./internal/streams/stream":515,_process:467,"core-util-is":383,events:422,inherits:440,isarray:506,"process-nextick-args":466,"safe-buffer":520,"string_decoder/":521,util:188}],511:[function(e,p,b){"use strict";p.exports=r;var c=e("./_stream_duplex"),i=Object.create(e("core-util-is"));function a(l,o){var s=this._transformState;s.transforming=!1;var f=s.writecb;if(!f)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,o!=null&&this.push(o),f(l);var d=this._readableState;d.reading=!1,(d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}function r(l){if(!(this instanceof r))return new r(l);c.call(this,l),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,l&&(typeof l.transform=="function"&&(this._transform=l.transform),typeof l.flush=="function"&&(this._flush=l.flush)),this.on("prefinish",t)}function t(){var l=this;typeof this._flush=="function"?this._flush((function(o,s){n(l,o,s)})):n(this,null,null)}function n(l,o,s){if(o)return l.emit("error",o);if(s!=null&&l.push(s),l._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(l._transformState.transforming)throw new Error("Calling transform done when still transforming");return l.push(null)}i.inherits=e("inherits"),i.inherits(r,c),r.prototype.push=function(l,o){return this._transformState.needTransform=!1,c.prototype.push.call(this,l,o)},r.prototype._transform=function(l,o,s){throw new Error("_transform() is not implemented")},r.prototype._write=function(l,o,s){var f=this._transformState;if(f.writecb=s,f.writechunk=l,f.writeencoding=o,!f.transforming){var d=this._readableState;(f.needTransform||d.needReadable||d.length<d.highWaterMark)&&this._read(d.highWaterMark)}},r.prototype._read=function(l){var o=this._transformState;o.writechunk!==null&&o.writecb&&!o.transforming?(o.transforming=!0,this._transform(o.writechunk,o.writeencoding,o.afterTransform)):o.needTransform=!0},r.prototype._destroy=function(l,o){var s=this;c.prototype._destroy.call(this,l,(function(f){o(f),s.emit("close")}))}},{"./_stream_duplex":508,"core-util-is":383,inherits:440}],512:[function(e,p,b){(function(c,i,a){(function(){"use strict";var r=e("process-nextick-args");function t(N){var S=this;this.next=null,this.entry=null,this.finish=function(){(function(C,E,h){var y=C.entry;for(C.entry=null;y;){var w=y.callback;E.pendingcb--,w(h),y=y.next}E.corkedRequestsFree.next=C})(S,N)}}p.exports=B;var n,l=!c.browser&&["v0.10","v0.9."].indexOf(c.version.slice(0,5))>-1?a:r.nextTick;B.WritableState=k;var o=Object.create(e("core-util-is"));o.inherits=e("inherits");var s={deprecate:e("util-deprecate")},f=e("./internal/streams/stream"),d=e("safe-buffer").Buffer,u=(i!==void 0?i:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},g,m=e("./internal/streams/destroy");function v(){}function k(N,S){n=n||e("./_stream_duplex"),N=N||{};var C=S instanceof n;this.objectMode=!!N.objectMode,C&&(this.objectMode=this.objectMode||!!N.writableObjectMode);var E=N.highWaterMark,h=N.writableHighWaterMark,y=this.objectMode?16:16384;this.highWaterMark=E||E===0?E:C&&(h||h===0)?h:y,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var w=N.decodeStrings===!1;this.decodeStrings=!w,this.defaultEncoding=N.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(x){(function(_,T){var D=_._writableState,q=D.sync,$=D.writecb;if((function(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0})(D),T)(function(A,H,M,I,F){--H.pendingcb,M?(r.nextTick(F,I),r.nextTick(z,A,H),A._writableState.errorEmitted=!0,A.emit("error",I)):(F(I),A._writableState.errorEmitted=!0,A.emit("error",I),z(A,H))})(_,D,q,T,$);else{var W=P(D);W||D.corked||D.bufferProcessing||!D.bufferedRequest||R(_,D),q?l(L,_,D,W,$):L(_,D,W,$)}})(S,x)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function B(N){if(n=n||e("./_stream_duplex"),!(g.call(B,this)||this instanceof n))return new B(N);this._writableState=new k(N,this),this.writable=!0,N&&(typeof N.write=="function"&&(this._write=N.write),typeof N.writev=="function"&&(this._writev=N.writev),typeof N.destroy=="function"&&(this._destroy=N.destroy),typeof N.final=="function"&&(this._final=N.final)),f.call(this)}function O(N,S,C,E,h,y,w){S.writelen=E,S.writecb=w,S.writing=!0,S.sync=!0,C?N._writev(h,S.onwrite):N._write(h,y,S.onwrite),S.sync=!1}function L(N,S,C,E){C||(function(h,y){y.length===0&&y.needDrain&&(y.needDrain=!1,h.emit("drain"))})(N,S),S.pendingcb--,E(),z(N,S)}function R(N,S){S.bufferProcessing=!0;var C=S.bufferedRequest;if(N._writev&&C&&C.next){var E=S.bufferedRequestCount,h=new Array(E),y=S.corkedRequestsFree;y.entry=C;for(var w=0,x=!0;C;)h[w]=C,C.isBuf||(x=!1),C=C.next,w+=1;h.allBuffers=x,O(N,S,!0,S.length,h,"",y.finish),S.pendingcb++,S.lastBufferedRequest=null,y.next?(S.corkedRequestsFree=y.next,y.next=null):S.corkedRequestsFree=new t(S),S.bufferedRequestCount=0}else{for(;C;){var _=C.chunk,T=C.encoding,D=C.callback;if(O(N,S,!1,S.objectMode?1:_.length,_,T,D),C=C.next,S.bufferedRequestCount--,S.writing)break}C===null&&(S.lastBufferedRequest=null)}S.bufferedRequest=C,S.bufferProcessing=!1}function P(N){return N.ending&&N.length===0&&N.bufferedRequest===null&&!N.finished&&!N.writing}function j(N,S){N._final((function(C){S.pendingcb--,C&&N.emit("error",C),S.prefinished=!0,N.emit("prefinish"),z(N,S)}))}function z(N,S){var C=P(S);return C&&((function(E,h){h.prefinished||h.finalCalled||(typeof E._final=="function"?(h.pendingcb++,h.finalCalled=!0,r.nextTick(j,E,h)):(h.prefinished=!0,E.emit("prefinish")))})(N,S),S.pendingcb===0&&(S.finished=!0,N.emit("finish"))),C}o.inherits(B,f),k.prototype.getBuffer=function(){for(var N=this.bufferedRequest,S=[];N;)S.push(N),N=N.next;return S},(function(){try{Object.defineProperty(k.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(g=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(N){return!!g.call(this,N)||this===B&&N&&N._writableState instanceof k}})):g=function(N){return N instanceof this},B.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},B.prototype.write=function(N,S,C){var E,h=this._writableState,y=!1,w=!h.objectMode&&(E=N,d.isBuffer(E)||E instanceof u);return w&&!d.isBuffer(N)&&(N=(function(x){return d.from(x)})(N)),typeof S=="function"&&(C=S,S=null),w?S="buffer":S||(S=h.defaultEncoding),typeof C!="function"&&(C=v),h.ended?(function(x,_){var T=new Error("write after end");x.emit("error",T),r.nextTick(_,T)})(this,C):(w||(function(x,_,T,D){var q=!0,$=!1;return T===null?$=new TypeError("May not write null values to stream"):typeof T=="string"||T===void 0||_.objectMode||($=new TypeError("Invalid non-string/buffer chunk")),$&&(x.emit("error",$),r.nextTick(D,$),q=!1),q})(this,h,N,C))&&(h.pendingcb++,y=(function(x,_,T,D,q,$){if(!T){var W=(function(I,F,U){return I.objectMode||I.decodeStrings===!1||typeof F!="string"||(F=d.from(F,U)),F})(_,D,q);D!==W&&(T=!0,q="buffer",D=W)}var A=_.objectMode?1:D.length;_.length+=A;var H=_.length<_.highWaterMark;if(H||(_.needDrain=!0),_.writing||_.corked){var M=_.lastBufferedRequest;_.lastBufferedRequest={chunk:D,encoding:q,isBuf:T,callback:$,next:null},M?M.next=_.lastBufferedRequest:_.bufferedRequest=_.lastBufferedRequest,_.bufferedRequestCount+=1}else O(x,_,!1,A,D,q,$);return H})(this,h,w,N,S,C)),y},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var N=this._writableState;N.corked&&(N.corked--,N.writing||N.corked||N.bufferProcessing||!N.bufferedRequest||R(this,N))},B.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(N,S,C){C(new Error("_write() is not implemented"))},B.prototype._writev=null,B.prototype.end=function(N,S,C){var E=this._writableState;typeof N=="function"?(C=N,N=null,S=null):typeof S=="function"&&(C=S,S=null),N!=null&&this.write(N,S),E.corked&&(E.corked=1,this.uncork()),E.ending||(function(h,y,w){y.ending=!0,z(h,y),w&&(y.finished?r.nextTick(w):h.once("finish",w)),y.ended=!0,h.writable=!1})(this,E,C)},Object.defineProperty(B.prototype,"destroyed",{get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),B.prototype.destroy=m.destroy,B.prototype._undestroy=m.undestroy,B.prototype._destroy=function(N,S){this.end(),S(N)}}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},e("timers").setImmediate)},{"./_stream_duplex":508,"./internal/streams/destroy":514,"./internal/streams/stream":515,_process:467,"core-util-is":383,inherits:440,"process-nextick-args":466,"safe-buffer":520,timers:523,"util-deprecate":524}],513:[function(e,p,b){"use strict";var c=e("safe-buffer").Buffer,i=e("util");p.exports=(function(){function a(){(function(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")})(this,a),this.head=null,this.tail=null,this.length=0}return a.prototype.push=function(r){var t={data:r,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},a.prototype.unshift=function(r){var t={data:r,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length},a.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},a.prototype.clear=function(){this.head=this.tail=null,this.length=0},a.prototype.join=function(r){if(this.length===0)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=r+t.data;return n},a.prototype.concat=function(r){if(this.length===0)return c.alloc(0);for(var t,n,l,o=c.allocUnsafe(r>>>0),s=this.head,f=0;s;)t=s.data,n=o,l=f,t.copy(n,l),f+=s.data.length,s=s.next;return o},a})(),i&&i.inspect&&i.inspect.custom&&(p.exports.prototype[i.inspect.custom]=function(){var a=i.inspect({length:this.length});return this.constructor.name+" "+a})},{"safe-buffer":520,util:188}],514:[function(e,p,b){"use strict";var c=e("process-nextick-args");function i(a,r){a.emit("error",r)}p.exports={destroy:function(a,r){var t=this,n=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return n||l?(r?r(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(i,this,a)):c.nextTick(i,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,(function(o){!r&&o?t._writableState?t._writableState.errorEmitted||(t._writableState.errorEmitted=!0,c.nextTick(i,t,o)):c.nextTick(i,t,o):r&&r(o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":466}],515:[function(e,p,b){arguments[4][490][0].apply(b,arguments)},{dup:490,events:422}],516:[function(e,p,b){"use strict";p.exports=e("./readable").PassThrough},{"./readable":517}],517:[function(e,p,b){"use strict";(b=p.exports=e("./lib/_stream_readable.js")).Stream=b,b.Readable=b,b.Writable=e("./lib/_stream_writable.js"),b.Duplex=e("./lib/_stream_duplex.js"),b.Transform=e("./lib/_stream_transform.js"),b.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":508,"./lib/_stream_passthrough.js":509,"./lib/_stream_readable.js":510,"./lib/_stream_transform.js":511,"./lib/_stream_writable.js":512}],518:[function(e,p,b){"use strict";p.exports=e("./readable").Transform},{"./readable":517}],519:[function(e,p,b){"use strict";p.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":512}],520:[function(e,p,b){arguments[4][217][0].apply(b,arguments)},{buffer:220,dup:217}],521:[function(e,p,b){arguments[4][218][0].apply(b,arguments)},{dup:218,"safe-buffer":520}],522:[function(e,p,b){arguments[4][218][0].apply(b,arguments)},{dup:218,"safe-buffer":494}],523:[function(e,p,b){(function(c,i){(function(){"use strict";var a=e("process/browser.js").nextTick,r=Function.prototype.apply,t=Array.prototype.slice,n={},l=0;function o(s,f){this._id=s,this._clearFn=f}b.setTimeout=function(){return new o(r.call(setTimeout,window,arguments),clearTimeout)},b.setInterval=function(){return new o(r.call(setInterval,window,arguments),clearInterval)},b.clearTimeout=b.clearInterval=function(s){s.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(window,this._id)},b.enroll=function(s,f){clearTimeout(s._idleTimeoutId),s._idleTimeout=f},b.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},b._unrefActive=b.active=function(s){clearTimeout(s._idleTimeoutId);var f=s._idleTimeout;f>=0&&(s._idleTimeoutId=setTimeout((function(){s._onTimeout&&s._onTimeout()}),f))},b.setImmediate=typeof c=="function"?c:function(s){var f=l++,d=!(arguments.length<2)&&t.call(arguments,1);return n[f]=!0,a((function(){n[f]&&(d?s.apply(null,d):s.call(null),b.clearImmediate(f))})),f},b.clearImmediate=typeof i=="function"?i:function(s){delete n[s]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":467,timers:523}],524:[function(e,p,b){(function(c){(function(){"use strict";function i(a){try{if(!c.localStorage)return!1}catch{return!1}var r=c.localStorage[a];return r!=null&&String(r).toLowerCase()==="true"}p.exports=function(a,r){if(i("noDeprecation"))return a;var t=!1;return function(){if(!t){if(i("throwDeprecation"))throw new Error(r);i("traceDeprecation")?console.trace(r):console.warn(r),t=!0}return a.apply(this,arguments)}}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],525:[function(e,p,b){"use strict";typeof Object.create=="function"?p.exports=function(c,i){c.super_=i,c.prototype=Object.create(i.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}})}:p.exports=function(c,i){c.super_=i;var a=function(){};a.prototype=i.prototype,c.prototype=new a,c.prototype.constructor=c}},{}],526:[function(e,p,b){"use strict";p.exports=function(c){return c&&typeof c=="object"&&typeof c.copy=="function"&&typeof c.fill=="function"&&typeof c.readUInt8=="function"}},{}],527:[function(e,p,b){(function(c,i){(function(){"use strict";var a=/%[sdj%]/g;b.format=function(h){if(!k(h)){for(var y=[],w=0;w<arguments.length;w++)y.push(n(arguments[w]));return y.join(" ")}w=1;for(var x=arguments,_=x.length,T=String(h).replace(a,(function(q){if(q==="%%")return"%";if(w>=_)return q;switch(q){case"%s":return String(x[w++]);case"%d":return Number(x[w++]);case"%j":try{return JSON.stringify(x[w++])}catch{return"[Circular]"}default:return q}})),D=x[w];w<_;D=x[++w])m(D)||!L(D)?T+=" "+D:T+=" "+n(D);return T},b.deprecate=function(h,y){if(B(i.process))return function(){return b.deprecate(h,y).apply(this,arguments)};if(c.noDeprecation===!0)return h;var w=!1;return function(){if(!w){if(c.throwDeprecation)throw new Error(y);c.traceDeprecation?console.trace(y):console.error(y),w=!0}return h.apply(this,arguments)}};var r,t={};function n(h,y){var w={seen:[],stylize:o};return arguments.length>=3&&(w.depth=arguments[2]),arguments.length>=4&&(w.colors=arguments[3]),g(y)?w.showHidden=y:y&&b._extend(w,y),B(w.showHidden)&&(w.showHidden=!1),B(w.depth)&&(w.depth=2),B(w.colors)&&(w.colors=!1),B(w.customInspect)&&(w.customInspect=!0),w.colors&&(w.stylize=l),s(w,h,w.depth)}function l(h,y){var w=n.styles[y];return w?"\x1B["+n.colors[w][0]+"m"+h+"\x1B["+n.colors[w][1]+"m":h}function o(h,y){return h}function s(h,y,w){if(h.customInspect&&y&&j(y.inspect)&&y.inspect!==b.inspect&&(!y.constructor||y.constructor.prototype!==y)){var x=y.inspect(w,h);return k(x)||(x=s(h,x,w)),x}var _=(function(M,I){if(B(I))return M.stylize("undefined","undefined");if(k(I)){var F="'"+JSON.stringify(I).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return M.stylize(F,"string")}if(v(I))return M.stylize(""+I,"number");if(g(I))return M.stylize(""+I,"boolean");if(m(I))return M.stylize("null","null")})(h,y);if(_)return _;var T=Object.keys(y),D=(function(M){var I={};return M.forEach((function(F,U){I[F]=!0})),I})(T);if(h.showHidden&&(T=Object.getOwnPropertyNames(y)),P(y)&&(T.indexOf("message")>=0||T.indexOf("description")>=0))return f(y);if(T.length===0){if(j(y)){var q=y.name?": "+y.name:"";return h.stylize("[Function"+q+"]","special")}if(O(y))return h.stylize(RegExp.prototype.toString.call(y),"regexp");if(R(y))return h.stylize(Date.prototype.toString.call(y),"date");if(P(y))return f(y)}var $,W="",A=!1,H=["{","}"];return u(y)&&(A=!0,H=["[","]"]),j(y)&&(W=" [Function"+(y.name?": "+y.name:"")+"]"),O(y)&&(W=" "+RegExp.prototype.toString.call(y)),R(y)&&(W=" "+Date.prototype.toUTCString.call(y)),P(y)&&(W=" "+f(y)),T.length!==0||A&&y.length!=0?w<0?O(y)?h.stylize(RegExp.prototype.toString.call(y),"regexp"):h.stylize("[Object]","special"):(h.seen.push(y),$=A?(function(M,I,F,U,X){for(var V=[],G=0,ee=I.length;G<ee;++G)E(I,String(G))?V.push(d(M,I,F,U,String(G),!0)):V.push("");return X.forEach((function(Z){Z.match(/^\d+$/)||V.push(d(M,I,F,U,Z,!0))})),V})(h,y,w,D,T):T.map((function(M){return d(h,y,w,D,M,A)})),h.seen.pop(),(function(M,I,F){return M.reduce((function(U,X){return X.indexOf(`
18
+ `)>=0,U+X.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?F[0]+(I===""?"":I+`
19
+ `)+" "+M.join(`,
20
+ `)+" "+F[1]:F[0]+I+" "+M.join(", ")+" "+F[1]})($,W,H)):H[0]+W+H[1]}function f(h){return"["+Error.prototype.toString.call(h)+"]"}function d(h,y,w,x,_,T){var D,q,$;if(($=Object.getOwnPropertyDescriptor(y,_)||{value:y[_]}).get?q=$.set?h.stylize("[Getter/Setter]","special"):h.stylize("[Getter]","special"):$.set&&(q=h.stylize("[Setter]","special")),E(x,_)||(D="["+_+"]"),q||(h.seen.indexOf($.value)<0?(q=m(w)?s(h,$.value,null):s(h,$.value,w-1)).indexOf(`
21
+ `)>-1&&(q=T?q.split(`
22
+ `).map((function(W){return" "+W})).join(`
23
+ `).substr(2):`
24
+ `+q.split(`
25
+ `).map((function(W){return" "+W})).join(`
26
+ `)):q=h.stylize("[Circular]","special")),B(D)){if(T&&_.match(/^\d+$/))return q;(D=JSON.stringify(""+_)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(D=D.substr(1,D.length-2),D=h.stylize(D,"name")):(D=D.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),D=h.stylize(D,"string"))}return D+": "+q}function u(h){return Array.isArray(h)}function g(h){return typeof h=="boolean"}function m(h){return h===null}function v(h){return typeof h=="number"}function k(h){return typeof h=="string"}function B(h){return h===void 0}function O(h){return L(h)&&z(h)==="[object RegExp]"}function L(h){return typeof h=="object"&&h!==null}function R(h){return L(h)&&z(h)==="[object Date]"}function P(h){return L(h)&&(z(h)==="[object Error]"||h instanceof Error)}function j(h){return typeof h=="function"}function z(h){return Object.prototype.toString.call(h)}function N(h){return h<10?"0"+h.toString(10):h.toString(10)}b.debuglog=function(h){if(B(r)&&(r=c.env.NODE_DEBUG||""),h=h.toUpperCase(),!t[h])if(new RegExp("\\b"+h+"\\b","i").test(r)){var y=c.pid;t[h]=function(){var w=b.format.apply(b,arguments);console.error("%s %d: %s",h,y,w)}}else t[h]=function(){};return t[h]},b.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},b.isArray=u,b.isBoolean=g,b.isNull=m,b.isNullOrUndefined=function(h){return h==null},b.isNumber=v,b.isString=k,b.isSymbol=function(h){return typeof h=="symbol"},b.isUndefined=B,b.isRegExp=O,b.isObject=L,b.isDate=R,b.isError=P,b.isFunction=j,b.isPrimitive=function(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||h===void 0},b.isBuffer=e("./support/isBuffer");var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var h=new Date,y=[N(h.getHours()),N(h.getMinutes()),N(h.getSeconds())].join(":");return[h.getDate(),S[h.getMonth()],y].join(" ")}function E(h,y){return Object.prototype.hasOwnProperty.call(h,y)}b.log=function(){console.log("%s - %s",C(),b.format.apply(b,arguments))},b.inherits=e("inherits"),b._extend=function(h,y){if(!y||!L(y))return h;for(var w=Object.keys(y),x=w.length;x--;)h[w[x]]=y[w[x]];return h}}).call(this)}).call(this,e("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":526,_process:467,inherits:525}],528:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"v1",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(b,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(b,"v4",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(b,"v5",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(b,"NIL",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(b,"version",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(b,"validate",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(b,"stringify",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(b,"parse",{enumerable:!0,get:function(){return s.default}});var c=f(e("./v1.js")),i=f(e("./v3.js")),a=f(e("./v4.js")),r=f(e("./v5.js")),t=f(e("./nil.js")),n=f(e("./version.js")),l=f(e("./validate.js")),o=f(e("./stringify.js")),s=f(e("./parse.js"));function f(d){return d&&d.__esModule?d:{default:d}}},{"./nil.js":530,"./parse.js":531,"./stringify.js":535,"./v1.js":536,"./v3.js":537,"./v4.js":539,"./v5.js":540,"./validate.js":541,"./version.js":542}],529:[function(e,p,b){"use strict";function c(s){return 14+(s+64>>>9<<4)+1}function i(s,f){let d=(65535&s)+(65535&f);return(s>>16)+(f>>16)+(d>>16)<<16|65535&d}function a(s,f,d,u,g,m){return i((v=i(i(f,s),i(u,m)))<<(k=g)|v>>>32-k,d);var v,k}function r(s,f,d,u,g,m,v){return a(f&d|~f&u,s,f,g,m,v)}function t(s,f,d,u,g,m,v){return a(f&u|d&~u,s,f,g,m,v)}function n(s,f,d,u,g,m,v){return a(f^d^u,s,f,g,m,v)}function l(s,f,d,u,g,m,v){return a(d^(f|~u),s,f,g,m,v)}Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=function(s){if(typeof s=="string"){let f=unescape(encodeURIComponent(s));s=new Uint8Array(f.length);for(let d=0;d<f.length;++d)s[d]=f.charCodeAt(d)}return(function(f){let d=[],u=32*f.length;for(let g=0;g<u;g+=8){let m=f[g>>5]>>>g%32&255,v=parseInt("0123456789abcdef".charAt(m>>>4&15)+"0123456789abcdef".charAt(15&m),16);d.push(v)}return d})((function(f,d){f[d>>5]|=128<<d%32,f[c(d)-1]=d;let u=1732584193,g=-271733879,m=-1732584194,v=271733878;for(let k=0;k<f.length;k+=16){let B=u,O=g,L=m,R=v;u=r(u,g,m,v,f[k],7,-680876936),v=r(v,u,g,m,f[k+1],12,-389564586),m=r(m,v,u,g,f[k+2],17,606105819),g=r(g,m,v,u,f[k+3],22,-1044525330),u=r(u,g,m,v,f[k+4],7,-176418897),v=r(v,u,g,m,f[k+5],12,1200080426),m=r(m,v,u,g,f[k+6],17,-1473231341),g=r(g,m,v,u,f[k+7],22,-45705983),u=r(u,g,m,v,f[k+8],7,1770035416),v=r(v,u,g,m,f[k+9],12,-1958414417),m=r(m,v,u,g,f[k+10],17,-42063),g=r(g,m,v,u,f[k+11],22,-1990404162),u=r(u,g,m,v,f[k+12],7,1804603682),v=r(v,u,g,m,f[k+13],12,-40341101),m=r(m,v,u,g,f[k+14],17,-1502002290),g=r(g,m,v,u,f[k+15],22,1236535329),u=t(u,g,m,v,f[k+1],5,-165796510),v=t(v,u,g,m,f[k+6],9,-1069501632),m=t(m,v,u,g,f[k+11],14,643717713),g=t(g,m,v,u,f[k],20,-373897302),u=t(u,g,m,v,f[k+5],5,-701558691),v=t(v,u,g,m,f[k+10],9,38016083),m=t(m,v,u,g,f[k+15],14,-660478335),g=t(g,m,v,u,f[k+4],20,-405537848),u=t(u,g,m,v,f[k+9],5,568446438),v=t(v,u,g,m,f[k+14],9,-1019803690),m=t(m,v,u,g,f[k+3],14,-187363961),g=t(g,m,v,u,f[k+8],20,1163531501),u=t(u,g,m,v,f[k+13],5,-1444681467),v=t(v,u,g,m,f[k+2],9,-51403784),m=t(m,v,u,g,f[k+7],14,1735328473),g=t(g,m,v,u,f[k+12],20,-1926607734),u=n(u,g,m,v,f[k+5],4,-378558),v=n(v,u,g,m,f[k+8],11,-2022574463),m=n(m,v,u,g,f[k+11],16,1839030562),g=n(g,m,v,u,f[k+14],23,-35309556),u=n(u,g,m,v,f[k+1],4,-1530992060),v=n(v,u,g,m,f[k+4],11,1272893353),m=n(m,v,u,g,f[k+7],16,-155497632),g=n(g,m,v,u,f[k+10],23,-1094730640),u=n(u,g,m,v,f[k+13],4,681279174),v=n(v,u,g,m,f[k],11,-358537222),m=n(m,v,u,g,f[k+3],16,-722521979),g=n(g,m,v,u,f[k+6],23,76029189),u=n(u,g,m,v,f[k+9],4,-640364487),v=n(v,u,g,m,f[k+12],11,-421815835),m=n(m,v,u,g,f[k+15],16,530742520),g=n(g,m,v,u,f[k+2],23,-995338651),u=l(u,g,m,v,f[k],6,-198630844),v=l(v,u,g,m,f[k+7],10,1126891415),m=l(m,v,u,g,f[k+14],15,-1416354905),g=l(g,m,v,u,f[k+5],21,-57434055),u=l(u,g,m,v,f[k+12],6,1700485571),v=l(v,u,g,m,f[k+3],10,-1894986606),m=l(m,v,u,g,f[k+10],15,-1051523),g=l(g,m,v,u,f[k+1],21,-2054922799),u=l(u,g,m,v,f[k+8],6,1873313359),v=l(v,u,g,m,f[k+15],10,-30611744),m=l(m,v,u,g,f[k+6],15,-1560198380),g=l(g,m,v,u,f[k+13],21,1309151649),u=l(u,g,m,v,f[k+4],6,-145523070),v=l(v,u,g,m,f[k+11],10,-1120210379),m=l(m,v,u,g,f[k+2],15,718787259),g=l(g,m,v,u,f[k+9],21,-343485551),u=i(u,B),g=i(g,O),m=i(m,L),v=i(v,R)}return[u,g,m,v]})((function(f){if(f.length===0)return[];let d=8*f.length,u=new Uint32Array(c(d));for(let g=0;g<d;g+=8)u[g>>5]|=(255&f[g/8])<<g%32;return u})(s),8*s.length))};b.default=o},{}],530:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0,b.default="00000000-0000-0000-0000-000000000000"},{}],531:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c,i=(c=e("./validate.js"))&&c.__esModule?c:{default:c},a=function(r){if(!(0,i.default)(r))throw TypeError("Invalid UUID");let t,n=new Uint8Array(16);return n[0]=(t=parseInt(r.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(r.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(r.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(r.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};b.default=a},{"./validate.js":541}],532:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0,b.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],533:[function(e,p,b){"use strict";let c;Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(){if(!c&&(c=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!c))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(i)};let i=new Uint8Array(16)},{}],534:[function(e,p,b){"use strict";function c(r,t,n,l){switch(r){case 0:return t&n^~t&l;case 1:return t^n^l;case 2:return t&n^t&l^n&l;case 3:return t^n^l}}function i(r,t){return r<<t|r>>>32-t}Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var a=function(r){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof r=="string"){let f=unescape(encodeURIComponent(r));r=[];for(let d=0;d<f.length;++d)r.push(f.charCodeAt(d))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);let l=r.length/4+2,o=Math.ceil(l/16),s=new Array(o);for(let f=0;f<o;++f){let d=new Uint32Array(16);for(let u=0;u<16;++u)d[u]=r[64*f+4*u]<<24|r[64*f+4*u+1]<<16|r[64*f+4*u+2]<<8|r[64*f+4*u+3];s[f]=d}s[o-1][14]=8*(r.length-1)/Math.pow(2,32),s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=8*(r.length-1)&4294967295;for(let f=0;f<o;++f){let d=new Uint32Array(80);for(let B=0;B<16;++B)d[B]=s[f][B];for(let B=16;B<80;++B)d[B]=i(d[B-3]^d[B-8]^d[B-14]^d[B-16],1);let u=n[0],g=n[1],m=n[2],v=n[3],k=n[4];for(let B=0;B<80;++B){let O=Math.floor(B/20),L=i(u,5)+c(O,g,m,v)+k+t[O]+d[B]>>>0;k=v,v=m,m=i(g,30)>>>0,g=u,u=L}n[0]=n[0]+u>>>0,n[1]=n[1]+g>>>0,n[2]=n[2]+m>>>0,n[3]=n[3]+v>>>0,n[4]=n[4]+k>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]};b.default=a},{}],535:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c,i=(c=e("./validate.js"))&&c.__esModule?c:{default:c};let a=[];for(let t=0;t<256;++t)a.push((t+256).toString(16).substr(1));var r=function(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(a[t[n+0]]+a[t[n+1]]+a[t[n+2]]+a[t[n+3]]+"-"+a[t[n+4]]+a[t[n+5]]+"-"+a[t[n+6]]+a[t[n+7]]+"-"+a[t[n+8]]+a[t[n+9]]+"-"+a[t[n+10]]+a[t[n+11]]+a[t[n+12]]+a[t[n+13]]+a[t[n+14]]+a[t[n+15]]).toLowerCase();if(!(0,i.default)(l))throw TypeError("Stringified UUID is invalid");return l};b.default=r},{"./validate.js":541}],536:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c=a(e("./rng.js")),i=a(e("./stringify.js"));function a(s){return s&&s.__esModule?s:{default:s}}let r,t,n=0,l=0;var o=function(s,f,d){let u=f&&d||0,g=f||new Array(16),m=(s=s||{}).node||r,v=s.clockseq!==void 0?s.clockseq:t;if(m==null||v==null){let P=s.random||(s.rng||c.default)();m==null&&(m=r=[1|P[0],P[1],P[2],P[3],P[4],P[5]]),v==null&&(v=t=16383&(P[6]<<8|P[7]))}let k=s.msecs!==void 0?s.msecs:Date.now(),B=s.nsecs!==void 0?s.nsecs:l+1,O=k-n+(B-l)/1e4;if(O<0&&s.clockseq===void 0&&(v=v+1&16383),(O<0||k>n)&&s.nsecs===void 0&&(B=0),B>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");n=k,l=B,t=v,k+=122192928e5;let L=(1e4*(268435455&k)+B)%4294967296;g[u++]=L>>>24&255,g[u++]=L>>>16&255,g[u++]=L>>>8&255,g[u++]=255&L;let R=k/4294967296*1e4&268435455;g[u++]=R>>>8&255,g[u++]=255&R,g[u++]=R>>>24&15|16,g[u++]=R>>>16&255,g[u++]=v>>>8|128,g[u++]=255&v;for(let P=0;P<6;++P)g[u+P]=m[P];return f||(0,i.default)(g)};b.default=o},{"./rng.js":533,"./stringify.js":535}],537:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c=a(e("./v35.js")),i=a(e("./md5.js"));function a(t){return t&&t.__esModule?t:{default:t}}var r=(0,c.default)("v3",48,i.default);b.default=r},{"./md5.js":529,"./v35.js":538}],538:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(n,l,o){function s(f,d,u,g){if(typeof f=="string"&&(f=(function(v){v=unescape(encodeURIComponent(v));let k=[];for(let B=0;B<v.length;++B)k.push(v.charCodeAt(B));return k})(f)),typeof d=="string"&&(d=(0,i.default)(d)),d.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let m=new Uint8Array(16+f.length);if(m.set(d),m.set(f,d.length),m=o(m),m[6]=15&m[6]|l,m[8]=63&m[8]|128,u){g=g||0;for(let v=0;v<16;++v)u[g+v]=m[v];return u}return(0,c.default)(m)}try{s.name=n}catch{}return s.DNS=r,s.URL=t,s},b.URL=b.DNS=void 0;var c=a(e("./stringify.js")),i=a(e("./parse.js"));function a(n){return n&&n.__esModule?n:{default:n}}let r="6ba7b810-9dad-11d1-80b4-00c04fd430c8";b.DNS=r;let t="6ba7b811-9dad-11d1-80b4-00c04fd430c8";b.URL=t},{"./parse.js":531,"./stringify.js":535}],539:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c=a(e("./rng.js")),i=a(e("./stringify.js"));function a(t){return t&&t.__esModule?t:{default:t}}var r=function(t,n,l){let o=(t=t||{}).random||(t.rng||c.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n){l=l||0;for(let s=0;s<16;++s)n[l+s]=o[s];return n}return(0,i.default)(o)};b.default=r},{"./rng.js":533,"./stringify.js":535}],540:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c=a(e("./v35.js")),i=a(e("./sha1.js"));function a(t){return t&&t.__esModule?t:{default:t}}var r=(0,c.default)("v5",80,i.default);b.default=r},{"./sha1.js":534,"./v35.js":538}],541:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c,i=(c=e("./regex.js"))&&c.__esModule?c:{default:c},a=function(r){return typeof r=="string"&&i.default.test(r)};b.default=a},{"./regex.js":532}],542:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var c,i=(c=e("./validate.js"))&&c.__esModule?c:{default:c},a=function(r){if(!(0,i.default)(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)};b.default=a},{"./validate.js":541}],543:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CHAR=`
27
+ \r -\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}`,b.S=` \r
28
+ `,b.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NAME_CHAR="-"+b.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.CHAR_RE=new RegExp("^["+b.CHAR+"]$","u"),b.S_RE=new RegExp("^["+b.S+"]+$","u"),b.NAME_START_CHAR_RE=new RegExp("^["+b.NAME_START_CHAR+"]$","u"),b.NAME_CHAR_RE=new RegExp("^["+b.NAME_CHAR+"]$","u"),b.NAME_RE=new RegExp("^["+b.NAME_START_CHAR+"]["+b.NAME_CHAR+"]*$","u"),b.NMTOKEN_RE=new RegExp("^["+b.NAME_CHAR+"]+$","u");function c(i){return i>=65&&i<=90||i>=97&&i<=122||i===58||i===95||i===8204||i===8205||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}b.S_LIST=[32,10,13,9],b.isChar=function(i){return i>=32&&i<=55295||i===10||i===13||i===9||i>=57344&&i<=65533||i>=65536&&i<=1114111},b.isS=function(i){return i===32||i===10||i===13||i===9},b.isNameStartChar=c,b.isNameChar=function(i){return c(i)||i>=48&&i<=57||i===45||i===46||i===183||i>=768&&i<=879||i>=8255&&i<=8256}},{}],544:[function(e,p,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.CHAR="-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}",b.RESTRICTED_CHAR="-\b\v\f-\x7F-\x84\x86-\x9F",b.S=` \r
29
+ `,b.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NAME_CHAR="-"+b.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.CHAR_RE=new RegExp("^["+b.CHAR+"]$","u"),b.RESTRICTED_CHAR_RE=new RegExp("^["+b.RESTRICTED_CHAR+"]$","u"),b.S_RE=new RegExp("^["+b.S+"]+$","u"),b.NAME_START_CHAR_RE=new RegExp("^["+b.NAME_START_CHAR+"]$","u"),b.NAME_CHAR_RE=new RegExp("^["+b.NAME_CHAR+"]$","u"),b.NAME_RE=new RegExp("^["+b.NAME_START_CHAR+"]["+b.NAME_CHAR+"]*$","u"),b.NMTOKEN_RE=new RegExp("^["+b.NAME_CHAR+"]+$","u");function c(i){return i>=65&&i<=90||i>=97&&i<=122||i===58||i===95||i===8204||i===8205||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}b.S_LIST=[32,10,13,9],b.isChar=function(i){return i>=1&&i<=55295||i>=57344&&i<=65533||i>=65536&&i<=1114111},b.isRestrictedChar=function(i){return i>=1&&i<=8||i===11||i===12||i>=14&&i<=31||i>=127&&i<=132||i>=134&&i<=159},b.isCharAndNotRestricted=function(i){return i===9||i===10||i===13||i>31&&i<127||i===133||i>159&&i<=55295||i>=57344&&i<=65533||i>=65536&&i<=1114111},b.isS=function(i){return i===32||i===10||i===13||i===9},b.isNameStartChar=c,b.isNameChar=function(i){return c(i)||i>=48&&i<=57||i===45||i===46||i===183||i>=768&&i<=879||i>=8255&&i<=8256}},{}],545:[function(e,p,b){"use strict";function c(i){return i>=65&&i<=90||i===95||i>=97&&i<=122||i>=192&&i<=214||i>=216&&i<=246||i>=248&&i<=767||i>=880&&i<=893||i>=895&&i<=8191||i>=8204&&i<=8205||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533||i>=65536&&i<=983039}Object.defineProperty(b,"__esModule",{value:!0}),b.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}",b.NC_NAME_CHAR="-"+b.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040",b.NC_NAME_START_CHAR_RE=new RegExp("^["+b.NC_NAME_START_CHAR+"]$","u"),b.NC_NAME_CHAR_RE=new RegExp("^["+b.NC_NAME_CHAR+"]$","u"),b.NC_NAME_RE=new RegExp("^["+b.NC_NAME_START_CHAR+"]["+b.NC_NAME_CHAR+"]*$","u"),b.isNCNameStartChar=c,b.isNCNameChar=function(i){return c(i)||i===45||i===46||i>=48&&i<=57||i===183||i>=768&&i<=879||i>=8255&&i<=8256}},{}]},{},[15])(15)}))});var Yc="waiting",k6="replied";import{createContext as up,useContext as fp,useMemo as Zc}from"react";import{Box as dp}from"@mui/material";var La="--app-mobile-font-offset";function ar(e,p=0){return`calc(${e}px + max(0px, var(${La}, 0px) - ${p}px))`}import{jsx as Xc}from"react/jsx-runtime";var Jc=up({});function hp({config:e,children:p}){let b=Zc(()=>e??{},[e]),c=b.mobileFontOffsetPx;return Xc(Jc.Provider,{value:b,children:c===void 0?p:Xc(dp,{sx:{display:"contents",[La]:`${c}px`},children:p})})}function Br(){return fp(Jc)}function wi(){let{buildFileUrl:e}=Br();return Zc(()=>e||((p,b)=>{let c=[];return b?.thumb&&c.push(`thumb=${b.thumb}`),b?.download&&c.push("download=1"),`/api/v1/files/${p}${c.length?`?${c.join("&")}`:""}`}),[e])}function _i(){let{uploadMaxMb:e}=Br();return e??50}import{useGlobalForm as Z0}from"@ehfuse/forma";import Qc from"@mui/icons-material/DoNotDisturbAltOutlined";import eu from"@mui/icons-material/BookmarkBorderOutlined";import pp from"@mui/icons-material/LabelOutlined";import mp from"@mui/icons-material/FlagOutlined";import gp from"@mui/icons-material/StarBorderOutlined";import bp from"@mui/icons-material/FolderOutlined";import yp from"@mui/icons-material/EventOutlined";import xp from"@mui/icons-material/BuildOutlined";import vp from"@mui/icons-material/LocalShippingOutlined";import wp from"@mui/icons-material/StorefrontOutlined";import _p from"@mui/icons-material/GroupsOutlined";import kp from"@mui/icons-material/LightbulbOutlined";import Sp from"@mui/icons-material/FavoriteBorderOutlined";import Tp from"@mui/icons-material/AssignmentOutlined";import Cp from"@mui/icons-material/HomeOutlined";import Bp from"@mui/icons-material/WorkOutline";import Ip from"@mui/icons-material/SchoolOutlined";import Mp from"@mui/icons-material/LocalHospitalOutlined";import Ep from"@mui/icons-material/RestaurantOutlined";import Rp from"@mui/icons-material/LocalFloristOutlined";import Ap from"@mui/icons-material/DirectionsCarOutlined";import Op from"@mui/icons-material/CampaignOutlined";import Dp from"@mui/icons-material/SavingsOutlined";import Pp from"@mui/icons-material/Inventory2Outlined";import Np from"@mui/icons-material/CleaningServicesOutlined";import tu from"@mui/icons-material/HandymanOutlined";import jp from"@mui/icons-material/LocalPhoneOutlined";import Lp from"@mui/icons-material/EmailOutlined";import Fp from"@mui/icons-material/ShoppingCartOutlined";import zp from"@mui/icons-material/BarChartOutlined";import qp from"@mui/icons-material/PrintOutlined";import $p from"@mui/icons-material/SecurityOutlined";import Hp from"@mui/icons-material/AlarmOutlined";import Wp from"@mui/icons-material/AttachFileOutlined";import Up from"@mui/icons-material/PhotoCameraOutlined";import Vp from"@mui/icons-material/ImageOutlined";import Kp from"@mui/icons-material/MenuBookOutlined";import Gp from"@mui/icons-material/EditOutlined";import Yp from"@mui/icons-material/KeyOutlined";import Xp from"@mui/icons-material/LockOutlined";import Zp from"@mui/icons-material/LockOpenOutlined";import Jp from"@mui/icons-material/SettingsOutlined";import Qp from"@mui/icons-material/CloudOutlined";import em from"@mui/icons-material/WifiOutlined";import tm from"@mui/icons-material/ComputerOutlined";import rm from"@mui/icons-material/SmartphoneOutlined";import nm from"@mui/icons-material/TvOutlined";import om from"@mui/icons-material/AccessTimeOutlined";import im from"@mui/icons-material/TimerOutlined";import sm from"@mui/icons-material/MapOutlined";import am from"@mui/icons-material/PlaceOutlined";import lm from"@mui/icons-material/NavigationOutlined";import cm from"@mui/icons-material/FlightOutlined";import um from"@mui/icons-material/TrainOutlined";import fm from"@mui/icons-material/DirectionsBusOutlined";import dm from"@mui/icons-material/DirectionsBikeOutlined";import hm from"@mui/icons-material/DirectionsWalkOutlined";import pm from"@mui/icons-material/DirectionsRunOutlined";import mm from"@mui/icons-material/FitnessCenterOutlined";import gm from"@mui/icons-material/SportsSoccerOutlined";import bm from"@mui/icons-material/EmojiEventsOutlined";import ym from"@mui/icons-material/CardGiftcardOutlined";import xm from"@mui/icons-material/CakeOutlined";import ru from"@mui/icons-material/CoffeeOutlined";import vm from"@mui/icons-material/LocalPizzaOutlined";import wm from"@mui/icons-material/ShoppingBagOutlined";import nu from"@mui/icons-material/CreditCardOutlined";import _m from"@mui/icons-material/AccountBalanceOutlined";import km from"@mui/icons-material/AccountBalanceWalletOutlined";import Sm from"@mui/icons-material/AttachMoneyOutlined";import Tm from"@mui/icons-material/ReceiptLongOutlined";import Cm from"@mui/icons-material/CalculateOutlined";import Bm from"@mui/icons-material/TrendingUpOutlined";import Im from"@mui/icons-material/ListAltOutlined";import Mm from"@mui/icons-material/TaskAltOutlined";import Em from"@mui/icons-material/DoneAllOutlined";import Rm from"@mui/icons-material/WarningAmberOutlined";import Am from"@mui/icons-material/InfoOutlined";import Om from"@mui/icons-material/HelpOutlined";import Dm from"@mui/icons-material/SupportAgentOutlined";import Pm from"@mui/icons-material/PersonOutlined";import Nm from"@mui/icons-material/PersonAddOutlined";import jm from"@mui/icons-material/BadgeOutlined";import Lm from"@mui/icons-material/WbSunnyOutlined";import Fm from"@mui/icons-material/DarkModeOutlined";import zm from"@mui/icons-material/LocalFireDepartmentOutlined";import qm from"@mui/icons-material/WaterDropOutlined";import $m from"@mui/icons-material/BoltOutlined";import Hm from"@mui/icons-material/AutorenewOutlined";import Wm from"@mui/icons-material/ScienceOutlined";import Um from"@mui/icons-material/MedicalServicesOutlined";import Vm from"@mui/icons-material/NotificationsOutlined";import Km from"@mui/icons-material/SendOutlined";import Gm from"@mui/icons-material/LinkOutlined";import Ym from"@mui/icons-material/PublicOutlined";import ou from"@mui/icons-material/ApartmentOutlined";import Xm from"@mui/icons-material/PlumbingOutlined";import Zm from"@mui/icons-material/ElectricalServicesOutlined";import Jm from"@mui/icons-material/ChatOutlined";import Qm from"@mui/icons-material/DescriptionOutlined";import e0 from"@mui/icons-material/FactCheckOutlined";import t0 from"@mui/icons-material/RocketLaunchOutlined";import r0 from"@mui/icons-material/PaletteOutlined";import n0 from"@mui/icons-material/MusicNoteOutlined";import o0 from"@mui/icons-material/VideocamOutlined";import i0 from"@mui/icons-material/ThumbUpOutlined";import s0 from"@mui/icons-material/PushPinOutlined";import a0 from"@mui/icons-material/SearchOutlined";import l0 from"@mui/icons-material/VisibilityOutlined";import c0 from"@mui/icons-material/VerifiedOutlined";import u0 from"@mui/icons-material/TrackChangesOutlined";import f0 from"@mui/icons-material/ExtensionOutlined";import d0 from"@mui/icons-material/CodeOutlined";import h0 from"@mui/icons-material/BugReportOutlined";import p0 from"@mui/icons-material/SmartToyOutlined";import m0 from"@mui/icons-material/StorageOutlined";import g0 from"@mui/icons-material/QrCode2Outlined";import b0 from"@mui/icons-material/FileDownloadOutlined";import y0 from"@mui/icons-material/FileUploadOutlined";import x0 from"@mui/icons-material/MicOutlined";import v0 from"@mui/icons-material/HeadphonesOutlined";import w0 from"@mui/icons-material/MovieOutlined";import _0 from"@mui/icons-material/SportsEsportsOutlined";import k0 from"@mui/icons-material/BrushOutlined";import S0 from"@mui/icons-material/ArchitectureOutlined";import T0 from"@mui/icons-material/EngineeringOutlined";import C0 from"@mui/icons-material/FactoryOutlined";import B0 from"@mui/icons-material/AgricultureOutlined";import I0 from"@mui/icons-material/DirectionsBoatOutlined";import M0 from"@mui/icons-material/TwoWheelerOutlined";import E0 from"@mui/icons-material/HandshakeOutlined";import R0 from"@mui/icons-material/GavelOutlined";import A0 from"@mui/icons-material/BalanceOutlined";import O0 from"@mui/icons-material/TranslateOutlined";import D0 from"@mui/icons-material/PsychologyOutlined";import P0 from"@mui/icons-material/PetsOutlined";import N0 from"@mui/icons-material/CelebrationOutlined";import j0 from"@mui/icons-material/BeachAccessOutlined";import L0 from"@mui/icons-material/AcUnitOutlined";import F0 from"@mui/icons-material/ForestOutlined";import z0 from"@mui/icons-material/LandscapeOutlined";import q0 from"@mui/icons-material/HotelOutlined";import $0 from"@mui/icons-material/LocalLaundryServiceOutlined";import H0 from"@mui/icons-material/ChairOutlined";import W0 from"@mui/icons-material/LocalBarOutlined";import U0 from"@mui/icons-material/LunchDiningOutlined";import V0 from"@mui/icons-material/IcecreamOutlined";import K0 from"@mui/icons-material/WorkspacePremiumOutlined";import G0 from"@mui/icons-material/DiamondOutlined";import Y0 from"@mui/icons-material/VaccinesOutlined";var Fa="bookmark",Tn="label",Kt="notifications",tr="event",ki="warning",Si="#e53e3e",iu="none",za=[{key:iu,Icon:Qc},{key:"label",Icon:pp},{key:"bookmark",Icon:eu},{key:"flag",Icon:mp},{key:"star",Icon:gp},{key:"folder",Icon:bp},{key:"event",Icon:yp},{key:"build",Icon:xp},{key:"shipping",Icon:vp},{key:"store",Icon:wp},{key:"groups",Icon:_p},{key:"idea",Icon:kp},{key:"heart",Icon:Sp},{key:"assignment",Icon:Tp},{key:"home",Icon:Cp},{key:"work",Icon:Bp},{key:"school",Icon:Ip},{key:"hospital",Icon:Mp},{key:"restaurant",Icon:Ep},{key:"flower",Icon:Rp},{key:"car",Icon:Ap},{key:"campaign",Icon:Op},{key:"savings",Icon:Dp},{key:"inventory",Icon:Pp},{key:"cleaning",Icon:Np},{key:"handyman",Icon:tu},{key:"phone",Icon:jp},{key:"email",Icon:Lp},{key:"cart",Icon:Fp},{key:"chart",Icon:zp},{key:"print",Icon:qp},{key:"security",Icon:$p},{key:"alarm",Icon:Hp},{key:"attach",Icon:Wp},{key:"camera",Icon:Up},{key:"image",Icon:Vp},{key:"book",Icon:Kp},{key:"edit",Icon:Gp},{key:"key",Icon:Yp},{key:"lock",Icon:Xp},{key:"unlock",Icon:Zp},{key:"settings",Icon:Jp},{key:"cloud",Icon:Qp},{key:"wifi",Icon:em},{key:"computer",Icon:tm},{key:"smartphone",Icon:rm},{key:"tv",Icon:nm},{key:"clock",Icon:om},{key:"timer",Icon:im},{key:"map",Icon:sm},{key:"place",Icon:am},{key:"navigation",Icon:lm},{key:"flight",Icon:cm},{key:"train",Icon:um},{key:"bus",Icon:fm},{key:"bike",Icon:dm},{key:"walk",Icon:hm},{key:"run",Icon:pm},{key:"fitness",Icon:mm},{key:"soccer",Icon:gm},{key:"trophy",Icon:bm},{key:"gift",Icon:ym},{key:"cake",Icon:xm},{key:"coffee",Icon:ru},{key:"pizza",Icon:vm},{key:"bag",Icon:wm},{key:"card",Icon:nu},{key:"bank",Icon:_m},{key:"wallet",Icon:km},{key:"money",Icon:Sm},{key:"receipt",Icon:Tm},{key:"calculate",Icon:Cm},{key:"trending",Icon:Bm},{key:"listalt",Icon:Im},{key:"task",Icon:Mm},{key:"doneall",Icon:Em},{key:"warning",Icon:Rm},{key:"info",Icon:Am},{key:"help",Icon:Om},{key:"support",Icon:Dm},{key:"person",Icon:Pm},{key:"personadd",Icon:Nm},{key:"badge",Icon:jm},{key:"sun",Icon:Lm},{key:"moon",Icon:Fm},{key:"fire",Icon:zm},{key:"water",Icon:qm},{key:"bolt",Icon:$m},{key:"renew",Icon:Hm},{key:"science",Icon:Wm},{key:"medical",Icon:Um},{key:"notifications",Icon:Vm},{key:"send",Icon:Km},{key:"link",Icon:Gm},{key:"public",Icon:Ym},{key:"apartment",Icon:ou},{key:"plumbing",Icon:Xm},{key:"electrical",Icon:Zm},{key:"chat",Icon:Jm},{key:"description",Icon:Qm},{key:"factcheck",Icon:e0},{key:"rocket",Icon:t0},{key:"palette",Icon:r0},{key:"music",Icon:n0},{key:"video",Icon:o0},{key:"thumbup",Icon:i0},{key:"pin",Icon:s0},{key:"search",Icon:a0},{key:"eye",Icon:l0},{key:"verified",Icon:c0},{key:"target",Icon:u0},{key:"extension",Icon:f0},{key:"code",Icon:d0},{key:"bug",Icon:h0},{key:"robot",Icon:p0},{key:"storage",Icon:m0},{key:"qrcode",Icon:g0},{key:"download",Icon:b0},{key:"upload",Icon:y0},{key:"mic",Icon:x0},{key:"headphones",Icon:v0},{key:"movie",Icon:w0},{key:"game",Icon:_0},{key:"brush",Icon:k0},{key:"architecture",Icon:S0},{key:"engineering",Icon:T0},{key:"factory",Icon:C0},{key:"agriculture",Icon:B0},{key:"boat",Icon:I0},{key:"motorcycle",Icon:M0},{key:"handshake",Icon:E0},{key:"gavel",Icon:R0},{key:"balance",Icon:A0},{key:"translate",Icon:O0},{key:"psychology",Icon:D0},{key:"pets",Icon:P0},{key:"celebration",Icon:N0},{key:"beach",Icon:j0},{key:"snow",Icon:L0},{key:"forest",Icon:F0},{key:"mountain",Icon:z0},{key:"hotel",Icon:q0},{key:"laundry",Icon:$0},{key:"chair",Icon:H0},{key:"bar",Icon:W0},{key:"burger",Icon:U0},{key:"icecream",Icon:V0},{key:"medal",Icon:K0},{key:"diamond",Icon:G0},{key:"vaccine",Icon:Y0}],X0={cafe:ru,payment:nu,business:ou,construction:tu};function bt(e){return e===iu?null:za.find(p=>p.key===e)?.Icon??X0[String(e??"")]??eu}function x8(e){return bt(e)??Qc}var qa={title:"",icon:Tn,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,visibility:"involved",visibility_group_seq:0,repeat_rule:"",repeat_until:"",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:""},$a={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function J0(e){let{formId:p="taskbox-create-form",initialValues:b,onValidate:c,onSubmit:i}=e;return Z0({formId:p,initialValues:{...qa,...b},onValidate:c,onSubmit:i})}import{useGlobalFormaState as Q0}from"@ehfuse/forma";var su="taskbox-ui-state";function Cn(){return Q0({stateId:su,initialValues:$a})}import{useMemo as eg}from"react";import{useTheme as tg}from"@mui/material";function Wo(e,p){let b=Math.max(0,Math.min(1,p));if(b<=0)return"transparent";let c=e.trim().replace("#",""),i=c.length===3?c.split("").map(n=>n+n).join(""):c;if(!/^[0-9a-fA-F]{6}$/.test(i))return e;let a=Number.parseInt(i.slice(0,2),16),r=Number.parseInt(i.slice(2,4),16),t=Number.parseInt(i.slice(4,6),16);return`rgba(${a}, ${r}, ${t}, ${b})`}function au(e,p){let b=Math.max(0,Math.min(1,p)),c=e.trim().replace("#",""),i=c.length===3?c.split("").map(l=>l+l).join(""):c;if(!/^[0-9a-fA-F]{6}$/.test(i))return e;let a=l=>Math.round(l+(255-l)*b),r=a(Number.parseInt(i.slice(0,2),16)),t=a(Number.parseInt(i.slice(2,4),16)),n=a(Number.parseInt(i.slice(4,6),16));return`#${[r,t,n].map(l=>l.toString(16).padStart(2,"0")).join("")}`}function Ha(e,p,b){return b==="dark"?{accent:e,accentContrast:p,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",surfaceHoverStrong:"#323a45",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:p,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:"#f8f8f7",surfaceHoverStrong:"#efefed",border:"#e6e6e3",borderStrong:"#dedddb"}}function rg(e,p){let b=p==="dark";return{bg:b?au(e.accent,.45):e.accent,color:b?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function lu(e,p){return{...e,...p??{}}}function ks(e,p="light"){let b=p==="dark",c=rg(e,p),i=e.accentOnSurface;return{mode:p,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:i,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:p==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHoverStrong,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:p==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:p==="dark"?400:700,minHeight:48,badge:{...c,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...c,borderRadius:4,width:34}},summary:{gaugeTrackColor:p==="dark"?e.borderStrong:"#ececea",gaugeBarColor:i,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:i,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:p==="dark"?e.surfaceSubtle:e.surface,color:p==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:p==="dark"?e.border:e.borderStrong,selectedBg:p==="dark"?e.surfaceHover:e.textStrong,selectedColor:p==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:b?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:b?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:b?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:b?"#232a33":e.surface,borderColor:b?"#333c47":e.border,hoverBg:b?"#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:p==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:p==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function Wa(e,p){if(!p)return e;let b=p.mode??e.mode,i={...b===e.mode?e.colors:Ha(e.colors.accent,e.colors.accentContrast,b),...p.colors??{}},a=ks(i,b),{groupHeader:r,...t}=p.table??{},{badge:n,...l}=p.board??{},{badge:o,...s}=r??{};return{mode:b,colors:i,table:{...a.table,...t,groupHeader:{...a.table.groupHeader,...s,badge:lu(a.table.groupHeader.badge,o)}},board:{...a.board,...l,badge:lu(a.board.badge,n)},summary:{...a.summary,...p.summary??{}},chip:{...a.chip,...p.chip??{}},actionButton:{...a.actionButton,...p.actionButton??{}},tabs:{...a.tabs,...p.tabs??{}},avatar:{...a.avatar,...p.avatar??{}},calendar:{...a.calendar,...p.calendar??{}},card:{...a.card,...p.card??{}},timeline:{...a.timeline,...p.timeline??{}}}}function ng(e={}){let{mode:p="light",accent:b="#2563eb",accentContrast:c="#ffffff",input:i}=e;return Wa(ks(Ha(b,c,p),p),i)}function nt(){let e=tg(),{theme:p}=Br(),b=e.palette.primary.main,c=e.palette.primary.contrastText,i=e.palette.mode==="dark"?"dark":"light";return eg(()=>Wa(ks(Ha(b,c,i),i),p),[b,c,i,p])}import{useCallback as Mn,useEffect as qs,useMemo as cn,useRef as jb,useState as En}from"react";import{Box as yr,Divider as Lb,IconButton as Fb,ListItemIcon as zb,Menu as Hu,MenuItem as $s}from"@mui/material";import Wu from"@mui/icons-material/Add";import qb from"@mui/icons-material/ArrowUpward";import $b from"@mui/icons-material/ArrowDownward";import Hb from"@mui/icons-material/KeyboardArrowDown";import Wb from"@mui/icons-material/KeyboardArrowRight";import ml from"@mui/icons-material/Check";import Ub from"@mui/icons-material/FilterList";import Vb from"@mui/icons-material/InboxOutlined";import{Virtuoso as Kb}from"react-virtuoso";import Gb from"@ehfuse/overlay-scrollbar";import{Box as cu}from"@mui/material";import{jsx as ig,jsxs as sg}from"react/jsx-runtime";var og={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 Ir({priority:e,small:p=!1,plain:b=!1}){let c=og[e],i=nt(),a=i.mode==="dark",r=b||e==="low";return sg(cu,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:p?.5:.75,px:r?0:p?.9:1.25,py:r?0:p?.25:.5,borderRadius:.75,fontSize:p?11.5:13,fontWeight:500,bgcolor:r?"transparent":a?Wo(c.dot,i.chip.darkBgAlpha):c.bgcolor,color:r?a?i.chip.plainColor:c.color:a?i.chip.darkTextSource==="fg"?c.color:c.dot:c.color,whiteSpace:"nowrap"},children:[ig(cu,{component:"span",sx:{width:p?6:8,height:p?6:8,borderRadius:"50%",bgcolor:c.dot}}),c.label]})}import{Menu as fg,MenuItem as dg}from"@mui/material";import hg from"@mui/icons-material/Check";function sn(){return{}}var Ua=[{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"}],Va=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],Ka=[{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 uu(e){return Ua.find(p=>p.key===e)?.name??""}function fu(e){return Va.find(p=>p.key===e)?.name??""}function Ss(e){return Ka.find(p=>p.key===e)?.name??""}function Ga(e,p=new Date){if(!e.is_event)return!1;let b=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(b))return!1;let c=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(c)){let a=new Date(`${b}T${c}:00`);return!Number.isNaN(a.getTime())&&a.getTime()<=p.getTime()}let i=new Date(`${b}T00:00:00`);return Number.isNaN(i.getTime())?!1:(i.setDate(i.getDate()+1),i.getTime()<=p.getTime())}function Ts(e,p=new Date){return e.is_event?Ga(e,p):!!e.completed}var yo=[{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"}],Ci=yo;function Cs(e){return yo.find(p=>p.key===e)??yo[0]}var Ya={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function rr(e){if(e.is_notice)return du(e.status);if(e.is_bug&&e.completed){let p=Ss(e.resolution)||"\uC644\uB8CC";return{...Ya,name:p}}return e.completed&&e.status!=="hold"?Ya:e.is_bug?lg(e.status):Cs(e.status)}var ag={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function Bi(e){return Ga(e)?ag:null}var Ti=[{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 du(e){return Ti.find(p=>p.key===e)??Ti[1]}var Xa="__closed__",xo=[{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"}],K8=[...xo.filter(e=>e.key!=="bug_hold"),{key:Xa,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...xo.filter(e=>e.key==="bug_hold")];function lg(e){return xo.find(p=>p.key===e)??xo[0]}function Bs(e){return e.is_notice?Ti:e.is_bug?xo:Ci}function G8(e){return e.status===Yc}var cg={in_progress:0,not_started:2,hold:3};function Y8(e){return e.completed?9:cg[String(e.status??"")]??2}function Uo(e,p){let b=new Map(p.map(i=>[i.key,i])),c=(e.label_keys??[]).map(i=>b.get(i)).filter(i=>!!i);if(e.is_event){let i=Bi({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return i?[i,...c]:c}return e.is_notice?String(e.status??"")==="notice_active"?c:[du(e.status),...c]:e.is_bug?[rr({...e,is_notice:!1}),...c]:e.completed?[Ya,...c]:[Cs(e.status),...c]}function hu(e){return{bg:`${e}1f`,fg:e,dot:e}}function Is(e,p){return e.includes(p)?e.filter(b=>b!==p):[...e,p]}import{Box as Ms}from"@mui/material";import{jsx as Ii,jsxs as ug}from"react/jsx-runtime";function Et({option:e,small:p=!1}){let b=nt(),c=b.mode==="dark",i=e.key==="not_started";return ug(Ms,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:p?.5:.75,px:i?0:p?.9:1.25,py:i?0:p?.25:.5,borderRadius:1.25,fontSize:p?11.5:13,fontWeight:500,bgcolor:i?"transparent":c?Wo(e.dot,b.chip.darkBgAlpha):e.bg,color:i?c?b.chip.plainColor:e.fg:c?b.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[Ii(Ms,{component:"span",sx:{width:p?6:8,height:p?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function tS({task:e,statusOptions:p,small:b=!1}){let c=Uo(e,p);return c.length===0?null:Ii(Ms,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:c.map(i=>Ii(Et,{option:i,small:b},i.key))})}function Qn({labelKeys:e,labelOptions:p}){let b=new Map(p.map(i=>[i.key,i])),c=e.map(i=>b.get(i)).filter(i=>!!i);return c.length===0?null:Ii(Ms,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:c.map(i=>Ii(Et,{option:i,small:!0},i.key))})}import{jsx as Za,jsxs as pg}from"react/jsx-runtime";function Vo({anchorEl:e,value:p,options:b=yo,onSelect:c,onClose:i}){let a=sn();return Za(fg,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...a,children:b.map(r=>pg(dg,{onClick:()=>{c(r.key),i()},sx:{fontSize:14,minWidth:150,gap:1},children:[Za(Et,{option:r}),p===r.key?Za(hg,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},r.key))})}function Ja(e){let p=String(e??"").trim().replace("T"," "),b=p.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return b?new Date(Number(b[1]),Number(b[2])-1,Number(b[3]),Number(b[4]??0),Number(b[5]??0),Number(b[6]??0)):new Date(p)}function nr(e,p="YYYY-MM-DD"){let b=typeof e=="string"?Ja(e):e;if(!e||e===""||isNaN(b.getTime()))return"";let c=b.getFullYear(),i=(b.getMonth()+1).toString().padStart(2,"0"),a=b.getDate().toString().padStart(2,"0"),r=c.toString().slice(-2);switch(p){case"YYYY-MM-DD":return`${c}-${i}-${a}`;case"YY.MM.DD":return`${r}.${i}.${a}`;case"MM/DD/YYYY":return`${i}/${a}/${c}`;case"DD.MM.YYYY":return`${a}.${i}.${c}`;case"YYYYMMDD":return`${c}${i}${a}`;default:return p.replace(/YYYY/g,c.toString()).replace(/YY/g,r).replace(/MM/g,i).replace(/DD/g,a)}}function pu(){return nr(new Date)}var Qa=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uC77C\uC2DC"},{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 mg(e){let p=new Date(`${e}T00:00:00`);return p.setDate(p.getDate()+(6-p.getDay())),nr(p)}var gg=[{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 bg(e,p,b){let c=e.due_date.slice(0,10);return c?c<p?"overdue":c===p?"today":c<=b?"this_week":"later":"no_due"}function el(e,p,b,c=[],i=[],a="",r){let t=e.filter(f=>f.is_notice);if(t.length>0){let f=el(e.filter(d=>!d.is_notice),p,b,c,i,a,r);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:t},...f]}let n=new Map,l=(f,d)=>{let u=n.get(f);u?u.push(d):n.set(f,[d])},o;if(p==="due"){let f=mg(b);for(let d of e)l(bg(d,b,f),d);o=gg}else if(p==="status"){for(let f of e)l(Cs(f.status).key,f);o=yo.map(f=>({key:f.key,label:f.name}))}else if(p==="tab"){for(let f of e)l(f.tab_key?.trim()||"__none__",f);o=[...c.filter(f=>!f.archived).map(f=>({key:f.key,label:f.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...c.filter(f=>f.archived).map(f=>({key:f.key,label:`${f.label} (\uBCF4\uAD00\uB428)`}))]}else if(r?.enabled){let f=Number(r.myAccountSeq??0),d=a.trim();for(let u of e){if(!(Number(u.manager_account_seq??0)>0||String(u.manager_name??"").trim()!=="")){l("__none__",u);continue}let m=f>0&&Number(u.manager_account_seq??0)===f||!!d&&String(u.manager_name??"").trim()===d;l(m?"__manager__":"__reference__",u)}o=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let m of e)l(String(m.manager_name??"").trim()||"__none__",m);let f=a.trim(),d=[...n.keys()].filter(m=>m!=="__none__").sort((m,v)=>{if(f){if(m===f)return-1;if(v===f)return 1}return m.localeCompare(v)}),u=!!f&&d.includes(f),g=d.filter(m=>m!==f);o=[...u?[{key:f,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...g.map(m=>({key:m,label:m}))]}let s=[];for(let f of o){let d=n.get(f.key);!d||d.length===0||s.push({key:f.key,label:f.label,tasks:d})}return s}import yg from"@mui/icons-material/NotesOutlined";import xg from"@mui/icons-material/AutorenewOutlined";import vg from"@mui/icons-material/CalendarTodayOutlined";import wg from"@mui/icons-material/EventOutlined";import _g from"@mui/icons-material/PersonOutlineOutlined";import gu from"@mui/icons-material/PeopleAltOutlined";import nl from"@mui/icons-material/CheckCircleOutlineOutlined";import kg from"@mui/icons-material/FlagOutlined";import Sg from"@mui/icons-material/AccessTimeOutlined";import Tg from"@mui/icons-material/StickyNote2Outlined";import Cg from"@mui/icons-material/ViewKanbanOutlined";import Bg from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as gr}from"react/jsx-runtime";var Ig={completed:"50px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"132px",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 bu(e){return ol(e).map(p=>Ig[p.id]).join(" ")}var Mg={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:gr(Sg,{sx:{fontSize:15}}),align:"center",sortable:!0},Eg={id:"ticket_no",label:"\uD2F0\uCF13",icon:gr(Bg,{sx:{fontSize:15}}),align:"center"},Rg={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:gr(Cg,{sx:{fontSize:15}}),projectFilter:!0},Ag={id:"targets",label:"\uB300\uC0C1\uC790",icon:gr(gu,{sx:{fontSize:15}})},mu={id:"priority",label:"\uC911\uC694\uB3C4",icon:gr(kg,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},Og={id:"ack",label:"\uD655\uC778",icon:gr(nl,{sx:{fontSize:15}}),align:"center",ackFilter:!0},Dg={id:"confirm",label:"\uD655\uC778",icon:gr(nl,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function tl(e){let p=e.findIndex(c=>c.id==="receiver_names"||c.id==="targets"),b=p>=0?p+1:e.findIndex(c=>c.id==="note");return b<0?[...e,mu]:[...e.slice(0,b),mu,...e.slice(b)]}function ol(e){let{showProject:p=!1,showManager:b=!0,showActions:c=!0,showRequest:i=!0,notice:a=!1,bug:r=!1,confirmMode:t="none"}=e??{},n=s=>{if(!r)return s;let f=s.filter(g=>g.id!=="note"),d=f.findIndex(g=>g.id==="completed"),u=d>=0?d+1:0;return[...f.slice(0,u),Eg,...f.slice(u)]};if(a)return n(tl(rl.filter(s=>!["manager_name","receiver_names","request"].includes(s.id)).flatMap(s=>s.id==="due_date"?[s,Ag]:s.id==="note"?[Og,s]:[s])));let l=b?rl:rl.filter(s=>s.id!=="manager_name");if(c)i||(l=l.filter(s=>s.id!=="request"));else{l=l.filter(f=>f.id!=="request");let s=l.findIndex(f=>f.id==="note");l=[...l.slice(0,s),Mg,...l.slice(s)]}if(t==="action"){let s=l.findIndex(f=>f.id==="note");l=[...l.slice(0,s),Dg,...l.slice(s)]}if(!p)return n(tl(l));let o=l.findIndex(s=>s.id==="receiver_names");return n(tl([...l.slice(0,o+1),Rg,...l.slice(o+1)]))}var rl=[{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:gr(yg,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:gr(xg,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC",icon:gr(vg,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC",icon:gr(wg,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:gr(_g,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:gr(gu,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:gr(nl,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:gr(Tg,{sx:{fontSize:15}})}];import{Button as yu,ClickAwayListener as jg,Dialog as Lg,Paper as Fg,Popper as zg,Typography as qg,Box as $g}from"@mui/material";import{useMediaQuery as Pg,useTheme as Ng}from"@mui/material";function Bt(){let{isMobile:e}=Br(),p=Ng(),b=Pg(p.breakpoints.up("lg"));return e!==void 0?e:!b}import{Fragment as Wg,jsx as eo,jsxs as vu}from"react/jsx-runtime";function xu(){if(typeof document>"u")return;let e=0,p=c=>{c.stopPropagation(),c.preventDefault(),b()},b=()=>{window.clearTimeout(e),document.removeEventListener("click",p,!0)};document.addEventListener("click",p,!0),e=window.setTimeout(b,350)}function Hg({title:e,content:p,confirmText:b,cancelText:c,titleFontSize:i,actionFontSize:a,actionMinHeight:r,onCancel:t,onConfirm:n}){return vu(Wg,{children:[eo(qg,{component:"div",sx:{fontSize:i,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),p,vu($g,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[eo(yu,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{xu(),t()},fullWidth:!0,sx:{fontSize:a,minHeight:r,fontWeight:700},children:c}),eo(yu,{size:"medium",variant:"contained",color:"primary",onClick:()=>{xu(),n()},fullWidth:!0,sx:{fontSize:a,minHeight:r,fontWeight:700},children:b})]})]})}function It({open:e,anchorEl:p,title:b="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:c,confirmText:i="\uD655\uC778",cancelText:a="\uCDE8\uC18C",placement:r="top",minWidth:t=160,minHeight:n,titleFontSize:l=17,actionFontSize:o=16,actionMinHeight:s=44,zIndex:f=1300,onCancel:d,onConfirm:u}){let g=Bt(),m=eo(Hg,{title:b,content:c,confirmText:i,cancelText:a,titleFontSize:l,actionFontSize:o,actionMinHeight:s,onCancel:d,onConfirm:u});return g?eo(Lg,{open:e,onClose:d,sx:{zIndex:f},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:m}):eo(zg,{open:e,anchorEl:p,placement:r,sx:{zIndex:f},children:eo(jg,{onClickAway:d,children:eo(Fg,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:t,minHeight:n,justifyContent:n?"space-between":"flex-start"},onClick:v=>v.stopPropagation(),onMouseDown:v=>v.stopPropagation(),children:m})})})}import{memo as pb}from"react";function Wr(e){let p=e.visibility;return p==="involved"||p==="group"||p==="all"?p:e.is_open?"all":"involved"}function Es(e,p,b=0){if(p<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===p)return!0;let a=(e.target_account_seqs??[]).filter(r=>r>0);return a.length===0||a.includes(p)}if((e.author_account_seq??0)===p||(e.manager_account_seq??0)===p||(e.receiver_account_seqs??[]).includes(p))return!0;let i=Wr(e);if(i==="all")return!0;if(i==="group"){let a=e.visibility_group_seq??0;return a>0&&b===a}return!1}function wu(e){return e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)!==0?!1:Wr(e)!=="involved"}function Rs(e,p){return p<=0||(e.author_account_seq??0)===p?!1:wu(e)}function As(e,p){return p<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||(e.author_account_seq??0)===p||wu(e)?!1:(e.receiver_account_seqs??[]).includes(p)}function _u(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function ku(e,p){if(p<=0)return!1;let b=(e.author_account_seq??0)===p;return e.is_notice?b:b||(e.manager_account_seq??0)===p}function Bn(e,p){return p<=0?!1:e.is_notice?(e.author_account_seq??0)===p:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p||(e.receiver_account_seqs??[]).includes(p)}var NS=[119,121,141,143];import{memo as ob,useEffect as ib,useRef as sb,useState as Ru}from"react";import{Box as _t,Button as ab,Checkbox as lb,Tooltip as js}from"@mui/material";import cb from"@mui/icons-material/PublicOutlined";import ub from"@mui/icons-material/Group";import fb from"@mui/icons-material/CheckCircle";import db from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as Ug,useState as Su}from"react";import{Avatar as Tu,Box as Vg}from"@mui/material";import Kg from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Os}from"react/jsx-runtime";var il=new Set,Cu=e=>e.startsWith("data:")||e.startsWith("blob:");function Gg(e){let p=e.trim();return p?([...p][0]??"").toUpperCase():""}function Nr({src:e,name:p="",avatarSx:b,iconFontSize:c=40}){let[i,a]=Su(()=>e?Cu(e)||il.has(e):!1),[r,t]=Su(!1),n={position:"relative",overflow:"hidden",borderRadius:"15px"},l=b?[n,...Array.isArray(b)?b:[b]]:n;if(Ug(()=>{t(!1),a(e?Cu(e)||il.has(e):!1)},[e]),!e||r){let o=Gg(p);return Os(Tu,{sx:l,children:o?Os(Vg,{component:"span",sx:{fontSize:"inherit",fontWeight:600,lineHeight:1,userSelect:"none"},children:o}):Os(Kg,{sx:{fontSize:c}})})}return Os(Tu,{src:e,imgProps:{onLoad:()=>{il.add(e),a(!0)},onError:()=>t(!0),style:i?void 0:{opacity:0}},sx:l})}var Yg=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ds=(e,p)=>{if(!p||!p.trim())return[{text:e,highlight:!1}];try{let b=Yg(p.trim()),c=new RegExp(`(${b})`,"gi");return e.split(c).map(a=>a.toLowerCase()===p.trim().toLowerCase()?{text:a,highlight:!0}:{text:a,highlight:!1}).filter(a=>a.text)}catch{return[{text:e,highlight:!1}]}};var Xg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function jr(e){let p=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(p))return"";let b=new Date(`${p}T00:00:00`);return Number.isNaN(b.getTime())?"":`${p.slice(2).replaceAll("-",".")} (${Xg[b.getDay()]})`}function Mr(e){let p=String(e??"").trim(),[b,c=""]=p.split(" "),i=jr(b);return i?c?`${i} ${c.slice(0,5)}`:i:""}function Ko(e){let p=e.checklist??[];return p.length===0?"":`${p.filter(c=>c.checked).length}/${p.length}`}import{Box as Bu,Tooltip as Zg}from"@mui/material";import{jsx as Ps}from"react/jsx-runtime";var Go=[{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 br({names:e,size:p=22,ringFirst:b=!1,avatarSrcByName:c}){let i=nt();return Ps(Bu,{sx:{display:"flex",alignItems:"center"},children:e.map((a,r)=>{let t=b&&r===0;return Ps(Zg,{title:t?`\uCC45\uC784\uC790 \xB7 ${a}`:a,arrow:!0,children:Ps(Bu,{sx:{ml:r===0?0:"-7px",zIndex:r,borderRadius:"50%",border:`2px solid ${t?i.avatar.ringColor:i.avatar.separatorColor}`,display:"inline-flex",...i.avatar.sx},children:Ps(Nr,{src:c?.get(a)??"",name:a,avatarSx:{width:p,height:p,fontSize:Math.round(p/2),borderRadius:"50%",...Go[r%Go.length]},iconFontSize:Math.round(p*.6)})})},`${a}-${r}`)})})}import{Box as Iu,Button as Eu}from"@mui/material";import Jg from"@mui/icons-material/CheckCircle";import{Fragment as tb,jsx as Mi,jsxs as Mu}from"react/jsx-runtime";function Qg(e){let p=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,gap:.5,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:p?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:p?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function eb(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 an({onClick:e,children:p,fullWidth:b=!1,sx:c}){let i=nt();return Mi(Eu,{size:"small",variant:"contained",color:"inherit",fullWidth:b,sx:[eb(i),...Array.isArray(c)?c:c?[c]:[]],onClick:a=>{a.stopPropagation(),e(a)},children:p})}function Yo({canConfirm:e,count:p,total:b,myConfirmed:c=!1,onConfirm:i,onShowList:a}){let r=nt(),t=Qg(r);return e?Mi(an,{onClick:()=>i(),children:"\uD655\uC778"}):Mu(Eu,{size:"small",variant:"outlined",color:"inherit",sx:t,onClick:n=>{n.stopPropagation(),a(n.currentTarget)},children:[c?Mi(Jg,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,Mi(Iu,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:b>0&&p>=b?"\uD655\uC778\uC644\uB8CC":Mu(tb,{children:[p,Mi(Iu,{component:"span",sx:{mx:.15},children:"/"}),b]})})]})}import{SvgIcon as rb}from"@mui/material";import{jsx as Ns,jsxs as nb}from"react/jsx-runtime";function to({sx:e,...p}){return nb(rb,{viewBox:"0 0 48 48",...p,sx:{fill:"none",...e},children:[Ns("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"}),Ns("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Ns("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Ns("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as Du,jsx as We,jsxs as Ei}from"react/jsx-runtime";function sl(e){let p=String(e??"").trim();if(!p)return"-";let b=p.slice(2,10).replaceAll("-","."),c=p.slice(11,16);return/^\d{2}:\d{2}$/.test(c)?`${b} ${c}`:b}function hb(e){let p=String(e.event_time??"").trim();return e.is_event&&/^\d{2}:\d{2}$/.test(p)?sl(`${String(e.due_date??"").slice(0,10)} ${p}`):sl(e.due_date)}function al(e,p){let b=String(e??"").trim()||"-";return Ds(b,p).map((c,i)=>We("span",{className:c.highlight?"font-semibold text-blue-600":void 0,children:c.text},`${c.text}-${i}`))}function Ls({names:e,searchText:p,avatarSrcByName:b,emphasize:c=!1}){let i=e.filter(a=>a.trim());if(i.length===0)return null;if(i.length===1){let a=i[0]??"";return Ei(Du,{children:[We(Nr,{src:b?.get(a)??"",name:a,avatarSx:{width:24,height:24,fontSize:12,borderRadius:"50%",...Go[0]},iconFontSize:15}),We(_t,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...c?{fontWeight:500,color:"#2f80ed"}:{}},children:al(a,p)})]})}return We(br,{names:i,size:22,avatarSrcByName:b})}function Au({display:e,summary:p,searchText:b,avatarSrcByName:c}){if(!e||e.kind==="everyone")return We(_t,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:i,individualNames:a}=e;if(i.length===0)return We(Ls,{names:a,searchText:b,avatarSrcByName:c});let r=[...i,...a],t=r.join(", ");return r.length>2?We(js,{title:t,arrow:!0,children:We(_t,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${r[0]}, ${r[1]} \uC678 ${r.length-2}\uBA85`})}):We(js,{title:t,arrow:!0,children:Ei(_t,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[We(_t,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.join(", ")+(a.length>0?",":"")}),a.length>0?We(Ls,{names:a,searchText:b,avatarSrcByName:c}):null]})})}var Ou=ob(function({task:p,gridTemplate:b,statusOptions:c,avatarSrcByName:i,searchText:a,myAccountSeq:r=0,todayStr:t,showProject:n=!1,showManager:l=!0,showActions:o=!0,showRequest:s=!0,confirmMode:f="none",bugMode:d=!1,confirmInfo:u,onConfirmTask:g,projectLabel:m="",projectIcon:v="",onProjectClick:k,onRequestToggleCompleted:B,onDateClick:O,onChangeNote:L,onMemberClick:R,onClaimClick:P,onVolunteerClick:j,onStatusClick:z,onOpenDetail:N,onTaskContextMenu:S,hideBottomBorder:C=!1,completeLocked:E=!1,unread:h=!1,notice:y=!1,noticeReadOnly:w=!1,noteLocked:x=!1,targetSummary:_="",targetDisplay:T,onArchiveTask:D,ackInfo:q,onAckConfirm:$,onAckListClick:W,onPriorityClick:A}){let[H,M]=Ru(!1),[I,F]=Ru(""),U=sb(null);ib(()=>{if(!H)return;let se=be=>{let ye=U.current;ye&&(be.target instanceof Node&&ye.contains(be.target)||ye.blur())};return document.addEventListener("mousedown",se,!0),document.addEventListener("touchstart",se,!0),()=>{document.removeEventListener("mousedown",se,!0),document.removeEventListener("touchstart",se,!0)}},[H]);let X=[p.manager_account_seq??0,...p.receiver_account_seqs??[]].some(se=>se>0&&se!==(p.author_account_seq??0)),V=w,G=r>0&&!p.is_notice&&!p.is_event&&(p.manager_account_seq??0)===r,ee=V||!!p.is_notice,Z=nt(),K=!!P&&Rs(p,r),Q=!!j&&As(p,r),J=ee&&!_u(p),ne=p.is_notice?We(Yo,{canConfirm:!!q?.canAck,count:q?.count??0,total:q?.total??0,myConfirmed:!!q?.acked,onConfirm:()=>$?.(p),onShowList:se=>W?.(p,se)}):null,ie=!p.is_notice&&!p.completed&&!!p.due_date&&p.due_date.slice(0,10)<=t,le=Ko(p),re=p.completed?Z.colors.textPrimary:ie?"#e5484d":"#2f80ed";return Ei(_t,{onContextMenu:se=>S(p,se),sx:{display:"grid",gridTemplateColumns:b,minHeight:48,position:"relative",fontSize:15,bgcolor:Z.table.rowBg,color:Z.table.rowColor,borderBottom:C?"none":`1px solid ${Z.table.rowBorderColor}`,"&:hover":{bgcolor:Z.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${Z.table.rowBorderColor}`},"& > .cell:first-of-type":{px:1.5},"& > .cell:last-of-type":{borderRight:"none",pr:2}},children:[We(_t,{className:"cell",sx:{justifyContent:"center"},children:p.is_event?(()=>{let se=bt(p.icon||tr);return se?We(se,{sx:{fontSize:19,color:p.icon_color||"#1e3a8a"}}):null})():!V&&!E?We(js,{title:p.completed&&p.completed_by?`${p.completed_by} \xB7 ${Mr(p.completed_time)} \uC644\uB8CC`:p.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:We(lb,{checked:p.completed,icon:We(db,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:We(fb,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:se=>se.stopPropagation(),onChange:(se,be)=>B({anchorEl:se.currentTarget,task:p,nextCompleted:be}),sx:{p:.5}})}):null}),d?We(_t,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:p.ticket_no||"-"}):null,Ei(_t,{className:"cell",onClick:()=>N(p),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}},children:[(()=>{if(!p.is_notice)return null;let se=bt(p.icon||Kt);return se?We(se,{sx:{fontSize:18,flexShrink:0,color:p.icon_color||"#e5484d"}}):null})(),(()=>{if(p.is_notice)return null;let se=Wr(p);return se==="involved"?null:We(js,{title:se==="all"?"\uC804\uCCB4\uACF5\uAC1C \u2014 \uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4":"\uBD80\uC11C\uACF5\uAC1C \u2014 \uC9C0\uC815\uD55C \uBD80\uC11C\uC758 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",arrow:!0,disableInteractive:!0,children:se==="all"?We(cb,{sx:{fontSize:15,flexShrink:0,color:"#2f80ed"}}):We(ub,{sx:{fontSize:15,flexShrink:0,color:"#d9730d"}})})})(),We(_t,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:p.completed?400:Z.table.rowTitleFontWeight,color:p.completed?Z.colors.textMuted:Z.table.rowTitleColor,textDecoration:p.completed?"line-through":"none"},children:al(p.title,a)}),le?We(_t,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:Z.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:le}):null,(p.comment_count??p.comments?.length??0)>0?We(to,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,We(_t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:We(Qn,{labelKeys:p.label_keys??[],labelOptions:c})}),h&&!p.completed?We(_t,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,Ts(p)&&!p.archived&&!V&&D?We(ab,{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:se=>{se.stopPropagation(),D(p)},children:"\uBCF4\uAD00"}):null]}),(()=>{let se=V||!!p.is_event||!!p.completed;return We(_t,{className:"cell",onClick:se?void 0:be=>z(p,be.currentTarget),sx:{py:.5,justifyContent:"center",...se?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:p.is_event?(()=>{let be=Bi(p);return be?We(Et,{option:be}):null})():We(Et,{option:rr(p)})})})(),We(_t,{className:"cell",onClick:V?void 0:se=>O(p,"start_date",se.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...V?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:sl(p.start_date)}),We(_t,{className:"cell",onClick:V?void 0:se=>O(p,"due_date",se.currentTarget),sx:{justifyContent:"center",color:re,fontWeight:500,whiteSpace:"nowrap",...V?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:p.due_date?hb(p):null}),y?We(_t,{className:"cell",onClick:V?void 0:()=>R(p,"targets"),sx:{gap:.75,...V?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:We(Au,{display:T,summary:_,searchText:a,avatarSrcByName:i})}):null,!y&&p.is_notice?We(_t,{className:"cell",onClick:V?void 0:()=>R(p,"targets"),sx:{gridColumn:l?"span 2":"auto",gap:.75,...V?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:We(Au,{display:T,summary:_,searchText:a,avatarSrcByName:i})}):null,!y&&!p.is_notice&&!p.is_event&&l?We(_t,{className:"cell",onClick:J?void 0:()=>R(p,"manager"),sx:{gap:.75,...K||Q?{justifyContent:"center"}:{},...J?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:K?We(an,{onClick:se=>P?.(p,se.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):Q?We(an,{onClick:se=>j?.(p,se.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):We(Ls,{names:p.manager_name?[p.manager_name]:[],searchText:a,avatarSrcByName:i,emphasize:G})}):null,!y&&!p.is_notice?We(_t,{className:"cell",onClick:ee?void 0:()=>R(p,"receivers"),sx:{gridColumn:p.is_event&&l?"span 2":"auto",gap:.75,...ee?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:We(Ls,{names:p.receiver_names,searchText:a,avatarSrcByName:i})}):null,We(_t,{className:"cell",onClick:V?void 0:se=>A?.(p,se.currentTarget),sx:{py:.5,justifyContent:"center",...V?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:We(Ir,{priority:p.priority,plain:!0})}),n?We(_t,{className:"cell",onClick:V?void 0:se=>k?.(p,se.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...V?{}:{cursor:"pointer","&:hover":{bgcolor:Z.table.cellHoverBg}}},children:m?Ei(Du,{children:[(()=>{let se=bt(v);return se?We(se,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),We(_t,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]}):null}):null,y?We(_t,{className:"cell",sx:{justifyContent:"center"},children:ne}):null,!y&&o&&s?We(_t,{className:"cell",sx:{justifyContent:"center"},children:p.is_notice?ne:X?We(Yo,{canConfirm:!!u?.canConfirm,count:u?.count??0,total:u?.total??0,myConfirmed:!!u?.myTime,onConfirm:()=>g?.(p),onShowList:se=>W?.(p,se)}):null}):null,!y&&f==="action"?We(_t,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:Z.table.rowSubColor},children:p.is_notice?ne:u&&u.total>0?We(Yo,{canConfirm:!!u.canConfirm,count:u.count,total:u.total,myConfirmed:!!u.myTime,onConfirm:()=>g?.(p),onShowList:se=>W?.(p,se)}):"-"}):null,!y&&!o?We(_t,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:Z.table.rowSubColor},children:p.completed_time||"-"}):null,d?null:We(_t,{className:"cell",onClick:()=>{!x&&!H&&(F(p.note),M(!0))},sx:{color:"#6f6f6c",cursor:x?"default":"text"},children:H?We(_t,{component:"input",ref:U,autoFocus:!0,spellCheck:!1,value:I,onChange:se=>F(se.target.value),onBlur:()=>{M(!1),I.trim()!==p.note&&L(p.seq,I)},onKeyDown:se=>{se.key==="Enter"&&se.target.blur(),se.key==="Escape"&&(F(p.note),M(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:Z.table.rowTitleColor,caretColor:Z.table.rowTitleColor,p:0,m:0}}):We(_t,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.note?al(p.note,a):""})}),G?We(_t,{component:"span",sx:{position:"absolute",left:3,top:6,bottom:6,width:3,bgcolor:"#2f80ed",borderRadius:1.5,pointerEvents:"none"}}):null]})});import{jsx as mb}from"react/jsx-runtime";var Pu=pb(function(p){let c=(p.useTaskItem?p.useTaskItem(p.task.seq):void 0)??p.task,{myAccountSeq:i}=p,a=p.projectByKey.get(c.tab_key??"");return mb(Ou,{hideBottomBorder:p.hideBottomBorder,gridTemplate:p.gridTemplate,task:c,statusOptions:p.statusOptions,avatarSrcByName:p.avatarSrcByName,searchText:p.searchText,myAccountSeq:i,todayStr:p.todayStr,showProject:p.showProject,showManager:p.showManager,showActions:p.showActions,showRequest:p.showRequest,confirmMode:p.confirmMode,confirmInfo:c.is_notice?void 0:p.getConfirmInfo?.(c),onConfirmTask:p.onConfirmTask,projectLabel:a?.label??"",projectIcon:a?.icon??"",onProjectClick:p.onProjectClick,onRequestReply:p.onRequestReply,onRequestToggleCompleted:p.onRequestToggleCompleted,onDateClick:p.onDateClick,onChangeNote:p.onChangeNote,onMemberClick:p.onMemberClick,onClaimClick:p.onClaimClick,onVolunteerClick:p.onVolunteerClick,onStatusClick:p.onStatusClick,onOpenDetail:p.onOpenDetail,onTaskContextMenu:p.onTaskContextMenu,notice:p.notice,bugMode:p.bugMode,noticeReadOnly:!Bn(c,i),noteLocked:c.is_notice?!Es(c,i):!Bn(c,i),completeLocked:c.is_event?!0:c.is_notice?(c.author_account_seq??0)!==i:(c.author_account_seq??0)!==i&&(c.manager_account_seq??0)!==i,targetSummary:c.is_notice?p.getTargetSummary?.(c):void 0,targetDisplay:c.is_notice?p.getTargetDisplay?.(c):void 0,onArchiveTask:p.onArchiveTask,unread:p.isTaskUnread?.(c)??!1,ackInfo:c.is_notice?p.getAckInfo?.(c):void 0,onAckConfirm:p.onAckConfirm,onAckListClick:p.onAckListClick,onPriorityClick:p.onPriorityClick})});import{useMemo as Nu,useState as ll}from"react";import{Box as vo,Button as ju,ButtonBase as Lu,Dialog as yb,Divider as cl,Menu as xb,MenuItem as vb,Popover as wb}from"@mui/material";import Fu from"@mui/icons-material/ChevronRight";import _b from"@mui/icons-material/Check";import kb from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as Sb,TimePicker as Tb}from"@ehfuse/mui-datetime-picker";import Cb from"@mui/icons-material/TimerOutlined";import{useEffect as gb,useState as bb}from"react";function ln(e){let{loadHolidays:p}=Br(),[b,c]=bb(()=>new Map),i=e.join(",");return gb(()=>{if(!p||!i){c(new Map);return}let a=!1;return p(i.split(",").map(Number)).then(r=>{if(a)return;let t=new Map;for(let n of r)t.has(n.date)||t.set(n.date,n.name);c(t)}).catch(()=>{}),()=>{a=!0}},[p,i]),b}import{Fragment as zu,jsx as ur,jsxs as Ur}from"react/jsx-runtime";var Bb=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],qu=[{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"}],$u=[{value:"none",label:"\uC5C6\uC74C"},...Bb,...qu];function ul(e){return e?$u:[{value:"none",label:"\uC5C6\uC74C"},...qu]}function fl(e){return e==="same_day"?"\uB2F9\uC77C":$u.find(p=>p.value===e)?.label??"\uC5C6\uC74C"}function Ib(e){let p=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(p.getTime())?new Date:p}function Lr({anchorEl:e,open:p,date:b,reminder:c,hideReminder:i=!1,showTime:a=!1,centered:r=!1,onClose:t,onDateChange:n,onReminderChange:l}){let[o,s]=ll(null),[f,d]=ll(null),u=sn(),g=String(b??"").trim().slice(0,10),m=String(b??"").trim().slice(11,16),v=/^\d{2}:\d{2}$/.test(m)?m:"",k=(z,N)=>n(N?`${z} ${N}`:z),[B,O]=ll(()=>{let z=Number(g.slice(0,4));return Number.isFinite(z)&&z>1900?z:new Date().getFullYear()}),L=Nu(()=>[B-1,B,B+1],[B]),R=ln(L),P=Nu(()=>{let z=[];for(let N of R.keys()){let S=new Date(`${N}T00:00:00`);Number.isNaN(S.getTime())||z.push(S)}return z},[R]),j=Ur(vo,{sx:{width:300,maxWidth:"100%"},children:[ur(vo,{sx:{height:320},children:ur(Sb,{selectedDate:Ib(g),onSelect:z=>{k(nr(z),v),a||t()},onClose:t,showFooter:!1,autoApply:!0,holidays:P,onYearChange:z=>O(z),onMonthChange:(z,N)=>{typeof N=="number"&&O(N)}})}),a?Ur(zu,{children:[ur(cl,{sx:{borderColor:"#e6e6e3"}}),Ur(Lu,{onClick:z=>d(z.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Ur(vo,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[ur(Cb,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC2DC\uAC01"]}),Ur(vo,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[v||"\uC5C6\uC74C",ur(Fu,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),ur(Tb,{anchorEl:f,open:!!f,onClose:()=>d(null),centered:r,value:{hour:v.slice(0,2)||"09",minute:v.slice(3,5)||"00"},format:"HH:mm",minuteStep:5,autoApply:!0,locale:"ko",onChange:(z,N)=>{k(g||nr(new Date),`${z}:${N}`),d(null)}})]}):null,i?null:Ur(zu,{children:[ur(cl,{sx:{borderColor:"#e6e6e3"}}),Ur(Lu,{onClick:z=>s(z.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Ur(vo,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[ur(kb,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC0AC\uC804\uC54C\uB9BC"]}),Ur(vo,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[fl(c),ur(Fu,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),ur(xb,{transitionDuration:0,anchorEl:o,open:!!o,onClose:()=>s(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...u,children:ul(!!v).map(z=>Ur(vb,{selected:z.value===c,onClick:()=>{l(z.value),s(null)},sx:{fontSize:14,minWidth:120,justifyContent:"space-between",gap:1},children:[z.label,z.value===c?ur(_b,{sx:{fontSize:16,color:"#2f80ed"}}):null]},z.value))})]}),ur(cl,{sx:{borderColor:"#e6e6e3"}}),Ur(vo,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[ur(ju,{size:"small",onClick:()=>{k(nr(new Date),v),t()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),ur(ju,{size:"small",onClick:t,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return r?ur(yb,{open:p,onClose:t,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:j}):ur(wb,{transitionDuration:0,open:p,anchorEl:e,onClose:t,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:j})}import{useEffect as Rb,useState as hl}from"react";import{Box as wo,Button as Ab,Switch as Ob}from"@mui/material";import{FormDialog as Db}from"@ehfuse/mui-form-dialog";import{ClearTextField as Pb}from"@ehfuse/mui-form-controls";import{ErrorAlert as Nb}from"@ehfuse/alerts";import{Box as Mb,ButtonBase as Eb}from"@mui/material";import{jsx as dl}from"react/jsx-runtime";function Fs({value:e,onChange:p}){return dl(Mb,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:za.map(({key:b,Icon:c})=>{let i=b===e;return dl(Eb,{onClick:()=>p(b),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:i?"2px solid #2563eb":"1px solid #dedddb",bgcolor:i?"#eef4ff":"#fff",color:i?"#1e3a8a":"#787774","&:hover":{bgcolor:i?"#eef4ff":"#f4f4f2"}},children:dl(c,{sx:{fontSize:20}})},b)})})}import{jsx as In,jsxs as pl}from"react/jsx-runtime";function zs({open:e,title:p="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:b="",initialIcon:c=Fa,confirmText:i="\uCD94\uAC00",initialUseSprints:a=!1,onClose:r,onSubmit:t}){let[n,l]=hl(""),[o,s]=hl(Fa),[f,d]=hl(!1);Rb(()=>{e&&(l(b),s(c),d(a))},[e]);let u=()=>{let m=n.trim();if(!m){Nb("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(m,o,f),r()};return In(Db,{open:e,onClose:r,maxWidth:"xs",title:p,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:pl(wo,{children:[In(Pb,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:n,onChange:m=>l(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),u())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),In(wo,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),In(wo,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:In(Fs,{value:o,onChange:s})}),pl(wo,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[pl(wo,{children:[In(wo,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),In(wo,{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)"})]}),In(Ob,{checked:f,onChange:(m,v)=>d(v)})]})]})}],actions:{showCancelButton:!0,right:In(Ab,{variant:"contained",onClick:u,children:i})}})}import{jsx as pt,jsxs as Vr}from"react/jsx-runtime";var Uu=48,Yb=5;function Vu({tasks:e,statusOptions:p,avatarSrcByName:b,searchText:c,todayStr:i,sortBy:a,sortDirection:r,onSort:t,onRequestReply:n,onToggleCompleted:l,onChangeTaskDate:o,onChangeTaskReminder:s,groupBy:f,collapsedGroupKeys:d,customTabs:u,onToggleGroup:g,hideCompleted:m=!1,onAddInGroup:v,canAddInGroup:k,renderGroupSummary:B,renderGroupTitleSummary:O,onChangeTaskProject:L,onAddProject:R,onChangeNote:P,onMemberClick:j,onClaimTask:z,onChangeTaskStatus:N,onOpenDetail:S,onTaskContextMenu:C,onMemberFilterClick:E,activeMemberFilters:h=[],onStatusFilterClick:y,statusFilterActive:w=!1,onAckFilterClick:x,ackFilterActive:_=!1,onProjectFilterClick:T,projectFilterActive:D=!1,onPriorityFilterClick:q,priorityFilterActive:$=!1,columns:W,getConfirmInfo:A,onConfirmTask:H,myAccountSeq:M=0,currentUserName:I="",groupManagerByMyRole:F=!1,allowManagerVolunteer:U=!0,noticeAdmin:X=!1,getTargetSummary:V,getTargetDisplay:G,onArchiveTask:ee,isTaskUnread:Z,getAckInfo:K,onAckConfirm:Q,onAckListClick:J,onChangeTaskPriority:ne,onEndReached:ie,useTaskItem:le}){let re=nt(),se=cn(()=>({showManager:!0,showActions:!0,showRequest:!0,...W}),[W]),be=se.showManager??!0,ye=se.showActions??!0,Fe=se.showRequest??!0,Ce=se.confirmMode??"none",ae=se.notice??!1,De=se.bug??!1,Be=f!=="none",ke=cn(()=>Be?el(e,f,i,u,p,I,{enabled:F,myAccountSeq:M}):[],[Be,e,f,i,u,p,I,F,M]),Re=cn(()=>m?e.filter(oe=>!oe.completed):e,[e,m]),we=cn(()=>Re.filter(oe=>oe.completed||oe.archived?!1:oe.is_notice?!!K?.(oe).canAck:!!A?.(oe).canConfirm),[Re,K,A]),ve=cn(()=>new Set(we.map(oe=>oe.seq)),[we]),Ze=cn(()=>ke.map(oe=>({section:oe,visibleTasks:oe.tasks.filter(pe=>!ve.has(pe.seq)&&(!m||!pe.completed))})).filter(oe=>oe.visibleTasks.length>0),[ke,m,ve]),Se=cn(()=>new Set(d),[d]),de=cn(()=>{let oe=[];if(Be)for(let{section:pe,visibleTasks:Te}of Ze){let tt=Se.has(pe.key);if(oe.push({kind:"header",section:pe,visibleTasks:Te,collapsed:tt}),!tt)for(let Ke of Te)oe.push({kind:"task",task:Ke,last:!1})}else for(let pe of Re)ve.has(pe.seq)||oe.push({kind:"task",task:pe,last:!1});for(let pe=oe.length-1;pe>=0;pe-=1){let Te=oe[pe];if(Te.kind==="task"){Te.last=!0;break}}return oe},[Be,Ze,Re,Se,ve]),Ee=se.showProject??(!ae&&f!=="tab"),_e=cn(()=>ol({...se,showProject:Ee}),[se,Ee]),Ie=bu({...se,showProject:Ee}),ot=cn(()=>{let oe=new Map;for(let pe of u)oe.set(pe.key,{label:pe.archived?`${pe.label} (\uBCF4\uAD00\uB428)`:pe.label,icon:pe.icon});return oe},[u]),Le=jb(null),[Ae,vt]=En(null),ze=Re.length>0;qs(()=>{if(!ze){vt(null);return}let oe=window.requestAnimationFrame(()=>{vt(Le.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(oe)},[ze]);let qe=`${f}|${a}|${r}|${c}|${m?1:0}`;qs(()=>{Ae&&(Ae.scrollTop=0)},[qe,Ae]);let[dt,Ue]=En(!1);qs(()=>{if(!Ae)return;let oe=()=>Ue(Ae.scrollHeight>Ae.clientHeight);oe();let pe=new ResizeObserver(oe);return pe.observe(Ae),Ae.firstElementChild&&pe.observe(Ae.firstElementChild),()=>pe.disconnect()},[Ae]),qs(()=>{if(!Ae)return;let oe=Ae.clientHeight,pe=new ResizeObserver(()=>{let Te=Ae.clientHeight;Te!==oe&&(oe=Te,Ae.dispatchEvent(new Event("scroll")))});return pe.observe(Ae),()=>pe.disconnect()},[Ae]);let[Oe,Ft]=En(null),[He,te]=En(null),[ue,fe]=En(null),[me,Je]=En(null),[Me,Ne]=En(!1),[ht,je]=En(null),Pe=ht?e.find(oe=>oe.seq===ht.taskSeq)??null:null,[ft,rt]=En(null),et=ft?e.find(oe=>oe.seq===ft.taskSeq)??null:null,yt=Mn((oe,pe)=>{rt({anchorEl:pe,taskSeq:oe.seq})},[]),lt=Mn((oe,pe)=>{je({anchorEl:pe,taskSeq:oe.seq})},[]),mt=Mn((oe,pe)=>{if(!pe)return;t(oe,a===oe&&r==="asc"?"desc":"asc")},[t,a,r]),er=Mn((oe,pe,Te)=>{Ft({anchorEl:Te,taskSeq:oe.seq,field:pe,date:oe[pe],isEvent:!!oe.is_event,reminder:oe.reminder,completed:oe.completed})},[]),Nt=Mn((oe,pe)=>{Je({anchorEl:pe,task:oe})},[]),Ut=Mn(oe=>{Oe&&(o(Oe.taskSeq,Oe.field,oe),Ft(pe=>pe&&{...pe,date:oe}))},[Oe,o]),Y=Mn(oe=>{Oe&&(s(Oe.taskSeq,oe),Ft(pe=>pe&&{...pe,reminder:oe}))},[Oe,s]),ce=Mn((oe,pe)=>{fe({anchorEl:pe,taskSeq:oe.seq,title:oe.title,kind:"claim"})},[]),ge=Mn((oe,pe)=>{fe({anchorEl:pe,taskSeq:oe.seq,title:oe.title,kind:"volunteer"})},[]),he=(oe,pe)=>pt(Pu,{task:oe,hideBottomBorder:pe,gridTemplate:Ie,useTaskItem:le,statusOptions:p,avatarSrcByName:b,searchText:c,myAccountSeq:M,todayStr:i,showProject:Ee,showManager:be,showActions:ye,showRequest:Fe,confirmMode:Ce,notice:ae,bugMode:De,projectByKey:ot,getConfirmInfo:A,onConfirmTask:H,onProjectClick:Nt,onRequestReply:n,onRequestToggleCompleted:te,onDateClick:er,onChangeNote:P,onMemberClick:j,onClaimClick:z?ce:void 0,onVolunteerClick:U?ge:void 0,onStatusClick:lt,onOpenDetail:S,onTaskContextMenu:C,onPriorityClick:yt,getTargetSummary:V,getTargetDisplay:G,getAckInfo:K,isTaskUnread:Z,onArchiveTask:ee,onAckConfirm:Q,onAckListClick:J},oe.seq);return Vr(yr,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${re.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:re.table.bg,color:re.table.rowColor,...re.table.sx},children:[pt(yr,{sx:{display:"grid",gridTemplateColumns:Ie,borderBottom:`1px solid ${re.table.borderColor}`,flexShrink:0,bgcolor:re.table.headerBg,"& > *":{borderRight:`1px solid ${re.table.rowBorderColor}`},"& > *:first-of-type":{px:1.5},"& > *:last-child":{borderRight:"none",pr:2},...re.table.headerSx},children:_e.map(oe=>{let pe=a===oe.id,Te=!!oe.memberFilter,tt=Te&&h.includes(oe.memberFilter),Ke=Te||!!oe.statusFilter||!!oe.ackFilter||!!oe.projectFilter||!!oe.priorityFilter,Ve=tt||!!oe.statusFilter&&w||!!oe.ackFilter&&_||!!oe.projectFilter&&D||!!oe.priorityFilter&&$;return Vr(yr,{onClick:Ye=>{oe.memberFilter?E(oe.memberFilter,Ye.currentTarget):oe.statusFilter?y(Ye.currentTarget):oe.ackFilter?x?.(Ye.currentTarget):oe.projectFilter?T?.(Ye.currentTarget):oe.priorityFilter?q?.(Ye.currentTarget):mt(oe.id,oe.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:oe.align==="center"?"center":"flex-start",gap:.5,px:1,py:1,minWidth:0,fontSize:re.table.headerFontSize,color:oe.sortable||Ke?re.table.headerActiveColor:re.table.headerColor,whiteSpace:"nowrap",cursor:oe.sortable||Ke?"pointer":"default",userSelect:"none",...pe?{color:re.table.headerFilteredColor}:{},...Ve?{color:re.table.headerFilteredColor,fontWeight:600}:{}},children:[oe.icon,oe.label,Ve?pt(Ub,{sx:{fontSize:14}}):null,pe?r==="asc"?pt(qb,{sx:{fontSize:13}}):pt($b,{sx:{fontSize:13}}):null]},oe.id)})}),we.length>0?Vr(yr,{sx:{flexShrink:0,maxHeight:`${re.table.groupHeader.minHeight+1+Uu*Yb}px`,overflowY:"auto",borderBottom:"1px solid #000"},children:[Vr(yr,{sx:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:re.table.groupHeader.minHeight,bgcolor:"#fdf3f2",borderBottom:"1px solid #f2d7d4"},children:[pt(yr,{component:"span",sx:{fontSize:re.table.groupHeader.labelFontSize,fontWeight:re.table.groupHeader.labelFontWeight,color:re.table.groupHeader.labelColor},children:"\uBBF8\uD655\uC778"}),pt(yr,{sx:{ml:"auto",display:"flex",alignItems:"center",pr:.5},children:pt(yr,{component:"span",sx:{flexShrink:0,width:re.table.groupHeader.badge.width,py:re.table.groupHeader.badge.paddingY,borderRadius:`${re.table.groupHeader.badge.borderRadius}px`,bgcolor:"#e5484d",color:"#fff",fontSize:re.table.groupHeader.badge.fontSize,fontWeight:re.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:we.length})})]}),we.map((oe,pe)=>he(oe,pe===we.length-1))]}):null,Re.length===0?pt(yr,{sx:{py:8,textAlign:"center",color:re.table.emptyColor,fontSize:14},children:e.length>0?`\uC644\uB8CC\uB41C \uC5C5\uBB34 ${e.length}\uAC74\uC774 "\uC644\uB8CC \uC228\uAE30\uAE30"\uB85C \uAC10\uCDB0\uC838 \uC788\uC2B5\uB2C8\uB2E4.`:De?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":ae?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):pt(yr,{sx:{flex:1,minHeight:0},children:pt(Gb,{ref:Le,style:{height:"100%"},thumb:{width:8},scrollTopFab:!0,children:Ae?pt(Kb,{customScrollParent:Ae,data:de,computeItemKey:(oe,pe)=>pe.kind==="header"?`group:${pe.section.key}`:pe.task.seq,endReached:Be?void 0:ie,defaultItemHeight:Uu,increaseViewportBy:{top:600,bottom:600},itemContent:(oe,pe)=>{if(pe.kind==="task")return he(pe.task,pe.last&&dt);let{section:Te,visibleTasks:tt,collapsed:Ke}=pe;return Vr(yr,{onClick:()=>g(Te.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:re.table.groupHeader.minHeight,bgcolor:re.table.groupHeader.bg,borderBottom:`1px solid ${re.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:re.table.groupHeader.hoverBg},...re.table.groupHeader.sx},children:[Ke?pt(Wb,{sx:{fontSize:20,color:re.colors.textMuted}}):pt(Hb,{sx:{fontSize:20,color:re.colors.textMuted}}),pt(yr,{component:"span",sx:{fontSize:re.table.groupHeader.labelFontSize,fontWeight:re.table.groupHeader.labelFontWeight,color:re.table.groupHeader.labelColor},children:Te.label}),O?pt(yr,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:O(Te.key,Te.tasks)}):null,v&&(!k||k(Te.key))?pt(Fb,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:Ve=>{Ve.stopPropagation(),v(Te.key,Te.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:re.colors.textSecondary,"&:hover":{bgcolor:re.colors.surfaceHover,color:re.colors.accentOnSurface}},children:pt(Wu,{sx:{fontSize:21}})}):null,Vr(yr,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[B?B(Te.key,Te.tasks):null,pt(yr,{component:"span",sx:{flexShrink:0,width:re.table.groupHeader.badge.width,py:re.table.groupHeader.badge.paddingY,borderRadius:`${re.table.groupHeader.badge.borderRadius}px`,bgcolor:re.table.groupHeader.badge.bg,border:re.table.groupHeader.badge.border,color:re.table.groupHeader.badge.color,fontSize:re.table.groupHeader.badge.fontSize,fontWeight:re.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:tt.length})]})]})}},qe):null})}),pt(Vo,{anchorEl:ht?.anchorEl??null,value:Pe?.status??"",options:Pe?Bs(Pe):Ci,onSelect:oe=>{Pe&&N(Pe.seq,oe)},onClose:()=>je(null)}),pt(Hu,{transitionDuration:0,anchorEl:ft?.anchorEl??null,open:!!ft,onClose:()=>rt(null),children:["high","medium","low"].map(oe=>Vr($s,{selected:et?.priority===oe,onClick:()=>{et&&ne?.(et.seq,oe),rt(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[pt(Ir,{priority:oe,small:!0}),et?.priority===oe?pt(ml,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe))}),Vr(Hu,{anchorEl:me?.anchorEl??null,open:!!me,onClose:()=>Je(null),transitionDuration:0,children:[Vr($s,{selected:!me?.task.tab_key,onClick:()=>{me&&L(me.task.seq,""),Je(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[pt(Vb,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",me?.task.tab_key?null:pt(ml,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),u.filter(oe=>!oe.archived).map(oe=>{let pe=bt(oe.icon),Te=me?.task.tab_key===oe.key;return Vr($s,{selected:Te,onClick:()=>{me&&L(me.task.seq,oe.key),Je(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[pe?pt(pe,{sx:{fontSize:17,color:"#1e3a8a"}}):null,oe.label,Te?pt(ml,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.key)}),R?[pt(Lb,{},"add-project-divider"),Vr($s,{onClick:()=>Ne(!0),sx:{fontSize:14,color:"#787774"},children:[pt(zb,{children:pt(Wu,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),R?pt(zs,{open:Me,onClose:()=>Ne(!1),onSubmit:(oe,pe)=>{let Te=me?.task.seq??0;(async()=>{let tt=await R(oe,pe);tt&&Te&&L(Te,tt)})(),Je(null)}}):null,pt(Lr,{anchorEl:Oe?.anchorEl??null,open:!!Oe&&Oe?.field==="start_date",date:Oe?.date??"",reminder:"none",hideReminder:!0,showTime:!Oe?.isEvent,onClose:()=>Ft(null),onDateChange:Ut,onReminderChange:()=>{}}),pt(Lr,{anchorEl:Oe?.anchorEl??null,open:!!Oe&&Oe?.field==="due_date",date:Oe?.date??"",showTime:!Oe?.isEvent,reminder:Oe?.reminder??"none",hideReminder:!!Oe?.completed,onClose:()=>Ft(null),onDateChange:Ut,onReminderChange:Y}),pt(It,{open:!!ue,anchorEl:ue?.anchorEl??null,title:ue?.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:()=>fe(null),onConfirm:()=>{ue&&z?.(ue.taskSeq),fe(null)}}),pt(It,{open:!!He,anchorEl:He?.anchorEl??null,title:He?.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:He?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>te(null),onConfirm:()=>{He&&l(He.task,He.nextCompleted),te(null)}})]})}import{useCallback as dn,useMemo as An,useRef as b1,useState as On}from"react";import{Box as Mt,ButtonBase as af,Divider as Xu,IconButton as Zu,Menu as Ju,MenuItem as ro}from"@mui/material";import xl from"@mui/icons-material/Add";import Qu from"@mui/icons-material/MoreVert";import ef from"@mui/icons-material/EditOutlined";import tf from"@mui/icons-material/ArchiveOutlined";import rf from"@mui/icons-material/UnarchiveOutlined";import y1 from"@mui/icons-material/NotificationsOutlined";import x1 from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as Xb}from"@mui/material";import{jsx as Ku}from"react/jsx-runtime";function un({sx:e,...p}){return Ku(Xb,{viewBox:"0 0 24 24",...p,sx:{fill:"none",...e},children:Ku("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 v1,DragOverlay as w1,PointerSensor as _1,pointerWithin as k1,rectIntersection as S1,useDroppable as T1,useSensor as C1,useSensors as B1}from"@dnd-kit/core";import{SortableContext as lf,arrayMove as nf,horizontalListSortingStrategy as I1,useSortable as M1,verticalListSortingStrategy as E1}from"@dnd-kit/sortable";import{CSS as R1}from"@dnd-kit/utilities";import vl from"@ehfuse/overlay-scrollbar";import{useState as n1}from"react";import{Box as Rn,ButtonBase as o1,Checkbox as i1,Tooltip as s1}from"@mui/material";import a1 from"@mui/icons-material/AlarmOutlined";import l1 from"@mui/icons-material/TimerOutlined";import{Box as Kr,Button as Zb,Popover as Jb}from"@mui/material";import Qb from"@mui/icons-material/CheckCircle";import{Fragment as e1,jsx as fn,jsxs as _o}from"react/jsx-runtime";function Hs({anchorEl:e,open:p,acks:b,total:c,avatarSrcByName:i,pendingNames:a=[],onRequestConfirm:r,onClose:t}){let n=Bt();return fn(Jb,{open:p&&(n||!!e),anchorEl:e,onClose:t,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...n?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:_o(Kr,{sx:{minWidth:240,maxWidth:320,py:1},children:[_o(Kr,{sx:{px:2,pb:.75,fontSize:ar(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",b.length,"/",c]}),a.length>0&&b.length>0?_o(Kr,{sx:{px:2,pt:1,pb:.5,fontSize:ar(12.5),fontWeight:600,color:"#9a9a97"},children:["\uD655\uC778 ",b.length]}):null,b.length===0?a.length>0?null:fn(Kr,{sx:{px:2,py:1.5,fontSize:ar(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(l=>_o(Kr,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[fn(br,{names:[l.name],size:22,avatarSrcByName:i}),fn(Kr,{component:"span",sx:{fontSize:ar(14),color:"#37352f",whiteSpace:"nowrap"},children:l.name}),fn(Kr,{component:"span",sx:{ml:"auto",fontSize:ar(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:Mr(l.time)}),fn(Qb,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},l.account_seq)),a.length>0?_o(e1,{children:[_o(Kr,{sx:{mt:b.length>0?.75:0,px:2,pt:1,pb:.5,borderTop:b.length>0?"1px solid #efefed":"none",fontSize:ar(12.5),fontWeight:600,color:"#9a9a97"},children:["\uBBF8\uD655\uC778 ",a.length]}),a.map(l=>_o(Kr,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[fn(br,{names:[l],size:22,avatarSrcByName:i}),fn(Kr,{component:"span",sx:{fontSize:ar(14),color:"#37352f",whiteSpace:"nowrap"},children:l})]},l))]}):null,r?fn(Kr,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:fn(Zb,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{r(),t()},sx:{fontSize:ar(13)},children:"\uD655\uC778 \uC694\uCCAD"})}):null]})})}function t1(e){let p=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(b=>b>0&&b!==p))]}function r1(e){let p=new Map,b=Number(e.manager_account_seq??0);b>0&&p.set(b,String(e.manager_name??"").trim());let c=e.receiver_account_seqs??[],i=e.receiver_names??[];return c.forEach((a,r)=>{a>0&&!p.has(a)&&p.set(a,String(i[r]??"").trim())}),p}function Ws(e,p){let b=t1(e),c=e.acks??[],i=p>0?c.find(t=>t.account_seq===p):void 0,a=new Set(c.map(t=>t.account_seq)),r=r1(e);return{myTime:i?.time??"",canConfirm:p>0&&b.includes(p)&&!i,count:c.filter(t=>b.includes(t.account_seq)).length,total:b.length,pendingNames:b.filter(t=>!a.has(t)).map(t=>r.get(t)??"").filter(t=>t.length>0)}}function H7(e){let p=String(e??"").trim();return p?p.slice(5,16).replaceAll("-","."):""}import{Fragment as f1,jsx as xr,jsxs as ko}from"react/jsx-runtime";function Us(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 c1(e){let p=e.trim();return p?p.slice(2,10).replaceAll("-","."):"-"}function u1(){let e=new Date,p=String(e.getMonth()+1).padStart(2,"0"),b=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${p}-${b}`}function Ri({task:e,statusOptions:p,showDueDate:b=!1,onRequestArchiveToggle:c,onRequestReply:i,onDueDateClick:a,titleFontSize:r=13}){let t=nt(),n=Ko(e),o=!!e.due_date&&e.due_date.slice(0,10)<=u1()?t.colors.danger:t.colors.accentOnSurface,s=Ws(e,0),[f,d]=n1(null),u=Uo(e,p),g=new Set(e.label_keys??[]),m=u.filter(k=>!g.has(k.key)),v=u.filter(k=>g.has(k.key));return ko(f1,{children:[ko(Rn,{sx:{display:"flex",alignItems:"center",gap:.5},children:[xr(i1,{size:"small",checked:e.completed,onPointerDown:k=>k.stopPropagation(),onClick:k=>k.stopPropagation(),onChange:(k,B)=>c?.({anchorEl:k.currentTarget,taskSeq:e.seq,nextCompleted:B}),sx:{p:0}}),xr(s1,{title:e.title,arrow:!0,enterDelay:300,children:ko(Rn,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:r,fontWeight:t.mode==="dark"||e.completed?400:500,color:t.mode==="dark"?t.colors.textStrong:t.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]})}),n?xr(Rn,{component:"span",sx:{flexShrink:0,fontSize:12.5,color:t.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:n}):null,(e.comment_count??e.comments?.length??0)>0?xr(to,{sx:{fontSize:15,flexShrink:0,color:t.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?xr(Rn,{sx:{pl:3,mt:-.5,fontSize:12.5,color:t.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,ko(Rn,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[ko(Rn,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[m.map(k=>xr(Et,{option:k,small:!0},k.key)),xr(Ir,{priority:e.priority,small:!0}),v.map(k=>xr(Et,{option:k,small:!0},k.key))]}),b&&String(e.due_date??"").trim()?ko(o1,{disabled:!a,onPointerDown:k=>k.stopPropagation(),onClick:k=>{k.stopPropagation(),a?.(e,k.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:o,whiteSpace:"nowrap","&:hover":a?{bgcolor:t.colors.border}:void 0},children:[c1(e.due_date),xr(a1,{sx:{fontSize:15}})]}):null]}),b&&(e.due_date.slice(11,16)||e.estimated_time)?ko(Rn,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:t.colors.textSecondary},children:[xr(l1,{sx:{fontSize:14}}),e.due_date.slice(11,16)||e.estimated_time]}):null,xr(br,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),s.total>0?xr(Rn,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:xr(Rn,{sx:{flexShrink:0,width:64},onPointerDown:k=>k.stopPropagation(),onClick:k=>k.stopPropagation(),children:xr(Yo,{canConfirm:!1,count:s.count,total:s.total,onConfirm:()=>{},onShowList:k=>d(k)})})}):null,xr(Hs,{anchorEl:f,open:!!f,acks:e.acks??[],total:s.total,pendingNames:s.pendingNames,onRequestConfirm:i&&s.count<s.total?()=>{i(e),d(null)}:void 0,onClose:()=>d(null)})]})}import{Box as d1}from"@mui/material";import{useSortable as h1}from"@dnd-kit/sortable";import{CSS as p1}from"@dnd-kit/utilities";import{jsx as Gu}from"react/jsx-runtime";function m1(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function Yu({task:e,statusOptions:p,variant:b="card",showDueDate:c=!1,onRequestArchiveToggle:i,onRequestReply:a,onDueDateClick:r,onCardClick:t,onCardContextMenu:n,titleFontSize:l}){let o=nt(),{attributes:s,listeners:f,setNodeRef:d,transform:u,transition:g,isDragging:m}=h1({id:String(e.seq)}),v=b==="list";return Gu(d1,{ref:d,...s,...f,onClick:t?()=>t(e):void 0,onContextMenu:n?k=>n(e,k):void 0,sx:{...v?m1(o.card):Us(o.card),opacity:m?.35:e.completed?.55:1,transform:p1.Translate.toString(u),transition:g,position:"relative",cursor:"default",touchAction:"none","&:hover":v?{bgcolor:o.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:Gu(Ri,{task:e,statusOptions:p,showDueDate:c,onRequestArchiveToggle:i,onRequestReply:a,onDueDateClick:r,titleFontSize:l})})}function g1(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function Fr(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let p=g1(e.end_date);return p?`${e.name} (~${p})`:e.name}import{jsx as Ge,jsxs as Ot}from"react/jsx-runtime";var of=2,Vs="group-",zr="colmove-",gl="__default__",bl=Xa,yl="__other__",Ks="sprint-",sf=`${Ks}0`,A1={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function cf(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 O1({column:e,tasks:p,statusOptions:b,onRequestArchiveToggle:c,onRequestReply:i,onDueDateClick:a,onAddTask:r,canAdd:t,onOpenMenu:n,onCardClick:l,onCardContextMenu:o,grow:s,summary:f,onOpenSprintMenu:d}){let u=nt(),{setNodeRef:g,isOver:m}=T1({id:`${Vs}${e.key}`}),{attributes:v,listeners:k,setNodeRef:B,transform:O,transition:L,isDragging:R}=M1({id:`${zr}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return Ot(Mt,{ref:P=>{g(P),B(P)},sx:{flex:s?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:P=>P.shadows[1],bgcolor:m?u.colors.accentSoft:u.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:R1.Translate.toString(O),...L?{transition:`${L}, background-color 0.15s`}:{},opacity:R?.6:1},children:[Ot(Mt,{...v,...k,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${u.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?Ge(Mt,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let P=bt(e.icon);return P?Ge(P,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Ge(Mt,{component:"span",sx:{fontSize:u.board.columnHeaderFontSize,fontWeight:700,color:u.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),Ge(Mt,{component:"span",sx:{...cf(u.board.badge),ml:"auto"},children:p.length}),e.sprint&&d?Ge(Zu,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>d(P.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:Ge(Qu,{sx:{fontSize:18}})}):e.locked?null:Ge(Zu,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:P=>P.stopPropagation(),onClick:P=>n({anchorEl:P.currentTarget,column:e}),sx:{color:"#9a9a97"},children:Ge(Qu,{sx:{fontSize:18}})})]}),f?Ge(Mt,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${u.card.borderColor}`,flexShrink:0},children:f}):null,Ge(Mt,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Ge(vl,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Ot(Mt,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[Ge(lf,{items:p.map(P=>String(P.seq)),strategy:E1,children:p.map(P=>Ge(Yu,{task:P,statusOptions:b,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:c,onRequestReply:i,onDueDateClick:a,onCardClick:l,onCardContextMenu:o},P.seq))}),p.length===0&&!t?Ge(Mt,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,p.length===0&&t?Ge(Mt,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:Ot(af,{className:"taskbox-board-add",onClick:()=>r(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${u.card.borderColor}`,bgcolor:u.card.bg,color:u.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:u.card.hoverBg}},children:[Ge(xl,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function wl({tasks:e,statusOptions:p,customTabs:b,mode:c="active",onToggleCompleted:i,onRequestReply:a,onChangeDueDate:r,onChangeReminder:t,onMoveTask:n,columnAxis:l="project",statusColumns:o=[],onMoveTaskStatus:s,sprintColumns:f=[],onMoveTaskSprint:d,onAddGroup:u,onAddTask:g,canAdd:m=!0,onRequestRename:v,onArchiveProject:k,onDeleteProject:B,onReorderProjects:O,onOpenDetail:L,onTaskContextMenu:R,hideCompleted:P=!1,renderColumnSummary:j,onEditSprint:z,onChangeSprintStatus:N,onRemoveSprint:S}){let C=nt(),[E,h]=On(null),[y,w]=On(null),[x,_]=On(null),[T,D]=On(null),[q,$]=On(null),[W,A]=On(null),[H,M]=On(null),[I,F]=On(null),[U,X]=On(null),V=b1(!1),G=An(()=>new Map(e.map(de=>[de.seq,de])),[e]),ee=An(()=>{let de=e.filter(Ee=>Ee.is_notice);return de.sort((Ee,_e)=>Ee.completed!==_e.completed?Ee.completed?1:-1:_e.seq-Ee.seq),de},[e]),Z=An(()=>b.filter(de=>!de.archived),[b]),K=An(()=>b.filter(de=>de.archived),[b]),Q=de=>({key:de.key,label:de.label,icon:de.icon,isDefault:!1,isArchived:de.archived}),J=An(()=>new Set(o.map(de=>de.key)),[o]),ne=An(()=>new Set(f.map(de=>de.seq)),[f]),ie=An(()=>{if(l==="sprint")return[{key:sf,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...f.map(de=>({key:`${Ks}${de.seq}`,label:Fr(de),icon:"",isDefault:!1,isArchived:!1,dot:A1[de.status],locked:!0,sprint:de}))];if(l==="status"){let de=o.map(Ee=>({key:Ee.key,label:Ee.name,icon:"",isDefault:!1,isArchived:!1,dot:Ee.dot,locked:!0}));return de.some(Ee=>Ee.key===bl)?de:[...de,{key:bl,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return c==="archived"?K.map(Q):[{key:gl,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...Z.map(Q)]},[l,o,f,c,Z,K]),le=B1(C1(_1,{activationConstraint:{distance:5}})),re=dn(de=>{let Ee=String(de.active.id).startsWith(zr),_e=k1(de),Ie=_e.length>0?_e:S1(de);if(Ee)return Ie.filter(Ae=>String(Ae.id).startsWith(zr));let ot=Ie.filter(Ae=>!String(Ae.id).startsWith(zr)),Le=ot.filter(Ae=>!String(Ae.id).startsWith(Vs));return Le.length>0?Le:ot},[]),se=An(()=>{let de=new Map;for(let Ee of e){if(Ee.is_notice)continue;let _e;if(l==="sprint"){let ot=Ee.sprint_seq??0;_e=ne.has(ot)?`${Ks}${ot}`:sf}else _e=l==="status"?Ee.completed?bl:J.has(String(Ee.status??""))?String(Ee.status??""):yl:Ee.tab_key?.trim()||gl;let Ie=de.get(_e);Ie?Ie.push(Ee):de.set(_e,[Ee])}for(let Ee of de.values())Ee.sort((_e,Ie)=>{if(_e.completed!==Ie.completed)return _e.completed?1:-1;let ot=(_e.group_sort_no??0)>0,Le=(Ie.group_sort_no??0)>0;return ot&&Le?(_e.group_sort_no??0)-(Ie.group_sort_no??0):ot!==Le?ot?-1:1:_e.due_date!==Ie.due_date?_e.due_date<Ie.due_date?-1:1:_e.seq-Ie.seq});return de},[e,l,J,ne]),be=An(()=>l!=="status"||(se.get(yl)??[]).length===0?ie:[...ie,{key:yl,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[l,ie,se]),ye=dn(de=>H?(H.get(de)??[]).map(Ee=>G.get(Ee)).filter(Ee=>!!Ee):se.get(de)??[],[H,G,se]),Fe=dn(de=>{let Ee=ye(de);return P?Ee.filter(_e=>!_e.completed):Ee},[ye,P]),Ce=dn(de=>{let Ee=String(de.active.id);if(Ee.startsWith(zr)){X(Ee.slice(zr.length));return}F(Number(Ee)),M(new Map(ie.map(_e=>[_e.key,(se.get(_e.key)??[]).map(Ie=>Ie.seq)])))},[ie,se]),ae=dn((de,Ee)=>{if(de.startsWith(Vs))return{key:de.slice(Vs.length),overSeq:null};let _e=Number(de);for(let[Ie,ot]of Ee)if(ot.includes(_e))return{key:Ie,overSeq:_e};return null},[]),De=dn(de=>{let{active:Ee,over:_e}=de;!_e||String(Ee.id).startsWith(zr)||M(Ie=>{if(!Ie)return Ie;let ot=Number(Ee.id),Le=ae(String(_e.id),Ie);if(!Le)return Ie;let Ae=[...Ie.entries()].find(([,dt])=>dt.includes(ot))?.[0];if(!Ae||Ae===Le.key)return Ie;let vt=new Map(Ie);vt.set(Ae,(vt.get(Ae)??[]).filter(dt=>dt!==ot));let ze=[...vt.get(Le.key)??[]],qe=ze.length;if(Le.overSeq!==null){let dt=ze.indexOf(Le.overSeq);dt!==-1&&(qe=dt)}return ze.splice(qe,0,ot),vt.set(Le.key,ze),vt})},[ae]),Be=dn(de=>{let Ee=String(de.active.id);if(Ee.startsWith(zr)){X(null);let qe=String(de.over?.id??"");if(!qe.startsWith(zr))return;let dt=Ee.slice(zr.length),Ue=qe.slice(zr.length);if(dt===Ue)return;let Oe=b.map(te=>te.key),Ft=Oe.indexOf(dt),He=Oe.indexOf(Ue);if(Ft===-1||He===-1)return;O(nf(Oe,Ft,He));return}let _e=H;if(M(null),F(null),V.current=!0,!_e||!de.over)return;let Ie=Number(Ee),ot=[..._e.entries()].find(([,qe])=>qe.includes(Ie));if(!ot)return;let[Le,Ae]=ot,vt=[...Ae],ze=ae(String(de.over.id),_e);if(ze&&ze.key===Le&&ze.overSeq!==null&&ze.overSeq!==Ie){let qe=vt.indexOf(Ie),dt=vt.indexOf(ze.overSeq);qe!==-1&&dt!==-1&&(vt=nf(vt,qe,dt))}if(l==="status"){s?.(Ie,Le);return}if(l==="sprint"){d?.(Ie,Number(Le.slice(Ks.length))||0);return}n(Ie,Le===gl?"":Le,vt)},[b,H,ae,n,O,l,s,d]),ke=dn(()=>{M(null),F(null),X(null),V.current=!0},[]),Re=dn(de=>{if(V.current){V.current=!1;return}L(de)},[L]),we=I!==null?G.get(I)??null:null,ve=U!==null?ie.find(de=>de.key===U)??null:null,Ze=dn((de,Ee)=>{A({anchorEl:Ee,taskSeq:de.seq,date:de.due_date,reminder:de.reminder})},[]),Se=y?.column??null;return Ot(Mt,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${C.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:of,bgcolor:C.colors.surfaceSubtle},children:[Ot(v1,{sensors:le,collisionDetection:re,onDragStart:Ce,onDragOver:De,onDragEnd:Be,onDragCancel:ke,children:[Ge(Mt,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:c==="archived"&&ie.length===0?Ge(Mt,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Ge(vl,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:Ot(Mt,{sx:{display:"flex",alignItems:"flex-start",gap:of,height:"100%",minWidth:"min-content",pb:.5},children:[c==="active"&&ee.length>0?Ot(Mt,{sx:{flex:l!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:de=>de.shadows[1],bgcolor:C.card.bg,overflow:"hidden"},children:[Ot(Mt,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${C.card.borderColor}`,flexShrink:0,minHeight:48},children:[Ge(y1,{sx:{fontSize:17,color:"#e8763a"}}),Ge(Mt,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:C.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),Ot(Mt,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",ee.length,")"]})]}),Ge(Mt,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Ge(vl,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Ge(Mt,{sx:{display:"flex",flexDirection:"column"},children:ee.map(de=>Ot(Mt,{onClick:()=>Re(de),onContextMenu:Ee=>R(de,Ee),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${C.card.borderColor}`,bgcolor:C.card.bg,cursor:"pointer","&:hover":{bgcolor:C.card.hoverBg}},children:[Ge(Ri,{task:de,statusOptions:p,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:h}),(()=>{let Ee=(de.target_names??[]).filter(Ie=>Ie.trim());if(Ee.length===0)return null;let _e=Ee.length>2?`${Ee[0]}, ${Ee[1]} \uC678 ${Ee.length-2}`:Ee.join(", ");return Ot(Mt,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[Ge(x1,{sx:{fontSize:14,flexShrink:0}}),Ge(Mt,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:_e})]})})()]},de.seq))})})})]}):null,Ge(lf,{items:Z.map(de=>`${zr}${de.key}`),strategy:I1,children:be.map(de=>Ge(O1,{column:de,tasks:Fe(de.key),summary:j?.(de.key,ye(de.key)),onOpenSprintMenu:z||N||S?(Ee,_e)=>_({anchorEl:Ee,sprint:_e}):void 0,statusOptions:p,onRequestArchiveToggle:h,onRequestReply:a,onDueDateClick:Ze,onAddTask:g,canAdd:m&&l==="project",onOpenMenu:w,onCardClick:Re,onCardContextMenu:R,grow:l!=="project"},de.key))}),c==="active"&&l==="project"?Ot(af,{onClick:u,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:[Ge(xl,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,c==="active"&&be.length===0&&ee.length===0?Ge(Mt,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:l==="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]})})}),Ge(w1,{children:we?Ge(Mt,{sx:{...Us,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Ge(Ri,{task:we,statusOptions:p,showDueDate:!0,titleFontSize:15})}):ve?Ot(Mt,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:C.card.bg,border:`1px solid ${C.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let de=bt(ve.icon);return de?Ge(de,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Ge(Mt,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:C.board.columnHeaderColor},children:ve.label}),Ge(Mt,{component:"span",sx:cf(C.board.badge),children:(se.get(ve.key)??[]).length})]}):null})]}),Ot(Ju,{transitionDuration:0,anchorEl:y?.anchorEl??null,open:!!y,onClose:()=>w(null),children:[Se&&!Se.isArchived&&m?Ot(ro,{onClick:()=>{Se&&g(Se.isDefault?"":Se.key),w(null)},sx:{fontSize:14,gap:1},children:[Ge(xl,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,Se&&!Se.isDefault&&!Se.isArchived?Ot(ro,{onClick:()=>{v(Se.key,Se.label,Se.icon),w(null)},sx:{fontSize:14,gap:1},children:[Ge(ef,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,Se&&!Se.isDefault&&!Se.isArchived?Ot(ro,{onClick:()=>{k(Se.key,!0),w(null)},sx:{fontSize:14,gap:1},children:[Ge(tf,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,Se&&Se.isArchived?Ot(ro,{onClick:()=>{k(Se.key,!1),w(null)},sx:{fontSize:14,gap:1},children:[Ge(rf,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,Se&&!Se.isDefault?Ge(Xu,{}):null,Se&&!Se.isDefault?Ot(ro,{onClick:()=>{y&&$(y),w(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Ge(un,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),Ot(Ju,{transitionDuration:0,anchorEl:x?.anchorEl??null,open:!!x,onClose:()=>_(null),children:[z?Ot(ro,{onClick:()=>{x&&z(x.sprint.seq),_(null)},sx:{fontSize:14,gap:1},children:[Ge(ef,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,N?Ot(ro,{onClick:()=>{x&&N(x.sprint.seq,x.sprint.status==="closed"?"active":"closed"),_(null)},sx:{fontSize:14,gap:1},children:[x?.sprint.status==="closed"?Ge(rf,{sx:{fontSize:18,color:"#787774"}}):Ge(tf,{sx:{fontSize:18,color:"#787774"}}),x?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,S?Ge(Xu,{}):null,S?Ot(ro,{onClick:()=>{x&&D(x),_(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Ge(un,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),Ge(It,{open:!!T,anchorEl:T?.anchorEl??null,title:`"${T?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>D(null),onConfirm:()=>{T&&S?.(T.sprint.seq),D(null)}}),Ge(Lr,{anchorEl:W?.anchorEl??null,open:!!W,date:W?.date??"",reminder:W?.reminder??"none",onClose:()=>A(null),onDateChange:de=>{W&&(r(W.taskSeq,de),A(Ee=>Ee&&{...Ee,date:de}))},onReminderChange:de=>{W&&(t(W.taskSeq,de),A(Ee=>Ee&&{...Ee,reminder:de}))}}),Ge(It,{open:!!q,anchorEl:q?.anchorEl??null,title:`"${q?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
30
+ \uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>$(null),onConfirm:()=>{q&&B(q.column.key),$(null)}}),Ge(It,{open:!!E,anchorEl:E?.anchorEl??null,title:E?.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:E?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>h(null),onConfirm:()=>{E&&i(E.taskSeq,E.nextCompleted),h(null)}})]})}import{useCallback as Pn,useMemo as Ai,useRef as df,useState as Oi}from"react";import{Box as Qt,Button as H1,ButtonBase as pf,IconButton as hf}from"@mui/material";import W1 from"@mui/icons-material/Add";import U1 from"@mui/icons-material/ChevronLeft";import V1 from"@mui/icons-material/ChevronRight";import K1 from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as G1}from"@ehfuse/mui-datetime-picker";import{DndContext as Y1,DragOverlay as X1,PointerSensor as Z1,pointerWithin as J1,rectIntersection as Q1,useDroppable as ey,useSensor as ty,useSensors as ry}from"@dnd-kit/core";import{SortableContext as ny,arrayMove as oy,useSortable as iy,verticalListSortingStrategy as sy}from"@dnd-kit/sortable";import{CSS as ay}from"@dnd-kit/utilities";import ly from"@ehfuse/overlay-scrollbar";function D1(e){let[p,b,c]=e.split("-").map(Number),i=new Date(Date.UTC(p,b-1,c+1)),a=r=>String(r).padStart(2,"0");return`${i.getUTCFullYear()}-${a(i.getUTCMonth()+1)}-${a(i.getUTCDate())}`}function Xo(e){let p=new Map;for(let b of e){let c=b.start_date;for(let i=0;i<62&&c<=b.end_date;i+=1){let a=p.get(c);a?a.push(b):p.set(c,[b]),c=D1(c)}}for(let b of p.values())b.sort((c,i)=>(c.time||"99:99").localeCompare(i.time||"99:99")||c.title.localeCompare(i.title));return p}function Zo(e){let p=String((e.is_event?e.event_time:e.due_date.slice(11,16)||e.estimated_time)??"").trim();return/^\d{1,2}:\d{2}$/.test(p)?p:""}function Jo(e,p){if(e.completed!==p.completed)return e.completed?1:-1;let b=Zo(e),c=Zo(p);if(!!b!=!!c)return b?-1:1;if(b&&c&&b!==c)return b<c?-1:1;let i=e.sort_no>0,a=p.sort_no>0;return i&&a?e.sort_no-p.sort_no:i!==a?i?-1:1:e.seq-p.seq}import{Box as _l,Tooltip as P1}from"@mui/material";import{jsx as kl,jsxs as N1}from"react/jsx-runtime";function Qo({event:e,small:p=!1}){let b=e.time?`${e.time} ${e.title}`:e.title,c=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",i=a=>{a.stopPropagation();let[r,t,n]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${r}/${t}/${n}`,"_blank")};return kl(P1,{title:`(${c}) ${b}`,arrow:!0,enterDelay:300,children:N1(_l,{onClick:i,onPointerDown:a=>a.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:p?.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:[kl(_l,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),kl(_l,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:b})]})})}import{useCallback as F1}from"react";import{Box as no,Checkbox as z1}from"@mui/material";import{useLayoutEffect as j1,useState as uf}from"react";var Tl=new WeakMap,Sl=null;function L1(){return typeof ResizeObserver>"u"?null:(Sl||(Sl=new ResizeObserver(e=>{for(let p of e){let b=Tl.get(p.target);if(!b)continue;let c=p.borderBoxSize?.[0]?.inlineSize??p.target.getBoundingClientRect().width;b(c)}})),Sl)}function ff(){let[e,p]=uf(null),[b,c]=uf(0);return j1(()=>{if(!e)return;c(e.getBoundingClientRect().width);let i=L1();if(i)return Tl.set(e,a=>c(r=>Math.abs(r-a)<1?r:a)),i.observe(e),()=>{i.unobserve(e),Tl.delete(e)}},[e]),{ref:p,width:b}}import{jsx as Dn,jsxs as Cl}from"react/jsx-runtime";var Bl={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"},ei=15,q1=150,$1=3;function oo({task:e,statusOptions:p,onOpenDetail:b,onContextMenu:c,isPreview:i=!1,isDragging:a=!1,isMine:r=!1,avatarSrcByName:t,showManagerAvatar:n=!1,onOpenMembers:l,setNodeRef:o,dragProps:s,trailing:f,showCheckbox:d=!1,onRequestToggleCompleted:u,showTime:g=!0,wrapTitle:m=!1}){let v=nt(),k=v.mode==="dark",[B]=Uo(e,p),O=String(e.manager_name??"").trim(),L=g?Zo(e):"",R=Ko(e),P=!e.completed&&!e.is_event&&!e.due_date.slice(0,10),j=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Kt:tr)):null,z=!e.completed&&!e.is_event&&!!e.due_date&&e.due_date.slice(0,10)<pu(),{ref:N,width:S}=ff(),C=S>0&&S<q1,E=C||m,h=F1(w=>{N(w),o?.(w)},[N,o]),y=n&&!r&&!C&&!!O;return Cl(no,{ref:h,...s??{},onClick:w=>{w.stopPropagation(),b(e)},onContextMenu:c?w=>c(e,w):void 0,sx:{display:"flex",alignItems:E?"flex-start":"center",gap:.5,py:.6,px:1,flexShrink:0,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:B?k?Wo(B.dot,v.chip.darkBgAlpha):B.bg:k?v.card.bg:v.colors.surfaceHover,color:B?k?v.chip.darkTextSource==="fg"?B.fg:B.dot:B.fg:v.colors.textPrimary,fontSize:ei,fontWeight:k||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:i?.5:a?.35:e.completed?.6:P?.75:1,border:i?`1px dashed ${v.colors.accent}`:"1px solid transparent",pointerEvents:i?"none":"auto",cursor:"pointer",touchAction:s?"none":"auto",overflow:"hidden","&:hover":{filter:"brightness(0.96)"},...z?{borderLeft:`3px solid ${v.colors.danger}`,pl:.75}:r?{borderLeft:"3px solid #2f80ed",pl:.75}:{}},children:[Dn(no,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,...E?{mt:"7px"}:{},bgcolor:Bl[e.priority]??v.colors.accentOnSurface}}),d&&!C&&u?Dn(z1,{size:"small",checked:e.completed,onPointerDown:w=>w.stopPropagation(),onClick:w=>w.stopPropagation(),onChange:(w,x)=>u({anchorEl:w.currentTarget,taskSeq:e.seq,nextCompleted:x}),sx:{p:0,flexShrink:0}}):null,j&&!C?Dn(j,{sx:{fontSize:15,flexShrink:0,opacity:.75,...E?{mt:"3px"}:{}}}):null,Cl(no,{sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",color:k?v.colors.textStrong:v.colors.textPrimary,...P&&!k?{color:v.colors.textSecondary}:{}},children:[C&&L?Dn(no,{component:"span",sx:{lineHeight:1.35,fontSize:ei-1,color:e.completed?v.colors.textPrimary:v.colors.danger},children:L}):null,Cl(no,{component:"span",sx:{minWidth:0,overflow:"hidden",...E?{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:$1,whiteSpace:"normal",overflowWrap:"anywhere",lineHeight:1.35}:{textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:[!C&&L?Dn(no,{component:"span",sx:{mr:.5,fontSize:ei-1,color:e.completed?v.colors.textPrimary:v.colors.danger},children:L}):null,e.title,!C&&R?Dn(no,{component:"span",sx:{ml:.5,fontSize:ei-2,color:v.colors.textMuted,fontVariantNumeric:"tabular-nums"},children:R}):null,!C&&(e.comment_count??e.comments?.length??0)>0?Dn(to,{sx:{fontSize:15,ml:.5,verticalAlign:"-2px",color:v.colors.textMuted}}):null]})]}),f??null,!f&&y?Dn(no,{component:"span",onClick:l?w=>{w.stopPropagation(),l(e)}:void 0,sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:Dn(Nr,{src:t?.get(O)??"",name:O,avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}import{jsx as kt,jsxs as Nn}from"react/jsx-runtime";var mf=36,cy=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ys="day-";function Il(e){let p=new Date(e);return p.setHours(0,0,0,0),p.setDate(p.getDate()-p.getDay()),p}function Gs(e,p){let b=new Date(e);return b.setDate(b.getDate()+p),b}function uy(e){let p=e[0],b=e[e.length-1];return p.getMonth()===b.getMonth()?`${p.getFullYear()}\uB144 ${p.getMonth()+1}\uC6D4`:p.getFullYear()===b.getFullYear()?`${p.getFullYear()}\uB144 ${p.getMonth()+1}\uC6D4 - ${b.getMonth()+1}\uC6D4`:`${p.getFullYear()}\uB144 ${p.getMonth()+1}\uC6D4 - ${b.getFullYear()}\uB144 ${b.getMonth()+1}\uC6D4`}function fy(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function dy({task:e,statusOptions:p,isMine:b,avatarSrcByName:c,onCardClick:i,onCardContextMenu:a,onRequestArchiveToggle:r,dragDisabled:t=!1}){let{attributes:n,listeners:l,setNodeRef:o,transform:s,transition:f,isDragging:d}=iy({id:String(e.seq),disabled:t});return kt(oo,{task:e,statusOptions:p,isMine:b,avatarSrcByName:c,showManagerAvatar:!0,wrapTitle:!0,onOpenDetail:u=>i?.(u),onContextMenu:a,showCheckbox:!0,onRequestToggleCompleted:r,isDragging:d,setNodeRef:o,dragProps:t?void 0:{...n,...l,style:{transform:ay.Translate.toString(s),transition:f}}})}function hy({dayKey:e,isToday:p,dayLabel:b,holidayName:c,tasks:i,googleEvents:a,statusOptions:r,onRequestArchiveToggle:t,onRequestReply:n,onAddSchedule:l,canAdd:o,onCardClick:s,onCardContextMenu:f,summary:d,myAccountSeq:u,avatarSrcByName:g,dragDisabled:m=!1}){let v=nt(),{setNodeRef:k}=ey({id:`${Ys}${e}`,disabled:m});return Nn(Qt,{ref:k,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:p?v.calendar.todayBg:v.calendar.cellBg},children:[Nn(Qt,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:mf,bgcolor:p?v.calendar.todayBg:v.calendar.dateBandBg,borderBottom:`1px solid ${v.calendar.borderColor}`,flexShrink:0},children:[c?kt(Qt,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:v.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c}):null,p?kt(Qt,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:v.colors.danger,color:v.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,kt(Qt,{component:"span",sx:{fontSize:13.5,fontWeight:p?700:400,color:c?v.colors.danger:v.mode==="dark"?v.colors.textStrong:v.colors.textPrimary,flexShrink:0},children:b})]}),d?kt(Qt,{sx:{px:1,py:1,borderBottom:`1px solid ${v.calendar.borderColor}`,flexShrink:0},children:d}):null,kt(Qt,{sx:{flex:1,minHeight:0,bgcolor:p?v.calendar.todayBg:v.colors.surfaceSubtle},children:kt(ly,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Nn(Qt,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[a.length>0?kt(Qt,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:a.map(B=>kt(Qo,{event:B},B.uid))}):null,kt(ny,{items:i.map(B=>String(B.seq)),strategy:sy,children:kt(Qt,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75},children:i.map(B=>kt(dy,{task:B,statusOptions:r,isMine:u>0&&Number(B.manager_account_seq??0)===u,avatarSrcByName:g,onCardClick:s,onCardContextMenu:f,onRequestArchiveToggle:t,dragDisabled:m},B.seq))})}),kt(Qt,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...o?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:Nn(pf,{className:"taskbox-add-schedule",onClick:()=>l(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${v.calendar.borderColor}`,bgcolor:v.calendar.cellBg,color:v.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:v.calendar.hoverBg}},children:[kt(W1,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function gf({tasks:e,googleEvents:p=[],statusOptions:b,fallbackToStartDate:c=!1,myAccountSeq:i=0,avatarSrcByName:a,todayStr:r,onToggleCompleted:t,onMoveTask:n,onRequestReply:l,onAddSchedule:o,canAdd:s=!0,disableDrag:f=!1,onOpenDetail:d,onTaskContextMenu:u,hideCompleted:g=!1,renderColumnSummary:m}){let v=nt(),[k,B]=Oi(()=>Il(new Date)),[O,L]=Oi(null),[R,P]=Oi(null),[j,z]=Oi(null),[N,S]=Oi(null),C=df(!1),E=Ai(()=>Array.from({length:7},(V,G)=>Gs(k,G)),[k]),h=Ai(()=>new Map(e.map(V=>[V.seq,V])),[e]),y=Ai(()=>[...new Set(E.map(V=>V.getFullYear()))],[E]),w=ln(y),x=ry(ty(Z1,{activationConstraint:{distance:5}})),_=Pn(V=>{let G=J1(V),ee=G.length>0?G:Q1(V),Z=ee.filter(K=>!String(K.id).startsWith(Ys));return Z.length>0?Z:ee},[]),T=Ai(()=>Xo(p),[p]),D=Ai(()=>{let V=new Map;for(let G of e){let ee=G.due_date.slice(0,10)||(c?G.start_date.slice(0,10)||String(G.created_time??"").slice(0,10):"");if(!ee)continue;let Z=V.get(ee);Z?Z.push(G):V.set(ee,[G])}for(let G of V.values())G.sort(Jo);return V},[e,c]),q=Pn(V=>j?(j.get(V)??[]).map(G=>h.get(G)).filter(G=>!!G):D.get(V)??[],[j,h,D]),$=Pn(V=>{let G=q(V);return g?G.filter(ee=>!ee.completed):G},[q,g]),W=Pn(V=>{S(Number(V.active.id)),z(new Map(E.map(G=>{let ee=nr(G);return[ee,(D.get(ee)??[]).map(Z=>Z.seq)]})))},[E,D]),A=Pn((V,G)=>{if(V.startsWith(Ys))return{day:V.slice(Ys.length),overSeq:null};let ee=Number(V);for(let[Z,K]of G)if(K.includes(ee))return{day:Z,overSeq:ee};return null},[]),H=Pn(V=>{let{active:G,over:ee}=V;ee&&z(Z=>{if(!Z)return Z;let K=Number(G.id),Q=A(String(ee.id),Z);if(!Q)return Z;let J=[...Z.entries()].find(([,re])=>re.includes(K))?.[0];if(!J||J===Q.day)return Z;let ne=new Map(Z);ne.set(J,(ne.get(J)??[]).filter(re=>re!==K));let ie=[...ne.get(Q.day)??[]],le=ie.length;if(Q.overSeq!==null){let re=ie.indexOf(Q.overSeq);re!==-1&&(le=re)}return ie.splice(le,0,K),ne.set(Q.day,ie),ne})},[A]),M=Pn(V=>{let{active:G,over:ee}=V,Z=j;if(z(null),S(null),C.current=!0,!Z||!ee)return;let K=Number(G.id),Q=[...Z.entries()].find(([,re])=>re.includes(K));if(!Q)return;let[J,ne]=Q,ie=[...ne],le=A(String(ee.id),Z);if(le&&le.day===J&&le.overSeq!==null&&le.overSeq!==K){let re=ie.indexOf(K),se=ie.indexOf(le.overSeq);re!==-1&&se!==-1&&(ie=oy(ie,re,se))}n(K,J,ie)},[j,n,A]),I=Pn(()=>{z(null),S(null),C.current=!0},[]),F=Pn(V=>{if(C.current){C.current=!1;return}d(V)},[d]),U=N!==null?h.get(N)??null:null,X=df(null);return Nn(Qt,{onTouchStart:V=>{let G=V.touches[0];X.current=G?{x:G.clientX,y:G.clientY}:null},onTouchEnd:V=>{let G=X.current;X.current=null;let ee=V.changedTouches[0];if(!G||!ee||N!==null)return;let Z=ee.clientX-G.x,K=ee.clientY-G.y;Math.abs(Z)<60||Math.abs(Z)<=Math.abs(K)||B(Gs(k,Z<0?7:-7))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${v.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[Nn(Qt,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:v.calendar.bg,borderBottom:`1px solid ${v.calendar.borderColor}`,flexShrink:0},children:[Nn(Qt,{sx:{display:"flex",alignItems:"center",gap:.25},children:[kt(hf,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>B(Gs(k,-7)),children:kt(U1,{sx:{fontSize:24,color:v.colors.textSecondary}})}),kt(H1,{size:"small",color:"inherit",onClick:()=>B(Il(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:v.mode==="dark"?400:500,color:v.mode==="dark"?v.colors.textStrong:v.colors.textPrimary},children:"\uC624\uB298"}),kt(hf,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>B(Gs(k,7)),children:kt(V1,{sx:{fontSize:24,color:v.colors.textSecondary}})})]}),Nn(pf,{onClick:V=>P(V.currentTarget),sx:{ml:"auto",display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:v.mode==="dark"?400:700,color:v.mode==="dark"?v.colors.textStrong:v.colors.textPrimary,"&:hover":{bgcolor:v.colors.surfaceHover}},children:[uy(E),kt(K1,{sx:{fontSize:18,color:v.colors.textMuted}})]})]}),kt(Qt,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:v.calendar.headerBg,borderBottom:`1px solid ${v.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${v.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:E.map(V=>{let G=V.getDay(),ee=w.has(nr(V));return kt(Qt,{sx:{height:mf,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:G===0||ee?v.colors.danger:G===6?v.colors.accentOnSurface:v.colors.textSecondary},children:cy[G]},nr(V))})}),kt(Qt,{sx:{flex:1,minHeight:0},children:Nn(Y1,{sensors:x,collisionDetection:_,onDragStart:W,onDragOver:H,onDragEnd:M,onDragCancel:I,children:[kt(Qt,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${v.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:E.map(V=>{let G=nr(V);return kt(hy,{dayKey:G,isToday:G===r,dayLabel:fy(V),holidayName:w.get(G)??"",summary:m?.(G,q(G)),tasks:$(G),googleEvents:T.get(G)??[],statusOptions:b,onRequestArchiveToggle:L,onRequestReply:l,onAddSchedule:o,canAdd:s,onCardClick:F,onCardContextMenu:u,myAccountSeq:i,avatarSrcByName:a,dragDisabled:f},G)})}),kt(X1,{children:U?kt(Qt,{sx:{boxShadow:"0 8px 20px rgba(0,0,0,0.18)",borderRadius:.75,cursor:"grabbing"},children:kt(oo,{task:U,statusOptions:b,onOpenDetail:()=>{},isMine:i>0&&Number(U.manager_account_seq??0)===i})}):null})]})}),kt(G1,{anchorEl:R,open:!!R,onClose:()=>P(null),selectedDate:k,onDateChange:V=>{B(Il(V)),P(null)}}),kt(It,{open:!!O,anchorEl:O?.anchorEl??null,title:O?.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:O?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>L(null),onConfirm:()=>{O&&t(O.taskSeq,O.nextCompleted),L(null)}})]})}import{useCallback as Di,useMemo as So,useRef as py,useState as Pi}from"react";import{Box as vr,Button as my,ButtonBase as yf,IconButton as bf,Tooltip as gy}from"@mui/material";import by from"@mui/icons-material/Add";import yy from"@mui/icons-material/ChevronLeft";import xy from"@mui/icons-material/ChevronRight";import vy from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as wy}from"@ehfuse/mui-datetime-picker";import{DndContext as _y,DragOverlay as ky,PointerSensor as Sy,pointerWithin as Ty,rectIntersection as Cy,useDraggable as By,useDroppable as xf,useSensor as Iy,useSensors as My}from"@dnd-kit/core";import Ey from"@ehfuse/overlay-scrollbar";import{jsx as At,jsxs as jn}from"react/jsx-runtime";var Ry=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Xs="mday-",Zs="mchip-",vf=36;function Ay(e){let p=new Date(e);return p.setHours(0,0,0,0),p.setDate(p.getDate()-p.getDay()),p}function Js(e){let p=new Date(e);return p.setHours(0,0,0,0),p.setDate(1),p}function Oy(e,p){let b=new Date(e);return b.setDate(b.getDate()+p),b}function Ml(e,p){let b=Js(e);return b.setMonth(b.getMonth()+p),b}function Dy({task:e,statusOptions:p,isPreview:b=!1,isMine:c=!1,avatarSrcByName:i,onOpenDetail:a,onContextMenu:r,onRequestToggleCompleted:t,dragDisabled:n=!1}){let{attributes:l,listeners:o,setNodeRef:s,isDragging:f}=By({id:String(e.seq),disabled:b||n}),{setNodeRef:d}=xf({id:`${Zs}${e.seq}`,disabled:b||n});return At(gy,{title:e.title,arrow:!0,enterDelay:400,children:At(oo,{task:e,statusOptions:p,onOpenDetail:a,onContextMenu:r,showCheckbox:!!t,onRequestToggleCompleted:t,isPreview:b,isDragging:f,isMine:c,avatarSrcByName:i,showManagerAvatar:!0,wrapTitle:!0,setNodeRef:u=>{s(u),d(u)},dragProps:n?void 0:{...l,...o}})})}function Py({dayKey:e,dayNumber:p,isToday:b,isOtherMonth:c,weekday:i,holidayName:a,tasks:r,googleEvents:t,statusOptions:n,previewSeq:l,myAccountSeq:o,avatarSrcByName:s,onRequestToggleCompleted:f,onOpenDetail:d,onTaskContextMenu:u,onAddSchedule:g,canAdd:m,dragDisabled:v=!1}){let k=nt(),B=k.mode==="dark",{setNodeRef:O,isOver:L}=xf({id:`${Xs}${e}`,disabled:v}),R=r,P=!!a||i===0;return jn(vr,{ref:O,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:L?k.colors.accentSoft:b?k.calendar.todayBg:c?k.calendar.otherMonthBg:k.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...m?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[jn(vr,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:vf,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:b?k.calendar.todayBg:k.calendar.dateBandBg,borderBottom:`1px solid ${k.calendar.borderColor}`},children:[a?At(vr,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:k.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a}):null,b?At(vr,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:k.colors.danger,color:k.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,At(vr,{component:"span",sx:{fontSize:13.5,fontWeight:b?700:400,color:c?k.colors.textMuted:P?k.colors.danger:i===6?k.colors.accentOnSurface:B?k.colors.textStrong:k.colors.textPrimary,flexShrink:0},children:p})]}),t.map(j=>At(Qo,{event:j,small:!0},j.uid)),R.map(j=>At(Dy,{task:j,statusOptions:n,isPreview:j.seq===l,isMine:o>0&&Number(j.manager_account_seq??0)===o,avatarSrcByName:s,onRequestToggleCompleted:f,onOpenDetail:d,onContextMenu:u,dragDisabled:v},j.seq)),At(vr,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:jn(yf,{className:"taskbox-month-add",onClick:()=>g(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${k.calendar.borderColor}`,bgcolor:k.calendar.cellBg,color:k.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:k.calendar.hoverBg}},children:[At(by,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function wf({tasks:e,googleEvents:p=[],statusOptions:b,fallbackToStartDate:c=!1,myAccountSeq:i=0,avatarSrcByName:a,onToggleCompleted:r,todayStr:t,onMoveTask:n,onAddSchedule:l,canAdd:o=!0,disableDrag:s=!1,onOpenDetail:f,onTaskContextMenu:d}){let u=nt(),g=u.mode==="dark",[m,v]=Pi(()=>Js(new Date)),[k,B]=Pi(null),[O,L]=Pi(null),[R,P]=Pi(null),[j,z]=Pi(null),N=So(()=>{let F=Ay(m);return Array.from({length:42},(U,X)=>Oy(F,X))},[m]),S=So(()=>new Map(e.map(F=>[F.seq,F])),[e]),C=So(()=>Xo(p),[p]),E=So(()=>[...new Set(N.map(F=>F.getFullYear()))],[N]),h=ln(E),y=So(()=>{let F=new Map;for(let U of e){let X=U.due_date.slice(0,10)||(c?U.start_date.slice(0,10)||String(U.created_time??"").slice(0,10):"");if(!X)continue;let V=F.get(X);V?V.push(U):F.set(X,[U])}for(let U of F.values())U.sort(Jo);return F},[e,c]),w=My(Iy(Sy,{activationConstraint:{distance:5}})),x=Di(F=>{let U=Ty(F),X=U.length>0?U:Cy(F),V=X.filter(G=>String(G.id).startsWith(Zs));return V.length>0?V:X.filter(G=>String(G.id).startsWith(Xs))},[]),_=Di(F=>{P(Number(F.active.id))},[]),T=Di(F=>{z(F.over?String(F.over.id):null)},[]),D=So(()=>{let F=new Map;for(let[U,X]of y)for(let V of X)F.set(V.seq,U);return F},[y]),q=R!==null?S.get(R)?.due_date.slice(0,10)??"":"",$=So(()=>{if(R===null||!j)return null;if(j.startsWith(Zs)){let F=Number(j.slice(Zs.length)),U=D.get(F);if(!U)return null;let X=(y.get(U)??[]).filter(G=>G.seq!==R),V=X.findIndex(G=>G.seq===F);return{day:U,index:V===-1?X.length:V}}if(j.startsWith(Xs)){let F=j.slice(Xs.length),U=(y.get(F)??[]).filter(X=>X.seq!==R);return{day:F,index:U.length}}return null},[R,D,j,y]),W=Di(F=>{let U=y.get(F)??[];if(R===null||!$)return U;let X=S.get(R);if(!X)return U;let V=U.filter(G=>G.seq!==R);return F===$.day?[...V.slice(0,$.index),X,...V.slice($.index)]:F===q?V:U},[R,q,$,S,y]),A=Di(F=>{let U=R,X=$;if(P(null),z(null),U===null||!X)return;let V=(y.get(X.day)??[]).filter(ee=>ee.seq!==U),G=[...V.slice(0,X.index).map(ee=>ee.seq),U,...V.slice(X.index).map(ee=>ee.seq)];n(U,X.day,G)},[R,$,n,y]),H=R!==null?S.get(R)??null:null,M=`${m.getFullYear()}\uB144 ${m.getMonth()+1}\uC6D4`,I=py(null);return jn(vr,{onTouchStart:F=>{let U=F.touches[0];I.current=U?{x:U.clientX,y:U.clientY}:null},onTouchEnd:F=>{let U=I.current;I.current=null;let X=F.changedTouches[0];if(!U||!X||R!==null)return;let V=X.clientX-U.x,G=X.clientY-U.y;Math.abs(V)<60||Math.abs(V)<=Math.abs(G)||v(Ml(m,V<0?1:-1))},sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${u.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[jn(vr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:u.calendar.bg,borderBottom:`1px solid ${u.calendar.borderColor}`,flexShrink:0},children:[jn(vr,{sx:{display:"flex",alignItems:"center",gap:.25},children:[At(bf,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>v(Ml(m,-1)),children:At(yy,{sx:{fontSize:24,color:u.colors.textSecondary}})}),At(my,{size:"small",color:"inherit",onClick:()=>v(Js(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:15.5,fontWeight:u.mode==="dark"?400:500,color:u.mode==="dark"?u.colors.textStrong:u.colors.textPrimary},children:"\uC624\uB298"}),At(bf,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>v(Ml(m,1)),children:At(xy,{sx:{fontSize:24,color:u.colors.textSecondary}})})]}),jn(yf,{onClick:F=>B(F.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:u.mode==="dark"?400:700,color:u.mode==="dark"?u.colors.textStrong:u.colors.textPrimary,"&:hover":{bgcolor:u.colors.surfaceHover}},children:[M,At(vy,{sx:{fontSize:18,color:u.colors.textMuted}})]})]}),At(vr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:u.calendar.headerBg,borderBottom:`1px solid ${u.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${u.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Ry.map((F,U)=>At(vr,{sx:{height:vf,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:U===0?u.colors.danger:U===6?u.colors.accentOnSurface:u.colors.textSecondary},children:F},F))}),At(vr,{sx:{flex:1,minHeight:0},children:jn(_y,{sensors:w,collisionDetection:x,onDragStart:_,onDragOver:T,onDragEnd:A,onDragCancel:()=>{P(null),z(null)},children:[At(Ey,{style:{height:"100%"},thumb:{width:8},children:At(vr,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${u.calendar.borderColor}`,borderBottom:`1px solid ${u.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:N.map(F=>{let U=nr(F);return At(Py,{dayKey:U,dayNumber:F.getDate(),isToday:U===t,isOtherMonth:F.getMonth()!==m.getMonth(),weekday:F.getDay(),holidayName:h.get(U)??"",tasks:W(U),googleEvents:C.get(U)??[],statusOptions:b,previewSeq:$?.day===U?R:null,myAccountSeq:i,avatarSrcByName:a,onRequestToggleCompleted:r?L:void 0,onOpenDetail:f,onTaskContextMenu:d,onAddSchedule:l,canAdd:o,dragDisabled:s},U)})})}),At(ky,{children:H?jn(vr,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:u.calendar.cellBg,border:`1px solid ${u.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:ei,fontWeight:500,color:u.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[At(vr,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:Bl[H.priority]}}),H.title]}):null})]})}),At(It,{open:!!O,anchorEl:O?.anchorEl??null,title:O?.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:O?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>L(null),onConfirm:()=>{O&&r?.(O.taskSeq,O.nextCompleted),L(null)}}),At(wy,{anchorEl:k,open:!!k,onClose:()=>B(null),selectedDate:m,onDateChange:F=>{v(Js(F)),B(null)}})]})}import{useEffect as Ly,useMemo as Ni,useRef as Rl,useState as Al}from"react";import{Box as fr,Button as Fy,IconButton as kf,useMediaQuery as zy}from"@mui/material";import qy from"@mui/icons-material/ChevronLeft";import $y from"@mui/icons-material/ChevronRight";import Hy from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as Wy}from"@ehfuse/mui-datetime-picker";import{Box as Ln,Button as Ny,Dialog as jy}from"@mui/material";import{jsx as Fn,jsxs as El}from"react/jsx-runtime";function _f({task:e,avatarSrcByName:p,onClose:b}){let c=nt(),i=e?[{label:"\uCC45\uC784\uC790",names:[String(e.manager_name??"").trim()]},{label:"\uCC38\uC870\uC790",names:e.receiver_names??[]},{label:"\uC791\uC131\uC790",names:[String(e.created_by??"").trim()]}]:[];return Fn(jy,{open:!!e,onClose:b,maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:e?El(Ln,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:c.colors.surface},children:[Fn(Ln,{sx:{fontSize:15.5,fontWeight:600,color:c.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),i.map(a=>{let r=a.names.filter(t=>!!t);return El(Ln,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[Fn(Ln,{sx:{width:56,flexShrink:0,fontSize:13.5,color:c.colors.textSecondary,pt:.5},children:a.label}),Fn(Ln,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:r.length===0?Fn(Ln,{sx:{fontSize:14,color:c.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):r.map(t=>El(Ln,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Fn(Nr,{src:p?.get(t)??"",name:t,avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),Fn(Ln,{sx:{fontSize:14.5,color:c.colors.textPrimary},children:t})]},`${a.label}-${t}`))})]},a.label)}),Fn(Ln,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:Fn(Ny,{size:"small",color:"inherit",onClick:b,children:"\uB2EB\uAE30"})})]}):null})}import{jsx as or,jsxs as hn}from"react/jsx-runtime";var Uy=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Sf(e){let p=e?.parentElement??null;for(;p;){let b=window.getComputedStyle(p);if(/(auto|scroll)/.test(b.overflowY)&&p.scrollHeight>p.clientHeight)return p;p=p.parentElement}return null}var Vy="(min-width:600px)";function Ol(e){let p=new Date(e);return p.setHours(0,0,0,0),p.setDate(1),p}function Tf(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Cf({tasks:e,googleEvents:p=[],statusOptions:b,todayStr:c,onOpenDetail:i,onAddSchedule:a,myAccountSeq:r=0,avatarSrcByName:t,fallbackToStartDate:n=!1}){let l=nt(),o=zy(Vy),[s,f]=Al(()=>Ol(new Date)),[d,u]=Al(!1),g=Ni(()=>{let C=new Date(s.getFullYear(),s.getMonth()+1,0).getDate();return Array.from({length:C},(E,h)=>{let y=new Date(s.getFullYear(),s.getMonth(),h+1);return{ymd:Tf(y),dayNumber:h+1,weekday:y.getDay()}})},[s]),m=Ni(()=>{let C=new Map;for(let E of e){let h=E.due_date.slice(0,10)||(n?E.start_date.slice(0,10)||String(E.created_time??"").slice(0,10):"");if(!h)continue;let y=C.get(h);y?y.push(E):C.set(h,[E])}for(let E of C.values())E.sort(Jo);return C},[e,n]),v=Ni(()=>n?e.filter(C=>!C.due_date.slice(0,10)&&!C.start_date.slice(0,10)&&!String(C.created_time??"").slice(0,10)).sort((C,E)=>C.completed!==E.completed?C.completed?1:-1:C.seq-E.seq):[],[e,n]),[k,B]=Al(null),O=Ni(()=>Xo(p),[p]),L=Ni(()=>[s.getFullYear()],[s]),R=ln(L),P=Rl(null),j=c.slice(0,7)===Tf(s).slice(0,7);Ly(()=>{if(!j)return;let C=()=>{let y=P.current,w=Sf(y);if(!w||!y)return;let x=y.getBoundingClientRect().top-w.getBoundingClientRect().top+w.scrollTop;w.scrollTop=Math.max(0,x-w.clientHeight/2+y.clientHeight/2)},E=setTimeout(C,100),h=setTimeout(C,400);return()=>{clearTimeout(E),clearTimeout(h)}},[j,s]);let z=Rl(null),N=Rl(null),S=C=>{f(h=>new Date(h.getFullYear(),h.getMonth()+C,1));let E=Sf(z.current);E&&E.scrollTo({top:0,behavior:"auto"})};return hn(fr,{ref:z,onTouchStart:C=>{let E=C.touches[0];N.current=E?{x:E.clientX,y:E.clientY}:null},onTouchEnd:C=>{let E=N.current;N.current=null;let h=C.changedTouches[0];if(!E||!h)return;let y=h.clientX-E.x,w=h.clientY-E.y;Math.abs(y)<60||Math.abs(y)<=Math.abs(w)||S(y<0?1:-1)},sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:l.colors.surface},children:[hn(fr,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[or(kf,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>S(-1),children:or(qy,{sx:{fontSize:24,color:l.colors.textSecondary}})}),or(Fy,{size:"small",color:"inherit",onClick:()=>f(Ol(new Date)),sx:{minWidth:0,px:1,fontSize:15.5,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary},children:"\uC624\uB298"}),or(kf,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>S(1),children:or($y,{sx:{fontSize:24,color:l.colors.textSecondary}})}),hn(fr,{onClick:()=>u(!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:[s.getFullYear(),"\uB144 ",s.getMonth()+1,"\uC6D4",or(Hy,{sx:{fontSize:20,color:l.colors.textMuted}})]})]}),hn(fr,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${l.calendar.borderColor}`},children:[v.length>0?hn(fr,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`},children:[hn(fr,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:l.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",or("br",{}),"\uC5C6\uC74C"]}),or(fr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:v.map(C=>or(oo,{task:C,statusOptions:b,onOpenDetail:i,isMine:r>0&&Number(C.manager_account_seq??0)===r,avatarSrcByName:t,showManagerAvatar:!0,onOpenMembers:B},C.seq))})]}):null,g.map(({ymd:C,dayNumber:E,weekday:h})=>{let y=R.get(C)??"",w=C===c,x=!!y||h===0,_=m.get(C)??[],T=O.get(C)??[],D=_.length>0||T.length>0;return hn(fr,{ref:w?P:void 0,onClick:a?()=>a(C):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:D?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`,...a?{cursor:"pointer"}:{}},children:[or(fr,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:hn(fr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.25,"@media (min-width:600px)":{flexDirection:"row",gap:.75}},children:[or(fr,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:40,height:32,borderRadius:1,px:1.25,fontSize:22,fontWeight:500,color:w?l.colors.surface:x?l.colors.danger:h===6?l.colors.accentOnSurface:l.colors.textPrimary,bgcolor:w?l.colors.accentOnSurface:"transparent"},children:E}),or(fr,{component:"span",sx:{fontSize:13,color:x?l.colors.danger:h===6?l.colors.accentOnSurface:l.colors.textSecondary},children:Uy[h]})]})}),hn(fr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[T.map(q=>or(Qo,{event:q},q.uid)),_.map(q=>{let $=Zo(q),W=or(oo,{task:q,statusOptions:b,onOpenDetail:i,isMine:r>0&&Number(q.manager_account_seq??0)===r,avatarSrcByName:t,showManagerAvatar:!0,onOpenMembers:B,showTime:!o,wrapTitle:!0},q.seq);return o?hn(fr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[or(fr,{component:"span",sx:{width:44,flexShrink:0,textAlign:"right",fontSize:13.5,fontWeight:400,opacity:1,color:$?q.completed?l.colors.textPrimary:l.colors.danger:"transparent"},children:$||"00:00"}),or(fr,{sx:{flex:1,minWidth:0},children:W})]},q.seq):W})]})]},C)})]}),or(_f,{task:k,avatarSrcByName:t,onClose:()=>B(null)}),or(Wy,{open:d,centered:!0,monthOnly:!0,onClose:()=>u(!1),selectedDate:s,onDateChange:C=>{f(Ol(C)),u(!1)}})]})}import{useCallback as Bf,useEffect as If,useMemo as Dl,useRef as ea,useState as ta}from"react";import{Box as Gt,Tooltip as Rf}from"@mui/material";import Ky from"@ehfuse/overlay-scrollbar";import Gy from"@mui/icons-material/CheckCircle";import Yy from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as Xy,PointerSensor as Zy,closestCenter as Jy,useSensor as Qy,useSensors as ex}from"@dnd-kit/core";import{SortableContext as tx,arrayMove as rx,useSortable as nx,verticalListSortingStrategy as ox}from"@dnd-kit/sortable";import ix from"@mui/icons-material/DragIndicator";import{jsx as jt,jsxs as io}from"react/jsx-runtime";var Pl=36,sx=48,Mf=40,ax=24,lx=4,cx=14,Ef=36,ux=12.5,ti=220,fx={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function To(e){let p=String(e??"").trim();if(!p)return null;let b=new Date(`${p}T00:00:00`);return Number.isNaN(b.getTime())?null:b}function Qs(e,p){let b=new Date(e);return b.setDate(b.getDate()+p),b}function Nl(e,p){return Math.round((p.getTime()-e.getTime())/864e5)}function dx({task:e,dragHandle:p,onPointerDown:b,onClick:c}){let i=nt(),a=ea(null),[r,t]=ta("");return jt(Rf,{title:r,arrow:!0,enterDelay:300,children:io(Gt,{onPointerDown:b,onClick:n=>c(e,n),onMouseEnter:()=>{let n=a.current;t(n&&n.scrollWidth>n.clientWidth?e.title:"")},sx:{width:ti,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:i.timeline.bg,borderRight:`1px solid ${i.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:i.mode==="dark"||e.completed?400:500,color:e.completed?i.colors.textMuted:i.mode==="dark"?i.colors.textStrong:i.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:i.colors.surfaceHover}},children:[p,jt(Gt,{ref:a,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function hx({id:e,showIndicator:p,children:b}){let c=nt(),{attributes:i,listeners:a,setNodeRef:r}=nx({id:e});return io(Gt,{ref:r,sx:{position:"relative"},children:[p?jt(Gt,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:c.colors.accentOnSurface,zIndex:5}}):null,b({...i,...a})]})}function Af({tasks:e,todayStr:p,onOpenDetail:b,onToggleChecklist:c,onReorderTasks:i,onTaskContextMenu:a}){let r=nt(),t=Dl(()=>[...e].sort((E,h)=>{let y=(E.timeline_sort_no??0)>0,w=(h.timeline_sort_no??0)>0;if(y&&w)return(E.timeline_sort_no??0)-(h.timeline_sort_no??0);if(y!==w)return y?-1:1;let x=E.due_date||E.start_date,_=h.due_date||h.start_date;return x!==_?x<_?-1:1:E.seq-h.seq}),[e]),[n,l]=ta(null),[o,s]=ta(null),f=ex(Qy(Zy,{activationConstraint:{distance:4}})),d=Bf(E=>{l(E.over?Number(E.over.id):null)},[]),u=Bf(E=>{l(null),s(null);let{active:h,over:y}=E;if(!y||h.id===y.id)return;let w=t.map(T=>T.seq),x=w.indexOf(Number(h.id)),_=w.indexOf(Number(y.id));x===-1||_===-1||i(rx(w,x,_))},[t,i]),g=Dl(()=>{let E=To(p)??new Date,h=E,y=Qs(E,21);for(let _ of t){let T=To(_.start_date)??To(_.due_date),D=To(_.due_date)??T;T&&T<h&&(h=T),D&&D>y&&(y=D)}let w=Qs(h,-3),x=Nl(w,Qs(y,3))+1;return Array.from({length:x},(_,T)=>Qs(w,T))},[t,p]),m=g[0],v=g.findIndex(E=>nr(E)===p),{dayWidths:k,dayOffsets:B,gridWidth:O}=Dl(()=>{let E=g.map((w,x)=>w.getDate()===1||x===0?sx:Pl),h=[],y=0;for(let w of E)h.push(y),y+=w;return{dayWidths:E,dayOffsets:h,gridWidth:y}},[g]),L=ti+O,R=ea(null),P=E=>{R.current={x:E.clientX,y:E.clientY}},j=(E,h)=>{let y=R.current;R.current=null,!(y&&(Math.abs(h.clientX-y.x)>5||Math.abs(h.clientY-y.y)>5))&&b(E)},z=ea(null),[N,S]=ta(!1);If(()=>{let E=z.current?.getScrollContainer();if(!E)return;let h=()=>S(E.scrollHeight>E.clientHeight);h();let y=new ResizeObserver(h);return y.observe(E),()=>y.disconnect()},[t.length]);let C=ea(!1);return If(()=>{if(t.length===0||C.current)return;C.current=!0;let E=window.requestAnimationFrame(()=>{let h=z.current?.getScrollContainer();!h||v<0||(h.scrollLeft=Math.max(0,B[v]-Pl*3))});return()=>window.cancelAnimationFrame(E)},[t.length]),jt(Gt,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${r.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:r.timeline.headerBg},children:jt(Gt,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:jt(Ky,{ref:z,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:io(Gt,{sx:{width:L,position:"relative",bgcolor:r.timeline.bg},children:[io(Gt,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:r.timeline.headerBg,borderBottom:`1px solid ${r.timeline.gridColor}`},children:[jt(Gt,{sx:{width:ti,height:Ef,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:r.timeline.headerBg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:r.colors.textSecondary},children:"\uC81C\uBAA9"}),g.map((E,h)=>{let y=E.getDay(),w=h===v,x=E.getDate()===1||h===0;return jt(Gt,{sx:{width:k[h],height:Ef,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:ux,fontWeight:w&&r.mode!=="dark"?700:400,color:w?r.timeline.bg:y===0?r.colors.danger:y===6?r.colors.accentOnSurface:r.colors.textSecondary,bgcolor:w?r.colors.danger:"transparent",borderRight:`1px solid ${r.timeline.gridColor}`,whiteSpace:"nowrap"},children:x?`${E.getMonth()+1}/${E.getDate()}`:E.getDate()},nr(E))})]}),jt(Xy,{sensors:f,collisionDetection:Jy,onDragStart:E=>s(Number(E.active.id)),onDragOver:d,onDragEnd:u,onDragCancel:()=>{l(null),s(null)},children:jt(tx,{items:t.map(E=>String(E.seq)),strategy:ox,children:io(Gt,{sx:{position:"relative"},children:[g.map((E,h)=>{let y=E.getDay(),w=h===v;return!w&&y!==0&&y!==6?null:jt(Gt,{sx:{position:"absolute",top:0,bottom:0,left:ti+B[h],width:k[h],bgcolor:w?"rgba(229,72,77,0.07)":r.colors.surfaceSubtle,zIndex:0}},`stripe-${nr(E)}`)}),t.map((E,h)=>{let y=To(E.start_date)??To(E.due_date),w=To(E.due_date)??y,x=y?Math.min(g.length-1,Math.max(0,Nl(m,y))):0,_=w?Math.min(g.length-1,Math.max(x,Nl(m,w))):x,T=fx[E.priority],D=ti+B[x]+2,q=B[_]+k[_]-B[x]-4,$=E.checklist??[];return jt(hx,{id:String(E.seq),showIndicator:n===E.seq&&o!==E.seq,children:W=>io(Gt,{sx:{borderBottom:h===t.length-1&&N?"none":`1px solid ${r.timeline.gridColor}`,position:"relative",zIndex:1,opacity:o===E.seq?.45:1},children:[io(Gt,{onContextMenu:A=>a(E,A),sx:{display:"flex",height:Mf,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[jt(dx,{task:E,dragHandle:jt(Gt,{component:"span",className:"taskbox-timeline-handle",...W,onClick:A=>A.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:r.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:r.colors.accentOnSurface}},children:(()=>{let A=(E.is_notice||E.is_event?bt(E.icon||(E.is_notice?Kt:tr)):null)??ix;return jt(A,{sx:{fontSize:17}})})()}),onPointerDown:P,onClick:j}),jt(Rf,{title:`${E.title} (${E.start_date||"?"} ~ ${E.due_date||"?"})`,arrow:!0,enterDelay:300,children:jt(Gt,{onPointerDown:P,onClick:A=>j(E,A),sx:{position:"absolute",top:(Mf-20)/2,left:D,width:Math.max(Pl-4,q),height:20,borderRadius:1,bgcolor:T.bg,border:`1px solid ${T.border}`,opacity:E.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),$.map((A,H)=>jt(Gt,{sx:{display:"flex",height:ax,position:"relative",mt:H===0?`${lx}px`:0,mb:H===$.length-1?`${cx}px`:0},children:jt(Gt,{sx:{width:ti,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:A.checked?r.colors.textMuted:r.colors.textPrimary},children:io(Gt,{onClick:()=>c(E.seq,H,!A.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[A.checked?jt(Gy,{sx:{fontSize:17,color:r.colors.accentOnSurface,flexShrink:0}}):jt(Yy,{sx:{fontSize:17,color:r.colors.textMuted,flexShrink:0}}),jt(Gt,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:A.checked?"line-through":"none"},children:A.label})]})})},`${E.seq}-check-${H}`))]})},E.seq)}),t.length===0?jt(Gt,{sx:{py:8,textAlign:"center",color:r.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as Co}from"react/jsx-runtime";function OB(e){switch(e.view){case"card":case"kanban":{let{view:p,...b}=e;return Co(wl,{...b,columnAxis:p==="kanban"?"status":"project"})}case"sprint":{let{view:p,...b}=e;return Co(wl,{...b,columnAxis:"sprint"})}case"calendar":{let{view:p,...b}=e;return Co(gf,{...b})}case"month":{let{view:p,...b}=e;return Co(wf,{...b})}case"agenda":{let{view:p,...b}=e;return Co(Cf,{...b})}case"timeline":{let{view:p,...b}=e;return Co(Af,{...b})}default:{let{view:p,...b}=e;return Co(Vu,{...b})}}}var DB=["list","card","kanban","calendar","month","timeline"];import{Box as Er}from"@mui/material";import{Fragment as px,jsx as Bo,jsxs as pn}from"react/jsx-runtime";function Of(e,p){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(p))return null;let b=new Date(`${e}T00:00:00`),c=new Date(`${p}T00:00:00`);return Math.round((b.getTime()-c.getTime())/864e5)}function Df({tasks:e,todayStr:p,showProgress:b=!0,dday:c=null,workdaysLeft:i=null,showPoints:a=!0,showHours:r=!0,showOverdue:t=!0,showInfo:n=!0,inline:l=!1}){let o=nt(),s=e.filter(P=>!P.archived),f=s.filter(P=>P.completed).length,d=s.length>0?Math.round(f/s.length*100):0,u=s.filter(P=>!P.completed&&!P.is_event&&!!P.due_date&&P.due_date.slice(0,10)<p).length,g=s.reduce((P,j)=>j.completed?P:P+(j.story_points??0),0),m=b?Bo(Er,{sx:{flex:l?"0 0 110px":"1 1 auto",minWidth:0,height:o.summary.gaugeHeight,borderRadius:3,bgcolor:o.summary.gaugeTrackColor},children:Bo(Er,{sx:{height:"100%",borderRadius:3,width:`${d}%`,bgcolor:d>=100?o.summary.gaugeCompleteColor:o.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,v=b?pn(Er,{component:"span",sx:{flexShrink:0,fontSize:l?14:13,color:o.summary.textColor},children:[d,"%"]}):null,k={color:o.summary.numberColor,fontWeight:700,fontSize:l?15:14},B=s.length-f,O=pn(px,{children:[l?null:pn("span",{children:["\uB0A8\uC740 ",Bo(Er,{component:"span",sx:k,children:B}),"\uAC74"]}),t&&u>0?pn(Er,{component:"span",sx:{color:o.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",Bo(Er,{component:"span",sx:{fontWeight:700,fontSize:l?15:14},children:u}),"\uAC74"]}):null,a&&g>0?pn("span",{children:[Bo(Er,{component:"span",sx:k,children:g}),"SP"]}):null]}),L=typeof i=="number"&&Number.isFinite(i)?pn("span",{children:["\uADFC\uBB34\uC77C ",Bo(Er,{component:"span",sx:k,children:i}),"\uC77C"]}):null,R=typeof c=="number"&&Number.isFinite(c)?Bo(Er,{component:"span",sx:{ml:l?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:o.summary.overdueColor,color:o.colors.textInverse,lineHeight:1.6},children:c===0?"D-day":c>0?`D-${c}`:`D+${-c}`}):null;return l?pn(Er,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:o.summary.textColor,whiteSpace:"nowrap",...o.summary.sx},children:[n?O:null,n?L:null,n?R:null,m,v]}):pn(Er,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[b?pn(Er,{sx:{display:"flex",alignItems:"center",gap:1},children:[m,v]}):null,pn(Er,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:o.summary.textColor},children:[O,L,R]})]})}import{useMemo as gx}from"react";function mx(e){let p=String(e??"").trim();if(!p)return 0;let b=0,c=!1;for(let i of p.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let a=parseFloat(i[1]),r=i[2].toLowerCase();c=!0,r==="m"||r==="\uBD84"?b+=a/60:r==="d"||r==="\uC77C"?b+=a*8:b+=a}if(!c){let i=parseFloat(p);Number.isFinite(i)&&(b+=i)}return b}function qB(e){let p=Math.round(e*10)/10;return`${p%1===0?p.toFixed(0):p.toFixed(1)}\uC2DC\uAC04`}function Pf(e,p,b){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(p))return 0;let c=new Date(`${e}T00:00:00`),i=new Date(`${p}T00:00:00`);if(i<c||i.getTime()-c.getTime()>3660*864e5)return 0;let a=0;for(let r=new Date(c);r<=i;r.setDate(r.getDate()+1)){let t=r.getDay();if(t===0||t===6)continue;let n=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`;b.has(n)||(a+=1)}return a}function $B(e){return e.reduce((p,b)=>b.completed?p:p+mx(b.estimated_time),0)}import{jsx as bx}from"react/jsx-runtime";function GB({sprint:e,tasks:p,todayStr:b,...c}){let i=e.status==="closed"?null:Of(e.end_date,b),a=i!==null&&i>=0,r=gx(()=>{if(!a)return[];let l=Number(b.slice(0,4)),o=Number(e.end_date.slice(0,4))||l,s=[];for(let f=l;f<=Math.max(l,o);f+=1)s.push(f);return s},[a,b,e.end_date]),t=ln(r),n=a?Pf(b,e.end_date,new Set(t.keys())):null;return bx(Df,{tasks:p,todayStr:b,dday:i,workdaysLeft:n,...c})}import{useEffect as Bx,useRef as Ix,useState as Mx}from"react";import{Box as Ll}from"@mui/material";import{Children as yx}from"react";import{Box as jl,CircularProgress as xx}from"@mui/material";import{jsx as ra}from"react/jsx-runtime";var Nf={xs:2,md:3};function jf(){return ra(jl,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:ra(xx,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function Lf({children:e}){return ra(jl,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:Nf,pb:Nf},children:yx.map(e,p=>p==null||p===!1?null:ra(jl,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:p}))})}import{Box as qn,Button as kx,Checkbox as Sx,Typography as so}from"@mui/material";import zf from"@mui/icons-material/CheckCircle";import Tx from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as _x,jsx as Ff}from"react/jsx-runtime";var vx="taskbox-search-highlight";function wx(e,p){let b=p?.keyPrefix??"hl";return e.map((c,i)=>Ff("span",{className:c.highlight?p?.highlightClassName??vx:p?.className,style:c.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:c.text},`${b}-${c.text}-${i}`))}function na({text:e,keyword:p,fallback:b="-",className:c,highlightClassName:i,keyPrefix:a}){let r=String(e??"").trim()||b,t=Ds(r,p);return Ff(_x,{children:wx(t,{className:c,highlightClassName:i,keyPrefix:a})})}import{jsx as gt,jsxs as ri}from"react/jsx-runtime";var Cx={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:ar(12.5),fontWeight:500,lineHeight:1.4},zn={fontSize:ar(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function mn({label:e,children:p}){return ri(qn,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[gt(qn,{sx:Cx,children:e}),gt(qn,{sx:{...zn,flex:1,pt:.2},children:p})]})}function qf({task:e,statusOptions:p,projectLabel:b,searchText:c,todayStr:i,onRequestToggleCompleted:a,onOpenDetail:r,onTaskContextMenu:t,targetSummary:n="",ackInfo:l,completeLocked:o=!1,unread:s=!1,noticeReadOnly:f=!1,onAckConfirm:d,onAckListClick:u,myManaged:g=!1}){let m=e.is_event?Bi(e):rr(e),v=String(e.due_date??"").slice(11,16),k=e.is_event?String(e.event_time??"").trim():/^\d{2}:\d{2}$/.test(v)?v:String(e.estimated_time??"").trim(),B=jr(e.start_date),O=jr(e.due_date),L=B&&k&&!O?`${B} ${k}`:B,R=O&&k?`${O} ${k}`:O,P=!e.is_notice&&!e.is_event&&!String(e.due_date??"").trim(),j=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<i,z=(e.receiver_names??[]).filter(Boolean);return ri(qn,{role:"button",tabIndex:0,onClick:()=>r(e),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),r(e))},onContextMenu:N=>t(e,N),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",opacity:P?.6:1,position:"relative"},children:[g?gt(qn,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,ri(qn,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[e.is_event?(()=>{let N=bt(e.icon||tr);return N?gt(N,{sx:{fontSize:21,flexShrink:0,mt:.2,color:e.icon_color||"#1e3a8a"}}):null})():!f&&!o?gt(Sx,{checked:e.completed,icon:gt(Tx,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:gt(zf,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:N=>N.stopPropagation(),onChange:(N,S)=>a({anchorEl:N.currentTarget,taskSeq:e.seq,nextCompleted:S}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{if(!e.is_notice)return null;let N=bt(e.icon||Kt);return N?gt(N,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:e.icon_color||"#e5484d"}}):null})(),gt(so,{sx:{fontSize:ar(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":P?"#5f5e5b":"#111827",textDecoration:e.completed?"line-through":"none"},children:gt(na,{text:e.title,keyword:c})}),s&&!e.completed?gt(qn,{component:"span",sx:{flexShrink:0,px:.55,fontSize:ar(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),ri(qn,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[gt(mn,{label:m?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:ri(qn,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1.25},children:[m?gt(Et,{option:m,small:!0}):null,gt(Ir,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?gt(mn,{label:"\uB77C\uBCA8",children:gt(Qn,{labelKeys:e.label_keys,labelOptions:p})}):null,b?gt(mn,{label:"\uD504\uB85C\uC81D\uD2B8",children:gt(so,{sx:zn,children:b})}):null,L?gt(mn,{label:"\uC2DC\uC791",children:gt(so,{sx:zn,children:L})}):null,R?gt(mn,{label:"\uB9C8\uAC10",children:ri(so,{sx:{...zn,color:j?"#e5484d":zn.color,fontWeight:j?600:400},children:[R,j?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?gt(mn,{label:"\uB300\uC0C1\uC790",children:gt(so,{sx:zn,children:n||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&l?gt(mn,{label:"\uD655\uC778",children:gt(kx,{size:"small",variant:l.canAck?"contained":"outlined",color:"inherit",startIcon:l.acked?gt(zf,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:N=>{N.stopPropagation(),l.canAck?d?.(e):u?.(e,N.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:ar(13),...l.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:l.canAck?"\uD655\uC778":`${l.count}/${l.total}`})}):null,!e.is_notice&&e.manager_name?gt(mn,{label:"\uCC45\uC784\uC790",children:gt(so,{sx:zn,children:gt(na,{text:e.manager_name,keyword:c})})}):null,!e.is_notice&&z.length>0?gt(mn,{label:"\uCC38\uC870\uC790",children:gt(so,{sx:zn,children:z.join(", ")})}):null,e.note?gt(mn,{label:"\uBE44\uACE0",children:gt(so,{sx:zn,children:gt(na,{text:e.note,keyword:c})})}):null]})]})}import{jsx as ni,jsxs as Ex}from"react/jsx-runtime";function wI({tasks:e,statusOptions:p,customTabs:b,loading:c,searchText:i,todayStr:a,onToggleCompleted:r,onOpenDetail:t,onTaskContextMenu:n,getTargetSummary:l,getAckInfo:o,getNoticeReadOnly:s,isTaskUnread:f,getCompleteLocked:d,onAckConfirm:u,onAckListClick:g,onEndReached:m,myAccountSeq:v=0}){let k=new Map(b.map(R=>[R.key,R.label])),[B,O]=Mx(null),L=Ix(null);return Bx(()=>{let R=L.current;if(!m||!R)return;let P=new IntersectionObserver(j=>{j[0]?.isIntersecting&&m()});return P.observe(R),()=>P.disconnect()},[m,e.length]),e.length===0?c?ni(jf,{}):ni(Ll,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Ex(Ll,{sx:{minWidth:0},children:[ni(Lf,{children:e.map(R=>ni(qf,{myManaged:v>0&&!R.is_notice&&!R.is_event&&(R.manager_account_seq??0)===v,task:R,statusOptions:p,projectLabel:R.tab_key?k.get(R.tab_key)??"":"",searchText:i,todayStr:a,onRequestToggleCompleted:O,onOpenDetail:t,onTaskContextMenu:n,targetSummary:R.is_notice?l?.(R):void 0,ackInfo:R.is_notice?o?.(R):void 0,noticeReadOnly:R.is_notice?s?.(R):!1,unread:f?.(R)??!1,completeLocked:d?.(R)??!1,onAckConfirm:u,onAckListClick:g},R.seq))}),m?ni(Ll,{ref:L,sx:{height:"1px"}}):null,ni(It,{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:()=>O(null),onConfirm:()=>{B&&r(B.taskSeq,B.nextCompleted),O(null)}})]})}import{useState as ji}from"react";import{Box as qt,Checkbox as Rx,Menu as Ax,MenuItem as $f,Tooltip as Ox}from"@mui/material";import Dx from"@mui/icons-material/CheckCircle";import Px from"@mui/icons-material/CheckCircleOutlineOutlined";import Nx from"@mui/icons-material/NotesOutlined";import jx from"@mui/icons-material/AutorenewOutlined";import Lx from"@mui/icons-material/CalendarTodayOutlined";import Fx from"@mui/icons-material/EventOutlined";import zx from"@mui/icons-material/PersonOutlineOutlined";import qx from"@mui/icons-material/PeopleAltOutlined";import $x from"@mui/icons-material/StickyNote2Outlined";import{Fragment as Ux,jsx as ct,jsxs as ao}from"react/jsx-runtime";var Fl={completed:{label:"\uC644\uB8CC",width:"44px",align:"center",icon:null},title:{label:"\uC81C\uBAA9",width:"1fr",align:"left",icon:ct(Nx,{sx:{fontSize:15}})},manager_name:{label:"\uCC45\uC784\uC790",width:"112px",align:"center",icon:ct(zx,{sx:{fontSize:15}})},receiver_names:{label:"\uCC38\uC870\uC790",width:"120px",align:"center",icon:ct(qx,{sx:{fontSize:15}})},status:{label:"\uC0C1\uD0DC",width:"104px",align:"center",icon:ct(jx,{sx:{fontSize:15}})},priority:{label:"\uC911\uC694\uB3C4",width:"88px",align:"center",icon:null},start_date:{label:"\uC2DC\uC791\uC77C\uC2DC",width:"110px",align:"center",icon:ct(Lx,{sx:{fontSize:15}})},due_date:{label:"\uB9C8\uAC10\uC77C\uC2DC",width:"110px",align:"center",icon:ct(Fx,{sx:{fontSize:15}})},note:{label:"\uBE44\uACE0",width:"1fr",align:"left",icon:ct($x,{sx:{fontSize:15}})}},Hx=[{id:"completed"},{id:"title"},{id:"manager_name"},{id:"due_date"},{id:"status"}],Wx=new Set(["manager_name","status","due_date"]);function Hf(e){let p=String(e??"").trim();return p?p.slice(2,10).replaceAll("-","."):""}function VI(e,p){return p>0?e.filter(b=>!b.is_notice&&!b.completed&&!b.archived&&Wr(b)==="group"&&Number(b.visibility_group_seq??0)===p).sort((b,c)=>{let i=String(b.due_date??"").trim(),a=String(c.due_date??"").trim();return i!==a?i?a?i.localeCompare(a):-1:1:Number(b.seq)-Number(c.seq)}):[]}function KI({tasks:e,columns:p=Hx,loading:b=!1,emptyText:c="\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",myAccountSeq:i=0,avatarSrcByName:a,managerCandidates:r=[],canAssignManager:t,onOpenDetail:n,onToggleCompleted:l,onChangeStatus:o,onChangeDueDate:s,onChangeReminder:f,onChangeManager:d,onClaimTask:u}){let g=nt(),[m,v]=ji(null),[k,B]=ji(null),[O,L]=ji(null),[R,P]=ji(null),[j,z]=ji(null),N=p.map(E=>E.width??Fl[E.id].width).join(" "),S=(E,h)=>ct(Nr,{src:a?.get(E)??"",name:E,avatarSx:{width:h,height:h,fontSize:Math.round(h/2),flexShrink:0,borderRadius:"50%"},iconFontSize:Math.round(h*.6)}),C=(E,h)=>{let w=Fl[E.id].align==="center";switch(E.id){case"completed":if(h.is_event){let x=bt(h.icon||tr);return ct(qt,{className:"cell",sx:{justifyContent:"center"},children:x?ct(x,{sx:{fontSize:19,color:h.icon_color||"#1e3a8a"}}):null},E.id)}return ct(qt,{className:"cell",sx:{justifyContent:"center",...l?{"&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:ct(Ox,{title:h.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,children:ct(Rx,{checked:!!h.completed,icon:ct(Px,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:ct(Dx,{sx:{fontSize:20,color:"#2f80ed"}}),onChange:x=>P({anchorEl:x.currentTarget,task:h}),sx:{p:.5}})})},E.id);case"title":{let x=h.is_notice?bt(h.icon||Kt):null,_=h.icon_color||"#e5484d";return ao(qt,{className:"cell",onClick:()=>n(h),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}},children:[x?ct(x,{sx:{fontSize:18,flexShrink:0,color:_}}):null,ct(qt,{component:"span",sx:{fontSize:14.5,fontWeight:g.table.rowTitleFontWeight,color:g.table.rowTitleColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.title||"(\uC81C\uBAA9 \uC5C6\uC74C)"})]},E.id)}case"manager_name":{let x=t?t(h):!1,_=i>0&&Number(h.manager_account_seq??0)===i;return x&&d?ao(qt,{className:"cell",onClick:T=>L({anchorEl:T.currentTarget,task:h}),sx:{gap:.75,justifyContent:"center",cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}},children:[h.manager_name?S(h.manager_name,22):null,ct(qt,{component:"span",sx:{fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.manager_name||""})]},E.id):ct(qt,{className:"cell",sx:{gap:.75,justifyContent:"center"},children:h.manager_name?ao(Ux,{children:[S(h.manager_name,22),ct(qt,{component:"span",sx:{fontSize:14,fontWeight:_?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.manager_name})]}):u?ct(an,{onClick:T=>z({anchorEl:T.currentTarget,taskSeq:Number(h.seq)}),children:"\uAC00\uC838\uAC00\uAE30"}):null},E.id)}case"receiver_names":return ct(qt,{className:"cell",sx:{justifyContent:"center",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(h.receiver_names??[]).join(", ")},E.id);case"status":return ct(qt,{className:"cell",onClick:o?x=>v({anchorEl:x.currentTarget,task:h}):void 0,sx:{py:.5,justifyContent:"center",...o?{cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:ct(Et,{option:rr(h)})},E.id);case"priority":return ct(qt,{className:"cell",sx:{justifyContent:"center"},children:ct(Ir,{priority:h.priority,plain:!0})},E.id);case"start_date":return ct(qt,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14},children:Hf(h.start_date)},E.id);case"due_date":return ct(qt,{className:"cell",onClick:s?x=>B({anchorEl:x.currentTarget,taskSeq:Number(h.seq),date:String(h.due_date??"").slice(0,10),reminder:h.reminder??"none"}):void 0,sx:{justifyContent:"center",whiteSpace:"nowrap",fontSize:14,...s?{cursor:"pointer","&:hover":{bgcolor:g.table.cellHoverBg}}:{}},children:Hf(h.due_date)},E.id);case"note":return ct(qt,{className:"cell",sx:{justifyContent:w?"center":"flex-start",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h.note||""},E.id);default:return null}};return ao(qt,{sx:{border:`1px solid ${g.table.borderColor}`,borderRadius:1,overflow:"hidden",bgcolor:g.table.bg,color:g.table.rowColor},children:[ct(qt,{sx:{display:"grid",gridTemplateColumns:N,borderBottom:`1px solid ${g.table.borderColor}`,bgcolor:g.table.headerBg,"& > *":{display:"flex",alignItems:"center",gap:.5,px:1,py:1,minWidth:0,fontSize:g.table.headerFontSize,whiteSpace:"nowrap",userSelect:"none",borderRight:`1px solid ${g.table.rowBorderColor}`},"& > *:first-of-type":{px:.5},"& > *:last-child":{borderRight:"none",pr:2}},children:p.map(E=>{let h=Fl[E.id];return ao(qt,{sx:{justifyContent:h.align==="center"?"center":"flex-start",color:Wx.has(E.id)?g.table.headerActiveColor:g.table.headerColor},children:[h.icon,E.label??h.label]},E.id)})}),b?ct(qt,{sx:{py:3,textAlign:"center",color:g.table.emptyColor,fontSize:14},children:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"}):e.length===0?ct(qt,{sx:{py:3,textAlign:"center",color:g.table.emptyColor,fontSize:14},children:c}):e.map((E,h)=>ct(qt,{sx:{display:"grid",gridTemplateColumns:N,minHeight:44,fontSize:15,bgcolor:g.table.rowBg,borderTop:h===0?"none":`1px solid ${g.table.rowBorderColor}`,"&:hover":{bgcolor:g.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${g.table.rowBorderColor}`},"& > .cell:first-of-type":{px:.5},"& > .cell:last-child":{borderRight:"none",pr:2}},children:p.map(y=>C(y,E))},E.seq)),ct(Vo,{anchorEl:m?.anchorEl??null,value:String(m?.task.status??""),options:m?Bs(m.task):void 0,onSelect:E=>{m&&o?.(Number(m.task.seq),E),v(null)},onClose:()=>v(null)}),ao(Ax,{anchorEl:O?.anchorEl??null,open:!!O,onClose:()=>L(null),transitionDuration:0,children:[ao($f,{onClick:()=>{O&&d?.(Number(O.task.seq),"",0),L(null)},sx:{fontSize:14,minWidth:170,gap:1,color:g.table.headerColor},children:[ct(qt,{sx:{width:24,flexShrink:0}}),"\uC9C0\uC815 \uC548 \uD568"]}),r.map(E=>ao($f,{selected:Number(O?.task.manager_account_seq??0)===Number(E.account_seq??0),onClick:()=>{O&&d?.(Number(O.task.seq),E.name,Number(E.account_seq??0)),L(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[S(E.name,24),E.name,E.role_name?ct(qt,{component:"span",sx:{color:g.table.headerColor,fontSize:13},children:E.role_name}):null]},E.seq))]}),ct(Lr,{anchorEl:k?.anchorEl??null,open:!!k,date:k?.date??"",reminder:k?.reminder??"none",hideReminder:!f,onClose:()=>B(null),onDateChange:E=>{k&&(s?.(k.taskSeq,E),B(h=>h?{...h,date:E}:null))},onReminderChange:E=>{k&&(f?.(k.taskSeq,E),B(h=>h?{...h,reminder:E}:null))}}),ct(It,{open:!!R,anchorEl:R?.anchorEl??null,title:R?.task.completed?"\uC644\uB8CC\uB97C \uD574\uC81C\uD560\uAE4C\uC694?":"\uC644\uB8CC \uCC98\uB9AC\uD560\uAE4C\uC694?",confirmText:R?.task.completed?"\uD574\uC81C":"\uC644\uB8CC",onCancel:()=>P(null),onConfirm:()=>{R&&l?.(R.task,!R.task.completed),P(null)}}),ct(It,{open:!!j,anchorEl:j?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uB97C \uB9E1\uC744\uAE4C\uC694?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>z(null),onConfirm:()=>{j&&u?.(j.taskSeq),z(null)}})]})}var Li=[{value:"daily",label:"\uB9E4\uC77C"},{value:"weekly",label:"\uB9E4\uC8FC"},{value:"monthly",label:"\uB9E4\uC6D4"},{value:"yearly",label:"\uB9E4\uB144"}];function oa(e){return Li.find(p=>p.value===e)?.label??"\uC5C6\uC74C"}function Vx(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let p=new Date(`${e}T00:00:00`);return Number.isNaN(p.getTime())?null:p}function ia(e,p){let b=Vx(e);if(!b)return"";let c=new Date(b);p==="daily"?c.setMonth(c.getMonth()+1):p==="weekly"?c.setMonth(c.getMonth()+3):p==="monthly"?c.setFullYear(c.getFullYear()+1):c.setFullYear(c.getFullYear()+3);let i=a=>String(a).padStart(2,"0");return`${c.getFullYear()}-${i(c.getMonth()+1)}-${i(c.getDate())}`}import{useEffect as aw,useRef as lw,useState as cw}from"react";import{Box as xn,Button as nc,Divider as _d,Drawer as uw,IconButton as fw}from"@mui/material";import dw from"@mui/icons-material/Close";import hw from"@ehfuse/overlay-scrollbar";import{FormDialog as pw}from"@ehfuse/mui-form-dialog";import{useState as $i}from"react";import{Box as Ro,ButtonBase as Xv,Divider as Hi,Menu as ec,MenuItem as tc,Tooltip as Zv}from"@mui/material";import Jv from"@mui/icons-material/SubjectOutlined";import Qv from"@mui/icons-material/StickyNote2Outlined";import ew from"@mui/icons-material/LabelOutlined";import tw from"@mui/icons-material/DirectionsRunOutlined";import bd from"@mui/icons-material/LockOutlined";import yd from"@mui/icons-material/PublicOutlined";import xd from"@mui/icons-material/Group";import rw from"@mui/icons-material/Repeat";import nw from"@mui/icons-material/EventOutlined";import ow from"@mui/icons-material/SpeedOutlined";import{TextField as iw}from"@ehfuse/mui-form-controls";import{InfoAlert as vd}from"@ehfuse/alerts";import{useState as Io}from"react";import{Box as Xf,Divider as f2,ListItemIcon as d2,Menu as $l,MenuItem as Fi}from"@mui/material";import h2 from"@mui/icons-material/Add";import aa from"@mui/icons-material/Check";import p2 from"@mui/icons-material/ViewKanbanOutlined";import m2 from"@mui/icons-material/CalendarTodayOutlined";import g2 from"@mui/icons-material/EventOutlined";import b2 from"@mui/icons-material/PersonOutlineOutlined";import Gf from"@mui/icons-material/PeopleAltOutlined";import y2 from"@mui/icons-material/FlagOutlined";import x2 from"@mui/icons-material/TimerOutlined";import v2 from"@mui/icons-material/NotificationsNoneOutlined";import w2 from"@mui/icons-material/InboxOutlined";import _2 from"@mui/icons-material/PlaceOutlined";import k2 from"@mui/icons-material/MapOutlined";import{TimePicker as S2}from"@ehfuse/mui-datetime-picker";import{InfoAlert as T2}from"@ehfuse/alerts";var Gr="@media (max-width: 719.95px)";function gn(e){return{[Gr]:{order:e}}}import{useEffect as Kx,useState as Gx}from"react";import{Box as Yx}from"@mui/material";import{jsx as Xx}from"react/jsx-runtime";function $n({value:e,placeholder:p,readOnly:b,onCommit:c}){let i=nt(),[a,r]=Gx(e);return Kx(()=>r(e),[e]),Xx(Yx,{component:"input",spellCheck:!1,value:a,readOnly:b,placeholder:p,onChange:t=>r(t.target.value),onBlur:()=>{a.trim()!==e&&c(a.trim())},onKeyDown:t=>{t.key==="Enter"&&t.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:i.colors.textPrimary,caretColor:i.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as zl}from"@mui/material";import{jsx as Zx,jsxs as Wf}from"react/jsx-runtime";function at({icon:e,label:p,onClick:b,sx:c,children:i}){return Wf(zl,{sx:[{display:"flex",alignItems:"center",minHeight:32},...Array.isArray(c)?c:[c]],children:[Wf(zl,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,p]}),Zx(zl,{onClick:b?a=>b(a.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:b?"pointer":"default","&:hover":b?{bgcolor:"#f2f2f0"}:void 0,[Gr]:{py:.25}},children:i})]})}import{Suspense as Jx,lazy as Qx,useEffect as e2,useState as Uf}from"react";import{Box as ql,Dialog as t2,DialogContent as r2,DialogTitle as n2,IconButton as Vf,Tooltip as o2}from"@mui/material";import i2 from"@mui/icons-material/Close";import s2 from"@mui/icons-material/Search";import{Fragment as u2,jsx as Yr,jsxs as sa}from"react/jsx-runtime";function a2(e){return Yr(ql,{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 l2=Qx(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:a2})));function c2(e){if(e.addressType!=="R")return e.address;let p="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(p+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(p+=p!==""?`, ${e.buildingName}`:e.buildingName),p!==""?`${e.address} (${p})`:e.address}function Kf({value:e,placeholder:p="\uC8FC\uC18C \uC785\uB825",readOnly:b,onCommit:c}){let[i,a]=Uf(e),[r,t]=Uf(!1),n=Br().slots?.addressSearch;e2(()=>a(e),[e]);let l=s=>{a(s),t(!1),s!==e&&c(s)};return sa(u2,{children:[sa(ql,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[Yr(ql,{component:"input",spellCheck:!1,value:i,readOnly:b,placeholder:p,onChange:s=>a(s.target.value),onBlur:()=>{r||i.trim()!==e&&c(i.trim())},onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),!b&&t(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),b?null:Yr(o2,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:Yr(Vf,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>t(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:Yr(s2,{sx:{fontSize:17}})})})]}),n?Yr(n,{open:r,onComplete:l,onClose:()=>t(!1)}):sa(t2,{open:r,onClose:()=>t(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[sa(n2,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",Yr(Vf,{onClick:()=>t(!1),size:"small",children:Yr(i2,{})})]}),Yr(r2,{style:{padding:0},dividers:!0,children:r?Yr(Jx,{fallback:null,children:Yr(l2,{onComplete:s=>{l(c2(s))},onClose:()=>t(!1),defaultQuery:i,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as la,jsx as Xe,jsxs as Xr}from"react/jsx-runtime";function Yf(e){return String(e??"").includes(" ")?Mr(e):jr(e)}function C2(e){let[p="00",b="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(p)?p:"00",minute:/^\d{2}$/.test(b)?b:"00"}}function oi({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Xe(Xf,{component:"span",sx:{color:"#9a9a97"},children:e})}var Yt=e=>({gridColumn:`${e}`,[Gr]:{gridColumn:"auto"}});function ca({values:e,customTabs:p,avatarSrcByName:b,managerLocked:c=!1,notice:i=!1,event:a=!1,hideDueDate:r=!1,hideReminder:t=!1,beforeStart:n,pinColumns:l=!1,readOnly:o=!1,targetSummary:s="",narrowCollapsedSx:f,reminderLocked:d=!1,managerAction:u,hideProject:g=!1,leading:m,trailing:v,onChangeProject:k,onChangeStartDate:B,onChangeDueDate:O,onChangeReminder:L,onChangePriority:R,onChangeEventTime:P,onChangeEventPlace:j,onChangeEventAddress:z,onMemberEdit:N,onAddProject:S}){let[C,E]=Io(null),[h,y]=Io(!1),[w,x]=Io(null),[_,T]=Io(null),[D,q]=Io(null),[$,W]=Io(null),[A,H]=Io(null),M=Bt(),I=sn(),F=l&&!a,U=(Z,K,Q=!1)=>[gn(Z),...Q&&f?Array.isArray(f)?f:[f]:[],...F&&K?[Yt(K)]:[]],X=p.find(Z=>Z.key===e.tabKey),V=p.filter(Z=>!Z.archived),G=Z=>{let K=!!String(e.startDate??"").trim();if(B(Z),K||i||a)return;let Q=Ja(Z);Number.isNaN(Q.getTime())||Q.getTime()<=Date.now()||T2("\uC2DC\uC791\uC77C\uC2DC\uAC00 \uB418\uBA74 \uCC45\uC784\uC790\uC5D0\uAC8C \uC54C\uB9BC\uC774 \uBC1C\uC1A1\uB429\uB2C8\uB2E4.")},ee=Xe(at,{icon:Xe(v2,{sx:{fontSize:17}}),label:"\uC0AC\uC804\uC54C\uB9BC",onClick:o||d?void 0:Z=>T(Z),sx:U(a?8:5,2,!0),children:e.reminder==="none"?Xe(oi,{label:"\uC5C6\uC74C"}):fl(e.reminder)});return Xr(la,{children:[Xr(Xf,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gridAutoFlow:"row dense",columnGap:3,rowGap:0,px:2,[Gr]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[m,g?null:Xe(at,{icon:Xe(p2,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:o?void 0:Z=>E(Z),sx:U(1,1,!0),children:X?(()=>{let Z=bt(X.icon);return Xr(la,{children:[Z?Xe(Z,{sx:{fontSize:16,color:"#1e3a8a"}}):null,X.label]})})():"\uAE30\uBCF8"}),i?Xe(at,{icon:Xe(Gf,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:o?void 0:()=>N("targets"),sx:U(7,1),children:s||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!i&&!a?Xe(at,{icon:Xe(b2,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:c||o||!e.managerName&&u?void 0:()=>N("manager"),sx:U(7,1),children:e.managerName?Xr(la,{children:[Xe(br,{names:[e.managerName],size:20,avatarSrcByName:b}),e.managerName]}):u??Xe(oi,{})}):null,n,a?null:Xe(at,{icon:Xe(m2,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC2DC",onClick:o?void 0:Z=>q(Z),sx:U(2,2),children:e.startDate?Yf(e.startDate):Xe(oi,{})}),i?null:Xe(at,{icon:Xe(Gf,{sx:{fontSize:17}}),label:a?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:o?void 0:()=>N("receivers"),sx:U(a?7:8,1),children:e.receiverNames.length>0?Xr(la,{children:[Xe(br,{names:e.receiverNames,size:20,avatarSrcByName:b}),e.receiverNames.length===1?e.receiverNames[0]:null]}):Xe(oi,{})}),r?null:Xe(at,{icon:Xe(g2,{sx:{fontSize:17}}),label:a?"\uB0A0\uC9DC":"\uB9C8\uAC10\uC77C\uC2DC",onClick:o?void 0:Z=>W(Z),sx:U(3,2),children:e.dueDate?a?jr(e.dueDate):Yf(e.dueDate):Xe(oi,{})}),a?Xe(at,{icon:Xe(x2,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:o?void 0:Z=>H(Z),sx:gn(4),children:e.eventTime?e.eventTime:Xe(oi,{label:"\uC885\uC77C"})}):null,a?Xe(at,{icon:Xe(_2,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:gn(5),children:Xe($n,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:o,onCommit:Z=>j?.(Z)})}):null,!t&&a?ee:null,a?Xe(at,{icon:Xe(k2,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},gn(6)],children:Xe(Kf,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:o,onCommit:Z=>z?.(Z)})}):null,a?null:Xe(at,{icon:Xe(y2,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:o?void 0:Z=>x(Z),sx:U(6,1,!0),children:Xe(Ir,{priority:e.priority,small:!0})}),!t&&!a?ee:null,v]}),Xr($l,{transitionDuration:0,anchorEl:C,open:!!C,onClose:()=>E(null),...I,children:[Xr(Fi,{selected:!e.tabKey,onClick:()=>{k(""),E(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Xe(w2,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:Xe(aa,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),V.map(Z=>{let K=bt(Z.icon),Q=e.tabKey===Z.key;return Xr(Fi,{selected:Q,onClick:()=>{k(Z.key),E(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[K?Xe(K,{sx:{fontSize:17,color:"#1e3a8a"}}):null,Z.label,Q?Xe(aa,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.key)}),S?[Xe(f2,{},"add-project-divider"),Xr(Fi,{onClick:()=>y(!0),sx:{fontSize:14,color:"#787774"},children:[Xe(d2,{children:Xe(h2,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),S?Xe(zs,{open:h,onClose:()=>y(!1),onSubmit:(Z,K,Q)=>{(async()=>{let J=await S(Z,K,Q);J&&k(J)})(),E(null)}}):null,Xe($l,{transitionDuration:0,anchorEl:w,open:!!w,onClose:()=>x(null),...I,children:["high","medium","low"].map(Z=>Xr(Fi,{selected:e.priority===Z,onClick:()=>{R(Z),x(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[Xe(Ir,{priority:Z,small:!0}),e.priority===Z?Xe(aa,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z))}),Xe($l,{transitionDuration:0,anchorEl:_,open:!!_,onClose:()=>T(null),...I,children:ul(a?!!e.eventTime:String(e.dueDate??"").includes(" ")).map(Z=>Xr(Fi,{selected:e.reminder===Z.value,onClick:()=>{L(Z.value),T(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[Z.label,e.reminder===Z.value?Xe(aa,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Z.value))}),a?Xe(S2,{anchorEl:A,open:!!A,onClose:()=>H(null),value:C2(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:M,locale:"ko",onChange:(Z,K)=>{P?.(`${Z}:${K}`),H(null)}}):null,Xe(Lr,{anchorEl:D,open:!!D,date:e.startDate,reminder:"none",hideReminder:!0,showTime:!0,centered:M,onClose:()=>q(null),onDateChange:G,onReminderChange:()=>{}}),Xe(Lr,{anchorEl:$,open:!!$,date:e.dueDate,reminder:e.reminder,hideReminder:d||t,showTime:!a,centered:M,onClose:()=>W(null),onDateChange:O,onReminderChange:L})]})}import{useState as B2}from"react";import{Box as I2,Menu as M2,MenuItem as E2}from"@mui/material";import R2 from"@mui/icons-material/RepeatOutlined";import A2 from"@mui/icons-material/DevicesOutlined";import O2 from"@mui/icons-material/ScreenSearchDesktopOutlined";import D2 from"@mui/icons-material/SellOutlined";import P2 from"@mui/icons-material/TaskAltOutlined";import{Fragment as Zf,jsx as ir,jsxs as Jf}from"react/jsx-runtime";function Hl({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return ir(I2,{component:"span",sx:{color:"#9a9a97"},children:e})}function ua({values:e,readOnly:p=!1,showResolution:b=!1,onChangeRepro:c,onChangeDevice:i,onChangeWhere:a,onChangeVersion:r,onChangeResolution:t}){let[n,l]=B2(null),o=n?.field==="repro"?Ua:n?.field==="device"?Va:Ka,s=f=>{n?.field==="repro"?c(f):n?.field==="device"?i(f):n?.field==="resolution"&&t?.(f),l(null)};return Jf(Zf,{children:[Jf(Zf,{children:[ir(at,{icon:ir(R2,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:p?void 0:f=>l({field:"repro",el:f}),children:uu(e.repro)||ir(Hl,{label:"\uC120\uD0DD"})}),ir(at,{icon:ir(A2,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:p?void 0:f=>l({field:"device",el:f}),children:fu(e.device)||ir(Hl,{label:"\uC120\uD0DD"})}),ir(at,{icon:ir(O2,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:ir($n,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:p,onCommit:a})}),ir(at,{icon:ir(D2,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:ir($n,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:p,onCommit:r})}),b?ir(at,{icon:ir(P2,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:p?void 0:f=>l({field:"resolution",el:f}),children:Ss(e.resolution)||ir(Hl,{label:"\uC120\uD0DD"})}):null]}),ir(M2,{open:!!n,anchorEl:n?.el??null,onClose:()=>l(null),transitionDuration:0,children:o.map(f=>ir(E2,{onClick:()=>s(f.key),sx:{fontSize:14},children:f.name},f.key))})]})}import{Box as Qf}from"@mui/material";import{jsxs as ed}from"react/jsx-runtime";var Wl=16;function qr({icon:e,title:p,titleExtra:b,children:c}){return ed(Qf,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[ed(Qf,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:Wl,fontWeight:500,color:"#37352f"},children:[e,p,b]}),c]})}import{useEffect as Ul,useRef as Mo,useState as N2}from"react";import{Box as Vl,IconButton as j2,Tooltip as L2}from"@mui/material";import F2 from"@mui/icons-material/ContentCopyOutlined";import z2 from"@mui/icons-material/Check";import{EhfuseEditor as q2,minimalToolbarOptions as $2}from"@ehfuse/editor";import{jsx as Eo,jsxs as W2}from"react/jsx-runtime";function Kl(e){let p=e.trim();return p?p.startsWith("<")?e:`<p>${p}</p>`:"<p></p>"}function H2(e){let p=e.replace(/<br\s*\/?>/gi,`
3
31
  `).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
4
- `),t=document.createElement("div");return t.innerHTML=o,(t.textContent??"").replace(/\n{3,}/g,`
32
+ `),b=document.createElement("div");return b.innerHTML=p,(b.textContent??"").replace(/\n{3,}/g,`
5
33
 
6
- `).trim()}function oa({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:a}){let l=Kn(null),p=Kn(null),c=i>0?i:0,m=Kn(c),d=Kn(a);d.current=a;let u=Kn(null),s=Kn(Date.now()+800),[g,T]=NT(!1),S=Re();Ol(()=>{if(n)return;let f=Pl(o);u.current===f||u.current===o||(u.current=f,s.current=Date.now()+800,l.current?.setHtml(f))},[e,o,n]);let b=Kn(-1);return Ol(()=>{if(n||S||i<=0||b.current===i||(b.current=i,Math.abs(i-m.current)<1))return;let f=p.current?.querySelector(".ehfuse-editor-container");f&&(Math.abs(f.getBoundingClientRect().height-i)<1||(f.style.height=`${i}px`,m.current=i))},[n,S,i]),Ol(()=>{if(n||S)return;let f=p.current?.querySelector(".ehfuse-editor-container");if(!f||typeof ResizeObserver>"u")return;let D,B=new ResizeObserver(R=>{let y=Math.round(R[0]?.contentRect.height??0);y<=0||(window.clearTimeout(D),D=window.setTimeout(()=>{Math.abs(y-m.current)<1||(m.current=y,d.current?.(y))},300))});return B.observe(f),()=>{window.clearTimeout(D),B.disconnect()}},[n,S]),n?GT(Rl,{sx:{position:"relative",mt:1},children:[Un(Rl,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:Pl(o)}}),Un(HT,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Un(FT,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(UT(o)).then(()=>{T(!0),window.setTimeout(()=>T(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:g?Un($T,{sx:{fontSize:17,color:"#2f9e5b"}}):Un(WT,{sx:{fontSize:17}})})})]}):Un(Rl,{ref:p,onDragOver:f=>f.stopPropagation(),onDrop:f=>f.stopPropagation(),sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:Un(VT,{ref:l,defaultValue:Pl(o),autoHeight:S,resizable:!S,showToolbar:!S,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:KT,locale:"ko",minHeight:c||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:f=>{let D=Date.now()<s.current,B=f===u.current;u.current=f,!(D||B)&&t(f)}})})}import{useState as Tr}from"react";import{Box as so,Button as Dm,Dialog as i0,IconButton as yr,Switch as a0,TextField as l0,Tooltip as Al}from"@mui/material";import{DndContext as s0,PointerSensor as c0,closestCenter as m0,useSensor as u0,useSensors as d0}from"@dnd-kit/core";import{restrictToParentElement as p0,restrictToVerticalAxis as f0}from"@dnd-kit/modifiers";import{SortableContext as x0,arrayMove as g0,useSortable as h0,verticalListSortingStrategy as b0}from"@dnd-kit/sortable";import{CSS as k0}from"@dnd-kit/utilities";import Mm from"@mui/icons-material/Close";import T0 from"@mui/icons-material/AddCircle";import Em from"@mui/icons-material/AddTask";import y0 from"@mui/icons-material/Checklist";import S0 from"@mui/icons-material/CheckCircle";import B0 from"@mui/icons-material/DragIndicator";import C0 from"@mui/icons-material/Launch";import v0 from"@mui/icons-material/LinkOutlined";import I0 from"@mui/icons-material/RadioButtonUnchecked";import{useEffect as jT,useMemo as YT,useState as zl}from"react";import{Box as ln,Button as XT,Tab as QT,Tabs as ZT}from"@mui/material";import{FormDialog as JT}from"@ehfuse/mui-form-dialog";import{ClearTextField as e0}from"@ehfuse/mui-form-controls";import{ErrorAlert as o0}from"@ehfuse/alerts";import t0 from"@mui/icons-material/CheckCircle";import n0 from"@mui/icons-material/RadioButtonUnchecked";import{OverlayScrollbar as r0}from"@ehfuse/overlay-scrollbar";import{jsx as wo,jsxs as ql}from"react/jsx-runtime";var wm=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function ta({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:a=!1,title:l="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:p="\uC5F0\uACB0",multiSelect:c=!1}){let m=Re(),[d,u]=zl("related"),[s,g]=zl(""),[T,S]=zl([]);jT(()=>{e&&(u("related"),g(""),S([]))},[e]);let b=YT(()=>{let y=new Set([o.seq,...n]),I=s.trim().toLowerCase();return t.filter(P=>y.has(P.seq)||P.is_event||P.is_notice||P.linked_only?!1:I?P.title.toLowerCase().includes(I)||(P.ticket_no??"").toLowerCase().includes(I):!0).sort((P,_)=>!!P.completed!=!!_.completed?P.completed?1:-1:_.seq-P.seq)},[t,o.seq,n,s]),f=()=>{if(T.length===0){o0("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let y of T)i(y,d);r()},D=y=>{S(I=>I.includes(y)?I.filter(P=>P!==y):c?[...I,y]:[y])},B=wm.find(y=>y.type===d)?.hint??"",R=ql(ln,{sx:{...m?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...m?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[a?null:wo(ZT,{value:d,onChange:(y,I)=>u(I),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:wm.map(y=>wo(QT,{value:y.type,label:y.label},y.type))}),a?null:wo(ln,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:B}),wo(ln,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:wo(e0,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:s,onChange:y=>g(y.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),wo(ln,{sx:{flex:1,minHeight:0},children:wo(r0,{style:{height:"100%"},contentStyle:{paddingTop:0},children:wo(ln,{sx:{display:"flex",flexDirection:"column"},children:b.length===0?wo(ln,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(y=>{let I=y.is_notice||y.is_event?Ce(y.icon||(y.is_notice?no:fo)):null,P=T.includes(y.seq);return ql(ln,{onClick:()=>D(y.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:1.25,flexShrink:0,cursor:"pointer",borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none"},bgcolor:P?"#e3eefb":"transparent","&:hover":{bgcolor:P?"#e3eefb":"#f7f7f5"}},children:[P?wo(t0,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):wo(n0,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),I?wo(I,{sx:{fontSize:17,flexShrink:0,color:y.icon_color||"#1e3a8a"}}):null,ql(ln,{component:"span",sx:{flex:1,minWidth:0,fontSize:15,color:"#37352f",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,overflow:"hidden",lineHeight:1.5,wordBreak:"break-word"},children:[y.ticket_no?`${y.ticket_no} `:"",y.title]}),wo(ln,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:wo(Ae,{option:vo(y)})})]},y.seq)})})})})]});return wo(JT,{open:e,onClose:r,maxWidth:"sm",fullScreen:m,mobilePresentation:m?"slide":"dialog",...m?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:m?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:l,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:R}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:wo(XT,{variant:"contained",disabled:T.length===0,onClick:f,children:p})}})}import{Fragment as D0,jsx as ce,jsxs as Rt}from"react/jsx-runtime";var Om="taskbox.checklist.hideCompleted";function _0({id:e,children:o}){let{attributes:t,listeners:n,setNodeRef:r,transform:i,transition:a,isDragging:l}=h0({id:e});return ce(so,{ref:r,sx:{transform:k0.Transform.toString(i),transition:a,...l?{opacity:.6,position:"relative",zIndex:1}:{}},children:o({handleProps:{...t,...n},dragging:l})})}function w0({sortable:e,sensors:o,rowIds:t,onDragEnd:n,children:r}){let i=ce(so,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:r});return e?ce(s0,{sensors:o,collisionDetection:m0,modifiers:[f0,p0],onDragEnd:n,children:ce(x0,{items:t,strategy:b0,children:i})}):i}function na({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,onReorder:a,removeLocked:l=!1,onConvertToTask:p,onOpenLinkedTask:c,linkCandidates:m,linkBaseTask:d,onLinkExistingTask:u,resolveLinkedTask:s,myAccountSeq:g=0}){let[T,S]=Tr(""),[b,f]=Tr(!1),[D,B]=Tr(null),R=Re(),[y,I]=Tr(null),[P,_]=Tr(null),v=W=>{let U=W.task_seq?s?.(W.task_seq):void 0;return U?U.completed:W.checked},$=W=>{if(!W.task_seq||g<=0)return!1;let U=s?.(W.task_seq);return U?!Qs(U,g):!1},h=o.filter(v).length,[x,C]=Tr(()=>{try{return localStorage.getItem(Om)==="1"}catch{return!1}}),L=W=>{C(W);try{localStorage.setItem(Om,W?"1":"0")}catch{}},N=!!a&&!R&&!l,k=d0(u0(c0,{activationConstraint:{distance:5}})),w=(W,U)=>W.task_seq?`linked-${W.task_seq}`:`row-${U}`,G=o.map(w),ae=x?G.filter((W,U)=>!v(o[U])):G,ie=W=>{let{active:U,over:de}=W;if(!de||U.id===de.id)return;let Be=G.indexOf(String(U.id)),ve=G.indexOf(String(de.id));Be<0||ve<0||a?.(e,g0(o,Be,ve))},be=()=>{T.trim()&&(t(e,T),S(""))};return Rt(rt,{icon:ce(y0,{sx:{fontSize:19,display:"block"}}),title:Rt(D0,{children:["\uD560\uC77C",o.length>0?Rt(so,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[h," / ",o.length]}):null]}),titleExtra:o.length>0?Rt(so,{sx:{flex:1,minWidth:0,ml:1,display:"flex",alignItems:"center",gap:1},children:[ce(so,{sx:{flex:1,minWidth:0,height:6,borderRadius:3,bgcolor:"#ececea"},children:ce(so,{sx:{height:"100%",borderRadius:3,width:`${Math.round(h/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}),h>0?Rt(so,{component:"label",sx:{display:"inline-flex",alignItems:"center",gap:.25,flexShrink:0,cursor:"pointer",fontSize:13.5,fontWeight:400,color:"#57564f",userSelect:"none"},children:[ce(a0,{size:"small",checked:x,onChange:(W,U)=>L(U)}),"\uC644\uB8CC\uC228\uAE40"]}):null]}):null,children:[ce(w0,{sortable:N,sensors:k,rowIds:ae,onDragEnd:ie,children:o.map((W,U)=>{let de=W.task_seq?s?.(W.task_seq):void 0,Be=v(W);if(x&&Be)return null;let ve=!!W.task_seq,j=$(W),F=oe=>Rt(so,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,...N?{ml:-3,pl:.5}:{},py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1},"&:hover .taskbox-checklist-handle":{opacity:1}},children:[oe?ce(so,{className:"taskbox-checklist-handle",...oe,sx:{display:"inline-flex",flexShrink:0,alignItems:"center",color:"#c9c8c5",opacity:0,transition:"opacity 0.15s",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:ce(B0,{sx:{fontSize:16}})}):null,ce(Al,{title:j?"\uC5F0\uACB0 \uC5C5\uBB34\uC758 \uC791\uC131\uC790\xB7\uCC45\uC784\uC790\uB9CC \uC644\uB8CC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4":"",arrow:!0,disableInteractive:!0,children:ce(so,{component:"span",onClick:j?void 0:()=>n(e,U,!Be),sx:{display:"inline-flex",flexShrink:0,cursor:j?"default":"pointer"},children:Be?ce(S0,{sx:{fontSize:18,color:j?"#a9c6ec":"#2f80ed"}}):ce(I0,{sx:{fontSize:18,color:j?"#d6d5d1":"#9a9a97"}})})}),D?.index===U?ce(so,{component:"input",autoFocus:!0,spellCheck:!1,value:D.label,enterKeyHint:"done",onChange:A=>B({index:U,label:A.target.value}),onBlur:()=>{D.label.trim()&&D.label.trim()!==W.label&&i?.(e,U,D.label),B(null)},onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&B(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):ce(so,{component:"span",onClick:ve?W.task_seq&&c?()=>c(W.task_seq):void 0:l||!i?void 0:R?()=>I({index:U,label:W.label}):()=>B({index:U,label:W.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:Be?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...ve?c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:l||!i?{}:{cursor:"text"}},children:W.label}),ve?Rt(so,{component:"span",onClick:W.task_seq&&c?()=>c(W.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...c?{cursor:"pointer"}:{}},children:[ce(C0,{sx:{fontSize:12}}),de?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!l&&!ve&&p?ce(Al,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:ce(yr,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:A=>_({anchorEl:A.currentTarget,index:U,label:W.label}),sx:{display:R?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:ce(Em,{sx:{fontSize:16}})})}):null,l?null:ce(yr,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,U),sx:{display:R?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:ce(Mm,{sx:{fontSize:15}})})]});return N?ce(_0,{id:G[U],children:({handleProps:oe})=>F(oe)},G[U]):ce(so,{children:F(null)},G[U])})}),Rt(so,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[ce(so,{component:"input",spellCheck:!1,value:T,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:W=>S(W.target.value),onKeyDown:W=>{W.key==="Enter"&&be()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),m&&d&&u?ce(Al,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:ce(yr,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:W=>W.preventDefault(),onClick:()=>f(!0),sx:{flexShrink:0,color:"#9a9a97"},children:ce(v0,{sx:{fontSize:20}})})}):null,ce(yr,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!T.trim(),onMouseDown:W=>W.preventDefault(),onClick:be,sx:{flexShrink:0,color:T.trim()?"#2f80ed":"#c9c8c5"},children:ce(T0,{sx:{fontSize:20}})})]}),m&&d&&u?ce(ta,{open:b,task:d,tasks:m,excludeSeqs:o.map(W=>Number(W.task_seq??0)).filter(W=>W>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>f(!1),onSubmit:W=>{let U=m.find(de=>de.seq===W);u(e,W,String(U?.title??"").trim())}}):null,ce(Pe,{open:!!P,anchorEl:P?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>_(null),onConfirm:()=>{P&&p?.(e,P.index,P.label),_(null)}}),ce(i0,{open:!!y,onClose:()=>I(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:Rt(so,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[ce(so,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),ce(l0,{autoFocus:!0,fullWidth:!0,size:"medium",value:y?.label??"",onChange:W=>I(U=>U&&{...U,label:W.target.value}),onKeyDown:W=>{if(W.key!=="Enter")return;let U=y;U&&U.label.trim()&&i?.(e,U.index,U.label.trim()),I(null)}}),Rt(so,{sx:{display:"flex",alignItems:"center",gap:1},children:[!l&&p&&y&&!o[y.index]?.task_seq?ce(yr,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{p(e,y.index,o[y.index]?.label??""),I(null)},sx:{color:"#57564f"},children:ce(Em,{sx:{fontSize:20}})}):null,!l&&y?ce(yr,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,y.index),I(null)},sx:{color:"#e5484d"},children:ce(Mm,{sx:{fontSize:19}})}):null,ce(so,{sx:{flex:1}}),ce(Dm,{color:"inherit",onClick:()=>I(null),children:"\uCDE8\uC18C"}),ce(Dm,{variant:"contained",disabled:!y?.label.trim(),onClick:()=>{y&&y.label.trim()&&i?.(e,y.index,y.label.trim()),I(null)},children:"\uD655\uC778"})]})]})})]})}import{useRef as z0,useState as q0}from"react";import{Box as Pt,IconButton as A0}from"@mui/material";import L0 from"@mui/icons-material/Close";import zm from"@mui/icons-material/AttachFileOutlined";var M0=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),ra=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return M0.has(o)};import{LinearProgress as E0}from"@mui/material";import{Fragment as O0,jsx as P0,jsxs as R0}from"react/jsx-runtime";function Rm(e){let o=$t(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),a=n??0;return!a||e>0&&(t??0)!==e?null:{index:a,total:r??0,queue:i??[]}}function Ll(){let o=$t().useValue("attachmentUpload.progress");return R0(O0,{children:[o??0,"%"]})}function Pm(){let o=$t().useValue("attachmentUpload.progress");return P0(E0,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as N0,jsx as $o,jsxs as Zr}from"react/jsx-runtime";function ia(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var aa={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function la({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:a}){let[l,p]=q0(!1),c=z0(null),m=Re(),d=Pr(),u=Rr(),s=Rm(e),g=e===0,T=B=>{if(i){i(B);return}window.open(u(B.uuid??""),"_blank","noopener,noreferrer")},S=B=>{if(a){a(B);return}window.open(u(B.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},b=B=>s?B+1<s.index?"done":B+1===s.index?"uploading":"waiting":"waiting",f=(B,R,y,I={})=>Zr(Pt,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:I.uploading?"#d5e6fb":"#e6e6e3",bgcolor:I.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[Zr(Pt,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[$o(zm,{sx:{fontSize:16,color:"#9a9a97"}}),R,$o(Pt,{component:"span",sx:{fontSize:12,color:I.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:y}),I.removeIndex!==void 0?$o(A0,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,I.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:$o(L0,{sx:{fontSize:15}})}):null]}),I.uploading?$o(Pm,{}):null]},B),D=B=>{let R=ra(B.name);return $o(Pt,{component:"button",type:"button",onClick:()=>R?T(B):S(B),title:`${B.name} ${R?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...aa,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:B.name})};return Zr(rt,{icon:$o(zm,{sx:{fontSize:18,display:"block"}}),title:Zr(N0,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[Zr(Pt,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((B,R)=>{let y=`${B.uuid||B.name}-${R}`;if(g){let I=b(R),P=I==="uploading";return f(y,$o(Pt,{component:"span",sx:{...aa,color:I==="done"?"#37352f":"#9a9a97"},children:B.name}),P?$o(Ll,{}):ia(B.size),{uploading:P,removeIndex:!r&&!s?R:void 0})}return B.uuid?f(y,D(B),ia(B.size),{removeIndex:r?void 0:R}):f(y,$o(Pt,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...aa,color:"#9a9a97"},children:B.name}),ia(B.size),{removeIndex:r?void 0:R})}),!g&&s?s.queue.slice(s.index-1).map((B,R)=>{let y=R===0;return f(`uploading-${s.index+R}-${B.name}`,$o(Pt,{component:"span",sx:{...aa,color:"#9a9a97"},children:B.name}),y?$o(Ll,{}):ia(B.size),{uploading:y})}):null]}),$o(Pt,{onClick:()=>c.current?.click(),onDragOver:B=>{B.preventDefault(),p(!0)},onDragLeave:()=>p(!1),onDrop:B=>{B.preventDefault(),p(!1);let R=Array.from(B.dataTransfer.files);R.length>0&&t(e,R)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:l?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:l?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:m?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${d}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${d}MB)`}),$o(Pt,{component:"input",ref:c,type:"file",multiple:!0,onChange:B=>{let R=Array.from(B.target.files??[]);R.length>0&&t(e,R),B.target.value=""},sx:{display:"none"}})]})}import{useState as U0}from"react";import{Checkbox as G0,Divider as j0,ListItemIcon as Y0,Menu as X0,MenuItem as Nm}from"@mui/material";import Q0 from"@mui/icons-material/Add";import{useEffect as F0,useState as qm}from"react";import{Box as Nl,Button as H0}from"@mui/material";import{FormDialog as W0}from"@ehfuse/mui-form-dialog";import{ClearTextField as $0}from"@ehfuse/mui-form-controls";import{ColorPicker as V0}from"@ehfuse/mui-color-picker";import{ErrorAlert as K0}from"@ehfuse/alerts";import{jsx as Jr,jsxs as Fl}from"react/jsx-runtime";var Am="#2f80ed";function Lm({open:e,onClose:o,onSubmit:t}){let[n,r]=qm(""),[i,a]=qm(Am);F0(()=>{e&&(r(""),a(Am))},[e]);let l=()=>{let m=n.trim();if(!m){K0("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(m,i),o()},p=Hs(i),c=Fl(Nl,{children:[Fl(Nl,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[Jr($0,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:m=>r(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),l())},fullWidth:!0,autoFocus:!0}),Jr(V0,{value:i,onChange:m=>a(m),shape:"circle",colorSize:28})]}),Fl(Nl,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",Jr(Ae,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...p}})]})]});return Jr(W0,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:c}],actions:{showCancelButton:!0,right:Jr(H0,{variant:"contained",onClick:l,children:"\uCD94\uAC00"})}})}import{Fragment as Z0,jsx as Sr,jsxs as sa}from"react/jsx-runtime";function ca({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[a,l]=U0(!1),p=St();return sa(Z0,{children:[sa(X0,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...p,children:[t.map(c=>{let m=o.includes(c.key);return sa(Nm,{onClick:()=>n(c.key),sx:{fontSize:14,minWidth:170,gap:1},children:[Sr(G0,{size:"small",checked:m,sx:{p:0}}),Sr(Ae,{option:c})]},c.key)}),Sr(j0,{}),sa(Nm,{onClick:()=>l(!0),sx:{fontSize:14,color:"#787774"},children:[Sr(Y0,{children:Sr(Q0,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),Sr(Lm,{open:a,onClose:()=>l(!1),onSubmit:r})]})}function Fm(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function Hm(e,o){let t=(e.target_account_seqs??[]).filter(d=>d>0);if(t.length===0)return null;let n=new Set(t),r=Fm(e,o),i=new Map;for(let d of r){let u=String(d.department??"").trim();if(!u)continue;let s=i.get(u)??[];s.push(d),i.set(u,s)}let a=[],l=new Set;for(let[d,u]of i)if(u.every(g=>n.has(Number(g.account_seq??0)))){a.push(d);for(let g of u)l.add(Number(g.account_seq??0))}let p=new Map(r.map(d=>[Number(d.account_seq??0),d.name])),c=e.target_names??[],m=[];return t.forEach((d,u)=>{l.has(d)||m.push(p.get(d)??c[u]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:m}}function ma(e,o){let t=Hm(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function w2(e,o){let t=Hm(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function Wm(e,o,t){let n=(e.target_account_seqs??[]).filter(s=>s>0),r=Fm(e,o),i=n.length>0?n.length:r.length,a=e.acks??[],l=t>0&&a.some(s=>s.account_seq===t),p=t>0&&Number(e.author_account_seq??0)===t,c=n.length===0||n.includes(t),m=new Set(a.map(s=>s.account_seq)),u=(n.length>0?r.filter(s=>n.includes(Number(s.account_seq??0))):r).filter(s=>!m.has(Number(s.account_seq??0))).map(s=>String(s.name??"").trim()).filter(s=>s.length>0);return{count:a.length,total:i,acked:l,pendingNames:u,canAck:t>0&&!p&&c&&!l&&!e.completed}}function $m(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(l=>l.size>n),i=e.filter(l=>l.size<=n),a=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
7
- \uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(l=>l.name).join(", ")}`:null;return{accepted:i,rejected:r,message:a}}import{DatePicker as cy}from"@ehfuse/mui-datetime-picker";import{Fragment as ti,jsx as re,jsxs as jn}from"react/jsx-runtime";var jm="#0f9d58";function $l({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:a=!1,hideBug:l=!1,leadingRow:p,hideLabel:c=!1,employees:m=[],myAccountSeq:d=0,departments:u=[],myGroupSeq:s=0,onMemberEdit:g,onAddProject:T,onAddLabelOption:S,contentSyncKey:b="create"}){let f=$t(),D=Pr(),B=e.useFormValue("manager_name"),R=e.useFormValue("receiver_names"),y=e.useFormValue("start_date"),I=!!e.useFormValue("is_event"),P=!!e.useFormValue("is_bug"),_=e.useFormValue("bug_repro")??"",v=e.useFormValue("bug_device")??"",$=e.useFormValue("bug_where")??"",h=e.useFormValue("bug_version")??"",x=e.useFormValue("event_time")??"",C=e.useFormValue("event_place")??"",L=e.useFormValue("event_address")??"",N=e.useFormValue("due_date"),k=e.useFormValue("reminder"),w=e.useFormValue("priority"),G=e.useFormValue("content"),ie=e.useFormValue("checklist")??[],be=e.useFormValue("tab_key"),W=e.useFormValue("sprint_seq")??0,U=e.useFormValue("story_points")??0,de=t.find(E=>E.key===be&&E.useSprints),Be=de?n.filter(E=>`custom-${E.group_seq}`===be):[],[ve,j]=ei(null),F=e.useFormValue("label_keys"),[oe,A]=ei(null),V=e.useFormValue("visibility")||"involved",te=Number(e.useFormValue("visibility_group_seq")??0),[z,me]=ei(null),ke=e.useFormValue("repeat_rule")||"",He=e.useFormValue("repeat_until")||"",[Xe,we]=ei(null),[to,X]=ei(null),K=e.useFormValue("target_names"),uo=e.useFormValue("target_account_seqs"),pn=f.useValue("createAttachmentFiles")??[],wn=i?ma({author_account_seq:d,target_names:K,target_account_seqs:uo},m):"";return jn(ti,{children:[p,i?null:re(Gn,{sx:{display:"flex",gap:1.25,px:2,pt:1.5,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...l?[]:[{value:"bug",label:"\uC624\uB958"}]].map(E=>{let he=P?"bug":I?"event":"task",Ie=he===E.value;return re(J0,{onClick:()=>{if(he===E.value)return;e.setFormValue("is_event",E.value==="event"),e.setFormValue("is_bug",E.value==="bug"),e.setFormValue("visibility",E.value==="bug"?"all":"involved"),e.setFormValue("visibility_group_seq",0),E.value==="bug"&&(e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until",""));let Ne=e.getFormValue("icon"),We=e.getFormValue("icon_color"),co=[Wt,"event",zr].includes(Ne),Oo=!We||We===jm||We===qr;co&&e.setFormValue("icon",E.value==="event"?"event":E.value==="bug"?zr:Wt),Oo&&e.setFormValue("icon_color",E.value==="event"?jm:E.value==="bug"?qr:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:Ie?600:400,color:Ie?"#ffffff":"#787774",bgcolor:Ie?"#2563eb":"#f4f4f2"},children:E.label},E.label)})}),re(oi,{sx:{borderColor:"#e6e6e3"}}),jn(Gn,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[re(Ji,{hideProject:a,hideDueDate:!I&&!!ke,hideReminder:!!ke,values:{tabKey:be,managerName:B,receiverNames:R,startDate:y,dueDate:N,reminder:k,priority:w,eventTime:x,eventPlace:C,eventAddress:L},customTabs:t,avatarSrcByName:r,notice:i,event:I,onChangeEventTime:E=>e.setFormValue("event_time",E),onChangeEventPlace:E=>e.setFormValue("event_place",E),onChangeEventAddress:E=>e.setFormValue("event_address",E),targetSummary:wn,onChangeProject:E=>e.setFormValue("tab_key",E),onAddProject:T,onChangeStartDate:E=>e.setFormValue("start_date",E),onChangeDueDate:E=>e.setFormValue("due_date",E),onChangeReminder:E=>e.setFormValue("reminder",E),onChangePriority:E=>e.setFormValue("priority",E),onMemberEdit:g,pinColumns:!0,beforeStart:jn(ti,{children:[!i&&!P?re(pe,{icon:re(iy,{sx:{fontSize:17,...ke?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:E=>we(E),sx:I?void 0:io(2),children:ke?ji(ke):re(Gn,{component:"span",sx:{color:"#9a9a97"},children:"\uC5C6\uC74C"})}):null,!i&&!P&&ke?re(pe,{icon:re(ay,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:E=>X(E),sx:I?void 0:io(2),children:He?et(He):re(Gn,{component:"span",sx:{color:"#9a9a97"},children:"\uC790\uB3D9"})}):null]}),trailing:jn(ti,{children:[i?null:re(pe,{icon:V==="all"?re(Km,{sx:{fontSize:17,color:"#2f80ed"}}):V==="group"?re(Um,{sx:{fontSize:17,color:"#d9730d"}}):re(Vm,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:E=>me(E),sx:I?void 0:io(1),children:V==="all"?"\uC804\uCCB4\uACF5\uAC1C":V==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${u.find(E=>E.seq===te)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}),de&&!I&&!i?jn(ti,{children:[re(pe,{icon:re(ry,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:E=>j(E),sx:io(1),children:W>0?Be.find(E=>E.seq===W)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":re(Gn,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),re(pe,{icon:re(ly,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:io(1),children:re(an,{value:U>0?String(U):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:E=>e.setFormValue("story_points",Number(E.replace(/[^0-9.]/g,""))||0)})})]}):null,P?re(ea,{values:{repro:_,device:v,where:$,version:h},onChangeRepro:E=>e.setFormValue("bug_repro",E),onChangeDevice:E=>e.setFormValue("bug_device",E),onChangeWhere:E=>e.setFormValue("bug_where",E),onChangeVersion:E=>e.setFormValue("bug_version",E)}):null]}),leading:I||c?null:re(Gn,{sx:{gridColumn:"1 / -1"},children:re(pe,{icon:re(ny,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:E=>A(E),children:(F??[]).length>0?re(hn,{labelKeys:F??[],labelOptions:o}):re(Gn,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),re(oi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),re(rt,{icon:re(oy,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:re(oa,{syncKey:b,value:G,onChange:E=>e.setFormValue("content",E)})}),I?null:re(oi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),I?null:re(na,{taskSeq:0,checklist:ie,onAdd:(E,he)=>e.setFormValue("checklist",[...ie,{label:he,checked:!1}]),onToggle:(E,he,Ie)=>e.setFormValue("checklist",ie.map((Ne,We)=>We===he?{...Ne,checked:Ie}:Ne)),onRemove:(E,he)=>e.setFormValue("checklist",ie.filter((Ie,Ne)=>Ne!==he)),onUpdate:(E,he,Ie)=>e.setFormValue("checklist",ie.map((Ne,We)=>We===he?{...Ne,label:Ie}:Ne))}),re(oi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),re(la,{taskSeq:0,attachments:pn.map(E=>({name:E.name,size:E.size})),onAdd:(E,he)=>{let Ie=$m(he,D);Ie.message&&Gm(Ie.message),Ie.accepted.length!==0&&f.setValue("createAttachmentFiles",[...f.getValue("createAttachmentFiles")??[],...Ie.accepted])},onRemove:(E,he)=>f.setValue("createAttachmentFiles",pn.filter((Ie,Ne)=>Ne!==he))}),P?null:jn(ti,{children:[re(oi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),re(rt,{icon:re(ty,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:re(sy,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),re(Hl,{transitionDuration:0,anchorEl:ve,open:!!ve,onClose:()=>j(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...Be.map(E=>({seq:E.seq,label:tt(E)}))].map(E=>re(Wl,{onClick:()=>{e.setFormValue("sprint_seq",E.seq),j(null)},sx:{fontSize:14,minWidth:170},children:E.label},E.seq))}),re(Hl,{transitionDuration:0,anchorEl:Xe,open:!!Xe,onClose:()=>we(null),children:[{value:"",label:"\uC5C6\uC74C"},...Xr].map(E=>re(Wl,{selected:ke===E.value,onClick:()=>{if(we(null),E.value===""){e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until","");return}let he;if(I){if(he=String(e.getFormValue("due_date")??"").slice(0,10),!he){Gm("\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}}else{if(he=String(e.getFormValue("start_date")??"").slice(0,10),!he){let Ie=new Date,Ne=We=>String(We).padStart(2,"0");he=`${Ie.getFullYear()}-${Ne(Ie.getMonth()+1)}-${Ne(Ie.getDate())}`}e.setFormValue("due_date",""),e.setFormValue("reminder","none")}e.setFormValue("repeat_rule",E.value),e.setFormValue("repeat_until",Yi(he,E.value))},sx:{fontSize:14,minWidth:140},children:E.label},E.value||"none"))}),re(cy,{anchorEl:to,open:!!to,onClose:()=>X(null),selectedDate:He?new Date(`${He}T00:00:00`):new Date,onDateChange:E=>{let he=Ie=>String(Ie).padStart(2,"0");e.setFormValue("repeat_until",`${E.getFullYear()}-${he(E.getMonth()+1)}-${he(E.getDate())}`),X(null)}}),re(Hl,{transitionDuration:0,anchorEl:z,open:!!z,onClose:()=>me(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",tip:"\uC791\uC131\uC790\xB7\uCC45\uC784\uC790\xB7\uCC38\uC870\uC790\uB9CC \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:re(Vm,{sx:{fontSize:17,color:"#57564f"}}),selected:V==="involved",onPick:()=>{e.setFormValue("visibility","involved"),e.setFormValue("visibility_group_seq",0)}},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",tip:"\uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:re(Km,{sx:{fontSize:17,color:"#2f80ed"}}),selected:V==="all",onPick:()=>{e.setFormValue("visibility","all"),e.setFormValue("visibility_group_seq",0)}},...[...u].sort((E,he)=>E.seq===s?-1:he.seq===s?1:0).map(E=>({key:`group-${E.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${E.name}`,tip:`${E.name} \uC18C\uC18D \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:re(Um,{sx:{fontSize:17,color:"#d9730d"}}),selected:V==="group"&&te===E.seq,onPick:()=>{e.setFormValue("visibility","group"),e.setFormValue("visibility_group_seq",E.seq)}}))].map(E=>re(ey,{title:E.tip,arrow:!0,disableInteractive:!0,placement:"right",children:jn(Wl,{selected:E.selected,onClick:()=>{E.onPick(),me(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[E.icon,E.label]})},E.key))}),re(ca,{anchorEl:oe,selectedKeys:F??[],labelOptions:o,onToggle:E=>e.setFormValue("label_keys",bi(F??[],E)),onAddLabel:(E,he)=>S?.(E,he),onClose:()=>A(null)})]})}import{Fragment as Xm,jsx as Je,jsxs as ua}from"react/jsx-runtime";function Sz({open:e,onClose:o,...t}){let{form:n,presetTitle:r="",presetContent:i="",presetVisibility:a,presetVisibilityGroupSeq:l=0,presetDueDate:p="",presetTabKey:c="",presetManager:m=null,isNotice:d=!1,defaultBug:u=!1}=t,s=$t(),g=uy(!1),[T,S]=dy(0),b=n.useFormValue("title"),f=n.useFormValue("icon"),D=n.useFormValue("icon_color"),B=!!n.useFormValue("is_event"),R=!!n.useFormValue("is_bug"),y=Re(),P=s.useValue("createSubmitting")??!1,_=d||B?Ce(f||(d?no:fo)):null,v=d?"\uACF5\uC9C0 \uB4F1\uB85D":B?"\uC77C\uC815 \uB4F1\uB85D":R?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",$=d?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":B?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":R?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";my(()=>{let x=g.current;g.current=e,!(!e||x)&&(n.setFormValues({...n.getFormValues(),title:r,icon:d?no:u?zr:Wt,icon_color:d?"#e5484d":u?qr:"",manager_name:m?.name??"",manager_account_seq:m?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:d,is_event:!1,is_bug:u,visibility:a??(u?"all":"involved"),visibility_group_seq:a==="group"?l:0,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:p,reminder:"none",priority:"medium",note:"",content:i,checklist:[],tab_key:c}),s.setValue("createAttachmentFiles",[]),S(C=>C+1))},[e]);let h=ua(zt,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[_?Je(zt,{sx:{display:"flex",p:0,color:D||"#1e3a8a"},children:Je(_,{sx:{fontSize:20}})}):null,Je(zt,{component:"input",autoFocus:!0,spellCheck:!1,value:b,placeholder:$,onChange:x=>n.setFormValue("title",x.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}})]});return y?Je(Xm,{children:Je(hy,{open:e,onClose:o,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:v,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:Je(Vl,{variant:"contained",size:"small",disableElevation:!0,disabled:P,onClick:P?void 0:n.submit,sx:{ml:2,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:P?"\uC800\uC7A5 \uC911\u2026":""}]},fullScreen:!0,mobilePresentation:"slide",tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!1},sections:[{id:"task-create",title:"",showTitle:!1,children:Je(zt,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:Je($l,{...t,contentSyncKey:`create-${T}`,leadingRow:h})})}]})}):Je(Xm,{children:Je(py,{anchor:"right",open:e,onClose:o,sx:{zIndex:x=>x.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:ua(zt,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[ua(zt,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[_?Je(zt,{sx:{display:"flex",px:.5,color:D||"#1e3a8a"},children:Je(_,{sx:{fontSize:20}})}):null,Je(zt,{component:"input",autoFocus:!0,spellCheck:!1,value:b,placeholder:$,onChange:x=>n.setFormValue("title",x.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),Je(fy,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:Je(xy,{})})]}),Je(Ym,{sx:{borderColor:"#e6e6e3"}}),Je(zt,{sx:{flex:1,minHeight:0},children:Je(gy,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Je($l,{...t,contentSyncKey:`create-${T}`})})}),Je(Ym,{sx:{borderColor:"#e6e6e3"}}),ua(zt,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[Je(Vl,{onClick:o,color:"inherit",disabled:P,children:"\uCDE8\uC18C"}),Je(Vl,{onClick:n.submit,variant:"contained",disabled:P,children:P?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})})})}import{useEffect as yu,useRef as Su,useState as Bu}from"react";import{Box as ba,Button as hS,Divider as Cu,Drawer as bS}from"@mui/material";import kS from"@mui/icons-material/ShareOutlined";import TS from"@mui/icons-material/HistoryOutlined";import yS from"@ehfuse/overlay-scrollbar";import{FormDialog as SS}from"@ehfuse/mui-form-dialog";import{SuccessAlert as vu}from"@ehfuse/alerts";import{useRef as Ul,useState as Br}from"react";import{Box as ue,Button as Qm,Chip as da,IconButton as xt,Tooltip as ou}from"@mui/material";import Zm from"@mui/icons-material/Send";import{TextField as by}from"@ehfuse/mui-form-controls";import pa from"@mui/icons-material/Close";import ky from"@mui/icons-material/EditOutlined";import Ty from"@mui/icons-material/Favorite";import yy from"@mui/icons-material/FavoriteBorderOutlined";import Sy from"@mui/icons-material/CheckCircle";import By from"@mui/icons-material/CheckCircleOutlineOutlined";import Cr from"@mui/icons-material/AttachFileOutlined";import Cy from"@mui/icons-material/AddCircleOutline";import vy from"@mui/icons-material/ImageOutlined";var Kl=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};import{Fragment as eu,jsx as Z,jsxs as eo}from"react/jsx-runtime";var Iy=5;function Jm({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(c=>c.account_seq===t),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",l=r.length===0?a:Z(ue,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(c=>`${c.name} \xB7 ${c.time}`).join(`
8
- `)}),p=e==="like"?"#e5484d":"#2f80ed";return Z(ou,{title:l,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:eo(ue,{sx:{display:"inline-flex",alignItems:"center"},children:[Z(xt,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?p:"#c9c8c5",p:.5},children:e==="like"?i?Z(Ty,{sx:{fontSize:16}}):Z(yy,{sx:{fontSize:16}}):i?Z(Sy,{sx:{fontSize:16}}):Z(By,{sx:{fontSize:16}})}),r.length>0?Z(ue,{component:"span",sx:{fontSize:12,color:i?p:"#9a9a97",ml:-.25},children:r.length}):null]})})}function tu({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:l,onPreview:p,onDownload:c}){let[m,d]=Br(null),u=Ul(null),[s,g]=Br(null),[T,S]=Br(!1),b=Math.max(0,o.length-Iy),f=b>0&&!T,D=m?Math.min(m.index,b):b,B=o.map((_,v)=>({comment:_,index:v})).slice(f?D:0),R=Rr(),y=_=>{if(p){p(_);return}window.open(R(_.uuid??""),"_blank","noopener,noreferrer")},I=_=>{if(c){c(_);return}window.open(R(_.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},P=Go().slots?.avatar;return eo(ue,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[eo(ue,{sx:{display:"flex",alignItems:"center",gap:1},children:[Z(kn,{sx:{fontSize:18,display:"block",color:"#37352f"}}),eo(ue,{sx:{fontSize:El,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),b>0&&(!f||D>0)?Z(ue,{role:"button",tabIndex:0,onClick:()=>S(_=>!_),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),S(v=>!v))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:f?`\uC774\uC804 \uB313\uAE00 ${D}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?Z(ue,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,Z(ue,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:B.map(({comment:_,index:v})=>{let $=!!t&&_.author===t;return eo(ue,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let h=r?.get(_.author)??"";return P?Z(ue,{sx:{display:"inline-flex",flexShrink:0},children:Z(P,{name:_.author,src:h||void 0,size:44})}):Z(ue,{sx:{display:"inline-flex",flexShrink:0},children:Z(Jo,{src:h,name:_.author,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...cr[0]},iconFontSize:24})})})(),eo(ue,{sx:{flex:1,minWidth:0},children:[eo(ue,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[Z(ue,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_.author}),Z(ue,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:_.time}),$?Z(ue,{sx:{ml:"auto"}}):eo(ue,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[Z(Jm,{kind:"like",reactions:_.likes,myAccountSeq:n,onToggle:()=>l?.(e,v,"like")}),Z(Jm,{kind:"ack",reactions:_.acks,myAccountSeq:n,onToggle:()=>l?.(e,v,"ack")})]}),$?eo(ue,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[Z(xt,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>d({index:v,text:_.text,attachments:[..._.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:Z(ky,{sx:{fontSize:15}})}),Z(xt,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:h=>g({anchorEl:h.currentTarget,index:v}),sx:{color:"#9a9a97"},children:Z(pa,{sx:{fontSize:15}})})]}):null]}),m?.index===v?eo(ue,{sx:{mt:.5},children:[Z(ue,{component:"textarea",autoFocus:!0,spellCheck:!1,value:m.text,onChange:h=>d({...m,text:h.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),eo(ue,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[m.attachments.map((h,x)=>{let C=()=>d({...m,attachments:m.attachments.filter((L,N)=>N!==x)});return fa(h.name)&&h.uuid?eo(ue,{sx:{position:"relative"},children:[Z(ue,{component:"img",src:R(h.uuid,{thumb:"md"}),alt:h.name,title:h.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),Z(xt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:C,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:Z(pa,{sx:{fontSize:14}})})]},`kept-${h.uuid}-${x}`):Z(da,{size:"small",icon:Z(Cr,{sx:{fontSize:14}}),label:h.name,onDelete:C,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${h.uuid??h.name}-${x}`)}),m.files.map((h,x)=>{let C=()=>d({...m,files:m.files.filter((L,N)=>N!==x)});return fa(h.name)?eo(ue,{sx:{position:"relative"},children:[Z(ue,{component:"img",src:URL.createObjectURL(h),alt:h.name,title:`${h.name} (\uC0C8 \uD30C\uC77C)`,onLoad:L=>URL.revokeObjectURL(L.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),Z(xt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:C,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:Z(pa,{sx:{fontSize:14}})})]},`new-${h.name}-${x}`):Z(da,{size:"small",icon:Z(Cr,{sx:{fontSize:14}}),label:`${h.name} (\uC0C8 \uD30C\uC77C)`,onDelete:C,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${h.name}-${x}`)}),Z(ou,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:Z(xt,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>u.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:Z(Cy,{sx:{fontSize:20}})})})]}),eo(ue,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[Z(Qm,{size:"small",color:"inherit",onClick:()=>d(null),children:"\uCDE8\uC18C"}),Z(Qm,{size:"small",variant:"contained",disabled:!m.text.trim()&&m.attachments.length===0&&m.files.length===0,onClick:()=>{i(e,v,m.text,{attachments:m.attachments,files:m.files}),d(null)},children:"\uC800\uC7A5"})]}),Z(ue,{component:"input",type:"file",multiple:!0,ref:u,sx:{display:"none"},onChange:h=>{let x=Array.from(h.target.files??[]);x.length>0&&d({...m,files:[...m.files,...x].slice(0,10)}),h.target.value=""}})]}):eo(ue,{children:[_.text?Z(ue,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:_.text}):null,(_.attachments??[]).length>0?Z(ue,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(_.attachments??[]).map((h,x)=>{let C=!!h.uuid;if(fa(h.name)&&C)return Z(ue,{component:"img",src:R(h.uuid??"",{thumb:"md"}),alt:h.name,title:`${h.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>y(h),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${h.name}-${x}`);let N=ra(h.name);return Z(da,{size:"small",icon:Z(Cr,{sx:{fontSize:14}}),label:`${h.name} (${Kl(h.size)})`,clickable:C,onClick:C?()=>N?y(h):I(h):void 0,title:C?`${h.name} ${N?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:h.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${h.name}-${x}`)})}):null]})]})]},`${_.time}-${v}`)})}),Z(Pe,{open:!!s,anchorEl:s?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>g(null),onConfirm:()=>{s&&(a(e,s.index),d(null)),g(null)}})]})}function fa(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function nu({onSubmit:e}){let[o,t]=Br(""),[n,r]=Br([]),[i,a]=Br(!1),l=Ul(null),p=Ul(null),c=Re(),m=s=>{let g=Array.from(s??[]);g.length!==0&&r(T=>[...T,...g].slice(0,10))},d=()=>{let s=o.trim();!s&&n.length===0||(e(s,n.length>0?n:void 0),t(""),r([]))},u=eo(eu,{children:[Z(xt,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>l.current?.click(),sx:{color:"#9a9a97"},children:Z(Cr,{sx:{fontSize:20}})}),Z(xt,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>p.current?.click(),sx:{color:"#9a9a97"},children:Z(vy,{sx:{fontSize:20}})})]});return eo(ue,{children:[n.length>0?Z(ue,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((s,g)=>fa(s.name)?eo(ue,{sx:{position:"relative"},children:[Z(ue,{component:"img",src:URL.createObjectURL(s),alt:s.name,title:s.name,onLoad:T=>URL.revokeObjectURL(T.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),Z(xt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(T=>T.filter((S,b)=>b!==g)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:Z(pa,{sx:{fontSize:14}})})]},`${s.name}-${g}`):Z(da,{size:"small",icon:Z(Cr,{sx:{fontSize:14}}),label:`${s.name} (${Kl(s.size)})`,onDelete:()=>r(T=>T.filter((S,b)=>b!==g)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${s.name}-${g}`))}):null,eo(ue,{sx:{position:"relative",display:"flex"},onDragOver:s=>{Array.from(s.dataTransfer?.types??[]).includes("Files")&&(s.preventDefault(),a(!0))},onDragLeave:s=>{s.currentTarget.contains(s.relatedTarget)||a(!1)},onDrop:s=>{Array.from(s.dataTransfer?.types??[]).includes("Files")&&(s.preventDefault(),a(!1),m(s.dataTransfer?.files??null))},children:[i?eo(ue,{sx:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",gap:.75,borderRadius:1,border:"2px dashed #2f80ed",bgcolor:"rgba(47,128,237,0.08)",color:"#2f80ed",fontSize:14,fontWeight:600,pointerEvents:"none"},children:[Z(Cr,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,Z(by,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:s=>t(s.target.value),fullWidth:!0,multiline:!0,minRows:c?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:c?15:6.5,pb:c?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),c?eo(ue,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[u,Z(xt,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:d,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:Z(Zm,{sx:{fontSize:22}})})]}):eo(eu,{children:[Z(ue,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:u}),Z(xt,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:d,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:Z(Zm,{sx:{fontSize:22}})})]})]}),Z(ue,{component:"input",ref:l,type:"file",multiple:!0,onChange:s=>{m(s.target.files),s.target.value=""},sx:{display:"none"}}),Z(ue,{component:"input",ref:p,type:"file",accept:"image/*",multiple:!0,onChange:s=>{m(s.target.files),s.target.value=""},sx:{display:"none"}})]})}import{useState as Gl}from"react";import{Box as Ir,IconButton as ni,Tooltip as ha}from"@mui/material";import Ay from"@mui/icons-material/Close";import Ly from"@mui/icons-material/ArrowBack";import Ny from"@mui/icons-material/ShareOutlined";import Fy from"@mui/icons-material/ContentCopyOutlined";import Hy from"@mui/icons-material/HistoryOutlined";import Wy from"@mui/icons-material/Print";import{useEffect as _y}from"react";import{Box as sn,Button as wy,CircularProgress as Dy}from"@mui/material";import{FormDialog as My}from"@ehfuse/mui-form-dialog";import{OverlayScrollbar as Ey}from"@ehfuse/overlay-scrollbar";import{jsx as cn,jsxs as xa}from"react/jsx-runtime";var Oy={created:"\uC5C5\uBB34\uB97C \uB4F1\uB85D\uD588\uC2B5\uB2C8\uB2E4",completed:"\uC644\uB8CC \uCC98\uB9AC\uD588\uC2B5\uB2C8\uB2E4",uncompleted:"\uC644\uB8CC\uB97C \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4",confirm_requested:"\uD655\uC778\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4",acked:"\uD655\uC778\uD588\uC2B5\uB2C8\uB2E4",claimed:"\uC5C5\uBB34\uB97C \uAC00\uC838\uAC14\uC2B5\uB2C8\uB2E4",bug_verified:"\uC218\uC815\uC744 \uD655\uC778\uD588\uC2B5\uB2C8\uB2E4(\uC885\uB8CC)",bug_reopened:"\uC7AC\uC624\uD508\uD588\uC2B5\uB2C8\uB2E4"};function ru(e){return String(e??"").trim()||"\uC5C6\uC74C"}function Ry(e){if(e.kind!=="field")return Oy[String(e.kind)]??"\uBCC0\uACBD\uD588\uC2B5\uB2C8\uB2E4";let o=String(e.field_label??e.field??"").trim()||"\uD56D\uBAA9",t=String(e.old_value??"").trim(),n=String(e.new_value??"").trim();return!t&&n?`${o}\uC744(\uB97C) "${n}"(\uC73C)\uB85C \uC785\uB825\uD588\uC2B5\uB2C8\uB2E4`:t&&!n?`${o}\uC744(\uB97C) \uBE44\uC6E0\uC2B5\uB2C8\uB2E4`:`${o}\uC744(\uB97C) "${ru(t)}" \u2192 "${ru(n)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function ga({open:e,taskSeq:o,items:t,loading:n,onLoad:r,onClose:i}){let a=Re();_y(()=>{e&&o>0&&!t&&r?.(o)},[e,o,t,r]);let l=cn(sn,{sx:{height:a?"100%":420,minHeight:0},children:cn(Ey,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:xa(sn,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[n&&!t?xa(sn,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[cn(Dy,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,t&&t.length===0?cn(sn,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(t??[]).map(p=>xa(sn,{sx:{display:"flex",flexDirection:a?"column":"row",gap:a?.25:1,alignItems:a?"stretch":"baseline",minWidth:0,flexShrink:0,...a?{pb:1,borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none",pb:0}}:{}},children:[cn(sn,{sx:{flexShrink:0,...a?{}:{width:"10.5em"},whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:Yo(p.acted_time)}),xa(sn,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[cn(sn,{component:"span",sx:{fontWeight:500},children:String(p.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),cn(sn,{component:"span",sx:{ml:.5},children:Ry(p)})]})]},p.seq))]})})});return cn(My,{open:e,onClose:i,maxWidth:"sm",fullScreen:a,mobilePresentation:a?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:a?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:`\uD65C\uB3D9${t&&t.length>0?` (${t.length})`:""}`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-activity",sections:[{id:"task-activity",showTitle:!1,children:l}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:cn(wy,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{InfoAlert as Py,SuccessAlert as zy}from"@ehfuse/alerts";var iu=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
34
+ `).trim()}function fa({syncKey:e,value:p,onChange:b,readOnly:c=!1,minHeight:i=180,height:a=0,onChangeHeight:r}){let t=Mo(null),n=Mo(null),l=a>0?a:0,o=Mo(l),s=Mo(r);s.current=r;let f=Mo(null),d=Mo(Date.now()+800),[u,g]=N2(!1),m=Bt();Ul(()=>{if(c)return;let k=Kl(p);f.current===k||f.current===p||(f.current=k,d.current=Date.now()+800,t.current?.setHtml(k))},[e,p,c]);let v=Mo(-1);return Ul(()=>{if(c||m||a<=0||v.current===a||(v.current=a,Math.abs(a-o.current)<1))return;let k=n.current?.querySelector(".ehfuse-editor-container");k&&(Math.abs(k.getBoundingClientRect().height-a)<1||(k.style.height=`${a}px`,o.current=a))},[c,m,a]),Ul(()=>{if(c||m)return;let k=n.current?.querySelector(".ehfuse-editor-container");if(!k||typeof ResizeObserver>"u")return;let B,O=new ResizeObserver(L=>{let R=Math.round(L[0]?.contentRect.height??0);R<=0||(window.clearTimeout(B),B=window.setTimeout(()=>{Math.abs(R-o.current)<1||(o.current=R,s.current?.(R))},300))});return O.observe(k),()=>{window.clearTimeout(B),O.disconnect()}},[c,m]),c?W2(Vl,{sx:{position:"relative",mt:1},children:[Eo(Vl,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:i,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:Kl(p)}}),Eo(L2,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Eo(j2,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(H2(p)).then(()=>{g(!0),window.setTimeout(()=>g(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:u?Eo(z2,{sx:{fontSize:17,color:"#2f9e5b"}}):Eo(F2,{sx:{fontSize:17}})})})]}):Eo(Vl,{ref:n,onDragOver:k=>k.stopPropagation(),onDrop:k=>k.stopPropagation(),sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:Eo(q2,{ref:t,defaultValue:Kl(p),autoHeight:m,resizable:!m,showToolbar:!m,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:$2,locale:"ko",minHeight:l||i,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:k=>{let B=Date.now()<d.current,O=k===f.current;f.current=k,!(B||O)&&b(k)}})})}import{useState as ii}from"react";import{Box as Jt,Button as rd,Dialog as rv,IconButton as si,Switch as nv,TextField as ov,Tooltip as Xl}from"@mui/material";import{DndContext as iv,PointerSensor as sv,closestCenter as av,useSensor as lv,useSensors as cv}from"@dnd-kit/core";import{restrictToParentElement as uv,restrictToVerticalAxis as fv}from"@dnd-kit/modifiers";import{SortableContext as dv,arrayMove as hv,useSortable as pv,verticalListSortingStrategy as mv}from"@dnd-kit/sortable";import{CSS as gv}from"@dnd-kit/utilities";import nd from"@mui/icons-material/Close";import bv from"@mui/icons-material/AddCircle";import od from"@mui/icons-material/AddTask";import yv from"@mui/icons-material/Checklist";import xv from"@mui/icons-material/CheckCircle";import vv from"@mui/icons-material/DragIndicator";import wv from"@mui/icons-material/Launch";import _v from"@mui/icons-material/LinkOutlined";import kv from"@mui/icons-material/RadioButtonUnchecked";import{useEffect as U2,useMemo as V2,useState as Gl}from"react";import{Box as Hn,Button as K2,Tab as G2,Tabs as Y2}from"@mui/material";import{FormDialog as X2}from"@ehfuse/mui-form-dialog";import{ClearTextField as Z2}from"@ehfuse/mui-form-controls";import{ErrorAlert as J2}from"@ehfuse/alerts";import Q2 from"@mui/icons-material/CheckCircle";import ev from"@mui/icons-material/RadioButtonUnchecked";import{OverlayScrollbar as tv}from"@ehfuse/overlay-scrollbar";import{jsx as dr,jsxs as Yl}from"react/jsx-runtime";var td=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function da({open:e,task:p,tasks:b,excludeSeqs:c=[],onClose:i,onSubmit:a,hideRelationType:r=!1,title:t="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:n="\uC5F0\uACB0",multiSelect:l=!1}){let o=Bt(),[s,f]=Gl("related"),[d,u]=Gl(""),[g,m]=Gl([]);U2(()=>{e&&(f("related"),u(""),m([]))},[e]);let v=V2(()=>{let R=new Set([p.seq,...c]),P=d.trim().toLowerCase();return b.filter(j=>R.has(j.seq)||j.is_event||j.is_notice||j.linked_only?!1:P?j.title.toLowerCase().includes(P)||(j.ticket_no??"").toLowerCase().includes(P):!0).sort((j,z)=>!!j.completed!=!!z.completed?j.completed?1:-1:z.seq-j.seq)},[b,p.seq,c,d]),k=()=>{if(g.length===0){J2("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let R of g)a(R,s);i()},B=R=>{m(P=>P.includes(R)?P.filter(j=>j!==R):l?[...P,R]:[R])},O=td.find(R=>R.type===s)?.hint??"",L=Yl(Hn,{sx:{...o?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...o?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[r?null:dr(Y2,{value:s,onChange:(R,P)=>f(P),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:td.map(R=>dr(G2,{value:R.type,label:R.label},R.type))}),r?null:dr(Hn,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:O}),dr(Hn,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:dr(Z2,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:d,onChange:R=>u(R.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),dr(Hn,{sx:{flex:1,minHeight:0},children:dr(tv,{style:{height:"100%"},contentStyle:{paddingTop:0},children:dr(Hn,{sx:{display:"flex",flexDirection:"column"},children:v.length===0?dr(Hn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):v.map(R=>{let P=R.is_notice||R.is_event?bt(R.icon||(R.is_notice?Kt:tr)):null,j=g.includes(R.seq);return Yl(Hn,{onClick:()=>B(R.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:1.25,flexShrink:0,cursor:"pointer",borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none"},bgcolor:j?"#e3eefb":"transparent","&:hover":{bgcolor:j?"#e3eefb":"#f7f7f5"}},children:[j?dr(Q2,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):dr(ev,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),P?dr(P,{sx:{fontSize:17,flexShrink:0,color:R.icon_color||"#1e3a8a"}}):null,Yl(Hn,{component:"span",sx:{flex:1,minWidth:0,fontSize:15,color:"#37352f",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,overflow:"hidden",lineHeight:1.5,wordBreak:"break-word"},children:[R.ticket_no?`${R.ticket_no} `:"",R.title]}),dr(Hn,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:dr(Et,{option:rr(R)})})]},R.seq)})})})})]});return dr(X2,{open:e,onClose:i,maxWidth:"sm",fullScreen:o,mobilePresentation:o?"slide":"dialog",...o?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:o?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:t,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:L}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:dr(K2,{variant:"contained",disabled:g.length===0,onClick:k,children:n})}})}import{Fragment as Cv,jsx as it,jsxs as bn}from"react/jsx-runtime";var id="taskbox.checklist.hideCompleted";function Sv({id:e,children:p}){let{attributes:b,listeners:c,setNodeRef:i,transform:a,transition:r,isDragging:t}=pv({id:e});return it(Jt,{ref:i,sx:{transform:gv.Transform.toString(a),transition:r,...t?{opacity:.6,position:"relative",zIndex:1}:{}},children:p({handleProps:{...b,...c},dragging:t})})}function Tv({sortable:e,sensors:p,rowIds:b,onDragEnd:c,children:i}){let a=it(Jt,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:i});return e?it(iv,{sensors:p,collisionDetection:av,modifiers:[fv,uv],onDragEnd:c,children:it(dv,{items:b,strategy:mv,children:a})}):a}function ha({taskSeq:e,checklist:p,onAdd:b,onToggle:c,onRemove:i,onUpdate:a,onReorder:r,removeLocked:t=!1,onConvertToTask:n,onOpenLinkedTask:l,linkCandidates:o,linkBaseTask:s,onLinkExistingTask:f,resolveLinkedTask:d,myAccountSeq:u=0}){let[g,m]=ii(""),[v,k]=ii(!1),[B,O]=ii(null),L=Bt(),[R,P]=ii(null),[j,z]=ii(null),N=W=>{let A=W.task_seq?d?.(W.task_seq):void 0;return A?A.completed:W.checked},S=W=>{if(!W.task_seq||u<=0)return!1;let A=d?.(W.task_seq);return A?!ku(A,u):!1},C=p.filter(N).length,[E,h]=ii(()=>{try{return localStorage.getItem(id)==="1"}catch{return!1}}),y=W=>{h(W);try{localStorage.setItem(id,W?"1":"0")}catch{}},w=!!r&&!L&&!t,x=cv(lv(sv,{activationConstraint:{distance:5}})),_=(W,A)=>W.task_seq?`linked-${W.task_seq}`:`row-${A}`,T=p.map(_),D=E?T.filter((W,A)=>!N(p[A])):T,q=W=>{let{active:A,over:H}=W;if(!H||A.id===H.id)return;let M=T.indexOf(String(A.id)),I=T.indexOf(String(H.id));M<0||I<0||r?.(e,hv(p,M,I))},$=()=>{g.trim()&&(b(e,g),m(""))};return bn(qr,{icon:it(yv,{sx:{fontSize:19,display:"block"}}),title:bn(Cv,{children:["\uD560\uC77C",p.length>0?bn(Jt,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[C," / ",p.length]}):null]}),titleExtra:p.length>0?bn(Jt,{sx:{flex:1,minWidth:0,ml:1,display:"flex",alignItems:"center",gap:1},children:[it(Jt,{sx:{flex:1,minWidth:0,height:6,borderRadius:3,bgcolor:"#ececea"},children:it(Jt,{sx:{height:"100%",borderRadius:3,width:`${Math.round(C/p.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}),C>0?bn(Jt,{component:"label",sx:{display:"inline-flex",alignItems:"center",gap:.25,flexShrink:0,cursor:"pointer",fontSize:13.5,fontWeight:400,color:"#57564f",userSelect:"none"},children:[it(nv,{size:"small",checked:E,onChange:(W,A)=>y(A)}),"\uC644\uB8CC\uC228\uAE40"]}):null]}):null,children:[it(Tv,{sortable:w,sensors:x,rowIds:D,onDragEnd:q,children:p.map((W,A)=>{let H=W.task_seq?d?.(W.task_seq):void 0,M=N(W);if(E&&M)return null;let I=!!W.task_seq,F=S(W),U=X=>bn(Jt,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,...w?{ml:-3,pl:.5}:{},py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1},"&:hover .taskbox-checklist-handle":{opacity:1}},children:[X?it(Jt,{className:"taskbox-checklist-handle",...X,sx:{display:"inline-flex",flexShrink:0,alignItems:"center",color:"#c9c8c5",opacity:0,transition:"opacity 0.15s",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:it(vv,{sx:{fontSize:16}})}):null,it(Xl,{title:F?"\uC5F0\uACB0 \uC5C5\uBB34\uC758 \uC791\uC131\uC790\xB7\uCC45\uC784\uC790\uB9CC \uC644\uB8CC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4":"",arrow:!0,disableInteractive:!0,children:it(Jt,{component:"span",onClick:F?void 0:()=>c(e,A,!M),sx:{display:"inline-flex",flexShrink:0,cursor:F?"default":"pointer"},children:M?it(xv,{sx:{fontSize:18,color:F?"#a9c6ec":"#2f80ed"}}):it(kv,{sx:{fontSize:18,color:F?"#d6d5d1":"#9a9a97"}})})}),B?.index===A?it(Jt,{component:"input",autoFocus:!0,spellCheck:!1,value:B.label,enterKeyHint:"done",onChange:V=>O({index:A,label:V.target.value}),onBlur:()=>{B.label.trim()&&B.label.trim()!==W.label&&a?.(e,A,B.label),O(null)},onKeyDown:V=>{V.key==="Enter"&&V.target.blur(),V.key==="Escape"&&O(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):it(Jt,{component:"span",onClick:I?W.task_seq&&l?()=>l(W.task_seq):void 0:t||!a?void 0:L?()=>P({index:A,label:W.label}):()=>O({index:A,label:W.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:M?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...I?l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:t||!a?{}:{cursor:"text"}},children:W.label}),I?bn(Jt,{component:"span",onClick:W.task_seq&&l?()=>l(W.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...l?{cursor:"pointer"}:{}},children:[it(wv,{sx:{fontSize:12}}),H?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!t&&!I&&n?it(Xl,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:it(si,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:V=>z({anchorEl:V.currentTarget,index:A,label:W.label}),sx:{display:L?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:it(od,{sx:{fontSize:16}})})}):null,t?null:it(si,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>i(e,A),sx:{display:L?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:it(nd,{sx:{fontSize:15}})})]});return w?it(Sv,{id:T[A],children:({handleProps:X})=>U(X)},T[A]):it(Jt,{children:U(null)},T[A])})}),bn(Jt,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[it(Jt,{component:"input",spellCheck:!1,value:g,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:W=>m(W.target.value),onKeyDown:W=>{W.key==="Enter"&&$()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),o&&s&&f?it(Xl,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:it(si,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:W=>W.preventDefault(),onClick:()=>k(!0),sx:{flexShrink:0,color:"#9a9a97"},children:it(_v,{sx:{fontSize:20}})})}):null,it(si,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!g.trim(),onMouseDown:W=>W.preventDefault(),onClick:$,sx:{flexShrink:0,color:g.trim()?"#2f80ed":"#c9c8c5"},children:it(bv,{sx:{fontSize:20}})})]}),o&&s&&f?it(da,{open:v,task:s,tasks:o,excludeSeqs:p.map(W=>Number(W.task_seq??0)).filter(W=>W>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>k(!1),onSubmit:W=>{let A=o.find(H=>H.seq===W);f(e,W,String(A?.title??"").trim())}}):null,it(It,{open:!!j,anchorEl:j?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>z(null),onConfirm:()=>{j&&n?.(e,j.index,j.label),z(null)}}),it(rv,{open:!!R,onClose:()=>P(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:bn(Jt,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[it(Jt,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),it(ov,{autoFocus:!0,fullWidth:!0,size:"medium",value:R?.label??"",onChange:W=>P(A=>A&&{...A,label:W.target.value}),onKeyDown:W=>{if(W.key!=="Enter")return;let A=R;A&&A.label.trim()&&a?.(e,A.index,A.label.trim()),P(null)}}),bn(Jt,{sx:{display:"flex",alignItems:"center",gap:1},children:[!t&&n&&R&&!p[R.index]?.task_seq?it(si,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{n(e,R.index,p[R.index]?.label??""),P(null)},sx:{color:"#57564f"},children:it(od,{sx:{fontSize:20}})}):null,!t&&R?it(si,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{i(e,R.index),P(null)},sx:{color:"#e5484d"},children:it(nd,{sx:{fontSize:19}})}):null,it(Jt,{sx:{flex:1}}),it(rd,{color:"inherit",onClick:()=>P(null),children:"\uCDE8\uC18C"}),it(rd,{variant:"contained",disabled:!R?.label.trim(),onClick:()=>{R&&R.label.trim()&&a?.(e,R.index,R.label.trim()),P(null)},children:"\uD655\uC778"})]})]})})]})}import{useRef as Av,useState as Ov}from"react";import{Box as yn,IconButton as Dv}from"@mui/material";import Pv from"@mui/icons-material/Close";import ld from"@mui/icons-material/AttachFileOutlined";var Bv=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),pa=e=>{let p=e?.split(".").pop()?.toLowerCase()??"";return Bv.has(p)};import{LinearProgress as Iv}from"@mui/material";import{Fragment as Mv,jsx as Rv,jsxs as Ev}from"react/jsx-runtime";function sd(e){let p=Cn(),b=p.useValue("attachmentUpload.taskSeq"),c=p.useValue("attachmentUpload.index"),i=p.useValue("attachmentUpload.total"),a=p.useValue("attachmentUpload.queue"),r=c??0;return!r||e>0&&(b??0)!==e?null:{index:r,total:i??0,queue:a??[]}}function Zl(){let p=Cn().useValue("attachmentUpload.progress");return Ev(Mv,{children:[p??0,"%"]})}function ad(){let p=Cn().useValue("attachmentUpload.progress");return Rv(Iv,{variant:"determinate",value:p??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as Nv,jsx as Sr,jsxs as zi}from"react/jsx-runtime";function ma(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var ga={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function ba({taskSeq:e,attachments:p,onAdd:b,onRemove:c,removeLocked:i=!1,onPreview:a,onDownload:r}){let[t,n]=Ov(!1),l=Av(null),o=Bt(),s=_i(),f=wi(),d=sd(e),u=e===0,g=O=>{if(a){a(O);return}window.open(f(O.uuid??""),"_blank","noopener,noreferrer")},m=O=>{if(r){r(O);return}window.open(f(O.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},v=O=>d?O+1<d.index?"done":O+1===d.index?"uploading":"waiting":"waiting",k=(O,L,R,P={})=>zi(yn,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:P.uploading?"#d5e6fb":"#e6e6e3",bgcolor:P.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[zi(yn,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Sr(ld,{sx:{fontSize:16,color:"#9a9a97"}}),L,Sr(yn,{component:"span",sx:{fontSize:12,color:P.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:R}),P.removeIndex!==void 0?Sr(Dv,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>c(e,P.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Sr(Pv,{sx:{fontSize:15}})}):null]}),P.uploading?Sr(ad,{}):null]},O),B=O=>{let L=pa(O.name);return Sr(yn,{component:"button",type:"button",onClick:()=>L?g(O):m(O),title:`${O.name} ${L?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...ga,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:O.name})};return zi(qr,{icon:Sr(ld,{sx:{fontSize:18,display:"block"}}),title:zi(Nv,{children:["\uD30C\uC77C ",p.length>0?p.length:""]}),children:[zi(yn,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[p.map((O,L)=>{let R=`${O.uuid||O.name}-${L}`;if(u){let P=v(L),j=P==="uploading";return k(R,Sr(yn,{component:"span",sx:{...ga,color:P==="done"?"#37352f":"#9a9a97"},children:O.name}),j?Sr(Zl,{}):ma(O.size),{uploading:j,removeIndex:!i&&!d?L:void 0})}return O.uuid?k(R,B(O),ma(O.size),{removeIndex:i?void 0:L}):k(R,Sr(yn,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...ga,color:"#9a9a97"},children:O.name}),ma(O.size),{removeIndex:i?void 0:L})}),!u&&d?d.queue.slice(d.index-1).map((O,L)=>{let R=L===0;return k(`uploading-${d.index+L}-${O.name}`,Sr(yn,{component:"span",sx:{...ga,color:"#9a9a97"},children:O.name}),R?Sr(Zl,{}):ma(O.size),{uploading:R})}):null]}),Sr(yn,{onClick:()=>l.current?.click(),onDragOver:O=>{O.preventDefault(),n(!0)},onDragLeave:()=>n(!1),onDrop:O=>{O.preventDefault(),n(!1);let L=Array.from(O.dataTransfer.files);L.length>0&&b(e,L)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:t?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:t?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:o?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${s}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${s}MB)`}),Sr(yn,{component:"input",ref:l,type:"file",multiple:!0,onChange:O=>{let L=Array.from(O.target.files??[]);L.length>0&&b(e,L),O.target.value=""},sx:{display:"none"}})]})}import{useState as Hv}from"react";import{Checkbox as Wv,Divider as Uv,ListItemIcon as Vv,Menu as Kv,MenuItem as dd}from"@mui/material";import Gv from"@mui/icons-material/Add";import{useEffect as jv,useState as cd}from"react";import{Box as Jl,Button as Lv}from"@mui/material";import{FormDialog as Fv}from"@ehfuse/mui-form-dialog";import{ClearTextField as zv}from"@ehfuse/mui-form-controls";import{ColorPicker as qv}from"@ehfuse/mui-color-picker";import{ErrorAlert as $v}from"@ehfuse/alerts";import{jsx as qi,jsxs as Ql}from"react/jsx-runtime";var ud="#2f80ed";function fd({open:e,onClose:p,onSubmit:b}){let[c,i]=cd(""),[a,r]=cd(ud);jv(()=>{e&&(i(""),r(ud))},[e]);let t=()=>{let o=c.trim();if(!o){$v("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}b(o,a),p()},n=hu(a),l=Ql(Jl,{children:[Ql(Jl,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[qi(zv,{label:"\uB77C\uBCA8 \uC774\uB984",value:c,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),t())},fullWidth:!0,autoFocus:!0}),qi(qv,{value:a,onChange:o=>r(o),shape:"circle",colorSize:28})]}),Ql(Jl,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",qi(Et,{option:{key:"__preview__",name:c.trim()||"\uB77C\uBCA8",...n}})]})]});return qi(Fv,{open:e,onClose:p,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:l}],actions:{showCancelButton:!0,right:qi(Lv,{variant:"contained",onClick:t,children:"\uCD94\uAC00"})}})}import{Fragment as Yv,jsx as ai,jsxs as ya}from"react/jsx-runtime";function xa({anchorEl:e,selectedKeys:p,labelOptions:b,onToggle:c,onAddLabel:i,onClose:a}){let[r,t]=Hv(!1),n=sn();return ya(Yv,{children:[ya(Kv,{anchorEl:e,open:!!e,onClose:a,transitionDuration:0,...n,children:[b.map(l=>{let o=p.includes(l.key);return ya(dd,{onClick:()=>c(l.key),sx:{fontSize:14,minWidth:170,gap:1},children:[ai(Wv,{size:"small",checked:o,sx:{p:0}}),ai(Et,{option:l})]},l.key)}),ai(Uv,{}),ya(dd,{onClick:()=>t(!0),sx:{fontSize:14,color:"#787774"},children:[ai(Vv,{children:ai(Gv,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),ai(fd,{open:r,onClose:()=>t(!1),onSubmit:i})]})}function hd(e,p){let b=Number(e.author_account_seq??0);return p.filter(c=>{let i=Number(c.account_seq??0);return i>0&&i!==b})}function pd(e,p){let b=(e.target_account_seqs??[]).filter(s=>s>0);if(b.length===0)return null;let c=new Set(b),i=hd(e,p),a=new Map;for(let s of i){let f=String(s.department??"").trim();if(!f)continue;let d=a.get(f)??[];d.push(s),a.set(f,d)}let r=[],t=new Set;for(let[s,f]of a)if(f.every(u=>c.has(Number(u.account_seq??0)))){r.push(s);for(let u of f)t.add(Number(u.account_seq??0))}let n=new Map(i.map(s=>[Number(s.account_seq??0),s.name])),l=e.target_names??[],o=[];return b.forEach((s,f)=>{t.has(s)||o.push(n.get(s)??l[f]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:r,individualNames:o}}function va(e,p){let b=pd(e,p);return b?[...b.teamNames,...b.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function AR(e,p){let b=pd(e,p);return b?{kind:"members",teamNames:b.teamNames,individualNames:b.individualNames}:{kind:"everyone"}}function md(e,p,b){let c=(e.target_account_seqs??[]).filter(d=>d>0),i=hd(e,p),a=c.length>0?c.length:i.length,r=e.acks??[],t=b>0&&r.some(d=>d.account_seq===b),n=b>0&&Number(e.author_account_seq??0)===b,l=c.length===0||c.includes(b),o=new Set(r.map(d=>d.account_seq)),f=(c.length>0?i.filter(d=>c.includes(Number(d.account_seq??0))):i).filter(d=>!o.has(Number(d.account_seq??0))).map(d=>String(d.name??"").trim()).filter(d=>d.length>0);return{count:r.length,total:a,acked:t,pendingNames:f,canAck:b>0&&!n&&l&&!t&&!e.completed}}function gd(e,p){let b=Number(p)||50,c=b*1024*1024,i=e.filter(t=>t.size>c),a=e.filter(t=>t.size<=c),r=i.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${b}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
35
+ \uC81C\uC678\uB41C \uD30C\uC77C: ${i.map(t=>t.name).join(", ")}`:null;return{accepted:a,rejected:i,message:r}}import{DatePicker as sw}from"@ehfuse/mui-datetime-picker";import{Fragment as Wi,jsx as Qe,jsxs as Ao}from"react/jsx-runtime";var wd="#0f9d58";function rc({form:e,statusOptions:p,customTabs:b,sprints:c=[],avatarSrcByName:i,isNotice:a=!1,hideProject:r=!1,hideBug:t=!1,leadingRow:n,hideLabel:l=!1,employees:o=[],myAccountSeq:s=0,departments:f=[],myGroupSeq:d=0,onMemberEdit:u,onAddProject:g,onAddLabelOption:m,contentSyncKey:v="create"}){let k=Cn(),B=_i(),O=e.useFormValue("manager_name"),L=e.useFormValue("receiver_names"),R=e.useFormValue("start_date"),P=!!e.useFormValue("is_event"),j=!!e.useFormValue("is_bug"),z=e.useFormValue("bug_repro")??"",N=e.useFormValue("bug_device")??"",S=e.useFormValue("bug_where")??"",C=e.useFormValue("bug_version")??"",E=e.useFormValue("event_time")??"",h=e.useFormValue("event_place")??"",y=e.useFormValue("event_address")??"",w=e.useFormValue("due_date"),x=e.useFormValue("reminder"),_=e.useFormValue("priority"),T=e.useFormValue("content"),q=e.useFormValue("checklist")??[],$=e.useFormValue("tab_key"),W=e.useFormValue("sprint_seq")??0,A=e.useFormValue("story_points")??0,H=b.find(ae=>ae.key===$&&ae.useSprints),M=H?c.filter(ae=>`custom-${ae.group_seq}`===$):[],[I,F]=$i(null),U=e.useFormValue("label_keys"),[X,V]=$i(null),G=e.useFormValue("visibility")||"involved",ee=Number(e.useFormValue("visibility_group_seq")??0),[Z,K]=$i(null),Q=e.useFormValue("repeat_rule")||"",J=e.useFormValue("repeat_until")||"",[ne,ie]=$i(null),[le,re]=$i(null),se=e.useFormValue("target_names"),be=e.useFormValue("target_account_seqs"),Fe=k.useValue("createAttachmentFiles")??[],Ce=a?va({author_account_seq:s,target_names:se,target_account_seqs:be},o):"";return Ao(Wi,{children:[n,a?null:Qe(Ro,{sx:{display:"flex",gap:1.25,px:2,pt:1.5,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...t?[]:[{value:"bug",label:"\uC624\uB958"}]].map(ae=>{let De=j?"bug":P?"event":"task",Be=De===ae.value;return Qe(Xv,{onClick:()=>{if(De===ae.value)return;e.setFormValue("is_event",ae.value==="event"),e.setFormValue("is_bug",ae.value==="bug"),e.setFormValue("visibility",ae.value==="bug"?"all":"involved"),e.setFormValue("visibility_group_seq",0),ae.value==="bug"&&(e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until",""));let ke=e.getFormValue("icon"),Re=e.getFormValue("icon_color"),we=[Tn,"event",ki].includes(ke),ve=!Re||Re===wd||Re===Si;we&&e.setFormValue("icon",ae.value==="event"?"event":ae.value==="bug"?ki:Tn),ve&&e.setFormValue("icon_color",ae.value==="event"?wd:ae.value==="bug"?Si:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:Be?600:400,color:Be?"#ffffff":"#787774",bgcolor:Be?"#2563eb":"#f4f4f2"},children:ae.label},ae.label)})}),Qe(Hi,{sx:{borderColor:"#e6e6e3"}}),Ao(Ro,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[Qe(ca,{hideProject:r,hideDueDate:!P&&!!Q,hideReminder:!!Q,values:{tabKey:$,managerName:O,receiverNames:L,startDate:R,dueDate:w,reminder:x,priority:_,eventTime:E,eventPlace:h,eventAddress:y},customTabs:b,avatarSrcByName:i,notice:a,event:P,onChangeEventTime:ae=>e.setFormValue("event_time",ae),onChangeEventPlace:ae=>e.setFormValue("event_place",ae),onChangeEventAddress:ae=>e.setFormValue("event_address",ae),targetSummary:Ce,onChangeProject:ae=>e.setFormValue("tab_key",ae),onAddProject:g,onChangeStartDate:ae=>e.setFormValue("start_date",ae),onChangeDueDate:ae=>e.setFormValue("due_date",ae),onChangeReminder:ae=>e.setFormValue("reminder",ae),onChangePriority:ae=>e.setFormValue("priority",ae),onMemberEdit:u,pinColumns:!0,beforeStart:Ao(Wi,{children:[!a&&!j?Qe(at,{icon:Qe(rw,{sx:{fontSize:17,...Q?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:ae=>ie(ae),sx:P?void 0:Yt(2),children:Q?oa(Q):Qe(Ro,{component:"span",sx:{color:"#9a9a97"},children:"\uC5C6\uC74C"})}):null,!a&&!j&&Q?Qe(at,{icon:Qe(nw,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:ae=>re(ae),sx:P?void 0:Yt(2),children:J?jr(J):Qe(Ro,{component:"span",sx:{color:"#9a9a97"},children:"\uC790\uB3D9"})}):null]}),trailing:Ao(Wi,{children:[a?null:Qe(at,{icon:G==="all"?Qe(yd,{sx:{fontSize:17,color:"#2f80ed"}}):G==="group"?Qe(xd,{sx:{fontSize:17,color:"#d9730d"}}):Qe(bd,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:ae=>K(ae),sx:P?void 0:Yt(1),children:G==="all"?"\uC804\uCCB4\uACF5\uAC1C":G==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${f.find(ae=>ae.seq===ee)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}),H&&!P&&!a?Ao(Wi,{children:[Qe(at,{icon:Qe(tw,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:ae=>F(ae),sx:Yt(1),children:W>0?M.find(ae=>ae.seq===W)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":Qe(Ro,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),Qe(at,{icon:Qe(ow,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:Yt(1),children:Qe($n,{value:A>0?String(A):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:ae=>e.setFormValue("story_points",Number(ae.replace(/[^0-9.]/g,""))||0)})})]}):null,j?Qe(ua,{values:{repro:z,device:N,where:S,version:C},onChangeRepro:ae=>e.setFormValue("bug_repro",ae),onChangeDevice:ae=>e.setFormValue("bug_device",ae),onChangeWhere:ae=>e.setFormValue("bug_where",ae),onChangeVersion:ae=>e.setFormValue("bug_version",ae)}):null]}),leading:P||l?null:Qe(Ro,{sx:{gridColumn:"1 / -1"},children:Qe(at,{icon:Qe(ew,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:ae=>V(ae),children:(U??[]).length>0?Qe(Qn,{labelKeys:U??[],labelOptions:p}):Qe(Ro,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),Qe(Hi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Qe(qr,{icon:Qe(Jv,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:Qe(fa,{syncKey:v,value:T,onChange:ae=>e.setFormValue("content",ae)})}),P?null:Qe(Hi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),P?null:Qe(ha,{taskSeq:0,checklist:q,onAdd:(ae,De)=>e.setFormValue("checklist",[...q,{label:De,checked:!1}]),onToggle:(ae,De,Be)=>e.setFormValue("checklist",q.map((ke,Re)=>Re===De?{...ke,checked:Be}:ke)),onRemove:(ae,De)=>e.setFormValue("checklist",q.filter((Be,ke)=>ke!==De)),onUpdate:(ae,De,Be)=>e.setFormValue("checklist",q.map((ke,Re)=>Re===De?{...ke,label:Be}:ke))}),Qe(Hi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Qe(ba,{taskSeq:0,attachments:Fe.map(ae=>({name:ae.name,size:ae.size})),onAdd:(ae,De)=>{let Be=gd(De,B);Be.message&&vd(Be.message),Be.accepted.length!==0&&k.setValue("createAttachmentFiles",[...k.getValue("createAttachmentFiles")??[],...Be.accepted])},onRemove:(ae,De)=>k.setValue("createAttachmentFiles",Fe.filter((Be,ke)=>ke!==De))}),j?null:Ao(Wi,{children:[Qe(Hi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Qe(qr,{icon:Qe(Qv,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:Qe(iw,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),Qe(ec,{transitionDuration:0,anchorEl:I,open:!!I,onClose:()=>F(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...M.map(ae=>({seq:ae.seq,label:Fr(ae)}))].map(ae=>Qe(tc,{onClick:()=>{e.setFormValue("sprint_seq",ae.seq),F(null)},sx:{fontSize:14,minWidth:170},children:ae.label},ae.seq))}),Qe(ec,{transitionDuration:0,anchorEl:ne,open:!!ne,onClose:()=>ie(null),children:[{value:"",label:"\uC5C6\uC74C"},...Li].map(ae=>Qe(tc,{selected:Q===ae.value,onClick:()=>{if(ie(null),ae.value===""){e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until","");return}let De;if(P){if(De=String(e.getFormValue("due_date")??"").slice(0,10),!De){vd("\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}}else{if(De=String(e.getFormValue("start_date")??"").slice(0,10),!De){let Be=new Date,ke=Re=>String(Re).padStart(2,"0");De=`${Be.getFullYear()}-${ke(Be.getMonth()+1)}-${ke(Be.getDate())}`}e.setFormValue("due_date",""),e.setFormValue("reminder","none")}e.setFormValue("repeat_rule",ae.value),e.setFormValue("repeat_until",ia(De,ae.value))},sx:{fontSize:14,minWidth:140},children:ae.label},ae.value||"none"))}),Qe(sw,{anchorEl:le,open:!!le,onClose:()=>re(null),selectedDate:J?new Date(`${J}T00:00:00`):new Date,onDateChange:ae=>{let De=Be=>String(Be).padStart(2,"0");e.setFormValue("repeat_until",`${ae.getFullYear()}-${De(ae.getMonth()+1)}-${De(ae.getDate())}`),re(null)}}),Qe(ec,{transitionDuration:0,anchorEl:Z,open:!!Z,onClose:()=>K(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",tip:"\uC791\uC131\uC790\xB7\uCC45\uC784\uC790\xB7\uCC38\uC870\uC790\uB9CC \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:Qe(bd,{sx:{fontSize:17,color:"#57564f"}}),selected:G==="involved",onPick:()=>{e.setFormValue("visibility","involved"),e.setFormValue("visibility_group_seq",0)}},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",tip:"\uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:Qe(yd,{sx:{fontSize:17,color:"#2f80ed"}}),selected:G==="all",onPick:()=>{e.setFormValue("visibility","all"),e.setFormValue("visibility_group_seq",0)}},...[...f].sort((ae,De)=>ae.seq===d?-1:De.seq===d?1:0).map(ae=>({key:`group-${ae.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${ae.name}`,tip:`${ae.name} \uC18C\uC18D \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:Qe(xd,{sx:{fontSize:17,color:"#d9730d"}}),selected:G==="group"&&ee===ae.seq,onPick:()=>{e.setFormValue("visibility","group"),e.setFormValue("visibility_group_seq",ae.seq)}}))].map(ae=>Qe(Zv,{title:ae.tip,arrow:!0,disableInteractive:!0,placement:"right",children:Ao(tc,{selected:ae.selected,onClick:()=>{ae.onPick(),K(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ae.icon,ae.label]})},ae.key))}),Qe(xa,{anchorEl:X,selectedKeys:U??[],labelOptions:p,onToggle:ae=>e.setFormValue("label_keys",Is(U??[],ae)),onAddLabel:(ae,De)=>m?.(ae,De),onClose:()=>V(null)})]})}import{Fragment as kd,jsx as $t,jsxs as wa}from"react/jsx-runtime";function CA({open:e,onClose:p,...b}){let{form:c,presetTitle:i="",presetContent:a="",presetVisibility:r,presetVisibilityGroupSeq:t=0,presetDueDate:n="",presetTabKey:l="",presetManager:o=null,isNotice:s=!1,defaultBug:f=!1}=b,d=Cn(),u=lw(!1),[g,m]=cw(0),v=c.useFormValue("title"),k=c.useFormValue("icon"),B=c.useFormValue("icon_color"),O=!!c.useFormValue("is_event"),L=!!c.useFormValue("is_bug"),R=Bt(),j=d.useValue("createSubmitting")??!1,z=s||O?bt(k||(s?Kt:tr)):null,N=s?"\uACF5\uC9C0 \uB4F1\uB85D":O?"\uC77C\uC815 \uB4F1\uB85D":L?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",S=s?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":O?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":L?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";aw(()=>{let E=u.current;u.current=e,!(!e||E)&&(c.setFormValues({...c.getFormValues(),title:i,icon:s?Kt:f?ki:Tn,icon_color:s?"#e5484d":f?Si:"",manager_name:o?.name??"",manager_account_seq:o?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:s,is_event:!1,is_bug:f,visibility:r??(f?"all":"involved"),visibility_group_seq:r==="group"?t:0,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:n,reminder:"none",priority:"medium",note:"",content:a,checklist:[],tab_key:l}),d.setValue("createAttachmentFiles",[]),m(h=>h+1))},[e]);let C=wa(xn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[z?$t(xn,{sx:{display:"flex",p:0,color:B||"#1e3a8a"},children:$t(z,{sx:{fontSize:20}})}):null,$t(xn,{component:"input",autoFocus:!0,spellCheck:!1,value:v,placeholder:S,onChange:E=>c.setFormValue("title",E.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}})]});return R?$t(kd,{children:$t(pw,{open:e,onClose:p,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:N,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:$t(nc,{variant:"contained",size:"small",disableElevation:!0,disabled:j,onClick:j?void 0:c.submit,sx:{ml:2,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:j?"\uC800\uC7A5 \uC911\u2026":""}]},fullScreen:!0,mobilePresentation:"slide",tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!1},sections:[{id:"task-create",title:"",showTitle:!1,children:$t(xn,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:$t(rc,{...b,contentSyncKey:`create-${g}`,leadingRow:C})})}]})}):$t(kd,{children:$t(uw,{anchor:"right",open:e,onClose:p,sx:{zIndex:E=>E.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:wa(xn,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[wa(xn,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[z?$t(xn,{sx:{display:"flex",px:.5,color:B||"#1e3a8a"},children:$t(z,{sx:{fontSize:20}})}):null,$t(xn,{component:"input",autoFocus:!0,spellCheck:!1,value:v,placeholder:S,onChange:E=>c.setFormValue("title",E.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),$t(fw,{"aria-label":"\uB2EB\uAE30",onClick:p,sx:{color:"#6b7280"},children:$t(dw,{})})]}),$t(_d,{sx:{borderColor:"#e6e6e3"}}),$t(xn,{sx:{flex:1,minHeight:0},children:$t(hw,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:$t(rc,{...b,contentSyncKey:`create-${g}`})})}),$t(_d,{sx:{borderColor:"#e6e6e3"}}),wa(xn,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[$t(nc,{onClick:p,color:"inherit",disabled:j,children:"\uCDE8\uC18C"}),$t(nc,{onClick:c.submit,variant:"contained",disabled:j,children:j?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})})})}import{useEffect as Gd,useRef as Yd,useState as Xd}from"react";import{Box as Ia,Button as p3,Divider as Zd,Drawer as m3}from"@mui/material";import g3 from"@mui/icons-material/ShareOutlined";import b3 from"@mui/icons-material/HistoryOutlined";import y3 from"@ehfuse/overlay-scrollbar";import{FormDialog as x3}from"@ehfuse/mui-form-dialog";import{SuccessAlert as Jd}from"@ehfuse/alerts";import{useRef as ic,useState as li}from"react";import{Box as st,Button as Sd,Chip as _a,IconButton as Zr,Tooltip as Id}from"@mui/material";import Td from"@mui/icons-material/Send";import{TextField as mw}from"@ehfuse/mui-form-controls";import ka from"@mui/icons-material/Close";import gw from"@mui/icons-material/EditOutlined";import bw from"@mui/icons-material/Favorite";import yw from"@mui/icons-material/FavoriteBorderOutlined";import xw from"@mui/icons-material/CheckCircle";import vw from"@mui/icons-material/CheckCircleOutlineOutlined";import ci from"@mui/icons-material/AttachFileOutlined";import ww from"@mui/icons-material/AddCircleOutline";import _w from"@mui/icons-material/ImageOutlined";var oc=e=>{if(e===0)return"0 Bytes";let p=1024,b=["Bytes","KB","MB","GB","TB"],c=Math.floor(Math.log(e)/Math.log(p));return parseFloat((e/Math.pow(p,c)).toFixed(2))+" "+b[c]};import{Fragment as Bd,jsx as $e,jsxs as Ht}from"react/jsx-runtime";var kw=5;function Cd({kind:e,reactions:p,myAccountSeq:b,onToggle:c}){let i=p??[],a=b>0&&i.some(l=>l.account_seq===b),r=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",t=i.length===0?r:$e(st,{sx:{whiteSpace:"pre-line",fontSize:12},children:i.map(l=>`${l.name} \xB7 ${l.time}`).join(`
36
+ `)}),n=e==="like"?"#e5484d":"#2f80ed";return $e(Id,{title:t,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Ht(st,{sx:{display:"inline-flex",alignItems:"center"},children:[$e(Zr,{size:"small","aria-label":`\uB313\uAE00 ${r}`,onClick:c,sx:{color:a?n:"#c9c8c5",p:.5},children:e==="like"?a?$e(bw,{sx:{fontSize:16}}):$e(yw,{sx:{fontSize:16}}):a?$e(xw,{sx:{fontSize:16}}):$e(vw,{sx:{fontSize:16}})}),i.length>0?$e(st,{component:"span",sx:{fontSize:12,color:a?n:"#9a9a97",ml:-.25},children:i.length}):null]})})}function Md({taskSeq:e,comments:p,currentUserName:b="",myAccountSeq:c=0,avatarSrcByName:i,onUpdate:a,onRemove:r,onToggleReaction:t,onPreview:n,onDownload:l}){let[o,s]=li(null),f=ic(null),[d,u]=li(null),[g,m]=li(!1),v=Math.max(0,p.length-kw),k=v>0&&!g,B=o?Math.min(o.index,v):v,O=p.map((z,N)=>({comment:z,index:N})).slice(k?B:0),L=wi(),R=z=>{if(n){n(z);return}window.open(L(z.uuid??""),"_blank","noopener,noreferrer")},P=z=>{if(l){l(z);return}window.open(L(z.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},j=Br().slots?.avatar;return Ht(st,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[Ht(st,{sx:{display:"flex",alignItems:"center",gap:1},children:[$e(to,{sx:{fontSize:18,display:"block",color:"#37352f"}}),Ht(st,{sx:{fontSize:Wl,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",p.length>0?` (${p.length})`:""]}),v>0&&(!k||B>0)?$e(st,{role:"button",tabIndex:0,onClick:()=>m(z=>!z),onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),m(N=>!N))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:k?`\uC774\uC804 \uB313\uAE00 ${B}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),p.length===0?$e(st,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,$e(st,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:O.map(({comment:z,index:N})=>{let S=!!b&&z.author===b;return Ht(st,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let C=i?.get(z.author)??"";return j?$e(st,{sx:{display:"inline-flex",flexShrink:0},children:$e(j,{name:z.author,src:C||void 0,size:44})}):$e(st,{sx:{display:"inline-flex",flexShrink:0},children:$e(Nr,{src:C,name:z.author,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Go[0]},iconFontSize:24})})})(),Ht(st,{sx:{flex:1,minWidth:0},children:[Ht(st,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[$e(st,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.author}),$e(st,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:z.time}),S?$e(st,{sx:{ml:"auto"}}):Ht(st,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[$e(Cd,{kind:"like",reactions:z.likes,myAccountSeq:c,onToggle:()=>t?.(e,N,"like")}),$e(Cd,{kind:"ack",reactions:z.acks,myAccountSeq:c,onToggle:()=>t?.(e,N,"ack")})]}),S?Ht(st,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[$e(Zr,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>s({index:N,text:z.text,attachments:[...z.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:$e(gw,{sx:{fontSize:15}})}),$e(Zr,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:C=>u({anchorEl:C.currentTarget,index:N}),sx:{color:"#9a9a97"},children:$e(ka,{sx:{fontSize:15}})})]}):null]}),o?.index===N?Ht(st,{sx:{mt:.5},children:[$e(st,{component:"textarea",autoFocus:!0,spellCheck:!1,value:o.text,onChange:C=>s({...o,text:C.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),Ht(st,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[o.attachments.map((C,E)=>{let h=()=>s({...o,attachments:o.attachments.filter((y,w)=>w!==E)});return Sa(C.name)&&C.uuid?Ht(st,{sx:{position:"relative"},children:[$e(st,{component:"img",src:L(C.uuid,{thumb:"md"}),alt:C.name,title:C.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),$e(Zr,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:h,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:$e(ka,{sx:{fontSize:14}})})]},`kept-${C.uuid}-${E}`):$e(_a,{size:"small",icon:$e(ci,{sx:{fontSize:14}}),label:C.name,onDelete:h,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${C.uuid??C.name}-${E}`)}),o.files.map((C,E)=>{let h=()=>s({...o,files:o.files.filter((y,w)=>w!==E)});return Sa(C.name)?Ht(st,{sx:{position:"relative"},children:[$e(st,{component:"img",src:URL.createObjectURL(C),alt:C.name,title:`${C.name} (\uC0C8 \uD30C\uC77C)`,onLoad:y=>URL.revokeObjectURL(y.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),$e(Zr,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:h,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:$e(ka,{sx:{fontSize:14}})})]},`new-${C.name}-${E}`):$e(_a,{size:"small",icon:$e(ci,{sx:{fontSize:14}}),label:`${C.name} (\uC0C8 \uD30C\uC77C)`,onDelete:h,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${C.name}-${E}`)}),$e(Id,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:$e(Zr,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>f.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:$e(ww,{sx:{fontSize:20}})})})]}),Ht(st,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[$e(Sd,{size:"small",color:"inherit",onClick:()=>s(null),children:"\uCDE8\uC18C"}),$e(Sd,{size:"small",variant:"contained",disabled:!o.text.trim()&&o.attachments.length===0&&o.files.length===0,onClick:()=>{a(e,N,o.text,{attachments:o.attachments,files:o.files}),s(null)},children:"\uC800\uC7A5"})]}),$e(st,{component:"input",type:"file",multiple:!0,ref:f,sx:{display:"none"},onChange:C=>{let E=Array.from(C.target.files??[]);E.length>0&&s({...o,files:[...o.files,...E].slice(0,10)}),C.target.value=""}})]}):Ht(st,{children:[z.text?$e(st,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:z.text}):null,(z.attachments??[]).length>0?$e(st,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(z.attachments??[]).map((C,E)=>{let h=!!C.uuid;if(Sa(C.name)&&h)return $e(st,{component:"img",src:L(C.uuid??"",{thumb:"md"}),alt:C.name,title:`${C.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>R(C),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${C.name}-${E}`);let w=pa(C.name);return $e(_a,{size:"small",icon:$e(ci,{sx:{fontSize:14}}),label:`${C.name} (${oc(C.size)})`,clickable:h,onClick:h?()=>w?R(C):P(C):void 0,title:h?`${C.name} ${w?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:C.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${C.name}-${E}`)})}):null]})]})]},`${z.time}-${N}`)})}),$e(It,{open:!!d,anchorEl:d?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>u(null),onConfirm:()=>{d&&(r(e,d.index),s(null)),u(null)}})]})}function Sa(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function Ed({onSubmit:e}){let[p,b]=li(""),[c,i]=li([]),[a,r]=li(!1),t=ic(null),n=ic(null),l=Bt(),o=d=>{let u=Array.from(d??[]);u.length!==0&&i(g=>[...g,...u].slice(0,10))},s=()=>{let d=p.trim();!d&&c.length===0||(e(d,c.length>0?c:void 0),b(""),i([]))},f=Ht(Bd,{children:[$e(Zr,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>t.current?.click(),sx:{color:"#9a9a97"},children:$e(ci,{sx:{fontSize:20}})}),$e(Zr,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>n.current?.click(),sx:{color:"#9a9a97"},children:$e(_w,{sx:{fontSize:20}})})]});return Ht(st,{children:[c.length>0?$e(st,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:c.map((d,u)=>Sa(d.name)?Ht(st,{sx:{position:"relative"},children:[$e(st,{component:"img",src:URL.createObjectURL(d),alt:d.name,title:d.name,onLoad:g=>URL.revokeObjectURL(g.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),$e(Zr,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>i(g=>g.filter((m,v)=>v!==u)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:$e(ka,{sx:{fontSize:14}})})]},`${d.name}-${u}`):$e(_a,{size:"small",icon:$e(ci,{sx:{fontSize:14}}),label:`${d.name} (${oc(d.size)})`,onDelete:()=>i(g=>g.filter((m,v)=>v!==u)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${d.name}-${u}`))}):null,Ht(st,{sx:{position:"relative",display:"flex"},onDragOver:d=>{Array.from(d.dataTransfer?.types??[]).includes("Files")&&(d.preventDefault(),r(!0))},onDragLeave:d=>{d.currentTarget.contains(d.relatedTarget)||r(!1)},onDrop:d=>{Array.from(d.dataTransfer?.types??[]).includes("Files")&&(d.preventDefault(),r(!1),o(d.dataTransfer?.files??null))},children:[a?Ht(st,{sx:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",gap:.75,borderRadius:1,border:"2px dashed #2f80ed",bgcolor:"rgba(47,128,237,0.08)",color:"#2f80ed",fontSize:14,fontWeight:600,pointerEvents:"none"},children:[$e(ci,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,$e(mw,{value:p,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:d=>b(d.target.value),fullWidth:!0,multiline:!0,minRows:l?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:l?15:6.5,pb:l?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),l?Ht(st,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[f,$e(Zr,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!p.trim()&&c.length===0,onClick:s,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:$e(Td,{sx:{fontSize:22}})})]}):Ht(Bd,{children:[$e(st,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:f}),$e(Zr,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!p.trim()&&c.length===0,onClick:s,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:$e(Td,{sx:{fontSize:22}})})]})]}),$e(st,{component:"input",ref:t,type:"file",multiple:!0,onChange:d=>{o(d.target.files),d.target.value=""},sx:{display:"none"}}),$e(st,{component:"input",ref:n,type:"file",accept:"image/*",multiple:!0,onChange:d=>{o(d.target.files),d.target.value=""},sx:{display:"none"}})]})}import{useState as sc}from"react";import{Box as fi,IconButton as Ui,Tooltip as Ba}from"@mui/material";import Dw from"@mui/icons-material/Close";import Pw from"@mui/icons-material/ArrowBack";import Nw from"@mui/icons-material/ShareOutlined";import jw from"@mui/icons-material/ContentCopyOutlined";import Lw from"@mui/icons-material/HistoryOutlined";import Fw from"@mui/icons-material/Print";import{useEffect as Sw}from"react";import{Box as Wn,Button as Tw,CircularProgress as Cw}from"@mui/material";import{FormDialog as Bw}from"@ehfuse/mui-form-dialog";import{OverlayScrollbar as Iw}from"@ehfuse/overlay-scrollbar";import{jsx as Un,jsxs as Ta}from"react/jsx-runtime";var Mw={created:"\uC5C5\uBB34\uB97C \uB4F1\uB85D\uD588\uC2B5\uB2C8\uB2E4",completed:"\uC644\uB8CC \uCC98\uB9AC\uD588\uC2B5\uB2C8\uB2E4",uncompleted:"\uC644\uB8CC\uB97C \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4",confirm_requested:"\uD655\uC778\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4",acked:"\uD655\uC778\uD588\uC2B5\uB2C8\uB2E4",claimed:"\uC5C5\uBB34\uB97C \uAC00\uC838\uAC14\uC2B5\uB2C8\uB2E4",bug_verified:"\uC218\uC815\uC744 \uD655\uC778\uD588\uC2B5\uB2C8\uB2E4(\uC885\uB8CC)",bug_reopened:"\uC7AC\uC624\uD508\uD588\uC2B5\uB2C8\uB2E4"};function Rd(e){return String(e??"").trim()||"\uC5C6\uC74C"}function Ew(e){if(e.kind!=="field")return Mw[String(e.kind)]??"\uBCC0\uACBD\uD588\uC2B5\uB2C8\uB2E4";let p=String(e.field_label??e.field??"").trim()||"\uD56D\uBAA9",b=String(e.old_value??"").trim(),c=String(e.new_value??"").trim();return!b&&c?`${p}\uC744(\uB97C) "${c}"(\uC73C)\uB85C \uC785\uB825\uD588\uC2B5\uB2C8\uB2E4`:b&&!c?`${p}\uC744(\uB97C) \uBE44\uC6E0\uC2B5\uB2C8\uB2E4`:`${p}\uC744(\uB97C) "${Rd(b)}" \u2192 "${Rd(c)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function Ca({open:e,taskSeq:p,items:b,loading:c,onLoad:i,onClose:a}){let r=Bt();Sw(()=>{e&&p>0&&!b&&i?.(p)},[e,p,b,i]);let t=Un(Wn,{sx:{height:r?"100%":420,minHeight:0},children:Un(Iw,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Ta(Wn,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[c&&!b?Ta(Wn,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[Un(Cw,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,b&&b.length===0?Un(Wn,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(b??[]).map(n=>Ta(Wn,{sx:{display:"flex",flexDirection:r?"column":"row",gap:r?.25:1,alignItems:r?"stretch":"baseline",minWidth:0,flexShrink:0,...r?{pb:1,borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none",pb:0}}:{}},children:[Un(Wn,{sx:{flexShrink:0,...r?{}:{width:"10.5em"},whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:Mr(n.acted_time)}),Ta(Wn,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[Un(Wn,{component:"span",sx:{fontWeight:500},children:String(n.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),Un(Wn,{component:"span",sx:{ml:.5},children:Ew(n)})]})]},n.seq))]})})});return Un(Bw,{open:e,onClose:a,maxWidth:"sm",fullScreen:r,mobilePresentation:r?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:r?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:`\uD65C\uB3D9${b&&b.length>0?` (${b.length})`:""}`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-activity",sections:[{id:"task-activity",showTitle:!1,children:t}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:Un(Tw,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}})}import{InfoAlert as Rw,SuccessAlert as Aw}from"@ehfuse/alerts";var Ad=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
9
37
  `).replace(/<\/(p|div|li|h[1-6]|tr)>/gi,`
10
38
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&amp;/gi,"&").replace(/\n{3,}/g,`
11
39
 
12
- `).trim():"";function qy(e){let o=[`[\uC5C5\uBB34] ${e.title}`],t=et(e.start_date),n=et(e.due_date);(t||n)&&o.push(`\uAE30\uAC04: ${t&&n?`${t} ~ ${n}`:t||n}`),e.manager_name&&o.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let r=vo(e).name;r&&o.push(`\uC0C1\uD0DC: ${r}`);let i=iu(e.content);i&&o.push("",i);let a=String(e.note??"").trim();return a&&o.push("",`\uBE44\uACE0: ${a}`),o.join(`
13
- `)}function au(e){navigator.clipboard.writeText(e).then(()=>zy("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Py("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function vr(e,o){let t=qy(e);if(o&&typeof navigator.share=="function"){navigator.share({text:t}).catch(n=>{n?.name!=="AbortError"&&au(t)});return}au(t)}import{Fragment as $y,jsx as Ke,jsxs as lu}from"react/jsx-runtime";function su({task:e,myAccountSeq:o=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:r,onChangeIconColor:i,onClose:a,appBarMode:l=!1,activityItems:p,activityLoading:c,onLoadActivity:m,onPrint:d}){let u=Re(),[s,g]=Gl(!1),[T,S]=Gl(null),[b,f]=Gl(null),D=e.is_notice?Ce(e.icon||no):null,B=!!e.is_notice,R=!!e.is_event,y=B&&o>0&&(e.author_account_seq??0)===o,I=!Vt(e,o),P=!R&&(B?y:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o);return lu($y,{children:[lu(Ir,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[l&&a?Ke(ni,{"aria-label":"\uB4A4\uB85C",onClick:a,sx:{color:"#37352f",ml:-1},children:Ke(Ly,{})}):null,P&&!l?Ke(ha,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${Yo(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Ke(Ir,{sx:{display:"flex",flexShrink:0,mr:1.5},children:Ke(Bt,{onClick:_=>f({anchorEl:_.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,l||!D?null:Ke(Ir,{sx:{display:"flex",px:.5,color:e.icon_color||(B?"#e5484d":"#1e3a8a")},children:Ke(D,{sx:{fontSize:20}})}),T!==null?Ke(Ir,{component:"input",autoFocus:!0,spellCheck:!1,value:T,onChange:_=>S(_.target.value),onBlur:()=>{T.trim()&&T.trim()!==e.title&&n(e.seq,T.trim()),S(null)},onKeyDown:_=>{_.key==="Enter"&&_.target.blur(),_.key==="Escape"&&S(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):l?Ke(Ir,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B?"\uACF5\uC9C0":R?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Ke(Ir,{onClick:I?void 0:()=>S(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:I?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),m?Ke(ha,{title:"\uD65C\uB3D9",arrow:!0,children:Ke(ni,{"aria-label":"\uD65C\uB3D9",onClick:()=>g(!0),sx:{color:"#6b7280"},children:Ke(Hy,{sx:{fontSize:20}})})}):null,Ke(ha,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Ke(ni,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>vr(e,u),sx:{color:"#6b7280"},children:u?Ke(Ny,{sx:{fontSize:20}}):Ke(Fy,{sx:{fontSize:20}})})}),d?Ke(ha,{title:"\uC778\uC1C4",arrow:!0,children:Ke(ni,{"aria-label":"\uC778\uC1C4",onClick:()=>d(e),sx:{color:"#6b7280"},children:Ke(Wy,{sx:{fontSize:20}})})}):null,a&&!l?Ke(ni,{"aria-label":"\uB2EB\uAE30",onClick:a,sx:{color:"#6b7280"},children:Ke(Ay,{})}):null]}),Ke(Pe,{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:()=>f(null),onConfirm:()=>{b&&t(e.seq,b.nextCompleted),f(null)}}),Ke(ga,{open:s,taskSeq:e.seq,items:p,loading:c,onLoad:m,onClose:()=>g(!1)})]})}import{useState as ht}from"react";import{Box as oo,Button as _r,ButtonBase as Jy,Checkbox as eS,Divider as Xn,Menu as Jl,MenuItem as es}from"@mui/material";import oS from"@mui/icons-material/ExpandLess";import tS from"@mui/icons-material/ExpandMore";import nS from"@mui/icons-material/ConfirmationNumberOutlined";import fu from"@mui/icons-material/Check";import rS from"@mui/icons-material/DirectionsRunOutlined";import iS from"@mui/icons-material/SpeedOutlined";import os from"@mui/icons-material/CheckCircle";import aS from"@mui/icons-material/CheckCircleOutlineOutlined";import ts from"@mui/icons-material/CheckCircleOutlined";import xu from"@mui/icons-material/AccessTimeOutlined";import lS from"@mui/icons-material/AutorenewOutlined";import sS from"@mui/icons-material/LabelOutlined";import cS from"@mui/icons-material/PersonOutlineOutlined";import mS from"@mui/icons-material/SubjectOutlined";import uS from"@mui/icons-material/StickyNote2Outlined";import dS from"@mui/icons-material/PanToolAltOutlined";import gu from"@mui/icons-material/LockOutlined";import hu from"@mui/icons-material/PublicOutlined";import bu from"@mui/icons-material/Group";import pS from"@mui/icons-material/Repeat";import fS from"@mui/icons-material/EventOutlined";import{ConfirmDialog as ku,InfoAlert as xS}from"@ehfuse/alerts";import{DatePicker as gS}from"@ehfuse/mui-datetime-picker";import{useState as Vy}from"react";import{TextField as Ky}from"@ehfuse/mui-form-controls";import{jsx as Uy}from"react/jsx-runtime";function cu({value:e,onCommit:o,onDraftChange:t,readOnly:n=!1}){let[r,i]=Vy(null);return Uy(Ky,{value:r??e,placeholder:n?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:n}},onChange:a=>{i(a.target.value),t?.(a.target.value)},onBlur:()=>{r!==null&&r.trim()!==e&&o(r),i(null)},onKeyDown:a=>{a.key==="Enter"&&a.target.blur(),a.key==="Escape"&&i(null)},sx:{mt:1}})}import{useMemo as Xl,useState as Ql}from"react";import{Box as Do,Button as du,IconButton as Gy}from"@mui/material";import jy from"@mui/icons-material/AccountTreeOutlined";import Yy from"@mui/icons-material/Add";import Xy from"@mui/icons-material/Close";import Qy from"@mui/icons-material/NextPlanOutlined";function Yn(e){return e.relations??[]}function Oq(e,o,t){return Yn(e).some(n=>n.type===t&&n.task_seq===o.seq)||Yn(o).some(n=>n.type===t&&n.task_seq===e.seq)}function mu(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function jl(e,o){let t=new Map(o.map(s=>[s.seq,s]));t.set(e.seq,e);let n=new Map,r=(s,g)=>{n.has(s)||n.set(s,new Set),n.has(g)||n.set(g,new Set),n.get(s).add(g),n.get(g).add(s)};for(let s of t.values())for(let g of Yn(s))g.type==="follow_up"&&t.has(g.task_seq)&&r(s.seq,g.task_seq);let i=new Set([e.seq]),a=[e.seq];for(;a.length>0;){let s=a.shift();for(let g of n.get(s)??[])i.has(g)||(i.add(g),a.push(g))}let l=[...i].map(s=>t.get(s)).filter(s=>!!s).sort((s,g)=>mu(s).localeCompare(mu(g))),p=new Set;for(let s of Yn(e))s.type==="related"&&p.add(s.task_seq);for(let s of t.values())s.seq!==e.seq&&Yn(s).some(g=>g.type==="related"&&g.task_seq===e.seq)&&p.add(s.seq);let c=[...p].map(s=>t.get(s)).filter(s=>s!==void 0&&s.seq!==e.seq),m=[...t.values()].filter(s=>s.seq!==e.seq&&Yn(s).some(g=>g.type==="duplicate_of"&&g.task_seq===e.seq)),d=Yn(e).find(s=>s.type==="duplicate_of")?.task_seq,u=d?t.get(d)??null:null;return{lineage:l,related:c,duplicates:m,duplicateOf:u}}function Yl(e,o){let t=jl(e,o);return(t.lineage.length>=2?t.lineage.length-1:0)+t.related.length+t.duplicates.length+(t.duplicateOf?1:0)}function uu(e,o){return Yl(e,o)>0}import{Fragment as Zy,jsx as Ye,jsxs as gt}from"react/jsx-runtime";function Zl({item:e,caption:o,onOpen:t,onUnlink:n}){let r=e.is_notice||e.is_event?Ce(e.icon||(e.is_notice?no:fo)):null;return gt(Do,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[o?Ye(Do,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:o}):null,r?Ye(r,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,gt(Do,{component:"span",onClick:t,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...t?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Ye(Ae,{option:vo(e),small:!0}),n?Ye(Gy,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:n,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Ye(Xy,{sx:{fontSize:15}})}):null]})}function pu({task:e,tasks:o,readOnly:t=!1,onOpenTask:n,onLink:r,onUnlink:i,onCreateFollowUp:a}){let[l,p]=Ql(!1),[c,m]=Ql(null),[d,u]=Ql(null),s=Xl(()=>jl(e,o),[e,o]),g=s.lineage.length>=2,T=Xl(()=>Yl(e,o),[e,o]),S=Xl(()=>{let f=new Set;for(let D of s.lineage)f.add(D.seq);for(let D of s.related)f.add(D.seq);for(let D of s.duplicates)f.add(D.seq);return s.duplicateOf&&f.add(s.duplicateOf.seq),[...f]},[s]),b=(f,D,B)=>{u({anchorEl:f,targetSeq:D,type:B})};return gt(rt,{icon:Ye(jy,{sx:{fontSize:19,display:"block"}}),title:gt(Zy,{children:["\uAD00\uB828 \uC5C5\uBB34",T>0?Ye(Do,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:T}):null]}),titleExtra:t?null:gt(Do,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[a?Ye(du,{size:"small",color:"inherit",startIcon:Ye(Qy,{sx:{fontSize:16}}),onClick:f=>m(f.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,r?Ye(du,{size:"small",color:"inherit",startIcon:Ye(Yy,{sx:{fontSize:16}}),onClick:()=>p(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[gt(Do,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[g?Ye(Do,{sx:{mb:s.related.length||s.duplicates.length||s.duplicateOf?1:0},children:s.lineage.map((f,D)=>{let B=f.seq===e.seq,R=D===s.lineage.length-1;return gt(Do,{sx:{display:"flex",gap:1},children:[gt(Do,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Ye(Do,{sx:{width:B?9:7,height:B?9:7,borderRadius:"50%",bgcolor:B?"#2f80ed":f.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),R?null:Ye(Do,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),gt(Do,{sx:{flex:1,minWidth:0,pb:R?0:.5},children:[gt(Do,{sx:{display:"flex",alignItems:"center",gap:.75},children:[gt(Do,{component:"span",onClick:!B&&n?()=>n(f.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:B?600:400,color:B?"#2f80ed":f.completed?"#9a9a97":"#37352f",textDecoration:f.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!B&&n?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[f.ticket_no?`${f.ticket_no} `:"",f.title]}),Ye(Ae,{option:vo(f),small:!0})]}),Ye(Do,{sx:{fontSize:12,color:"#9a9a97"},children:f.completed&&f.completed_time?`${f.completed_time} \uC644\uB8CC`:f.created_time??""})]})]},f.seq)})}):null,s.duplicateOf?Ye(Zl,{item:s.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:n?()=>n(s.duplicateOf.seq):void 0,onUnlink:!t&&i?f=>b(f.currentTarget,s.duplicateOf.seq,"duplicate_of"):void 0}):null,s.duplicates.map(f=>Ye(Zl,{item:f,caption:"\uC911\uBCF5",onOpen:n?()=>n(f.seq):void 0,onUnlink:!t&&i?D=>b(D.currentTarget,f.seq,"duplicate_of"):void 0},`dup-${f.seq}`)),s.related.map(f=>Ye(Zl,{item:f,onOpen:n?()=>n(f.seq):void 0,onUnlink:!t&&i?D=>b(D.currentTarget,f.seq,"related"):void 0},`rel-${f.seq}`)),T===0?Ye(Do,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),r?Ye(ta,{open:l,task:e,tasks:o,excludeSeqs:S,onClose:()=>p(!1),onSubmit:(f,D)=>r(e.seq,f,D)}):null,Ye(Pe,{open:!!c,anchorEl:c,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>m(null),onConfirm:()=>{a?.(e.seq),m(null)}}),Ye(Pe,{open:!!d,anchorEl:d?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>u(null),onConfirm:()=>{d&&i?.(e.seq,d.targetSeq,d.type),u(null)}})]})}import{Fragment as Ho,jsx as q,jsxs as Ue}from"react/jsx-runtime";function In({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return q(oo,{component:"span",sx:{color:"#9a9a97"},children:e})}function Tu({task:e,customTabs:o,statusOptions:t,avatarSrcByName:n,onChangeStatus:r,onChangeLabels:i,onAddLabelOption:a,onChangeProject:l,onAddProject:p,onChangeDate:c,onChangeReminder:m,onMemberEdit:d,onChangePriority:u,onChangeVisibility:s,onChangeRepeat:g,departments:T=[],onChangeEventTime:S,onChangeEventPlace:b,onChangeEventAddress:f,onChangeNote:D,onChangeNoteDraft:B,onChangeContent:R,onChangeContentHeight:y,onAddChecklistItem:I,onToggleChecklistItem:P,onRemoveChecklistItem:_,onUpdateChecklistItem:v,onReorderChecklist:$,onConvertChecklistToTask:h,onOpenChecklistTask:x,onLinkChecklistTask:C,resolveChecklistTask:L,relatedTasksPool:N,onOpenRelatedTask:k,onLinkRelatedTask:w,onUnlinkRelatedTask:G,onCreateFollowUpTask:ae,onAddAttachments:ie,onRemoveAttachment:be,onPreview:W,onDownload:U,onUpdateComment:de,onRemoveComment:Be,onToggleCommentReaction:ve,currentUserName:j="",myAccountSeq:F=0,noticeAdmin:oe=!1,hideProject:A=!1,hideLabel:V=!1,showTitle:te=!1,onChangeTitle:z,onToggleCompleted:me,onChangeIcon:ke,onChangeIconColor:He,employees:Xe=[],onAckConfirm:we,onRequestConfirm:to,onChangeBugField:X,sprints:K=[],sprintProject:uo=!1,hideSprint:Zo=!1,onChangeSprint:pn,onChangeStoryPoints:wn,onChangeResolution:E,onClaimTask:he,onVerifyBug:Ie}){let[Ne,We]=ht(null),[co,Oo]=ht(null),[Dn,De]=ht(null),[H,Y]=ht(!1),le={[dt]:H?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[ge,Ge]=ht(null),[$e,Te]=ht(null),[ko,To]=ht(null),[Bo,po]=ht(null),[Mn,qe]=ht(null),[yt,Uo]=ht(null),[fn,Ft]=ht(null),Qe=!!e.is_notice,Me=!!e.is_event,Ro=!!e.is_bug,mi=!!he&&yi(e,F),ui=!!he&&Si(e,F),nr=!!Ie&&Ro&&!!e.completed&&F>0&&(e.author_account_seq??0)===F&&!(e.acks??[]).some(M=>M.account_seq===F),Po=!Vt(e,F),En=!e.is_event&&(e.is_notice?F>0&&(e.author_account_seq??0)===F:(e.author_account_seq??0)===F||(e.manager_account_seq??0)===F),On=e.is_notice||e.is_event?Ce(e.icon||(e.is_notice?no:fo)):null,Rn=Qe?!Ti(e,F):Po,xn=mi||ui?Ue(Bt,{onClick:M=>Ft(M.currentTarget),children:[q(dS,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Sa=Qe?ma(e,Xe):"",Co=Qe?Wm(e,Xe,F):null,zo=Qe?null:Pi(e,F),Ba=!!(zo&&zo.total>0||Qe&&Co),Ca=!Qe,Er=Ue(Ho,{children:[q(pe,{icon:q(cS,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Ot(9),le??null,...Me?[]:[io(1)]],children:e.created_by?Ue(Ho,{children:[q(Ao,{names:[e.created_by],size:20,avatarSrcByName:n}),e.created_by]}):q(In,{})}),q(pe,{icon:q(xu,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Ot(11),le??null,...Me?[]:[io(2)]],children:e.created_time?Yo(e.created_time):q(In,{})})]});return Ue(Ho,{children:[te?Ue(oo,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[En?q(eS,{checked:e.completed,icon:q(aS,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:q(os,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(M,at)=>{co||Oo({anchorEl:M.currentTarget,nextCompleted:at})},sx:{p:0,mt:.25}}):null,On?q(oo,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(Qe?"#e5484d":"#1e3a8a")},children:q(On,{sx:{fontSize:20}})}):null,q(oo,{sx:{flex:1,minWidth:0},children:Ne!==null?q(oo,{component:"input",autoFocus:!0,spellCheck:!1,value:Ne,onChange:M=>We(M.target.value),onBlur:()=>{Ne.trim()&&Ne.trim()!==e.title&&z(e.seq,Ne.trim()),We(null)},onKeyDown:M=>{M.key==="Enter"&&M.target.blur(),M.key==="Escape"&&We(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):q(oo,{onClick:()=>We(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),q(Pe,{open:!!co,anchorEl:co?.anchorEl??null,title:co?.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:co?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Oo(null),onConfirm:()=>{co&&me(e.seq,co.nextCompleted),Oo(null)}})]}):null,Ue(oo,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[dt]:{pb:0,"& > :last-child":{mb:0}}},children:[q(Ji,{hideProject:A,pinColumns:!0,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:o,avatarSrcByName:n,hideDueDate:!Me&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:Qe,event:Me,readOnly:Po,targetSummary:Sa,onChangeProject:M=>l(e.seq,M),onAddProject:p,onChangeStartDate:M=>c(e.seq,"start_date",M),onChangeDueDate:M=>c(e.seq,"due_date",M),onChangeReminder:M=>m(e.seq,M),onChangePriority:M=>u(e.seq,M),onChangeEventTime:M=>S?.(e.seq,M),onChangeEventPlace:M=>b?.(e.seq,M),onChangeEventAddress:M=>f?.(e.seq,M),onMemberEdit:M=>d(e,M,null),narrowCollapsedSx:le,reminderLocked:e.completed,managerAction:xn,leading:Ue(Ho,{children:[nr||xn&&(Qe||Me)?Ue(oo,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[Qe||Me?xn:null,nr?Ue(Ho,{children:[q(_r,{variant:"contained",size:"large",onClick:()=>Ie?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),q(_r,{variant:"outlined",size:"large",color:"error",onClick:()=>Ie?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,Ro&&e.ticket_no?q(pe,{icon:q(nS,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:io(1),children:q(oo,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Me?null:q(oo,{sx:Ro&&e.ticket_no||Ca||Ba?io(Ro&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:q(pe,{icon:q(lS,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:Po||e.completed?void 0:M=>Ge(M),children:q(Ae,{option:vo(e)})})}),Qe?null:(()=>{let M=st(e),at=M==="all"?q(hu,{sx:{fontSize:17,color:"#2f80ed"}}):M==="group"?q(bu,{sx:{fontSize:17,color:"#d9730d"}}):q(gu,{sx:{fontSize:17}}),gn=M==="all"?"\uC804\uCCB4\uACF5\uAC1C":M==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${T.find(lt=>lt.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return q(oo,{sx:Me?void 0:io(Ro?1:2),children:q(pe,{icon:at,label:"\uACF5\uAC1C",onClick:Po||!s?void 0:lt=>Te(lt),children:gn})})})(),!Qe&&!Ro?q(oo,{sx:Me?void 0:io(1),children:q(pe,{icon:q(pS,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:Po||!g?void 0:M=>To(M),children:e.repeat_rule?ji(e.repeat_rule):q(In,{label:"\uC5C6\uC74C"})})}):null,!Qe&&!Ro&&e.repeat_rule?q(oo,{sx:Me?void 0:io(2),children:q(pe,{icon:q(fS,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:Po||!g?void 0:M=>po(M),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:q(In,{})})}):null,zo&&zo.total>0?q(oo,{sx:Me?void 0:io(2),children:q(pe,{icon:q(ts,{sx:{fontSize:17}}),label:"\uD655\uC778",children:zo.canConfirm?q(_r,{size:"small",variant:"contained",onClick:()=>we?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Ue(_r,{size:"small",variant:"outlined",color:"inherit",startIcon:zo.myTime?q(os,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:M=>De({anchorEl:M.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[zo.count," / ",zo.total]})})}):null,Qe&&Co?q(oo,{sx:io(2),children:q(pe,{icon:q(ts,{sx:{fontSize:17}}),label:"\uD655\uC778",children:q(oo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:Co.canAck?q(_r,{size:"small",variant:"contained",onClick:()=>we?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):q(_r,{size:"small",variant:"outlined",color:"inherit",startIcon:Co.acked?q(os,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:M=>De({anchorEl:M.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:Co.total>0&&Co.count>=Co.total?"\uC644\uB8CC":Ue(Ho,{children:[Co.count,q(oo,{component:"span",sx:{mx:.4},children:"/"}),Co.total]})})})})}):null,uo&&!Zo&&!Me&&!Qe?Ue(Ho,{children:[q(pe,{icon:q(rS,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:Po?void 0:M=>qe(M),sx:io(1),children:(e.sprint_seq??0)>0?K.find(M=>M.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":q(In,{label:"\uBBF8\uBC30\uC815"})}),q(pe,{icon:q(iS,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:io(2),children:q(an,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:Po,onCommit:M=>wn?.(e.seq,Number(M.replace(/[^0-9.]/g,""))||0)})})]}):null,Me||V?null:q(oo,{sx:[{gridColumn:"1 / -1"},le??null],children:q(pe,{icon:q(sS,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:Po?void 0:M=>Uo(M),children:(e.label_keys??[]).length>0?q(hn,{labelKeys:e.label_keys??[],labelOptions:t}):q(In,{})})}),Me?null:Er]}),trailing:Ue(Ho,{children:[Ro?q(ea,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:Po,showResolution:!!e.completed,onChangeRepro:M=>X?.(e.seq,"bug_repro",M),onChangeDevice:M=>X?.(e.seq,"bug_device",M),onChangeWhere:M=>X?.(e.seq,"bug_where",M),onChangeVersion:M=>X?.(e.seq,"bug_version",M),onChangeResolution:M=>E?.(e.seq,M)}):null,Me?Er:null,e.completed?Ue(Ho,{children:[q(pe,{icon:q(ts,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Ot(10),le??null,...Me?[]:[io(1)]],children:e.completed_by?Ue(Ho,{children:[q(Ao,{names:[e.completed_by],size:20,avatarSrcByName:n}),e.completed_by]}):q(In,{})}),q(pe,{icon:q(xu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Ot(12),le??null,...Me?[]:[io(2)]],children:e.completed_time?Yo(e.completed_time):q(In,{})})]}):null]})}),Ue(oo,{sx:{display:"none",[dt]:{display:"block",mt:1.5,mb:0}},children:[q(Xn,{sx:{borderColor:"#e6e6e3"}}),q(Jy,{onClick:()=>Y(M=>!M),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:H?Ue(Ho,{children:["\uC811\uAE30 ",q(oS,{sx:{fontSize:18}})]}):Ue(Ho,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",q(tS,{sx:{fontSize:18}})]})})]}),Ue(oo,{children:[q(Xn,{sx:{my:1.5,borderColor:"#e6e6e3",[dt]:{mt:0,mb:1.25}}}),q(rt,{icon:q(mS,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:q(oo,{sx:{userSelect:"text"},children:q(oa,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:y?M=>y(e.seq,M):void 0,readOnly:Po,onChange:M=>R(e.seq,M)})})}),e.is_bug?null:Ue(Ho,{children:[q(Xn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),q(rt,{icon:q(uS,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:q(oo,{sx:{userSelect:"text"},children:q(cu,{value:e.note,readOnly:Rn,onCommit:M=>D(e.seq,M),onDraftChange:B?M=>B(e.seq,M):void 0})})})]}),Me?null:Ue(Ho,{children:[q(Xn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),q(na,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Rn,onAdd:I,onToggle:P,onRemove:_,onUpdate:v,onReorder:$,onConvertToTask:h,onOpenLinkedTask:x,resolveLinkedTask:L,myAccountSeq:F,linkCandidates:N,linkBaseTask:e,onLinkExistingTask:C})]}),N&&!Me&&!Qe&&uu(e,N)?Ue(Ho,{children:[q(Xn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),q(pu,{task:e,tasks:N,readOnly:Po,onOpenTask:k,onLink:w,onUnlink:G,onCreateFollowUp:ae})]}):null,q(Xn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),q(la,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Rn,onAdd:ie,onRemove:be,onPreview:W?M=>W({...M,taskSeq:e.seq}):void 0,onDownload:U?M=>U({...M,taskSeq:e.seq}):void 0})]}),q(Xn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),q(tu,{taskSeq:e.seq,comments:e.comments??[],currentUserName:j,myAccountSeq:F,avatarSrcByName:n,onUpdate:de,onRemove:Be,onToggleReaction:ve,onPreview:W?M=>W({...M,taskSeq:e.seq}):void 0,onDownload:U?M=>U({...M,taskSeq:e.seq}):void 0})]}),q(lr,{anchorEl:ge,value:e.status,options:Qe?Ar:Ro?zn:Lr,onSelect:M=>r(e.seq,M),onClose:()=>Ge(null)}),q(Jl,{transitionDuration:0,anchorEl:ko,open:!!ko,onClose:()=>To(null),children:[{value:"",label:"\uC5C6\uC74C"},...Xr].map(M=>q(es,{selected:(e.repeat_rule??"")===M.value,onClick:()=>{To(null),(async()=>{let at=e.repeat_rule??"";if(M.value===at)return;if(M.value===""){await ku({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&g?.(e.seq,"","");return}let gn=String(e.due_date??"").slice(0,10);if(!gn){xS(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}at&&!await ku({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||g?.(e.seq,M.value,Yi(gn,M.value))})()},sx:{fontSize:14,minWidth:140},children:M.label},M.value||"none"))}),q(gS,{anchorEl:Bo,open:!!Bo,onClose:()=>po(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:M=>{po(null);let at=O=>String(O).padStart(2,"0"),gn=`${M.getFullYear()}-${at(M.getMonth()+1)}-${at(M.getDate())}`,lt=e.repeat_rule??"";lt&&g?.(e.seq,lt,gn)}}),q(Jl,{transitionDuration:0,anchorEl:$e,open:!!$e,onClose:()=>Te(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:q(gu,{sx:{fontSize:17,color:"#57564f"}}),selected:st(e)==="involved",onPick:()=>s?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:q(hu,{sx:{fontSize:17,color:"#2f80ed"}}),selected:st(e)==="all",onPick:()=>s?.(e.seq,"all",0)},...T.map(M=>({key:`group-${M.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${M.name}`,icon:q(bu,{sx:{fontSize:17,color:"#d9730d"}}),selected:st(e)==="group"&&(e.visibility_group_seq??0)===M.seq,onPick:()=>s?.(e.seq,"group",M.seq)}))].map(M=>Ue(es,{selected:M.selected,onClick:()=>{M.onPick(),Te(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[M.icon,M.label,M.selected?q(fu,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},M.key))}),q(Jl,{transitionDuration:0,anchorEl:Mn,open:!!Mn,onClose:()=>qe(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...K.filter(M=>`custom-${M.group_seq}`===String(e.tab_key??"")).map(M=>({seq:M.seq,label:tt(M)}))].map(M=>Ue(es,{onClick:()=>{pn?.(e.seq,M.seq),qe(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[M.label,(e.sprint_seq??0)===M.seq?q(fu,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},M.seq))}),q(Ri,{anchorEl:Dn?.anchorEl??null,open:!!Dn?.open,acks:e.acks??[],total:Co?.total??zo?.total??0,pendingNames:Co?.pendingNames??zo?.pendingNames??[],avatarSrcByName:n,onRequestConfirm:to&&(Co?Co.count<Co.total:zo&&zo.count<zo.total)?()=>{to(e.seq),De(M=>M?{...M,open:!1}:null)}:void 0,onClose:()=>De(M=>M?{...M,open:!1}:null)}),q(ca,{anchorEl:yt,selectedKeys:e.label_keys??[],labelOptions:t,onToggle:M=>i(e.seq,bi(e.label_keys??[],M)),onAddLabel:a,onClose:()=>Uo(null)}),q(Pe,{open:!!fn,anchorEl:fn,title:mi?"\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:()=>Ft(null),onConfirm:()=>{he?.(e.seq),Ft(null)}})]})}import{Fragment as BS,jsx as Wo,jsxs as Iu}from"react/jsx-runtime";function mL(){let e=new Date,o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function uL({open:e,task:o,onClose:t,onAddComment:n,onSaveFields:r,presentation:i="auto",myAccountSeq:a=0,onToggleCompleted:l,onChangeTitle:p,onChangeIcon:c,onChangeIconColor:m,activityItems:d,activityLoading:u,onLoadActivity:s,onPrint:g,...T}){let S=Re(),b=Su(null);o&&(b.current=o);let f=o??b.current,[D,B]=Bu(!1),[R,y]=Bu({}),I=Object.keys(R).length>0;yu(()=>{y({})},[o?.seq,e]);let P=Su(null);if(yu(()=>{P.current?.scrollTo({top:0})},[o?.seq]),!f)return null;let _=S&&I?{...f,...R}:f,v=_.checklist??[],$=(k,w)=>{S?y(G=>({...G,...k})):w()},h=()=>{let k=R;y({});let w=f.seq,G=k.title===void 0?void 0:String(k.title).trim();if(r){let ae={...k};G!==void 0&&(G?ae.title=G:delete ae.title),Object.keys(ae).length>0&&r(w,ae),vu({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}G&&p(w,G),k.icon!==void 0&&c(w,String(k.icon)),k.icon_color!==void 0&&m?.(w,String(k.icon_color)),k.status!==void 0&&T.onChangeStatus(w,k.status),k.label_keys!==void 0&&T.onChangeLabels(w,k.label_keys??[]),k.tab_key!==void 0&&T.onChangeProject(w,String(k.tab_key??"")),k.start_date!==void 0&&T.onChangeDate(w,"start_date",String(k.start_date??"")),k.due_date!==void 0&&T.onChangeDate(w,"due_date",String(k.due_date??"")),k.reminder!==void 0&&T.onChangeReminder(w,k.reminder),k.priority!==void 0&&T.onChangePriority(w,k.priority),k.event_time!==void 0&&T.onChangeEventTime?.(w,String(k.event_time??"")),k.event_place!==void 0&&T.onChangeEventPlace?.(w,String(k.event_place??"")),k.event_address!==void 0&&T.onChangeEventAddress?.(w,String(k.event_address??"")),k.content!==void 0&&T.onChangeContent(w,String(k.content??"")),k.note!==void 0&&T.onChangeNote(w,String(k.note??"")),k.visibility!==void 0&&T.onChangeVisibility?.(w,k.visibility,Number(k.visibility_group_seq??0)),vu({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},x={...T,onChangeStatus:(k,w)=>$({status:w},()=>T.onChangeStatus(k,w)),onChangeLabels:(k,w)=>$({label_keys:w},()=>T.onChangeLabels(k,w)),onChangeProject:(k,w)=>$({tab_key:w},()=>T.onChangeProject(k,w)),onChangeDate:(k,w,G)=>$({[w]:G},()=>T.onChangeDate(k,w,G)),onChangeReminder:(k,w)=>$({reminder:w},()=>T.onChangeReminder(k,w)),onChangePriority:(k,w)=>$({priority:w},()=>T.onChangePriority(k,w)),onChangeEventTime:(k,w)=>$({event_time:w},()=>T.onChangeEventTime?.(k,w)),onChangeEventPlace:(k,w)=>$({event_place:w},()=>T.onChangeEventPlace?.(k,w)),onChangeEventAddress:(k,w)=>$({event_address:w},()=>T.onChangeEventAddress?.(k,w)),onChangeContent:(k,w)=>$({content:w},()=>T.onChangeContent(k,w)),onChangeNote:(k,w)=>$({note:w},()=>T.onChangeNote(k,w)),onMemberEdit:(k,w)=>T.onMemberEdit(k,w,S?G=>y(ae=>({...ae,...G})):null),onChangeNoteDraft:S?(k,w)=>$({note:w},()=>{}):void 0,onChangeVisibility:T.onChangeVisibility?(k,w,G)=>$({visibility:w,visibility_group_seq:G},()=>T.onChangeVisibility?.(k,w,G)):void 0,onAddChecklistItem:(k,w)=>$({checklist:[...v,{label:w,checked:!1}]},()=>T.onAddChecklistItem(k,w)),onToggleChecklistItem:(k,w,G)=>$({checklist:v.map((ae,ie)=>ie===w?{...ae,checked:G}:ae)},()=>T.onToggleChecklistItem(k,w,G)),onRemoveChecklistItem:(k,w)=>$({checklist:v.filter((G,ae)=>ae!==w)},()=>T.onRemoveChecklistItem(k,w)),onUpdateChecklistItem:T.onUpdateChecklistItem?(k,w,G)=>$({checklist:v.map((ae,ie)=>ie===w?{...ae,label:G}:ae)},()=>T.onUpdateChecklistItem?.(k,w,G)):void 0,onReorderChecklist:T.onReorderChecklist?(k,w)=>$({checklist:w},()=>T.onReorderChecklist?.(k,w)):void 0,onLinkChecklistTask:T.onLinkChecklistTask?(k,w,G)=>$({checklist:[...v,{label:G,checked:!1,task_seq:w}]},()=>T.onLinkChecklistTask?.(k,w,G)):void 0},C=Wo(Tu,{...x,task:_,myAccountSeq:a,onChangeTitle:(k,w)=>$({title:w},()=>p(k,w)),onToggleCompleted:l,onChangeIcon:(k,w)=>$({icon:w},()=>c(k,w)),onChangeIconColor:(k,w)=>$({icon_color:w},()=>m?.(k,w)),showTitle:S}),L=Wo(nu,{onSubmit:(k,w)=>n(_.seq,k,w)},_.seq);return S||i==="dialog"?Iu(BS,{children:[Wo(SS,{open:e,onClose:t,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:_.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":_.is_event?"\uC77C\uC815":_.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...s?[{icon:Wo(TS,{sx:{ml:2,color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>B(!0)}]:[],{icon:Wo(kS,{sx:{ml:s?0:2,color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>vr(_,!0)},{icon:Wo(hS,{variant:"contained",size:"small",disableElevation:!0,disabled:!I,onClick:I?h:void 0,sx:{ml:1,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:""}]},fullScreen:S,maxWidth:S?void 0:"md",width:S?void 0:720,mobilePresentation:S?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:L},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:Wo(ba,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:C})}]},f.seq),Wo(ga,{open:D,taskSeq:_.seq,items:d,loading:u,onLoad:s,onClose:()=>B(!1)})]}):Wo(bS,{anchor:"right",open:e,onClose:t,disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:k=>k.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Iu(ba,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[Wo(su,{task:_,myAccountSeq:a,onToggleCompleted:l,onChangeTitle:p,onChangeIcon:c,onChangeIconColor:m,onClose:t,activityItems:d,activityLoading:u,onLoadActivity:s,onPrint:g}),Wo(Cu,{sx:{borderColor:"#e6e6e3"}}),Wo(ba,{sx:{flex:1,minHeight:0},children:Wo(yS,{ref:P,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:C})}),Wo(Cu,{sx:{borderColor:"#37352f"}}),Wo(ba,{sx:{flexShrink:0},children:L})]})})}import{useEffect as vS,useState as Qn}from"react";import{Box as Vo,Button as is,IconButton as _u}from"@mui/material";import{FormDialog as IS}from"@ehfuse/mui-form-dialog";import _S from"@mui/icons-material/EditOutlined";import{ErrorAlert as wu}from"@ehfuse/alerts";import{ClearTextField as Du,DateTextField as Mu,LabelSelect as Eu}from"@ehfuse/mui-form-controls";var ns="custom-";function CS(e){return e.startsWith(ns)}function fL(e){return e>0?`${ns}${e}`:""}function rs(e){if(!CS(e))return 0;let o=Number(e.slice(ns.length));return Number.isInteger(o)&&o>0?o:0}import{Fragment as DS,jsx as ao,jsxs as _n}from"react/jsx-runtime";var wS=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function Ou(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function CL({open:e,customTabs:o,sprints:t,onClose:n,onCreate:r,onUpdate:i,onChangeStatus:a,onRemove:l}){let p=o.filter(h=>h.useSprints&&!h.archived),[c,m]=Qn(""),[d,u]=Qn(""),[s,g]=Qn(""),[T,S]=Qn(""),[b,f]=Qn(""),[D,B]=Qn(!1),[R,y]=Qn(0);vS(()=>{e&&(m(p.length===1?p[0].key:""),u(""),g(""),S(""),f(""),y(0))},[e]);let I=()=>{u(""),g(""),S(""),f(""),y(0)},P=h=>{y(h.seq),m(`custom-${h.group_seq}`),u(h.name),g(h.goal),S(h.start_date),f(h.end_date)},_=async()=>{let h=rs(c);if(!h){wu("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!d.trim()){wu("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}B(!0);try{if(R>0){i(R,{name:d.trim(),goal:s.trim(),start_date:T,end_date:b}),I();return}await r({group_seq:h,name:d.trim(),goal:s.trim(),start_date:T,end_date:b})&&I()}finally{B(!1)}},v=new Map(o.map(h=>[rs(h.key),h.label])),$=ao(Vo,{children:p.length===0?ao(Vo,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):_n(DS,{children:[_n(Vo,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[ao(Eu,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:c,options:p.map(h=>({value:h.key,label:h.label})),onChange:h=>m(String(h.target.value)),disabled:R>0}),ao(Du,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:d,onChange:h=>u(h.target.value)}),ao(Mu,{size:"medium",label:"\uC2DC\uC791\uC77C",value:T,onChange:h=>S(h.target.value)}),ao(Mu,{size:"medium",label:"\uC885\uB8CC\uC77C",value:b,onChange:h=>f(h.target.value)}),ao(Du,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:s,onChange:h=>g(h.target.value),sx:{gridColumn:"1 / -1"}})]}),_n(Vo,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[R>0?ao(is,{color:"inherit",onClick:I,disabled:D,children:"\uCDE8\uC18C"}):null,ao(is,{variant:"contained",onClick:()=>{_()},disabled:D,children:R>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),ao(Vo,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:t.length===0?ao(Vo,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(h=>_n(Vo,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[_n(Vo,{sx:{minWidth:0},children:[_n(Vo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[ao(Vo,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:h.name}),ao(Vo,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:v.get(h.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),_n(Vo,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Ou(h.start_date)," ~ ",Ou(h.end_date)]})]}),h.goal?ao(Vo,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:h.goal}):null]}),_n(Vo,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ao(Eu,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:h.status,options:wS.map(x=>({value:x.value,label:x.label})),onChange:x=>a(h.seq,String(x.target.value)),sx:{width:104,flexShrink:0}}),ao(_u,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>P(h),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:ao(_S,{sx:{fontSize:18}})}),ao(_u,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>l(h.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:ao(It,{style:{width:16,height:16}})})]})]},h.seq))})]})});return ao(IS,{open:e,onClose:n,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:$}],actions:{showCancelButton:!1,right:ao(is,{variant:"contained",onClick:n,children:"\uB2EB\uAE30"})}})}import{useState as Ru}from"react";import{Box as bo,Button as as,Divider as MS,IconButton as ES,TextField as OS}from"@mui/material";import{FormDialog as RS}from"@ehfuse/mui-form-dialog";import PS from"@mui/icons-material/OpenInNewOutlined";import zS from"@mui/icons-material/EventOutlined";import{ConfirmDialog as qS}from"@ehfuse/alerts";import{jsx as Le,jsxs as Zn}from"react/jsx-runtime";function PL({open:e,imports:o,onRegister:t,onRemove:n,onClose:r}){let[i,a]=Ru(""),[l,p]=Ru(!1),c=async()=>{let u=i.trim();if(u){p(!0);try{await t(u)&&a("")}finally{p(!1)}}},m=async u=>{await qS({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&n(u.seq)},d=Zn(bo,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[Zn(bo,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",Le("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",Le("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",Le("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),Le(bo,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),o.length>0?Le(bo,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:o.map((u,s)=>Zn(bo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:s>0?"1px solid #efefed":"none"},children:[Le(zS,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),Le(bo,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),Le(ES,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{m(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Le(It,{sx:{fontSize:18}})})]},u.seq))}):Le(bo,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),Le(MS,{sx:{my:1,borderColor:"#e6e6e3"}}),Le(bo,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),Zn(bo,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Le(bo,{children:Zn(bo,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",Le("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),Le(bo,{children:Zn(bo,{component:"span",children:[Le("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",Le("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Le(bo,{children:Le(bo,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),Le(bo,{children:Le(bo,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})})]}),Zn(bo,{sx:{display:"flex",gap:2,alignItems:"center"},children:[Le(OS,{value:i,onChange:u=>a(u.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),Le(as,{variant:"contained",disabled:!i.trim()||l,onClick:()=>{c()},sx:{flexShrink:0},children:l?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return Le(RS,{open:e,onClose:r,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:d}],actions:{showCancelButton:!1,left:Le(as,{variant:"outlined",startIcon:Le(PS,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Le(as,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Box as mn,Button as ri,TextField as AS}from"@mui/material";import{FormDialog as LS}from"@ehfuse/mui-form-dialog";import NS from"@mui/icons-material/ContentCopyOutlined";import Pu from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as zu}from"@ehfuse/alerts";import{Fragment as HS,jsx as lo,jsxs as Jn}from"react/jsx-runtime";function FS(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function WL({open:e,feed:o,feedTaskCount:t,buildFeedUrl:n,onSubscribe:r,onClose:i}){let a=n??FS,l=o.subscribed?a(o.token):"",p=()=>{navigator.clipboard.writeText(l).then(()=>zu("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>zu("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},c=()=>{let d=l.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(d)}`,"_blank")},m=Jn(mn,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Jn(mn,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",lo("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),t===0?Jn(mn,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",lo("br",{}),lo("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",o.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):o.subscribed&&o.enabled?Jn(HS,{children:[lo(AS,{value:l,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),Jn(mn,{sx:{display:"flex",gap:2},children:[lo(ri,{variant:"outlined",startIcon:lo(NS,{}),onClick:p,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),lo(ri,{variant:"contained",startIcon:lo(Pu,{}),onClick:c,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),Jn(mn,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[lo(mn,{children:Jn("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",lo("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),lo(mn,{children:lo("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),lo(mn,{children:lo("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),lo(mn,{children:lo("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):lo(ri,{variant:"contained",onClick:r,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return lo(LS,{open:e,onClose:i,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:m}],actions:{showCancelButton:!1,left:lo(ri,{variant:"outlined",startIcon:lo(Pu,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:lo(ri,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{useEffect as WS,useMemo as ls,useState as ss}from"react";import{Box as ii,Button as $S,Typography as VS}from"@mui/material";import{FormDialog as KS}from"@ehfuse/mui-form-dialog";import{SearchTextField as US}from"@ehfuse/mui-form-controls";import{TreeView as GS}from"@ehfuse/tree-view";import{Fragment as JS,jsx as bt,jsxs as eB}from"react/jsx-runtime";function qu(e){return`${e.name}#${e.seq}`}function jS(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function YS(e){let o=[],t=n=>{for(let r of n.employees??[])o.push(r);for(let r of n.groups??[])t(r)};for(let n of e)t(n);return o}function XS(e,o){return o?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(t=>String(t).toLowerCase().includes(o)):!0}function QS(e){let o=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:qu(e),renderLabel:bt(ii,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:bt(ii,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:o})})}}function Au(e,o){let t=(e.groups??[]).map(r=>Au(r,o)).filter(r=>r!==null),n=(e.employees??[]).filter(r=>XS(r,o)).map(QS);return t.length===0&&n.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...t,...n]}}function ZS({groups:e,allEmployees:o,initialSelectedSeqs:t,multiple:n,isMobile:r,onSelectionChange:i}){let[a,l]=ss(""),p=ls(()=>e.map(m=>Au(m,a.trim().toLowerCase())).filter(m=>m!==null),[e,a]),c=ls(()=>o.filter(m=>t.includes(m.seq)).map(qu),[]);return eB(JS,{children:[bt(ii,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:bt(US,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:l,onClear:()=>l(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),bt(ii,{sx:r?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:bt(GS,{items:p,checkbox:!0,multiSelect:n,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:m=>i(m.map(jS).filter(d=>d>0)),styles:{border:"none",borderRadius:"0"}})})]})}function QL({open:e,title:o="\uC9C1\uC6D0 \uC120\uD0DD",hint:t="",groups:n,multiple:r=!1,selectedSeqs:i,confirmText:a="\uD655\uC778",onConfirm:l,onClose:p}){let c=Re(),[m,d]=ss([]),[u,s]=ss(0),g=ls(()=>YS(n),[n]),T=i??[];WS(()=>{e&&(d(T),s(b=>b+1))},[e]);let S=()=>{let b=g.filter(f=>m.includes(f.seq));l(r?b:b.slice(0,1)),p()};return bt(KS,{open:e,onClose:p,title:`${o}${r&&m.length>0?` (${m.length}\uBA85)`:""}`,locale:"ko",fullScreen:c,mobilePresentation:c?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:bt(ii,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:bt(ZS,{groups:n,allEmployees:g,initialSelectedSeqs:T,multiple:r,isMobile:c,onSelectionChange:d},u)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:t?bt(VS,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:t}):void 0,right:bt($S,{variant:"contained",onClick:S,children:a})}})}import{useEffect as cB,useMemo as mB,useState as Qu}from"react";import{Box as li,Button as uB}from"@mui/material";import{FormDialog as dB}from"@ehfuse/mui-form-dialog";import{LabelSelect as Zu}from"@ehfuse/mui-form-controls";import{Box as qt}from"@mui/material";import{jsx as wr,jsxs as Dr}from"react/jsx-runtime";function oB(e,o){let t=o.filter(n=>n.sprint_seq===e.seq&&!n.archived&&n.completed);return{points:t.reduce((n,r)=>n+(r.story_points??0),0),count:t.length}}function Lu({sprints:e,tasks:o,height:t=160}){let r=[...e].sort((m,d)=>`${m.start_date}|${m.seq}`.localeCompare(`${d.start_date}|${d.seq}`)).map(m=>({sprint:m,...oB(m,o)})),i=r.some(m=>m.points>0),a=r.map(m=>i?m.points:m.count),l=Math.max(1,...a),p=r.filter(m=>m.sprint.status==="closed").map(m=>i?m.points:m.count),c=p.length>0?Math.round(p.reduce((m,d)=>m+d,0)/p.length*10)/10:null;return r.length===0?wr(qt,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Dr(qt,{children:[Dr(qt,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[Dr("span",{children:["\uC644\uB8CC ",i?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),c!==null?Dr("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",wr(qt,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),i?"SP":"\uAC74"]}):null]}),wr(qt,{sx:{display:"flex",alignItems:"flex-end",gap:2,height:t,px:.5},children:r.map(m=>{let d=i?m.points:m.count,u=Math.round((t-24)*d/l),s=m.sprint.status==="closed";return Dr(qt,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:[wr(qt,{sx:{fontSize:14,fontWeight:700,color:"#37352f",lineHeight:1.5},children:d}),wr(qt,{sx:{width:"60%",maxWidth:56,height:Math.max(2,u),borderRadius:"4px 4px 0 0",bgcolor:s?"#2f80ed":"#a9c9f5"}})]},m.sprint.seq)})}),wr(qt,{sx:{display:"flex",gap:2,px:.5,mt:.5},children:r.map(m=>Dr(qt,{sx:{flex:1,minWidth:0,textAlign:"center",fontSize:13.5,color:"#000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[m.sprint.name,m.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""]},m.sprint.seq))})]})}import{useMemo as tB}from"react";import{Box as er}from"@mui/material";import{jsx as At,jsxs as or}from"react/jsx-runtime";function Nu(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function nB(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function cs(e){return e.slice(5).replace("-",".")}function Fu({sprint:e,tasks:o,todayStr:t,height:n=200}){let r=tB(()=>{let b=Nu(e.start_date),f=Nu(e.end_date);if(!b||!f||f<b||Math.round((f.getTime()-b.getTime())/864e5)+1>366)return null;let B=o.filter(h=>h.sprint_seq===e.seq&&!h.archived);if(B.length===0)return{empty:!0};let R=B.some(h=>(h.story_points??0)>0),y=h=>R?h.story_points??0:1,I=B.reduce((h,x)=>h+y(x),0),P=new Map;for(let h of B){if(!h.completed)continue;let x=(h.completed_time??"").slice(0,10),C=/^\d{4}-\d{2}-\d{2}$/.test(x)?x:e.start_date;P.set(C,(P.get(C)??0)+y(h))}let _=[];for(let h=new Date(b);h<=f;h.setDate(h.getDate()+1))_.push(nB(h));let v=I,$=[];for(let h of _){if(h>t)break;v-=P.get(h)??0,$.push({day:h,value:Math.max(0,v)})}return{empty:!1,days:_,total:I,usePoints:R,actual:$}},[e,o,t]);if(!r)return At(er,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4."});if(r.empty)return At(er,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let{days:i,total:a,usePoints:l,actual:p}=r,c=600,m=200,d=8,u=b=>i.length===1?0:b/(i.length-1)*c,s=b=>d+(m-d*2)*(1-b/Math.max(1,a)),g=`${u(0)},${s(a)} ${u(i.length-1)},${s(0)}`,T=p.map(b=>`${u(i.indexOf(b.day))},${s(b.value)}`).join(" "),S=p[p.length-1];return or(er,{children:[or(er,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[or("span",{children:["\uB0A8\uC740 ",l?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",a]}),S?or("span",{children:["\uD604\uC7AC"," ",At(er,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:S.value}),l?"SP":"\uAC74"," \uB0A8\uC74C"]}):null]}),At(er,{sx:{border:"1px solid #e6e6e3",borderRadius:1,bgcolor:"#fafaf9",px:1,py:.5},children:or("svg",{viewBox:`0 0 ${c} ${m}`,preserveAspectRatio:"none",style:{display:"block",width:"100%",height:n},children:[At("line",{x1:0,y1:s(0),x2:c,y2:s(0),stroke:"#e6e6e3",strokeWidth:1}),At("polyline",{points:g,fill:"none",stroke:"#9a9a97",strokeWidth:1.5,strokeDasharray:"6 5",vectorEffect:"non-scaling-stroke"}),p.length>1?At("polyline",{points:T,fill:"none",stroke:"#2f80ed",strokeWidth:2.5,vectorEffect:"non-scaling-stroke"}):null,S?At("circle",{cx:u(i.indexOf(S.day)),cy:s(S.value),r:4,fill:"#2f80ed",vectorEffect:"non-scaling-stroke"}):null]})}),or(er,{sx:{mt:.5,display:"flex",justifyContent:"space-between",fontSize:13.5,color:"#000"},children:[At("span",{children:cs(e.start_date)}),t>e.start_date&&t<e.end_date?or("span",{children:["\uC624\uB298 ",cs(t)]}):null,At("span",{children:cs(e.end_date)})]})]})}import{useMemo as lB}from"react";import{Box as kt}from"@mui/material";function un(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function ka(e,o=new Date){let t=new Date(o);return t.setMonth(t.getMonth()-e),t}function l7(e=new Date){return{fromDate:un(ka(1,e)),toDate:un(e)}}var us=864e5,ai=[0,1,2,3,5,8,13,21];function $u(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function ms(e){let o=String(e??"").trim(),t=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(o);if(!t)return null;let n=new Date(`${t[1]}T${t[2]??"00:00"}:00`).getTime();return Number.isNaN(n)?null:n}function Mr(e){let o=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(o)?o.slice(0,10):""}function rB(e){let o=Mr(e.created_time)||Mr(e.start_date)||Mr(e.completed_time);if(!o)return null;let t=Mr(e.start_date),n=t&&t>o?t:o,r=e.completed?Mr(e.completed_time)||o:"";return{created:o,started:n,done:r}}function Vu(e,o){let t=/^\d{4}-\d{2}-\d{2}$/.test(o)?new Date(`${o}T00:00:00`):new Date,n=Math.max(2,Math.min(366,Math.round(e))),r=[];for(let i=n-1;i>=0;i-=1)r.push(un(new Date(t.getTime()-i*us)));return r}function Ku(e,o,t){let n=Vu(o,t),r=e.filter($u).map(rB).filter(p=>p!==null),i=n.map(p=>{let c=0,m=0,d=0;for(let u of r)u.created>p||(u.done&&u.done<=p?c+=1:u.started<=p?m+=1:d+=1);return{day:p,done:c,inProgress:m,waiting:d}}),a=i[i.length-1],l=i.reduce((p,c)=>Math.max(p,c.done+c.inProgress+c.waiting),0);return{points:i,max:l,currentWip:a?.inProgress??0,currentTotal:a?a.done+a.inProgress+a.waiting:0,currentDone:a?.done??0}}function iB(e,o){if(e.length===0)return 0;let t=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*o)-1));return e[t]}function Hu(e){if(e.length===0)return null;let o=[...e].sort((i,a)=>i-a),t=i=>Math.round(i*10)/10,n=Math.floor(o.length/2),r=o.length%2===1?o[n]:(o[n-1]+o[n])/2;return{count:o.length,median:t(r),average:t(o.reduce((i,a)=>i+a,0)/o.length),p85:t(iB(o,.85))}}function Wu(e){for(let o=ai.length-1;o>=0;o-=1)if(e>=ai[o])return o;return 0}function aB(){return ai.map((e,o)=>o===ai.length-1?`${e}\uC77C+`:`${e}~${ai[o+1]}\uC77C`)}function Uu(e,o,t){let n=Vu(o,t),r=n[0],i=n[n.length-1],a=aB(),l=a.map(()=>0),p=a.map(()=>0),c=[],m=[];for(let d of e){if(!$u(d)||!d.completed)continue;let u=Mr(d.completed_time);if(!u||u<r||u>i)continue;let s=ms(d.completed_time),g=ms(d.created_time);if(s===null||g===null)continue;let T=Math.max(0,(s-g)/us);c.push(T),l[Wu(T)]+=1;let S=ms(d.start_date);if(S===null||S>s)continue;let b=Math.max(0,(s-Math.max(S,g))/us);m.push(b),p[Wu(b)]+=1}return{labels:a,leadCounts:l,cycleCounts:p,lead:Hu(c),cycle:Hu(m)}}import{jsx as Ko,jsxs as dn}from"react/jsx-runtime";function Gu(e){return e.slice(5).replace("-",".")}function ds({color:e,text:o}){return dn(kt,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Ko(kt,{sx:{width:10,height:10,borderRadius:.5,bgcolor:e,flexShrink:0}}),Ko(kt,{component:"span",sx:{fontSize:13.5,color:"#000"},children:o})]})}function ju({tasks:e,todayStr:o,days:t=30,height:n=200}){let r=lB(()=>Ku(e,t,o),[e,t,o]),{points:i,max:a,currentWip:l,currentTotal:p,currentDone:c}=r;if(i.length===0||a===0)return Ko(kt,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let m=600,d=200,u=8,s=S=>i.length===1?0:S/(i.length-1)*m,g=S=>u+(d-u*2)*(1-S/a),T=S=>`${i.map((f,D)=>`${D===0?"M":"L"}${s(D)},${g(S(f))}`).join(" ")} L${s(i.length-1)},${g(0)} L${s(0)},${g(0)} Z`;return dn(kt,{children:[dn(kt,{sx:{mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[dn("span",{children:["\uCD5C\uADFC ",i.length,"\uC77C \u2014 \uC811\uC218 ",p,"\uAC74 / \uC644\uB8CC ",c,"\uAC74"]}),dn("span",{children:["\uC9C4\uD589 \uC911"," ",Ko(kt,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:l}),"\uAC74"]})]}),Ko(kt,{sx:{border:"1px solid #e6e6e3",borderRadius:1,bgcolor:"#fafaf9",px:1,py:.5},children:dn("svg",{viewBox:`0 0 ${m} ${d}`,preserveAspectRatio:"none",style:{display:"block",width:"100%",height:n},children:[Ko("path",{d:T(S=>S.done+S.inProgress+S.waiting),fill:"#e6e6e3"}),Ko("path",{d:T(S=>S.done+S.inProgress),fill:"#a9c9f5"}),Ko("path",{d:T(S=>S.done),fill:"#2f80ed"}),Ko("line",{x1:0,y1:g(0),x2:m,y2:g(0),stroke:"#e6e6e3",strokeWidth:1,vectorEffect:"non-scaling-stroke"})]})}),dn(kt,{sx:{mt:.5,display:"flex",justifyContent:"space-between",fontSize:13.5,color:"#000"},children:[Ko("span",{children:Gu(i[0].day)}),dn("span",{children:["\uC624\uB298 ",Gu(i[i.length-1].day)]})]}),dn(kt,{sx:{mt:1,display:"flex",alignItems:"center",flexWrap:"wrap",gap:2},children:[Ko(ds,{color:"#2f80ed",text:"\uC644\uB8CC"}),Ko(ds,{color:"#a9c9f5",text:"\uC9C4\uD589"}),Ko(ds,{color:"#e6e6e3",text:"\uB300\uAE30"}),Ko(kt,{component:"span",sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]})}import{useMemo as sB}from"react";import{Box as Mo}from"@mui/material";import{jsx as it,jsxs as Lt}from"react/jsx-runtime";function Yu({label:e,color:o,summary:t}){return t?Lt(Mo,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1.5,fontSize:14,color:"#000"},children:[Lt(Mo,{sx:{display:"flex",alignItems:"center",gap:.75},children:[it(Mo,{sx:{width:10,height:10,borderRadius:.5,bgcolor:o,flexShrink:0}}),it(Mo,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]}),Lt("span",{children:[t.count,"\uAC74"]}),Lt("span",{children:["\uC911\uC559\uAC12"," ",it(Mo,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:t.median}),"\uC77C"]}),Lt("span",{children:["\uD3C9\uADE0 ",t.average,"\uC77C"]}),Lt("span",{children:["85% ",t.p85,"\uC77C \uC774\uB0B4"]})]}):Lt(Mo,{sx:{fontSize:14,color:"#000"},children:[e," \u2014 \uD45C\uBCF8 \uC5C6\uC74C"]})}function Xu({tasks:e,todayStr:o,days:t=30,height:n=160}){let r=sB(()=>Uu(e,t,o),[e,t,o]),{labels:i,leadCounts:a,cycleCounts:l,lead:p,cycle:c}=r;if(!p)return it(Mo,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let m=Math.max(1,...a,...l),d=n-24;return Lt(Mo,{children:[Lt(Mo,{sx:{mb:1.5,display:"flex",flexDirection:"column",gap:.5},children:[it(Yu,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:"#2f80ed",summary:p}),it(Yu,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:"#a9c9f5",summary:c})]}),it(Mo,{sx:{display:"flex",alignItems:"flex-end",gap:1.5,height:n,px:.5},children:i.map((u,s)=>it(Mo,{sx:{flex:1,minWidth:0,height:"100%",display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.5},children:[{count:a[s],color:"#2f80ed"},{count:l[s],color:"#a9c9f5"}].map((g,T)=>Lt(Mo,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:[it(Mo,{sx:{fontSize:13.5,fontWeight:700,color:"#37352f",lineHeight:1.5},children:g.count>0?g.count:""}),it(Mo,{sx:{width:"100%",height:Math.max(g.count>0?3:0,Math.round(d*g.count/m)),borderRadius:"3px 3px 0 0",bgcolor:g.color}})]},T))},u))}),it(Mo,{sx:{display:"flex",gap:1.5,px:.5,mt:.5},children:i.map(u=>it(Mo,{sx:{flex:1,minWidth:0,textAlign:"center",fontSize:13.5,color:"#000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u},u))})]})}import{jsx as Nt,jsxs as ps}from"react/jsx-runtime";var pB=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function M7({open:e,sprints:o,tasks:t,todayStr:n,initialSprintSeq:r=0,onClose:i}){let[a,l]=Qu(0),[p,c]=Qu(30);cB(()=>{if(!e)return;let u=o.find(g=>g.status==="active")??o[0],s=o.find(g=>g.seq===r)??u;l(s?.seq??0)},[e]);let m=mB(()=>o.find(u=>u.seq===a)??null,[o,a]),d=Nt(Zu,{label:"\uAE30\uAC04",showLabel:!1,value:String(p),options:pB,onChange:u=>c(Number(u.target.value)||30),sx:{width:280,mb:2}});return Nt(dB,{open:e,onClose:i,width:680,title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Nt(li,{sx:{px:3,py:2.5},children:Nt(Lu,{sprints:o,tasks:t})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:ps(li,{sx:{px:3,py:2.5},children:[Nt(Zu,{label:"\uBAA9\uD45C",showLabel:!1,value:a?String(a):"",options:o.map(u=>({value:String(u.seq),label:tt(u)})),onChange:u=>l(Number(u.target.value)||0),sx:{width:280,mb:2}}),m?Nt(Fu,{sprint:m,tasks:t,todayStr:n}):Nt(li,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694."})]})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:ps(li,{sx:{px:3,py:2.5},children:[d,Nt(ju,{tasks:t,todayStr:n,days:p})]})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:ps(li,{sx:{px:3,py:2.5},children:[d,Nt(Xu,{tasks:t,todayStr:n,days:p})]})}],actions:{showCancelButton:!1,right:Nt(uB,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Checkbox as fB,Divider as xB,Menu as gB,MenuItem as fs}from"@mui/material";import{jsx as si,jsxs as Ju}from"react/jsx-runtime";function z7({anchorEl:e,candidates:o,selectedNames:t,avatarSrcByName:n,onToggle:r,onClear:i,onClose:a}){return Ju(gB,{anchorEl:e,open:!!e,onClose:a,transitionDuration:0,children:[o.length===0?si(fs,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):o.map(l=>{let p=t.includes(l.name);return Ju(fs,{onClick:()=>r(l),sx:{fontSize:14,minWidth:170,gap:1},children:[si(fB,{size:"small",checked:p,sx:{p:0}}),si(Ao,{names:[l.name],size:20,avatarSrcByName:n}),l.name]},`${l.accountSeq}-${l.name}`)}),si(xB,{}),si(fs,{disabled:t.length===0,onClick:i,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as hB}from"react";import{ButtonBase as bB,Menu as kB,MenuItem as TB}from"@mui/material";import yB from"@mui/icons-material/KeyboardArrowDown";import SB from"@mui/icons-material/Check";import{Fragment as BB,jsx as xs,jsxs as gs}from"react/jsx-runtime";function $7({value:e,onChange:o,options:t}){let[n,r]=hB(null),i=t??Fa,a=Fa.find(l=>l.value===e)?.label??"";return gs(BB,{children:[gs(bB,{onClick:l=>r(l.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[a,xs(yB,{sx:{fontSize:17,color:"#9a9a97"}})]}),xs(kB,{transitionDuration:0,anchorEl:n,open:!!n,onClose:()=>r(null),children:i.map(l=>gs(TB,{selected:l.value===e,onClick:()=>{o(l.value),r(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[l.label,l.value===e?xs(SB,{sx:{fontSize:16,color:"#2f80ed"}}):null]},l.value))})]})}import{Box as hs,ButtonBase as CB,Divider as vB,Popover as IB}from"@mui/material";import _B from"@mui/icons-material/Check";import wB from"@ehfuse/overlay-scrollbar";import{jsx as tr,jsxs as od}from"react/jsx-runtime";var ed=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function Q7({anchorEl:e,value:o,color:t="",onSelect:n,onSelectColor:r,onClose:i}){return tr(IB,{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:od(hs,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[tr(wB,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:tr(Di,{value:o||Wt,onChange:a=>{n(a),i()}})}),r?od(hs,{sx:{px:1.25,pb:1.25},children:[tr(vB,{sx:{mb:1,borderColor:"#efefed"}}),tr(hs,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:ed.map(a=>{let l=(t||ed[0])===a;return tr(CB,{"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?tr(_B,{sx:{fontSize:15,color:"#ffffff"}}):null},a)})})]}):null]})})}import{Box as Ta,ButtonBase as DB}from"@mui/material";import{DateTextField as td}from"@ehfuse/mui-form-controls";import{jsx as ci,jsxs as nd}from"react/jsx-runtime";var MB=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function rd({fromDate:e,toDate:o,onChange:t}){let n=i=>{if(i<=0){t("","");return}t(un(ka(i)),un(new Date))},r=i=>i<=0?!e&&!o:!e||!o?!1:e===un(ka(i))&&o===un(new Date);return nd(Ta,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[ci(Ta,{sx:{display:"flex",alignItems:"center",gap:1.5},children:MB.map(i=>{let a=r(i.months);return ci(DB,{onClick:()=>n(i.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:a?500:400,border:"1px solid",borderColor:a?"#2f80ed":"#dedddb",color:a?"#2f80ed":"#37352f",bgcolor:a?"#eef6ff":"transparent","&:hover":{bgcolor:a?"#eef6ff":"#f7f7f5"}},children:i.label},i.label)})}),nd(Ta,{sx:{display:"flex",alignItems:"center",gap:.5},children:[ci(td,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:i=>t(i.target.value,o),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),ci(Ta,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),ci(td,{value:o,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:i=>t(e,i.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as EB}from"@mui/material";import{jsx as id}from"react/jsx-runtime";function lN({anchorEl:e,fromDate:o,toDate:t,onChange:n,onClose:r}){return id(EB,{transitionDuration:0,anchorEl:e,open:!!e,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:id(rd,{fromDate:o,toDate:t,onChange:n})})}import{Box as OB,ButtonBase as RB,Tab as PB,Tabs as zB}from"@mui/material";import qB from"@mui/icons-material/Checklist";import AB from"@mui/icons-material/Face";import LB from"@mui/icons-material/Publish";import NB from"@mui/icons-material/NotificationsOutlined";import FB from"@mui/icons-material/BugReportOutlined";import HB from"@mui/icons-material/DescriptionOutlined";import WB from"@mui/icons-material/Inventory2Outlined";import{jsx as Tt}from"react/jsx-runtime";function ad(e,o){return o>0?`${e} (${o})`:e}var TN=[{id:"my",label:"\uC804\uCCB4",icon:Tt(qB,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Tt(NB,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Tt(AB,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Tt(LB,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Tt(FB,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Tt(WB,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Tt(HB,{sx:{fontSize:18}}),hideCount:!0}];function $B(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function yN({items:e,activeTab:o,counts:t,onChange:n,compact:r=!1}){let i=se(),a=$B(i.tabs),l=e;return r?Tt(OB,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:l.map(p=>{let c=o===p.id;return Tt(RB,{onClick:()=>n(p.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:yo(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:c?i.tabs.selectedBg:i.tabs.bg,color:c?i.tabs.selectedColor:i.tabs.color,borderColor:c?i.tabs.selectedBg:i.tabs.borderColor},children:ad(p.label,p.hideCount?0:t[p.id]??0)},p.id)})}):Tt(zB,{value:o,onChange:(p,c)=>n(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:l.map(p=>Tt(PB,{value:p.id,label:ad(p.label,p.hideCount?0:t[p.id]??0),icon:p.icon,iconPosition:"start",sx:a},p.id))})}import{useEffect as VB,useMemo as KB,useState as bs}from"react";import{Divider as ks,ListItemIcon as Qo,Menu as Ts,MenuItem as Eo}from"@mui/material";import UB from"@mui/icons-material/OpenInNewOutlined";import GB from"@mui/icons-material/Check";import jB from"@mui/icons-material/CheckCircleOutlined";import YB from"@mui/icons-material/RadioButtonUnchecked";import XB from"@mui/icons-material/SendOutlined";import QB from"@mui/icons-material/EventOutlined";import ZB from"@mui/icons-material/PersonOutlineOutlined";import JB from"@mui/icons-material/ViewKanbanOutlined";import eC from"@mui/icons-material/ContentCopyOutlined";import oC from"@mui/icons-material/NextPlanOutlined";import tC from"@mui/icons-material/ContentPasteOutlined";import nC from"@mui/icons-material/ShareOutlined";import rC from"@mui/icons-material/DirectionsRunOutlined";import ld from"@mui/icons-material/ChevronRight";import iC from"@mui/icons-material/ArchiveOutlined";import aC from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as lC}from"@ehfuse/alerts";import{Fragment as sC,jsx as xe,jsxs as So}from"react/jsx-runtime";function QN({target:e,onClose:o,customTabs:t,sprints:n=[],myAccountSeq:r=0,onOpenDetail:i,onToggleCompleted:a,onRequestConfirm:l,onChangeDueDate:p,onChangeReminder:c,onMemberEdit:m,onMoveProject:d,onDuplicate:u,onCreateFollowUp:s,onShare:g,onAssignSprint:T,onArchiveToggle:S,onDelete:b}){let f=Re(),D=St(),[B,R]=bs(null),[y,I]=bs(null),[P,_]=bs(null);VB(()=>{e||(R(null),I(null),_(null))},[e]);let v=e?.task??null,$=!!v?.is_notice,h=!!v?.is_event,x=v?!Vt(v,r):!1,C=KB(()=>new Set(t.filter(k=>k.useSprints).map(k=>k.key)),[t]),L=async(k="one")=>{let w=v;if(o(),!w)return;await lC({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:k==="series"?`"${w.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${w.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&b(w.seq,k)},N=()=>{v&&S(v.seq,!v.archived),o()};return So(sC,{children:[So(Ts,{open:!!e,onClose:o,transitionDuration:0,anchorReference:f?"none":"anchorPosition",anchorPosition:!f&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...f?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:f?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[So(Eo,{onClick:()=>{v&&i(v),o()},sx:{fontSize:14},children:[xe(Qo,{children:xe(UB,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),So(Eo,{disabled:$?(v?.author_account_seq??0)!==r:(v?.author_account_seq??0)!==r&&(v?.manager_account_seq??0)!==r,onClick:()=>{v&&a(v.seq,!v.completed),o()},sx:{fontSize:14},children:[xe(Qo,{children:v?.completed?xe(YB,{sx:{fontSize:19}}):xe(jB,{sx:{fontSize:19}})}),v?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!$&&l?So(Eo,{disabled:!(v?.manager_account_seq??0)&&(v?.receiver_account_seqs??[]).length===0,onClick:()=>{v&&l(v),o()},sx:{fontSize:14},children:[xe(Qo,{children:xe(XB,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,h?null:xe(ks,{}),h?null:So(Eo,{disabled:x,onClick:k=>{v&&R({anchorEl:k.currentTarget,task:v})},sx:{fontSize:14},children:[xe(Qo,{children:xe(QB,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!$&&!h&&m?So(Eo,{onClick:()=>{v&&m(v,"manager"),o()},sx:{fontSize:14},children:[xe(Qo,{children:xe(ZB,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,h?null:So(Eo,{disabled:x,onClick:k=>{v&&I({anchorEl:k.currentTarget,task:v})},sx:{fontSize:14},children:[xe(Qo,{children:xe(JB,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",xe(ld,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),xe(ks,{}),u?So(Eo,{disabled:x,onClick:()=>{v&&u(v.seq),o()},sx:{fontSize:14},children:[xe(Qo,{children:xe(eC,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,s&&v&&!v.is_event&&!v.is_notice?So(Eo,{onClick:()=>{v&&s(v.seq),o()},sx:{fontSize:14},children:[xe(Qo,{children:xe(oC,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,So(Eo,{onClick:()=>{v&&(g?g(v):vr(v,f)),o()},sx:{fontSize:14},children:[xe(Qo,{children:f?xe(nC,{sx:{fontSize:19}}):xe(tC,{sx:{fontSize:19}})}),f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),v&&!v.is_notice&&!v.is_event&&C.has(String(v.tab_key??""))&&T?So(Eo,{onClick:k=>_(k.currentTarget),sx:{fontSize:14},children:[xe(Qo,{children:xe(rC,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",xe(ld,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,So(Eo,{onClick:N,disabled:x||!v?.archived&&!(v&&xi(v)),sx:{fontSize:14},children:[xe(Qo,{children:v?.archived?xe(aC,{sx:{fontSize:19}}):xe(iC,{sx:{fontSize:19}})}),v?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),xe(ks,{}),So(Eo,{disabled:x,onClick:()=>{L("one")},sx:{fontSize:14,color:"#e5484d"},children:[xe(Qo,{children:xe(It,{sx:{fontSize:19,color:"#e5484d"}})}),(v?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(v?.repeat_group_key??0)>0?So(Eo,{disabled:x,onClick:()=>{L("series")},sx:{fontSize:14,color:"#e5484d"},children:[xe(Qo,{children:xe(It,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]}),xe(ot,{anchorEl:B?.anchorEl??null,open:!!B,date:B?.task.due_date??"",reminder:B?.task.reminder??"none",hideReminder:!!B?.task.completed,centered:f,onClose:()=>{R(null),o()},onDateChange:k=>{B&&p(B.task.seq,k)},onReminderChange:k=>{B&&c?.(B.task.seq,k)}}),So(Ts,{transitionDuration:0,anchorEl:y?.anchorEl??null,open:!!y,onClose:()=>{I(null),o()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...D,children:[xe(Eo,{selected:!y?.task.tab_key,onClick:()=>{y&&d(y.task.seq,""),I(null),o()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),t.filter(k=>!k.archived).map(k=>xe(Eo,{selected:y?.task.tab_key===k.key,onClick:()=>{y&&d(y.task.seq,k.key),I(null),o()},sx:{fontSize:14,minWidth:170},children:k.label},k.key))]}),xe(Ts,{transitionDuration:0,anchorEl:P,open:!!P,onClose:()=>_(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...n.filter(k=>`custom-${k.group_seq}`===String(v?.tab_key??"")).map(k=>({seq:k.seq,label:tt(k)}))].map(k=>So(Eo,{onClick:()=>{v&&T?.(v.seq,k.seq),_(null),o()},sx:{fontSize:14,minWidth:160,gap:1},children:[k.label,(v?.sprint_seq??0)===k.seq?xe(GB,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},k.seq))})]})}import{Checkbox as cC,Divider as mC,Menu as uC,MenuItem as sd}from"@mui/material";import{jsx as ya,jsxs as cd}from"react/jsx-runtime";function t4({anchorEl:e,labelOptions:o,selectedKeys:t,onToggle:n,onClear:r,onClose:i}){return cd(uC,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,children:[o.map(a=>{let l=t.includes(a.key);return cd(sd,{onClick:()=>n(a.key),sx:{fontSize:14,minWidth:190,gap:1},children:[ya(cC,{size:"small",checked:l,sx:{p:0}}),ya(Ae,{option:a})]},a.key)}),ya(mC,{}),ya(sd,{disabled:t.length===0,onClick:()=>{r(),i()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as dC,Menu as pC,MenuItem as md}from"@mui/material";import fC from"@mui/icons-material/Check";import xC from"@mui/icons-material/SettingsOutlined";import{jsx as ys,jsxs as Ss}from"react/jsx-runtime";function c4(e){let{anchorEl:o,sprints:t,value:n,onSelect:r,onManage:i,onClose:a}=e;return Ss(pC,{transitionDuration:0,anchorEl:o,open:!!o,onClose:a,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...t.map(l=>({seq:l.seq,label:tt(l)}))].map(l=>Ss(md,{onClick:()=>{r(l.seq),a()},sx:{fontSize:14,minWidth:180,gap:1},children:[l.label,n===l.seq?ys(fC,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},l.seq)),ys(dC,{}),Ss(md,{onClick:()=>{a(),i()},sx:{fontSize:14,gap:1},children:[ys(xC,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var gC={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function hC(e){return gC[e]??"tasks"}var d4={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},ud=["list","calendar","month","card","kanban","sprint","timeline"],bC=["list","card"];function p4(e){let o=hC(e);switch(o){case"notice":return{kind:o,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:o,viewOptions:ud,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:o,viewOptions:bC,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:o,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:o,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:o,viewOptions:ud,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}export{O_ as ALL_TASK_VIEWER_ACCOUNT_SEQS,Lm as AddLabelDialog,Mi as AddTabDialog,Pm as AttachmentUploadGauge,Ll as AttachmentUploadPercent,Ra as BUG_DEVICE_OPTIONS,qr as BUG_ICON_COLOR,$I as BUG_KANBAN_COLUMNS,Oa as BUG_REPRO_OPTIONS,Pa as BUG_RESOLUTION_OPTIONS,zn as BUG_STATUS_OPTIONS,zr as BUG_TASK_ICON,ea as BugPropertiesGrid,Ex as COLUMN_WIDTHS,qa as COMPLETED_STATUS_OPTION,ns as CUSTOM_TAB_KEY_PREFIX,PL as CalendarImportDialog,WL as CalendarSubscribeDialog,kn as CommentBubbleIcon,mr as ConfirmCountButton,ju as CumulativeFlowChart,xc as DATE_REMINDER_OPTIONS,Uk as DEFAULT_COMPACT_COLUMNS,Ia as DEFAULT_PROJECT_ICON,TN as DEFAULT_TASKBOX_TAB_ITEMS,Wt as DEFAULT_TASK_ICON,El as DRAWER_SECTION_TITLE_FONT_SIZE,lN as DateRangeFilterPopover,rt as DrawerSection,ot as DueDatePickerPopover,mx as ENDED_EVENT_STATUS_OPTION,jm as EVENT_ICON_COLOR,fo as EVENT_TASK_ICON,QL as EmployeeSelectDialog,Fa as GROUP_BY_OPTIONS,fr as GoogleEventChip,$7 as GroupByMenuButton,Di as IconPickerGrid,Tm as InlineAddressInput,an as InlineTextValue,Aa as KANBAN_CLOSED_COLUMN_KEY,t4 as LabelFilterMenu,ca as LabelSelectMenu,Xu as LeadTimeDistributionChart,Lr as MANUAL_TASK_STATUS_OPTIONS,z7 as MemberFilterMenu,Ar as NOTICE_STATUS_OPTIONS,no as NOTICE_TASK_ICON,Rs as NO_TASK_ICON,_a as PROJECT_ICON_OPTIONS,pe as PropertyRow,cr as RECEIVER_AVATAR_COLORS,gc as REMINDER_OPTIONS,Ao as ReceiverAvatarStack,pu as RelatedTasksSection,kC as STATUS_KEY_REPLIED,Bs as STATUS_KEY_WAITING,Bc as SortableTaskCard,Fu as SprintBurndownChart,M7 as SprintChartsDialog,c4 as SprintFilterMenu,CL as SprintManageDialog,Lu as SprintVelocityChart,lr as StatusSelectMenu,$a as TASKBOX_COLUMNS,dt as TASKBOX_DRAWER_NARROW_MQ,Ps as TASKBOX_UI_STATE_ID,d4 as TASKBOX_VIEW_LABELS,MO as TASKBOX_VIEW_MODES,Xr as TASK_REPEAT_RULE_OPTIONS,Pn as TASK_STATUS_OPTIONS,Mg as TIME_REMINDER_OPTIONS,Ri as TaskAckListPopover,Bt as TaskActionButton,ga as TaskActivityDialog,la as TaskAttachmentsSection,lm as TaskBoxColumnSummary,$R as TaskBoxCompactTable,sl as TaskBoxGroupBoard,hR as TaskBoxMobileList,Jc as TaskBoxMonthAgenda,jc as TaskBoxMonthCalendar,VO as TaskBoxSprintColumnSummary,Tc as TaskBoxTable,yN as TaskBoxTabs,im as TaskBoxTimeline,DO as TaskBoxView,$c as TaskBoxWeekCalendar,$r as TaskCardContent,na as TaskChecklistSection,nu as TaskCommentInput,tu as TaskCommentsSection,oa as TaskContentEditor,QN as TaskContextMenu,Ji as TaskCorePropertiesGrid,$l as TaskCreateBody,Sz as TaskCreateDrawer,rd as TaskDateRangeFilter,Tu as TaskDetailBody,uL as TaskDetailDrawer,su as TaskDetailHeader,Q7 as TaskIconPickerPopover,hn as TaskLabelChips,ta as TaskLinkDialog,cu as TaskNoteField,jo as TaskPriorityChip,Ae as TaskStatusChip,QI as TaskStatusChips,xd as TaskboxProvider,FS as buildCalendarFeedUrl,zi as buildCardBaseSx,Ku as buildCumulativeFlow,Uu as buildLeadCycleDistribution,Hs as buildStatusOptionColors,Ha as buildTaskGroupSections,jl as buildTaskRelationsModel,qy as buildTaskShareText,pi as buildTaskboxTheme,Xs as canAssignBugManager,yi as canClaimTaskItem,Qs as canCompleteTaskItem,Vt as canEditTaskItem,Ti as canViewTaskItem,Si as canVolunteerTaskItem,Yl as countTaskRelations,sm as countWorkdays,ax as createTaskboxTheme,am as daysLeftUntil,Yi as defaultRepeatUntil,wa as defaultTaskBoxFormValues,Da as defaultTaskboxUiStateValues,$m as filterFilesWithinLimit,ND as formatConfirmTime,AO as formatHours,et as formatKoreanDate,Yo as formatKoreanDateTime,tt as formatSprintOptionLabel,Ns as getBugDeviceName,Ls as getBugReproName,fi as getBugResolutionName,ux as getBugStatusOption,l7 as getDefaultDateRange,Nr as getEventDisplayStatusOption,KI as getNoDueStatusRank,Wm as getNoticeAckInfo,Fs as getNoticeStatusOption,w2 as getNoticeTargetDisplay,xI as getProjectIconAnchorComponent,Ce as getProjectIconComponent,Za as getReminderLabel,Qa as getReminderOptions,ji as getRepeatRuleLabel,hi as getStatusOptionsForTask,p4 as getTabHeaderConfig,Ka as getTaskBoxColumnDefs,Ks as getTaskBoxGridTemplate,hC as getTaskBoxTabKind,Pi as getTaskConfirmInfo,vo as getTaskDisplayStatusOption,gi as getTaskStatusOption,ur as groupGoogleEventsByDate,rs as groupSeqFromTabKey,Oq as hasRelation,uu as hasTaskRelations,UT as htmlToPlainText,CS as isCustomTabKey,$u as isFlowTask,Ys as isOpenPoolTaskItem,za as isPastEvent,xi as isTaskDone,VI as isWaitingTask,ka as monthsAgoDate,Ot as narrowOrderSx,mL as nowDateTimeString,bk as parseEstimatedHours,ms as parseTaskTimeMs,Yn as relationsOf,ar as resolveTaskStatusOptions,Ea as resolveTaskboxTheme,WR as selectDepartmentSharedTasks,vr as shareTaskText,LO as sumRemainingHours,ma as summarizeNoticeTargets,fL as tabKeyFromGroupSeq,st as taskVisibilityOf,un as toYmd,bi as toggleLabelKey,Rr as useBuildFileUrl,Rm as useTaskAttachmentUploadMeta,Go as useTaskboxConfig,ox as useTaskboxForm,se as useTaskboxTheme,$t as useTaskboxUiState,Pr as useUploadMaxMb,io as wideColumnSx};
40
+ `).trim():"";function Ow(e){let p=[`[\uC5C5\uBB34] ${e.title}`],b=jr(e.start_date),c=jr(e.due_date);(b||c)&&p.push(`\uAE30\uAC04: ${b&&c?`${b} ~ ${c}`:b||c}`),e.manager_name&&p.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let i=rr(e).name;i&&p.push(`\uC0C1\uD0DC: ${i}`);let a=Ad(e.content);a&&p.push("",a);let r=String(e.note??"").trim();return r&&p.push("",`\uBE44\uACE0: ${r}`),p.join(`
41
+ `)}function Od(e){navigator.clipboard.writeText(e).then(()=>Aw("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Rw("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function ui(e,p){let b=Ow(e);if(p&&typeof navigator.share=="function"){navigator.share({text:b}).catch(c=>{c?.name!=="AbortError"&&Od(b)});return}Od(b)}import{Fragment as zw,jsx as Dt,jsxs as Dd}from"react/jsx-runtime";function Pd({task:e,myAccountSeq:p=0,onToggleCompleted:b,onChangeTitle:c,onChangeIcon:i,onChangeIconColor:a,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:l,onLoadActivity:o,onPrint:s}){let f=Bt(),[d,u]=sc(!1),[g,m]=sc(null),[v,k]=sc(null),B=e.is_notice?bt(e.icon||Kt):null,O=!!e.is_notice,L=!!e.is_event,R=O&&p>0&&(e.author_account_seq??0)===p,P=!Bn(e,p),j=!L&&(O?R:(e.author_account_seq??0)===p||(e.manager_account_seq??0)===p);return Dd(zw,{children:[Dd(fi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Dt(Ui,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Dt(Pw,{})}):null,j&&!t?Dt(Ba,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${Mr(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Dt(fi,{sx:{display:"flex",flexShrink:0,mr:1.5},children:Dt(an,{onClick:z=>k({anchorEl:z.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!B?null:Dt(fi,{sx:{display:"flex",px:.5,color:e.icon_color||(O?"#e5484d":"#1e3a8a")},children:Dt(B,{sx:{fontSize:20}})}),g!==null?Dt(fi,{component:"input",autoFocus:!0,spellCheck:!1,value:g,onChange:z=>m(z.target.value),onBlur:()=>{g.trim()&&g.trim()!==e.title&&c(e.seq,g.trim()),m(null)},onKeyDown:z=>{z.key==="Enter"&&z.target.blur(),z.key==="Escape"&&m(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Dt(fi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O?"\uACF5\uC9C0":L?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Dt(fi,{onClick:P?void 0:()=>m(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:P?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),o?Dt(Ba,{title:"\uD65C\uB3D9",arrow:!0,children:Dt(Ui,{"aria-label":"\uD65C\uB3D9",onClick:()=>u(!0),sx:{color:"#6b7280"},children:Dt(Lw,{sx:{fontSize:20}})})}):null,Dt(Ba,{title:f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Dt(Ui,{"aria-label":f?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>ui(e,f),sx:{color:"#6b7280"},children:f?Dt(Nw,{sx:{fontSize:20}}):Dt(jw,{sx:{fontSize:20}})})}),s?Dt(Ba,{title:"\uC778\uC1C4",arrow:!0,children:Dt(Ui,{"aria-label":"\uC778\uC1C4",onClick:()=>s(e),sx:{color:"#6b7280"},children:Dt(Fw,{sx:{fontSize:20}})})}):null,r&&!t?Dt(Ui,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Dt(Dw,{})}):null]}),Dt(It,{open:!!v,anchorEl:v?.anchorEl??null,title:v?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:v?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>k(null),onConfirm:()=>{v&&b(e.seq,v.nextCompleted),k(null)}}),Dt(Ca,{open:d,taskSeq:e.seq,items:n,loading:l,onLoad:o,onClose:()=>u(!1)})]})}import{useState as Qr}from"react";import{Box as Wt,Button as di,ButtonBase as Xw,Checkbox as Zw,Divider as Do,Menu as dc,MenuItem as hc}from"@mui/material";import Jw from"@mui/icons-material/ExpandLess";import Qw from"@mui/icons-material/ExpandMore";import e3 from"@mui/icons-material/ConfirmationNumberOutlined";import qd from"@mui/icons-material/Check";import t3 from"@mui/icons-material/DirectionsRunOutlined";import r3 from"@mui/icons-material/SpeedOutlined";import pc from"@mui/icons-material/CheckCircle";import n3 from"@mui/icons-material/CheckCircleOutlineOutlined";import mc from"@mui/icons-material/CheckCircleOutlined";import $d from"@mui/icons-material/AccessTimeOutlined";import o3 from"@mui/icons-material/AutorenewOutlined";import i3 from"@mui/icons-material/LabelOutlined";import s3 from"@mui/icons-material/PersonOutlineOutlined";import a3 from"@mui/icons-material/SubjectOutlined";import l3 from"@mui/icons-material/StickyNote2Outlined";import c3 from"@mui/icons-material/PanToolAltOutlined";import Hd from"@mui/icons-material/LockOutlined";import Wd from"@mui/icons-material/PublicOutlined";import Ud from"@mui/icons-material/Group";import u3 from"@mui/icons-material/Repeat";import f3 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as Vd,InfoAlert as d3}from"@ehfuse/alerts";import{DatePicker as h3}from"@ehfuse/mui-datetime-picker";import{useState as qw}from"react";import{TextField as $w}from"@ehfuse/mui-form-controls";import{jsx as Hw}from"react/jsx-runtime";function Nd({value:e,onCommit:p,onDraftChange:b,readOnly:c=!1}){let[i,a]=qw(null);return Hw($w,{value:i??e,placeholder:c?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:c}},onChange:r=>{a(r.target.value),b?.(r.target.value)},onBlur:()=>{i!==null&&i.trim()!==e&&p(i),a(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&a(null)},sx:{mt:1}})}import{useMemo as cc,useState as uc}from"react";import{Box as hr,Button as Fd,IconButton as Ww}from"@mui/material";import Uw from"@mui/icons-material/AccountTreeOutlined";import Vw from"@mui/icons-material/Add";import Kw from"@mui/icons-material/Close";import Gw from"@mui/icons-material/NextPlanOutlined";function Oo(e){return e.relations??[]}function NO(e,p,b){return Oo(e).some(c=>c.type===b&&c.task_seq===p.seq)||Oo(p).some(c=>c.type===b&&c.task_seq===e.seq)}function jd(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function ac(e,p){let b=new Map(p.map(d=>[d.seq,d]));b.set(e.seq,e);let c=new Map,i=(d,u)=>{c.has(d)||c.set(d,new Set),c.has(u)||c.set(u,new Set),c.get(d).add(u),c.get(u).add(d)};for(let d of b.values())for(let u of Oo(d))u.type==="follow_up"&&b.has(u.task_seq)&&i(d.seq,u.task_seq);let a=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let d=r.shift();for(let u of c.get(d)??[])a.has(u)||(a.add(u),r.push(u))}let t=[...a].map(d=>b.get(d)).filter(d=>!!d).sort((d,u)=>jd(d).localeCompare(jd(u))),n=new Set;for(let d of Oo(e))d.type==="related"&&n.add(d.task_seq);for(let d of b.values())d.seq!==e.seq&&Oo(d).some(u=>u.type==="related"&&u.task_seq===e.seq)&&n.add(d.seq);let l=[...n].map(d=>b.get(d)).filter(d=>d!==void 0&&d.seq!==e.seq),o=[...b.values()].filter(d=>d.seq!==e.seq&&Oo(d).some(u=>u.type==="duplicate_of"&&u.task_seq===e.seq)),s=Oo(e).find(d=>d.type==="duplicate_of")?.task_seq,f=s?b.get(s)??null:null;return{lineage:t,related:l,duplicates:o,duplicateOf:f}}function lc(e,p){let b=ac(e,p);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)}function Ld(e,p){return lc(e,p)>0}import{Fragment as Yw,jsx as Lt,jsxs as Jr}from"react/jsx-runtime";function fc({item:e,caption:p,onOpen:b,onUnlink:c}){let i=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Kt:tr)):null;return Jr(hr,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[p?Lt(hr,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:p}):null,i?Lt(i,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Jr(hr,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Lt(Et,{option:rr(e),small:!0}),c?Lt(Ww,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:c,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Lt(Kw,{sx:{fontSize:15}})}):null]})}function zd({task:e,tasks:p,readOnly:b=!1,onOpenTask:c,onLink:i,onUnlink:a,onCreateFollowUp:r}){let[t,n]=uc(!1),[l,o]=uc(null),[s,f]=uc(null),d=cc(()=>ac(e,p),[e,p]),u=d.lineage.length>=2,g=cc(()=>lc(e,p),[e,p]),m=cc(()=>{let k=new Set;for(let B of d.lineage)k.add(B.seq);for(let B of d.related)k.add(B.seq);for(let B of d.duplicates)k.add(B.seq);return d.duplicateOf&&k.add(d.duplicateOf.seq),[...k]},[d]),v=(k,B,O)=>{f({anchorEl:k,targetSeq:B,type:O})};return Jr(qr,{icon:Lt(Uw,{sx:{fontSize:19,display:"block"}}),title:Jr(Yw,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?Lt(hr,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:Jr(hr,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?Lt(Fd,{size:"small",color:"inherit",startIcon:Lt(Gw,{sx:{fontSize:16}}),onClick:k=>o(k.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,i?Lt(Fd,{size:"small",color:"inherit",startIcon:Lt(Vw,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Jr(hr,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?Lt(hr,{sx:{mb:d.related.length||d.duplicates.length||d.duplicateOf?1:0},children:d.lineage.map((k,B)=>{let O=k.seq===e.seq,L=B===d.lineage.length-1;return Jr(hr,{sx:{display:"flex",gap:1},children:[Jr(hr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Lt(hr,{sx:{width:O?9:7,height:O?9:7,borderRadius:"50%",bgcolor:O?"#2f80ed":k.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),L?null:Lt(hr,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Jr(hr,{sx:{flex:1,minWidth:0,pb:L?0:.5},children:[Jr(hr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Jr(hr,{component:"span",onClick:!O&&c?()=>c(k.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:O?600:400,color:O?"#2f80ed":k.completed?"#9a9a97":"#37352f",textDecoration:k.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!O&&c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[k.ticket_no?`${k.ticket_no} `:"",k.title]}),Lt(Et,{option:rr(k),small:!0})]}),Lt(hr,{sx:{fontSize:12,color:"#9a9a97"},children:k.completed&&k.completed_time?`${k.completed_time} \uC644\uB8CC`:k.created_time??""})]})]},k.seq)})}):null,d.duplicateOf?Lt(fc,{item:d.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:c?()=>c(d.duplicateOf.seq):void 0,onUnlink:!b&&a?k=>v(k.currentTarget,d.duplicateOf.seq,"duplicate_of"):void 0}):null,d.duplicates.map(k=>Lt(fc,{item:k,caption:"\uC911\uBCF5",onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&a?B=>v(B.currentTarget,k.seq,"duplicate_of"):void 0},`dup-${k.seq}`)),d.related.map(k=>Lt(fc,{item:k,onOpen:c?()=>c(k.seq):void 0,onUnlink:!b&&a?B=>v(B.currentTarget,k.seq,"related"):void 0},`rel-${k.seq}`)),g===0?Lt(hr,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),i?Lt(da,{open:t,task:e,tasks:p,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(k,B)=>i(e.seq,k,B)}):null,Lt(It,{open:!!l,anchorEl:l,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>o(null),onConfirm:()=>{r?.(e.seq),o(null)}}),Lt(It,{open:!!s,anchorEl:s?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>f(null),onConfirm:()=>{s&&a?.(e.seq,s.targetSeq,s.type),f(null)}})]})}import{Fragment as wr,jsx as xe,jsxs as Pt}from"react/jsx-runtime";function lo({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return xe(Wt,{component:"span",sx:{color:"#9a9a97"},children:e})}function Kd({task:e,customTabs:p,statusOptions:b,avatarSrcByName:c,onChangeStatus:i,onChangeLabels:a,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:l,onChangeReminder:o,onMemberEdit:s,onChangePriority:f,onChangeVisibility:d,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:v,onChangeEventAddress:k,onChangeNote:B,onChangeNoteDraft:O,onChangeContent:L,onChangeContentHeight:R,onAddChecklistItem:P,onToggleChecklistItem:j,onRemoveChecklistItem:z,onUpdateChecklistItem:N,onReorderChecklist:S,onConvertChecklistToTask:C,onOpenChecklistTask:E,onLinkChecklistTask:h,resolveChecklistTask:y,relatedTasksPool:w,onOpenRelatedTask:x,onLinkRelatedTask:_,onUnlinkRelatedTask:T,onCreateFollowUpTask:D,onAddAttachments:q,onRemoveAttachment:$,onPreview:W,onDownload:A,onUpdateComment:H,onRemoveComment:M,onToggleCommentReaction:I,currentUserName:F="",myAccountSeq:U=0,noticeAdmin:X=!1,hideProject:V=!1,hideLabel:G=!1,showTitle:ee=!1,onChangeTitle:Z,onToggleCompleted:K,onChangeIcon:Q,onChangeIconColor:J,employees:ne=[],onAckConfirm:ie,onRequestConfirm:le,onChangeBugField:re,sprints:se=[],sprintProject:be=!1,hideSprint:ye=!1,onChangeSprint:Fe,onChangeStoryPoints:Ce,onChangeResolution:ae,onClaimTask:De,onVerifyBug:Be}){let[ke,Re]=Qr(null),[we,ve]=Qr(null),[Ze,Se]=Qr(null),[de,Ee]=Qr(!1),_e={[Gr]:de?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[Ie,ot]=Qr(null),[Le,Ae]=Qr(null),[vt,ze]=Qr(null),[qe,dt]=Qr(null),[Ue,Oe]=Qr(null),[Ft,He]=Qr(null),[te,ue]=Qr(null),fe=!!e.is_notice,me=!!e.is_event,Je=!!e.is_bug,Me=!!De&&Rs(e,U),Ne=!!De&&As(e,U),ht=!!Be&&Je&&!!e.completed&&U>0&&(e.author_account_seq??0)===U&&!(e.acks??[]).some(Y=>Y.account_seq===U),je=!Bn(e,U),Pe=!e.is_event&&(e.is_notice?U>0&&(e.author_account_seq??0)===U:(e.author_account_seq??0)===U||(e.manager_account_seq??0)===U),ft=e.is_notice||e.is_event?bt(e.icon||(e.is_notice?Kt:tr)):null,rt=fe?!Es(e,U):je,et=Me||Ne?Pt(an,{onClick:Y=>ue(Y.currentTarget),children:[xe(c3,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,yt=fe?va(e,ne):"",lt=fe?md(e,ne,U):null,mt=fe?null:Ws(e,U),er=!!(mt&&mt.total>0||fe&&lt),Nt=!fe,Ut=Pt(wr,{children:[xe(at,{icon:xe(s3,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[gn(9),_e??null,...me?[]:[Yt(1)]],children:e.created_by?Pt(wr,{children:[xe(br,{names:[e.created_by],size:20,avatarSrcByName:c}),e.created_by]}):xe(lo,{})}),xe(at,{icon:xe($d,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[gn(11),_e??null,...me?[]:[Yt(2)]],children:e.created_time?Mr(e.created_time):xe(lo,{})})]});return Pt(wr,{children:[ee?Pt(Wt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Pe?xe(Zw,{checked:e.completed,icon:xe(n3,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:xe(pc,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(Y,ce)=>{we||ve({anchorEl:Y.currentTarget,nextCompleted:ce})},sx:{p:0,mt:.25}}):null,ft?xe(Wt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(fe?"#e5484d":"#1e3a8a")},children:xe(ft,{sx:{fontSize:20}})}):null,xe(Wt,{sx:{flex:1,minWidth:0},children:ke!==null?xe(Wt,{component:"input",autoFocus:!0,spellCheck:!1,value:ke,onChange:Y=>Re(Y.target.value),onBlur:()=>{ke.trim()&&ke.trim()!==e.title&&Z(e.seq,ke.trim()),Re(null)},onKeyDown:Y=>{Y.key==="Enter"&&Y.target.blur(),Y.key==="Escape"&&Re(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):xe(Wt,{onClick:()=>Re(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),xe(It,{open:!!we,anchorEl:we?.anchorEl??null,title:we?.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:we?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>ve(null),onConfirm:()=>{we&&K(e.seq,we.nextCompleted),ve(null)}})]}):null,Pt(Wt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[Gr]:{pb:0,"& > :last-child":{mb:0}}},children:[xe(ca,{hideProject:V,pinColumns:!0,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:p,avatarSrcByName:c,hideDueDate:!me&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:fe,event:me,readOnly:je,targetSummary:yt,onChangeProject:Y=>t(e.seq,Y),onAddProject:n,onChangeStartDate:Y=>l(e.seq,"start_date",Y),onChangeDueDate:Y=>l(e.seq,"due_date",Y),onChangeReminder:Y=>o(e.seq,Y),onChangePriority:Y=>f(e.seq,Y),onChangeEventTime:Y=>m?.(e.seq,Y),onChangeEventPlace:Y=>v?.(e.seq,Y),onChangeEventAddress:Y=>k?.(e.seq,Y),onMemberEdit:Y=>s(e,Y,null),narrowCollapsedSx:_e,reminderLocked:e.completed,managerAction:et,leading:Pt(wr,{children:[ht||et&&(fe||me)?Pt(Wt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[fe||me?et:null,ht?Pt(wr,{children:[xe(di,{variant:"contained",size:"large",onClick:()=>Be?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),xe(di,{variant:"outlined",size:"large",color:"error",onClick:()=>Be?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,Je&&e.ticket_no?xe(at,{icon:xe(e3,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:Yt(1),children:xe(Wt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,me?null:xe(Wt,{sx:Je&&e.ticket_no||Nt||er?Yt(Je&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:xe(at,{icon:xe(o3,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:je||e.completed?void 0:Y=>ot(Y),children:xe(Et,{option:rr(e)})})}),fe?null:(()=>{let Y=Wr(e),ce=Y==="all"?xe(Wd,{sx:{fontSize:17,color:"#2f80ed"}}):Y==="group"?xe(Ud,{sx:{fontSize:17,color:"#d9730d"}}):xe(Hd,{sx:{fontSize:17}}),ge=Y==="all"?"\uC804\uCCB4\uACF5\uAC1C":Y==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(he=>he.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return xe(Wt,{sx:me?void 0:Yt(Je?1:2),children:xe(at,{icon:ce,label:"\uACF5\uAC1C",onClick:je||!d?void 0:he=>Ae(he),children:ge})})})(),!fe&&!Je?xe(Wt,{sx:me?void 0:Yt(1),children:xe(at,{icon:xe(u3,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:je||!u?void 0:Y=>ze(Y),children:e.repeat_rule?oa(e.repeat_rule):xe(lo,{label:"\uC5C6\uC74C"})})}):null,!fe&&!Je&&e.repeat_rule?xe(Wt,{sx:me?void 0:Yt(2),children:xe(at,{icon:xe(f3,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:je||!u?void 0:Y=>dt(Y),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:xe(lo,{})})}):null,mt&&mt.total>0?xe(Wt,{sx:me?void 0:Yt(2),children:xe(at,{icon:xe(mc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:mt.canConfirm?xe(di,{size:"small",variant:"contained",onClick:()=>ie?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Pt(di,{size:"small",variant:"outlined",color:"inherit",startIcon:mt.myTime?xe(pc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Y=>Se({anchorEl:Y.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[mt.count," / ",mt.total]})})}):null,fe&&lt?xe(Wt,{sx:Yt(2),children:xe(at,{icon:xe(mc,{sx:{fontSize:17}}),label:"\uD655\uC778",children:xe(Wt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:lt.canAck?xe(di,{size:"small",variant:"contained",onClick:()=>ie?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):xe(di,{size:"small",variant:"outlined",color:"inherit",startIcon:lt.acked?xe(pc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:Y=>Se({anchorEl:Y.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:lt.total>0&&lt.count>=lt.total?"\uC644\uB8CC":Pt(wr,{children:[lt.count,xe(Wt,{component:"span",sx:{mx:.4},children:"/"}),lt.total]})})})})}):null,be&&!ye&&!me&&!fe?Pt(wr,{children:[xe(at,{icon:xe(t3,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:je?void 0:Y=>Oe(Y),sx:Yt(1),children:(e.sprint_seq??0)>0?se.find(Y=>Y.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":xe(lo,{label:"\uBBF8\uBC30\uC815"})}),xe(at,{icon:xe(r3,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:Yt(2),children:xe($n,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:je,onCommit:Y=>Ce?.(e.seq,Number(Y.replace(/[^0-9.]/g,""))||0)})})]}):null,me||G?null:xe(Wt,{sx:[{gridColumn:"1 / -1"},_e??null],children:xe(at,{icon:xe(i3,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:je?void 0:Y=>He(Y),children:(e.label_keys??[]).length>0?xe(Qn,{labelKeys:e.label_keys??[],labelOptions:b}):xe(lo,{})})}),me?null:Ut]}),trailing:Pt(wr,{children:[Je?xe(ua,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:je,showResolution:!!e.completed,onChangeRepro:Y=>re?.(e.seq,"bug_repro",Y),onChangeDevice:Y=>re?.(e.seq,"bug_device",Y),onChangeWhere:Y=>re?.(e.seq,"bug_where",Y),onChangeVersion:Y=>re?.(e.seq,"bug_version",Y),onChangeResolution:Y=>ae?.(e.seq,Y)}):null,me?Ut:null,e.completed?Pt(wr,{children:[xe(at,{icon:xe(mc,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[gn(10),_e??null,...me?[]:[Yt(1)]],children:e.completed_by?Pt(wr,{children:[xe(br,{names:[e.completed_by],size:20,avatarSrcByName:c}),e.completed_by]}):xe(lo,{})}),xe(at,{icon:xe($d,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[gn(12),_e??null,...me?[]:[Yt(2)]],children:e.completed_time?Mr(e.completed_time):xe(lo,{})})]}):null]})}),Pt(Wt,{sx:{display:"none",[Gr]:{display:"block",mt:1.5,mb:0}},children:[xe(Do,{sx:{borderColor:"#e6e6e3"}}),xe(Xw,{onClick:()=>Ee(Y=>!Y),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:de?Pt(wr,{children:["\uC811\uAE30 ",xe(Jw,{sx:{fontSize:18}})]}):Pt(wr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",xe(Qw,{sx:{fontSize:18}})]})})]}),Pt(Wt,{children:[xe(Do,{sx:{my:1.5,borderColor:"#e6e6e3",[Gr]:{mt:0,mb:1.25}}}),xe(qr,{icon:xe(a3,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:xe(Wt,{sx:{userSelect:"text"},children:xe(fa,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:R?Y=>R(e.seq,Y):void 0,readOnly:je,onChange:Y=>L(e.seq,Y)})})}),e.is_bug?null:Pt(wr,{children:[xe(Do,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(qr,{icon:xe(l3,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:xe(Wt,{sx:{userSelect:"text"},children:xe(Nd,{value:e.note,readOnly:rt,onCommit:Y=>B(e.seq,Y),onDraftChange:O?Y=>O(e.seq,Y):void 0})})})]}),me?null:Pt(wr,{children:[xe(Do,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(ha,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:rt,onAdd:P,onToggle:j,onRemove:z,onUpdate:N,onReorder:S,onConvertToTask:C,onOpenLinkedTask:E,resolveLinkedTask:y,myAccountSeq:U,linkCandidates:w,linkBaseTask:e,onLinkExistingTask:h})]}),w&&!me&&!fe&&Ld(e,w)?Pt(wr,{children:[xe(Do,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(zd,{task:e,tasks:w,readOnly:je,onOpenTask:x,onLink:_,onUnlink:T,onCreateFollowUp:D})]}):null,xe(Do,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(ba,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:rt,onAdd:q,onRemove:$,onPreview:W?Y=>W({...Y,taskSeq:e.seq}):void 0,onDownload:A?Y=>A({...Y,taskSeq:e.seq}):void 0})]}),xe(Do,{sx:{my:1.5,borderColor:"#e6e6e3"}}),xe(Md,{taskSeq:e.seq,comments:e.comments??[],currentUserName:F,myAccountSeq:U,avatarSrcByName:c,onUpdate:H,onRemove:M,onToggleReaction:I,onPreview:W?Y=>W({...Y,taskSeq:e.seq}):void 0,onDownload:A?Y=>A({...Y,taskSeq:e.seq}):void 0})]}),xe(Vo,{anchorEl:Ie,value:e.status,options:fe?Ti:Je?xo:Ci,onSelect:Y=>i(e.seq,Y),onClose:()=>ot(null)}),xe(dc,{transitionDuration:0,anchorEl:vt,open:!!vt,onClose:()=>ze(null),children:[{value:"",label:"\uC5C6\uC74C"},...Li].map(Y=>xe(hc,{selected:(e.repeat_rule??"")===Y.value,onClick:()=>{ze(null),(async()=>{let ce=e.repeat_rule??"";if(Y.value===ce)return;if(Y.value===""){await Vd({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let ge=String(e.due_date??"").slice(0,10);if(!ge){d3(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}ce&&!await Vd({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,Y.value,ia(ge,Y.value))})()},sx:{fontSize:14,minWidth:140},children:Y.label},Y.value||"none"))}),xe(h3,{anchorEl:qe,open:!!qe,onClose:()=>dt(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:Y=>{dt(null);let ce=oe=>String(oe).padStart(2,"0"),ge=`${Y.getFullYear()}-${ce(Y.getMonth()+1)}-${ce(Y.getDate())}`,he=e.repeat_rule??"";he&&u?.(e.seq,he,ge)}}),xe(dc,{transitionDuration:0,anchorEl:Le,open:!!Le,onClose:()=>Ae(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:xe(Hd,{sx:{fontSize:17,color:"#57564f"}}),selected:Wr(e)==="involved",onPick:()=>d?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:xe(Wd,{sx:{fontSize:17,color:"#2f80ed"}}),selected:Wr(e)==="all",onPick:()=>d?.(e.seq,"all",0)},...g.map(Y=>({key:`group-${Y.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${Y.name}`,icon:xe(Ud,{sx:{fontSize:17,color:"#d9730d"}}),selected:Wr(e)==="group"&&(e.visibility_group_seq??0)===Y.seq,onPick:()=>d?.(e.seq,"group",Y.seq)}))].map(Y=>Pt(hc,{selected:Y.selected,onClick:()=>{Y.onPick(),Ae(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Y.icon,Y.label,Y.selected?xe(qd,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Y.key))}),xe(dc,{transitionDuration:0,anchorEl:Ue,open:!!Ue,onClose:()=>Oe(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...se.filter(Y=>`custom-${Y.group_seq}`===String(e.tab_key??"")).map(Y=>({seq:Y.seq,label:Fr(Y)}))].map(Y=>Pt(hc,{onClick:()=>{Fe?.(e.seq,Y.seq),Oe(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Y.label,(e.sprint_seq??0)===Y.seq?xe(qd,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},Y.seq))}),xe(Hs,{anchorEl:Ze?.anchorEl??null,open:!!Ze?.open,acks:e.acks??[],total:lt?.total??mt?.total??0,pendingNames:lt?.pendingNames??mt?.pendingNames??[],avatarSrcByName:c,onRequestConfirm:le&&(lt?lt.count<lt.total:mt&&mt.count<mt.total)?()=>{le(e.seq),Se(Y=>Y?{...Y,open:!1}:null)}:void 0,onClose:()=>Se(Y=>Y?{...Y,open:!1}:null)}),xe(xa,{anchorEl:Ft,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:Y=>a(e.seq,Is(e.label_keys??[],Y)),onAddLabel:r,onClose:()=>He(null)}),xe(It,{open:!!te,anchorEl:te,title:Me?"\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:()=>ue(null),onConfirm:()=>{De?.(e.seq),ue(null)}})]})}import{Fragment as v3,jsx as _r,jsxs as Qd}from"react/jsx-runtime";function pP(){let e=new Date,p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function mP({open:e,task:p,onClose:b,onAddComment:c,onSaveFields:i,presentation:a="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:o,activityItems:s,activityLoading:f,onLoadActivity:d,onPrint:u,...g}){let m=Bt(),v=Yd(null);p&&(v.current=p);let k=p??v.current,[B,O]=Xd(!1),[L,R]=Xd({}),P=Object.keys(L).length>0;Gd(()=>{R({})},[p?.seq,e]);let j=Yd(null);if(Gd(()=>{j.current?.scrollTo({top:0})},[p?.seq]),!k)return null;let z=m&&P?{...k,...L}:k,N=z.checklist??[],S=(x,_)=>{m?R(T=>({...T,...x})):_()},C=()=>{let x=L;R({});let _=k.seq,T=x.title===void 0?void 0:String(x.title).trim();if(i){let D={...x};T!==void 0&&(T?D.title=T:delete D.title),Object.keys(D).length>0&&i(_,D),Jd({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}T&&n(_,T),x.icon!==void 0&&l(_,String(x.icon)),x.icon_color!==void 0&&o?.(_,String(x.icon_color)),x.status!==void 0&&g.onChangeStatus(_,x.status),x.label_keys!==void 0&&g.onChangeLabels(_,x.label_keys??[]),x.tab_key!==void 0&&g.onChangeProject(_,String(x.tab_key??"")),x.start_date!==void 0&&g.onChangeDate(_,"start_date",String(x.start_date??"")),x.due_date!==void 0&&g.onChangeDate(_,"due_date",String(x.due_date??"")),x.reminder!==void 0&&g.onChangeReminder(_,x.reminder),x.priority!==void 0&&g.onChangePriority(_,x.priority),x.event_time!==void 0&&g.onChangeEventTime?.(_,String(x.event_time??"")),x.event_place!==void 0&&g.onChangeEventPlace?.(_,String(x.event_place??"")),x.event_address!==void 0&&g.onChangeEventAddress?.(_,String(x.event_address??"")),x.content!==void 0&&g.onChangeContent(_,String(x.content??"")),x.note!==void 0&&g.onChangeNote(_,String(x.note??"")),x.visibility!==void 0&&g.onChangeVisibility?.(_,x.visibility,Number(x.visibility_group_seq??0)),Jd({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},E={...g,onChangeStatus:(x,_)=>S({status:_},()=>g.onChangeStatus(x,_)),onChangeLabels:(x,_)=>S({label_keys:_},()=>g.onChangeLabels(x,_)),onChangeProject:(x,_)=>S({tab_key:_},()=>g.onChangeProject(x,_)),onChangeDate:(x,_,T)=>S({[_]:T},()=>g.onChangeDate(x,_,T)),onChangeReminder:(x,_)=>S({reminder:_},()=>g.onChangeReminder(x,_)),onChangePriority:(x,_)=>S({priority:_},()=>g.onChangePriority(x,_)),onChangeEventTime:(x,_)=>S({event_time:_},()=>g.onChangeEventTime?.(x,_)),onChangeEventPlace:(x,_)=>S({event_place:_},()=>g.onChangeEventPlace?.(x,_)),onChangeEventAddress:(x,_)=>S({event_address:_},()=>g.onChangeEventAddress?.(x,_)),onChangeContent:(x,_)=>S({content:_},()=>g.onChangeContent(x,_)),onChangeNote:(x,_)=>S({note:_},()=>g.onChangeNote(x,_)),onMemberEdit:(x,_)=>g.onMemberEdit(x,_,m?T=>R(D=>({...D,...T})):null),onChangeNoteDraft:m?(x,_)=>S({note:_},()=>{}):void 0,onChangeVisibility:g.onChangeVisibility?(x,_,T)=>S({visibility:_,visibility_group_seq:T},()=>g.onChangeVisibility?.(x,_,T)):void 0,onAddChecklistItem:(x,_)=>S({checklist:[...N,{label:_,checked:!1}]},()=>g.onAddChecklistItem(x,_)),onToggleChecklistItem:(x,_,T)=>S({checklist:N.map((D,q)=>q===_?{...D,checked:T}:D)},()=>g.onToggleChecklistItem(x,_,T)),onRemoveChecklistItem:(x,_)=>S({checklist:N.filter((T,D)=>D!==_)},()=>g.onRemoveChecklistItem(x,_)),onUpdateChecklistItem:g.onUpdateChecklistItem?(x,_,T)=>S({checklist:N.map((D,q)=>q===_?{...D,label:T}:D)},()=>g.onUpdateChecklistItem?.(x,_,T)):void 0,onReorderChecklist:g.onReorderChecklist?(x,_)=>S({checklist:_},()=>g.onReorderChecklist?.(x,_)):void 0,onLinkChecklistTask:g.onLinkChecklistTask?(x,_,T)=>S({checklist:[...N,{label:T,checked:!1,task_seq:_}]},()=>g.onLinkChecklistTask?.(x,_,T)):void 0},h=_r(Kd,{...E,task:z,myAccountSeq:r,onChangeTitle:(x,_)=>S({title:_},()=>n(x,_)),onToggleCompleted:t,onChangeIcon:(x,_)=>S({icon:_},()=>l(x,_)),onChangeIconColor:(x,_)=>S({icon_color:_},()=>o?.(x,_)),showTitle:m}),y=_r(Ed,{onSubmit:(x,_)=>c(z.seq,x,_)},z.seq);return m||a==="dialog"?Qd(v3,{children:[_r(x3,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:z.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":z.is_event?"\uC77C\uC815":z.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...d?[{icon:_r(b3,{sx:{ml:2,color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>O(!0)}]:[],{icon:_r(g3,{sx:{ml:d?0:2,color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>ui(z,!0)},{icon:_r(p3,{variant:"contained",size:"small",disableElevation:!0,disabled:!P,onClick:P?C:void 0,sx:{ml:1,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:""}]},fullScreen:m,maxWidth:m?void 0:"md",width:m?void 0:720,mobilePresentation:m?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:y},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:_r(Ia,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:h})}]},k.seq),_r(Ca,{open:B,taskSeq:z.seq,items:s,loading:f,onLoad:d,onClose:()=>O(!1)})]}):_r(m3,{anchor:"right",open:e,onClose:b,disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:x=>x.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Qd(Ia,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[_r(Pd,{task:z,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:l,onChangeIconColor:o,onClose:b,activityItems:s,activityLoading:f,onLoadActivity:d,onPrint:u}),_r(Zd,{sx:{borderColor:"#e6e6e3"}}),_r(Ia,{sx:{flex:1,minHeight:0},children:_r(y3,{ref:j,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:h})}),_r(Zd,{sx:{borderColor:"#37352f"}}),_r(Ia,{sx:{flexShrink:0},children:y})]})})}import{useEffect as _3,useState as Po}from"react";import{Box as Tr,Button as yc,IconButton as eh}from"@mui/material";import{FormDialog as k3}from"@ehfuse/mui-form-dialog";import S3 from"@mui/icons-material/EditOutlined";import{ErrorAlert as th}from"@ehfuse/alerts";import{ClearTextField as rh,DateTextField as nh,LabelSelect as oh}from"@ehfuse/mui-form-controls";var gc="custom-";function w3(e){return e.startsWith(gc)}function yP(e){return e>0?`${gc}${e}`:""}function bc(e){if(!w3(e))return 0;let p=Number(e.slice(gc.length));return Number.isInteger(p)&&p>0?p:0}import{Fragment as C3,jsx as Xt,jsxs as co}from"react/jsx-runtime";var T3=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function ih(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function IP({open:e,customTabs:p,sprints:b,onClose:c,onCreate:i,onUpdate:a,onChangeStatus:r,onRemove:t}){let n=p.filter(C=>C.useSprints&&!C.archived),[l,o]=Po(""),[s,f]=Po(""),[d,u]=Po(""),[g,m]=Po(""),[v,k]=Po(""),[B,O]=Po(!1),[L,R]=Po(0);_3(()=>{e&&(o(n.length===1?n[0].key:""),f(""),u(""),m(""),k(""),R(0))},[e]);let P=()=>{f(""),u(""),m(""),k(""),R(0)},j=C=>{R(C.seq),o(`custom-${C.group_seq}`),f(C.name),u(C.goal),m(C.start_date),k(C.end_date)},z=async()=>{let C=bc(l);if(!C){th("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!s.trim()){th("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}O(!0);try{if(L>0){a(L,{name:s.trim(),goal:d.trim(),start_date:g,end_date:v}),P();return}await i({group_seq:C,name:s.trim(),goal:d.trim(),start_date:g,end_date:v})&&P()}finally{O(!1)}},N=new Map(p.map(C=>[bc(C.key),C.label])),S=Xt(Tr,{children:n.length===0?Xt(Tr,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):co(C3,{children:[co(Tr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Xt(oh,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:l,options:n.map(C=>({value:C.key,label:C.label})),onChange:C=>o(String(C.target.value)),disabled:L>0}),Xt(rh,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:s,onChange:C=>f(C.target.value)}),Xt(nh,{size:"medium",label:"\uC2DC\uC791\uC77C",value:g,onChange:C=>m(C.target.value)}),Xt(nh,{size:"medium",label:"\uC885\uB8CC\uC77C",value:v,onChange:C=>k(C.target.value)}),Xt(rh,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:d,onChange:C=>u(C.target.value),sx:{gridColumn:"1 / -1"}})]}),co(Tr,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[L>0?Xt(yc,{color:"inherit",onClick:P,disabled:B,children:"\uCDE8\uC18C"}):null,Xt(yc,{variant:"contained",onClick:()=>{z()},disabled:B,children:L>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),Xt(Tr,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:b.length===0?Xt(Tr,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(C=>co(Tr,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[co(Tr,{sx:{minWidth:0},children:[co(Tr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Xt(Tr,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:C.name}),Xt(Tr,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:N.get(C.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),co(Tr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[ih(C.start_date)," ~ ",ih(C.end_date)]})]}),C.goal?Xt(Tr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:C.goal}):null]}),co(Tr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Xt(oh,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:C.status,options:T3.map(E=>({value:E.value,label:E.label})),onChange:E=>r(C.seq,String(E.target.value)),sx:{width:104,flexShrink:0}}),Xt(eh,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>j(C),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Xt(S3,{sx:{fontSize:18}})}),Xt(eh,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>t(C.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Xt(un,{style:{width:16,height:16}})})]})]},C.seq))})]})});return Xt(k3,{open:e,onClose:c,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],actions:{showCancelButton:!1,right:Xt(yc,{variant:"contained",onClick:c,children:"\uB2EB\uAE30"})}})}import{useState as sh}from"react";import{Box as sr,Button as xc,Divider as B3,IconButton as I3,TextField as M3}from"@mui/material";import{FormDialog as E3}from"@ehfuse/mui-form-dialog";import R3 from"@mui/icons-material/OpenInNewOutlined";import A3 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as O3}from"@ehfuse/alerts";import{jsx as Rt,jsxs as No}from"react/jsx-runtime";function LP({open:e,imports:p,onRegister:b,onRemove:c,onClose:i}){let[a,r]=sh(""),[t,n]=sh(!1),l=async()=>{let f=a.trim();if(f){n(!0);try{await b(f)&&r("")}finally{n(!1)}}},o=async f=>{await O3({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&c(f.seq)},s=No(sr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[No(sr,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",Rt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",Rt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",Rt("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),Rt(sr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),p.length>0?Rt(sr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:p.map((f,d)=>No(sr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:d>0?"1px solid #efefed":"none"},children:[Rt(A3,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),Rt(sr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),Rt(I3,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{o(f)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Rt(un,{sx:{fontSize:18}})})]},f.seq))}):Rt(sr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),Rt(B3,{sx:{my:1,borderColor:"#e6e6e3"}}),Rt(sr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),No(sr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Rt(sr,{children:No(sr,{component:"span",children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > ",Rt("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),Rt(sr,{children:No(sr,{component:"span",children:[Rt("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",Rt("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Rt(sr,{children:Rt(sr,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),Rt(sr,{children:Rt(sr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})})]}),No(sr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[Rt(M3,{value:a,onChange:f=>r(f.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),Rt(xc,{variant:"contained",disabled:!a.trim()||t,onClick:()=>{l()},sx:{flexShrink:0},children:t?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return Rt(E3,{open:e,onClose:i,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:s}],actions:{showCancelButton:!1,left:Rt(xc,{variant:"outlined",startIcon:Rt(R3,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Rt(xc,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Box as Vn,Button as Vi,TextField as D3}from"@mui/material";import{FormDialog as P3}from"@ehfuse/mui-form-dialog";import N3 from"@mui/icons-material/ContentCopyOutlined";import ah from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as lh}from"@ehfuse/alerts";import{Fragment as L3,jsx as Zt,jsxs as jo}from"react/jsx-runtime";function j3(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function VP({open:e,feed:p,feedTaskCount:b,buildFeedUrl:c,onSubscribe:i,onClose:a}){let r=c??j3,t=p.subscribed?r(p.token):"",n=()=>{navigator.clipboard.writeText(t).then(()=>lh("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>lh("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},l=()=>{let s=t.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(s)}`,"_blank")},o=jo(Vn,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[jo(Vn,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Zt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?jo(Vn,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",Zt("br",{}),Zt("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",p.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):p.subscribed&&p.enabled?jo(L3,{children:[Zt(D3,{value:t,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),jo(Vn,{sx:{display:"flex",gap:2},children:[Zt(Vi,{variant:"outlined",startIcon:Zt(N3,{}),onClick:n,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Zt(Vi,{variant:"contained",startIcon:Zt(ah,{}),onClick:l,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),jo(Vn,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[Zt(Vn,{children:jo("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Zt("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Zt(Vn,{children:Zt("span",{children:"\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."})}),Zt(Vn,{children:Zt("span",{children:"\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."})}),Zt(Vn,{children:Zt("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):Zt(Vi,{variant:"contained",onClick:i,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Zt(P3,{open:e,onClose:a,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uB85C \uB0B4\uBCF4\uB0B4\uAE30",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:o}],actions:{showCancelButton:!1,left:Zt(Vi,{variant:"outlined",startIcon:Zt(ah,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Zt(Vi,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}})}import{useEffect as F3,useMemo as vc,useState as wc}from"react";import{Box as Ki,Button as z3,Typography as q3}from"@mui/material";import{FormDialog as $3}from"@ehfuse/mui-form-dialog";import{SearchTextField as H3}from"@ehfuse/mui-form-controls";import{TreeView as W3}from"@ehfuse/tree-view";import{Fragment as X3,jsx as en,jsxs as Z3}from"react/jsx-runtime";function ch(e){return`${e.name}#${e.seq}`}function U3(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function V3(e){let p=[],b=c=>{for(let i of c.employees??[])p.push(i);for(let i of c.groups??[])b(i)};for(let c of e)b(c);return p}function K3(e,p){return p?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(p)):!0}function G3(e){let p=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:ch(e),renderLabel:en(Ki,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:en(Ki,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:p})})}}function uh(e,p){let b=(e.groups??[]).map(i=>uh(i,p)).filter(i=>i!==null),c=(e.employees??[]).filter(i=>K3(i,p)).map(G3);return b.length===0&&c.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...c]}}function Y3({groups:e,allEmployees:p,initialSelectedSeqs:b,multiple:c,isMobile:i,onSelectionChange:a}){let[r,t]=wc(""),n=vc(()=>e.map(o=>uh(o,r.trim().toLowerCase())).filter(o=>o!==null),[e,r]),l=vc(()=>p.filter(o=>b.includes(o.seq)).map(ch),[]);return Z3(X3,{children:[en(Ki,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:en(H3,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),en(Ki,{sx:i?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:en(W3,{items:n,checkbox:!0,multiSelect:c,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:l,onChange:o=>a(o.map(U3).filter(s=>s>0)),styles:{border:"none",borderRadius:"0"}})})]})}function tN({open:e,title:p="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:c,multiple:i=!1,selectedSeqs:a,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let l=Bt(),[o,s]=wc([]),[f,d]=wc(0),u=vc(()=>V3(c),[c]),g=a??[];F3(()=>{e&&(s(g),d(v=>v+1))},[e]);let m=()=>{let v=u.filter(k=>o.includes(k.seq));t(i?v:v.slice(0,1)),n()};return en($3,{open:e,onClose:n,title:`${p}${i&&o.length>0?` (${o.length}\uBA85)`:""}`,locale:"ko",fullScreen:l,mobilePresentation:l?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:en(Ki,{sx:{...l?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...l?{}:{overflow:"hidden"},userSelect:"none"},children:en(Y3,{groups:c,allEmployees:u,initialSelectedSeqs:g,multiple:i,isMobile:l,onSelectionChange:s},f)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?en(q3,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:en(z3,{variant:"contained",onClick:m,children:r})}})}import{useEffect as P4,useMemo as N4,useState as Bh}from"react";import{Box as es,Button as j4}from"@mui/material";import{FormDialog as L4}from"@ehfuse/mui-form-dialog";import{LabelSelect as Ih}from"@ehfuse/mui-form-controls";import{Box as Yi}from"@mui/material";import{Bar as J3,BarChart as Q3,CartesianGrid as e4,Cell as t4,ReferenceLine as r4,ResponsiveContainer as n4,Tooltip as o4,XAxis as i4,YAxis as s4}from"recharts";var Lo="#2f80ed",Gi="#a9c9f5",Ma="#9a9a97",uo={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}};function fo(e){return{display:"flex",flexDirection:"column",minHeight:0,...typeof e=="string"?{height:e}:{}}}function ho(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as tn,jsxs as Xi}from"react/jsx-runtime";function a4(e,p){let b=p.filter(c=>c.sprint_seq===e.seq&&!c.archived&&c.completed);return{points:b.reduce((c,i)=>c+(i.story_points??0),0),count:b.length}}function fh({sprints:e,tasks:p,height:b=200}){let i=[...e].sort((o,s)=>`${o.start_date}|${o.seq}`.localeCompare(`${s.start_date}|${s.seq}`)).map(o=>({sprint:o,...a4(o,p)})),a=i.some(o=>o.points>0),r=a?"SP":"\uAC74",t=i.filter(o=>o.sprint.status==="closed").map(o=>a?o.points:o.count),n=t.length>0?Math.round(t.reduce((o,s)=>o+s,0)/t.length*10)/10:null,l=i.map(o=>({\uBAA9\uD45C:`${o.sprint.name}${o.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:a?o.points:o.count,closed:o.sprint.status==="closed"}));return i.length===0?tn(Yi,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Xi(Yi,{sx:fo(b),children:[Xi(Yi,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Xi("span",{children:["\uC644\uB8CC ",a?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Xi("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",tn(Yi,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),tn(Yi,{sx:ho(b),children:tn(n4,{width:"100%",height:"100%",children:Xi(Q3,{data:l,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[tn(e4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),tn(i4,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),tn(s4,{tick:{fontSize:13},width:40,allowDecimals:!1}),tn(o4,{...uo,formatter:o=>`${Number(o??0)}${r}`}),n!==null?tn(r4,{y:n,stroke:Ma,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,tn(J3,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:l.map(o=>tn(t4,{fill:o.closed?Lo:Gi},o.\uBAA9\uD45C))})]})})})]})}import{useMemo as l4}from"react";import{Box as hi}from"@mui/material";import{CartesianGrid as c4,Line as dh,LineChart as u4,ResponsiveContainer as f4,Tooltip as d4,XAxis as h4,YAxis as p4}from"recharts";import{jsx as rn,jsxs as Zi}from"react/jsx-runtime";function hh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function m4(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function g4(e){return e.slice(5).replace("-",".")}function ph({sprint:e,tasks:p,todayStr:b,height:c=200}){let i=l4(()=>{let o=hh(e.start_date),s=hh(e.end_date);if(!o||!s||s<o||Math.round((s.getTime()-o.getTime())/864e5)+1>366)return null;let d=p.filter(R=>R.sprint_seq===e.seq&&!R.archived);if(d.length===0)return{empty:!0};let u=d.some(R=>(R.story_points??0)>0),g=R=>u?R.story_points??0:1,m=d.reduce((R,P)=>R+g(P),0),v=new Map;for(let R of d){if(!R.completed)continue;let P=(R.completed_time??"").slice(0,10),j=/^\d{4}-\d{2}-\d{2}$/.test(P)?P:e.start_date;v.set(j,(v.get(j)??0)+g(R))}let k=[];for(let R=new Date(o);R<=s;R.setDate(R.getDate()+1))k.push(m4(R));let B=m,O=m;return{empty:!1,data:k.map((R,P)=>{let j=k.length===1?0:m*(1-P/(k.length-1));return R<=b&&(B-=v.get(R)??0,O=Math.max(0,B)),{\uB0A0\uC9DC:g4(R),\uC774\uC0C1:Math.round(j*10)/10,\uB0A8\uC740\uB7C9:R<=b?Math.max(0,B):null}}),total:m,usePoints:u,last:O}},[e,p,b]);if(!i)return rn(hi,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4."});if(i.empty)return rn(hi,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let{data:a,total:r,usePoints:t,last:n}=i,l=t?"SP":"\uAC74";return Zi(hi,{sx:fo(c),children:[Zi(hi,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Zi("span",{children:["\uB0A8\uC740 ",t?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",r]}),Zi("span",{children:["\uD604\uC7AC"," ",rn(hi,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),l," \uB0A8\uC74C"]})]}),rn(hi,{sx:ho(c),children:rn(f4,{width:"100%",height:"100%",children:Zi(u4,{data:a,margin:{top:8,right:12,left:0,bottom:0},children:[rn(c4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),rn(h4,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),rn(p4,{tick:{fontSize:13},width:40,allowDecimals:!1}),rn(d4,{...uo,formatter:o=>`${Number(o??0)}${l}`}),rn(dh,{type:"linear",dataKey:"\uC774\uC0C1",stroke:Ma,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),rn(dh,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Lo,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as wh}from"react";import{Box as mi}from"@mui/material";import{Area as Sc,AreaChart as v4,CartesianGrid as w4,Legend as _4,ResponsiveContainer as k4,Tooltip as S4,XAxis as T4,YAxis as C4}from"recharts";function Kn(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())}`}function Ea(e,p=new Date){let b=new Date(p);return b.setMonth(b.getMonth()-e),b}function gN(e=new Date){return{fromDate:Kn(Ea(1,e)),toDate:Kn(e)}}var kc=864e5,Ji=[0,1,2,3,5,8,13,21];function bh(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function _c(e){let p=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(p);if(!b)return null;let c=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(c)?null:c}function pi(e){let p=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(p)?p.slice(0,10):""}function b4(e){let p=pi(e.created_time)||pi(e.start_date)||pi(e.completed_time);if(!p)return null;let b=pi(e.start_date),c=b&&b>p?b:p,i=e.completed?pi(e.completed_time)||p:"";return{created:p,started:c,done:i}}function yh(e,p){let b=/^\d{4}-\d{2}-\d{2}$/.test(p)?new Date(`${p}T00:00:00`):new Date,c=Math.max(2,Math.min(366,Math.round(e))),i=[];for(let a=c-1;a>=0;a-=1)i.push(Kn(new Date(b.getTime()-a*kc)));return i}function xh(e,p,b){let c=yh(p,b),i=e.filter(bh).map(b4).filter(n=>n!==null),a=c.map(n=>{let l=0,o=0,s=0;for(let f of i)f.created>n||(f.done&&f.done<=n?l+=1:f.started<=n?o+=1:s+=1);return{day:n,done:l,inProgress:o,waiting:s}}),r=a[a.length-1],t=a.reduce((n,l)=>Math.max(n,l.done+l.inProgress+l.waiting),0);return{points:a,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function y4(e,p){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*p)-1));return e[b]}function mh(e){if(e.length===0)return null;let p=[...e].sort((a,r)=>a-r),b=a=>Math.round(a*10)/10,c=Math.floor(p.length/2),i=p.length%2===1?p[c]:(p[c-1]+p[c])/2;return{count:p.length,median:b(i),average:b(p.reduce((a,r)=>a+r,0)/p.length),p85:b(y4(p,.85))}}function gh(e){for(let p=Ji.length-1;p>=0;p-=1)if(e>=Ji[p])return p;return 0}function x4(){return Ji.map((e,p)=>p===Ji.length-1?`${e}\uC77C+`:`${e}~${Ji[p+1]}\uC77C`)}function vh(e,p,b){let c=yh(p,b),i=c[0],a=c[c.length-1],r=x4(),t=r.map(()=>0),n=r.map(()=>0),l=[],o=[];for(let s of e){if(!bh(s)||!s.completed)continue;let f=pi(s.completed_time);if(!f||f<i||f>a)continue;let d=_c(s.completed_time),u=_c(s.created_time);if(d===null||u===null)continue;let g=Math.max(0,(d-u)/kc);l.push(g),t[gh(g)]+=1;let m=_c(s.start_date);if(m===null||m>d)continue;let v=Math.max(0,(d-Math.max(m,u))/kc);o.push(v),n[gh(v)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:mh(l),cycle:mh(o)}}import{jsx as Rr,jsxs as Qi}from"react/jsx-runtime";function B4(e){return e.slice(5).replace("-",".")}function _h({tasks:e,todayStr:p,days:b=30,height:c=220}){let i=wh(()=>xh(e,b,p),[e,b,p]),a=wh(()=>i.points.map(r=>({\uB0A0\uC9DC:B4(r.day),\uC644\uB8CC:r.done,\uC9C4\uD589:r.inProgress,\uB300\uAE30:r.waiting})),[i]);return a.length===0||i.max===0?Rr(mi,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Qi(mi,{sx:fo(c),children:[Qi(mi,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Qi("span",{children:["\uCD5C\uADFC ",i.points.length,"\uC77C \u2014 \uC811\uC218 ",i.currentTotal,"\uAC74 / \uC644\uB8CC ",i.currentDone,"\uAC74"]}),Qi("span",{children:["\uC9C4\uD589 \uC911"," ",Rr(mi,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:i.currentWip}),"\uAC74"]})]}),Rr(mi,{sx:ho(c),children:Rr(k4,{width:"100%",height:"100%",children:Qi(v4,{data:a,margin:{top:8,right:12,left:0,bottom:0},children:[Rr(w4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Rr(T4,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Rr(C4,{tick:{fontSize:13},width:40,allowDecimals:!1}),Rr(S4,{...uo,formatter:r=>`${Number(r??0)}\uAC74`}),Rr(_4,{wrapperStyle:{fontSize:13.5}}),Rr(Sc,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:"#2f80ed",fill:"#2f80ed"}),Rr(Sc,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:"#a9c9f5",fill:"#a9c9f5"}),Rr(Sc,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:"#d8d8d5",fill:"#e6e6e3"})]})})}),Rr(mi,{sx:{flexShrink:0,mt:.5,fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})}import{useMemo as kh}from"react";import{Box as wn}from"@mui/material";import{Bar as Sh,BarChart as I4,CartesianGrid as M4,Legend as E4,ResponsiveContainer as R4,Tooltip as A4,XAxis as O4,YAxis as D4}from"recharts";import{jsx as kr,jsxs as vn}from"react/jsx-runtime";function Th({label:e,color:p,summary:b}){return b?vn(wn,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1.5,fontSize:14,color:"#000"},children:[vn(wn,{sx:{display:"flex",alignItems:"center",gap:.75},children:[kr(wn,{sx:{width:10,height:10,borderRadius:.5,bgcolor:p,flexShrink:0}}),kr(wn,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]}),vn("span",{children:[b.count,"\uAC74"]}),vn("span",{children:["\uC911\uC559\uAC12"," ",kr(wn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),vn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),vn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):vn(wn,{sx:{fontSize:14,color:"#000"},children:[e," \u2014 \uD45C\uBCF8 \uC5C6\uC74C"]})}function Ch({tasks:e,todayStr:p,days:b=30,height:c=200}){let i=kh(()=>vh(e,b,p),[e,b,p]),a=kh(()=>i.labels.map((r,t)=>({\uAD6C\uAC04:r,\uB9AC\uB4DC\uD0C0\uC784:i.leadCounts[t],\uC0AC\uC774\uD074\uD0C0\uC784:i.cycleCounts[t]})),[i]);return i.lead?vn(wn,{sx:fo(c),children:[vn(wn,{sx:{flexShrink:0,mb:1.5,display:"flex",flexDirection:"column",gap:.5},children:[kr(Th,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Lo,summary:i.lead}),kr(Th,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Gi,summary:i.cycle})]}),kr(wn,{sx:ho(c),children:kr(R4,{width:"100%",height:"100%",children:vn(I4,{data:a,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"24%",children:[kr(M4,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),kr(O4,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),kr(D4,{tick:{fontSize:13},width:40,allowDecimals:!1}),kr(A4,{...uo,formatter:r=>`${Number(r??0)}\uAC74`}),kr(E4,{wrapperStyle:{fontSize:13.5}}),kr(Sh,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Lo,radius:[3,3,0,0]}),kr(Sh,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Gi,radius:[3,3,0,0]})]})})})]}):kr(wn,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})}import{jsx as _n,jsxs as Tc}from"react/jsx-runtime";var Mh=460,F4=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function HN({open:e,sprints:p,tasks:b,todayStr:c,initialSprintSeq:i=0,onClose:a}){let[r,t]=Bh(0),[n,l]=Bh(30);P4(()=>{if(!e)return;let d=p.find(g=>g.status==="active")??p[0],u=p.find(g=>g.seq===i)??d;t(u?.seq??0)},[e]);let o=N4(()=>p.find(d=>d.seq===r)??null,[p,r]),s={height:Mh,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0},f=_n(Ih,{label:"\uAE30\uAC04",showLabel:!1,value:String(n),options:F4,onChange:d=>l(Number(d.target.value)||30),sx:{width:280,mb:2,flexShrink:0}});return _n(L4,{open:e,onClose:a,width:680,title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,fixedHeight:Mh,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:_n(es,{sx:s,children:_n(fh,{sprints:p,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Tc(es,{sx:s,children:[_n(Ih,{label:"\uBAA9\uD45C",showLabel:!1,value:r?String(r):"",options:p.map(d=>({value:String(d.seq),label:Fr(d)})),onChange:d=>t(Number(d.target.value)||0),sx:{width:280,mb:2,flexShrink:0}}),o?_n(ph,{sprint:o,tasks:b,todayStr:c,height:"100%"}):_n(es,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694."})]})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:Tc(es,{sx:s,children:[f,_n(_h,{tasks:b,todayStr:c,days:n,height:"100%"})]})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Tc(es,{sx:s,children:[f,_n(Ch,{tasks:b,todayStr:c,days:n,height:"100%"})]})}],actions:{showCancelButton:!1,right:_n(j4,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}})}import{Checkbox as z4,Divider as q4,Menu as $4,MenuItem as Cc}from"@mui/material";import{jsx as ts,jsxs as Eh}from"react/jsx-runtime";function GN({anchorEl:e,candidates:p,selectedNames:b,avatarSrcByName:c,onToggle:i,onClear:a,onClose:r}){return Eh($4,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[p.length===0?ts(Cc,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):p.map(t=>{let n=b.includes(t.name);return Eh(Cc,{onClick:()=>i(t),sx:{fontSize:14,minWidth:170,gap:1},children:[ts(z4,{size:"small",checked:n,sx:{p:0}}),ts(br,{names:[t.name],size:20,avatarSrcByName:c}),t.name]},`${t.accountSeq}-${t.name}`)}),ts(q4,{}),ts(Cc,{disabled:b.length===0,onClick:a,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as H4}from"react";import{ButtonBase as W4,Menu as U4,MenuItem as V4}from"@mui/material";import K4 from"@mui/icons-material/KeyboardArrowDown";import G4 from"@mui/icons-material/Check";import{Fragment as Y4,jsx as Bc,jsxs as Ic}from"react/jsx-runtime";function rj({value:e,onChange:p,options:b}){let[c,i]=H4(null),a=b??Qa,r=Qa.find(t=>t.value===e)?.label??"";return Ic(Y4,{children:[Ic(W4,{onClick:t=>i(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,Bc(K4,{sx:{fontSize:17,color:"#9a9a97"}})]}),Bc(U4,{transitionDuration:0,anchorEl:c,open:!!c,onClose:()=>i(null),children:a.map(t=>Ic(V4,{selected:t.value===e,onClick:()=>{p(t.value),i(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?Bc(G4,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Mc,ButtonBase as X4,Divider as Z4,Popover as J4}from"@mui/material";import Q4 from"@mui/icons-material/Check";import e5 from"@ehfuse/overlay-scrollbar";import{jsx as Fo,jsxs as Ah}from"react/jsx-runtime";var Rh=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function uj({anchorEl:e,value:p,color:b="",onSelect:c,onSelectColor:i,onClose:a}){return Fo(J4,{transitionDuration:0,open:!!e,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:Ah(Mc,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[Fo(e5,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:Fo(Fs,{value:p||Tn,onChange:r=>{c(r),a()}})}),i?Ah(Mc,{sx:{px:1.25,pb:1.25},children:[Fo(Z4,{sx:{mb:1,borderColor:"#efefed"}}),Fo(Mc,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:Rh.map(r=>{let t=(b||Rh[0])===r;return Fo(X4,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${r}`,onClick:()=>i(r),sx:{width:26,height:26,borderRadius:"50%",bgcolor:r,display:"flex",alignItems:"center",justifyContent:"center"},children:t?Fo(Q4,{sx:{fontSize:15,color:"#ffffff"}}):null},r)})})]}):null]})})}import{Box as Ra,ButtonBase as t5}from"@mui/material";import{DateTextField as Oh}from"@ehfuse/mui-form-controls";import{jsx as rs,jsxs as Dh}from"react/jsx-runtime";var r5=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function Ph({fromDate:e,toDate:p,onChange:b}){let c=a=>{if(a<=0){b("","");return}b(Kn(Ea(a)),Kn(new Date))},i=a=>a<=0?!e&&!p:!e||!p?!1:e===Kn(Ea(a))&&p===Kn(new Date);return Dh(Ra,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[rs(Ra,{sx:{display:"flex",alignItems:"center",gap:1.5},children:r5.map(a=>{let r=i(a.months);return rs(t5,{onClick:()=>c(a.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:a.label},a.label)})}),Dh(Ra,{sx:{display:"flex",alignItems:"center",gap:.5},children:[rs(Oh,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:a=>b(a.target.value,p),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),rs(Ra,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),rs(Oh,{value:p,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:a=>b(e,a.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as n5}from"@mui/material";import{jsx as Nh}from"react/jsx-runtime";function vj({anchorEl:e,fromDate:p,toDate:b,onChange:c,onClose:i}){return Nh(n5,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Nh(Ph,{fromDate:p,toDate:b,onChange:c})})}import{Box as o5,ButtonBase as i5,Tab as s5,Tabs as a5}from"@mui/material";import l5 from"@mui/icons-material/Checklist";import c5 from"@mui/icons-material/Face";import u5 from"@mui/icons-material/Publish";import f5 from"@mui/icons-material/NotificationsOutlined";import d5 from"@mui/icons-material/BugReportOutlined";import h5 from"@mui/icons-material/DescriptionOutlined";import p5 from"@mui/icons-material/Inventory2Outlined";import{jsx as nn}from"react/jsx-runtime";function jh(e,p){return p>0?`${e} (${p})`:e}var Oj=[{id:"my",label:"\uC804\uCCB4",icon:nn(l5,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:nn(f5,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:nn(c5,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:nn(u5,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:nn(d5,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:nn(p5,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:nn(h5,{sx:{fontSize:18}}),hideCount:!0}];function m5(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function Dj({items:e,activeTab:p,counts:b,onChange:c,compact:i=!1}){let a=nt(),r=m5(a.tabs),t=e;return i?nn(o5,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let l=p===n.id;return nn(i5,{onClick:()=>c(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:ar(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:l?a.tabs.selectedBg:a.tabs.bg,color:l?a.tabs.selectedColor:a.tabs.color,borderColor:l?a.tabs.selectedBg:a.tabs.borderColor},children:jh(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):nn(a5,{value:p,onChange:(n,l)=>c(l),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>nn(s5,{value:n.id,label:jh(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as g5,useMemo as b5,useState as Ec}from"react";import{Divider as Rc,ListItemIcon as Ar,Menu as Ac,MenuItem as pr}from"@mui/material";import y5 from"@mui/icons-material/OpenInNewOutlined";import x5 from"@mui/icons-material/Check";import v5 from"@mui/icons-material/CheckCircleOutlined";import w5 from"@mui/icons-material/RadioButtonUnchecked";import _5 from"@mui/icons-material/SendOutlined";import k5 from"@mui/icons-material/EventOutlined";import S5 from"@mui/icons-material/PersonOutlineOutlined";import T5 from"@mui/icons-material/ViewKanbanOutlined";import C5 from"@mui/icons-material/ContentCopyOutlined";import B5 from"@mui/icons-material/NextPlanOutlined";import I5 from"@mui/icons-material/ContentPasteOutlined";import M5 from"@mui/icons-material/ShareOutlined";import E5 from"@mui/icons-material/DirectionsRunOutlined";import Lh from"@mui/icons-material/ChevronRight";import R5 from"@mui/icons-material/ArchiveOutlined";import A5 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as O5}from"@ehfuse/alerts";import{Fragment as D5,jsx as ut,jsxs as lr}from"react/jsx-runtime";function uL({target:e,onClose:p,customTabs:b,sprints:c=[],myAccountSeq:i=0,onOpenDetail:a,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:l,onMemberEdit:o,onMoveProject:s,onDuplicate:f,onCreateFollowUp:d,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:v}){let k=Bt(),B=sn(),[O,L]=Ec(null),[R,P]=Ec(null),[j,z]=Ec(null);g5(()=>{e||(L(null),P(null),z(null))},[e]);let N=e?.task??null,S=!!N?.is_notice,C=!!N?.is_event,E=N?!Bn(N,i):!1,h=b5(()=>new Set(b.filter(x=>x.useSprints).map(x=>x.key)),[b]),y=async(x="one")=>{let _=N;if(p(),!_)return;await O5({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:x==="series"?`"${_.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${_.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&v(_.seq,x)},w=()=>{N&&m(N.seq,!N.archived),p()};return lr(D5,{children:[lr(Ac,{open:!!e,onClose:p,transitionDuration:0,anchorReference:k?"none":"anchorPosition",anchorPosition:!k&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...k?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:k?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[lr(pr,{onClick:()=>{N&&a(N),p()},sx:{fontSize:14},children:[ut(Ar,{children:ut(y5,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),lr(pr,{disabled:S?(N?.author_account_seq??0)!==i:(N?.author_account_seq??0)!==i&&(N?.manager_account_seq??0)!==i,onClick:()=>{N&&r(N.seq,!N.completed),p()},sx:{fontSize:14},children:[ut(Ar,{children:N?.completed?ut(w5,{sx:{fontSize:19}}):ut(v5,{sx:{fontSize:19}})}),N?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!S&&t?lr(pr,{disabled:!(N?.manager_account_seq??0)&&(N?.receiver_account_seqs??[]).length===0,onClick:()=>{N&&t(N),p()},sx:{fontSize:14},children:[ut(Ar,{children:ut(_5,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,C?null:ut(Rc,{}),C?null:lr(pr,{disabled:E,onClick:x=>{N&&L({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ut(Ar,{children:ut(k5,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!S&&!C&&o?lr(pr,{onClick:()=>{N&&o(N,"manager"),p()},sx:{fontSize:14},children:[ut(Ar,{children:ut(S5,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,C?null:lr(pr,{disabled:E,onClick:x=>{N&&P({anchorEl:x.currentTarget,task:N})},sx:{fontSize:14},children:[ut(Ar,{children:ut(T5,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(Lh,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut(Rc,{}),f?lr(pr,{disabled:E,onClick:()=>{N&&f(N.seq),p()},sx:{fontSize:14},children:[ut(Ar,{children:ut(C5,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,d&&N&&!N.is_event&&!N.is_notice?lr(pr,{onClick:()=>{N&&d(N.seq),p()},sx:{fontSize:14},children:[ut(Ar,{children:ut(B5,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,lr(pr,{onClick:()=>{N&&(u?u(N):ui(N,k)),p()},sx:{fontSize:14},children:[ut(Ar,{children:k?ut(M5,{sx:{fontSize:19}}):ut(I5,{sx:{fontSize:19}})}),k?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),N&&!N.is_notice&&!N.is_event&&h.has(String(N.tab_key??""))&&g?lr(pr,{onClick:x=>z(x.currentTarget),sx:{fontSize:14},children:[ut(Ar,{children:ut(E5,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(Lh,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,lr(pr,{onClick:w,disabled:E||!N?.archived&&!(N&&Ts(N)),sx:{fontSize:14},children:[ut(Ar,{children:N?.archived?ut(A5,{sx:{fontSize:19}}):ut(R5,{sx:{fontSize:19}})}),N?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut(Rc,{}),lr(pr,{disabled:E,onClick:()=>{y("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Ar,{children:ut(un,{sx:{fontSize:19,color:"#e5484d"}})}),(N?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(N?.repeat_group_key??0)>0?lr(pr,{disabled:E,onClick:()=>{y("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Ar,{children:ut(un,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]}),ut(Lr,{anchorEl:O?.anchorEl??null,open:!!O,date:O?.task.due_date??"",reminder:O?.task.reminder??"none",hideReminder:!!O?.task.completed,centered:k,onClose:()=>{L(null),p()},onDateChange:x=>{O&&n(O.task.seq,x)},onReminderChange:x=>{O&&l?.(O.task.seq,x)}}),lr(Ac,{transitionDuration:0,anchorEl:R?.anchorEl??null,open:!!R,onClose:()=>{P(null),p()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...B,children:[ut(pr,{selected:!R?.task.tab_key,onClick:()=>{R&&s(R.task.seq,""),P(null),p()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(x=>!x.archived).map(x=>ut(pr,{selected:R?.task.tab_key===x.key,onClick:()=>{R&&s(R.task.seq,x.key),P(null),p()},sx:{fontSize:14,minWidth:170},children:x.label},x.key))]}),ut(Ac,{transitionDuration:0,anchorEl:j,open:!!j,onClose:()=>z(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...c.filter(x=>`custom-${x.group_seq}`===String(N?.tab_key??"")).map(x=>({seq:x.seq,label:Fr(x)}))].map(x=>lr(pr,{onClick:()=>{N&&g?.(N.seq,x.seq),z(null),p()},sx:{fontSize:14,minWidth:160,gap:1},children:[x.label,(N?.sprint_seq??0)===x.seq?ut(x5,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},x.seq))})]})}import{Checkbox as P5,Divider as N5,Menu as j5,MenuItem as Fh}from"@mui/material";import{jsx as Aa,jsxs as zh}from"react/jsx-runtime";function mL({anchorEl:e,labelOptions:p,selectedKeys:b,onToggle:c,onClear:i,onClose:a}){return zh(j5,{transitionDuration:0,anchorEl:e,open:!!e,onClose:a,children:[p.map(r=>{let t=b.includes(r.key);return zh(Fh,{onClick:()=>c(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Aa(P5,{size:"small",checked:t,sx:{p:0}}),Aa(Et,{option:r})]},r.key)}),Aa(N5,{}),Aa(Fh,{disabled:b.length===0,onClick:()=>{i(),a()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as L5,Menu as F5,MenuItem as qh}from"@mui/material";import z5 from"@mui/icons-material/Check";import q5 from"@mui/icons-material/SettingsOutlined";import{jsx as Oc,jsxs as Dc}from"react/jsx-runtime";function _L(e){let{anchorEl:p,sprints:b,value:c,onSelect:i,onManage:a,onClose:r}=e;return Dc(F5,{transitionDuration:0,anchorEl:p,open:!!p,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:Fr(t)}))].map(t=>Dc(qh,{onClick:()=>{i(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,c===t.seq?Oc(z5,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),Oc(L5,{}),Dc(qh,{onClick:()=>{r(),a()},sx:{fontSize:14,gap:1},children:[Oc(q5,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var $5={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function H5(e){return $5[e]??"tasks"}var TL={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},$h=["list","calendar","month","card","kanban","sprint","timeline"],W5=["list","card"];function CL(e){let p=H5(e);switch(p){case"notice":return{kind:p,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:p,viewOptions:$h,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:p,viewOptions:W5,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:p,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:p,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:p,viewOptions:$h,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}var U5={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function V5(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function Pc(e){let p=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(p)?`${p.slice(2,4)}.${p.slice(5,7)}.${p.slice(8,10)}`:"-"}function gi(e){let p=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${p(e.getMonth()+1)}-${p(e.getDate())} ${p(e.getHours())}:${p(e.getMinutes())}`}function Nc(e,p){let c=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),i=Pc(e.due_date),a=(e.receiver_names??[]).filter(Boolean).map(t=>String(t).trim()),r=(e.checklist??[]).length?`${(e.checklist??[]).filter(t=>t.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:rr(e).name,projectLabel:e.tab_key?p.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:V5(a),receiverNamesFull:a.join(", "),startDate:Pc(e.start_date),dueDate:i!=="-"&&c?`${i} ${c}`:i,priorityName:U5[String(e.priority??"")]??"",checklist:r,note:String(e.note??"").trim(),completed:!!e.completed}}function Tt(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function K5(e,p){if(e===" ")return p*.3;let b=e.codePointAt(0)??0,c=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return p*(c?1:.55)}function G5(e,p){let b=0;for(let c of String(e??""))b+=K5(c,p);return b}function $r(e,p){let b=String(e??"").trim();if(!b)return["-"];let c=[],i="";for(let a of b){if(a===`
42
+ `){i&&c.push(i),i="";continue}let r=`${i}${a}`;if(r.length>p&&i){c.push(i),i=a;continue}i=r}return i&&c.push(i),c.length>0?c:["-"]}var os=595.28,is=841.89,ss=841.89,as=595.28,mr=28,Hr=96,Or=44,Y5="'Malgun Gothic','\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo','Noto Sans KR',sans-serif",X5="'Batang','\uBC14\uD0D5','AppleMyungjo','Noto Serif KR',serif",ns="#cbd5e1",Z5=[`text { font-family: ${Y5}; fill: #111827; }`,`.doc-title { font-family: ${X5}; font-size: 20px; font-weight: 700; }`,".doc-sub { font-size: 10.5px; fill: #6b7280; }",".doc-meta { font-size: 9.5px; fill: #6b7280; }",".th { font-size: 9.5px; font-weight: 700; fill: #374151; }",".td { font-size: 9px; }",".td.done { fill: #9ca3af; }",".gt { font-size: 10px; font-weight: 700; fill: #1f2937; }",".label { font-size: 9px; fill: #6b7280; }",".value { font-size: 10px; }",".section { font-size: 11.5px; font-weight: 700; fill: #1f2937; }",".pageno { font-size: 9px; fill: #6b7280; }",`.head { fill: #eef2f7; stroke: ${ns}; stroke-width: 0.5; }`,`.group { fill: #f8fafc; stroke: ${ns}; stroke-width: 0.5; }`,`.frame { fill: none; stroke: ${ns}; stroke-width: 0.5; }`,`.hline { stroke: ${ns}; stroke-width: 0.5; }`,`.vline { stroke: ${ns}; stroke-width: 0.5; }`,".bar { fill: #bfdbfe; stroke: #60a5fa; stroke-width: 0.6; }",".bar.done { fill: #e5e7eb; stroke: #cbd5e1; }",".bar.overdue { fill: #fecaca; stroke: #f87171; }"].join("");function Gn(e,p,b){let c=b-mr;return[`<text x="${mr}" y="46" class="doc-title">${Tt(e.documentTitle)}</text>`,`<text x="${mr}" y="66" class="doc-sub">${Tt(e.subtitle)}</text>`,`<text x="${c}" y="42" class="doc-meta" text-anchor="end">${Tt(e.facilityName)}</text>`,`<text x="${c}" y="58" class="doc-meta" text-anchor="end">\uCD9C\uB825 ${Tt(gi(e.printedAt))}${e.printedBy?` \xB7 ${Tt(e.printedBy)}`:""}</text>`,p?`<text x="${c}" y="74" class="doc-meta" text-anchor="end">${Tt(p)}</text>`:""].join("")}function Yn(e){let{width:p,height:b,body:c,pageIndex:i,pageCount:a}=e;return[`<svg xmlns="http://www.w3.org/2000/svg" width="${p}" height="${b}" viewBox="0 0 ${p} ${b}">`,`<style>${Z5}</style>`,`<rect x="0" y="0" width="${p}" height="${b}" fill="#ffffff" />`,c,`<text x="${p/2}" y="${b-22}" class="pageno" text-anchor="middle">${i+1} / ${a}</text>`,"</svg>"].join("")}var Lc=ss,Wh=as,Xn=mr,ls=Lc-mr,us=22,zo=20,qo=22,cs=5,Uh=Hr,Vh=Or,Hh=Wh-46,fs=[{key:"title",label:"\uC81C\uBAA9",width:302,align:"start"},{key:"status",label:"\uC0C1\uD0DC",width:56,align:"middle"},{key:"project",label:"\uD504\uB85C\uC81D\uD2B8",width:72,align:"middle"},{key:"manager",label:"\uCC45\uC784\uC790",width:62,align:"middle"},{key:"receivers",label:"\uCC38\uC870\uC790",width:122,align:"start"},{key:"start",label:"\uC2DC\uC791",width:56,align:"middle"},{key:"due",label:"\uB9C8\uAC10",width:64,align:"middle"},{key:"priority",label:"\uC911\uC694\uB3C4",width:52,align:"middle"}],jc=fs.reduce((e,p,b)=>(e.push(b===0?Xn:e[b-1]+fs[b-1].width),e),[]);function J5(e,p,b){let c=Math.max(2,Math.floor((p-cs*2)/(b*.62))),i=$r(e,c),a=i[0]??"";return i.length>1?`${a.slice(0,Math.max(1,c-1))}\u2026`:a}function Q5(e){let p=[],b=[],c=Uh+us,i=(a,r)=>{p.push(b),b=[],c=Vh+us,a&&(b.push({kind:"group",label:a,count:r,continued:!0}),c+=qo)};for(let a of e){a.label&&(c+qo+zo>Hh&&i("",0),b.push({kind:"group",label:a.label,count:a.rows.length,continued:!1}),c+=qo);for(let r of a.rows)c+zo>Hh&&i(a.label,a.rows.length),b.push({kind:"row",completed:r.completed,values:fs.map(t=>{switch(t.key){case"title":return r.title;case"status":return r.statusName;case"project":return r.projectLabel||"\uAE30\uBCF8";case"manager":return r.managerName||"-";case"receivers":return r.receiverNames||"-";case"start":return r.startDate;case"due":return r.dueDate;default:return r.priorityName||"-"}})}),c+=zo}return p.push(b),p.filter((a,r)=>r===0||a.length>0)}function e6(e,p){let b=[];b.push(`<rect x="${Xn}" y="${p}" width="${ls-Xn}" height="${us}" class="head" />`),fs.forEach((i,a)=>{let r=jc[a],t=i.align==="middle"?r+i.width/2:r+cs;b.push(`<text x="${t}" y="${p+us-7}" class="th" text-anchor="${i.align}">${Tt(i.label)}</text>`)});let c=p+us;for(let i of e){if(i.kind==="group"){b.push(`<rect x="${Xn}" y="${c}" width="${ls-Xn}" height="${qo}" class="group" />`,`<text x="${Xn+cs}" y="${c+qo-7}" class="gt">${Tt(i.continued?`${i.label} (\uC774\uC5B4\uC11C)`:i.label)}</text>`,`<text x="${ls-cs}" y="${c+qo-7}" class="gt" text-anchor="end">${i.count}\uAC74</text>`),c+=qo;continue}fs.forEach((a,r)=>{let t=jc[r],n=a.align==="middle"?t+a.width/2:t+cs;b.push(`<text x="${n}" y="${c+zo-6}" class="${i.completed?"td done":"td"}" text-anchor="${a.align}">${Tt(J5(i.values[r]??"",a.width,9))}</text>`)}),b.push(`<line x1="${Xn}" y1="${c+zo}" x2="${ls}" y2="${c+zo}" class="hline" />`),c+=zo}return jc.slice(1).forEach(i=>{b.push(`<line x1="${i}" y1="${p}" x2="${i}" y2="${c}" class="vline" />`)}),b.push(`<rect x="${Xn}" y="${p}" width="${ls-Xn}" height="${c-p}" class="frame" />`),b.join("")}async function t6(e,p){let b=Q5(p),c=p.reduce((i,a)=>i+a.rows.length,0);return b.map((i,a)=>{let r=a===0?Uh:Vh,t=[a===0?Gn(e,`\uC804\uCCB4 ${c}\uAC74`,Lc):"",e6(i,r)].join("");return Yn({width:Lc,height:Wh,body:t,pageIndex:a,pageCount:b.length})})}var zc=os,Kh=is,kn=mr,Oa=zc-mr,r6=Kh-46,Gh=22,n6=68,o6=(Oa-kn)/2,i6=14,Fc=58;function bi(e){switch(e.kind){case"title":return 34;case"props":return Math.ceil(e.pairs.length/2)*Gh+10;case"section":return 26;default:return i6}}function s6(e){let p=[{kind:"title",text:e.title,ticket:e.ticketNo}];return p.push({kind:"props",pairs:e.properties}),p.push({kind:"section",text:"\uB0B4\uC6A9"}),(e.content.trim()?e.content.split(`
43
+ `).flatMap(c=>c.trim()?$r(c,Fc):[""]):["(\uB0B4\uC6A9 \uC5C6\uC74C)"]).forEach(c=>p.push({kind:"line",text:c,muted:!e.content.trim()})),e.checklist.length>0&&(p.push({kind:"section",text:`\uD560\uC77C (${e.checklist.filter(c=>c.checked).length}/${e.checklist.length})`}),e.checklist.forEach(c=>{$r(c.label,Fc-3).forEach((i,a)=>p.push({kind:a===0?"check":"line",text:i,checked:c.checked}))})),e.includeComments&&e.comments.length>0&&(p.push({kind:"section",text:`\uB313\uAE00 (${e.comments.length})`}),e.comments.forEach(c=>{p.push({kind:"line",text:`${c.author} \xB7 ${c.time}`,muted:!0}),$r(c.text,Fc).forEach(i=>p.push({kind:"line",text:i}))})),p}function a6(e){let p=[],b=[],c=Hr;for(let i of e){let a=bi(i);c+a>r6&&(p.push(b),b=[],c=Or),b.push(i),c+=a}return p.push(b),p}function l6(e,p){switch(e.kind){case"title":{let b=e.ticket?`<text x="${Oa}" y="${p+16}" class="doc-meta" text-anchor="end">${Tt(e.ticket)}</text>`:"";return{markup:`<text x="${kn}" y="${p+16}" class="section" style="font-size:14px">${Tt(e.text)}</text>${b}<line x1="${kn}" y1="${p+24}" x2="${Oa}" y2="${p+24}" class="hline" />`,nextY:p+bi(e)}}case"props":{let b=[];return e.pairs.forEach((c,i)=>{let a=i%2,r=Math.floor(i/2),t=kn+a*o6,n=p+r*Gh;b.push(`<text x="${t}" y="${n+14}" class="label">${Tt(c.label)}</text>`,`<text x="${t+n6}" y="${n+14}" class="value">${Tt($r(c.value||"-",26)[0]??"-")}</text>`)}),{markup:b.join(""),nextY:p+bi(e)}}case"section":return{markup:`<text x="${kn}" y="${p+16}" class="section">${Tt(e.text)}</text><line x1="${kn}" y1="${p+21}" x2="${Oa}" y2="${p+21}" class="hline" />`,nextY:p+bi(e)};case"check":return{markup:`<text x="${kn}" y="${p+10}" class="td">${e.checked?"\u2611":"\u2610"}</text><text x="${kn+14}" y="${p+10}" class="${e.checked?"td done":"td"}">${Tt(e.text)}</text>`,nextY:p+bi(e)};default:return{markup:`<text x="${kn}" y="${p+10}" class="${e.muted?"td done":"td"}">${Tt(e.text)}</text>`,nextY:p+bi(e)}}}async function c6(e,p){let b=a6(s6(p));return b.map((c,i)=>{let a=i===0?Hr:Or,r=[i===0?Gn(e,"",zc):`<text x="${kn}" y="${Or-12}" class="doc-meta">${Tt(`${p.title} (\uC774\uC5B4\uC11C)`)}</text>`];for(let t of c){let n=l6(t,a);r.push(n.markup),a=n.nextY}return Yn({width:zc,height:Kh,body:r.join(""),pageIndex:i,pageCount:b.length})})}var $c=ss,Xh=as,Da=mr,ds=$c-mr,Yh=Xh-46,u6=210,po=20,qc=24;function mo(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let p=new Date(`${e}T00:00:00`);return Number.isNaN(p.getTime())?null:p}function Zh(e,p){return Math.round((p.getTime()-e.getTime())/864e5)}function f6(e,p){let b=[];e.forEach(r=>{let t=mo(r.startDate),n=mo(r.dueDate);t&&b.push(t),n&&b.push(n)});let c=mo(p)??new Date;if(b.length===0)return{start:c,days:30};let i=new Date(Math.min(...b.map(r=>r.getTime()))),a=new Date(Math.max(...b.map(r=>r.getTime())));return i.setDate(i.getDate()-1),a.setDate(a.getDate()+1),{start:i,days:Math.max(7,Zh(i,a)+1)}}async function d6(e,p,b){let c=f6(p,b),i=Da+u6,r=(ds-i)/c.days,t=mo(b),n=d=>i+Zh(c.start,d)*r,l=Math.max(1,Math.floor((Yh-Hr-qc)/po)),o=Math.max(1,Math.floor((Yh-Or-qc)/po)),s=[],f=0;for(;f<p.length||s.length===0;){let d=s.length===0?l:o;if(s.push(p.slice(f,f+d)),f+=d,f>=p.length)break}return s.map((d,u)=>{let g=u===0?Hr:Or,m=[u===0?Gn(e,`\uC804\uCCB4 ${p.length}\uAC74`,$c):""],v=g+qc;m.push(`<line x1="${Da}" y1="${v}" x2="${ds}" y2="${v}" class="vline" />`);for(let k=0;k<c.days;k+=1){let B=new Date(c.start);if(B.setDate(B.getDate()+k),B.getDay()!==0&&k!==0)continue;let O=i+k*r;m.push(`<line x1="${O}" y1="${v}" x2="${O}" y2="${v+d.length*po}" class="hline" />`,`<text x="${O+2}" y="${v-6}" class="label">${B.getMonth()+1}.${B.getDate()}</text>`)}if(t&&t>=c.start){let k=n(t);k>=i&&k<=ds&&m.push(`<line x1="${k}" y1="${v}" x2="${k}" y2="${v+d.length*po}" stroke="#f87171" stroke-width="0.8" />`)}return d.forEach((k,B)=>{let O=v+B*po,L=$r(k.title,24)[0]??"";m.push(`<text x="${Da}" y="${O+14}" class="${k.completed?"td done":"td"}">${Tt(L)}</text>`,`<text x="${i-6}" y="${O+14}" class="label" text-anchor="end">${Tt(k.managerName)}</text>`,`<line x1="${Da}" y1="${O+po}" x2="${ds}" y2="${O+po}" class="hline" />`);let R=mo(k.startDate)??mo(k.dueDate),P=mo(k.dueDate)??mo(k.startDate);if(!R||!P)return;let j=n(R),z=Math.max(j+r*.8,n(P)+r*.8),N=k.completed?"bar done":k.overdue?"bar overdue":"bar";m.push(`<rect x="${j}" y="${O+5}" width="${Math.max(3,Math.min(z,ds)-j)}" height="${po-10}" rx="2" class="${N}" />`)}),Yn({width:$c,height:Xh,body:m.join(""),pageIndex:u,pageCount:s.length})})}function h6(e,p,b,c){return{title:e.title,managerName:e.managerName,startDate:String(p??"").slice(0,10),dueDate:String(b??"").slice(0,10),completed:e.completed,overdue:!e.completed&&!!b&&String(b).slice(0,10)<c}}var Wc=os,Qh=is,hs=mr,Hc=Wc-mr,Jh=Qh-46,ps=30,yi=18;function p6(e){let p=[],b=[],c=Hr,i=(a,r)=>{p.push(b),b=[],c=Or,a&&(b.push({kind:"column",label:a,summary:r,continued:!0}),c+=ps)};for(let a of e){if(c+ps+yi>Jh&&i("",""),b.push({kind:"column",label:a.label,summary:a.summary,continued:!1}),c+=ps,a.items.length===0){b.push({kind:"empty"}),c+=yi;continue}for(let r of a.items)c+yi>Jh&&i(a.label,a.summary),b.push({kind:"item",title:r.title,meta:r.meta,completed:r.completed}),c+=yi}return p.push(b),p}async function m6(e,p,b){let c=p6(p);return c.map((i,a)=>{let r=a===0?Hr:Or,t=[a===0?Gn(e,b,Wc):""];for(let n of i){if(n.kind==="column"){t.push(`<rect x="${hs}" y="${r}" width="${Hc-hs}" height="${ps-6}" class="group" />`,`<text x="${hs+6}" y="${r+16}" class="gt">${Tt(n.continued?`${n.label} (\uC774\uC5B4\uC11C)`:n.label)}</text>`,`<text x="${Hc-6}" y="${r+16}" class="label" text-anchor="end">${Tt(n.summary)}</text>`),r+=ps;continue}if(n.kind==="empty"){t.push(`<text x="${hs+12}" y="${r+12}" class="td done">(\uC5C5\uBB34 \uC5C6\uC74C)</text>`),r+=yi;continue}t.push(`<text x="${hs+12}" y="${r+12}" class="${n.completed?"td done":"td"}">${Tt($r(n.title,46)[0]??"")}</text>`,`<text x="${Hc-6}" y="${r+12}" class="label" text-anchor="end">${Tt(n.meta)}</text>`),r+=yi}return Yn({width:Wc,height:Qh,body:t.join(""),pageIndex:a,pageCount:c.length})})}var g6=[{header:"\uADF8\uB8F9",width:16},{header:"\uC81C\uBAA9",width:44},{header:"\uC0C1\uD0DC",width:10},{header:"\uD504\uB85C\uC81D\uD2B8",width:14},{header:"\uCC45\uC784\uC790",width:10},{header:"\uCC38\uC870\uC790",width:22},{header:"\uC2DC\uC791",width:12},{header:"\uB9C8\uAC10",width:14},{header:"\uC911\uC694\uB3C4",width:8},{header:"\uD560\uC77C",width:8},{header:"\uBE44\uACE0",width:30}],b6="FFEEF2F7",Pa="FFCBD5E1";function y6(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()||"\uC5C5\uBB34\uBAA9\uB85D"}async function x6(e,p){let b=await Promise.resolve().then(()=>cp(tp(),1)),c=new b.Workbook,i=c.addWorksheet("\uC5C5\uBB34\uBAA9\uB85D",{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0,fitToWidth:1,fitToHeight:0}});i.columns=g6.map(o=>({header:o.header,width:o.width})),i.spliceRows(1,0,[`${e.documentTitle}`],[`${e.subtitle} \xB7 ${e.facilityName} \xB7 \uCD9C\uB825 ${gi(e.printedAt)}${e.printedBy?` \xB7 ${e.printedBy}`:""}`]),i.getRow(1).font={bold:!0,size:14},i.getRow(2).font={size:10,color:{argb:"FF6B7280"}};let a=i.getRow(3);a.font={bold:!0,size:10},a.eachCell(o=>{o.fill={type:"pattern",pattern:"solid",fgColor:{argb:b6}},o.alignment={vertical:"middle",horizontal:"center"}}),p.forEach(o=>{o.rows.forEach(s=>{let f=i.addRow([o.label,s.title,s.statusName,s.projectLabel||"\uAE30\uBCF8",s.managerName,s.receiverNamesFull,s.startDate==="-"?"":s.startDate,s.dueDate==="-"?"":s.dueDate,s.priorityName,s.checklist,s.note]);f.font={size:10,color:{argb:s.completed?"FF9CA3AF":"FF111827"}},f.alignment={vertical:"middle",wrapText:!1}})});let r=i.rowCount;for(let o=3;o<=r;o+=1)i.getRow(o).eachCell({includeEmpty:!0},s=>{s.border={top:{style:"thin",color:{argb:Pa}},left:{style:"thin",color:{argb:Pa}},bottom:{style:"thin",color:{argb:Pa}},right:{style:"thin",color:{argb:Pa}}}});i.views=[{state:"frozen",ySplit:3}];let t=await c.xlsx.writeBuffer(),n=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),l=gi(e.printedAt).replace(/[: ]/g,"").slice(0,13);return{blob:n,fileName:`${y6(e.documentTitle)}_${l}.xlsx`}}function v6(e){return String(e??"").replace(/<br\s*\/?>(?=.)/gi,`
44
+ `).replace(/<\/(p|div|li|h[1-6])>/gi,`
45
+ `).replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function w6(e,p){let b=Nc(e,p);return{title:b.title,ticketNo:String(e.ticket_no??"").trim(),properties:[{label:"\uC0C1\uD0DC",value:b.statusName},{label:"\uD504\uB85C\uC81D\uD2B8",value:b.projectLabel||"\uAE30\uBCF8"},{label:"\uCC45\uC784\uC790",value:b.managerName},{label:"\uCC38\uC870\uC790",value:b.receiverNamesFull},{label:"\uC2DC\uC791\uC77C\uC2DC",value:b.startDate},{label:"\uB9C8\uAC10\uC77C\uC2DC",value:b.dueDate},{label:"\uC911\uC694\uB3C4",value:b.priorityName},{label:"\uC791\uC131\uC790",value:String(e.created_by??"")}],content:v6(e.content),checklist:(e.checklist??[]).map(c=>({label:String(c.label??""),checked:!!c.checked})),comments:(e.comments??[]).map(c=>({author:String(c.author??""),time:String(c.time??""),text:String(c.text??"")})),includeComments:!0}}export{NS as ALL_TASK_VIEWER_ACCOUNT_SEQS,fd as AddLabelDialog,zs as AddTabDialog,ad as AttachmentUploadGauge,Zl as AttachmentUploadPercent,Va as BUG_DEVICE_OPTIONS,Si as BUG_ICON_COLOR,K8 as BUG_KANBAN_COLUMNS,Ua as BUG_REPRO_OPTIONS,Ka as BUG_RESOLUTION_OPTIONS,xo as BUG_STATUS_OPTIONS,ki as BUG_TASK_ICON,ua as BugPropertiesGrid,Ig as COLUMN_WIDTHS,Ya as COMPLETED_STATUS_OPTION,Or as CONT_BODY_TOP,gc as CUSTOM_TAB_KEY_PREFIX,LP as CalendarImportDialog,VP as CalendarSubscribeDialog,to as CommentBubbleIcon,Yo as ConfirmCountButton,_h as CumulativeFlowChart,qu as DATE_REMINDER_OPTIONS,Hx as DEFAULT_COMPACT_COLUMNS,Fa as DEFAULT_PROJECT_ICON,Oj as DEFAULT_TASKBOX_TAB_ITEMS,Tn as DEFAULT_TASK_ICON,Wl as DRAWER_SECTION_TITLE_FONT_SIZE,vj as DateRangeFilterPopover,qr as DrawerSection,Lr as DueDatePickerPopover,ag as ENDED_EVENT_STATUS_OPTION,wd as EVENT_ICON_COLOR,tr as EVENT_TASK_ICON,tN as EmployeeSelectDialog,Hr as FIRST_BODY_TOP,Qa as GROUP_BY_OPTIONS,Qo as GoogleEventChip,rj as GroupByMenuButton,Fs as IconPickerGrid,Kf as InlineAddressInput,$n as InlineTextValue,Xa as KANBAN_CLOSED_COLUMN_KEY,as as LANDSCAPE_HEIGHT,ss as LANDSCAPE_WIDTH,mL as LabelFilterMenu,xa as LabelSelectMenu,Ch as LeadTimeDistributionChart,Ci as MANUAL_TASK_STATUS_OPTIONS,mr as MARGIN_X,GN as MemberFilterMenu,Ti as NOTICE_STATUS_OPTIONS,Kt as NOTICE_TASK_ICON,iu as NO_TASK_ICON,is as PORTRAIT_HEIGHT,os as PORTRAIT_WIDTH,za as PROJECT_ICON_OPTIONS,at as PropertyRow,Go as RECEIVER_AVATAR_COLORS,$u as REMINDER_OPTIONS,br as ReceiverAvatarStack,zd as RelatedTasksSection,k6 as STATUS_KEY_REPLIED,Yc as STATUS_KEY_WAITING,Yu as SortableTaskCard,ph as SprintBurndownChart,HN as SprintChartsDialog,_L as SprintFilterMenu,IP as SprintManageDialog,fh as SprintVelocityChart,Vo as StatusSelectMenu,rl as TASKBOX_COLUMNS,Gr as TASKBOX_DRAWER_NARROW_MQ,su as TASKBOX_UI_STATE_ID,TL as TASKBOX_VIEW_LABELS,DB as TASKBOX_VIEW_MODES,Li as TASK_REPEAT_RULE_OPTIONS,yo as TASK_STATUS_OPTIONS,Bb as TIME_REMINDER_OPTIONS,Hs as TaskAckListPopover,an as TaskActionButton,Ca as TaskActivityDialog,ba as TaskAttachmentsSection,Df as TaskBoxColumnSummary,KI as TaskBoxCompactTable,wl as TaskBoxGroupBoard,wI as TaskBoxMobileList,Cf as TaskBoxMonthAgenda,wf as TaskBoxMonthCalendar,GB as TaskBoxSprintColumnSummary,Vu as TaskBoxTable,Dj as TaskBoxTabs,Af as TaskBoxTimeline,OB as TaskBoxView,gf as TaskBoxWeekCalendar,Ri as TaskCardContent,ha as TaskChecklistSection,Ed as TaskCommentInput,Md as TaskCommentsSection,fa as TaskContentEditor,uL as TaskContextMenu,ca as TaskCorePropertiesGrid,rc as TaskCreateBody,CA as TaskCreateDrawer,Ph as TaskDateRangeFilter,Kd as TaskDetailBody,mP as TaskDetailDrawer,Pd as TaskDetailHeader,uj as TaskIconPickerPopover,Qn as TaskLabelChips,da as TaskLinkDialog,Nd as TaskNoteField,Ir as TaskPriorityChip,Et as TaskStatusChip,tS as TaskStatusChips,hp as TaskboxProvider,j3 as buildCalendarFeedUrl,Us as buildCardBaseSx,xh as buildCumulativeFlow,vh as buildLeadCycleDistribution,hu as buildStatusOptionColors,m6 as buildTaskColumnsPrintSvgPages,w6 as buildTaskDetailPrintData,c6 as buildTaskDetailPrintSvgPages,el as buildTaskGroupSections,t6 as buildTaskListPrintSvgPages,x6 as buildTaskListXlsx,ac as buildTaskRelationsModel,Ow as buildTaskShareText,d6 as buildTaskTimelinePrintSvgPages,ks as buildTaskboxTheme,_u as canAssignBugManager,Rs as canClaimTaskItem,ku as canCompleteTaskItem,Bn as canEditTaskItem,Es as canViewTaskItem,As as canVolunteerTaskItem,lc as countTaskRelations,Pf as countWorkdays,ng as createTaskboxTheme,Of as daysLeftUntil,ia as defaultRepeatUntil,qa as defaultTaskBoxFormValues,$a as defaultTaskboxUiStateValues,Tt as escapePrintXml,G5 as estimatePrintTextWidth,gd as filterFilesWithinLimit,H7 as formatConfirmTime,qB as formatHours,jr as formatKoreanDate,Mr as formatKoreanDateTime,Pc as formatPrintDate,gi as formatPrintStamp,Fr as formatSprintOptionLabel,fu as getBugDeviceName,uu as getBugReproName,Ss as getBugResolutionName,lg as getBugStatusOption,gN as getDefaultDateRange,Bi as getEventDisplayStatusOption,Y8 as getNoDueStatusRank,md as getNoticeAckInfo,du as getNoticeStatusOption,AR as getNoticeTargetDisplay,x8 as getProjectIconAnchorComponent,bt as getProjectIconComponent,fl as getReminderLabel,ul as getReminderOptions,oa as getRepeatRuleLabel,Bs as getStatusOptionsForTask,CL as getTabHeaderConfig,ol as getTaskBoxColumnDefs,bu as getTaskBoxGridTemplate,H5 as getTaskBoxTabKind,Ws as getTaskConfirmInfo,rr as getTaskDisplayStatusOption,Cs as getTaskStatusOption,Xo as groupGoogleEventsByDate,bc as groupSeqFromTabKey,NO as hasRelation,Ld as hasTaskRelations,H2 as htmlToPlainText,w3 as isCustomTabKey,bh as isFlowTask,wu as isOpenPoolTaskItem,Ga as isPastEvent,Ts as isTaskDone,G8 as isWaitingTask,Ea as monthsAgoDate,gn as narrowOrderSx,pP as nowDateTimeString,mx as parseEstimatedHours,_c as parseTaskTimeMs,Oo as relationsOf,Gn as renderPrintHeader,Uo as resolveTaskStatusOptions,Wa as resolveTaskboxTheme,VI as selectDepartmentSharedTasks,ui as shareTaskText,$B as sumRemainingHours,va as summarizeNoticeTargets,yP as tabKeyFromGroupSeq,Wr as taskVisibilityOf,Nc as toTaskPrintRow,h6 as toTimelinePrintRow,Kn as toYmd,Is as toggleLabelKey,wi as useBuildFileUrl,sd as useTaskAttachmentUploadMeta,Br as useTaskboxConfig,J0 as useTaskboxForm,nt as useTaskboxTheme,Cn as useTaskboxUiState,_i as useUploadMaxMb,Yt as wideColumnSx,Yn as wrapPrintPage,$r as wrapPrintText};
46
+ /*! Bundled license information:
47
+
48
+ exceljs/dist/exceljs.min.js:
49
+ (*! ExcelJS 19-10-2023 *)
50
+ (*!
51
+ * The buffer module from node.js, for the browser.
52
+ *
53
+ * @author Feross Aboukhadijeh <https://feross.org>
54
+ * @license MIT
55
+ *)
56
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
57
+ (*!
58
+
59
+ JSZip v3.10.1 - A JavaScript class for generating and reading zip files
60
+ <http://stuartk.com/jszip>
61
+
62
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
63
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
64
+
65
+ JSZip uses the library pako released under the MIT license :
66
+ https://github.com/nodeca/pako/blob/main/LICENSE
67
+ *)
68
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
69
+ (**
70
+ * Character classes and associated utilities for the 5th edition of XML 1.0.
71
+ *
72
+ * @author Louis-Dominique Dubeau
73
+ * @license MIT
74
+ * @copyright Louis-Dominique Dubeau
75
+ *)
76
+ (**
77
+ * Character classes and associated utilities for the 2nd edition of XML 1.1.
78
+ *
79
+ * @author Louis-Dominique Dubeau
80
+ * @license MIT
81
+ * @copyright Louis-Dominique Dubeau
82
+ *)
83
+ (**
84
+ * Character class utilities for XML NS 1.0 edition 3.
85
+ *
86
+ * @author Louis-Dominique Dubeau
87
+ * @license MIT
88
+ * @copyright Louis-Dominique Dubeau
89
+ *)
90
+ */
14
91
  //# sourceMappingURL=index.esm.js.map