{"version":3,"file":"index.Dvx5LBIK.js","sources":["../../../../../../../node_modules/@babylon/ui-kit-searchers/esm/components/others/searcher/redirecting-modal/constants.mjs","../../../../../../../node_modules/@babylon/ui-kit-searchers/esm/components/others/searcher/redirecting-modal/styled.mjs","../../../../../../../node_modules/@babylon/ui-kit-searchers/esm/components/others/searcher/redirecting-modal/index.mjs"],"sourcesContent":["const LOADING = {\n LOADING_SRC: '/contenidos/fotos/CIUDADES/',\n LOADING_ALTERNATIVE: '/comun/images/lineas/paquetes_800x600.jpg'\n};\n\nexport { LOADING };\n","import Modal from '@babylon/ui-kit-structures/components/others/modal';\nimport { FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport styled, { keyframes } from 'styled-components';\n\nconst SearcherRedirectingModalWrapper = /*#__PURE__*/ styled(Modal).withConfig({\n displayName: \"SearcherRedirectingModalWrapper\",\n componentId: \"sc-26e832fb-0\"\n})([\n `& > div{max-width:450px;}`\n]);\nconst SearcherRedirectingModalLoaderAnimation = /*#__PURE__*/ keyframes([\n `from{left:-200px;width:30%;}50%{width:30%;}70%{width:70%;}80%{left:50%;}95%{left:120%;}to{left:100%;}`\n]);\nconst SearcherRedirectingModalLoader = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"SearcherRedirectingModalLoader\",\n componentId: \"sc-26e832fb-1\"\n})([\n `background-color:rgba(39,174,96,0.2);height:4px;overflow:hidden;position:relative;width:100%;&::before{content:'';display:block;position:absolute;left:-200px;width:200px;height:4px;background-color:`,\n `;animation:`,\n ` 2s linear infinite;}`\n], ({ theme })=>theme.colors.status.success, SearcherRedirectingModalLoaderAnimation);\nconst SearcherRedirectingModalContent = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"SearcherRedirectingModalContent\",\n componentId: \"sc-26e832fb-2\"\n})([\n `padding:32px;text-align:center;`\n]);\nconst SearcherRedirectingModalTitle = /*#__PURE__*/ styled.p.withConfig({\n displayName: \"SearcherRedirectingModalTitle\",\n componentId: \"sc-26e832fb-3\"\n})([\n `margin-bottom:12px;color:`,\n `;`,\n ``\n], ({ theme })=>theme.colors.grays.darker, FontMixin({\n size: 'largest',\n height: 'larger',\n weight: 'light'\n}));\nconst SearcherRedirectingModalDescription = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"SearcherRedirectingModalDescription\",\n componentId: \"sc-26e832fb-4\"\n})([\n `margin-bottom:4px;color:`,\n `;`,\n ``\n], ({ theme })=>theme.colors.grays.darker, FontMixin({\n size: 'medium',\n height: 'medium',\n weight: 'light'\n}));\nconst SearcherRedirectingModalMessage = /*#__PURE__*/ styled.p.withConfig({\n displayName: \"SearcherRedirectingModalMessage\",\n componentId: \"sc-26e832fb-5\"\n})([\n `color:`,\n `;`,\n ``\n], ({ theme })=>theme.colors.grays.dark, FontMixin({\n size: 'medium',\n height: 'medium',\n weight: 'light'\n}));\n\nexport { SearcherRedirectingModalContent, SearcherRedirectingModalDescription, SearcherRedirectingModalLoader, SearcherRedirectingModalMessage, SearcherRedirectingModalTitle, SearcherRedirectingModalWrapper };\n","import { jsx, jsxs } from 'react/jsx-runtime';\nimport Image from '@babylon/ui-kit-base/components/multimedia/image';\nimport contextBabylon from '@babylon/ui-kit-context';\nimport { transformAccommodationValueToText } from '@babylon/ui-kit-forms/helpers/accommodation';\nimport { transformPassengersValueToText } from '@babylon/ui-kit-forms/helpers/passengers';\nimport { formatDate } from '@babylon/ui-kit-helpers/date';\nimport { useContext, useState, useEffect, useMemo } from 'react';\nimport { LOADING } from './constants.mjs';\nimport { SearcherRedirectingModalWrapper, SearcherRedirectingModalLoader, SearcherRedirectingModalContent, SearcherRedirectingModalTitle, SearcherRedirectingModalDescription, SearcherRedirectingModalMessage } from './styled.mjs';\n\nconst SearcherRedirectingModal = ({ visible = false, literals, alternative, loadingImage, origin, destination, accommodation, passengers, dates = [], months, days })=>{\n const { loadingTitle = '', titleLoaderLabel = '', loadingMessage = '', messageLoaderLabel = '' } = literals ?? {};\n const { Language } = useContext(contextBabylon);\n const [displayedStartDate, setDisplayedStartDate] = useState('');\n const [displayedEndDate, setDisplayedEndDate] = useState('');\n useEffect(()=>{\n if (dates[0] && dates[1]) {\n formatDate(dates[0] || '', 'ccc, dd LLL', Language).then(setDisplayedStartDate).catch(console.error);\n formatDate(dates[1] || '', 'ccc, dd LLL', Language).then(setDisplayedEndDate).catch(console.error);\n } else if (dates[0] && !dates[1]) {\n formatDate(dates[0] || '', 'eeee, d MMMM uuuu', Language).then(setDisplayedStartDate).catch(console.error);\n setDisplayedEndDate('');\n }\n }, [\n Language,\n dates\n ]);\n const displayedDate = useMemo(()=>{\n if (displayedStartDate && displayedEndDate) {\n return /*#__PURE__*/ jsx(\"p\", {\n children: `${displayedStartDate} → ${displayedEndDate},`\n });\n }\n if (displayedStartDate && !displayedEndDate) {\n return /*#__PURE__*/ jsx(\"p\", {\n children: displayedStartDate\n });\n }\n return null;\n }, [\n displayedEndDate,\n displayedStartDate\n ]);\n return /*#__PURE__*/ jsx(SearcherRedirectingModalWrapper, {\n \"data-testid\": \"SearcherRedirectingModal\",\n visible: visible,\n iconRight: \"\",\n content: /*#__PURE__*/ jsxs(\"div\", {\n children: [\n /*#__PURE__*/ jsx(Image, {\n src: loadingImage ?? `${LOADING.LOADING_SRC}${destination?.value ?? destination?.code}.jpg`,\n alternative: alternative ?? LOADING.LOADING_ALTERNATIVE,\n alt: loadingTitle || titleLoaderLabel,\n isLazy: false,\n width: 450,\n height: 220,\n resize: {\n width: 450,\n height: 220\n }\n }),\n /*#__PURE__*/ jsx(SearcherRedirectingModalLoader, {}),\n /*#__PURE__*/ jsxs(SearcherRedirectingModalContent, {\n children: [\n /*#__PURE__*/ jsx(SearcherRedirectingModalTitle, {\n children: loadingTitle || titleLoaderLabel\n }),\n /*#__PURE__*/ jsxs(SearcherRedirectingModalDescription, {\n children: [\n (!!origin || !!destination) && /*#__PURE__*/ jsxs(\"span\", {\n children: [\n (origin && origin?.text) ?? origin?.label ?? origin?.name,\n origin && destination && ' → ',\n destination?.text || (destination?.label ?? destination?.name)\n ]\n }),\n displayedDate,\n accommodation && /*#__PURE__*/ jsx(\"span\", {\n children: transformAccommodationValueToText(accommodation, literals)\n }),\n passengers && /*#__PURE__*/ jsx(\"span\", {\n children: transformPassengersValueToText(passengers, literals)\n }),\n months && /*#__PURE__*/ jsx(\"div\", {\n children: months.map((month)=>month.label).join(' - ')\n }),\n days && /*#__PURE__*/ jsx(\"div\", {\n children: days.map((day)=>day.label).join(', ')\n })\n ]\n }),\n /*#__PURE__*/ jsx(SearcherRedirectingModalMessage, {\n children: loadingMessage || messageLoaderLabel\n })\n ]\n })\n ]\n })\n });\n};\n\nexport { SearcherRedirectingModal as default };\n"],"names":["LOADING","SearcherRedirectingModalWrapper","styled","Modal","SearcherRedirectingModalLoaderAnimation","keyframes","SearcherRedirectingModalLoader","theme","SearcherRedirectingModalContent","SearcherRedirectingModalTitle","FontMixin","SearcherRedirectingModalDescription","SearcherRedirectingModalMessage","SearcherRedirectingModal","visible","literals","alternative","loadingImage","origin","destination","accommodation","passengers","dates","months","days","loadingTitle","titleLoaderLabel","loadingMessage","messageLoaderLabel","Language","useContext","contextBabylon","displayedStartDate","setDisplayedStartDate","useState","displayedEndDate","setDisplayedEndDate","useEffect","formatDate","displayedDate","useMemo","jsx","jsxs","Image","transformAccommodationValueToText","transformPassengersValueToText","month","day"],"mappings":"mHAAA,MAAMA,EAAU,CACZ,YAAa,8BACb,oBAAqB,2CACzB,ECCMC,EAAgDC,EAAOC,CAAK,EAAE,WAAW,CAC3E,YAAa,kCACb,YAAa,eACjB,CAAC,EAAE,CACC,2BACJ,CAAC,EACKC,EAAwDC,EAAU,CACpE,uGACJ,CAAC,EACKC,EAA+CJ,EAAO,IAAI,WAAW,CACvE,YAAa,iCACb,YAAa,eACjB,CAAC,EAAE,CACC,yMACA,cACA,uBACJ,EAAG,CAAC,CAAE,MAAAK,CAAK,IAAKA,EAAM,OAAO,OAAO,QAASH,CAAuC,EAC9EI,EAAgDN,EAAO,IAAI,WAAW,CAC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