(history, reducers, initialState);\n\n\trenderApp(routes);\n}\n\nexport const getStore = () => store;\n\nexport const getHistory = () => history;\n\nexport const setStore = (newStore: any) => store = newStore;\n\nexport function renderApp(routes) {\n\t// This code starts up the React app when it runs in a browser. It sets up the routing configuration\n\t// and injects the app into a DOM element.\n\tif (getStore() === null) {\n\t\tthrow 'bootClient must be called first!';\n\t}\n\n\tloadableReady(() => {\n\t\tReactDOM.hydrate(\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{routes}\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t ,\n\t\t\tdocument.getElementById('react-app'),\n\t\t);\n\t});\n}\n","import { Action, Reducer } from 'redux';\n\nimport { addTask } from 'domain-task';\n\nimport { request } from '@common/react/components/Api';\n\n/* eslint-disable-next-line */\nimport { AppThunkAction } from '@app/store/index';\n\nexport interface PageItemState {\n\tpage: P | null;\n\tpath: string | null;\n\tisLoading: boolean;\n}\n\nexport enum TypeKeys {\n\tREQUESTPAGE = 'REQUESTPAGE',\n\tRECIEVEPAGE = 'RECIEVEPAGE'\n}\n\nexport interface RequestPageAction {\n\ttype: TypeKeys.REQUESTPAGE;\n\tstorageName: string | null;\n\tpath: string;\n}\n\nexport interface ReceivePageAction {\n\ttype: TypeKeys.RECIEVEPAGE;\n\tstorageName: string | null;\n\tpage: any;\n}\n\ntype KnownPageAction = RequestPageAction | ReceivePageAction;\n\nexport const actionCreators = ({\n\tloadPage: (storageName: string, path: string): AppThunkAction => (dispatch, getState) => {\n\t\tconst storeState = (getState() as any)[storageName];\n\n\t\tif (storeState.path !== path) {\n\t\t\tconst fetchTask = request(\n\t\t\t\t'pageLoader',\n\t\t\t\t{ path },\n\t\t\t\tgetState(),\n\t\t\t).then((data) => dispatch({ type: TypeKeys.RECIEVEPAGE, storageName, page: data }));\n\n\t\t\taddTask(fetchTask);\n\t\t\tdispatch({ type: TypeKeys.REQUESTPAGE, storageName, path });\n\n\t\t\treturn fetchTask;\n\t\t}\n\t},\n});\n\nexport const reducer = (storageName: string):Reducer> => {\n\treturn (state: PageItemState = { isLoading: false, page: null, path: '' }, incomingAction: Action) => {\n\t\tconst action = incomingAction as KnownPageAction;\n\t\tif (!action.storageName || action.storageName === storageName) {\n\t\t\tswitch (action.type) {\n\t\t\t\tcase TypeKeys.REQUESTPAGE:\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tpage: state.page,\n\t\t\t\t\t\tpath: action.path,\n\t\t\t\t\t};\n\t\t\t\tcase TypeKeys.RECIEVEPAGE:\n\t\t\t\t\treturn { isLoading: false, page: action.page, path: action.page.path };\n\t\t\t\tdefault:\n\t\t\t\t\tconst exhaustiveCheck: never = action;\n\t\t\t}\n\t\t}\n\n\t\treturn state;\n\t};\n};\n","import { ReducersMapObject } from 'redux';\n\nimport * as Login from '@common/react/store/Login';\nimport * as Item from '@common/react/store/Item';\nimport { BaseUser } from '@common/react/objects/BaseUser';\nimport { BuildData } from '@common/react/objects/BuildData';\nimport BaseHostOptions from '@common/react/store/BaseHostOptions';\n\n// The top-level state object\nexport interface BaseApplicationState {\n\tlogin: Login.LoginState;\n\tbuildData: Item.ItemState;\n\thostOptions: Item.ItemState;\n}\n\n// Whenever an action is dispatched, Redux will update each top-level application state property using\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\n// acts on the corresponding ApplicationState property type.\nexport const baseReducers: ReducersMapObject = {\n\tlogin: Login.getReducer(),\n\tbuildData: Item.getReducer('buildData'),\n\thostOptions: Item.getReducer('hostOptions'),\n};\n\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\n// correctly typed to match your store.\nexport interface BaseAppThunkAction> {\n\t(dispatch: (action: TAction) => void, getState: () => TApplicationState): void;\n}\n","import { ReducersMapObject } from 'redux';\n\nimport * as Items from '@common/react/store/ItemList';\nimport * as Item from '@common/react/store/Item';\nimport { BaseAppThunkAction, baseReducers } from '@common/react/store';\nimport { ApplicationStateWithChats, getReducer as getChatsReducer } from '@common/react/components/Chat/Store/Chats';\nimport { PageItemState, reducer as PageStateReducer } from '@common/react/store/PageItem';\nimport { VideoChatState, getReducer as getVideoChatReducer } from '@common/react/store/VideoChat';\n\nimport { BaseInvite } from '@commonTuna/react/objects/BaseInvite';\n\nimport { User } from '@app/objects/User';\nimport { HeaderState, reducer as HeaderReducer } from '@app/store/HeaderSearch';\nimport { CountersState, reducer as CountersReducer } from '@app/store/Counters';\nimport { RegistrationPage } from '@app/objects/Pages/RegistrationPage';\nimport { SearchFilterState, reducer as SearchFilterReducer } from '@app/store/SearchFilter';\nimport { UserRegistrationSteps } from '@app/components/Pages/Register/PatientMainForm';\nimport { BuildData } from '@app/objects/BuildData';\n\n// The top-level state object\nexport interface ApplicationState extends ApplicationStateWithChats {\n\tserverPage: PageItemState;\n\n\tbuildData: Item.ItemState;\n\n\tcompanyTemplateInvites: Items.ItemsState;\n\n\tuserRegistrationSteps: Item.ItemState;\n\n\tcounters: CountersState;\n\n\theader: HeaderState;\n\n\tregistrationPage: PageItemState;\n\n\tsearchFilterData: SearchFilterState;\n\n\tvideoChat: VideoChatState;\n}\n\n// Whenever an action is dispatched, Redux will update each top-level application state property using\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\n// acts on the corresponding ApplicationState property type.\nexport const reducers: ReducersMapObject = {\n\t...baseReducers,\n\n\tbuildData: Item.getReducer('buildData'),\n\n\tserverPage: PageStateReducer('serverPage'),\n\n\tchats: getChatsReducer(),\n\n\tcompanyTemplateInvites: Items.getReducer('companyTemplateInvites'),\n\n\tuserRegistrationSteps: Item.getReducer('userRegistrationSteps'),\n\n\tcounters: CountersReducer,\n\n\theader: HeaderReducer,\n\n\tregistrationPage: PageStateReducer('registrationPage'),\n\n\tsearchFilterData: SearchFilterReducer,\n\n\tvideoChat: getVideoChatReducer(),\n};\n\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\n// correctly typed to match your store.\nexport type AppThunkAction = BaseAppThunkAction\n","import 'raf/polyfill';\n\nimport 'core-js/features/array/from';\nimport 'core-js/features/array/find';\nimport 'core-js/features/array/includes';\nimport 'core-js/features/set';\nimport 'core-js/features/map';\nimport 'core-js/features/weak-map';\nimport 'core-js/features/promise';\n\nimport * as Sentry from '@sentry/browser';\n\nimport { bootClient, renderApp } from '@common/react/loadable/boot-client';\nimport { updateReducers } from '@common/react/configureStore';\n\nimport { ApplicationState, reducers } from '@app/store';\nimport { User } from '@app/objects/User';\nimport { routes } from '@app/routes';\n\nconsole.log(`ENVIRONMENT: ${ENVIRONMENT}`);\n\nbootClient(routes, reducers);\n\n// Allow Hot Module Replacement\nif (module.hot) {\n\tmodule.hot.accept('@app/routes', () => {\n\t\trenderApp((require('@app/routes') as any).routes);\n\t});\n}\n\n// Enable Webpack hot module replacement for reducers\nif (module.hot) {\n\tmodule.hot.accept('@app/store', () => {\n\t\tconst nextRootReducer = require('@app/store');\n\t\tupdateReducers((nextRootReducer as any).reducers);\n\t});\n}\n\nif (process.env.NODE_ENV === 'production') {\n\tSentry.init({ dsn: 'https://c615bb76d98d45c4ba76c5d43dcd9685@o389532.ingest.sentry.io/5356380' });\n}\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';\n\nimport { ApplicationState } from '@app/store';\nimport { User } from '@app/objects/User';\n\nexport function request(type: string, data?: any, state?: ApplicationState) {\n\treturn baseRequest(type, data, state);\n}\n","import * as React from 'react';\n\nimport ConfigProvider from 'antd/es/config-provider';\nimport loadable from '@loadable/component';\n\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\nimport '@common/react/yupLocaleSettings';\nimport { LoadingProvider } from '@common/react/components/Core/LoadingProvider/LoadingProvider';\nimport VideoChatModal from '@common/react/components/UI/VideoChat/VideoChatModal';\nimport ErrorBoundaryWithSentry from '@common/react/components/UI/ErrorBoundaryWithSentry/ErrorBoundaryWithSentry';\nimport SignalRChats from '@common/react/components/Chat/SignalRChats';\nimport { ChatSettingsProvider } from '@common/react/components/Chat/ChatSettingsProvider';\nimport { RequestProvider } from '@common/react/components/RequestProvider/RequestProvider';\nimport { ReactionsPlugin } from '@common/react/components/Chat/Reactions/ReactionsPlugin';\nimport { ChatPlugins } from '@common/react/components/Chat/Chat';\nimport VideoChatGlider from '@common/react/components/Chat/VideoChatGlider';\nimport Application from '@common/react/components/Core/Application/Application';\nimport NotificationGliderProvider from '@common/react/components/Chat/NotificationGliderProvider';\nimport ReactionNotificationHandler from '@common/react/components/Chat/ReactionNotificationHandler';\n\nimport Avatar from '@commonTuna/react/components/UI/Avatar/Avatar';\n\nimport CartProviderWithUpdate from '@app/components/UI/CartProviderWithUpdate/CartProviderWithUpdate';\nimport HeaderSearch from '@app/components/UI/Header/HeaderSearch';\nimport PortalLoader from '@app/components/UI/PortalLoader';\nimport '@app/scss/components/chatMessageNotificationGlider.scss';\nimport { MenuStateProvider } from '@app/components/UI/Menu/MenuStateProvider';\nimport UserStateTracker from '@app/components/UI/UserStateTracker/UserStateTracker';\nimport { theme } from '@app/components/UI/ThemeConfig/ThemeConfig';\nimport RouteChangeTracker from '@app/components/Routes/RouteChangeTracker';\nimport PatientLocationsSetter from '@app/components/UI/PatientLocationsSetter/PatientLocationsSetter';\nimport { customReduxActions } from '@app/store/CustomReduxActions';\nimport { User } from '@app/objects/User';\nimport { Init } from '@app/objects/Init';\n\nimport '@app/scss/style.scss';\nimport RouteWithFooter from '@app/components/Routes/RouteWithFooter';\n\nconst params = { fallback: };\n\nconst NotFound = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"PageNotFound\" */\n\t\t'@common/react/components/UI/PageNotFound/PageNotFound'\n\t)), params);\n\nconst renderAvatar = (state) => ;\n\nconst Layout: React.FC = ({ children }) => {\n\treturn (\n\t\t\n\t\t\t
\n\t\t\t\t \n\t\t\t\t }>\n\t\t\t\t\t ,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tinitCustomHandler={customReduxActions}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\n\t\t\t \n\t\t
\n\t);\n};\n\nexport default Layout;\n","// do not edit .js files directly - edit src/index.jst\n\n\n\nvar fastDeepEqual = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at.\n *\n * Http://www.apache.org/licenses/LICENSE-2.0.\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst DEFAULT_ID = \"__googleMapsScriptId\";\n/**\n * The status of the [[Loader]].\n */\nvar LoaderStatus;\n(function (LoaderStatus) {\n LoaderStatus[LoaderStatus[\"INITIALIZED\"] = 0] = \"INITIALIZED\";\n LoaderStatus[LoaderStatus[\"LOADING\"] = 1] = \"LOADING\";\n LoaderStatus[LoaderStatus[\"SUCCESS\"] = 2] = \"SUCCESS\";\n LoaderStatus[LoaderStatus[\"FAILURE\"] = 3] = \"FAILURE\";\n})(LoaderStatus || (LoaderStatus = {}));\n/**\n * [[Loader]] makes it easier to add Google Maps JavaScript API to your application\n * dynamically using\n * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n * It works by dynamically creating and appending a script node to the the\n * document head and wrapping the callback function so as to return a promise.\n *\n * ```\n * const loader = new Loader({\n * apiKey: \"\",\n * version: \"weekly\",\n * libraries: [\"places\"]\n * });\n *\n * loader.load().then((google) => {\n * const map = new google.maps.Map(...)\n * })\n * ```\n */\nclass Loader {\n /**\n * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set\n * using this library, instead the defaults are set by the Google Maps\n * JavaScript API server.\n *\n * ```\n * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});\n * ```\n */\n constructor({ apiKey, authReferrerPolicy, channel, client, id = DEFAULT_ID, language, libraries = [], mapIds, nonce, region, retries = 3, url = \"https://maps.googleapis.com/maps/api/js\", version, }) {\n this.CALLBACK = \"__googleMapsCallback\";\n this.callbacks = [];\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.apiKey = apiKey;\n this.authReferrerPolicy = authReferrerPolicy;\n this.channel = channel;\n this.client = client;\n this.id = id || DEFAULT_ID; // Do not allow empty string\n this.language = language;\n this.libraries = libraries;\n this.mapIds = mapIds;\n this.nonce = nonce;\n this.region = region;\n this.retries = retries;\n this.url = url;\n this.version = version;\n if (Loader.instance) {\n if (!fastDeepEqual(this.options, Loader.instance.options)) {\n throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(Loader.instance.options)}`);\n }\n return Loader.instance;\n }\n Loader.instance = this;\n }\n get options() {\n return {\n version: this.version,\n apiKey: this.apiKey,\n channel: this.channel,\n client: this.client,\n id: this.id,\n libraries: this.libraries,\n language: this.language,\n region: this.region,\n mapIds: this.mapIds,\n nonce: this.nonce,\n url: this.url,\n authReferrerPolicy: this.authReferrerPolicy,\n };\n }\n get status() {\n if (this.errors.length) {\n return LoaderStatus.FAILURE;\n }\n if (this.done) {\n return LoaderStatus.SUCCESS;\n }\n if (this.loading) {\n return LoaderStatus.LOADING;\n }\n return LoaderStatus.INITIALIZED;\n }\n get failed() {\n return this.done && !this.loading && this.errors.length >= this.retries + 1;\n }\n /**\n * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].\n *\n * @ignore\n */\n createUrl() {\n let url = this.url;\n url += `?callback=${this.CALLBACK}`;\n if (this.apiKey) {\n url += `&key=${this.apiKey}`;\n }\n if (this.channel) {\n url += `&channel=${this.channel}`;\n }\n if (this.client) {\n url += `&client=${this.client}`;\n }\n if (this.libraries.length > 0) {\n url += `&libraries=${this.libraries.join(\",\")}`;\n }\n if (this.language) {\n url += `&language=${this.language}`;\n }\n if (this.region) {\n url += `®ion=${this.region}`;\n }\n if (this.version) {\n url += `&v=${this.version}`;\n }\n if (this.mapIds) {\n url += `&map_ids=${this.mapIds.join(\",\")}`;\n }\n if (this.authReferrerPolicy) {\n url += `&auth_referrer_policy=${this.authReferrerPolicy}`;\n }\n return url;\n }\n deleteScript() {\n const script = document.getElementById(this.id);\n if (script) {\n script.remove();\n }\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n */\n load() {\n return this.loadPromise();\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n *\n * @ignore\n */\n loadPromise() {\n return new Promise((resolve, reject) => {\n this.loadCallback((err) => {\n if (!err) {\n resolve(window.google);\n }\n else {\n reject(err.error);\n }\n });\n });\n }\n /**\n * Load the Google Maps JavaScript API script with a callback.\n */\n loadCallback(fn) {\n this.callbacks.push(fn);\n this.execute();\n }\n /**\n * Set the script on document.\n */\n setScript() {\n if (document.getElementById(this.id)) {\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\n this.callback();\n return;\n }\n const url = this.createUrl();\n const script = document.createElement(\"script\");\n script.id = this.id;\n script.type = \"text/javascript\";\n script.src = url;\n script.onerror = this.loadErrorCallback.bind(this);\n script.defer = true;\n script.async = true;\n if (this.nonce) {\n script.nonce = this.nonce;\n }\n document.head.appendChild(script);\n }\n /**\n * Reset the loader state.\n */\n reset() {\n this.deleteScript();\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.onerrorEvent = null;\n }\n resetIfRetryingFailed() {\n if (this.failed) {\n this.reset();\n }\n }\n loadErrorCallback(e) {\n this.errors.push(e);\n if (this.errors.length <= this.retries) {\n const delay = this.errors.length * Math.pow(2, this.errors.length);\n console.log(`Failed to load Google Maps script, retrying in ${delay} ms.`);\n setTimeout(() => {\n this.deleteScript();\n this.setScript();\n }, delay);\n }\n else {\n this.onerrorEvent = e;\n this.callback();\n }\n }\n setCallback() {\n window.__googleMapsCallback = this.callback.bind(this);\n }\n callback() {\n this.done = true;\n this.loading = false;\n this.callbacks.forEach((cb) => {\n cb(this.onerrorEvent);\n });\n this.callbacks = [];\n }\n execute() {\n this.resetIfRetryingFailed();\n if (this.done) {\n this.callback();\n }\n else {\n // short circuit and warn if google.maps is already loaded\n if (window.google && window.google.maps && window.google.maps.version) {\n console.warn(\"Google Maps already loaded outside @googlemaps/js-api-loader.\" +\n \"This may result in undesirable behavior as options and script parameters may not match.\");\n this.callback();\n return;\n }\n if (this.loading) ;\n else {\n this.loading = true;\n this.setCallback();\n this.setScript();\n }\n }\n }\n}\n\nexport { DEFAULT_ID, Loader, LoaderStatus };\n//# sourceMappingURL=index.esm.js.map\n","import e,{Component as t}from\"react\";import o from\"prop-types\";import n from\"react-dom\";import r from\"eventemitter3\";import{Loader as i}from\"@googlemaps/js-api-loader\";import s from\"@mapbox/point-geometry\";function a(){return(a=Object.assign||function(e){for(var t=1;t-1){var n='\"callback\" key in bootstrapURLKeys is not allowed,\\n use onGoogleApiLoaded property instead';throw console.error(n),new Error(n)}if(\"undefined\"==typeof window)throw new Error(\"google map cannot be loaded outside browser env\");var r=e.key,s=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n=0||(r[o]=e[o]);return r}(e,[\"key\"]);return w||(w=new i(a({apiKey:r||\"\"},s,{libraries:o}))),L=w.load().then(function(){return b(window.google.maps),window.google.maps}),b(L),L};function k(e,t,o){var n=o-t;return e===o?e:((e-t)%n+n)%n+t}var O=function(){function e(e,t){if(isNaN(e)||isNaN(t))throw new Error(\"Invalid LatLng object: (\"+e+\", \"+t+\")\");this.lat=+e,this.lng=+t}return e.prototype.wrap=function(){return new e(this.lat,k(this.lng,-180,180))},e}();O.convert=function(e){return e instanceof O?e:Array.isArray(e)?new O(e[0],e[1]):\"lng\"in e&&\"lat\"in e?new O(e.lat,e.lng):e};var x=function(){function e(e,t,o){this.tileSize=e||512,this._minZoom=t||0,this._maxZoom=o||52,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this.zoom=0,this.center=new O(0,0),this.angle=0}var t,o=e.prototype;return o.zoomScale=function(e){return Math.pow(2,e)},o.scaleZoom=function(e){return Math.log(e)/Math.LN2},o.project=function(e,t){return new s(this.lngX(e.lng,t),this.latY(e.lat,t))},o.unproject=function(e,t){return new O(this.yLat(e.y,t),this.xLng(e.x,t))},o.lngX=function(e,t){return(180+e)*(t||this.worldSize)/360},o.latY=function(e,t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))*(t||this.worldSize)/360},o.xLng=function(e,t){return 360*e/(t||this.worldSize)-180},o.yLat=function(e,t){return 360/Math.PI*Math.atan(Math.exp((180-360*e/(t||this.worldSize))*Math.PI/180))-90},o.locationPoint=function(e){var t=this.project(e);return this.centerPoint._sub(this.point._sub(t)._rotate(this.angle))},o.pointLocation=function(e){var t=this.centerPoint._sub(e)._rotate(-this.angle);return this.unproject(this.point.sub(t))},(t=[{key:\"minZoom\",get:function(){return this._minZoom},set:function(e){this._minZoom=e,this.zoom=Math.max(this.zoom,e)}},{key:\"maxZoom\",get:function(){return this._maxZoom},set:function(e){this._maxZoom=e,this.zoom=Math.min(this.zoom,e)}},{key:\"worldSize\",get:function(){return this.tileSize*this.scale}},{key:\"centerPoint\",get:function(){return new s(0,0)}},{key:\"size\",get:function(){return new s(this.width,this.height)}},{key:\"bearing\",get:function(){return-this.angle/Math.PI*180},set:function(e){this.angle=-k(e,-180,180)*Math.PI/180}},{key:\"zoom\",get:function(){return this._zoom},set:function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom}},{key:\"x\",get:function(){return this.lngX(this.center.lng)}},{key:\"y\",get:function(){return this.latY(this.center.lat)}},{key:\"point\",get:function(){return new s(this.x,this.y)}}])&&function(e,t){for(var o=0;o0&&this.getHeight()-o-r>0){var a=this.transform_.pointLocation(s.convert({x:i-this.getWidth()/2,y:o-this.getHeight()/2})),p=this.transform_.pointLocation(s.convert({x:this.getWidth()/2-n,y:this.getHeight()/2-r})),l=[a.lat,a.lng,p.lat,p.lng,p.lat,a.lng,a.lat,p.lng];return t&&(l=l.map(function(e){return Math.round(e*t)/t})),l}return[0,0,0,0]},e}();function S(e){if(window.requestAnimationFrame)return window.requestAnimationFrame(e);var t=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;return t?t(e):window.setTimeout(e,1e3/60)}var E=Math.log2?Math.log2:function(e){return Math.log(e)/Math.LN2};function P(e,t){return Object.keys(e).reduce(function(o,n){return t(e[n])&&(o[n]=e[n]),o},{})}var A=function(e){if(null!==e&&\"object\"==typeof e){if(0===Object.keys(e).length)return!0}else if(null==e||\"\"===e)return!0;return!1},I=Object.prototype.toString;function N(e){return\"number\"==typeof e||function(e){return!!e&&\"object\"==typeof e}(e)&&\"[object Number]\"===I.call(e)}var Z=null;function j(){if(Z)return Z;if(\"undefined\"!=typeof navigator){var e=navigator.userAgent.indexOf(\"MSIE\")>-1,t=navigator.userAgent.indexOf(\"Firefox\")>-1,o=navigator.userAgent.toLowerCase().indexOf(\"op\")>-1,n=navigator.userAgent.indexOf(\"Chrome\")>-1,r=navigator.userAgent.indexOf(\"Safari\")>-1;return n&&r&&(r=!1),n&&o&&(n=!1),Z={isExplorer:e,isFirefox:t,isOpera:o,isChrome:n,isSafari:r}}return Z={isChrome:!0,isExplorer:!1,isFirefox:!1,isOpera:!1,isSafari:!1}}var U=function(e){return Function.prototype.toString.call(e)};function H(e){if(!e||\"object\"!=typeof e)return!1;var t=\"function\"==typeof e.constructor?Object.getPrototypeOf(e):Object.prototype;if(null===t)return!0;var o=t.constructor;return\"function\"==typeof o&&o instanceof o&&U(o)===U(Object)}function K(e,t,o,n){e.addEventListener(t,o,function(){var e=!1;try{var t=Object.defineProperty({},\"passive\",{get:function(){e=!0}});window.addEventListener(\"test\",t,t),window.removeEventListener(\"test\",t,t)}catch(t){e=!1}return e}()?{capture:n,passive:!0}:n)}var R,G=!(\"undefined\"==typeof window||!window.document||!window.document.createElement);R=G?window:\"undefined\"!=typeof self?self:void 0;var B,W=\"undefined\"!=typeof document&&document.attachEvent,V=!1;if(G&&!W){var F=function(){var e=R.requestAnimationFrame||R.mozRequestAnimationFrame||R.webkitRequestAnimationFrame||function(e){return R.setTimeout(e,20)};return function(t){return e(t)}}(),$=(B=R.cancelAnimationFrame||R.mozCancelAnimationFrame||R.webkitCancelAnimationFrame||R.clearTimeout,function(e){return B(e)}),q=function(e){var t=e.__resizeTriggers__,o=t.firstElementChild,n=t.lastElementChild,r=o.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,r.style.width=o.offsetWidth+1+\"px\",r.style.height=o.offsetHeight+1+\"px\",o.scrollLeft=o.scrollWidth,o.scrollTop=o.scrollHeight},Y=function(e){var t=this;q(this),this.__resizeRAF__&&$(this.__resizeRAF__),this.__resizeRAF__=F(function(){(function(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height})(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach(function(o){o.call(t,e)}))})},X=!1,J=\"\",Q=\"animationstart\",ee=\"Webkit Moz O ms\".split(\" \"),te=\"webkitAnimationStart animationstart oAnimationStart MSAnimationStart\".split(\" \");if(G){var oe=document.createElement(\"fakeelement\");if(void 0!==oe.style.animationName&&(X=!0),!1===X)for(var ne=0;ne0||r.geoService_.getHeight()>0){var e=Math.ceil(r.geoService_.getWidth()/256)+2,t=Math.ceil(r.geoService_.getHeight()/256)+2,o=Math.max(e,t);return Math.ceil(E(o))}return 3},r._computeMinZoom=function(e){return A(e)?r._getMinZoom():e},r._mapDomResizeCallback=function(){if(r.resetSizeOnIdle_=!0,r.maps_){var e=r.props.center||r.props.defaultCenter,t=r.map_.getCenter();r.maps_.event.trigger(r.map_,\"resize\"),r.map_.setCenter(r.props.resetBoundsOnResize?e:t)}},r._setLayers=function(e){e.forEach(function(e){r.layers_[e]=new r.maps_[e],r.layers_[e].setMap(r.map_)})},r._renderPortal=function(){return e.createElement(M,{experimental:r.props.experimental,onChildClick:r._onChildClick,onChildMouseDown:r._onChildMouseDown,onChildMouseEnter:r._onChildMouseEnter,onChildMouseLeave:r._onChildMouseLeave,geoService:r.geoService_,insideMapPanes:!0,distanceToMouse:r.props.distanceToMouse,getHoverDistance:r._getHoverDistance,dispatcher:r.markersDispatcher_})},r._initMap=function(){if(!r.initialized_){r.initialized_=!0;var e=le(r.props.center||r.props.defaultCenter);r.geoService_.setView(e,r.props.zoom||r.props.defaultZoom,0),r._onBoundsChanged();var t=a({},r.props.apiKey&&{key:r.props.apiKey},r.props.bootstrapURLKeys);r.props.googleMapLoader(t,r.props.heatmapLibrary).then(function(e){if(r.mounted_){var t,o,i=r.geoService_.getCenter(),s={zoom:r.props.zoom||r.props.defaultZoom,center:new e.LatLng(i.lat,i.lng)};r.props.heatmap.positions&&(Object.assign(l(r),{heatmap:(t=e,o=r.props.heatmap,new t.visualization.HeatmapLayer({data:o.positions.reduce(function(e,o){var n=o.weight,r=void 0===n?1:n;return e.push({location:new t.LatLng(o.lat,o.lng),weight:r}),e},[])}))}),function(e,t){var o=t.options,n=void 0===o?{}:o;Object.keys(n).map(function(t){return e.set(t,n[t])})}(r.heatmap,r.props.heatmap));var p=P(e,H),u=\"function\"==typeof r.props.options?r.props.options(p):r.props.options,h=!A(r.props.draggable)&&{draggable:r.props.draggable},c=r._computeMinZoom(u.minZoom);r.minZoom_=c;var d=a({},{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:\"poi\",elementType:\"labels\",stylers:[{visibility:\"off\"}]}],minZoom:3},{minZoom:c},u,s);r.defaultDraggableOption_=A(d.draggable)?r.defaultDraggableOption_:d.draggable;var m=a({},d,h);m.minZoom=ue(m.minZoom,c);var g=new e.Map(n.findDOMNode(r.googleMapDom_),m);r.map_=g,r.maps_=e,r._setLayers(r.props.layerTypes);var _=e.version.match(/^3\\.(\\d+)\\./),f=_&&Number(_[1]),v=l(r),M=Object.assign(new e.OverlayView,{onAdd:function(){var t=\"undefined\"!=typeof screen?screen.width+\"px\":\"2000px\",o=\"undefined\"!=typeof screen?screen.height+\"px\":\"2000px\",n=document.createElement(\"div\");if(n.style.backgroundColor=\"transparent\",n.style.position=\"absolute\",n.style.left=\"0px\",n.style.top=\"0px\",n.style.width=t,n.style.height=o,v.props.overlayViewDivStyle){var r=v.props.overlayViewDivStyle;\"object\"==typeof r&&Object.keys(r).forEach(function(e){n.style[e]=r[e]})}this.getPanes().overlayMouseTarget.appendChild(n),v.geoService_.setMapCanvasProjection(e,M.getProjection()),ae?v.setState({overlay:n}):pe(v,v._renderPortal(),n,function(){return v.setState({overlay:n})})},onRemove:function(){var e=v.state.overlay;e&&!ae&&n.unmountComponentAtNode(e),v.setState({overlay:null})},draw:function(){if(v.updateCounter_++,v._onBoundsChanged(g,e,!v.props.debounced),v.googleApiLoadedCalled_||(v._onGoogleApiLoaded({map:g,maps:e,ref:v.googleMapDom_}),v.googleApiLoadedCalled_=!0),v.mouse_){var t=v.geoService_.fromContainerPixelToLatLng(v.mouse_);v.mouse_.lat=t.lat,v.mouse_.lng=t.lng}v._onChildMouseMove(),v.markersDispatcher_&&(v.markersDispatcher_.emit(\"kON_CHANGE\"),v.fireMouseEventOnIdle_&&v.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\"))}});r.overlay_=M,M.setMap(g),r.props.heatmap.positions&&r.heatmap.setMap(g),r.props.onTilesLoaded&&e.event.addListener(g,\"tilesloaded\",function(){v._onTilesLoaded()}),e.event.addListener(g,\"zoom_changed\",function(){v.geoService_.getZoom()!==g.getZoom()&&(v.zoomAnimationInProgress_||(v.zoomAnimationInProgress_=!0,v._onZoomAnimationStart(g.zoom)),f<32)&&((new Date).getTime()-r.zoomControlClickTime_<300?S(function(){return S(function(){v.updateCounter_++,v._onBoundsChanged(g,e)})}):(v.updateCounter_++,v._onBoundsChanged(g,e)))}),e.event.addListener(g,\"idle\",function(){if(r.resetSizeOnIdle_){r._setViewSize();var t=r._computeMinZoom(u.minZoom);t!==r.minZoom_&&(r.minZoom_=t,g.setOptions({minZoom:t})),r.resetSizeOnIdle_=!1}v.zoomAnimationInProgress_&&(v.zoomAnimationInProgress_=!1,v._onZoomAnimationEnd(g.zoom)),v.updateCounter_++,v._onBoundsChanged(g,e),v.dragTime_=0,v.markersDispatcher_&&v.markersDispatcher_.emit(\"kON_CHANGE\")}),e.event.addListener(g,\"mouseover\",function(){v.mouseInMap_=!0}),e.event.addListener(g,\"click\",function(){v.mouseInMap_=!0}),e.event.addListener(g,\"mouseout\",function(){v.mouseInMap_=!1,v.mouse_=null,v.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\")}),e.event.addListener(g,\"drag\",function(){v.dragTime_=(new Date).getTime(),v._onDrag(g)}),e.event.addListener(g,\"dragend\",function(){var t=e.event.addListener(g,\"idle\",function(){e.event.removeListener(t),v._onDragEnd(g)})}),e.event.addListener(g,\"maptypeid_changed\",function(){v._onMapTypeIdChange(g.getMapTypeId())})}}).catch(function(e){throw r._onGoogleApiLoaded({map:null,maps:null,ref:r.googleMapDom_}),console.error(e),e})}},r._onGoogleApiLoaded=function(){var e;r.props.onGoogleApiLoaded&&(\"production\"!==process.env.NODE_ENV&&!0!==r.props.yesIWantToUseGoogleMapApiInternals&&console.warn(\"GoogleMap: Usage of internal api objects is dangerous and can cause a lot of issues.\\nTo hide this warning add yesIWantToUseGoogleMapApiInternals={true} to 50&&(r.boundingRect_=e.currentTarget.getBoundingClientRect()),r.mouseMoveTime_=t;var o=e.clientX-r.boundingRect_.left,n=e.clientY-r.boundingRect_.top;r.mouse_||(r.mouse_={x:0,y:0,lat:0,lng:0}),r.mouse_.x=o,r.mouse_.y=n;var i=r.geoService_.fromContainerPixelToLatLng(r.mouse_);r.mouse_.lat=i.lat,r.mouse_.lng=i.lng,r._onChildMouseMove(),t-r.dragTime_<100?r.fireMouseEventOnIdle_=!0:(r.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\"),r.fireMouseEventOnIdle_=!1)}},r._onClick=function(){var e;return r.props.onClick&&!r.childMouseDownArgs_&&(new Date).getTime()-r.childMouseUpTime_>300&&0===r.dragTime_&&(e=r.props).onClick.apply(e,arguments)},r._onMapClick=function(e){r.markersDispatcher_&&(r._onMapMouseMove(e),(new Date).getTime()-r.dragTime_>100&&(r.mouse_&&r._onClick(a({},r.mouse_,{event:e})),r.markersDispatcher_.emit(\"kON_CLICK\",e)))},r._onMapMouseDownNative=function(e){r.mouseInMap_&&r._onMapMouseDown(e)},r._onMapMouseDown=function(e){r.markersDispatcher_&&(new Date).getTime()-r.dragTime_>100&&(r._onMapMouseMove(e),r.markersDispatcher_.emit(\"kON_MDOWN\",e))},r._onMapMouseDownCapture=function(){j().isChrome&&(r.zoomControlClickTime_=(new Date).getTime())},r._onKeyDownCapture=function(){j().isChrome&&(r.zoomControlClickTime_=(new Date).getTime())},r._isCenterDefined=function(e){return e&&(H(e)&&N(e.lat)&&N(e.lng)||2===e.length&&N(e[0])&&N(e[1]))},r._onBoundsChanged=function(e,t,o){if(e){var n=e.getCenter();r.geoService_.setView([n.lat(),n.lng()],e.getZoom(),0)}if((r.props.onChange||r.props.onBoundsChange)&&r.geoService_.canProject()){var i=r.geoService_.getZoom(),s=r.geoService_.getBounds(),p=r.geoService_.getCenter();if(!function(e,t,o){if(e&&t){for(var n=0;n!==e.length;++n)if(Math.abs(e[n]-t[n])>1e-5)return!1;return!0}return!1}(s,r.prevBounds_)&&!1!==o){var l=r.geoService_.getBounds(r.props.margin);r.props.onBoundsChange&&r.props.onBoundsChange(r.centerIsObject_?a({},p):[p.lat,p.lng],i,s,l),r.props.onChange&&r.props.onChange({center:a({},p),zoom:i,bounds:{nw:{lat:s[0],lng:s[1]},se:{lat:s[2],lng:s[3]},sw:{lat:s[4],lng:s[5]},ne:{lat:s[6],lng:s[7]}},marginBounds:{nw:{lat:l[0],lng:l[1]},se:{lat:l[2],lng:l[3]},sw:{lat:l[4],lng:l[5]},ne:{lat:l[6],lng:l[7]}},size:r.geoService_.hasSize()?{width:r.geoService_.getWidth(),height:r.geoService_.getHeight()}:{width:0,height:0}}),r.prevBounds_=s}}},r._registerChild=function(e){r.googleMapDom_=e},r.mounted_=!1,r.initialized_=!1,r.googleApiLoadedCalled_=!1,r.map_=null,r.maps_=null,r.prevBounds_=null,r.heatmap=null,r.layers_={},r.mouse_=null,r.mouseMoveTime_=0,r.boundingRect_=null,r.mouseInMap_=!0,r.dragTime_=0,r.fireMouseEventOnIdle_=!1,r.updateCounter_=0,r.markersDispatcher_=new c(l(r)),r.geoService_=new T(256),r.centerIsObject_=H(r.props.center),r.minZoom_=3,r.defaultDraggableOption_=!0,r.zoomControlClickTime_=0,r.childMouseDownArgs_=null,r.childMouseUpTime_=0,r.googleMapDom_=null,\"production\"!==process.env.NODE_ENV&&(r.props.apiKey&&console.warn(\"GoogleMap: apiKey is deprecated, use bootstrapURLKeys={{key: YOUR_API_KEY}} instead.\"),r.props.onBoundsChange&&console.warn(\"GoogleMap: onBoundsChange is deprecated, use onChange({center, zoom, bounds, ...other}) instead.\"),A(r.props.center)&&A(r.props.defaultCenter)&&console.warn(\"GoogleMap: center or defaultCenter property must be defined\"),A(r.props.zoom)&&A(r.props.defaultZoom)&&console.warn(\"GoogleMap: zoom or defaultZoom property must be defined\")),r._isCenterDefined(r.props.center||r.props.defaultCenter)){var i=le(r.props.center||r.props.defaultCenter);r.geoService_.setView(i,r.props.zoom||r.props.defaultZoom,0)}return r.zoomAnimationInProgress_=!1,r.state={overlay:null},r}p(o,t);var r=o.prototype;return r.componentDidMount=function(){var e=this;this.mounted_=!0,K(window,\"resize\",this._onWindowResize,!1),K(window,\"keydown\",this._onKeyDownCapture,!0);var t=n.findDOMNode(this.googleMapDom_);t&&K(t,\"mousedown\",this._onMapMouseDownNative,!0),K(window,\"mouseup\",this._onChildMouseUp,!1);var o=a({},this.props.apiKey&&{key:this.props.apiKey},this.props.bootstrapURLKeys);this.props.googleMapLoader(o,this.props.heatmapLibrary),setTimeout(function(){e._setViewSize(),e._isCenterDefined(e.props.center||e.props.defaultCenter)&&e._initMap()},0,this),this.props.resetBoundsOnResize&&function(e,t){if(void 0===e.parentNode){var o=document.createElement(\"div\");e.parentNode=o}e=e.parentNode,W?e.attachEvent(\"onresize\",t):(e.__resizeTriggers__||(\"static\"==getComputedStyle(e).position&&(e.style.position=\"relative\"),function(){if(!V){var e=(ie||\"\")+\".resize-triggers { \"+(se||\"\")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName(\"head\")[0],o=document.createElement(\"style\");o.type=\"text/css\",o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e)),t.appendChild(o),V=!0}}(),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement(\"div\")).className=\"resize-triggers\",e.__resizeTriggers__.innerHTML='
',e.appendChild(e.__resizeTriggers__),q(e),K(e,\"scroll\",Y,!0),Q&&e.__resizeTriggers__.addEventListener(Q,function(t){t.animationName==re&&q(e)})),e.__resizeListeners__.push(t))}(t,this._mapDomResizeCallback)},r.shouldComponentUpdate=function(e,t){return!_(d(this.props,[\"draggable\"]),d(e,[\"draggable\"]))||!_(this.state,t)},r.componentDidUpdate=function(e){var t=this;if(\"production\"!==process.env.NODE_ENV&&(_(e.defaultCenter,this.props.defaultCenter)||console.warn(\"GoogleMap: defaultCenter prop changed. You can't change default props.\"),_(e.defaultZoom,this.props.defaultZoom)||console.warn(\"GoogleMap: defaultZoom prop changed. You can't change default props.\")),!this._isCenterDefined(e.center)&&this._isCenterDefined(this.props.center)&&setTimeout(function(){return t._initMap()},0),this.map_){var o=this.geoService_.getCenter();if(this._isCenterDefined(this.props.center)){var n=le(this.props.center),r=this._isCenterDefined(e.center)?le(e.center):null;(!r||Math.abs(n.lat-r.lat)+Math.abs(n.lng-r.lng)>1e-5)&&Math.abs(n.lat-o.lat)+Math.abs(n.lng-o.lng)>1e-5&&this.map_.panTo({lat:n.lat,lng:n.lng})}if(A(this.props.zoom)||Math.abs(this.props.zoom-e.zoom)>0&&this.map_.setZoom(this.props.zoom),!A(e.draggable)&&A(this.props.draggable)?this.map_.setOptions({draggable:this.defaultDraggableOption_}):_(e.draggable,this.props.draggable)||this.map_.setOptions({draggable:this.props.draggable}),!A(this.props.options)&&!_(e.options,this.props.options)){var i=P(this.maps_,H),s=\"function\"==typeof this.props.options?this.props.options(i):this.props.options;if(\"minZoom\"in(s=d(s,[\"zoom\",\"center\",\"draggable\"]))){var a=this._computeMinZoom(s.minZoom);s.minZoom=ue(s.minZoom,a)}this.map_.setOptions(s)}_(this.props.layerTypes,e.layerTypes)||(Object.keys(this.layers_).forEach(function(e){t.layers_[e].setMap(null),delete t.layers_[e]}),this._setLayers(this.props.layerTypes)),this.heatmap&&!_(this.props.heatmap.positions,e.heatmap.positions)&&this.heatmap.setData(this.props.heatmap.positions.map(function(e){return{location:new t.maps_.LatLng(e.lat,e.lng),weight:e.weight}})),this.heatmap&&!_(this.props.heatmap.options,e.heatmap.options)&&Object.keys(this.props.heatmap.options).forEach(function(e){t.heatmap.set(e,t.props.heatmap.options[e])})}this.markersDispatcher_.emit(\"kON_CHANGE\"),_(this.props.hoverDistance,e.hoverDistance)||this.markersDispatcher_.emit(\"kON_MOUSE_POSITION_CHANGE\")},r.componentWillUnmount=function(){this.mounted_=!1;var e,t,o=n.findDOMNode(this.googleMapDom_);o&&o.removeEventListener(\"mousedown\",this._onMapMouseDownNative,!0),window.removeEventListener(\"resize\",this._onWindowResize),window.removeEventListener(\"keydown\",this._onKeyDownCapture),window.removeEventListener(\"mouseup\",this._onChildMouseUp,!1),this.props.resetBoundsOnResize&&(t=this._mapDomResizeCallback,e=(e=o).parentNode,W?e.detachEvent(\"onresize\",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener(\"scroll\",Y),e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)))),this.overlay_&&this.overlay_.setMap(null),this.maps_&&this.map_&&this.props.shouldUnregisterMapOnUnmount&&(this.map_.setOptions({scrollwheel:!1}),this.maps_.event.clearInstanceListeners(this.map_)),this.props.shouldUnregisterMapOnUnmount&&(this.map_=null,this.maps_=null),this.markersDispatcher_.dispose(),this.resetSizeOnIdle_=!1,this.props.shouldUnregisterMapOnUnmount&&(delete this.map_,delete this.markersDispatcher_)},r.render=function(){var t=this.state.overlay,o=t?null:e.createElement(C,{experimental:this.props.experimental,onChildClick:this._onChildClick,onChildMouseDown:this._onChildMouseDown,onChildMouseEnter:this._onChildMouseEnter,onChildMouseLeave:this._onChildMouseLeave,geoService:this.geoService_,insideMapPanes:!1,distanceToMouse:this.props.distanceToMouse,getHoverDistance:this._getHoverDistance,dispatcher:this.markersDispatcher_});return e.createElement(\"div\",{style:this.props.style,onMouseMove:this._onMapMouseMove,onMouseDownCapture:this._onMapMouseDownCapture,onClick:this._onMapClick},e.createElement(h,{registerChild:this._registerChild}),ae&&t&&pe(this._renderPortal(),t),o)},o}(t);function ce(e){var t=e.lng,o=Math.sin(e.lat*Math.PI/180),n=t/360+.5,r=.5-.25*Math.log((1+o)/(1-o))/Math.PI;return{x:n,y:r=r<0?0:r>1?1:r}}function de(e){var t=e.x,o=Math.PI-2*Math.PI*e.y;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o))),lng:360*t-180}}function me(e,t,o,n){var r=ce(e),i=ce(t),s=r.x0?.5*(r.x+i.x-1):.5*(1+r.x+i.x),y:.5*(r.y+i.y)},c=Math.pow(2,u),d=o/c/256/2,m=n/c/256/2,g=de({x:h.x-d,y:h.y-m}),_=de({x:h.x+d,y:h.y+m});return{center:de(h),zoom:u,newBounds:{nw:g,se:_}}}function ge(e){var t=e.ne,o=e.sw;return{nw:{lat:t.lat,lng:o.lng},se:{lat:o.lat,lng:t.lng}}}function _e(e){var t=e.nw,o=e.se;return{ne:{lat:t.lat,lng:o.lng},sw:{lat:o.lat,lng:t.lng}}}function fe(e,t){var o,n=e.nw,r=e.se,i=e.ne,s=e.sw,p=t.width,l=t.height;if(n&&r)o=me(n,r,p,l);else{var u=ge({ne:i,sw:s});o=me(u.nw,u.se,p,l)}return a({},o,{newBounds:a({},o.newBounds,_e(o.newBounds))})}function ve(e,t,o){var n=function(e,t){var o=function(e,t){var o,n=t.lat,r=t.lng,i=(o=n*Math.PI/180,{metersPerLatDegree:111132.92-559.82*Math.cos(2*o)+1.175*Math.cos(4*o)-.0023*Math.cos(6*o),metersPerLngDegree:111412.84*Math.cos(o)-93.5*Math.cos(3*o)+.118*Math.cos(5*o)}),s=.5*e/i.metersPerLatDegree,a=.5*e/i.metersPerLngDegree;return{nw:{lat:n-s,lng:r-a},se:{lat:n+s,lng:r+a}}}(e,{lat:t.lat,lng:t.lng}),n=o.se,r=ce(o.nw),i=ce(n);return{w:Math.abs(i.x-r.x),h:Math.abs(i.y-r.y)}}(e,{lat:t.lat,lng:t.lng}),r=n.w,i=n.h,s=Math.pow(2,o);return{w:r*s*256,h:i*s*256}}function Me(e,t){var o=e.x,n=Math.PI-2*Math.PI*e.y/Math.pow(2,t);return{lat:180/Math.PI*Math.atan(.5*(Math.exp(n)-Math.exp(-n))),lng:o/Math.pow(2,t)*360-180}}function ye(e,t){var o=ce({lat:e.lat,lng:e.lng}),n=Math.pow(2,t);return{x:Math.floor(o.x*n),y:Math.floor(o.y*n)}}function Ce(e,t){for(var o=e.from,n=e.to,r=Math.pow(2,t),i=[],s=o.x;s!==(n.x+1)%r;s=(s+1)%r)for(var a=o.y;a!==(n.y+1)%r;a=(a+1)%r)i.push([t,s,a]);return i}he.propTypes={apiKey:o.string,bootstrapURLKeys:o.any,defaultCenter:o.oneOfType([o.array,o.shape({lat:o.number,lng:o.number})]),center:o.oneOfType([o.array,o.shape({lat:o.number,lng:o.number})]),defaultZoom:o.number,zoom:o.number,onBoundsChange:o.func,onChange:o.func,onClick:o.func,onChildClick:o.func,onChildMouseDown:o.func,onChildMouseUp:o.func,onChildMouseMove:o.func,onChildMouseEnter:o.func,onChildMouseLeave:o.func,onZoomAnimationStart:o.func,onZoomAnimationEnd:o.func,onDrag:o.func,onDragEnd:o.func,onMapTypeIdChange:o.func,onTilesLoaded:o.func,options:o.any,distanceToMouse:o.func,hoverDistance:o.number,debounced:o.bool,margin:o.array,googleMapLoader:o.any,onGoogleApiLoaded:o.func,yesIWantToUseGoogleMapApiInternals:o.bool,draggable:o.bool,style:o.any,resetBoundsOnResize:o.bool,layerTypes:o.arrayOf(o.string),shouldUnregisterMapOnUnmount:o.bool},he.defaultProps={distanceToMouse:function(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))},hoverDistance:30,debounced:!0,options:function(){return{overviewMapControl:!1,streetViewControl:!1,rotateControl:!0,mapTypeControl:!1,styles:[{featureType:\"poi\",elementType:\"labels\",stylers:[{visibility:\"off\"}]}],minZoom:3}},googleMapLoader:z,yesIWantToUseGoogleMapApiInternals:!1,style:{width:\"100%\",height:\"100%\",margin:0,padding:0,position:\"relative\"},layerTypes:[],heatmap:{},heatmapLibrary:!1,shouldUnregisterMapOnUnmount:!0},he.googleMapLoader=z;export default he;export{ge as convertNeSwToNwSe,_e as convertNwSeToNeSw,fe as fitBounds,Ce as getTilesIds,ye as latLng2Tile,ve as meters2ScreenPixels,Me as tile2LatLng};\n//# sourceMappingURL=index.modern.js.map\n","import React from 'react';\nimport { renderToString } from 'react-dom/server';\n\nimport Tabs, { TabsProps } from 'antd/lib/tabs';\nimport Modal from 'antd/lib/modal';\nimport GoogleMapReact from 'google-map-react';\nimport Tag from 'antd/lib/tag';\n\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\n\nimport { LocationPortal } from '@app/objects/CompanyPortal';\n\nimport '@app/scss/components/locations.scss';\nimport { Location } from '@app/objects/Location';\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\nimport { getLocationName } from '@app/components/Utils';\nimport Stars from '@app/components/UI/Stars/Stars';\n\ninterface IPros {\n\tlocations: Array;\n\tcontainerClassName?: string;\n\tcontent?: (location: LocationPortal) => JSX.Element;\n\treviews?: (location: LocationPortal) => React.ReactNode;\n\thideTitle?: boolean;\n\thideLink?: boolean;\n}\n\ninterface MapProps {\n\taddress: string;\n\taddressList?: Array;\n}\n\nexport const getAddress = (item) => {\n\treturn [item.addressEn, item.city, item.state, item.zip].filter((e) => e).join(', ');\n};\n\nconst getClinicAvatar = (location: Location): string => {\n\tif (location.portalOriginalAvatar) {\n\t\treturn `/remote/${location.portalOriginalAvatar}`;\n\t}\n\tif (location.portalAvatar) {\n\t\treturn `/remote/${location.portalAvatar}`;\n\t}\n\treturn '';\n};\n\nfunction codeAddress(map, maps, address: string, addressList?: Array, onLoad?: (address, result, openPopup, callback) => void) {\n\tconst geocoder = new maps.Geocoder();\n\tconst gedData = (item: string | Location) => {\n\t\tconst isLocation = typeof item !== 'string';\n\t\tconst currentAddress = !isLocation ? item : getAddress(item);\n\t\tgeocoder.geocode({ address: currentAddress }, (results, status) => {\n\t\t\tif (status === 'OK') {\n\t\t\t\tif (address === currentAddress) {\n\t\t\t\t\tmap.setCenter(results[0].geometry.location);\n\t\t\t\t}\n\t\t\t\t// eslint-disable-next-line\n\t\t\t\tconst marker = new maps.Marker({\n\t\t\t\t\tmap,\n\t\t\t\t\tposition: results[0].geometry.location,\n\t\t\t\t\tclickable: true,\n\t\t\t\t});\n\t\t\t\tif (isLocation) {\n\t\t\t\t\tconst locationName = getLocationName(item, false);\n\t\t\t\t\tconst avatar = getClinicAvatar(item);\n\t\t\t\t\tconst infowindow = new google.maps.InfoWindow({\n\t\t\t\t\t\tcontent: `${isLocation ? renderToString(\n\t\t\t\t\t\t\t{avatar ?
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
: ''}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{locationName}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{item.portalDescription\n\t\t\t\t\t\t\t\t&&
\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t
) : currentAddress}`,\n\t\t\t\t\t\tariaLabel: '',\n\t\t\t\t\t});\n\t\t\t\t\tconst onClick = () => {\n\t\t\t\t\t\tinfowindow.open({\n\t\t\t\t\t\t\tanchor: marker,\n\t\t\t\t\t\t\tmap,\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tmarker.addListener('click', onClick);\n\t\t\t\t\tif (address === currentAddress) {\n\t\t\t\t\t\tonClick();\n\t\t\t\t\t}\n\t\t\t\t\tonLoad && onLoad(currentAddress, results[0].geometry.location, {\n\t\t\t\t\t\topen: onClick,\n\t\t\t\t\t\tclose: () => {\n\t\t\t\t\t\t\tinfowindow.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t}, () => {\n\t\t\t\t\t\tmarker.removeListener('click', onClick);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tonLoad && onLoad(currentAddress, results[0].geometry.location, undefined, () => undefined);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.log(`Geocode was not successful for the following reason: ${status}`);\n\t\t\t}\n\t\t});\n\t};\n\tconst list: any = addressList || [];\n\t(list?.map((item) => (typeof item === 'string' ? item : getAddress(item))).includes(address) ? list : address ? [address].concat(list) : list)\n\t\t.forEach(gedData);\n}\n\nexport const SimpleMap: React.FC = ({ address, addressList }) => {\n\tconst [maps, setMaps] = React.useState();\n\tconst [map, setMap] = React.useState();\n\tconst listenersRef = React.useRef([]);\n\tconst addressRef = React.useRef({});\n\tconst popupRef = React.useRef({});\n\tconst defaultProps = {\n\t\tcenter: { lat: -34.397, lng: 150.644 },\n\t\tzoom: 12,\n\t};\n\n\tReact.useEffect(() => {\n\t\tif (map && maps) {\n\t\t\tif (addressRef.current[address]) {\n\t\t\t\tmap.setCenter(addressRef.current[address]);\n\t\t\t\tif (popupRef.current[address]) {\n\t\t\t\t\tObject.values(popupRef.current).forEach((item: any) => {\n\t\t\t\t\t\titem?.close();\n\t\t\t\t\t});\n\t\t\t\t\tpopupRef.current[address]?.open();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcodeAddress(map, maps, address);\n\t\t\t}\n\t\t}\n\t}, [address]);\n\n\tReact.useEffect(() => {\n\t\tif (listenersRef.current.length) {\n\t\t\treturn () => listenersRef.current.forEach((callback) => callback());\n\t\t}\n\t}, []);\n\n\tconst renderMarker = (map, maps) => {\n\t\tsetMap(map);\n\t\tsetMaps(maps);\n\t\treturn codeAddress(map, maps, address, addressList, (address, result, openPopup, callback) => {\n\t\t\tlistenersRef.current.concat(callback);\n\t\t\taddressRef.current[address] = result;\n\t\t\tpopupRef.current[address] = openPopup;\n\t\t});\n\t};\n\n\treturn (\n\t\t\n\t\t\t renderMarker(map, maps)}\n\t\t\t/>\n\t\t
\n\t);\n};\n\ninterface ILocationModal {\n\tlocation: Location;\n\tbuttonClassName?: string;\n\tbuttonValue?: JSX.Element;\n}\n\nexport const LocationModal: React.FC = ({ location, buttonValue, buttonClassName }) => {\n\tconst [visible, setVisible] = React.useState(false);\n\n\tconst close = () => setVisible(false);\n\n\tconst open = () => setVisible(true);\n\tconst { addressEn, zip, city } = location;\n\n\treturn (\n\t\t<>\n\t\t\t\n\t\t\t\t{buttonValue || location.nameEn}\n\t\t\t \n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t{location.nameEn}\n\t\t\t\t\t \n\t\t\t\t>}\n\t\t\t\twidth={600}\n\t\t\t\tclassName=\"location-popap\"\n\t\t\t\tfooter={null}\n\t\t\t>\n\t\t\t\t\n\t\t\t\t\tAddress: \n\t\t\t\t\t{' '}\n\t\t\t\t\t{addressEn}\n\t\t\t\t\t,\n\t\t\t\t\t{' '}\n\t\t\t\t\t{city}\n\t\t\t\t\t,\n\t\t\t\t\t{' '}\n\t\t\t\t\t{zip}\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\tPhone: \n\t\t\t\t\t{' '}\n\t\t\t\t\t{location.phone}\n\t\t\t\t
\n\t\t\t\t \n\t\t\t \n\t\t>\n\t);\n};\n\nconst showTime = (time) => {\n\tconst [h, m] = time.split(':');\n\treturn `${+h > 12 ? `${+h - 12}` : h}:${m} ${+h > 12 ? 'p' : 'a'}.m.`;\n};\n\nconst days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\nconst LocationNode: React.FC<{ content, reviews?, item, hideLink?, hideMap?}> = ({\n\titem, reviews, content, hideLink, hideMap = false,\n}) => {\n\tconst arr = React.useMemo(() =>\n\t\t[item.addressEn, item.city, item.state, item.zip].filter((str) => str), []);\n\tconst address = arr.filter((e) => e).join(', ');\n\n\tconst workingHours = React.useMemo(() => {\n\t\tif (!item.workingHours) return [];\n\t\tconst whs = item.workingHours?.slice()\n\t\t\t?.sort((a, b) => {\n\t\t\t\tif (a.dayOfWeek === 0) return 1;\n\t\t\t\tif (b.dayOfWeek === 0) return -1;\n\t\t\t\treturn a.dayOfWeek - b.dayOfWeek;\n\t\t\t});\n\t\tconst obj: any = {};\n\t\twhs.forEach((wh) => {\n\t\t\tconst key = `${wh.startTime}-${wh.endTime}`;\n\t\t\tif (!obj[key]) {\n\t\t\t\tobj[key] = [{ ...wh }];\n\t\t\t} else {\n\t\t\t\tobj[key] = obj[key].concat(wh);\n\t\t\t}\n\t\t});\n\t\treturn Object.values(obj)\n\t\t\t.map((arr: any, i) => {\n\t\t\t\tlet title = days[arr[0].dayOfWeek];\n\t\t\t\tfor (let i = 1; i < arr.length; i++) {\n\t\t\t\t\tconst isEnd = arr[i].dayOfWeek === 6 && arr[i + 1]?.dayOfWeek === 0;\n\t\t\t\t\tif (arr[i].dayOfWeek - 1 !== arr[i - 1]?.dayOfWeek && !isEnd && !(arr[i].dayOfWeek === 0 && arr[i - 1]?.dayOfWeek === 6)) {\n\t\t\t\t\t\ttitle = `${title}, ${days[arr[i].dayOfWeek]}`;\n\t\t\t\t\t} else if (i + 1 === arr.length\n\t\t\t\t\t\t|| (arr[i].dayOfWeek + 1 !== arr[i + 1]?.dayOfWeek && !isEnd)) {\n\t\t\t\t\t\ttitle = `${title} - ${days[arr[i].dayOfWeek]}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tid: i,\n\t\t\t\t\ttitle,\n\t\t\t\t\tstartTime: arr[0].startTime,\n\t\t\t\t\tendTime: arr[0].endTime,\n\t\t\t\t};\n\t\t\t});\n\t}, [item.workingHours]);\n\n\treturn \n\t\t
\n\t\t\t{address ? <>\n\t\t\t\t
\n\t\t\t\t\tAddress: \n\t\t\t\t \n\t\t\t\t{address}\n\t\t\t> : null}\n\t\t\t{workingHours.length ? <>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\tWorking Hours: \n\t\t\t\t \n\t\t\t\t{workingHours.map((wh) =>
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{wh.title}\n\t\t\t\t\t\t\t:\n\t\t\t\t\t\t \n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t{showTime(wh.startTime)}\n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t-\n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t{showTime(wh.endTime)}\n\t\t\t\t\t \n\t\t\t\t )}\n\t\t\t> : null}\n\t\t\t{hideLink ? null :
\n\t\t\t\t\n\t\t\t\t\tMore About\n\t\t\t\t\t{' '}\n\t\t\t\t\t{item.nameEn}\n\t\t\t\t\t{' '}\n\t\t\t\t\tClinic\n\t\t\t\t \n\t\t\t
}\n\t\t
\n\t\t{hideMap ? null :
\n\t\t\t
\n\t\t\t
\n\t\t\t\t{content && content(item)}\n\t\t\t
\n\t\t
}\n\t\t{reviews &&
\n\t\t\t{reviews && reviews(item)}\n\t\t
\n\t\t}\n\t
;\n};\n\nconst Locations: React.FC = ({\n\tlocations, containerClassName, content, reviews, hideTitle, hideLink,\n}) => {\n\tif (locations.length === 1) {\n\t\tconst item = locations[0];\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{hideTitle ? null :
\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t
\n\t\t\t\t\t\t{getLocationName(item, false)}\n\t\t\t\t\t}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\tconst items: TabsProps['items'] = locations.map((item, index) => {\n\t\treturn {\n\t\t\tkey: index.toString(),\n\t\t\tlabel: getLocationName(item, false),\n\t\t\tclassName: 'location-tab',\n\t\t\tchildren: ,\n\t\t};\n\t});\n\n\treturn (\n\t\tlocations.length > 0 ? \n\t\t\t \n\t\t
: null\n\t);\n};\n\nexport default Locations;\n","import React from 'react';\nimport ContentLoader from 'react-content-loader';\n\nconst SpecialImageLoader = (props) => (\n\t\n\t\t \n\t \n);\n\nexport default SpecialImageLoader;\n","import * as React from 'react';\nimport { NavLink } from 'react-router-dom';\n\nimport Tag from 'antd/lib/tag';\n\nimport { Product } from '@app/objects/Product/Product';\n\nconst ProductTag: React.FC<{product: Product}> = (props) => {\n\tconst product = props.product;\n\treturn (<>\n\t\t{product.path\n\t\t\t? \n\t\t\t\t\n\t\t\t\t\t{product.name}\n\t\t\t\t \n\t\t\t \n\t\t\t: \n\t\t\t\t{product.name}\n\t\t\t \n\t\t}\n\t>);\n};\n\nexport default ProductTag;\n","import React from 'react';\nimport ContentLoader from 'react-content-loader';\n\nconst PreviewImageLoader = (props) => (\n\t\n\t\t \n\t \n);\n\nexport default PreviewImageLoader;\n","import * as React from 'react';\nimport { useHistory } from 'react-router-dom';\n\nimport Tag from 'antd/lib/tag';\n\nimport ServerPageProvider from '@common/react/components/Core/ServerPageProvider/ServerPageProvider';\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\nimport { ItemEditorWrapper } from '@common/react/components/Core/ItemEditor/ItemEditorWrapper';\nimport ResizeObserverContainer from '@common/react/components/UI/ResizeObserverContainer/ResizeObserverContainer';\n\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\n\nimport AddToCartButton from '@app/components/UI/AddToCartButton/AddToCartButton';\nimport SpecialImageLoader from '@app/components/UI/SpecialImageLoader/SpecialImageLoader';\nimport ProductTag from '@app/components/Pages/Products/ProductTag';\nimport { Special } from '@app/objects/Special';\nimport SpecialsCarousel from '@app/components/UI/SpecialsCarousel/SpecialsCarousel';\nimport PreviewImageLoader from '@app/components/UI/SpecialImageLoader/PreviewImageLoader';\n\nimport '@app/scss/components/specialProductInfo.scss';\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\nimport useShoppingCart from '@app/hooks/useShoppingCart';\nimport { transformSpecialToCartItem } from '@app/objects/CartItem';\nimport Locations from '@app/components/Pages/DoctorPortal/Locations';\n\nimport noImage from '@images/no-image.jpg';\n\ninterface InnerProps {\n\tpopularSpecials?: Array;\n\tforPreview?: boolean;\n\tshowLocation?: boolean;\n}\n\nconst BuyNow: React.FC<{ specialForStore, className? }> = (props) => {\n\tconst history = useHistory();\n\tconst { getItem, addCartItem } = useShoppingCart();\n\tconst {\n\t\tspecialForStore,\n\t\tclassName = '',\n\t} = props;\n\tconst storedItem = getItem(specialForStore?.id);\n\n\treturn {\n\t\t\te.preventDefault();\n\t\t\tif (!storedItem) {\n\t\t\t\taddCartItem(specialForStore, 1);\n\t\t\t}\n\t\t\thistory.push('/ordering');\n\t\t}}\n\t\tclassName={`special-buy-now-button ${className}`}\n\t>\n\t\t\n\t\t\tBuy now\n\t\t \n\t ;\n};\n\nexport const SpecialPageInner: React.FC = ({ popularSpecials, forPreview = false, showLocation }) => {\n\tconst [imgLoading, setImgLoading] = React.useState(true);\n\tconst [hide, setHide] = React.useState(true);\n\tconst [height, setHeight] = React.useState(100);\n\n\tReact.useEffect(() => {\n\t\tsetHide(false);\n\t}, []);\n\n\treturn \n\t\tclassName=\"special-container\"\n\t\trender={({ state: { item: special } }) => {\n\t\t\tconst specialForStore = transformSpecialToCartItem(special);\n\n\t\t\tif (!forPreview) {\n\t\t\t\treturn <>\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{imgLoading\n\t\t\t\t\t\t\t\t\t\t? forPreview\n\t\t\t\t\t\t\t\t\t\t\t?
\n\t\t\t\t\t\t\t\t\t\t\t:
\n\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t
setImgLoading(false)}\n\t\t\t\t\t\t\t\t\t\thidden={imgLoading}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t
setHeight(height + 20)}>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t{imgLoading\n\t\t\t\t\t\t\t\t\t\t\t\t? forPreview\n\t\t\t\t\t\t\t\t\t\t\t\t\t?
\n\t\t\t\t\t\t\t\t\t\t\t\t\t:
\n\t\t\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t
setImgLoading(false)}\n\t\t\t\t\t\t\t\t\t\t\t\thidden={imgLoading}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t{special.name &&
{special.name} }\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.price)} \n\t\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.originalPrice)} \n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{special.name &&
\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.price)} \n\t\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.originalPrice)} \n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{special.name}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{!showLocation && special.location\n\t\t\t\t\t\t\t\t\t\t\t&&
\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t{special.location.nameEn}\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t{special?.procedures?.length > 0 && <>\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tProcedures\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t{special.procedures.map((item) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{item.procedure.name}\n\t\t\t\t\t\t\t\t\t\t\t\t\t )}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t>}\n\t\t\t\t\t\t\t\t\t\t{special?.products?.length > 0 && <>\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tProducts\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t{special.products.map((item) => item.product\n\t\t\t\t\t\t\t\t\t\t\t\t\t&&
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t
)}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t>}\n\t\t\t\t\t\t\t\t\t\t{special.description &&
{special.description}
}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{showLocation && special.location &&
}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{popularSpecials && popularSpecials.length > 0 && \n\t\t\t\t\t\t \n\t\t\t\t\t
}\n\t\t\t\t\t\n\t\t\t\t>;\n\t\t\t}\n\n\t\t\treturn <>\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{imgLoading\n\t\t\t\t\t\t\t\t\t? forPreview\n\t\t\t\t\t\t\t\t\t\t?
\n\t\t\t\t\t\t\t\t\t\t:
\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t
setImgLoading(false)}\n\t\t\t\t\t\t\t\t\thidden={imgLoading}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t{forPreview ? null\n\t\t\t\t\t\t\t\t: <>\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{special.name &&
{special.name} }\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{special.location\n\t\t\t\t\t\t\t\t\t\t&&
\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t{special.location.nameEn}\n\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t{special?.procedures?.length > 0 && <>\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\tProcedures\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t{special.procedures.map((item) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t{item.procedure.name}\n\t\t\t\t\t\t\t\t\t\t\t\t )}\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t>}\n\t\t\t\t\t\t\t\t\t{special?.products?.length > 0 && <>\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\tProducts\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t{special.products.map((item) => item.product\n\t\t\t\t\t\t\t\t\t\t\t\t&&
\n\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t
)}\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t>}\n\t\t\t\t\t\t\t\t\t{special.description &&
{special.description}
}\n\t\t\t\t\t\t\t\t\t{forPreview ? null :
\n\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.price)} \n\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.originalPrice)} \n\t\t\t\t\t\t\t\t\t
}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{forPreview && <>\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.price)} \n\t\t\t\t\t\t\t\t\t\t{getMoneyString(special.originalPrice)} \n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t>}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{forPreview &&
\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tShow more details \n\t\t\t\t\t\t\t
}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{popularSpecials && popularSpecials.length > 0 && \n\t\t\t\t\t \n\t\t\t\t
}\n\t\t\t>;\n\t\t}}\n\t\tbackPath=\"\"\n\t/>;\n};\n\nconst SpecialPageProvider: React.FC = () => {\n\treturn (\n\t\t }\n\t\t\treloadByPathChange\n\t\t\tinner={(page) => (\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t
\n\t\t\t)}\n\t\t/>\n\t);\n};\n\nexport default SpecialPageProvider;\n","import React from 'react';\nimport ContentLoader from 'react-content-loader';\n\nconst CardImageLoader = (props) => (\n\t\n\t\t \n\t \n);\n\nexport default CardImageLoader;\n","import * as React from 'react';\n\nimport Modal from 'antd/lib/modal';\n\nimport { ItemProvider } from '@common/react/components/Core/ItemProvider/ItemProvider';\n\nimport '@app/scss/components/specialModal.scss';\nimport { SpecialPageInner } from '@app/components/Pages/Specials/Special';\n\ninterface Props {\n\tid: number;\n}\n\nconst SpecialModal: React.FC = ({ id }) => {\n\tconst [open, setOpen] = React.useState(false);\n\n\tconst preventDefault = (e: React.MouseEvent): void => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t};\n\n\tconst handleOpen = () => {\n\t\tsetOpen(true);\n\t};\n\n\tconst handleClose = () => {\n\t\tsetOpen(false);\n\t};\n\n\treturn preventDefault(e)}>\n\t\t
Fast Preview
\n\t\t
\n\t\t\t\n\t\t\t\t \n\t\t\t \n\t\t \n\t
;\n};\n\nexport default SpecialModal;\n","import * as React from 'react';\nimport { NavLink } from 'react-router-dom';\n\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\n\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\n\nimport TextWithTooltip from '@app/components/UI/TextWithTooltip/TextWithTooltip';\nimport AddToCartButton from '@app/components/UI/AddToCartButton/AddToCartButton';\nimport { Special } from '@app/objects/Special';\nimport CardImageLoader from '@app/components/UI/CardImageLoader/CardImageLoader';\nimport SpecialModal from '@app/components/UI/SpecialModal/SpecialModal';\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\n\nimport noImage from '@images/no-image.jpg';\n\ninterface SpecialCardProps {\n\titem: Special;\n\tlazyLoad?: boolean;\n}\n\nconst SpecialName: React.FC<{name: string, className?: string}> = ({ name, className }) => {\n\treturn ;\n};\n\nexport const SpecialLocation: React.FC<{text: string}> = ({ text }) => {\n\treturn ;\n};\n\nconst SpecialCardContent: React.FC = (props) => {\n\tconst {\n\t\titem,\n\t\tlazyLoad,\n\t} = props;\n\tconst [loading, setLoading] = React.useState(true);\n\n\tReact.useEffect(() => {\n\t\tsetLoading(false);\n\t}, []);\n\n\treturn <>\n\t\t\n\t\t\t \n\t\t\t{loading && }\n\t\t\t setLoading(false)}\n\t\t\t\thidden={loading}\n\t\t\t/>\n\t\t
\n\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t
\n\t\t\t\t{item.location\n\t\t\t\t\t&&
\n\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t}\n\t\t\t\t{item.description\n\t\t\t\t\t?
\n\t\t\t\t\t\t{item.description}\n\t\t\t\t\t
\n\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t\t
\n\t\t\t\t\t{getMoneyString(item.price)} \n\t\t\t\t\t{getMoneyString(item.originalPrice)} \n\t\t\t\t
\n\t\t\t\t
e.preventDefault()}>\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t>;\n};\n\nconst SpecialCard: React.FC = ({ item, lazyLoad = true }) => {\n\treturn \n\t\t{item.path\n\t\t\t?
\n\t\t\t\t \n\t\t\t \n\t\t\t:
\n\t\t\t\t \n\t\t\t
\n\t\t}\n\t
;\n};\n\nexport default SpecialCard;\n","import * as React from 'react';\nimport { Route, RouteProps, Redirect } from 'react-router-dom';\nimport { shallowEqual, useSelector } from 'react-redux';\nimport { Helmet } from 'react-helmet';\n\nimport { loadable, loadableDelay } from '@common/react/loadable/loadableSettings';\nimport ErrorBoundaryWithSentry from '@common/react/components/UI/ErrorBoundaryWithSentry/ErrorBoundaryWithSentry';\nimport { RequestProvider } from '@common/react/components/RequestProvider/RequestProvider';\n\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\n\nimport { ApplicationState } from '@app/store';\n\nconst params = {\n\tfallback: ,\n};\n\nconst DashboardLayout = loadable(() => loadableDelay(/* webpackChunkName: \"DashboardLayout\" */\n\timport('@app/components/Layouts/DashboardLayout/DashboardLayout'),\n), params);\n\ninterface Props extends RouteProps {\n\tcomponent: any;\n\tredirectPath?: string;\n\ttitle?: string;\n}\n\nconst DashboardRoute: React.FC = ({\n\tcomponent: Component, redirectPath = '/', title, ...rest\n}) => {\n\tconst user = useSelector((state: ApplicationState) => state.login.user, shallowEqual);\n\treturn (user ? \n\t\t\t{title && \n\t\t\t\t{title} \n\t\t\t }\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t \n\t\t : )}\n\t/>;\n};\n\nexport default DashboardRoute;\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';\n\nimport { useHistory } from 'react-router-dom';\n\nimport GA4React from 'ga-4-react';\n\ninterface RouteChangeTrackerProps {\n\tid: string;\n}\n\nconst RouteChangeTracker: React.FC = ({ id, children }) => {\n\tconst history = useHistory();\n\tReact.useEffect(() => {\n\t\tif (process.env.NODE_ENV === 'production') {\n\t\t\tconst ga4react = new GA4React(id);\n\n\t\t\tga4react.initialize().then((ga4) => {\n\t\t\t\tga4.pageview(window.location.pathname + window.location.search);\n\n\t\t\t\thistory.listen((location, action) => {\n\t\t\t\t\tif (GA4React.isInitialized()) {\n\t\t\t\t\t\tga4react.pageview(location.pathname + location.search);\n\t\t\t\t\t\tga4react.gtag('set', 'page', location.pathname);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, console.error);\n\t\t}\n\t}, []);\n\n\treturn <>{children}>;\n};\n\nexport default RouteChangeTracker;\n","import * as React from 'react';\n\nexport const MainLayout: React.FC = (props) => {\n\treturn \n\t\t{props.children}\n\t
;\n};\n","import * as React from 'react';\nimport { NavLink } from 'react-router-dom';\n\nimport ImageLazy from '@common/react/components/UI/ImageLazy/ImageLazy';\n\nconst year = new Date().getFullYear();\n\nconst Footer: React.FC = () => {\n\treturn ;\n};\n\nexport default Footer;\n","import React from 'react';\nimport { Route, RouteProps } from 'react-router-dom';\n\nimport ErrorBoundaryWithSentry from '@common/react/components/UI/ErrorBoundaryWithSentry/ErrorBoundaryWithSentry';\n\nimport { MainLayout } from '@app/components/Layouts/MainLayout';\n\nimport Footer from '@app/components/UI/Footer/Footer';\n\ninterface Props extends RouteProps {\n\tcomponent: any;\n}\n\nconst RouteWithFooter: React.FC = ({ component: Component, ...rest }) => (\n\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t \n\t\t\t }\n\t/>\n);\n\nexport default RouteWithFooter;\n","import * as React from 'react';\n\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\n\nimport '@app/scss/components/addToCartButton.scss';\nimport { Special } from '@app/objects/Special';\nimport { CartItem, transformSpecialToCartItem } from '@app/objects/CartItem';\nimport useShoppingCart from '@app/hooks/useShoppingCart';\n\ninterface Props {\n\tspecial: Special | CartItem;\n\twithTotal?: boolean;\n}\n\nconst AddToCartButton: React.FC = (props) => {\n\tconst specialForStore = transformSpecialToCartItem(props.special);\n\tconst { addCartItem, updateCartItemQuantity, getItem } = useShoppingCart();\n\n\tconst [isInitialized, setIsInitialized] = React.useState(false);\n\n\tReact.useEffect(() => {\n\t\tsetIsInitialized(true);\n\t}, [isInitialized]);\n\n\tconst storedItem: CartItem | undefined = getItem(specialForStore.id);\n\n\tconst withTotal = props.withTotal ?? true;\n\n\tconst getQuantityTitle = (quantity: number) => {\n\t\treturn `${quantity} unit${quantity > 1 ? 's' : ''}`;\n\t};\n\n\tconst quantity = storedItem?.quantity;\n\n\treturn \n\t\t{isInitialized && storedItem && quantity\n\t\t\t?
\n\t\t\t\t
updateCartItemQuantity(storedItem.id, quantity - 1)}\n\t\t\t\t>\n\t\t\t\t\t–\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t\t
{getQuantityTitle(quantity)}
\n\t\t\t\t\t{withTotal &&
{getMoneyString(storedItem.itemTotal || 0)}
}\n\t\t\t\t
\n\t\t\t\t
updateCartItemQuantity(storedItem.id, quantity + 1)}\n\t\t\t\t>\n\t\t\t\t\t+\n\t\t\t\t \n\t\t\t
\n\t\t\t:
addCartItem(specialForStore, 1)}>Add to cart \n\t\t}\n\t
;\n};\n\nexport default AddToCartButton;\n","import React from 'react';\nimport { CartProvider, useCart } from 'react-use-cart';\n\nimport { List } from '@common/typescript/objects/List';\n\nimport { request } from '@app/components/Api';\nimport { Special } from '@app/objects/Special';\nimport { transformSpecialToCartItem } from '@app/objects/CartItem';\n\nconst CartProviderWithUpdate: React.FC = ({ children }) => {\n\tconst {\n\t\titems, updateItem, removeItem, isEmpty,\n\t} = useCart();\n\n\tconst cartItemsIds = React.useMemo(() => items.map((item) => item.id), []);\n\n\tconst updateCartItems = (specialsList: Array) => {\n\t\tif (!isEmpty) {\n\t\t\tif (cartItemsIds.length > specialsList.length) {\n\t\t\t\tconst specialsIds = specialsList.map((special) => special.id.toString());\n\t\t\t\tconst shouldDelete = cartItemsIds.filter((id) => !specialsIds.includes(id));\n\n\t\t\t\tfor (let i = 0; i < shouldDelete.length; i++) {\n\t\t\t\t\tremoveItem(shouldDelete[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < cartItemsIds.length; i++) {\n\t\t\t\tconst actualSpecial = specialsList.find((special) => special.id.toString() === cartItemsIds[i]);\n\t\t\t\tif (actualSpecial) {\n\t\t\t\t\tconst specialForStore = transformSpecialToCartItem(actualSpecial);\n\t\t\t\t\tupdateItem(actualSpecial.id.toString(), specialForStore);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst firstLoad = () => {\n\t\tif (cartItemsIds.length === 0) return;\n\n\t\trequest>('specialsList', {\n\t\t\tids: cartItemsIds,\n\t\t})\n\t\t\t.then((res) => {\n\t\t\t\tupdateCartItems(res.list);\n\t\t\t})\n\t\t\t.catch((err) => console.log(err));\n\t};\n\n\tReact.useEffect(() => {\n\t\tfirstLoad();\n\t}, []);\n\n\treturn <>\n\t\t{children}\n\t>;\n};\n\nconst CartProviderWithUpdateWrapper: React.FC = ({ children }) => {\n\treturn \n\t\t\n\t\t\t{children}\n\t\t \n\t ;\n};\n\nexport default CartProviderWithUpdateWrapper;\n","import * as React from 'react';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\n\nimport { bindActionCreators } from 'redux';\n\nimport { getActionCreators } from '@common/react/store/Login';\nimport { BaseUser } from '@common/react/objects/BaseUser';\nimport { BaseApplicationState } from '@common/react/store';\n\ninterface OwnProps {\n\trender?: (logout: (event: React.MouseEvent) => void) => JSX.Element;\n\tclearState?: boolean;\n}\n\nconst Logout: React.FC = ({ render, clearState }) => {\n\tconst dispatch = useDispatch();\n\tconst login = useSelector((state: BaseApplicationState) => state.login, shallowEqual);\n\tconst { logoff } = React.useMemo(() => bindActionCreators(getActionCreators(), dispatch), [login.user]);\n\n\tconst logout = (event: React.MouseEvent) => {\n\t\tevent.preventDefault();\n\t\tlogoff(clearState);\n\t};\n\n\treturn render ? render(logout) : Logout ;\n};\n\nexport default Logout;\n","import React from 'react';\n\nimport { request } from '@common/react/components/Api';\n\ninterface Props {\n\ttransmuted: boolean;\n\trender?: (transmuteBack: () => void) => JSX.Element;\n\tonSuccess?: () => void;\n}\n\nconst TransmutationBack: React.FC = ({ transmuted, render, onSuccess }) => {\n\tconst transmuteBack = () => {\n\t\trequest('transmutation', {\n\t\t\tid: 0,\n\t\t\ttransmutation: !transmuted,\n\t\t}).then(() => {\n\t\t\twindow.location.href = '/';\n\t\t\tonSuccess && onSuccess();\n\t\t}).catch((err) => console.log(err));\n\t};\n\n\tconst renderComponent = render\n\t\t? render(transmuteBack)\n\t\t: (\n\t\t\t \n\t\t );\n\n\treturn <>{transmuted && renderComponent}>;\n};\n\nexport default TransmutationBack;\n","import React from 'react';\n\nimport Message from 'antd/lib/message';\nimport Modal from 'antd/lib/modal';\n\nimport { request } from '@app/components/Api';\n\nconst DashboardTopAlert: React.FC<{objectId: number}> = ({ objectId }) => {\n\tconst handleClick = () => {\n\t\trequest('sendConfirmEmail', { id: objectId })\n\t\t\t.then(() => Modal.success({ content: 'The activation email has been successfully sent.' }))\n\t\t\t.catch(Message.error);\n\t};\n\n\treturn ;\n};\n\nexport default DashboardTopAlert;\n","import React from 'react';\nimport { useCart } from 'react-use-cart';\n\nimport Popover from 'antd/lib/popover';\n\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\nimport { getPopupContainer } from '@common/react/components/Utils/Utils';\n\nimport ShoppingCartInformation from '@app/components/UI/ShoppingCartInformation/ShoppingCartInformation';\n\ninterface Props {\n\twithoutPopover?: boolean;\n}\n\nconst ShoppingCartDropdown: React.FC = ({ withoutPopover }) => {\n\tconst [isInitialized, setIsInitialized] = React.useState(false);\n\tconst { totalItems } = useCart();\n\n\tReact.useEffect(() => {\n\t\tsetIsInitialized(true);\n\t}, []);\n\n\tconst totalCount = isInitialized ? totalItems : 0;\n\n\tconst content = (\n\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t{totalCount}\n\t\t\t
\n\t\t
\n\t );\n\n\tif (withoutPopover) {\n\t\treturn {content}
;\n\t}\n\n\treturn \n\t\t
\n\t\t\t\t\t\t\tCheck out\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{content}\n\t\t \n\t
;\n};\n\nexport default ShoppingCartDropdown;\n","import React from 'react';\nimport { useHistory } from 'react-router-dom';\nimport { shallowEqual, useSelector } from 'react-redux';\n\nimport Drawer from 'antd/lib/drawer';\n\nimport Logout from '@common/react/components/UI/Logout/Logout';\nimport { transformArrayToList } from '@common/typescript/objects/List';\n\nimport { ApplicationState } from '@app/store';\nimport { Menu as CustomMenu } from '@app/components/UI/Menu/Menu';\nimport { UserRole } from '@app/objects/User';\n\ninterface BurgerMenuProps {\n\tgetPopupContainer?: (node) => HTMLElement;\n}\n\nexport const menu = [\n\t{\n\t\tpath: '/specials',\n\t\tname: 'Specials Shop',\n\t\tclassName: 'menu-item_gray',\n\t},\n\t{\n\t\tpath: '/doctors',\n\t\tname: 'Schedule Appointment',\n\t\tclassName: 'menu-item_orange',\n\t},\n\t{\n\t\tpath: '/login',\n\t\tname: 'Patient Login',\n\t\tprivate: false,\n\t\tclassName: 'menu-item_blue',\n\t},\n\t{\n\t\tpath: '',\n\t\tname: 'Search',\n\t\ticon: 'search',\n\t\tclassName: 'bold-title',\n\t\tprivate: true,\n\t\tchildren: transformArrayToList([\n\t\t\t{\n\t\t\t\tpath: '/doctors',\n\t\t\t\tname: 'Doctors',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/procedures',\n\t\t\t\tname: 'Procedures',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/specialties',\n\t\t\t\tname: 'Specialties',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/clinics',\n\t\t\t\tname: 'Clinics',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/locations',\n\t\t\t\tname: 'Locations',\n\t\t\t},\n\t\t]),\n\t},\n\t{\n\t\tpath: '/doctors',\n\t\tname: 'Doctors',\n\t\tprivate: false,\n\t},\n\t{\n\t\tpath: '/procedures',\n\t\tname: 'Procedures',\n\t\tprivate: false,\n\t},\n\t{\n\t\tpath: '/specialties',\n\t\tname: 'Specialties',\n\t\tprivate: false,\n\t},\n\t{\n\t\tpath: '/clinics',\n\t\tname: 'Clinics',\n\t\tprivate: false,\n\t},\n\t{\n\t\tpath: '/locations',\n\t\tname: 'Locations',\n\t\tprivate: false,\n\t},\n\t{\n\t\tpath: '/profile',\n\t\tname: 'Profile',\n\t\ticon: 'user-circle',\n\t\tclassName: 'bold-title',\n\t\tprivate: true,\n\t},\n\t{\n\t\tpath: '/dashboard',\n\t\tname: 'Dashboard',\n\t\ticon: 'home',\n\t\tclassName: 'bold-title',\n\t\tprivate: true,\n\t},\n\t{\n\t\tpath: '/appointment-list',\n\t\tname: 'Appointments',\n\t\ticon: 'calendar-plus-o',\n\t\tclassName: 'bold-title',\n\t\tprivate: true,\n\t},\n\t{\n\t\tpath: '/analysis-list',\n\t\tname: 'Lab. Orders',\n\t\ticon: 'flask',\n\t\tclassName: 'bold-title',\n\t\tprivate: true,\n\t},\n\t{\n\t\tpath: '/bills',\n\t\tname: 'Bills',\n\t\ticon: 'usd',\n\t\tclassName: 'bold-title',\n\t\tprivate: true,\n\t},\n\t{\n\t\tpath: '',\n\t\tname: 'Documents',\n\t\ticon: 'file-code-o',\n\t\tclassName: 'bold-title',\n\t\tprivate: true,\n\t\tchildren: transformArrayToList([\n\t\t\t{\n\t\t\t\tpath: '/orders',\n\t\t\t\tname: 'Purchases',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/document-list',\n\t\t\t\tname: 'Health Records',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/questionnaires',\n\t\t\t\tname: 'Questionnaires',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/consent-forms',\n\t\t\t\tname: 'Consent|Medical Documents',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/instructions',\n\t\t\t\tname: 'Instructions',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/prescriptions-list',\n\t\t\t\tname: 'Prescriptions',\n\t\t\t},\n\t\t]),\n\t},\n\t{\n\t\tpath: '',\n\t\tadmin: true,\n\t\tname: 'Admin',\n\t\ticon: 'user-secret',\n\t\tclassName: 'bold-title',\n\t\tchildren: transformArrayToList([\n\t\t\t{\n\t\t\t\tpath: '/user-list',\n\t\t\t\tname: 'Users',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/shortLink-list',\n\t\t\t\tname: 'Short Links',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/authLink-list',\n\t\t\t\tname: 'Auth Links',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/user-session-list',\n\t\t\t\tname: 'Entry Log Journal',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/page-list',\n\t\t\t\tname: 'Pages',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/inquiry-list',\n\t\t\t\tname: 'Inquiries',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/email-templates',\n\t\t\t\tname: 'Email Templates',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/marketing-emails',\n\t\t\t\tname: 'Marketing Emails',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/emailLogs',\n\t\t\t\tname: 'Email Log',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/smsLogs',\n\t\t\t\tname: 'Sms Log',\n\t\t\t},\n\t\t\t{\n\t\t\t\tpath: '/base-hosted-service-list',\n\t\t\t\tname: 'Hosted Services',\n\t\t\t},\n\t\t]),\n\t},\n\t{\n\t\tpath: '',\n\t\tname: '',\n\t\tprivate: true,\n\t\tnode: \n\t\t\t \n\t\t\t\t\tLogout\n\t\t\t\t }\n\t\t\t\tclearState\n\t\t\t/>\n\t\t ,\n\t},\n];\n\nconst BurgerMenu: React.FC = ({ getPopupContainer }) => {\n\tconst [open, setOpen] = React.useState(false);\n\tconst user = useSelector((state: ApplicationState) => state.login.user, shallowEqual);\n\tconst onClose = () => setOpen(false);\n\tconst history = useHistory();\n\n\tReact.useEffect(() => {\n\t\tsetOpen(false);\n\t}, [history.location.pathname]);\n\n\tconst resultMenu = React.useMemo(() => {\n\t\treturn menu.filter((item) => (item.admin\n\t\t\t? user && user.role === UserRole.Admin\n\t\t\t: item.private === undefined || (user && item.private) || (!user && !item.private)));\n\t}, [user]);\n\n\treturn <>\n\t\t\n\t\t\t \n\t\t \n\t\t setOpen((prev) => !prev)}>\n\t\t\t \n\t\t \n\t>;\n};\n\nexport default BurgerMenu;\n","import React from 'react';\n\ninterface Props {\n\taddress: string;\n\tclassName?: string;\n}\n\nconst LocationLink: React.FC = ({ address, children, className }) => {\n\tconst link = React.useMemo(() => {\n\t\tlet res = `https://maps.google.com/maps/search/?api=1&query=${address}`;\n\t\tif (typeof window !== 'undefined') {\n\t\t\tif (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n\t\t\t\tres = `maps://maps.google.com/maps/search/?api=1&query=${address}`;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}, [address]);\n\n\treturn \n\t\t{children}\n\t ;\n};\n\nexport default LocationLink;\n","import React from 'react';\n\nimport Select from 'antd/lib/select';\n\nimport Autocomplete, { OptionType } from '@common/react/components/Forms/Autocomplete/Autocomplete';\nimport { WithId } from '@common/typescript/objects/WithId';\nimport { Nullable } from '@common/typescript/objects/Nullable';\n\nimport { DoctorSpecialty } from '@commonTuna/react/objects/DoctorSpecialty';\nimport { GlobalProcedure } from '@commonTuna/react/objects/GlobalProcedure';\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\n\nimport { Doctor } from '@app/objects/Doctor';\n\ninterface SearchResultRow extends WithId {\n\tdoctor: Nullable;\n\tspecialties: Nullable;\n\tglobalProcedure: Nullable;\n}\n\ninterface Props {\n\tvalue: string;\n\tonSelect: (value, option) => void;\n\tonChange: (value) => void;\n\tinitType?: SearchType;\n\tonSearchClick?: (e) => void;\n\tonCloseClick?: (e) => void;\n\tinitFocus?: boolean;\n}\n\ninterface Options {\n\tlabel: React.ReactNode;\n\toptions: Array;\n}\n\nexport const emptyValues = {\n\tdoctorId: undefined,\n\tglobalProcedureId: undefined,\n\tspecialtyId: undefined,\n\tglobalPayerId: undefined,\n\tspecialId: undefined,\n\tlocationId: undefined,\n\tprofessionId: undefined,\n};\n\nexport const clearValues = Object.keys(emptyValues)\n\t.map((key) => ({ name: key, value: undefined } as any))\n\t.concat([{ name: 'text', value: '' }]);\n\nconst { Option } = Select;\n\nenum SearchType {\n\tAll = 0,\n\tDoctor = 1,\n\tProcedure = 2,\n\tSpeciality = 3,\n\tClinic = 4,\n\tInsurance = 5,\n\tSpecial = 6,\n\tLocation = 7\n}\n\nconst searchOptions = [\n\t{ name: 'All', value: SearchType.All },\n\t{ name: 'Doctors', value: SearchType.Doctor },\n\t{ name: 'Procedures', value: SearchType.Procedure },\n\t{ name: 'Specialities', value: SearchType.Speciality },\n\t{ name: 'Clinics', value: SearchType.Clinic },\n\t{ name: 'Insurances', value: SearchType.Insurance },\n\t{ name: 'Specials', value: SearchType.Special },\n\t{ name: 'Locations', value: SearchType.Location },\n];\n\nconst sections = ['doctor', 'globalProcedure', 'specialty', 'insurance', 'clinic', 'profession', 'special', 'location'];\n\nconst Search: React.FC = ({\n\tvalue, onChange, onSelect, initType, onSearchClick, initFocus, onCloseClick,\n}) => {\n\tconst [type, setType] = React.useState(initType || SearchType.All);\n\tconst ref = React.useRef(null);\n\n\tReact.useEffect(() => {\n\t\tinitFocus && ref.current?.focus();\n\t}, [initFocus]);\n\n\tconst renderTitle = (title, icon) => <>\n\t\t{icon}\n\t\t{' '}\n\t\t{title}\n\t>;\n\n\tconst renderItem = (value: React.ReactNode, label: React.ReactNode, option: OptionType): OptionType => {\n\t\treturn {\n\t\t\tvalue,\n\t\t\tlabel,\n\t\t\titem: option.item,\n\t\t\tkey: option.item.id,\n\t\t};\n\t};\n\n\tconst getSection = (section: string, filteredOptions: Array): Options => {\n\t\tif (section === 'doctor') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle('Doctors', ),\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(`Doctor: ${option.item.doctor.nameEn}`, option.item.doctor.nameEn, option)),\n\t\t\t};\n\t\t}\n\t\tif (section === 'globalProcedure') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle(\n\t\t\t\t\t'Procedures',\n\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t ,\n\t\t\t\t),\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(\n\t\t\t\t\t`Procedure: ${option.item.globalProcedure.name}`,\n\t\t\t\t\toption.item.globalProcedure.name,\n\t\t\t\t\toption,\n\t\t\t\t)),\n\t\t\t};\n\t\t}\n\t\tif (section === 'specialty') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle('Specialties', ),\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(`Specialty: ${option.item.specialty.name}`, option.item.specialty.name, option)),\n\t\t\t};\n\t\t}\n\t\tif (section === 'insurance') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle('Insurances', ),\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(\n\t\t\t\t\t`Insurance: ${option.item.insurance.name}`,\n\t\t\t\t\t<>\n\t\t\t\t\t\t{option.item.insurance.avatar\n\t\t\t\t\t\t\t&& \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{option.item.insurance.name}\n\t\t\t\t\t>,\n\t\t\t\t\toption,\n\t\t\t\t)),\n\t\t\t};\n\t\t}\n\t\tif (section === 'clinic') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle('Clinics', ),\n\t\t\t\toptions: filteredOptions.map((option) =>\n\t\t\t\t\trenderItem(\n\t\t\t\t\t\t`Clinic: ${option.item.clinic.company?.name} - ${option.item.clinic.nameEn}`,\n\t\t\t\t\t\t`${option.item.clinic.company?.name} - ${option.item.clinic.nameEn}`,\n\t\t\t\t\t\toption,\n\t\t\t\t\t)),\n\t\t\t};\n\t\t}\n\t\tif (section === 'profession') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle('Professions', ),\n\t\t\t\toptions: filteredOptions\n\t\t\t\t\t.map((option) => renderItem(\n\t\t\t\t\t\t`Profession: ${option.item.profession.nameEn}`,\n\t\t\t\t\t\toption.item.profession.nameEn,\n\t\t\t\t\t\toption,\n\t\t\t\t\t)),\n\t\t\t};\n\t\t}\n\t\tif (section === 'special') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle('Specials', ),\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(\n\t\t\t\t\t`Special: ${option.item.special.name}`,\n\t\t\t\t\t<>\n\t\t\t\t\t\t{option.item.special.avatar\n\t\t\t\t\t\t\t? \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t
: null}\n\t\t\t\t\t\t{option.item.special.name}\n\t\t\t\t\t>,\n\t\t\t\t\toption,\n\t\t\t\t)),\n\t\t\t};\n\t\t}\n\t\tif (section === 'location') {\n\t\t\treturn {\n\t\t\t\tlabel: renderTitle('Locations', ),\n\t\t\t\toptions: filteredOptions.map((option) => renderItem(`Location: ${option.item.location.name}`, option.item.location.name, option)),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tlabel: '',\n\t\t\toptions: [{\n\t\t\t\tvalue: '', label: '', item: '', key: -1,\n\t\t\t}],\n\t\t};\n\t};\n\n\tconst getOptions = (options: Array): Array => {\n\t\tconst result: Array = [];\n\t\tfor (let i = 0; i < sections.length; i++) {\n\t\t\tconst section = sections[i];\n\t\t\tconst filteredOptions = options.filter((o) => o.item[section] !== null);\n\t\t\tif (filteredOptions.length > 0) {\n\t\t\t\tresult.push(getSection(section, filteredOptions));\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\treturn <>\n\t\t {\n\t\t\t\tsetType(value);\n\t\t\t\tif (ref.current) {\n\t\t\t\t\tref.current.focus();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{searchOptions.map((item) => \n\t\t\t\t{item.name}\n\t\t\t )}\n\t\t \n\t\t\n\t\t\tautocompleteRef={ref}\n\t\t\ttype=\"search\"\n\t\t\tloadOnFocus\n\t\t\tgetOptions={getOptions}\n\t\t\tvalue={value}\n\t\t\tonSelect={onSelect}\n\t\t\tonChange={onChange}\n\t\t\tantdProps={{\n\t\t\t\tstyle: { width: '100%' },\n\t\t\t\tdefaultActiveFirstOption: false,\n\t\t\t\tplaceholder: 'Start type for search...',\n\t\t\t}}\n\t\t\tparams={{ count: 5, searchType: type }}\n\t\t/>\n\t\t \n\t\t \n\t>;\n};\n\nexport default Search;\n","import React from 'react';\n\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\nimport { useLocation, useHistory, NavLink } from 'react-router-dom';\n\nimport { bindActionCreators } from 'redux';\n\nimport Tag from 'antd/lib/tag';\n\nimport { parseQuery } from '@common/typescript/utils/url';\nimport { BaseParams } from '@common/react/objects/BaseParams';\nimport Logout from '@common/react/components/UI/Logout/Logout';\nimport { getUserName } from '@common/react/utils/utils';\nimport ImageLazy from '@common/react/components/UI/ImageLazy/ImageLazy';\nimport TransmutationBack from '@common/react/components/Forms/TransmutationBack';\nimport { getSearchParamsFromUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\n\nimport Avatar from '@commonTuna/react/components/UI/Avatar/Avatar';\n\nimport { ApplicationState } from '@app/store';\nimport { actionCreators } from '@app/store/HeaderSearch';\nimport DashboardTopAlert from '@app/components/UI/DashboardTopAlert/DashboardTopAlert';\nimport { SearchFilterState } from '@app/store/SearchFilter';\nimport ShoppingCartDropdown from '@app/components/UI/ShoppingCartDropdown/ShoppingCartDropdown';\nimport BurgerMenu from '@app/components/UI/Header/BurgerMenu';\nimport '@app/scss/pages/headerSearch.scss';\nimport { useMenuStateProviderContext } from '@app/components/UI/Menu/MenuStateProvider';\nimport LocationLink from '@app/components/UI/LocationLink/LocationLink';\nimport Search, { clearValues, emptyValues } from '@app/components/UI/Header/Search';\nimport { STORAGE_KEYS } from '@app/objects/StorageKeys';\n\nconst HeaderSearch: React.FC = () => {\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst { user, transmuted } = useSelector((state: ApplicationState) => state.login, shallowEqual);\n\tconst state = useSelector((state: ApplicationState) => state.header, shallowEqual);\n\tconst searchFilterData = useSelector((state: ApplicationState) => state.searchFilterData, shallowEqual);\n\tconst dispatch = useDispatch();\n\tconst { setState } = bindActionCreators(actionCreators, dispatch);\n\tconst context = useMenuStateProviderContext();\n\tconst { state: { mounted }, actions: { setState: setMenuState } } = context;\n\tconst locationData = useSelector((state: ApplicationState) => state.buildData?.item?.location, shallowEqual);\n\n\tconst userName = user ? (user.firstName || user.lastName ? getUserName(user) : user.email) : '';\n\tconst [keys, setKeys] = React.useState({ key: 'initial' });\n\n\tconst [isOpen, setIsOpen] = React.useState(false);\n\n\tconst toggle = () => setIsOpen(!isOpen);\n\n\tconst [values, setValues] = React.useState({\n\t\tlocationName: '',\n\t\tglobalPayerName: '',\n\t\ttext: '',\n\t\tlanguages: [],\n\t\tcertificates: [],\n\t});\n\n\tconst handleUrl = (arr: Array<{ name: string, value: any}>) => {\n\t\tconst searchObj = location.pathname === '/doctors' ? parseQuery(location.search)\n\t\t\t: { ...state, text: undefined };\n\n\t\tarr.forEach(({ name, value }) => {\n\t\t\tsearchObj[name] = value instanceof Array ? `[${value}]` : `${value}`;\n\t\t});\n\n\t\tconst emptyValues = ['', 'null', 'undefined', undefined, null, '-1', '[]'];\n\n\t\tconst search = Object.keys(searchObj)\n\t\t\t.filter((k) => emptyValues.indexOf(searchObj[k]) === -1)\n\t\t\t.map((k) => `${k}=${searchObj[k]}`).join('&');\n\n\t\tif (location.pathname !== '/doctors') {\n\t\t\thistory.push(`/doctors?${search}`);\n\t\t} else {\n\t\t\thistory.replace(`${location.pathname.replace(/\\/\\d+/, '/1')}?${search}`);\n\t\t}\n\t};\n\n\tconst onSelectSearch = (value, option) => {\n\t\tconst obj = option.props.item;\n\t\tconst update = (name, value) => {\n\t\t\tsetState({\n\t\t\t\t...state,\n\t\t\t\t...emptyValues,\n\t\t\t\t[name]: value,\n\t\t\t});\n\t\t\thandleUrl([...clearValues, { name, value }]);\n\t\t};\n\n\t\tif (obj.doctor !== null) {\n\t\t\tupdate('doctorId', obj.doctor.id);\n\t\t} else if (obj.specialty !== null && obj.specialty !== undefined) {\n\t\t\tupdate('specialtyId', obj.specialty.id);\n\t\t} else if (obj.globalProcedure !== null) {\n\t\t\tupdate('globalProcedureId', obj.globalProcedure.id);\n\t\t} else if (obj.clinic !== null) {\n\t\t\tupdate('locationId', obj.clinic.id);\n\t\t} else if (obj.insurance !== null) {\n\t\t\tupdate('globalPayerId', obj.insurance.id);\n\t\t} else if (obj.profession !== null) {\n\t\t\tupdate('professionId', obj.profession.id);\n\t\t} else if (obj.special !== null) {\n\t\t\tsetState({\n\t\t\t\t...state,\n\t\t\t\t...emptyValues,\n\t\t\t});\n\t\t\thistory.push(`/special/${obj.special.path}`);\n\t\t} else if (obj.location !== null) {\n\t\t\tsetState({\n\t\t\t\t...state,\n\t\t\t\t...emptyValues,\n\t\t\t});\n\t\t\thistory.push(`/location/${obj.location.path}`);\n\t\t}\n\t};\n\n\tconst handleSearchFilterResult = (searchObj: BaseParams, result: SearchFilterState) => {\n\t\tconst text = searchObj.text;\n\t\tif (!text) {\n\t\t\tif (result.doctorName) {\n\t\t\t\thandleUrl([...clearValues, { name: 'doctorId', value: searchObj.doctorId }]);\n\t\t\t} else if (result.globalProcedureName) {\n\t\t\t\thandleUrl([...clearValues, { name: 'globalProcedureId', value: searchObj.globalProcedureId }]);\n\t\t\t} else if (result.specialtyName) {\n\t\t\t\thandleUrl([...clearValues, { name: 'specialtyId', value: searchObj.specialtyId }]);\n\t\t\t} else if (result.locationName) {\n\t\t\t\thandleUrl([...clearValues, { name: 'locationId', value: searchObj.locationId }]);\n\t\t\t}\n\t\t}\n\n\t\tsetKeys((prev) => ({\n\t\t\t...prev,\n\t\t\tglobalProcedureIds: Math.random(),\n\t\t\tspecialtyIds: Math.random(),\n\t\t}));\n\t\tsetState(searchObj);\n\t};\n\n\tReact.useEffect(() => {\n\t\tlet searchObj: BaseParams = {};\n\n\t\tif (location.pathname === '/doctors') {\n\t\t\tsearchObj = getSearchParamsFromUrl(location);\n\t\t} else {\n\t\t\tsearchObj = {\n\t\t\t\tdoctorId: -1,\n\t\t\t\tspecialtyId: -1,\n\t\t\t\tglobalProcedureId: -1,\n\t\t\t};\n\t\t}\n\n\t\tif (searchObj.text) {\n\t\t\thandleUrl([\n\t\t\t\t...clearValues,\n\t\t\t\t{ name: 'text', value: searchObj.text },\n\t\t\t]);\n\t\t\tsetValues((prev) => ({\n\t\t\t\t...prev,\n\t\t\t\ttext: searchObj.text,\n\t\t\t}));\n\t\t}\n\n\t\thandleSearchFilterResult(searchObj, searchFilterData);\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tlet text = state.text;\n\t\tif (!text) {\n\t\t\tif (searchFilterData.doctorName) {\n\t\t\t\ttext = `Doctor: ${searchFilterData.doctorName}`;\n\t\t\t} else if (searchFilterData.globalProcedureName) {\n\t\t\t\ttext = `Procedure: ${searchFilterData.globalProcedureName}`;\n\t\t\t} else if (searchFilterData.specialtyName) {\n\t\t\t\ttext = `Specialty: ${searchFilterData.specialtyName}`;\n\t\t\t} else if (searchFilterData.locationName) {\n\t\t\t\ttext = `Location: ${searchFilterData.locationName}`;\n\t\t\t}\n\t\t}\n\n\t\tsetValues((prev) => ({\n\t\t\t...prev,\n\t\t\t...searchFilterData,\n\t\t\ttext: text || '',\n\t\t}));\n\t}, [searchFilterData]);\n\n\tReact.useEffect(() => {\n\t\t// setIsOpen(false);\n\t\tsetMenuState((prev) => ({ ...prev, open: false }));\n\t}, [history.location.pathname]);\n\tconst showAlert = user && !user?.emailConfirmed && !!user.email;\n\n\treturn (\n\t\t<>\n\t\t\t{user && showAlert ? \n\t\t\t\t \n\t\t\t
: null}\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t{locationData ?
\n\t\t\t\t\t\t\t \n \n\t\t\t\t\t\t\t{locationData.nameEn}\n\t\t\t\t\t\t : null}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\tvalue === '' && setState({\n\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\ttext: value,\n\t\t\t\t\t\t\t\t\t\t...emptyValues,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tsetValues((prev) => ({\n\t\t\t\t\t\t\t\t\t\t...prev,\n\t\t\t\t\t\t\t\t\t\ttext: value,\n\t\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t\t\thandleUrl([\n\t\t\t\t\t\t\t\t\t\t...clearValues,\n\t\t\t\t\t\t\t\t\t\t{ name: 'text', value },\n\t\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tinitFocus={isOpen}\n\t\t\t\t\t\t\t\tonSearchClick={() => setIsOpen(false)}\n\t\t\t\t\t\t\t\tonCloseClick={() => {\n\t\t\t\t\t\t\t\t\tsetState({\n\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\ttext: '',\n\t\t\t\t\t\t\t\t\t\t...emptyValues,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\thandleUrl([\n\t\t\t\t\t\t\t\t\t\t...clearValues,\n\t\t\t\t\t\t\t\t\t\t{ name: 'text', value: '' },\n\t\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\t\tsetKeys((prev) => ({ ...prev, key: Math.random() }));\n\t\t\t\t\t\t\t\t\tsetValues((prev) => ({ ...prev, text: '' }));\n\t\t\t\t\t\t\t\t\tif (!['doctorId', 'specialtyId', 'globalProcedureId', 'locationId', 'globalPayerId', 'professionId']\n\t\t\t\t\t\t\t\t\t\t.some((key) => state[key] && state[key] > 0) && !values.text) {\n\t\t\t\t\t\t\t\t\t\tsetIsOpen(false);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tDoctors \n\t\t\t\t\t\t\t\t\t\tProcedures \n\t\t\t\t\t\t\t\t\t\tSpecialties \n\t\t\t\t\t\t\t\t\t\tLocations \n\t\t\t\t\t\t\t\t\t\tClinics \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
toggle()}>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t{user ?
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tSpecials Shop \n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\tSchedule an Appointment \n\t\t\t\t\t\t
\n\t\t\t\t\t
: null}\n\t\t\t\t\t{user\n\t\t\t\t\t\t?
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{/*\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{user && user.unviewedMessagesCount > 0 && {user.unviewedMessagesCount}
}\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t*/}\n\t\t\t\t\t\t\t\t{/* \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t */}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t{user && user.unviewedMessagesCount > 0 && (\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t{user.unviewedMessagesCount}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t{user.unviewedNotificationsCount > 0 && (\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t{user.unviewedNotificationsCount}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t localStorage.removeItem(STORAGE_KEYS.CHECKOUT_UID)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\tclearState\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{mounted\n\t\t\t\t\t\t\t\t\t\t? setMenuState((prev) => ({ ...prev, open: !prev.open }))}>\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t: \n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t
\n\t\t\t\t\t\t:
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tSpecials Shop \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tSchedule an Appointment \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\tPatient Login \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t}\n\t\t\t\t\t
node.closest('.search-page') || document.body} />\n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tContact Us\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tEMR\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t \n\t\t\t
\n\t\t>\n\t);\n};\n\nexport default HeaderSearch;\n","import * as React from 'react';\nimport { NavLink } from 'react-router-dom';\n\nimport { MenuItem as BaseMenuItem } from '@common/react/objects/MenuItem';\nimport { Nullable } from '@common/typescript/objects/Nullable';\n\nimport { CountersState } from '@app/store/Counters';\nimport { User } from '@app/objects/User';\n\nimport '@app/scss/components/menu.scss';\n\ninterface MenuItem extends BaseMenuItem {\n\tnode?: React.ReactNode;\n\ticon?: React.ReactNode;\n}\n\ninterface MenuItemProps extends Omit {\n\titem: MenuItem;\n\tcounters?: CountersState;\n}\n\ninterface MenuProps {\n\titems: Array;\n\tcounters?: CountersState;\n\tclassName?: string;\n\twithChildren?: boolean;\n\tbasePath?: string;\n\tpathKey?: string;\n\tdefaultOpen?: boolean;\n\tuser?: Nullable;\n}\n\nconst Item: React.FC = ({\n\titem,\n\tcounters,\n\twithChildren,\n\tbasePath,\n\tpathKey,\n\tdefaultOpen,\n\tuser,\n}) => {\n\tconst [open, setOpen] = React.useState(defaultOpen || ((typeof item.isOpen !== 'undefined') ? item.isOpen : false));\n\n\tconst condition = withChildren && item.children && item.children.list && item.children.list.length > 0;\n\tconst path = item[pathKey || 'path'];\n\tconst { exact = false, isActive } = item;\n\n\t// tslint:disable-next-line:max-line-length\n\tconst className = `menu-component__item ${open && condition\n\t\t? 'menu-component__item_open' : ''} ${condition\n\t\t? 'menu-component__item_with-children' : ''} ${item.className || ''}`;\n\n\tconst requiredBadge = React.useMemo(() => {\n\t\treturn {\n\t\t\t'/chats': {\n\t\t\t\tcondition: !!user && user.unviewedMessagesCount > 0,\n\t\t\t\tvalue: user?.unviewedMessagesCount,\n\t\t\t\ttitle: 'Unviewed messages',\n\t\t\t},\n\t\t\t'/document-list': {\n\t\t\t\tcondition: !!counters && counters.notViewedDocumentsCount > 0,\n\t\t\t\tvalue: counters?.notViewedDocumentsCount,\n\t\t\t\ttitle: 'Not read documents',\n\t\t\t},\n\t\t\t'/questionnaires': {\n\t\t\t\tcondition: !!counters && counters.notAnsweredDiseasesCount > 0,\n\t\t\t\tvalue: counters?.notAnsweredDiseasesCount,\n\t\t\t\ttitle: 'Not answered questionnaires',\n\t\t\t},\n\t\t\t'/consent-forms': {\n\t\t\t\tcondition: !!counters && counters.notAnsweredConsentsCount > 0,\n\t\t\t\tvalue: counters?.notAnsweredConsentsCount,\n\t\t\t\ttitle: 'Not signed consent forms',\n\t\t\t},\n\t\t\t'/instructions': {\n\t\t\t\tcondition: !!counters && counters.notReadInstructionsCount > 0,\n\t\t\t\tvalue: counters?.notReadInstructionsCount,\n\t\t\t\ttitle: 'Not read instructions',\n\t\t\t},\n\t\t\t'/prescriptions-list': {\n\t\t\t\tcondition: !!counters && counters.notViewedPrescriptionsCount > 0,\n\t\t\t\tvalue: counters?.notViewedPrescriptionsCount,\n\t\t\t\ttitle: 'Not read prescriptions',\n\t\t\t},\n\t\t\t'/bills': {\n\t\t\t\tcondition: !!counters && counters.notPaidBillItemsCount > 0,\n\t\t\t\tvalue: counters?.notPaidBillItemsCount,\n\t\t\t\ttitle: 'Not paid bills count',\n\t\t\t},\n\t\t};\n\t}, [user, counters]);\n\n\tconst totalBadge = React.useMemo(() => {\n\t\treturn {\n\t\t\t'/document-list': {\n\t\t\t\tcondition: !!counters && counters.totalDocumentsCount > 0,\n\t\t\t\tvalue: counters?.totalDocumentsCount,\n\t\t\t\ttitle: 'Total documents count',\n\t\t\t},\n\t\t\t'/questionnaires': {\n\t\t\t\tcondition: !!counters && counters.totalDiseasesCount > 0,\n\t\t\t\tvalue: counters?.totalDiseasesCount,\n\t\t\t\ttitle: 'Total questionnaires count',\n\t\t\t},\n\t\t\t'/consent-forms': {\n\t\t\t\tcondition: !!counters && counters.totalConsentsCount > 0,\n\t\t\t\tvalue: counters?.totalConsentsCount,\n\t\t\t\ttitle: 'Total consent forms count',\n\t\t\t},\n\t\t\t'/instructions': {\n\t\t\t\tcondition: !!counters && counters.totalInstructionsCount > 0,\n\t\t\t\tvalue: counters?.totalInstructionsCount,\n\t\t\t\ttitle: 'Total instructions count',\n\t\t\t},\n\t\t\t'/prescriptions-list': {\n\t\t\t\tcondition: !!counters && counters.totalPrescriptionsCount > 0,\n\t\t\t\tvalue: counters?.totalPrescriptionsCount,\n\t\t\t\ttitle: 'Total prescriptions count',\n\t\t\t},\n\t\t\t'/bills': {\n\t\t\t\tcondition: !!counters && counters.totalBillItemsCount > 0,\n\t\t\t\tvalue: counters?.totalBillItemsCount,\n\t\t\t\ttitle: 'Total bills count',\n\t\t\t},\n\t\t};\n\t}, [counters]);\n\n\tconst toggleMenu = () => {\n\t\tsetOpen(!open);\n\t};\n\n\tif (item.node) {\n\t\treturn <>{item.node}>;\n\t}\n\n\tconst icon = item.icon && ;\n\n\treturn (\n\t\t\n\t\t\t{path ? item.externalLink\n\t\t\t\t? \n\t\t\t\t\t{icon}\n\t\t\t\t\t{item.name}\n\t\t\t\t \n\t\t\t\t: (\n\t\t\t\t\t\n\t\t\t\t\t\t{icon}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{item.name}\n\t\t\t\t\t\t \n\t\t\t\t\t\t{requiredBadge[item.path]?.condition\n\t\t\t\t\t\t\t? \n\t\t\t\t\t\t\t\t{requiredBadge[item.path].value}\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{totalBadge[item.path]?.condition\n\t\t\t\t\t\t\t? \n\t\t\t\t\t\t\t\t{totalBadge[item.path].value}\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t)\n\t\t\t\t: \n\t\t\t\t\t{icon}\n\t\t\t\t\t{item.name}\n\t\t\t\t \n\t\t\t}\n\t\t\t{condition\n\t\t\t\t&& <>\n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{item.children && item.children.list.map((child, index) =>\n\t\t\t\t\t\t\t\t )}\n\t\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t>\n\t\t\t}\n\t\t \n\t);\n};\n\nexport const Menu: React.FC = ({\n\tclassName = '',\n\titems,\n\twithChildren = false,\n\tbasePath,\n\tpathKey,\n\tdefaultOpen,\n\tcounters,\n\tuser,\n}) => {\n\tconst menuItems = items || [];\n\n\treturn \n\t\t{menuItems.map((item, index) =>\n\t\t\t )}\n\t ;\n};\n","import * as React from 'react';\n\nimport once from 'lodash/once';\n\nexport interface MenuStateProviderContextState {\n\topen: boolean;\n\tmounted: boolean;\n}\n\nexport interface MenuStateProviderContext {\n\tstate: MenuStateProviderContextState;\n\tactions: {setState};\n}\n\nexport const createMenuStateProviderContext = once(() => React.createContext({} as MenuStateProviderContext));\n\nexport const useMenuStateProviderContext: () => MenuStateProviderContext = () => React.useContext(createMenuStateProviderContext());\n\nexport const MenuStateProvider: React.FC = ({ children }) => {\n\tconst ItemContext = createMenuStateProviderContext();\n\n\tconst [state, setState] = React.useState({ open: false, mounted: false });\n\n\tconst value = {\n\t\tstate,\n\t\tactions: {\n\t\t\tsetState,\n\t\t},\n\t};\n\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t \n\t);\n};\n","import React from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { bindActionCreators } from 'redux';\n\nimport { useApplicationContext, subscribe } from '@common/react/components/Core/Application/Application';\n\nimport { NotificationAction } from '@common/typescript/objects/NotificationAction';\n\nimport { PatientLocation } from '@app/objects/PatientLocation';\nimport * as LoginState from '@app/store/Login';\nimport { User } from '@app/objects/User';\n\nconst PatientLocationsSetter: React.FC = () => {\n\tconst { getUser } = useApplicationContext();\n\tconst user = getUser();\n\n\tconst dispatch = useDispatch();\n\tconst loginActions: LoginState.LoginActionCreators = React.useMemo(() =>\n\t\tbindActionCreators(LoginState.getActionCreators(), dispatch), []);\n\n\tconst handleNotify = (notification) => {\n\t\tswitch (notification.objectType) {\n\t\t\tcase 'UpdatePatientLocation':\n\t\t\t\tconst userData = notification.data as User;\n\t\t\t\tconst patientLocation: PatientLocation = notification.data.value;\n\t\t\t\tif (user && (user.id === userData.id)) {\n\t\t\t\t\tif (notification.action === NotificationAction.Add) {\n\t\t\t\t\t\tconst patientLocationIndex = user.patientLocations.findIndex((pl) => pl.id === patientLocation.id);\n\t\t\t\t\t\tif (patientLocationIndex >= 0) {\n\t\t\t\t\t\t\tconst newPatientLocations = user.patientLocations.map((pl, index) => {\n\t\t\t\t\t\t\t\tif (index === patientLocationIndex) {\n\t\t\t\t\t\t\t\t\treturn { ...pl, ...patientLocation };\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn pl;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tloginActions.updateUser({ patientLocations: [...newPatientLocations] });\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tloginActions.updateUser({ patientLocations: [...user.patientLocations, patientLocation] });\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (notification.action === NotificationAction.Delete) {\n\t\t\t\t\t\tloginActions.updateUser({ patientLocations: [...user.patientLocations.filter((q) => q.id !== patientLocation.id)] });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\tReact.useEffect(subscribe(handleNotify), [user?.id]);\n\n\treturn <>>;\n};\n\nexport default PatientLocationsSetter;\n","import React from 'react';\n\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\n\nconst PortalLoader: React.FC = () => {\n\treturn ;\n};\n\nexport const params = {\n\tfallback: ,\n};\n\nexport default PortalLoader;\n","import React from 'react';\n\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\n\nimport emptyCart from '@images/empty-cart.png';\n\nconst EmptyCart: React.FC = () => {\n\treturn \n\t\t
\n\t\t\t
\n\t\t
\n\t\t
You have no items in your shopping cart. \n\t\t
\n\t\t\tLet's go buy something!\n\t\t \n\t
;\n};\n\nexport default EmptyCart;\n","import React from 'react';\nimport { useCart } from 'react-use-cart';\n\nimport { getMoneyString } from '@commonTuna/react/components/Utils';\nimport ImageWithSkeleton from '@commonTuna/react/components/UI/ImageWithSkeleton/ImageWithSkeleton';\n\nimport '@app/scss/components/shoppingCartInformation.scss';\nimport TextWithTooltip from '@app/components/UI/TextWithTooltip/TextWithTooltip';\nimport AddToCartButton from '@app/components/UI/AddToCartButton/AddToCartButton';\nimport EmptyCart from '@app/components/UI/EmptyCart/EmptyCart';\nimport { CartItem, transformStoredItemToCartItem } from '@app/objects/CartItem';\nimport useShoppingCart from '@app/hooks/useShoppingCart';\nimport { SpecialLocation } from '@app/components/Pages/Specials/SpecialCard';\nimport WithPathLink from '@app/components/UI/WithPathLink/WithPathLink';\n\nimport noImage from '@images/no-image.jpg';\n\ninterface Props {\n\tcheckout?: React.ReactNode;\n}\n\nconst CartItemTitle: React.FC<{name: string}> = ({ name }) => {\n\treturn ;\n};\n\nconst ShoppingCartItem: React.FC<{item: CartItem}> = ({ item }) => {\n\tconst { removeCartItem } = useShoppingCart();\n\n\treturn \n\t\t
removeCartItem(item.id)} />\n\t\t\n\t\t\t \n\t\t \n\t\t\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t{item.name} \n\t\t\t\t \n\t\t\t\t{item.location\n\t\t\t\t\t&&
\n\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t
\n\t\t\t\t}\n\t\t\t\t
{getMoneyString(item.price)} \n\t\t\t\t
{getMoneyString(item.originalPrice)} \n\t\t\t
\n\t\t\t\n\t\t\t\t
\n\t\t\t\t
{getMoneyString(item.itemTotal ?? 0)}
\n\t\t\t
\n\t\t \n\t ;\n};\n\nconst ShoppingCartInformation: React.FC = ({ checkout }) => {\n\tconst { items, cartTotal, isEmpty } = useCart();\n\n\treturn \n\t\t{isEmpty ?
\n\t\t\t:
\n\t\t\t\t
\n\t\t\t\t\t{items.map((item) =>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t )}\n\t\t\t\t \n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\tTotal:\n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t{getMoneyString(cartTotal)}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t{checkout}\n\t\t\t
\n\t\t}\n\t
;\n};\n\nexport default ShoppingCartInformation;\n","/**\n * SSR Window 4.0.2\n * Better handling for window object in SSR environment\n * https://github.com/nolimits4web/ssr-window\n *\n * Copyright 2021, Vladimir Kharlampidi\n *\n * Licensed under MIT\n *\n * Released on: December 13, 2021\n */\n/* eslint-disable no-param-reassign */\nfunction isObject(obj) {\n return obj !== null && typeof obj === 'object' && 'constructor' in obj && obj.constructor === Object;\n}\nfunction extend(target, src) {\n if (target === void 0) {\n target = {};\n }\n if (src === void 0) {\n src = {};\n }\n Object.keys(src).forEach(key => {\n if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {\n extend(target[key], src[key]);\n }\n });\n}\nconst ssrDocument = {\n body: {},\n addEventListener() {},\n removeEventListener() {},\n activeElement: {\n blur() {},\n nodeName: ''\n },\n querySelector() {\n return null;\n },\n querySelectorAll() {\n return [];\n },\n getElementById() {\n return null;\n },\n createEvent() {\n return {\n initEvent() {}\n };\n },\n createElement() {\n return {\n children: [],\n childNodes: [],\n style: {},\n setAttribute() {},\n getElementsByTagName() {\n return [];\n }\n };\n },\n createElementNS() {\n return {};\n },\n importNode() {\n return null;\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: ''\n }\n};\nfunction getDocument() {\n const doc = typeof document !== 'undefined' ? document : {};\n extend(doc, ssrDocument);\n return doc;\n}\nconst ssrWindow = {\n document: ssrDocument,\n navigator: {\n userAgent: ''\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: ''\n },\n history: {\n replaceState() {},\n pushState() {},\n go() {},\n back() {}\n },\n CustomEvent: function CustomEvent() {\n return this;\n },\n addEventListener() {},\n removeEventListener() {},\n getComputedStyle() {\n return {\n getPropertyValue() {\n return '';\n }\n };\n },\n Image() {},\n Date() {},\n screen: {},\n setTimeout() {},\n clearTimeout() {},\n matchMedia() {\n return {};\n },\n requestAnimationFrame(callback) {\n if (typeof setTimeout === 'undefined') {\n callback();\n return null;\n }\n return setTimeout(callback, 0);\n },\n cancelAnimationFrame(id) {\n if (typeof setTimeout === 'undefined') {\n return;\n }\n clearTimeout(id);\n }\n};\nfunction getWindow() {\n const win = typeof window !== 'undefined' ? window : {};\n extend(win, ssrWindow);\n return win;\n}\n\nexport { getWindow as a, getDocument as g };\n","import { a as getWindow, g as getDocument } from './ssr-window.esm.mjs';\n\nfunction classesToTokens(classes) {\n if (classes === void 0) {\n classes = '';\n }\n return classes.trim().split(' ').filter(c => !!c.trim());\n}\n\nfunction deleteProps(obj) {\n const object = obj;\n Object.keys(object).forEach(key => {\n try {\n object[key] = null;\n } catch (e) {\n // no getter for object\n }\n try {\n delete object[key];\n } catch (e) {\n // something got wrong\n }\n });\n}\nfunction nextTick(callback, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n return setTimeout(callback, delay);\n}\nfunction now() {\n return Date.now();\n}\nfunction getComputedStyle(el) {\n const window = getWindow();\n let style;\n if (window.getComputedStyle) {\n style = window.getComputedStyle(el, null);\n }\n if (!style && el.currentStyle) {\n style = el.currentStyle;\n }\n if (!style) {\n style = el.style;\n }\n return style;\n}\nfunction getTranslate(el, axis) {\n if (axis === void 0) {\n axis = 'x';\n }\n const window = getWindow();\n let matrix;\n let curTransform;\n let transformMatrix;\n const curStyle = getComputedStyle(el);\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map(a => a.replace(',', '.')).join(', ');\n }\n // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n } else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n if (axis === 'x') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[4]);\n }\n if (axis === 'y') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;\n // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);\n // Normal Browsers\n else curTransform = parseFloat(matrix[5]);\n }\n return curTransform || 0;\n}\nfunction isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';\n}\nfunction isNode(node) {\n // eslint-disable-next-line\n if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {\n return node instanceof HTMLElement;\n }\n return node && (node.nodeType === 1 || node.nodeType === 11);\n}\nfunction extend() {\n const to = Object(arguments.length <= 0 ? undefined : arguments[0]);\n const noExtend = ['__proto__', 'constructor', 'prototype'];\n for (let i = 1; i < arguments.length; i += 1) {\n const nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];\n if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {\n const keysArray = Object.keys(Object(nextSource)).filter(key => noExtend.indexOf(key) < 0);\n for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {\n const nextKey = keysArray[nextIndex];\n const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n if (desc !== undefined && desc.enumerable) {\n if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n to[nextKey] = {};\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n }\n return to;\n}\nfunction setCSSProperty(el, varName, varValue) {\n el.style.setProperty(varName, varValue);\n}\nfunction animateCSSModeScroll(_ref) {\n let {\n swiper,\n targetPosition,\n side\n } = _ref;\n const window = getWindow();\n const startPosition = -swiper.translate;\n let startTime = null;\n let time;\n const duration = swiper.params.speed;\n swiper.wrapperEl.style.scrollSnapType = 'none';\n window.cancelAnimationFrame(swiper.cssModeFrameID);\n const dir = targetPosition > startPosition ? 'next' : 'prev';\n const isOutOfBound = (current, target) => {\n return dir === 'next' && current >= target || dir === 'prev' && current <= target;\n };\n const animate = () => {\n time = new Date().getTime();\n if (startTime === null) {\n startTime = time;\n }\n const progress = Math.max(Math.min((time - startTime) / duration, 1), 0);\n const easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2;\n let currentPosition = startPosition + easeProgress * (targetPosition - startPosition);\n if (isOutOfBound(currentPosition, targetPosition)) {\n currentPosition = targetPosition;\n }\n swiper.wrapperEl.scrollTo({\n [side]: currentPosition\n });\n if (isOutOfBound(currentPosition, targetPosition)) {\n swiper.wrapperEl.style.overflow = 'hidden';\n swiper.wrapperEl.style.scrollSnapType = '';\n setTimeout(() => {\n swiper.wrapperEl.style.overflow = '';\n swiper.wrapperEl.scrollTo({\n [side]: currentPosition\n });\n });\n window.cancelAnimationFrame(swiper.cssModeFrameID);\n return;\n }\n swiper.cssModeFrameID = window.requestAnimationFrame(animate);\n };\n animate();\n}\nfunction getSlideTransformEl(slideEl) {\n return slideEl.querySelector('.swiper-slide-transform') || slideEl.shadowRoot && slideEl.shadowRoot.querySelector('.swiper-slide-transform') || slideEl;\n}\nfunction elementChildren(element, selector) {\n if (selector === void 0) {\n selector = '';\n }\n const children = [...element.children];\n if (element instanceof HTMLSlotElement) {\n children.push(...element.assignedElements());\n }\n if (!selector) {\n return children;\n }\n return children.filter(el => el.matches(selector));\n}\nfunction elementIsChildOf(el, parent) {\n const isChild = parent.contains(el);\n if (!isChild && parent instanceof HTMLSlotElement) {\n const children = [...element.assignedElements()];\n return children.includes(el);\n }\n return isChild;\n}\nfunction showWarning(text) {\n try {\n console.warn(text);\n return;\n } catch (err) {\n // err\n }\n}\nfunction createElement(tag, classes) {\n if (classes === void 0) {\n classes = [];\n }\n const el = document.createElement(tag);\n el.classList.add(...(Array.isArray(classes) ? classes : classesToTokens(classes)));\n return el;\n}\nfunction elementOffset(el) {\n const window = getWindow();\n const document = getDocument();\n const box = el.getBoundingClientRect();\n const body = document.body;\n const clientTop = el.clientTop || body.clientTop || 0;\n const clientLeft = el.clientLeft || body.clientLeft || 0;\n const scrollTop = el === window ? window.scrollY : el.scrollTop;\n const scrollLeft = el === window ? window.scrollX : el.scrollLeft;\n return {\n top: box.top + scrollTop - clientTop,\n left: box.left + scrollLeft - clientLeft\n };\n}\nfunction elementPrevAll(el, selector) {\n const prevEls = [];\n while (el.previousElementSibling) {\n const prev = el.previousElementSibling; // eslint-disable-line\n if (selector) {\n if (prev.matches(selector)) prevEls.push(prev);\n } else prevEls.push(prev);\n el = prev;\n }\n return prevEls;\n}\nfunction elementNextAll(el, selector) {\n const nextEls = [];\n while (el.nextElementSibling) {\n const next = el.nextElementSibling; // eslint-disable-line\n if (selector) {\n if (next.matches(selector)) nextEls.push(next);\n } else nextEls.push(next);\n el = next;\n }\n return nextEls;\n}\nfunction elementStyle(el, prop) {\n const window = getWindow();\n return window.getComputedStyle(el, null).getPropertyValue(prop);\n}\nfunction elementIndex(el) {\n let child = el;\n let i;\n if (child) {\n i = 0;\n // eslint-disable-next-line\n while ((child = child.previousSibling) !== null) {\n if (child.nodeType === 1) i += 1;\n }\n return i;\n }\n return undefined;\n}\nfunction elementParents(el, selector) {\n const parents = []; // eslint-disable-line\n let parent = el.parentElement; // eslint-disable-line\n while (parent) {\n if (selector) {\n if (parent.matches(selector)) parents.push(parent);\n } else {\n parents.push(parent);\n }\n parent = parent.parentElement;\n }\n return parents;\n}\nfunction elementTransitionEnd(el, callback) {\n function fireCallBack(e) {\n if (e.target !== el) return;\n callback.call(el, e);\n el.removeEventListener('transitionend', fireCallBack);\n }\n if (callback) {\n el.addEventListener('transitionend', fireCallBack);\n }\n}\nfunction elementOuterSize(el, size, includeMargins) {\n const window = getWindow();\n if (includeMargins) {\n return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom'));\n }\n return el.offsetWidth;\n}\nfunction makeElementsArray(el) {\n return (Array.isArray(el) ? el : [el]).filter(e => !!e);\n}\nfunction getRotateFix(swiper) {\n return v => {\n if (Math.abs(v) > 0 && swiper.browser && swiper.browser.need3dFix && Math.abs(v) % 90 === 0) {\n return v + 0.001;\n }\n return v;\n };\n}\n\nexport { elementParents as a, elementOffset as b, createElement as c, now as d, elementChildren as e, elementOuterSize as f, getSlideTransformEl as g, elementIndex as h, classesToTokens as i, getTranslate as j, elementTransitionEnd as k, isObject as l, makeElementsArray as m, nextTick as n, getRotateFix as o, elementStyle as p, elementNextAll as q, elementPrevAll as r, setCSSProperty as s, animateCSSModeScroll as t, showWarning as u, elementIsChildOf as v, extend as w, deleteProps as x };\n","import { a as getWindow, g as getDocument } from './ssr-window.esm.mjs';\nimport { a as elementParents, p as elementStyle, e as elementChildren, s as setCSSProperty, f as elementOuterSize, q as elementNextAll, r as elementPrevAll, j as getTranslate, t as animateCSSModeScroll, n as nextTick, u as showWarning, c as createElement, v as elementIsChildOf, d as now, w as extend, h as elementIndex, x as deleteProps } from './utils.mjs';\n\nlet support;\nfunction calcSupport() {\n const window = getWindow();\n const document = getDocument();\n return {\n smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style,\n touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch)\n };\n}\nfunction getSupport() {\n if (!support) {\n support = calcSupport();\n }\n return support;\n}\n\nlet deviceCached;\nfunction calcDevice(_temp) {\n let {\n userAgent\n } = _temp === void 0 ? {} : _temp;\n const support = getSupport();\n const window = getWindow();\n const platform = window.navigator.platform;\n const ua = userAgent || window.navigator.userAgent;\n const device = {\n ios: false,\n android: false\n };\n const screenWidth = window.screen.width;\n const screenHeight = window.screen.height;\n const android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/); // eslint-disable-line\n let ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n const ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n const iphone = !ipad && ua.match(/(iPhone\\sOS|iOS)\\s([\\d_]+)/);\n const windows = platform === 'Win32';\n let macos = platform === 'MacIntel';\n\n // iPadOs 13 fix\n const iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];\n if (!ipad && macos && support.touch && iPadScreens.indexOf(`${screenWidth}x${screenHeight}`) >= 0) {\n ipad = ua.match(/(Version)\\/([\\d.]+)/);\n if (!ipad) ipad = [0, 1, '13_0_0'];\n macos = false;\n }\n\n // Android\n if (android && !windows) {\n device.os = 'android';\n device.android = true;\n }\n if (ipad || iphone || ipod) {\n device.os = 'ios';\n device.ios = true;\n }\n\n // Export object\n return device;\n}\nfunction getDevice(overrides) {\n if (overrides === void 0) {\n overrides = {};\n }\n if (!deviceCached) {\n deviceCached = calcDevice(overrides);\n }\n return deviceCached;\n}\n\nlet browser;\nfunction calcBrowser() {\n const window = getWindow();\n const device = getDevice();\n let needPerspectiveFix = false;\n function isSafari() {\n const ua = window.navigator.userAgent.toLowerCase();\n return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;\n }\n if (isSafari()) {\n const ua = String(window.navigator.userAgent);\n if (ua.includes('Version/')) {\n const [major, minor] = ua.split('Version/')[1].split(' ')[0].split('.').map(num => Number(num));\n needPerspectiveFix = major < 16 || major === 16 && minor < 2;\n }\n }\n const isWebView = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent);\n const isSafariBrowser = isSafari();\n const need3dFix = isSafariBrowser || isWebView && device.ios;\n return {\n isSafari: needPerspectiveFix || isSafariBrowser,\n needPerspectiveFix,\n need3dFix,\n isWebView\n };\n}\nfunction getBrowser() {\n if (!browser) {\n browser = calcBrowser();\n }\n return browser;\n}\n\nfunction Resize(_ref) {\n let {\n swiper,\n on,\n emit\n } = _ref;\n const window = getWindow();\n let observer = null;\n let animationFrame = null;\n const resizeHandler = () => {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n emit('beforeResize');\n emit('resize');\n };\n const createObserver = () => {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n observer = new ResizeObserver(entries => {\n animationFrame = window.requestAnimationFrame(() => {\n const {\n width,\n height\n } = swiper;\n let newWidth = width;\n let newHeight = height;\n entries.forEach(_ref2 => {\n let {\n contentBoxSize,\n contentRect,\n target\n } = _ref2;\n if (target && target !== swiper.el) return;\n newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;\n newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;\n });\n if (newWidth !== width || newHeight !== height) {\n resizeHandler();\n }\n });\n });\n observer.observe(swiper.el);\n };\n const removeObserver = () => {\n if (animationFrame) {\n window.cancelAnimationFrame(animationFrame);\n }\n if (observer && observer.unobserve && swiper.el) {\n observer.unobserve(swiper.el);\n observer = null;\n }\n };\n const orientationChangeHandler = () => {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n emit('orientationchange');\n };\n on('init', () => {\n if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {\n createObserver();\n return;\n }\n window.addEventListener('resize', resizeHandler);\n window.addEventListener('orientationchange', orientationChangeHandler);\n });\n on('destroy', () => {\n removeObserver();\n window.removeEventListener('resize', resizeHandler);\n window.removeEventListener('orientationchange', orientationChangeHandler);\n });\n}\n\nfunction Observer(_ref) {\n let {\n swiper,\n extendParams,\n on,\n emit\n } = _ref;\n const observers = [];\n const window = getWindow();\n const attach = function (target, options) {\n if (options === void 0) {\n options = {};\n }\n const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;\n const observer = new ObserverFunc(mutations => {\n // The observerUpdate event should only be triggered\n // once despite the number of mutations. Additional\n // triggers are redundant and are very costly\n if (swiper.__preventObserver__) return;\n if (mutations.length === 1) {\n emit('observerUpdate', mutations[0]);\n return;\n }\n const observerUpdate = function observerUpdate() {\n emit('observerUpdate', mutations[0]);\n };\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(observerUpdate);\n } else {\n window.setTimeout(observerUpdate, 0);\n }\n });\n observer.observe(target, {\n attributes: typeof options.attributes === 'undefined' ? true : options.attributes,\n childList: swiper.isElement || (typeof options.childList === 'undefined' ? true : options).childList,\n characterData: typeof options.characterData === 'undefined' ? true : options.characterData\n });\n observers.push(observer);\n };\n const init = () => {\n if (!swiper.params.observer) return;\n if (swiper.params.observeParents) {\n const containerParents = elementParents(swiper.hostEl);\n for (let i = 0; i < containerParents.length; i += 1) {\n attach(containerParents[i]);\n }\n }\n // Observe container\n attach(swiper.hostEl, {\n childList: swiper.params.observeSlideChildren\n });\n\n // Observe wrapper\n attach(swiper.wrapperEl, {\n attributes: false\n });\n };\n const destroy = () => {\n observers.forEach(observer => {\n observer.disconnect();\n });\n observers.splice(0, observers.length);\n };\n extendParams({\n observer: false,\n observeParents: false,\n observeSlideChildren: false\n });\n on('init', init);\n on('destroy', destroy);\n}\n\n/* eslint-disable no-underscore-dangle */\n\nvar eventsEmitter = {\n on(events, handler, priority) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (typeof handler !== 'function') return self;\n const method = priority ? 'unshift' : 'push';\n events.split(' ').forEach(event => {\n if (!self.eventsListeners[event]) self.eventsListeners[event] = [];\n self.eventsListeners[event][method](handler);\n });\n return self;\n },\n once(events, handler, priority) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (typeof handler !== 'function') return self;\n function onceHandler() {\n self.off(events, onceHandler);\n if (onceHandler.__emitterProxy) {\n delete onceHandler.__emitterProxy;\n }\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n handler.apply(self, args);\n }\n onceHandler.__emitterProxy = handler;\n return self.on(events, onceHandler, priority);\n },\n onAny(handler, priority) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (typeof handler !== 'function') return self;\n const method = priority ? 'unshift' : 'push';\n if (self.eventsAnyListeners.indexOf(handler) < 0) {\n self.eventsAnyListeners[method](handler);\n }\n return self;\n },\n offAny(handler) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (!self.eventsAnyListeners) return self;\n const index = self.eventsAnyListeners.indexOf(handler);\n if (index >= 0) {\n self.eventsAnyListeners.splice(index, 1);\n }\n return self;\n },\n off(events, handler) {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (!self.eventsListeners) return self;\n events.split(' ').forEach(event => {\n if (typeof handler === 'undefined') {\n self.eventsListeners[event] = [];\n } else if (self.eventsListeners[event]) {\n self.eventsListeners[event].forEach((eventHandler, index) => {\n if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {\n self.eventsListeners[event].splice(index, 1);\n }\n });\n }\n });\n return self;\n },\n emit() {\n const self = this;\n if (!self.eventsListeners || self.destroyed) return self;\n if (!self.eventsListeners) return self;\n let events;\n let data;\n let context;\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (typeof args[0] === 'string' || Array.isArray(args[0])) {\n events = args[0];\n data = args.slice(1, args.length);\n context = self;\n } else {\n events = args[0].events;\n data = args[0].data;\n context = args[0].context || self;\n }\n data.unshift(context);\n const eventsArray = Array.isArray(events) ? events : events.split(' ');\n eventsArray.forEach(event => {\n if (self.eventsAnyListeners && self.eventsAnyListeners.length) {\n self.eventsAnyListeners.forEach(eventHandler => {\n eventHandler.apply(context, [event, ...data]);\n });\n }\n if (self.eventsListeners && self.eventsListeners[event]) {\n self.eventsListeners[event].forEach(eventHandler => {\n eventHandler.apply(context, data);\n });\n }\n });\n return self;\n }\n};\n\nfunction updateSize() {\n const swiper = this;\n let width;\n let height;\n const el = swiper.el;\n if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {\n width = swiper.params.width;\n } else {\n width = el.clientWidth;\n }\n if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {\n height = swiper.params.height;\n } else {\n height = el.clientHeight;\n }\n if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {\n return;\n }\n\n // Subtract paddings\n width = width - parseInt(elementStyle(el, 'padding-left') || 0, 10) - parseInt(elementStyle(el, 'padding-right') || 0, 10);\n height = height - parseInt(elementStyle(el, 'padding-top') || 0, 10) - parseInt(elementStyle(el, 'padding-bottom') || 0, 10);\n if (Number.isNaN(width)) width = 0;\n if (Number.isNaN(height)) height = 0;\n Object.assign(swiper, {\n width,\n height,\n size: swiper.isHorizontal() ? width : height\n });\n}\n\nfunction updateSlides() {\n const swiper = this;\n function getDirectionPropertyValue(node, label) {\n return parseFloat(node.getPropertyValue(swiper.getDirectionLabel(label)) || 0);\n }\n const params = swiper.params;\n const {\n wrapperEl,\n slidesEl,\n size: swiperSize,\n rtlTranslate: rtl,\n wrongRTL\n } = swiper;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;\n const slides = elementChildren(slidesEl, `.${swiper.params.slideClass}, swiper-slide`);\n const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;\n let snapGrid = [];\n const slidesGrid = [];\n const slidesSizesGrid = [];\n let offsetBefore = params.slidesOffsetBefore;\n if (typeof offsetBefore === 'function') {\n offsetBefore = params.slidesOffsetBefore.call(swiper);\n }\n let offsetAfter = params.slidesOffsetAfter;\n if (typeof offsetAfter === 'function') {\n offsetAfter = params.slidesOffsetAfter.call(swiper);\n }\n const previousSnapGridLength = swiper.snapGrid.length;\n const previousSlidesGridLength = swiper.slidesGrid.length;\n let spaceBetween = params.spaceBetween;\n let slidePosition = -offsetBefore;\n let prevSlideSize = 0;\n let index = 0;\n if (typeof swiperSize === 'undefined') {\n return;\n }\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;\n } else if (typeof spaceBetween === 'string') {\n spaceBetween = parseFloat(spaceBetween);\n }\n swiper.virtualSize = -spaceBetween;\n\n // reset margins\n slides.forEach(slideEl => {\n if (rtl) {\n slideEl.style.marginLeft = '';\n } else {\n slideEl.style.marginRight = '';\n }\n slideEl.style.marginBottom = '';\n slideEl.style.marginTop = '';\n });\n\n // reset cssMode offsets\n if (params.centeredSlides && params.cssMode) {\n setCSSProperty(wrapperEl, '--swiper-centered-offset-before', '');\n setCSSProperty(wrapperEl, '--swiper-centered-offset-after', '');\n }\n const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;\n if (gridEnabled) {\n swiper.grid.initSlides(slides);\n } else if (swiper.grid) {\n swiper.grid.unsetSlides();\n }\n\n // Calc slides\n let slideSize;\n const shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(key => {\n return typeof params.breakpoints[key].slidesPerView !== 'undefined';\n }).length > 0;\n for (let i = 0; i < slidesLength; i += 1) {\n slideSize = 0;\n let slide;\n if (slides[i]) slide = slides[i];\n if (gridEnabled) {\n swiper.grid.updateSlide(i, slide, slides);\n }\n if (slides[i] && elementStyle(slide, 'display') === 'none') continue; // eslint-disable-line\n\n if (params.slidesPerView === 'auto') {\n if (shouldResetSlideSize) {\n slides[i].style[swiper.getDirectionLabel('width')] = ``;\n }\n const slideStyles = getComputedStyle(slide);\n const currentTransform = slide.style.transform;\n const currentWebKitTransform = slide.style.webkitTransform;\n if (currentTransform) {\n slide.style.transform = 'none';\n }\n if (currentWebKitTransform) {\n slide.style.webkitTransform = 'none';\n }\n if (params.roundLengths) {\n slideSize = swiper.isHorizontal() ? elementOuterSize(slide, 'width', true) : elementOuterSize(slide, 'height', true);\n } else {\n // eslint-disable-next-line\n const width = getDirectionPropertyValue(slideStyles, 'width');\n const paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');\n const paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');\n const marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');\n const marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');\n const boxSizing = slideStyles.getPropertyValue('box-sizing');\n if (boxSizing && boxSizing === 'border-box') {\n slideSize = width + marginLeft + marginRight;\n } else {\n const {\n clientWidth,\n offsetWidth\n } = slide;\n slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);\n }\n }\n if (currentTransform) {\n slide.style.transform = currentTransform;\n }\n if (currentWebKitTransform) {\n slide.style.webkitTransform = currentWebKitTransform;\n }\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n } else {\n slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n if (slides[i]) {\n slides[i].style[swiper.getDirectionLabel('width')] = `${slideSize}px`;\n }\n }\n if (slides[i]) {\n slides[i].swiperSlideSize = slideSize;\n }\n slidesSizesGrid.push(slideSize);\n if (params.centeredSlides) {\n slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;\n if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n } else {\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n slidePosition = slidePosition + slideSize + spaceBetween;\n }\n swiper.virtualSize += slideSize + spaceBetween;\n prevSlideSize = slideSize;\n index += 1;\n }\n swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;\n if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {\n wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;\n }\n if (params.setWrapperSize) {\n wrapperEl.style[swiper.getDirectionLabel('width')] = `${swiper.virtualSize + spaceBetween}px`;\n }\n if (gridEnabled) {\n swiper.grid.updateWrapperSize(slideSize, snapGrid);\n }\n\n // Remove last grid elements depending on width\n if (!params.centeredSlides) {\n const newSlidesGrid = [];\n for (let i = 0; i < snapGrid.length; i += 1) {\n let slidesGridItem = snapGrid[i];\n if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);\n if (snapGrid[i] <= swiper.virtualSize - swiperSize) {\n newSlidesGrid.push(slidesGridItem);\n }\n }\n snapGrid = newSlidesGrid;\n if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {\n snapGrid.push(swiper.virtualSize - swiperSize);\n }\n }\n if (isVirtual && params.loop) {\n const size = slidesSizesGrid[0] + spaceBetween;\n if (params.slidesPerGroup > 1) {\n const groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup);\n const groupSize = size * params.slidesPerGroup;\n for (let i = 0; i < groups; i += 1) {\n snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize);\n }\n }\n for (let i = 0; i < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; i += 1) {\n if (params.slidesPerGroup === 1) {\n snapGrid.push(snapGrid[snapGrid.length - 1] + size);\n }\n slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size);\n swiper.virtualSize += size;\n }\n }\n if (snapGrid.length === 0) snapGrid = [0];\n if (spaceBetween !== 0) {\n const key = swiper.isHorizontal() && rtl ? 'marginLeft' : swiper.getDirectionLabel('marginRight');\n slides.filter((_, slideIndex) => {\n if (!params.cssMode || params.loop) return true;\n if (slideIndex === slides.length - 1) {\n return false;\n }\n return true;\n }).forEach(slideEl => {\n slideEl.style[key] = `${spaceBetween}px`;\n });\n }\n if (params.centeredSlides && params.centeredSlidesBounds) {\n let allSlidesSize = 0;\n slidesSizesGrid.forEach(slideSizeValue => {\n allSlidesSize += slideSizeValue + (spaceBetween || 0);\n });\n allSlidesSize -= spaceBetween;\n const maxSnap = allSlidesSize - swiperSize;\n snapGrid = snapGrid.map(snap => {\n if (snap <= 0) return -offsetBefore;\n if (snap > maxSnap) return maxSnap + offsetAfter;\n return snap;\n });\n }\n if (params.centerInsufficientSlides) {\n let allSlidesSize = 0;\n slidesSizesGrid.forEach(slideSizeValue => {\n allSlidesSize += slideSizeValue + (spaceBetween || 0);\n });\n allSlidesSize -= spaceBetween;\n const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);\n if (allSlidesSize + offsetSize < swiperSize) {\n const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;\n snapGrid.forEach((snap, snapIndex) => {\n snapGrid[snapIndex] = snap - allSlidesOffset;\n });\n slidesGrid.forEach((snap, snapIndex) => {\n slidesGrid[snapIndex] = snap + allSlidesOffset;\n });\n }\n }\n Object.assign(swiper, {\n slides,\n snapGrid,\n slidesGrid,\n slidesSizesGrid\n });\n if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) {\n setCSSProperty(wrapperEl, '--swiper-centered-offset-before', `${-snapGrid[0]}px`);\n setCSSProperty(wrapperEl, '--swiper-centered-offset-after', `${swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2}px`);\n const addToSnapGrid = -swiper.snapGrid[0];\n const addToSlidesGrid = -swiper.slidesGrid[0];\n swiper.snapGrid = swiper.snapGrid.map(v => v + addToSnapGrid);\n swiper.slidesGrid = swiper.slidesGrid.map(v => v + addToSlidesGrid);\n }\n if (slidesLength !== previousSlidesLength) {\n swiper.emit('slidesLengthChange');\n }\n if (snapGrid.length !== previousSnapGridLength) {\n if (swiper.params.watchOverflow) swiper.checkOverflow();\n swiper.emit('snapGridLengthChange');\n }\n if (slidesGrid.length !== previousSlidesGridLength) {\n swiper.emit('slidesGridLengthChange');\n }\n if (params.watchSlidesProgress) {\n swiper.updateSlidesOffset();\n }\n swiper.emit('slidesUpdated');\n if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) {\n const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;\n const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);\n if (slidesLength <= params.maxBackfaceHiddenSlides) {\n if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass);\n } else if (hasClassBackfaceClassAdded) {\n swiper.el.classList.remove(backFaceHiddenClass);\n }\n }\n}\n\nfunction updateAutoHeight(speed) {\n const swiper = this;\n const activeSlides = [];\n const isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n let newHeight = 0;\n let i;\n if (typeof speed === 'number') {\n swiper.setTransition(speed);\n } else if (speed === true) {\n swiper.setTransition(swiper.params.speed);\n }\n const getSlideByIndex = index => {\n if (isVirtual) {\n return swiper.slides[swiper.getSlideIndexByData(index)];\n }\n return swiper.slides[index];\n };\n // Find slides currently in view\n if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {\n if (swiper.params.centeredSlides) {\n (swiper.visibleSlides || []).forEach(slide => {\n activeSlides.push(slide);\n });\n } else {\n for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {\n const index = swiper.activeIndex + i;\n if (index > swiper.slides.length && !isVirtual) break;\n activeSlides.push(getSlideByIndex(index));\n }\n }\n } else {\n activeSlides.push(getSlideByIndex(swiper.activeIndex));\n }\n\n // Find new height from highest slide in view\n for (i = 0; i < activeSlides.length; i += 1) {\n if (typeof activeSlides[i] !== 'undefined') {\n const height = activeSlides[i].offsetHeight;\n newHeight = height > newHeight ? height : newHeight;\n }\n }\n\n // Update Height\n if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = `${newHeight}px`;\n}\n\nfunction updateSlidesOffset() {\n const swiper = this;\n const slides = swiper.slides;\n // eslint-disable-next-line\n const minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0;\n for (let i = 0; i < slides.length; i += 1) {\n slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment();\n }\n}\n\nconst toggleSlideClasses$1 = (slideEl, condition, className) => {\n if (condition && !slideEl.classList.contains(className)) {\n slideEl.classList.add(className);\n } else if (!condition && slideEl.classList.contains(className)) {\n slideEl.classList.remove(className);\n }\n};\nfunction updateSlidesProgress(translate) {\n if (translate === void 0) {\n translate = this && this.translate || 0;\n }\n const swiper = this;\n const params = swiper.params;\n const {\n slides,\n rtlTranslate: rtl,\n snapGrid\n } = swiper;\n if (slides.length === 0) return;\n if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();\n let offsetCenter = -translate;\n if (rtl) offsetCenter = translate;\n swiper.visibleSlidesIndexes = [];\n swiper.visibleSlides = [];\n let spaceBetween = params.spaceBetween;\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size;\n } else if (typeof spaceBetween === 'string') {\n spaceBetween = parseFloat(spaceBetween);\n }\n for (let i = 0; i < slides.length; i += 1) {\n const slide = slides[i];\n let slideOffset = slide.swiperSlideOffset;\n if (params.cssMode && params.centeredSlides) {\n slideOffset -= slides[0].swiperSlideOffset;\n }\n const slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);\n const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween);\n const slideBefore = -(offsetCenter - slideOffset);\n const slideAfter = slideBefore + swiper.slidesSizesGrid[i];\n const isFullyVisible = slideBefore >= 0 && slideBefore <= swiper.size - swiper.slidesSizesGrid[i];\n const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;\n if (isVisible) {\n swiper.visibleSlides.push(slide);\n swiper.visibleSlidesIndexes.push(i);\n }\n toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);\n toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);\n slide.progress = rtl ? -slideProgress : slideProgress;\n slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;\n }\n}\n\nfunction updateProgress(translate) {\n const swiper = this;\n if (typeof translate === 'undefined') {\n const multiplier = swiper.rtlTranslate ? -1 : 1;\n // eslint-disable-next-line\n translate = swiper && swiper.translate && swiper.translate * multiplier || 0;\n }\n const params = swiper.params;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n let {\n progress,\n isBeginning,\n isEnd,\n progressLoop\n } = swiper;\n const wasBeginning = isBeginning;\n const wasEnd = isEnd;\n if (translatesDiff === 0) {\n progress = 0;\n isBeginning = true;\n isEnd = true;\n } else {\n progress = (translate - swiper.minTranslate()) / translatesDiff;\n const isBeginningRounded = Math.abs(translate - swiper.minTranslate()) < 1;\n const isEndRounded = Math.abs(translate - swiper.maxTranslate()) < 1;\n isBeginning = isBeginningRounded || progress <= 0;\n isEnd = isEndRounded || progress >= 1;\n if (isBeginningRounded) progress = 0;\n if (isEndRounded) progress = 1;\n }\n if (params.loop) {\n const firstSlideIndex = swiper.getSlideIndexByData(0);\n const lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1);\n const firstSlideTranslate = swiper.slidesGrid[firstSlideIndex];\n const lastSlideTranslate = swiper.slidesGrid[lastSlideIndex];\n const translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1];\n const translateAbs = Math.abs(translate);\n if (translateAbs >= firstSlideTranslate) {\n progressLoop = (translateAbs - firstSlideTranslate) / translateMax;\n } else {\n progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax;\n }\n if (progressLoop > 1) progressLoop -= 1;\n }\n Object.assign(swiper, {\n progress,\n progressLoop,\n isBeginning,\n isEnd\n });\n if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);\n if (isBeginning && !wasBeginning) {\n swiper.emit('reachBeginning toEdge');\n }\n if (isEnd && !wasEnd) {\n swiper.emit('reachEnd toEdge');\n }\n if (wasBeginning && !isBeginning || wasEnd && !isEnd) {\n swiper.emit('fromEdge');\n }\n swiper.emit('progress', progress);\n}\n\nconst toggleSlideClasses = (slideEl, condition, className) => {\n if (condition && !slideEl.classList.contains(className)) {\n slideEl.classList.add(className);\n } else if (!condition && slideEl.classList.contains(className)) {\n slideEl.classList.remove(className);\n }\n};\nfunction updateSlidesClasses() {\n const swiper = this;\n const {\n slides,\n params,\n slidesEl,\n activeIndex\n } = swiper;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;\n const getFilteredSlide = selector => {\n return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];\n };\n let activeSlide;\n let prevSlide;\n let nextSlide;\n if (isVirtual) {\n if (params.loop) {\n let slideIndex = activeIndex - swiper.virtual.slidesBefore;\n if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex;\n if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length;\n activeSlide = getFilteredSlide(`[data-swiper-slide-index=\"${slideIndex}\"]`);\n } else {\n activeSlide = getFilteredSlide(`[data-swiper-slide-index=\"${activeIndex}\"]`);\n }\n } else {\n if (gridEnabled) {\n activeSlide = slides.filter(slideEl => slideEl.column === activeIndex)[0];\n nextSlide = slides.filter(slideEl => slideEl.column === activeIndex + 1)[0];\n prevSlide = slides.filter(slideEl => slideEl.column === activeIndex - 1)[0];\n } else {\n activeSlide = slides[activeIndex];\n }\n }\n if (activeSlide) {\n if (!gridEnabled) {\n // Next Slide\n nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];\n if (params.loop && !nextSlide) {\n nextSlide = slides[0];\n }\n\n // Prev Slide\n prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];\n if (params.loop && !prevSlide === 0) {\n prevSlide = slides[slides.length - 1];\n }\n }\n }\n slides.forEach(slideEl => {\n toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);\n toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);\n toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);\n });\n swiper.emitSlidesClasses();\n}\n\nconst processLazyPreloader = (swiper, imageEl) => {\n if (!swiper || swiper.destroyed || !swiper.params) return;\n const slideSelector = () => swiper.isElement ? `swiper-slide` : `.${swiper.params.slideClass}`;\n const slideEl = imageEl.closest(slideSelector());\n if (slideEl) {\n let lazyEl = slideEl.querySelector(`.${swiper.params.lazyPreloaderClass}`);\n if (!lazyEl && swiper.isElement) {\n if (slideEl.shadowRoot) {\n lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);\n } else {\n // init later\n requestAnimationFrame(() => {\n if (slideEl.shadowRoot) {\n lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);\n if (lazyEl) lazyEl.remove();\n }\n });\n }\n }\n if (lazyEl) lazyEl.remove();\n }\n};\nconst unlazy = (swiper, index) => {\n if (!swiper.slides[index]) return;\n const imageEl = swiper.slides[index].querySelector('[loading=\"lazy\"]');\n if (imageEl) imageEl.removeAttribute('loading');\n};\nconst preload = swiper => {\n if (!swiper || swiper.destroyed || !swiper.params) return;\n let amount = swiper.params.lazyPreloadPrevNext;\n const len = swiper.slides.length;\n if (!len || !amount || amount < 0) return;\n amount = Math.min(amount, len);\n const slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView);\n const activeIndex = swiper.activeIndex;\n if (swiper.params.grid && swiper.params.grid.rows > 1) {\n const activeColumn = activeIndex;\n const preloadColumns = [activeColumn - amount];\n preloadColumns.push(...Array.from({\n length: amount\n }).map((_, i) => {\n return activeColumn + slidesPerView + i;\n }));\n swiper.slides.forEach((slideEl, i) => {\n if (preloadColumns.includes(slideEl.column)) unlazy(swiper, i);\n });\n return;\n }\n const slideIndexLastInView = activeIndex + slidesPerView - 1;\n if (swiper.params.rewind || swiper.params.loop) {\n for (let i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) {\n const realIndex = (i % len + len) % len;\n if (realIndex < activeIndex || realIndex > slideIndexLastInView) unlazy(swiper, realIndex);\n }\n } else {\n for (let i = Math.max(activeIndex - amount, 0); i <= Math.min(slideIndexLastInView + amount, len - 1); i += 1) {\n if (i !== activeIndex && (i > slideIndexLastInView || i < activeIndex)) {\n unlazy(swiper, i);\n }\n }\n }\n};\n\nfunction getActiveIndexByTranslate(swiper) {\n const {\n slidesGrid,\n params\n } = swiper;\n const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n let activeIndex;\n for (let i = 0; i < slidesGrid.length; i += 1) {\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {\n activeIndex = i;\n } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {\n activeIndex = i + 1;\n }\n } else if (translate >= slidesGrid[i]) {\n activeIndex = i;\n }\n }\n // Normalize slideIndex\n if (params.normalizeSlideIndex) {\n if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;\n }\n return activeIndex;\n}\nfunction updateActiveIndex(newActiveIndex) {\n const swiper = this;\n const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n const {\n snapGrid,\n params,\n activeIndex: previousIndex,\n realIndex: previousRealIndex,\n snapIndex: previousSnapIndex\n } = swiper;\n let activeIndex = newActiveIndex;\n let snapIndex;\n const getVirtualRealIndex = aIndex => {\n let realIndex = aIndex - swiper.virtual.slidesBefore;\n if (realIndex < 0) {\n realIndex = swiper.virtual.slides.length + realIndex;\n }\n if (realIndex >= swiper.virtual.slides.length) {\n realIndex -= swiper.virtual.slides.length;\n }\n return realIndex;\n };\n if (typeof activeIndex === 'undefined') {\n activeIndex = getActiveIndexByTranslate(swiper);\n }\n if (snapGrid.indexOf(translate) >= 0) {\n snapIndex = snapGrid.indexOf(translate);\n } else {\n const skip = Math.min(params.slidesPerGroupSkip, activeIndex);\n snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);\n }\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n if (activeIndex === previousIndex && !swiper.params.loop) {\n if (snapIndex !== previousSnapIndex) {\n swiper.snapIndex = snapIndex;\n swiper.emit('snapIndexChange');\n }\n return;\n }\n if (activeIndex === previousIndex && swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {\n swiper.realIndex = getVirtualRealIndex(activeIndex);\n return;\n }\n const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;\n\n // Get real index\n let realIndex;\n if (swiper.virtual && params.virtual.enabled && params.loop) {\n realIndex = getVirtualRealIndex(activeIndex);\n } else if (gridEnabled) {\n const firstSlideInColumn = swiper.slides.filter(slideEl => slideEl.column === activeIndex)[0];\n let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute('data-swiper-slide-index'), 10);\n if (Number.isNaN(activeSlideIndex)) {\n activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);\n }\n realIndex = Math.floor(activeSlideIndex / params.grid.rows);\n } else if (swiper.slides[activeIndex]) {\n const slideIndex = swiper.slides[activeIndex].getAttribute('data-swiper-slide-index');\n if (slideIndex) {\n realIndex = parseInt(slideIndex, 10);\n } else {\n realIndex = activeIndex;\n }\n } else {\n realIndex = activeIndex;\n }\n Object.assign(swiper, {\n previousSnapIndex,\n snapIndex,\n previousRealIndex,\n realIndex,\n previousIndex,\n activeIndex\n });\n if (swiper.initialized) {\n preload(swiper);\n }\n swiper.emit('activeIndexChange');\n swiper.emit('snapIndexChange');\n if (swiper.initialized || swiper.params.runCallbacksOnInit) {\n if (previousRealIndex !== realIndex) {\n swiper.emit('realIndexChange');\n }\n swiper.emit('slideChange');\n }\n}\n\nfunction updateClickedSlide(el, path) {\n const swiper = this;\n const params = swiper.params;\n let slide = el.closest(`.${params.slideClass}, swiper-slide`);\n if (!slide && swiper.isElement && path && path.length > 1 && path.includes(el)) {\n [...path.slice(path.indexOf(el) + 1, path.length)].forEach(pathEl => {\n if (!slide && pathEl.matches && pathEl.matches(`.${params.slideClass}, swiper-slide`)) {\n slide = pathEl;\n }\n });\n }\n let slideFound = false;\n let slideIndex;\n if (slide) {\n for (let i = 0; i < swiper.slides.length; i += 1) {\n if (swiper.slides[i] === slide) {\n slideFound = true;\n slideIndex = i;\n break;\n }\n }\n }\n if (slide && slideFound) {\n swiper.clickedSlide = slide;\n if (swiper.virtual && swiper.params.virtual.enabled) {\n swiper.clickedIndex = parseInt(slide.getAttribute('data-swiper-slide-index'), 10);\n } else {\n swiper.clickedIndex = slideIndex;\n }\n } else {\n swiper.clickedSlide = undefined;\n swiper.clickedIndex = undefined;\n return;\n }\n if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {\n swiper.slideToClickedSlide();\n }\n}\n\nvar update = {\n updateSize,\n updateSlides,\n updateAutoHeight,\n updateSlidesOffset,\n updateSlidesProgress,\n updateProgress,\n updateSlidesClasses,\n updateActiveIndex,\n updateClickedSlide\n};\n\nfunction getSwiperTranslate(axis) {\n if (axis === void 0) {\n axis = this.isHorizontal() ? 'x' : 'y';\n }\n const swiper = this;\n const {\n params,\n rtlTranslate: rtl,\n translate,\n wrapperEl\n } = swiper;\n if (params.virtualTranslate) {\n return rtl ? -translate : translate;\n }\n if (params.cssMode) {\n return translate;\n }\n let currentTranslate = getTranslate(wrapperEl, axis);\n currentTranslate += swiper.cssOverflowAdjustment();\n if (rtl) currentTranslate = -currentTranslate;\n return currentTranslate || 0;\n}\n\nfunction setTranslate(translate, byController) {\n const swiper = this;\n const {\n rtlTranslate: rtl,\n params,\n wrapperEl,\n progress\n } = swiper;\n let x = 0;\n let y = 0;\n const z = 0;\n if (swiper.isHorizontal()) {\n x = rtl ? -translate : translate;\n } else {\n y = translate;\n }\n if (params.roundLengths) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n swiper.previousTranslate = swiper.translate;\n swiper.translate = swiper.isHorizontal() ? x : y;\n if (params.cssMode) {\n wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;\n } else if (!params.virtualTranslate) {\n if (swiper.isHorizontal()) {\n x -= swiper.cssOverflowAdjustment();\n } else {\n y -= swiper.cssOverflowAdjustment();\n }\n wrapperEl.style.transform = `translate3d(${x}px, ${y}px, ${z}px)`;\n }\n\n // Check if we need to update progress\n let newProgress;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (translate - swiper.minTranslate()) / translatesDiff;\n }\n if (newProgress !== progress) {\n swiper.updateProgress(translate);\n }\n swiper.emit('setTranslate', swiper.translate, byController);\n}\n\nfunction minTranslate() {\n return -this.snapGrid[0];\n}\n\nfunction maxTranslate() {\n return -this.snapGrid[this.snapGrid.length - 1];\n}\n\nfunction translateTo(translate, speed, runCallbacks, translateBounds, internal) {\n if (translate === void 0) {\n translate = 0;\n }\n if (speed === void 0) {\n speed = this.params.speed;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (translateBounds === void 0) {\n translateBounds = true;\n }\n const swiper = this;\n const {\n params,\n wrapperEl\n } = swiper;\n if (swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n const minTranslate = swiper.minTranslate();\n const maxTranslate = swiper.maxTranslate();\n let newTranslate;\n if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate;\n\n // Update progress\n swiper.updateProgress(newTranslate);\n if (params.cssMode) {\n const isH = swiper.isHorizontal();\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n } else {\n if (!swiper.support.smoothScroll) {\n animateCSSModeScroll({\n swiper,\n targetPosition: -newTranslate,\n side: isH ? 'left' : 'top'\n });\n return true;\n }\n wrapperEl.scrollTo({\n [isH ? 'left' : 'top']: -newTranslate,\n behavior: 'smooth'\n });\n }\n return true;\n }\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(newTranslate);\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionEnd');\n }\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(newTranslate);\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionStart');\n }\n if (!swiper.animating) {\n swiper.animating = true;\n if (!swiper.onTranslateToWrapperTransitionEnd) {\n swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.onTranslateToWrapperTransitionEnd = null;\n delete swiper.onTranslateToWrapperTransitionEnd;\n swiper.animating = false;\n if (runCallbacks) {\n swiper.emit('transitionEnd');\n }\n };\n }\n swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n }\n }\n return true;\n}\n\nvar translate = {\n getTranslate: getSwiperTranslate,\n setTranslate,\n minTranslate,\n maxTranslate,\n translateTo\n};\n\nfunction setTransition(duration, byController) {\n const swiper = this;\n if (!swiper.params.cssMode) {\n swiper.wrapperEl.style.transitionDuration = `${duration}ms`;\n swiper.wrapperEl.style.transitionDelay = duration === 0 ? `0ms` : '';\n }\n swiper.emit('setTransition', duration, byController);\n}\n\nfunction transitionEmit(_ref) {\n let {\n swiper,\n runCallbacks,\n direction,\n step\n } = _ref;\n const {\n activeIndex,\n previousIndex\n } = swiper;\n let dir = direction;\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';\n }\n swiper.emit(`transition${step}`);\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit(`slideResetTransition${step}`);\n return;\n }\n swiper.emit(`slideChangeTransition${step}`);\n if (dir === 'next') {\n swiper.emit(`slideNextTransition${step}`);\n } else {\n swiper.emit(`slidePrevTransition${step}`);\n }\n }\n}\n\nfunction transitionStart(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n params\n } = swiper;\n if (params.cssMode) return;\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n transitionEmit({\n swiper,\n runCallbacks,\n direction,\n step: 'Start'\n });\n}\n\nfunction transitionEnd(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n params\n } = swiper;\n swiper.animating = false;\n if (params.cssMode) return;\n swiper.setTransition(0);\n transitionEmit({\n swiper,\n runCallbacks,\n direction,\n step: 'End'\n });\n}\n\nvar transition = {\n setTransition,\n transitionStart,\n transitionEnd\n};\n\nfunction slideTo(index, speed, runCallbacks, internal, initial) {\n if (index === void 0) {\n index = 0;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (typeof index === 'string') {\n index = parseInt(index, 10);\n }\n const swiper = this;\n let slideIndex = index;\n if (slideIndex < 0) slideIndex = 0;\n const {\n params,\n snapGrid,\n slidesGrid,\n previousIndex,\n activeIndex,\n rtlTranslate: rtl,\n wrapperEl,\n enabled\n } = swiper;\n if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n if (typeof speed === 'undefined') {\n speed = swiper.params.speed;\n }\n const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);\n let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n const translate = -snapGrid[snapIndex];\n // Normalize slideIndex\n if (params.normalizeSlideIndex) {\n for (let i = 0; i < slidesGrid.length; i += 1) {\n const normalizedTranslate = -Math.floor(translate * 100);\n const normalizedGrid = Math.floor(slidesGrid[i] * 100);\n const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {\n slideIndex = i;\n } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {\n slideIndex = i + 1;\n }\n } else if (normalizedTranslate >= normalizedGrid) {\n slideIndex = i;\n }\n }\n }\n // Directions locks\n if (swiper.initialized && slideIndex !== activeIndex) {\n if (!swiper.allowSlideNext && (rtl ? translate > swiper.translate && translate > swiper.minTranslate() : translate < swiper.translate && translate < swiper.minTranslate())) {\n return false;\n }\n if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {\n if ((activeIndex || 0) !== slideIndex) {\n return false;\n }\n }\n }\n if (slideIndex !== (previousIndex || 0) && runCallbacks) {\n swiper.emit('beforeSlideChangeStart');\n }\n\n // Update progress\n swiper.updateProgress(translate);\n let direction;\n if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset';\n\n // Update Index\n if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {\n swiper.updateActiveIndex(slideIndex);\n // Update Height\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n swiper.updateSlidesClasses();\n if (params.effect !== 'slide') {\n swiper.setTranslate(translate);\n }\n if (direction !== 'reset') {\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n }\n return false;\n }\n if (params.cssMode) {\n const isH = swiper.isHorizontal();\n const t = rtl ? translate : -translate;\n if (speed === 0) {\n const isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n if (isVirtual) {\n swiper.wrapperEl.style.scrollSnapType = 'none';\n swiper._immediateVirtual = true;\n }\n if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) {\n swiper._cssModeVirtualInitialSet = true;\n requestAnimationFrame(() => {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n });\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n }\n if (isVirtual) {\n requestAnimationFrame(() => {\n swiper.wrapperEl.style.scrollSnapType = '';\n swiper._immediateVirtual = false;\n });\n }\n } else {\n if (!swiper.support.smoothScroll) {\n animateCSSModeScroll({\n swiper,\n targetPosition: t,\n side: isH ? 'left' : 'top'\n });\n return true;\n }\n wrapperEl.scrollTo({\n [isH ? 'left' : 'top']: t,\n behavior: 'smooth'\n });\n }\n return true;\n }\n swiper.setTransition(speed);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n if (speed === 0) {\n swiper.transitionEnd(runCallbacks, direction);\n } else if (!swiper.animating) {\n swiper.animating = true;\n if (!swiper.onSlideToWrapperTransitionEnd) {\n swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.onSlideToWrapperTransitionEnd = null;\n delete swiper.onSlideToWrapperTransitionEnd;\n swiper.transitionEnd(runCallbacks, direction);\n };\n }\n swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n }\n return true;\n}\n\nfunction slideToLoop(index, speed, runCallbacks, internal) {\n if (index === void 0) {\n index = 0;\n }\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (typeof index === 'string') {\n const indexAsNumber = parseInt(index, 10);\n index = indexAsNumber;\n }\n const swiper = this;\n if (swiper.destroyed) return;\n if (typeof speed === 'undefined') {\n speed = swiper.params.speed;\n }\n const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;\n let newIndex = index;\n if (swiper.params.loop) {\n if (swiper.virtual && swiper.params.virtual.enabled) {\n // eslint-disable-next-line\n newIndex = newIndex + swiper.virtual.slidesBefore;\n } else {\n let targetSlideIndex;\n if (gridEnabled) {\n const slideIndex = newIndex * swiper.params.grid.rows;\n targetSlideIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;\n } else {\n targetSlideIndex = swiper.getSlideIndexByData(newIndex);\n }\n const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;\n const {\n centeredSlides\n } = swiper.params;\n let slidesPerView = swiper.params.slidesPerView;\n if (slidesPerView === 'auto') {\n slidesPerView = swiper.slidesPerViewDynamic();\n } else {\n slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));\n if (centeredSlides && slidesPerView % 2 === 0) {\n slidesPerView = slidesPerView + 1;\n }\n }\n let needLoopFix = cols - targetSlideIndex < slidesPerView;\n if (centeredSlides) {\n needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);\n }\n if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {\n needLoopFix = false;\n }\n if (needLoopFix) {\n const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';\n swiper.loopFix({\n direction,\n slideTo: true,\n activeSlideIndex: direction === 'next' ? targetSlideIndex + 1 : targetSlideIndex - cols + 1,\n slideRealIndex: direction === 'next' ? swiper.realIndex : undefined\n });\n }\n if (gridEnabled) {\n const slideIndex = newIndex * swiper.params.grid.rows;\n newIndex = swiper.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === slideIndex)[0].column;\n } else {\n newIndex = swiper.getSlideIndexByData(newIndex);\n }\n }\n }\n requestAnimationFrame(() => {\n swiper.slideTo(newIndex, speed, runCallbacks, internal);\n });\n return swiper;\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slideNext(speed, runCallbacks, internal) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n enabled,\n params,\n animating\n } = swiper;\n if (!enabled || swiper.destroyed) return swiper;\n if (typeof speed === 'undefined') {\n speed = swiper.params.speed;\n }\n let perGroup = params.slidesPerGroup;\n if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {\n perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);\n }\n const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;\n const isVirtual = swiper.virtual && params.virtual.enabled;\n if (params.loop) {\n if (animating && !isVirtual && params.loopPreventsSliding) return false;\n swiper.loopFix({\n direction: 'next'\n });\n // eslint-disable-next-line\n swiper._clientLeft = swiper.wrapperEl.clientLeft;\n if (swiper.activeIndex === swiper.slides.length - 1 && params.cssMode) {\n requestAnimationFrame(() => {\n swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);\n });\n return true;\n }\n }\n if (params.rewind && swiper.isEnd) {\n return swiper.slideTo(0, speed, runCallbacks, internal);\n }\n return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slidePrev(speed, runCallbacks, internal) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n const {\n params,\n snapGrid,\n slidesGrid,\n rtlTranslate,\n enabled,\n animating\n } = swiper;\n if (!enabled || swiper.destroyed) return swiper;\n if (typeof speed === 'undefined') {\n speed = swiper.params.speed;\n }\n const isVirtual = swiper.virtual && params.virtual.enabled;\n if (params.loop) {\n if (animating && !isVirtual && params.loopPreventsSliding) return false;\n swiper.loopFix({\n direction: 'prev'\n });\n // eslint-disable-next-line\n swiper._clientLeft = swiper.wrapperEl.clientLeft;\n }\n const translate = rtlTranslate ? swiper.translate : -swiper.translate;\n function normalize(val) {\n if (val < 0) return -Math.floor(Math.abs(val));\n return Math.floor(val);\n }\n const normalizedTranslate = normalize(translate);\n const normalizedSnapGrid = snapGrid.map(val => normalize(val));\n let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];\n if (typeof prevSnap === 'undefined' && params.cssMode) {\n let prevSnapIndex;\n snapGrid.forEach((snap, snapIndex) => {\n if (normalizedTranslate >= snap) {\n // prevSnap = snap;\n prevSnapIndex = snapIndex;\n }\n });\n if (typeof prevSnapIndex !== 'undefined') {\n prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];\n }\n }\n let prevIndex = 0;\n if (typeof prevSnap !== 'undefined') {\n prevIndex = slidesGrid.indexOf(prevSnap);\n if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;\n if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {\n prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;\n prevIndex = Math.max(prevIndex, 0);\n }\n }\n if (params.rewind && swiper.isBeginning) {\n const lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;\n return swiper.slideTo(lastIndex, speed, runCallbacks, internal);\n } else if (params.loop && swiper.activeIndex === 0 && params.cssMode) {\n requestAnimationFrame(() => {\n swiper.slideTo(prevIndex, speed, runCallbacks, internal);\n });\n return true;\n }\n return swiper.slideTo(prevIndex, speed, runCallbacks, internal);\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slideReset(speed, runCallbacks, internal) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n const swiper = this;\n if (swiper.destroyed) return;\n if (typeof speed === 'undefined') {\n speed = swiper.params.speed;\n }\n return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);\n}\n\n/* eslint no-unused-vars: \"off\" */\nfunction slideToClosest(speed, runCallbacks, internal, threshold) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n if (threshold === void 0) {\n threshold = 0.5;\n }\n const swiper = this;\n if (swiper.destroyed) return;\n if (typeof speed === 'undefined') {\n speed = swiper.params.speed;\n }\n let index = swiper.activeIndex;\n const skip = Math.min(swiper.params.slidesPerGroupSkip, index);\n const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);\n const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n if (translate >= swiper.snapGrid[snapIndex]) {\n // The current translate is on or after the current snap index, so the choice\n // is between the current index and the one after it.\n const currentSnap = swiper.snapGrid[snapIndex];\n const nextSnap = swiper.snapGrid[snapIndex + 1];\n if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {\n index += swiper.params.slidesPerGroup;\n }\n } else {\n // The current translate is before the current snap index, so the choice\n // is between the current index and the one before it.\n const prevSnap = swiper.snapGrid[snapIndex - 1];\n const currentSnap = swiper.snapGrid[snapIndex];\n if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {\n index -= swiper.params.slidesPerGroup;\n }\n }\n index = Math.max(index, 0);\n index = Math.min(index, swiper.slidesGrid.length - 1);\n return swiper.slideTo(index, speed, runCallbacks, internal);\n}\n\nfunction slideToClickedSlide() {\n const swiper = this;\n if (swiper.destroyed) return;\n const {\n params,\n slidesEl\n } = swiper;\n const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;\n let slideToIndex = swiper.clickedIndex;\n let realIndex;\n const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;\n if (params.loop) {\n if (swiper.animating) return;\n realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10);\n if (params.centeredSlides) {\n if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {\n swiper.loopFix();\n slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index=\"${realIndex}\"]`)[0]);\n nextTick(() => {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else if (slideToIndex > swiper.slides.length - slidesPerView) {\n swiper.loopFix();\n slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index=\"${realIndex}\"]`)[0]);\n nextTick(() => {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else {\n swiper.slideTo(slideToIndex);\n }\n}\n\nvar slide = {\n slideTo,\n slideToLoop,\n slideNext,\n slidePrev,\n slideReset,\n slideToClosest,\n slideToClickedSlide\n};\n\nfunction loopCreate(slideRealIndex) {\n const swiper = this;\n const {\n params,\n slidesEl\n } = swiper;\n if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;\n const initSlides = () => {\n const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);\n slides.forEach((el, index) => {\n el.setAttribute('data-swiper-slide-index', index);\n });\n };\n const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;\n const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);\n const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;\n const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;\n const addBlankSlides = amountOfSlides => {\n for (let i = 0; i < amountOfSlides; i += 1) {\n const slideEl = swiper.isElement ? createElement('swiper-slide', [params.slideBlankClass]) : createElement('div', [params.slideClass, params.slideBlankClass]);\n swiper.slidesEl.append(slideEl);\n }\n };\n if (shouldFillGroup) {\n if (params.loopAddBlankSlides) {\n const slidesToAdd = slidesPerGroup - swiper.slides.length % slidesPerGroup;\n addBlankSlides(slidesToAdd);\n swiper.recalcSlides();\n swiper.updateSlides();\n } else {\n showWarning('Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');\n }\n initSlides();\n } else if (shouldFillGrid) {\n if (params.loopAddBlankSlides) {\n const slidesToAdd = params.grid.rows - swiper.slides.length % params.grid.rows;\n addBlankSlides(slidesToAdd);\n swiper.recalcSlides();\n swiper.updateSlides();\n } else {\n showWarning('Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)');\n }\n initSlides();\n } else {\n initSlides();\n }\n swiper.loopFix({\n slideRealIndex,\n direction: params.centeredSlides ? undefined : 'next'\n });\n}\n\nfunction loopFix(_temp) {\n let {\n slideRealIndex,\n slideTo = true,\n direction,\n setTranslate,\n activeSlideIndex,\n byController,\n byMousewheel\n } = _temp === void 0 ? {} : _temp;\n const swiper = this;\n if (!swiper.params.loop) return;\n swiper.emit('beforeLoopFix');\n const {\n slides,\n allowSlidePrev,\n allowSlideNext,\n slidesEl,\n params\n } = swiper;\n const {\n centeredSlides\n } = params;\n swiper.allowSlidePrev = true;\n swiper.allowSlideNext = true;\n if (swiper.virtual && params.virtual.enabled) {\n if (slideTo) {\n if (!params.centeredSlides && swiper.snapIndex === 0) {\n swiper.slideTo(swiper.virtual.slides.length, 0, false, true);\n } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {\n swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);\n } else if (swiper.snapIndex === swiper.snapGrid.length - 1) {\n swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);\n }\n }\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n swiper.emit('loopFix');\n return;\n }\n let slidesPerView = params.slidesPerView;\n if (slidesPerView === 'auto') {\n slidesPerView = swiper.slidesPerViewDynamic();\n } else {\n slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));\n if (centeredSlides && slidesPerView % 2 === 0) {\n slidesPerView = slidesPerView + 1;\n }\n }\n const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;\n let loopedSlides = slidesPerGroup;\n if (loopedSlides % slidesPerGroup !== 0) {\n loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;\n }\n loopedSlides += params.loopAdditionalSlides;\n swiper.loopedSlides = loopedSlides;\n const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;\n if (slides.length < slidesPerView + loopedSlides) {\n showWarning('Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters');\n } else if (gridEnabled && params.grid.fill === 'row') {\n showWarning('Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`');\n }\n const prependSlidesIndexes = [];\n const appendSlidesIndexes = [];\n let activeIndex = swiper.activeIndex;\n if (typeof activeSlideIndex === 'undefined') {\n activeSlideIndex = swiper.getSlideIndex(slides.filter(el => el.classList.contains(params.slideActiveClass))[0]);\n } else {\n activeIndex = activeSlideIndex;\n }\n const isNext = direction === 'next' || !direction;\n const isPrev = direction === 'prev' || !direction;\n let slidesPrepended = 0;\n let slidesAppended = 0;\n const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;\n const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;\n const activeColIndexWithShift = activeColIndex + (centeredSlides && typeof setTranslate === 'undefined' ? -slidesPerView / 2 + 0.5 : 0);\n // prepend last slides before start\n if (activeColIndexWithShift < loopedSlides) {\n slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);\n for (let i = 0; i < loopedSlides - activeColIndexWithShift; i += 1) {\n const index = i - Math.floor(i / cols) * cols;\n if (gridEnabled) {\n const colIndexToPrepend = cols - index - 1;\n for (let i = slides.length - 1; i >= 0; i -= 1) {\n if (slides[i].column === colIndexToPrepend) prependSlidesIndexes.push(i);\n }\n // slides.forEach((slide, slideIndex) => {\n // if (slide.column === colIndexToPrepend) prependSlidesIndexes.push(slideIndex);\n // });\n } else {\n prependSlidesIndexes.push(cols - index - 1);\n }\n }\n } else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {\n slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);\n for (let i = 0; i < slidesAppended; i += 1) {\n const index = i - Math.floor(i / cols) * cols;\n if (gridEnabled) {\n slides.forEach((slide, slideIndex) => {\n if (slide.column === index) appendSlidesIndexes.push(slideIndex);\n });\n } else {\n appendSlidesIndexes.push(index);\n }\n }\n }\n swiper.__preventObserver__ = true;\n requestAnimationFrame(() => {\n swiper.__preventObserver__ = false;\n });\n if (isPrev) {\n prependSlidesIndexes.forEach(index => {\n slides[index].swiperLoopMoveDOM = true;\n slidesEl.prepend(slides[index]);\n slides[index].swiperLoopMoveDOM = false;\n });\n }\n if (isNext) {\n appendSlidesIndexes.forEach(index => {\n slides[index].swiperLoopMoveDOM = true;\n slidesEl.append(slides[index]);\n slides[index].swiperLoopMoveDOM = false;\n });\n }\n swiper.recalcSlides();\n if (params.slidesPerView === 'auto') {\n swiper.updateSlides();\n } else if (gridEnabled && (prependSlidesIndexes.length > 0 && isPrev || appendSlidesIndexes.length > 0 && isNext)) {\n swiper.slides.forEach((slide, slideIndex) => {\n swiper.grid.updateSlide(slideIndex, slide, swiper.slides);\n });\n }\n if (params.watchSlidesProgress) {\n swiper.updateSlidesOffset();\n }\n if (slideTo) {\n if (prependSlidesIndexes.length > 0 && isPrev) {\n if (typeof slideRealIndex === 'undefined') {\n const currentSlideTranslate = swiper.slidesGrid[activeIndex];\n const newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended];\n const diff = newSlideTranslate - currentSlideTranslate;\n if (byMousewheel) {\n swiper.setTranslate(swiper.translate - diff);\n } else {\n swiper.slideTo(activeIndex + Math.ceil(slidesPrepended), 0, false, true);\n if (setTranslate) {\n swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;\n swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;\n }\n }\n } else {\n if (setTranslate) {\n const shift = gridEnabled ? prependSlidesIndexes.length / params.grid.rows : prependSlidesIndexes.length;\n swiper.slideTo(swiper.activeIndex + shift, 0, false, true);\n swiper.touchEventsData.currentTranslate = swiper.translate;\n }\n }\n } else if (appendSlidesIndexes.length > 0 && isNext) {\n if (typeof slideRealIndex === 'undefined') {\n const currentSlideTranslate = swiper.slidesGrid[activeIndex];\n const newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended];\n const diff = newSlideTranslate - currentSlideTranslate;\n if (byMousewheel) {\n swiper.setTranslate(swiper.translate - diff);\n } else {\n swiper.slideTo(activeIndex - slidesAppended, 0, false, true);\n if (setTranslate) {\n swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;\n swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;\n }\n }\n } else {\n const shift = gridEnabled ? appendSlidesIndexes.length / params.grid.rows : appendSlidesIndexes.length;\n swiper.slideTo(swiper.activeIndex - shift, 0, false, true);\n }\n }\n }\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n if (swiper.controller && swiper.controller.control && !byController) {\n const loopParams = {\n slideRealIndex,\n direction,\n setTranslate,\n activeSlideIndex,\n byController: true\n };\n if (Array.isArray(swiper.controller.control)) {\n swiper.controller.control.forEach(c => {\n if (!c.destroyed && c.params.loop) c.loopFix({\n ...loopParams,\n slideTo: c.params.slidesPerView === params.slidesPerView ? slideTo : false\n });\n });\n } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) {\n swiper.controller.control.loopFix({\n ...loopParams,\n slideTo: swiper.controller.control.params.slidesPerView === params.slidesPerView ? slideTo : false\n });\n }\n }\n swiper.emit('loopFix');\n}\n\nfunction loopDestroy() {\n const swiper = this;\n const {\n params,\n slidesEl\n } = swiper;\n if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;\n swiper.recalcSlides();\n const newSlidesOrder = [];\n swiper.slides.forEach(slideEl => {\n const index = typeof slideEl.swiperSlideIndex === 'undefined' ? slideEl.getAttribute('data-swiper-slide-index') * 1 : slideEl.swiperSlideIndex;\n newSlidesOrder[index] = slideEl;\n });\n swiper.slides.forEach(slideEl => {\n slideEl.removeAttribute('data-swiper-slide-index');\n });\n newSlidesOrder.forEach(slideEl => {\n slidesEl.append(slideEl);\n });\n swiper.recalcSlides();\n swiper.slideTo(swiper.realIndex, 0);\n}\n\nvar loop = {\n loopCreate,\n loopFix,\n loopDestroy\n};\n\nfunction setGrabCursor(moving) {\n const swiper = this;\n if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;\n const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;\n if (swiper.isElement) {\n swiper.__preventObserver__ = true;\n }\n el.style.cursor = 'move';\n el.style.cursor = moving ? 'grabbing' : 'grab';\n if (swiper.isElement) {\n requestAnimationFrame(() => {\n swiper.__preventObserver__ = false;\n });\n }\n}\n\nfunction unsetGrabCursor() {\n const swiper = this;\n if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {\n return;\n }\n if (swiper.isElement) {\n swiper.__preventObserver__ = true;\n }\n swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';\n if (swiper.isElement) {\n requestAnimationFrame(() => {\n swiper.__preventObserver__ = false;\n });\n }\n}\n\nvar grabCursor = {\n setGrabCursor,\n unsetGrabCursor\n};\n\n// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd\nfunction closestElement(selector, base) {\n if (base === void 0) {\n base = this;\n }\n function __closestFrom(el) {\n if (!el || el === getDocument() || el === getWindow()) return null;\n if (el.assignedSlot) el = el.assignedSlot;\n const found = el.closest(selector);\n if (!found && !el.getRootNode) {\n return null;\n }\n return found || __closestFrom(el.getRootNode().host);\n }\n return __closestFrom(base);\n}\nfunction preventEdgeSwipe(swiper, event, startX) {\n const window = getWindow();\n const {\n params\n } = swiper;\n const edgeSwipeDetection = params.edgeSwipeDetection;\n const edgeSwipeThreshold = params.edgeSwipeThreshold;\n if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {\n if (edgeSwipeDetection === 'prevent') {\n event.preventDefault();\n return true;\n }\n return false;\n }\n return true;\n}\nfunction onTouchStart(event) {\n const swiper = this;\n const document = getDocument();\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n const data = swiper.touchEventsData;\n if (e.type === 'pointerdown') {\n if (data.pointerId !== null && data.pointerId !== e.pointerId) {\n return;\n }\n data.pointerId = e.pointerId;\n } else if (e.type === 'touchstart' && e.targetTouches.length === 1) {\n data.touchId = e.targetTouches[0].identifier;\n }\n if (e.type === 'touchstart') {\n // don't proceed touch event\n preventEdgeSwipe(swiper, e, e.targetTouches[0].pageX);\n return;\n }\n const {\n params,\n touches,\n enabled\n } = swiper;\n if (!enabled) return;\n if (!params.simulateTouch && e.pointerType === 'mouse') return;\n if (swiper.animating && params.preventInteractionOnTransition) {\n return;\n }\n if (!swiper.animating && params.cssMode && params.loop) {\n swiper.loopFix();\n }\n let targetEl = e.target;\n if (params.touchEventsTarget === 'wrapper') {\n if (!elementIsChildOf(targetEl, swiper.wrapperEl)) return;\n }\n if ('which' in e && e.which === 3) return;\n if ('button' in e && e.button > 0) return;\n if (data.isTouched && data.isMoved) return;\n\n // change target el for shadow root component\n const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';\n // eslint-disable-next-line\n const eventPath = e.composedPath ? e.composedPath() : e.path;\n if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {\n targetEl = eventPath[0];\n }\n const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;\n const isTargetShadow = !!(e.target && e.target.shadowRoot);\n\n // use closestElement for shadow root element to get the actual closest for nested shadow root element\n if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) {\n swiper.allowClick = true;\n return;\n }\n if (params.swipeHandler) {\n if (!targetEl.closest(params.swipeHandler)) return;\n }\n touches.currentX = e.pageX;\n touches.currentY = e.pageY;\n const startX = touches.currentX;\n const startY = touches.currentY;\n\n // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore\n\n if (!preventEdgeSwipe(swiper, e, startX)) {\n return;\n }\n Object.assign(data, {\n isTouched: true,\n isMoved: false,\n allowTouchCallbacks: true,\n isScrolling: undefined,\n startMoving: undefined\n });\n touches.startX = startX;\n touches.startY = startY;\n data.touchStartTime = now();\n swiper.allowClick = true;\n swiper.updateSize();\n swiper.swipeDirection = undefined;\n if (params.threshold > 0) data.allowThresholdMove = false;\n let preventDefault = true;\n if (targetEl.matches(data.focusableElements)) {\n preventDefault = false;\n if (targetEl.nodeName === 'SELECT') {\n data.isTouched = false;\n }\n }\n if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) {\n document.activeElement.blur();\n }\n const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;\n if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) {\n e.preventDefault();\n }\n if (params.freeMode && params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) {\n swiper.freeMode.onTouchStart();\n }\n swiper.emit('touchStart', e);\n}\n\nfunction onTouchMove(event) {\n const document = getDocument();\n const swiper = this;\n const data = swiper.touchEventsData;\n const {\n params,\n touches,\n rtlTranslate: rtl,\n enabled\n } = swiper;\n if (!enabled) return;\n if (!params.simulateTouch && event.pointerType === 'mouse') return;\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n if (e.type === 'pointermove') {\n if (data.touchId !== null) return; // return from pointer if we use touch\n const id = e.pointerId;\n if (id !== data.pointerId) return;\n }\n let targetTouch;\n if (e.type === 'touchmove') {\n targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];\n if (!targetTouch || targetTouch.identifier !== data.touchId) return;\n } else {\n targetTouch = e;\n }\n if (!data.isTouched) {\n if (data.startMoving && data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n return;\n }\n const pageX = targetTouch.pageX;\n const pageY = targetTouch.pageY;\n if (e.preventedByNestedSwiper) {\n touches.startX = pageX;\n touches.startY = pageY;\n return;\n }\n if (!swiper.allowTouchMove) {\n if (!e.target.matches(data.focusableElements)) {\n swiper.allowClick = false;\n }\n if (data.isTouched) {\n Object.assign(touches, {\n startX: pageX,\n startY: pageY,\n currentX: pageX,\n currentY: pageY\n });\n data.touchStartTime = now();\n }\n return;\n }\n if (params.touchReleaseOnEdges && !params.loop) {\n if (swiper.isVertical()) {\n // Vertical\n if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {\n data.isTouched = false;\n data.isMoved = false;\n return;\n }\n } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {\n return;\n }\n }\n if (document.activeElement) {\n if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {\n data.isMoved = true;\n swiper.allowClick = false;\n return;\n }\n }\n if (data.allowTouchCallbacks) {\n swiper.emit('touchMove', e);\n }\n touches.previousX = touches.currentX;\n touches.previousY = touches.currentY;\n touches.currentX = pageX;\n touches.currentY = pageY;\n const diffX = touches.currentX - touches.startX;\n const diffY = touches.currentY - touches.startY;\n if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;\n if (typeof data.isScrolling === 'undefined') {\n let touchAngle;\n if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {\n data.isScrolling = false;\n } else {\n // eslint-disable-next-line\n if (diffX * diffX + diffY * diffY >= 25) {\n touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;\n data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;\n }\n }\n }\n if (data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n if (typeof data.startMoving === 'undefined') {\n if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {\n data.startMoving = true;\n }\n }\n if (data.isScrolling || e.type === 'touchmove' && data.preventTouchMoveFromPointerMove) {\n data.isTouched = false;\n return;\n }\n if (!data.startMoving) {\n return;\n }\n swiper.allowClick = false;\n if (!params.cssMode && e.cancelable) {\n e.preventDefault();\n }\n if (params.touchMoveStopPropagation && !params.nested) {\n e.stopPropagation();\n }\n let diff = swiper.isHorizontal() ? diffX : diffY;\n let touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY;\n if (params.oneWayMovement) {\n diff = Math.abs(diff) * (rtl ? 1 : -1);\n touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1);\n }\n touches.diff = diff;\n diff *= params.touchRatio;\n if (rtl) {\n diff = -diff;\n touchesDiff = -touchesDiff;\n }\n const prevTouchesDirection = swiper.touchesDirection;\n swiper.swipeDirection = diff > 0 ? 'prev' : 'next';\n swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next';\n const isLoop = swiper.params.loop && !params.cssMode;\n const allowLoopFix = swiper.touchesDirection === 'next' && swiper.allowSlideNext || swiper.touchesDirection === 'prev' && swiper.allowSlidePrev;\n if (!data.isMoved) {\n if (isLoop && allowLoopFix) {\n swiper.loopFix({\n direction: swiper.swipeDirection\n });\n }\n data.startTranslate = swiper.getTranslate();\n swiper.setTransition(0);\n if (swiper.animating) {\n const evt = new window.CustomEvent('transitionend', {\n bubbles: true,\n cancelable: true,\n detail: {\n bySwiperTouchMove: true\n }\n });\n swiper.wrapperEl.dispatchEvent(evt);\n }\n data.allowMomentumBounce = false;\n // Grab Cursor\n if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(true);\n }\n swiper.emit('sliderFirstMove', e);\n }\n let loopFixed;\n new Date().getTime();\n if (data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {\n Object.assign(touches, {\n startX: pageX,\n startY: pageY,\n currentX: pageX,\n currentY: pageY,\n startTranslate: data.currentTranslate\n });\n data.loopSwapReset = true;\n data.startTranslate = data.currentTranslate;\n return;\n }\n swiper.emit('sliderMove', e);\n data.isMoved = true;\n data.currentTranslate = diff + data.startTranslate;\n let disableParentSwiper = true;\n let resistanceRatio = params.resistanceRatio;\n if (params.touchReleaseOnEdges) {\n resistanceRatio = 0;\n }\n if (diff > 0) {\n if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] : swiper.minTranslate())) {\n swiper.loopFix({\n direction: 'prev',\n setTranslate: true,\n activeSlideIndex: 0\n });\n }\n if (data.currentTranslate > swiper.minTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) {\n data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;\n }\n }\n } else if (diff < 0) {\n if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] : swiper.maxTranslate())) {\n swiper.loopFix({\n direction: 'next',\n setTranslate: true,\n activeSlideIndex: swiper.slides.length - (params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10)))\n });\n }\n if (data.currentTranslate < swiper.maxTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) {\n data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;\n }\n }\n }\n if (disableParentSwiper) {\n e.preventedByNestedSwiper = true;\n }\n\n // Directions locks\n if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {\n data.currentTranslate = data.startTranslate;\n }\n\n // Threshold\n if (params.threshold > 0) {\n if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {\n if (!data.allowThresholdMove) {\n data.allowThresholdMove = true;\n touches.startX = touches.currentX;\n touches.startY = touches.currentY;\n data.currentTranslate = data.startTranslate;\n touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;\n return;\n }\n } else {\n data.currentTranslate = data.startTranslate;\n return;\n }\n }\n if (!params.followFinger || params.cssMode) return;\n\n // Update active index in free mode\n if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n if (params.freeMode && params.freeMode.enabled && swiper.freeMode) {\n swiper.freeMode.onTouchMove();\n }\n // Update progress\n swiper.updateProgress(data.currentTranslate);\n // Update translate\n swiper.setTranslate(data.currentTranslate);\n}\n\nfunction onTouchEnd(event) {\n const swiper = this;\n const data = swiper.touchEventsData;\n let e = event;\n if (e.originalEvent) e = e.originalEvent;\n let targetTouch;\n const isTouchEvent = e.type === 'touchend' || e.type === 'touchcancel';\n if (!isTouchEvent) {\n if (data.touchId !== null) return; // return from pointer if we use touch\n if (e.pointerId !== data.pointerId) return;\n targetTouch = e;\n } else {\n targetTouch = [...e.changedTouches].filter(t => t.identifier === data.touchId)[0];\n if (!targetTouch || targetTouch.identifier !== data.touchId) return;\n }\n if (['pointercancel', 'pointerout', 'pointerleave', 'contextmenu'].includes(e.type)) {\n const proceed = ['pointercancel', 'contextmenu'].includes(e.type) && (swiper.browser.isSafari || swiper.browser.isWebView);\n if (!proceed) {\n return;\n }\n }\n data.pointerId = null;\n data.touchId = null;\n const {\n params,\n touches,\n rtlTranslate: rtl,\n slidesGrid,\n enabled\n } = swiper;\n if (!enabled) return;\n if (!params.simulateTouch && e.pointerType === 'mouse') return;\n if (data.allowTouchCallbacks) {\n swiper.emit('touchEnd', e);\n }\n data.allowTouchCallbacks = false;\n if (!data.isTouched) {\n if (data.isMoved && params.grabCursor) {\n swiper.setGrabCursor(false);\n }\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n\n // Return Grab Cursor\n if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(false);\n }\n\n // Time diff\n const touchEndTime = now();\n const timeDiff = touchEndTime - data.touchStartTime;\n\n // Tap, doubleTap, Click\n if (swiper.allowClick) {\n const pathTree = e.path || e.composedPath && e.composedPath();\n swiper.updateClickedSlide(pathTree && pathTree[0] || e.target, pathTree);\n swiper.emit('tap click', e);\n if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {\n swiper.emit('doubleTap doubleClick', e);\n }\n }\n data.lastClickTime = now();\n nextTick(() => {\n if (!swiper.destroyed) swiper.allowClick = true;\n });\n if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 && !data.loopSwapReset || data.currentTranslate === data.startTranslate && !data.loopSwapReset) {\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n let currentPos;\n if (params.followFinger) {\n currentPos = rtl ? swiper.translate : -swiper.translate;\n } else {\n currentPos = -data.currentTranslate;\n }\n if (params.cssMode) {\n return;\n }\n if (params.freeMode && params.freeMode.enabled) {\n swiper.freeMode.onTouchEnd({\n currentPos\n });\n return;\n }\n\n // Find current slide\n const swipeToLast = currentPos >= -swiper.maxTranslate() && !swiper.params.loop;\n let stopIndex = 0;\n let groupSize = swiper.slidesSizesGrid[0];\n for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {\n const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n if (typeof slidesGrid[i + increment] !== 'undefined') {\n if (swipeToLast || currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {\n stopIndex = i;\n groupSize = slidesGrid[i + increment] - slidesGrid[i];\n }\n } else if (swipeToLast || currentPos >= slidesGrid[i]) {\n stopIndex = i;\n groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];\n }\n }\n let rewindFirstIndex = null;\n let rewindLastIndex = null;\n if (params.rewind) {\n if (swiper.isBeginning) {\n rewindLastIndex = params.virtual && params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1;\n } else if (swiper.isEnd) {\n rewindFirstIndex = 0;\n }\n }\n // Find current slide size\n const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;\n const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n if (timeDiff > params.longSwipesMs) {\n // Long touches\n if (!params.longSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n if (swiper.swipeDirection === 'next') {\n if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex);\n }\n if (swiper.swipeDirection === 'prev') {\n if (ratio > 1 - params.longSwipesRatio) {\n swiper.slideTo(stopIndex + increment);\n } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) {\n swiper.slideTo(rewindLastIndex);\n } else {\n swiper.slideTo(stopIndex);\n }\n }\n } else {\n // Short swipes\n if (!params.shortSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);\n if (!isNavButtonTarget) {\n if (swiper.swipeDirection === 'next') {\n swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment);\n }\n if (swiper.swipeDirection === 'prev') {\n swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex);\n }\n } else if (e.target === swiper.navigation.nextEl) {\n swiper.slideTo(stopIndex + increment);\n } else {\n swiper.slideTo(stopIndex);\n }\n }\n}\n\nfunction onResize() {\n const swiper = this;\n const {\n params,\n el\n } = swiper;\n if (el && el.offsetWidth === 0) return;\n\n // Breakpoints\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n // Save locks\n const {\n allowSlideNext,\n allowSlidePrev,\n snapGrid\n } = swiper;\n const isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n\n // Disable locks on resize\n swiper.allowSlideNext = true;\n swiper.allowSlidePrev = true;\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateSlidesClasses();\n const isVirtualLoop = isVirtual && params.loop;\n if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {\n swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n if (swiper.params.loop && !isVirtual) {\n swiper.slideToLoop(swiper.realIndex, 0, false, true);\n } else {\n swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n }\n if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {\n clearTimeout(swiper.autoplay.resizeTimeout);\n swiper.autoplay.resizeTimeout = setTimeout(() => {\n if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {\n swiper.autoplay.resume();\n }\n }, 500);\n }\n // Return locks after resize\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n}\n\nfunction onClick(e) {\n const swiper = this;\n if (!swiper.enabled) return;\n if (!swiper.allowClick) {\n if (swiper.params.preventClicks) e.preventDefault();\n if (swiper.params.preventClicksPropagation && swiper.animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n}\n\nfunction onScroll() {\n const swiper = this;\n const {\n wrapperEl,\n rtlTranslate,\n enabled\n } = swiper;\n if (!enabled) return;\n swiper.previousTranslate = swiper.translate;\n if (swiper.isHorizontal()) {\n swiper.translate = -wrapperEl.scrollLeft;\n } else {\n swiper.translate = -wrapperEl.scrollTop;\n }\n // eslint-disable-next-line\n if (swiper.translate === 0) swiper.translate = 0;\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n let newProgress;\n const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;\n }\n if (newProgress !== swiper.progress) {\n swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);\n }\n swiper.emit('setTranslate', swiper.translate, false);\n}\n\nfunction onLoad(e) {\n const swiper = this;\n processLazyPreloader(swiper, e.target);\n if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) {\n return;\n }\n swiper.update();\n}\n\nfunction onDocumentTouchStart() {\n const swiper = this;\n if (swiper.documentTouchHandlerProceeded) return;\n swiper.documentTouchHandlerProceeded = true;\n if (swiper.params.touchReleaseOnEdges) {\n swiper.el.style.touchAction = 'auto';\n }\n}\n\nconst events = (swiper, method) => {\n const document = getDocument();\n const {\n params,\n el,\n wrapperEl,\n device\n } = swiper;\n const capture = !!params.nested;\n const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';\n const swiperMethod = method;\n if (!el || typeof el === 'string') return;\n\n // Touch Events\n document[domMethod]('touchstart', swiper.onDocumentTouchStart, {\n passive: false,\n capture\n });\n el[domMethod]('touchstart', swiper.onTouchStart, {\n passive: false\n });\n el[domMethod]('pointerdown', swiper.onTouchStart, {\n passive: false\n });\n document[domMethod]('touchmove', swiper.onTouchMove, {\n passive: false,\n capture\n });\n document[domMethod]('pointermove', swiper.onTouchMove, {\n passive: false,\n capture\n });\n document[domMethod]('touchend', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('pointerup', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('pointercancel', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('touchcancel', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('pointerout', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('pointerleave', swiper.onTouchEnd, {\n passive: true\n });\n document[domMethod]('contextmenu', swiper.onTouchEnd, {\n passive: true\n });\n\n // Prevent Links Clicks\n if (params.preventClicks || params.preventClicksPropagation) {\n el[domMethod]('click', swiper.onClick, true);\n }\n if (params.cssMode) {\n wrapperEl[domMethod]('scroll', swiper.onScroll);\n }\n\n // Resize handler\n if (params.updateOnWindowResize) {\n swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);\n } else {\n swiper[swiperMethod]('observerUpdate', onResize, true);\n }\n\n // Images loader\n el[domMethod]('load', swiper.onLoad, {\n capture: true\n });\n};\nfunction attachEvents() {\n const swiper = this;\n const {\n params\n } = swiper;\n swiper.onTouchStart = onTouchStart.bind(swiper);\n swiper.onTouchMove = onTouchMove.bind(swiper);\n swiper.onTouchEnd = onTouchEnd.bind(swiper);\n swiper.onDocumentTouchStart = onDocumentTouchStart.bind(swiper);\n if (params.cssMode) {\n swiper.onScroll = onScroll.bind(swiper);\n }\n swiper.onClick = onClick.bind(swiper);\n swiper.onLoad = onLoad.bind(swiper);\n events(swiper, 'on');\n}\nfunction detachEvents() {\n const swiper = this;\n events(swiper, 'off');\n}\nvar events$1 = {\n attachEvents,\n detachEvents\n};\n\nconst isGridEnabled = (swiper, params) => {\n return swiper.grid && params.grid && params.grid.rows > 1;\n};\nfunction setBreakpoint() {\n const swiper = this;\n const {\n realIndex,\n initialized,\n params,\n el\n } = swiper;\n const breakpoints = params.breakpoints;\n if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return;\n\n // Get breakpoint for window width and update parameters\n const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);\n if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;\n const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;\n const breakpointParams = breakpointOnlyParams || swiper.originalParams;\n const wasMultiRow = isGridEnabled(swiper, params);\n const isMultiRow = isGridEnabled(swiper, breakpointParams);\n const wasGrabCursor = swiper.params.grabCursor;\n const isGrabCursor = breakpointParams.grabCursor;\n const wasEnabled = params.enabled;\n if (wasMultiRow && !isMultiRow) {\n el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);\n swiper.emitContainerClasses();\n } else if (!wasMultiRow && isMultiRow) {\n el.classList.add(`${params.containerModifierClass}grid`);\n if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {\n el.classList.add(`${params.containerModifierClass}grid-column`);\n }\n swiper.emitContainerClasses();\n }\n if (wasGrabCursor && !isGrabCursor) {\n swiper.unsetGrabCursor();\n } else if (!wasGrabCursor && isGrabCursor) {\n swiper.setGrabCursor();\n }\n\n // Toggle navigation, pagination, scrollbar\n ['navigation', 'pagination', 'scrollbar'].forEach(prop => {\n if (typeof breakpointParams[prop] === 'undefined') return;\n const wasModuleEnabled = params[prop] && params[prop].enabled;\n const isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled;\n if (wasModuleEnabled && !isModuleEnabled) {\n swiper[prop].disable();\n }\n if (!wasModuleEnabled && isModuleEnabled) {\n swiper[prop].enable();\n }\n });\n const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;\n const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);\n const wasLoop = params.loop;\n if (directionChanged && initialized) {\n swiper.changeDirection();\n }\n extend(swiper.params, breakpointParams);\n const isEnabled = swiper.params.enabled;\n const hasLoop = swiper.params.loop;\n Object.assign(swiper, {\n allowTouchMove: swiper.params.allowTouchMove,\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev\n });\n if (wasEnabled && !isEnabled) {\n swiper.disable();\n } else if (!wasEnabled && isEnabled) {\n swiper.enable();\n }\n swiper.currentBreakpoint = breakpoint;\n swiper.emit('_beforeBreakpoint', breakpointParams);\n if (initialized) {\n if (needsReLoop) {\n swiper.loopDestroy();\n swiper.loopCreate(realIndex);\n swiper.updateSlides();\n } else if (!wasLoop && hasLoop) {\n swiper.loopCreate(realIndex);\n swiper.updateSlides();\n } else if (wasLoop && !hasLoop) {\n swiper.loopDestroy();\n }\n }\n swiper.emit('breakpoint', breakpointParams);\n}\n\nfunction getBreakpoint(breakpoints, base, containerEl) {\n if (base === void 0) {\n base = 'window';\n }\n if (!breakpoints || base === 'container' && !containerEl) return undefined;\n let breakpoint = false;\n const window = getWindow();\n const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;\n const points = Object.keys(breakpoints).map(point => {\n if (typeof point === 'string' && point.indexOf('@') === 0) {\n const minRatio = parseFloat(point.substr(1));\n const value = currentHeight * minRatio;\n return {\n value,\n point\n };\n }\n return {\n value: point,\n point\n };\n });\n points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));\n for (let i = 0; i < points.length; i += 1) {\n const {\n point,\n value\n } = points[i];\n if (base === 'window') {\n if (window.matchMedia(`(min-width: ${value}px)`).matches) {\n breakpoint = point;\n }\n } else if (value <= containerEl.clientWidth) {\n breakpoint = point;\n }\n }\n return breakpoint || 'max';\n}\n\nvar breakpoints = {\n setBreakpoint,\n getBreakpoint\n};\n\nfunction prepareClasses(entries, prefix) {\n const resultClasses = [];\n entries.forEach(item => {\n if (typeof item === 'object') {\n Object.keys(item).forEach(classNames => {\n if (item[classNames]) {\n resultClasses.push(prefix + classNames);\n }\n });\n } else if (typeof item === 'string') {\n resultClasses.push(prefix + item);\n }\n });\n return resultClasses;\n}\nfunction addClasses() {\n const swiper = this;\n const {\n classNames,\n params,\n rtl,\n el,\n device\n } = swiper;\n // prettier-ignore\n const suffixes = prepareClasses(['initialized', params.direction, {\n 'free-mode': swiper.params.freeMode && params.freeMode.enabled\n }, {\n 'autoheight': params.autoHeight\n }, {\n 'rtl': rtl\n }, {\n 'grid': params.grid && params.grid.rows > 1\n }, {\n 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'\n }, {\n 'android': device.android\n }, {\n 'ios': device.ios\n }, {\n 'css-mode': params.cssMode\n }, {\n 'centered': params.cssMode && params.centeredSlides\n }, {\n 'watch-progress': params.watchSlidesProgress\n }], params.containerModifierClass);\n classNames.push(...suffixes);\n el.classList.add(...classNames);\n swiper.emitContainerClasses();\n}\n\nfunction removeClasses() {\n const swiper = this;\n const {\n el,\n classNames\n } = swiper;\n if (!el || typeof el === 'string') return;\n el.classList.remove(...classNames);\n swiper.emitContainerClasses();\n}\n\nvar classes = {\n addClasses,\n removeClasses\n};\n\nfunction checkOverflow() {\n const swiper = this;\n const {\n isLocked: wasLocked,\n params\n } = swiper;\n const {\n slidesOffsetBefore\n } = params;\n if (slidesOffsetBefore) {\n const lastSlideIndex = swiper.slides.length - 1;\n const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;\n swiper.isLocked = swiper.size > lastSlideRightEdge;\n } else {\n swiper.isLocked = swiper.snapGrid.length === 1;\n }\n if (params.allowSlideNext === true) {\n swiper.allowSlideNext = !swiper.isLocked;\n }\n if (params.allowSlidePrev === true) {\n swiper.allowSlidePrev = !swiper.isLocked;\n }\n if (wasLocked && wasLocked !== swiper.isLocked) {\n swiper.isEnd = false;\n }\n if (wasLocked !== swiper.isLocked) {\n swiper.emit(swiper.isLocked ? 'lock' : 'unlock');\n }\n}\nvar checkOverflow$1 = {\n checkOverflow\n};\n\nvar defaults = {\n init: true,\n direction: 'horizontal',\n oneWayMovement: false,\n swiperElementNodeName: 'SWIPER-CONTAINER',\n touchEventsTarget: 'wrapper',\n initialSlide: 0,\n speed: 300,\n cssMode: false,\n updateOnWindowResize: true,\n resizeObserver: true,\n nested: false,\n createElements: false,\n eventsPrefix: 'swiper',\n enabled: true,\n focusableElements: 'input, select, option, textarea, button, video, label',\n // Overrides\n width: null,\n height: null,\n //\n preventInteractionOnTransition: false,\n // ssr\n userAgent: null,\n url: null,\n // To support iOS's swipe-to-go-back gesture (when being used in-app).\n edgeSwipeDetection: false,\n edgeSwipeThreshold: 20,\n // Autoheight\n autoHeight: false,\n // Set wrapper width\n setWrapperSize: false,\n // Virtual Translate\n virtualTranslate: false,\n // Effects\n effect: 'slide',\n // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'\n\n // Breakpoints\n breakpoints: undefined,\n breakpointsBase: 'window',\n // Slides grid\n spaceBetween: 0,\n slidesPerView: 1,\n slidesPerGroup: 1,\n slidesPerGroupSkip: 0,\n slidesPerGroupAuto: false,\n centeredSlides: false,\n centeredSlidesBounds: false,\n slidesOffsetBefore: 0,\n // in px\n slidesOffsetAfter: 0,\n // in px\n normalizeSlideIndex: true,\n centerInsufficientSlides: false,\n // Disable swiper and hide navigation when container not overflow\n watchOverflow: true,\n // Round length\n roundLengths: false,\n // Touches\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n allowTouchMove: true,\n threshold: 5,\n touchMoveStopPropagation: false,\n touchStartPreventDefault: true,\n touchStartForcePreventDefault: false,\n touchReleaseOnEdges: false,\n // Unique Navigation Elements\n uniqueNavElements: true,\n // Resistance\n resistance: true,\n resistanceRatio: 0.85,\n // Progress\n watchSlidesProgress: false,\n // Cursor\n grabCursor: false,\n // Clicks\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n // loop\n loop: false,\n loopAddBlankSlides: true,\n loopAdditionalSlides: 0,\n loopPreventsSliding: true,\n // rewind\n rewind: false,\n // Swiping/no swiping\n allowSlidePrev: true,\n allowSlideNext: true,\n swipeHandler: null,\n // '.swipe-handler',\n noSwiping: true,\n noSwipingClass: 'swiper-no-swiping',\n noSwipingSelector: null,\n // Passive Listeners\n passiveListeners: true,\n maxBackfaceHiddenSlides: 10,\n // NS\n containerModifierClass: 'swiper-',\n // NEW\n slideClass: 'swiper-slide',\n slideBlankClass: 'swiper-slide-blank',\n slideActiveClass: 'swiper-slide-active',\n slideVisibleClass: 'swiper-slide-visible',\n slideFullyVisibleClass: 'swiper-slide-fully-visible',\n slideNextClass: 'swiper-slide-next',\n slidePrevClass: 'swiper-slide-prev',\n wrapperClass: 'swiper-wrapper',\n lazyPreloaderClass: 'swiper-lazy-preloader',\n lazyPreloadPrevNext: 0,\n // Callbacks\n runCallbacksOnInit: true,\n // Internals\n _emitClasses: false\n};\n\nfunction moduleExtendParams(params, allModulesParams) {\n return function extendParams(obj) {\n if (obj === void 0) {\n obj = {};\n }\n const moduleParamName = Object.keys(obj)[0];\n const moduleParams = obj[moduleParamName];\n if (typeof moduleParams !== 'object' || moduleParams === null) {\n extend(allModulesParams, obj);\n return;\n }\n if (params[moduleParamName] === true) {\n params[moduleParamName] = {\n enabled: true\n };\n }\n if (moduleParamName === 'navigation' && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].prevEl && !params[moduleParamName].nextEl) {\n params[moduleParamName].auto = true;\n }\n if (['pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] && params[moduleParamName].enabled && !params[moduleParamName].el) {\n params[moduleParamName].auto = true;\n }\n if (!(moduleParamName in params && 'enabled' in moduleParams)) {\n extend(allModulesParams, obj);\n return;\n }\n if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {\n params[moduleParamName].enabled = true;\n }\n if (!params[moduleParamName]) params[moduleParamName] = {\n enabled: false\n };\n extend(allModulesParams, obj);\n };\n}\n\n/* eslint no-param-reassign: \"off\" */\nconst prototypes = {\n eventsEmitter,\n update,\n translate,\n transition,\n slide,\n loop,\n grabCursor,\n events: events$1,\n breakpoints,\n checkOverflow: checkOverflow$1,\n classes\n};\nconst extendedDefaults = {};\nclass Swiper {\n constructor() {\n let el;\n let params;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {\n params = args[0];\n } else {\n [el, params] = args;\n }\n if (!params) params = {};\n params = extend({}, params);\n if (el && !params.el) params.el = el;\n const document = getDocument();\n if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) {\n const swipers = [];\n document.querySelectorAll(params.el).forEach(containerEl => {\n const newParams = extend({}, params, {\n el: containerEl\n });\n swipers.push(new Swiper(newParams));\n });\n // eslint-disable-next-line no-constructor-return\n return swipers;\n }\n\n // Swiper Instance\n const swiper = this;\n swiper.__swiper__ = true;\n swiper.support = getSupport();\n swiper.device = getDevice({\n userAgent: params.userAgent\n });\n swiper.browser = getBrowser();\n swiper.eventsListeners = {};\n swiper.eventsAnyListeners = [];\n swiper.modules = [...swiper.__modules__];\n if (params.modules && Array.isArray(params.modules)) {\n swiper.modules.push(...params.modules);\n }\n const allModulesParams = {};\n swiper.modules.forEach(mod => {\n mod({\n params,\n swiper,\n extendParams: moduleExtendParams(params, allModulesParams),\n on: swiper.on.bind(swiper),\n once: swiper.once.bind(swiper),\n off: swiper.off.bind(swiper),\n emit: swiper.emit.bind(swiper)\n });\n });\n\n // Extend defaults with modules params\n const swiperParams = extend({}, defaults, allModulesParams);\n\n // Extend defaults with passed params\n swiper.params = extend({}, swiperParams, extendedDefaults, params);\n swiper.originalParams = extend({}, swiper.params);\n swiper.passedParams = extend({}, params);\n\n // add event listeners\n if (swiper.params && swiper.params.on) {\n Object.keys(swiper.params.on).forEach(eventName => {\n swiper.on(eventName, swiper.params.on[eventName]);\n });\n }\n if (swiper.params && swiper.params.onAny) {\n swiper.onAny(swiper.params.onAny);\n }\n\n // Extend Swiper\n Object.assign(swiper, {\n enabled: swiper.params.enabled,\n el,\n // Classes\n classNames: [],\n // Slides\n slides: [],\n slidesGrid: [],\n snapGrid: [],\n slidesSizesGrid: [],\n // isDirection\n isHorizontal() {\n return swiper.params.direction === 'horizontal';\n },\n isVertical() {\n return swiper.params.direction === 'vertical';\n },\n // Indexes\n activeIndex: 0,\n realIndex: 0,\n //\n isBeginning: true,\n isEnd: false,\n // Props\n translate: 0,\n previousTranslate: 0,\n progress: 0,\n velocity: 0,\n animating: false,\n cssOverflowAdjustment() {\n // Returns 0 unless `translate` is > 2**23\n // Should be subtracted from css values to prevent overflow\n return Math.trunc(this.translate / 2 ** 23) * 2 ** 23;\n },\n // Locks\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev,\n // Touch Events\n touchEventsData: {\n isTouched: undefined,\n isMoved: undefined,\n allowTouchCallbacks: undefined,\n touchStartTime: undefined,\n isScrolling: undefined,\n currentTranslate: undefined,\n startTranslate: undefined,\n allowThresholdMove: undefined,\n // Form elements to match\n focusableElements: swiper.params.focusableElements,\n // Last click time\n lastClickTime: 0,\n clickTimeout: undefined,\n // Velocities\n velocities: [],\n allowMomentumBounce: undefined,\n startMoving: undefined,\n pointerId: null,\n touchId: null\n },\n // Clicks\n allowClick: true,\n // Touches\n allowTouchMove: swiper.params.allowTouchMove,\n touches: {\n startX: 0,\n startY: 0,\n currentX: 0,\n currentY: 0,\n diff: 0\n },\n // Images\n imagesToLoad: [],\n imagesLoaded: 0\n });\n swiper.emit('_swiper');\n\n // Init\n if (swiper.params.init) {\n swiper.init();\n }\n\n // Return app instance\n // eslint-disable-next-line no-constructor-return\n return swiper;\n }\n getDirectionLabel(property) {\n if (this.isHorizontal()) {\n return property;\n }\n // prettier-ignore\n return {\n 'width': 'height',\n 'margin-top': 'margin-left',\n 'margin-bottom ': 'margin-right',\n 'margin-left': 'margin-top',\n 'margin-right': 'margin-bottom',\n 'padding-left': 'padding-top',\n 'padding-right': 'padding-bottom',\n 'marginRight': 'marginBottom'\n }[property];\n }\n getSlideIndex(slideEl) {\n const {\n slidesEl,\n params\n } = this;\n const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);\n const firstSlideIndex = elementIndex(slides[0]);\n return elementIndex(slideEl) - firstSlideIndex;\n }\n getSlideIndexByData(index) {\n return this.getSlideIndex(this.slides.filter(slideEl => slideEl.getAttribute('data-swiper-slide-index') * 1 === index)[0]);\n }\n recalcSlides() {\n const swiper = this;\n const {\n slidesEl,\n params\n } = swiper;\n swiper.slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);\n }\n enable() {\n const swiper = this;\n if (swiper.enabled) return;\n swiper.enabled = true;\n if (swiper.params.grabCursor) {\n swiper.setGrabCursor();\n }\n swiper.emit('enable');\n }\n disable() {\n const swiper = this;\n if (!swiper.enabled) return;\n swiper.enabled = false;\n if (swiper.params.grabCursor) {\n swiper.unsetGrabCursor();\n }\n swiper.emit('disable');\n }\n setProgress(progress, speed) {\n const swiper = this;\n progress = Math.min(Math.max(progress, 0), 1);\n const min = swiper.minTranslate();\n const max = swiper.maxTranslate();\n const current = (max - min) * progress + min;\n swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n emitContainerClasses() {\n const swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n const cls = swiper.el.className.split(' ').filter(className => {\n return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;\n });\n swiper.emit('_containerClasses', cls.join(' '));\n }\n getSlideClasses(slideEl) {\n const swiper = this;\n if (swiper.destroyed) return '';\n return slideEl.className.split(' ').filter(className => {\n return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;\n }).join(' ');\n }\n emitSlidesClasses() {\n const swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n const updates = [];\n swiper.slides.forEach(slideEl => {\n const classNames = swiper.getSlideClasses(slideEl);\n updates.push({\n slideEl,\n classNames\n });\n swiper.emit('_slideClass', slideEl, classNames);\n });\n swiper.emit('_slideClasses', updates);\n }\n slidesPerViewDynamic(view, exact) {\n if (view === void 0) {\n view = 'current';\n }\n if (exact === void 0) {\n exact = false;\n }\n const swiper = this;\n const {\n params,\n slides,\n slidesGrid,\n slidesSizesGrid,\n size: swiperSize,\n activeIndex\n } = swiper;\n let spv = 1;\n if (typeof params.slidesPerView === 'number') return params.slidesPerView;\n if (params.centeredSlides) {\n let slideSize = slides[activeIndex] ? Math.ceil(slides[activeIndex].swiperSlideSize) : 0;\n let breakLoop;\n for (let i = activeIndex + 1; i < slides.length; i += 1) {\n if (slides[i] && !breakLoop) {\n slideSize += Math.ceil(slides[i].swiperSlideSize);\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n for (let i = activeIndex - 1; i >= 0; i -= 1) {\n if (slides[i] && !breakLoop) {\n slideSize += slides[i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n } else {\n // eslint-disable-next-line\n if (view === 'current') {\n for (let i = activeIndex + 1; i < slides.length; i += 1) {\n const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;\n if (slideInView) {\n spv += 1;\n }\n }\n } else {\n // previous\n for (let i = activeIndex - 1; i >= 0; i -= 1) {\n const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;\n if (slideInView) {\n spv += 1;\n }\n }\n }\n }\n return spv;\n }\n update() {\n const swiper = this;\n if (!swiper || swiper.destroyed) return;\n const {\n snapGrid,\n params\n } = swiper;\n // Breakpoints\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n [...swiper.el.querySelectorAll('[loading=\"lazy\"]')].forEach(imageEl => {\n if (imageEl.complete) {\n processLazyPreloader(swiper, imageEl);\n }\n });\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n function setTranslate() {\n const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;\n const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());\n swiper.setTranslate(newTranslate);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n let translated;\n if (params.freeMode && params.freeMode.enabled && !params.cssMode) {\n setTranslate();\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n } else {\n if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !params.centeredSlides) {\n const slides = swiper.virtual && params.virtual.enabled ? swiper.virtual.slides : swiper.slides;\n translated = swiper.slideTo(slides.length - 1, 0, false, true);\n } else {\n translated = swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n if (!translated) {\n setTranslate();\n }\n }\n if (params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n swiper.emit('update');\n }\n changeDirection(newDirection, needUpdate) {\n if (needUpdate === void 0) {\n needUpdate = true;\n }\n const swiper = this;\n const currentDirection = swiper.params.direction;\n if (!newDirection) {\n // eslint-disable-next-line\n newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';\n }\n if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {\n return swiper;\n }\n swiper.el.classList.remove(`${swiper.params.containerModifierClass}${currentDirection}`);\n swiper.el.classList.add(`${swiper.params.containerModifierClass}${newDirection}`);\n swiper.emitContainerClasses();\n swiper.params.direction = newDirection;\n swiper.slides.forEach(slideEl => {\n if (newDirection === 'vertical') {\n slideEl.style.width = '';\n } else {\n slideEl.style.height = '';\n }\n });\n swiper.emit('changeDirection');\n if (needUpdate) swiper.update();\n return swiper;\n }\n changeLanguageDirection(direction) {\n const swiper = this;\n if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return;\n swiper.rtl = direction === 'rtl';\n swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl;\n if (swiper.rtl) {\n swiper.el.classList.add(`${swiper.params.containerModifierClass}rtl`);\n swiper.el.dir = 'rtl';\n } else {\n swiper.el.classList.remove(`${swiper.params.containerModifierClass}rtl`);\n swiper.el.dir = 'ltr';\n }\n swiper.update();\n }\n mount(element) {\n const swiper = this;\n if (swiper.mounted) return true;\n\n // Find el\n let el = element || swiper.params.el;\n if (typeof el === 'string') {\n el = document.querySelector(el);\n }\n if (!el) {\n return false;\n }\n el.swiper = swiper;\n if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === swiper.params.swiperElementNodeName.toUpperCase()) {\n swiper.isElement = true;\n }\n const getWrapperSelector = () => {\n return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;\n };\n const getWrapper = () => {\n if (el && el.shadowRoot && el.shadowRoot.querySelector) {\n const res = el.shadowRoot.querySelector(getWrapperSelector());\n // Children needs to return slot items\n return res;\n }\n return elementChildren(el, getWrapperSelector())[0];\n };\n // Find Wrapper\n let wrapperEl = getWrapper();\n if (!wrapperEl && swiper.params.createElements) {\n wrapperEl = createElement('div', swiper.params.wrapperClass);\n el.append(wrapperEl);\n elementChildren(el, `.${swiper.params.slideClass}`).forEach(slideEl => {\n wrapperEl.append(slideEl);\n });\n }\n Object.assign(swiper, {\n el,\n wrapperEl,\n slidesEl: swiper.isElement && !el.parentNode.host.slideSlots ? el.parentNode.host : wrapperEl,\n hostEl: swiper.isElement ? el.parentNode.host : el,\n mounted: true,\n // RTL\n rtl: el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl',\n rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || elementStyle(el, 'direction') === 'rtl'),\n wrongRTL: elementStyle(wrapperEl, 'display') === '-webkit-box'\n });\n return true;\n }\n init(el) {\n const swiper = this;\n if (swiper.initialized) return swiper;\n const mounted = swiper.mount(el);\n if (mounted === false) return swiper;\n swiper.emit('beforeInit');\n\n // Set breakpoint\n if (swiper.params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n // Add Classes\n swiper.addClasses();\n\n // Update size\n swiper.updateSize();\n\n // Update slides\n swiper.updateSlides();\n if (swiper.params.watchOverflow) {\n swiper.checkOverflow();\n }\n\n // Set Grab Cursor\n if (swiper.params.grabCursor && swiper.enabled) {\n swiper.setGrabCursor();\n }\n\n // Slide To Initial Slide\n if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {\n swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true);\n } else {\n swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);\n }\n\n // Create loop\n if (swiper.params.loop) {\n swiper.loopCreate();\n }\n\n // Attach events\n swiper.attachEvents();\n const lazyElements = [...swiper.el.querySelectorAll('[loading=\"lazy\"]')];\n if (swiper.isElement) {\n lazyElements.push(...swiper.hostEl.querySelectorAll('[loading=\"lazy\"]'));\n }\n lazyElements.forEach(imageEl => {\n if (imageEl.complete) {\n processLazyPreloader(swiper, imageEl);\n } else {\n imageEl.addEventListener('load', e => {\n processLazyPreloader(swiper, e.target);\n });\n }\n });\n preload(swiper);\n\n // Init Flag\n swiper.initialized = true;\n preload(swiper);\n\n // Emit\n swiper.emit('init');\n swiper.emit('afterInit');\n return swiper;\n }\n destroy(deleteInstance, cleanStyles) {\n if (deleteInstance === void 0) {\n deleteInstance = true;\n }\n if (cleanStyles === void 0) {\n cleanStyles = true;\n }\n const swiper = this;\n const {\n params,\n el,\n wrapperEl,\n slides\n } = swiper;\n if (typeof swiper.params === 'undefined' || swiper.destroyed) {\n return null;\n }\n swiper.emit('beforeDestroy');\n\n // Init Flag\n swiper.initialized = false;\n\n // Detach events\n swiper.detachEvents();\n\n // Destroy loop\n if (params.loop) {\n swiper.loopDestroy();\n }\n\n // Cleanup styles\n if (cleanStyles) {\n swiper.removeClasses();\n if (el && typeof el !== 'string') {\n el.removeAttribute('style');\n }\n if (wrapperEl) {\n wrapperEl.removeAttribute('style');\n }\n if (slides && slides.length) {\n slides.forEach(slideEl => {\n slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);\n slideEl.removeAttribute('style');\n slideEl.removeAttribute('data-swiper-slide-index');\n });\n }\n }\n swiper.emit('destroy');\n\n // Detach emitter events\n Object.keys(swiper.eventsListeners).forEach(eventName => {\n swiper.off(eventName);\n });\n if (deleteInstance !== false) {\n if (swiper.el && typeof swiper.el !== 'string') {\n swiper.el.swiper = null;\n }\n deleteProps(swiper);\n }\n swiper.destroyed = true;\n return null;\n }\n static extendDefaults(newDefaults) {\n extend(extendedDefaults, newDefaults);\n }\n static get extendedDefaults() {\n return extendedDefaults;\n }\n static get defaults() {\n return defaults;\n }\n static installModule(mod) {\n if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];\n const modules = Swiper.prototype.__modules__;\n if (typeof mod === 'function' && modules.indexOf(mod) < 0) {\n modules.push(mod);\n }\n }\n static use(module) {\n if (Array.isArray(module)) {\n module.forEach(m => Swiper.installModule(m));\n return Swiper;\n }\n Swiper.installModule(module);\n return Swiper;\n }\n}\nObject.keys(prototypes).forEach(prototypeGroup => {\n Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {\n Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];\n });\n});\nSwiper.use([Resize, Observer]);\n\nexport { Swiper as S, defaults as d };\n","/* underscore in name -> watch for changes */\nconst paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'swiperElementNodeName', 'touchEventsTarget', 'initialSlide', '_speed', 'cssMode', 'updateOnWindowResize', 'resizeObserver', 'nested', 'focusableElements', '_enabled', '_width', '_height', 'preventInteractionOnTransition', 'userAgent', 'url', '_edgeSwipeDetection', '_edgeSwipeThreshold', '_freeMode', '_autoHeight', 'setWrapperSize', 'virtualTranslate', '_effect', 'breakpoints', 'breakpointsBase', '_spaceBetween', '_slidesPerView', 'maxBackfaceHiddenSlides', '_grid', '_slidesPerGroup', '_slidesPerGroupSkip', '_slidesPerGroupAuto', '_centeredSlides', '_centeredSlidesBounds', '_slidesOffsetBefore', '_slidesOffsetAfter', 'normalizeSlideIndex', '_centerInsufficientSlides', '_watchOverflow', 'roundLengths', 'touchRatio', 'touchAngle', 'simulateTouch', '_shortSwipes', '_longSwipes', 'longSwipesRatio', 'longSwipesMs', '_followFinger', 'allowTouchMove', '_threshold', 'touchMoveStopPropagation', 'touchStartPreventDefault', 'touchStartForcePreventDefault', 'touchReleaseOnEdges', 'uniqueNavElements', '_resistance', '_resistanceRatio', '_watchSlidesProgress', '_grabCursor', 'preventClicks', 'preventClicksPropagation', '_slideToClickedSlide', '_loop', 'loopAdditionalSlides', 'loopAddBlankSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideFullyVisibleClass', 'slideNextClass', 'slidePrevClass', 'slideBlankClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',\n// modules\n'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];\n\nfunction isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object' && !o.__swiper__;\n}\nfunction extend(target, src) {\n const noExtend = ['__proto__', 'constructor', 'prototype'];\n Object.keys(src).filter(key => noExtend.indexOf(key) < 0).forEach(key => {\n if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {\n if (src[key].__swiper__) target[key] = src[key];else extend(target[key], src[key]);\n } else {\n target[key] = src[key];\n }\n });\n}\nfunction needsNavigation(params) {\n if (params === void 0) {\n params = {};\n }\n return params.navigation && typeof params.navigation.nextEl === 'undefined' && typeof params.navigation.prevEl === 'undefined';\n}\nfunction needsPagination(params) {\n if (params === void 0) {\n params = {};\n }\n return params.pagination && typeof params.pagination.el === 'undefined';\n}\nfunction needsScrollbar(params) {\n if (params === void 0) {\n params = {};\n }\n return params.scrollbar && typeof params.scrollbar.el === 'undefined';\n}\nfunction uniqueClasses(classNames) {\n if (classNames === void 0) {\n classNames = '';\n }\n const classes = classNames.split(' ').map(c => c.trim()).filter(c => !!c);\n const unique = [];\n classes.forEach(c => {\n if (unique.indexOf(c) < 0) unique.push(c);\n });\n return unique.join(' ');\n}\nfunction attrToProp(attrName) {\n if (attrName === void 0) {\n attrName = '';\n }\n return attrName.replace(/-[a-z]/g, l => l.toUpperCase().replace('-', ''));\n}\nfunction wrapperClass(className) {\n if (className === void 0) {\n className = '';\n }\n if (!className) return 'swiper-wrapper';\n if (!className.includes('swiper-wrapper')) return `swiper-wrapper ${className}`;\n return className;\n}\n\nfunction updateSwiper(_ref) {\n let {\n swiper,\n slides,\n passedParams,\n changedParams,\n nextEl,\n prevEl,\n scrollbarEl,\n paginationEl\n } = _ref;\n const updateParams = changedParams.filter(key => key !== 'children' && key !== 'direction' && key !== 'wrapperClass');\n const {\n params: currentParams,\n pagination,\n navigation,\n scrollbar,\n virtual,\n thumbs\n } = swiper;\n let needThumbsInit;\n let needControllerInit;\n let needPaginationInit;\n let needScrollbarInit;\n let needNavigationInit;\n let loopNeedDestroy;\n let loopNeedEnable;\n let loopNeedReloop;\n if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && currentParams.thumbs && !currentParams.thumbs.swiper) {\n needThumbsInit = true;\n }\n if (changedParams.includes('controller') && passedParams.controller && passedParams.controller.control && currentParams.controller && !currentParams.controller.control) {\n needControllerInit = true;\n }\n if (changedParams.includes('pagination') && passedParams.pagination && (passedParams.pagination.el || paginationEl) && (currentParams.pagination || currentParams.pagination === false) && pagination && !pagination.el) {\n needPaginationInit = true;\n }\n if (changedParams.includes('scrollbar') && passedParams.scrollbar && (passedParams.scrollbar.el || scrollbarEl) && (currentParams.scrollbar || currentParams.scrollbar === false) && scrollbar && !scrollbar.el) {\n needScrollbarInit = true;\n }\n if (changedParams.includes('navigation') && passedParams.navigation && (passedParams.navigation.prevEl || prevEl) && (passedParams.navigation.nextEl || nextEl) && (currentParams.navigation || currentParams.navigation === false) && navigation && !navigation.prevEl && !navigation.nextEl) {\n needNavigationInit = true;\n }\n const destroyModule = mod => {\n if (!swiper[mod]) return;\n swiper[mod].destroy();\n if (mod === 'navigation') {\n if (swiper.isElement) {\n swiper[mod].prevEl.remove();\n swiper[mod].nextEl.remove();\n }\n currentParams[mod].prevEl = undefined;\n currentParams[mod].nextEl = undefined;\n swiper[mod].prevEl = undefined;\n swiper[mod].nextEl = undefined;\n } else {\n if (swiper.isElement) {\n swiper[mod].el.remove();\n }\n currentParams[mod].el = undefined;\n swiper[mod].el = undefined;\n }\n };\n if (changedParams.includes('loop') && swiper.isElement) {\n if (currentParams.loop && !passedParams.loop) {\n loopNeedDestroy = true;\n } else if (!currentParams.loop && passedParams.loop) {\n loopNeedEnable = true;\n } else {\n loopNeedReloop = true;\n }\n }\n updateParams.forEach(key => {\n if (isObject(currentParams[key]) && isObject(passedParams[key])) {\n Object.assign(currentParams[key], passedParams[key]);\n if ((key === 'navigation' || key === 'pagination' || key === 'scrollbar') && 'enabled' in passedParams[key] && !passedParams[key].enabled) {\n destroyModule(key);\n }\n } else {\n const newValue = passedParams[key];\n if ((newValue === true || newValue === false) && (key === 'navigation' || key === 'pagination' || key === 'scrollbar')) {\n if (newValue === false) {\n destroyModule(key);\n }\n } else {\n currentParams[key] = passedParams[key];\n }\n }\n });\n if (updateParams.includes('controller') && !needControllerInit && swiper.controller && swiper.controller.control && currentParams.controller && currentParams.controller.control) {\n swiper.controller.control = currentParams.controller.control;\n }\n if (changedParams.includes('children') && slides && virtual && currentParams.virtual.enabled) {\n virtual.slides = slides;\n virtual.update(true);\n } else if (changedParams.includes('virtual') && virtual && currentParams.virtual.enabled) {\n if (slides) virtual.slides = slides;\n virtual.update(true);\n }\n if (changedParams.includes('children') && slides && currentParams.loop) {\n loopNeedReloop = true;\n }\n if (needThumbsInit) {\n const initialized = thumbs.init();\n if (initialized) thumbs.update(true);\n }\n if (needControllerInit) {\n swiper.controller.control = currentParams.controller.control;\n }\n if (needPaginationInit) {\n if (swiper.isElement && (!paginationEl || typeof paginationEl === 'string')) {\n paginationEl = document.createElement('div');\n paginationEl.classList.add('swiper-pagination');\n paginationEl.part.add('pagination');\n swiper.el.appendChild(paginationEl);\n }\n if (paginationEl) currentParams.pagination.el = paginationEl;\n pagination.init();\n pagination.render();\n pagination.update();\n }\n if (needScrollbarInit) {\n if (swiper.isElement && (!scrollbarEl || typeof scrollbarEl === 'string')) {\n scrollbarEl = document.createElement('div');\n scrollbarEl.classList.add('swiper-scrollbar');\n scrollbarEl.part.add('scrollbar');\n swiper.el.appendChild(scrollbarEl);\n }\n if (scrollbarEl) currentParams.scrollbar.el = scrollbarEl;\n scrollbar.init();\n scrollbar.updateSize();\n scrollbar.setTranslate();\n }\n if (needNavigationInit) {\n if (swiper.isElement) {\n if (!nextEl || typeof nextEl === 'string') {\n nextEl = document.createElement('div');\n nextEl.classList.add('swiper-button-next');\n nextEl.innerHTML = swiper.hostEl.constructor.nextButtonSvg;\n nextEl.part.add('button-next');\n swiper.el.appendChild(nextEl);\n }\n if (!prevEl || typeof prevEl === 'string') {\n prevEl = document.createElement('div');\n prevEl.classList.add('swiper-button-prev');\n prevEl.innerHTML = swiper.hostEl.constructor.prevButtonSvg;\n prevEl.part.add('button-prev');\n swiper.el.appendChild(prevEl);\n }\n }\n if (nextEl) currentParams.navigation.nextEl = nextEl;\n if (prevEl) currentParams.navigation.prevEl = prevEl;\n navigation.init();\n navigation.update();\n }\n if (changedParams.includes('allowSlideNext')) {\n swiper.allowSlideNext = passedParams.allowSlideNext;\n }\n if (changedParams.includes('allowSlidePrev')) {\n swiper.allowSlidePrev = passedParams.allowSlidePrev;\n }\n if (changedParams.includes('direction')) {\n swiper.changeDirection(passedParams.direction, false);\n }\n if (loopNeedDestroy || loopNeedReloop) {\n swiper.loopDestroy();\n }\n if (loopNeedEnable || loopNeedReloop) {\n swiper.loopCreate();\n }\n swiper.update();\n}\n\nexport { needsPagination as a, needsScrollbar as b, attrToProp as c, uniqueClasses as d, extend as e, isObject as i, needsNavigation as n, paramsList as p, updateSwiper as u, wrapperClass as w };\n","/**\n * Swiper React 11.1.7\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * https://swiperjs.com\n *\n * Copyright 2014-2024 Vladimir Kharlampidi\n *\n * Released under the MIT License\n *\n * Released on: July 24, 2024\n */\n\nimport React, { useEffect, useLayoutEffect, useContext, createContext, forwardRef, useState, useRef } from 'react';\nimport { S as Swiper$1 } from './shared/swiper-core.mjs';\nimport { g as getParams, m as mountSwiper, a as getChangedParams, u as updateOnVirtualData } from './shared/update-on-virtual-data.mjs';\nimport { d as uniqueClasses, w as wrapperClass, n as needsNavigation, b as needsScrollbar, a as needsPagination, e as extend, u as updateSwiper } from './shared/update-swiper.mjs';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nfunction isChildSwiperSlide(child) {\n return child.type && child.type.displayName && child.type.displayName.includes('SwiperSlide');\n}\nfunction processChildren(c) {\n const slides = [];\n React.Children.toArray(c).forEach(child => {\n if (isChildSwiperSlide(child)) {\n slides.push(child);\n } else if (child.props && child.props.children) {\n processChildren(child.props.children).forEach(slide => slides.push(slide));\n }\n });\n return slides;\n}\nfunction getChildren(c) {\n const slides = [];\n const slots = {\n 'container-start': [],\n 'container-end': [],\n 'wrapper-start': [],\n 'wrapper-end': []\n };\n React.Children.toArray(c).forEach(child => {\n if (isChildSwiperSlide(child)) {\n slides.push(child);\n } else if (child.props && child.props.slot && slots[child.props.slot]) {\n slots[child.props.slot].push(child);\n } else if (child.props && child.props.children) {\n const foundSlides = processChildren(child.props.children);\n if (foundSlides.length > 0) {\n foundSlides.forEach(slide => slides.push(slide));\n } else {\n slots['container-end'].push(child);\n }\n } else {\n slots['container-end'].push(child);\n }\n });\n return {\n slides,\n slots\n };\n}\n\nfunction renderVirtual(swiper, slides, virtualData) {\n if (!virtualData) return null;\n const getSlideIndex = index => {\n let slideIndex = index;\n if (index < 0) {\n slideIndex = slides.length + index;\n } else if (slideIndex >= slides.length) {\n // eslint-disable-next-line\n slideIndex = slideIndex - slides.length;\n }\n return slideIndex;\n };\n const style = swiper.isHorizontal() ? {\n [swiper.rtlTranslate ? 'right' : 'left']: `${virtualData.offset}px`\n } : {\n top: `${virtualData.offset}px`\n };\n const {\n from,\n to\n } = virtualData;\n const loopFrom = swiper.params.loop ? -slides.length : 0;\n const loopTo = swiper.params.loop ? slides.length * 2 : slides.length;\n const slidesToRender = [];\n for (let i = loopFrom; i < loopTo; i += 1) {\n if (i >= from && i <= to) {\n slidesToRender.push(slides[getSlideIndex(i)]);\n }\n }\n return slidesToRender.map((child, index) => {\n return /*#__PURE__*/React.cloneElement(child, {\n swiper,\n style,\n key: child.props.virtualIndex || child.key || `slide-${index}`\n });\n });\n}\n\nfunction useIsomorphicLayoutEffect(callback, deps) {\n // eslint-disable-next-line\n if (typeof window === 'undefined') return useEffect(callback, deps);\n return useLayoutEffect(callback, deps);\n}\n\nconst SwiperSlideContext = /*#__PURE__*/createContext(null);\nconst useSwiperSlide = () => {\n return useContext(SwiperSlideContext);\n};\nconst SwiperContext = /*#__PURE__*/createContext(null);\nconst useSwiper = () => {\n return useContext(SwiperContext);\n};\n\nconst Swiper = /*#__PURE__*/forwardRef(function (_temp, externalElRef) {\n let {\n className,\n tag: Tag = 'div',\n wrapperTag: WrapperTag = 'div',\n children,\n onSwiper,\n ...rest\n } = _temp === void 0 ? {} : _temp;\n let eventsAssigned = false;\n const [containerClasses, setContainerClasses] = useState('swiper');\n const [virtualData, setVirtualData] = useState(null);\n const [breakpointChanged, setBreakpointChanged] = useState(false);\n const initializedRef = useRef(false);\n const swiperElRef = useRef(null);\n const swiperRef = useRef(null);\n const oldPassedParamsRef = useRef(null);\n const oldSlides = useRef(null);\n const nextElRef = useRef(null);\n const prevElRef = useRef(null);\n const paginationElRef = useRef(null);\n const scrollbarElRef = useRef(null);\n const {\n params: swiperParams,\n passedParams,\n rest: restProps,\n events\n } = getParams(rest);\n const {\n slides,\n slots\n } = getChildren(children);\n const onBeforeBreakpoint = () => {\n setBreakpointChanged(!breakpointChanged);\n };\n Object.assign(swiperParams.on, {\n _containerClasses(swiper, classes) {\n setContainerClasses(classes);\n }\n });\n const initSwiper = () => {\n // init swiper\n Object.assign(swiperParams.on, events);\n eventsAssigned = true;\n const passParams = {\n ...swiperParams\n };\n delete passParams.wrapperClass;\n swiperRef.current = new Swiper$1(passParams);\n if (swiperRef.current.virtual && swiperRef.current.params.virtual.enabled) {\n swiperRef.current.virtual.slides = slides;\n const extendWith = {\n cache: false,\n slides,\n renderExternal: setVirtualData,\n renderExternalUpdate: false\n };\n extend(swiperRef.current.params.virtual, extendWith);\n extend(swiperRef.current.originalParams.virtual, extendWith);\n }\n };\n if (!swiperElRef.current) {\n initSwiper();\n }\n\n // Listen for breakpoints change\n if (swiperRef.current) {\n swiperRef.current.on('_beforeBreakpoint', onBeforeBreakpoint);\n }\n const attachEvents = () => {\n if (eventsAssigned || !events || !swiperRef.current) return;\n Object.keys(events).forEach(eventName => {\n swiperRef.current.on(eventName, events[eventName]);\n });\n };\n const detachEvents = () => {\n if (!events || !swiperRef.current) return;\n Object.keys(events).forEach(eventName => {\n swiperRef.current.off(eventName, events[eventName]);\n });\n };\n useEffect(() => {\n return () => {\n if (swiperRef.current) swiperRef.current.off('_beforeBreakpoint', onBeforeBreakpoint);\n };\n });\n\n // set initialized flag\n useEffect(() => {\n if (!initializedRef.current && swiperRef.current) {\n swiperRef.current.emitSlidesClasses();\n initializedRef.current = true;\n }\n });\n\n // mount swiper\n useIsomorphicLayoutEffect(() => {\n if (externalElRef) {\n externalElRef.current = swiperElRef.current;\n }\n if (!swiperElRef.current) return;\n if (swiperRef.current.destroyed) {\n initSwiper();\n }\n mountSwiper({\n el: swiperElRef.current,\n nextEl: nextElRef.current,\n prevEl: prevElRef.current,\n paginationEl: paginationElRef.current,\n scrollbarEl: scrollbarElRef.current,\n swiper: swiperRef.current\n }, swiperParams);\n if (onSwiper && !swiperRef.current.destroyed) onSwiper(swiperRef.current);\n // eslint-disable-next-line\n return () => {\n if (swiperRef.current && !swiperRef.current.destroyed) {\n swiperRef.current.destroy(true, false);\n }\n };\n }, []);\n\n // watch for params change\n useIsomorphicLayoutEffect(() => {\n attachEvents();\n const changedParams = getChangedParams(passedParams, oldPassedParamsRef.current, slides, oldSlides.current, c => c.key);\n oldPassedParamsRef.current = passedParams;\n oldSlides.current = slides;\n if (changedParams.length && swiperRef.current && !swiperRef.current.destroyed) {\n updateSwiper({\n swiper: swiperRef.current,\n slides,\n passedParams,\n changedParams,\n nextEl: nextElRef.current,\n prevEl: prevElRef.current,\n scrollbarEl: scrollbarElRef.current,\n paginationEl: paginationElRef.current\n });\n }\n return () => {\n detachEvents();\n };\n });\n\n // update on virtual update\n useIsomorphicLayoutEffect(() => {\n updateOnVirtualData(swiperRef.current);\n }, [virtualData]);\n\n // bypass swiper instance to slides\n function renderSlides() {\n if (swiperParams.virtual) {\n return renderVirtual(swiperRef.current, slides, virtualData);\n }\n return slides.map((child, index) => {\n return /*#__PURE__*/React.cloneElement(child, {\n swiper: swiperRef.current,\n swiperSlideIndex: index\n });\n });\n }\n return /*#__PURE__*/React.createElement(Tag, _extends({\n ref: swiperElRef,\n className: uniqueClasses(`${containerClasses}${className ? ` ${className}` : ''}`)\n }, restProps), /*#__PURE__*/React.createElement(SwiperContext.Provider, {\n value: swiperRef.current\n }, slots['container-start'], /*#__PURE__*/React.createElement(WrapperTag, {\n className: wrapperClass(swiperParams.wrapperClass)\n }, slots['wrapper-start'], renderSlides(), slots['wrapper-end']), needsNavigation(swiperParams) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n ref: prevElRef,\n className: \"swiper-button-prev\"\n }), /*#__PURE__*/React.createElement(\"div\", {\n ref: nextElRef,\n className: \"swiper-button-next\"\n })), needsScrollbar(swiperParams) && /*#__PURE__*/React.createElement(\"div\", {\n ref: scrollbarElRef,\n className: \"swiper-scrollbar\"\n }), needsPagination(swiperParams) && /*#__PURE__*/React.createElement(\"div\", {\n ref: paginationElRef,\n className: \"swiper-pagination\"\n }), slots['container-end']));\n});\nSwiper.displayName = 'Swiper';\n\nconst SwiperSlide = /*#__PURE__*/forwardRef(function (_temp, externalRef) {\n let {\n tag: Tag = 'div',\n children,\n className = '',\n swiper,\n zoom,\n lazy,\n virtualIndex,\n swiperSlideIndex,\n ...rest\n } = _temp === void 0 ? {} : _temp;\n const slideElRef = useRef(null);\n const [slideClasses, setSlideClasses] = useState('swiper-slide');\n const [lazyLoaded, setLazyLoaded] = useState(false);\n function updateClasses(_s, el, classNames) {\n if (el === slideElRef.current) {\n setSlideClasses(classNames);\n }\n }\n useIsomorphicLayoutEffect(() => {\n if (typeof swiperSlideIndex !== 'undefined') {\n slideElRef.current.swiperSlideIndex = swiperSlideIndex;\n }\n if (externalRef) {\n externalRef.current = slideElRef.current;\n }\n if (!slideElRef.current || !swiper) {\n return;\n }\n if (swiper.destroyed) {\n if (slideClasses !== 'swiper-slide') {\n setSlideClasses('swiper-slide');\n }\n return;\n }\n swiper.on('_slideClass', updateClasses);\n // eslint-disable-next-line\n return () => {\n if (!swiper) return;\n swiper.off('_slideClass', updateClasses);\n };\n });\n useIsomorphicLayoutEffect(() => {\n if (swiper && slideElRef.current && !swiper.destroyed) {\n setSlideClasses(swiper.getSlideClasses(slideElRef.current));\n }\n }, [swiper]);\n const slideData = {\n isActive: slideClasses.indexOf('swiper-slide-active') >= 0,\n isVisible: slideClasses.indexOf('swiper-slide-visible') >= 0,\n isPrev: slideClasses.indexOf('swiper-slide-prev') >= 0,\n isNext: slideClasses.indexOf('swiper-slide-next') >= 0\n };\n const renderChildren = () => {\n return typeof children === 'function' ? children(slideData) : children;\n };\n const onLoad = () => {\n setLazyLoaded(true);\n };\n return /*#__PURE__*/React.createElement(Tag, _extends({\n ref: slideElRef,\n className: uniqueClasses(`${slideClasses}${className ? ` ${className}` : ''}`),\n \"data-swiper-slide-index\": virtualIndex,\n onLoad: onLoad\n }, rest), zoom && /*#__PURE__*/React.createElement(SwiperSlideContext.Provider, {\n value: slideData\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"swiper-zoom-container\",\n \"data-swiper-zoom\": typeof zoom === 'number' ? zoom : undefined\n }, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement(\"div\", {\n className: \"swiper-lazy-preloader\"\n }))), !zoom && /*#__PURE__*/React.createElement(SwiperSlideContext.Provider, {\n value: slideData\n }, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement(\"div\", {\n className: \"swiper-lazy-preloader\"\n })));\n});\nSwiperSlide.displayName = 'SwiperSlide';\n\nexport { Swiper, SwiperSlide, useSwiper, useSwiperSlide };\n","import { e as extend, p as paramsList, i as isObject, n as needsNavigation, a as needsPagination, b as needsScrollbar } from './update-swiper.mjs';\nimport { d as defaults } from './swiper-core.mjs';\n\nfunction getParams(obj, splitEvents) {\n if (obj === void 0) {\n obj = {};\n }\n if (splitEvents === void 0) {\n splitEvents = true;\n }\n const params = {\n on: {}\n };\n const events = {};\n const passedParams = {};\n extend(params, defaults);\n params._emitClasses = true;\n params.init = false;\n const rest = {};\n const allowedParams = paramsList.map(key => key.replace(/_/, ''));\n const plainObj = Object.assign({}, obj);\n Object.keys(plainObj).forEach(key => {\n if (typeof obj[key] === 'undefined') return;\n if (allowedParams.indexOf(key) >= 0) {\n if (isObject(obj[key])) {\n params[key] = {};\n passedParams[key] = {};\n extend(params[key], obj[key]);\n extend(passedParams[key], obj[key]);\n } else {\n params[key] = obj[key];\n passedParams[key] = obj[key];\n }\n } else if (key.search(/on[A-Z]/) === 0 && typeof obj[key] === 'function') {\n if (splitEvents) {\n events[`${key[2].toLowerCase()}${key.substr(3)}`] = obj[key];\n } else {\n params.on[`${key[2].toLowerCase()}${key.substr(3)}`] = obj[key];\n }\n } else {\n rest[key] = obj[key];\n }\n });\n ['navigation', 'pagination', 'scrollbar'].forEach(key => {\n if (params[key] === true) params[key] = {};\n if (params[key] === false) delete params[key];\n });\n return {\n params,\n passedParams,\n rest,\n events\n };\n}\n\nfunction mountSwiper(_ref, swiperParams) {\n let {\n el,\n nextEl,\n prevEl,\n paginationEl,\n scrollbarEl,\n swiper\n } = _ref;\n if (needsNavigation(swiperParams) && nextEl && prevEl) {\n swiper.params.navigation.nextEl = nextEl;\n swiper.originalParams.navigation.nextEl = nextEl;\n swiper.params.navigation.prevEl = prevEl;\n swiper.originalParams.navigation.prevEl = prevEl;\n }\n if (needsPagination(swiperParams) && paginationEl) {\n swiper.params.pagination.el = paginationEl;\n swiper.originalParams.pagination.el = paginationEl;\n }\n if (needsScrollbar(swiperParams) && scrollbarEl) {\n swiper.params.scrollbar.el = scrollbarEl;\n swiper.originalParams.scrollbar.el = scrollbarEl;\n }\n swiper.init(el);\n}\n\nfunction getChangedParams(swiperParams, oldParams, children, oldChildren, getKey) {\n const keys = [];\n if (!oldParams) return keys;\n const addKey = key => {\n if (keys.indexOf(key) < 0) keys.push(key);\n };\n if (children && oldChildren) {\n const oldChildrenKeys = oldChildren.map(getKey);\n const childrenKeys = children.map(getKey);\n if (oldChildrenKeys.join('') !== childrenKeys.join('')) addKey('children');\n if (oldChildren.length !== children.length) addKey('children');\n }\n const watchParams = paramsList.filter(key => key[0] === '_').map(key => key.replace(/_/, ''));\n watchParams.forEach(key => {\n if (key in swiperParams && key in oldParams) {\n if (isObject(swiperParams[key]) && isObject(oldParams[key])) {\n const newKeys = Object.keys(swiperParams[key]);\n const oldKeys = Object.keys(oldParams[key]);\n if (newKeys.length !== oldKeys.length) {\n addKey(key);\n } else {\n newKeys.forEach(newKey => {\n if (swiperParams[key][newKey] !== oldParams[key][newKey]) {\n addKey(key);\n }\n });\n oldKeys.forEach(oldKey => {\n if (swiperParams[key][oldKey] !== oldParams[key][oldKey]) addKey(key);\n });\n }\n } else if (swiperParams[key] !== oldParams[key]) {\n addKey(key);\n }\n }\n });\n return keys;\n}\n\nconst updateOnVirtualData = swiper => {\n if (!swiper || swiper.destroyed || !swiper.params.virtual || swiper.params.virtual && !swiper.params.virtual.enabled) return;\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n if (swiper.parallax && swiper.params.parallax && swiper.params.parallax.enabled) {\n swiper.parallax.setTranslate();\n }\n};\n\nexport { getChangedParams as a, getParams as g, mountSwiper as m, updateOnVirtualData as u };\n","import React from 'react';\n\nimport 'swiper/css';\n\nimport { Swiper, SwiperSlide } from 'swiper/react';\n\nimport SpecialCard from '@app/components/Pages/Specials/SpecialCard';\nimport { Special } from '@app/objects/Special';\n\nimport '@app/scss/components/special.scss';\nimport '@app/scss/components/specialsCarousel.scss';\n\ninterface Props {\n\tspecials: Array;\n\tcount?: number;\n\ttitleAsH2?: boolean;\n}\n\nconst SpecialsCarousel: React.FC = ({ specials, count = 5, titleAsH2 }) => {\n\tconst text = 'Popular Specials';\n\n\treturn \n\t\t{titleAsH2 ?
{text} :
{text} }\n\t\t
\n\t\t\t
\n\t\t\t\t{specials.map((special) =>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t
\n\t\t\t\t\t )}\n\t\t\t \n\t\t
\n\t
;\n};\n\nexport default SpecialsCarousel;\n","import React from 'react';\n\ninterface Props {\n\tvalue: number;\n\tclassName?: string;\n}\n\nconst Stars: React.FC = ({ value, className }) => {\n\treturn <>\n\t\t{Array\n\t\t\t.from({ length: Math.round(value || 0) })\n\t\t\t.map((_, i) => i)\n\t\t\t.map((i) => )}\n\t>;\n};\n\nexport default Stars;\n","import * as React from 'react';\n\nimport Tooltip, { AbstractTooltipProps } from 'antd/lib/tooltip';\n\ninterface Props {\n\ttext?: string;\n\tcount: number;\n\ttooltipProps?: AbstractTooltipProps;\n\tclassName?: string;\n\twithTitle?: boolean;\n}\n\nconst TextWithTooltip: React.FC = ({\n\ttext, count, tooltipProps, className, withTitle,\n}) => {\n\treturn text ? \n\t\t{text.length > count\n\t\t\t? \n\t\t\t\t{text?.substr(0, count)}\n\t\t\t\t...\n\t\t\t \n\t\t\t: withTitle ? {text} : text\n\t\t}\n\t
: null;\n};\n\nexport default TextWithTooltip;\n","import React from 'react';\n\nimport { AliasToken } from 'antd/es/theme/interface';\n\ninterface ThemeConfig {\n\ttoken: Partial;\n}\n\nconst data: Partial = {\n\tborderRadius: 6,\n\tcolorPrimary: '#fba10d',\n};\n\nexport const theme: ThemeConfig = {\n\ttoken: {\n\t\tcolorPrimary: data.colorPrimary,\n\t\tborderRadius: data.borderRadius,\n\t\tcolorInfo: data.colorPrimary,\n\t\tcolorInfoText: data.colorPrimary,\n\t},\n};\n","import React from 'react';\n\nimport { shallowEqual, useSelector } from 'react-redux';\n\nimport { STORAGE_KEYS } from '@app/objects/StorageKeys';\nimport { ApplicationState } from '@app/store';\nimport { LoginState } from '@app/store/Login';\n\nconst UserStateTracker: React.FC = ({ children }) => {\n\tconst { user } = useSelector((state) => state.login, shallowEqual);\n\n\tReact.useEffect(() => {\n\t\tif (!user) {\n\t\t\tlocalStorage.removeItem(STORAGE_KEYS.CHECKOUT_UID);\n\t\t}\n\t}, [user]);\n\n\treturn <>{children}>;\n};\n\nexport default UserStateTracker;\n","import * as React from 'react';\n\nimport LinkWithPrevLocation from '@common/react/components/UI/LinkWithPrevLocation/LinkWithPrevLocation';\n\ninterface Props {\n\tprefix: string;\n\tpath: string;\n\tclassName?: string;\n}\n\nconst WithPathLink: React.FC = ({\n\tprefix, path, children, className,\n}) => {\n\treturn <>\n\t\t{path\n\t\t\t? \n\t\t\t\t{children}\n\t\t\t \n\t\t\t: <>\n\t\t\t\t{children}\n\t\t\t>\n\t\t}\n\t>;\n};\n\nexport default WithPathLink;\n","import * as React from 'react';\n\nimport moment, { Moment } from 'moment';\n\nimport { Location } from '@app/objects/Location';\nimport { LocationPortal } from '@app/objects/CompanyPortal';\n\ninterface Named {\n\tfirstName: string;\n\tlastName: string;\n}\n\ninterface NamedWithEmail extends Named {\n\temail: string;\n}\n\nexport const getAppContainer = (): HTMLElement => document.body.querySelector('.app-container') || document.body;\n\nexport const getParentWidth = (parentSelector: string): number | undefined => {\n\tif (typeof document !== 'undefined' && typeof window !== 'undefined') {\n\t\tconst parentEl = document.querySelector(parentSelector);\n\t\tif (!parentEl) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst parentStyle = window.getComputedStyle(parentEl, null);\n\t\tif (!parentStyle.width) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn parseInt(parentStyle.width, 10)\n\t\t\t- parseInt(parentStyle.paddingLeft || '', 10)\n\t\t\t- parseInt(parentStyle.paddingRight || '', 10);\n\t}\n};\n\nexport const getUserNameOrUnnamedWithEmail = (item?: NamedWithEmail) => {\n\tif (item) {\n\t\tconst name = (!item.lastName && !item.firstName) ? 'Unnamed' : `${item.lastName || ''} ${item.firstName || ''}`;\n\t\treturn `${name} ${item.email ? `(${item.email})` : ''}`;\n\t}\n\treturn '';\n};\n\nexport const timeSpanToMinutes = (timeSpan: string): number | null => {\n\tconst timeArr = timeSpan.split(':');\n\tif (timeArr.length === 3) {\n\t\tconst hours = +timeArr[0];\n\t\tconst minutes = +timeArr[1];\n\t\treturn hours ? hours * 60 + minutes : minutes;\n\t}\n\treturn null;\n};\n\nexport const getLocationName = (location: Location | LocationPortal, truncateName: boolean = true, withoutContainer?: boolean) => {\n\tconst companyName = location?.company?.portalShortName || location?.company?.name;\n\tconst name = companyName ? `${truncateString(companyName, 25, truncateName)} - ${location.nameEn}` : `${location.nameEn}`;\n\n\treturn withoutContainer ? name : \n\t\t{name}\n\t
;\n};\n\nconst truncateString = (str: string, maxLength: number, truncateName: boolean) => {\n\tif (truncateName && str.length > maxLength) {\n\t\treturn `${str.slice(0, maxLength - 3)}...`;\n\t}\n\treturn str;\n};\n\nexport const dateTimeFormatString = 'MM/DD/YYYY h:mm A';\n\nexport const dateToUtc = (date): Moment => {\n\tconst offset = moment().utcOffset();\n\treturn moment(date).subtract(offset, 'minutes');\n};\n\nexport const dateToUtcString = (date, format): string => {\n\tconst utc = dateToUtc(date);\n\treturn moment(utc).format(format);\n};\n","import React from 'react';\nimport { useCart } from 'react-use-cart';\n\nimport { getLocalStorageValue } from '@common/react/utils/localStorage/localStorage';\n\nimport { STORAGE_KEYS } from '@app/objects/StorageKeys';\n\nconst useShoppingCart = () => {\n\tconst {\n\t\tremoveItem, addItem, updateItemQuantity, getItem,\n\t} = useCart();\n\tconst uid = getLocalStorageValue(STORAGE_KEYS.CHECKOUT_UID, null);\n\n\tconst removeUid = () => {\n\t\tif (uid) {\n\t\t\tlocalStorage.removeItem(STORAGE_KEYS.CHECKOUT_UID);\n\t\t}\n\t};\n\n\tconst removeCartItem = (itemId) => {\n\t\tremoveItem(itemId);\n\t\tremoveUid();\n\t};\n\n\tconst addCartItem = (item, quantity) => {\n\t\taddItem(item, quantity);\n\t\tremoveUid();\n\t};\n\n\tconst updateCartItemQuantity = (itemId, quantity) => {\n\t\tupdateItemQuantity(itemId, quantity);\n\t\tremoveUid();\n\t};\n\n\treturn {\n\t\tremoveCartItem,\n\t\taddCartItem,\n\t\tupdateCartItemQuantity,\n\t\tgetItem,\n\t};\n};\n\nexport default useShoppingCart;\n","import { Item } from 'react-use-cart';\n\nimport { Nullable } from '@common/typescript/objects/Nullable';\n\nimport { Special } from '@app/objects/Special';\n\nexport interface CartItem extends Item {\n\tname: string;\n\toriginalPrice: number;\n\tdescription: string;\n\tpath: string;\n\tlocationId: Nullable;\n\tlocation: {\n\t\tid: number;\n\t\tnameEn: string,\n\t\tnameEs: string,\n\t\tportalPathEn: string;\n\t};\n\tavatar: string;\n\toriginalAvatar: string;\n}\n\nexport const transformSpecialToCartItem = (special: Special | CartItem): CartItem => {\n\treturn {\n\t\tid: special.id.toString(),\n\t\tprice: special.price,\n\t\tname: special.name,\n\t\toriginalPrice: special.originalPrice,\n\t\tpath: special.path,\n\t\tdescription: special.description,\n\t\tlocationId: special.locationId,\n\t\tlocation: {\n\t\t\tid: special.location?.id ?? 0,\n\t\t\tnameEn: special.location?.nameEn ?? '',\n\t\t\tnameEs: special.location?.nameEs ?? '',\n\t\t\tportalPathEn: special.location?.portalPathEn ?? '',\n\t\t},\n\t\tavatar: special.avatar,\n\t\toriginalAvatar: special.originalAvatar,\n\t};\n};\n\nexport const transformStoredItemToCartItem = (item: Item): CartItem => {\n\treturn {\n\t\tid: item.id,\n\t\tname: item.name || '',\n\t\tprice: item.price || 0,\n\t\toriginalPrice: item.originalPrice || 0,\n\t\tpath: item.path || '',\n\t\tdescription: item.description || '',\n\t\tlocationId: item.locationId || null,\n\t\tlocation: item.location || { id: 0, nameEn: '', nameEs: '' },\n\t\tavatar: item.avatar || '',\n\t\toriginalAvatar: item.originalAvatar || '',\n\t\tquantity: item.quantity,\n\t\titemTotal: item.itemTotal,\n\t};\n};\n","export const STORAGE_KEYS = {\n\tCHECKOUT_UID: 'checkout-uid',\n};\n","import { BaseUser } from '@common/react/objects/BaseUser';\nimport { Nullable } from '@common/typescript/objects/Nullable';\n\nimport { Gender } from '@commonTuna/react/objects/Enums';\n\nimport { Insurance } from '@app/objects/Insurance';\nimport { DrivingLicense } from '@app/objects/DrivingLicense';\nimport { Suffix } from '@app/objects/Suffix';\nimport { MarriageStatus } from '@app/objects/MarriageStatus';\nimport { PatientLocation } from '@app/objects/PatientLocation';\n\nexport enum UserRole {\n\tAdmin = 1,\n\tUser = 2,\n\tSupport = 3\n}\n\nexport const UserRoleNames = {\n\t[UserRole.Admin]: 'Admin',\n\t[UserRole.User]: 'User',\n\t[UserRole.Support]: 'Support',\n};\n\nexport interface User extends BaseUser {\n\tavatar: string;\n\toriginalAvatar: string;\n\n\trole: UserRole;\n\n\tsuffix: Suffix;\n\tfirstName: string;\n\tlastName: string;\n\temail: string;\n\tbirthDate: Nullable;\n\tgender: Nullable;\n\tphoneNumber: string;\n\n\tmarriageStatus: MarriageStatus;\n\n\temergencyContactName: string;\n\temergencyContactPhone: string;\n\temergencyContactRelation: string;\n\n\taddress: string;\n\tcity: string;\n\tregion: string;\n\tzip: string;\n\n\tinsurances: Array;\n\tpatientLocations: Array;\n\n\tdrivingLicenses: Array;\n\n\tallowEmail: boolean;\n\tallowSms: boolean;\n\tallowCalls: boolean;\n\tallowPush: boolean;\n\tagreementForSignUp: boolean;\n\n\temailConfirmed: boolean;\n\n\tenableSounds: boolean;\n\tbrowserNotifications: boolean;\n\tcompletedRegistration: boolean;\n\tcolor: string | null;\n\tlastLoggedIn?: number;\n\ttime: number;\n\n\tbaseUtcOffset: string;\n\n\tethnicityId: Nullable;\n}\n\nexport interface RegistrationUser extends User {\n\tpassword: string;\n\trepeatPassword: string;\n\tcaptcha?: string;\n}\n","import * as React from 'react';\nimport { Switch } from 'react-router-dom';\n\nimport loadable from '@loadable/component';\nimport 'regenerator-runtime/runtime';\n\nimport { loadableDelay } from '@common/react/loadable/loadableSettings';\nimport NotFoundRoute from '@common/react/components/Routes/NotFoundRoute';\n\nimport { LogoLoaderPage } from '@commonTuna/react/components/UI/LogoLoader/LogoLoader';\n\nimport DashboardRoute from '@app/components/Routes/DashboardRoute';\nimport RouteWithFooter from '@app/components/Routes/RouteWithFooter';\nimport Layout from '@app/components/Layout';\n\nconst params = {\n\tfallback: ,\n};\n\n/* --------------Admin---------------*/\nconst Profile = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ProfilePage\" */\n\t\t'@app/components/Pages/Profile'\n\t)), params);\nconst Dashboard = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"DashboardPage\" */\n\t\t'@app/components/Pages/Admin/Dashboard/Dashboard'\n\t)), params);\nconst ChatsPage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ChatsPage\" */\n\t\t'@app/components/Pages/Admin/Chats/Chats'\n\t)), params);\nconst Questionnaires = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"QuestionnairesPage\" */\n\t\t'@app/components/Pages/Admin/Invites/Questionnaires'\n\t)), params);\nconst ConsentForms = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ConsentFormsPage\" */\n\t\t'@app/components/Pages/Admin/Invites/ConsentForms'\n\t)), params);\nconst Instructions = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"InstructionsPage\" */\n\t\t'@app/components/Pages/Admin/Invites/Instructions'\n\t)), params);\nconst Analyzes = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"AnalyzesPage\" */\n\t\t'@app/components/Pages/Admin/Analyzes/Analyzes'\n\t)), params);\nconst Appointments = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"AppointmentsPage\" */\n\t\t'@app/components/Pages/Admin/Appointments/Appointments'\n\t)), params);\nconst AppointmentViewer = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"AppointmentViewerPage\" */\n\t\t'@app/components/Pages/Admin/Appointments/Appointment'\n\t)), params);\nconst Documents = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"DocumentsPage\" */\n\t\t'@app/components/Pages/Admin/Documents/Documents'\n\t)), params);\nconst Doctors = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"SearchPage\" */\n\t\t'@app/components/Pages/Doctors'\n\t)), params);\nconst Prescriptions = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"DocumentsPage\" */\n\t\t'@app/components/Pages/Admin/Prescriptions/Prescriptions'\n\t)), params);\nconst Users = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Users\" */\n\t\t'@app/components/Pages/Admin/Users/Users'\n\t)), params);\nconst ShortLinks = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ShortLinks\" */\n\t\t'@app/components/Pages/Admin/ShortLinks/ShortLinks'\n\t)), params);\nconst AuthLinks = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"AuthLinks\" */\n\t\t'@common/react/components/Pages/AuthLinks/AuthLinks'\n\t)), params);\nconst AuthLinksFilters = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"AuthLinksFilters\" */\n\t\t'@commonTuna/react/components/Pages/Admin/AuthLinks/AuthLinksFilters'\n\t)), params);\nconst UserSessions = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"UserSessions\" */\n\t\t'@app/components/Pages/Admin/UserSessions/UserSessions'\n\t)), params);\nconst Notifications = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"NotificationsPage\" */\n\t\t'@app/components/Pages/Admin/Notifications/Notifications'\n\t)), params);\nconst Pages = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"PagesPage\" */\n\t\t'@app/components/Pages/Admin/Pages/Pages'\n\t)), params);\nconst PageEditor = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"PageEditorPage\" */\n\t\t'@app/components/Pages/Admin/Pages/PageEditor'\n\t)), params);\nconst Orders = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"OrdersPage\" */\n\t\t'@app/components/Pages/Admin/Orders/Orders'\n\t)), params);\nconst Inquiries = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Inquiries\" */\n\t\t'@app/components/Pages/Admin/Inquiries/Inquiries'\n\t)), params);\nconst Bills = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"BillsPage\" */\n\t\t'@app/components/Pages/Admin/Bills/Bills'\n\t)), params);\nconst Checkout = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"CheckoutPage\" */\n\t\t'@app/components/Pages/Admin/Checkout/Checkout'\n\t)), params);\nconst EmailTemplates = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"EmailTemplatesPage\" */\n\t\t'@app/components/Pages/Admin/EmailTemplates/EmailTemplates'\n\t)), params);\nconst MarketingEmails = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"MarketingEmailsPage\" */\n\t\t'@app/components/Pages/Admin/MarketingEmails/MarketingEmails'\n\t)), params);\nconst SmsLogs = loadable(\n\t() =>\n\t\tloadableDelay(import(/* webpackChunkName: \"SmsLogs\" */\n\t\t\t'@commonTuna/react/components/Pages/Admin/SmsLogs/SmsLogs'\n\t\t)),\n\tparams,\n);\nconst EmailLogs = loadable(\n\t() =>\n\t\tloadableDelay(import(/* webpackChunkName: \"EmailLogs\" */\n\t\t\t'@commonTuna/react/components/Pages/Admin/EmailLogs/EmailLogs'\n\t\t)),\n\tparams,\n);\nconst Ordering = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Ordering\" */\n\t\t'@app/components/Pages/Admin/Ordering/Ordering'\n\t)), params);\nconst BaseHostedServices = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"BaseHostedServicesPage\" */\n\t\t'@app/components/Pages/Admin/BaseHostedServices/BaseHostedServices'\n\t)), params);\nconst PageAccesses = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"PageAccessesPage\" */\n\t\t'@app/components/Pages/Admin/PageAccesses/PageAccesses'\n\t)), params);\n\n/* ------------Admin end-------------*/\n\nconst Home = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Home\" */\n\t\t'@app/components/Pages/Home/Home'\n\t)), params);\nconst Login = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"LoginPage\" */\n\t\t'@app/components/Pages/Login/Login'\n\t)), params);\nconst Recover = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"RecoverPage\" */\n\t\t'@app/components/Pages/Recover/Recover'\n\t)), params);\nconst Confirm = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ConfirmPage\" */\n\t\t'@app/components/Pages/Confirm/Confirm'\n\t)), params);\nconst ContactSupport = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ContactSupportPage\" */\n\t\t'@app/components/Pages/ContactSupport/ContactSupport'\n\t)), params);\nconst Register = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"RegisterPage\" */\n\t\t'@app/components/Pages/Register/Register'\n\t)), params);\nconst Confirmation = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ConfirmationPage\" */\n\t\t'@app/components/Pages/Confirmation/Confirmation'\n\t)), params);\nconst ChangeEmailConfirmation = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ChangeEmailConfirmation\" */\n\t\t'@app/components/Pages/Register/ChangeEmailConfirmation'\n\t)), params);\nconst CompanyPortalComponent = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"PortalFromBBY\" */\n\t\t'@app/components/Pages/FromBBY/CompanyPortal'\n\t)), params);\nconst DoctorPortalComponent = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"DoctorPortalComponent\" */\n\t\t'@app/components/Pages/DoctorPortal'\n\t)), params);\nconst DoctorReview = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"DoctorReview\" */\n\t\t'@app/components/Pages/DoctorReview'\n\t)), params);\nconst Specialties = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Specialties\" */\n\t\t'@app/components/Pages/Specialties/Specialties'\n\t)), params);\nconst Locations = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Locations\" */\n\t\t'@app/components/Pages/Region/Regions'\n\t)), params);\nconst Location = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Region\" */\n\t\t'@app/components/Pages/Region/Region'\n\t)), params);\nconst Specialty = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Specialty\" */\n\t\t'@app/components/Pages/Specialties/Specialty'\n\t)), params);\nconst Specials = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Specials\" */\n\t\t'@app/components/Pages/Specials/Specials'\n\t)), params);\nconst Special = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Special\" */\n\t\t'@app/components/Pages/Specials/Special'\n\t)), params);\nconst Product = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Product\" */\n\t\t'@app/components/Pages/Products/Product'\n\t)), params);\nconst Procedures = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Procedures\" */\n\t\t'@app/components/Pages/Procedures/Procedures'\n\t)), params);\nconst ProcedurePage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ProcedurePage\" */\n\t\t'@app/components/Pages/Procedures/ProcedurePage'\n\t)), params);\nconst PrivacyPolicy = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"PrivacyPolicy\" */\n\t\t'@app/components/Pages/PrivacyPolicy/PrivacyPolicy'\n\t)), params);\nconst RegistrationArticle = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"RegistrationArticle\" */\n\t\t'@app/components/Pages/RegistrationArticle/RegistrationArticle'\n\t)), params);\nconst Inquiry = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"Inquiry\" */\n\t\t'@app/components/Pages/Inquiry/Inquiry'\n\t)), params);\nconst ExpiredLink = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ExpiredLink\" */\n\t\t'@app/components/Pages/ExpiredLink/ExpiredLink'\n\t)), params);\nconst ShoppingCart = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ShoppingCart\" */\n\t\t'@app/components/Pages/ShoppingCart/ShoppingCart'\n\t)), params);\nconst QuickPay = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"QuickPayPage\" */\n\t\t'@app/components/Pages/QuickPay/QuickPay'\n\t)), params);\nconst ErrorPage = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ErrorPage\" */ '@common/react/components/Pages/ErrorPage/ErrorPage')), params);\nconst PaymentsProcessing = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"PaymentsProcessing\" */\n\t\t'@app/components/Pages/PaymentsProcessing/PaymentsProcessing'\n\t)), params);\nconst Clinics = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ClinicsPage\" */\n\t\t'@app/components/Pages/Clinics/Clinics'\n\t)), params);\nconst ClinicPortalComponent = loadable(() =>\n\tloadableDelay(import(/* webpackChunkName: \"ClinicPortalComponent\" */\n\t\t'@app/components/Pages/Clinics/ClinicPortalComponent'\n\t)), params);\n\nexport const routes = (\n\t\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t } />} title=\"Auth Links\" />\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t \n );\n","import { Action, Reducer, ActionCreatorsMapObject } from 'redux';\n\nimport { AppThunkAction } from '@app/store/index';\n\n/* interface AppointmentInvitesCounters {\n\tappointmentId: number;\n\tnotAnsweredInvitesCount: number;\n\tnotReadInstructionsCount: number;\n} */\n\nexport interface CountersState {\n\tnotViewedDocumentsCount: number;\n\tnotAnsweredDiseasesCount: number;\n\tnotAnsweredConsentsCount: number;\n\tnotReadInstructionsCount: number;\n\tnotViewedPrescriptionsCount: number;\n\tnotPaidBillItemsCount: number;\n\n\ttotalDocumentsCount: number;\n\ttotalDiseasesCount: number;\n\ttotalConsentsCount: number;\n\ttotalInstructionsCount: number;\n\ttotalPrescriptionsCount: number;\n\ttotalBillItemsCount: number;\n}\n\nexport enum CountersTypeKeys {\n\tSET_COUNTERS_STATE = 'SET_COUNTERS_STATE',\n\tUPDATE_COUNTERS = 'UPDATE_COUNTERS'\n}\n\nexport interface SetCountersState {\n\ttype: CountersTypeKeys.SET_COUNTERS_STATE;\n\tpayload: CountersState;\n}\n\ninterface UpdateCounters {\n\ttype: CountersTypeKeys.UPDATE_COUNTERS;\n\tdata: object;\n}\n\nexport type Actions = SetCountersState | UpdateCounters;\n\nexport interface CountersActionCreators extends ActionCreatorsMapObject {\n\tsetCountersState: (state: CountersState) => AppThunkAction;\n\tupdateCounters: (data: object) => AppThunkAction;\n}\n\nexport const countersActionCreators = {\n\tsetCountersState: (state: CountersState): AppThunkAction => (dispatch, getState) => {\n\t\tdispatch({ type: CountersTypeKeys.SET_COUNTERS_STATE, payload: { ...state } });\n\t},\n\tupdateCounters: (data: object): AppThunkAction => (dispatch, getState) => {\n\t\tdispatch({ type: CountersTypeKeys.UPDATE_COUNTERS, data });\n\t},\n};\n\nconst initialState = {\n\tnotViewedDocumentsCount: 0,\n\tnotAnsweredDiseasesCount: 0,\n\tnotAnsweredConsentsCount: 0,\n\tnotReadInstructionsCount: 0,\n\tnotViewedPrescriptionsCount: 0,\n\tnotPaidBillItemsCount: 0,\n\ttotalDocumentsCount: 0,\n\ttotalDiseasesCount: 0,\n\ttotalConsentsCount: 0,\n\ttotalInstructionsCount: 0,\n\ttotalPrescriptionsCount: 0,\n\ttotalBillItemsCount: 0,\n};\n\nexport const reducer: Reducer = (\n\tstate: CountersState = initialState,\n\tincomingAction: Action,\n) => {\n\tconst action = incomingAction as Actions;\n\tswitch (action.type) {\n\t\tcase CountersTypeKeys.SET_COUNTERS_STATE:\n\t\t\treturn { ...action.payload };\n\t\tcase CountersTypeKeys.UPDATE_COUNTERS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.data,\n\t\t\t};\n\t\tdefault:\n\t\t\treturn state;\n\t}\n};\n","import { TypeKeys as ItemsKeys, InitStorageAction } from '@common/react/store/ItemList';\nimport {\n\tTypeKeys as ItemKeys, InitStorageAction as ItemInitStorageAction, InitStorageAction as InitStorageItemAction, TypeKeys as ItemTypeKeys,\n} from '@common/react/store/Item';\n\nimport { BaseInvite } from '@commonTuna/react/objects/BaseInvite';\n\nimport { Init } from '@app/objects/Init';\nimport { SetCountersState, CountersTypeKeys } from '@app/store/Counters';\nimport { SearchFilterTypeKeys, SetSearchFilterState } from '@app/store/SearchFilter';\n\nexport const customReduxActions = (dispatch, init: Init) => {\n\tconst buildDataAction: InitStorageItemAction = {\n\t\ttype: ItemTypeKeys.INITSTORAGE,\n\t\tstorageName: 'buildData',\n\t\titem: {\n\t\t\tbuildNumber: init.buildNumber,\n\t\t\tbuildDate: init.buildDate,\n\t\t\tmaxNameLength: init.maxNameLength,\n\t\t\t...(init as any),\n\t\t},\n\t};\n\n\tdispatch(buildDataAction);\n\n\tif (init.companyTemplateInvites) {\n\t\tconst companyTemplateInvitesAction: InitStorageAction = {\n\t\t\ttype: ItemsKeys.INITSTORAGE,\n\t\t\tstorageName: 'companyTemplateInvites',\n\t\t\titems: init.companyTemplateInvites,\n\t\t\ttotal: init.companyTemplateInvites.length,\n\t\t\tobjectType: 'invite',\n\t\t\tparams: {},\n\t\t};\n\n\t\tdispatch(companyTemplateInvitesAction);\n\t}\n\n\tif (init.userRegistrationSteps) {\n\t\tconst userRegistrationStepsAction: ItemInitStorageAction = {\n\t\t\ttype: ItemKeys.INITSTORAGE,\n\t\t\tstorageName: 'userRegistrationSteps',\n\t\t\titem: init.userRegistrationSteps,\n\t\t};\n\n\t\tdispatch(userRegistrationStepsAction);\n\t}\n\n\tif (init.counters) {\n\t\tconst countersAction: SetCountersState = {\n\t\t\ttype: CountersTypeKeys.SET_COUNTERS_STATE,\n\t\t\tpayload: init.counters,\n\t\t};\n\n\t\tdispatch(countersAction);\n\t}\n\n\tif (init.searchFilterData) {\n\t\tconst searchFilterAction: SetSearchFilterState = {\n\t\t\ttype: SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE,\n\t\t\tpayload: init.searchFilterData,\n\t\t};\n\n\t\tdispatch(searchFilterAction);\n\t}\n\n\tif (init.hostOptions) {\n\t\tconst hostOptionsAction: InitStorageItemAction = {\n\t\t\ttype: ItemTypeKeys.INITSTORAGE,\n\t\t\tstorageName: 'hostOptions',\n\t\t\titem: init.hostOptions,\n\t\t};\n\n\t\tdispatch(hostOptionsAction);\n\t}\n};\n","export const SET_PATIENT_LOCATION = 'SET_PATIENT_LOCATION';\nexport const SET_SEARCH_STATE = 'SET_SEARCH_STATE';\n","import { Action, ActionCreatorsMapObject, Reducer } from 'redux';\n\nimport { BaseAppThunkAction } from '@common/react/store';\n\nimport { SET_SEARCH_STATE } from '@app/store/constants';\nimport { User } from '@app/objects/User';\nimport { ApplicationState } from '@app/store/index';\n\nexport interface HeaderState {\n\tdoctorId?: number;\n\tglobalProcedureId?: number;\n\tspecialtyId?: number;\n\tglobalPayerId?: number;\n\ttext?: string;\n\tlocationId?: number;\n\tlanguageIds?: Array;\n\tfrom?: number | null;\n\tglobalProcedureIds?: Array;\n\tspecialtyIds?: Array;\n\tcertificateIds?: Array;\n\tregionIds?: Array;\n\tlocationIds?: Array;\n\tglobalPayerIds?: Array;\n\tgender?: number;\n}\n\ninterface SetAction extends Action {\n\tpayload: HeaderState;\n}\n\nexport interface HeaderActionCreators extends ActionCreatorsMapObject {\n\tsetState: (state: HeaderState) => BaseAppThunkAction;\n}\n\nexport const actionCreators: HeaderActionCreators = {\n\tsetState: (state: HeaderState) => (dispatch) => {\n\t\tdispatch({\n\t\t\ttype: SET_SEARCH_STATE,\n\t\t\tpayload: { ...state },\n\t\t});\n\t},\n};\n\nconst initialState = {};\n\nexport const reducer: Reducer = (state: HeaderState = initialState, action: Action) => {\n\tswitch (action.type) {\n\t\tcase SET_SEARCH_STATE:\n\t\t\treturn { ...(action as SetAction).payload };\n\t}\n\n\treturn state;\n};\n","import { BaseUser } from '@common/react/objects/BaseUser';\nimport {\n\tLoginState as BaseLoginState,\n\tLoginActionCreators as BaseLoginActionCreators,\n\tgetActionCreators as baseGetActionCreators,\n\tgetReducer as baseGetReducer,\n} from '@common/react/store/Login';\n\nimport { User } from '@app/objects/User';\nimport { ApplicationState } from '@app/store/index';\n\nexport { TypeKeys } from '@common/react/store/Login';\n\nexport type LoginState = BaseLoginState\n\nexport type LoginActionCreators = BaseLoginActionCreators\n\nexport function getActionCreators() {\n\treturn baseGetActionCreators();\n}\n\nexport function getReducer() {\n\treturn baseGetReducer();\n}\n","import { Action, Reducer, ActionCreatorsMapObject } from 'redux';\n\nimport { Language } from '@commonTuna/react/objects/Language';\nimport { Certificate } from '@commonTuna/react/objects/Certificate';\n\nimport { AppThunkAction } from '@app/store/index';\n\nexport interface SearchFilterState {\n\tlocationName: string;\n\tglobalPayerName: string;\n\tspecialtyName?: string;\n\tdoctorName?: string;\n\tglobalProcedureName?: string;\n\tglobalProcedures?: Array;\n\tspecialties?: Array;\n\tlanguages: Array;\n\tcertificates: Array;\n}\n\nexport enum SearchFilterTypeKeys {\n\tSET_SEARCH_FILTER_STATE = 'SET_SEARCH_FILTER_STATE',\n\tUPDATE_SEARCH_FILTER = 'UPDATE_SEARCH_FILTER'\n}\n\nexport interface SetSearchFilterState {\n\ttype: SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE;\n\tpayload: SearchFilterState;\n}\n\ninterface UpdateSearchFilter {\n\ttype: SearchFilterTypeKeys.UPDATE_SEARCH_FILTER;\n\tdata: object;\n}\n\nexport type Actions = SetSearchFilterState | UpdateSearchFilter;\n\nexport interface SearchFilterActionCreators extends ActionCreatorsMapObject {\n\tsetSearchFilterState: (state: SearchFilterState) => AppThunkAction;\n\tupdateSearchFilter: (data: object) => AppThunkAction;\n}\n\nexport const searchFilterActionCreators = {\n\tsetSearchFilterState: (state: SearchFilterState): AppThunkAction => (dispatch, getState) => {\n\t\tdispatch({ type: SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE, payload: { ...state } });\n\t},\n\tupdateSearchFilter: (data: object): AppThunkAction => (dispatch, getState) => {\n\t\tdispatch({ type: SearchFilterTypeKeys.UPDATE_SEARCH_FILTER, data });\n\t},\n};\n\nconst initialState = {\n\tlocationName: '',\n\tglobalPayerName: '',\n\tspecialtyName: '',\n\tdoctorName: '',\n\tglobalProcedureName: '',\n\tglobalProcedures: [],\n\tspecialties: [],\n\tlanguages: [],\n\tcertificates: [],\n};\n\nexport const reducer: Reducer = (\n\tstate: SearchFilterState = initialState,\n\tincomingAction: Action,\n) => {\n\tconst action = incomingAction as Actions;\n\tswitch (action.type) {\n\t\tcase SearchFilterTypeKeys.SET_SEARCH_FILTER_STATE:\n\t\t\treturn { ...action.payload };\n\t\tcase SearchFilterTypeKeys.UPDATE_SEARCH_FILTER:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.data,\n\t\t\t};\n\t\tdefault:\n\t\t\treturn state;\n\t}\n};\n","import { fetch } from 'domain-task';\n\nimport { BaseApplicationState } from '@common/react/store';\nimport { BaseUser } from '@common/react/objects/BaseUser';\nimport { BaseParams } from '@common/typescript/objects/BaseParams';\n\ninterface Message {\n\tsuccess: number;\n\tresponse: T;\n\tsession: string;\n}\n\nexport interface ResponseError {\n\tmessage: string;\n\tcode: number;\n\tname?: string;\n}\n\nfunction baseRequest<\n\tT,\n\tTUser extends BaseUser,\n\tTApplicationState extends BaseApplicationState\n>(type: string, data: BaseParams = {}, state?: TApplicationState, signal?: AbortSignal): Promise {\n\treturn fetch('api/post', {\n\t\tcredentials: 'same-origin',\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-type': 'application/json; charset=utf-8',\n\t\t\tCookie: `session=${state ? state.login.session : ''}`,\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\ttype,\n\t\t\tdata: JSON.stringify(data),\n\t\t}),\n\t\tsignal,\n\t})\n\t\t.then((response) => response.json() as Message)\n\t\t.then((data: Message) => {\n\t\t\tif (!data.success) {\n\t\t\t\tthrow data.response as ResponseError;\n\t\t\t}\n\n\t\t\treturn data.response as T;\n\t\t});\n}\n\nfunction request<\n\tT,\n\tTUser extends BaseUser,\n\tTApplicationState extends BaseApplicationState\n\t>(type: string, data: BaseParams = {}, state?: TApplicationState, signal?: AbortSignal): Promise {\n\treturn baseRequest(type, data, state, signal)\n\t\t.catch((error: ResponseError) => {\n\t\t\tif (error.name === 'AbortError') {\n\t\t\t\tthrow new Error('Aborted');\n\t\t\t}\n\t\t\tif (error.message === 'Access denied' && window) {\n\t\t\t\twindow.location.href = '/';\n\t\t\t}\n\n\t\t\tconsole.log(error.message);\n\t\t\tthrow error.message as string;\n\t\t});\n}\n\nexport { baseRequest, request };\n","import * as React from 'react';\n\nimport { FormikProps } from 'formik';\nimport { MentionProps } from 'antd';\n\nimport { List } from '@common/typescript/objects/List';\nimport { BaseUser, BaseUserWithAvatar } from '@common/react/objects/BaseUser';\nimport { Nullable } from '@common/typescript/objects/Nullable';\nimport { File, FileInterface } from '@common/typescript/objects/FileInterface';\nimport { ButtonsProps, ChatFormComponentState } from '@common/react/components/Chat/ChatMessageForm';\nimport { Notification } from '@common/typescript/objects/Notification';\nimport { ApplicationStateWithChats, ChatsActionCreators } from '@common/react/components/Chat/Store/Chats';\n\nexport enum ChatMessageType {\n\tRegular = 0,\n\tVoiceMessage = 1,\n\tEmail = 2,\n\tPhoneCall = 3,\n\tVideoChat = 4,\n\tVideoMessage = 5,\n\tSticker = 6,\n\tGiphy = 7,\n\tTenor = 8,\n\tForwardedMessage = 9,\n\tReplyMessage = 10,\n}\n\nexport enum ChatRoomType {\n\tVideo,\n\tAudio\n}\n\nexport enum ChatKind\n{\n\tPersonal,\n\tConference,\n\tGroup,\n\tHelp,\n\tSos\n}\n\nexport interface Chat {\n\tid: number;\n\tkind: ChatKind;\n\ttime: number;\n\tname: string;\n\tcontacts: Array;\n\tcontactsIds: Array;\n\tmessages: List;\n\tlastMessage: Nullable;\n\tunviewedMessagesCount: number;\n\tuserId: number;\n\tarchive?: boolean;\n}\n\nexport enum ChatPlugins {\n\tRegular = 0,\n\tVoiceMessage = 1,\n\tEmail = 2,\n\tPhoneCall = 3,\n\tVideoChat = 4,\n\tVideoMessage = 5,\n\tSticker = 6,\n\tGiphy = 7,\n\tTenor = 8,\n\tForward = 9,\n\tReply = 10,\n\tEdit = 16,\n\tDeleted = 17,\n\tVoiceCall = 18,\n\tTyping = 26,\n\tFiles = 27,\n\tEmoji = 28,\n\tMentions = 29,\n\tReactions = 30,\n\tLinkPreview = 31,\n\tLinkPreviewGroup = 32,\n\tColorBox = 33,\n\tSearching = 34,\n\tArchive = 35,\n\tAddChat = 36,\n\tOnlineFilter = 37,\n\tAllChats = 38,\n\tCompleteChat = 39,\n\tLeaveChat = 40,\n\tChatNameEditor = 41,\n\tCopy = 42,\n\tModalPlugin = 44,\n\tTemplate = 45,\n\tAdaptiveCards = 46,\n\tSendLater = 47,\n}\n\nexport interface ChatPlugin {\n\tformButton?: (formikBag: FormikProps, props: ChatFormButtonsProps) => React.ReactNode;\n\tformComponent?: (props: MentionProps) => React.ReactNode;\n\tmessageControlWrapper?: ({ chat, render }) => React.ReactNode;\n\tlistComponent?: (props) => React.ReactNode;\n\tadditionalComponent?: (props) => React.ReactNode;\n\tmessage?: {\n\t\trender: ({\n\t\t\tmessage, contacts, withRemoteId, onMouseEnter, lastVideoCallId, onImageClick,\n\t\t}) => React.ReactNode;\n\t\tlastMessage?: ({ message, chat, userId }) => React.ReactNode;\n\t\tnotification?: ({ message, withRemoteId, contacts }) => React.ReactNode;\n\t};\n\tformTag?: (formikBag: FormikProps, { state, setState, waveColor }) => React.ReactNode;\n\tmessagesHeaderAction?:\n\t\t({\n\t\t\tcurrentChat,\n\t\t\tuser,\n\t\t\tleaveChat,\n\t\t\thistory,\n\t\t\tpatientId,\n\t\t\tstate,\n\t\t\tcompleteChat,\n\t\t\twithRemoteId,\n\t\t\tactions,\n\t\t\tstorageName,\n\t\t} : {\n\t\t\tcurrentChat,\n\t\t\tuser,\n\t\t\tleaveChat,\n\t\t\thistory,\n\t\t\tpatientId,\n\t\t\tstate,\n\t\t\tcompleteChat,\n\t\t\twithRemoteId,\n\t\t\tactions: ChatsActionCreators>,\n\t\t\tstorageName\n\t\t}) => React.ReactNode;\n\tchatMessageAction?: ({\n\t\tedit, remove, isEdit, message, update, fromUser, options, reply,\n\t}) => React.ReactNode;\n\tchatsListHeaderComponent?: ({\n\t\tfilters, handleChange, selectChat, pageSettings, user,\n\t}) => React.ReactNode;\n\tonMessageListClick?: (e, chat: Chat) => void;\n\tmessageAttachment?: (message) => React.ReactNode;\n\tmessageAttachmentBefore?: (message) => React.ReactNode;\n\tnotificationHandler?: (\n\t\tnotification: Notification,\n\t\tstoreName: string,\n\t\tactions: ChatsActionCreators>,\n\t\toptions: any // plugin options\n\t) => void;\n\tsendButtonWrapper?: (button, formikBag, disabled) => React.ReactNode;\n\toptions?: any;\n}\n\nexport type ChatListHeaderSettingsType = Array React.ReactNode)>;\n\ntype CustomComponent = (({\n\tcurrentChat, user, leaveChat, history, patientId, state, completeChat, withRemoteId, actions,\n}) => React.ReactNode);\n\nexport type ChatMessagesHeaderSettingsType = Array;\n\nexport type ChatNameType = ({\n\tcurrentChat, user, withRemoteId, patientId,\n}) => React.ReactNode;\n\nexport interface EmojiReaction {\n\tid: number;\n\tuserId: number;\n\tuser: BaseUserWithAvatar;\n\tobjectId: number;\n\tobject: ChatMessage;\n\treaction: string;\n\tanimate?: boolean;\n}\n\nexport interface BaseChatMessage {\n\tid: number;\n\ttext: string;\n\tchatId: number;\n\tfiles?: Array;\n\tloading?: boolean;\n}\n\nexport interface ChatMessage {\n\tid: number;\n\ttext: string;\n\tchatId: number;\n\tchat?: Chat;\n\tuserId: number;\n\tuser?: BaseUserWithAvatar;\n\ttime: number;\n\tsendingTime: number;\n\tmessageViewers: Array;\n\tviewed: boolean;\n\tviewLoading?: boolean;\n\tfiles: Array;\n\temojiReactions: Array;\n\tchatMessageType: ChatMessageType;\n\tchatRoomType?: ChatRoomType;\n\tinnerChatMessageId: Nullable;\n\tinnerChatMessage: Nullable;\n\tloading?: boolean;\n}\n\nexport interface ChatMessageAccess {\n\tchatMessageObject?: ChatMessage;\n\tid: number;\n\tmessage: number;\n\ttime: number;\n\tuser?: BaseUserWithAvatar;\n\tuserId: number;\n\tviewed: boolean;\n}\n\nexport interface ChatUser {\n\tid: number;\n\tchatId: number;\n\tuserId: number;\n\tuser?: BaseUserWithAvatar;\n\tchat?: Chat;\n}\n\nexport interface NewMessage {\n\tid: number;\n\ttext: string;\n\tchatId: number;\n\n\tbytes: Array;\n\tfiles: Array;\n\tattachments: Array;\n\tchatMessageType: ChatMessageType;\n\tinnerChatMessageId?: number;\n\tsendingTime?: number;\n}\n\nexport interface ChatFormButtonsProps extends ButtonsProps {\n\tchat: Chat;\n\tisEditMessage?: boolean;\n\twaveColor?: string;\n\tsetState: React.Dispatch>;\n\tchatId?: number;\n\tgetPopupContainer?: (node) => HTMLElement;\n}\n\nexport type ChatFormButtonsWrappers = {\n\t[key in ChatPlugins]?: (children) => React.ReactNode;\n};\n\nexport type ChatFormButtonsComponents = ChatPlugins | ((formikBag: FormikProps, props: ChatFormButtonsProps) => React.ReactNode);\n\nexport enum ChatHeaderButtons {\n\tVoice,\n\tVideo,\n\tMail\n}\n\nexport enum StickerType {\n\tImage,\n\tGiphy\n}\n\nexport type ChatMessageActionsComponent = ChatPlugins\n\t| (({\n\t\tremove, update, edit, isEdit, message, fromUser, options,\n\t}) => React.ReactNode);\n\nexport type ChatOtherComponents = ChatPlugins | (({\n\tchat, defaultIdx, setImg, files, basePath,\n}) => React.ReactNode);\n\nexport interface ChatStickerCollectionItem {\n\timage: string;\n\tdescription?: string;\n\tfullImage?: string;\n}\n\nexport interface ChatStickerCollection {\n\titems: Array;\n\timage: string;\n\tdescription?: string;\n\tenable?: boolean;\n}\n","import * as React from 'react';\n\nimport Mentions from 'antd/lib/mentions';\nimport Tag from 'antd/lib/tag';\nimport {\n\tFieldProps, Form, Formik, FormikProps,\n} from 'formik';\nimport * as Yup from 'yup';\nimport message from 'antd/lib/message';\nimport Popover from 'antd/lib/popover';\n\nimport {\n\tChat,\n\tChatMessage,\n\tChatMessageType,\n\tNewMessage,\n} from '@common/react/components/Chat/Chat';\nimport Button from '@common/react/components/Forms/Button';\nimport FormikField from '@common/react/components/Forms/FormikField/FormikField';\nimport { getUserName } from '@common/react/utils/utils';\nimport { BaseUser, BaseUserWithAvatar } from '@common/react/objects/BaseUser';\nimport { FileInterface, FileType } from '@common/typescript/objects/FileInterface';\nimport FormikRef from '@common/react/components/Core/ItemEditor/FormikRef';\nimport { RecordResult } from '@common/react/utils/record-audio';\nimport { uploadFile } from '@common/react/components/Forms/Files/File';\nimport {\n\tuseChatSettingsProviderContext,\n} from '@common/react/components/Chat/ChatSettingsProvider';\nimport useRequest from '@common/react/hooks/useRequest';\nimport { imageExtensions } from '@common/react/components/Chat/Chats';\n\nexport interface ButtonsProps {\n\tonUploadFile: (file: FileInterface) => void;\n}\n\ninterface ComponentProps {\n\tchat: Chat;\n\teditMessage: ChatMessage | null;\n\tsetEdit: (message) => void;\n\tafterSubmit?: (message) => void;\n\tsendClassName?: string;\n\tonImageClick?: (e, file: FileInterface) => void;\n\tactionsInPopup?: boolean;\n\tfilesAfterButtons?: boolean;\n\tgetActionPopupContainer?: (node) => HTMLElement;\n\tgetUserAvatar?: (user) => React.ReactNode;\n\treplyMessage?: ChatMessage | null;\n\tsetReply?: (message) => void;\n}\n\ninterface ContactsHash {\n\t[index: number]: string;\n}\n\nexport interface ChatFormComponentState {\n\tisLoading: boolean;\n\tcontacts: ContactsHash;\n\n\trecordAudioResult: RecordResult | undefined;\n\trecordVideoResult: RecordResult | undefined;\n}\n\nconst getValidationSchema = (maxLength: number) => Yup.object().shape({\n\ttext: Yup.string().max(maxLength, `max characters count: ${maxLength}`),\n});\n\nconst transformContactsToHash = (contacts: Array) => contacts.reduce((map, obj) => {\n\tmap[obj.id] = getUserName(obj);\n\treturn map;\n}, {});\n\ninterface FilesProps {\n\tformikBag: FormikProps;\n\tonRemoveUploadedFile: (id, formikBag) => void;\n\tstate: ChatFormComponentState;\n\tsetState: React.Dispatch>;\n\tonImageClick?: (e, f) => void;\n}\n\nconst Files: React.FC = ({\n\tformikBag, onRemoveUploadedFile, onImageClick, state, setState,\n}) => {\n\tconst context = useChatSettingsProviderContext();\n\n\tif (!context?.state) throw 'need ChatSettingsContext';\n\n\tconst {\n\t\tstate: {\n\t\t\tformSettings,\n\t\t\tformTags,\n\t\t\tplugins,\n\t\t},\n\t} = context;\n\tconst { waveColor } = formSettings;\n\n\treturn \n\t\t{formikBag.values.files\n\t\t\t.map((f) => (\n\t\t\t\t
onRemoveUploadedFile(f.id, formikBag)}\n\t\t\t\t\tclosable\n\t\t\t\t\tcloseIcon={ }\n\t\t\t\t>\n\t\t\t\t\t{imageExtensions.includes(f.extension?.toLowerCase())\n\t\t\t\t\t\t? (\n\t\t\t\t\t\t\t onImageClick && onImageClick(e, f)}\n\t\t\t\t\t\t\t\tclassName=\"chat-form-file-tag-image\"\n\t\t\t\t\t\t\t\tsrc={f.thumb}\n\t\t\t\t\t\t\t\talt={f.name}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: \n\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t{f.name} \n \n\t\t\t\t \n\t\t\t))\n\t\t}\n\t\t
\n\t\t\t{formTags.map((plugin) => \n\t\t\t\t{plugins[plugin]?.formTag?.(formikBag, { state, setState, waveColor })}\n\t\t\t )}\n\t\t \n\t
;\n};\n\nconst ChatMessageForm: React.FC = (props) => {\n\tconst {\n\t\tsendClassName = 'btn-primary', chat, onImageClick, editMessage, setEdit, actionsInPopup, filesAfterButtons,\n\t} = props;\n\tconst {\n\t\tgetActionPopupContainer, replyMessage, setReply, getUserAvatar,\n\t} = props;\n\tconst form = React.useRef | null>(null);\n\tconst request = useRequest();\n\n\tconst context = useChatSettingsProviderContext();\n\n\tif (!context?.state) throw 'need ChatSettingsContext';\n\n\tconst {\n\t\tstate: {\n\t\t\tformButtons,\n\t\t\tchatFormButtonsWrappers,\n\t\t\trequests,\n\t\t\tformSettings,\n\t\t\terrorHandlers,\n\t\t\tplugins,\n\t\t\tmessageControl,\n\t\t\tmessageControlWrappers,\n\t\t\tsendButtonWrapper,\n\t\t},\n\t} = context;\n\tconst { maxAttachmentsCount, maxMessageLength, waveColor } = formSettings;\n\n\tconst [state, _setState] = React.useState({\n\t\tisLoading: false,\n\t\tcontacts: props.chat ? transformContactsToHash(props.chat.contacts) : {},\n\t\trecordAudioResult: undefined,\n\t\trecordVideoResult: undefined,\n\t});\n\tconst setState = React.useCallback((newState) => _setState((state) => ({ ...state, ...newState })), []);\n\tconst buttonWrapper = sendButtonWrapper && plugins[sendButtonWrapper]?.sendButtonWrapper;\n\n\tReact.useEffect(() => {\n\t\tsetState({\n\t\t\tcontacts: props.chat ? transformContactsToHash(props.chat.contacts) : {},\n\t\t});\n\t}, [props.chat]);\n\n\tconst handleSubmitForm = (values: NewMessage, { resetForm }) => {\n\t\tconst {\n\t\t\ttext, files, attachments, bytes,\n\t\t} = values;\n\n\t\tif (!(text.replace(/\\s/g, '') || files?.length || attachments?.length || bytes?.length)) return;\n\n\t\tsetState({\n\t\t\tisLoading: true,\n\t\t});\n\n\t\tconst item = values;\n\n\t\titem.chatId = props.chat.id;\n\t\titem.attachments = item.files.map((f) => f.id);\n\n\t\trequest(editMessage && requests.updateMessage ? requests.updateMessage : requests.chatMessage, item).then((result) => {\n\t\t\tsetState({\n\t\t\t\tisLoading: false,\n\t\t\t});\n\t\t\tresetForm();\n\t\t\t_setState((prev) => ({\n\t\t\t\t...prev,\n\t\t\t\trecordAudioResult: undefined,\n\t\t\t\trecordVideoResult: undefined,\n\t\t\t}));\n\t\t\tprops.afterSubmit && props.afterSubmit(result);\n\t\t\tif (editMessage) {\n\t\t\t\tsetEdit(null);\n\t\t\t}\n\t\t\tif (replyMessage) {\n\t\t\t\tsetReply && setReply(null);\n\t\t\t}\n\t\t}).catch((e) => {\n\t\t\t(errorHandlers?.onSaveMessageLoadError || message.error)(e);\n\t\t\tsetState({\n\t\t\t\tisLoading: false,\n\t\t\t});\n\t\t});\n\t};\n\n\tconst onUploadFile = (file: FileInterface, formikBag: FormikProps) => {\n\t\tformikBag.setValues((prev) => {\n\t\t\tconst nextFiles = formikBag.values.files.concat(file);\n\n\t\t\tif (nextFiles.length > maxAttachmentsCount) {\n\t\t\t\tmessage.info(`Max Attachment files count: ${maxAttachmentsCount}`);\n\t\t\t\treturn prev;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...prev,\n\t\t\t\tfiles: prev.files.concat(file),\n\t\t\t};\n\t\t});\n\t};\n\n\tconst onRemoveUploadedFile = (id: number, formikBag) => {\n\t\tformikBag.setValues((prev) => {\n\t\t\treturn {\n\t\t\t\t...prev,\n\t\t\t\tfiles: prev.files.filter((f) => f.id !== id),\n\t\t\t};\n\t\t});\n\t};\n\n\tconst onKeyDown = (e: KeyboardEvent) => {\n\t\tconst formikBag = form.current;\n\n\t\tif (formikBag && e.ctrlKey && e.code === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tformikBag.submitForm();\n\t\t}\n\t};\n\n\tconst handlePaste = (e: React.ClipboardEvent, formikBag: FormikProps) => {\n\t\tconst items = Array.from(e.clipboardData.items).filter((x) => /^image\\//.test(x.type));\n\n\t\titems.forEach((item) => {\n\t\t\tconst blob = item?.getAsFile();\n\n\t\t\tuploadFile({\n\t\t\t\tfile: blob,\n\t\t\t\ttype: 'chatMessage',\n\t\t\t\tobjectId: -1,\n\t\t\t\tfileType: FileType.File,\n\t\t\t})\n\t\t\t\t.then((data) => onUploadFile(data, formikBag))\n\t\t\t\t.catch((err: any) => {\n\t\t\t\t\tmessage.error(typeof err === 'object' ? err.message : err);\n\t\t\t\t});\n\t\t});\n\t};\n\n\tReact.useEffect(() => {\n\t\tdocument.addEventListener('keydown', onKeyDown);\n\t\treturn () => document.removeEventListener('keydown', onKeyDown);\n\t}, []);\n\n\tconst MentionComponent = React.useMemo(() => {\n\t\treturn ({ placement, ...props }: any) => {\n\t\t\tconst mention = (onKeyDown) => {\n\t\t\t\tconst handleKeyDown = (e) => {\n\t\t\t\t\tonKeyDown && onKeyDown(e);\n\t\t\t\t\tprops.onKeyDown && props.onKeyDown(e);\n\t\t\t\t};\n\t\t\t\treturn messageControl && plugins[messageControl]?.formComponent\n\t\t\t\t\t? plugins[messageControl]?.formComponent?.({ placement, ...props, onKeyDown: handleKeyDown })\n\t\t\t\t\t: ;\n\t\t\t};\n\t\t\tif (!messageControlWrappers || messageControlWrappers.some((plugin) => !plugins[plugin]?.messageControlWrapper)) {\n\t\t\t\treturn <>{mention(undefined)}>;\n\t\t\t}\n\n\t\t\treturn <>\n\t\t\t\t{(messageControlWrappers?.reduce(\n\t\t\t\t\t(acc, plugin) =>\n\t\t\t\t\t\t(handleKeyDown) => {\n\t\t\t\t\t\t\treturn <>\n\t\t\t\t\t\t\t\t{plugins[plugin]?.messageControlWrapper?.({\n\t\t\t\t\t\t\t\t\tchat,\n\t\t\t\t\t\t\t\t\trender: (onKeyDown) => {\n\t\t\t\t\t\t\t\t\t\tconst keyDownHandler = (e) => {\n\t\t\t\t\t\t\t\t\t\t\tonKeyDown && onKeyDown(e);\n\t\t\t\t\t\t\t\t\t\t\thandleKeyDown && handleKeyDown(e);\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\treturn acc(keyDownHandler);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t>;\n\t\t\t\t\t\t},\n\t\t\t\t\tmention,\n\t\t\t\t) || mention)?.(undefined)}\n\t\t\t>;\n\t\t};\n\t}, [messageControl, `${messageControlWrappers}`, chat.id]);\n\n\tconst validationSchema = React.useMemo(() => {\n\t\treturn getValidationSchema(maxMessageLength);\n\t}, []);\n\n\tconst mentionOptions = React.useMemo(() => {\n\t\treturn chat.contacts.map((item) => {\n\t\t\tconst name = getUserName(item);\n\n\t\t\treturn {\n\t\t\t\tvalue: name,\n\t\t\t\tlabel: <>\n\t\t\t\t\t{getUserAvatar && {getUserAvatar(item)}
}\n\t\t\t\t\t{name} \n\t\t\t\t>,\n\t\t\t};\n\t\t});\n\t}, [chat.contacts, messageControl && plugins[messageControl]?.formComponent]);\n\n\tconst getActions = (formikBag) => \n\t\t{formButtons\n\t\t\t.map((button) => {\n\t\t\t\tconst props = {\n\t\t\t\t\tonUploadFile: (f) => onUploadFile(f, formikBag),\n\t\t\t\t\tsetState: _setState,\n\t\t\t\t\twaveColor,\n\t\t\t\t\tisEditMessage: !!editMessage,\n\t\t\t\t\tchatId: chat.id,\n\t\t\t\t\tgetPopupContainer: getActionPopupContainer,\n\t\t\t\t\tchat,\n\t\t\t\t};\n\t\t\t\tconst wrapper = typeof button !== 'function' && chatFormButtonsWrappers[button]\n\t\t\t\t\t? chatFormButtonsWrappers[button] : (children) => {children} ;\n\n\t\t\t\tconst buttonRender = typeof button === 'function'\n\t\t\t\t\t? button\n\t\t\t\t\t: plugins[button] && plugins[button]?.formButton !== null\n\t\t\t\t\t\t? plugins[button]?.formButton\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\treturn !buttonRender ? null : wrapper ? wrapper(buttonRender(formikBag, props)) : buttonRender(formikBag, props);\n\t\t\t})\n\t\t}\n\t ;\n\n\treturn f.file) || [],\n\t\t\tattachments: [],\n\t\t\tbytes: [],\n\t\t\tchatMessageType: replyMessage ? ChatMessageType.ReplyMessage : ChatMessageType.Regular,\n\t\t\tinnerChatMessageId: replyMessage?.id,\n\t\t} as NewMessage}\n\t\tonSubmit={handleSubmitForm}\n\t\tvalidationSchema={validationSchema}\n\t\tenableReinitialize\n\t>\n\t\t{(formikBag: FormikProps) => {\n\t\t\tconst disabled = !formikBag.values.files.length\n\t\t\t\t&& !formikBag.values.text.replace(/\\s/g, '').length\n\t\t\t\t&& formikBag.values.bytes.length <= 0;\n\t\t\treturn ;\n\t\t}}\n\t ;\n};\n\nexport default ChatMessageForm;\n","import * as React from 'react';\n\nexport const defaultChatMessagesError = ({ reload }) => {\n\treturn \n\t\t
\n\t\t\tOops... we couldn't upload the messages,\n\t\t\t \n\t\t\tbut our team is already working on it\n\t\t \n\t\t \n\t\t reload()}>\n\t\t\tClick to reload messages\n\t\t \n\t
;\n};\n","import React from 'react';\n\nconst useScrollTo = (\n\trefreshId: number | string | null,\n\tprevent?: boolean,\n\tafterScrollStart?: () => void,\n) => {\n\tconst ref = React.useRef(null);\n\n\tReact.useEffect(() => {\n\t\tconst scrollContainer = ref.current;\n\n\t\tif (scrollContainer && !prevent) {\n\t\t\tscrollContainer.scrollIntoView({ block: 'end' });\n\t\t\tsetTimeout(() => afterScrollStart && afterScrollStart(), 0);\n\t\t}\n\t}, [refreshId]);\n\n\treturn ref;\n};\n\nexport default useScrollTo;\n","import * as React from 'react';\nimport { shallowEqual, useSelector } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\n\nimport Message from 'antd/lib/message';\n\nimport { parseQuery } from '@common/typescript/utils/url';\nimport { getUserName } from '@common/react/utils/utils';\nimport { getAvatar } from '@common/react/utils/getAvatar';\nimport { replaceSearchUrl } from '@common/react/components/Utils/Utils';\nimport {\n\tChat,\n\tChatMessage,\n\tChatMessageActionsComponent,\n\tChatMessageType, ChatPlugins,\n} from '@common/react/components/Chat/Chat';\nimport { ApplicationStateWithChats, ChatsActionCreators } from '@common/react/components/Chat/Store/Chats';\nimport { BaseUserWithAvatar } from '@common/react/objects/BaseUser';\nimport { BaseApplicationState } from '@common/react/store';\nimport { dateFormat, dateTimeFormat } from '@common/typescript/Utils';\nimport { File } from '@common/typescript/objects/FileInterface';\nimport {\n\tdefaultTransformFiltersBeforeHandleUrl,\n\tItemsProvider,\n\tuseItemsProviderContext,\n} from '@common/react/components/Core/ItemsProvider/ItemsProvider';\nimport {\n\tChatSettingsProviderContext,\n\tPluginsDictionary,\n\tuseChatSettingsProviderContext,\n} from '@common/react/components/Chat/ChatSettingsProvider';\nimport Loader from '@common/react/components/Core/LoadingProvider/Loader';\nimport useRequest from '@common/react/hooks/useRequest';\nimport { deleteConfirmation } from '@common/react/components/Modal/Modal';\nimport { defaultChatMessagesError } from '@common/react/components/Chat/ChatComponents';\nimport useScrollTo from '@common/react/hooks/useScrollTo';\n\ntype ListProps = OwnProps;\n\ntype Actions = ChatsActionCreators>;\n\ninterface OwnProps {\n\tactions: Actions;\n\tchat: Chat;\n\tuser: BaseUserWithAvatar;\n\tcontext: ChatSettingsProviderContext;\n\tsetEdit: (message) => void;\n\teditMessage?: ChatMessage | null;\n\tsetReplyMessage: (message) => void;\n\treplyMessage?: ChatMessage | null;\n\tloader?: React.ReactElement;\n\tonImageClick?: (e, file: File) => void;\n\tgetUserAvatar?: (user) => React.ReactNode;\n}\n\nexport interface ChatItemProps {\n\tmessage: ChatMessage;\n\twithRemoteId: boolean;\n\tfromUser: boolean;\n\twithoutBadge: boolean;\n\tuser: BaseUserWithAvatar;\n\tremove: () => void;\n\tupdate: (message) => void;\n\tedit: (message) => void;\n\treply: (message) => void;\n\tisEdit: boolean;\n\tplugins: PluginsDictionary;\n\tonMouseEnter?: (message: ChatMessage) => void;\n\tcontacts: Array;\n\tonImageClick?: (e, file: File) => void;\n\tgetUserAvatar?: (user) => React.ReactNode;\n\tlastVideoCallId?: number;\n\tmessageActions?: Array;\n\tshowActionsByHover?: boolean;\n\tscrollIntoView?: boolean;\n\tafterScroll?: () => void;\n\tgetViewerAvatar?: (messageViewers) => React.ReactNode;\n\tattachments?: Array;\n\tattachmentsBefore?: Array;\n}\n\nconst getMessageUser = (id: number, contacts: Array) =>\n\tcontacts.find((contact: BaseUserWithAvatar) => contact.id === id);\n\nconst allowMessageTypes = [\n\tChatMessageType.Regular,\n\tChatMessageType.Giphy,\n\tChatMessageType.Tenor,\n\tChatMessageType.Sticker,\n];\n\nconst ChatMessageItem: React.FC = ({\n\tmessage,\n\twithoutBadge,\n\tfromUser,\n\tuser,\n\tonMouseEnter,\n\tcontacts,\n\tonImageClick,\n\tplugins,\n\tshowActionsByHover,\n\tafterScroll,\n\treply,\n\tattachments,\n\tattachmentsBefore,\n\t...rest\n}) => {\n\tconst ref = useScrollTo(rest.scrollIntoView ? 0 : message.id, !rest.scrollIntoView, afterScroll);\n\tconst { withRemoteId, lastVideoCallId } = rest;\n\tconst context = useChatSettingsProviderContext();\n\n\tconst { state: { onMessageDoubleClick } } = context;\n\n\tconst className = `chat-message-list-component__item ${\n\t\tfromUser ? 'chat-message-list-component__item_you' : ''} ${\n\t\twithoutBadge ? 'chat-message-list-component__item_withoutBadge' : ''} ${\n\t\tmessage.viewed ? '' : 'chat-message-list-component__item_unviewed'} ${\n\t\trest.isEdit ? 'chat-message-list-component__item_edit' : ''\n\t}`;\n\n\tconst {\n\t\tgetUserAvatar = (user) =>
,\n\t\tgetViewerAvatar = (messageViewer) => \n\t\t\t{messageViewer?.user?.avatar\n\t\t\t\t?
\n\t\t\t\t:
{messageViewer?.user?.firstName} }\n\t\t
,\n\t} = rest;\n\n\tconst handleClick = (e) => {\n\t\tconst ignoreNode = [\n\t\t\t'.chat-file-tag',\n\t\t\t'.message-action',\n\t\t\t'.btn-chat-message-reaction',\n\t\t\t'.chat-message-reactions',\n\t\t\t'.chat-message-list-component__viewers',\n\t\t\t'.ant-tooltip',\n\t\t\t'.ant-popover',\n\t\t];\n\n\t\tif (e.detail > 1 && allowMessageTypes.includes(message.chatMessageType)\n\t\t\t&& !ignoreNode.some((node) => e.target?.classList.contains(node) || e.target?.closest(node))) {\n\t\t\tonMessageDoubleClick && onMessageDoubleClick(e, message, reply);\n\t\t}\n\t};\n\n\tconst messageRender = plugins[message.chatMessageType]\n\t\t? plugins[message.chatMessageType]?.message?.render\n\t\t: () => null;\n\n\treturn (message.chatMessageType !== ChatMessageType.Email || withRemoteId)\n\t\t? (\n\t\t\t onMouseEnter(message) : undefined}\n\t\t\t>\n\t\t\t\t{\n\t\t\t\t\tgetViewerAvatar && \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmessage.messageViewers && message.messageViewers\n\t\t\t\t\t\t\t\t.filter((messageViewer) => messageViewer.viewed && message.userId !== messageViewer.userId)\n\t\t\t\t\t\t\t\t.map((messageViewer) =>\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{getViewerAvatar(messageViewer)}\n\t\t\t\t\t\t\t\t\t
)\n\t\t\t\t\t\t}\n\t\t\t\t\t
\n\t\t\t\t}\n\t\t\t\t{attachmentsBefore?.map((plugin) => (\n\t\t\t\t\tplugins?.[plugin]?.messageAttachmentBefore ? \n\t\t\t\t\t\t{plugins?.[plugin]?.messageAttachmentBefore?.(message)}\n\t\t\t\t\t : null))}\n\t\t\t\t\n\t\t\t\t\t{!withoutBadge && user\n\t\t\t\t\t&& <>\n\t\t\t\t\t\t{getUserAvatar(user)}\n\t\t\t\t\t\t
{getUserName(user)}
\n\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t\t{!withoutBadge && !user && withRemoteId\n\t\t\t\t\t&&
{user ? getUserName(user) : 'DELETED'}
}\n\t\t\t\t\t
\n\t\t\t\t\t\t{dateFormat(message.time)}\n\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t{dateTimeFormat(message.time)}\n\t\t\t\t\t
\n\t\t\t\t\t{messageRender?.({\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tcontacts,\n\t\t\t\t\t\tonImageClick,\n\t\t\t\t\t\twithRemoteId,\n\t\t\t\t\t\tonMouseEnter,\n\t\t\t\t\t\tlastVideoCallId,\n\t\t\t\t\t})}\n\t\t\t\t\t{attachments?.map((plugin) => (\n\t\t\t\t\t\tplugins?.[plugin]?.messageAttachment ?
\n\t\t\t\t\t\t\t{plugins?.[plugin]?.messageAttachment?.(message)}\n\t\t\t\t\t\t : null))}\n\t\t\t\t
\n\t\t\t\t{\n\t\t\t\t\trest.messageActions?.length\n\t\t\t\t\t\t? (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t{rest.messageActions.map((action) => {\n\t\t\t\t\t\t\t\t\tconst props = {\n\t\t\t\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\t\t\t\tedit: rest.edit,\n\t\t\t\t\t\t\t\t\t\tisEdit: rest.isEdit,\n\t\t\t\t\t\t\t\t\t\tremove: rest.remove,\n\t\t\t\t\t\t\t\t\t\tupdate: rest.update,\n\t\t\t\t\t\t\t\t\t\treply,\n\t\t\t\t\t\t\t\t\t\tfromUser,\n\t\t\t\t\t\t\t\t\t\toptions: typeof action === 'function' ? undefined : plugins[action]?.options,\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\tif (typeof action === 'function') {\n\t\t\t\t\t\t\t\t\t\treturn action(props);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn {plugins[action]?.chatMessageAction?.(props)} ;\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t ) : null;\n};\n\nexport const ScrollTo: React.FC<{refreshId: number | string | null, prevent?: boolean}> = ({ refreshId, prevent }) => {\n\tconst ref = useScrollTo(refreshId, prevent);\n\n\treturn
;\n};\n\nconst ChatMessageList: React.FC = (props) => {\n\tconst {\n\t\tuser, chat, loader, actions, onImageClick, getUserAvatar, context: chatSettingsContext,\n\t} = props;\n\tconst {\n\t\tsetEdit, editMessage, replyMessage, setReplyMessage,\n\t} = props;\n\tconst request = useRequest();\n\tconst history = useHistory();\n\tconst [scrollToMessageId, setScrollToMessageId] = React.useState(() => {\n\t\tconst params = parseQuery(history.location.search);\n\t\treturn +(params.messageId || 0);\n\t});\n\n\tconst lastScrollData = React.useRef<{top: number, height: number}>({ top: 0, height: 0 });\n\n\tconst [scrollId, setScrollId] = React.useState(null);\n\tconst [error, setError] = React.useState('');\n\tconst [loadingMore, setLoadingMore] = React.useState(false);\n\tconst listRef = React.useRef(null);\n\n\tconst context = useItemsProviderContext();\n\tconst {\n\t\tstate: {\n\t\t\titems, pagination, loading, filters,\n\t\t}, actions: { load, loadMore },\n\t} = context;\n\n\tconst {\n\t\tstate: {\n\t\t\trequests, withRemoteId, chatStoreSettings: { getMessages }, messageActions, errorHandlers,\n\t\t\tmessagesLoadMoreIndicator, plugins, storageName, showActionsByHover, avatarSettings,\n\t\t},\n\t} = chatSettingsContext;\n\n\tconst messages = useSelector((state: BaseApplicationState) => {\n\t\treturn getMessages(chat.id)(state);\n\t}, shallowEqual);\n\n\tconst reload = (useResult: {use: boolean} = { use: true }) => {\n\t\tsetError('');\n\t\tconst otherChat = chat.contacts.every((contact) => (contact as any).remoteId !== user.id);\n\t\tconst userId = otherChat ? (chat.contacts as any).find((contact) => contact.remoteId && contact.remoteId > 0)?.remoteId : undefined;\n\n\t\tload({ chatId: chat.id, userId: withRemoteId ? userId || 0 : undefined }, false, false, false, true, useResult)\n\t\t\t.then((res) => {\n\t\t\t\tres.list.length > 0 && setScrollId(res.list[0].id);\n\t\t\t})\n\t\t\t.catch((e) => {\n\t\t\t\tsetError(e);\n\t\t\t});\n\t};\n\n\tReact.useEffect(() => {\n\t\thistory.listen((location, action) => {\n\t\t\tconst messageId = +(parseQuery(location.search).messageId || 0);\n\t\t\tif (messageId) {\n\t\t\t\tsetScrollToMessageId(messageId);\n\t\t\t}\n\t\t});\n\t}, []);\n\n\tReact.useEffect(() => {\n\t\tconst useResult = { use: true };\n\t\tif ((filters.chatId !== chat.id || props.initLoad) && !messages) {\n\t\t\treload(useResult);\n\t\t\treturn () => {\n\t\t\t\tuseResult.use = false;\n\t\t\t};\n\t\t}\n\t\titems.length > 0 && setScrollId(items[items.length - 1].id);\n\t\tmessages && setError('');\n\t}, [chat.id]);\n\n\tReact.useEffect(() => {\n\t\tif (items.length > 0 && items[items.length - 1].id) {\n\t\t\tsetScrollId(items[items.length - 1].id);\n\t\t}\n\t}, [items]);\n\n\tconst clickHandler = (e) => {\n\t\tif (e.target && e.target.nodeName === 'A' && e.target.className === 'chat-component__mention' && e.target.dataset.id) {\n\t\t\tconst contact = chat.contacts.find((item) => item.id === +e.target.dataset.id);\n\t\t\tcontact && Object.keys(plugins).forEach((plugin) => plugins[plugin]?.options?.onMentionClick?.(contact));\n\t\t}\n\t};\n\n\tconst setViewed = (message: ChatMessage) => {\n\t\tif (!message.viewLoading) {\n\t\t\tactions.updateMessage({ ...message, viewLoading: true }, storageName);\n\t\t\trequest(requests.chatMessageAccess, {\n\t\t\t\tviewed: true,\n\t\t\t\tmessage: message.id,\n\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tactions.updateMessage({ ...message, viewed: true, viewLoading: false }, storageName);\n\t\t\t\t})\n\t\t\t\t.catch((e) => {\n\t\t\t\t\t(errorHandlers?.onChatMessageAccessError || Message.error)(e);\n\t\t\t\t\tactions.updateMessage({ ...message, viewLoading: false }, storageName);\n\t\t\t\t});\n\t\t}\n\t};\n\n\tconst onScroll = (event) => {\n\t\tif (!event.target.classList.contains('chat-message-list-component')) return;\n\t\tconst scrollTop = (event.target as HTMLUListElement).scrollTop;\n\t\tif (items.length < pagination.total && !loading && scrollTop < 100 && lastScrollData.current.top - scrollTop > 0) {\n\t\t\tconst otherChat = chat.contacts.every((contact: any) => contact.remoteId !== user.id);\n\t\t\tconst userId = otherChat ? (chat.contacts as any).find((contact) => contact.remoteId && contact.remoteId > 0)?.remoteId : undefined;\n\n\t\t\tsetLoadingMore((loading) => {\n\t\t\t\tif (!loading) {\n\t\t\t\t\tloadMore({ chatId: chat.id, userId: withRemoteId ? userId || 0 : undefined }, true, true)\n\t\t\t\t\t\t.then(() => {\n\t\t\t\t\t\t\tif (listRef.current && lastScrollData.current.height > 0) {\n\t\t\t\t\t\t\t\tconst newHeight = listRef.current.scrollHeight;\n\t\t\t\t\t\t\t\tconst lastHeight = lastScrollData.current.height;\n\t\t\t\t\t\t\t\tlet top = newHeight - (lastHeight + lastScrollData.current.top);\n\t\t\t\t\t\t\t\tif (top < 0) {\n\t\t\t\t\t\t\t\t\ttop = 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlistRef.current.scrollTo({ top, left: 0 });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((e) => {\n\t\t\t\t\t\t\t(errorHandlers?.onChatMessagesLoadError || Message.error)(e);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.finally(() => {\n\t\t\t\t\t\t\tsetLoadingMore(false);\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t}\n\n\t\tlastScrollData.current.top = scrollTop;\n\t\tlastScrollData.current.height = listRef.current?.scrollHeight || 0;\n\t};\n\n\tconst self = withRemoteId ? chat.contacts.find((contact) => (contact as any).remoteId === user.id) || user : user;\n\tconst contacts = chat.contacts.filter((contact) => (withRemoteId ? (contact as any).remoteId !== self.id : contact.id !== user.id));\n\tconst lastVideoCallId = React.useMemo(() => {\n\t\treturn items.length > 0 ? [...items]\n\t\t\t.reverse()\n\t\t\t.find((item) => item.chatMessageType === ChatMessageType.VideoChat)?.id : undefined;\n\t}, [items]);\n\n\tconst update = (message, params) => {\n\t\trequests.updateMessage && request(requests.updateMessage, {\n\t\t\tid: message.id,\n\t\t\t...params,\n\t\t})\n\t\t\t.then(() => {\n\t\t\t\tactions.updateMessage({ id: message.id, chatId: message.chatId, ...params }, storageName);\n\t\t\t});\n\t};\n\n\tconst remove = (message) => {\n\t\tif (messages && requests.removeMessage) {\n\t\t\treturn request(requests.removeMessage, {\n\t\t\t\tid: message.id,\n\t\t\t\tdeleted: true,\n\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tactions.removeMessage(request, requests.getChat, storageName, message, message.chatId);\n\t\t\t\t});\n\t\t}\n\t};\n\n\tconst handleRemove = (message) => {\n\t\tif (chatSettingsContext.state.removeMessageConfirmation) {\n\t\t\tdeleteConfirmation(\n\t\t\t\t() => remove(message),\n\t\t\t\t'This message will be permanently deleted and cannot be recovered. Are you sure?',\n\t\t\t);\n\t\t} else {\n\t\t\tremove(message);\n\t\t}\n\t};\n\n\tconst afterScrollToMessage = () => {\n\t\tconst params = parseQuery(history.location.search);\n\t\tif (params.messageId) {\n\t\t\tsetScrollToMessageId(0);\n\t\t\thistory.replace({\n\t\t\t\t...history.location,\n\t\t\t\tsearch: replaceSearchUrl(history.location.search, 'messageId', ''),\n\t\t\t});\n\t\t}\n\t};\n\n\treturn \n\t\t{loadingMore && messagesLoadMoreIndicator ?
\n\t\t\t{messagesLoadMoreIndicator}\n\t\t
: null}\n\t\t{error ? (errorHandlers?.chatMessagesErrorComponent || defaultChatMessagesError)({ reload })\n\t\t\t: <>\n\t\t\t\t{(items && loading) &&
}\n\t\t\t\t
\n\t\t\t\t\t{items?.map((item, index) => {\n\t\t\t\t\t\tconst withoutBadge: boolean = index > 0 && item.userId === items[index - 1].userId;\n\t\t\t\t\t\tconst messageUser = item.userId === self.id\n\t\t\t\t\t\t\t? { ...user, status: item.user?.status } as BaseUserWithAvatar\n\t\t\t\t\t\t\t: getMessageUser(item.userId, contacts);\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tsetEdit(message);\n\t\t\t\t\t\t\t\tsetReplyMessage(null);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tattachmentsBefore={chatSettingsContext?.state?.messageAttachmentsBefore}\n\t\t\t\t\t\t\tattachments={chatSettingsContext?.state?.messageAttachments}\n\t\t\t\t\t\t\treply={(message) => {\n\t\t\t\t\t\t\t\tsetEdit(null);\n\t\t\t\t\t\t\t\tsetReplyMessage(message);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tisEdit={item.id === editMessage?.id || item.id === replyMessage?.id}\n\t\t\t\t\t\t\tremove={() => handleRemove(item)}\n\t\t\t\t\t\t\tupdate={(message) => update(item, message)}\n\t\t\t\t\t\t\tplugins={plugins}\n\t\t\t\t\t\t\tscrollIntoView={scrollToMessageId === item.id}\n\t\t\t\t\t\t\tafterScroll={afterScrollToMessage}\n\t\t\t\t\t\t\tshowActionsByHover={showActionsByHover}\n\t\t\t\t\t\t\tgetViewerAvatar={avatarSettings.viewerAvatar}\n\t\t\t\t\t\t/>;\n\t\t\t\t\t})}\n\t\t\t\t\t 0} />\n\t\t\t\t \n\t\t\t>\n\t\t}\n\t
;\n};\n\nconst ChatMessageListWrapper: React.FC> = (props) => {\n\tconst context = useChatSettingsProviderContext();\n\n\tif (!context?.state) throw 'need ChatSettingsContext';\n\n\tconst { state: { requests, storageName, chatStoreSettings: { getMessages } } } = context;\n\n\tconst messages = useSelector(getMessages(props.chat.id), shallowEqual);\n\n\treturn \n\t\titems={messages?.list}\n\t\tsyncItems={messages?.list}\n\t\ttype={requests.chatMessage}\n\t\ttransformFiltersBeforeHandleUrl={(filters) => ({\n\t\t\t...defaultTransformFiltersBeforeHandleUrl(filters),\n\t\t\tpageSize: undefined,\n\t\t})}\n\t\tpagination={{\n\t\t\ttotal: messages?.count, current: 1, pageSize: 20,\n\t\t}}\n\t\tfilters={{ chatId: props.chat.id }}\n\t\tonItemsChange={(items, filters, res) => filters?.chatId && props.actions.setMessages({\n\t\t\tlist: items,\n\t\t\toffset: res?.offset ?? items.length - (filters?.pageSize || 20),\n\t\t\texecution: 0,\n\t\t\tcount: res?.count ?? items.length,\n\t\t}, filters.chatId, storageName)}\n\t>\n\t\t \n\t ;\n};\n\nexport default ChatMessageListWrapper;\n","import * as React from 'react';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\nimport { useHistory } from 'react-router-dom';\n\nimport once from 'lodash/once';\nimport { bindActionCreators } from 'redux';\n\nimport useRequest from '@common/react/hooks/useRequest';\nimport {\n\tChat,\n\tChatFormButtonsComponents,\n\tChatFormButtonsWrappers,\n\tChatMessage,\n\tChatMessageActionsComponent,\n\tChatMessageType,\n\tChatOtherComponents,\n\tChatPlugins,\n\tChatPlugin,\n\tChatListHeaderSettingsType,\n\tChatNameType,\n\tChatMessagesHeaderSettingsType,\n} from '@common/react/components/Chat/Chat';\nimport { getAvatar } from '@common/react/utils/getAvatar';\nimport * as ChatsState from '@common/react/components/Chat/Store/Chats';\nimport { List } from '@common/typescript/objects/List';\n\nimport { BaseParams } from '@common/react/objects/BaseParams';\nimport { BaseUserWithAvatar } from '@common/typescript/objects/BaseUser';\nimport { getUserName } from '@common/react/utils/utils';\nimport { RegularMessagePlugin } from '@common/react/components/Chat/RegularMessagePlugin/RegularMessagePlugin';\nimport { FilePlugin } from '@common/react/components/Chat/FilesPlugin/FilesPlugin';\nimport { handleUrl } from '@common/react/utils/FIltersParamsFromUrl/FiltersParamsFromUrl';\n\nexport interface ChatSettingsRequests {\n\tchat: string;\n\tchatUser: string;\n\tchatMessage: string;\n\tchatMessageAccess: string;\n\ttyping: string;\n\tloadChats: string;\n\tloadMessages: string;\n\tgetChat: string;\n\tcompleteChat?: string;\n\tremoveMessage?: string;\n\tupdateMessage?: string;\n\tchatEmojiReactionMessage?: string;\n\tgetOrCreatePersonalChat: string;\n}\n\nexport interface ChatSettingsNotificationTypes {\n\tchat: string;\n\tchatUser: string;\n\tchatMessage: string;\n\tchatMessageAccess: string;\n\tchatReaction: string;\n\ttyping: string;\n\tupdateChatCounterNotification: string;\n\tupdateUserMessagesCountNotification: string;\n}\n\nexport interface ChatSettingsUserSettings {\n\tuseBrowserNotification: boolean;\n\tsound: boolean;\n}\n\nexport interface ChatSettingsAvatarSettings {\n\t// maybe better return components with special interface\n\tgetUserAvatar: (user: any) => React.ReactNode;\n\tgetUserAvatarAtMention?: (user: any) => React.ReactNode;\n\tgetChatAvatar: (chat: any, userId: number) => React.ReactNode;\n\tnotificationAvatar: (state: any) => React.ReactNode;\n\tviewerAvatar?: (state: any) => React.ReactNode;\n}\n\nexport interface ChatSettingsFormSettings {\n\tsendByEnter: boolean;\n\tunderFormLabel: string;\n\tallowPasteImages: boolean;\n\tmaxAttachmentsCount: number;\n\tmaxMessageLength: number;\n\twaveColor?: string;\n}\n\nexport interface ChatSettingsChatPageSettings {\n\tpath: string;\n\tchatIdUrlKey: string;\n\tarchive: string;\n}\n\nexport interface ErrorHandlers {\n\tonChatsLoadError?: (err: string) => void;\n\tonChatMessagesLoadError?: (err: string) => void;\n\tonSaveMessageLoadError?: (err: string) => void;\n\tonChatMessageAccessError?: (err: string) => void;\n\tchatMessagesErrorComponent?: ({ reload }) => React.ReactNode;\n}\n\nexport interface ChatSettingsProviderProps {\n\tchildren: any;\n\tstorageName?: string;\n\trequests?: ChatSettingsRequests;\n\tnotificationTypes?: ChatSettingsNotificationTypes;\n\tuserSettings?: ChatSettingsUserSettings;\n\tavatarSettings?: ChatSettingsAvatarSettings;\n\tformSettings?: ChatSettingsFormSettings;\n\tformButtons?: Array;\n\tformTags?: Array;\n\theaderButtons?: Array;\n\tmessageTypes?: Array;\n\totherComponents?: Array;\n\tpageSettings?: ChatSettingsChatPageSettings;\n\tchatFormButtonsWrappers?: ChatFormButtonsWrappers;\n\tchatStoreSettings?: ChatStoreSettings;\n\ttitle?: string;\n\twithRemoteId?: boolean;\n\tchatsFilters?: BaseParams;\n\tchatListHeaderSettings?: ChatListHeaderSettingsType;\n\trenderChatName?: ChatNameType;\n\tmessagesHeaderComponents?: ChatMessagesHeaderSettingsType;\n\tnotificationHideDelay?: number;\n\tmaxChatMessageNotificationCount?: number;\n\tmessageActions?: Array;\n\tremoveMessageConfirmation?: boolean;\n\terrorHandlers?: ErrorHandlers;\n\temptyChatListMessage?: React.ReactNode | (({ filters, load }) => React.ReactNode);\n\tbasePath?: string;\n\tmessagesLoadMoreIndicator?: React.ReactNode;\n\tplugins?: PluginsDictionary;\n\tlistComponent?: Array;\n\tmessageControl?: ChatPlugins;\n\tmessageControlWrappers?: Array;\n\tshowActionsByHover?: boolean;\n\tshowMessagesButtonInVideoModal?: boolean;\n\topenModalFromNotification?: boolean;\n\topenInModal?: boolean;\n\tonMessageDoubleClick?: (e: React.MouseEvent, message: ChatMessage, reply: (message) => void) => void;\n\tmessageAttachments?: Array;\n\tmessageAttachmentsBefore?: Array;\n\tsendButtonWrapper?: ChatPlugins;\n}\n\nexport type PluginsDictionary = {\n\t[key in ChatPlugins]?: ChatPlugin;\n};\n\nexport interface ChatSettingsProviderContextState {\n\trequests: ChatSettingsRequests;\n\tplugins: PluginsDictionary;\n\tstorageName: string;\n\tnotificationTypes: ChatSettingsNotificationTypes;\n\tformSettings: ChatSettingsFormSettings;\n\tformButtons: Array;\n\totherComponents: Array;\n\tchatFormButtonsWrappers: ChatFormButtonsWrappers;\n\tpageSettings: ChatSettingsChatPageSettings;\n\tchatStoreSettings: ChatStoreSettings;\n\ttitle: string;\n\tavatarSettings: ChatSettingsAvatarSettings;\n\tformTags: Array;\n\twithRemoteId: boolean;\n\tchatListHeaderSettings: ChatListHeaderSettingsType;\n\tmessagesHeaderComponents: ChatMessagesHeaderSettingsType;\n\tnotificationHideDelay: number;\n\tmaxChatMessageNotificationCount: number;\n\tmessageActions?: Array;\n\tchatsFilters?: BaseParams;\n\trenderChatName?: ChatNameType;\n\tremoveMessageConfirmation?: boolean;\n\terrorHandlers?: ErrorHandlers;\n\temptyChatListMessage?: React.ReactNode | (({ filters, load }) => React.ReactNode);\n\tbasePath?: string;\n\tmessagesLoadMoreIndicator?: React.ReactNode;\n\tlistComponent?: Array;\n\tmessageControl?: ChatPlugins;\n\tmessageControlWrappers?: Array;\n\tshowActionsByHover?: boolean;\n\tshowMessagesButtonInVideoModal?: boolean;\n\tmodalMode?: boolean;\n\topenModalFromNotification?: boolean;\n\tonMessageDoubleClick?: (e: React.MouseEvent, message: ChatMessage, reply: (message) => void) => void;\n\topenInModal?: boolean;\n\tmessageAttachments?: Array