(history, reducers, initialState);\r\n\r\n\trenderApp(routes);\r\n}\r\n\r\nexport const getStore = () => store;\r\n\r\nexport const getHistory = () => history;\r\n\r\nexport const setStore = (newStore: any) => store = newStore;\r\n\r\nexport function renderApp(routes) {\r\n\t// This code starts up the React app when it runs in a browser. It sets up the routing configuration\r\n\t// and injects the app into a DOM element.\r\n\tif (getStore() === null) {\r\n\t\tthrow 'bootClient must be called first!';\r\n\t}\r\n\r\n\tloadableReady(() => {\r\n\t\tReactDOM.hydrate(\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{routes}\r\n\t\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t ,\r\n\t\t\tdocument.getElementById('react-app'),\r\n\t\t);\r\n\t});\r\n}\r\n","import { Action, Reducer } from 'redux';\r\n\r\nimport { addTask } from 'domain-task';\r\n\r\nimport { AppThunkAction } from '@app/store/index';\r\nimport { request } from '@app/components/Api';\r\n\r\nexport interface PageItemState {\r\n\tpage: P | null;\r\n\tpath: string | null;\r\n\tisLoading: boolean;\r\n}\r\n\r\nexport enum TypeKeys {\r\n\tREQUESTPAGE = 'REQUESTPAGE',\r\n\tRECIEVEPAGE = 'RECIEVEPAGE'\r\n}\r\n\r\nexport interface RequestPageAction {\r\n\ttype: TypeKeys.REQUESTPAGE;\r\n\tstorageName: string | null;\r\n\tpath: string;\r\n}\r\n\r\nexport interface ReceivePageAction {\r\n\ttype: TypeKeys.RECIEVEPAGE;\r\n\tstorageName: string | null;\r\n\tpage: any;\r\n}\r\n\r\ntype KnownPageAction = RequestPageAction | ReceivePageAction;\r\n\r\nexport const actionCreators = ({\r\n\tloadPage: (storageName: string, path: string): AppThunkAction => (dispatch, getState) => {\r\n\t\tconst storeState = (getState() as any)[storageName];\r\n\r\n\t\tif (storeState.path !== path) {\r\n\t\t\tconst fetchTask = request(\r\n\t\t\t\t'pageLoader',\r\n\t\t\t\t{ path },\r\n\t\t\t\tgetState(),\r\n\t\t\t).then((data) => dispatch({ type: TypeKeys.RECIEVEPAGE, storageName, page: data }));\r\n\r\n\t\t\taddTask(fetchTask);\r\n\t\t\tdispatch({ type: TypeKeys.REQUESTPAGE, storageName, path });\r\n\r\n\t\t\treturn fetchTask;\r\n\t\t}\r\n\t},\r\n});\r\n\r\nexport const reducer = (storageName: string):Reducer> => {\r\n\treturn (state: PageItemState = { isLoading: false, page: null, path: '' }, incomingAction: Action) => {\r\n\t\tconst action = incomingAction as KnownPageAction;\r\n\t\tif (!action.storageName || action.storageName === storageName) {\r\n\t\t\tswitch (action.type) {\r\n\t\t\t\tcase TypeKeys.REQUESTPAGE:\r\n\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tisLoading: true,\r\n\t\t\t\t\t\tpage: state.page,\r\n\t\t\t\t\t\tpath: action.path,\r\n\t\t\t\t\t};\r\n\t\t\t\tcase TypeKeys.RECIEVEPAGE:\r\n\t\t\t\t\treturn { isLoading: false, page: action.page, path: action.page.path };\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tconst exhaustiveCheck: never = action;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn state;\r\n\t};\r\n};\r\n","import { ReducersMapObject } from 'redux';\r\n\r\nimport * as Login from '@common/react/store/Login';\r\nimport * as Item from '@common/react/store/Item';\r\nimport { BaseUser } from '@common/react/objects/BaseUser';\r\nimport { BuildData } from '@common/react/objects/BuildData';\r\nimport BaseHostOptions from '@common/react/store/BaseHostOptions';\r\n\r\n// The top-level state object\r\nexport interface BaseApplicationState {\r\n\tlogin: Login.LoginState;\r\n\tbuildData: Item.ItemState;\r\n\thostOptions: Item.ItemState;\r\n}\r\n\r\n// Whenever an action is dispatched, Redux will update each top-level application state property using\r\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\r\n// acts on the corresponding ApplicationState property type.\r\nexport const baseReducers: ReducersMapObject = {\r\n\tlogin: Login.getReducer(),\r\n\tbuildData: Item.getReducer('buildData'),\r\n\thostOptions: Item.getReducer('hostOptions'),\r\n};\r\n\r\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\r\n// correctly typed to match your store.\r\nexport interface BaseAppThunkAction> {\r\n\t(dispatch: (action: TAction) => void, getState: () => TApplicationState): void;\r\n}\r\n","import { ReducersMapObject } from 'redux';\r\n\r\nimport * as Items from '@common/react/store/ItemList';\r\nimport * as Item from '@common/react/store/Item';\r\nimport { BaseAppThunkAction, baseReducers } from '@common/react/store';\r\nimport { ApplicationStateWithChats, getReducer as getChatsReducer } from '@common/react/components/Chat/Store/Chats';\r\nimport { PageItemState, reducer as PageStateReducer } from '@common/react/store/PageItem';\r\nimport { Notification as BaseNotification } from '@common/typescript/objects/Notification';\r\nimport { VideoChatState, getReducer as getVideoChatReducer } from '@common/react/store/VideoChat';\r\n\r\nimport { BaseInvite } from '@commonTuna/react/objects/BaseInvite';\r\n\r\nimport { User } from '@app/objects/User';\r\nimport { Appointment } from '@app/objects/Appointment';\r\nimport { HeaderState, reducer as HeaderReducer } from '@app/store/HeaderSearch';\r\nimport { CountersState, reducer as CountersReducer } from '@app/store/Counters';\r\nimport { RegistrationPage } from '@app/objects/Pages/RegistrationPage';\r\nimport { SearchFilterState, reducer as SearchFilterReducer } from '@app/store/SearchFilter';\r\nimport { UserRegistrationSteps } from '@app/components/Pages/Register/PatientMainForm';\r\nimport { BuildData } from '@app/objects/BuildData';\r\n\r\ntype Notification = BaseNotification;\r\n\r\n// The top-level state object\r\nexport interface ApplicationState extends ApplicationStateWithChats {\r\n\tserverPage: PageItemState;\r\n\r\n\tappointment: Item.ItemState;\r\n\r\n\tbuildData: Item.ItemState;\r\n\r\n\tcompanyTemplateInvites: Items.ItemsState;\r\n\r\n\tuserRegistrationSteps: Item.ItemState;\r\n\r\n\tcounters: CountersState;\r\n\r\n\theader: HeaderState;\r\n\r\n\tregistrationPage: PageItemState;\r\n\r\n\tnotifications: Items.ItemsState;\r\n\r\n\tsearchFilterData: SearchFilterState;\r\n\r\n\tvideoChat: VideoChatState;\r\n}\r\n\r\n// Whenever an action is dispatched, Redux will update each top-level application state property using\r\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\r\n// acts on the corresponding ApplicationState property type.\r\nexport const reducers: ReducersMapObject = {\r\n\t...baseReducers,\r\n\r\n\tbuildData: Item.getReducer('buildData'),\r\n\r\n\tserverPage: PageStateReducer('serverPage'),\r\n\r\n\tchats: getChatsReducer(),\r\n\r\n\tappointment: Item.getReducer('appointment'),\r\n\r\n\tcompanyTemplateInvites: Items.getReducer('companyTemplateInvites'),\r\n\r\n\tuserRegistrationSteps: Item.getReducer('userRegistrationSteps'),\r\n\r\n\tcounters: CountersReducer,\r\n\r\n\theader: HeaderReducer,\r\n\r\n\tregistrationPage: PageStateReducer('registrationPage'),\r\n\r\n\tnotifications: Items.getReducer('notifications'),\r\n\r\n\tsearchFilterData: SearchFilterReducer,\r\n\r\n\tvideoChat: getVideoChatReducer(),\r\n};\r\n\r\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\r\n// correctly typed to match your store.\r\nexport type AppThunkAction = BaseAppThunkAction\r\n","import 'raf/polyfill';\r\n\r\nimport 'core-js/features/array/from';\r\nimport 'core-js/features/array/find';\r\nimport 'core-js/features/array/includes';\r\nimport 'core-js/features/set';\r\nimport 'core-js/features/map';\r\nimport 'core-js/features/weak-map';\r\nimport 'core-js/features/promise';\r\n\r\nimport * as Sentry from '@sentry/browser';\r\n\r\nimport { bootClient, renderApp } from '@common/react/loadable/boot-client';\r\nimport { updateReducers } from '@common/react/configureStore';\r\n\r\nimport { ApplicationState, reducers } from '@app/store';\r\nimport { User } from '@app/objects/User';\r\nimport { routes } from '@app/routes';\r\n\r\nconsole.log(`ENVIRONMENT: ${ENVIRONMENT}`);\r\n\r\nbootClient(routes, reducers);\r\n\r\n// Allow Hot Module Replacement\r\nif (module.hot) {\r\n\tmodule.hot.accept('@app/routes', () => {\r\n\t\trenderApp((require('@app/routes') as any).routes);\r\n\t});\r\n}\r\n\r\n// Enable Webpack hot module replacement for reducers\r\nif (module.hot) {\r\n\tmodule.hot.accept('@app/store', () => {\r\n\t\tconst nextRootReducer = require('@app/store');\r\n\t\tupdateReducers((nextRootReducer as any).reducers);\r\n\t});\r\n}\r\n\r\nif (process.env.NODE_ENV === 'production') {\r\n\tSentry.init({ dsn: 'https://c615bb76d98d45c4ba76c5d43dcd9685@o389532.ingest.sentry.io/5356380' });\r\n}\r\n","import { getCurrentHub } from '@sentry/hub';\nimport { logger } from '@sentry/utils';\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instanciate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind(clientClass, options) {\n if (options.debug === true) {\n logger.enable();\n }\n var hub = getCurrentHub();\n var client = new clientClass(options);\n hub.bindClient(client);\n}\n//# sourceMappingURL=sdk.js.map","import { request as baseRequest } from '@common/react/components/Api';\r\n\r\nimport { ApplicationState } from '@app/store';\r\nimport { User } from '@app/objects/User';\r\n\r\nexport function request(type: string, data?: any, state?: ApplicationState) {\r\n\treturn baseRequest(type, data, state);\r\n}\r\n","import { setLocale } from 'yup';\r\n\r\nsetLocale({\r\n\tmixed: {\r\n\t\trequired: 'Required field!',\r\n\t},\r\n\tstring: {\r\n\t\temail: 'Invalid email',\r\n\t},\r\n});\r\n","import React from 'react';\r\n\r\nexport type DraggablePlace = 'center' | 'leftBottom';\r\n\r\ninterface DraggableProps {\r\n\tisDraggable?: boolean;\r\n\tisInOrigin?: boolean;\r\n\tclassName?: string;\r\n\tstyle?: React.CSSProperties;\r\n\tignoreElements?: Array;\r\n\tpadding?: number;\r\n\tdefaultPosition?: DraggablePlace;\r\n}\r\n\r\ninterface DraggableData {\r\n\tisDragging: boolean;\r\n\tshiftX?: number;\r\n\tshiftY?: number;\r\n\tposX?: number;\r\n\tposY?: number;\r\n}\r\n\r\nconst Draggable: React.FC = ({\r\n\tisDraggable, isInOrigin, className, style, children, ignoreElements, padding = 5, ...rest\r\n}) => {\r\n\tconst { defaultPosition = 'center' } = rest;\r\n\tconst [position, setPosition] = React.useState<{x: string, y: string}>({ x: '50%', y: '50%' });\r\n\tconst [defaultStyle, setDefaultStyle] = React.useState(() => {\r\n\t\tif (defaultPosition === 'center') {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft: defaultPosition === 'leftBottom' ? 'unset' : undefined,\r\n\t\t\tright: defaultPosition === 'leftBottom' ? `${padding}px` : undefined,\r\n\t\t\ttop: defaultPosition === 'leftBottom' ? 'unset' : undefined,\r\n\t\t\tbottom: defaultPosition === 'leftBottom' ? `${padding}px` : undefined,\r\n\t\t\ttransform: undefined,\r\n\t\t};\r\n\t});\r\n\r\n\tconst draggableRef = React.useRef(null);\r\n\tconst draggableData = React.useRef({ isDragging: false });\r\n\r\n\tconst handleDragStart: React.PointerEventHandler = (e) => {\r\n\t\tif (!draggableRef.current || !isDraggable) return;\r\n\t\tconst el = (e.target as any);\r\n\r\n\t\tconst ignore = ignoreElements?.some((item) => {\r\n\t\t\treturn el.classList.contains(item) || !!el.closest(`.${item}`);\r\n\t\t});\r\n\r\n\t\tif (ignore) return;\r\n\r\n\t\tdraggableData.current.isDragging = true;\r\n\t\te.currentTarget?.setPointerCapture(e.pointerId);\r\n\t\tconst {\r\n\t\t\twidth, height, left, top,\r\n\t\t} = e.currentTarget.getBoundingClientRect();\r\n\r\n\t\tdraggableData.current.shiftX = e.clientX - left - width / 2;\r\n\t\tdraggableData.current.shiftY = e.clientY - top - height / 2;\r\n\t};\r\n\r\n\tconst handleDrag: React.PointerEventHandler = (e) => {\r\n\t\tif (!draggableRef.current || !draggableData.current.isDragging || !isDraggable) return;\r\n\t\te.preventDefault();\r\n\r\n\t\tlet posX = e.clientX - (draggableData.current.shiftX || 0);\r\n\t\tlet posY = e.clientY - (draggableData.current.shiftY || 0);\r\n\t\tconst width = draggableRef.current.offsetWidth;\r\n\t\tconst height = draggableRef.current.offsetHeight;\r\n\r\n\t\tif (posY < padding + height / 2) {\r\n\t\t\tposY = padding + height / 2;\r\n\t\t}\r\n\r\n\t\tif (posX < padding + width / 2) {\r\n\t\t\tposX = padding + width / 2;\r\n\t\t}\r\n\r\n\t\tif (posX + width / 2 + padding > window.innerWidth\r\n\t\t\t&& window.innerWidth > width + 2 * padding) {\r\n\t\t\tposX = window.innerWidth - padding - width / 2;\r\n\t\t}\r\n\r\n\t\tif (posX + width / 2 + padding > window.innerWidth\r\n\t\t\t&& window.innerWidth > width + 2 * padding) {\r\n\t\t\tposX = window.innerWidth - padding - width / 2;\r\n\t\t}\r\n\r\n\t\tif (posY + height / 2 + padding > window.innerHeight\r\n\t\t\t&& window.innerHeight > height + 2 * padding) {\r\n\t\t\tposY = window.innerHeight - padding - height / 2;\r\n\t\t}\r\n\r\n\t\tdraggableRef.current.style.right = 'unset';\r\n\t\tdraggableRef.current.style.bottom = 'unset';\r\n\t\tdraggableRef.current.style.transform = 'translate(-50%, -50%)';\r\n\t\tdraggableData.current.posX = posX;\r\n\t\tdraggableRef.current.style.left = `${posX}px`;\r\n\r\n\t\tdraggableData.current.posY = posY;\r\n\t\tdraggableRef.current.style.top = `${posY}px`;\r\n\t\tdraggableRef.current.style.borderColor = 'green';\r\n\t};\r\n\r\n\tconst handleDragEnd: React.PointerEventHandler = (e) => {\r\n\t\tif (!draggableRef.current || !draggableData.current.isDragging) return;\r\n\t\te.preventDefault();\r\n\r\n\t\tdraggableData.current.isDragging = false;\r\n\t\tdraggableRef.current.style.borderColor = 'transparent';\r\n\r\n\t\tif (typeof draggableData.current.posX === 'number') {\r\n\t\t\tsetPosition({\r\n\t\t\t\tx: `${draggableData.current.posX}px`,\r\n\t\t\t\ty: `${draggableData.current.posY}px`,\r\n\t\t\t});\r\n\t\t\tsetDefaultStyle({});\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t
\r\n\t);\r\n};\r\n\r\nexport default Draggable;\r\n","import React from 'react';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\n\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport ChatMessageForm from '@common/react/components/Chat/ChatMessageForm';\r\nimport ChatMessageList from '@common/react/components/Chat/ChatMessageList';\r\nimport { Chat, ChatMessage } from '@common/react/components/Chat/Chat';\r\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\r\nimport useRequest from '@common/react/hooks/useRequest';\r\nimport { useChatSettingsProviderContext } from '@common/react/components/Chat/ChatSettingsProvider';\r\n\r\ninterface Props {\r\n\tchat?: Chat;\r\n\tchatId: number;\r\n\tactionsInPopup?: boolean;\r\n\tfilesAfterButtons?: boolean;\r\n\tgetActionPopupContainer?: (node) => HTMLElement;\r\n}\r\n\r\nconst ChatMessagesWithForm: React.FC = (props) => {\r\n\tconst context = useChatSettingsProviderContext();\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\trequests: { getChat }, storageName, chatStoreSettings, avatarSettings,\r\n\t\t},\r\n\t} = context;\r\n\tconst { getActionCreators } = chatStoreSettings;\r\n\r\n\tconst chats = useSelector((state: any) => state[storageName]?.chats, shallowEqual);\r\n\tconst [chat, setChat] = React.useState(() => props.chat || chats?.list.find((chat) => chat?.id === props.chatId));\r\n\tconst user = useSelector((state: any) => state.login.user, shallowEqual);\r\n\tconst [editMessage, setEdit] = React.useState(null);\r\n\tconst [replyMessage, setReplyMessage] = React.useState(null);\r\n\r\n\tconst dispatch = useDispatch();\r\n\tconst actions = React.useMemo(() => bindActionCreators(getActionCreators(), dispatch), []);\r\n\r\n\tconst request = useRequest();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (!chat && props.chatId) {\r\n\t\t\trequest(getChat, { chatId: props.chatId })\r\n\t\t\t\t.then((res) => {\r\n\t\t\t\t\tsetChat(res);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}, []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetEdit(null);\r\n\t}, [props.chatId]);\r\n\r\n\tif (!user || !props.chatId) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (!chat) {\r\n\t\treturn ;\r\n\t}\r\n\r\n\treturn <>\r\n\t\t \r\n\t\t \r\n\t>;\r\n};\r\n\r\nexport default ChatMessagesWithForm;\r\n","import React from 'react';\r\nimport { useSelector } from 'react-redux';\r\n\r\nimport Button from 'antd/lib/button';\r\n\r\nimport Draggable, { DraggablePlace } from '@common/react/components/UI/Draggable';\r\nimport '@common/react/scss/components/videoChatModal.scss';\r\nimport VideoChat from '@common/react/components/UI/VideoChat/VideoChat';\r\nimport ChatMessagesWithForm from '@common/react/components/Chat/ChatMessagesWithForm';\r\nimport { useChatSettingsProviderContext } from '@common/react/components/Chat/ChatSettingsProvider';\r\n\r\ninterface VideoChatModal {\r\n\tskeletonImage?: string;\r\n\tdefaultPlace?: DraggablePlace;\r\n\tdragContainerPadding?: number;\r\n\tavatarComponent?: (avatar?: string, userName?: string) => React.ReactNode;\r\n}\r\n\r\nconst defaultAvatarComponent = (avatar) => {\r\n\treturn ;\r\n};\r\n\r\nconst VideoChatModal: React.FC = (props) => {\r\n\tconst {\r\n\t\tskeletonImage, defaultPlace = 'leftBottom', dragContainerPadding = 30, avatarComponent = defaultAvatarComponent,\r\n\t} = props;\r\n\tconst videoChatState = useSelector((state: any) => state.videoChat);\r\n\tconst context = useChatSettingsProviderContext();\r\n\tconst showMessagesButtonInVideoModal = context?.state?.showMessagesButtonInVideoModal;\r\n\r\n\tconst [isMinimized, setIsMinimized] = React.useState(false);\r\n\tconst [isFullscreen, setFullscreen] = React.useState(false);\r\n\tconst [withMessages, setWithMessages] = React.useState(false);\r\n\r\n\tconst handleMinimize: React.MouseEventHandler = (e) => {\r\n\t\te.preventDefault();\r\n\r\n\t\tsetIsMinimized(true);\r\n\t};\r\n\r\n\tconst handleMaximize: React.MouseEventHandler = (e) => {\r\n\t\te.preventDefault();\r\n\r\n\t\tsetIsMinimized(false);\r\n\t};\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\t\t
\r\n\t\t\t\t\t\t{avatarComponent(videoChatState.avatar || skeletonImage, videoChatState.roomName)}\r\n\t\t\t\t\t\t{videoChatState.roomName} \r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\r\n\t\t\t\t{videoChatState.visibility &&
\r\n\t\t\t\t\t }\r\n\t\t\t\t\t\t\tonClick={isMinimized ? handleMaximize : handleMinimize}\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\t{withMessages && showMessagesButtonInVideoModal && videoChatState.chatId ? \r\n\t\t\t\t node.closest('.ant-popover-inner-content')}\r\n\t\t\t\t\tchatId={videoChatState.chatId}\r\n\t\t\t\t/>\r\n\t\t\t
: null}\r\n\t\t \r\n\t);\r\n};\r\n\r\nexport default VideoChatModal;\r\n","import React from 'react';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\n\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport { User } from '@app/objects/User';\r\n\r\nimport { Notification } from '@common/typescript/objects/Notification';\r\nimport { BaseUser, BaseUserWithAvatar } from '@common/typescript/objects/BaseUser';\r\nimport { Chat, ChatUser } from '@common/react/components/Chat/Chat';\r\nimport { BaseApplicationState } from '@common/react/store';\r\nimport { subscribe } from '@common/react/utils/SignalRUtils/SignalRUtils';\r\nimport { NotificationAction } from '@common/typescript/objects/NotificationAction';\r\nimport { useChatSettingsProviderContext } from '@common/react/components/Chat/ChatSettingsProvider';\r\nimport * as Login from '@common/react/store/Login';\r\nimport useRequest from '@common/react/hooks/useRequest';\r\nimport { ApplicationStateWithChats, ChatsActionCreators } from '@common/react/components/Chat/Store/Chats';\r\n\r\nconst notifySound = require('@common/react/audio/notify.ogg');\r\n\r\ninterface Props {\r\n\twithRemoteId?: boolean;\r\n}\r\n\r\ntype Actions = ChatsActionCreators>;\r\ntype LoginActions = Login.LoginActionCreators>;\r\n\r\nconst SignalRChats:React.FC = (props) => {\r\n\tconst { withRemoteId } = props;\r\n\tconst user = useSelector((state: BaseApplicationState) => state.login.user, shallowEqual);\r\n\tconst dispatch = useDispatch();\r\n\r\n\tconst context = useChatSettingsProviderContext();\r\n\r\n\tif (!context?.state) throw 'need ChatSettingsContext';\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\tnotificationTypes,\r\n\t\t\tplugins,\r\n\t\t\trequests,\r\n\t\t\tstorageName,\r\n\t\t\tchatStoreSettings: {\r\n\t\t\t\tgetActionCreators,\r\n\t\t\t\tuserUnviewedMessagesCountName,\r\n\t\t\t},\r\n\t\t},\r\n\t} = context;\r\n\tconst request = useRequest();\r\n\r\n\tconst actions: Actions = React.useMemo(() => bindActionCreators(getActionCreators(), dispatch), []);\r\n\tconst loginActions: LoginActions = bindActionCreators(Login.getActionCreators(), dispatch);\r\n\r\n\tconst handleNotification = React.useCallback((notification: Notification) => {\r\n\t\tif (!user) return;\r\n\t\tswitch (notification.objectType) {\r\n\t\t\tcase notificationTypes.chatMessage:\r\n\t\t\t\tconst chatMessage = notification.data;\r\n\t\t\t\tconst isDelete = notification.action === NotificationAction.Delete;\r\n\r\n\t\t\t\tif (isDelete) {\r\n\t\t\t\t\tactions.removeMessage(request, requests.getChat, storageName, chatMessage, chatMessage.chatId);\r\n\t\t\t\t\tif (chatMessage.viewed) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (notification.action === NotificationAction.Update) {\r\n\t\t\t\t\tactions.updateMessage(chatMessage, storageName);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (withRemoteId ? chatMessage.remoteId >= 0 : chatMessage.remoteId == null) {\r\n\t\t\t\t\tconst isOwnMessage: boolean = withRemoteId ? user?.id === chatMessage.remoteId\r\n\t\t\t\t\t\t: user?.id === chatMessage.userId;\r\n\r\n\t\t\t\t\tif (!isOwnMessage) {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t!isDelete && new Audio(notifySound).play();\r\n\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\tconsole.log(e);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tloginActions.updateUser(\r\n\t\t\t\t\t\t\t{},\r\n\t\t\t\t\t\t\t(user) => ({ [userUnviewedMessagesCountName]: user[userUnviewedMessagesCountName] + (isDelete ? -1 : 1) }),\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnotification.action === NotificationAction.Add\r\n\t\t\t\t\t&& actions.addMessage(request, requests.getChat, storageName, chatMessage, !isOwnMessage);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase notificationTypes.chatMessageAccess:\r\n\t\t\t\tconst chatMessageAccess = notification.data;\r\n\t\t\t\tif (chatMessageAccess.viewed && chatMessageAccess.chatMessageObject) {\r\n\t\t\t\t\tconst userIdName = withRemoteId ? 'remoteId' : 'userId';\r\n\t\t\t\t\tconst isCurrentUserViewed = user?.id === chatMessageAccess[userIdName];\r\n\t\t\t\t\tconst isViewedCurrentUserMessage = user?.id === chatMessageAccess.chatMessageObject[userIdName];\r\n\r\n\t\t\t\t\tif ((isCurrentUserViewed && !isViewedCurrentUserMessage) || (!isCurrentUserViewed && isViewedCurrentUserMessage)) {\r\n\t\t\t\t\t\tactions.updateMessageViewed(\r\n\t\t\t\t\t\t\tchatMessageAccess,\r\n\t\t\t\t\t\t\tchatMessageAccess.chatMessageObject.chatId,\r\n\t\t\t\t\t\t\tchatMessageAccess.chatMessageObject.id,\r\n\t\t\t\t\t\t\tchatMessageAccess.viewed,\r\n\t\t\t\t\t\t\tstorageName,\r\n\t\t\t\t\t\t\t!isCurrentUserViewed,\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (isCurrentUserViewed && !isViewedCurrentUserMessage) {\r\n\t\t\t\t\t\tactions.changeChatCounter(chatMessageAccess.chatMessageObject.chatId, -1, storageName);\r\n\t\t\t\t\t\tloginActions.updateUser(\r\n\t\t\t\t\t\t\t{},\r\n\t\t\t\t\t\t\t(user) => ({\r\n\t\t\t\t\t\t\t\t[userUnviewedMessagesCountName]: user[userUnviewedMessagesCountName] < 0\r\n\t\t\t\t\t\t\t\t\t? 0 : user[userUnviewedMessagesCountName] - 1,\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}\r\n\t\t\t\tbreak;\r\n\t\t\tcase notificationTypes.chat:\r\n\t\t\t\tif (notification.action === NotificationAction.Add) {\r\n\t\t\t\t\tactions.addChat(notification.data as Chat, storageName);\r\n\t\t\t\t} else if (notification.action === NotificationAction.Update) {\r\n\t\t\t\t\tactions.updateChat(notification.data as Chat, storageName);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase notificationTypes.updateChatCounterNotification:\r\n\t\t\t\tif (notification.action === NotificationAction.Update) {\r\n\t\t\t\t\tconst chat = notification.data;\r\n\r\n\t\t\t\t\tactions.updateChatCounter(chat.id, chat.unviewedMessagesCount, storageName);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase notificationTypes.updateUserMessagesCountNotification:\r\n\t\t\t\tif (user?.id === notification.data?.id) {\r\n\t\t\t\t\tconst unViewedMessagesCount = notification.data?.unviewedMessagesCount;\r\n\t\t\t\t\tloginActions.updateUser({ [userUnviewedMessagesCountName]: unViewedMessagesCount > 0 ? unViewedMessagesCount : 0 });\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase notificationTypes.chatUser:\r\n\t\t\t\tconst chatUser = notification.data as ChatUser;\r\n\t\t\t\tconst remoteId = (chatUser as any).remoteId;\r\n\t\t\t\tif (notification.action === NotificationAction.Add) {\r\n\t\t\t\t\tchatUser.user = {\r\n\t\t\t\t\t\t...chatUser.user,\r\n\t\t\t\t\t\tremoteId,\r\n\t\t\t\t\t} as BaseUserWithAvatar;\r\n\t\t\t\t\tactions.addUserToChat(chatUser, storageName);\r\n\t\t\t\t} else if (notification.action === NotificationAction.Delete) {\r\n\t\t\t\t\tif (withRemoteId ? remoteId === user?.id : (notification.data as ChatUser).userId === user?.id) {\r\n\t\t\t\t\t\tif (withRemoteId) {\r\n\t\t\t\t\t\t\tactions.removeUserFromChat(chatUser, storageName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tactions.removeChat(chatUser.chatId, storageName);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tactions.removeUserFromChat(chatUser, storageName);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t// no default\r\n\t\t}\r\n\t\tObject.keys(plugins)\r\n\t\t\t.forEach((key) => {\r\n\t\t\t\tplugins[key]?.notificationHandler?.(notification, storageName, actions, plugins[key]?.options);\r\n\t\t\t});\r\n\t}, [user?.id, request]);\r\n\r\n\tReact.useEffect(subscribe(handleNotification), [user?.id]);\r\n\r\n\treturn <>>;\r\n};\r\n\r\nexport default SignalRChats;\r\n","import React from 'react';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\n\r\nimport Button from 'antd/lib/button';\r\nimport Message from 'antd/lib/message';\r\n\r\nimport { TypeKeys } from '@common/react/store/VideoChat';\r\nimport { ChatRoomType } from '@common/react/components/Chat/Chat';\r\nimport useRequest from '@common/react/hooks/useRequest';\r\n\r\nconst shortBeeps = require('@common/react/audio/short-beeps.ogg');\r\n\r\ninterface VideoChatButtonProps {\r\n\troomId: string;\r\n\troomName: string;\r\n\troomCreateActor: string;\r\n\tnotifyUserIds: Array;\r\n\tavatar?: string;\r\n\tchatId?: number;\r\n\tbutton?: (onClick: React.MouseEventHandler, isDisabled: boolean, loading?: boolean) => JSX.Element;\r\n\tsupport?: boolean;\r\n\tonClick?: () => void;\r\n\tisVideo?: boolean;\r\n}\r\n\r\nconst VideoChatButton: React.FC = (props) => {\r\n\tconst {\r\n\t\tbutton, support, roomId, roomName, notifyUserIds, roomCreateActor, chatId, onClick, avatar, isVideo = true,\r\n\t} = props;\r\n\tconst dispatch = useDispatch();\r\n\tconst isChatting = useSelector((state: any) => state.videoChat.isChatting, shallowEqual);\r\n\tconst user = useSelector((state: any) => state.login.user, shallowEqual);\r\n\tconst [loading, setLoading] = React.useState(false);\r\n\tconst request = useRequest();\r\n\r\n\tconst handleClick: React.MouseEventHandler = (e) => {\r\n\t\te.preventDefault();\r\n\t\tsetLoading(true);\r\n\r\n\t\tconst handleSuccess = (res) => {\r\n\t\t\tdispatch({\r\n\t\t\t\ttype: TypeKeys.UPDATE,\r\n\t\t\t\tdata: {\r\n\t\t\t\t\ttoken: res.token,\r\n\t\t\t\t\troomIdentifier: res.roomIdentifier,\r\n\t\t\t\t\troomName,\r\n\t\t\t\t\tavatar,\r\n\t\t\t\t\tisSupport: support ?? false,\r\n\t\t\t\t\thasError: false,\r\n\t\t\t\t\tchatId,\r\n\t\t\t\t\tpreventCameraStart: !isVideo,\r\n\t\t\t\t\tvisibility: true,\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\trequest<{token: string, roomIdentifier: string}>(roomCreateActor, {\r\n\t\t\troomName: roomId,\r\n\t\t\tchatId,\r\n\t\t\tnotifyUserIds,\r\n\t\t\tchatRoomType: isVideo ? ChatRoomType.Video : ChatRoomType.Audio,\r\n\t\t})\r\n\t\t\t.then(handleSuccess)\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tMessage.error(e);\r\n\t\t\t\tdispatch({ type: TypeKeys.CLEAR });\r\n\t\t\t\tif (user?.enableSounds) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tnew Audio(shortBeeps).play();\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tconsole.log(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.finally(() => {\r\n\t\t\t\tsetLoading(false);\r\n\t\t\t});\r\n\r\n\t\tonClick && onClick();\r\n\t};\r\n\r\n\treturn button\r\n\t\t? button(handleClick, isChatting, loading)\r\n\t\t: (\r\n\t\t\t\r\n\t\t\t\t \r\n\t\t\t \r\n\t\t);\r\n};\r\n\r\nexport default VideoChatButton;\r\n","import React from 'react';\r\n\r\nimport { Notification } from '@common/typescript/objects/Notification';\r\nimport { BaseUser, BaseUserWithAvatar } from '@common/typescript/objects/BaseUser';\r\nimport VideoChatButton from '@common/react/components/UI/VideoChat/VideoChatButton';\r\nimport CallSound from '@common/react/components/UI/VideoChat/CallSound';\r\nimport { subscribe } from '@common/react/utils/SignalRUtils/SignalRUtils';\r\nimport '@common/react/scss/components/videoChatGlider.scss';\r\n\r\nenum AnimationState {\r\n\tStartShow,\r\n\tVisible,\r\n\tStartHide,\r\n\tHidden\r\n}\r\n\r\ninterface VideoChatNotify {\r\n\troomIdentifier: string;\r\n\tcreator: BaseUserWithAvatar;\r\n\trestMembers: Array;\r\n}\r\n\r\ninterface VideoChatGliderState {\r\n\tanimationState: AnimationState;\r\n\troomIdentifier: string;\r\n\tcreator: BaseUserWithAvatar | null;\r\n\trestMembers: Array | null;\r\n\tnotifyUserIds: Array;\r\n\tchatId?: number;\r\n}\r\n\r\ninterface VideoChatGliderProps {\r\n\trenderAvatar: (creator: BaseUserWithAvatar | null, imageSkeleton?: string) => React.ReactNode;\r\n\timageSkeleton?: string;\r\n}\r\n\r\nconst VideoChatGlider: React.FC = ({ renderAvatar, imageSkeleton }) => {\r\n\tconst [state, setState] = React.useState({\r\n\t\tanimationState: AnimationState.Hidden,\r\n\t\troomIdentifier: '',\r\n\t\tcreator: null,\r\n\t\trestMembers: null,\r\n\t\tnotifyUserIds: [],\r\n\t});\r\n\tconst timeoutRef = React.useRef();\r\n\r\n\tconst notificationHandle = (notification: Notification) => {\r\n\t\tif (notification.objectType !== 'VideoChatNotify') return;\r\n\t\tconst data = notification.data as VideoChatNotify;\r\n\r\n\t\tsetState((state) => ({\r\n\t\t\t...state,\r\n\t\t\tcreator: data.creator,\r\n\t\t\tanimationState: AnimationState.StartShow,\r\n\t\t\troomIdentifier: data.roomIdentifier,\r\n\t\t\tavatar: data.creator,\r\n\t\t\tchatId: (data as any).chatId,\r\n\t\t\tnotifyUserIds: data.restMembers.map((item) => item.id).concat(data.creator.id),\r\n\t\t}));\r\n\r\n\t\ttimeoutRef.current = setTimeout(() => {\r\n\t\t\tsetState((state) => ({\r\n\t\t\t\t...state,\r\n\t\t\t\tanimationState: AnimationState.StartHide,\r\n\t\t\t}));\r\n\t\t}, 10_000);\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsubscribe(notificationHandle)();\r\n\t}, []);\r\n\r\n\tconst className = React.useMemo(() => {\r\n\t\tconst defaultClassName = 'video-chat-glider';\r\n\r\n\t\tif (state.animationState === AnimationState.Hidden) {\r\n\t\t\treturn `${defaultClassName} hidden`;\r\n\t\t}\r\n\r\n\t\tif (state.animationState === AnimationState.StartHide) {\r\n\t\t\treturn `${defaultClassName} hide-anim`;\r\n\t\t}\r\n\r\n\t\tif (state.animationState === AnimationState.StartShow) {\r\n\t\t\treturn `${defaultClassName} visible show-anim`;\r\n\t\t}\r\n\r\n\t\treturn `${defaultClassName} visible`;\r\n\t}, [state.animationState]);\r\n\r\n\tconst handleAnimationEnd: React.AnimationEventHandler = React.useCallback((e) => {\r\n\t\tif (state.animationState === AnimationState.StartShow) {\r\n\t\t\tsetState((state) => ({ ...state, animationState: AnimationState.Visible }));\r\n\t\t}\r\n\r\n\t\tif (state.animationState === AnimationState.StartHide) {\r\n\t\t\tsetState((state) => ({\r\n\t\t\t\t...state,\r\n\t\t\t\tanimationState: AnimationState.Hidden,\r\n\t\t\t\troomIdentifier: '',\r\n\t\t\t\tavatar: imageSkeleton,\r\n\t\t\t\tcreator: null,\r\n\t\t\t\tnotifyUserIds: [],\r\n\t\t\t}));\r\n\t\t}\r\n\t}, [state.animationState]);\r\n\r\n\tconst handleCancelClick: React.MouseEventHandler = (e) => {\r\n\t\te.preventDefault();\r\n\r\n\t\tsetState((state) => ({ ...state, animationState: AnimationState.StartHide }));\r\n\r\n\t\ttimeoutRef.current && clearTimeout(timeoutRef.current);\r\n\t};\r\n\r\n\tconst handleAnswerClick = () => {\r\n\t\tsetState((state) => ({ ...state, animationState: AnimationState.StartHide }));\r\n\r\n\t\ttimeoutRef.current && clearTimeout(timeoutRef.current);\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{state.roomIdentifier && state.animationState !== AnimationState.StartHide ?
: null}\r\n\t\t\t
\r\n\t\t\t\t{state.creator && renderAvatar(state.creator, imageSkeleton)}\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t{state.creator?.firstName}\r\n\t\t\t\t\t{state.creator?.lastName ? <>\r\n \r\n\t\t\t\t\t\t{state.creator?.lastName}\r\n\t\t\t\t\t> : null}\r\n\t\t\t\t\t \r\n\t\t\t\t\tRoom:\r\n\t\t\t\t\t{' '}\r\n\t\t\t\t\t{state.roomIdentifier.split('_')[1]}\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t\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\tonClick={handleAnswerClick}\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 \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 VideoChatGlider;\r\n","import { Keyframes } from '@ant-design/cssinjs';\nconst genNotificationPlacementStyle = token => {\n const {\n componentCls,\n notificationMarginEdge,\n animationMaxHeight\n } = token;\n const noticeCls = `${componentCls}-notice`;\n const rightFadeIn = new Keyframes('antNotificationFadeIn', {\n '0%': {\n transform: `translate3d(100%, 0, 0)`,\n opacity: 0\n },\n '100%': {\n transform: `translate3d(0, 0, 0)`,\n opacity: 1\n }\n });\n const topFadeIn = new Keyframes('antNotificationTopFadeIn', {\n '0%': {\n top: -animationMaxHeight,\n opacity: 0\n },\n '100%': {\n top: 0,\n opacity: 1\n }\n });\n const bottomFadeIn = new Keyframes('antNotificationBottomFadeIn', {\n '0%': {\n bottom: -animationMaxHeight,\n opacity: 0\n },\n '100%': {\n bottom: 0,\n opacity: 1\n }\n });\n const leftFadeIn = new Keyframes('antNotificationLeftFadeIn', {\n '0%': {\n transform: `translate3d(-100%, 0, 0)`,\n opacity: 0\n },\n '100%': {\n transform: `translate3d(0, 0, 0)`,\n opacity: 1\n }\n });\n return {\n [componentCls]: {\n [`&${componentCls}-top, &${componentCls}-bottom`]: {\n marginInline: 0,\n [noticeCls]: {\n marginInline: 'auto auto'\n }\n },\n [`&${componentCls}-top`]: {\n [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {\n animationName: topFadeIn\n }\n },\n [`&${componentCls}-bottom`]: {\n [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {\n animationName: bottomFadeIn\n }\n },\n [`&${componentCls}-topRight, &${componentCls}-bottomRight`]: {\n [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {\n animationName: rightFadeIn\n }\n },\n [`&${componentCls}-topLeft, &${componentCls}-bottomLeft`]: {\n marginInlineEnd: 0,\n marginInlineStart: notificationMarginEdge,\n [noticeCls]: {\n marginInlineEnd: 'auto',\n marginInlineStart: 0\n },\n [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {\n animationName: leftFadeIn\n }\n }\n }\n };\n};\nexport default genNotificationPlacementStyle;","export const NotificationPlacements = ['top', 'topLeft', 'topRight', 'bottom', 'bottomLeft', 'bottomRight'];","import { NotificationPlacements } from '../interface';\nconst placementAlignProperty = {\n topLeft: 'left',\n topRight: 'right',\n bottomLeft: 'left',\n bottomRight: 'right',\n top: 'left',\n bottom: 'left'\n};\nconst genPlacementStackStyle = (token, placement) => {\n const {\n componentCls\n } = token;\n return {\n [`${componentCls}-${placement}`]: {\n [`&${componentCls}-stack > ${componentCls}-notice-wrapper`]: {\n [placement.startsWith('top') ? 'top' : 'bottom']: 0,\n [placementAlignProperty[placement]]: {\n value: 0,\n _skip_check_: true\n }\n }\n }\n };\n};\nconst genStackChildrenStyle = token => {\n const childrenStyle = {};\n for (let i = 1; i < token.notificationStackLayer; i++) {\n childrenStyle[`&:nth-last-child(${i + 1})`] = {\n overflow: 'hidden',\n [`& > ${token.componentCls}-notice`]: {\n opacity: 0,\n transition: `opacity ${token.motionDurationMid}`\n }\n };\n }\n return Object.assign({\n [`&:not(:nth-last-child(-n+${token.notificationStackLayer}))`]: {\n opacity: 0,\n overflow: 'hidden',\n color: 'transparent',\n pointerEvents: 'none'\n }\n }, childrenStyle);\n};\nconst genStackedNoticeStyle = token => {\n const childrenStyle = {};\n for (let i = 1; i < token.notificationStackLayer; i++) {\n childrenStyle[`&:nth-last-child(${i + 1})`] = {\n background: token.colorBgBlur,\n backdropFilter: 'blur(10px)',\n '-webkit-backdrop-filter': 'blur(10px)'\n };\n }\n return Object.assign({}, childrenStyle);\n};\nconst genStackStyle = token => {\n const {\n componentCls\n } = token;\n return Object.assign({\n [`${componentCls}-stack`]: {\n [`& > ${componentCls}-notice-wrapper`]: Object.assign({\n transition: `all ${token.motionDurationSlow}`,\n position: 'absolute'\n }, genStackChildrenStyle(token))\n },\n [`${componentCls}-stack:not(${componentCls}-stack-expanded)`]: {\n [`& > ${componentCls}-notice-wrapper`]: Object.assign({}, genStackedNoticeStyle(token))\n },\n [`${componentCls}-stack${componentCls}-stack-expanded`]: {\n [`& > ${componentCls}-notice-wrapper`]: {\n '&:not(:nth-last-child(-n + 1))': {\n opacity: 1,\n width: token.width,\n overflow: 'unset',\n color: 'inherit',\n pointerEvents: 'auto',\n [`& > ${token.componentCls}-notice`]: {\n opacity: 1\n }\n },\n '&:after': {\n content: '\"\"',\n position: 'absolute',\n height: token.margin,\n width: '100%',\n insetInline: 0,\n bottom: -token.margin,\n background: 'transparent',\n pointerEvents: 'auto'\n }\n }\n }\n }, NotificationPlacements.map(placement => genPlacementStackStyle(token, placement)).reduce((acc, cur) => Object.assign(Object.assign({}, acc), cur), {}));\n};\nexport default genStackStyle;","import { Keyframes } from '@ant-design/cssinjs';\nimport { resetComponent } from '../../style';\nimport { genComponentStyleHook, mergeToken } from '../../theme/internal';\nimport genNotificationPlacementStyle from './placement';\nimport genStackStyle from './stack';\nconst genNotificationStyle = token => {\n const {\n iconCls,\n componentCls,\n // .ant-notification\n boxShadow,\n fontSizeLG,\n notificationMarginBottom,\n borderRadiusLG,\n colorSuccess,\n colorInfo,\n colorWarning,\n colorError,\n colorTextHeading,\n notificationBg,\n notificationPadding,\n notificationMarginEdge,\n motionDurationMid,\n motionEaseInOut,\n fontSize,\n lineHeight,\n width,\n notificationIconSize,\n colorText\n } = token;\n const noticeCls = `${componentCls}-notice`;\n const fadeOut = new Keyframes('antNotificationFadeOut', {\n '0%': {\n maxHeight: token.animationMaxHeight,\n marginBottom: notificationMarginBottom\n },\n '100%': {\n maxHeight: 0,\n marginBottom: 0,\n paddingTop: 0,\n paddingBottom: 0,\n opacity: 0\n }\n });\n const noticeStyle = {\n position: 'relative',\n width,\n maxWidth: `calc(100vw - ${notificationMarginEdge * 2}px)`,\n marginBottom: notificationMarginBottom,\n marginInlineStart: 'auto',\n background: notificationBg,\n borderRadius: borderRadiusLG,\n boxShadow,\n [noticeCls]: {\n padding: notificationPadding,\n overflow: 'hidden',\n lineHeight,\n wordWrap: 'break-word'\n },\n [`${componentCls}-close-icon`]: {\n fontSize,\n cursor: 'pointer'\n },\n [`${noticeCls}-message`]: {\n marginBottom: token.marginXS,\n color: colorTextHeading,\n fontSize: fontSizeLG,\n lineHeight: token.lineHeightLG\n },\n [`${noticeCls}-description`]: {\n fontSize,\n color: colorText\n },\n [`&${noticeCls}-closable ${noticeCls}-message`]: {\n paddingInlineEnd: token.paddingLG\n },\n [`${noticeCls}-with-icon ${noticeCls}-message`]: {\n marginBottom: token.marginXS,\n marginInlineStart: token.marginSM + notificationIconSize,\n fontSize: fontSizeLG\n },\n [`${noticeCls}-with-icon ${noticeCls}-description`]: {\n marginInlineStart: token.marginSM + notificationIconSize,\n fontSize\n },\n // Icon & color style in different selector level\n // https://github.com/ant-design/ant-design/issues/16503\n // https://github.com/ant-design/ant-design/issues/15512\n [`${noticeCls}-icon`]: {\n position: 'absolute',\n fontSize: notificationIconSize,\n lineHeight: 0,\n // icon-font\n [`&-success${iconCls}`]: {\n color: colorSuccess\n },\n [`&-info${iconCls}`]: {\n color: colorInfo\n },\n [`&-warning${iconCls}`]: {\n color: colorWarning\n },\n [`&-error${iconCls}`]: {\n color: colorError\n }\n },\n [`${noticeCls}-close`]: {\n position: 'absolute',\n top: token.notificationPaddingVertical,\n insetInlineEnd: token.notificationPaddingHorizontal,\n color: token.colorIcon,\n outline: 'none',\n width: token.notificationCloseButtonSize,\n height: token.notificationCloseButtonSize,\n borderRadius: token.borderRadiusSM,\n transition: `background-color ${token.motionDurationMid}, color ${token.motionDurationMid}`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:hover': {\n color: token.colorIconHover,\n backgroundColor: token.wireframe ? 'transparent' : token.colorFillContent\n }\n },\n [`${noticeCls}-btn`]: {\n float: 'right',\n marginTop: token.marginSM\n }\n };\n return [\n // ============================ Holder ============================\n {\n [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'fixed',\n zIndex: token.zIndexPopup,\n marginInlineEnd: notificationMarginEdge,\n [`${componentCls}-hook-holder`]: {\n position: 'relative'\n },\n // animation\n [`${componentCls}-fade-appear-prepare`]: {\n opacity: '0 !important'\n },\n [`${componentCls}-fade-enter, ${componentCls}-fade-appear`]: {\n animationDuration: token.motionDurationMid,\n animationTimingFunction: motionEaseInOut,\n animationFillMode: 'both',\n opacity: 0,\n animationPlayState: 'paused'\n },\n [`${componentCls}-fade-leave`]: {\n animationTimingFunction: motionEaseInOut,\n animationFillMode: 'both',\n animationDuration: motionDurationMid,\n animationPlayState: 'paused'\n },\n [`${componentCls}-fade-enter${componentCls}-fade-enter-active, ${componentCls}-fade-appear${componentCls}-fade-appear-active`]: {\n animationPlayState: 'running'\n },\n [`${componentCls}-fade-leave${componentCls}-fade-leave-active`]: {\n animationName: fadeOut,\n animationPlayState: 'running'\n },\n // RTL\n '&-rtl': {\n direction: 'rtl',\n [`${noticeCls}-btn`]: {\n float: 'left'\n }\n }\n })\n },\n // ============================ Notice ============================\n {\n [componentCls]: {\n [`${noticeCls}-wrapper`]: Object.assign({}, noticeStyle)\n }\n },\n // ============================= Pure =============================\n {\n [`${noticeCls}-pure-panel`]: Object.assign(Object.assign({}, noticeStyle), {\n margin: 0\n })\n }];\n};\n// ============================== Export ==============================\nexport default genComponentStyleHook('Notification', token => {\n const notificationPaddingVertical = token.paddingMD;\n const notificationPaddingHorizontal = token.paddingLG;\n const notificationToken = mergeToken(token, {\n notificationBg: token.colorBgElevated,\n notificationPaddingVertical,\n notificationPaddingHorizontal,\n notificationIconSize: token.fontSizeLG * token.lineHeightLG,\n notificationCloseButtonSize: token.controlHeightLG * 0.55,\n notificationMarginBottom: token.margin,\n notificationPadding: `${token.paddingMD}px ${token.paddingContentHorizontalLG}px`,\n notificationMarginEdge: token.marginLG,\n animationMaxHeight: 150,\n notificationStackLayer: 3\n });\n return [genNotificationStyle(notificationToken), genNotificationPlacementStyle(notificationToken), genStackStyle(notificationToken)];\n}, token => ({\n zIndexPopup: token.zIndexPopupBase + 50,\n width: 384\n}));","\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport CheckCircleFilled from \"@ant-design/icons/es/icons/CheckCircleFilled\";\nimport CloseCircleFilled from \"@ant-design/icons/es/icons/CloseCircleFilled\";\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport ExclamationCircleFilled from \"@ant-design/icons/es/icons/ExclamationCircleFilled\";\nimport InfoCircleFilled from \"@ant-design/icons/es/icons/InfoCircleFilled\";\nimport LoadingOutlined from \"@ant-design/icons/es/icons/LoadingOutlined\";\nimport classNames from 'classnames';\nimport { Notice } from 'rc-notification';\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport useStyle from './style';\nexport const TypeIcon = {\n info: /*#__PURE__*/React.createElement(InfoCircleFilled, null),\n success: /*#__PURE__*/React.createElement(CheckCircleFilled, null),\n error: /*#__PURE__*/React.createElement(CloseCircleFilled, null),\n warning: /*#__PURE__*/React.createElement(ExclamationCircleFilled, null),\n loading: /*#__PURE__*/React.createElement(LoadingOutlined, null)\n};\nexport function getCloseIcon(prefixCls, closeIcon) {\n if (closeIcon === null || closeIcon === false) {\n return null;\n }\n return closeIcon || /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-close-x`\n }, /*#__PURE__*/React.createElement(CloseOutlined, {\n className: `${prefixCls}-close-icon`\n }));\n}\nconst typeToIcon = {\n success: CheckCircleFilled,\n info: InfoCircleFilled,\n error: CloseCircleFilled,\n warning: ExclamationCircleFilled\n};\nexport const PureContent = props => {\n const {\n prefixCls,\n icon,\n type,\n message,\n description,\n btn,\n role = 'alert'\n } = props;\n let iconNode = null;\n if (icon) {\n iconNode = /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-icon`\n }, icon);\n } else if (type) {\n iconNode = /*#__PURE__*/React.createElement(typeToIcon[type] || null, {\n className: classNames(`${prefixCls}-icon`, `${prefixCls}-icon-${type}`)\n });\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames({\n [`${prefixCls}-with-icon`]: iconNode\n }),\n role: role\n }, iconNode, /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-message`\n }, message), /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-description`\n }, description), btn && /*#__PURE__*/React.createElement(\"div\", {\n className: `${prefixCls}-btn`\n }, btn));\n};\n/** @private Internal Component. Do not use in your production. */\nconst PurePanel = props => {\n const {\n prefixCls: staticPrefixCls,\n className,\n icon,\n type,\n message,\n description,\n btn,\n closable = true,\n closeIcon\n } = props,\n restProps = __rest(props, [\"prefixCls\", \"className\", \"icon\", \"type\", \"message\", \"description\", \"btn\", \"closable\", \"closeIcon\"]);\n const {\n getPrefixCls\n } = React.useContext(ConfigContext);\n const prefixCls = staticPrefixCls || getPrefixCls('notification');\n const noticePrefixCls = `${prefixCls}-notice`;\n const [, hashId] = useStyle(prefixCls);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(`${noticePrefixCls}-pure-panel`, hashId, className)\n }, /*#__PURE__*/React.createElement(Notice, Object.assign({}, restProps, {\n prefixCls: prefixCls,\n eventKey: \"pure\",\n duration: null,\n closable: closable,\n closeIcon: getCloseIcon(prefixCls, closeIcon),\n content: /*#__PURE__*/React.createElement(PureContent, {\n prefixCls: noticePrefixCls,\n icon: icon,\n type: type,\n message: message,\n description: description,\n btn: btn\n })\n })));\n};\nexport default PurePanel;","\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { NotificationProvider, useNotification as useRcNotification } from 'rc-notification';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport { getCloseIcon, PureContent } from './PurePanel';\nimport useStyle from './style';\nimport { getMotion, getPlacementStyle } from './util';\nimport { useToken } from '../theme/internal';\nconst DEFAULT_OFFSET = 24;\nconst DEFAULT_DURATION = 4.5;\nconst DEFAULT_PLACEMENT = 'topRight';\nconst Wrapper = _ref => {\n let {\n children,\n prefixCls\n } = _ref;\n const [, hashId] = useStyle(prefixCls);\n return /*#__PURE__*/React.createElement(NotificationProvider, {\n classNames: {\n list: hashId,\n notice: hashId\n }\n }, children);\n};\nconst renderNotifications = (node, _ref2) => {\n let {\n prefixCls,\n key\n } = _ref2;\n return /*#__PURE__*/React.createElement(Wrapper, {\n prefixCls: prefixCls,\n key: key\n }, node);\n};\nconst Holder = /*#__PURE__*/React.forwardRef((props, ref) => {\n const {\n top,\n bottom,\n prefixCls: staticPrefixCls,\n getContainer: staticGetContainer,\n maxCount,\n rtl,\n onAllRemoved,\n stack\n } = props;\n const {\n getPrefixCls,\n getPopupContainer,\n notification\n } = React.useContext(ConfigContext);\n const [, token] = useToken();\n const prefixCls = staticPrefixCls || getPrefixCls('notification');\n // =============================== Style ===============================\n const getStyle = placement => getPlacementStyle(placement, top !== null && top !== void 0 ? top : DEFAULT_OFFSET, bottom !== null && bottom !== void 0 ? bottom : DEFAULT_OFFSET);\n const getClassName = () => classNames({\n [`${prefixCls}-rtl`]: rtl\n });\n // ============================== Motion ===============================\n const getNotificationMotion = () => getMotion(prefixCls);\n // ============================== Origin ===============================\n const [api, holder] = useRcNotification({\n prefixCls,\n style: getStyle,\n className: getClassName,\n motion: getNotificationMotion,\n closable: true,\n closeIcon: getCloseIcon(prefixCls),\n duration: DEFAULT_DURATION,\n getContainer: () => (staticGetContainer === null || staticGetContainer === void 0 ? void 0 : staticGetContainer()) || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer()) || document.body,\n maxCount,\n onAllRemoved,\n renderNotifications,\n stack: stack === false ? false : {\n threshold: typeof stack === 'object' ? stack === null || stack === void 0 ? void 0 : stack.threshold : undefined,\n offset: 8,\n gap: token.margin\n }\n });\n // ================================ Ref ================================\n React.useImperativeHandle(ref, () => Object.assign(Object.assign({}, api), {\n prefixCls,\n notification\n }));\n return holder;\n});\n// ==============================================================================\n// == Hook ==\n// ==============================================================================\nexport function useInternalNotification(notificationConfig) {\n const holderRef = React.useRef(null);\n const warning = devUseWarning('Notification');\n // ================================ API ================================\n const wrapAPI = React.useMemo(() => {\n // Wrap with notification content\n // >>> Open\n const open = config => {\n var _a;\n if (!holderRef.current) {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'usage', 'You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.') : void 0;\n return;\n }\n const {\n open: originOpen,\n prefixCls,\n notification\n } = holderRef.current;\n const noticePrefixCls = `${prefixCls}-notice`;\n const {\n message,\n description,\n icon,\n type,\n btn,\n className,\n style,\n role = 'alert',\n closeIcon\n } = config,\n restConfig = __rest(config, [\"message\", \"description\", \"icon\", \"type\", \"btn\", \"className\", \"style\", \"role\", \"closeIcon\"]);\n const realCloseIcon = getCloseIcon(noticePrefixCls, closeIcon);\n return originOpen(Object.assign(Object.assign({\n // use placement from props instead of hard-coding \"topRight\"\n placement: (_a = notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.placement) !== null && _a !== void 0 ? _a : DEFAULT_PLACEMENT\n }, restConfig), {\n content: /*#__PURE__*/React.createElement(PureContent, {\n prefixCls: noticePrefixCls,\n icon: icon,\n type: type,\n message: message,\n description: description,\n btn: btn,\n role: role\n }),\n className: classNames(type && `${noticePrefixCls}-${type}`, className, notification === null || notification === void 0 ? void 0 : notification.className),\n style: Object.assign(Object.assign({}, notification === null || notification === void 0 ? void 0 : notification.style), style),\n closeIcon: realCloseIcon,\n closable: !!realCloseIcon\n }));\n };\n // >>> destroy\n const destroy = key => {\n var _a, _b;\n if (key !== undefined) {\n (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.close(key);\n } else {\n (_b = holderRef.current) === null || _b === void 0 ? void 0 : _b.destroy();\n }\n };\n const clone = {\n open,\n destroy\n };\n const keys = ['success', 'info', 'warning', 'error'];\n keys.forEach(type => {\n clone[type] = config => open(Object.assign(Object.assign({}, config), {\n type\n }));\n });\n return clone;\n }, []);\n // ============================== Return ===============================\n return [wrapAPI, /*#__PURE__*/React.createElement(Holder, Object.assign({\n key: \"notification-holder\"\n }, notificationConfig, {\n ref: holderRef\n }))];\n}\nexport default function useNotification(notificationConfig) {\n return useInternalNotification(notificationConfig);\n}","export function getPlacementStyle(placement, top, bottom) {\n let style;\n switch (placement) {\n case 'top':\n style = {\n left: '50%',\n transform: 'translateX(-50%)',\n right: 'auto',\n top,\n bottom: 'auto'\n };\n break;\n case 'topLeft':\n style = {\n left: 0,\n top,\n bottom: 'auto'\n };\n break;\n case 'topRight':\n style = {\n right: 0,\n top,\n bottom: 'auto'\n };\n break;\n case 'bottom':\n style = {\n left: '50%',\n transform: 'translateX(-50%)',\n right: 'auto',\n top: 'auto',\n bottom\n };\n break;\n case 'bottomLeft':\n style = {\n left: 0,\n top: 'auto',\n bottom\n };\n break;\n default:\n style = {\n right: 0,\n top: 'auto',\n bottom\n };\n break;\n }\n return style;\n}\nexport function getMotion(prefixCls) {\n return {\n motionName: `${prefixCls}-fade`\n };\n}","\"use client\";\n\nimport * as React from 'react';\nimport { render } from \"rc-util/es/React/render\";\nimport ConfigProvider, { globalConfig, warnContext } from '../config-provider';\nimport PurePanel from './PurePanel';\nimport useNotification, { useInternalNotification } from './useNotification';\nlet notification = null;\nlet act = callback => callback();\nlet taskQueue = [];\nlet defaultGlobalConfig = {};\nfunction getGlobalContext() {\n const {\n prefixCls: globalPrefixCls,\n getContainer: globalGetContainer,\n rtl,\n maxCount,\n top,\n bottom\n } = defaultGlobalConfig;\n const mergedPrefixCls = globalPrefixCls !== null && globalPrefixCls !== void 0 ? globalPrefixCls : globalConfig().getPrefixCls('notification');\n const mergedContainer = (globalGetContainer === null || globalGetContainer === void 0 ? void 0 : globalGetContainer()) || document.body;\n return {\n prefixCls: mergedPrefixCls,\n getContainer: () => mergedContainer,\n rtl,\n maxCount,\n top,\n bottom\n };\n}\nconst GlobalHolder = /*#__PURE__*/React.forwardRef((_, ref) => {\n const [notificationConfig, setNotificationConfig] = React.useState(getGlobalContext);\n const [api, holder] = useInternalNotification(notificationConfig);\n const global = globalConfig();\n const rootPrefixCls = global.getRootPrefixCls();\n const rootIconPrefixCls = global.getIconPrefixCls();\n const theme = global.getTheme();\n const sync = () => {\n setNotificationConfig(getGlobalContext);\n };\n React.useEffect(sync, []);\n React.useImperativeHandle(ref, () => {\n const instance = Object.assign({}, api);\n Object.keys(instance).forEach(method => {\n instance[method] = function () {\n sync();\n return api[method].apply(api, arguments);\n };\n });\n return {\n instance,\n sync\n };\n });\n return /*#__PURE__*/React.createElement(ConfigProvider, {\n prefixCls: rootPrefixCls,\n iconPrefixCls: rootIconPrefixCls,\n theme: theme\n }, holder);\n});\nfunction flushNotice() {\n if (!notification) {\n const holderFragment = document.createDocumentFragment();\n const newNotification = {\n fragment: holderFragment\n };\n notification = newNotification;\n // Delay render to avoid sync issue\n act(() => {\n render( /*#__PURE__*/React.createElement(GlobalHolder, {\n ref: node => {\n const {\n instance,\n sync\n } = node || {};\n Promise.resolve().then(() => {\n if (!newNotification.instance && instance) {\n newNotification.instance = instance;\n newNotification.sync = sync;\n flushNotice();\n }\n });\n }\n }), holderFragment);\n });\n return;\n }\n // Notification not ready\n if (!notification.instance) {\n return;\n }\n // >>> Execute task\n taskQueue.forEach(task => {\n // eslint-disable-next-line default-case\n switch (task.type) {\n case 'open':\n {\n act(() => {\n notification.instance.open(Object.assign(Object.assign({}, defaultGlobalConfig), task.config));\n });\n break;\n }\n case 'destroy':\n act(() => {\n notification === null || notification === void 0 ? void 0 : notification.instance.destroy(task.key);\n });\n break;\n }\n });\n // Clean up\n taskQueue = [];\n}\n// ==============================================================================\n// == Export ==\n// ==============================================================================\nfunction setNotificationGlobalConfig(config) {\n defaultGlobalConfig = Object.assign(Object.assign({}, defaultGlobalConfig), config);\n // Trigger sync for it\n act(() => {\n var _a;\n (_a = notification === null || notification === void 0 ? void 0 : notification.sync) === null || _a === void 0 ? void 0 : _a.call(notification);\n });\n}\nfunction open(config) {\n // Warning if exist theme\n if (process.env.NODE_ENV !== 'production') {\n warnContext('notification');\n }\n taskQueue.push({\n type: 'open',\n config\n });\n flushNotice();\n}\nfunction destroy(key) {\n taskQueue.push({\n type: 'destroy',\n key\n });\n flushNotice();\n}\nconst methods = ['success', 'info', 'warning', 'error'];\nconst baseStaticMethods = {\n open,\n destroy,\n config: setNotificationGlobalConfig,\n useNotification,\n _InternalPanelDoNotUseOrYouWillBeFired: PurePanel\n};\nconst staticMethods = baseStaticMethods;\nmethods.forEach(type => {\n staticMethods[type] = config => open(Object.assign(Object.assign({}, config), {\n type\n }));\n});\n// ==============================================================================\n// == Test ==\n// ==============================================================================\nconst noop = () => {};\n/** @internal Only Work in test env */\n// eslint-disable-next-line import/no-mutable-exports\nexport let actWrapper = noop;\nif (process.env.NODE_ENV === 'test') {\n actWrapper = wrapper => {\n act = wrapper;\n };\n}\nexport default staticMethods;","import React from 'react';\r\n\r\nimport { notification } from 'antd';\r\nimport { NotificationInstance, NotificationPlacement } from 'antd/lib/notification/interface';\r\n\r\nimport '@common/react/scss/components/notificationGlider.scss';\r\n\r\ninterface NotificationGliderContext {\r\n\tapi: NotificationInstance;\r\n\tplacement: NotificationPlacement;\r\n}\r\n\r\nconst NotificationGliderContext = React.createContext({} as NotificationGliderContext);\r\n\r\nexport const useNotificationGliderContext: () => NotificationGliderContext = () =>\r\n\tReact.useContext(NotificationGliderContext);\r\n\r\nconst NotificationGliderProvider: React.FC = ({ children }) => {\r\n\tconst [api, contextHolder] = notification.useNotification();\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t\t{contextHolder}\r\n\t\t \r\n\t);\r\n};\r\n\r\nexport default NotificationGliderProvider;\r\n","import React from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\n\r\nimport { subscribe } from '@common/react/utils/SignalRUtils/SignalRUtils';\r\nimport { BaseUser } from '@common/typescript/objects/BaseUser';\r\nimport { Notification } from '@common/typescript/objects/Notification';\r\nimport { useChatSettingsProviderContext } from '@common/react/components/Chat/ChatSettingsProvider';\r\nimport { useNotificationGliderContext } from '@common/react/components/Chat/NotificationGliderProvider';\r\nimport { ChatPlugins, EmojiReaction } from '@common/react/components/Chat/Chat';\r\nimport { NotificationAction } from '@common/typescript/objects/NotificationAction';\r\nimport { handleUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\r\n\r\nconst ReactionNotificationHandler: React.FC = () => {\r\n\tconst history = useHistory();\r\n\tconst { api, placement } = useNotificationGliderContext();\r\n\tconst context = useChatSettingsProviderContext();\r\n\tconst state = context?.state;\r\n\tconst user = useSelector((state: any) => state?.login?.user, shallowEqual);\r\n\r\n\tconst handleNotification = React.useCallback((incomingNotification: Notification) => {\r\n\t\tif (incomingNotification.objectType !== state.notificationTypes.chatReaction\r\n\t\t\t|| location.pathname === state.pageSettings.path\r\n\t\t\t|| incomingNotification.action !== NotificationAction.Add || state?.modalMode\r\n\t\t\t|| user?.id === incomingNotification.data.remoteId || user?.id === incomingNotification.data.userId) return;\r\n\r\n\t\tconst reaction = incomingNotification.data as EmojiReaction;\r\n\r\n\t\tconst notificationComponent = state.plugins[ChatPlugins.Reactions]?.message?.notification;\r\n\r\n\t\tapi?.info({\r\n\t\t\ticon: state.avatarSettings.notificationAvatar(reaction.user),\r\n\t\t\tmessage: `${reaction.user.firstName} ${reaction.user.lastName}`,\r\n\t\t\tdescription:\r\n\t<>\r\n\t\t{\r\n\t\t\tnotificationComponent ? notificationComponent({\r\n\t\t\t\tmessage: reaction,\r\n\t\t\t\twithRemoteId: false,\r\n\t\t\t\tcontacts: [],\r\n\t\t\t}) : 'Reaction'\r\n\t\t}\r\n\t>,\r\n\t\t\tclassName: 'notification-glider',\r\n\t\t\tonClick: () => {\r\n\t\t\t\tif (state.openModalFromNotification) {\r\n\t\t\t\t\tcontext.actions.setModalMode((prev) => true);\r\n\t\t\t\t\thandleUrl(\r\n\t\t\t\t\t\t{ chatId: reaction.object.chatId, messageId: reaction.objectId },\r\n\t\t\t\t\t\thistory.location,\r\n\t\t\t\t\t\thistory,\r\n\t\t\t\t\t\tundefined,\r\n\t\t\t\t\t\t'',\r\n\t\t\t\t\t\ttrue,\r\n\t\t\t\t\t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thistory.push(`${state.pageSettings.path}/${reaction.object.chatId}?messageId=${reaction.objectId}`);\r\n\t\t\t\t}\r\n\t\t\t\tapi.destroy();\r\n\t\t\t},\r\n\t\t\tplacement,\r\n\t\t});\r\n\t}, [history?.location.pathname, state?.modalMode, user]);\r\n\r\n\tReact.useEffect(subscribe(handleNotification), [handleNotification]);\r\n\r\n\treturn null;\r\n};\r\n\r\nexport default ReactionNotificationHandler;\r\n","import React from 'react';\r\nimport { CartProvider, useCart } from 'react-use-cart';\r\n\r\nimport { List } from '@common/typescript/objects/List';\r\n\r\nimport { request } from '@app/components/Api';\r\nimport { Special } from '@app/objects/Special';\r\nimport { transformSpecialToCartItem } from '@app/objects/CartItem';\r\n\r\nconst CartProviderWithUpdate: React.FC = ({ children }) => {\r\n\tconst {\r\n\t\titems, updateItem, removeItem, isEmpty,\r\n\t} = useCart();\r\n\r\n\tconst cartItemsIds = React.useMemo(() => items.map((item) => item.id), []);\r\n\r\n\tconst updateCartItems = (specialsList: Array) => {\r\n\t\tif (!isEmpty) {\r\n\t\t\tif (cartItemsIds.length > specialsList.length) {\r\n\t\t\t\tconst specialsIds = specialsList.map((special) => special.id.toString());\r\n\t\t\t\tconst shouldDelete = cartItemsIds.filter((id) => !specialsIds.includes(id));\r\n\r\n\t\t\t\tfor (let i = 0; i < shouldDelete.length; i++) {\r\n\t\t\t\t\tremoveItem(shouldDelete[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfor (let i = 0; i < cartItemsIds.length; i++) {\r\n\t\t\t\tconst actualSpecial = specialsList.find((special) => special.id.toString() === cartItemsIds[i]);\r\n\t\t\t\tif (actualSpecial) {\r\n\t\t\t\t\tconst specialForStore = transformSpecialToCartItem(actualSpecial);\r\n\t\t\t\t\tupdateItem(actualSpecial.id.toString(), specialForStore);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tconst firstLoad = () => {\r\n\t\tif (cartItemsIds.length === 0) return;\r\n\r\n\t\trequest>('specialsList', {\r\n\t\t\tids: cartItemsIds,\r\n\t\t})\r\n\t\t\t.then((res) => {\r\n\t\t\t\tupdateCartItems(res.list);\r\n\t\t\t})\r\n\t\t\t.catch((err) => console.log(err));\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\tfirstLoad();\r\n\t}, []);\r\n\r\n\treturn <>\r\n\t\t{children}\r\n\t>;\r\n};\r\n\r\nconst CartProviderWithUpdateWrapper: React.FC = ({ children }) => {\r\n\treturn \r\n\t\t\r\n\t\t\t{children}\r\n\t\t \r\n\t ;\r\n};\r\n\r\nexport default CartProviderWithUpdateWrapper;\r\n","import * as React from 'react';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\n\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport { getActionCreators } from '@common/react/store/Login';\r\nimport { BaseUser } from '@common/react/objects/BaseUser';\r\nimport { BaseApplicationState } from '@common/react/store';\r\n\r\ninterface OwnProps {\r\n\trender?: (logout: (event: React.MouseEvent) => void) => JSX.Element;\r\n\tclearState?: boolean;\r\n}\r\n\r\nconst Logout: React.FC = ({ render, clearState }) => {\r\n\tconst dispatch = useDispatch();\r\n\tconst login = useSelector((state: BaseApplicationState) => state.login, shallowEqual);\r\n\tconst { logoff } = React.useMemo(() => bindActionCreators(getActionCreators(), dispatch), [login.user]);\r\n\r\n\tconst logout = (event: React.MouseEvent) => {\r\n\t\tevent.preventDefault();\r\n\t\tlogoff(clearState);\r\n\t};\r\n\r\n\treturn render ? render(logout) : Logout ;\r\n};\r\n\r\nexport default Logout;\r\n","import React from 'react';\r\n\r\nimport { request } from '@common/react/components/Api';\r\n\r\ninterface Props {\r\n\ttransmuted: boolean;\r\n\trender?: (transmuteBack: () => void) => JSX.Element;\r\n\tonSuccess?: () => void;\r\n}\r\n\r\nconst TransmutationBack: React.FC = ({ transmuted, render, onSuccess }) => {\r\n\tconst transmuteBack = () => {\r\n\t\trequest('transmutation', {\r\n\t\t\tid: 0,\r\n\t\t\ttransmutation: !transmuted,\r\n\t\t}).then(() => {\r\n\t\t\twindow.location.href = '/';\r\n\t\t\tonSuccess && onSuccess();\r\n\t\t}).catch((err) => console.log(err));\r\n\t};\r\n\r\n\tconst renderComponent = render\r\n\t\t? render(transmuteBack)\r\n\t\t: (\r\n\t\t\t \r\n\t\t );\r\n\r\n\treturn <>{transmuted && renderComponent}>;\r\n};\r\n\r\nexport default TransmutationBack;\r\n","import React from 'react';\r\n\r\nimport Message from 'antd/lib/message';\r\nimport Modal from 'antd/lib/modal';\r\n\r\nimport { request } from '@app/components/Api';\r\n\r\nconst DashboardTopAlert: React.FC<{objectId: number}> = ({ objectId }) => {\r\n\tconst handleClick = () => {\r\n\t\trequest('sendConfirmEmail', { id: objectId })\r\n\t\t\t.then(() => Modal.success({ content: 'The activation email has been successfully sent.' }))\r\n\t\t\t.catch(Message.error);\r\n\t};\r\n\r\n\treturn ;\r\n};\r\n\r\nexport default DashboardTopAlert;\r\n","import React from 'react';\r\nimport { useCart } from 'react-use-cart';\r\n\r\nimport Popover from 'antd/lib/popover';\r\n\r\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\r\nimport { getPopupContainer } from '@common/react/components/Utils/Utils';\r\n\r\nimport ShoppingCartInformation from '@app/components/UI/ShoppingCartInformation/ShoppingCartInformation';\r\n\r\ninterface Props {\r\n\twithoutPopover?: boolean;\r\n}\r\n\r\nconst ShoppingCartDropdown: React.FC = ({ withoutPopover }) => {\r\n\tconst [isInitialized, setIsInitialized] = React.useState(false);\r\n\tconst { totalItems } = useCart();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetIsInitialized(true);\r\n\t}, []);\r\n\r\n\tconst totalCount = isInitialized ? totalItems : 0;\r\n\r\n\tconst content = (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t{totalCount}\r\n\t\t\t
\r\n\t\t
\r\n\t );\r\n\r\n\tif (withoutPopover) {\r\n\t\treturn {content}
;\r\n\t}\r\n\r\n\treturn \r\n\t\t
\r\n\t\t\t\t\t\t\tCheck out\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\t{content}\r\n\t\t \r\n\t
;\r\n};\r\n\r\nexport default ShoppingCartDropdown;\r\n","import React from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\n\r\nimport Drawer from 'antd/lib/drawer';\r\n\r\nimport Logout from '@common/react/components/UI/Logout/Logout';\r\nimport { transformArrayToList } from '@common/typescript/objects/List';\r\n\r\nimport { ApplicationState } from '@app/store';\r\nimport { Menu as CustomMenu } from '@app/components/UI/Menu/Menu';\r\nimport { UserRole } from '@app/objects/User';\r\n\r\ninterface BurgerMenuProps {\r\n\tgetPopupContainer?: (node) => HTMLElement;\r\n}\r\n\r\nexport const menu = [\r\n\t{\r\n\t\tpath: '/specials',\r\n\t\tname: 'Specials Shop',\r\n\t\tclassName: 'menu-item_gray',\r\n\t},\r\n\t{\r\n\t\tpath: '/doctors',\r\n\t\tname: 'Schedule Appointment',\r\n\t\tclassName: 'menu-item_orange',\r\n\t},\r\n\t{\r\n\t\tpath: '/login',\r\n\t\tname: 'Patient Login',\r\n\t\tprivate: false,\r\n\t\tclassName: 'menu-item_blue',\r\n\t},\r\n\t{\r\n\t\tpath: '',\r\n\t\tname: 'Search',\r\n\t\ticon: 'search',\r\n\t\tclassName: 'bold-title',\r\n\t\tprivate: true,\r\n\t\tchildren: transformArrayToList([\r\n\t\t\t{\r\n\t\t\t\tpath: '/doctors',\r\n\t\t\t\tname: 'Doctors',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/procedures',\r\n\t\t\t\tname: 'Procedures',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/specialties',\r\n\t\t\t\tname: 'Specialties',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/clinics',\r\n\t\t\t\tname: 'Clinics',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/locations',\r\n\t\t\t\tname: 'Locations',\r\n\t\t\t},\r\n\t\t]),\r\n\t},\r\n\t{\r\n\t\tpath: '/doctors',\r\n\t\tname: 'Doctors',\r\n\t\tprivate: false,\r\n\t},\r\n\t{\r\n\t\tpath: '/procedures',\r\n\t\tname: 'Procedures',\r\n\t\tprivate: false,\r\n\t},\r\n\t{\r\n\t\tpath: '/specialties',\r\n\t\tname: 'Specialties',\r\n\t\tprivate: false,\r\n\t},\r\n\t{\r\n\t\tpath: '/clinics',\r\n\t\tname: 'Clinics',\r\n\t\tprivate: false,\r\n\t},\r\n\t{\r\n\t\tpath: '/locations',\r\n\t\tname: 'Locations',\r\n\t\tprivate: false,\r\n\t},\r\n\t{\r\n\t\tpath: '/profile',\r\n\t\tname: 'Profile',\r\n\t\ticon: 'user-circle',\r\n\t\tclassName: 'bold-title',\r\n\t\tprivate: true,\r\n\t},\r\n\t{\r\n\t\tpath: '/dashboard',\r\n\t\tname: 'Dashboard',\r\n\t\ticon: 'home',\r\n\t\tclassName: 'bold-title',\r\n\t\tprivate: true,\r\n\t},\r\n\t{\r\n\t\tpath: '/appointment-list',\r\n\t\tname: 'Appointments',\r\n\t\ticon: 'calendar-plus-o',\r\n\t\tclassName: 'bold-title',\r\n\t\tprivate: true,\r\n\t},\r\n\t{\r\n\t\tpath: '/analysis-list',\r\n\t\tname: 'Lab. Orders',\r\n\t\ticon: 'flask',\r\n\t\tclassName: 'bold-title',\r\n\t\tprivate: true,\r\n\t},\r\n\t{\r\n\t\tpath: '/bills',\r\n\t\tname: 'Bills',\r\n\t\ticon: 'usd',\r\n\t\tclassName: 'bold-title',\r\n\t\tprivate: true,\r\n\t},\r\n\t{\r\n\t\tpath: '',\r\n\t\tname: 'Documents',\r\n\t\ticon: 'file-code-o',\r\n\t\tclassName: 'bold-title',\r\n\t\tprivate: true,\r\n\t\tchildren: transformArrayToList([\r\n\t\t\t{\r\n\t\t\t\tpath: '/orders',\r\n\t\t\t\tname: 'Purchases',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/document-list',\r\n\t\t\t\tname: 'Health Records',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/questionnaires',\r\n\t\t\t\tname: 'Questionnaires',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/consent-forms',\r\n\t\t\t\tname: 'Consent|Medical Documents',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/instructions',\r\n\t\t\t\tname: 'Instructions',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/prescriptions-list',\r\n\t\t\t\tname: 'Prescriptions',\r\n\t\t\t},\r\n\t\t]),\r\n\t},\r\n\t{\r\n\t\tpath: '',\r\n\t\tadmin: true,\r\n\t\tname: 'Admin',\r\n\t\ticon: 'user-secret',\r\n\t\tclassName: 'bold-title',\r\n\t\tchildren: transformArrayToList([\r\n\t\t\t{\r\n\t\t\t\tpath: '/user-list',\r\n\t\t\t\tname: 'Users',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/shortLink-list',\r\n\t\t\t\tname: 'Short Links',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/authLink-list',\r\n\t\t\t\tname: 'Auth Links',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/user-session-list',\r\n\t\t\t\tname: 'Entry Log Journal',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/page-list',\r\n\t\t\t\tname: 'Pages',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/inquiry-list',\r\n\t\t\t\tname: 'Inquiries',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/email-templates',\r\n\t\t\t\tname: 'Email Templates',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/marketing-emails',\r\n\t\t\t\tname: 'Marketing Emails',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/emailLogs',\r\n\t\t\t\tname: 'Email Log',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/smsLogs',\r\n\t\t\t\tname: 'Sms Log',\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tpath: '/base-hosted-service-list',\r\n\t\t\t\tname: 'Hosted Services',\r\n\t\t\t},\r\n\t\t]),\r\n\t},\r\n\t{\r\n\t\tpath: '',\r\n\t\tname: '',\r\n\t\tprivate: true,\r\n\t\tnode: \r\n\t\t\t \r\n\t\t\t\t\tLogout\r\n\t\t\t\t }\r\n\t\t\t\tclearState\r\n\t\t\t/>\r\n\t\t ,\r\n\t},\r\n];\r\n\r\nconst BurgerMenu: React.FC = ({ getPopupContainer }) => {\r\n\tconst [open, setOpen] = React.useState(false);\r\n\tconst user = useSelector((state: ApplicationState) => state.login.user, shallowEqual);\r\n\tconst onClose = () => setOpen(false);\r\n\tconst history = useHistory();\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetOpen(false);\r\n\t}, [history.location.pathname]);\r\n\r\n\tconst resultMenu = React.useMemo(() => {\r\n\t\treturn menu.filter((item) => (item.admin\r\n\t\t\t? user && user.role === UserRole.Admin\r\n\t\t\t: item.private === undefined || (user && item.private) || (!user && !item.private)));\r\n\t}, [user]);\r\n\r\n\treturn <>\r\n\t\t\r\n\t\t\t \r\n\t\t \r\n\t\t setOpen((prev) => !prev)}>\r\n\t\t\t \r\n\t\t \r\n\t>;\r\n};\r\n\r\nexport default BurgerMenu;\r\n","import React from 'react';\r\n\r\ninterface Props {\r\n\taddress: string;\r\n\tclassName?: string;\r\n}\r\n\r\nconst LocationLink: React.FC = ({ address, children, className }) => {\r\n\tconst link = React.useMemo(() => {\r\n\t\tlet res = `https://maps.google.com/maps/search/?api=1&query=${address}`;\r\n\t\tif (typeof window !== 'undefined') {\r\n\t\t\tif (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\r\n\t\t\t\tres = `maps://maps.google.com/maps/search/?api=1&query=${address}`;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}, [address]);\r\n\r\n\treturn \r\n\t\t{children}\r\n\t ;\r\n};\r\n\r\nexport default LocationLink;\r\n","import React from 'react';\r\n\r\nimport Select from 'antd/lib/select';\r\n\r\nimport Autocomplete, { OptionType } from '@common/react/components/Forms/Autocomplete/Autocomplete';\r\nimport { WithId } from '@common/typescript/objects/WithId';\r\nimport { Nullable } from '@common/typescript/objects/Nullable';\r\n\r\nimport { DoctorSpecialty } from '@commonTuna/react/objects/DoctorSpecialty';\r\nimport { GlobalProcedure } from '@commonTuna/react/objects/GlobalProcedure';\r\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\r\n\r\nimport { Doctor } from '@app/objects/Doctor';\r\n\r\ninterface SearchResultRow extends WithId {\r\n\tdoctor: Nullable;\r\n\tspecialties: Nullable;\r\n\tglobalProcedure: Nullable;\r\n}\r\n\r\ninterface Props {\r\n\tvalue: string;\r\n\tonSelect: (value, option) => void;\r\n\tonChange: (value) => void;\r\n\tinitType?: SearchType;\r\n\tonSearchClick?: (e) => void;\r\n\tinitFocus?: boolean;\r\n}\r\n\r\ninterface Options {\r\n\tlabel: React.ReactNode;\r\n\toptions: Array;\r\n}\r\n\r\nexport const emptyValues = {\r\n\tdoctorId: undefined,\r\n\tglobalProcedureId: undefined,\r\n\tspecialtyId: undefined,\r\n\tglobalPayerId: undefined,\r\n\tspecialId: undefined,\r\n\tlocationId: undefined,\r\n\tprofessionId: undefined,\r\n};\r\n\r\nexport const clearValues = Object.keys(emptyValues)\r\n\t.map((key) => ({ name: key, value: undefined } as any))\r\n\t.concat([{ name: 'text', value: '' }]);\r\n\r\nconst { Option } = Select;\r\n\r\nenum SearchType {\r\n\tAll = 0,\r\n\tDoctor = 1,\r\n\tProcedure = 2,\r\n\tSpeciality = 3,\r\n\tClinic = 4,\r\n\tInsurance = 5,\r\n\tSpecial = 6,\r\n\tLocation = 7\r\n}\r\n\r\nconst searchOptions = [\r\n\t{ name: 'All', value: SearchType.All },\r\n\t{ name: 'Doctors', value: SearchType.Doctor },\r\n\t{ name: 'Procedures', value: SearchType.Procedure },\r\n\t{ name: 'Specialities', value: SearchType.Speciality },\r\n\t{ name: 'Clinics', value: SearchType.Clinic },\r\n\t{ name: 'Insurances', value: SearchType.Insurance },\r\n\t{ name: 'Specials', value: SearchType.Special },\r\n\t{ name: 'Locations', value: SearchType.Location },\r\n];\r\n\r\nconst sections = ['doctor', 'globalProcedure', 'specialty', 'insurance', 'clinic', 'profession', 'special'];\r\n\r\nconst Search: React.FC = ({\r\n\tvalue, onChange, onSelect, initType, onSearchClick, initFocus,\r\n}) => {\r\n\tconst [type, setType] = React.useState(initType || SearchType.All);\r\n\tconst ref = React.useRef(null);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tinitFocus && ref.current?.focus();\r\n\t}, [initFocus]);\r\n\r\n\tconst renderTitle = (title, icon) => <>\r\n\t\t{icon}\r\n\t\t{' '}\r\n\t\t{title}\r\n\t>;\r\n\r\n\tconst renderItem = (value: React.ReactNode, label: React.ReactNode, option: OptionType): OptionType => {\r\n\t\treturn {\r\n\t\t\tvalue,\r\n\t\t\tlabel,\r\n\t\t\titem: option.item,\r\n\t\t\tkey: option.item.id,\r\n\t\t};\r\n\t};\r\n\r\n\tconst getSection = (section: string, filteredOptions: Array): Options => {\r\n\t\tif (section === 'doctor') {\r\n\t\t\treturn {\r\n\t\t\t\tlabel: renderTitle('Doctors', ),\r\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(`Doctor: ${option.item.doctor.nameEn}`, option.item.doctor.nameEn, option)),\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (section === 'globalProcedure') {\r\n\t\t\treturn {\r\n\t\t\t\tlabel: renderTitle(\r\n\t\t\t\t\t'Procedures',\r\n\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),\r\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(\r\n\t\t\t\t\t`Procedure: ${option.item.globalProcedure.name}`,\r\n\t\t\t\t\toption.item.globalProcedure.name,\r\n\t\t\t\t\toption,\r\n\t\t\t\t)),\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (section === 'specialty') {\r\n\t\t\treturn {\r\n\t\t\t\tlabel: renderTitle('Specialties', ),\r\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(`Specialty: ${option.item.specialty.name}`, option.item.specialty.name, option)),\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (section === 'insurance') {\r\n\t\t\treturn {\r\n\t\t\t\tlabel: renderTitle('Insurances', ),\r\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(\r\n\t\t\t\t\t`Insurance: ${option.item.insurance.name}`,\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{option.item.insurance.avatar\r\n\t\t\t\t\t\t\t&& \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\t}\r\n\t\t\t\t\t\t{option.item.insurance.name}\r\n\t\t\t\t\t>,\r\n\t\t\t\t\toption,\r\n\t\t\t\t)),\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (section === 'clinic') {\r\n\t\t\treturn {\r\n\t\t\t\tlabel: renderTitle('Locations', ),\r\n\t\t\t\toptions: filteredOptions.map((option) =>\r\n\t\t\t\t\trenderItem(\r\n\t\t\t\t\t\t`Location: ${option.item.clinic.company?.name} - ${option.item.clinic.nameEn}`,\r\n\t\t\t\t\t\t`${option.item.clinic.company?.name} - ${option.item.clinic.nameEn}`,\r\n\t\t\t\t\t\toption,\r\n\t\t\t\t\t)),\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (section === 'profession') {\r\n\t\t\treturn {\r\n\t\t\t\tlabel: renderTitle('Professions', ),\r\n\t\t\t\toptions: filteredOptions\r\n\t\t\t\t\t.map((option) => renderItem(\r\n\t\t\t\t\t\t`Profession: ${option.item.profession.nameEn}`,\r\n\t\t\t\t\t\toption.item.profession.nameEn,\r\n\t\t\t\t\t\toption,\r\n\t\t\t\t\t)),\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (section === 'special') {\r\n\t\t\treturn {\r\n\t\t\t\tlabel: renderTitle('Specials', ),\r\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(\r\n\t\t\t\t\t`Special: ${option.item.special.name}`,\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{option.item.special.avatar\r\n\t\t\t\t\t\t\t? \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t
: null}\r\n\t\t\t\t\t\t{option.item.special.name}\r\n\t\t\t\t\t>,\r\n\t\t\t\t\toption,\r\n\t\t\t\t)),\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tlabel: '',\r\n\t\t\toptions: [{\r\n\t\t\t\tvalue: '', label: '', item: '', key: -1,\r\n\t\t\t}],\r\n\t\t};\r\n\t};\r\n\r\n\tconst getOptions = (options: Array): Array => {\r\n\t\tconst result: Array = [];\r\n\t\tfor (let i = 0; i < sections.length; i++) {\r\n\t\t\tconst section = sections[i];\r\n\t\t\tconst filteredOptions = options.filter((o) => o.item[section] !== null);\r\n\t\t\tif (filteredOptions.length > 0) {\r\n\t\t\t\tresult.push(getSection(section, filteredOptions));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\r\n\treturn <>\r\n\t\t {\r\n\t\t\t\tsetType(value);\r\n\t\t\t\tif (ref.current) {\r\n\t\t\t\t\tref.current.focus();\r\n\t\t\t\t}\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{searchOptions.map((item) => \r\n\t\t\t\t{item.name}\r\n\t\t\t )}\r\n\t\t \r\n\t\t\r\n\t\t\tautocompleteRef={ref}\r\n\t\t\ttype=\"search\"\r\n\t\t\tloadOnFocus\r\n\t\t\tgetOptions={getOptions}\r\n\t\t\tvalue={value}\r\n\t\t\tonSelect={onSelect}\r\n\t\t\tonChange={onChange}\r\n\t\t\tantdProps={{\r\n\t\t\t\tstyle: { width: '100%' },\r\n\t\t\t\tdefaultActiveFirstOption: false,\r\n\t\t\t\tplaceholder: 'Start type for search...',\r\n\t\t\t}}\r\n\t\t\tparams={{ count: 5, searchType: type }}\r\n\t\t/>\r\n\t\t \r\n\t\t \r\n\t>;\r\n};\r\n\r\nexport default Search;\r\n","import React from 'react';\r\n\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { useLocation, useHistory, NavLink } from 'react-router-dom';\r\n\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport Tag from 'antd/lib/tag';\r\n\r\nimport { parseQuery } from '@common/typescript/utils/url';\r\nimport { BaseParams } from '@common/react/objects/BaseParams';\r\nimport Logout from '@common/react/components/UI/Logout/Logout';\r\nimport { getUserName } from '@common/react/utils/utils';\r\nimport ImageLazy from '@common/react/components/UI/ImageLazy/ImageLazy';\r\nimport TransmutationBack from '@common/react/components/Forms/TransmutationBack';\r\nimport { getSearchParamsFromUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\r\n\r\nimport Avatar from '@commonTuna/react/components/UI/Avatar/Avatar';\r\n\r\nimport { ApplicationState } from '@app/store';\r\nimport { actionCreators } from '@app/store/HeaderSearch';\r\nimport DashboardTopAlert from '@app/components/UI/DashboardTopAlert/DashboardTopAlert';\r\nimport { SearchFilterState } from '@app/store/SearchFilter';\r\nimport ShoppingCartDropdown from '@app/components/UI/ShoppingCartDropdown/ShoppingCartDropdown';\r\nimport BurgerMenu from '@app/components/UI/Header/BurgerMenu';\r\nimport '@app/scss/pages/headerSearch.scss';\r\nimport { useMenuStateProviderContext } from '@app/components/UI/Menu/MenuStateProvider';\r\nimport LocationLink from '@app/components/UI/LocationLink/LocationLink';\r\nimport Search, { clearValues, emptyValues } from '@app/components/UI/Header/Search';\r\nimport { STORAGE_KEYS } from '@app/objects/StorageKeys';\r\n\r\nconst HeaderSearch: React.FC = () => {\r\n\tconst history = useHistory();\r\n\tconst location = useLocation();\r\n\tconst { user, transmuted } = useSelector((state: ApplicationState) => state.login, shallowEqual);\r\n\tconst state = useSelector((state: ApplicationState) => state.header, shallowEqual);\r\n\tconst searchFilterData = useSelector((state: ApplicationState) => state.searchFilterData, shallowEqual);\r\n\tconst dispatch = useDispatch();\r\n\tconst { setState } = bindActionCreators(actionCreators, dispatch);\r\n\tconst context = useMenuStateProviderContext();\r\n\tconst { state: { mounted }, actions: { setState: setMenuState } } = context;\r\n\tconst locationData = useSelector((state: ApplicationState) => state.buildData?.item?.location, shallowEqual);\r\n\r\n\tconst userName = user ? (user.firstName || user.lastName ? getUserName(user) : user.email) : '';\r\n\tconst [keys, setKeys] = React.useState({ key: 'initial' });\r\n\r\n\tconst [isOpen, setIsOpen] = React.useState(false);\r\n\r\n\tconst toggle = () => setIsOpen(!isOpen);\r\n\r\n\tconst [values, setValues] = React.useState({\r\n\t\tlocationName: '',\r\n\t\tglobalPayerName: '',\r\n\t\ttext: '',\r\n\t\tlanguages: [],\r\n\t\tcertificates: [],\r\n\t});\r\n\r\n\tconst handleUrl = (arr: Array<{ name: string, value: any}>) => {\r\n\t\tconst searchObj = location.pathname === '/doctors' ? parseQuery(location.search)\r\n\t\t\t: { ...state, text: undefined };\r\n\r\n\t\tarr.forEach(({ name, value }) => {\r\n\t\t\tsearchObj[name] = value instanceof Array ? `[${value}]` : `${value}`;\r\n\t\t});\r\n\r\n\t\tconst emptyValues = ['', 'null', 'undefined', undefined, null, '-1', '[]'];\r\n\r\n\t\tconst search = Object.keys(searchObj)\r\n\t\t\t.filter((k) => emptyValues.indexOf(searchObj[k]) === -1)\r\n\t\t\t.map((k) => `${k}=${searchObj[k]}`).join('&');\r\n\r\n\t\tif (location.pathname !== '/doctors') {\r\n\t\t\thistory.push(`/doctors?${search}`);\r\n\t\t} else {\r\n\t\t\thistory.replace(`${location.pathname.replace(/\\/\\d+/, '/1')}?${search}`);\r\n\t\t}\r\n\t};\r\n\r\n\tconst onSelectSearch = (value, option) => {\r\n\t\tconst obj = option.props.item;\r\n\t\tconst update = (name, value) => {\r\n\t\t\tsetState({\r\n\t\t\t\t...state,\r\n\t\t\t\t...emptyValues,\r\n\t\t\t\t[name]: value,\r\n\t\t\t});\r\n\t\t\thandleUrl([...clearValues, { name, value }]);\r\n\t\t};\r\n\r\n\t\tif (obj.doctor !== null) {\r\n\t\t\tupdate('doctorId', obj.doctor.id);\r\n\t\t} else if (obj.specialty !== null && obj.specialty !== undefined) {\r\n\t\t\tupdate('specialtyId', obj.specialty.id);\r\n\t\t} else if (obj.globalProcedure !== null) {\r\n\t\t\tupdate('globalProcedureId', obj.globalProcedure.id);\r\n\t\t} else if (obj.clinic !== null) {\r\n\t\t\tupdate('locationId', obj.clinic.id);\r\n\t\t} else if (obj.insurance !== null) {\r\n\t\t\tupdate('globalPayerId', obj.insurance.id);\r\n\t\t} else if (obj.profession !== null) {\r\n\t\t\tupdate('professionId', obj.profession.id);\r\n\t\t} else if (obj.special !== null) {\r\n\t\t\tsetState({\r\n\t\t\t\t...state,\r\n\t\t\t\t...emptyValues,\r\n\t\t\t});\r\n\t\t\thistory.push(`/special/${obj.special.path}`);\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleSearchFilterResult = (searchObj: BaseParams, result: SearchFilterState) => {\r\n\t\tconst text = searchObj.text;\r\n\t\tif (!text) {\r\n\t\t\tif (result.doctorName) {\r\n\t\t\t\thandleUrl([...clearValues, { name: 'doctorId', value: searchObj.doctorId }]);\r\n\t\t\t} else if (result.globalProcedureName) {\r\n\t\t\t\thandleUrl([...clearValues, { name: 'globalProcedureId', value: searchObj.globalProcedureId }]);\r\n\t\t\t} else if (result.specialtyName) {\r\n\t\t\t\thandleUrl([...clearValues, { name: 'specialtyId', value: searchObj.specialtyId }]);\r\n\t\t\t} else if (result.locationName) {\r\n\t\t\t\thandleUrl([...clearValues, { name: 'locationId', value: searchObj.locationId }]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsetKeys((prev) => ({\r\n\t\t\t...prev,\r\n\t\t\tglobalProcedureIds: Math.random(),\r\n\t\t\tspecialtyIds: Math.random(),\r\n\t\t}));\r\n\t\tsetState(searchObj);\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\tlet searchObj: BaseParams = {};\r\n\r\n\t\tif (location.pathname === '/doctors') {\r\n\t\t\tsearchObj = getSearchParamsFromUrl(location);\r\n\t\t} else {\r\n\t\t\tsearchObj = {\r\n\t\t\t\tdoctorId: -1,\r\n\t\t\t\tspecialtyId: -1,\r\n\t\t\t\tglobalProcedureId: -1,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tif (searchObj.text) {\r\n\t\t\thandleUrl([\r\n\t\t\t\t...clearValues,\r\n\t\t\t\t{ name: 'text', value: searchObj.text },\r\n\t\t\t]);\r\n\t\t}\r\n\r\n\t\thandleSearchFilterResult(searchObj, searchFilterData);\r\n\t}, []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tlet text = state.text;\r\n\t\tif (!text) {\r\n\t\t\tif (searchFilterData.doctorName) {\r\n\t\t\t\ttext = `Doctor: ${searchFilterData.doctorName}`;\r\n\t\t\t} else if (searchFilterData.globalProcedureName) {\r\n\t\t\t\ttext = `Procedure: ${searchFilterData.globalProcedureName}`;\r\n\t\t\t} else if (searchFilterData.specialtyName) {\r\n\t\t\t\ttext = `Specialty: ${searchFilterData.specialtyName}`;\r\n\t\t\t} else if (searchFilterData.locationName) {\r\n\t\t\t\ttext = `Location: ${searchFilterData.locationName}`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsetValues((prev) => ({\r\n\t\t\t...prev,\r\n\t\t\t...searchFilterData,\r\n\t\t\ttext: text || '',\r\n\t\t}));\r\n\t}, [searchFilterData]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\t// setIsOpen(false);\r\n\t\tsetMenuState((prev) => ({ ...prev, open: false }));\r\n\t}, [history.location.pathname]);\r\n\tconst showAlert = user && !user?.emailConfirmed;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{user && showAlert ? \r\n\t\t\t\t \r\n\t\t\t
: null}\r\n\t\t\t\r\n\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\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{locationData ?
\r\n\t\t\t\t\t\t\t \r\n \r\n\t\t\t\t\t\t\t{locationData.nameEn}\r\n\t\t\t\t\t\t : null}\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\t\tvalue === '' && setState({\r\n\t\t\t\t\t\t\t\t\t\t...state,\r\n\t\t\t\t\t\t\t\t\t\ttext: value,\r\n\t\t\t\t\t\t\t\t\t\t...emptyValues,\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\thandleUrl([\r\n\t\t\t\t\t\t\t\t\t\t...clearValues,\r\n\t\t\t\t\t\t\t\t\t\t{ name: 'text', value },\r\n\t\t\t\t\t\t\t\t\t]);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\tinitFocus={isOpen}\r\n\t\t\t\t\t\t\t\tonSearchClick={() => setIsOpen(false)}\r\n\t\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\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tDoctors \r\n\t\t\t\t\t\t\t\t\t\tProcedures \r\n\t\t\t\t\t\t\t\t\t\tSpecialties \r\n\t\t\t\t\t\t\t\t\t\tLocations \r\n\t\t\t\t\t\t\t\t\t\tClinics \r\n\t\t\t\t\t\t\t\t\t \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\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
toggle()}>\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{user ?
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\tSpecials Shop \r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\tSchedule an Appointment \r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
: null}\r\n\t\t\t\t\t{user\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\t{/*\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{user && user.unviewedMessagesCount > 0 && {user.unviewedMessagesCount}
}\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\t\t*/}\r\n\t\t\t\t\t\t\t\t{/* \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t \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\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t \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\t\t */}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t{user && user.unviewedMessagesCount > 0 && (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{user.unviewedMessagesCount}\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t{user.unviewedNotificationsCount > 0 && (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{user.unviewedNotificationsCount}\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t localStorage.removeItem(STORAGE_KEYS.CHECKOUT_UID)}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\tclearState\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{mounted\r\n\t\t\t\t\t\t\t\t\t\t? setMenuState((prev) => ({ ...prev, open: !prev.open }))}>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t: \r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t}\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\t
\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\tSpecials Shop \r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\tSchedule an Appointment \r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\tPatient Login \r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t \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\t
\r\n\t\t\t\t\t}\r\n\t\t\t\t\t
node.closest('.search-page') || document.body} />\r\n\t\t\t\t\t\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\tContact Us\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\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tEMR\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 \r\n\t\t\t
\r\n\t\t>\r\n\t);\r\n};\r\n\r\nexport default HeaderSearch;\r\n","import React from 'react';\r\n\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\n\r\nimport { STORAGE_KEYS } from '@app/objects/StorageKeys';\r\nimport { ApplicationState } from '@app/store';\r\nimport { LoginState } from '@app/store/Login';\r\n\r\nconst UserStateTracker: React.FC = ({ children }) => {\r\n\tconst { user } = useSelector((state) => state.login, shallowEqual);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (!user) {\r\n\t\t\tlocalStorage.removeItem(STORAGE_KEYS.CHECKOUT_UID);\r\n\t\t}\r\n\t}, [user]);\r\n\r\n\treturn <>{children}>;\r\n};\r\n\r\nexport default UserStateTracker;\r\n","import React from 'react';\r\n\r\nimport { AliasToken } from 'antd/es/theme/interface';\r\n\r\ninterface ThemeConfig {\r\n\ttoken: Partial;\r\n}\r\n\r\nconst data: Partial = {\r\n\tborderRadius: 6,\r\n\tcolorPrimary: '#fba10d',\r\n};\r\n\r\nexport const theme: ThemeConfig = {\r\n\ttoken: {\r\n\t\tcolorPrimary: data.colorPrimary,\r\n\t\tborderRadius: data.borderRadius,\r\n\t\tcolorInfo: data.colorPrimary,\r\n\t\tcolorInfoText: data.colorPrimary,\r\n\t},\r\n};\r\n","import React, { useState, useEffect } from 'react';\n\nvar GA4ReactGlobalIndex = '__ga4React__';\n/**\r\n * @desc class required to manage google analitycs 4\r\n * @class GA4React\r\n * */\n\nclass GA4React {\n constructor(gaCode, gaConfig, additionalGaCode, timeout, options) {\n this.gaCode = gaCode;\n this.gaConfig = gaConfig;\n this.additionalGaCode = additionalGaCode;\n this.timeout = timeout;\n this.options = options;\n this.scriptSyncId = 'ga4ReactScriptSync';\n this.scriptAsyncId = 'ga4ReactScriptAsync';\n this.nonceAsync = '';\n this.nonceSync = '';\n this.gaConfig = gaConfig ? gaConfig : {};\n this.gaCode = gaCode;\n this.timeout = timeout || 5000;\n this.additionalGaCode = additionalGaCode;\n this.options = options;\n\n if (this.options) {\n var {\n nonce\n } = this.options;\n this.nonceAsync = nonce && nonce[0] ? nonce[0] : '';\n this.nonceSync = nonce && nonce[1] ? nonce[1] : '';\n }\n }\n /**\r\n * @desc output on resolve initialization\r\n */\n\n\n outputOnResolve() {\n return {\n pageview: this.pageview,\n event: this.event,\n gtag: this.gtag\n };\n }\n /**\r\n * @desc Return main function for send ga4 events, pageview etc\r\n * @returns {Promise}\r\n */\n\n\n initialize() {\n return new Promise((resolve, reject) => {\n if (GA4React.isInitialized()) {\n reject(new Error('GA4React is being initialized'));\n } // in case of retry logics, remove previous scripts\n\n\n var previousScriptAsync = document.getElementById(this.scriptAsyncId);\n\n if (previousScriptAsync) {\n previousScriptAsync.remove();\n }\n\n var head = document.getElementsByTagName('head')[0];\n var scriptAsync = document.createElement('script');\n scriptAsync.setAttribute('id', this.scriptAsyncId);\n scriptAsync.setAttribute('async', '');\n\n if (this.nonceAsync && typeof this.nonceAsync === 'string' && this.nonceAsync.length > 0) {\n scriptAsync.setAttribute('nonce', this.nonceAsync);\n }\n\n scriptAsync.setAttribute('src', \"https://www.googletagmanager.com/gtag/js?id=\" + this.gaCode);\n\n scriptAsync.onload = () => {\n var target = document.getElementById(this.scriptSyncId);\n\n if (target) {\n target.remove();\n } // in case of retry logics, remove previous script sync\n\n\n var previousScriptSync = document.getElementById(this.scriptSyncId);\n\n if (previousScriptSync) {\n previousScriptSync.remove();\n }\n\n var scriptSync = document.createElement('script');\n scriptSync.setAttribute('id', this.scriptSyncId);\n\n if (this.nonceSync && typeof this.nonceSync === 'string' && this.nonceSync.length > 0) {\n scriptSync.setAttribute('nonce', this.nonceSync);\n }\n\n var scriptHTML = \"window.dataLayer = window.dataLayer || [];\\n function gtag(){dataLayer.push(arguments);};\\n gtag('js', new Date());\\n gtag('config', '\" + this.gaCode + \"', \" + JSON.stringify(this.gaConfig) + \");\";\n\n if (this.additionalGaCode) {\n this.additionalGaCode.forEach(code => {\n scriptHTML += \"\\ngtag('config', '\" + code + \"', \" + JSON.stringify(this.gaConfig) + \");\";\n });\n }\n\n scriptSync.innerHTML = scriptHTML;\n head.appendChild(scriptSync);\n var resolved = this.outputOnResolve();\n Object.assign(window, {\n [GA4ReactGlobalIndex]: resolved\n });\n resolve(resolved);\n };\n\n scriptAsync.onerror = event => {\n if (typeof event === 'string') {\n reject(\"GA4React intialization failed \" + event);\n } else {\n var error = new Error();\n error.name = 'GA4React intialization failed';\n error.message = JSON.stringify(event, ['message', 'arguments', 'type', 'name']);\n reject(error);\n }\n };\n\n var onChangeReadyState = () => {\n switch (document.readyState) {\n case 'interactive':\n case 'complete':\n if (!GA4React.isInitialized()) {\n head.appendChild(scriptAsync);\n document.removeEventListener('readystatechange', onChangeReadyState);\n }\n\n break;\n }\n };\n\n if (document.readyState !== 'complete') {\n document.addEventListener('readystatechange', onChangeReadyState);\n } else {\n onChangeReadyState();\n }\n\n setTimeout(() => {\n reject(new Error('GA4React Timeout'));\n }, this.timeout);\n });\n }\n /**\r\n * @desc send pageview event to gtag\r\n * @param path\r\n */\n\n\n pageview(path, location, title) {\n return this.gtag('event', 'page_view', {\n page_path: path,\n page_location: location || window.location,\n page_title: title || document.title\n });\n }\n /**\r\n * @desc set event and send to gtag\r\n * @param action\r\n * @param label\r\n * @param category\r\n * @param nonInteraction\r\n */\n\n\n event(action, label, category, nonInteraction) {\n if (nonInteraction === void 0) {\n nonInteraction = false;\n }\n\n return this.gtag('event', action, {\n event_label: label,\n event_category: category,\n non_interaction: nonInteraction\n });\n }\n /**\r\n * @desc direct access to gtag\r\n * @param args\r\n */\n\n\n gtag() {\n //@ts-ignore\n return window.gtag(...arguments);\n }\n /**\r\n * @desc ga is initialized?\r\n */\n\n\n static isInitialized() {\n switch (typeof window[GA4ReactGlobalIndex] !== 'undefined') {\n case true:\n return true;\n\n default:\n return false;\n }\n }\n /**\r\n * @desc get ga4react from global\r\n */\n\n\n static getGA4React() {\n if (GA4React.isInitialized()) {\n return window[GA4ReactGlobalIndex];\n } else {\n console.error(new Error('GA4React is not initialized'));\n }\n }\n\n}\n\nvar outputGA4 = (children, setComponents, ga4) => {\n setComponents(React.Children.map(children, (child, index) => {\n if (!React.isValidElement(child)) {\n return React.createElement(React.Fragment, null, child);\n } //@ts-ignore\n\n\n if (child.type && typeof child.type.name !== 'undefined') {\n return React.cloneElement(child, {\n //@ts-ignore\n ga4: ga4,\n index\n });\n } else {\n return child;\n }\n }));\n};\n\nvar GA4R = (_ref) => {\n var {\n code,\n timeout,\n config,\n additionalCode,\n children,\n options\n } = _ref;\n var [components, setComponents] = useState(null);\n useEffect(() => {\n if (!GA4React.isInitialized()) {\n var ga4manager = new GA4React(\"\" + code, config, additionalCode, timeout, options);\n ga4manager.initialize().then(ga4 => {\n outputGA4(children, setComponents, ga4);\n }, err => {\n console.error(err);\n });\n } else {\n var ga4 = GA4React.getGA4React();\n\n if (ga4) {\n outputGA4(children, setComponents, ga4);\n }\n }\n }, []);\n return React.createElement(React.Fragment, null, components);\n};\n\nvar useGA4React = (gaCode, gaConfig, gaAdditionalCode, gaTimeout, options) => {\n var [ga4, setGA4] = useState(undefined);\n useEffect(() => {\n if (gaCode) {\n switch (GA4React.isInitialized()) {\n case false:\n var ga4react = new GA4React(\"\" + gaCode, gaConfig, gaAdditionalCode, gaTimeout, options);\n ga4react.initialize().then(ga4 => {\n setGA4(ga4);\n }, err => {\n console.error(err);\n });\n break;\n\n case true:\n setGA4(GA4React.getGA4React());\n break;\n }\n } else {\n setGA4(GA4React.getGA4React());\n }\n }, [gaCode]);\n return ga4;\n};\n\nfunction withTracker(MyComponent) {\n return props => {\n var {\n path,\n location,\n title,\n gaCode,\n gaTimeout,\n gaConfig,\n gaAdditionalCode,\n options\n } = props;\n useEffect(() => {\n switch (GA4React.isInitialized()) {\n case true:\n var ga4 = GA4React.getGA4React();\n\n if (ga4) {\n ga4.pageview(path, location, title);\n }\n\n break;\n\n default:\n case false:\n var ga4react = new GA4React(\"\" + gaCode, gaConfig, gaAdditionalCode, gaTimeout, options);\n ga4react.initialize().then(ga4 => {\n ga4.pageview(path, location, title);\n }, err => {\n console.error(err);\n });\n break;\n }\n });\n return React.createElement(MyComponent, Object.assign({}, props));\n };\n}\n\nexport default GA4React;\nexport { GA4R, GA4React, useGA4React, withTracker };\n//# sourceMappingURL=ga-4-react.esm.js.map\n","import React from 'react';\r\n\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nimport GA4React from 'ga-4-react';\r\n\r\ninterface RouteChangeTrackerProps {\r\n\tid: string;\r\n}\r\n\r\nconst RouteChangeTracker: React.FC = ({ id, children }) => {\r\n\tconst history = useHistory();\r\n\tReact.useEffect(() => {\r\n\t\tif (process.env.NODE_ENV === 'production') {\r\n\t\t\tconst ga4react = new GA4React(id);\r\n\r\n\t\t\tga4react.initialize().then((ga4) => {\r\n\t\t\t\tga4.pageview(window.location.pathname + window.location.search);\r\n\r\n\t\t\t\thistory.listen((location, action) => {\r\n\t\t\t\t\tif (GA4React.isInitialized()) {\r\n\t\t\t\t\t\tga4react.pageview(location.pathname + location.search);\r\n\t\t\t\t\t\tga4react.gtag('set', 'page', location.pathname);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}, console.error);\r\n\t\t}\r\n\t}, []);\r\n\r\n\treturn <>{children}>;\r\n};\r\n\r\nexport default RouteChangeTracker;\r\n","import React from 'react';\r\nimport { useDispatch } from 'react-redux';\r\n\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport { useApplicationContext, subscribe } from '@common/react/components/Core/Application/Application';\r\n\r\nimport { PatientLocation } from '@app/objects/PatientLocation';\r\nimport * as LoginState from '@app/store/Login';\r\nimport { User } from '@app/objects/User';\r\n\r\nconst PatientLocationsSetter: React.FC = () => {\r\n\tconst { getUser } = useApplicationContext();\r\n\tconst user = getUser();\r\n\r\n\tconst dispatch = useDispatch();\r\n\tconst loginActions: LoginState.LoginActionCreators = React.useMemo(() =>\r\n\t\tbindActionCreators(LoginState.getActionCreators(), dispatch), []);\r\n\r\n\tconst handleNotify = (notification) => {\r\n\t\tswitch (notification.objectType) {\r\n\t\t\tcase 'UpdatePatientLocation':\r\n\t\t\t\tconst userData = notification.data as User;\r\n\t\t\t\tconst patientLocation: PatientLocation = notification.data.value;\r\n\t\t\t\tif (user && (user.id === userData.id)) {\r\n\t\t\t\t\tconst patientLocationIndex = user.patientLocations.findIndex((pl) => pl.id === patientLocation.id);\r\n\t\t\t\t\tif (patientLocationIndex >= 0) {\r\n\t\t\t\t\t\tconst newPatientLocations = user.patientLocations.map((pl, index) => {\r\n\t\t\t\t\t\t\tif (index === patientLocationIndex) {\r\n\t\t\t\t\t\t\t\treturn { ...pl, ...patientLocation };\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn pl;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tloginActions.updateUser({ patientLocations: [...newPatientLocations] });\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tloginActions.updateUser({ patientLocations: [...user.patientLocations, patientLocation] });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t};\r\n\r\n\tReact.useEffect(subscribe(handleNotify), [user?.id]);\r\n\r\n\treturn <>>;\r\n};\r\n\r\nexport default PatientLocationsSetter;\r\n","import * as React from 'react';\r\n\r\nimport ConfigProvider from 'antd/es/config-provider';\r\n\r\nimport '@common/react/yupLocaleSettings';\r\nimport { LoadingProvider } from '@common/react/components/Core/LoadingProvider/LoadingProvider';\r\nimport VideoChatModal from '@common/react/components/UI/VideoChat/VideoChatModal';\r\nimport ErrorBoundaryWithSentry from '@common/react/components/UI/ErrorBoundaryWithSentry/ErrorBoundaryWithSentry';\r\nimport SignalRChats from '@common/react/components/Chat/SignalRChats';\r\nimport { ChatSettingsProvider } from '@common/react/components/Chat/ChatSettingsProvider';\r\nimport { RequestProvider } from '@common/react/components/RequestProvider/RequestProvider';\r\nimport { ReactionsPlugin } from '@common/react/components/Chat/Reactions/ReactionsPlugin';\r\nimport { ChatPlugins } from '@common/react/components/Chat/Chat';\r\nimport VideoChatGlider from '@common/react/components/Chat/VideoChatGlider';\r\nimport Application from '@common/react/components/Core/Application/Application';\r\nimport NotificationGliderProvider from '@common/react/components/Chat/NotificationGliderProvider';\r\nimport ReactionNotificationHandler from '@common/react/components/Chat/ReactionNotificationHandler';\r\n\r\nimport Avatar from '@commonTuna/react/components/UI/Avatar/Avatar';\r\n\r\nimport CartProviderWithUpdate from '@app/components/UI/CartProviderWithUpdate/CartProviderWithUpdate';\r\nimport HeaderSearch from '@app/components/UI/Header/HeaderSearch';\r\nimport PortalLoader from '@app/components/UI/PortalLoader';\r\nimport '@app/scss/components/chatMessageNotificationGlider.scss';\r\nimport { MenuStateProvider } from '@app/components/UI/Menu/MenuStateProvider';\r\nimport UserStateTracker from '@app/components/UI/UserStateTracker/UserStateTracker';\r\nimport { theme } from '@app/components/UI/ThemeConfig/ThemeConfig';\r\nimport RouteChangeTracker from '@app/components/Routes/RouteChangeTracker';\r\nimport PatientLocationsSetter from '@app/components/UI/PatientLocationsSetter/PatientLocationsSetter';\r\nimport { customReduxActions } from '@app/store/CustomReduxActions';\r\nimport { User } from '@app/objects/User';\r\nimport { Init } from '@app/objects/Init';\r\n\r\nimport '@app/scss/style.scss';\r\n\r\nconst renderAvatar = (state) => ;\r\n\r\nconst Layout: React.FC = ({ children }) => {\r\n\treturn (\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t \r\n\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\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tinitCustomHandler={customReduxActions}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{children}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t \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\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);\r\n};\r\n\r\nexport default Layout;\r\n","import React from 'react';\r\nimport ContentLoader from 'react-content-loader';\r\n\r\nconst SpecialImageLoader = (props) => (\r\n\t\r\n\t\t \r\n\t \r\n);\r\n\r\nexport default SpecialImageLoader;\r\n","import * as React from 'react';\r\nimport { NavLink } from 'react-router-dom';\r\n\r\nimport Tag from 'antd/lib/tag';\r\n\r\nimport { Product } from '@app/objects/Product/Product';\r\n\r\nconst ProductTag: React.FC<{product: Product}> = (props) => {\r\n\tconst product = props.product;\r\n\treturn (<>\r\n\t\t{product.path\r\n\t\t\t? \r\n\t\t\t\t\r\n\t\t\t\t\t{product.name}\r\n\t\t\t\t \r\n\t\t\t \r\n\t\t\t: \r\n\t\t\t\t{product.name}\r\n\t\t\t \r\n\t\t}\r\n\t>);\r\n};\r\n\r\nexport default ProductTag;\r\n","import React from 'react';\r\n\r\nimport Carousel from 'antd/lib/carousel';\r\n\r\nimport SpecialCard from '@app/components/Pages/Specials/SpecialCard';\r\nimport { Special } from '@app/objects/Special';\r\n\r\nimport '@app/scss/components/special.scss';\r\nimport '@app/scss/components/specialsCarousel.scss';\r\n\r\ninterface Props {\r\n\tspecials: Array;\r\n}\r\n\r\nconst tabletSetting = {\r\n\tbreakpoint: 821,\r\n\tsettings: {\r\n\t\tslidesToShow: 3,\r\n\t},\r\n};\r\n\r\nconst mobileSetting = {\r\n\tbreakpoint: 500,\r\n\tsettings: {\r\n\t\tslidesToShow: 1,\r\n\t},\r\n};\r\n\r\nconst SpecialsCarousel: React.FC = ({ specials }) => {\r\n\tconst fullScreenSlidesToShow = specials.length <= 5 ? specials.length : 5;\r\n\tconst maxWidth = `${fullScreenSlidesToShow * 218}px`;\r\n\r\n\treturn \r\n\t\t
Popular Specials \r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\t \r\n\t\t\t\t}\r\n\t\t\t\tprevArrow={\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\tlazyLoad=\"ondemand\"\r\n\t\t\t>\r\n\t\t\t\t{specials.map((special) =>\r\n\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 \r\n\t\t
\r\n\t
;\r\n};\r\n\r\nexport default SpecialsCarousel;\r\n","import React from 'react';\r\nimport ContentLoader from 'react-content-loader';\r\n\r\nconst PreviewImageLoader = (props) => (\r\n\t\r\n\t\t \r\n\t \r\n);\r\n\r\nexport default PreviewImageLoader;\r\n","import * as React from 'react';\r\n\r\nimport Tag from 'antd/lib/tag';\r\n\r\nimport ServerPageProvider from '@common/react/components/Core/ServerPageProvider/ServerPageProvider';\r\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\r\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\r\nimport { ItemEditorWrapper } from '@common/react/components/Core/ItemEditor/ItemEditorWrapper';\r\n\r\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\r\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\r\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\r\n\r\nimport AddToCartButton from '@app/components/UI/AddToCartButton/AddToCartButton';\r\nimport SpecialImageLoader from '@app/components/UI/SpecialImageLoader/SpecialImageLoader';\r\nimport ProductTag from '@app/components/Pages/Products/ProductTag';\r\nimport { Special } from '@app/objects/Special';\r\nimport SpecialsCarousel from '@app/components/UI/SpecialsCarousel/SpecialsCarousel';\r\nimport PreviewImageLoader from '@app/components/UI/SpecialImageLoader/PreviewImageLoader';\r\n\r\nimport '@app/scss/components/specialProductInfo.scss';\r\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\r\n\r\nimport noImage from '@images/no-image.jpg';\r\n\r\ninterface InnerProps {\r\n\tpopularSpecials?: Array;\r\n\tforPreview?: boolean;\r\n}\r\n\r\nexport const SpecialPageInner: React.FC = ({ popularSpecials, forPreview = false }) => {\r\n\tconst [imgLoading, setImgLoading] = React.useState(true);\r\n\r\n\treturn \r\n\t\tclassName=\"special-container\"\r\n\t\trender={({ state: { item: special } }) => {\r\n\t\t\treturn \r\n\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\t{imgLoading\r\n\t\t\t\t\t\t\t\t? forPreview\r\n\t\t\t\t\t\t\t\t\t?
\r\n\t\t\t\t\t\t\t\t\t:
\r\n\t\t\t\t\t\t\t\t: null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t
setImgLoading(false)}\r\n\t\t\t\t\t\t\t\thidden={imgLoading}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t{!forPreview\r\n\t\t\t\t\t\t\t&&
\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\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\t{special.name &&
{special.name} }\r\n\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{special.description &&
{special.description}
}\r\n\t\t\t\t\t\t\t\t{special.location\r\n\t\t\t\t\t\t\t\t\t&&
\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{special.location.nameEn}\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{getMoneyString(special.price)} \r\n\t\t\t\t\t\t\t\t\t{getMoneyString(special.originalPrice)} \r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t{special?.products?.length > 0 && <>\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\tProducts\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t{special.products.map((item) => item.product\r\n\t\t\t\t\t\t\t\t\t\t\t&&
\r\n\t\t\t\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t\t
)}\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t>}\r\n\t\t\t\t\t\t\t\t{special?.procedures?.length > 0 && <>\r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\tProcedures\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t\t{special.procedures.map((item) =>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{item.procedure.name}\r\n\t\t\t\t\t\t\t\t\t\t\t )}\r\n\t\t\t\t\t\t\t\t\t
\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\t\t{forPreview && (\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t
\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\t
\r\n\t\t\t\t\t\t{forPreview &&
\r\n\t\t\t\t\t\t\tShow more details \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\t{popularSpecials && popularSpecials.length > 0 &&
}\r\n\t\t\t
;\r\n\t\t}}\r\n\t\tbackPath=\"\"\r\n\t/>;\r\n};\r\n\r\nconst SpecialPageProvider: React.FC = () => {\r\n\treturn (\r\n\t\t }\r\n\t\t\treloadByPathChange\r\n\t\t\tinner={(page) => (\r\n\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);\r\n};\r\n\r\nexport default SpecialPageProvider;\r\n","import * as React from 'react';\r\n\r\nimport Modal from 'antd/lib/modal';\r\n\r\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\r\n\r\nimport '@app/scss/components/specialModal.scss';\r\nimport { SpecialPageInner } from '@app/components/Pages/Specials/Special';\r\n\r\ninterface Props {\r\n\tid: number;\r\n}\r\n\r\nconst SpecialModal: React.FC = ({ id }) => {\r\n\tconst [open, setOpen] = React.useState(false);\r\n\r\n\tconst preventDefault = (e: React.MouseEvent): void => {\r\n\t\te.preventDefault();\r\n\t\te.stopPropagation();\r\n\t};\r\n\r\n\tconst handleOpen = () => {\r\n\t\tsetOpen(true);\r\n\t};\r\n\r\n\tconst handleClose = () => {\r\n\t\tsetOpen(false);\r\n\t};\r\n\r\n\treturn preventDefault(e)}>\r\n\t\t
Fast Preview
\r\n\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 SpecialModal;\r\n","import * as React from 'react';\r\nimport { NavLink } from 'react-router-dom';\r\n\r\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\r\n\r\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\r\n\r\nimport TextWithTooltip from '@app/components/UI/TextWithTooltip/TextWithTooltip';\r\nimport AddToCartButton from '@app/components/UI/AddToCartButton/AddToCartButton';\r\nimport { Special } from '@app/objects/Special';\r\nimport CardImageLoader from '@app/components/UI/CardImageLoader/CardImageLoader';\r\nimport SpecialModal from '@app/components/UI/SpecialModal/SpecialModal';\r\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\r\n\r\nimport noImage from '@images/no-image.jpg';\r\n\r\ninterface SpecialCardProps {\r\n\titem: Special;\r\n\tlazyLoad?: boolean;\r\n}\r\n\r\nconst SpecialName: React.FC<{name: string, className?: string}> = ({ name, className }) => {\r\n\treturn ;\r\n};\r\n\r\nexport const SpecialLocation: React.FC<{text: string}> = ({ text }) => {\r\n\treturn ;\r\n};\r\n\r\nconst SpecialCardContent: React.FC = (props) => {\r\n\tconst {\r\n\t\titem,\r\n\t\tlazyLoad,\r\n\t} = props;\r\n\tconst [loading, setLoading] = React.useState(true);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetLoading(false);\r\n\t}, []);\r\n\r\n\treturn <>\r\n\t\t\r\n\t\t\t \r\n\t\t\t{loading && }\r\n\t\t\t setLoading(false)}\r\n\t\t\t\thidden={loading}\r\n\t\t\t/>\r\n\t\t
\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t \r\n\t\t\t\t
\r\n\t\t\t\t{item.description\r\n\t\t\t\t\t?
\r\n\t\t\t\t\t\t{item.description}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t: null\r\n\t\t\t\t}\r\n\t\t\t\t
\r\n\t\t\t\t\t{getMoneyString(item.price)} \r\n\t\t\t\t\t{getMoneyString(item.originalPrice)} \r\n\t\t\t\t
\r\n\t\t\t\t{item.location\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\t \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\t
e.preventDefault()}>\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\nconst SpecialCard: React.FC = ({ item, lazyLoad = true }) => {\r\n\treturn \r\n\t\t{item.path\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 SpecialCard;\r\n","import * as React from 'react';\r\nimport { Route, RouteProps, Redirect } from 'react-router-dom';\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\nimport { Helmet } from 'react-helmet';\r\n\r\nimport { loadable, loadableDelay } from '@common/react/loadable/loadableSettings';\r\nimport ErrorBoundaryWithSentry from '@common/react/components/UI/ErrorBoundaryWithSentry/ErrorBoundaryWithSentry';\r\nimport { RequestProvider } from '@common/react/components/RequestProvider/RequestProvider';\r\n\r\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\r\n\r\nimport { ApplicationState } from '@app/store';\r\n\r\nconst params = {\r\n\tfallback: ,\r\n};\r\n\r\nconst DashboardLayout = loadable(() => loadableDelay(/* webpackChunkName: \"DashboardLayout\" */\r\n\timport('@app/components/Layouts/DashboardLayout/DashboardLayout'),\r\n), params);\r\n\r\ninterface Props extends RouteProps {\r\n\tcomponent: any;\r\n\tredirectPath?: string;\r\n\ttitle?: string;\r\n}\r\n\r\nconst DashboardRoute: React.FC = ({\r\n\tcomponent: Component, redirectPath = '/', title, ...rest\r\n}) => {\r\n\tconst user = useSelector((state: ApplicationState) => state.login.user, shallowEqual);\r\n\treturn (user ? \r\n\t\t\t{title && \r\n\t\t\t\t{title} \r\n\t\t\t }\r\n\t\t\t\r\n\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/>;\r\n};\r\n\r\nexport default DashboardRoute;\r\n","import * as React from 'react';\r\n\r\nexport const MainLayout: React.FC = (props) => {\r\n\treturn \r\n\t\t{props.children}\r\n\t
;\r\n};\r\n","import * as React from 'react';\r\nimport { NavLink } from 'react-router-dom';\r\n\r\nimport ImageLazy from '@common/react/components/UI/ImageLazy/ImageLazy';\r\n\r\nconst year = new Date().getFullYear();\r\n\r\nconst Footer: React.FC = () => {\r\n\treturn ;\r\n};\r\n\r\nexport default Footer;\r\n","import React from 'react';\r\nimport { Route, RouteProps } from 'react-router-dom';\r\n\r\nimport ErrorBoundaryWithSentry from '@common/react/components/UI/ErrorBoundaryWithSentry/ErrorBoundaryWithSentry';\r\n\r\nimport { MainLayout } from '@app/components/Layouts/MainLayout';\r\n\r\nimport Footer from '@app/components/UI/Footer/Footer';\r\n\r\ninterface Props extends RouteProps {\r\n\tcomponent: any;\r\n}\r\n\r\nconst RouteWithFooter: React.FC = ({ component: Component, ...rest }) => (\r\n\t\r\n\t\t\t\r\n\t\t\t\t\r\n\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/>\r\n);\r\n\r\nexport default RouteWithFooter;\r\n","import * as React from 'react';\r\n\r\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\r\n\r\nimport '@app/scss/components/addToCartButton.scss';\r\nimport { Special } from '@app/objects/Special';\r\nimport { CartItem, transformSpecialToCartItem } from '@app/objects/CartItem';\r\nimport useShoppingCart from '@app/hooks/useShoppingCart';\r\n\r\ninterface Props {\r\n\tspecial: Special | CartItem;\r\n\twithTotal?: boolean;\r\n}\r\n\r\nconst AddToCartButton: React.FC = (props) => {\r\n\tconst specialForStore = transformSpecialToCartItem(props.special);\r\n\tconst { addCartItem, updateCartItemQuantity, getItem } = useShoppingCart();\r\n\r\n\tconst [isInitialized, setIsInitialized] = React.useState(false);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetIsInitialized(true);\r\n\t}, [isInitialized]);\r\n\r\n\tconst storedItem: CartItem | undefined = getItem(specialForStore.id);\r\n\r\n\tconst withTotal = props.withTotal ?? true;\r\n\r\n\tconst getQuantityTitle = (quantity: number) => {\r\n\t\treturn `${quantity} unit${quantity > 1 ? 's' : ''}`;\r\n\t};\r\n\r\n\tconst quantity = storedItem?.quantity;\r\n\r\n\treturn \r\n\t\t{isInitialized && storedItem && quantity\r\n\t\t\t?
\r\n\t\t\t\t
updateCartItemQuantity(storedItem.id, quantity - 1)}\r\n\t\t\t\t>\r\n\t\t\t\t\t–\r\n\t\t\t\t \r\n\t\t\t\t
\r\n\t\t\t\t\t
{getQuantityTitle(quantity)}
\r\n\t\t\t\t\t{withTotal &&
{getMoneyString(storedItem.itemTotal || 0)}
}\r\n\t\t\t\t
\r\n\t\t\t\t
updateCartItemQuantity(storedItem.id, quantity + 1)}\r\n\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\t:
addCartItem(specialForStore, 1)}>Add to cart \r\n\t\t}\r\n\t
;\r\n};\r\n\r\nexport default AddToCartButton;\r\n","import React from 'react';\r\nimport ContentLoader from 'react-content-loader';\r\n\r\nconst CardImageLoader = (props) => (\r\n\t\r\n\t\t \r\n\t \r\n);\r\n\r\nexport default CardImageLoader;\r\n","import * as React from 'react';\r\nimport { NavLink } from 'react-router-dom';\r\n\r\nimport { MenuItem as BaseMenuItem } from '@common/react/objects/MenuItem';\r\nimport { Nullable } from '@common/typescript/objects/Nullable';\r\n\r\nimport { CountersState } from '@app/store/Counters';\r\nimport { User } from '@app/objects/User';\r\n\r\nimport '@app/scss/components/menu.scss';\r\n\r\ninterface MenuItem extends BaseMenuItem {\r\n\tnode?: React.ReactNode;\r\n\ticon?: React.ReactNode;\r\n}\r\n\r\ninterface MenuItemProps extends Omit {\r\n\titem: MenuItem;\r\n\tcounters?: CountersState;\r\n}\r\n\r\ninterface MenuProps {\r\n\titems: Array;\r\n\tcounters?: CountersState;\r\n\tclassName?: string;\r\n\twithChildren?: boolean;\r\n\tbasePath?: string;\r\n\tpathKey?: string;\r\n\tdefaultOpen?: boolean;\r\n\tuser?: Nullable;\r\n}\r\n\r\nconst Item: React.FC = ({\r\n\titem,\r\n\tcounters,\r\n\twithChildren,\r\n\tbasePath,\r\n\tpathKey,\r\n\tdefaultOpen,\r\n\tuser,\r\n}) => {\r\n\tconst [open, setOpen] = React.useState(defaultOpen || ((typeof item.isOpen !== 'undefined') ? item.isOpen : false));\r\n\r\n\tconst condition = withChildren && item.children && item.children.list && item.children.list.length > 0;\r\n\tconst path = item[pathKey || 'path'];\r\n\tconst { exact = false, isActive } = item;\r\n\r\n\t// tslint:disable-next-line:max-line-length\r\n\tconst className = `menu-component__item ${open && condition\r\n\t\t? 'menu-component__item_open' : ''} ${condition\r\n\t\t? 'menu-component__item_with-children' : ''} ${item.className || ''}`;\r\n\r\n\tconst requiredBadge = React.useMemo(() => {\r\n\t\treturn {\r\n\t\t\t'/chats': {\r\n\t\t\t\tcondition: !!user && user.unviewedMessagesCount > 0,\r\n\t\t\t\tvalue: user?.unviewedMessagesCount,\r\n\t\t\t\ttitle: 'Unviewed messages',\r\n\t\t\t},\r\n\t\t\t'/document-list': {\r\n\t\t\t\tcondition: !!counters && counters.notViewedDocumentsCount > 0,\r\n\t\t\t\tvalue: counters?.notViewedDocumentsCount,\r\n\t\t\t\ttitle: 'Not read documents',\r\n\t\t\t},\r\n\t\t\t'/questionnaires': {\r\n\t\t\t\tcondition: !!counters && counters.notAnsweredDiseasesCount > 0,\r\n\t\t\t\tvalue: counters?.notAnsweredDiseasesCount,\r\n\t\t\t\ttitle: 'Not answered questionnaires',\r\n\t\t\t},\r\n\t\t\t'/consent-forms': {\r\n\t\t\t\tcondition: !!counters && counters.notAnsweredConsentsCount > 0,\r\n\t\t\t\tvalue: counters?.notAnsweredConsentsCount,\r\n\t\t\t\ttitle: 'Not signed consent forms',\r\n\t\t\t},\r\n\t\t\t'/instructions': {\r\n\t\t\t\tcondition: !!counters && counters.notReadInstructionsCount > 0,\r\n\t\t\t\tvalue: counters?.notReadInstructionsCount,\r\n\t\t\t\ttitle: 'Not read instructions',\r\n\t\t\t},\r\n\t\t\t'/prescriptions-list': {\r\n\t\t\t\tcondition: !!counters && counters.notViewedPrescriptionsCount > 0,\r\n\t\t\t\tvalue: counters?.notViewedPrescriptionsCount,\r\n\t\t\t\ttitle: 'Not read prescriptions',\r\n\t\t\t},\r\n\t\t\t'/bills': {\r\n\t\t\t\tcondition: !!counters && counters.notPaidBillItemsCount > 0,\r\n\t\t\t\tvalue: counters?.notPaidBillItemsCount,\r\n\t\t\t\ttitle: 'Not paid bills count',\r\n\t\t\t},\r\n\t\t};\r\n\t}, [user, counters]);\r\n\r\n\tconst totalBadge = React.useMemo(() => {\r\n\t\treturn {\r\n\t\t\t'/document-list': {\r\n\t\t\t\tcondition: !!counters && counters.totalDocumentsCount > 0,\r\n\t\t\t\tvalue: counters?.totalDocumentsCount,\r\n\t\t\t\ttitle: 'Total documents count',\r\n\t\t\t},\r\n\t\t\t'/questionnaires': {\r\n\t\t\t\tcondition: !!counters && counters.totalDiseasesCount > 0,\r\n\t\t\t\tvalue: counters?.totalDiseasesCount,\r\n\t\t\t\ttitle: 'Total questionnaires count',\r\n\t\t\t},\r\n\t\t\t'/consent-forms': {\r\n\t\t\t\tcondition: !!counters && counters.totalConsentsCount > 0,\r\n\t\t\t\tvalue: counters?.totalConsentsCount,\r\n\t\t\t\ttitle: 'Total consent forms count',\r\n\t\t\t},\r\n\t\t\t'/instructions': {\r\n\t\t\t\tcondition: !!counters && counters.totalInstructionsCount > 0,\r\n\t\t\t\tvalue: counters?.totalInstructionsCount,\r\n\t\t\t\ttitle: 'Total instructions count',\r\n\t\t\t},\r\n\t\t\t'/prescriptions-list': {\r\n\t\t\t\tcondition: !!counters && counters.totalPrescriptionsCount > 0,\r\n\t\t\t\tvalue: counters?.totalPrescriptionsCount,\r\n\t\t\t\ttitle: 'Total prescriptions count',\r\n\t\t\t},\r\n\t\t\t'/bills': {\r\n\t\t\t\tcondition: !!counters && counters.totalBillItemsCount > 0,\r\n\t\t\t\tvalue: counters?.totalBillItemsCount,\r\n\t\t\t\ttitle: 'Total bills count',\r\n\t\t\t},\r\n\t\t};\r\n\t}, [counters]);\r\n\r\n\tconst toggleMenu = () => {\r\n\t\tsetOpen(!open);\r\n\t};\r\n\r\n\tif (item.node) {\r\n\t\treturn <>{item.node}>;\r\n\t}\r\n\r\n\tconst icon = item.icon && ;\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{path ? item.externalLink\r\n\t\t\t\t? \r\n\t\t\t\t\t{icon}\r\n\t\t\t\t\t{item.name}\r\n\t\t\t\t \r\n\t\t\t\t: (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{icon}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{item.name}\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t{requiredBadge[item.path]?.condition\r\n\t\t\t\t\t\t\t? \r\n\t\t\t\t\t\t\t\t{requiredBadge[item.path].value}\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t: null\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t{totalBadge[item.path]?.condition\r\n\t\t\t\t\t\t\t? \r\n\t\t\t\t\t\t\t\t{totalBadge[item.path].value}\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t: null\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\t: \r\n\t\t\t\t\t{icon}\r\n\t\t\t\t\t{item.name}\r\n\t\t\t\t \r\n\t\t\t}\r\n\t\t\t{condition\r\n\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\t{item.children && item.children.list.map((child, index) =>\r\n\t\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>\r\n\t\t\t}\r\n\t\t \r\n\t);\r\n};\r\n\r\nexport const Menu: React.FC = ({\r\n\tclassName = '',\r\n\titems,\r\n\twithChildren = false,\r\n\tbasePath,\r\n\tpathKey,\r\n\tdefaultOpen,\r\n\tcounters,\r\n\tuser,\r\n}) => {\r\n\tconst menuItems = items || [];\r\n\r\n\treturn \r\n\t\t{menuItems.map((item, index) =>\r\n\t\t\t )}\r\n\t ;\r\n};\r\n","import * as React from 'react';\r\n\r\nimport once from 'lodash/once';\r\n\r\nexport interface MenuStateProviderContextState {\r\n\topen: boolean;\r\n\tmounted: boolean;\r\n}\r\n\r\nexport interface MenuStateProviderContext {\r\n\tstate: MenuStateProviderContextState;\r\n\tactions: {setState};\r\n}\r\n\r\nexport const createMenuStateProviderContext = once(() => React.createContext({} as MenuStateProviderContext));\r\n\r\nexport const useMenuStateProviderContext: () => MenuStateProviderContext = () => React.useContext(createMenuStateProviderContext());\r\n\r\nexport const MenuStateProvider: React.FC = ({ children }) => {\r\n\tconst ItemContext = createMenuStateProviderContext();\r\n\r\n\tconst [state, setState] = React.useState({ open: false, mounted: false });\r\n\r\n\tconst value = {\r\n\t\tstate,\r\n\t\tactions: {\r\n\t\t\tsetState,\r\n\t\t},\r\n\t};\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{children}\r\n\t\t \r\n\t);\r\n};\r\n","import React from 'react';\r\n\r\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\r\n\r\nconst PortalLoader: React.FC = () => {\r\n\treturn ;\r\n};\r\n\r\nexport const params = {\r\n\tfallback: ,\r\n};\r\n\r\nexport default PortalLoader;\r\n","import React from 'react';\r\n\r\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\r\n\r\nimport emptyCart from '@images/empty-cart.png';\r\n\r\nconst EmptyCart: React.FC = () => {\r\n\treturn \r\n\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\t\t
You have no items in your shopping cart. \r\n\t\t
\r\n\t\t\tLet's go buy something!\r\n\t\t \r\n\t
;\r\n};\r\n\r\nexport default EmptyCart;\r\n","import React from 'react';\r\nimport { useCart } from 'react-use-cart';\r\n\r\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\r\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\r\n\r\nimport '@app/scss/components/shoppingCartInformation.scss';\r\nimport TextWithTooltip from '@app/components/UI/TextWithTooltip/TextWithTooltip';\r\nimport AddToCartButton from '@app/components/UI/AddToCartButton/AddToCartButton';\r\nimport EmptyCart from '@app/components/UI/EmptyCart/EmptyCart';\r\nimport { CartItem, transformStoredItemToCartItem } from '@app/objects/CartItem';\r\nimport useShoppingCart from '@app/hooks/useShoppingCart';\r\nimport { SpecialLocation } from '@app/components/Pages/Specials/SpecialCard';\r\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\r\n\r\nimport noImage from '@images/no-image.jpg';\r\n\r\ninterface Props {\r\n\tcheckout?: React.ReactNode;\r\n}\r\n\r\nconst CartItemTitle: React.FC<{name: string}> = ({ name }) => {\r\n\treturn ;\r\n};\r\n\r\nconst ShoppingCartItem: React.FC<{item: CartItem}> = ({ item }) => {\r\n\tconst { removeCartItem } = useShoppingCart();\r\n\r\n\treturn \r\n\t\t
removeCartItem(item.id)} />\r\n\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
\r\n\t\t\t\t\t
\r\n\t\t\t\t \r\n\t\t\t\t{item.location\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\t \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\t
{getMoneyString(item.price)} \r\n\t\t\t\t
{getMoneyString(item.originalPrice)} \r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
{getMoneyString(item.itemTotal ?? 0)}
\r\n\t\t\t
\r\n\t\t \r\n\t ;\r\n};\r\n\r\nconst ShoppingCartInformation: React.FC = ({ checkout }) => {\r\n\tconst { items, cartTotal, isEmpty } = useCart();\r\n\r\n\treturn \r\n\t\t{isEmpty ?
\r\n\t\t\t:
\r\n\t\t\t\t
\r\n\t\t\t\t\t{items.map((item) =>\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 )}\r\n\t\t\t\t \r\n\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\tTotal:\r\n\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t{getMoneyString(cartTotal)}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t{checkout}\r\n\t\t\t
\r\n\t\t}\r\n\t
;\r\n};\r\n\r\nexport default ShoppingCartInformation;\r\n","import * as React from 'react';\r\n\r\nimport Tooltip, { AbstractTooltipProps } from 'antd/lib/tooltip';\r\n\r\ninterface Props {\r\n\ttext?: string;\r\n\tcount: number;\r\n\ttooltipProps?: AbstractTooltipProps;\r\n\tclassName?: string;\r\n\twithTitle?: boolean;\r\n}\r\n\r\nconst TextWithTooltip: React.FC = ({\r\n\ttext, count, tooltipProps, className, withTitle,\r\n}) => {\r\n\treturn text ? \r\n\t\t{text.length > count\r\n\t\t\t? \r\n\t\t\t\t{text?.substr(0, count)}\r\n\t\t\t\t...\r\n\t\t\t \r\n\t\t\t: withTitle ? {text} : text\r\n\t\t}\r\n\t
: null;\r\n};\r\n\r\nexport default TextWithTooltip;\r\n","import * as React from 'react';\r\n\r\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\r\n\r\ninterface Props {\r\n\tprefix: string;\r\n\tpath: string;\r\n}\r\n\r\nconst WithPathLink: React.FC = ({ prefix, path, children }) => {\r\n\treturn <>\r\n\t\t{path\r\n\t\t\t? \r\n\t\t\t\t{children}\r\n\t\t\t \r\n\t\t\t: <>\r\n\t\t\t\t{children}\r\n\t\t\t>\r\n\t\t}\r\n\t>;\r\n};\r\n\r\nexport default WithPathLink;\r\n","import React from 'react';\r\nimport { useCart } from 'react-use-cart';\r\n\r\nimport { getLocalStorageValue } from '@common/react/utils/localStorage/localStorage';\r\n\r\nimport { STORAGE_KEYS } from '@app/objects/StorageKeys';\r\n\r\nconst useShoppingCart = () => {\r\n\tconst {\r\n\t\tremoveItem, addItem, updateItemQuantity, getItem,\r\n\t} = useCart();\r\n\tconst uid = getLocalStorageValue(STORAGE_KEYS.CHECKOUT_UID, null);\r\n\r\n\tconst removeUid = () => {\r\n\t\tif (uid) {\r\n\t\t\tlocalStorage.removeItem(STORAGE_KEYS.CHECKOUT_UID);\r\n\t\t}\r\n\t};\r\n\r\n\tconst removeCartItem = (itemId) => {\r\n\t\tremoveItem(itemId);\r\n\t\tremoveUid();\r\n\t};\r\n\r\n\tconst addCartItem = (item, quantity) => {\r\n\t\taddItem(item, quantity);\r\n\t\tremoveUid();\r\n\t};\r\n\r\n\tconst updateCartItemQuantity = (itemId, quantity) => {\r\n\t\tupdateItemQuantity(itemId, quantity);\r\n\t\tremoveUid();\r\n\t};\r\n\r\n\treturn {\r\n\t\tremoveCartItem,\r\n\t\taddCartItem,\r\n\t\tupdateCartItemQuantity,\r\n\t\tgetItem,\r\n\t};\r\n};\r\n\r\nexport default useShoppingCart;\r\n","import { Item } from 'react-use-cart';\r\n\r\nimport { Nullable } from '@common/typescript/objects/Nullable';\r\n\r\nimport { Special } from '@app/objects/Special';\r\n\r\nexport interface CartItem extends Item {\r\n\tname: string;\r\n\toriginalPrice: number;\r\n\tdescription: string;\r\n\tpath: string;\r\n\tlocationId: Nullable;\r\n\tlocation: {\r\n\t\tid: number;\r\n\t\tnameEn: string,\r\n\t\tnameEs: string,\r\n\t\tportalPathEn: string;\r\n\t};\r\n\tavatar: string;\r\n\toriginalAvatar: string;\r\n}\r\n\r\nexport const transformSpecialToCartItem = (special: Special | CartItem): CartItem => {\r\n\treturn {\r\n\t\tid: special.id.toString(),\r\n\t\tprice: special.price,\r\n\t\tname: special.name,\r\n\t\toriginalPrice: special.originalPrice,\r\n\t\tpath: special.path,\r\n\t\tdescription: special.description,\r\n\t\tlocationId: special.locationId,\r\n\t\tlocation: {\r\n\t\t\tid: special.location?.id ?? 0,\r\n\t\t\tnameEn: special.location?.nameEn ?? '',\r\n\t\t\tnameEs: special.location?.nameEs ?? '',\r\n\t\t\tportalPathEn: special.location?.portalPathEn ?? '',\r\n\t\t},\r\n\t\tavatar: special.avatar,\r\n\t\toriginalAvatar: special.originalAvatar,\r\n\t};\r\n};\r\n\r\nexport const transformStoredItemToCartItem = (item: Item): CartItem => {\r\n\treturn {\r\n\t\tid: item.id,\r\n\t\tname: item.name || '',\r\n\t\tprice: item.price || 0,\r\n\t\toriginalPrice: item.originalPrice || 0,\r\n\t\tpath: item.path || '',\r\n\t\tdescription: item.description || '',\r\n\t\tlocationId: item.locationId || null,\r\n\t\tlocation: item.location || { id: 0, nameEn: '', nameEs: '' },\r\n\t\tavatar: item.avatar || '',\r\n\t\toriginalAvatar: item.originalAvatar || '',\r\n\t\tquantity: item.quantity,\r\n\t\titemTotal: item.itemTotal,\r\n\t};\r\n};\r\n","export const STORAGE_KEYS = {\r\n\tCHECKOUT_UID: 'checkout-uid',\r\n};\r\n","import { BaseUser } from '@common/react/objects/BaseUser';\r\nimport { Nullable } from '@common/typescript/objects/Nullable';\r\n\r\nimport { Gender } from '@commonTuna/react/objects/Enums';\r\n\r\nimport { Insurance } from '@app/objects/Insurance';\r\nimport { DrivingLicense } from '@app/objects/DrivingLicense';\r\nimport { Suffix } from '@app/objects/Suffix';\r\nimport { MarriageStatus } from '@app/objects/MarriageStatus';\r\nimport { PatientLocation } from '@app/objects/PatientLocation';\r\n\r\nexport enum UserRole {\r\n\tAdmin = 1,\r\n\tUser = 2,\r\n\tSupport = 3\r\n}\r\n\r\nexport const UserRoleNames = {\r\n\t[UserRole.Admin]: 'Admin',\r\n\t[UserRole.User]: 'User',\r\n\t[UserRole.Support]: 'Support',\r\n};\r\n\r\nexport interface User extends BaseUser {\r\n\tavatar: string;\r\n\toriginalAvatar: string;\r\n\r\n\trole: UserRole;\r\n\r\n\tsuffix: Suffix;\r\n\tfirstName: string;\r\n\tlastName: string;\r\n\temail: string;\r\n\tbirthDate: Nullable;\r\n\tgender: Nullable;\r\n\tphoneNumber: string;\r\n\r\n\tmarriageStatus: MarriageStatus;\r\n\r\n\temergencyContactName: string;\r\n\temergencyContactPhone: string;\r\n\temergencyContactRelation: string;\r\n\r\n\taddress: string;\r\n\tcity: string;\r\n\tregion: string;\r\n\tzip: string;\r\n\r\n\tinsurances: Array;\r\n\tpatientLocations: Array;\r\n\r\n\tdrivingLicenses: Array;\r\n\r\n\tallowEmail: boolean;\r\n\tallowSms: boolean;\r\n\tallowCalls: boolean;\r\n\tallowPush: boolean;\r\n\tagreementForSignUp: boolean;\r\n\r\n\temailConfirmed: boolean;\r\n\r\n\tenableSounds: boolean;\r\n\tbrowserNotifications: boolean;\r\n\tcompletedRegistration: boolean;\r\n\tcolor: string | null;\r\n\tlastLoggedIn?: number;\r\n\ttime: number;\r\n\r\n\tbaseUtcOffset: string;\r\n\r\n\tethnicityId: Nullable;\r\n}\r\n\r\nexport interface RegistrationUser extends User {\r\n\tpassword: string;\r\n\trepeatPassword: string;\r\n\tcaptcha?: string;\r\n}\r\n","import * as React from 'react';\r\nimport { Switch } from 'react-router-dom';\r\n\r\nimport loadable from '@loadable/component';\r\nimport 'regenerator-runtime/runtime';\r\n\r\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\r\nimport NotFoundRoute from '@common/react/components/Routes/NotFoundRoute';\r\n\r\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\r\n\r\nimport DashboardRoute from '@app/components/Routes/DashboardRoute';\r\nimport RouteWithFooter from '@app/components/Routes/RouteWithFooter';\r\nimport Layout from '@app/components/Layout';\r\n\r\nconst params = {\r\n\tfallback: ,\r\n};\r\n\r\n/* --------------Admin---------------*/\r\nconst Profile = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ProfilePage\" */\r\n\t\t'@app/components/Pages/Profile'\r\n\t)), params);\r\nconst Dashboard = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"DashboardPage\" */\r\n\t\t'@app/components/Pages/Admin/Dashboard/Dashboard'\r\n\t)), params);\r\nconst ChatsPage = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ChatsPage\" */\r\n\t\t'@app/components/Pages/Admin/Chats/Chats'\r\n\t)), params);\r\nconst Questionnaires = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"QuestionnairesPage\" */\r\n\t\t'@app/components/Pages/Admin/Invites/Questionnaires'\r\n\t)), params);\r\nconst ConsentForms = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ConsentFormsPage\" */\r\n\t\t'@app/components/Pages/Admin/Invites/ConsentForms'\r\n\t)), params);\r\nconst Instructions = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"InstructionsPage\" */\r\n\t\t'@app/components/Pages/Admin/Invites/Instructions'\r\n\t)), params);\r\nconst Analyzes = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"AnalyzesPage\" */\r\n\t\t'@app/components/Pages/Admin/Analyzes/Analyzes'\r\n\t)), params);\r\nconst Appointments = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"AppointmentsPage\" */\r\n\t\t'@app/components/Pages/Admin/Appointments/Appointments'\r\n\t)), params);\r\nconst AppointmentViewer = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"AppointmentViewerPage\" */\r\n\t\t'@app/components/Pages/Admin/Appointments/Appointment'\r\n\t)), params);\r\nconst Documents = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"DocumentsPage\" */\r\n\t\t'@app/components/Pages/Admin/Documents/Documents'\r\n\t)), params);\r\nconst Doctors = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"SearchPage\" */\r\n\t\t'@app/components/Pages/Doctors'\r\n\t)), params);\r\nconst DoctorListPage = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"DoctorListPage\" */\r\n\t\t'@app/components/Pages/Admin/DoctorListPage/DoctorListPage'\r\n\t)), params);\r\nconst Prescriptions = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"DocumentsPage\" */\r\n\t\t'@app/components/Pages/Admin/Prescriptions/Prescriptions'\r\n\t)), params);\r\nconst Users = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Users\" */\r\n\t\t'@app/components/Pages/Admin/Users/Users'\r\n\t)), params);\r\nconst ShortLinks = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ShortLinks\" */\r\n\t\t'@app/components/Pages/Admin/ShortLinks/ShortLinks'\r\n\t)), params);\r\nconst AuthLinks = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"AuthLinks\" */\r\n\t\t'@common/react/components/Pages/AuthLinks/AuthLinks'\r\n\t)), params);\r\nconst AuthLinksFilters = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"AuthLinksFilters\" */\r\n\t\t'@commonTuna/react/components/Pages/Admin/AuthLinks/AuthLinksFilters'\r\n\t)), params);\r\nconst UserSessions = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"UserSessions\" */\r\n\t\t'@app/components/Pages/Admin/UserSessions/UserSessions'\r\n\t)), params);\r\nconst Notifications = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"NotificationsPage\" */\r\n\t\t'@app/components/Pages/Admin/Notifications/Notifications'\r\n\t)), params);\r\nconst Pages = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"PagesPage\" */\r\n\t\t'@app/components/Pages/Admin/Pages/Pages'\r\n\t)), params);\r\nconst PageEditor = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"PageEditorPage\" */\r\n\t\t'@app/components/Pages/Admin/Pages/PageEditor'\r\n\t)), params);\r\nconst Orders = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"OrdersPage\" */\r\n\t\t'@app/components/Pages/Admin/Orders/Orders'\r\n\t)), params);\r\nconst Inquiries = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Inquiries\" */\r\n\t\t'@app/components/Pages/Admin/Inquiries/Inquiries'\r\n\t)), params);\r\nconst Bills = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"BillsPage\" */\r\n\t\t'@app/components/Pages/Admin/Bills/Bills'\r\n\t)), params);\r\nconst Checkout = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"CheckoutPage\" */\r\n\t\t'@app/components/Pages/Admin/Checkout/Checkout'\r\n\t)), params);\r\nconst EmailTemplates = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"EmailTemplatesPage\" */\r\n\t\t'@app/components/Pages/Admin/EmailTemplates/EmailTemplates'\r\n\t)), params);\r\nconst MarketingEmails = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"MarketingEmailsPage\" */\r\n\t\t'@app/components/Pages/Admin/MarketingEmails/MarketingEmails'\r\n\t)), params);\r\nconst SmsLogs = loadable(\r\n\t() =>\r\n\t\tloadableDelay(import(/* webpackChunkName: \"SmsLogs\" */\r\n\t\t\t'@commonTuna/react/components/Pages/Admin/SmsLogs/SmsLogs'\r\n\t\t)),\r\n\tparams,\r\n);\r\nconst EmailLogs = loadable(\r\n\t() =>\r\n\t\tloadableDelay(import(/* webpackChunkName: \"EmailLogs\" */\r\n\t\t\t'@commonTuna/react/components/Pages/Admin/EmailLogs/EmailLogs'\r\n\t\t)),\r\n\tparams,\r\n);\r\nconst Ordering = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Ordering\" */\r\n\t\t'@app/components/Pages/Admin/Ordering/Ordering'\r\n\t)), params);\r\nconst BaseHostedServices = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"BaseHostedServicesPage\" */\r\n\t\t'@app/components/Pages/Admin/BaseHostedServices/BaseHostedServices'\r\n\t)), params);\r\n\r\n/* ------------Admin end-------------*/\r\n\r\nconst Home = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Home\" */\r\n\t\t'@app/components/Pages/Home/Home'\r\n\t)), params);\r\nconst Login = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"LoginPage\" */\r\n\t\t'@app/components/Pages/Login/Login'\r\n\t)), params);\r\nconst Recover = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"RecoverPage\" */\r\n\t\t'@app/components/Pages/Recover/Recover'\r\n\t)), params);\r\nconst Confirm = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ConfirmPage\" */\r\n\t\t'@app/components/Pages/Confirm/Confirm'\r\n\t)), params);\r\nconst ContactSupport = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ContactSupportPage\" */\r\n\t\t'@app/components/Pages/ContactSupport/ContactSupport'\r\n\t)), params);\r\nconst Register = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"RegisterPage\" */\r\n\t\t'@app/components/Pages/Register/Register'\r\n\t)), params);\r\nconst Confirmation = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ConfirmationPage\" */\r\n\t\t'@app/components/Pages/Confirmation/Confirmation'\r\n\t)), params);\r\nconst ChangeEmailConfirmation = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ChangeEmailConfirmation\" */\r\n\t\t'@app/components/Pages/Register/ChangeEmailConfirmation'\r\n\t)), params);\r\nconst CompanyPortalComponent = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"PortalFromBBY\" */\r\n\t\t'@app/components/Pages/FromBBY/CompanyPortal'\r\n\t)), params);\r\nconst DoctorPortalComponent = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"DoctorPortalComponent\" */\r\n\t\t'@app/components/Pages/DoctorPortal'\r\n\t)), params);\r\nconst DoctorReview = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"DoctorPortalComponent\" */\r\n\t\t'@app/components/Pages/DoctorReview'\r\n\t)), params);\r\nconst Specialties = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Specialties\" */\r\n\t\t'@app/components/Pages/Specialties/Specialties'\r\n\t)), params);\r\nconst Locations = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Specialties\" */\r\n\t\t'@app/components/Pages/Region/Regions'\r\n\t)), params);\r\nconst Location = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Specialties\" */\r\n\t\t'@app/components/Pages/Region/Region'\r\n\t)), params);\r\nconst Specialty = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Specialty\" */\r\n\t\t'@app/components/Pages/Specialties/Specialty'\r\n\t)), params);\r\nconst Specials = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Specials\" */\r\n\t\t'@app/components/Pages/Specials/Specials'\r\n\t)), params);\r\nconst Special = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Special\" */\r\n\t\t'@app/components/Pages/Specials/Special'\r\n\t)), params);\r\nconst Product = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Product\" */\r\n\t\t'@app/components/Pages/Products/Product'\r\n\t)), params);\r\nconst Procedures = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Procedures\" */\r\n\t\t'@app/components/Pages/Procedures/Procedures'\r\n\t)), params);\r\nconst ProcedurePage = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ProcedurePage\" */\r\n\t\t'@app/components/Pages/Procedures/ProcedurePage'\r\n\t)), params);\r\nconst PrivacyPolicy = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"PrivacyPolicy\" */\r\n\t\t'@app/components/Pages/PrivacyPolicy/PrivacyPolicy'\r\n\t)), params);\r\nconst Inquiry = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"Inquiry\" */\r\n\t\t'@app/components/Pages/Inquiry/Inquiry'\r\n\t)), params);\r\nconst ExpiredLink = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ExpiredLink\" */\r\n\t\t'@app/components/Pages/ExpiredLink/ExpiredLink'\r\n\t)), params);\r\nconst ShoppingCart = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ShoppingCart\" */\r\n\t\t'@app/components/Pages/ShoppingCart/ShoppingCart'\r\n\t)), params);\r\nconst QuickPay = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"QuickPayPage\" */\r\n\t\t'@app/components/Pages/QuickPay/QuickPay'\r\n\t)), params);\r\nconst ErrorPage = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ErrorPage\" */ '@common/react/components/Pages/ErrorPage/ErrorPage')), params);\r\nconst PaymentsProcessing = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"PaymentsProcessing\" */\r\n\t\t'@app/components/Pages/PaymentsProcessing/PaymentsProcessing'\r\n\t)), params);\r\nconst Clinics = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ClinicsPage\" */\r\n\t\t'@app/components/Pages/Clinics/Clinics'\r\n\t)), params);\r\nconst ClinicPortalComponent = loadable(() =>\r\n\tloadableDelay(import(/* webpackChunkName: \"ClinicPage\" */\r\n\t\t'@app/components/Pages/Clinics/ClinicPortalComponent'\r\n\t)), params);\r\n\r\nexport const routes = (\r\n\t\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t } />} title=\"Auth Links\" />\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t \r\n );\r\n","import { Action, Reducer, ActionCreatorsMapObject } from 'redux';\r\n\r\nimport { AppThunkAction } from '@app/store/index';\r\n\r\n/* interface AppointmentInvitesCounters {\r\n\tappointmentId: number;\r\n\tnotAnsweredInvitesCount: number;\r\n\tnotReadInstructionsCount: number;\r\n} */\r\n\r\nexport interface CountersState {\r\n\tnotViewedDocumentsCount: number;\r\n\tnotAnsweredDiseasesCount: number;\r\n\tnotAnsweredConsentsCount: number;\r\n\tnotReadInstructionsCount: number;\r\n\tnotViewedPrescriptionsCount: number;\r\n\tnotPaidBillItemsCount: number;\r\n\r\n\ttotalDocumentsCount: number;\r\n\ttotalDiseasesCount: number;\r\n\ttotalConsentsCount: number;\r\n\ttotalInstructionsCount: number;\r\n\ttotalPrescriptionsCount: number;\r\n\ttotalBillItemsCount: number;\r\n}\r\n\r\nexport enum CountersTypeKeys {\r\n\tSET_COUNTERS_STATE = 'SET_COUNTERS_STATE',\r\n\tUPDATE_COUNTERS = 'UPDATE_COUNTERS'\r\n}\r\n\r\nexport interface SetCountersState {\r\n\ttype: CountersTypeKeys.SET_COUNTERS_STATE;\r\n\tpayload: CountersState;\r\n}\r\n\r\ninterface UpdateCounters {\r\n\ttype: CountersTypeKeys.UPDATE_COUNTERS;\r\n\tdata: object;\r\n}\r\n\r\nexport type Actions = SetCountersState | UpdateCounters;\r\n\r\nexport interface CountersActionCreators extends ActionCreatorsMapObject {\r\n\tsetCountersState: (state: CountersState) => AppThunkAction;\r\n\tupdateCounters: (data: object) => AppThunkAction;\r\n}\r\n\r\nexport const countersActionCreators = {\r\n\tsetCountersState: (state: CountersState): AppThunkAction => (dispatch, getState) => {\r\n\t\tdispatch({ type: CountersTypeKeys.SET_COUNTERS_STATE, payload: { ...state } });\r\n\t},\r\n\tupdateCounters: (data: object): AppThunkAction => (dispatch, getState) => {\r\n\t\tdispatch({ type: CountersTypeKeys.UPDATE_COUNTERS, data });\r\n\t},\r\n};\r\n\r\nconst initialState = {\r\n\tnotViewedDocumentsCount: 0,\r\n\tnotAnsweredDiseasesCount: 0,\r\n\tnotAnsweredConsentsCount: 0,\r\n\tnotReadInstructionsCount: 0,\r\n\tnotViewedPrescriptionsCount: 0,\r\n\tnotPaidBillItemsCount: 0,\r\n\ttotalDocumentsCount: 0,\r\n\ttotalDiseasesCount: 0,\r\n\ttotalConsentsCount: 0,\r\n\ttotalInstructionsCount: 0,\r\n\ttotalPrescriptionsCount: 0,\r\n\ttotalBillItemsCount: 0,\r\n};\r\n\r\nexport const reducer: Reducer = (\r\n\tstate: CountersState = initialState,\r\n\tincomingAction: Action,\r\n) => {\r\n\tconst action = incomingAction as Actions;\r\n\tswitch (action.type) {\r\n\t\tcase CountersTypeKeys.SET_COUNTERS_STATE:\r\n\t\t\treturn { ...action.payload };\r\n\t\tcase CountersTypeKeys.UPDATE_COUNTERS:\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t...action.data,\r\n\t\t\t};\r\n\t\tdefault:\r\n\t\t\treturn state;\r\n\t}\r\n};\r\n","import { TypeKeys as ItemsKeys, InitStorageAction } from '@common/react/store/ItemList';\r\nimport {\r\n\tTypeKeys as ItemKeys, InitStorageAction as ItemInitStorageAction, InitStorageAction as InitStorageItemAction, TypeKeys as ItemTypeKeys,\r\n} from '@common/react/store/Item';\r\n\r\nimport { BaseInvite } from '@commonTuna/react/objects/BaseInvite';\r\n\r\nimport { Init } from '@app/objects/Init';\r\nimport { SetCountersState, CountersTypeKeys } from '@app/store/Counters';\r\nimport { SearchFilterTypeKeys, SetSearchFilterState } from '@app/store/SearchFilter';\r\n\r\nexport const customReduxActions = (dispatch, init: Init) => {\r\n\tconst buildDataAction: InitStorageItemAction = {\r\n\t\ttype: ItemTypeKeys.INITSTORAGE,\r\n\t\tstorageName: 'buildData',\r\n\t\titem: {\r\n\t\t\tbuildNumber: init.buildNumber,\r\n\t\t\tbuildDate: init.buildDate,\r\n\t\t\tmaxNameLength: init.maxNameLength,\r\n\t\t\t...(init as any),\r\n\t\t},\r\n\t};\r\n\r\n\tdispatch(buildDataAction);\r\n\r\n\tif (init.companyTemplateInvites) {\r\n\t\tconst companyTemplateInvitesAction: InitStorageAction = {\r\n\t\t\ttype: ItemsKeys.INITSTORAGE,\r\n\t\t\tstorageName: 'companyTemplateInvites',\r\n\t\t\titems: init.companyTemplateInvites,\r\n\t\t\ttotal: init.companyTemplateInvites.length,\r\n\t\t\tobjectType: 'invite',\r\n\t\t\tparams: {},\r\n\t\t};\r\n\r\n\t\tdispatch(companyTemplateInvitesAction);\r\n\t}\r\n\r\n\tif (init.userRegistrationSteps) {\r\n\t\tconst userRegistrationStepsAction: ItemInitStorageAction = {\r\n\t\t\ttype: ItemKeys.INITSTORAGE,\r\n\t\t\tstorageName: 'userRegistrationSteps',\r\n\t\t\titem: init.userRegistrationSteps,\r\n\t\t};\r\n\r\n\t\tdispatch(userRegistrationStepsAction);\r\n\t}\r\n\r\n\tif (init.counters) {\r\n\t\tconst countersAction: SetCountersState = {\r\n\t\t\ttype: CountersTypeKeys.SET_COUNTERS_STATE,\r\n\t\t\tpayload: init.counters,\r\n\t\t};\r\n\r\n\t\tdispatch(countersAction);\r\n\t}\r\n\r\n\tif (init.searchFilterData) {\r\n\t\tconst searchFilterAction: SetSearchFilterState = {\r\n\t\t\ttype: SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE,\r\n\t\t\tpayload: init.searchFilterData,\r\n\t\t};\r\n\r\n\t\tdispatch(searchFilterAction);\r\n\t}\r\n\r\n\tif (init.hostOptions) {\r\n\t\tconst hostOptionsAction: InitStorageItemAction = {\r\n\t\t\ttype: ItemTypeKeys.INITSTORAGE,\r\n\t\t\tstorageName: 'hostOptions',\r\n\t\t\titem: init.hostOptions,\r\n\t\t};\r\n\r\n\t\tdispatch(hostOptionsAction);\r\n\t}\r\n};\r\n","export const SET_PATIENT_LOCATION = 'SET_PATIENT_LOCATION';\r\nexport const SET_SEARCH_STATE = 'SET_SEARCH_STATE';\r\n","import { Action, ActionCreatorsMapObject, Reducer } from 'redux';\r\n\r\nimport { BaseAppThunkAction } from '@common/react/store';\r\n\r\nimport { SET_SEARCH_STATE } from '@app/store/constants';\r\nimport { User } from '@app/objects/User';\r\nimport { ApplicationState } from '@app/store/index';\r\n\r\nexport interface HeaderState {\r\n\tdoctorId?: number;\r\n\tglobalProcedureId?: number;\r\n\tspecialtyId?: number;\r\n\tglobalPayerId?: number;\r\n\ttext?: string;\r\n\tlocationId?: number;\r\n\tlanguageIds?: Array;\r\n\tfrom?: number | null;\r\n\tglobalProcedureIds?: Array;\r\n\tspecialtyIds?: Array;\r\n\tcertificateIds?: Array;\r\n\tgender?: number;\r\n}\r\n\r\ninterface SetAction extends Action {\r\n\tpayload: HeaderState;\r\n}\r\n\r\nexport interface HeaderActionCreators extends ActionCreatorsMapObject {\r\n\tsetState: (state: HeaderState) => BaseAppThunkAction;\r\n}\r\n\r\nexport const actionCreators: HeaderActionCreators = {\r\n\tsetState: (state: HeaderState) => (dispatch) => {\r\n\t\tdispatch({\r\n\t\t\ttype: SET_SEARCH_STATE,\r\n\t\t\tpayload: { ...state },\r\n\t\t});\r\n\t},\r\n};\r\n\r\nconst initialState = {};\r\n\r\nexport const reducer: Reducer = (state: HeaderState = initialState, action: Action) => {\r\n\tswitch (action.type) {\r\n\t\tcase SET_SEARCH_STATE:\r\n\t\t\treturn { ...(action as SetAction).payload };\r\n\t}\r\n\r\n\treturn state;\r\n};\r\n","import { BaseUser } from '@common/react/objects/BaseUser';\r\nimport {\r\n\tLoginState as BaseLoginState,\r\n\tLoginActionCreators as BaseLoginActionCreators,\r\n\tgetActionCreators as baseGetActionCreators,\r\n\tgetReducer as baseGetReducer,\r\n} from '@common/react/store/Login';\r\n\r\nimport { User } from '@app/objects/User';\r\nimport { ApplicationState } from '@app/store/index';\r\n\r\nexport { TypeKeys } from '@common/react/store/Login';\r\n\r\nexport type LoginState = BaseLoginState\r\n\r\nexport type LoginActionCreators = BaseLoginActionCreators\r\n\r\nexport function getActionCreators() {\r\n\treturn baseGetActionCreators();\r\n}\r\n\r\nexport function getReducer() {\r\n\treturn baseGetReducer();\r\n}\r\n","import { Action, Reducer, ActionCreatorsMapObject } from 'redux';\r\n\r\nimport { Language } from '@commonTuna/react/objects/Language';\r\nimport { Certificate } from '@commonTuna/react/objects/Certificate';\r\n\r\nimport { AppThunkAction } from '@app/store/index';\r\n\r\nexport interface SearchFilterState {\r\n\tlocationName: string;\r\n\tglobalPayerName: string;\r\n\tspecialtyName?: string;\r\n\tdoctorName?: string;\r\n\tglobalProcedureName?: string;\r\n\tglobalProcedures?: Array;\r\n\tspecialties?: Array;\r\n\tlanguages: Array;\r\n\tcertificates: Array;\r\n}\r\n\r\nexport enum SearchFilterTypeKeys {\r\n\tSET_SEARCH_FILTER_STATE = 'SET_SEARCH_FILTER_STATE',\r\n\tUPDATE_SEARCH_FILTER = 'UPDATE_SEARCH_FILTER'\r\n}\r\n\r\nexport interface SetSearchFilterState {\r\n\ttype: SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE;\r\n\tpayload: SearchFilterState;\r\n}\r\n\r\ninterface UpdateSearchFilter {\r\n\ttype: SearchFilterTypeKeys.UPDATE_SEARCH_FILTER;\r\n\tdata: object;\r\n}\r\n\r\nexport type Actions = SetSearchFilterState | UpdateSearchFilter;\r\n\r\nexport interface SearchFilterActionCreators extends ActionCreatorsMapObject {\r\n\tsetSearchFilterState: (state: SearchFilterState) => AppThunkAction;\r\n\tupdateSearchFilter: (data: object) => AppThunkAction;\r\n}\r\n\r\nexport const searchFilterActionCreators = {\r\n\tsetSearchFilterState: (state: SearchFilterState): AppThunkAction => (dispatch, getState) => {\r\n\t\tdispatch({ type: SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE, payload: { ...state } });\r\n\t},\r\n\tupdateSearchFilter: (data: object): AppThunkAction => (dispatch, getState) => {\r\n\t\tdispatch({ type: SearchFilterTypeKeys.UPDATE_SEARCH_FILTER, data });\r\n\t},\r\n};\r\n\r\nconst initialState = {\r\n\tlocationName: '',\r\n\tglobalPayerName: '',\r\n\tspecialtyName: '',\r\n\tdoctorName: '',\r\n\tglobalProcedureName: '',\r\n\tglobalProcedures: [],\r\n\tspecialties: [],\r\n\tlanguages: [],\r\n\tcertificates: [],\r\n};\r\n\r\nexport const reducer: Reducer = (\r\n\tstate: SearchFilterState = initialState,\r\n\tincomingAction: Action,\r\n) => {\r\n\tconst action = incomingAction as Actions;\r\n\tswitch (action.type) {\r\n\t\tcase SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE:\r\n\t\t\treturn { ...action.payload };\r\n\t\tcase SearchFilterTypeKeys.UPDATE_SEARCH_FILTER:\r\n\t\t\treturn {\r\n\t\t\t\t...state,\r\n\t\t\t\t...action.data,\r\n\t\t\t};\r\n\t\tdefault:\r\n\t\t\treturn state;\r\n\t}\r\n};\r\n","import { fetch } from 'domain-task';\r\n\r\nimport { BaseApplicationState } from '@common/react/store';\r\nimport { BaseUser } from '@common/react/objects/BaseUser';\r\nimport { BaseParams } from '@common/typescript/objects/BaseParams';\r\n\r\ninterface Message {\r\n\tsuccess: number;\r\n\tresponse: T;\r\n\tsession: string;\r\n}\r\n\r\nexport interface ResponseError {\r\n\tmessage: string;\r\n\tcode: number;\r\n\tname?: string;\r\n}\r\n\r\nfunction baseRequest<\r\n\tT,\r\n\tTUser extends BaseUser,\r\n\tTApplicationState extends BaseApplicationState\r\n>(type: string, data: BaseParams = {}, state?: TApplicationState, signal?: AbortSignal): Promise {\r\n\treturn fetch('api/post', {\r\n\t\tcredentials: 'same-origin',\r\n\t\tmethod: 'POST',\r\n\t\theaders: {\r\n\t\t\t'Content-type': 'application/json; charset=utf-8',\r\n\t\t\tCookie: `session=${state ? state.login.session : ''}`,\r\n\t\t},\r\n\t\tbody: JSON.stringify({\r\n\t\t\ttype,\r\n\t\t\tdata: JSON.stringify(data),\r\n\t\t}),\r\n\t\tsignal,\r\n\t})\r\n\t\t.then((response) => response.json() as Message)\r\n\t\t.then((data: Message) => {\r\n\t\t\tif (!data.success) {\r\n\t\t\t\tthrow data.response as ResponseError;\r\n\t\t\t}\r\n\r\n\t\t\treturn data.response as T;\r\n\t\t});\r\n}\r\n\r\nfunction request<\r\n\tT,\r\n\tTUser extends BaseUser,\r\n\tTApplicationState extends BaseApplicationState\r\n\t>(type: string, data: BaseParams = {}, state?: TApplicationState, signal?: AbortSignal): Promise {\r\n\treturn baseRequest(type, data, state, signal)\r\n\t\t.catch((error: ResponseError) => {\r\n\t\t\tif (error.name === 'AbortError') {\r\n\t\t\t\tthrow new Error('Aborted');\r\n\t\t\t}\r\n\t\t\tif (error.message === 'Access denied' && window) {\r\n\t\t\t\twindow.location.href = '/';\r\n\t\t\t}\r\n\r\n\t\t\tconsole.log(error.message);\r\n\t\t\tthrow error.message as string;\r\n\t\t});\r\n}\r\n\r\nexport { baseRequest, request };\r\n","import * as React from 'react';\r\n\r\nimport { FormikProps } from 'formik';\r\nimport { MentionProps } from 'antd';\r\n\r\nimport { List } from '@common/typescript/objects/List';\r\nimport { BaseUser, BaseUserWithAvatar } from '@common/react/objects/BaseUser';\r\nimport { Nullable } from '@common/typescript/objects/Nullable';\r\nimport { File, FileInterface } from '@common/typescript/objects/FileInterface';\r\nimport { ButtonsProps, ChatFormComponentState } from '@common/react/components/Chat/ChatMessageForm';\r\nimport { Notification } from '@common/typescript/objects/Notification';\r\nimport { ApplicationStateWithChats, ChatsActionCreators } from '@common/react/components/Chat/Store/Chats';\r\n\r\nexport enum ChatMessageType {\r\n\tRegular = 0,\r\n\tVoiceMessage = 1,\r\n\tEmail = 2,\r\n\tPhoneCall = 3,\r\n\tVideoChat = 4,\r\n\tVideoMessage = 5,\r\n\tSticker = 6,\r\n\tGiphy = 7,\r\n\tTenor = 8,\r\n\tForwardedMessage = 9,\r\n\tReplyMessage = 10,\r\n}\r\n\r\nexport enum ChatRoomType {\r\n\tVideo,\r\n\tAudio\r\n}\r\n\r\nexport enum ChatKind\r\n{\r\n\tPersonal,\r\n\tConference,\r\n\tGroup,\r\n\tHelp,\r\n\tSos\r\n}\r\n\r\nexport interface Chat {\r\n\tid: number;\r\n\tkind: ChatKind;\r\n\ttime: number;\r\n\tname: string;\r\n\tcontacts: Array;\r\n\tcontactsIds: Array;\r\n\tmessages: List;\r\n\tlastMessage: Nullable;\r\n\tunviewedMessagesCount: number;\r\n\tuserId: number;\r\n\tarchive?: boolean;\r\n}\r\n\r\nexport enum ChatPlugins {\r\n\tRegular = 0,\r\n\tVoiceMessage = 1,\r\n\tEmail = 2,\r\n\tPhoneCall = 3,\r\n\tVideoChat = 4,\r\n\tVideoMessage = 5,\r\n\tSticker = 6,\r\n\tGiphy = 7,\r\n\tTenor = 8,\r\n\tForward = 9,\r\n\tReply = 10,\r\n\tEdit = 16,\r\n\tDeleted = 17,\r\n\tVoiceCall = 18,\r\n\tTyping = 26,\r\n\tFiles = 27,\r\n\tEmoji = 28,\r\n\tMentions = 29,\r\n\tReactions = 30,\r\n\tLinkPreview = 31,\r\n\tLinkPreviewGroup = 32,\r\n\tColorBox = 33,\r\n\tSearching = 34,\r\n\tArchive = 35,\r\n\tAddChat = 36,\r\n\tOnlineFilter = 37,\r\n\tAllChats = 38,\r\n\tCompleteChat = 39,\r\n\tLeaveChat = 40,\r\n\tChatNameEditor = 41,\r\n\tCopy = 42,\r\n\tModalPlugin = 44,\r\n\tTemplate = 45,\r\n\tAdaptiveCards = 46,\r\n}\r\n\r\nexport interface ChatPlugin {\r\n\tformButton?: (formikBag: FormikProps, props: ChatFormButtonsProps) => React.ReactNode;\r\n\tformComponent?: (props: MentionProps) => React.ReactNode;\r\n\tmessageControlWrapper?: ({ chat, render }) => React.ReactNode;\r\n\tlistComponent?: (props) => React.ReactNode;\r\n\tadditionalComponent?: (props) => React.ReactNode;\r\n\tmessage?: {\r\n\t\trender: ({\r\n\t\t\tmessage, contacts, withRemoteId, onMouseEnter, lastVideoCallId, onImageClick,\r\n\t\t}) => React.ReactNode;\r\n\t\tlastMessage?: ({ message, chat, userId }) => React.ReactNode;\r\n\t\tnotification?: ({ message, withRemoteId, contacts }) => React.ReactNode;\r\n\t};\r\n\tformTag?: (formikBag: FormikProps, { state, setState, waveColor }) => React.ReactNode;\r\n\tmessagesHeaderAction?:\r\n\t\t({\r\n\t\t\tcurrentChat,\r\n\t\t\tuser,\r\n\t\t\tleaveChat,\r\n\t\t\thistory,\r\n\t\t\tpatientId,\r\n\t\t\tstate,\r\n\t\t\tcompleteChat,\r\n\t\t\twithRemoteId,\r\n\t\t\tactions,\r\n\t\t\tstorageName,\r\n\t\t} : {\r\n\t\t\tcurrentChat,\r\n\t\t\tuser,\r\n\t\t\tleaveChat,\r\n\t\t\thistory,\r\n\t\t\tpatientId,\r\n\t\t\tstate,\r\n\t\t\tcompleteChat,\r\n\t\t\twithRemoteId,\r\n\t\t\tactions: ChatsActionCreators>,\r\n\t\t\tstorageName\r\n\t\t}) => React.ReactNode;\r\n\tchatMessageAction?: ({\r\n\t\tedit, remove, isEdit, message, update, fromUser, options, reply,\r\n\t}) => React.ReactNode;\r\n\tchatsListHeaderComponent?: ({\r\n\t\tfilters, handleChange, selectChat, pageSettings, user,\r\n\t}) => React.ReactNode;\r\n\tonMessageListClick?: (e, chat: Chat) => void;\r\n\tmessageAttachment?: (message) => React.ReactNode;\r\n\tnotificationHandler?: (\r\n\t\tnotification: Notification,\r\n\t\tstoreName: string,\r\n\t\tactions: ChatsActionCreators>,\r\n\t\toptions: any // plugin options\r\n\t) => void;\r\n\toptions?: any;\r\n}\r\n\r\nexport type ChatListHeaderSettingsType = Array React.ReactNode)>;\r\n\r\ntype CustomComponent = (({\r\n\tcurrentChat, user, leaveChat, history, patientId, state, completeChat, withRemoteId, actions,\r\n}) => React.ReactNode);\r\n\r\nexport type ChatMessagesHeaderSettingsType = Array;\r\n\r\nexport type ChatNameType = ({\r\n\tcurrentChat, user, withRemoteId, patientId,\r\n}) => React.ReactNode;\r\n\r\nexport interface EmojiReaction {\r\n\tid: number;\r\n\tuserId: number;\r\n\tuser: BaseUserWithAvatar;\r\n\tobjectId: number;\r\n\tobject: ChatMessage;\r\n\treaction: string;\r\n\tanimate?: boolean;\r\n}\r\n\r\nexport interface ChatMessage {\r\n\tid: number;\r\n\ttext: string;\r\n\tchatId: number;\r\n\tchat?: Chat;\r\n\tuserId: number;\r\n\tuser?: BaseUserWithAvatar;\r\n\ttime: number;\r\n\tmessageViewers: Array;\r\n\tviewed: boolean;\r\n\tviewLoading?: boolean;\r\n\tfiles: Array;\r\n\temojiReactions: Array;\r\n\tchatMessageType: ChatMessageType;\r\n\tchatRoomType?: ChatRoomType;\r\n\tinnerChatMessageId: Nullable;\r\n\tinnerChatMessage: Nullable;\r\n}\r\n\r\nexport interface ChatMessageAccess {\r\n\tchatMessageObject?: ChatMessage;\r\n\tid: number;\r\n\tmessage: number;\r\n\ttime: number;\r\n\tuser?: BaseUserWithAvatar;\r\n\tuserId: number;\r\n\tviewed: boolean;\r\n}\r\n\r\nexport interface ChatUser {\r\n\tid: number;\r\n\tchatId: number;\r\n\tuserId: number;\r\n\tuser?: BaseUserWithAvatar;\r\n\tchat?: Chat;\r\n}\r\n\r\nexport interface NewMessage {\r\n\tid: number;\r\n\ttext: string;\r\n\tchatId: number;\r\n\r\n\tbytes: Array;\r\n\tfiles: Array;\r\n\tattachments: Array;\r\n\tchatMessageType: ChatMessageType;\r\n\tinnerChatMessageId?: number;\r\n}\r\n\r\nexport interface ChatFormButtonsProps extends ButtonsProps {\r\n\tchat: Chat;\r\n\tisEditMessage?: boolean;\r\n\twaveColor?: string;\r\n\tsetState: React.Dispatch>;\r\n\tchatId?: number;\r\n\tgetPopupContainer?: (node) => HTMLElement;\r\n}\r\n\r\nexport type ChatFormButtonsWrappers = {\r\n\t[key in ChatPlugins]?: (children) => React.ReactNode;\r\n};\r\n\r\nexport type ChatFormButtonsComponents = ChatPlugins | ((formikBag: FormikProps, props: ChatFormButtonsProps) => React.ReactNode);\r\n\r\nexport enum ChatHeaderButtons {\r\n\tVoice,\r\n\tVideo,\r\n\tMail\r\n}\r\n\r\nexport enum StickerType {\r\n\tImage,\r\n\tGiphy\r\n}\r\n\r\nexport type ChatMessageActionsComponent = ChatPlugins\r\n\t| (({\r\n\t\tremove, update, edit, isEdit, message, fromUser, options,\r\n\t}) => React.ReactNode);\r\n\r\nexport type ChatOtherComponents = ChatPlugins | (({\r\n\tchat, defaultIdx, setImg, files, basePath,\r\n}) => React.ReactNode);\r\n\r\nexport interface ChatStickerCollectionItem {\r\n\timage: string;\r\n\tdescription?: string;\r\n\tfullImage?: string;\r\n}\r\n\r\nexport interface ChatStickerCollection {\r\n\titems: Array;\r\n\timage: string;\r\n\tdescription?: string;\r\n\tenable?: boolean;\r\n}\r\n","import * as React from 'react';\r\n\r\nimport Mentions from 'antd/lib/mentions';\r\nimport Tag from 'antd/lib/tag';\r\nimport {\r\n\tFieldProps, Form, Formik, FormikProps,\r\n} from 'formik';\r\nimport * as Yup from 'yup';\r\nimport VerticalAlignBottomOutlined from '@ant-design/icons/VerticalAlignBottomOutlined';\r\nimport message from 'antd/lib/message';\r\nimport Popover from 'antd/lib/popover';\r\n\r\nimport {\r\n\tChat,\r\n\tChatMessage,\r\n\tChatMessageType,\r\n\tNewMessage,\r\n} from '@common/react/components/Chat/Chat';\r\nimport Button from '@common/react/components/Forms/Button';\r\nimport FormikField from '@common/react/components/Forms/FormikField/FormikField';\r\nimport { getUserName } from '@common/react/utils/utils';\r\nimport { BaseUser, BaseUserWithAvatar } from '@common/react/objects/BaseUser';\r\nimport { FileInterface, FileType } from '@common/typescript/objects/FileInterface';\r\nimport FormikRef from '@common/react/components/Core/ItemEditor/FormikRef';\r\nimport { RecordResult } from '@common/react/utils/record-audio';\r\nimport { uploadFile } from '@common/react/components/Forms/Files/File';\r\nimport {\r\n\tuseChatSettingsProviderContext,\r\n} from '@common/react/components/Chat/ChatSettingsProvider';\r\nimport useRequest from '@common/react/hooks/useRequest';\r\nimport { imageExtensions } from '@common/react/components/Chat/Chats';\r\n\r\nexport interface ButtonsProps {\r\n\tonUploadFile: (file: FileInterface) => void;\r\n}\r\n\r\ninterface ComponentProps {\r\n\tchat: Chat;\r\n\teditMessage: ChatMessage | null;\r\n\tsetEdit: (message) => void;\r\n\tafterSubmit?: (message) => void;\r\n\tsendClassName?: string;\r\n\tonImageClick?: (e, file: FileInterface) => void;\r\n\tactionsInPopup?: boolean;\r\n\tfilesAfterButtons?: boolean;\r\n\tgetActionPopupContainer?: (node) => HTMLElement;\r\n\tgetUserAvatar?: (user) => React.ReactNode;\r\n\treplyMessage?: ChatMessage | null;\r\n\tsetReply?: (message) => void;\r\n}\r\n\r\ninterface ContactsHash {\r\n\t[index: number]: string;\r\n}\r\n\r\nexport interface ChatFormComponentState {\r\n\tisLoading: boolean;\r\n\tcontacts: ContactsHash;\r\n\r\n\trecordAudioResult: RecordResult | undefined;\r\n\trecordVideoResult: RecordResult | undefined;\r\n}\r\n\r\nconst getValidationSchema = (maxLength: number) => Yup.object().shape({\r\n\ttext: Yup.string().max(maxLength, `max characters count: ${maxLength}`),\r\n});\r\n\r\nconst transformContactsToHash = (contacts: Array) => contacts.reduce((map, obj) => {\r\n\tmap[obj.id] = getUserName(obj);\r\n\treturn map;\r\n}, {});\r\n\r\ninterface FilesProps {\r\n\tformikBag: FormikProps;\r\n\tonRemoveUploadedFile: (id, formikBag) => void;\r\n\tstate: ChatFormComponentState;\r\n\tsetState: React.Dispatch>;\r\n\tonImageClick?: (e, f) => void;\r\n}\r\n\r\nconst Files: React.FC = ({\r\n\tformikBag, onRemoveUploadedFile, onImageClick, state, setState,\r\n}) => {\r\n\tconst context = useChatSettingsProviderContext();\r\n\r\n\tif (!context?.state) throw 'need ChatSettingsContext';\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\tformSettings,\r\n\t\t\tformTags,\r\n\t\t\tplugins,\r\n\t\t},\r\n\t} = context;\r\n\tconst { waveColor } = formSettings;\r\n\r\n\treturn \r\n\t\t{formikBag.values.files\r\n\t\t\t.map((f) => (\r\n\t\t\t\t
onRemoveUploadedFile(f.id, formikBag)}\r\n\t\t\t\t\tclosable\r\n\t\t\t\t\tcloseIcon={ }\r\n\t\t\t\t>\r\n\t\t\t\t\t{imageExtensions.includes(f.extension?.toLowerCase())\r\n\t\t\t\t\t\t? (\r\n\t\t\t\t\t\t\t onImageClick && onImageClick(e, f)}\r\n\t\t\t\t\t\t\t\tclassName=\"chat-form-file-tag-image\"\r\n\t\t\t\t\t\t\t\tsrc={f.thumb}\r\n\t\t\t\t\t\t\t\talt={f.name}\r\n\t\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}\r\n\t\t\t\t\t \r\n\t\t\t\t\t{f.name} \r\n \r\n\t\t\t\t \r\n\t\t\t))\r\n\t\t}\r\n\t\t
\r\n\t\t\t{formTags.map((plugin) => \r\n\t\t\t\t{plugins[plugin]?.formTag?.(formikBag, { state, setState, waveColor })}\r\n\t\t\t )}\r\n\t\t \r\n\t
;\r\n};\r\n\r\nconst ChatMessageForm: React.FC = (props) => {\r\n\tconst {\r\n\t\tsendClassName = 'btn-primary', chat, onImageClick, editMessage, setEdit, actionsInPopup, filesAfterButtons,\r\n\t} = props;\r\n\tconst {\r\n\t\tgetActionPopupContainer, replyMessage, setReply, getUserAvatar,\r\n\t} = props;\r\n\tconst form = React.useRef | null>(null);\r\n\tconst request = useRequest();\r\n\r\n\tconst context = useChatSettingsProviderContext();\r\n\r\n\tif (!context?.state) throw 'need ChatSettingsContext';\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\tformButtons,\r\n\t\t\tchatFormButtonsWrappers,\r\n\t\t\trequests,\r\n\t\t\tformSettings,\r\n\t\t\terrorHandlers,\r\n\t\t\tplugins,\r\n\t\t\tmessageControl,\r\n\t\t\tmessageControlWrappers,\r\n\t\t},\r\n\t} = context;\r\n\tconst { maxAttachmentsCount, maxMessageLength, waveColor } = formSettings;\r\n\r\n\tconst [state, _setState] = React.useState({\r\n\t\tisLoading: false,\r\n\t\tcontacts: props.chat ? transformContactsToHash(props.chat.contacts) : {},\r\n\t\trecordAudioResult: undefined,\r\n\t\trecordVideoResult: undefined,\r\n\t});\r\n\tconst setState = React.useCallback((newState) => _setState((state) => ({ ...state, ...newState })), []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tsetState({\r\n\t\t\tcontacts: props.chat ? transformContactsToHash(props.chat.contacts) : {},\r\n\t\t});\r\n\t}, [props.chat]);\r\n\r\n\tconst handleSubmitForm = (values: NewMessage, { resetForm }) => {\r\n\t\tconst {\r\n\t\t\ttext, files, attachments, bytes,\r\n\t\t} = values;\r\n\r\n\t\tif (!(text.replace(/\\s/g, '') || files?.length || attachments?.length || bytes?.length)) return;\r\n\r\n\t\tsetState({\r\n\t\t\tisLoading: true,\r\n\t\t});\r\n\r\n\t\tconst item = values;\r\n\r\n\t\titem.chatId = props.chat.id;\r\n\t\titem.attachments = item.files.map((f) => f.id);\r\n\r\n\t\trequest(editMessage && requests.updateMessage ? requests.updateMessage : requests.chatMessage, item).then((result) => {\r\n\t\t\tsetState({\r\n\t\t\t\tisLoading: false,\r\n\t\t\t});\r\n\t\t\tresetForm();\r\n\t\t\t_setState((prev) => ({\r\n\t\t\t\t...prev,\r\n\t\t\t\trecordAudioResult: undefined,\r\n\t\t\t\trecordVideoResult: undefined,\r\n\t\t\t}));\r\n\t\t\tprops.afterSubmit && props.afterSubmit(result);\r\n\t\t\tif (editMessage) {\r\n\t\t\t\tsetEdit(null);\r\n\t\t\t}\r\n\t\t\tif (replyMessage) {\r\n\t\t\t\tsetReply && setReply(null);\r\n\t\t\t}\r\n\t\t}).catch((e) => {\r\n\t\t\t(errorHandlers?.onSaveMessageLoadError || message.error)(e);\r\n\t\t\tsetState({\r\n\t\t\t\tisLoading: false,\r\n\t\t\t});\r\n\t\t});\r\n\t};\r\n\r\n\tconst onUploadFile = (file: FileInterface, formikBag: FormikProps) => {\r\n\t\tformikBag.setValues((prev) => {\r\n\t\t\tconst nextFiles = formikBag.values.files.concat(file);\r\n\r\n\t\t\tif (nextFiles.length > maxAttachmentsCount) {\r\n\t\t\t\tmessage.info(`Max Attachment files count: ${maxAttachmentsCount}`);\r\n\t\t\t\treturn prev;\r\n\t\t\t}\r\n\r\n\t\t\treturn {\r\n\t\t\t\t...prev,\r\n\t\t\t\tfiles: prev.files.concat(file),\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\tconst onRemoveUploadedFile = (id: number, formikBag) => {\r\n\t\tformikBag.setValues((prev) => {\r\n\t\t\treturn {\r\n\t\t\t\t...prev,\r\n\t\t\t\tfiles: prev.files.filter((f) => f.id !== id),\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\tconst onKeyDown = (e: KeyboardEvent) => {\r\n\t\tconst formikBag = form.current;\r\n\r\n\t\tif (formikBag && e.ctrlKey && e.code === 'Enter') {\r\n\t\t\te.preventDefault();\r\n\t\t\tformikBag.submitForm();\r\n\t\t}\r\n\t};\r\n\r\n\tconst handlePaste = (e: React.ClipboardEvent, formikBag: FormikProps) => {\r\n\t\tconst items = Array.from(e.clipboardData.items).filter((x) => /^image\\//.test(x.type));\r\n\r\n\t\titems.forEach((item) => {\r\n\t\t\tconst blob = item?.getAsFile();\r\n\r\n\t\t\tuploadFile({\r\n\t\t\t\tfile: blob,\r\n\t\t\t\ttype: 'chatMessage',\r\n\t\t\t\tobjectId: -1,\r\n\t\t\t\tfileType: FileType.File,\r\n\t\t\t})\r\n\t\t\t\t.then((data) => onUploadFile(data, formikBag))\r\n\t\t\t\t.catch((err: any) => {\r\n\t\t\t\t\tmessage.error(typeof err === 'object' ? err.message : err);\r\n\t\t\t\t});\r\n\t\t});\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\tdocument.addEventListener('keydown', onKeyDown);\r\n\t\treturn () => document.removeEventListener('keydown', onKeyDown);\r\n\t}, []);\r\n\r\n\tconst MentionComponent = React.useMemo(() => {\r\n\t\treturn ({ placement, ...props }: any) => {\r\n\t\t\tconst mention = (onKeyDown) => {\r\n\t\t\t\tconst handleKeyDown = (e) => {\r\n\t\t\t\t\tonKeyDown && onKeyDown(e);\r\n\t\t\t\t\tprops.onKeyDown && props.onKeyDown(e);\r\n\t\t\t\t};\r\n\t\t\t\treturn messageControl && plugins[messageControl]?.formComponent\r\n\t\t\t\t\t? plugins[messageControl]?.formComponent?.({ placement, ...props, onKeyDown: handleKeyDown })\r\n\t\t\t\t\t: ;\r\n\t\t\t};\r\n\t\t\tif (!messageControlWrappers || messageControlWrappers.some((plugin) => !plugins[plugin]?.messageControlWrapper)) {\r\n\t\t\t\treturn <>{mention(undefined)}>;\r\n\t\t\t}\r\n\r\n\t\t\treturn <>\r\n\t\t\t\t{(messageControlWrappers?.reduce(\r\n\t\t\t\t\t(acc, plugin) =>\r\n\t\t\t\t\t\t(handleKeyDown) => {\r\n\t\t\t\t\t\t\treturn <>\r\n\t\t\t\t\t\t\t\t{plugins[plugin]?.messageControlWrapper?.({\r\n\t\t\t\t\t\t\t\t\tchat,\r\n\t\t\t\t\t\t\t\t\trender: (onKeyDown) => {\r\n\t\t\t\t\t\t\t\t\t\tconst keyDownHandler = (e) => {\r\n\t\t\t\t\t\t\t\t\t\t\tonKeyDown && onKeyDown(e);\r\n\t\t\t\t\t\t\t\t\t\t\thandleKeyDown && handleKeyDown(e);\r\n\t\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t\t\treturn acc(keyDownHandler);\r\n\t\t\t\t\t\t\t\t\t},\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\t},\r\n\t\t\t\t\tmention,\r\n\t\t\t\t) || mention)?.(undefined)}\r\n\t\t\t>;\r\n\t\t};\r\n\t}, [messageControl, `${messageControlWrappers}`, chat.id]);\r\n\r\n\tconst validationSchema = React.useMemo(() => {\r\n\t\treturn getValidationSchema(maxMessageLength);\r\n\t}, []);\r\n\r\n\tconst mentionOptions = React.useMemo(() => {\r\n\t\treturn chat.contacts.map((item) => {\r\n\t\t\tconst name = getUserName(item);\r\n\r\n\t\t\treturn {\r\n\t\t\t\tvalue: name,\r\n\t\t\t\tlabel: <>\r\n\t\t\t\t\t{getUserAvatar && {getUserAvatar(item)}
}\r\n\t\t\t\t\t{name} \r\n\t\t\t\t>,\r\n\t\t\t};\r\n\t\t});\r\n\t}, [chat.contacts, messageControl && plugins[messageControl]?.formComponent]);\r\n\r\n\tconst getActions = (formikBag) => \r\n\t\t{formButtons\r\n\t\t\t.map((button) => {\r\n\t\t\t\tconst props = {\r\n\t\t\t\t\tonUploadFile: (f) => onUploadFile(f, formikBag),\r\n\t\t\t\t\tsetState: _setState,\r\n\t\t\t\t\twaveColor,\r\n\t\t\t\t\tisEditMessage: !!editMessage,\r\n\t\t\t\t\tchatId: chat.id,\r\n\t\t\t\t\tgetPopupContainer: getActionPopupContainer,\r\n\t\t\t\t\tchat,\r\n\t\t\t\t};\r\n\t\t\t\tconst wrapper = typeof button !== 'function' && chatFormButtonsWrappers[button]\r\n\t\t\t\t\t? chatFormButtonsWrappers[button] : (children) => {children} ;\r\n\r\n\t\t\t\tconst buttonRender = typeof button === 'function'\r\n\t\t\t\t\t? button\r\n\t\t\t\t\t: plugins[button] && plugins[button]?.formButton !== null\r\n\t\t\t\t\t\t? plugins[button]?.formButton\r\n\t\t\t\t\t\t: undefined;\r\n\r\n\t\t\t\treturn !buttonRender ? null : wrapper ? wrapper(buttonRender(formikBag, props)) : buttonRender(formikBag, props);\r\n\t\t\t})\r\n\t\t}\r\n\t ;\r\n\r\n\treturn f.file) || [],\r\n\t\t\tattachments: [],\r\n\t\t\tbytes: [],\r\n\t\t\tchatMessageType: replyMessage ? ChatMessageType.ReplyMessage : ChatMessageType.Regular,\r\n\t\t\tinnerChatMessageId: replyMessage?.id,\r\n\t\t} as NewMessage}\r\n\t\tonSubmit={handleSubmitForm}\r\n\t\tvalidationSchema={validationSchema}\r\n\t\tenableReinitialize\r\n\t>\r\n\t\t{(formikBag: FormikProps) => {\r\n\t\t\treturn ;\r\n\t\t}}\r\n\t ;\r\n};\r\n\r\nexport default ChatMessageForm;\r\n","import * as React from 'react';\r\n\r\nexport const defaultChatMessagesError = ({ reload }) => {\r\n\treturn \r\n\t\t
\r\n\t\t\tOops... we couldn't upload the messages,\r\n\t\t\t \r\n\t\t\tbut our team is already working on it\r\n\t\t \r\n\t\t \r\n\t\t reload()}>\r\n\t\t\tClick to reload messages\r\n\t\t \r\n\t
;\r\n};\r\n","import React from 'react';\r\n\r\nconst useScrollTo = (\r\n\trefreshId: number | string | null,\r\n\tprevent?: boolean,\r\n\tafterScrollStart?: () => void,\r\n) => {\r\n\tconst ref = React.useRef(null);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst scrollContainer = ref.current;\r\n\r\n\t\tif (scrollContainer && !prevent) {\r\n\t\t\tscrollContainer.scrollIntoView({ block: 'end' });\r\n\t\t\tsetTimeout(() => afterScrollStart && afterScrollStart(), 0);\r\n\t\t}\r\n\t}, [refreshId]);\r\n\r\n\treturn ref;\r\n};\r\n\r\nexport default useScrollTo;\r\n","import * as React from 'react';\r\nimport { shallowEqual, useSelector } from 'react-redux';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nimport Message from 'antd/lib/message';\r\n\r\nimport { parseQuery } from '@common/typescript/utils/url';\r\nimport { getUserName } from '@common/react/utils/utils';\r\nimport { memoize } from '@common/typescript/utils/memoize';\r\nimport { getAvatar } from '@common/react/utils/getAvatar';\r\nimport { replaceSearchUrl } from '@common/react/components/Utils/Utils';\r\nimport {\r\n\tChat,\r\n\tChatMessage,\r\n\tChatMessageActionsComponent,\r\n\tChatMessageType, ChatPlugins,\r\n} from '@common/react/components/Chat/Chat';\r\nimport { ApplicationStateWithChats, ChatsActionCreators } from '@common/react/components/Chat/Store/Chats';\r\nimport { BaseUserWithAvatar } from '@common/react/objects/BaseUser';\r\nimport { BaseApplicationState } from '@common/react/store';\r\nimport { dateFormat, dateTimeFormat } from '@common/typescript/Utils';\r\nimport { File } from '@common/typescript/objects/FileInterface';\r\nimport {\r\n\tdefaultTransformFiltersBeforeHandleUrl,\r\n\tItemsProvider,\r\n\tuseItemsProviderContext,\r\n} from '@common/react/components/Core/ItemsProvider/ItemsProvider';\r\nimport {\r\n\tChatSettingsProviderContext,\r\n\tPluginsDictionary,\r\n\tuseChatSettingsProviderContext,\r\n} from '@common/react/components/Chat/ChatSettingsProvider';\r\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\r\nimport useRequest from '@common/react/hooks/useRequest';\r\nimport { deleteConfirmation } from '@common/react/components/Modal/Modal';\r\nimport { defaultChatMessagesError } from '@common/react/components/Chat/ChatComponents';\r\nimport useScrollTo from '@common/react/hooks/useScrollTo';\r\n\r\ntype ListProps = OwnProps;\r\n\r\ntype Actions = ChatsActionCreators>;\r\n\r\ninterface OwnProps {\r\n\tactions: Actions;\r\n\tchat: Chat;\r\n\tuser: BaseUserWithAvatar;\r\n\tcontext: ChatSettingsProviderContext;\r\n\tsetEdit: (message) => void;\r\n\teditMessage?: ChatMessage | null;\r\n\tsetReplyMessage: (message) => void;\r\n\treplyMessage?: ChatMessage | null;\r\n\tloader?: React.ReactElement;\r\n\tonImageClick?: (e, file: File) => void;\r\n\tgetUserAvatar?: (user) => React.ReactNode;\r\n}\r\n\r\nexport interface ChatItemProps {\r\n\tmessage: ChatMessage;\r\n\twithRemoteId: boolean;\r\n\tfromUser: boolean;\r\n\twithoutBadge: boolean;\r\n\tuser: BaseUserWithAvatar;\r\n\tremove: () => void;\r\n\tupdate: (message) => void;\r\n\tedit: (message) => void;\r\n\treply: (message) => void;\r\n\tisEdit: boolean;\r\n\tplugins: PluginsDictionary;\r\n\tonMouseEnter?: (message: ChatMessage) => void;\r\n\tcontacts: Array;\r\n\tonImageClick?: (e, file: File) => void;\r\n\tgetUserAvatar?: (user) => React.ReactNode;\r\n\tlastVideoCallId?: number;\r\n\tmessageActions?: Array;\r\n\tshowActionsByHover?: boolean;\r\n\tscrollIntoView?: boolean;\r\n\tafterScroll?: () => void;\r\n\tgetViewerAvatar?: (messageViewers) => React.ReactNode;\r\n\tattachments?: Array;\r\n}\r\n\r\nconst getMessageUser = memoize((id: number, contacts: Array, remote?: boolean) =>\r\n\tcontacts.find((contact: BaseUserWithAvatar) => contact[remote ? 'remoteId' : 'id'] === id));\r\n\r\nconst ChatMessageItem: React.FC = ({\r\n\tmessage,\r\n\twithoutBadge,\r\n\tfromUser,\r\n\tuser,\r\n\tonMouseEnter,\r\n\tcontacts,\r\n\tonImageClick,\r\n\tplugins,\r\n\tshowActionsByHover,\r\n\tafterScroll,\r\n\treply,\r\n\tattachments,\r\n\t...rest\r\n}) => {\r\n\tconst ref = useScrollTo(rest.scrollIntoView ? 0 : message.id, !rest.scrollIntoView, afterScroll);\r\n\tconst { withRemoteId, lastVideoCallId } = rest;\r\n\r\n\tconst className = `chat-message-list-component__item ${\r\n\t\tfromUser ? 'chat-message-list-component__item_you' : ''} ${\r\n\t\twithoutBadge ? 'chat-message-list-component__item_withoutBadge' : ''} ${\r\n\t\tmessage.viewed ? '' : 'chat-message-list-component__item_unviewed'} ${\r\n\t\trest.isEdit ? 'chat-message-list-component__item_edit' : ''\r\n\t}`;\r\n\r\n\tconst {\r\n\t\tgetUserAvatar = (user) =>
,\r\n\t\tgetViewerAvatar = (messageViewer) => \r\n\t\t\t{messageViewer?.user?.avatar\r\n\t\t\t\t?
\r\n\t\t\t\t:
{messageViewer?.user?.firstName} }\r\n\t\t
,\r\n\t} = rest;\r\n\r\n\tconst messageRender = plugins[message.chatMessageType]\r\n\t\t? plugins[message.chatMessageType]?.message?.render\r\n\t\t: () => null;\r\n\r\n\treturn (message.chatMessageType !== ChatMessageType.Email || withRemoteId)\r\n\t\t? onMouseEnter(message) : undefined}>\r\n\t\t\t{\r\n\t\t\t\tgetViewerAvatar && \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmessage.messageViewers && message.messageViewers\r\n\t\t\t\t\t\t\t.filter((messageViewer) => messageViewer.viewed && message.userId !== messageViewer.userId)\r\n\t\t\t\t\t\t\t.map((messageViewer) =>\r\n\t\t\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\t\t{getViewerAvatar(messageViewer)}\r\n\t\t\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\t\r\n\t\t\t\t{!withoutBadge && user\r\n\t\t\t\t&& <>\r\n\t\t\t\t\t{getUserAvatar(user)}\r\n\t\t\t\t\t
{getUserName(user)}
\r\n\t\t\t\t>\r\n\t\t\t\t}\r\n\t\t\t\t{!withoutBadge && !user && withRemoteId\r\n\t\t\t\t&&
{user ? getUserName(user) : 'DELETED'}
}\r\n\t\t\t\t
\r\n\t\t\t\t\t{dateFormat(message.time)}\r\n\t\t\t\t\t{' '}\r\n\t\t\t\t\t{dateTimeFormat(message.time)}\r\n\t\t\t\t
\r\n\t\t\t\t{messageRender?.({\r\n\t\t\t\t\tmessage,\r\n\t\t\t\t\tcontacts,\r\n\t\t\t\t\tonImageClick,\r\n\t\t\t\t\twithRemoteId,\r\n\t\t\t\t\tonMouseEnter,\r\n\t\t\t\t\tlastVideoCallId,\r\n\t\t\t\t})}\r\n\t\t\t\t{attachments?.map((plugin) => (\r\n\t\t\t\t\tplugins?.[plugin]?.messageAttachment ?
\r\n\t\t\t\t\t\t{plugins?.[plugin]?.messageAttachment?.(message)}\r\n\t\t\t\t\t : null))}\r\n\t\t\t
\r\n\t\t\t{\r\n\t\t\t\trest.messageActions?.length\r\n\t\t\t\t\t? (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{rest.messageActions.map((action) => {\r\n\t\t\t\t\t\t\t\tconst props = {\r\n\t\t\t\t\t\t\t\t\tmessage,\r\n\t\t\t\t\t\t\t\t\tedit: rest.edit,\r\n\t\t\t\t\t\t\t\t\tisEdit: rest.isEdit,\r\n\t\t\t\t\t\t\t\t\tremove: rest.remove,\r\n\t\t\t\t\t\t\t\t\tupdate: rest.update,\r\n\t\t\t\t\t\t\t\t\treply,\r\n\t\t\t\t\t\t\t\t\tfromUser,\r\n\t\t\t\t\t\t\t\t\toptions: typeof action === 'function' ? undefined : plugins[action]?.options,\r\n\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\tif (typeof action === 'function') {\r\n\t\t\t\t\t\t\t\t\treturn action(props);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\treturn {plugins[action]?.chatMessageAction?.(props)} ;\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t) : null\r\n\t\t\t}\r\n\t\t : null;\r\n};\r\n\r\nexport const ScrollTo: React.FC<{refreshId: number | string | null, prevent?: boolean}> = ({ refreshId, prevent }) => {\r\n\tconst ref = useScrollTo(refreshId, prevent);\r\n\r\n\treturn
;\r\n};\r\n\r\nconst ChatMessageList: React.FC = (props) => {\r\n\tconst {\r\n\t\tuser, chat, loader, actions, onImageClick, getUserAvatar, context: chatSettingsContext,\r\n\t} = props;\r\n\tconst {\r\n\t\tsetEdit, editMessage, replyMessage, setReplyMessage,\r\n\t} = props;\r\n\tconst request = useRequest();\r\n\tconst history = useHistory();\r\n\tconst [scrollToMessageId, setScrollToMessageId] = React.useState(() => {\r\n\t\tconst params = parseQuery(history.location.search);\r\n\t\treturn +(params.messageId || 0);\r\n\t});\r\n\r\n\tconst lastScrollData = React.useRef<{top: number, height: number}>({ top: 0, height: 0 });\r\n\r\n\tconst [scrollId, setScrollId] = React.useState(null);\r\n\tconst [error, setError] = React.useState('');\r\n\tconst [loadingMore, setLoadingMore] = React.useState(false);\r\n\tconst listRef = React.useRef(null);\r\n\r\n\tconst context = useItemsProviderContext();\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\titems, pagination, loading, filters,\r\n\t\t}, actions: { load, loadMore },\r\n\t} = context;\r\n\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\trequests, withRemoteId, chatStoreSettings: { getMessages }, messageActions, errorHandlers,\r\n\t\t\tmessagesLoadMoreIndicator, plugins, storageName, showActionsByHover, avatarSettings,\r\n\t\t},\r\n\t} = chatSettingsContext;\r\n\r\n\tconst messages = useSelector((state: BaseApplicationState) => {\r\n\t\treturn getMessages(chat.id)(state);\r\n\t}, shallowEqual);\r\n\r\n\tconst reload = (useResult: {use: boolean} = { use: true }) => {\r\n\t\tsetError('');\r\n\t\tconst otherChat = chat.contacts.every((contact) => (contact as any).remoteId !== user.id);\r\n\t\tconst userId = otherChat ? (chat.contacts as any).find((contact) => contact.remoteId && contact.remoteId > 0)?.remoteId : undefined;\r\n\r\n\t\tload({ chatId: chat.id, userId: withRemoteId ? userId || 0 : undefined }, false, false, false, true, useResult)\r\n\t\t\t.then((res) => {\r\n\t\t\t\tres.list.length > 0 && setScrollId(res.list[0].id);\r\n\t\t\t})\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tsetError(e);\r\n\t\t\t});\r\n\t};\r\n\r\n\tReact.useEffect(() => {\r\n\t\thistory.listen((location, action) => {\r\n\t\t\tconst messageId = +(parseQuery(location.search).messageId || 0);\r\n\t\t\tif (messageId) {\r\n\t\t\t\tsetScrollToMessageId(messageId);\r\n\t\t\t}\r\n\t\t});\r\n\t}, []);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tconst useResult = { use: true };\r\n\t\tif ((filters.chatId !== chat.id || props.initLoad) && !messages) {\r\n\t\t\treload(useResult);\r\n\t\t\treturn () => {\r\n\t\t\t\tuseResult.use = false;\r\n\t\t\t};\r\n\t\t}\r\n\t\titems.length > 0 && setScrollId(items[items.length - 1].id);\r\n\t\tmessages && setError('');\r\n\t}, [chat.id]);\r\n\r\n\tReact.useEffect(() => {\r\n\t\tif (items.length > 0 && items[items.length - 1].id) {\r\n\t\t\tsetScrollId(items[items.length - 1].id);\r\n\t\t}\r\n\t}, [items]);\r\n\r\n\tconst clickHandler = (e) => {\r\n\t\tif (e.target && e.target.nodeName === 'A' && e.target.className === 'chat-component__mention' && e.target.dataset.id) {\r\n\t\t\tconst contact = chat.contacts.find((item) => item.id === +e.target.dataset.id);\r\n\t\t\tcontact && Object.keys(plugins).forEach((plugin) => plugins[plugin]?.options?.onMentionClick?.(contact));\r\n\t\t}\r\n\t};\r\n\r\n\tconst setViewed = (message: ChatMessage) => {\r\n\t\tif (!message.viewLoading) {\r\n\t\t\tactions.updateMessage({ ...message, viewLoading: true }, storageName);\r\n\t\t\trequest(requests.chatMessageAccess, {\r\n\t\t\t\tviewed: true,\r\n\t\t\t\tmessage: message.id,\r\n\t\t\t})\r\n\t\t\t\t.then(() => {\r\n\t\t\t\t\tactions.updateMessage({ ...message, viewed: true, viewLoading: false }, storageName);\r\n\t\t\t\t})\r\n\t\t\t\t.catch((e) => {\r\n\t\t\t\t\t(errorHandlers?.onChatMessageAccessError || Message.error)(e);\r\n\t\t\t\t\tactions.updateMessage({ ...message, viewLoading: false }, storageName);\r\n\t\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tconst onScroll = (event) => {\r\n\t\tif (!event.target.classList.contains('chat-message-list-component')) return;\r\n\t\tconst scrollTop = (event.target as HTMLUListElement).scrollTop;\r\n\t\tif (items.length < pagination.total && !loading && scrollTop < 100 && lastScrollData.current.top - scrollTop > 0) {\r\n\t\t\tconst otherChat = chat.contacts.every((contact: any) => contact.remoteId !== user.id);\r\n\t\t\tconst userId = otherChat ? (chat.contacts as any).find((contact) => contact.remoteId && contact.remoteId > 0)?.remoteId : undefined;\r\n\r\n\t\t\tsetLoadingMore((loading) => {\r\n\t\t\t\tif (!loading) {\r\n\t\t\t\t\tloadMore({ chatId: chat.id, userId: withRemoteId ? userId || 0 : undefined }, true, true)\r\n\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\tif (listRef.current && lastScrollData.current.height > 0) {\r\n\t\t\t\t\t\t\t\tconst newHeight = listRef.current.scrollHeight;\r\n\t\t\t\t\t\t\t\tconst lastHeight = lastScrollData.current.height;\r\n\t\t\t\t\t\t\t\tlet top = newHeight - (lastHeight + lastScrollData.current.top);\r\n\t\t\t\t\t\t\t\tif (top < 0) {\r\n\t\t\t\t\t\t\t\t\ttop = 0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tlistRef.current.scrollTo({ top, left: 0 });\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.catch((e) => {\r\n\t\t\t\t\t\t\t(errorHandlers?.onChatMessagesLoadError || Message.error)(e);\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\t\tsetLoadingMore(false);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tlastScrollData.current.top = scrollTop;\r\n\t\tlastScrollData.current.height = listRef.current?.scrollHeight || 0;\r\n\t};\r\n\r\n\tconst self = withRemoteId ? chat.contacts.find((contact) => (contact as any).remoteId === user.id) || user : user;\r\n\tconst contacts = chat.contacts.filter((contact) => (withRemoteId ? (contact as any).remoteId !== user.id : contact.id !== user.id));\r\n\tconst lastVideoCallId = React.useMemo(() => {\r\n\t\treturn items.length > 0 ? [...items]\r\n\t\t\t.reverse()\r\n\t\t\t.find((item) => item.chatMessageType === ChatMessageType.VideoChat)?.id : undefined;\r\n\t}, [items]);\r\n\r\n\tconst update = (message, params) => {\r\n\t\trequests.updateMessage && request(requests.updateMessage, {\r\n\t\t\tid: message.id,\r\n\t\t\t...params,\r\n\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tactions.updateMessage({ id: message.id, chatId: message.chatId, ...params }, storageName);\r\n\t\t\t});\r\n\t};\r\n\r\n\tconst remove = (message) => {\r\n\t\tif (messages && requests.removeMessage) {\r\n\t\t\treturn request(requests.removeMessage, {\r\n\t\t\t\tid: message.id,\r\n\t\t\t\tdeleted: true,\r\n\t\t\t})\r\n\t\t\t\t.then(() => {\r\n\t\t\t\t\tactions.removeMessage(request, requests.getChat, storageName, message, message.chatId);\r\n\t\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleRemove = (message) => {\r\n\t\tif (chatSettingsContext.state.removeMessageConfirmation) {\r\n\t\t\tdeleteConfirmation(\r\n\t\t\t\t() => remove(message),\r\n\t\t\t\t'This message will be permanently deleted and cannot be recovered. Are you sure?',\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tremove(message);\r\n\t\t}\r\n\t};\r\n\r\n\tconst afterScrollToMessage = () => {\r\n\t\tconst params = parseQuery(history.location.search);\r\n\t\tif (params.messageId) {\r\n\t\t\tsetScrollToMessageId(0);\r\n\t\t\thistory.replace({\r\n\t\t\t\t...history.location,\r\n\t\t\t\tsearch: replaceSearchUrl(history.location.search, 'messageId', ''),\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\treturn \r\n\t\t{loadingMore && messagesLoadMoreIndicator ?
\r\n\t\t\t{messagesLoadMoreIndicator}\r\n\t\t
: null}\r\n\t\t{error ? (errorHandlers?.chatMessagesErrorComponent || defaultChatMessagesError)({ reload })\r\n\t\t\t: <>\r\n\t\t\t\t{(items && loading) &&
}\r\n\t\t\t\t
\r\n\t\t\t\t\t{items?.map((item, index) => {\r\n\t\t\t\t\t\tconst withoutBadge: boolean = index > 0 && item.userId === items[index - 1].userId;\r\n\t\t\t\t\t\tconst messageUser = !withRemoteId\r\n\t\t\t\t\t\t\t? item.userId === user.id ? { ...user, status: item.user?.status } : getMessageUser(item.userId, contacts)\r\n\t\t\t\t\t\t\t: item.userId === self?.[self === user ? 'id' : 'remoteId'] ? { ...user, status: item.user?.status }\r\n\t\t\t\t\t\t\t\t: getMessageUser(item.userId, contacts, true);\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\t\tsetEdit(message);\r\n\t\t\t\t\t\t\t\tsetReplyMessage(null);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tattachments={chatSettingsContext?.state?.messageAttachments}\r\n\t\t\t\t\t\t\treply={(message) => {\r\n\t\t\t\t\t\t\t\tsetEdit(null);\r\n\t\t\t\t\t\t\t\tsetReplyMessage(message);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tisEdit={item.id === editMessage?.id || item.id === replyMessage?.id}\r\n\t\t\t\t\t\t\tremove={() => handleRemove(item)}\r\n\t\t\t\t\t\t\tupdate={(message) => update(item, message)}\r\n\t\t\t\t\t\t\tplugins={plugins}\r\n\t\t\t\t\t\t\tscrollIntoView={scrollToMessageId === item.id}\r\n\t\t\t\t\t\t\tafterScroll={afterScrollToMessage}\r\n\t\t\t\t\t\t\tshowActionsByHover={showActionsByHover}\r\n\t\t\t\t\t\t\tgetViewerAvatar={avatarSettings.viewerAvatar}\r\n\t\t\t\t\t\t/>;\r\n\t\t\t\t\t})}\r\n\t\t\t\t\t 0} />\r\n\t\t\t\t \r\n\t\t\t>\r\n\t\t}\r\n\t
;\r\n};\r\n\r\nconst ChatMessageListWrapper: React.FC> = (props) => {\r\n\tconst context = useChatSettingsProviderContext();\r\n\r\n\tif (!context?.state) throw 'need ChatSettingsContext';\r\n\r\n\tconst { state: { requests, storageName, chatStoreSettings: { getMessages } } } = context;\r\n\r\n\tconst messages = useSelector(getMessages(props.chat.id), shallowEqual);\r\n\r\n\treturn \r\n\t\titems={messages?.list}\r\n\t\tsyncItems={messages?.list}\r\n\t\ttype={requests.chatMessage}\r\n\t\ttransformFiltersBeforeHandleUrl={(filters) => ({\r\n\t\t\t...defaultTransformFiltersBeforeHandleUrl(filters),\r\n\t\t\tpageSize: undefined,\r\n\t\t})}\r\n\t\tpagination={{\r\n\t\t\ttotal: messages?.count, current: 1, pageSize: 20,\r\n\t\t}}\r\n\t\tfilters={{ chatId: props.chat.id }}\r\n\t\tonItemsChange={(items, filters, res) => filters?.chatId && props.actions.setMessages({\r\n\t\t\tlist: items,\r\n\t\t\toffset: res?.offset ?? items.length - (filters?.pageSize || 20),\r\n\t\t\texecution: 0,\r\n\t\t\tcount: res?.count ?? items.length,\r\n\t\t}, filters.chatId, storageName)}\r\n\t>\r\n\t\t \r\n\t ;\r\n};\r\n\r\nexport default ChatMessageListWrapper;\r\n","export const memoize = (fn) => {\r\n\tconst cache = {};\r\n\treturn (...args) => {\r\n\t\tconst n = args[0];\r\n\t\tif (n in cache) {\r\n\t\t\treturn cache[n];\r\n\t\t} \r\n\t\t\r\n\t\tconst result = fn.apply(null, args);\r\n\t\tcache[n] = result;\r\n\t\treturn result;\r\n\t};\r\n};","import * as React from 'react';\r\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nimport once from 'lodash/once';\r\nimport { bindActionCreators } from 'redux';\r\n\r\nimport useRequest from '@common/react/hooks/useRequest';\r\nimport {\r\n\tChat,\r\n\tChatFormButtonsComponents,\r\n\tChatFormButtonsWrappers,\r\n\tChatMessage,\r\n\tChatMessageActionsComponent,\r\n\tChatMessageType,\r\n\tChatOtherComponents,\r\n\tChatPlugins,\r\n\tChatPlugin,\r\n\tChatListHeaderSettingsType,\r\n\tChatNameType,\r\n\tChatMessagesHeaderSettingsType,\r\n} from '@common/react/components/Chat/Chat';\r\nimport { getAvatar } from '@common/react/utils/getAvatar';\r\nimport * as ChatsState from '@common/react/components/Chat/Store/Chats';\r\nimport { List } from '@common/typescript/objects/List';\r\n\r\nimport { BaseParams } from '@common/react/objects/BaseParams';\r\nimport { BaseUserWithAvatar } from '@common/typescript/objects/BaseUser';\r\nimport { getUserName } from '@common/react/utils/utils';\r\nimport { RegularMessagePlugin } from '@common/react/components/Chat/RegularMessagePlugin/RegularMessagePlugin';\r\nimport { FilePlugin } from '@common/react/components/Chat/FilesPlugin/FilesPlugin';\r\nimport { handleUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\r\n\r\nexport interface ChatSettingsRequests {\r\n\tchat: string;\r\n\tchatUser: string;\r\n\tchatMessage: string;\r\n\tchatMessageAccess: string;\r\n\ttyping: string;\r\n\tloadChats: string;\r\n\tloadMessages: string;\r\n\tgetChat: string;\r\n\tcompleteChat?: string;\r\n\tremoveMessage?: string;\r\n\tupdateMessage?: string;\r\n\tchatEmojiReactionMessage?: string;\r\n}\r\n\r\nexport interface ChatSettingsNotificationTypes {\r\n\tchat: string;\r\n\tchatUser: string;\r\n\tchatMessage: string;\r\n\tchatMessageAccess: string;\r\n\tchatReaction: string;\r\n\ttyping: string;\r\n\tupdateChatCounterNotification: string;\r\n\tupdateUserMessagesCountNotification: string;\r\n}\r\n\r\nexport interface ChatSettingsUserSettings {\r\n\tuseBrowserNotification: boolean;\r\n\tsound: boolean;\r\n}\r\n\r\nexport interface ChatSettingsAvatarSettings {\r\n\t// maybe better return components with special interface\r\n\tgetUserAvatar: (user: any) => React.ReactNode;\r\n\tgetUserAvatarAtMention?: (user: any) => React.ReactNode;\r\n\tgetChatAvatar: (chat: any, userId: number) => React.ReactNode;\r\n\tnotificationAvatar: (state: any) => React.ReactNode;\r\n\tviewerAvatar?: (state: any) => React.ReactNode;\r\n}\r\n\r\nexport interface ChatSettingsFormSettings {\r\n\tsendByEnter: boolean;\r\n\tunderFormLabel: string;\r\n\tallowPasteImages: boolean;\r\n\tmaxAttachmentsCount: number;\r\n\tmaxMessageLength: number;\r\n\twaveColor?: string;\r\n}\r\n\r\nexport interface ChatSettingsChatPageSettings {\r\n\tpath: string;\r\n\tchatIdUrlKey: string;\r\n\tarchive: string;\r\n}\r\n\r\nexport interface ErrorHandlers {\r\n\tonChatsLoadError?: (err: string) => void;\r\n\tonChatMessagesLoadError?: (err: string) => void;\r\n\tonSaveMessageLoadError?: (err: string) => void;\r\n\tonChatMessageAccessError?: (err: string) => void;\r\n\tchatMessagesErrorComponent?: ({ reload }) => React.ReactNode;\r\n}\r\n\r\nexport interface ChatSettingsProviderProps {\r\n\tchildren: any;\r\n\tstorageName?: string;\r\n\trequests?: ChatSettingsRequests;\r\n\tnotificationTypes?: ChatSettingsNotificationTypes;\r\n\tuserSettings?: ChatSettingsUserSettings;\r\n\tavatarSettings?: ChatSettingsAvatarSettings;\r\n\tformSettings?: ChatSettingsFormSettings;\r\n\tformButtons?: Array;\r\n\tformTags?: Array;\r\n\theaderButtons?: Array;\r\n\tmessageTypes?: Array;\r\n\totherComponents?: Array;\r\n\tpageSettings?: ChatSettingsChatPageSettings;\r\n\tchatFormButtonsWrappers?: ChatFormButtonsWrappers;\r\n\tchatStoreSettings?: ChatStoreSettings;\r\n\ttitle?: string;\r\n\twithRemoteId?: boolean;\r\n\tchatsFilters?: BaseParams;\r\n\tchatListHeaderSettings?: ChatListHeaderSettingsType;\r\n\trenderChatName?: ChatNameType;\r\n\tmessagesHeaderComponents?: ChatMessagesHeaderSettingsType;\r\n\tnotificationHideDelay?: number;\r\n\tmaxChatMessageNotificationCount?: number;\r\n\tmessageActions?: Array;\r\n\tremoveMessageConfirmation?: boolean;\r\n\terrorHandlers?: ErrorHandlers;\r\n\temptyChatListMessage?: React.ReactNode | (({ filters, load }) => React.ReactNode);\r\n\tbasePath?: string;\r\n\tmessagesLoadMoreIndicator?: React.ReactNode;\r\n\tplugins?: PluginsDictionary;\r\n\tlistComponent?: Array;\r\n\tmessageControl?: ChatPlugins;\r\n\tmessageControlWrappers?: Array;\r\n\tshowActionsByHover?: boolean;\r\n\tshowMessagesButtonInVideoModal?: boolean;\r\n\topenModalFromNotification?: boolean;\r\n\topenInModal?: boolean;\r\n\tmessageAttachments?: Array;\r\n}\r\n\r\nexport type PluginsDictionary = {\r\n\t[key in ChatPlugins]?: ChatPlugin;\r\n};\r\n\r\nexport interface ChatSettingsProviderContextState {\r\n\trequests: ChatSettingsRequests;\r\n\tplugins: PluginsDictionary;\r\n\tstorageName: string;\r\n\tnotificationTypes: ChatSettingsNotificationTypes;\r\n\tformSettings: ChatSettingsFormSettings;\r\n\tformButtons: Array;\r\n\totherComponents: Array;\r\n\tchatFormButtonsWrappers: ChatFormButtonsWrappers;\r\n\tpageSettings: ChatSettingsChatPageSettings;\r\n\tchatStoreSettings: ChatStoreSettings;\r\n\ttitle: string;\r\n\tavatarSettings: ChatSettingsAvatarSettings;\r\n\tformTags: Array;\r\n\twithRemoteId: boolean;\r\n\tchatListHeaderSettings: ChatListHeaderSettingsType;\r\n\tmessagesHeaderComponents: ChatMessagesHeaderSettingsType;\r\n\tnotificationHideDelay: number;\r\n\tmaxChatMessageNotificationCount: number;\r\n\tmessageActions?: Array;\r\n\tchatsFilters?: BaseParams;\r\n\trenderChatName?: ChatNameType;\r\n\tremoveMessageConfirmation?: boolean;\r\n\terrorHandlers?: ErrorHandlers;\r\n\temptyChatListMessage?: React.ReactNode | (({ filters, load }) => React.ReactNode);\r\n\tbasePath?: string;\r\n\tmessagesLoadMoreIndicator?: React.ReactNode;\r\n\tlistComponent?: Array