1"use strict";(self.webpackChunkshop_react_web=self.webpackChunkshop_react_web||[]).push([[9119],{78292:(e,t,s)=>{s.d(t,{A:()=>a});s(65043);const a=s.p+"static/media/ico_apple_store.5b758bd864049543e124551353993c44.svg"},82332:(e,t,s)=>{s.d(t,{A:()=>a});s(65043);const a=s.p+"static/media/ico_google_play.88d6e67a5a0990ececad6c8044f8e55e.svg"},99436:(e,t,s)=>{s.d(t,{A:()=>a});s(65043);const a=s.p+"static/media/img_toast_etc.aa846d0f0b631ef3cff2061603bd20c2.svg"},75602:(e,t,s)=>{s.d(t,{A:()=>n});var a=s(23175),i=s(70579);const n=e=>{let{width:t=24,height:s=24,$widthWt:n,$heightWt:o,stroke:r="var(--color-gray-400)"}=e;return(0,i.jsxs)(a.E,{width:t,height:s,$widthWt:n,$heightWt:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M11.6611 18.275C16.0289 18.275 19.5722 14.727 19.5722 10.3472C19.5722 5.96746 16.0289 2.41943 11.6611 2.41943C7.29327 2.41943 3.75 5.96746 3.75 10.3472C3.75 14.727 7.29327 18.275 11.6611 18.275Z",stroke:r,strokeWidth:"1.5"}),(0,i.jsx)("path",{d:"M16.8779 16.5464L20.9987 21.1696",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},25946:(e,t,s)=>{s.r(t),s.d(t,{default:()=>ps});var a=s(65043),i=s(73216),n=s(46655),o=s(97605),r=s(28007),l=s(2907),d=s(56036),c=s(91668),p=s(399),h=s(59116),u=s(35509),f=s(57377),g=s(56743);const m=[{value:g.R4.DAILY,text:"\uc77c\uac04"},{value:g.R4.WEEKLY,text:"\uc8fc\uac04"},{value:g.R4.MONTHLY,text:"\uc6d4\uac04"}],v=[{value:g.H8.MEAL,text:"\uc2dd\uc0ac"},{value:g.H8.MEETING,text:"\ubbf8\ud305"},{value:g.H8.TRAINING,text:"\uad50\uc721"},{value:g.H8.FIELD_WORK,text:"\ucd9c\uc7a5"},{value:g.H8.ETC,text:"\uae30\ud0c0"}];var x=s(48120),S=s(24678);const D=s.p+"static/media/ico_quick_reservation.5f2c328c7569c15f0c94c0e3a37b6c8e.svg";const y=s.p+"static/media/ico_normal_reservation.0d5aedde2de0df47a8b6ed38d53a3c47.svg";const w=s.p+"static/media/ico_restrict_reservation.ed1def072004c254b9e3798270ebb90a.svg";var j=s(42040),k=s(29079),T=s(11177),b=s(7685),C=s(86047),I=s(95100),L=s(28568),O=s(9088),E=s(92858),R=s(70579);const $=e=>{const{setNewReservationPopup:t,newReservationPopupPosition:s,calendarScheduleParams:i,isFromDraggableCalendar:r}=e,l=(0,j.A)((e=>e.storedShopWithUserInfo)),{tempSelectedRange:d,setSelectedRange:c}=(0,k.A)((0,n.k)((e=>({tempSelectedRange:e.tempSelectedRange,setSelectedRange:e.setSelectedRange})))),g=(0,O.A)((e=>e.resetForm)),{setIsDrawerOpen:m,setIsBlockOpen:v,isDrawerOpen:$,isBlockOpen:A,setSelectedReservationId:N,resetBlockRuleId:P,hasDirty:W,setIsDetailMode:M}=(0,C.A)((0,n.k)((e=>({setIsDrawerOpen:e.setIsDrawerOpen,setIsBlockOpen:e.setIsBlockOpen,isDrawerOpen:e.isDrawerOpen,isBlockOpen:e.isBlockOpen,setSelectedReservationId:e.setSelectedReservationId,resetBlockRuleId:e.resetBlockRuleId,hasDirty:e.hasDirty,setIsDetailMode:e.setIsDetailMode})))),H=(0,E.E)((e=>e.isUnderWideTabletScreen));(0,E.e)();const{postReservation:z,reservationDetailData:B,isPendingSubmit:F,setIsPendingSubmit:V}=(0,T.A)(),{shopDepositDto:_,setIsFetchShopDeposit:U}=(0,I.A)(),[Y,K]=(0,a.useState)(!1),[G,q]=(0,a.useState)(!1),[Q,Z]=(0,a.useState)(!1),{initialReservationStart:J,initialReservationEnd:X}=(0,b.xR)(),ee=()=>t(!1),te=()=>{d&&c({start:null===d||void 0===d?void 0:d.start,end:null===d||void 0===d?void 0:d.end,staffId:d.staffId}),A&&(v(!1),P()),$&&N(null),ee(),M(!1),m(!0)},se=()=>{d&&c({start:null===d||void 0===d?void 0:d.start,end:null===d||void 0===d?void 0:d.end,staffId:d.staffId}),N(null),A&&P(),$&&m(!1),ee(),v(!0)};(0,a.useEffect)((()=>{U(!0)}),[]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(o.G2,{top:s?"".concat(s.top,"px"):"48px",left:s?"".concat(s.left,"px"):H?"calc(-50% - 24px)":"-50%",width:"150px",direction:"column",background:"var(--color-white)",$boxShadow:"0px 2px 16px 0px rgba(0, 0, 0, 0.10)",radius:x.A.corner16,$zIndex:S.A.zIndexDialog,children:[r&&d&&(0,R.jsx)(o.pT,{radius:"16px 16px 0 0",padding:"8px 20px",width:"100%",background:"var(--color-primary-400)",justify:"flex-start",children:(0,R.jsxs)(p.x5,{color:"var(--color-white)",fontWeight:h.sO.medium,children:[(0,f.vF)(null===d||void 0===d?void 0:d.start)," ~"," ",(0,f.vF)(null===d||void 0===d?void 0:d.end)]})}),(0,R.jsxs)(o.pT,{width:"100%",padding:"10px 20px",justify:"space-between",$hasCursor:!0,$hoverBackgroun
1d:"var(--color-gray-50)",$activeBackground:"var(--color-gray-100)",radius:r&&d?"":"16px 16px 0 0",onClick:F?void 0:()=>{V(!0);const e=new Date;z({staffId:null!==d&&void 0!==d&&d.staffId?null===d||void 0===d?void 0:d.staffId:l.shopStaffId,startTime:d?(0,b.Ut)(d.start):(0,b.$l)(e,J),endTime:d?(0,b.Ut)(d.end):(0,b.$l)(e,X),deposit:_&&_.isUse?_.depositAmount:0},i,ee)},children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-600)",children:"\ube60\ub978 \uc608\uc57d"}),(0,R.jsx)(u.Oi,{children:(0,R.jsx)("img",{src:D,alt:"\ube60\ub978\uc608\uc57d"})})]}),(0,R.jsxs)(o.pT,{width:"100%",padding:"10px 20px",justify:"space-between",$hasCursor:!0,$hoverBackground:"var(--color-gray-50)",$activeBackground:"var(--color-gray-100)",onClick:()=>(Z(!1),W&&A?q(!0):W&&$?K(!0):void te()),children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-600)",children:"\uc608\uc57d \ub4f1\ub85d"}),(0,R.jsx)(u.Oi,{children:(0,R.jsx)("img",{src:y,alt:"\uc608\uc57d\ub4f1\ub85d"})})]}),(0,R.jsxs)(o.pT,{width:"100%",padding:"10px 20px",justify:"space-between",$hasCursor:!0,$hoverBackground:"var(--color-gray-50)",$activeBackground:"var(--color-gray-100)",radius:"0 0 16px 16px",onClick:()=>(Z(!0),W&&A?q(!0):W&&$?K(!0):void se()),children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-600)",children:"\uc608\uc57d \uc81c\ud55c"}),(0,R.jsx)(u.Oi,{children:(0,R.jsx)("img",{src:w,alt:"\uc608\uc57d\uc81c\ud55c"})})]})]}),(0,R.jsx)(L.A,{modal:Y,setModal:K,onSubmit:()=>{K(!1),null===g||void 0===g||g(),Q?se():te()},description:B?"\uc608\uc57d \uc218\uc815\uc744 \ucde8\uc18c\ud560\uae4c\uc694?":"\uc608\uc57d \ub4f1\ub85d\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"}),(0,R.jsx)(L.A,{modal:G,setModal:q,onSubmit:()=>{q(!1),null===g||void 0===g||g(),Q?se():te()},description:"\uc608\uc57d \uc81c\ud55c\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"})]})};var A=s(2690);const N=s.p+"static/media/ico_month_type_today_calendar_default.e49a0611c767a8c8857bcd2da6b64a6c.svg";const P=s.p+"static/media/ico_month_type_today_calendar_hover.7500d80c3b0997ce9feae2188af6743f.svg";var W=s(79741),M=s(29044),H=s(15132),z=s(3845),B=s(65612),F=s(49684),V=s(29875),_=s(40186),U=s(28797);const Y=e=>{const{isOneOwnerShop:t,selectedStaffCheckList:s,setSelectedStaffCheckList:i,staffPreviewList:n,staffIdList:r,myStaffId:l,setIsClearSelectedStaffCheckList:d}=e,c=(0,a.useRef)(null),[u,f]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),(0,R.jsx)(R.Fragment,{children:t?(0,R.jsxs)(o.pT,{width:"72px",justify:"start",gap:"8px",padding:"1px",radius:x.A.corner40,border:"1px solid var(--color-gray-200)",background:"var(--color-white)",$flexShrink:"0",children:[(0,R.jsx)(o.pT,{background:"#".concat(n[0].staffMainColor),padding:"1px 7px",radius:x.A.corner50,$minWidth:"38px",$minHeight:"38px",$minWidthWt:"34px",$minHeightWt:"34px",children:(0,R.jsx)(p.ld,{color:"var(--color-white)",fontSize:h.$N.size18,fontWeight:h.sO.medium,$lineHeight:h.kj.height26,$fontSizeWt:h.$N.size14,$lineHeightWt:h.kj.height22,children:(0,b.Od)(n[0].staffName)})}),(0,R.jsx)(p.ld,{fontWeight:h.sO.regular,color:"var(--color-gray-600)",$fontSizeWt:h.$N.size14,$lineHeightWt:h.kj.height22,children:"1"})]}):(0,R.jsxs)(V.SR,{width:"104px",$widthWt:"98px",radius:x.A.corner40,ref:c,margin:0===s.length?"0px":s.length<3?"0 0 0 ".concat(30*(s.length-1),"px"):"0 0 0 60px",$marginWt:0===s.length?"0px":s.length<3?"0 0 0 ".concat(24*(s.length-1),"px"):"0 0 0 48px",children:[(0,R.jsxs)(V.Ks,{height:"42px",padding:"8px 24px 8px 2px",$heightWt:"38px",$paddingWt:"6px 24px 6px 0",radius:x.A.corner40,onClick:()=>f((e=>!e)),overflow:"visible",children:[(0,R.jsx)(o.pT,{position:"relative",children:0===s.length?(0,R.jsx)(U.A,{background:"var(--color-gray-300)",staffName:"",right:"-38px",$rightWt:"-36px"}):n.filter((e=>s.includes(e.staffId))).slice(0,3).map(((e,t)=>(0,R.jsx)(U.A,{background:"#".concat(e.staffMainColor),staffName:e.staffName,right:"".concat(30*t-38,"px"),$rightWt:"".concat(26*t-36,"px")},e.staffId)))}),(0,R.jsx)(p.ld,{color:"var(--color-gray-600)",fontWeight:h.sO.regular,$fontSizeWt:h.$N.size14,$lineHeightWt:h.kj.height22,margin:s.length>9?"0 14px 0 0":"0 20px 0 0",children:s.length})]}),u&&(0,R.jsx)(V.yf,{width:"184px",$leftWt:"-84px",children:(0,R.jsxs)(V.IO,{children:[(0,R.jsxs)(o.pT,{role:"button",gap:"8px",padding:"10px 12px",justify:"flex-start",$hasCursor:!0,onClick:e=>{var t;e.stopPropagation(),(t=!(s.length===n.length))||d(!0),i(t?r:[])},children:[(0,R.jsxs)(_.vm,{children:[(0,R.jsx)("input",{id:"allCheck",type:"checkbox",checked:s.length===n.length,readOnly:!0,onClick:e=>{e.stopPropagation()}}),(0,R.jsx)(_.Sr,{children:(0,R.jsx)("svg",{viewBox:"0 0 24 24",children:(0,R.jsx)("polyline",{points:"19 7 10 17 5 12"})})})]}),(0,R.jsx)(p.x5,{color:"var(--color-gray-600)",children:s.length===n.length?"\uc804\uccb4\ud574\uc81c":"\uc804\uccb4\uc120\ud0dd"})]}),(0,R.jsx)(o.WZ,{background:"var(--color-gray-200)"}),n.map((e=>(0,R.jsxs)(o.pT,{role:"button",gap:"8px",padding:"10px 12px",justify:"flex-start",$hasCursor:!0,onClick:t=>{if(!(t.target instanceof HTMLInputElement)){const t=document.getElementById("staff".concat(e.staffId)).checked;a=e.staffId,i(!t?e=>[...e,a]:s.filter((e=>e!==a)))}var a},children:[(0,R.jsxs)(_.vm,{children:[(0,R.jsx)("input",{id:"staff"+e.staffId,type:"checkbox",checked:!!s.includes(e.staffId),readOnly:!0}),(0,R.jsx)(_.Sr,{children:(0,R.jsx)("svg",{viewBox:"0 0 24 24",children:(0,R.jsx)("polyline",{points:"19 7 10 17 5 12"})})})]}),(0,R.jsx)(o.pT,{background:"#".concat(e.staffMainColor),padding:"1px 7px",radius:x.A.corner50,$minWidth:"24px",$minHeight:"24px",children:(0,R.jsx)(p.x5,{fontSize:h.$N.size12,fontWeight:h.sO.medium,$lineHeight:h.kj.height20,color:"var(--color-white)",children:(0,b.Od)(e.staffName)})}),l===e.staffId?(0,R.jsxs)(p.x5,{fontWeight:h.sO.regular,color:"var(--color-gray-600)",children:[(0,b.PR)(e.staffName,3)," (\ub098)"]}):(0,R.jsx)(p.x5,{fontWeight:h.sO.regular,color:"var(--color-gray-600)",children:(0,b.PR)(e.staffName,5)})]},e.staffId)))]})})]})})},K=e=>{var t;const{tabValueArray:s,selectedValue:i,setSelectedValue:n,$displayWt:o}=e,r=(0,a.useRef)(null),[l,d]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{const e=e=>{r.current&&!r.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),(0,R.jsxs)(V.SR,{width:"104px",$widthWt:"89px",radius:x.A.corner40,ref:r,$displayWt:o,children:[(0,R.jsx)(V.Ks,{height:"42px",padding:"8px 24px",$heightWt:"36px",$paddingWt:"6px 20px",radius:x.A.corner40,$fontSizeWt:h.$N.size14,$lineHeightWt:h.kj.height22,$backgroundPositionWt:"right 20px center",$backgroundSizeWt:"20px",onClick:()=>d((e=>!e)),children:(0,R.jsx)("span",{children:null===(t=s.find((e=>e.value===i)))||void 0===t?void 0:t.text})}),l&&(0,R.jsx)(V.yf,{children:(0,R.jsx)(V.IO,{children:null===s||void 0===s?void 0:s.map(((e,t)=>(0,R.jsx)(V.xD,{$fontSizeWt:h.$N.size14,$lineHeightWt:h.kj.height22,onClick:t=>{t.stopPropagation(),(e=>{i!==e.value?n&&(d(!1),n(e.value),localStorage.setItem("viewType",e.value)):d(!1)})(e)},children:(0,R.jsx)("li",{children:(0,R.jsx)("span",{children:e.text})})},t)))})})]})};var G=s(44342);const q=e=>{const{selectedViewType:t,setSelectedViewType:s,newReservationPopup:i,setNewReservationPopup:g,selectedDate:v,setSelectedDate:x,searchBarInput:S,setSearchBarInput:D,onSearch:y,onClear:w,isDrawerOpen:j,calendarScheduleParams:T,isOneOwnerShop:b,selectedStaffCheckList:I,setSelectedStaffCheckList:L,quitStaffCheckList:O,setQuitStaffCheckList:V,staffPreviewList:_,deletedStaffPreviewList:U,staffIdList:q,myStaffId:Q,setIsClearSelectedStaffCheckList:Z}=e,{setIsDrawerOpen:J}=(0,C.A)((0,n.k)((e=>({setIsDrawerOpen:e.setIsDrawerOpen})))),{resetSelectedRange:X,resetTempSelectedRange:ee}=(0,k.A)((0,n.k)((e=>({resetSelectedRange:e.resetSelectedRange,resetTempSelectedRange:e.resetTempSelectedRange}
1)))),te=(0,a.useRef)(null),se=(0,a.useRef)(null),ae=(0,E.E)((e=>e.isUnderWideTabletScreen));return(0,a.useEffect)((()=>{const e=e=>{if(j)return J(j);const t=ae?se.current:te.current;t&&!t.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[g,i,j,ae]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(o.pT,{width:"100%",$maxHeight:"40px",children:[(0,R.jsx)(o.pT,{gap:"16px",width:"100",children:(0,R.jsxs)(o.pT,{justify:"start",gap:"16px",width:"100%",$gapWt:"12px",children:[(0,R.jsx)(p.V9,{fontSize:h.$N.size24,$lineHeight:h.kj.height32,color:"var(--color-gray-600)",$letterSpacing:h.fI.spacing14,$whiteSpace:"pre",$fontSizeWt:h.$N.size20,$lineHeightWt:h.kj.height28,children:(0,f.t0)(v,t)}),(0,R.jsxs)(o.pT,{gap:"8px",children:[(0,R.jsx)(u.Oi,{width:"36px",height:"36px",$widthWt:"32px",$heightWt:"32px",$hoverImage:M.A,$activeImage:H.A,onClick:()=>{let e=new Date(v);switch(t){case m[0].value:e=(0,r.e)(e,1);break;case m[1].value:e=(0,r.e)(e,7);break;case m[2].value:e=(0,l.a)(e,1)}x(e)},children:(0,R.jsx)("img",{src:W.A,alt:"\ub0a0\uc9dc \uc774\ub3d9"})}),(0,R.jsx)(u.Oi,{width:"36px",height:"36px",$widthWt:"32px",$heightWt:"32px",$hoverImage:B.A,$activeImage:F.A,onClick:()=>{let e=new Date(v);switch(t){case m[0].value:e=(0,d.f)(e,1);break;case m[1].value:e=(0,d.f)(e,7);break;case m[2].value:e=(0,c.P)(e,1)}x(e)},children:(0,R.jsx)("img",{src:z.A,alt:"\ub0a0\uc9dc \uc774\ub3d9"})})]}),(0,R.jsx)(u.Oi,{width:"max-content",height:"unset",display:t===m[2].value?"block":"none",$displayWt:"block",$widthWt:"65px",$hoverImage:P,$activeTransform:"scale(0.8636)",onClick:()=>x(new Date),children:(0,R.jsx)("img",{src:N,alt:"\uc624\ub298\ub85c \uc774\ub3d9"})})]})}),(0,R.jsxs)(o.pT,{gap:"12px",width:"100%",justify:"flex-end",children:[(0,R.jsx)(A.A,{searchBarInput:S,setSearchBarInput:D,placeholder:"\uace0\uac1d\uba85, \ud734\ub300\ud3f0 \ubc88\ud638 \uac80\uc0c9",width:"240px",$widthWt:"236px",onSearch:y,onClear:w,$iconSize:"36px",$iconSizeWt:"36px"}),(0,R.jsx)(Y,{isOneOwnerShop:b,selectedStaffCheckList:I,setSelectedStaffCheckList:L,quitStaffCheckList:O,setQuitStaffCheckList:V,staffPreviewList:_,deletedStaffPreviewList:U,staffIdList:q,myStaffId:Q,setIsClearSelectedStaffCheckList:Z}),(0,R.jsx)(K,{selectedValue:t,setSelectedValue:s,tabValueArray:m,$displayWt:"none"}),(0,R.jsxs)(o.pT,{position:"relative",ref:te,gap:"16px",$displayWt:"none",children:[(0,R.jsxs)(u.tB,{width:"104px",padding:"8px 24px",background:"var(--color-gray-600)",gap:"4px",fontWeight:h.sO.regular,$hoverBackground:"var(--color-gray-500)",$activeBackground:"var(--color-gray-700-main)",onClick:()=>{X(),ee(),g((e=>!e))},children:["\uc77c\uc815",(0,R.jsx)(G.A,{stroke:"var(--color-white)"})]}),i&&(0,R.jsx)($,{setNewReservationPopup:g,isDrawerOpen:j,calendarScheduleParams:T})]})]})]}),(0,R.jsxs)(o.pT,{gap:"12px",width:"100%",justify:"space-between",display:"none",$displayWt:"flex",children:[(0,R.jsx)(K,{selectedValue:t,setSelectedValue:s,tabValueArray:m}),(0,R.jsxs)(o.pT,{position:"relative",ref:se,gap:"16px",children:[(0,R.jsxs)(u.tB,{width:"89px",padding:"7px 20px",background:"var(--color-gray-600)",gap:"4px",fontWeight:h.sO.regular,$hoverBackground:"var(--color-gray-500)",$activeBackground:"var(--color-gray-700-main)",$fontSizeWt:h.$N.size14,$lineHeightWt:h.kj.height24,onClick:()=>g((e=>!e)),children:["\uc77c\uc815",(0,R.jsx)(G.A,{stroke:"var(--color-white)"})]}),i&&(0,R.jsx)($,{setNewReservationPopup:g,isDrawerOpen:j,calendarScheduleParams:T})]})]})]})};var Q=s(87648),Z=s(97950),J=s(58528),X=s(65076),ee=s(86178),te=s.n(ee);s(43545);const se=s.p+"static/media/ico_today_calendar_default.f6e8df3bb73613acece90cf67087df79.svg";const ae=s.p+"static/media/ico_today_calendar_hover.cd8f88f75ec4c675d84598ea84d9d1e2.svg",ie=a.memo((e=>{const{setSelectedDate:t}=e,s=(0,a.useCallback)((()=>{t((e=>{const t=new Date;return e.toDateString()===t.toDateString()?e:t}))}),[]);return(0,R.jsx)("div",{children:(0,R.jsx)(u.Oi,{width:"max-content",height:"unset",$displayWt:"none",$hoverImage:ae,$activeTransform:"scale(0.8889)",onClick:s,children:(0,R.jsx)("img",{src:se,alt:"\uc624\ub298\ub85c \uc774\ub3d9"})})})}));
1ie.displayName="TodayCalendarButton";const ne=ie;var oe=s(99436);const re=s.p+"static/media/ico_shop_off_winter.49a2170bceb1911e6d949c0f9491b78c.svg";const le=s.p+"static/media/ico_shop_off_summer.f159b950abf50451cceaa1dfcadbf481.svg";const de=s.p+"static/media/ico_shop_off_etc.becfabed4e91cc142adcacd3a90b70fa.svg";const ce=s.p+"static/media/ico_shop_off_foundation_anniversary.2d5ca55250ff8c7b23303b08bdaa9c80.svg";const pe=s.p+"static/media/ico_staff_off_time.ad4a250cfd2463390757d7e0296f8016.svg";const he=s.p+"static/media/ico_staff_off_day.ae8e66cf29dda658faf31f2a5e66e589.svg";const ue=s.p+"static/media/ico_staff_off_sick.4e7f34ba9f318d40d64409dc394bd606.svg",fe=e=>{let{reason:t,startTime:s,$maxWidth:a,right:i}=e;return(0,R.jsxs)(o.G2,{top:"calc(100% + 53px)",right:i,$zIndex:S.A.zIndexInlineTooltip,padding:"4px 8px",radius:x.A.corner40,border:"1px solid var(--color-gray-200)",background:"var(--color-gray-50)",gap:"8px",$maxWidth:a||"calc(100% - 16px)",width:"100%",children:[(0,R.jsx)("img",{width:"16px",height:"16px",src:"\ubc18\ucc28"===t?pe:"\uc5f0\ucc28"===t?he:"\ubcd1\uac00"===t?ue:"\uaca8\uc6b8 \ud734\uac00"===t?re:"\uc5ec\ub984 \ud734\uac00"===t?le:"\ucc3d\ub9bd\uae30\ub150\uc77c"===t?ce:"\uc815\uae30\ud734\ubb34"===t?oe.A:de,alt:"\ud734\ubb34"}),(0,R.jsxs)(p.x5,{color:"var(--color-gray-400)",className:"ellipsis",children:[t," ".concat(s&&(0,b._V)(s,{includeDate:!1,includeTime:!0}))]})]})};var ge=s(76172);const me=e=>{const{date:t,weeklyClosedDayOfWeekList:s,shopDayOffDtoList:a,staffDayOffDtoList:i,selectedStaffId:n,publicHolidayList:r,staffPreviewDtoList:l}=e,{reason:d,isShow:c,startTime:u}=(0,ge.SG)({date:t,staffId:n,shopDayOffDtoList:null!==a&&void 0!==a?a:[],staffDayOffDtoList:null!==i&&void 0!==i?i:[],weeklyClosedDayOfWeekList:null!==s&&void 0!==s?s:[]}),g=r.find((e=>(0,f._y)(e.holidayDate)===(0,f._y)(t))),m=!!g,v=(0,f._y)(t)===(0,f._y)(new Date);return(0,R.jsxs)(o.pT,{padding:"13px 0",position:"relative",$minHeight:"64px",children:[(0,R.jsxs)(o.pT,{padding:"4px 8px",background:v?"var(--color-primary-50)":"",gap:"6px",radius:x.A.corner12,children:[(0,R.jsx)(p.x5,{fontWeight:h.sO.medium,color:m?"var(--color-red-500-main)":v?"var(--color-primary-500-main)":"",$whiteSpace:"nowrap",children:(0,f.EX)(t)}),(0,R.jsxs)(p.x5,{color:m?"var(--color-red-500-main)":v?"var(--color-primary-500-main)":"var(--color-gray-600)",fontWeight:h.sO.regular,$whiteSpace:"nowrap",children:[(0,f._d)(t),"\uc694\uc77c"]}),m&&(0,R.jsx)(p.x5,{color:"var(--color-red-500-main)",fontSize:"9px",fontWeight:h.sO.medium,$whiteSpace:"nowrap",$displayWt:"none",children:(0,b.PR)(g.holidayName,5)})]}),c&&(0,R.jsx)(fe,{reason:d,startTime:u||""}),m&&(0,R.jsx)(o.vp,{top:"calc(100% + 1px)",width:"100%",background:"var(--color-red-50)",$zIndex:S.A.zIndexInlineTooltip,padding:"2px",display:"none",$displayWt:l.length<=1?"block":"",children:(0,R.jsx)(p.x5,{color:"var(--color-red-500-main)",align:"center",fontSize:h.$N.size12,$lineHeight:h.kj.height20,children:(0,b.PR)(g.holidayName,5)})})]})};var ve=s(11837);const xe=a.memo((()=>{const[e,t]=(0,a.useState)([]);return(0,a.useEffect)((()=>{const e=(0,ve.RG)("00:00","23:00",60);t(e)}),[]),(0,R.jsxs)("div",{className:"rbc-time-gutter",children:[e.map(((e,t)=>(0,R.jsxs)(o.pT,{justify:"flex-start",direction:"column",align:"flex-start",height:"133px",padding:"0 8px",children:[(0,R.jsx)(p.x5,{fontSize:h.$N.size12,$lineHeight:h.kj.height20,color:"var(--color-gray-400)",children:e}),(0,R.jsx)(o.pT,{height:"22px",width:"20px",children:(0,R.jsx)(o.WZ,{background:"var(--color-gray-300)"})}),(0,R.jsx)(o.pT,{height:"22px",width:"20px",children:(0,R.jsx)(o.WZ,{background:"var(--color-gray-300)"})}),(0,R.jsx)(o.pT,{height:"22px",width:"32px",children:(0,R.jsx)(o.WZ,{background:"var(--color-gray-300)"})}),(0,R.jsx)(o.pT,{height:"22px",width:"20px",children:(0,R.jsx)(o.WZ,{background:"var(--color-gray-300)"})}),(0,R.jsx)(o.pT,{height:"22px",width:"20px",children:(0,R.jsx)(o.WZ,{background:"var(--color-gray-300)"})})]},t))),(0,R.jsx)(o.bQ,{padding:"0 8px",children:(0,R.jsx)(p.x5,{color:"var(--color-gray-400)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,children:"24:00"})})]})}));
1xe.displayName="CalendarTimeGutter";const Se=xe;var De=s(94839),ye=s(19966),we=s(21504),je=s(39914),ke=s(49153);const Te=e=>{(0,a.useLayoutEffect)((()=>{var t;const s=null===(t=e.current)||void 0===t?void 0:t.closest(".rbc-event");if(!s)return;const a=()=>{const{left:e,width:t,top:a,height:i}=s.style;e.startsWith("calc")&&(s.style.left=(0,b.RP)(e)),t.startsWith("calc")&&(s.style.width=(0,b.RP)(t)),a.startsWith("calc")&&(s.style.top=(0,b.RP)(a)),i.startsWith("calc")&&(s.style.height=(0,b.RP)(i));const n=getComputedStyle(s).left;0!==(parseFloat(n)||0)&&(s.style.borderLeft="none")};a();const i=requestAnimationFrame(a);return()=>cancelAnimationFrame(i)}),[e])},be=e=>{var t,s;let{event:i}=e;const n=(0,a.useRef)(null);Te(n);const r=(null===(t=De.GI.find((e=>e.value===i.status)))||void 0===t?void 0:t.text)||"",l=i.status===g.c9.NO_SHOW||i.status===g.c9.CANCELED,d=i.isPaid&&!(i.status===g.c9.BLOCK),c=(0,E.E)((e=>e.isUnderWideTabletScreen));(0,E.e)();const u=(0,a.useMemo)((()=>{const e=new Date(i.start).getTime(),t=(new Date(i.end).getTime()-e)/6e4;return{hasLongHeight:t>=(c?60:50),isOneline:t<=10}}),[i.start,i.end]);return(0,R.jsxs)(ye.$K,{ref:n,onDragStart:e=>e.preventDefault(),onResize:e=>e.preventDefault(),isPaid:i.isPaid,status:i.status,height:"100%",justify:"flex-start",align:"flex-start",opacity:l?"0.6":"1",padding:u.hasLongHeight?"10px 6px":"0 6px",children:[!d&&(0,R.jsx)(ye.vD,{status:i.status,height:u.hasLongHeight?"calc(100% - 42px)":"calc(100% - 4px)",$alignSelf:u.hasLongHeight?"":"center",margin:"0 8px 0 0"}),(0,R.jsxs)(o.pT,{direction:"column",align:"flex-start",gap:u.hasLongHeight&&i.memo?"8px":"0",$gapWt:u.hasLongHeight&&i.memo?"2px":"0",$minWidth:"0",overflow:!u.hasLongHeight&&i.aiNotes?"hidden":"",children:[(0,R.jsxs)(o.pT,{width:"max-width",justify:"flex-start",align:"flex-start",...u.isOneline?{direction:"row",gap:"4px"}:{direction:"column"},children:[(0,R.jsxs)(o.pT,{gap:"4px",children:[(0,R.jsx)(p.x5,{color:d?"var(--color-white)":"var(--color-gray-600)",fontSize:h.$N.size12,fontWeight:h.sO.medium,$userSelect:"none",$whiteSpace:"nowrap",$lineHeight:h.kj.height20,children:(0,f.vF)(i.start)}),i.status!==g.c9.BLOCK&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(ke.A,{name:i.customerName||"",gender:i.customerGender,isDeleted:!!i.isCustomerDeleted,color:d?"var(--color-white)":"",$fontSize:h.$N.size12,$fontWeight:h.sO.medium,$lineHeight:h.kj.height20})}),i.status===g.c9.BLOCK&&(0,R.jsx)(p.x5,{color:"var(--color-gray-600)",$userSelect:"none",className:"ellipsis",fontSize:h.$N.size12,fontWeight:h.sO.medium,$lineHeight:h.kj.height20,children:(null===(s=v.find((e=>e.value===i.blockType)))||void 0===s?void 0:s.text)||"\uae30\ud0c0"})]}),(0,R.jsxs)(o.pT,{gap:"4px",children:[i.hasCoupon&&(0,R.jsx)(je.A,{hasNoSpace:!0}),i.treatmentList&&(0,R.jsx)(o.pT,{children:(0,R.jsx)(p.x5,{color:d?"var(--color-white)":"var(--color-gray-600)",$userSelect:"none",className:"ellipsis",fontSize:h.$N.size12,$lineHeight:h.kj.height20,children:(0,b.kS)(i.treatmentList)})})]})]}),u.hasLongHeight&&(0,R.jsx)(p.x5,{className:"ellipsis-two-line",color:d?"var(--color-white)":"var(--color-gray-500)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,$userSelect:"none",children:i.memo})]}),u.hasLongHeight&&(0,R.jsxs)(o.G2,{bottom:"10px",left:"6px",gap:"4px",children:[(0,R.jsx)(ye.QU,{position:"unset",status:i.status,children:r}),i.aiNotes&&(0,R.jsx)(we.A,{width:u.isOneline?16:24,height:u.isOneline?16:24,$heightWt:16,$widthWt:16})]}),!u.hasLongHeight&&i.aiNotes&&(0,R.jsx)(o.pT,{margin:"".concat(u.isOneline?"1px":"2px"," 0 0 auto"),children:(0,R.jsx)(we.A,{width:16,height:16})})]})};var Ce=s(67920);const Ie=(e,t,s,a)=>{if(!e||!t)return null;let i;if(void 0!==a)i=e[a];else if(1===e.length)i=e[0];else{const s=new Date(t.start).getDay();i=e[0===s?6:s-1]}if(!i)return null;const n=i.querySelector(".custom-slot-selection");n&&n.remove();const{top:o,height:r}=((e,t)=>{const s=new Date(e).setHours(0,0,0,0),a=(e.getTime()-s)/6e4,i=((t.getTime()-s)/6e4-a)/1440*100;return{top:"".concat(a/1440*100,"%"),height:"".concat(i,"%")}})(t.start,t.end),l=document.createElement("div");
1return l.className="custom-slot-selection",l.innerText=s(t.start),l.style.top=o,l.style.height=r,i.appendChild(l),{selectionDiv:l}},Le=(e,t)=>{const s=te()(e).locale("en").format("dddd").toUpperCase(),a=t.find((e=>e.dayOfWeek===s));if(!a)return null;const i=te()(te()(e).format("YYYY-MM-DD")+"T".concat(a.openingTime),"YYYY-MM-DDTHH:mm"),n=te()(te()(e).format("YYYY-MM-DD")+"T".concat(a.closingTime),"YYYY-MM-DDTHH:mm"),o=te()(e);return o.isBefore(i)||o.isSameOrAfter(n)},Oe=(e,t)=>{if(t&&t.length>0)for(const s of t){const t=te()(s.startTime,"YYYY-MM-DDTHH:mm"),a=te()(s.endTime,"YYYY-MM-DDTHH:mm").clone().subtract(10,"minutes");if(te()(e).isBetween(t,a,null,"[]"))return!0}return!1};var Ee=s(39263),Re=s(24925),$e=s(24858);const Ae=e=>{const{modal:t,setModal:s,onSubmit:i,isDeleteModal:n,isChangeDate:r=!1,isChangeRepeatCycle:l=!1,isChangeOthers:d=!1,onClose:c}=e,{setValue:u,watch:f}=(0,$e.xW)(),m=f("actionScope"),v=()=>{s(!1),u("actionScope",void 0),null===c||void 0===c||c()},x=(D=l,y=d,(S=r)&&D||y&&D?De.ch.filter((e=>e.value===g.cF.THIS_AND_FUTURE||e.value===g.cF.ALL)):S&&y||S?De.ch.filter((e=>e.value===g.cF.SINGLE||e.value===g.cF.THIS_AND_FUTURE)):D?De.ch.filter((e=>e.value===g.cF.THIS_AND_FUTURE||e.value===g.cF.ALL)):De.ch);var S,D,y;return(0,a.useEffect)((()=>{x&&u("actionScope",x[0].value)}),[t]),(0,R.jsx)(R.Fragment,{children:t?(0,R.jsx)(Ee.hE,{onClick:v,children:(0,R.jsxs)(Ee.lT,{padding:"24px",children:[(0,R.jsx)(o.pT,{gap:"4px",direction:"column",align:"start",justify:"start",margin:"0 0 20px",children:(0,R.jsx)(p.V9,{children:n?"\ubc18\ubcf5 \uc77c\uc815 \uc0ad\uc81c":"\ubc18\ubcf5 \uc77c\uc815 \uc218\uc815"})}),(0,R.jsx)(o.pT,{direction:"column",align:"start",margin:"0 0 16px",onClick:e=>e.stopPropagation(),children:null===x||void 0===x?void 0:x.map((e=>(0,R.jsxs)(o.pT,{justify:"start",gap:"12px",padding:"18px 0",onClick:()=>{return t=e.value,u("actionScope",t,{shouldDirty:!0});var t},$hasCursor:!0,children:[(0,R.jsxs)(_.vm,{htmlFor:e.value,color:"var(--color-gray-500)",children:[(0,R.jsx)("input",{type:"radio",id:e.value,checked:m===e.value,readOnly:!0}),(0,R.jsx)(_.Sr,{width:"20px",height:"20px",children:(0,R.jsx)("svg",{viewBox:"0 0 24 24",children:(0,R.jsx)("polyline",{points:"19 7 10 17 5 12"})})})]}),(0,R.jsx)(o.pT,{children:(0,R.jsx)(p.ld,{color:"var(--color-gray-600)",fontWeight:h.sO.regular,children:e.text})})]},e.value)))}),(0,R.jsx)(Re.A,{onSubmit:i,handleClose:v})]})}):""})};var Ne=s(55635),Pe=s(23178);const We=()=>{const[e,t]=(0,a.useState)(null),[s,i]=(0,a.useState)(!1),[o,r]=(0,a.useState)(!1),l=(0,O.A)((e=>e.resetForm)),{setIsDrawerOpen:d,setBlockRuleId:c,setIsBlockOpen:p,setBlock:h,setSelectedReservationId:u,resetBlockRuleId:f,setHasDirtyStore:g,resetChangeStore:m,setIsDetailMode:v}=(0,C.A)((0,n.k)((e=>({setIsDrawerOpen:e.setIsDrawerOpen,setBlockRuleId:e.setBlockRuleId,setIsBlockOpen:e.setIsBlockOpen,setBlock:e.setBlock,setSelectedReservationId:e.setSelectedReservationId,resetBlockRuleId:e.resetBlockRuleId,setHasDirtyStore:e.setHasDirtyStore,resetChangeStore:e.resetChangeStore,setIsDetailMode:e.setIsDetailMode})))),x=(0,a.useCallback)((e=>{if(g(!1),e.blockRuleId)return h({blockStartDate:e.start}),c(e.blockRuleId),p(!0),d(!1),void u(null);v(!0),u(e.reservationId),p(!1),f(),d(!0)}),[d,c,p,h,u,f,v]);return{handleSelectEvent:x,setSelectedEvent:t,reservationModal:{open:s,setOpen:i,onSubmit:()=>{i(!1),m(),g(!1),null===l||void 0===l||l(),x(e)}},blockModal:{open:o,setOpen:r,onSubmit:()=>{r(!1),m(),g(!1),null===l||void 0===l||l(),x(e)}}}};var Me=s(59380),He=s(82013);const ze=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body",s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(0,a.useEffect)((()=>{if(!s)return;const a=document.querySelector(t);return a&&(a.style.overflow=e?"hidden":"auto"),()=>{a&&(a.style.overflow="auto")}}),[e,t,s])},Be=e=>{let{reservationDateKeyDtoList:t,blockDateKeyDtoList:s,staffDayOffDtoList:i=[],publicHolidayList:n=[],staffPreviewDtoList:o=[],selectedDate:r,visibleEventLimit:l,selectedStaffId:d,viewType:c}=e;return(0,a.useMemo)((()=>{if(!t&&!s)return c===g.dL.MONTH?{events:[],slicedEvents:[]}:{events:[]};const e=t.flatMap((e=>{const[t,s]=Object.entries(e)[0];return Object.entries(s).flatMap((e=>{let[s,a]=e;return a.map((e=>{const{reservationId:a,startTime:i,endTime:n,memo:o="",status:r,treatmentList:l=[],customerName:d,createdBy:p,aiNotes:h,hasCoupon:u,isPaid:f,customerGender:m,isCustomerDeleted:v,...x}=e;return{...x,reservationId:a,title:"".concat(r),start:new Date(i),end:new Date(n),status:r,staffId:s,date:t,memo:o,treatmentList:l,customerName:d,isDraggable:!0,isResizable:!0,createdBy:p,aiNotes:h,hasCoupon:u,isPaid:f,customerGender:m,isCustomerDeleted:v,...c===g.dL.DAY_MULTI_STAFF?{resourceId:s}:{}}}))}))})),a=s.flatMap((e=>{const[t,s]=Object.entries(e)[0];return Object.entries(s).flatMap((e=>{let[s,a]=e;return a.map((e=>{const{blockRuleId:a,startTime:i,endTime:n,memo:o,blockType:r,repeatCycle:l,...d}=e;return{...d,blockRuleId:a,title:r,start:new Date(i),end:new Date(n),memo:o,status:g.c9.BLOCK,staffId:s,date:t,blockType:r,repeatCycle:l,isDraggable:!0,isResizable:!0,...c===g.dL.DAY_MULTI_STAFF?{resourceId:s}:{}}}))}))})),p=[...e,...a];switch(c){case g.dL.DAY_ONE_STAFF:case g.dL.WEEK_ONE_STAFF:return{events:p.filter((e=>e.staffId===d))};case g.dL.DAY_MULTI_STAFF:return{events:p};case g.dL.MONTH:{let t=[...e.map((e=>({...e,isAllDay:!1,reason:"",staffDayOffId:void 0,shopDayOffId:void 0,isPublicHoliday:!1,holidayName:""}))),...a.map((e=>({...e,isAllDay:!1,reason:"",staffDayOffId:void 0,shopDayOffId:void 0,isPublicHoliday:!1,holidayName:""})))];if(i.length>0&&o.length>0){const e=new Set(o.map((e=>e.staffId))),s=i.filter((t=>e.has(t.staffId))).map((e=>{const{staffDayOffId:t,startTime:s,endTime:a,staffId:i,reason:n="",isAllDay:o,date:r,...l}=e;return{...l,staffDayOffId:t,title:"Day Off",start:new Date(s),end:new Date(a),staffId:i,isAllDay:o,reason:n,memo:"",date:r}}));t=[...t,...s]}if(n.length>0&&r){const e=r.getMonth(),s=r.getFullYear(),a=n.filter((t=>t.holidayDate.getMonth()===e&&t.holidayDate.getFullYear()===s)).map((e=>{const{holidayName:t,holidayDate:s,...a}=e;return{...a,title:t,start:s,end:s,holidayName:t,isPublicHoliday:!0,memo:"",date:(0,f._y)(s)}}));t=[...t,...a]}let s=[];if(l){const e=t.reduce(((e,t)=>{const s=t.date||"";return e[s]||(e[s]=[]),e[s].push(t),e}),{});s=Object.entries(e).flatMap((e=>{let[t,s]=e;return s.sort(((e,t)=>e.start.getTime()-t.start.getTime())).slice(0,l).map((e=>({...e,dateKey:t}
1)))}))}return{events:t,slicedEvents:s}}default:return{events:p}}}),[t,s,i,n,o,r,l,d,c])},Fe=()=>{const[e,t]=(0,a.useState)(!1),[s,i]=(0,a.useState)(!1),[n,o]=(0,a.useState)({top:-999,left:-999}),r=(0,a.useCallback)((()=>{o({top:-999,left:-999})}),[]),[l,d]=(0,a.useState)(),[c,p]=(0,a.useState)(!1),[h,u]=(0,a.useState)({top:-999,left:-999}),[f,m]=(0,a.useState)(!1),[v,x]=(0,a.useState)(!1),[S,D]=(0,a.useState)(!1),[y,w]=(0,a.useState)(),[j,k]=(0,a.useState)(),[T,b]=(0,a.useState)(""),[C,I]=(0,a.useState)(),[L,O]=(0,a.useState)();return{isDragging:e,setIsDragging:t,newReservationPopup:s,setNewReservationPopup:i,newReservationPopupPosition:n,setNewReservationPopupPosition:o,resetPopupPosition:r,scopeModal:f,setScopeModal:m,isChangeDate:v,setIsChangeDate:x,isChangeOthers:S,setIsChangeOthers:D,changedStart:y,setChangedStart:w,changedEnd:j,setChangedEnd:k,changedStaffId:T,setChangedStaffId:b,selectedBlockId:C,setSelectedBlockId:I,blockStartDate:L,setBlockStartDate:O,hoverReservationPopup:c,setHoverReservationPopup:p,hoveredReservation:l,hoverReservationPopupPosition:h,onControlMouseEnter:(e,t)=>{if(e.stopPropagation(),t.status===g.c9.BLOCK)return;if((null===l||void 0===l?void 0:l.reservationId)===t.reservationId)return;const s=e.clientY,a=e.clientX;let i;i=window.innerHeight-s<84?s-150-10:s+10,null===d||void 0===d||d(t),null===u||void 0===u||u({top:i,left:a})},onControlMouseLeave:e=>{e.stopPropagation(),null===d||void 0===d||d(void 0),null===u||void 0===u||u({top:-999,left:-999})}}},Ve=e=>{let{setToast:t,setIsDragging:s,setIsChangeDate:i,setScopeModal:n,setChangedStart:o,setChangedEnd:r,setChangedStaffId:l,setSelectedBlockId:d,setBlockStartDate:c,calendarScheduleParams:p,patchBlockTime:h,putReservationTime:u}=e;return{handleMoveEvent:(0,a.useCallback)((e=>{const{event:a,start:m,end:v,resourceId:x}=e;s(!1);const S=new Date(m),D=new Date(v),y=new Date(a.end),w=23===y.getHours()&&59===y.getMinutes(),j=new Date(a.start);if(S.getTime()===j.getTime())return;w&&D.setMinutes(D.getMinutes()+1);const k=S.getDate()!==D.getDate();if(a.blockRuleId){const e=(0,f.vF)(S),t=(0,f.vF)(D);"NONE"===a.repeatCycle?h(a.blockRuleId,{staffId:String(null!==x&&void 0!==x?x:a.staffId),fromDate:a.date,toDate:m,startTime:e,endTime:k?"23:59":t,actionScope:g.cF.THIS_AND_FUTURE},p):(i(!0),n(!0),o(m),r(v),l(a.staffId),d(a.blockRuleId),c&&c(new Date(a.date)))}else if(a.reservationId){if(a.status===g.c9.REVENUE)return void t("\ub4f1\ub85d\ub41c \ub9e4\ucd9c\uc774 \uc788\uc5b4\uc11c \uc608\uc57d\uc815\ubcf4\ub97c \uc218\uc815\ud560 \uc218 \uc5c6\uc5b4\uc694\n\uba3c\uc800 \ub9e4\ucd9c\uc744 \ucde8\uc18c\ud574\uc8fc\uc138\uc694","warning");const e=new Date(D.getFullYear(),D.getMonth(),D.getDate()-1,23,59,59);u(a.reservationId,{startTime:(0,b.Ut)(S),endTime:k?(0,b.Ut)(e):(0,b.Ut)(D),staffId:String(null!==x&&void 0!==x?x:a.staffId)},p)}}),[s,t,i,n,o,r,l,d,c,h,p,u])}},_e=e=>{let{setToast:t,isDragging:s,setIsDragging:i,setIsChangeOthers:n,setScopeModal:o,setChangedStart:r,setChangedEnd:l,setChangedStaffId:d,setSelectedBlockId:c,calendarScheduleParams:p,patchBlockTime:h,putReservationTime:u}=e;return{handleResizeEvent:(0,a.useCallback)((e=>{let{event:a,start:m,end:v}=e;const x=new Date(m),S=new Date(v);if(s&&i(!1),a.blockRuleId){const e=(0,f.vF)(m),t=(0,f.vF)(v);"NONE"===a.repeatCycle?h(a.blockRuleId,{staffId:a.staffId,fromDate:a.date,toDate:a.date,startTime:e,endTime:t,actionScope:g.cF.THIS_AND_FUTURE},p):(n(!0),o(!0),r(m),l(v),d(a.staffId),c(a.blockRuleId))}else if(a.reservationId){if(a.status===g.c9.REVENUE)return void t("\ub4f1\ub85d\ub41c \ub9e4\ucd9c\uc774 \uc788\uc5b4\uc11c \uc608\uc57d\uc815\ubcf4\ub97c \uc218\uc815\ud560 \uc218 \uc5c6\uc5b4\uc694\n\uba3c\uc800 \ub9e4\ucd9c\uc744 \ucde8\uc18c\ud574\uc8fc\uc138\uc694","warning");u(a.reservationId,{startTime:(0,b.Ut)(x),endTime:(0,b.Ut)(S),staffId:a.staffId},p)}}),[t,s,i,n,o,r,l,d,c,p,h,u])}},Ue=e=>{let{isUnderWideTabletScreen:t,resetPopupPosition:s,isDragging:i,setIsDragging:n,tempSelectedRange:o,resetTempSelectedRange:r,setNewReservationPopup:l,setNewReservationPopupPosition:d,setTempSelectedRange:c,selectedStaffId:p,viewType:h,selectedDate:u}=e;return{handleSelecting:(0,a.useCallback)((()=>!t&&(s(),!0)),[t]),handleSelectSlot:(0,a.useCallback)((e=>{const{start:t,end:s,resourceId:a,action:m,box:v,bounds:x}=e;if(h===g.dL.MONTH){if(!te()(t).isSame(u,"month"))return}i&&n&&n(!1);const S=h===g.dL.MONTH?(0,f.bC)(t):{start:t,end:s},D=a?String(a):p,y={start:S.start,end:S.end,staffId:D};if(o&&"click"===m&&new Date(t)>=new Date(o.start)&&new Date(s)<=new Date(o.end)&&o.staffId===D)return r(),void l(!1);const w=v?(0,He.Vl)(v.clientX,v.clientY):x?(0,He.Vl)(x.x,x.y):null;w&&d(w),c(y),setTimeout((()=>{l(!0)}),0)}),[i,o,c,t,p,u])}},Ye=e=>{let{isScrolling:t,setSelectedEvent:s,hasDirty:i,isBlockOpen:n,isDrawerOpen:o,blockModal:r,reservationModal:l,handleSelectEvent:d}=e;return{handleCalendarSelectEvent:(0,a.useCallback)((e=>
1{if(!e.isPublicHoliday&&!t){if(s(e),i){if(n)return r.setOpen(!0);if(o)return l.setOpen(!0)}d(e)}}),[t,s,i,n,o,r,l,d])}},Ke=()=>{const e=(0,a.useRef)(null);(0,a.useEffect)((()=>{const t=()=>{const e=document.querySelector(".rbc-current-time-indicator");if(!e)return;const t=e.querySelector(".current-time-text");t&&(t.textContent=te()().format("HH:mm"))},s=te()(),a=6e4-(1e3*s.seconds()+s.milliseconds()),i=setTimeout((()=>{t();const s=setInterval(t,6e4);e.current=s}),a);return()=>{clearTimeout(i),e.current&&clearInterval(e.current)}}),[])},Ge=(0,J.ye)(te()),qe=(0,X.A)(J.Vv),Qe=e=>{let{selectedDate:t,setSelectedDate:s,isDrawerOpen:i,shopDayOffDtoList:o,weeklyClosedDayOfWeekList:r,reservationDateKeyDtoList:l,staffDayOffDtoList:d,blockDateKeyDtoList:c,staffPreviewDtoList:p,calendarScheduleParams:h,publicHolidayList:u,isBlockOpen:m}=e;te().updateLocale("ko",{week:{dow:1}});const v=(0,a.useRef)(null),x=(0,$e.mN)(),{getValues:S}=x,D=(0,j.A)((e=>e.storedShopWithUserInfo)),{tempSelectedRange:y,setTempSelectedRange:w,resetSelectedRange:b,resetTempSelectedRange:I}=(0,k.A)((0,n.k)((e=>({tempSelectedRange:e.tempSelectedRange,setTempSelectedRange:e.setTempSelectedRange,resetSelectedRange:e.resetSelectedRange,resetTempSelectedRange:e.resetTempSelectedRange})))),{isEventTriggered:O,setEventTriggered:A}=(0,Ne.A)((0,n.k)((e=>({isEventTriggered:e.isEventTriggered,setEventTriggered:e.setEventTriggered})))),N=(0,Pe.W)((e=>e.setToast)),P=(0,C.A)((e=>e.hasDirty)),W=(0,E.E)((e=>e.isUnderWideTabletScreen)),{detailInfo:M}=(0,Ce.A)(),{putReservationTime:H,patchBlockTime:z,reservationDetailData:B}=(0,T.A)(),{handleSelectEvent:F,setSelectedEvent:V,reservationModal:_,blockModal:U}=We();Ke();const{isDragging:Y,setIsDragging:K,newReservationPopup:G,setNewReservationPopup:q,newReservationPopupPosition:Q,setNewReservationPopupPosition:X,resetPopupPosition:ee,scopeModal:se,setScopeModal:ae,isChangeDate:ie,setIsChangeDate:oe,isChangeOthers:re,setIsChangeOthers:le,changedStart:de,setChangedStart:ce,changedEnd:pe,setChangedEnd:he,changedStaffId:ue,setChangedStaffId:fe,selectedBlockId:ve,setSelectedBlockId:xe,blockStartDate:De,setBlockStartDate:ye}=Fe(),[we,je]=(0,a.useState)([]);ze(G,".rbc-time-content");const ke=(0,a.useMemo)((()=>p&&p.length>0?p[0].staffId:null===D||void 0===D?void 0:D.shopStaffId),[p,D]),{events:Te}=Be({reservationDateKeyDtoList:l,blockDateKeyDtoList:c,selectedStaffId:ke,viewType:g.dL.WEEK_ONE_STAFF}),{handleMoveEvent:Oe}=Ve({setToast:N,setIsDragging:K,setIsChangeDate:oe,setScopeModal:ae,setChangedStart:ce,setChangedEnd:he,setChangedStaffId:fe,setSelectedBlockId:xe,setBlockStartDate:ye,calendarScheduleParams:h,patchBlockTime:z,putReservationTime:H}),{handleResizeEvent:Ee}=_e({setToast:N,isDragging:Y,setIsDragging:K,setIsChangeOthers:le,setScopeModal:ae,setChangedStart:ce,setChangedEnd:he,setChangedStaffId:fe,setSelectedBlockId:xe,calendarScheduleParams:h,patchBlockTime:z,putReservationTime:H}),{handleSelecting:Re,handleSelectSlot:Qe}=Ue({isUnderWideTabletScreen:W,resetPopupPosition:ee,isDragging:Y,setIsDragging:K,tempSelectedRange:y,resetTempSelectedRange:I,setNewReservationPopup:q,setNewReservationPopupPosition:X,setTempSelectedRange:w,selectedStaffId:ke}),{handleCalendarSelectEvent:Ze}=Ye({setSelectedEvent:V,hasDirty:P,isBlockOpen:m,isDrawerOpen:i,blockModal:U,reservationModal:_,handleSelectEvent:F}),Je=(0,a.useCallback)((()=>{K(!0)}),[]),Xe=(0,a.useCallback)((()=>{K(!1)}),[]),et=(0,a.useCallback)((e=>{const t=e.toISOString().split("T")[0],s=e.getTime(),a="".concat(e.getHours().toString().padStart(2,"0"),":").concat(e.getMinutes().toString().padStart(2,"0")),i=Le(e,we);let n="";if(null===i)n="transparent";else if(i)n="outsideBusiness";else{d.find((e=>{if(e.isAllDay)return!1;const a=new Date(e.startTime).getTime(),i=new Date(e.endTime).getTime();return e.date===t&&s>=a&&s<i&&e.staffId===ke}))&&(n="staffTimeOff")}return{style:{},className:n,"data-time":a,onClick:t=>{if(!W)return;t.preventDefault(),t.stopPropagation();const s=(e=>{const t=new Date(e);return t.setMinutes(t.getMinutes()+10),t})(e),a=(0,He.Vl)(t.clientX,t.clientY);a&&X(a),w({start:e,end:s,staffId:ke}),q(!0)}}}),[d,ke,we]),tt=(0,a.useCallback)((e=>
1{const t=e.toLocaleString("en-US",{weekday:"long"}).toUpperCase(),s=r.includes(t),a=e.toISOString().split("T")[0],i=o.find((e=>e.date===a)),n=d.find((e=>e.date===a&&e.staffId===ke&&e.isAllDay));return s||i?{className:"shopOffDate"}:n?{className:"staffOffDate"}:{}}),[o,r,d,ke]);(0,a.useEffect)((()=>{const e=e=>{const t=e.target,s=t.closest(".custom-slot-selection");if(s)return s.remove(),ee(),void q(!1);v.current&&!v.current.contains(t)&&(I(),q(!1))};return G&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[G]),(0,a.useEffect)((()=>{if(!y||!(0,Me.my)(t,y.start,"week")){const e=document.querySelector(".custom-slot-selection");return void(e&&e.remove())}const e=document.querySelectorAll(".rbc-day-slot");if(0===e.length)return;const{selectionDiv:s}=Ie(e,y,(e=>te()(e).format("HH:mm")))||{};return()=>{s&&s.remove()}}),[y,t,null===y||void 0===y?void 0:y.staffId]),(0,a.useEffect)((()=>{y&&s(null===y||void 0===y?void 0:y.start)}),[null===y||void 0===y?void 0:y.start]),(0,a.useEffect)((()=>{i||m?q(!1):(I(),b())}),[i,m]),(0,a.useEffect)((()=>{te()(t).week()===te()().week()&&requestAnimationFrame((()=>{(0,ge.Iu)(J.Pp.WEEK)}))}),[t]),(0,a.useEffect)((()=>{const e=()=>{requestAnimationFrame((()=>{(0,ge.Iu)(J.Pp.WEEK)}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),(0,a.useEffect)((()=>{je((null===M||void 0===M?void 0:M.businessDayList)||[])}),[null===M||void 0===M?void 0:M.businessDayList]),(0,a.useEffect)((()=>{O&&(I(),b(),A(!1))}),[O]);const st=(0,a.useMemo)((()=>{const e=()=>(0,R.jsx)(ne,{setSelectedDate:s});return e.displayName="MemoizedTimeGutterHeader",e}),[s]);return(0,R.jsxs)($e.Op,{...x,children:[(0,R.jsx)(qe,{dayLayoutAlgorithm:"no-overlap",className:"".concat(G?"disableHover":""," ").concat((0,ge.zr)()?"isResetMargin":""),localizer:Ge,events:Te,defaultView:J.Pp.WEEK,date:t,step:10,timeslots:6,views:["week"],formats:f.mZ,selectable:!W,longPressThreshold:W?10:250,resizable:!0,resizableAccessor:e=>!W&&e.isResizable||!1,draggableAccessor:e=>!W&&e.isDraggable||!1,onSelectEvent:Ze,onEventDrop:Oe,onEventResize:Ee,onSelectSlot:Qe,onDragStart:Je,onDragOver:Xe,onSelecting:Re,dayPropGetter:tt,slotPropGetter:et,scrollToTime:te()().subtract(50,"minutes").toDate(),components:{week:{header:e=>(0,R.jsx)(me,{...e,weeklyClosedDayOfWeekList:r,shopDayOffDtoList:o,staffDayOffDtoList:d,selectedStaffId:ke,publicHolidayList:u,staffPreviewDtoList:p})},timeGutterHeader:st,timeGutterWrapper:Se,event:e=>(0,R.jsx)(be,{...e})}}),G&&Z.createPortal((0,R.jsx)("div",{ref:v,children:(0,R.jsx)($,{setNewReservationPopup:q,newReservationPopupPosition:Q,calendarScheduleParams:h,isFromDraggableCalendar:!0})}),document.body),(0,R.jsx)(Ae,{modal:se,setModal:ae,onClose:()=>{le(!1),oe(!1)},onSubmit:()=>{const e=new Date(de).getDate()!==new Date(pe).getDate(),t=(0,f.vF)(de),s=(0,f.vF)(pe);z(ve,{staffId:ue,fromDate:De,toDate:e?(0,f._y)(de):(0,f._y)(pe),startTime:t,endTime:e?"23:59":s,actionScope:S("actionScope")},h),ae(!1)},isChangeDate:ie,isChangeRepeatCycle:!1,isChangeOthers:re}),(0,R.jsx)(L.A,{modal:_.open,setModal:_.setOpen,onSubmit:_.onSubmit,description:B?"\uc608\uc57d \uc218\uc815\uc744 \ucde8\uc18c\ud560\uae4c\uc694?":"\uc608\uc57d \ub4f1\ub85d\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"}),(0,R.jsx)(L.A,{modal:U.open,setModal:U.setOpen,onSubmit:U.onSubmit,description:"\uc608\uc57d \uc81c\ud55c\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"})]})};var Ze=s(9953);const Je=e=>{var t;const{event:s,height:i,staffPreviewDtoList:r,$zIndex:l,onControlMouseEnter:d,onControlMouseLeave:c}=e,{status:u,isPaid:m,staffId:D,reason:y,isPublicHoliday:w,holidayName:j,reservationId:k,shopDayOffId:I,staffDayOffId:O,start:E,customerName:$,customerGender:A,blockType:N,treatmentList:P,hasCoupon:W,aiNotes:M,isCustomerDeleted:H}=s,{reservationDetailData:z}=(0,T.A)(),{isDrawerOpen:B,isBlockOpen:F,hasDirty:V}=(0,C.A)((0,n.k)((e=>({isDrawerOpen:e.isDrawerOpen,isBlockOpen:e.isBlockOpen,hasDirty:e.hasDirty})))),{handleSelectEvent:_,setSelectedEvent:U,blockModal:Y,reservationModal:K}=We(),{handleCalendarSelectEvent:G}
1=Ye({setSelectedEvent:U,hasDirty:V,isBlockOpen:F,isDrawerOpen:B,blockModal:Y,reservationModal:K,handleSelectEvent:_}),q=u===g.c9.NO_SHOW||u===g.c9.CANCELED,Q=m&&!(u===g.c9.BLOCK),Z=null===r||void 0===r?void 0:r.find((e=>e.staffId===D)),J=(0,a.useMemo)((()=>null!==y&&void 0!==y&&y.includes("\uaca8\uc6b8")?"\uaca8\uc6b8 \ud734\uac00":null!==y&&void 0!==y&&y.includes("\uc5ec\ub984")?"\uc5ec\ub984 \ud734\uac00":null!==y&&void 0!==y&&y.includes("\ucc3d\ub9bd\uae30\ub150\uc77c")?"\ucc3d\ub9bd\uae30\ub150\uc77c":"\uae30\ud0c0\uc0f5\ud734\ubb34"),[y]),X=(0,a.useMemo)((()=>null!==y&&void 0!==y&&y.includes("\uc5f0\ucc28")?"\uc5f0\ucc28":null!==y&&void 0!==y&&y.includes("\ubcd1\uac00")?"\ubcd1\uac00":null!==y&&void 0!==y&&y.includes("\ubc18\ucc28")?"\ubc18\ucc28":"\uae30\ud0c0 \uc9c1\uc6d0 \ud734\ubb34"),[y]);return(0,R.jsxs)(R.Fragment,{children:[w?(0,R.jsx)(o.pT,{width:"100%",padding:"5px 16px",height:"32px",justify:"flex-start",background:"var(--color-red-50)",$borderBottom:"1px solid var(--color-white)",$zIndex:S.A.zIndexInlineTooltip,children:(0,R.jsx)(p.x5,{color:"var(--color-red-500-main)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,className:"ellipsis",children:j})}):(0,R.jsxs)(ye.$K,{$zIndex:null!==l&&void 0!==l?l:"",isPaid:m,status:u,height:null!==i&&void 0!==i?i:"32px",padding:"5px 8px",$borderBottom:"1px solid white",width:"100%",$hasCursor:!0,opacity:q?"0.6":"1",justify:"flex-start",onMouseEnter:e=>null===d||void 0===d?void 0:d(e,s),onMouseLeave:e=>null===c||void 0===c?void 0:c(e),onClick:e=>{e.stopPropagation(),G(s)},children:[!Q&&(0,R.jsx)(ye.vD,{status:u,height:"100%",margin:"0 10px 0 0"}),(0,R.jsxs)(p.x5,{color:Q?"var(--color-white)":"var(--color-gray-600)",className:"ellipsis",fontSize:h.$N.size12,fontWeight:h.sO.medium,$lineHeight:h.kj.height20,children:[!I&&!O&&(0,f.vF)(E),u!==g.c9.BLOCK&&(0,R.jsxs)(R.Fragment,{children:[$&&!H&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("span",{style:{display:"inline-block",width:"4px"}}),(0,R.jsx)(Ze.A,{gender:A,verticalAlign:"text-bottom"})]}),(0,R.jsx)(p.D7,{margin:"0 0 0 4px",children:$||"\uace0\uac1d \ubbf8\uc9c0\uc815"})]}),u===g.c9.BLOCK?(0,R.jsx)(p.D7,{margin:"0 0 0 6px",children:(null===(t=v.find((e=>e.value===N)))||void 0===t?void 0:t.text)||"\uae30\ud0c0"}):P&&(0,R.jsx)(p.D7,{color:Q?"var(--color-white)":"var(--color-gray-500)",fontWeight:h.sO.regular,margin:"0 0 0 6px",children:(0,b.kS)(P)}),O&&(null===y||void 0===y?void 0:y.includes("\ubc18\ucc28"))&&(0,f.vF)(E),(I||O)&&(0,R.jsx)(p.D7,{fontSize:h.$N.size12,fontWeight:h.sO.regular,margin:O&&null!==y&&void 0!==y&&y.includes("\ubc18\ucc28")?"0 0 0 8px":"0",children:I?J:X})]}),(0,R.jsxs)(o.pT,{margin:"0 0 0 auto",gap:"8px",children:[W&&(0,R.jsx)(je.A,{hasNoSpace:!0}),M&&(0,R.jsx)(we.A,{width:24,height:24,$heightWt:16,$widthWt:16}),r&&(null===r||void 0===r?void 0:r.length)>1&&(0,R.jsx)(o.pT,{background:"#".concat(null===Z||void 0===Z?void 0:Z.staffMainColor),$minWidth:"20px",$minHeight:"20px",radius:x.A.corner40,children:(0,R.jsx)(p.x5,{fontSize:h.$N.size12,$lineHeight:h.kj.height20,color:"var(--color-white)",children:(0,b.Od)((null===Z||void 0===Z?void 0:Z.staffName)||"")})})]})]},k),(0,R.jsx)(L.A,{modal:K.open,setModal:K.setOpen,onSubmit:K.onSubmit,description:z?"\uc608\uc57d \uc218\uc815\uc744 \ucde8\uc18c\ud560\uae4c\uc694?":"\uc608\uc57d \ub4f1\ub85d\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"}),(0,R.jsx)(L.A,{modal:Y.open,setModal:Y.setOpen,onSubmit:Y.onSubmit,description:"\uc608\uc57d \uc81c\ud55c\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"})]})},Xe=e=>{const{staffReservations:t,date:s,staff:a,onControlMouseEnter:i,onControlMouseLeave:n}=e,o=t.filter((e=>e.staffId===a.staffId&&te()(e.start).isSame(s,"day")));return(0,R.jsx)(R.Fragment,{children:o.map((e=>(0,R.jsx)(Je,{event:e,height:"32px",$zIndex:"1",onControlMouseEnter:i,onControlMouseLeave:n},e.reservationId||e.blockRuleId+"".concat(a.staffId))))})},et=e=>{const{reservations:t,selectedDate:s,top:i,left:n,closePopup:r,staffPreviewDtoList:l}=e,d=(0,E.E)((e=>
1e.isUnderWideTabletScreen));(0,E.e)();const c=(0,a.useRef)(null),h=e=>{c.current&&!c.current.contains(e.target)&&r()};return(0,a.useEffect)((()=>(document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)})),[]),d?(0,R.jsx)(Ee.hE,{onClick:e=>{e.stopPropagation(),r()},children:(0,R.jsxs)(Ee.lT,{$maxWidth:"250px",$maxHeight:"350px",padding:"12px 8px 8px",radius:x.A.corner16,onClick:e=>e.stopPropagation(),children:[(0,R.jsx)(o.bQ,{width:"unset",padding:"0 8px 8px",children:(0,R.jsx)(p.ld,{children:(0,f.qv)(s)})}),(0,R.jsx)(o.Z6,{$maxHeight:"298px",children:(0,R.jsx)(o.pT,{direction:"column",justify:"flex-start",children:t.map((e=>(0,R.jsx)(Je,{event:e,staffPreviewDtoList:l},e.reservationId)))})})]})}):(0,R.jsxs)(o.G2,{ref:c,left:"".concat(n,"px"),top:"".concat(i,"px"),$zIndex:S.A.zIndexDialog,width:"250px",$maxHeight:"348px",background:"var(--color-white)",$boxShadow:"var(--shadow-2)",radius:x.A.corner16,justify:"flex-start",align:"flex-start",border:"1px solid var(--color-gray-200)",padding:"8px",direction:"column",gap:"8px",children:[(0,R.jsx)(o.bQ,{width:"unset",padding:"0 8px",children:(0,R.jsx)(p.ld,{children:(0,f.qv)(s)})}),(0,R.jsx)(o.Z6,{children:(0,R.jsx)(o.pT,{direction:"column",justify:"flex-start",children:t.map((e=>(0,R.jsx)(Je,{event:e,staffPreviewDtoList:l},e.reservationId)))})})]})},tt=e=>{let{staffMainColor:t,staffName:s,minWidth:a,direction:i,justify:n,gap:r,margin:l,colorBoxPadding:d,colorBoxWidth:c,colorBoxHeight:u,colorBoxFontSize:f,colorBoxLineHeight:g,colorBoxFontWeight:m,nameFontSize:v,nameFontWeight:S,nameColor:D,nameWidth:y,isNeedEllipsis:w,boxFlexWrap:j}=e;return(0,R.jsxs)(o.pT,{width:"100%",$minWidth:a,direction:i||"row",justify:n||"start",ga
1p:r||"8px",margin:l,wrap:j,$rowGap:j?"0":"",children:[(0,R.jsx)(o.pT,{background:"#".concat(t),padding:d||"2px 8px",radius:x.A.corner50,width:c||"24px",height:u||"24px",children:(0,R.jsx)(p.x5,{fontSize:f||h.$N.size12,$lineHeight:g||h.kj.height20,fontWeight:m||h.sO.regular,color:"var(--color-white)",children:(0,b.Od)(s)})}),(0,R.jsx)(p.x5,{className:w?"ellipsis":"",fontSize:v||"",fontWeight:S||h.sO.regular,color:D||"var(--color-gray-600)",width:y,align:"center",children:s})]})},st=e=>{const[t,s]=(0,a.useState)(!1);return(0,a.useEffect)((()=>{if(!e.current)return;const t=e.current.scrollHeight>e.current.clientHeight;s(t);const a=new ResizeObserver((()=>(()=>{if(e.current){const t=e.current.scrollHeight>e.current.clientHeight;s((e=>e!==t?t:e))}})()));return a.observe(e.current),()=>{a.disconnect()}}),[e]),t};var at=s(2634);const it=e=>{let{event:t,hoverReservationPopupPosition:s}=e;const{customerName:a,customerGender:i,isCustomerDeleted:n,treatmentList:r,start:l,end:d}=t;return(0,R.jsxs)(o.G2,{position:"fixed",direction:"column",align:"flex-start",background:"var(--color-white)",$boxShadow:"var(--shadow-2)",border:"1px solid var(--color-gray-200)",radius:x.A.corner12,padding:"8px",$minWidth:"200px",$zIndex:S.A.zIndexDialog,top:s?"".concat(s.top,"px"):"-999px",left:s?"".concat(s.left,"px"):"-999px",children:[(0,R.jsx)(ke.A,{name:a||"",gender:i,isDeleted:!!n,$fontSize:h.$N.size12,$fontWeight:h.sO.medium,$lineHeight:h.kj.height20}),(0,R.jsxs)(p.x5,{fontSize:h.$N.size12,fontWeight:h.sO.medium,$lineHeight:h.kj.height20,children:[(0,b._V)(null!==l&&void 0!==l?l:"",{includeDate:!1,includeTime:!0})," ~"," ",(0,b._V)(null!==d&&void 0!==d?d:"",{includeDate:!1,includeTime:!0})]}),r&&(null===r||void 0===r?void 0:r.length)>0&&r.map((e=>(0,R.jsxs)(p.x5,{color:"var(--color-gray-500)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,children:[e.name," ",e.count>1?"(".concat(e.count,")"):null]},e.id)))]})},nt=e=>{let{staffPreviewDtoList:t,selectedDate:s,setSelectedDate:i,reservationDateKeyDtoList:r,blockDateKeyDtoList:l,shopDayOffDtoList:d,weeklyClosedDayOfWeekList:c,staffDayOffDtoList:u,calendarScheduleParams:m,publicHolidayList:v,setHasScroll:S}=e;const D=(0,a.useRef)(null),y=(0,a.useRef)(null),w=st(y),{tempSelectedRange:j,setTempSelectedRange:T}=(0,k.A)((0,n.k)((e=>({tempSelectedRange:e.tempSelectedRange,setTempSelectedRange:e.setTempSelectedRange})))),b=(0,E.E)((e=>e.isUnderWideTabletScreen)),{newReservationPopup:C,setNewReservationPopup:I,newReservationPopupPosition:L,setNewReservationPopupPosition:O,hoveredReservation:A,hoverReservationPopupPosition:N,onControlMouseEnter:P,onControlMouseLeave:W}=Fe(),[M,H]=(0,a.useState)({isVisible:!1,top:0,left:0,selectedDate:null,reservations:[]});ze(C,".calendar-week-multi-staff-container");const[z,B]=(0,a.useState)(0),F=(0,a.useMemo)((()=>{const e={};return r.forEach((t=>{const[s,a]=Object.entries(t)[0];e[s]||(e[s]={}),Object.entries(a).forEach((t=>{let[a,i]=t;e[s][a]||(e[s][a]=[]),e[s][a].push(...i.map((e=>(e=>({reservationId:e.reservationId,start:new Date(e.startTime),end:new Date(e.endTime),status:e.status,memo:e.memo,treatmentList:e.treatmentList,staffId:e.staffId,customerName:e.customerName,createdBy:e.createdBy,isPaid:e.isPaid,hasCoupon:e.hasCoupon,aiNotes:e.aiNotes,customerGender:e.customerGender,isCustomerDeleted:e.isCustomerDeleted}))(e)))),e[s][a].sort(((e,t)=>e.start.getTime()-t.start.getTime()))}))})),v.forEach((s=>{const a=(0,f._y)(new Date(s.holidayDate)),i=t[0];i&&b&&(e[a]||(e[a]={}),e[a][i.staffId]||(e[a][i.staffId]=[]),e[a][i.staffId].push({start:s.holidayDate,end:s.holidayDate,holidayName:s.holidayName,isPublicHoliday:!0,memo:"",date:(0,f._y)(s.holidayDate),staffId:i.staffId}),e[a][i.staffId].sort(((e,t)=>e.start.getTime()-t.start.getTime())))})),l.forEach((t=>{const[s,a]=Object.entries(t)[0];e[s]||(e[s]={}),Object.entries(a).forEach((t=>{let[a,i]=t;e[s][a]||(e[s][a]=[]),e[s][a].push(...i.map((e=>({blockRuleId:e.blockRuleId,blockType:e.blockType,start:new Date(e.startTime),end:new Date(e.endTime),status:g.c9.BLOCK,memo:e.memo,repeatCycle:e.repeatCycle,staffId:a})))),e[s][a].sort(((e,t)=>e.start.getTime()-t.start.getTime()))}))})),u.forEach((t=>{const{staffDayOffId:s,startTime:a,endTime:i,staffId:n,reason:o,isAllDay:r,date:l}=t;e[l]||(e[l]={}),e[l][n]||(e[l][n]=[]),e[l][n].push({staffDayOffId:s,start:new Date(a),end:new Date(i),staffId:n,isAllDay:r,reason:o,memo:"",date:l}),e[l][n].sort(((e,t)=>e.start.getTime()-t.start.getTime()))})),e}),[r,l,u,v,b]),V=(0,a.useMemo)((()=>[...Array(7)].map(((e,t)=>{const a=te()(s).startOf("week").add(t,"days").toDate(),i=te()(a).format("YYYY-MM-DD"),n=d.find((e=>e.date===i)),o=c.includes(De.n0[t]);let r,l;var p,h,u;n?(r=null!==(p=n.reason)&&void 0!==p&&p.includes("\uaca8\uc6b8")?"\uaca8\uc6b8 \ud734\uac00":null!==(h=n.reason)&&void 0!==h&&h.includes("\uc5ec\ub984")?"\uc5ec\ub984 \ud734\uac00":null!==(u=n.reason)&&void 0!==u&&u.includes("\ucc3d\ub9bd\uae30\ub150\uc77c")?"\ucc3d\ub9bd\uae30\ub150\uc77c":"\uae30\ud0c0\uc0f5\ud734\ubb34",l="\uaca8\uc6b8 \ud734\uac00"===r?re:"\uc5ec\ub984 \ud734\uac00"===r?le:"\ucc3d\ub9bd\uae30\ub150\uc77c"===r?ce:de):(r=o?"\uc815\uae30\ud734\ubb34":null,l=oe.A);return{date:a,dateString:i,shopDayOff:n,isRegularClosed:o,reason:r,shopOffIconSrc:l}}))),[s,d,c]);return(0,a.useEffect)((()=>{const e=e=>{D.current&&!D.current.contains(e.target)&&I(!1)};return C&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[C]),(0,a.useEffect)((()=>{const e=()=>{const e=document.querySelector(".weekMultiStaffContainer");if(e){const t=e.clientHeight,s=Math.floor((t-32)/32);B(s)}};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}}),[t.length]),(0,a.useEffect)((()=>{j&&i(null===j||void 0===j?void 0:j.start)}),[null===j||void 0===j?void 0:j.start]),(0,a.useEffect)((()=>{S&&S(w)}
1),[w,S]),(0,R.jsxs)(ye.J$,{$rowCount:t.length,ref:y,className:"calendar-week-multi-staff-container",padding:C&&w&&!(0,ge.zr)()?"0 6px 0 0":"",children:[t.map(((e,s)=>(0,R.jsxs)(o.bQ,{display:"contents",children:[(0,R.jsx)(o.pT,{gap:"4px",$borderBottom:"1px solid var(--color-gray-200)",direction:"column",$minHeight:"194px",children:(0,R.jsx)(tt,{staffMainColor:e.staffMainColor,staffName:e.staffName,minWidth:"42px",direction:"column",gap:"4px",justify:"center",nameWidth:"58px",isNeedEllipsis:!0})}),V.map(((s,a)=>{var i;let{date:n,dateString:r,shopDayOff:l,isRegularClosed:d,reason:c,shopOffIconSrc:u}=s;const g=(null===(i=F[r])||void 0===i?void 0:i[e.staffId])||[],{remainingCount:m,shouldShowMore:v}=(t.length,S=g.length,{remainingCount:Math.max(0,S-z),shouldShowMore:S>z});var S;const D=g.slice(0,z);return(0,R.jsxs)(o.pT,{className:"weekMultiStaffContainer ".concat(l||d?"shopOffDate":""),position:"relative",direction:"column",justify:"flex-start",align:"flex-start",width:"100%",$borderBottom:"1px solid var(--color-gray-200)",$borderLeft:"1px solid var(--color-gray-200)",$minWidth:"79px",$minHeight:"194px",$hasCursor:!0,onClick:t=>((e,t,s)=>{const a=e.clientX,i=e.clientY,n=(0,He.Vl)(a,i);n&&(O(n),I(!0));const{start:o,end:r}=(0,f.bC)(t);T({start:o,end:r,staffId:s})})(t,n,e.staffId),children:[(0,R.jsx)(Xe,{staffReservations:D,date:n,staff:e,onControlMouseEnter:P,onControlMouseLeave:W}),v&&(0,R.jsxs)(ye.Ep,{onClick:e=>((e,t,s)=>{e.stopPropagation();const a=(null===s||void 0===s?void 0:s.length)>9?9:null===s||void 0===s?void 0:s.length,i=(0,He.Vl)(e.clientX,e.clientY,250,32*a+50);i&&H({isVisible:!0,top:i.top,left:i.left,selectedDate:t,reservations:s})})(e,n,g),children:[(0,R.jsx)(at.A,{width:16,height:16}),"".concat(m,"\uac74 \ub354\ubcf4\uae30")]}),(l||d)&&(0,R.jsx)(o.vp,{width:"100%",top:"15px",left:"50%",transform:"translateX(-50%)",children:(0,R.jsxs)(o.pT,{gap:"4px",margin:"0 auto",$maxHeight:"22px",padding:"0 12px",radius:x.A.corner40,background:"var(--color-white)",border:"1px solid var(--color-gray-200)",$minWidth:"0",$maxWidth:"calc(100% - 16px)",width:"max-content",children:[(0,R.jsx)("img",{src:u,width:"16px",height:"16px",alt:"\uc0f5\ud734\ubb34"}),(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,className:"ellipsis",children:c})]})})]},a)}))]},s))),M.isVisible&&Z.createPortal((0,R.jsx)(et,{reservations:M.reservations,selectedDate:M.selectedDate,top:M.top,left:M.left,closePopup:()=>{H({isVisible:!1,top:-999,left:-999,selectedDate:null,reservations:[]})}}),document.body),C&&Z.createPortal((0,R.jsx)("div",{ref:D,children:(0,R.jsx)($,{setNewReservationPopup:I,newReservationPopupPosition:L,calendarScheduleParams:m})}),document.body),A&&(0,R.jsx)(it,{event:A,hoverReservationPopupPosition:N})]})},ot=(0,J.ye)(te()),rt=e=>{let{selectedDate:t,setSelectedDate:s,reservationDateKeyDtoList:i,blockDateKeyDtoList:n,staffPreviewDtoList:o,shopDayOffDtoList:r,weeklyClosedDayOfWeekList:l,staffDayOffDtoList:d,calendarScheduleParams:c,publicHolidayList:p}=e;te().updateLocale("ko",{week:{dow:1}});const[h,u]=(0,a.useState)(!1),f=(0,a.useMemo)((()=>{const e=()=>(0,R.jsx)(ne,{setSelectedDate:s});return e.displayName="MemoizedTimeGutterHeader",e}),[s]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(J.Vv,{localizer:ot,defaultView:J.Pp.WEEK,date:t,step:60,timeslots:1,views:["week"],className:"calendar-week-multi-staff ".concat((0,ge.zr)()||o.length<5?"isResetMargin":""),components:{week:{header:e=>(0,R.jsx)(me,{...e,publicHolidayList:p,staffPreviewDtoList:o})},timeGutterHeader:f},style:{margin:o.length>4?"0 15px 0 0":"0",paddingRight:h&&!(0,ge.zr)()?"6px":"0"}}),(0,R.jsx)(nt,{staffPreviewDtoList:o,selectedDate:t,setSelectedDate:s,reservationDateKeyDtoList:i,blockDateKeyDtoList:n,shopDayOffDtoList:r,weeklyClosedDayOfWeekList:l,staffDayOffDtoList:d,calendarScheduleParams:c,publicHolidayList:p,hasScroll:h,setHasScroll:u})]})};var lt=s(15122);const dt=e=>{const{value:t,children:s,event:i,staffPreviewDtoList:n,visibleEventLimit:r,shopDayOffData:l,weeklyClosedDayOfWeekList:d}=e,c=(0,E.E)((e=>
1e.isUnderWideTabletScreen));(0,E.e)();const[u,g]=(0,a.useState)({isVisible:!1,top:0,left:0}),m=()=>{g({isVisible:!1,top:0,left:0})},v=(0,f._y)(t),S=t.toLocaleString("en-US",{weekday:"long"}).toUpperCase(),D=null===d||void 0===d?void 0:d.includes(S),y=(0,a.useMemo)((()=>i.filter((e=>(0,f._y)(e.start)===v)).sort(((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime()))),[i,v]),{shopOffReason:w,shopOffIconSrc:j}=(0,a.useMemo)((()=>{var e,t,s;if(!l){const e=D?"\uc815\uae30\ud734\ubb34":"\uae30\ud0c0\uc0f5\ud734\ubb34";return{shopOffReason:e,shopOffIconSrc:"\uc815\uae30\ud734\ubb34"===e?oe.A:de}}const a=null!==(e=l.reason)&&void 0!==e&&e.includes("\uaca8\uc6b8")?"\uaca8\uc6b8 \ud734\uac00":null!==(t=l.reason)&&void 0!==t&&t.includes("\uc5ec\ub984")?"\uc5ec\ub984 \ud734\uac00":null!==(s=l.reason)&&void 0!==s&&s.includes("\ucc3d\ub9bd\uae30\ub150\uc77c")?"\ucc3d\ub9bd\uae30\ub150\uc77c":"\uae30\ud0c0\uc0f5\ud734\ubb34";return{shopOffReason:a,shopOffIconSrc:"\uaca8\uc6b8 \ud734\uac00"===a?re:"\uc5ec\ub984 \ud734\uac00"===a?le:"\ucc3d\ub9bd\uae30\ub150\uc77c"===a?ce:de}}),[l,D]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:null===s||void 0===s?void 0:s.props.className,style:{pointerEvents:"none"},children:[(0,R.jsx)("div",{className:"rbc-date-cell",children:(0,R.jsx)("div",{id:"#dateId-".concat(v),className:v===(0,f._y)(new Date)?"todayDateText":"dateText",children:(0,f.FJ)(t)})}),y.length>r&&(0,R.jsxs)(o.pT,{onClick:e=>(e=>{e.stopPropagation();const t=(null===y||void 0===y?void 0:y.length)>9?9:null===y||void 0===y?void 0:y.length,s=(0,He.Vl)(e.clientX,e.clientY,250,32*t+50);s&&g({isVisible:!0,top:s.top,left:s.left})})(e),className:"rbc-show-more",children:[(0,R.jsx)(at.A,{width:16,height:16}),y.length-r,"\uac74 \ub354\ubcf4\uae30"]}),(l||D)&&(0,R.jsx)(o.vp,{width:"100%",top:"40px",left:"50%",transform:"translateX(-50%)",children:(0,R.jsxs)(o.pT,{gap:"4px",margin:"0 auto",$maxHeight:"22px",padding:"0 12px",radius:x.A.corner40,background:"var(--color-white)",border:"1px solid var(--color-gray-200)",$minWidth:"0",$maxWidth:"calc(100% - 16px)",width:"max-content",children:[(0,R.jsx)("img",{src:j,width:"16px",height:"16px",alt:"\uc0f5\ud734\ubb34"}),(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,className:"ellipsis",children:w})]})})]}),u.isVisible&&(c?(0,R.jsx)(et,{reservations:y,staffPreviewDtoList:n,selectedDate:t,closePopup:m}):Z.createPortal((0,R.jsx)(et,{reservations:y,staffPreviewDtoList:n,selectedDate:t,top:u.top,left:u.left,closePopup:m}),document.body))]})};const ct=s.p+"static/media/ico_staff_off_etc.f5ddda1177fb35276a24ca113d2943f6.svg",pt=e=>{var t;const{event:s,staffPreviewDtoList:i}=e,{status:n,isPaid:r,staffId:l,reason:d,isPublicHoliday:c,holidayName:u,staffDayOffId:m,start:S,customerName:D,customerGender:y,blockType:w,treatmentList:j,hasCoupon:k,aiNotes:T,isAllDay:C,isCustomerDeleted:I}=s,L=n===g.c9.NO_SHOW||n===g.c9.CANCELED,O=r&&!(n===g.c9.BLOCK),E=i.find((e=>e.staffId===l)),{staffOffReason:$,staffOffIconSrc:A}=(0,a.useMemo)((()=>({staffOffReason:null!==d&&void 0!==d&&d.includes("\uc5f0\ucc28")?"\uc5f0\ucc28":null!==d&&void 0!==d&&d.includes("\ubcd1\uac00")?"\ubcd1\uac00":null!==d&&void 0!==d&&d.includes("\ubc18\ucc28")?"\ubc18\ucc28":"\uae30\ud0c0 \uc9c1\uc6d0 \ud734\ubb34",staffOffIconSrc:"\uc5f0\ucc28"===d?he:"\ubcd1\uac00"===d?ue:"\ubc18\ucc28"===d?pe:ct})),[d]);return(0,R.jsx)(R.Fragment,{children:c?(0,R.jsx)(o.pT,{padding:"5px 16px",height:"32px",justify:"flex-start",background:"var(--color-red-50)",$borderBottom:"1px solid var(--color-white)",children:(0,R.jsx)(p.x5,{color:"var(--color-red-500-main)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,className:"ellipsis",children:u})}):m?(0,R.jsxs)(o.pT,{gap:"4px",padding:"5px 8px",height:"32px",background:"var(--color-gray)",$borderBottom:"1px solid var(--color-white)",children:[(0,R.jsxs)(o.pT,{gap:"4px",$maxHeight:"20px",padding:"0 12px",radius:x.A.corner40,background:"var(--color-white)",border:"1px solid var(--color-gray-200)",$minWidth:"0",children:[(0,R.jsx)("img",{src:A,width:"16px",height:"16px",alt:"\uc9c1\uc6d0\ud734\ubb34"}),(0,R.jsxs)(p.x5,{color:"var(--color-gray-400)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,className:"ellipsis",children:[$,!C&&" ".concat((0,f.vF)(S))]})]}),i.length>1&&(0,R.jsx)(o.pT,{background:"#".concat(null===E||void 0===E?void 0:E.staffMainColor),$minWidth:"20px",$minHeight:"20px",margin:"0 0 0 auto",radius:x.A.corner40,children:(0,R.jsx)(p.x5,{fontSize:h.$N.size12,$lineHeight:h.kj.height20,color:"var(--color-white)",children:(0,b.Od)((null===E||void 0===E?void 0:E.staffName)||"")})})]}):(0,R.jsxs)(ye.$K,{isPaid:r,status:n,height:"32px",padding:"5px 8px",$borderBottom:"1px solid white",width:"100%",$hasCursor:!0,opacity:L?"0.6":"1",justify:"flex-start",$pointerEvents:"auto",children:[!O&&(0,R.jsx)(ye.vD,{status:n,$minWidth:"4px",height:"100%",radius:x.A.corner8,margin:"0 10px 0 0"}),(0,R.jsxs)(p.x5,{className:"ellipsis",color:O?"var(--color-white)":"var(--color-gray-600)",fontSize:h.$N.size12,fontWeight:h.sO.medium,$lineHeight:h.kj.height20,children:[(0,f.vF)(S),n!==g.c9.BLOCK&&(0,R.jsxs)(R.Fragment,{children:[D&&!I&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("span",{style:{display:"inline-block",width:"4px"}}),(0,R.jsx)(Ze.A,{gender:y,verticalAlign:"text-bottom"})]}),(0,R.jsx)(p.D7,{margin:"0 0 0 4px",children:D||"\uace0\uac1d \ubbf8\uc9c0\uc815"})]}),n===g.c9.BLOCK?(0,R.jsx)(p.D7,{margin:"0 0 0 6px",children:(null===(t=v.find((e=>e.value===w)))||void 0===t?void 0:t.text)||"\uae30\ud0c0"}):j&&(0,R.jsx)(p.D7,{color:O?"var(--color-white)":"var(--color-gray-500)",fontWeight:h.sO.regular,margin:"0 0 0 6px",children:(0,b.kS)(j)})]}),(0,R.jsxs)(o.pT,{margin:"0 0 0 auto",gap:"8px",children:[k&&(0,R.jsx)(je.A,{hasNoSpace:!0}),T&&(0,R.jsx)(we.A,{width:24,height:24,$heightWt:16,$widthWt:16}),i.length>1&&(0,R.jsx)(o.pT,{background:"#".concat(null===E||void 0===E?void 0:E.staffMainColor),$minWidth:"20px",$minHeight:"20px",radius:x.A.corner40,children:(0,R.jsx)(p.x5,{fontSize:h.$N.size12,$lineHeight:h.kj.height20,color:"var(--color-white)",children:(0,b.Od)((null===E||void 0===E?void 0:E.staffName)||"")})})]})]})})},ht=(0,J.ye)(te()),ut=e=>{let{selectedDate:t,setSelectedDate:s,isDrawerOpen:i,shopDayOffDtoList:o,weeklyClosedDayOfWeekList:r,reservationDateKeyDtoList:l,staffPreviewDtoList:d,staffDayOffDtoList:c,blockDateKeyDtoList:p,calendarScheduleParams:h,publicHolidayList:u}=e;te().updateLocale("ko",{week:{dow:1}});const m=(0,a.useRef)(null),v=(0,j.A)((e=>e.storedShopWithUserInfo)),{reservationDetailData:x}=(0,T.A)(),{isBlockOpen:S,hasDirty:D}=(0,C.A)((0,n.k)((e=>({isBlockOpen:e.isBlockOpen,hasDirty:e.hasDirty})))),{handleSelectEvent:y,setSelectedEvent:w,blockModal:b,reservationModal:I}=We(),{tempSelectedRange:O,setTempSelectedRange:A,resetTempSelectedRange:N}=(0,k.A)((0,n.k)((e=>({tempSelectedRange:e.tempSelectedRange,setTempSelectedRange:e.setTempSelectedRange,resetTempSelectedRange:e.resetTempSelectedRange}
1)))),P=(0,E.E)((e=>e.isUnderWideTabletScreen)),W=(()=>{const[e,t]=(0,a.useState)(!1),s=(0,a.useRef)(0),i=(0,a.useRef)(!1),n=(0,a.useRef)(!!(0,ge.zr)());return(0,a.useEffect)((()=>{const e=n.current,a=e=>{s.current=e.touches[0].clientY},o=a=>{const n=a.touches[0].clientY;let o=Math.abs(n-s.current);e&&(o*=.5),o>(e?2:5)&&!i.current&&(i.current=!0,t(!0)),requestAnimationFrame((()=>{o<2&&(i.current=!1,t(!1))}))},r=()=>{i.current=!1,t(!1)},l=t=>{e&&i.current&&t.preventDefault()};return document.addEventListener("touchstart",a,{passive:!0}),document.addEventListener("touchmove",o,{passive:!0}),document.addEventListener("touchend",r,{passive:!0}),e&&document.addEventListener("touchend",l,{passive:!1}),()=>{document.removeEventListener("touchstart",a),document.removeEventListener("touchmove",o),document.removeEventListener("touchend",r),e&&document.addEventListener("touchend",l,{passive:!1})}}),[]),e})(),{newReservationPopup:M,setNewReservationPopup:H,newReservationPopupPosition:z,setNewReservationPopupPosition:B,resetPopupPosition:F,hoveredReservation:V,hoverReservationPopupPosition:_,onControlMouseEnter:U,onControlMouseLeave:Y}=Fe();ze(M,".rbc-month-view",P);const K=(0,a.useMemo)((()=>d&&d.length>0?d[0].staffId:null===v||void 0===v?void 0:v.shopStaffId),[d,v]),[G,q]=(0,a.useState)(0),Q=(0,a.useMemo)((()=>o.reduce(((e,t)=>(e[t.date]||(e[t.date]=[]),e[t.date].push(t),e)),{})),[o]),{events:X,slicedEvents:ee}=Be({reservationDateKeyDtoList:l,blockDateKeyDtoList:p,staffDayOffDtoList:c,publicHolidayList:u,staffPreviewDtoList:d,selectedDate:t,visibleEventLimit:G,viewType:g.dL.MONTH}),se=(0,a.useCallback)((e=>{const t=e.toLocaleString("en-US",{weekday:"long"}).toUpperCase(),s=r.includes(t),a=e.toLocaleDateString("en-CA"),i=o.find((e=>e.date===a)),n=u.find((e=>(0,f._y)(e.holidayDate)===a));return i||s?{className:"shopOffDate"}:n?{className:"publicHoliday"}:{}}),[o,r]),{handleSelecting:ae,handleSelectSlot:ie}=Ue({isUnderWideTabletScreen:P,resetPopupPosition:F,tempSelectedRange:O,resetTempSelectedRange:N,setNewReservationPopup:H,setNewReservationPopupPosition:B,setTempSelectedRange:A,selectedStaffId:K,viewType:g.dL.MONTH,selectedDate:t}),{handleCalendarSelectEvent:ne}=Ye({isScrolling:W,setSelectedEvent:w,hasDirty:D,isBlockOpen:S,isDrawerOpen:i,blockModal:b,reservationModal:I,handleSelectEvent:y});(0,a.useEffect)((()=>{if(W)return;const e=e=>{const t=e.target;t.closest(".rbc-event")&&(e.preventDefault(),t.click())};return document.addEventListener("touchend",e),()=>document.removeEventListener("touchend",e)}),[]),(0,a.useEffect)((()=>{i&&H(!1)}),[i]),(0,a.useEffect)((()=>{const e=e=>{m.current&&!m.current.contains(e.target)&&H(!1)};return M&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[M]),(0,a.useEffect)((()=>{const e=()=>{const e=document.querySelector(".rbc-day-bg");if(e){const t=e.clientHeight,s=Math.floor((t-72)/32);q(s)}};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}}),[l,p]),(0,a.useEffect)((()=>{O&&s(null===O||void 0===O?void 0:O.start)}),[null===O||void 0===O?void 0:O.start]);const oe=(0,a.useMemo)((()=>{const e=e=>{const t=(0,f._y)(e.value),s=Q[t]||[];return(0,R.jsx)(dt,{...e,event:X,shopDayOffData:s[0],staffPreviewDtoList:d,visibleEventLimit:G,weeklyClosedDayOfWeekList:r})};return e.displayName="MemoizedMonthDateCellHeader",e}),[X,d,G,r]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(J.Vv,{localizer:ht,events:ee,date:t,defaultView:J.Pp.MONTH,longPressThreshold:P?10:250,selectable:!W,view:"month",className:"calendar-month",dayLayoutAlgorithm:"no-overlap",onSelectEvent:ne,onSelecting:ae,onSelectSlot:ie,dayPropGetter:se,components:{month:{header:lt.A},event:e=>(0,R.jsx)("div",{className:"rbc-event",onMouseEnter:t=>U(t,e.event),onMouseLeave:e=>Y(e),children:(0,R.jsx)(pt,{...e,staffPreviewDtoList:d,visibleEventLimit:G})}),dateCellWrapper:oe}}),M&&Z.createPortal((0,R.jsx)("div",{ref:m,children:(0,R.jsx)($,{setNewReservationPopup:H,newReservationPopupPosition:z,calendarScheduleParams:h})}),document.body),V&&(0,R.jsx)(it,{event:V,hoverReservationPopupPosition:_}),(0,R.jsx)(L.A,{modal:I.open,setModal:I.setOpen,onSubmit:I.onSubmit,description:x?"\uc608\uc57d \uc218\uc815\uc744 \ucde8\uc18c\ud560\uae4c\uc694?":"\uc608\uc57d \ub4f1\ub85d\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"}
1),(0,R.jsx)(L.A,{modal:b.open,setModal:b.setOpen,onSubmit:b.onSubmit,description:"\uc608\uc57d \uc81c\ud55c\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"})]})};var ft=s(471);const gt=e=>{let{label:t,date:s,weeklyClosedDayOfWeekList:a,shopDayOffDtoList:i,staffDayOffDtoList:n,selectedStaffId:r,timeOffString:l,publicHolidayList:d}=e;const c=s.toLocaleString("en-US",{weekday:"long"}).toUpperCase(),u=a.includes(c),g=s.toLocaleDateString("en-CA"),m=i.find((e=>e.date===g)),v=n.find((e=>e.date===g&&e.staffId===r)),D=v?v.reason.includes("\uc5f0\ucc28")?"\uc624\ub298\uc740 \uc5f0\ucc28\uc608\uc694.":v.reason.includes("\ubcd1\uac00")?"\uc624\ub298\uc740 \ubcd1\uac00\uc608\uc694.":v.reason.includes("\uae30\ud0c0")?"\uc624\ub298\uc740 \uae30\ud0c0 \uc9c1\uc6d0\ud734\ubb34\uc608\uc694.":v.reason.includes("\ubc18\ucc28")?"\uc624\ub298\uc740 \ubc18\ucc28\uc608\uc694.":"":m?m.reason.includes("\uaca8\uc6b8")?"\uc624\ub298\uc740 \uaca8\uc6b8 \ud734\uac00\uc608\uc694.":m.reason.includes("\uc5ec\ub984")?"\uc624\ub298\uc740 \uc5ec\ub984 \ud734\uac00\uc608\uc694.":m.reason.includes("\ucc3d\ub9bd\uae30\ub150\uc77c")?"\uc624\ub298\uc740 \ucc3d\ub9bd\uae30\ub150\uc77c\uc774\uc5d0\uc694.":m.reason.includes("\uae30\ud0c0")?"\uc624\ub298\uc740 \uae30\ud0c0 \uc0f5\ud734\ubb34\uc608\uc694.":"":u?"\uc624\ub298\uc740 \uc815\uae30\ud734\ubb34\uc77c\uc774\uc5d0\uc694.":null,y="\uc624\ub298\uc740 \uc5f0\ucc28\uc608\uc694."===D?he:"\uc624\ub298\uc740 \ubcd1\uac00\uc608\uc694."===D?ue:"\uc624\ub298\uc740 \uae30\ud0c0 \uc9c1\uc6d0\ud734\ubb34\uc608\uc694."===D?ct:"\uc624\ub298\uc740 \ubc18\ucc28\uc608\uc694."===D?pe:"\uc624\ub298\uc740 \uaca8\uc6b8 \ud734\uac00\uc608\uc694."===D?re:"\uc624\ub298\uc740 \uc5ec\ub984 \ud734\uac00\uc608\uc694."===D?le:"\uc624\ub298\uc740 \ucc3d\ub9bd\uae30\ub150\uc77c\uc774\uc5d0\uc694."===D?ce:"\uc624\ub298\uc740 \uc815\uae30\ud734\ubb34\uc77c\uc774\uc5d0\uc694."===D?oe.A:de,w=null===d||void 0===d?void 0:d.find((e=>(0,f._y)(e.holidayDate)===(0,f._y)(s))),j=!!w;return(0,R.jsxs)(o.pT,{width:"100%",justify:"start",gap:"8px",padding:"20px 16px",position:"relative",children:[(0,R.jsx)(p.ld,{fontWeight:h.sO.regular,color:j?"var(--color-red-500-main)":"var(--color-gray-600)",children:t.split(" ")[0]}),(0,R.jsxs)(p.ld,{fontWeight:h.sO.regular,color:j?"var(--color-red-500-main)":"var(--color-gray-600)",children:[t.split(" ")[1],"\uc694\uc77c"]}),j&&(0,R.jsx)(p.x5,{fontSize:h.$N.size14,color:"var(--color-red-500-main)",children:w.holidayName}),(u||!!m||v)&&(0,R.jsxs)(o.G2,{top:"calc(100% + 53px)",left:"calc(50% - 170px)",$zIndex:S.A.zIndexInlineTooltip,width:"340px",padding:"12px 16px",radius:x.A.corner40,border:"1px solid var(--color-gray-200)",background:"var(--color-gray-50)",gap:"10px",children:[(0,R.jsx)("img",{src:y,alt:"\ud734\ubb34"}),(0,R.jsx)(p.x5,{fontWeight:h.sO.regular,color:"var(--color-gray-500)",$whiteSpace:"nowrap",children:"\uc624\ub298\uc740 \uae30\ud0c0 \uc9c1\uc6d0\ud734\ubb34\uc608\uc694."===D||"\uc624\ub298\uc740 \uae30\ud0c0 \uc0f5\ud734\ubb34\uc608\uc694."===D?"\uc624\ub298\uc740 \uae30\ud0c0 \ud734\ubb34\uc608\uc694.":"\uc624\ub298\uc740 \ubc18\ucc28\uc608\uc694."===D?"\uc624\ub298\uc740 \ubc18\ucc28 ".concat(l," \uc608\uc694."):D})]})]})},mt=a.memo((e=>{var t,s;let{event:i}=e;const n=(0,a.useRef)(null);Te(n);const r=(null===(t=De.GI.find((e=>e.value===i.status)))||void 0===t?void 0:t.text)||"",l=i.status===g.c9.NO_SHOW||i.status===g.c9.CANCELED,d=i.isPaid&&!(i.status===g.c9.BLOCK),c=(0,E.E)((e=>e.isUnderWideTabletScreen));(0,E.e)();const u=(0,a.useMemo)((()=>{const e=new Date(i.start).getTime(),t=(new Date(i.end).getTime()-e)/6e4;return{hasLongHeight:t>=(c?60:50),isOneline:t<=10,tabletException:!i.resourceId||(!c||t>=30)}}),[i.start,i.end,i.resourceId]);return(0,R.jsxs)(ye.$K,{ref:n,onDragStart:e=>e.preventDefault(),onResize:e=>e.preventDefault(),isPaid:i.isPaid,status:i.status,height:"100%",justify:"flex-start",align:"flex-start",opacity:l?"0.6":"1",padding:u.hasLongHeight?"12px 8px":"0 8px",gap:"8px",children:[!d&&(0,R.jsx)(ye.vD,{status:i.status,height:"calc(100% - 4px)",$alignSelf:u.hasLongHeight?"":"center"}),(0,R.jsxs)(o.pT,{direction:"column",width:"100%",align:"flex-start",ga
1p:u.hasLongHeight&&i.memo?"4px":"0",$gapWt:u.hasLongHeight&&i.memo?"2px":"0",$minWidth:"0",overflow:!u.hasLongHeight&&i.aiNotes?"hidden":"",children:[(0,R.jsxs)(o.pT,{width:"max-width",justify:"flex-start",align:"flex-start",...u.isOneline?{direction:"row",gap:"4px"}:{direction:"column"},children:[(0,R.jsxs)(o.pT,{gap:"4px",width:"max-content",justify:"flex-start",children:[(0,R.jsx)(p.x5,{color:d?"var(--color-white)":"var(--color-gray-600)",fontSize:h.$N.size12,fontWeight:h.sO.medium,$userSelect:"none",$whiteSpace:"nowrap",$lineHeight:h.kj.height20,children:(0,f.vF)(i.start)}),i.status===g.c9.BLOCK&&(0,R.jsx)(p.x5,{color:"var(--color-gray-600)",$userSelect:"none",className:"ellipsis",fontSize:h.$N.size12,fontWeight:h.sO.medium,$lineHeight:h.kj.height20,children:(null===(s=v.find((e=>e.value==i.title)))||void 0===s?void 0:s.text)||"\uae30\ud0c0"}),i.status!==g.c9.BLOCK&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(ke.A,{name:i.customerName||"",gender:i.customerGender,isDeleted:!!i.isCustomerDeleted,color:d?"var(--color-white)":"",$fontSize:h.$N.size12,$fontWeight:h.sO.medium,$lineHeight:h.kj.height20})})]}),(0,R.jsxs)(o.pT,{gap:"4px",children:[i.hasCoupon&&(0,R.jsx)(je.A,{hasNoSpace:!0}),u.tabletException&&i.treatmentList&&(0,R.jsx)(p.x5,{color:d?"var(--color-white)":"var(--color-gray-600)",$userSelect:"none",className:"ellipsis",fontSize:h.$N.size12,$lineHeight:h.kj.height20,children:(0,b.kS)(i.treatmentList)})]})]}),u.hasLongHeight&&(0,R.jsx)(p.x5,{className:"ellipsis-two-line",color:d?"var(--color-white)":"var(--color-gray-400)",fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,$userSelect:"none",children:i.memo})]}),(0,R.jsxs)(o.G2,{bottom:u.hasLongHeight?"12px":"unset",left:d?"8px":u.hasLongHeight?"22px":"unset",gap:"4px",top:u.hasLongHeight?"unset":"1px",right:u.hasLongHeight?"unset":"16px",justify:"flex-start",children:[u.hasLongHeight&&(0,R.jsx)(ye.QU,{position:"unset",status:i.status,children:r}),i.aiNotes&&(!i.resourceId||u.hasLongHeight)&&(0,R.jsx)(we.A,{width:u.hasLongHeight?24:16,height:u.hasLongHeight?24:16})]}),!u.hasLongHeight&&i.aiNotes&&i.resourceId&&(0,R.jsx)(o.pT,{margin:"".concat(u.isOneline?"1px":"2px"," 0 0 auto"),children:(0,R.jsx)(we.A,{width:16,height:16})})]})}));mt.displayName="DayEvent";const vt=mt,xt=(0,J.ye)(te()),St=(0,X.A)(J.Vv),Dt=e=>{let{selectedDate:t,setSelectedDate:s,isDrawerOpen:i,shopDayOffDtoList:o,weeklyClosedDayOfWeekList:r,reservationDateKeyDtoList:l,staffDayOffDtoList:d,blockDateKeyDtoList:c,staffPreviewDtoList:p,shopBusinessHours:h,calendarScheduleParams:u,publicHolidayList:m,isBlockOpen:v}=e;te().updateLocale("ko",{week:{dow:1}});const x=(0,a.useRef)(null),S=(0,$e.mN)(),{getValues:D}=S,y=(0,j.A)((e=>e.storedShopWithUserInfo)),{tempSelectedRange:w,setTempSelectedRange:I,resetSelectedRange:O,resetTempSelectedRange:A}=(0,k.A)((0,n.k)((e=>({tempSelectedRange:e.tempSelectedRange,setTempSelectedRange:e.setTempSelectedRange,resetSelectedRange:e.resetSelectedRange,resetTempSelectedRange:e.resetTempSelectedRange})))),{isEventTriggered:N,setEventTriggered:P}=(0,Ne.A)((0,n.k)((e=>({isEventTriggered:e.isEventTriggered,setEventTriggered:e.setEventTriggered})))),W=(0,Pe.W)((e=>e.setToast)),M=(0,C.A)((e=>e.hasDirty)),H=(0,E.E)((e=>e.isUnderWideTabletScreen)),{putReservationTime:z,patchBlockTime:B,reservationDetailData:F}=(0,T.A)(),{handleSelectEvent:V,reservationModal:_,blockModal:U,setSelectedEvent:Y}=We();Ke();const{isDragging:K,setIsDragging:G,newReservationPopup:q,setNewReservationPopup:Q,newReservationPopupPosition:X,setNewReservationPopupPosition:ee,resetPopupPosition:se,scopeModal:ae,setScopeModal:ie,isChangeDate:oe,setIsChangeDate:re,isChangeOthers:le,setIsChangeOthers:de,changedStart:ce,setChangedStart:pe,changedEnd:he,setChangedEnd:ue,changedStaffId:fe,setChangedStaffId:me,selectedBlockId:ve,setSelectedBlockId:xe}=Fe(),[De,ye]=(0,a.useState)(""),[we,je]=(0,a.useState)([]);ze(q,".rbc-time-content");const ke=(0,a.useMemo)((()=>p&&p.length>0?p[0].staffId:null===y||void 0===y?void 0:y.shopStaffId),[p,y]),{events:Te}=Be({reservationDateKeyDtoList:l,blockDateKeyDtoList:c,selectedStaffId:ke,viewType:g.dL.DAY_ONE_STAFF}),{handleMoveEvent:be}
1=Ve({setToast:W,setIsDragging:G,setIsChangeDate:re,setScopeModal:ie,setChangedStart:pe,setChangedEnd:ue,setChangedStaffId:me,setSelectedBlockId:xe,calendarScheduleParams:u,patchBlockTime:B,putReservationTime:z}),{handleResizeEvent:Ce}=_e({setToast:W,isDragging:K,setIsDragging:G,setIsChangeOthers:de,setScopeModal:ie,setChangedStart:pe,setChangedEnd:ue,setChangedStaffId:me,setSelectedBlockId:xe,calendarScheduleParams:u,patchBlockTime:B,putReservationTime:z}),{handleSelecting:Ee,handleSelectSlot:Re}=Ue({isUnderWideTabletScreen:H,resetPopupPosition:se,isDragging:K,setIsDragging:G,tempSelectedRange:w,resetTempSelectedRange:A,setNewReservationPopup:Q,setNewReservationPopupPosition:ee,setTempSelectedRange:I,selectedStaffId:ke}),{handleCalendarSelectEvent:Ge}=Ye({setSelectedEvent:Y,hasDirty:M,isBlockOpen:v,isDrawerOpen:i,blockModal:U,reservationModal:_,handleSelectEvent:V}),qe=(0,a.useCallback)((()=>{G(!0)}),[]),Qe=(0,a.useCallback)((()=>{G(!1)}),[]),Ze=(0,a.useCallback)((e=>{const t="".concat(e.getHours().toString().padStart(2,"0"),":").concat(e.getMinutes().toString().padStart(2,"0")),s=Le(e,h),a=Oe(e,we);let i="";return null===s?i="transparent":s?i="outsideBusiness":a&&(i="staffTimeOff"),{style:{},className:i,"data-time":t,onClick:t=>{if(!H)return;t.preventDefault(),t.stopPropagation();const s=(e=>{const t=new Date(e);return t.setMinutes(t.getMinutes()+10),t})(e),a=(0,He.Vl)(t.clientX,t.clientY);a&&ee(a),I({start:e,end:s,staffId:ke}),Q(!0)}}}),[h,we,H]),Je=(0,a.useCallback)((e=>{const t=e.toLocaleString("en-US",{weekday:"long"}).toUpperCase(),s=r.includes(t),a=e.toISOString().split("T")[0],i=o.find((e=>e.date===a)),n=d.find((e=>e.date===a&&e.staffId===ke&&e.isAllDay));return s||i?{className:"shopOffDate"}:n?{className:"staffOffDate"}:{}}),[o,r,d,ke]);(0,a.useEffect)((()=>{if(!w||!(0,Me.my)(t,w.start,"day")){const e=document.querySelector(".custom-slot-selection");return void(e&&e.remove())}if(!w){const e=document.querySelector(".custom-slot-selection");return void(e&&e.remove())}const e=document.querySelectorAll(".rbc-day-slot");if(0===e.length)return;const{selectionDiv:s}=Ie(e,w,(e=>te()(e).format("HH:mm")))||{};return()=>{s&&s.remove()}}),[w,t]),(0,a.useEffect)((()=>{const e=e=>{const t=e.target,s=t.closest(".custom-slot-selection");if(s)return s.remove(),se(),void Q(!1);x.current&&!x.current.contains(t)&&(A(),Q(!1))};return q&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[q]),(0,a.useEffect)((()=>{i||v?Q(!1):(A(),O())}),[i,v]),(0,a.useEffect)((()=>{const e=()=>{te()(t).isSame(te()(),"day")&&requestAnimationFrame((()=>{(0,ge.Iu)(J.Pp.DAY)}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[t]),(0,a.useEffect)((()=>{const e=t.toLocaleDateString("en-CA"),s=d.filter((t=>t.date===e&&t.staffId===ke&&!t.isAllDay)).map((e=>({startTime:e.startTime,endTime:e.endTime})));s.length>0?(ye((0,b.bb)(s)),je(s)):(ye(""),je([]))}),[d,t,ke]),(0,a.useEffect)((()=>{N&&(A(),O(),P(!1))}),[N]);const Xe=(0,a.useMemo)((()=>{const e=()=>(0,R.jsx)(ne,{setSelectedDate:s});return e.displayName="MemoizedTimeGutterHeader",e}),[s]);return(0,R.jsxs)($e.Op,{...S,children:[(0,R.jsx)(St,{dayLayoutAlgorithm:"no-overlap",className:"calendar-day-one-staff ".concat(q?"disableHover":""," ").concat((0,ge.zr)()?"isResetMargin":""),localizer:xt,events:Te,defaultView:J.Pp.DAY,date:t,step:10,timeslots:6,views:["day"],formats:f.mZ,selectable:!H,longPressThreshold:H?10:250,resizable:!0,resizableAccessor:e=>!H&&e.isResizable||!1,draggableAccessor:e=>!H&&e.isDraggable||!1,onSelectEvent:Ge,onEventDrop:be,onEventResize:Ce,onSelectSlot:Re,onDragStart:qe,onDragOver:Qe,onSelecting:Ee,dayPropGetter:Je,scrollToTime:te()().subtract(50,"minutes").toDate(),onNavigate:void 0,slotPropGetter:Ze,components:{day:{header:e=>(0,R.jsx)(gt,{...e,weeklyClosedDayOfWeekList:r,shopDayOffDtoList:o,staffDayOffDtoList:d,selectedStaffId:ke,timeOffString:De,publicHolidayList:m})},timeGutterHeader:Xe,timeGutterWrapper:Se,event:e=>(0,R.jsx)(vt,{...e})}}),q&&Z.createPortal((0,R.jsx)("div",{ref:x,children:(0,R.jsx)($,{setNewReservationPopup:Q,isDrawerOpen:i,newReservationPopupPosition:X,calendarScheduleParams:u,isFromDraggableCalendar:!0})}),document.body),(0,R.jsx)(Ae,{modal:ae,setModal:ie,onClose:()=>{de(!1),re(!1)},onSubmit:()=>{const e=new Date(ce).getDate()!==new Date(he).getDate(),t=(0,f.vF)(ce),s=(0,f.vF)(he);B(ve,{staffId:fe,fromDate:ce,toDate:he,startTime:t,endTime:e?"23:59":s,actionScope:D("actionScope")},u),ie(!1)},isChangeDate:oe,isChangeRepeatCycle:!1,isChangeOthers:le}),(0,R.jsx)(L.A,{modal:_.open,setModal:_.setOpen,onSubmit:_.onSubmit,description:F?"\uc608\uc57d \uc218\uc815\uc744 \ucde8\uc18c\ud560\uae4c\uc694?":"\uc608\uc57d \ub4f1\ub85d\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"}),(0,R.jsx)(L.A,{modal:U.open,setModal:U.setOpen,onSubmit:U.onSubmit,description:"\uc608\uc57d \uc81c\ud55c\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"})]})},yt=e=>
1{let{label:t,resource:s,matchingShopDayOff:a,isRegularClosed:i,timeOffString:n,isException:r,formattedDate:l,staffDayOffDtoList:d}=e;const c=a?a.reason.includes("\uaca8\uc6b8")?"\uc624\ub298\uc740 \uaca8\uc6b8 \ud734\uac00\uc608\uc694.":a.reason.includes("\uc5ec\ub984")?"\uc624\ub298\uc740 \uc5ec\ub984 \ud734\uac00\uc608\uc694.":a.reason.includes("\ucc3d\ub9bd\uae30\ub150\uc77c")?"\uc624\ub298\uc740 \ucc3d\ub9bd\uae30\ub150\uc77c\uc774\uc5d0\uc694.":a.reason.includes("\uae30\ud0c0")?"\uc624\ub298\uc740 \uae30\ud0c0 \ud734\ubb34\uc608\uc694.":"":i?"\uc624\ub298\uc740 \uc815\uae30\ud734\ubb34\uc77c\uc774\uc5d0\uc694.":null,u="\uc624\ub298\uc740 \uaca8\uc6b8 \ud734\uac00\uc608\uc694."===c?re:"\uc624\ub298\uc740 \uc5ec\ub984 \ud734\uac00\uc608\uc694."===c?le:"\uc624\ub298\uc740 \ucc3d\ub9bd\uae30\ub150\uc77c\uc774\uc5d0\uc694."===c?ce:"\uc624\ub298\uc740 \uc815\uae30\ud734\ubb34\uc77c\uc774\uc5d0\uc694."===c?oe.A:de,f=n[s.resourceId]||"",g=d.find((e=>e.date===l&&e.staffId===s.resourceId)),m=g?g.reason.includes("\uc5f0\ucc28")?"\uc5f0\ucc28":g.reason.includes("\ubcd1\uac00")?"\ubcd1\uac00":g.reason.includes("\uae30\ud0c0")?"\uae30\ud0c0 \ud734\ubb34":"\ubc18\ucc28 ".concat(f):"",v="\uc5f0\ucc28"===m?he:"\ubcd1\uac00"===m?ue:"\uae30\ud0c0 \ud734\ubb34"===m?ct:pe;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(o.pT,{height:"100%",children:(0,R.jsx)(tt,{staffMainColor:s.staffMainColor,staffName:t,minWidth:"42px",gap:"8px",justify:"center",boxFlexWrap:"wrap",nameWidth:"38px",isNeedEllipsis:!0})}),(i||!!a)&&(0,R.jsxs)("div",{className:"shopOff",children:[(0,R.jsx)("img",{src:u,alt:"\ud734\ubb34"}),(0,R.jsx)(p.x5,{fontWeight:h.sO.regular,color:"var(--color-gray-500)",$whiteSpace:"nowrap",children:c})]}),g&&(0,R.jsx)("div",{className:"staffOffHeaderContent",children:(0,R.jsxs)("div",{className:r?"isException staffOff":"staffOff",children:[(0,R.jsx)("img",{src:v,alt:"\ud734\ubb34"}),!r&&(0,R.jsx)(p.x5,{fontWeight:h.sO.regular,color:"var(--color-gray-500)",$whiteSpace:"nowrap",className:"ellipsis",children:m})]})})]})},wt=(0,J.ye)(te()),jt=(0,X.A)(J.Vv),kt=e=>{let{selectedDate:t,setSelectedDate:s,isDrawerOpen:i,shopDayOffDtoList:o,weeklyClosedDayOfWeekList:r,reservationDateKeyDtoList:l,staffDayOffDtoList:d,blockDateKeyDtoList:c,staffPreviewDtoList:p,shopBusinessHours:h,calendarScheduleParams:u,isBlockOpen:m}=e;te().updateLocale("ko",{week:{dow:1}});const v=(0,a.useRef)(null),x=(0,$e.mN)(),{getValues:S}=x,{tempSelectedRange:D,setTempSelectedRange:y,resetSelectedRange:w,resetTempSelectedRange:j}=(0,k.A)((0,n.k)((e=>({tempSelectedRange:e.tempSelectedRange,setTempSelectedRange:e.setTempSelectedRange,resetSelectedRange:e.resetSelectedRange,resetTempSelectedRange:e.resetTempSelectedRange})))),{isEventTriggered:I,setEventTriggered:O}=(0,Ne.A)((0,n.k)((e=>({isEventTriggered:e.isEventTriggered,setEventTriggered:e.setEventTriggered})))),A=(0,Pe.W)((e=>e.setToast)),N=(0,C.A)((e=>e.hasDirty)),P=(0,E.E)((e=>e.isUnderWideTabletScreen)),{putReservationTime:W,patchBlockTime:M,reservationDetailData:H}=(0,T.A)(),{handleSelectEvent:z,reservationModal:B,blockModal:F,setSelectedEvent:V}=We();Ke();const{isDragging:_,setIsDragging:U,newReservationPopup:Y,setNewReservationPopup:K,newReservationPopupPosition:G,setNewReservationPopupPosition:q,resetPopupPosition:Q,scopeModal:X,setScopeModal:ee,isChangeDate:se,setIsChangeDate:ae,isChangeOthers:ie,setIsChangeOthers:oe,changedStart:re,setChangedStart:le,changedEnd:de,setChangedEnd:ce,changedStaffId:pe,setChangedStaffId:he,selectedBlockId:ue,setSelectedBlockId:fe}=Fe(),[me,ve]=(0,a.useState)({}),[xe,De]=(0,a.useState)([]),[ye,we]=(0,a.useState)(!1),{events:je}=Be({reservationDateKeyDtoList:l,blockDateKeyDtoList:c,viewType:g.dL.DAY_MULTI_STAFF}),ke=p.map((e=>({resourceId:e.staffId,resourceTitle:e.staffName,staffMainColor:e.staffMainColor}))),Te=t.toLocaleString("en-US",{weekday:"long"}).toUpperCase(),be=r.includes(Te),Ce=t.toLocaleDateString("en-CA"),Ee=o.find((e=>e.date===Ce));ze(Y,".rbc-time-content");const{handleMoveEvent:Re}=Ve({setToast:A,setIsDragging:U,setIsChangeDate:ae,setScopeModal:ee,setChangedStart:le,setChangedEnd:ce,setChangedStaffId:he,setSelectedBlockId:fe,calendarScheduleParams:u,patchBlockTime:M,putReservationTime:W}),{handleResizeEvent:Ge}=_e({setToast:A,isDragging:_,setIsDragging:U,setIsChangeOthers:oe,setScopeModal:ee,setChangedStart:le,setChangedEnd:ce,setChangedStaffId:he,setSelectedBlockId:fe,calendarScheduleParams:u,patchBlockTime:M,putReservationTime:W}),{handleSelecting:qe,handleSelectSlot:Qe}=Ue({isUnderWideTabletScreen:P,resetPopupPosition:Q,isDragging:_,setIsDragging:U,tempSelectedRange:D,resetTempSelectedRange:j,setNewReservationPopup:K,setNewReservationPopupPosition:q,setTempSelectedRange:y}),{handleCalendarSelectEvent:Ze}=Ye({setSelectedEvent:V,hasDirty:N,isBlockOpen:m,isDrawerOpen:i,blockModal:F,reservationModal:B,handleSelectEvent:z}),Je=(0,a.useCallback)((()=>{U(!0)}),[]),Xe=(0,a.useCallback)((()=>{U(!1)}),[]),et=(0,a.useCallback)((()=>be||Ee?{className:"shopOffDate"}:{}),[be,Ee]);(0,a.useEffect)((()=>
1{if(!D||!(0,Me.my)(t,D.start,"day")){const e=document.querySelector(".custom-slot-selection");return void(e&&e.remove())}const e=document.querySelectorAll(".rbc-day-slot");if(0===e.length)return;const s=p.findIndex((e=>e.staffId===(null===D||void 0===D?void 0:D.staffId))),{selectionDiv:a}=Ie(e,D,(e=>te()(e).format("HH:mm")),s)||{};return()=>{a&&a.remove()}}),[D,p,t]),(0,a.useEffect)((()=>{D&&s(null===D||void 0===D?void 0:D.start)}),[null===D||void 0===D?void 0:D.start]),(0,a.useEffect)((()=>{const e=e=>{const t=e.target,s=t.closest(".custom-slot-selection");if(s)return s.remove(),Q(),void K(!1);v.current&&!v.current.contains(t)&&(j(),K(!1))};return Y&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[Y]),(0,a.useEffect)((()=>{i||m?K(!1):(j(),w())}),[i,m]),(0,a.useEffect)((()=>{const e=()=>{te()(t).isSame(te()(),"day")&&requestAnimationFrame((()=>{(0,ge.Iu)(J.Pp.DAY)}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[t]),(0,a.useEffect)((()=>{(()=>{const e=d.filter((e=>e.date===Ce&&e.isAllDay)).map((e=>ke.findIndex((t=>t.resourceId===e.staffId)))),t=d.filter((e=>e.date===Ce&&!e.isAllDay)),s=document.getElementById("dynamic-staff-off-styles");s&&s.remove();const a=document.createElement("style");a.id="dynamic-staff-off-styles",document.head.appendChild(a);const i=e.map((e=>"\n\t\t\t\t\t\t.rbc-time-content .rbc-day-slot:nth-child(".concat(e+2,") {\n\t\t\t\t\t\t\tbackground-color: var(--color-gray);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t.rbc-time-content .rbc-day-slot:nth-child(").concat(e+2,") .outsideBusiness {\n\t\t\t\t\t\t\tbackground-color: transparent;\n\t\t\t\t\t\t}\n\t\t\t\t\t"))).join("\n"),n=t.map((e=>{const t=ke.findIndex((t=>t.resourceId===e.staffId));if(-1===t)return"";const s=new Date(e.startTime).getHours(),a=new Date(e.endTime).getHours();let i="";for(let n=s;n<=a;n++){const e=n+1;i+="\n\t\t\t\t\t\t.rbc-time-content .rbc-day-slot:nth-child(".concat(t+2,") .rbc-timeslot-group:nth-child(").concat(e,") .staffTimeOff {\n\t\t\t\t\t\t\tbackground-color: var(--color-gray);\n\t\t\t\t\t\t}\n\t\t\t\t\t")}return i})).join("\n");a.innerHTML=i+n})()}),[d,ke]),(0,a.useEffect)((()=>{const e=d.filter((e=>e.date===Ce&&!e.isAllDay)).map((e=>({startTime:e.startTime,endTime:e.endTime,staffId:e.staffId})));if(e.length>0){const t=e.reduce(((e,t)=>{const s="".concat((0,b._V)(t.startTime,{includeDate:!1,includeTime:!0})," ~ ").concat((0,b._V)(t.endTime,{includeDate:!1,includeTime:!0}));return e[t.staffId]?e[t.staffId]+=", ".concat(s):e[t.staffId]=s,e}),{});ve(t),De(e)}else ve({}),De([])}),[d,Ce]),(0,a.useEffect)((()=>{I&&(j(),w(),O(!1))}),[I]),(0,a.useEffect)((()=>{we(p.length>10)}),[p]);const tt=(0,a.useCallback)(((e,t)=>{const s="".concat(e.getHours().toString().padStart(2,"0"),":").concat(e.getMinutes().toString().padStart(2,"0")),a=Le(e,h),i=Oe(e,xe);let n="";return null===a?n="transparent":a?n="outsideBusiness":i&&(n="staffTimeOff"),{style:{},className:n,"data-time":s,onClick:s=>{if(!P)return;s.preventDefault(),s.stopPropagation();const a=(e=>{const t=new Date(e);return t.setMinutes(t.getMinutes()+10),t})(e),i=(0,He.Vl)(s.clientX,s.clientY);i&&q(i),y({start:e,end:a,staffId:t}),K(!0)}}}),[h,xe,P]),st=(0,a.useMemo)((()=>{const e=()=>(0,R.jsx)(ne,{setSelectedDate:s});return e.displayName="MemoizedTimeGutterHeader",e}),[s]);return(0,R.jsxs)($e.Op,{...x,children:[(0,R.jsx)(jt,{dayLayoutAlgorithm:"no-overlap",className:"calendar-day-multi-staff ".concat(Y?"disableHover":""," ").concat((0,ge.zr)()?"isResetMargin":""),localizer:wt,events:je,defaultView:J.Pp.DAY,date:t,step:10,timeslots:6,views:["day"],formats:f.mZ,selectable:!P,longPressThreshold:P?10:250,resizable:!0,resizableAccessor:e=>!P&&e.isResizable||!1,draggableAccessor:e=>!P&&e.isDraggable||!1,onSelectEvent:Ze,onEventDrop:Re,onEventResize:Ge,onSelectSlot:Qe,onDragStart:Je,onDragOver:Xe,onSelecting:qe,dayPropGetter:et,scrollToTime:te()().subtract(50,"minutes").toDate(),resources:ke,resourceIdAccessor:e=>e.resourceId,resourceTitleAccessor:e=>e.resourceTitle,onNavigate:void 0,slotPropGetter:tt,components:{timeGutterHeader:st,timeGutterWrapper:Se,event:e=>(0,R.jsx)(vt,{...e}),resourceHeader:e=>
1(0,R.jsx)(yt,{...e,matchingShopDayOff:Ee,isRegularClosed:be,timeOffString:me,isException:ye,formattedDate:Ce,staffDayOffDtoList:d,resource:e.resource})}}),Y&&Z.createPortal((0,R.jsx)("div",{ref:v,children:(0,R.jsx)($,{setNewReservationPopup:K,isDrawerOpen:i,newReservationPopupPosition:G,calendarScheduleParams:u,isFromDraggableCalendar:!0})}),document.body),(0,R.jsx)(Ae,{modal:X,setModal:ee,onClose:()=>{oe(!1),ae(!1)},onSubmit:()=>{const e=new Date(re).getDate()!==new Date(de).getDate(),t=(0,f.vF)(re),s=(0,f.vF)(de);M(ue,{staffId:pe,fromDate:re,toDate:de,startTime:t,endTime:e?"23:59":s,actionScope:S("actionScope")},u),ee(!1)},isChangeDate:se,isChangeRepeatCycle:!1,isChangeOthers:ie}),(0,R.jsx)(L.A,{modal:B.open,setModal:B.setOpen,onSubmit:B.onSubmit,description:H?"\uc608\uc57d \uc218\uc815\uc744 \ucde8\uc18c\ud560\uae4c\uc694?":"\uc608\uc57d \ub4f1\ub85d\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"}),(0,R.jsx)(L.A,{modal:F.open,setModal:F.setOpen,onSubmit:F.onSubmit,description:"\uc608\uc57d \uc81c\ud55c\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"})]})};var Tt=s(63701),bt=s(31140),Ct=s(71585),It=s(86638),Lt=s(15996),Ot=s(64454),Et=s(52240),Rt=s(45357),$t=s(30285);const At=e=>{var t;const{blockDetailData:s,hasSchedule:i}=e,{staffPreviewList:n,shopDayOffDtoList:r,weeklyClosedDayOfWeekList:l}=(0,T.A)(),d=(0,j.A)((e=>e.storedShopWithUserInfo)),c=(0,k.A)((e=>e.selectedRange)),{register:u,setValue:g,getValues:m,watch:v,formState:{dirtyFields:S}}=(0,$e.xW)(),{shopBusinessTime:D,updateShopBusinessParams:y,setIsFetchShopBusinessTime:w}=(0,Rt.A)(),{initialReservationStart:C,initialReservationEnd:I}=(0,b.xR)(),[L,O]=(0,a.useState)(""),[E,$]=(0,a.useState)(),[A,N]=(0,a.useState)(!1),[P,W]=(0,a.useState)(!1),[M,H]=(0,a.useState)(!1),z=(0,a.useRef)(0),B=v("changeDate"),F=v("blockType"),V=m("repeatCycle")||"NONE",U=v("startTime"),Y=v("detailForm.startTime"),K=v("endTime"),G=(0,a.useCallback)((()=>i?"\uc911\ubcf5\ub41c \uc77c\uc815\uc774 \uc788\uc5b4\uc694":P?"":"\uc601\uc5c5\uc2dc\uac04\uc774 \uc544\ub2c8\uc5d0\uc694"),[i,P]),q=()=>{var e;if(!s&&null!==c&&void 0!==c&&c.formattedEnd&&!S.blockType&&!S.startTime)return g("detailForm.endTime",null===c||void 0===c?void 0:c.formattedEnd),g("endTime",null===c||void 0===c?void 0:c.formattedEnd);const t=s&&!S.blockType?(()=>{if(!s)return;const e=s.startTime.slice(0,5),t=s.endTime.slice(0,5),[a,i]=e.split(":").map(Number),n=60*a+i,[o,r]=t.split(":").map(Number),l=60*o+r;return z.current=l-n})():(null===(e=De.c7.filter((e=>e.value===F))[0])||void 0===e?void 0:e.duration)||10,a=s?Y:U;if(!a)return;const[i,n]=a.split(":").map(Number),o=new Date(B);if(o.setHours(i),o.setMinutes(n+t),(null===o||void 0===o?void 0:o.getMonth())+1!==(null===B||void 0===B?void 0:B.getMonth())+1||o.getDate()!==B.getDate())return g("detailForm.endTime","23:59"),g("endTime","23:59");const r=o.getHours(),l=o.getMinutes(),d="".concat(r.toString().padStart(2,"0"),":").concat(l.toString().padStart(2,"0"));g("detailForm.endTime",d),g("endTime",d)};return(0,a.useEffect)((()=>{if("23:50"===m("startTime"))return g("detailForm.endTime","23:59"),g("endTime","23:59");return!s&&!(null!==c&&void 0!==c&&c.formattedEnd)&&(0,Me.RI)(S)?(g("startTime",C),g("endTime",I)):q()}),[F,U,Y,s]),(0,a.useEffect)((()=>{var e;const t=v("staffId")||d.shopStaffId,s=null===n||void 0===n||null===(e=n.filter((e=>e.staffId===t))[0])||void 0===e?void 0:e.staffName;$(t),O(s),g("staffId",t)}),[d,n,v("staffId")]),(0,a.useEffect)((()=>{c&&!s&&g("startDate",c.start)}),[c]),(0,a.useEffect)((()=>{if(!B)return;y("dayOfWeek",(0,f.se)(B)),w(!0);const e=l.includes((0,f.se)(B)),t=-1!==r.findIndex((e=>e.date===(0,f._y)(B)));H(t||e);const s=null===D||void 0===D?void 0:D.openingTime.slice(0,5),a=null===D||void 0===D?void 0:D.closingTime.slice(0,5),i=(0,Me.RN)([{startTime:s,endTime:a}],U,K,!1);W(!!i)}),[B,U,K,D]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(ye.qm,{margin:"0 0 16px",$marginWt:"0 0 24px",children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",children:"\uc9c1\uc6d0 \uc120\ud0dd"}),(0,R.jsx)(Tt.A,{selectedValue:E,setSelectedValue:$,selectedText:L,setSelectedText:O,placeholder:"\uc9c1\uc6d0\uc744 \uc120\ud0dd\ud574 \uc8fc\uc138\uc694.",width:"100%",fontSize:h.$N.size14,fontWeight:h.sO.regular,lineHeight:h.kj.height22,height:"48px",padding:"13px 14px",onChange:e=>g("staffId",e,{shouldDirty:!0})})]}),(0,R.jsxs)(ye.qm,{margin:"0 0 16px",$marginWt:"0 0 24px",children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",children:"\ub0a0\uc9dc"}),(0,R.jsxs)(o.pT,{width:"inherit",direction:"column",align:"start",children:[(0,R.jsx)(bt.A,{className:"outlineInput",calendarClassName:"inputCalendar",selected:m("changeDate"),onChange:e=>{g("detailForm.startData",e,{shouldDirty:!0}
1),g("changeDate",e,{shouldDirty:!0})},fontSize:h.$N.size14,dateFormat:"yyyy.MM.dd EEEE",$maxHeight:"48px"}),M&&(0,R.jsxs)(o.pT,{padding:"6px 0",gap:"4px",children:[(0,R.jsx)("img",{src:Ct.A,alt:"\uc8fc\uc758",width:"20px"}),(0,R.jsx)(p.x5,{fontSize:h.$N.size12,color:"var(--color-red-500-main)",fontWeight:h.sO.regular,$lineHeight:h.kj.height20,children:"\uc624\ub298\uc740 \uc0f5 \ud734\ubb34\uc77c\uc774\uc5d0\uc694."})]})]})]}),(0,R.jsxs)(ye.qm,{margin:"0 0 24px",children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",children:"\uc2dc\uac04"}),(0,R.jsxs)(o.pT,{direction:"column",align:"start",width:"inherit",children:[(0,R.jsxs)(o.pT,{gap:"8px",width:"100%",children:[(0,R.jsx)(It.A,{isStartDropdown:!0,selectedValue:s?m("detailForm.startTime"):v("startTime"),setSelectedValue:e=>{s&&g("detailForm.startTime",e,{shouldDirty:!0}),g("startTime",e,{shouldDirty:!0})},fontSize:h.$N.size14,$fontSizeWt:h.$N.size14,lineHeight:h.kj.height22,padding:"12px 14px"}),"~",(0,R.jsx)(It.A,{isStartDropdown:!1,selectedValue:s?m("detailForm.endTime"):v("endTime"),setSelectedValue:e=>{s&&g("detailForm.endTime",e,{shouldDirty:!0}),g("endTime",e,{shouldDirty:!0})},startTime:m("startTime"),fontSize:h.$N.size14,$fontSizeWt:h.$N.size14,lineHeight:h.kj.height22,padding:"12px 14px"})]}),G()&&(0,R.jsxs)(o.pT,{padding:"6px 0",gap:"4px",children:[(0,R.jsx)("img",{src:Ct.A,alt:"\uc8fc\uc758",width:"20px"}),(0,R.jsx)(p.x5,{fontSize:h.$N.size12,color:"var(--color-red-500-main)",fontWeight:h.sO.regular,$lineHeight:h.kj.height20,children:G()})]})]})]}),(0,R.jsxs)(ye.qm,{margin:"0 0 16px",$marginWt:"0 0 24px",children:[(0,R.jsxs)(o.pT,{gap:"4px",children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",children:"\uc2a4\ucf00\uc904 \ubd84\ub958"}),(0,R.jsxs)(o.oO,{$hasCursor:!0,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:[(0,R.jsx)(o.pT,{children:(0,R.jsx)($t.A,{width:20,height:20,stroke:"var(--color-gray-300)"})}),A&&(0,R.jsx)(Lt.A,{text:"\uc2a4\ucf00\uc904 \ubd84\ub958 \ubbf8\uc120\ud0dd \uc2dc '\uae30\ud0c0'\ub85c \uc124\uc815\ub418\uc5b4\uc694",left:"200%",$triangleLeft:"35%"})]})]}),(0,R.jsx)(Ot.A,{data:De.c7,selectedValue:F,setSelectedValue:e=>g("blockType",e,{shouldDirty:!0}),width:"100%",isSelectAll:!1,placeholder:"\uc2a4\ucf00\uc904 \ubd84\ub958\ub97c \uc120\ud0dd\ud574 \uc8fc\uc138\uc694",$fontSize:h.$N.size14,$lineHeight:h.kj.height22,height:"48px",padding:"12px 14px",radius:x.A.corner12})]}),(0,R.jsxs)(ye.qm,{margin:"0 0 16px",children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",children:"\ubc18\ubcf5 \uc124\uc815"}),(0,R.jsx)(Ot.A,{width:"100%",...u("repeatCycle"),data:De.tb,selectedValue:V,setSelectedValue:e=>g("repeatCycle",e,{shouldDirty:!0}),isSelectAll:!1,padding:"12px 14px",$lineHeight:h.kj.height22,$fontWeight:h.sO.regular,$fontSize:h.$N.size14,height:"48px",radius:x.A.corner12})]}),(0,R.jsxs)(ye.qm,{children:[(0,R.jsx)(p.x5,{color:"var(--color-gray-500)",children:"\uba54\ubaa8"}),(0,R.jsx)(_.pd,{placeholder:"\uba54\ubaa8\ub97c \uc785\ub825\ud574 \uc8fc\uc138\uc694",...u("memo"),onChange:e=>(0,Et.x)(e,g,"memo",30),maxLength:30,fontSize:h.$N.size14,$lineHeight:h.kj.height22,height:"48px",padding:"12px 14px",radius:x.A.corner12,onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()}}),(0,R.jsx)(o.pT,{justify:"end",width:"100%",padding:"4px 0 0",children:(0,R.jsxs)(p.x$,{align:"right",children:[(null===(t=v("memo"))||void 0===t?void 0:t.length)||0,"/30"]})})]})]})};var Nt=s(30494),Pt=s(38554),Wt=s(45555);const Mt=e=>{var t,s;const{isBlockOpen:i,calendarScheduleParams:r}=e,{postBlockReservation:l,blockDetailData:d,putBlockDetail:c,deleteBlock:m,isFetchingBlockDetail:v,isPendingSubmit:S,setIsPendingSubmit:D,reservationDateKeyDtoList:y,staffDayOffDtoList:w,blockDateKeyDtoList:j,setIsFetchCalendarScheduleData:I,setCalendarScheduleParams:E}=(0,T.A)(),{resetIsBlockOpen:$,resetBlockRuleId:A,blockData:N,resetBlock:P,setHasDirtyStore:W,blockRuleId:M}=(0,C.A)((0,n.k)((e=>({resetIsBlockOpen:e.resetIsBlockOpen,resetBlockRuleId:e.resetBlockRuleId,blockData:e.blockData,resetBlock:e.resetBlock,setHasDirtyStore:e.setHasDirtyStore,blockRuleId:e.blockRuleId})))),H=(0,O.A)((e=>e.setReset)),{selectedRange:z,resetSelectedRange:B}=(0,k.A)((0,n.k)((e=>({selectedRange:e.selectedRange,resetSelectedRange:e.resetSelectedRange}
1)))),[F,V]=(0,a.useState)(!1),[_,U]=(0,a.useState)(!1),[Y,K]=(0,a.useState)(!1),[G,q]=(0,a.useState)(!1),Q=(0,$e.mN)({defaultValues:{startTime:void 0,endTime:void 0,startDate:new Date,repeatCycle:void 0,blockType:null,memo:"",actionScope:void 0,changeDate:new Date,detailForm:{startTime:void 0,endTime:void 0,startDate:new Date}}}),{reset:Z,setValue:J,handleSubmit:X,formState:{dirtyFields:ee},watch:se,getValues:ae}=Q,ie=se("changeDate"),ne=se("startTime"),oe=se("endTime"),re=se("staffId"),{hasSchedule:le}=(0,Nt.A)({selectedDate:ie,reservationDateKeyDtoList:y,staffDayOffDtoList:w,blockDateKeyDtoList:j,startTime:ne,endTime:oe,selectedStaffValue:re,blockRuleId:M}),de=0!==Object.keys(ee).length,ce=()=>{A(),V(!1),q(!1),K(!1),U(!1),P(),J("blockType",null),J("memo",""),J("repeatCycle",g.AV.NONE)},pe=()=>{$(!1),ce(),Z(),B(),W(!1)},he=()=>{de?V(!0):pe()},ue=!!ee.changeDate&&te()(se("changeDate")).format("YYYY-MM-DD")!==te()(null===N||void 0===N?void 0:N.blockStartDate).format("YYYY-MM-DD"),fe=!!ee.repeatCycle&&se("repeatCycle")!==(null===d||void 0===d?void 0:d.repeatCycle),me=!!ee.memo&&se("memo")!==(null===d||void 0===d?void 0:d.memo)||!!ee.blockType&&se("blockType")!==(null===d||void 0===d?void 0:d.blockType)||!!ee.staffId&&se("staffId")!==(null===d||void 0===d?void 0:d.staffId)||!!ee.startTime&&se("startTime")!==(null===d||void 0===d||null===(t=d.startTime)||void 0===t?void 0:t.slice(0,5))||!!ee.endTime&&se("endTime")!==(null===d||void 0===d||null===(s=d.endTime)||void 0===s?void 0:s.slice(0,5)),ve=ue&&fe&&me,xe="NONE"===(null===d||void 0===d?void 0:d.repeatCycle)||ve||ue&&fe,Se=()=>{Z(),P(),d&&(J("startDate",(0,f.Am)(null===d||void 0===d?void 0:d.startDate)),J("repeatCycle",null===d||void 0===d?void 0:d.repeatCycle)),U(!1)},De=()=>{var e;const t=null!==(e=null===N||void 0===N?void 0:N.blockStartDate)&&void 0!==e?e:null===d||void 0===d?void 0:d.startDate;c({staffId:ae("staffId"),fromDate:(0,b.$l)(t,ae("startTime")),toDate:(0,b.Ut)(ae("changeDate")),actionScope:xe?g.cF.THIS_AND_FUTURE:ae("actionScope"),startTime:ae("startTime"),endTime:ae("endTime"),blockType:ae("blockType"),repeatCycle:ae("repeatCycle"),memo:ae("memo")},r,Se)},ye=()=>{if(d&&N){const e=null!==N&&void 0!==N&&N.blockStartDate?null===N||void 0===N?void 0:N.blockStartDate:(0,f.Am)(d.startDate),t=(0,f.JP)(e);m({d:t,as:"NONE"===se("repeatCycle")?g.cF.SINGLE:ae("actionScope")||g.cF.SINGLE,latestCalendarScheduleParams:r,handleClose:pe})}};return(0,a.useEffect)((()=>{d||z&&(J("startTime",null===z||void 0===z?void 0:z.formattedStart),J("endTime",null===z||void 0===z?void 0:z.formattedEnd),J("startDate",z.start),J("changeDate",z.start),J("staffId",z.staffId))}),[z,d]),(0,a.useEffect)((()=>{var e,t,s,a;if(!v&&!d)return ce();if(!d)return;const i=null!==N&&void 0!==N&&N.blockStartDate?null===N||void 0===N?void 0:N.blockStartDate:(0,f.Am)(d.startDate);Z({repeatCycle:d.repeatCycle,blockType:d.blockType,memo:d.memo,startDate:i,changeDate:i,startTime:null===(e=d.startTime)||void 0===e?void 0:e.slice(0,5),endTime:null===(t=d.endTime)||void 0===t?void 0:t.slice(0,5),staffId:d.staffId,detailForm:{startDate:i,startTime:null===(s=d.startTime)||void 0===s?void 0:s.slice(0,5),endTime:null===(a=d.endTime)||void 0===a?void 0:a.slice(0,5)}}),(0,ge.CV)([{valueName:"d",newValue:(0,f._y)(i)}],E),(0,ge.CV)([{valueName:"stffs",newValue:d.staffId}],E)}),[d,null===N||void 0===N?void 0:N.blockStartDate,M]),(0,a.useEffect)((()=>{(0,ge.CV)([{valueName:"ct",newValue:g.R4.DAILY}],E),(0,ge.CV)([{valueName:"d",newValue:(0,f._y)(ie)}],E),(0,ge.CV)([{valueName:"stffs",newValue:se("staffId")}],E),null===I||void 0===I||I(!0)}),[ne,oe,ie]),(0,a.useEffect)((()=>{W(de)}),[ee,ue,fe,me]),(0,a.useEffect)((()=>{H(Z)}),[Z,H,d]),(0,a.useEffect)((()=>(i&&window.innerWidth<=768?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""})),[i]),(0,a.useEffect)((()=>()=>{he()}),[]),(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)($e.Op,{...Q,children:[(0,R.jsx)("form",{onSubmit:X((e=>{if(d&&de)return xe?De():U(!0);D(!0),l({staffId:e.staffId,startDate:(0,b.$l)(e.changeDate,e.startTime),startTime:e.startTime,endTime:e.endTime,memo:e.memo,repeatCycle:e.repeatCycle,blockType:e.blockType},r,pe)})),children:(0,R.jsxs)(o.JC,{className:i?"open":"",$boxShadow:i?"-4px 16px 20px 0px rgba(0, 0, 0, 0.15)":"",children:[(0,R.jsx)(o.pT,{$minWidth:"448px",$maxWidthWt:"768px",$minWidthMd:"unset",children:(0,R.jsxs)(o.pT,{width:"100%",$borderBottom:"1px solid var(--color-gray-100)",padding:"16px 24px",$paddingWt:d?"16px 24px":"22px 24px 20px 24px",justify:"space-between",$maxHeight:"58px",children:[(0,R.jsx)(p.V9,{fontSize:h.$N.size18,$lineHeight:h.kj.height26,fontWeight:h.sO.medium,$fontSizeWt:h.$N.size20,$lineHeightWt:h.kj.height28,children:d?"\uc790\uc138\ud788\ubcf4\uae30":"\uc608\uc57d\uc81c\ud55c"}),(0,R.jsxs)(o.pT,{gap:"12px",children:[d&&(0,R.jsx)(o.pT,{width:"32px",height:"32px",border:"1px solid var(--color-gray-200)",radius:x.A.corner50,$hasCursor:!0,onClick:()=>{"NONE"===se("repeatCycle")?q(!0):K(!0)},children:(0,R.jsx)(Wt.A,{stroke:"var(--color-gray-400)"})}),(0,R.jsx)(o.pT,{onClick:he,$hasCursor:!0,children:(0,R.jsx)(Pt.A,{stroke:"var(--color-gray-700-main)"})})]})]})}),(0,R.jsx)(o.pT,{width:"100%",$widthWt:"768px",$widthMd:"100vw",margin:"0",height:"calc(100% - 148px)",direction:"column",justify:"start",padding:"20px 20px 48px",overflow:"auto",children:(0,R.jsx)(At,{blockDetailData:d,hasSchedule:le})}),(0,R.jsx)(o.pT,{width:"100%",gap:"16px",padding:"16px 24px 20px",$boxShadow:"0 -5px 7px rgba(117, 117, 117, 0.10)",background:"var(--color-white)",position:"absolute",style:{bottom:0},children:(0,R.jsx)(u.tB,{height:"52px",$activeTransform:"scale(0.8636)",background:"var(--color-primary-500-main)",$hoverBackgroun
1d:"var(--color-primary-400)",disabled:!!S||(d?!de:!i),$disabledBackground:"var(--color-gray-300)",children:d?"\uc800\uc7a5":"\ub4f1\ub85d"})})]})}),(0,R.jsx)(L.A,{modal:F,setModal:V,onSubmit:pe,description:"\uc608\uc57d \uc81c\ud55c\uc744 \ucde8\uc18c\ud560\uae4c\uc694?",caption:"\ud655\uc778 \uc2dc \uc785\ub825\ud55c \ub0b4\uc6a9\uc740 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"}),(0,R.jsx)(Ae,{modal:_,setModal:U,onSubmit:De,isChangeDate:ue,isChangeRepeatCycle:fe,isChangeOthers:me}),(0,R.jsx)(Ae,{modal:Y,setModal:K,onSubmit:ye,isDeleteModal:!0,isChangeDate:!1,isChangeRepeatCycle:!1,isChangeOthers:!1}),(0,R.jsx)(L.A,{modal:G,setModal:q,onSubmit:ye,description:"\uc608\uc57d \uc81c\ud55c\uc744 \uc0ad\uc81c\ud560\uae4c\uc694?",caption:"\uc0ad\uc81c\ud55c \uc815\ubcf4\ub294 \ub418\ub3cc\ub9b4 \uc218 \uc5c6\uc5b4\uc694"})]})})};var Ht=s(9970),zt=s(31899),Bt=s.n(zt),Ft=s(62721);s(25015);const Vt=e=>{const{selectedDate:t,setSelectedDate:s,selectedViewType:i,weekStartDate:n,weekEndDate:r,monthStartDate:l,monthEndDate:d,miniShopDayOffDtoList:c,miniWeeklyClosedDayOfWeekList:u,datesWithReservationsDtoList:g,publicHolidayList:v,setSelectedMonth:x}=e;(0,E.e)();const S=(0,E.E)((e=>e.isUnderWideTabletScreen)),[D,y]=(0,a.useState)({}),w=(e,t,s)=>{const a=(0,f._y)(t),i=g.find((e=>Object.keys(e)[0]===a)),n=null===i||void 0===i?void 0:i[a],r=u.includes(t.getDay()),l=c.find((e=>e.date===a)),d=s(t),m=!!l||r,x=!!v.find((e=>(0,f._y)(e.holidayDate)===a));return(0,R.jsxs)(o.pT,{direction:"column",padding:"8px 0",$minHeight:"44px",position:"relative",$zIndex:"100",onMouseEnter:()=>{S||i&&y((e=>({...e,[a]:!0})))},onMouseLeave:()=>{S||i&&y((e=>({...e,[a]:!1})))},onMouseDown:()=>{S&&i&&y((e=>({...e,[a]:!0})))},onMouseUp:()=>{S&&i&&y((e=>({...e,[a]:!1})))},children:[(0,R.jsx)(ye.hC,{$isSelected:d,$isShopOff:m,$isPublicHoliday:x,children:e}),i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ye.I$,{$isSelected:d}),D[a]&&(0,R.jsx)(o.vp,{top:"-24px",left:"50%",transform:"translateX(-50%)",$zIndex:"100",children:(0,R.jsx)(ye.q3,{children:(0,R.jsxs)(p.$w,{fontSize:h.$N.size12,$lineHeight:h.kj.height20,fontWeight:h.sO.regular,color:"var(--color-white)",$whiteSpace:"pre",children:[n,"\uac74"]})})})]}):(0,R.jsx)(o.pT,{height:"4px"})]})},j=e=>(0,f._y)(t)===(0,f._y)(e),k=e=>[n,r].some((t=>(0,f._y)(t)===(0,f._y)(e))),T=e=>[l,d].some((t=>(0,f._y)(t)===(0,f._y)(e)));return(0,R.jsxs)(R.Fragment,{children:[i===m[0].value&&(0,R.jsx)(Bt(),{inline:!0,locale:Ft.ko,calendarStartDay:1,calendarClassName:"miniCalendar",dateFormatCalendar:"yyyy\ub144 MM\uc6d4",selected:t,onChange:e=>s(e),onMonthChange:e=>x(e),renderDayContents:(e,t)=>w(e,t,j)}),i===m[1].value&&(0,R.jsx)(Bt(),{inline:!0,locale:Ft.ko,calendarStartDay:1,calendarClassName:"rangeMiniCalendar",dateFormatCalendar:"yyyy\ub144 MM\uc6d4",selected:t,startDate:n,endDate:r,onChange:e=>{s(e)},onMonthChange:e=>x(e),renderDayContents:(e,t)=>w(e,t,k)}),i===m[2].value&&(0,R.jsx)(Bt(),{inline:!0,locale:Ft.ko,calendarStartDay:1,calendarClassName:"rangeMiniCalendar",dateFormatCalendar:"yyyy\ub144 MM\uc6d4",selected:t,startDate:l,endDate:d,onChange:e=>{s(e)},onMonthChange:e=>x(e),renderDayContents:(e,t)=>w(e,t,T)})]})};var _t=s(29917);const Ut=e=>{const{selectedDate:t,setSelectedDate:s,selectedViewType:a,weekStartDate:i,weekEndDate:n,monthStartDate:r,monthEndDate:l,miniShopDayOffDtoList:d,miniWeeklyClosedDayOfWeekList:c,datesWithReservationsDtoList:p,publicHolidayList:h,setTodayTodoListModal:u,todayReservationTotalCount:f,todayReservationDtoList:g,hasNoReserveStatus:m,setSelectedMonth:v}=e;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(o.pT,{direction:"column",children:[(0,R.jsx)(Vt,{selectedDate:t,setSelectedDate:s,selectedViewType:a,weekStartDate:i,weekEndDate:n,monthStartDate:r,monthEndDate:l,miniShopDayOffDtoList:d,miniWeeklyClosedDayOfWeekList:c,datesWithReservationsDtoList:p,publicHolidayList:h,setSelectedMonth:v}),(0,R.jsx)(o.WZ,{background:"var(--color-gray-200)",margin:"24px 0"})]}),(0,R.jsx)(_t.A,{selectedDate:t,setTodayTodoListModal:u,todayReservationTotalCount:f,todayReservationDtoList:g,hasNoReserveStatus:m})]})};var Yt=s(53570),Kt=s(73019);const Gt=(e,t,s,i,n)=>{const o=(0,Pe.W)((e=>e.setToast));(0,a.useEffect)((()=>{i&&t&&!s&&e&&0===e.length&&(o("\uac80\uc0c9\ub41c \uacb0\uacfc\uac00 \uc5c6\uc5b4\uc694.","warning"),n(!1))}),[e,i])};var qt=s(65876),Qt=s(23175);const Zt=e=>{let{width:t=28,height:s=28,$widthWt:a,$heightWt:i,stroke:n="var(--color-primary-500-main)"}=e;return(0,R.jsxs)(Qt.E,{width:t,height:s,$widthWt:a,$heightWt:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28",fill:"none",children:[(0,R.jsxs)("g",{clipPath:"url(#clip0_159_32)",children:[(0,R.jsx)("path",{d:"M5 7C5 4.79086 6.79086 3 9 3H20.9974C22.102 3 22.9974 3.89543 22.9974 5V23C22.9974 24.1046 22.102 25 20.9974 25H9C6.79086 25 5 23.2091 5 21V7Z",fill:"white",stroke:"white",strokeWidth:"1.5"}),(0,R.jsx)("path",{d:"M24 20.5H9.5C7.84315 20.5 6.5 21.8431 6.5 23.5V23.5C6.5 25.1569 7.84315 26.5 9.5 26.5H20.4246",stroke:n,strokeWidth:"1.5"}),(0,R.jsx)("path",{d:"M15.6016 2V7.75C15.6016 8.20136 16.1524 8.42167 16.4636 8.09483L18.1016 6.375L19.7395 8.09483C20.0508 8.42167 20.6016 8.20136 20.6016 7.75V2",stroke:n,strokeWidth:"1.5",strokeLinejoin:"round"})]}),(0,R.jsx)("defs",{children:(0,R.jsx)("clipPath",{id:"clip0_159_32",children:(0,R.jsx)("rect",{width:"28",height:"28",fill:"white"})})})]})},Jt=e=>{let{handleModal:t}=e;const s=(0,i.zy)().pathname,{questDto:n,achievementRate:r,postUserQuest:l}=(0,Kt.A)(),[d,c]=(0,a.useState)(!1),[u,f]=(0,a.useState)(null);return(0,a.useEffect)((()=>
1{if(n){const e=n.filter((e=>!e.isAchieve)).find((e=>e.url===s));e&&e.id!==u&&(f(e.id),l(e.id))}}),[n,s,u]),(0,a.useEffect)((()=>{c(100===r)}),[r]),(0,R.jsx)(o.G2,{role:"button",display:"none",$displayWt:"flex",width:"64px",height:"64px",radius:x.A.corner50,position:"fixed",$zIndex:S.A.zIndexInlineTooltip,bottom:"22px",right:"22px",$rightWt:"34px",$hasCursor:!0,background:d?"var(--color-gray-400)":"var(--color-primary-500-main)",onClick:()=>{t()},children:(0,R.jsxs)(o.pT,{position:"relative",width:"56px",height:"56px",padding:"4px",direction:"column",gap:"2px",children:[(0,R.jsx)(o.G2,{top:"0",left:"0",width:"100%",height:"100%",border:"1.5px solid white",radius:x.A.corner50,opacity:"0.25"}),(0,R.jsx)(qt.Uw,{border:"2.5px solid white",achievementRate:r}),(0,R.jsx)(Zt,{stroke:d?"var(--color-gray-400)":"var(--color-primary-500-main)"}),(0,R.jsxs)(p.x5,{color:"var(--color-white)",fontSize:h.$N.size10,fontWeight:h.sO.medium,$lineHeight:"10px",children:[r,"%"]})]})})};var Xt=s(30956),es=s(78292),ts=s(82332);const ss=s.p+"static/media/ico_mieum_face.afb24c1ee16c2552b517f300e8348e92.svg",as="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAA+CAYAAACGPyP0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAATwSURBVHgB3Vq9VxtHEJ89uYIi5AW3SKVTRTy3JhFNUtqkDl9/AUmZNIYmaVEbCh8fTmmRkjQmD9rEuIIuQinjggZX0m1mbnVkpZs5rZDubuPfe3C72r2P383Hzc4OwAcEBTlAb2zM4aEOvV4dIKhiu4Z3qptBXRt8AtUGDW1s3YDSbyEITrF9ocLwBsbE1MgggQZE0RegVQN7DZgY6hQg2odK5diV2MRk9OrqBr799ekQYNHGazfV4eHuqIn3JmNIqOdAKlQM2lAJllFKbWnC2GRQnWrQ0y9ylEQ2FGyrg4MdbiiAMaDX1tahF70pjUj8ELCNz/GcG3KWTHwBvJDrfJiZAfj0EcDCAsD8PEC1an6jto1378zfdQegcw1weWX6o8BIyImMMxF68MePAZaepB96HFwhoVctc8x+su9sxzCSjBORRyiBr1fMcZo4OwdotbIl1QsW1S/hBTUzySCRLSQiu0RSmxUk8dWXkBuIyI8/yYSUulAH+4txU7qG8VrRX9J4rEY/fD+ZOrliFCHQm6huoezNetFrcaxIIvb9Zmf4ca226MBKpv9BfJF54aKI2CAb2tvjx3SwLEhGsX48tpGyiBDIS0pOJoiepcgYqQghChl7WUQSkOvnoOEpIxkKGhkQiTy9litIOjxqA2TMOkQIVUgqPoCLIvoYlkydnUUny2+keDiRiaIGO6u6AP8HDEumxs6adpiSEwbJaFVlZ80/BK/wd4f9eUgymreZhyW7YxsU0ty+Z4fuyPQzKnPsrAWPbObykv8dA05bMjV2kk9ECK1jYUD//h+ZbrfGzpkRgrsycPKbHDkHgRU1BwFvL75IhkjQQo0DrWnC0FIzrT5jJ/pg/Ml65j1v+PjsTTrYNsMbf5X31oXiVStrpdlWh2FITYuM4JZ9sJlORx4L1PJdk/5575alZYeGHTvDmUjGb+OX7Dbgut0uLxVf3LIUTg2FX4aM7255/hNhQH9s9wwZn90yYXZWGFAf2b1E6/x1ywRJ3dXgc/fJaHmF6QMkMlpzZATJ+ELGEWPtz5QGMS2Lm7sWsslIsZCnMGRUvHWdhi9kbm+dpiWS4bemrzNioiIhv9S23UnIvGWnSkvUoiFGzPra7vY/mvqCndzxRDISGa0HNMqQqVT4hfWV42Zp3vhHIlNp292YTBxGS07g7AxKh5Angwe8zRD22RMoiVCmVyNVF/JktO63+3ZCg9+IJSInJ1AaLqXtcyoUGsQdGVM5lJ4Qg3JVZblp6UVSOdcQhnPNOyCh2Sxe3eglynmylCYNkFFH4Smuq3nboYsevYTCkJUnQw3iqpvSsdmD4FuQIoLz84wbTBFJnkyEYl94ioyxnUBWNxL9z3uQG0YWMKjjJE+WGhHOAP3N2i6ObknjudQD0GeAJC/ZplI3mCdblArosspN5iDSrzFkqEMWVp7hfudSQVVMwaYkFUJ2IZAh9CZV8crhCW7gfr7kvmVIb5+iiz/+dCABJuF3dLCdNWV0iRYVBEW6NVJCNihFlazbkwwPSS7Z9aKv+jgxnwMRglvxHEmoG21n2lAeIBvpRTvq5ejK2Xg6jAG9uoFuO6K6mjnIG7jngsa+ORx/ZZ4CYyJWOyOldcgDJI1IN13UKnUq3BNTJ9UngR/t3fuUzseXgAlhKgahga2neLXGcGIu++6YKor0r+hyj+NQakL8C4qDxO4YkjoEAAAAAElFTkSuQmCC",is=s.p+"static/media/img_qrcode_and.9b6aa59697d18b7836f5.png",ns=s.p+"static/media/img_qrcode_ios.cf27e3c80f43ff2bf66e.png";var os=s(92633),rs=s(37687);const ls=e=>{const{modal:t,setModal:s,trackerInfo:i,selectedPromotionId:n,setShowFloating:r}=e,{putPromotion:l}=(0,rs.A)();(0,os.A)(t);const[d,c]=(0,a.useState)(!1),u=()=>c((e=>!e));return(0,a.useEffect)((()=>{i&&c(null===i||void 0===i?void 0:i.neverAskAgain)}),[i]),(0,R.jsx)(R.Fragment,{children:t&&(0,R.jsx)(Ee.hE,{children:(0,R.jsxs)(o.pT,{direction:"column",gap:"16px",children:[(0,R.jsx)(o.Z6,{width:"unset",height:"unset",$maxHeightWt:"calc(100dvh - 96px)",children:(0,R.jsxs)(Ee.lT,{$maxWidth:"560px",padding:"38px 32px 32px",$background:"linear-gradient(180deg, #FF9D9D 0%, #FF7878 100%)",children:[(0,R.jsx)(o.vp,{top:"34px",right:"21px",children:(0,R.jsx)("img",{src:ss,alt:"\ubbf8\uc74c\uc774"})}),(0,R.jsx)(o.vp,{top:"113px",right:"56px",$zIndex:S.A.zIndexDialog,children:(0,R.jsx)("img",{src:as,alt:"\ubbf8\uc74c\uc774\ud314",width:"26px",height:"32px"})}),(0,R.jsx)(o.vp,{top:"113px",right:"102px",$zIndex:S.A.zIndexDialog,transform:"scaleX(-1)",children:(0,R.jsx)("img",{src:as,alt:"\ubbf8\uc74c\uc774\ud314",width:"26px",height:"32px"})}),(0,R.jsxs)(o.pT,{direction:"column",align:"start",width:"calc(100% - 21px - 110px)",children:[(0,R.jsx)(p.V9,{color:"var(--color-white)",fontWeight:h.sO.regular,$lineHeight:h.kj.height32,children:"\ubbf8\uc74c\uc740 \ub354 \ud3b8\ub9ac\ud55c \uad00\ub9ac \uacbd\ud5d8\uc744 \uc120\uc0ac\ud560\uac8c\uc694!"}),(0,R.jsx)(p.V9,{color:"var(--color-white)",fontSize:h.$N.size22,fontWeight:h.sO.medium,$lineHeight:h.kj.height32,children:"PC\uc5d0\uc11c\ub3c4, \uc571\uc5d0\uc11c\ub3c4 \ub354 \uc27d\uac8c \uc6b4\uc601\ud558\uc138\uc694"})]}),(0,R.jsxs)(o.pT,{gap:"40px",margin:"24px 0 0",align:"start",children:[(0,R.jsxs)(o.pT,{direction:"column",gap:"10px",children:[(0,R.jsx)(o.pT,{$maxWidth:"228px",$maxHeight:"228px",padding:"29px",radius:x.A.corner24,background:"var(--color-white)",children:(0,R.jsx)("img",{src:is,alt:"\uad6c\uae00\ud50c\ub808\uc774\uc2a4\ud1a0\uc5b4 \ud050\uc54c\ucf54\ub4dc"})}),(0,R.jsx)("img",{src:ts.A,alt:"\uad6c\uae00\ud50c\ub808\uc774\uc2a4\ud1a0\uc5b4"})]}),(0,R.jsxs)(o.pT,{direction:"column",gap:"16px",$zIndex:S.A.zIndexInlineTooltip,children:[(0,R.jsx)(o.pT,{$maxWidth:"228px",$maxHeight:"228px",padding:"29px",radius:x.A.corner24,background:"var(--color-white)",children:(0,R.jsx)("img",{src:ns,alt:"\uc560\ud50c\uc2a4\ud1a0\uc5b4 \ud050\uc54c\ucf54\ub4dc"})}),(0,R.jsx)("img",{src:es.A,alt:"\uc560\ud50c\uc2a4\ud1a0\uc5b4",width:"94px"})]})]})]})}),(0,R.jsxs)(o.pT,{width:"100%",$maxWidth:"560px",justify:null!==i&&void 0!==i&&i.neverAskAgain?"end":"space-between",children:[!(null!==i&&void 0!==i&&i.neverAskAgain)&&(0,R.jsxs)(o.pT,{gap:"12px",onClick:e=>{e.stopPropagation(),u()},$hasCursor:!0,children:[(0,R.jsxs)(_.vm,{htmlFor:"neverAskAgain",children:[(0,R.jsx)("input",{type:"checkbox",id:"neverAskAgain",checked:d,onChange:u}),(0,R.jsx)(_.o4,{children:(0,R.jsx)("svg",{viewBox:"0 0 24 24",children:(0,R.jsx)("polyline",{points:"19 7 10 17 5 12"})})})]}),(0,R.jsx)(p.ld,{color:"var(--color-white)",fontWeight:h.sO.regular,children:"\ub2e4\uc2dc \ubcf4\uc9c0 \uc54a\uae30"})]}),(0,R.jsx)(o.pT,{$hasCursor:!0,onClick:()=>{d?l(n,i.id,{neverAskAgain:d,neverShowAgain:!1}
1,(()=>{r(!0),s(!1)})):(s(!1),r(!0))},justify:"end",children:(0,R.jsx)(p.ld,{color:"var(--color-white)",fontWeight:h.sO.regular,children:"\ub2eb\uae30"})})]})]})})})};var ds=s(13645);var cs=s(49774);const ps=()=>{var e,t,s,r,l,d;const c=(0,i.zy)(),p=(0,i.wQ)(),h=null===(e=c.state)||void 0===e?void 0:e.isFromInvite,{isDrawerOpen:u,isBlockOpen:g,isTabletRightDrawerOpen:v}=(0,C.A)((0,n.k)((e=>({isDrawerOpen:e.isDrawerOpen,isBlockOpen:e.isBlockOpen,isTabletRightDrawerOpen:e.isTabletRightDrawerOpen}))));(0,E.e)();const S=(0,E.E)((e=>e.isUnderPcScreen)),D=(0,cs.C)((e=>e.resetPageParams)),{shopId:y,hasNoReserveStatus:w,todayReservationDtoList:j,todayReservationTotalCount:k,setIsFetchTodayReservationData:b,staffDayOffDtoList:I,shopDayOffDtoList:L,weeklyClosedDayOfWeekList:O,blockDateKeyDtoList:$,reservationDateKeyDtoList:A,staffPreviewDtoList:N,setIsFetchCalendarScheduleData:P,isFetchingCalendarScheduleData:W,isSuccessCalendarScheduleData:M,setCalendarScheduleParams:H,calendarScheduleParams:z,hasCalendarData:B,staffPreviewList:F,deletedStaffPreviewList:V,setIsFetchStaffPreviewListData:_,isUpperAdmin:U,isOneOwnerShop:Y,staffIdList:K,miniShopDayOffDtoList:G,miniWeeklyClosedDayOfWeekList:Z,datesWithReservationsDtoList:J,setIsFetchMiniCalendarScheduleData:X,setMiniCalendarScheduleParams:ee,setIsEmptyCheckList:te,myStaffId:se,isMaster:ae}=(0,T.A)(),{detailInfo:ie}=(0,Ce.A)(),{questDto:ne,questModal:oe,setQuestModal:re,achievementRate:le}=(0,Kt.A)(),{setOpenAppModal:de,promotionTrackers:ce,openAppModal:pe,setShowFloating:he,selectedPromotionId:ue}=(0,ds.A)(),[fe,me]=(0,a.useState)(new Date),[ve,xe]=(0,a.useState)(new Date),[Se,De]=(0,a.useState)(null!==(t=localStorage.getItem("viewType"))&&void 0!==t?t:m[1].value),[ye,we]=(0,a.useState)(null!==(s=null===(r=localStorage.getItem("selectedStaffCheckList"))||void 0===r?void 0:r.split(","))&&void 0!==s?s:[]),[je,ke]=(0,a.useState)(null!==(l=null===(d=localStorage.getItem("quitStaffCheckList"))||void 0===d?void 0:d.split(","))&&void 0!==l?l:[]),[Te,be]=(0,a.useState)(null),[Ie,Le]=(0,a.useState)(!1),[Oe,Ee]=(0,a.useState)(null),[Re,$e]=(0,a.useState)(null),[Ae,Ne]=(0,a.useState)(null),[Pe,We]=(0,a.useState)(null),{newReservationPopup:Me,setNewReservationPopup:He}=Fe(),[ze,Be]=(0,a.useState)(!1),[Ve,_e]=(0,a.useState)([]),[Ue,Ye]=(0,a.useState)(!1);Gt(A,M,W,Ue,Ye);(0,a.useEffect)((()=>{Se===m[0].value&&(0,ge.CV)([{valueName:"d",newValue:(0,f._y)(fe)}],H)}),[fe,Se]),(0,a.useEffect)((()=>{Se===m[1].value&&null!==Oe&&null!==Re&&(fe.getTime()<Oe.getTime()||fe.getTime()>Re.getTime())&&(0,ge.CV)([{valueName:"d",newValue:(0,f._y)(fe)}],H)}),[fe.getTime(),Oe,Re,Se]),(0,a.useEffect)((()=>{Se===m[2].value&&(0,ge.CV)([{valueName:"d",newValue:(0,f._y)(fe)}],H)}),[fe.getMonth(),Se]),(0,a.useEffect)((()=>{(0,ge.CV)([{valueName:"m",newValue:(0,f._y)(ve)}],ee)}),[ve]),(0,a.useEffect)((()=>{(0,ge.CV)([{valueName:"ct",newValue:Se}],H)}),[Se]),(0,a.useEffect)((()=>{if(Y){const e=[se,...je],t=e.length>=1?e.join(","):null;(0,ge.CV)([{valueName:"stffs",newValue:t}],H),(0,ge.CV)([{valueName:"stffs",newValue:t}],ee)}else{const e=[...ye,...je],t=e.length>=1?e.join(","):null;te(0===e.length),(0,ge.CV)([{valueName:"stffs",newValue:t}],H),(0,ge.CV)([{valueName:"stffs",newValue:t}],ee)}}),[ye,je,Y,se]);const Ke=(e=>{const[t,s]=(0,a.useState)([]);return(0,a.useEffect)((()=>{(async()=>{const t=new URLSearchParams({serviceKey:decodeURIComponent("eiDXnFjU%2FBVMQ7xOEw4YCzwQgxywdxwwMpJ3rJap%2Fas1q3adzzNnGBLdGiMLuxnUQMApCT8R5L3ThJS4c0WUXw%3D%3D"),numOfRows:"365",solYear:e.getFullYear().toString(),_type:"json"});try{const e=await fetch("".concat("https://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getRestDeInfo","?").concat(t)),a=(await e.json()).response.body.items.item.map((e=>{const{dateName:t,locdate:s}=e;return{holidayName:"\uae30\ub3c5\ud0c4\uc2e0\uc77c"===t?"\ud06c\ub9ac\uc2a4\ub9c8\uc2a4":"1\uc6d41\uc77c"===t?"\uc0c8\ud574":t,holidayDate:(0,f.oz)(s)}}));s(a)}catch(a){(0,ge.aO)(a)}})()}),[e.getFullYear(),f.oz]),t})(fe);(0,a.useEffect)((()=>{b(!0),_(!0),P(!0),X(!0),"POP"!==p&&D()}),[]),(0,a.useEffect)((()=>{Y||(0!==ye.length||Ie||localStorage.getItem("selectedStaffCheckList")?h&&we(K):we(K))}),[Y,K,Ie,h]);const Ge=localStorage.getItem("selectedStaffCheckList");return(0,a.useEffect)((()=>
1{if(Ge){const e=Ge.split(",").filter((e=>K.includes(e)));e.length>0&&we(e)}}),[K]),(0,a.useEffect)((()=>{Y||(ye.length>0?localStorage.setItem("selectedStaffCheckList",ye.join(",")):localStorage.removeItem("selectedStaffCheckList"))}),[Y,ye]),(0,a.useEffect)((()=>{je.length>0&&localStorage.setItem("quitStaffCheckList",je.join(","))}),[je]),(0,a.useEffect)((()=>{localStorage.removeItem("selectedStaffCheckList"),localStorage.removeItem("quitStaffCheckList")}),[y]),(0,a.useEffect)((()=>{_e((null===ie||void 0===ie?void 0:ie.businessDayList)||[])}),[null===ie||void 0===ie?void 0:ie.businessDayList]),(0,a.useEffect)((()=>{switch(Se){case m[1].value:Ee((0,f.KG)(fe)[0]),$e((0,f.KG)(fe)[1]);break;case m[2].value:Ne((0,f.ek)(fe)[0]),We((0,f.ek)(fe)[1]);break;default:return}}),[fe,Se]),(0,R.jsxs)(R.Fragment,{children:[!B&&(0,R.jsx)(Ht.A,{}),(0,R.jsxs)(o.pT,{width:"100%",align:"start",children:[(0,R.jsxs)(o.pT,{width:"calc(100% - 360px)",direction:"column",gap:"24px",$widthLg:"100%",padding:"78px 24px 20px",$gapWt:"16px",$paddingLg:"78px 48px 20px 24px",$paddingWt:"78px 32px 16px 24px",children:[(0,R.jsx)(q,{selectedViewType:Se,setSelectedViewType:De,newReservationPopup:Me,setNewReservationPopup:He,selectedDate:fe,setSelectedDate:me,searchBarInput:Te,setSearchBarInput:be,onSearch:()=>{(0,ge.CV)([{valueName:"scn",newValue:Te}],H),!W&&M&&Ye(!0)},onClear:()=>{(0,ge.CV)([{valueName:"scn",newValue:null}],H),Ye(!1)},isDrawerOpen:u,calendarScheduleParams:z,isOneOwnerShop:Y,selectedStaffCheckList:ye,setSelectedStaffCheckList:we,quitStaffCheckList:je,setQuitStaffCheckList:ke,staffPreviewList:F,deletedStaffPreviewList:V,staffIdList:K,myStaffId:se,setIsClearSelectedStaffCheckList:Le}),(0,R.jsxs)(o.He,{className:"nonDraggable calendarContainer",position:"relative",radius:x.A.corner16,padding:"0",$boxShadow:"0px 2px 12px 0px rgba(0, 0, 0, 0.10)",height:"calc(100dvh - 162px)",$heightWt:"calc(100dvh - 202px)",$minHeight:"558px",$minHeightWt:Se===m[2].value?"884px":"558px",$overflowY:Se===m[1].value&&N.length>1?"auto":"",children:[Se===m[0].value&&(0,R.jsx)(R.Fragment,{children:N.length<=1?(0,R.jsx)(Dt,{selectedDate:fe,setSelectedDate:me,isDrawerOpen:u,shopDayOffDtoList:L,weeklyClosedDayOfWeekList:O,reservationDateKeyDtoList:A,staffDayOffDtoList:I,blockDateKeyDtoList:$,staffPreviewDtoList:N,shopBusinessHours:Ve,calendarScheduleParams:z,publicHolidayList:Ke,isBlockOpen:g}):(0,R.jsx)(kt,{selectedDate:fe,setSelectedDate:me,isDrawerOpen:u,shopDayOffDtoList:L,weeklyClosedDayOfWeekList:O,reservationDateKeyDtoList:A,staffDayOffDtoList:I,blockDateKeyDtoList:$,staffPreviewDtoList:N,shopBusinessHours:Ve,calendarScheduleParams:z,isBlockOpen:g})}),Se===m[1].value&&(N.length<=1?(0,R.jsx)(Qe,{selectedDate:fe,setSelectedDate:me,isDrawerOpen:u,shopDayOffDtoList:L,weeklyClosedDayOfWeekList:O,reservationDateKeyDtoList:A,staffDayOffDtoList:I,blockDateKeyDtoList:$,staffPreviewDtoList:N,calendarScheduleParams:z,publicHolidayList:Ke,isBlockOpen:g}):(0,R.jsx)(rt,{selectedDate:fe,setSelectedDate:me,shopDayOffDtoList:L,weeklyClosedDayOfWeekList:O,reservationDateKeyDtoList:A,staffPreviewDtoList:N,staffDayOffDtoList:I,blockDateKeyDtoList:$,calendarScheduleParams:z,publicHolidayList:Ke,isDrawerOpen:u,isBlockOpen:g})),Se===m[2].value&&(0,R.jsx)(ut,{selectedDate:fe,setSelectedDate:me,isDrawerOpen:u,shopDayOffDtoList:L,weeklyClosedDayOfWeekList:O,reservationDateKeyDtoList:A,staffPreviewDtoList:N,staffDayOffDtoList:I,blockDateKeyDtoList:$,calendarScheduleParams:z,publicHolidayList:Ke,isBlockOpen:g,selectedStaffCheckList:ye})]})]}),S?(0,R.jsx)(R.Fragment,{children:v?(0,R.jsxs)(o.JC,{className:"open",$heightWt:"100dvh",$boxShadow:"unset",$borderLeft:"1px solid var(--color-gray-200)",children:[(0,R.jsx)(Xt.A,{}),(0,R.jsx)(o.Z6,{$maxHeight:"100dvh",background:"var(--color-gray-50)",$paddingRight:"0",children:(0,R.jsx)(o.pT,{position:"relative",width:"100%",background:"var(--color-gray-50)",direction:"column",padding:"16px",justify:"start",children:(0,R.jsx)(Ut,{selectedDate:fe,setSelectedDate:me,selectedViewType:Se,weekStartDate:Oe,weekEndDate:Re,monthStartDate:Ae,monthEndDate:Pe,miniShopDayOffDtoList:G,miniWeeklyClosedDayOfWeekList:Z,datesWithReservationsDtoList:J,publicHolidayList:Ke,setTodayTodoListModal:Be,todayReservationTotalCount:k,todayReservationDtoList:j,isOneOwnerShop:Y,isUpperAdmin:U,selectedStaffCheckList:ye,setSelectedStaffCheckList:we,quitStaffCheckList:je,setQuitStaffCheckList:ke,staffPreviewList:F,deletedStaffPreviewList:V,staffIdList:K,myStaffId:se,setIsClearSelectedStaffCheckList:Le,hasNoReserveStatus:w,setSelectedMonth:xe})})})]}):(0,R.jsx)(o.JC,{className:"",$heightWt:"100dvh",$boxShadow:"unset",transform:"translateX(0%)",width:"20px",children:(0,R.jsx)(o.pT,{position:"relative",width:"100%",height:"100%",background:"var(--color-gray-50)",$borderLeft:"1px solid var(--color-gray-200)",children:(0,R.jsx)(Xt.A,{})})})}):(0,R.jsx)(o.Z6,{width:"unset",$overflowX:"hidden",$maxHeight:"100%",$paddingRight:"0",background:"var(--color-gray-50)",children:(0,R.jsx)(o.pT,{width:"360px",height:"100dvh",$minHeight:"720px",background:"var(--color-gray-50)",direction:"column",padding:"78px 16px 16px",justify:"start",children:(0,R.jsx)(Ut,{selectedDate:fe,setSelectedDate:me,selectedViewType:Se,weekStartDate:Oe,weekEndDate:Re,monthStartDate:Ae,monthEndDate:Pe,miniShopDayOffDtoList:G,miniWeeklyClosedDayOfWeekList:Z,datesWithReservationsDtoList:J,publicHolidayList:Ke,setTodayTodoListModal:Be,todayReservationTotalCount:k,todayReservationDtoList:j,isOneOwnerShop:Y,hasNoReserveStatus:w,setSelectedMonth:xe})})})]}),(0,R.jsx)(Q.A,{todayTodoListModal:ze,setTodayTodoListModal:Be,todayReservationTotalCount:k,todayReservationDtoList:j}),u&&(0,R.jsx)(ft.A,{isDrawerOpen:u,calendarScheduleParams:z}
1),g&&(0,R.jsx)(Mt,{isBlockOpen:g,setNewReservationPopup:He,calendarScheduleParams:z}),ae&&(0,R.jsx)(Jt,{handleModal:()=>{re(!0)}}),(0,R.jsx)(Yt.A,{questModal:oe,setQuestModal:re,questDto:ne,achievementRate:le}),pe&&(0,R.jsx)(ls,{modal:pe,setModal:de,setShowFloating:he,trackerInfo:ce,selectedPromotionId:ue})]})}},11837:(e,t,s)=>{s.d(t,{RG:()=>r,iv:()=>n,kW:()=>o,tj:()=>l});var a=s(94839),i=s(56743);const n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const s=[];for(let a=0;a<e.length;a+=t)s.push(e.slice(a,a+t));return s},o=e=>e.filter((e=>e.isBreakDay)).map((e=>e.dayOfWeek)).map((e=>{const t=a.Ei.find((t=>t.value===e));return t?t.text:""})).filter((e=>""!==e)),r=(e,t,s)=>{const a=[];let i=e;for(;i<=t;){a.push(i);let[e,t]=i.split(":").map(Number);t+=s,t>=60&&(t-=60,e+=1),i="".concat(String(e).padStart(2,"0"),":").concat(String(t).padStart(2,"0"))}return a},l=(e,t)=>e.filter((e=>e.couponType===t)).map((e=>({id:e.id,name:e.name,endDate:e.endDate,remainingCount:e.remainingCount,remainingAmount:e.remainingAmount,couponLinkedProductInfoList:t===i.y9.PASS&&e.couponLinkedProductInfoList,passCount:t===i.y9.PASS&&e.passCount})))}}]); 2//# sourceMappingURL=9119.0242276c.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.