PageSourceSearch

https://cdn.joinhomebase.com/assets/index-chunk-CluoUJxv.js

js joinhomebase.com collected 2026-09-24 08:34:38 UTC 39,181 bytes, 2 lines download raw bytes

1import{reactExports as u,jsxRuntimeExports as e}from"./react-core-chunk-B2r03cU8.js";import{createSelector as gs,useDispatch as T,useSelector as p}from"./redux-core-chunk-DgWMjMkF.js";import{getCurrentUserIsOwner as js,getCurrentUserIsManagerial as Re,getCurrentUserHasUsedMobile as fs,fetchTeamAnnouncements as bs,acknowledgeAnnouncement as vs,PageWithSubcomponents as S,Box_default as n,Pill_default as R,Icon_default as ys,Avatar_default as Pe,Text_default as i,Button_default as f,cxHelpers as M,useQuery as Cs,useHistory as ks,useIsMediumScreen as L,Skeleton_default as q,getSmartCoverRequestsExperiment as Q,handleEmptyJsonResponse as de,removeTrade as ws,fetchTrades as P,actions$2 as ne,Alert_default as ae,ActionButtons_default as me,formatShift as H,getRequestHeader as Me,getPendingState as oe,stateToPillVariant as ie,Dialog_default as O,getSmartCoverRequestHeader as Ss,getQualificationsLabel as Ts,getReasonForNeededCoverLabel as Es,isDeniedByManager as Ce,selectIncomingTrades as Ds,selectTradesLoading as Le,selectOutgoingTrades as Fe,selectSelectedTradesTab as $s,useIsSmallScreen as Ue,setSelectedTradesTab as As,SegmentedPicker_default as Be,TRADES_TAB_OPTIONS as qs,ObjectSchema as Os,StringSchema as Is,withUxPartition as Ns,useTrackUx as F,flashNotice as ue,Formik as he,Form as _e,formatPhoneNumber as Rs,PhoneField as Ps,useFormikContext as Ms,LinearProgress_default as Ls,selectJobsForTimeOffModal as We,updateTimeOff$1 as Fs,openTimeOffModal as He,deleteTimeOff$1 as Us,IconButton_default as ke,selectTimeOffs as Bs,selectTimeOffsLoading as Ws,selectPTOPolicies as Hs,fetchTimeOffs$1 as Ve,toCurrency as we,getCurrentLocationEntity as Vs,selectUserTotals as zs,selectTotalsLoading as Ks,Link_default as Gs,browserHistory as ze,List_default as Ke,SelectField as Ge,TextField as Ye,selectAvailableForCoverage as Qe,selectAvailableForCoverageLoading as Je,fetchAvailableForCoverage as Xe,CircularInfinite_default as Ze,selectAvailableForTrade as Ys,selectAvailableForTradeLoading as Qs,fetchAvailableForTrade as Js,Toast as Xs,selectOpenShifts as Zs,selectShiftsLoading as es,getCurrentUserFirstName as ss,getCurrentUserLastName as et,showNotification as Se,Tooltip_default as st,selectUserShifts as tt,selectSelectedScheduleTab as nt,selectDateRange as ts,selectIsDateRangeLoading as ns,fetchProfile as rt,fetchShifts as at,setSelectedScheduleTab as ot,SHIFT_TAB_OPTIONS as it,withUxRoot as lt,getLocationStartOfWeek as ct,setDateRange$1 as Te}from"./app-init-chunk-kk_CZVyp.js";import{FDBPayPeriodPicker as dt}from"./FDBPayPeriodPicker-chunk-DNtqqBQD.js";import{RANGE_PICKER_WIDTH as Ee}from"./CommonPresetConstants-chunk-BNvXgbB8.js";import{useCredentialsVerificationPageNudge as ut,CredentialsVerificationPageDialogs as mt,CredentialsVerificationPageAlert as ht}from"./selectors-chunk-CneQwkCV.js";import{trackTeamAnnouncementsEvent as Z,toI18n as t,formatDate as re,hooks as K,df as Y,momentWithCustomLocale as De}from"./tracking-chunk-Cdw_Cfie.js";import{TRACK_ACTIONS as ee,fetchJSON as _t,deleteJSON as $e,putJSON as xe,EVENT_CATEGORIES as rs,EVENT_ACTIONS as $,TRACK_ACTION_TYPES as A,postJSON as V,PRODUCT_AREAS as xt}from"./app-bundle-B0YfsjKz.js";import{ONBOARDING_DOCUMENTS_QUERY_KEY as pt,ONBOARDING_REQUEST_PACKET_KIND as gt}from"./constants-chunk-DR1ocnla.js";import{getCoverRequestReasonOptions as jt}from"./helpers-chunk-B3OnalmE.js";import{SmartCoverRequestScheduleModal as ft}from"./index-chunk-DwFF2HFf.js";try{(function(){var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="6b12ea53-b963-44b4-b56d-db307665cdbe",s._sentryDebugIdIdentifier="sentry-dbid-6b12ea53-b963-44b4-b56d-db307665cdbe")})()}catch{}const bt=gs(js,Re,fs,(s,r,a)=>!s&&!r&&!a),vt=s=>s.getIn(["dashboard","teamAnnouncements"]),{cx:yt}=M("AnnouncementsView"),Ct=()=>{const[s,r]=u.useState(0),a=T(),o=p(vt),c=u.useCallback(()=>{a(bs()),Z(ee.VIEW)},[a]);u.useEffect(()=>{c()},[c]);const l=u.useMemo(()=>o.size?o.toList().sortBy(m=>!m.get("needs_acknowledgement")).toArray():[],[o]),h=l[s],d=h?.get("needs_acknowledgement"),x=u.useCallback(()=>{Z(ee.CLOSED);const m=s<l.length-1;r(m?s+1:0),Z(ee.VIEW)},[s,l.length]),_=u.useCallback(()=>{a(vs(h.get("id"),()=>{Z(ee.CLOSED),c()}))},[h,a,c]);return l.length?e.jsx(S.Section,{title:t("my_week.team_announcements_section.announcement"),children:e.jsx(S.Card,{children:e.jsxs(n,{className:yt(),children:[e.jsxs(n,{hright:!0,row:!0,vcenter:!0,gap:"xs",children:[d&&e.jsx(n,{children:e.jsx(R,{children:t("my_week.team_announcements_section.acknowledgement_required")})}),e.jsx(n,{pointer:!0,onClick:x,children:e.jsx(ys,{iconName:"Close",size:"xsmall"})})]}),e.jsxs(n,{alignItemsStart:!0,children:[e.jsx(Pe,{size:"medium",image:h.get("avatar_url")}),e.jsxs(n,{ml:"xs",children:[e.jsx(n,{children:e.jsxs(n,{children:[e.jsx(i,{variant:"bodySmBoldTight",children:h.get("sending_user_name")}
1),e.jsxs(i,{variant:"captions",children:[re(h.get("created_at"),"msg_date_time"),", ",h.get("description")]})]})}),e.jsx(n,{mt:"xs",row:!0,gap:"xs",children:e.jsxs(i,{variant:"bodyBoldTight",children:[t("my_week.team_announcements_section.subject"),h.get("subject")]})}),e.jsx(n,{mt:"xs",maxh:64,overflow:"auto",pr:"md",children:e.jsx(i,{variant:"bodySmTight",children:h.get("body")})}),e.jsx(n,{mt:"md",children:d&&e.jsx(f,{size:"small",onClick:_,children:t("my_week.team_announcements_section.acknowledge")})})]})]})]})})}):null},kt="/employee_onboarding/dashboard_cards/onboarding_documents",wt=()=>{const{data:s,isLoading:r,error:a}=Cs({queryKey:pt,queryFn:()=>_t(kt),staleTime:3e5});return{showCard:!r&&!a&&s?.show_card&&s?.packet_id!=null,isLoading:r,data:s}},E={HIDDEN:"hidden",APPROX_MINUTES:"approx_minutes",DAYS:"days",DUE_TODAY:"due_today",OVERDUE:"overdue"},St=864e5,Tt=s=>new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime(),Et=s=>{const a=s.split("T")[0].split("-").map(Number);if(a.length!==3||a.some(h=>Number.isNaN(h)))return null;const[o,c,l]=a;return new Date(o,c-1,l).getTime()},Dt=(s,r,a=new Date)=>{if(!s)return{kind:E.APPROX_MINUTES};if(r==null||r==="")return{kind:E.HIDDEN};const o=Et(r);if(o==null)return{kind:E.HIDDEN};const c=Tt(a),l=Math.round((o-c)/St);return l<0?{kind:E.OVERDUE}:l===0?{kind:E.DUE_TODAY}:{kind:E.DAYS,count:l}},$t=2,At=(s,r)=>{switch(s.kind){case E.APPROX_MINUTES:{const a=Math.max(0,r)*$t;return t("my_week.complete_onboarding_cta.time_approx_minutes",{props:{count:a}})}case E.DAYS:return t("my_week.complete_onboarding_cta.days_left",{props:{count:s.count}});case E.DUE_TODAY:return t("my_week.complete_onboarding_cta.due_today");case E.OVERDUE:return t("my_week.complete_onboarding_cta.overdue");case E.HIDDEN:return""}},qt=({packetId:s,packetType:r,packetsFulfilledCount:a,packetsTotalCount:o,packetStarted:c,startDate:l})=>{const h=ks(),d=!L(),x=u.useCallback(()=>{const g=r===gt.SINGLE_DOCUMENT_PACKET?"/employee_onboarding/single_document_packet":"/employee_onboarding/packet";h.push(`${g}/${s}`)},[s,r,h]);if(!s)return null;const _=Dt(c,l),m=At(_,o);return e.jsxs(n,{column:d,row:!d,alignItemsCenter:!d,justifyContentSpaceBetween:!d,gap:"sm",p:"md",bradiusm:!0,bgcolor:"purple900",children:[e.jsxs(n,{column:!0,gap:"xs",children:[e.jsxs(n,{row:!0,gap:"xs",children:[e.jsx(R,{variant:"mono",children:t("my_week.complete_onboarding_cta.progress",{props:{fulfilled:a,total:o}})}),_.kind!==E.HIDDEN&&e.jsx(R,{variant:"primary",children:m})]}),e.jsxs(i,{variant:"heading4",color:"mono0",children:[t("my_week.complete_onboarding_cta.title")," ",e.jsx("span",{"aria-hidden":"true",children:"🎉"})]}),e.jsx(i,{color:"mono0",children:t("my_week.complete_onboarding_cta.description")})]}),e.jsx(n,{maxw:d?void 0:250,w:d?"100%":void 0,children:e.jsx(f,{uxElement:"open_packet",size:"small",fullWidth:d,onClick:x,children:t("my_week.complete_onboarding_cta.cta")})})]})},J=()=>e.jsxs(n,{p:16,column:!0,gap:16,children:[e.jsx(q,{width:"100%",height:72,bradiuss:!0}),e.jsx(q,{width:"100%",height:72,bradiuss:!0}),e.jsx(q,{width:"100%",height:72,bradiuss:!0})]}),pe=()=>{const[s,r]=u.useState({open:!1,actionType:"accept"}),a=u.useCallback(()=>{r(h=>({...h,open:!1}))},[]),o=u.useCallback(()=>{r({open:!0,actionType:"accept"})},[]),c=u.useCallback(()=>{r({open:!0,actionType:"decline"})},[]),l=u.useCallback(()=>{r({open:!0,actionType:"delete"})},[]);return{dialogConfig:s,handleCloseDialog:a,handleOpenAcceptModal:o,handleOpenDeclineModal:c,handleOpenDeleteModal:l}},ce="my_week.user.shift_trade_requests.request_confirmation_modal",ge=({actionType:s,requestType:r,tradeId:a,onClose:o})=>{const c=T(),[l,h]=u.useState(!1),[d,x]=u.useState(null),_=p(Q),m=u.useCallback(async()=>{h(!0),x(null);try{s==="delete"?(_?await $e("/covers/destroy_cover_request",{trade_id:a}):await de($e(`/trades/${a}.json`)),c(ws(a))):(await de(xe(`/trades/${a}/${s==="decline"?"reject":s}.json`)),c(P()));const j=t(`my_week.user.shift_trade_requests.${r==="cover"?"smart_cover_requests":"trade_requests"}.${s}_${r}_success`);c(ne.openGlobalToast({content:j,toastProps:{variant:"success",autoHide:!0,hideCloseIcon:!0},initiatedFrom:"smart_cover_request_modal"})),o()}catch{x(t("fe_design_base.errors.general")),c(ne.openGlobalToast({content:t("fe_design_base.errors.general"),toastProps:{variant:"error",autoHide:!0,hideCloseIcon:!0},initiatedFrom:"smart_cover_request_modal"}
1)),s==="delete"&&c(P())}finally{h(!1)}},[s,r,a,o,c,_]);return e.jsxs(n,{ph:24,pv:16,column:!0,gap:16,maxw:500,children:[e.jsxs(n,{mb:16,children:[e.jsx(n,{mb:8,children:e.jsx(i,{variant:"heading2",children:t(`${ce}.${s}.header`,{props:{requestType:r}})})}),e.jsx(i,{variant:"body",children:t(`${ce}.${s}.subheader`)})]}),d&&e.jsx(ae,{variant:"error",children:d}),e.jsx(n,{mt:24,children:e.jsx(me,{buttons:[{label:t(`${ce}.${s}.confirm_button`),variant:s==="delete"?"primaryDestructive":"primary",onClick:m,isLoading:l},{label:t("actions.cancel"),variant:"tertiary",onClick:o,disabled:l}]})})]})},Ae="my_week.user.shift_trade_requests",as=({trade:s,coverType:r})=>{const{dialogConfig:a,handleCloseDialog:o,handleOpenAcceptModal:c,handleOpenDeclineModal:l,handleOpenDeleteModal:h}=pe(),d=!L(),x=H(s.shift),_=s.location_name?`(${s.location_name})`:"",{headerI18nKey:m,headerI18nProps:g}=Me({type:r,isTrade:!1,requesterName:s.requester_first_name,receiverName:s.receiver_first_name});return e.jsxs(e.Fragment,{children:[e.jsxs(n,{flex:!0,column:d,vcenter:!0,p:16,children:[e.jsxs("div",{children:[e.jsxs(n,{flex:!0,column:d,gap:8,vcenter:!0,children:[e.jsx(i,{variant:"bodySmBoldTight",children:m?t(m,{props:g||{}}):null}),e.jsx(R,{variant:ie(s.state,!1,s.responder_name,s.receiver_name),children:oe(s.state,!1,s.responder_name,s.receiver_name)})]}),e.jsx(i,{variant:"bodySmTight",children:`${x.date} `}),e.jsx(i,{variant:"bodySmTight",children:`${x.time} ${x.roleName} ${_}`})]}),r==="incoming"&&s.state==="pending"&&e.jsxs(n,{ml:d?0:"auto",flex:!0,gap:8,children:[e.jsx(n,{minw:127,children:e.jsx(f,{fullWidth:!0,variant:"primary",size:"small",onClick:c,children:t(`${Ae}.accept_cover`)})}),e.jsx(n,{minw:127,children:e.jsx(f,{fullWidth:!0,variant:"secondary",size:"small",onClick:l,children:t(`${Ae}.decline_cover`)})})]}),r==="outgoing"&&s.state!=="approved"&&e.jsx(n,{ml:d?0:"auto",children:e.jsx(f,{variant:"secondaryDestructive",size:"small",onClick:h,children:t("actions.delete")})})]}),e.jsx(O,{open:a.open,onClose:o,children:()=>e.jsx(ge,{actionType:a.actionType,requestType:"cover",tradeId:s.id,onClose:o})})]})},os=({type:s})=>e.jsx(n,{p:16,minh:63,hcenter:!0,vcenter:!0,children:e.jsx(i,{children:t("my_week.user.shift_trade_requests.no_covers",{props:{action:s}})})}),qe="my_week.user.shift_trade_requests.smart_cover_requests",Ot=({shiftTime:s="",roleName:r="",locationName:a="",requesterName:o="",shiftDate:c="",qualifications:l="",reasonForNeededCover:h="",onAccept:d,onDecline:x,onDelete:_,trade:m,coverType:g})=>{const j=!L(),v=jt(),C=h||m.reason,b=v.find(U=>U.value===C),y=b?b.label:C,k=l||m.requirement,{headerI18nKey:w,headerI18nProps:D}=Ss({type:g,isTrade:!1,requesterName:m.requester_first_name,receiverName:m.receiver_first_name});return e.jsxs(n,{flex:!0,vcenter:!0,row:!0,justifyContentSpaceBetween:!0,alignItemsCenter:!0,w:"100%",p:16,children:[e.jsxs(n,{column:!0,children:[e.jsxs(n,{flex:!0,gap:8,vcenter:!0,mb:10,children:[e.jsxs(n,{flex:!0,row:!0,gap:8,alignItemsCenter:!0,children:[e.jsx(Pe,{size:"large",image:m.requester_avatar_url||m.receiver_avatar_url||"",initials:m.requester_first_name?m.requester_first_name.charAt(0):""}),e.jsxs(n,{flex:!0,column:!0,children:[e.jsx(i,{variant:"bodySmBoldTight",color:"mono900",children:g==="outgoing"?"You":o||m.requester_first_name}),e.jsx(i,{variant:"captions",color:"mono700",children:w&&t(w,{props:D||{}})})]})]}),e.jsx(R,{variant:ie(m.state,!1,m.responder_name,m.receiver_name),children:oe(m.state,!1,m.responder_name,m.receiver_name)})]}),e.jsxs(n,{column:!0,children:[g==="outgoing"&&m.receiver_first_name&&e.jsx(n,{mb:4,children:e.jsx(i,{variant:"bodySmBold",color:"mono900",children:m.receiver_first_name})}),e.jsx(i,{variant:"bodySmTight",children:`${c} `}),e.jsxs(i,{variant:"bodySmTight",children:[`${s}`,r&&e.jsxs(e.Fragment,{children:[" •",` ${r.replace(/[()]/g,"")}`]}),a&&e.jsxs(e.Fragment,{children:[" •",` ${a.replace(/[()]/g,"")}`]})]}),k&&e.jsxs(n,{flex:!0,row:!0,gap:8,mt:6,children:[e.jsx(i,{variant:"bodySmBold",color:"mono900",children:Ts()}),e.jsx(i,{variant:"bodySm",color:"mono900",children:k})]}),y&&e.jsxs(n,{flex:!0,row:!0,gap:8,mt:6,children:[e.jsx(i,{variant:"bodySmBold",color:"mono900",children:Es()}),e.jsx(i,{variant:"bodySm",color:"mono900",children:y})]})]})]}),e.jsxs(n,{flex:!0,justifyContentEnd:!0,children:[g==="incoming"&&m.state==="pending"&&e.jsxs(n,{ml:j?0:"auto",flex:!0,gap:8,children:[e.jsx(n,{minw:127,children:e.jsx(f,{fullWidth:!0,variant:"secondary",size:"small",onClick:x,children:t(`${qe}.decline_cover`)})}),e.jsx(n,{minw:127,children:e.jsx(f,{fullWidth:!0,variant:"primary",size:"small",onClick:d,children:t(`${qe}.accept_cover`)})})]}),g==="incoming"&&m.state==="accepted"&&e.jsx(n,{ml:j?0:"auto",children:e.jsx(f,{variant:"secondary
1Destructive",size:"medium",onClick:x,children:t("actions.cancel")})}),g==="incoming"&&Ce(m.state,m.responder_name,m.receiver_name)&&e.jsx(n,{ml:j?0:"auto",children:e.jsx(f,{variant:"secondaryDestructive",size:"medium",onClick:_,children:t("actions.cancel")})}),g==="outgoing"&&m.state!=="approved"&&m.state!=="accepted"&&!Ce(m.state,m.responder_name,m.receiver_name)&&e.jsx(n,{ml:j?0:"auto",children:e.jsx(f,{variant:"secondaryDestructive",size:"small",onClick:_,children:t("my_week.user.time_off_requests.delete_button")})})]})]})},is=({trade:s,coverType:r})=>{const{dialogConfig:a,handleCloseDialog:o,handleOpenAcceptModal:c,handleOpenDeclineModal:l,handleOpenDeleteModal:h}=pe(),d=H(s.shift),x=s.location_name?`(${s.location_name})`:"";return e.jsxs(e.Fragment,{children:[e.jsx(n,{flex:!0,vcenter:!0,p:16,children:e.jsx(Ot,{reasonForNeededCover:s.reason,qualifications:s.requirement,shiftTime:d.time,roleName:d.roleName,locationName:x,requesterName:s.requester_first_name,shiftDate:d.date,onAccept:c,onDecline:l,onDelete:h,trade:s,coverType:r})}),e.jsx(O,{open:a.open,onClose:o,children:()=>e.jsx(ge,{actionType:a.actionType,requestType:"cover",tradeId:s.id,onClose:o})})]})},It="my_week.user.shift_trade_requests",Nt=({tradeId:s})=>{const r=T(),[a,o]=u.useState(!1),c=u.useCallback(async()=>{o(!0);try{await de(xe(`/trades/${s}/reject.json`)),r(ne.openGlobalToast({content:t(`${It}.trade_requests.undo_accept_success`),toastProps:{variant:"success",autoHide:!0,hideCloseIcon:!0},initiatedFrom:"trade_request_card"})),r(P())}catch{r(ne.openGlobalToast({content:t("fe_design_base.errors.general"),toastProps:{variant:"error",autoHide:!0,hideCloseIcon:!0},initiatedFrom:"trade_request_card"}))}finally{o(!1)}},[s,r]);return{isUndoingAccept:a,handleUndoAccept:c}},G="my_week.user.shift_trade_requests",ls=({trade:s,tradeType:r})=>{const{dialogConfig:a,handleCloseDialog:o,handleOpenAcceptModal:c,handleOpenDeclineModal:l,handleOpenDeleteModal:h}=pe(),{isUndoingAccept:d,handleUndoAccept:x}=Nt({tradeId:s.id}),_=!L(),m=H(s.trade_shift),g=H(s.shift),j=s.location_name?`(${s.location_name})`:"",v=r==="incoming"?g:m,C=r==="incoming"?m:g,{headerI18nKey:b,headerI18nProps:y}=Me({type:r,isTrade:!0,requesterName:s.requester_first_name,receiverName:s.receiver_first_name});return e.jsxs(e.Fragment,{children:[e.jsxs(n,{flex:!0,column:_,vcenter:!0,p:16,children:[e.jsxs("div",{children:[e.jsxs(n,{flex:!0,column:_,gap:8,vcenter:!0,children:[e.jsx(i,{variant:"bodySmBoldTight",children:b?t(b,{props:y||{}}):null}),e.jsx(R,{variant:ie(s.state),children:oe(s.state)})]}),e.jsx(i,{variant:"bodySmTight",children:`${t(`${G}.you_would_work`)} ${v.date} ${v.time} ${v.roleName}`}),e.jsx(i,{variant:"bodySmTight",children:`${t(`${G}.they_would_work`)} ${C.date} ${C.time} ${C.roleName} ${j}`})]}),r==="incoming"&&s.state==="pending"&&e.jsxs(n,{ml:_?0:"auto",flex:!0,gap:8,children:[e.jsx(n,{minw:127,children:e.jsx(f,{fullWidth:!0,variant:"primary",size:"small",onClick:c,children:t(`${G}.accept_trade`)})}),e.jsx(n,{minw:127,children:e.jsx(f,{fullWidth:!0,variant:"secondary",size:"small",onClick:l,children:t(`${G}.decline_trade`)})})]}),r==="incoming"&&s.state==="accepted"&&e.jsx(n,{ml:_?0:"auto",children:e.jsx(f,{variant:"secondaryDestructive",size:"small",onClick:x,disabled:d,children:t(`${G}.undo_accept_trade`)})}),r==="outgoing"&&s.state!=="approved"&&e.jsx(n,{ml:_?0:"auto",children:e.jsx(f,{variant:"secondaryDestructive",size:"small",onClick:h,children:t("actions.delete")})})]}),e.jsx(O,{open:a.open,onClose:o,children:()=>e.jsx(ge,{actionType:a.actionType,requestType:"trade",tradeId:s.id,onClose:o})})]})},Rt=()=>{const s=p(Ds),r=p(Le),a=p(Q);return r?e.jsx(J,{}):s.length?e.jsx("div",{children:s.map(o=>o.trade_shift?e.jsx(ls,{trade:o,tradeType:"incoming"},o.id):e.jsx("div",{children:a?e.jsx(is,{trade:o,coverType:"incoming"}):e.jsx(as,{trade:o,coverType:"incoming"})},o.id))}):e.jsx(os,{type:"received"})},{cx:Pt,cxEl:Oe}=M("OutgoingRequests"),Mt=()=>{const s=p(Fe),r=p(Le),a=p(Q);return r?e.jsx(J,{}):s.length?e.jsx(n,{className:Pt(),maxh:450,overflow:"auto",children:s.map(o=>o.trade_shift?e.jsx("div",{className:Oe("TradeRequest"),children:e.jsx(ls,{trade:
1o,tradeType:"outgoing"})},o.id):e.jsx("div",{className:Oe("CoverRequest"),children:a?e.jsx(is,{trade:o,coverType:"outgoing"}):e.jsx(as,{trade:o,coverType:"outgoing"})},o.id))}):e.jsx(os,{type:"requested"})},{cx:Lt}=M("CoversAndTrades"),Ft=()=>{const s=T(),r=p($s),a=!Ue(),o=u.useCallback((c,l)=>{s(As(l))},[s]);return e.jsxs(S.Card,{children:[e.jsx(Be,{options:qs,tabValue:r,onChange:o,fullWidth:!0,scrollable:a}),e.jsx(n,{className:Lt(),children:r==="incoming-requests"?e.jsx(Rt,{}):e.jsx(Mt,{})})]})},Ut="https://cdn.joinhomebase.com/assets/iphone-tophalf-bundle-aIDSWHZG.png",Bt=Os().shape({phone:Is().matches(/^\d{10}$/,t("my_week.download_app_section.error")).required(t("my_week.download_app_section.error"))});function Wt(){const{errors:s,touched:r}=Ms(),a=F();return u.useEffect(()=>{s.phone&&r.phone&&a($.ERROR_MESSAGE_SHOWN,A.VIEW,{error_message:s.phone})},[s.phone,r.phone,a]),null}const Ht=({isSmallScreen:s})=>{const r=F(),[a,o]=u.useState(!1),[c,l]=u.useState(!0),h=u.useCallback(async(_,{setSubmitting:m})=>{r($.GET_APP_CLICKED,A.CLICK);try{await V("/users/download_app_sms",{phone:_.phone}),o(!0)}catch(g){ue.error(t("errors.generic"));const j=await g.response.text();r($.ERROR_MESSAGE_SHOWN,A.VIEW,{error_message:j})}finally{m(!1)}},[r]),d=u.useCallback(()=>{r($.FIELD_FOCUSED,A.CLICK)},[r]),x=u.useCallback(()=>{l(!1)},[]);return c?e.jsx(S.Section,{children:e.jsx(S.Card,{children:e.jsx(he,{initialValues:{phone:""},validationSchema:Bt,onSubmit:h,children:({isSubmitting:_,values:m})=>e.jsxs(_e,{children:[e.jsx(Wt,{}),e.jsxs(n,{row:!0,gap:"lg",children:[!s&&e.jsx(n,{shrink:0,children:e.jsx("img",{src:Ut,alt:"iphone",width:200,height:192})}),e.jsxs(n,{column:!0,gap:"sm",mt:"md",children:[e.jsx(i,{variant:"heading4",children:t("my_week.download_app_section.employee_header")}),a?e.jsxs(n,{column:!0,gap:"md",maxw:350,children:[e.jsx(ae,{variant:"success",children:e.jsx(i,{variant:"bodyBold",children:t("my_week.download_app_section.success",{props:{phone_number:Rs(m.phone)}})})}),e.jsx(n,{maxw:250,children:e.jsx(f,{fullWidth:!0,variant:"secondary",onClick:x,children:t("actions.close")})})]}):e.jsxs(n,{maxw:250,column:!0,gap:"xs",children:[e.jsx(Ps,{name:"phone",startIcon:"Phone",onFocus:d}),e.jsx(f,{type:"submit",fullWidth:!0,isLoading:_,children:t("my_week.download_app_section.cta")})]})]})]})]})})})}):null},Vt=Ns({eventCategory:rs.DASHBOARD_GET_MOBILE_APP_CARD_MY_WEEK})(Ht),zt=({policy:s})=>{const r=s.category_name==="pto",a=s.accrued||s.max_accrued||0,o=s.pto_balance||0,c=a>0?o/a*100:0;return e.jsx(n,{column:!0,mb:24,children:e.jsxs(n,{column:!0,children:[e.jsxs(i,{variant:"heading3",children:[o," ",t("my_week.user.time_off_requests.hrs")]}),e.jsxs(n,{spacebetween:!0,mb:4,children:[e.jsx(i,{variant:"bodySmBoldTight",children:t(r?"my_week.user.time_off_requests.pto_remaining":"my_week.user.time_off_requests.paid_sick_leave_remaining")}),e.jsxs(i,{variant:"bodySmBoldTight",children:[s.accrued&&e.jsxs(e.Fragment,{children:[s.accrued," ",t("my_week.user.time_off_requests.hrs_accrued")]}),s.accrued&&s.max_accrued&&" / ",s.max_accrued&&e.jsxs(e.Fragment,{children:[s.max_accrued," ",t("my_week.user.time_off_requests.hrs_max")]})]})]}),e.jsx(Ls,{height:"medium",progress:c,variant:"determinate",hidePercentage:!0})]})})},Kt=({timeOff:s})=>{const[r,a]=u.useState(!1),o=T(),c=s.state,l=s.state==="pending",h=l&&!s.expired,d=p(We),x=u.useCallback(async(v,C)=>{try{const b=await xe(`/time_offs/${v.id}`,C);o(Fs(b)),ue.success(t("my_week.user.time_off_requests.update_success"))}catch(b){const k=(await b.response?.json())?.errors?.[0]||t("errors.generic");ue.error(k)}},[o]),_=u.useCallback(()=>{o(He({jobs:d,isEditing:!0,isManager:!1,timeOff:s,onSave:x}))},[o,s,d,x]),m=u.useCallback(()=>{a(!0)},[]),g=u.useCallback(()=>{o(Us(s.id)),a(!1)},[s.id,o]),j=u.useCallback(()=>{a(!1)},[]);return e.jsxs(e.Fragment,{children:[e.jsxs(n,{flex:!0,vcenter:!0,children:[e.jsxs("div",{children:[e.jsxs(n,{flex:!0,gap:8,vcenter:!0,children:[e.jsx(i,{variant:"bodySmBoldTight",children:s.date_range_text}),e.jsx(R,{variant:ie(c,s.expired),children:oe(c,s.expired)})]}),e.jsx(i,{variant:"bodySmTight",children:s.normalized_category_name}),e.jsx(i,{variant:"captions",color:"mono700",children:`${t("my_week.user.time_off_requests.requested")} ${re(s.created_at,"pretty_no_year_short")}${s.responder_name&&s.state!=="pending"?` (${s.responder_name})`:""}`})]}),e.jsxs(n,{ml:"auto",flex:!0,gap:8,children:[h&&e.jsx(ke,{icon:"Edit",label:t("my_week.user.time_off_requests.edit_button"),size:"small",onClick:_}),l&&e.jsx(ke,{icon:"Delete",label:t("my_week.user.time_off_requests.delete_button_alt"),size:"small",destructive:!0,onClick:m})]})]}),r&&e.jsx(O,{open:r,onClose:j,buttons:[{label:t("my_week.user.time_off_requests.delete_button"),onClick:g,variant:"primaryDestructive"},{label:t("actions.cancel"),onClick:j,variant:"tertiary"}],children:()=>e.jsxs(n,{p:24,column:!0,gap:16,children:[e.jsx(i,{variant:"heading2",children:t("my_week.user.time_off_requests.delete_header",{props:{date:s.date_range_text}})}),e.jsx(i,{variant:"body",children:t("my_week.user.time_off_requests.delete_subheader")})]})})]})},{cx:Gt,cxEl:Yt}=M("TimeOffWidget"),Qt=()=>{const s=T(),r=p(Bs),a=p(Ws),o=p(We),c=p(Hs),l=F(),h=u.useCallback(()=>
1{l($.REQUEST_TIME_OFF_CLICKED,A.CLICK),s(He({jobs:o,onSuccess:()=>{s(Ve())}}))},[s,l,o]);return a||!c?e.jsx(S.Card,{children:e.jsx(J,{})}):e.jsx(S.Card,{title:t("my_week.user.time_off_requests.upcoming_time_off"),children:e.jsxs(n,{column:!0,className:Gt(),children:[c.map(d=>e.jsx(zt,{policy:d},d.category_name)),r.length===0?e.jsx(n,{tcenter:!0,children:e.jsx(i,{children:t("my_week.user.time_off_requests.no_time_off")})}):e.jsx(n,{column:!0,gap:"lg",maxh:300,overflow:"auto",children:r.map(d=>e.jsx("div",{className:Yt("TimeOff"),children:e.jsx(Kt,{timeOff:d})},d.id))}),e.jsx(n,{mt:"lg",mh:"auto",children:e.jsx(f,{size:"small",onClick:h,children:t("my_week.user.time_off_requests.request_time_off")})})]})})},Ie=s=>s.toFixed(2),Ne=s=>({scheduled_hours:Ie(s.scheduled_hours),worked_hours:Ie(s.paid),scheduled_costs:we(s.scheduled_costs),actual_costs:we(s.costs)}),Jt=()=>e.jsxs(n,{p:16,bgcolor:"mono0",column:!0,gap:16,children:[e.jsx(q,{width:"100%",height:50,bradiuss:!0}),e.jsx(q,{width:"100%",height:50,bradiuss:!0}),e.jsx(q,{width:"100%",height:50,bradiuss:!0}),e.jsx(q,{width:"100%",height:50,bradiuss:!0}),e.jsx(q,{width:"100%",height:50,bradiuss:!0})]}),{cx:Xt,cxEl:se}=M("TotalsWidget"),Zt=()=>{const r=p(Vs)?.get("timeclock_enabled"),a=p(zs),o=p(Ks),c=F(),l=u.useCallback(()=>{c($.VIEW_ALL_TIMESHEETS_CLICKED,A.CLICK)},[c]);if(!a||o)return e.jsx(S.Card,{children:e.jsx(Jt,{})});const[h,d]=a,x=Ne(d),_=Ne(h);return e.jsx(S.Card,{title:t("my_week.user.totals.your_week"),children:e.jsx(n,{column:!0,className:Xt(),children:e.jsxs(n,{column:!0,children:[e.jsxs("div",{className:se("ScheduledHours"),children:[e.jsxs(n,{mb:"2xs",flex:!0,children:[e.jsx(n,{flex:!0,children:e.jsx(i,{variant:"bodyBold",children:t("my_week.user.totals.scheduled_hours")})}),e.jsx(n,{ml:"auto",children:e.jsx(i,{variant:"bodyBold",color:"mono900",children:x.scheduled_hours})})]}),e.jsx(n,{mb:"md",children:e.jsx(i,{variant:"captions",color:"secondary",children:t("my_week.user.vs_last_week",{props:{amount:_.scheduled_hours}})})})]}),e.jsxs("div",{className:se("ScheduledEstimatedWages"),children:[e.jsxs(n,{mb:"2xs",flex:!0,children:[e.jsx(n,{flex:!0,children:e.jsx(i,{variant:"bodyBold",children:t("my_week.user.totals.scheduled_est_wages")})}),e.jsx(n,{ml:"auto",children:e.jsx(i,{variant:"bodyBold",color:"mono900",children:x.scheduled_costs})})]}),e.jsx(n,{mb:"md",children:e.jsx(i,{variant:"captions",color:"secondary",children:t("my_week.user.vs_last_week",{props:{amount:_.scheduled_costs}})})})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:se("ActualHours"),children:[e.jsxs(n,{mb:"2xs",flex:!0,children:[e.jsx(n,{flex:!0,children:e.jsx(i,{variant:"bodyBold",children:t("my_week.user.totals.actual_hours")})}),e.jsx(n,{ml:"auto",children:e.jsx(i,{variant:"bodyBold",color:"mono900",children:x.worked_hours})})]}),e.jsx(n,{mb:"md",children:e.jsx(i,{variant:"captions",color:"secondary",children:t("my_week.user.vs_last_week",{props:{amount:_.worked_hours}})})})]}),e.jsxs("div",{className:se("ActualEstimatedWages"),children:[e.jsxs(n,{mb:"2xs",flex:!0,children:[e.jsx(n,{flex:!0,children:e.jsx(i,{variant:"bodyBold",children:t("my_week.user.totals.actual_est_wages")})}),e.jsx(n,{ml:"auto",children:e.jsx(i,{variant:"bodyBold",color:"mono900",children:x.actual_costs})})]}),e.jsx(n,{mb:"lg",children:e.jsx(i,{variant:"captions",color:"secondary",children:t("my_week.user.vs_last_week",{props:{amount:_.actual_costs}})})})]}),e.jsx(Gs,{href:"/timesheets",onClick:l,children:t("my_week.user.totals.view_all_timesheets")})]})]})})})},en=()=>{const s=u.useCallback(()=>{ze.push("/user/availability")},[]);return e.jsxs(n,{p:16,hcenter:!0,column:!0,gap:16,children:[e.jsx(i,{children:t("my_week.user.schedule_section.no_open_shifts")}),e.jsx(f,{size:"small",onClick:s,children:t("my_week.user.schedule_section.no_shifts_button")})]})},te="my_week.user.empty_availability",cs=({shift:s,type:r,onClose:a})=>e.jsxs(n,{ph:30,column:!0,gap:24,maxw:450,children:[e.jsxs("div",{children:[e.jsx(i,{variant:"heading2",children:t(`${te}.${r}_title`)}),e.jsx(i,{variant:"bodyBold",children:s})]}),e.jsx(i,{children:t(`${te}.${r}_body`)}),e.jsx(i,{children:t(`${te}.need_help`)}),e.jsx(n,{w:"30%",mh:"auto",mt:24,children:e.jsx(f,{fullWidth:!0,onClick:a,children:t(`${te}.cta`)})})]}),B="my_week.user.confirmation_modal",ds=({onClose:s,type:r})=>e.jsxs(n,{ph:32,pv:16,column:!0,gap:16,maxw:500,children:[e.jsx(i,{variant:"heading2",children:t(`${B}.${r}_title`)}),e.jsx(i,{variant:"heading4",children:t(`${B}.list_title`)}),e.jsx(Ke,{data:[{primary:t(`${B}.list_item_1`)},{primary:t(`${B}.list_item_2`)},{primary:t(`${B}.list_item_3`)}],gapOverride:"8px"}),e.jsx(n,{mh:"auto",mt:24,w:"30%",children:e.jsx(f,{fullWidth:!0,onClick:s,children:t(`${B}.cta`)})})]}),I="my_week.user.request_cover_modal",sn=({shiftId:s,ownerId:r,date:a,time:o,availableForCoverage:c,onClose:l})=>{const h=T(),[d,x]=u.useState(!1),[_,m]=u.useState(!1),[g,j]=u.useState(null),v=p(Q),C={selectedEmployees:[],message:""},b=u.useCallback(async y=>{const k=y.selectedEmployees.reduce((w,D)=>(w[D]="1",w),{});x(!0),j(null);try{v?await V("/covers/batch_create",{owes:k,reason:y.message,shift_id:s,requester:r}):await V("/trades/batch_create.json",{owes:k,reason:y.message,shift_id:s,requester:r}),h(P()),m(!0)}catch{j(t("fe_design_base.errors.general"))}finally{x(!1)}},[s,r,h,v]);return e.jsx(e.Fragment,{children:_?e.jsx(ds,{onClose:l,type:"cover"}):e.jsx(he,{initialValues:C,onSubmit:b,children:({values:y})=>e.jsx(_e,{children:e.jsxs(n,{ph:50,children:[e.jsxs(n,{mb:24,children:[e.jsx(i,{variant:"heading2",children:t(`${I}.title`)}),e.jsxs(i,{variant:"bodyBold",children:[t(`${I}.shift`),`${a} ${o}`]})]}),e.jsxs(n,{column:!0,gap:16,children:[e.jsx(i,{variant:"bodyBold",children:t(`${I}.choose_team_member`)}),e.jsx(Ge,{label:t(`${I}
1.select_label`),placeholder:t(`${I}.select_placeholder`),options:c,multiple:!0,name:"selectedEmployees",displayAsText:!0,menuMaxHeight:300,hasAsterisk:!0}),e.jsx(Ye,{name:"message",label:t(`${I}.message_label`),textArea:!0,minRows:4,maxRows:4}),g&&e.jsx(ae,{variant:"error",children:g})]}),e.jsx(n,{mt:24,children:e.jsx(me,{buttons:[{label:t(`${I}.cta`),variant:"primary",type:"submit",disabled:!y.selectedEmployees.length,isLoading:d},{label:t("actions.cancel"),variant:"tertiary",onClick:l}]})})]})})})})},tn=({shiftId:s,ownerId:r,date:a,time:o,onClose:c})=>{const l=T(),h=p(Qe),d=p(Je);return u.useEffect(()=>{l(Xe({shift_id:s}))},[l,s]),d?e.jsx(n,{minw:510,minh:266,hcenter:!0,vcenter:!0,children:e.jsx(Ze,{variant:"dark",size:"large"})}):h.length?e.jsx(sn,{shiftId:s,ownerId:r,date:a,time:o,availableForCoverage:h,onClose:c}):e.jsx(cs,{shift:`${a} ${o}`,type:"cover",onClose:c})},N="my_week.user.trade_shift_modal",nn=({shiftId:s,ownerId:r,date:a,time:o,roleName:c,availableForTrade:l,onClose:h})=>{const d=T(),[x,_]=u.useState(!1),[m,g]=u.useState(!1),[j,v]=u.useState(null),C={selectedShifts:[],message:""},b=u.useCallback(async y=>{const k=y.selectedShifts.reduce((w,D)=>(w[D]="1",w),{});_(!0),v(null);try{await V("/trades/batch_create.json",{owes:k,reason:y.message,shift_id:s,requester:r,request_type:"trade"}),d(P()),g(!0)}catch{v(t("fe_design_base.errors.general"))}finally{_(!1)}},[s,r,d]);return e.jsx(e.Fragment,{children:m?e.jsx(ds,{onClose:h,type:"trade"}):e.jsx(he,{initialValues:C,onSubmit:b,children:({values:y})=>e.jsx(_e,{children:e.jsxs(n,{ph:50,children:[e.jsxs(n,{mb:24,children:[e.jsx(i,{variant:"heading2",children:t(`${N}.title`)}),e.jsx(i,{variant:"bodyBold",children:`${t(`${N}.shift`)} ${a} ${o} ${c}`})]}),e.jsxs(n,{column:!0,gap:16,children:[e.jsx(i,{variant:"bodyBold",children:t(`${N}.choose_shift`)}),e.jsx(Ge,{label:t(`${N}.select_label`),placeholder:t(`${N}.select_placeholder`),options:l,multiple:!0,name:"selectedShifts",displayAsText:!0,menuMaxHeight:280,hasAsterisk:!0}),e.jsx(Ye,{name:"message",label:t(`${N}.message_label`),textArea:!0,minRows:4,maxRows:4}),j&&e.jsx(ae,{variant:"error",children:j})]}),e.jsx(n,{mt:24,children:e.jsx(me,{buttons:[{label:t(`${N}.cta`),variant:"primary",type:"submit",disabled:!y.selectedShifts.length,isLoading:x},{label:t("actions.cancel"),variant:"tertiary",onClick:h}]})})]})})})})},rn=({shiftId:s,ownerId:r,date:a,time:o,roleName:c,onClose:l})=>{const h=T(),d=p(Ys),x=p(Qs);return u.useEffect(()=>{h(Js({shift_id:s}))},[h,s]),x?e.jsx(n,{minw:510,minh:266,hcenter:!0,vcenter:!0,children:e.jsx(Ze,{variant:"dark",size:"large"})}):d.length?e.jsx(nn,{shiftId:s,ownerId:r,date:a,time:o,roleName:c,availableForTrade:d,onClose:l}):e.jsx(cs,{shift:`${a} ${o}`,type:"trade",onClose:l})},W="my_week.user.claim_open_shift_modal",an=({onClose:s})=>e.jsxs(n,{ph:32,pv:16,column:!0,gap:16,maxw:500,children:[e.jsx(i,{variant:"heading2",children:t(`${W}.title`)}),e.jsx(i,{variant:"heading4",children:t(`${W}.list_title`)}),e.jsx(Ke,{data:[{primary:t(`${W}.list_item_1`)},{primary:t(`${W}.list_item_2`)},{primary:t(`${W}.list_item_3`)}],gapOverride:"8px"}),e.jsx(n,{mh:"auto",mt:24,w:"30%",children:e.jsx(f,{fullWidth:!0,onClick:s,children:t(`${W}.cta`)})})]}),on=({shift:s,date:r,time:a,roleName:o})=>{const[c,l]=u.useState(!1),[h,d]=u.useState(!1),[x,_]=u.useState(null),m=F(),g=u.useCallback(async b=>{m($.CLAIM_SHIFT_CLICKED,A.CLICK),l(!0),_(null);try{await V(`/schedule_builder/shifts/${b}/claim_requests`),d(!0)}catch(y){const{response:k}=y,w=await k.json();_(w.errors?.[0]?.detail||t("fe_design_base.errors.general"))}finally{l(!1)}},[m]),j=u.useCallback(()=>{g(s.id)},[g,s.id]),v=u.useCallback(()=>{d(!1),_(null)},[]),C=!L();return e.jsxs(e.Fragment,{children:[e.jsxs(n,{flex:!0,column:C,vcenter:!0,p:16,children:[e.jsxs("div",{children:[e.jsx(i,{variant:"bodySmBoldTight",children:r}),e.jsx(i,{variant:"bodySmTight",children:a}),e.jsx(i,{variant:"bodySmTight",children:`${s.location_name} ${o}`})]}),e.jsx(n,{ml:C?0:"auto",children:e.jsx(f,{variant:"secondary",size:"small",onClick:j,isLoading:c,children:t("my_week.user.schedule_section.claim_shift")})})]}),e.jsx(O,{open:h,onClose:v,children:()=>e.jsx(an,{onClose:v})}),e.jsx(Xs,{open:!!x,onClose:v,variant:"error",overrideClickAway:!0,children:e.jsx(i,{variant:"bodyBold",children:x})})]})},{cx:ln,cxEl:cn}=M("OpenShifts"),dn=()=>{const s=p(Zs);return p(es)?e.jsx(J,{}):e.jsx("div",{className:ln(),children:s.length?s.map(a=>{const{date:o,time:c,roleName:l}=H(a);return e.jsx("div",{className:cn("Shift"),children:e.jsx(on,{shift:a,date:o,time:c,roleName:l})},a.id)}):e.jsx(en,{})})},un=()=>{const s=u.useCallback(()=>{ze.push("/user/availability")},[]);return e.jsxs(n,{p:16,hcenter:!0,column:!0,gap:16,children:[e.jsx(i,{children:t("my_week.user.schedule_section.no_user_shifts")}),e.jsx(f,{size:"small",onClick:s,children:t("my_week.user.schedule_section.no_shifts_button")})]})},mn=({shift:s,date:r,time:a,isTradable:o,duration:c,roleName:l})=>{const[h,d]=u.useState(!1),[x,_]=u.useState(!1),m=F(),g=!L(),j=p(Q),v=p(Qe),C=p(Je),b=T(),y=p(ss),
1k=p(et),w=p(Fe),D=u.useMemo(()=>w.some(z=>z.shift.id===s.id&&(z.state==="pending"||z.state==="accepted")),[w,s.id]),U=u.useCallback(async(z,_s,xs)=>{try{const ve=z.reduce((ye,ps)=>(ye[ps]="1",ye),{});await V("/covers/batch_create",{owes:ve,reason:_s||"",requirement:xs||"",shift_id:Number(s.id),requester:Number(s.owner_id)}),b(P()),d(!1),b(Se({message:t("schedule_builder.smart_covers.cover_request_toast_success"),type:"success"}))}catch{d(!1),b(Se({message:t("schedule_builder.smart_covers.cover_request_toast_error"),type:"error"}))}},[s.id,b,s.owner_id,d]),us=u.useCallback(()=>{m($.REQUEST_COVER_CLICKED,A.CLICK),b(Xe({shift_id:s.id})),d(!0)},[m,b,s.id]),ms=u.useCallback(()=>{m($.TRADE_SHIFT_CLICKED,A.CLICK),_(!0)},[m]),X=u.useCallback(()=>{d(!1)},[]),je=u.useCallback(()=>{_(!1)},[]),fe=new Date(s.end_at).getTime()-new Date(s.start_at).getTime(),be=Math.floor(fe/(1e3*60*60)),le=Math.floor(fe%(1e3*60*60)/(1e3*60)),hs=be>0?`(${be}h${le>0?` ${le}m`:""})`:`(${le}m)`;return e.jsxs(e.Fragment,{children:[e.jsxs(n,{flex:!0,column:g,vcenter:!0,p:16,children:[e.jsxs("div",{children:[e.jsx(i,{variant:"bodySmBoldTight",children:r}),e.jsx(i,{variant:"bodySmTight",children:`${a} (${c})`}),e.jsx(i,{variant:"bodySmTight",children:`${s.location_name} ${l}`})]}),o&&e.jsxs(n,{ml:g?0:"auto",flex:!0,column:g,gap:8,maxw:g?200:300,children:[e.jsx(st,{placement:"left-start",content:D?t("my_week.user.shift_trade_requests.smart_cover_requests.request_cover_disabled"):"",children:e.jsx("span",{children:e.jsx(f,{variant:"secondary",size:"small",onClick:D?void 0:us,disabled:D,children:t("my_week.user.schedule_section.request_a_cover")})})}),e.jsx(f,{variant:"secondary",size:"small",onClick:ms,children:t("my_week.user.schedule_section.trade_shift")})]})]}),j?e.jsx(O,{open:h,onClose:X,children:()=>e.jsx(ft,{onClose:X,employees:v,isLoading:C,shift:{durationText:hs,day:K(s.start_at).format("D"),month:K(s.start_at).format("MMM"),weekday:K(s.start_at).format(Y("short_wday")).toUpperCase(),startTime:K(s.start_at).format(Y("time_short")),endTime:K(s.end_at).format(Y("time_short")),role:l,location:s.location_name,employeeName:`${t("my_week.user.shift_trade_requests.smart_cover_requests.you")} ${y} ${k}`},onSubmit:U})}):e.jsx(O,{open:h,onClose:X,children:()=>e.jsx(tn,{shiftId:s.id,ownerId:s.owner_id,date:r,time:a,onClose:X})}),e.jsx(O,{open:x,onClose:je,children:()=>e.jsx(rn,{shiftId:s.id,ownerId:s.owner_id,date:r,time:a,roleName:l,onClose:je})})]})},{cx:hn,cxEl:_n}=M("UserShifts"),xn=()=>{const s=p(tt);return p(es)?e.jsx(J,{}):e.jsx("div",{className:hn(),children:s.length?s.map(a=>{const{date:o,time:c,isTradable:l,duration:h,roleName:d}=H(a);return e.jsx("div",{className:_n("Shift"),children:e.jsx(mn,{shift:a,date:o,time:c,duration:h,roleName:d,isTradable:l})},a.id)}):e.jsx(un,{})})},pn=()=>{const s=T(),r=p(nt),a=p(ts),o=p(ns);u.useEffect(()=>{o||(s(rt(a)),s(at(a)))},[s,a,o]);const c=!Ue(),l=u.useCallback((h,d)=>{s(ot(d))},[s]);return e.jsxs(S.Card,{children:[e.jsx(Be,{options:it,tabValue:r,onChange:l,fullWidth:!0,scrollable:c}),e.jsx(n,{children:r==="my-schedule"?e.jsx(xn,{}):e.jsx(dn,{})})]})},gn=()=>{const s=T(),r=!L(),a=p(bt),{showCard:o,isLoading:c,data:l}=wt(),h=p(ct),d=p(ts),x=p(ns),_=p(ss),m=p(Re),g=ut(!m);u.useEffect(()=>{s(Te({start_date:De(h).startOf("week").format(Y("parsable_date")),end_date:De(h).endOf("week").format(Y("parsable_date"))})),s(Ve()),s(P())},[]);const j=!o&&a,v=F(),C=u.useRef(!1);u.useEffect(()=>{!c&&!C.current&&(C.current=!0,v($.PAGE_VIEWED,A.VIEW,{getMobileAppCard:j,onboard_packet_present:o}))},[c,v,j,o]);const b=u.useCallback(U=>{s(Te({start_date:re(U.startDate,"parsable_date"),end_date:re(U.endDate,"parsable_date")}))},[s]),y=x?e.jsx(q,{width:Ee,height:40,bradiuss:!0}):e.jsx(n,{minw:Ee,children:e.jsx(dt,{startDate:d.start_date,endDate:d.end_date,payrollPeriod:"week",startOfWorkWeek:h,payrollInfo:[h],twiceWeekPayrollInfo:null,name:"week-picker",displayedMonths:1,onApplyRange:b})}),k=g.verification?e.jsx(ht,{...g}):void 0,w=g.verification?e.jsx(mt,{...g}):void 0,D=o?e.jsx(qt,{packetId:l?.packet_id??null,packetType:l?.packet_type??null,packetsFulfilledCount:l?.packets_fulfilled_count??0,packetsTotalCount:l?.packets_total_count??0,packetStarted:l?.packet_started??!1,startDate:l?.team_member_start_date??null}):void 0;return e.jsxs(S,{title:t("my_week.welcome_back_title",{props:{name:_}}),actions:y,alert:k,promo:D,dialogs:w,children:[e.jsxs(S.Main,{children:[!c&&!o&&a&&e.jsx(Vt,{isSmallScreen:r}),e.jsx(Ct,{}),e.jsxs(S.Section,{children:[e.jsx(pn,{}),e.jsx(Ft,{})]})]}),e.jsxs(S.Aside,{children:[e.jsx(Zt,{}),e.jsx(Qt,{})]})]})},Dn=lt({productArea:xt.DASHBOARD,eventCategory:rs.DASHBOARD_MY_WEEK})(gn);export{Dn as default};
2//# sourceMappingURL=index-chunk-CluoUJxv.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.