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AO1K,OAAO4K,OAASF,EAAO1K,OAAO4K,OAAOxI,OAAS,GAC5DkP,YAAY,YACZe,aAAc,SAACC,GACd,MAAQ,CACP9Q,IAAK8Q,EAAiBrQ,GAAG8P,WACzB7R,MAAOoS,EAAiBlQ,OACxBS,MAAOyP,EAAiBlQ,OACxBmH,KAAM+I,EACNC,MAAOD,EAAiBlQ,OAEzB,EACD4B,SAAU,SAAC9D,EAAOsR,GACjB9G,EAAOmD,cAAc,qBAAsB,GAC3CnD,EAAOmD,cAAc,qBAAsB,IAC3CnD,EAAOmD,cAAc,kBAAmB,MACxCnD,EAAOmD,cAAc,aAAc,IACnCnD,EAAOmD,cAAc,SAAU2D,EAAOC,MAAMlI,MAC5CkE,EAAc+D,EAAOC,MAAMlI,KAAKtH,KAAO,GACnCuP,EAAOC,MAAMlI,KAAKtH,GAAK,GAAKyI,EAAO1K,OAAOhB,YAC7CiP,EAAeuD,EAAOC,MAAMlI,KAAKtH,GAAIyI,EAAO1K,OAAOhB,WAEpD,EACD0S,SAAU,WACK,MADW,uDAAP,MAEjBhH,EAAOmD,cAAc,oBAAqB,MAC1CnD,EAAOmD,cAAc,kBAAmB,MACxCnD,EAAOmD,cAAc,SAAU,MAC/BJ,IAED,EACD+E,OAAQ,CAAExT,WAAY0L,EAAO1K,OAAOhB,YACpCyT,aAAW,GAEZ,C","sources":["webpack://NorthernTunaPortal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockTable.tsx","webpack://NorthernTunaPortal/./ClientApp/utils/DoctorBookedTimeBlock/DoctorBookedTimeBlock.ts","webpack://NorthernTunaPortal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlock.tsx","webpack://NorthernTunaPortal/./ClientApp/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockHeader.tsx","webpack://NorthernTunaPortal/./ClientApp/components/UI/ScheduleAppointmentModal/LoginForm.tsx","webpack://NorthernTunaPortal/./ClientApp/components/UI/ScheduleAppointmentModal/ScheduleAppointment.tsx"],"sourcesContent":["import React from 'react';\r\n\r\nimport moment, { Moment } from 'moment';\r\n\r\nimport { DoctorBookedTime } from '@app/objects/Doctor';\r\nimport { Location } from '@app/objects/Location';\r\n\r\nimport '@app/scss/components/doctorBookedTimeBlockTable.scss';\r\nimport DoctorBookedTimeBlockHeader from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockHeader';\r\nimport { SelectedTimeIndex } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\r\n\r\ninterface ComponentProps {\r\n\tbookedTime: DoctorBookedTime;\r\n\tonSelectTime: (day: Moment, time: Moment, selectedTimeIndex?: SelectedTimeIndex) => void;\r\n\tonSelectPreviousWeek: () => void;\r\n\tonSelectNextWeek: () => void;\r\n\tstartDate: number;\r\n\tlocationId: number;\r\n\tlocations?: Array;\r\n\tonSelectLocation?: (location: Location) => void;\r\n\tclassName?: string;\r\n\trowCount?: number;\r\n\tselectedTime?: number;\r\n\twithoutLocationButtons?: boolean;\r\n\twithHeader?: boolean;\r\n\tnearestTime: number | null;\r\n\tonNearestTimeClick?: () => void;\r\n\trange: number;\r\n}\r\n\r\nconst getInitialCount = (bookedTime: DoctorBookedTime, offset: number, selectedTime?: number): number => {\r\n\tif (!selectedTime) {\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tfor (const [day, value] of Object.entries(bookedTime.values)) {\r\n\t\tif (moment.utc(selectedTime).isSame(moment(day), 'day')) {\r\n\t\t\tfor (const index in value) {\r\n\t\t\t\tconst time = bookedTime.values[day][index];\r\n\r\n\t\t\t\tif (moment(selectedTime).utc().format('HH:mm:ss') === time?.start) {\r\n\t\t\t\t\treturn Math.floor(+index / offset) * offset;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn 0;\r\n};\r\n\r\nconst DoctorBookedTimeBlockTable: React.FC = ({\r\n\tbookedTime,\r\n\tonSelectTime,\r\n\tonSelectPreviousWeek,\r\n\tonSelectNextWeek,\r\n\tstartDate,\r\n\tlocationId,\r\n\tlocations,\r\n\tonSelectLocation,\r\n\tclassName,\r\n\trowCount,\r\n\tselectedTime,\r\n\twithoutLocationButtons,\r\n\twithHeader = true,\r\n\tnearestTime = null,\r\n\tonNearestTimeClick,\r\n\trange,\r\n}) => {\r\n\tconst [offset, setOffset] = React.useState(rowCount ?? 7);\r\n\tconst [count, setCount] = React.useState(getInitialCount(bookedTime, offset, selectedTime));\r\n\tconst [maxCount, setMaxCount] = React.useState(() => {\r\n\t\treturn Math.max(...Object.keys(bookedTime.values).map((day) => bookedTime.values[day]?.length ?? 0));\r\n\t});\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (rowCount && rowCount !== offset) {\r\n\t\t\tsetOffset(rowCount);\r\n\t\t\tsetCount(0);\r\n\t\t}\r\n\t}, [rowCount]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetMaxCount(Math.max(...Object.keys(bookedTime.values).map((day) => bookedTime.values[day]?.length ?? 0)));\r\n\t}, [bookedTime]);\r\n\r\n\tconst showMore = () => {\r\n\t\tsetCount(count + offset);\r\n\t};\r\n\r\n\tconst showPrev = () => {\r\n\t\tsetCount(count - offset);\r\n\t};\r\n\r\n\tconst renderItem = (index: number): Array => {\r\n\t\treturn Object.keys(bookedTime.values).slice(0, range).map((day) => {\r\n\t\t\tconst time = bookedTime.values[day][index];\r\n\t\t\tconst isSelected = !!selectedTime && moment.utc(selectedTime).isSame(moment(day), 'day')\r\n\t\t\t\t&& moment(selectedTime).utc().format('HH:mm:ss') === time?.start;\r\n\r\n\t\t\treturn time ? \r\n\t\t\t\t {\r\n\t\t\t\t\t\tonSelectTime(moment(day).utc(), moment(time.start, 'hh:mm a'), { key: day, start: time.start });\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t
{moment(time.start, 'hh:mm a').format('hh:mm a')}
\r\n\t\t\t\t\r\n\t\t\t : -;\r\n\t\t});\r\n\t};\r\n\r\n\tconst renderItems = () => {\r\n\t\tlet index = count;\r\n\t\tconst result: Array = [];\r\n\t\tlet row;\r\n\r\n\t\tdo {\r\n\t\t\trow = renderItem(index++);\r\n\r\n\t\t\tresult.push(\r\n\t\t\t\t\r\n\t\t\t\t{row}\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t} while (index < (count + offset > maxCount ? maxCount : count + offset));\r\n\r\n\t\treturn result.map((node) => node);\r\n\t};\r\n\r\n\tconst leftChevronDisabled = moment(startDate).utc() <= moment(new Date()).utc();\r\n\r\n\treturn
\r\n\t\t
\r\n\t\t\t{!withoutLocationButtons && locations && locations.length && locations.map((location) =>\r\n\t\t\t\t onSelectLocation && onSelectLocation(location)}\r\n\t\t\t\t>\r\n\t\t\t\t\t{`${location.company?.name ? `${location.company?.name} - ` : ''}${location.nameEn}`}\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t{withHeader && }\r\n\t\t\t\t{!nearestTime && renderItems()}\r\n\t\t\t\r\n\t\t
\r\n\t\t{nearestTime && \r\n\t\t\tNearest available on\r\n\t\t\t{' '}\r\n\t\t\t{moment(nearestTime).utc().format('MMM DD')}\r\n\t\t}\r\n\t\t{!nearestTime && <>\r\n\t\t\t= maxCount}\r\n\t\t\t\ttitle=\"Next times\"\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t
;\r\n};\r\n\r\nexport default DoctorBookedTimeBlockTable;\r\n","import moment from 'moment';\r\n\r\nimport { DoctorBookedTime } from '@app/objects/Doctor';\r\nimport { getMinutesFromDuration } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\r\n\r\nconst dayMS = 3600 * 1000 * 24; // milliseconds in one day\r\n\r\nexport const getStartDayInitial = (range: number, selectedTime?: number): number => {\r\n\tconst now = moment.utc().valueOf();\r\n\r\n\tif (!selectedTime) {\r\n\t\treturn now;\r\n\t}\r\n\r\n\treturn now + Math.floor((selectedTime - now) / (dayMS * range)) * dayMS * range;\r\n};\r\n\r\nexport const filterDisabledTimes = (times: DoctorBookedTime): DoctorBookedTime => {\r\n\tconst res = { ...times, values: { ...times.values } };\r\n\r\n\tObject.entries(res.values).forEach(([key, blocks]) => {\r\n\t\tres.values[key] = blocks.filter(({ booked }) => !booked);\r\n\t});\r\n\r\n\treturn res;\r\n};\r\n\r\nexport const filterTimesBeforeNow = (times: DoctorBookedTime): DoctorBookedTime => {\r\n\tconst res = { ...times, values: { ...times.values } };\r\n\tconst now = moment(new Date());\r\n\r\n\tObject.entries(res.values).forEach(([key, blocks]) => {\r\n\t\tif (moment(key).utc().isSame(now, 'day')) {\r\n\t\t\tres.values[key] = blocks.filter(({ start }) => moment(start, 'HH:mm:ss').valueOf() >= now.valueOf());\r\n\t\t}\r\n\t});\r\n\r\n\treturn res;\r\n};\r\n\r\nexport const changeBookedTimesByInterval = (times: DoctorBookedTime, interval: number): DoctorBookedTime => {\r\n\tconst res = { ...times, values: { ...times.values } };\r\n\r\n\tObject.entries(res.values).forEach(([key, blocks]) => {\r\n\t\tres.values[key] = blocks.map((currentBlock, index) => {\r\n\t\t\tlet duration = getMinutesFromDuration(currentBlock.end) - getMinutesFromDuration(currentBlock.start);\r\n\r\n\t\t\tif (duration >= interval || currentBlock.booked) {\r\n\t\t\t\treturn currentBlock;\r\n\t\t\t}\r\n\r\n\t\t\tfor (let i = index; blocks.length > i; i++) {\r\n\t\t\t\tif (duration < interval\r\n\t\t\t\t\t\t&& (!blocks[i + 1] || blocks[i].end !== blocks[i + 1]?.start || blocks[i + 1].booked)) {\r\n\t\t\t\t\treturn { ...currentBlock, booked: true };\r\n\t\t\t\t}\r\n\r\n\t\t\t\tduration += getMinutesFromDuration(blocks[i + 1].end) - getMinutesFromDuration(blocks[i + 1].start);\r\n\t\t\t\tif (duration >= interval) {\r\n\t\t\t\t\treturn currentBlock;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn { ...currentBlock, booked: duration < interval };\r\n\t\t});\r\n\t});\r\n\r\n\treturn res;\r\n};\r\n\r\nexport const resolveBookedTimes = (times: DoctorBookedTime, interval: number): DoctorBookedTime => {\r\n\treturn changeBookedTimesByInterval(filterTimesBeforeNow(times), interval);\r\n};\r\n","import React from 'react';\r\n\r\nimport moment, { Moment } from 'moment';\r\n\r\nimport Message from 'antd/lib/message';\r\n\r\nimport LogoLoader, { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\r\n\r\nimport { request } from '@app/components/Api';\r\nimport { Location } from '@app/objects/Location';\r\nimport DoctorBookedTimeBlockTable from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlockTable';\r\nimport { DoctorBookedTime } from '@app/objects/Doctor';\r\nimport {\r\n\tfilterDisabledTimes,\r\n\tgetStartDayInitial,\r\n\tresolveBookedTimes,\r\n} from '@app/utils/DoctorBookedTimeBlock/DoctorBookedTimeBlock';\r\nimport { SelectedTimeIndex } from '@app/components/UI/ScheduleAppointmentModal/ScheduleAppointment';\r\n\r\ninterface ComponentProps {\r\n\tdoctorId: number;\r\n\tonSelect?: (time: number, location: Location, asNearestDate?: boolean, selectIndex?: SelectedTimeIndex) => void;\r\n\tlocations: Array;\r\n\tvalue?: DoctorBookedTime;\r\n\tclassName?: string;\r\n\tdays?: number;\r\n\trowCount?: number;\r\n\tonlyWorkingDays?: boolean;\r\n\tselectLocationById?: number;\r\n\tselectedTime?: number;\r\n\tinitStartDay?: number;\r\n\twithoutLocationButtons?: boolean;\r\n\twithHeader?: boolean;\r\n\tinterval?: number;\r\n\thideDisabledTimes?: boolean;\r\n\tnearestDateRedirect?: boolean;\r\n}\r\n\r\nconst DoctorBookedTimeBlock: React.FC = ({\r\n\tdoctorId,\r\n\tonSelect,\r\n\tlocations,\r\n\tvalue,\r\n\tclassName,\r\n\tdays,\r\n\trowCount,\r\n\tonlyWorkingDays = false,\r\n\tselectedTime,\r\n\tselectLocationById,\r\n\twithoutLocationButtons,\r\n\twithHeader,\r\n\tinterval: propsInterval,\r\n\thideDisabledTimes = true,\r\n\tnearestDateRedirect = false,\r\n\tinitStartDay,\r\n}) => {\r\n\tconst [selectedLocation, setSelectedLocation] = React.useState(selectLocationById\r\n\t\t? (locations.find((q) => q.id === selectLocationById) ?? locations[0])\r\n\t\t: locations[0]);\r\n\tconst [loading, setLoading] = React.useState(false);\r\n\tconst [range, setRange] = React.useState(days ?? 7);\r\n\tconst [interval, setInterval] = React.useState(propsInterval || 0);\r\n\tconst [startDay, setStartDay] = React.useState(initStartDay || getStartDayInitial(range, selectedTime));\r\n\tconst [startDate, setStartDate] = React.useState(startDay);\r\n\tconst [endDate, setEndDate] = React.useState(startDate);\r\n\tconst [bookedTimeRes, setBookedTimeRes] = React.useState(value || null);\r\n\tconst [nearestTime, setNearestDate] = React.useState(null);\r\n\tconst [solvedNearestTime, setSolvedNearestDate] = React.useState(nearestTime);\r\n\tconst nearestDate = solvedNearestTime || nearestTime;\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (propsInterval !== interval) {\r\n\t\t\tsetInterval(propsInterval || 0);\r\n\t\t}\r\n\t}, [propsInterval]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetBookedTimeRes(value || null);\r\n\t}, [value]);\r\n\r\n\tconst loadTimes = (from: number, interval: number, locationId: number, days?: number) => {\r\n\t\tsetLoading(true);\r\n\t\trequest('getDoctorBookedTime', {\r\n\t\t\tid: doctorId,\r\n\t\t\tlocationId,\r\n\t\t\tinterval,\r\n\t\t\tfrom,\r\n\t\t\tdaysRange: days || range,\r\n\t\t\tonlyWorkingDays,\r\n\t\t}).then((res) => {\r\n\t\t\tsetBookedTimeRes(res);\r\n\t\t\tsetStartDate(res.startDate);\r\n\t\t\tsetEndDate(res.endDate);\r\n\t\t\tsetNearestDate(res.nearestTime);\r\n\t\t}).catch((message) => {\r\n\t\t\tMessage.error(message);\r\n\t\t}).finally(() => {\r\n\t\t\tsetLoading(false);\r\n\t\t});\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (value && JSON.stringify(value) !== JSON.stringify(bookedTimeRes)) {\r\n\t\t\tsetBookedTimeRes(value);\r\n\t\t\tsetStartDate(value.startDate);\r\n\t\t\tsetEndDate(value.endDate);\r\n\t\t\tsetNearestDate(value.nearestTime);\r\n\t\t}\r\n\t}, [value]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (value && (!selectedLocation || value.locationId === selectedLocation.id) && (Object.values(value.values).length || value.nearestTime)) {\r\n\t\t\tsetStartDate(value.startDate);\r\n\t\t\tsetEndDate(value.endDate);\r\n\t\t\tsetNearestDate(value.nearestTime);\r\n\t\t} else {\r\n\t\t\tselectedLocation?.id && loadTimes(startDate, interval, selectedLocation.id);\r\n\t\t}\r\n\t}, [interval]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tlet newSelectedLocation; let\r\n\t\t\tnewRage;\r\n\t\tif (selectLocationById && selectLocationById !== selectedLocation?.id) {\r\n\t\t\tnewSelectedLocation = selectLocationById\r\n\t\t\t\t? (locations.find((q) => q.id === selectLocationById) ?? locations[0])\r\n\t\t\t\t: locations[0];\r\n\t\t\tsetSelectedLocation(newSelectedLocation);\r\n\t\t}\r\n\r\n\t\tif (days && days !== range) {\r\n\t\t\tnewRage = days;\r\n\t\t\tsetRange(newRage);\r\n\t\t}\r\n\r\n\t\tif (newSelectedLocation || newRage) {\r\n\t\t\tloadTimes(startDate, interval, (newSelectedLocation || selectedLocation)?.id, newRage || days);\r\n\t\t}\r\n\t}, [selectLocationById, days]);\r\n\r\n\tconst bookedTime = React.useMemo(() => {\r\n\t\tif (!bookedTimeRes) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst resolvedBookedTime = resolveBookedTimes(bookedTimeRes, propsInterval || interval);\r\n\t\treturn hideDisabledTimes ? filterDisabledTimes(resolvedBookedTime) : resolvedBookedTime;\r\n\t}, [propsInterval, interval, bookedTimeRes]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst dates = Object.keys(bookedTime?.values || {})\r\n\t\t\t.map((key) => (bookedTime?.values[key].length ? key : null));\r\n\t\tconst dateIndex = dates.findIndex((time) => time !== null);\r\n\r\n\t\tsetSolvedNearestDate(dateIndex + 1 > range ? +moment(dates[dateIndex]) : null);\r\n\t}, [range, nearestDate, bookedTime]);\r\n\r\n\tconst onSelectLocation = (location: Location) => {\r\n\t\tsetSelectedLocation(location);\r\n\r\n\t\tloadTimes(startDate, interval, location.id);\r\n\t};\r\n\r\n\tconst onSelectTime = (day: Moment, time: Moment, nearestDate?: number, selectedTimeIndex?: SelectedTimeIndex) => {\r\n\t\tonSelect && onSelect(\r\n\t\t\tnearestDate || day.add(time.hours(), 'hours').add(time.minutes(), 'minutes').valueOf(),\r\n\t\t\tselectedLocation,\r\n\t\t\t!!nearestDate,\r\n\t\t\tselectedTimeIndex,\r\n\t\t);\r\n\t};\r\n\r\n\tconst selectNextWeek = () => {\r\n\t\tloadTimes(moment(endDate).add('day', 1).valueOf(), interval, selectedLocation.id);\r\n\t};\r\n\r\n\tconst onSelectPreviousWeek = () => {\r\n\t\tloadTimes(moment(startDate).add('day', -1).valueOf(), -interval, selectedLocation.id);\r\n\t};\r\n\r\n\tconst onNearestTimeClick = () => {\r\n\t\tconst solvedNearestDate = Object.keys(bookedTime?.values || {})\r\n\t\t\t.map((key) => (bookedTime?.values[key].length ? key : null))\r\n\t\t\t.find((time) => time !== null);\r\n\t\tconst date = solvedNearestDate ? +moment(solvedNearestDate) : nearestDate;\r\n\t\tif (date) {\r\n\t\t\tif (nearestDateRedirect) {\r\n\t\t\t\tconst time = moment.utc(date);\r\n\t\t\t\tonSelectTime(time, time, +time.hours(new Date().getHours()));\r\n\t\t\t} else {\r\n\t\t\t\tloadTimes(date, interval, selectedLocation.id);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tif (!bookedTime) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\treturn
\r\n\t\t\r\n\t\t\t\tonSelectTime(day, time, undefined, selectIndexTime)}\r\n\t\t\tonSelectNextWeek={selectNextWeek}\r\n\t\t\tonSelectPreviousWeek={onSelectPreviousWeek}\r\n\t\t\tstartDate={startDate}\r\n\t\t\tlocations={locations}\r\n\t\t\tlocationId={selectedLocation.id}\r\n\t\t\tonSelectLocation={onSelectLocation}\r\n\t\t\trowCount={rowCount}\r\n\t\t\tselectedTime={selectedTime}\r\n\t\t\twithHeader={withHeader}\r\n\t\t\tclassName={className}\r\n\t\t\twithoutLocationButtons={withoutLocationButtons}\r\n\t\t\tnearestTime={nearestDate}\r\n\t\t\tonNearestTimeClick={onNearestTimeClick}\r\n\t\t/>\r\n\t\t{loading\r\n\t\t\t&&
\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t}\r\n\t
;\r\n};\r\n\r\nexport default DoctorBookedTimeBlock;\r\n","import React from 'react';\r\n\r\nimport moment from 'moment';\r\n\r\nimport { DoctorBookedValues } from '@app/objects/Doctor';\r\n\r\ninterface Props {\r\n\tleftChevronDisabled: boolean;\r\n\tonSelectPreviousWeek: () => void;\r\n\tonSelectNextWeek: () => void;\r\n\tcolumns: DoctorBookedValues;\r\n\tdisabledButtons?: boolean;\r\n\tdaysRange?: number;\r\n}\r\n\r\nconst DoctorBookedTimeBlockHeader: React.FC = ({\r\n\tleftChevronDisabled,\r\n\tonSelectNextWeek,\r\n\tonSelectPreviousWeek,\r\n\tcolumns,\r\n\tdisabledButtons,\r\n\tdaysRange,\r\n}) => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{Object.keys(columns).slice(0, daysRange).map((day, index) =>\r\n\t\t\t\t\r\n\t\t\t\t\t{moment(day).utc().format('ddd')}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{moment(day).utc().format('MMM DD')}\r\n\t\t\t\t)}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default DoctorBookedTimeBlockHeader;\r\n","import * as React from 'react';\r\nimport { Link } from 'react-router-dom';\r\n\r\nimport Modal from 'antd/lib/modal';\r\n\r\nimport LoginPage from '@common/react/components/Pages/Login/Login';\r\n\r\nimport { customReduxActions } from '@app/store/CustomReduxActions';\r\n\r\ninterface Props {\r\n\tvisible: boolean;\r\n\thandleClose: () => void;\r\n\tafterLogin: () => void;\r\n}\r\n\r\nconst LoginForm: React.FC = ({ visible, handleClose, afterLogin }) => {\r\n\treturn (\r\n\t\t document.querySelector('.app-container') || document.body}\r\n\t\t>\r\n\t\t\t
\r\n\t\t\t\t <>}\r\n\t\t\t\t\twithFieldTitle\r\n\t\t\t\t\tbuttons={Register}\r\n\t\t\t\t\tafterLogin={afterLogin}\r\n\t\t\t\t/>\r\n\t\t\t
\r\n\t\t\r\n\t);\r\n};\r\n\r\nexport default LoginForm;\r\n","import React from 'react';\r\n\r\nimport * as Yup from 'yup';\r\nimport * as moment from 'moment';\r\nimport Select from 'antd/lib/select';\r\nimport Modal from 'antd/lib/modal';\r\n\r\nimport Button from '@common/react/components/Forms/Button';\r\nimport Autocomplete from '@common/react/components/Forms/Autocomplete/Autocomplete';\r\nimport { nonEmptyArray, notNullValidator, simpleStringValidator } from '@common/react/utils/validationHelpers';\r\nimport { getPopupContainer } from '@common/react/components/Utils/Utils';\r\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\r\nimport { ItemEditor } from '@common/react/components/Core/ItemEditor/ItemEditor';\r\nimport { useApplicationContext } from '@common/react/components/Core/Application/Application';\r\n\r\nimport { TimeSpan } from '@commonTuna/react/components/UI/DayTimeSelectModal/DayTimeSelectModal';\r\nimport { BaseInvite } from '@commonTuna/react/objects/BaseInvite';\r\n\r\nimport { Appointment, AppointmentProcedure } from '@app/objects/Appointment';\r\nimport { User } from '@app/objects/User';\r\nimport { Location } from '@app/objects/Location';\r\nimport { Doctor, DoctorBookedTime, DoctorProcedure } from '@app/objects/Doctor';\r\nimport LoginForm from '@app/components/UI/ScheduleAppointmentModal/LoginForm';\r\nimport DoctorBookedTimeBlockTable from '@app/components/UI/DoctorBookedTimeBlock/DoctorBookedTimeBlock';\r\nimport { dateToUtcString, getAppContainer, getLocationName } from '@app/components/Utils';\r\n\r\ninterface ComponentProps {\r\n\tpatient: User | null;\r\n\tdoctorFixed?: boolean;\r\n\tdoctor?: Doctor;\r\n\tafterSubmit?: (items?: Array) => void;\r\n\tloadInvites?: () => void;\r\n\tscheduledTime?: number;\r\n\tselectedLocation?: Location | null;\r\n\tlocationItems?: Array;\r\n\tonModalClose?: () => void;\r\n\tasNearestDate?: boolean;\r\n\tdoctorProcedures?: Array;\r\n\tdoctorBookedTime?: DoctorBookedTime;\r\n\tdaysRange?: number;\r\n\tshowMobile?: boolean;\r\n}\r\n\r\nexport interface SelectedTimeIndex {\r\n\tkey: string;\r\n\tstart: string;\r\n}\r\n\r\ninterface FormValues {\r\n\tid: number | null;\r\n\tfirstName: string | null;\r\n\tlastName: string | null;\r\n\tpatientId: number | null;\r\n\tpatient: User | null;\r\n\tscheduledTime: number | null;\r\n\tprocedures: Array;\r\n\tlocation: Location | null;\r\n\tlocationId: number | null;\r\n\tdoctorProcedureIds: Array;\r\n\tduration: string | null;\r\n\tnotes: string;\r\n\tdoctor: Doctor | null;\r\n\tdoctorProcedure: DoctorProcedure | null;\r\n\tselectedTimeIndex: SelectedTimeIndex | undefined;\r\n}\r\n\r\nconst getDuration = (timeSpan: string): string | null => {\r\n\tconst timeArr = timeSpan.split(':');\r\n\tif (timeArr.length === 3) {\r\n\t\tconst hours = +timeArr[0] ? `${+timeArr[0]} h ` : '';\r\n\t\tconst minutes = `${+timeArr[1]} m`;\r\n\t\treturn `${hours}${minutes}`;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nexport const getMinutesFromDuration = (duration: string) => {\r\n\tconst [h, m] = duration.split(':');\r\n\r\n\treturn +(h || 0) * 60 + +(m || 0);\r\n};\r\n\r\nconst { success, error } = Modal;\r\n\r\nconst Option = Select.Option;\r\n\r\nfunction strToTimeSpan(str: string): TimeSpan {\r\n\tconst numArr = str.split(':').map(Number);\r\n\treturn {\r\n\t\thour: numArr[0],\r\n\t\tminute: numArr[1],\r\n\t};\r\n}\r\n\r\nfunction clearListFields(items: Array, fields: Array) {\r\n\tif (!items) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst newValues = {};\r\n\tfields.forEach((field) => newValues[field] = null);\r\n\r\n\treturn items.map((item: T) => ({\r\n\t\t...item,\r\n\t\t...newValues,\r\n\t}));\r\n}\r\n\r\nexport const dateStringRequiredValidator = Yup.string().matches(/([0-9]{2}-[0-9]{2}-[0-9]{4})/, 'Invalid date').required();\r\n\r\nconst validationSchemaWithPatientCreating = Yup.object().shape({\r\n\tlocationId: notNullValidator.required(),\r\n\tscheduledTime: notNullValidator.required(),\r\n\tduration: simpleStringValidator,\r\n\tprocedures: nonEmptyArray('Procedures should not be empty'),\r\n});\r\n\r\nexport const getDaysCount = () => {\r\n\tif (typeof window === 'undefined') return 3;\r\n\tif (window.innerWidth >= 1920) return 7;\r\n\tif (window.innerWidth >= 1770) return 6;\r\n\tif (window.innerWidth >= 1580) return 5;\r\n\tif (window.innerWidth >= 1366) return 4;\r\n\treturn 3;\r\n};\r\n\r\nexport const getDaysCountMobile = () => {\r\n\tif (typeof window === 'undefined') return 4;\r\n\r\n\tconst count = Math.floor((window.innerWidth - 160) / 82);\r\n\r\n\treturn count > 7 ? 7 : count < 2 ? 2 : count;\r\n};\r\n\r\nconst getRowsCount = () => {\r\n\tif (typeof window === 'undefined' || window.innerHeight >= 1000) {\r\n\t\treturn 11;\r\n\t}\r\n\r\n\treturn Math.ceil((window.innerHeight - 575) / 50);\r\n};\r\n\r\nconst FormHandler: React.FC<{ formik, patient, doctor, formRef}> = ({\r\n\tformik, patient, doctor, formRef,\r\n}) => {\r\n\tReact.useEffect(() => {\r\n\t\tformik.setValues((prev) => ({\r\n\t\t\t...prev,\r\n\t\t\tpatientId: patient?.id || -1,\r\n\t\t\tpatient: patient || null,\r\n\t\t\tfirstName: patient?.firstName || '',\r\n\t\t\tlastName: patient?.lastName || '',\r\n\t\t}));\r\n\t}, [patient]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (doctor) {\r\n\t\t\tformik.setValues((prev) => ({\r\n\t\t\t\t...prev,\r\n\t\t\t\tdoctor: doctor || null,\r\n\t\t\t\tdoctorId: doctor?.id,\r\n\t\t\t}));\r\n\t\t}\r\n\t}, [doctor]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (formik) {\r\n\t\t\tformRef.current = formik;\r\n\t\t}\r\n\t}, [formik]);\r\n\r\n\treturn <>;\r\n};\r\n\r\nconst ScheduleAppointment: React.FC = ({\r\n\tpatient,\r\n\tdoctor,\r\n\tdoctorFixed = false,\r\n\tafterSubmit,\r\n\tloadInvites,\r\n\tscheduledTime,\r\n\tselectedLocation,\r\n\tlocationItems,\r\n\tonModalClose,\r\n\tasNearestDate,\r\n\tdoctorProcedures,\r\n\tdoctorBookedTime,\r\n\tdaysRange,\r\n\tshowMobile,\r\n}) => {\r\n\tconst [locations, setLocations] = React.useState>(locationItems ?? []);\r\n\tconst [doctorBookedTimes, setDoctorBookedTimes] = React.useState(doctorBookedTime);\r\n\tconst [procedures, setProcedures] = React.useState>(doctorProcedures || []);\r\n\tconst [isLoading, setLoading] = React.useState(false);\r\n\tconst [visible, setVisible] = React.useState(false);\r\n\tconst [duration, setDuration] = React.useState(15);\r\n\tconst [invites, setInvites] = React.useState>([]);\r\n\tconst [companyTemplateInvite, setCompanyTemplateInvite] = React.useState(null);\r\n\tconst [days, setDays] = React.useState(daysRange || (showMobile ? getDaysCountMobile : getDaysCount)());\r\n\tconst [rowCount, setRowCount] = React.useState(getRowsCount());\r\n\tconst [isMobile, setIsMobile] = React.useState(typeof window !== 'undefined' ? window.innerWidth < 768 : false);\r\n\tconst formRef = React.useRef();\r\n\tconst { request } = useApplicationContext();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst resize = () => {\r\n\t\t\tsetIsMobile(window.innerWidth < 768);\r\n\t\t};\r\n\r\n\t\tresize();\r\n\t\twindow.addEventListener('resize', resize);\r\n\t\treturn () => window.removeEventListener('resize', resize);\r\n\t}, []);\r\n\r\n\tconst initialValues = React.useMemo(() => {\r\n\t\tconst values = {} as FormValues;\r\n\t\treturn ({\r\n\t\t\t...{} as Appointment,\r\n\t\t\tpatientId: patient?.id || -1,\r\n\t\t\tpatient: patient || null,\r\n\t\t\tfirstName: patient?.firstName || '',\r\n\t\t\tlastName: patient?.lastName || '',\r\n\t\t\tdoctor: doctor || null,\r\n\t\t\tdoctorId: doctor?.id,\r\n\t\t\tduration: procedures[0]?.duration || null,\r\n\t\t\tscheduledTime: scheduledTime && !asNearestDate\r\n\t\t\t\t? scheduledTime\r\n\t\t\t\t: values.scheduledTime || null,\r\n\t\t\tnotes: values.notes || '',\r\n\t\t\tlocation: selectedLocation || (values.location || locations.length > 0 ? locations[0] : null),\r\n\t\t\tlocationId: selectedLocation\r\n\t\t\t\t? selectedLocation.id\r\n\t\t\t\t: values.locationId || locations.length > 0 ? locations[0].id : -1,\r\n\t\t\tprocedures: values.procedures || [{\r\n\t\t\t\tid: -1,\r\n\t\t\t\tdeleted: false,\r\n\t\t\t\tdoctorProcedure: null,\r\n\t\t\t\tstartProcedureTime: scheduledTime || values.scheduledTime || null,\r\n\t\t\t\tappointmentId: null,\r\n\t\t\t\tcount: 1,\r\n\t\t\t} as unknown as AppointmentProcedure],\r\n\t\t\tdoctorProcedure: values.doctorProcedure || null,\r\n\t\t\tdoctorProcedureIds: values?.doctorProcedureIds ? values.doctorProcedureIds.length > 0 ? values.doctorProcedureIds : [] : [],\r\n\t\t\tselectedTimeIndex: undefined,\r\n\t\t});\r\n\t}, [patient, doctor?.id, scheduledTime, selectedLocation]);\r\n\r\n\tconst handleClose = React.useCallback(() => {\r\n\t\tsetVisible(false);\r\n\t\tonModalClose && onModalClose();\r\n\t}, []);\r\n\r\n\tconst afterLogin = () => {\r\n\t\thandleClose();\r\n\t\tModal.confirm({\r\n\t\t\ttitle: `You wanted to create an appointment with ${doctor?.nameEn} ${\r\n\t\t\t\tdateToUtcString(formRef.current?.values.scheduledTime, 'hh:mm a')}?`,\r\n\t\t\tcontent: '',\r\n\t\t\tclassName: 'schedule-confirm',\r\n\t\t\ticon: <>,\r\n\t\t\tokText: 'Yes',\r\n\t\t\tokType: 'primary',\r\n\t\t\tcancelText: 'No',\r\n\t\t\tokButtonProps: {\r\n\t\t\t\tclassName: 'btn btn-primary',\r\n\t\t\t},\r\n\t\t\tcancelButtonProps: {\r\n\t\t\t\tclassName: 'btn btn-default',\r\n\t\t\t},\r\n\t\t\tgetContainer: getAppContainer,\r\n\t\t\tonOk() {\r\n\t\t\t\tformRef.current?.submitForm();\r\n\t\t\t},\r\n\t\t\tonCancel: () => {\r\n\t\t\t\tfillDoctorProcedureFields(procedures[0]);\r\n\t\t\t\tformRef.current?.setFieldValue('scheduledTime', scheduledTime && !asNearestDate\r\n\t\t\t\t\t? scheduledTime\r\n\t\t\t\t\t: null);\r\n\t\t\t\tif (locations.length) {\r\n\t\t\t\t\tformRef.current?.setFieldValue('locationId', locations[0].id);\r\n\t\t\t\t\tformRef.current?.setFieldValue('location', locations[0]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t});\r\n\t};\r\n\r\n\tconst onSave = React.useCallback(() => {\r\n\t\tsuccess({\r\n\t\t\tcontent: <>\r\n\t\t\t\t\r\n\t\t\t\t{' '}\r\n\t\t\t\tAppointment has been successfully created.\r\n\t\t\t,\r\n\t\t\twrapClassName: 'success-modal',\r\n\t\t\ticon: null,\r\n\t\t});\r\n\t}, []);\r\n\r\n\tconst loadLocations = (doctorId?: number) => {\r\n\t\tconst locationData = {\r\n\t\t\ttext: '',\r\n\t\t\tdoctorId,\r\n\t\t};\r\n\t\trequest('locationList', locationData)\r\n\t\t\t.then((response: any) => {\r\n\t\t\t\tsetLocations(response.list);\r\n\t\t\t\tif (formRef.current && formRef.current.values.locationId === -1 && response.list.length > 0) {\r\n\t\t\t\t\tformRef.current?.setFieldValue('locationId', response.list[0].id);\r\n\t\t\t\t\tformRef.current?.setFieldValue('location', response.list[0]);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\terror({\r\n\t\t\t\t\ttitle: 'Error',\r\n\t\t\t\t\tcontent: `Something went wrong. ${err}`,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tconst fillDoctorProcedureFields = (doctorProcedure: DoctorProcedure) => {\r\n\t\tformRef.current?.setFieldValue('doctorProcedureId', +doctorProcedure.id);\r\n\t\tformRef.current?.setFieldValue('doctorProcedureIds', [+doctorProcedure.id]);\r\n\t\tformRef.current?.setFieldValue('doctorProcedure', doctorProcedure);\r\n\t\tformRef.current?.setFieldValue('procedures', [{\r\n\t\t\tdoctorProcedure,\r\n\t\t\tdoctorProcedureId: +doctorProcedure.id,\r\n\t\t\tduration: formRef.current?.values.duration,\r\n\t\t\tstartProcedureTime: formRef.current?.values.scheduledTime,\r\n\t\t\tappointmentId: -1,\r\n\t\t}]);\r\n\t\tformRef.current?.setFieldValue('doctor', doctorProcedure.doctor);\r\n\t\tformRef.current?.setFieldValue('duration', doctorProcedure.duration);\r\n\t};\r\n\r\n\tconst loadProcedures = (doctorId?: number, locationId?: number) => {\r\n\t\tconst proceduresData = {\r\n\t\t\ttext: '',\r\n\t\t\tdoctorId,\r\n\t\t\tlocationId,\r\n\t\t\twithProcedure: true,\r\n\t\t\twithDoctor: true,\r\n\t\t\twithAppointmentType: true,\r\n\t\t\tpublished: true,\r\n\t\t\thasGlobalProcedure: true,\r\n\t\t\twithGlobalProcedure: true,\r\n\t\t};\r\n\r\n\t\trequest('doctorProcedureList', proceduresData)\r\n\t\t\t.then((response: any) => {\r\n\t\t\t\tconst list = response.list.filter((p) => p.procedure?.globalProcedureId);\r\n\t\t\t\tsetProcedures(list);\r\n\t\t\t\tif (formRef.current && list.length > 0) {\r\n\t\t\t\t\tfillDoctorProcedureFields(response.list[0]);\r\n\t\t\t\t}\r\n\t\t\t\tformRef.current?.setFieldValue('locationId', locationId);\r\n\t\t\t})\r\n\t\t\t.catch((err) => {\r\n\t\t\t\terror({\r\n\t\t\t\t\ttitle: 'Error',\r\n\t\t\t\t\tcontent: `Something went wrong. ${err}`,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t};\r\n\r\n\tconst handleResize = () => {\r\n\t\tsetDays((showMobile ? getDaysCountMobile : getDaysCount)());\r\n\t\tsetRowCount(getRowsCount());\r\n\t};\r\n\r\n\tconst endDate = React.useMemo(() => doctorBookedTimes && moment(doctorBookedTimes.endDate).subtract(7 - days, 'days'), []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (!locationItems) {\r\n\t\t\tloadLocations(doctor?.id);\r\n\t\t}\r\n\r\n\t\tif (formRef.current?.values) {\r\n\t\t\tif (procedures.length > 0) {\r\n\t\t\t\tfillDoctorProcedureFields(procedures[0]);\r\n\t\t\t} else {\r\n\t\t\t\tloadProcedures(formRef.current?.values.doctor?.id || doctor?.id, formRef.current?.values.locationId || undefined);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (doctorBookedTimes) {\r\n\t\t\tconst keys = Object.keys(doctorBookedTimes.values);\r\n\r\n\t\t\tif (!doctorBookedTimes.nearestTime && endDate && keys.every((key) => {\r\n\t\t\t\tif (moment(key) <= endDate) {\r\n\t\t\t\t\treturn doctorBookedTimes.values[key].length === 0;\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t})) {\r\n\t\t\t\tconst nearestTimeKey = keys.find((key) =>\r\n\t\t\t\t\t(doctorBookedTimes.values[key]?.length > 0 ? doctorBookedTimes.values[key].some((value) => !value.booked) : false));\r\n\r\n\t\t\t\tif (nearestTimeKey) {\r\n\t\t\t\t\tconst tempNearestTime = moment(nearestTimeKey);\r\n\t\t\t\t\tif (endDate && tempNearestTime > endDate) {\r\n\t\t\t\t\t\tdoctorBookedTimes.nearestTime = tempNearestTime.valueOf();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst keysForRemove = endDate && Object.keys(doctorBookedTimes.values).map((key) => {\r\n\t\t\t\tif (moment(key) > endDate) {\r\n\t\t\t\t\treturn key;\r\n\t\t\t\t}\r\n\t\t\t\treturn '';\r\n\t\t\t});\r\n\r\n\t\t\tkeysForRemove && keysForRemove.length > 0 && keysForRemove.map((key) => {\r\n\t\t\t\tif (key) {\r\n\t\t\t\t\tdelete doctorBookedTimes.values[key];\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\twindow.addEventListener('resize', handleResize);\r\n\r\n\t\treturn () => window.removeEventListener('resize', handleResize);\r\n\t}, []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (scheduledTime && !asNearestDate && selectedLocation && formRef.current) {\r\n\t\t\tformRef.current?.setFieldValue('scheduledTime', scheduledTime);\r\n\t\t\tformRef.current?.setFieldValue('location', selectedLocation);\r\n\t\t\tformRef.current?.setFieldValue('locationId', selectedLocation.id);\r\n\t\t}\r\n\r\n\t\tif (scheduledTime && selectedLocation) {\r\n\t\t\tloadProcedures(formRef.current?.values.doctor?.id || doctor?.id, selectedLocation.id);\r\n\t\t}\r\n\t}, [scheduledTime, selectedLocation, asNearestDate]);\r\n\r\n\tconst value = React.useMemo(() => (doctorBookedTimes && endDate && {\r\n\t\t...doctorBookedTimes,\r\n\t\tendDate: endDate.valueOf(),\r\n\t}), [doctorBookedTimes, endDate]);\r\n\r\n\treturn <>\r\n\t\t {\r\n\t\t\t\tconst data = {\r\n\t\t\t\t\t...values,\r\n\t\t\t\t\tpatient: null,\r\n\t\t\t\t\tdoctor: null,\r\n\t\t\t\t\tlocation: null,\r\n\t\t\t\t\troom: null,\r\n\t\t\t\t\tappointmentType: null,\r\n\t\t\t\t\tscheduledTime: values.scheduledTime!,\r\n\t\t\t\t\tprocedures: clearListFields(values.procedures, ['doctorProcedure', 'appointment', 'room', 'doctorPayer']),\r\n\t\t\t\t};\r\n\t\t\t\treturn {\r\n\t\t\t\t\tid: -1,\r\n\t\t\t\t\tdoctorPath: doctor?.portalPathEn,\r\n\t\t\t\t\tappointments: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t...data,\r\n\t\t\t\t\t\t\tscheduledTime: values.scheduledTime,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t],\r\n\t\t\t\t} as any;\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t {\r\n\t\t\t\t\tif (values.patient) {\r\n\t\t\t\t\t\tsetLoading(true);\r\n\t\t\t\t\t\tsubmit()\r\n\t\t\t\t\t\t\t.then((response: any) => {\r\n\t\t\t\t\t\t\t\tonSave();\r\n\t\t\t\t\t\t\t\tsetLoading(false);\r\n\t\t\t\t\t\t\t\tsetVisible(false);\r\n\r\n\t\t\t\t\t\t\t\t// Try remove time block if appointment successfully scheduled\r\n\t\t\t\t\t\t\t\tif (doctorBookedTimes && values.selectedTimeIndex) {\r\n\t\t\t\t\t\t\t\t\tconst current = { ...doctorBookedTimes };\r\n\t\t\t\t\t\t\t\t\tcurrent.values[values.selectedTimeIndex.key] = current.values[values.selectedTimeIndex.key]\r\n\t\t\t\t\t\t\t\t\t\t.filter((q) => q.start !== values.selectedTimeIndex!.start);\r\n\t\t\t\t\t\t\t\t\tsetDoctorBookedTimes(current);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tconst newAppointment = response.appointments[0];\r\n\r\n\t\t\t\t\t\t\t\tif (newAppointment.invites?.length > 0) {\r\n\t\t\t\t\t\t\t\t\tconst companyInvite = newAppointment.invites.find((inv) => inv.isCompanyTemplate && !inv.answered);\r\n\t\t\t\t\t\t\t\t\tif (companyInvite) {\r\n\t\t\t\t\t\t\t\t\t\tsetCompanyTemplateInvite(companyInvite);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tsetInvites(newAppointment.invites.filter((inv) => !inv.isCompanyTemplate));\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tafterSubmit && afterSubmit(newAppointment.invites);\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t.catch((err: string) => {\r\n\t\t\t\t\t\t\t\tsetLoading(false);\r\n\t\t\t\t\t\t\t\terror({\r\n\t\t\t\t\t\t\t\t\ttitle: 'Error',\r\n\t\t\t\t\t\t\t\t\tcontent: err,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsetVisible(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}}\r\n\t\t\t\tedit={(formik) =>
\r\n\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t{!doctorFixed\r\n\t\t\t\t\t\t\t&& \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{formik.values.locationId && formik.values.doctor?.id && formik.values.duration && (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tdays={days}\r\n\t\t\t\t\t\t\t\trowCount={rowCount}\r\n\t\t\t\t\t\t\t\tinterval={formik.values.duration ? getMinutesFromDuration(formik.values.duration) : undefined}\r\n\t\t\t\t\t\t\t\tselectedTime={formik.values.scheduledTime || undefined}\r\n\t\t\t\t\t\t\t\tinitStartDay={(asNearestDate && scheduledTime) || undefined}\r\n\t\t\t\t\t\t\t\tselectLocationById={formik.values.locationId || undefined}\r\n\t\t\t\t\t\t\t\tonSelect={(time: number, location: Location, asNearestTime?: boolean, selectedTimeIndex?: SelectedTimeIndex) => {\r\n\t\t\t\t\t\t\t\t\tformik.setFieldValue('scheduledTime', time);\r\n\t\t\t\t\t\t\t\t\tif (formik.values.procedures?.length) {\r\n\t\t\t\t\t\t\t\t\t\tformik.setFieldValue('procedures[0].startProcedureTime', time);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tformik.setFieldValue('selectedTimeIndex', selectedTimeIndex);\r\n\t\t\t\t\t\t\t\t\t/* formik.setFieldValue('location', location);\r\n\t\t\t\t\t\t\t\t\tformik.setFieldValue('locationId', location.id); */\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\t\t\twithoutLocationButtons\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tSchedule Appointment\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
}\r\n\t\t\t/>\r\n\t\t\r\n\t\t\r\n\t;\r\n};\r\n\r\nexport default ScheduleAppointment;\r\n\r\ninterface ProcedureSelectComponentProps {\r\n\tformik: any;\r\n\tprocedures: Array;\r\n\tdoctorFixed: boolean;\r\n}\r\n\r\nconst ProcedureSelectComponent: React.FC = ({ formik, procedures, doctorFixed }) => {\r\n\treturn {\r\n\t\t\tformik.setFieldValue('doctorProcedureId', +value);\r\n\t\t\tformik.setFieldValue('doctorProcedureIds', [+value]);\r\n\t\t\tformik.setFieldValue('doctorProcedure', option.props.item);\r\n\t\t\tformik.setFieldValue('procedures', [{\r\n\t\t\t\tdoctorProcedure: option.props.item,\r\n\t\t\t\tdoctorProcedureId: +value,\r\n\t\t\t\tduration: formik.values.duration,\r\n\t\t\t\tstartProcedureTime: formik.values.scheduledTime,\r\n\t\t\t\tappointmentId: -1,\r\n\t\t\t}]);\r\n\t\t\tformik.setFieldValue('doctor', option.props.item.doctor);\r\n\t\t\tformik.setFieldValue('duration', option.props.item.duration);\r\n\t\t}}\r\n\t\tonChange={(value = -1) => {\r\n\t\t\tif (value === -1) {\r\n\t\t\t\tformik.setFieldValue('doctorProcedureId', null);\r\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\t}\r\n\t\t}}\r\n\t>\r\n\t\t{procedures.map((doctorProcedure) => {\r\n\t\t\tconst addInfo = `${doctorFixed ? ''\r\n\t\t\t\t: `${doctorProcedure!.doctor?.nameEn || '-'}, `}${getDuration(doctorProcedure!.duration) || '0 m'}`;\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t{doctorProcedure.procedure.globalProcedure?.name}\r\n\t\t\t\t\t{' '}\r\n\t\t\t\t\t(\r\n\t\t\t\t\t{addInfo}\r\n\t\t\t\t\t)\r\n\t\t\t\t\r\n\t\t\t);\r\n\t\t})}\r\n\t;\r\n};\r\n\r\ninterface LocationSelectComponentProps {\r\n\tformik: any;\r\n\tlocations: Array;\r\n\tloadProcedures: (doctorId?: number, locationId?: number) => void;\r\n}\r\n\r\nconst LocationSelectComponent: React.FC = ({ formik, locations, loadProcedures }) => {\r\n\treturn {\r\n\t\t\tconst location = locations.find((q) => q.id === value);\r\n\r\n\t\t\tif (location) {\r\n\t\t\t\tloadProcedures(formik.values.doctor?.id, location?.id);\r\n\r\n\t\t\t\tformik.setFieldValue('location', location);\r\n\r\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\t\tformik.setFieldValue('scheduleTime', null);\r\n\t\t\t}\r\n\t\t}}\r\n\t>\r\n\t\t{locations?.map((location, index) =>\r\n\t\t\t\r\n\t\t\t\t{getLocationName(location)}\r\n\t\t\t)}\r\n\t;\r\n};\r\n\r\ninterface AutocompleteDoctorComponentProps {\r\n\tformik: any;\r\n\tloadLocations: (doctorId?: number) => void;\r\n\tloadProcedures: (doctorId?: number, locationId?: number) => void;\r\n}\r\n\r\nconst AutocompleteDoctorComponent: React.FC = ({ formik, loadLocations, loadProcedures }) => {\r\n\treturn item.nameEn}\r\n\t\tvalue={formik.values.doctor ? formik.values.doctor.nameEn : ''}\r\n\t\tplaceholder=\"Doctor...\"\r\n\t\trenderOption={(autocompleteItem) => {\r\n\t\t\treturn ({\r\n\t\t\t\tkey: autocompleteItem.id.toString(),\r\n\t\t\t\tvalue: autocompleteItem.nameEn,\r\n\t\t\t\ttitle: autocompleteItem.nameEn,\r\n\t\t\t\titem: autocompleteItem,\r\n\t\t\t\tlabel: autocompleteItem.nameEn,\r\n\t\t\t});\r\n\t\t}}\r\n\t\tonSelect={(value, option) => {\r\n\t\t\tformik.setFieldValue('doctorProcedureId', -1);\r\n\t\t\tformik.setFieldValue('doctorProcedureIds', []);\r\n\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\tformik.setFieldValue('procedures', []);\r\n\t\t\tformik.setFieldValue('doctor', option.props.item);\r\n\t\t\tloadLocations(option.props.item.id || -1);\r\n\t\t\tif (option.props.item.id > 0 && formik.values.locationId) {\r\n\t\t\t\tloadProcedures(option.props.item.id, formik.values.locationId);\r\n\t\t\t}\r\n\t\t}}\r\n\t\tonChange={(value = '') => {\r\n\t\t\tif (value === '') {\r\n\t\t\t\tformik.setFieldValue('doctorProcedureId', null);\r\n\t\t\t\tformik.setFieldValue('doctorProcedure', null);\r\n\t\t\t\tformik.setFieldValue('doctor', null);\r\n\t\t\t\tloadLocations();\r\n\t\t\t}\r\n\t\t}}\r\n\t\tparams={{ locationId: formik.values.locationId }}\r\n\t\tloadOnFocus\r\n\t/>;\r\n};\r\n"],"names":["bookedTime","onSelectTime","onSelectPreviousWeek","onSelectNextWeek","startDate","locationId","locations","onSelectLocation","className","rowCount","selectedTime","withoutLocationButtons","withHeader","nearestTime","onNearestTimeClick","range","React","offset","setOffset","Object","entries","values","day","value","moment","isSame","index","time","utc","format","start","Math","floor","getInitialCount","count","setCount","max","keys","map","length","maxCount","setMaxCount","renderItem","slice","isSelected","key","type","disabled","booked","onClick","e","leftChevronDisabled","Date","location","id","company","name","nameEn","DoctorBookedTimeBlockHeader","columns","daysRange","row","result","push","node","renderItems","title","dayMS","resolveBookedTimes","times","interval","res","forEach","blocks","currentBlock","duration","getMinutesFromDuration","end","i","changeBookedTimesByInterval","now","filter","valueOf","filterTimesBeforeNow","doctorId","onSelect","days","onlyWorkingDays","selectLocationById","propsInterval","hideDisabledTimes","nearestDateRedirect","initStartDay","find","q","selectedLocation","setSelectedLocation","loading","setLoading","setRange","setInterval","getStartDayInitial","startDay","setStartDate","endDate","setEndDate","bookedTimeRes","setBookedTimeRes","setNearestDate","solvedNearestTime","setSolvedNearestDate","nearestDate","loadTimes","from","request","then","message","Message","JSON","stringify","newSelectedLocation","newRage","resolvedBookedTime","dates","dateIndex","findIndex","selectedTimeIndex","add","hours","minutes","selectIndexTime","undefined","solvedNearestDate","date","getHours","LogoLoader","size","disabledButtons","style","padding","visible","handleClose","afterLogin","centered","open","onCancel","footer","width","destroyOnClose","maskClosable","getContainer","document","querySelector","body","customReduxActions","withoutServerPage","afterBaseRedirectUser","withFieldTitle","buttons","Link","to","split","success","Modal","error","Option","Select","clearListFields","items","fields","newValues","field","item","Yup","matches","required","validationSchemaWithPatientCreating","shape","notNullValidator","scheduledTime","simpleStringValidator","procedures","nonEmptyArray","getDaysCount","window","innerWidth","getDaysCountMobile","getRowsCount","innerHeight","ceil","FormHandler","formik","patient","doctor","formRef","setValues","prev","patientId","firstName","lastName","current","doctorFixed","afterSubmit","loadInvites","locationItems","onModalClose","asNearestDate","doctorProcedures","doctorBookedTime","showMobile","setLocations","doctorBookedTimes","setDoctorBookedTimes","setProcedures","isLoading","setVisible","setInvites","setCompanyTemplateInvite","setDays","setRowCount","setIsMobile","useApplicationContext","resize","addEventListener","removeEventListener","initialValues","notes","deleted","doctorProcedure","startProcedureTime","appointmentId","doctorProcedureIds","onSave","content","color","fontSize","wrapClassName","icon","loadLocations","text","response","list","setFieldValue","err","fillDoctorProcedureFields","doctorProcedureId","loadProcedures","withProcedure","withDoctor","withAppointmentType","published","hasGlobalProcedure","withGlobalProcedure","p","procedure","globalProcedureId","handleResize","subtract","every","nearestTimeKey","some","tempNearestTime","keysForRemove","readonly","validationSchema","clearForSubmit","data","room","appointmentType","doctorPath","portalPathEn","appointments","showMessages","beforeSubmit","actions","submit","newAppointment","invites","companyInvite","inv","isCompanyTemplate","answered","edit","htmlFor","ProcedureSelectComponent","LocationSelectComponent","AutocompleteDoctorComponent","maxWidth","asNearestTime","dateToUtcString","okText","okType","cancelText","okButtonProps","cancelButtonProps","getAppContainer","onOk","submitForm","marginBottom","placeholder","getPopupContainer","option","props","onChange","addInfo","timeSpan","timeArr","getDuration","toString","globalProcedure","popupClassName","defaultValue","getLocationName","renderTitle","renderOption","autocompleteItem","label","params","loadOnFocus"],"sourceRoot":""}