@digitransit-component/digitransit-component-datetimepicker 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.development.js +2 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -2
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prop-types"),require("react"),require("moment-timezone"),require("lodash/debounce"),require("moment/locale/fi"),require("lodash/uniqueId"),require("i18next"),require("@digitransit-component/digitransit-component-icon"),require("react-select"),require("react-modal"),require("react-autosuggest")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","moment-timezone","lodash/debounce","moment/locale/fi","lodash/uniqueId","i18next","@digitransit-component/digitransit-component-icon","react-select","react-modal","react-autosuggest"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@digitransit-component/digitransit-component-datetimepicker"]={},e.PropTypes,e.React,e.moment,e.debounce,null,e.uniqueId,e.i18next,e.Icon,e.Select,e.ReactModal,e.Autosuggest)}(this,(function(e,t,n,i,a,l,o,r,s,d,c,u){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=_(t),m=_(n),f=_(i),y=_(a),b=_(o),g=_(r),h=_(s),x=_(d),v=_(c),w=_(u);var k={parseTypedTime:function(e){let t=e;return 3===t.length&&t.split("").every((e=>Number.isInteger(Number(e))))&&(t=Number(t.slice(0,2))<=23?`${t.slice(0,2)}:${t[2]}`:`${t[0]}:${t.slice(1)}`),t}};var E={"sr-only":"styles_sr-only__BrzYQ","dt-datetimepicker":"styles_dt-datetimepicker__PtoFG",hidden:"styles_hidden__6ySER","datetimepicker-open-container":"styles_datetimepicker-open-container__1dVr5","top-row-container":"styles_top-row-container__cXGjL",closed:"styles_closed__Fqe1r","time-icon":"styles_time-icon__ntgLZ","dropdown-icon":"styles_dropdown-icon__diYYB","close-icon":"styles_close-icon__-MzK5","label-open":"styles_label-open__Gmvov",textbutton:"styles_textbutton__T7wS2",active:"styles_active__4L82E","combobox-left":"styles_combobox-left__Sp4kh","combobox-right":"styles_combobox-right__Hg8kN","departure-or-arrival-container":"styles_departure-or-arrival-container__pJ-Iw","radio-textbutton-label":"styles_radio-textbutton-label__h-zfy","first-radio":"styles_first-radio__FWNoD","radio-textbutton":"styles_radio-textbutton__tsKET","departure-now-button":"styles_departure-now-button__VKMMK","open-button":"styles_open-button__c2B-6","close-button":"styles_close-button__2mfgI","right-edge":"styles_right-edge__29UYw","combobox-container":"styles_combobox-container__CLY9U","combobox-icon":"styles_combobox-icon__-0XPH","date-input-icon":"styles_date-input-icon__KMrj1","time-input-icon":"styles_time-input-icon__qkhC7","datetimepicker-select-container":"styles_datetimepicker-select-container__EVW1l","picker-container":"styles_picker-container__V02r4","combobox-mobile-container":"styles_combobox-mobile-container__u2DSO","mobile-modal-overlay":"styles_mobile-modal-overlay__8vF8L","mobile-modal-content":"styles_mobile-modal-content__fWRgy","top-row":"styles_top-row__h8xy1","modal-title":"styles_modal-title__EA3YD","tab-row":"styles_tab-row__orgwh","radio-tab-label":"styles_radio-tab-label__vIfup","input-row":"styles_input-row__2XXEY","input-container":"styles_input-container__USZlF","time-input-mobile":"styles_time-input-mobile__6e4A5","mobile-input-display":"styles_mobile-input-display__VUMd0","mobile-input-hidden":"styles_mobile-input-hidden__2KIuK",container:"styles_container__ihyhz",suggestion:"styles_suggestion__ZczJa",suggestionHighlighted:"styles_suggestionHighlighted__fzLiW",suggestionsContainerOpen:"styles_suggestionsContainerOpen__ISHXi",input:"styles_input__PAfbH","buttons-row":"styles_buttons-row__-3wsn","ready-button":"styles_ready-button__dH7Qc"};function C({value:e,onChange:t,getDisplay:i,timeChoices:a,validate:l,id:o,label:r,icon:s,disableTyping:d,timeZone:c,datePicker:u}){f.default.tz.setDefault(c);const[_,p]=n.useState(i(e)),[y,b]=n.useState(!1);n.useEffect((()=>p(i(e))),[e]);const g=e=>{const n=Number(e);!Number.isNaN(n)&&f.default(n).isValid()&&f.default(n).valueOf()===n&&t(n)};const h=a.map((e=>({value:e.toString(),label:i(e)}))),v=h.reduce(((t,n)=>Math.abs(e-t.value)<Math.abs(e-n.value)?t:n)),w=`${o}-input`,C=`${o}-label`;return m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:E["combobox-container"],htmlFor:w},m.default.createElement("span",{className:E["sr-only"],id:C},r," ",_),s,m.default.createElement(x.default,{"aria-labelledby":C,ariaLiveMessages:{guidance:()=>".",onChange:()=>"",onFilter:()=>"",onFocus:({context:e,label:t})=>"menu"===e?t:""},options:h,inputId:w,onChange:t=>{if(y){const t=l(_,e);null!==t?(g(t),b(!1)):(p(i(e)),b(!1))}else g(t.value)},components:{IndicatorsContainer:()=>null},className:E["datetimepicker-select-container"],classNamePrefix:"datetimepicker-select",onInputChange:(e,{action:t})=>{var n;if(!d&&(!/[a-zA-Z§ÄäÖö\s]/g.test(n=e)&&(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(n)||n.length<5))&&"input-change"===t){const t=k.parseTypedTime(e);p(t),b(!0)}},inputValue:!d&&_,value:v,filterOption:(e,t)=>!!u||(t.length<1||t.length>5||((e,t)=>{const n=t.length<=2?t:t.split(":")[0],i=/^([0-1]?[0-9]|2[0-3])$/.test(n),a=1===n.length?"0".concat(t):t;return!i||e.label.split(":")[0]===a.split(":")[0]})(e,t)),controlShouldRenderValue:d,tabSelectsValue:!1,placeholder:"",onFocus:e=>{d||e.target.select()},onBlur:()=>{if(y){const t=l(_,e);null!==t?(g(t),b(!1)):(p(i(e)),b(!1))}},onKeyDown:e=>{["ArrowDown","ArrowUp"].includes(e.key)&&b(!1)},isSearchable:!d})))}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".styles_sr-only__BrzYQ:not(:focus):not(:active) {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n\n.styles_dt-datetimepicker__PtoFG {\n border: none;\n padding: 0;\n margin: 0;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG button, .styles_dt-datetimepicker__PtoFG label {\n font-size: 1em;\n font-weight: inherit; }\n .styles_dt-datetimepicker__PtoFG label button {\n cursor: pointer;\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif; }\n .styles_dt-datetimepicker__PtoFG .styles_hidden__6ySER {\n display: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-open-container__1dVr5 {\n background-color: #f4f4f5;\n border-radius: 5px;\n padding: 15px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n display: flex;\n flex-wrap: wrap; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL.styles_closed__Fqe1r {\n margin: 11px 0 6px 18px; }\n @media screen and (max-width: 319px) {\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_time-icon__ntgLZ svg {\n width: 18px;\n height: 19px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB {\n margin-left: 9px;\n position: relative;\n top: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB svg {\n width: 14px;\n height: 10px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg {\n width: 12px;\n height: 12px;\n border-radius: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg path {\n stroke-width: 30; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label.styles_label-open__Gmvov {\n align-items: flex-start;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL button, .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n font-size: 1em;\n letter-spacing: -0.5px;\n line-height: 1; }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 9px;\n margin-top: 1px;\n background: none;\n border: none;\n color: #666666;\n padding: 0; }\n @media screen and (min-width: 768px) {\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2.styles_active__4L82E {\n color: var(--color); }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-left__Sp4kh {\n position: relative;\n margin-right: 4px;\n width: 63%; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-right__Hg8kN {\n position: relative;\n margin-left: 4px;\n width: 37%; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-or-arrival-container__pJ-Iw {\n height: calc(1rem + 20px);\n background-color: #dddddd;\n border-radius: 8px;\n display: flex;\n width: calc(5px + 13em); }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy {\n color: #333333;\n margin: 2px;\n background: none;\n border-radius: 6px;\n padding: 9px 0;\n width: 50%;\n cursor: pointer;\n height: calc(1rem + 16px);\n text-align: center;\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.03em; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_active__4L82E {\n font-weight: 500;\n background: white; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy:focus-within {\n /* First apply outline that is used in Edge and Firefox */\n outline: 1px dotted #212121;\n /* Then override outline for webkit browsers like Chrome, this has no effect on other browsers */\n outline: 5px auto -webkit-focus-ring-color;\n /* stylelint-disable-line declaration-block-no-duplicate-properties */ }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_first-radio__FWNoD {\n margin: 0;\n display: flex;\n align-items: flex-start; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-now-button__VKMMK {\n font-family: inherit;\n letter-spacing: -0.02em;\n height: calc(1rem + 18px);\n color: var(--color);\n padding: 8px 0;\n width: 6.6875rem;\n background: white;\n border: 1px solid #888888;\n border-radius: 30px;\n margin-left: 11px; }\n .styles_dt-datetimepicker__PtoFG .styles_open-button__c2B-6 {\n display: flex;\n margin-bottom: 0;\n margin-top: -1px;\n padding: 2px 0 2px 0; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI {\n transition: transform 0.2s;\n position: relative;\n top: -8px;\n right: -8px;\n border: 0;\n font-weight: normal;\n background: none;\n color: var(--color);\n padding: 0;\n line-height: normal; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI:hover {\n transform: scale(1.2); }\n .styles_dt-datetimepicker__PtoFG .styles_right-edge__29UYw {\n margin-left: auto;\n margin-right: 0;\n position: relative;\n top: -2px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-container__CLY9U {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH {\n color: var(--color);\n height: 40px;\n position: absolute;\n z-index: 7;\n pointer-events: none; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 14px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 svg {\n width: 20px;\n height: 18px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 8px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 svg {\n margin-top: 1px;\n width: 22px;\n height: 22px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l {\n position: relative;\n height: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__control {\n cursor: inherit;\n height: 40px;\n border: 1px solid #888888; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__value-container {\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__single-value {\n margin: 0 0 0 47px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input {\n background: inherit;\n position: relative;\n margin-left: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input {\n opacity: 1 !important;\n background: inherit;\n box-shadow: none;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333333;\n font-family: inherit;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input:focus {\n box-shadow: none;\n outline: none;\n border: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu {\n z-index: 19;\n padding: 0;\n background: #fff;\n max-height: 250px;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list {\n max-height: 250px;\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option {\n height: 50px;\n border-top: 1px solid #dddddd;\n padding: 13px 0 0 12px;\n letter-spacing: -0.6px;\n color: #333333; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-selected {\n background: inherit; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-focused {\n background: #dfe5e8; }\n .styles_dt-datetimepicker__PtoFG .styles_picker-container__V02r4 {\n margin: 14px 0 0 0;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-mobile-container__u2DSO {\n flex-grow: 1; }\n\n.styles_mobile-modal-overlay__8vF8L {\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 1000; }\n\n.styles_mobile-modal-content__fWRgy {\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif;\n background: white;\n width: 89%;\n position: absolute;\n left: 5.5%;\n padding: 31px 20px 33px 20px;\n top: 80px;\n border-radius: 5px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 {\n display: flex;\n justify-content: space-between;\n margin-bottom: 21px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_modal-title__EA3YD {\n font-weight: var(--font-weight-medium);\n font-size: 20px;\n line-height: 18px;\n letter-spacing: -0.5px;\n color: #333333;\n padding: 6px 0 0 8px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_departure-now-button__VKMMK {\n background-color: white;\n font-family: inherit;\n padding: 5px 15px;\n border: 1px solid #888888;\n border-radius: 50px;\n font-weight: var(--font-weight-medium);\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.02em;\n color: var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh {\n display: flex;\n border: 2px solid #dddddd;\n border-radius: 5px;\n margin-bottom: 16px;\n background-color: #dddddd; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup {\n padding: 9px 0;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.5px;\n border-radius: 3px;\n font-weight: normal;\n width: 50%;\n text-align: center;\n color: #333333; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup.styles_active__4L82E {\n font-weight: var(--font-weight-medium);\n background-color: #ffffff; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY {\n display: flex;\n margin-bottom: 25px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:first-child {\n flex-basis: 60%;\n margin-right: 10px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:nth-child(2) {\n flex-basis: 40%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF {\n border: 1px solid #888888;\n border-radius: 5px;\n display: flex;\n align-items: center;\n height: 40px;\n line-height: 1.5;\n font-size: 100%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF:focus-within {\n background: rgba(0, 122, 201, 0.06);\n border: 2px solid var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH {\n height: 18px;\n font-size: 18px;\n padding: 0 0 0 10px;\n border: none;\n position: relative;\n top: 3px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 > svg {\n height: 20px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_time-input-mobile__6e4A5 {\n font-family: inherit;\n box-shadow: none;\n font-size: 18px;\n letter-spacing: -0.5px;\n line-height: 20px;\n font-weight: var(--font-weight-medium);\n border: none;\n outline: none;\n background: none;\n width: 50px;\n margin-left: 10px;\n color: #333333;\n height: 1.5265rem; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0 {\n position: relative;\n left: 10px;\n border: none;\n background: inherit;\n box-shadow: none;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-stretch: normal;\n font-style: normal;\n font-size: 16px;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333333; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0:focus {\n outline: none;\n box-shadow: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK {\n font-size: 16px;\n margin-bottom: 12px;\n height: 0px;\n width: 0;\n background: inherit;\n color: transparent;\n outline: none;\n box-shadow: none;\n border: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK:focus {\n outline: none;\n box-shadow: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz {\n position: absolute;\n width: calc((100% - 50px) * 0.6);\n height: 25px;\n font-size: 15px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestion__ZczJa {\n list-style: none;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: 49px;\n height: 50px;\n margin: 0;\n padding: 0 0 0 16px;\n color: rgba(0, 0, 0, 0.87);\n background: white; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionHighlighted__fzLiW {\n background: #dfe5e8; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi {\n position: absolute;\n z-index: 19;\n max-height: 250px;\n overflow-x: hidden;\n overflow-y: scroll;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid;\n top: 42px;\n left: -2px;\n width: 100%;\n font-size: 16px;\n line-height: 1;\n color: rgba(0, 0, 0, 0.87); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi ul {\n padding: 0;\n margin: 0; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH {\n box-shadow: none;\n border: none;\n background: none;\n font-size: 16px;\n font-weight: var(--font-weight-medium);\n height: 25px;\n display: inline-block;\n font-family: inherit;\n line-height: 1.33;\n color: #333333;\n padding-left: 46px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH:focus {\n outline: none;\n border: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn {\n display: flex;\n flex-direction: column;\n font-size: 16px;\n font-weight: var(--font-weight-medium); }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button {\n background-color: white;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-size: 16px;\n letter-spacing: -0.02em;\n width: 100%;\n border-radius: 50px;\n height: 40px;\n color: var(--color);\n border: 1px solid #888888; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button.styles_ready-button__dH7Qc {\n color: white;\n background-color: var(--color);\n border: none;\n margin-bottom: 10px; }\n"),"production"!==process.env.NODE_ENV&&(C.propTypes={value:p.default.number.isRequired,onChange:p.default.func.isRequired,getDisplay:p.default.func.isRequired,timeChoices:p.default.arrayOf(p.default.number).isRequired,validate:p.default.func.isRequired,id:p.default.string.isRequired,label:p.default.node.isRequired,icon:p.default.node.isRequired,disableTyping:p.default.bool,timeZone:p.default.string,datePicker:p.default.bool}),C.defaultProps={disableTyping:!1,timeZone:"Europe/Helsinki",datePicker:!1};const R={de:{today:"Heute",tomorrow:"Morgen","accessible-close":"Schließe die Auswahl","accessible-closed":"Auswahl geschlossen","accessible-open":"Öffne die Auswahl","accessible-opened":"Auswahl geöffnet","accessible-title":"Datum und Uhrzeitauswahl",arrival:"Ankunft",date:"Datum",departure:"Abfahrt","departure-now":"Abfahrt jetzt","choose-time":"Zeit wählen",ready:"Fertig",time:"Zeit",cancel:"Abbrechen"},en:{today:"Today",tomorrow:"Tomorrow","accessible-close":"Close the picker","accessible-closed":"Timepicker closed","accessible-open":"Open the picker","accessible-opened":"Timepicker opened","accessible-title":"Date and timepicker","accessible-update-instructions":"Changing time parameters will trigger a new search.",arrival:"Arrival",date:"Date",departure:"Departure","departure-now":"Leaving now",time:"Time","choose-time":"Choose time",ready:"Ready",cancel:"Cancel"},fi:{today:"Tänään",tomorrow:"Huomenna","accessible-close":"Sulje valitsin","accessible-closed":"Valitsin suljettu","accessible-open":"Avaa valitsin","accessible-opened":"Valitsin avattu","accessible-title":"Aika- ja päivämäärävalitsin","accessible-update-instructions":"Aikavalintojen muuttaminen laukaisee uuden haun.",arrival:"Perillä",date:"Päivä",departure:"Lähtöaika","departure-now":"Lähtö nyt",time:"Aika","choose-time":"Valitse aika",ready:"Valmis",cancel:"Peruuta"},sv:{today:"I dag",tomorrow:"I morgon","accessible-close":"Stäng väljaren","accessible-closed":"Väljaren stängde","accessible-open":"Öppna väljaren","accessible-opened":"Väljaren öppnade","accessible-title":"Tid- och datumväljaren","accessible-update-instructions":"Om du ändrar tiderna, startas en ny sökning automatiskt.",arrival:"Anländer",date:"Datum",departure:"Avgångstid","departure-now":"Avgår nu",time:"Tid","choose-time":"Välj tid",ready:"Färdig",cancel:"Avbryt"}};const F=["ref"];function N({value:e,getDisplay:t,onChange:i,itemCount:a,startTime:l,id:o,label:r,icon:s,timeZone:d}){f.default.tz.setDefault(d);const[c,u]=n.useState(!1),_=n.useRef(null),p=Array(a).fill().map(((e,t)=>f.default(l).add(t,"day").valueOf())),y=p.map((t=>e-t)).findIndex((e=>e<6e4));n.useLayoutEffect((()=>{c&&_.current&&(_.current.scrollTop=50*y)}),[e,c]);const b=!(navigator.userAgent.toLowerCase().indexOf("android")>-1),g=`${o}-input`,h=`${o}-label`;return m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:E["input-container"],htmlFor:g},m.default.createElement("span",null,s),m.default.createElement("span",{className:E["sr-only"],id:h},r),b?m.default.createElement(m.default.Fragment,null,m.default.createElement("select",{className:E["mobile-input-display"],onChange:e=>i(Number(e.target.value)),value:e},p.map((e=>m.default.createElement("option",{key:e,value:e},t(e)))))):m.default.createElement(w.default,{id:o,suggestions:p,getSuggestionValue:e=>e.toString(),renderSuggestion:e=>t(e),onSuggestionsFetchRequested:()=>null,shouldRenderSuggestions:()=>!0,inputProps:{value:t(e),onChange:(e,{newValue:t})=>{i(Number(t))},onFocus:()=>{u(!0)},onBlur:()=>{u(!1)},"aria-labelledby":h,"aria-autocomplete":"none",readOnly:!0},focusInputOnSuggestionClick:!1,onSuggestionsClearRequested:()=>null,renderSuggestionsContainer:({containerProps:e,children:t})=>{const{ref:n}=e,i=function(e,t){if(null==e)return{};var n,i,a={},l=Object.keys(e);for(i=0;i<l.length;i++)n=l[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,F);return m.default.createElement("div",Object.assign({tabIndex:"-1"},i,{ref:e=>{e&&(_.current=e,n(e))}}),t)},theme:E})))}function P({value:e,getDisplay:t,onChange:i,id:a,label:l,icon:o,timeZone:r,validate:s}){const[d,c]=n.useState(t(e));f.default.tz.setDefault(r);const u=`${a}-input`,_=`${a}-label`,p=n.useRef(null);return n.useLayoutEffect((()=>{p.current&&p.current.focus()}),[]),m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:E["input-container"],htmlFor:u},m.default.createElement("span",null,o),m.default.createElement("span",{className:E["sr-only"],id:_},l),m.default.createElement("input",{id:u,inputMode:"numeric",type:"text",maxLength:"6",className:E["time-input-mobile"],value:d,onFocus:e=>{e.target.setSelectionRange(0,0)},onChange:t=>{let n=t.target.value;if(n.match(/[0-9]{3}:[0-9]{2}/)&&n.slice(1)===d&&(n=n.charAt(0)),n.length>5)return;const a=k.parseTypedTime(n);c(a);const l=s(a,e);l&&i(l)},ref:p})))}function S({departureOrArrival:e,onNowClick:t,lang:i,color:a,timeZone:l,onSubmit:o,onCancel:r,timestamp:s,getTimeDisplay:d,dateSelectItemCount:c,getDateDisplay:u,validateTime:_,fontWeights:p}){f.default.tz.setDefault(l);const y={lng:i},[x,w]=n.useState(s),[k,C]=n.useState(e);const[R]=n.useState(b.default("datetimepicker-")),F=f.default().startOf("day").hour(f.default(x).hour()).minute(f.default(x).minute()).valueOf();return m.default.createElement(v.default,{appElement:document?document.querySelector("#app"):void 0,isOpen:!0,className:E["mobile-modal-content"],overlayClassName:E["mobile-modal-overlay"]},m.default.createElement("div",{style:{"--color":`${a}`,"--font-weight-medium":p.medium}},m.default.createElement("div",{className:E["top-row"]},m.default.createElement("h3",{className:E["modal-title"]},g.default.t("choose-time",y)),m.default.createElement("button",{type:"button",className:E["departure-now-button"],onClick:t},g.default.t("departure-now",y))),m.default.createElement("div",{className:E["tab-row"]},m.default.createElement("label",{htmlFor:`${R}-modal-departure`,className:`${E["radio-tab-label"]}\n ${E["departure"===k?"active":void 0]}`},g.default.t("departure",y),m.default.createElement("input",{id:`${R}-modal-departure`,name:"departureOrArrival",type:"radio",value:"departure",className:E["radio-textbutton"],onChange:()=>{C("departure")},checked:"departure"===k})),m.default.createElement("label",{htmlFor:`${R}-modal-arrival`,className:`${E["radio-tab-label"]}\n ${E["arrival"===k?"active":void 0]}`},g.default.t("arrival",y),m.default.createElement("input",{id:`${R}-modal-arrival`,name:"departureOrArrival",type:"radio",value:"arrival",className:E["radio-textbutton"],onChange:()=>{C("arrival")},checked:"arrival"===k}))),m.default.createElement("div",{className:E["input-row"]},m.default.createElement(N,{value:x,getDisplay:u,onChange:function(e){w(e)},itemCount:c,startTime:F,id:`${R}-date`,label:g.default.t("date",y),icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["date-input-icon"]}`},m.default.createElement(h.default,{img:"calendar",color:a})),timeZone:l}),m.default.createElement(P,{value:x,getDisplay:d,onChange:function(e){w(e)},id:`${R}-time`,label:g.default.t("time",y),icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["time-input-icon"]}`},m.default.createElement(h.default,{img:"time",color:a})),timeZone:l,validate:_})),m.default.createElement("div",{className:E["buttons-row"]},m.default.createElement("button",{type:"button",className:E["ready-button"],onClick:()=>o(x,k)},g.default.t("ready",y)),m.default.createElement("button",{type:"button",className:E["cancel-button"],onClick:r},g.default.t("cancel",y)))))}function G({timestamp:e,onTimeChange:t,onDateChange:i,departureOrArrival:a,onNowClick:l,onDepartureClick:o,onArrivalClick:r,embedWhenClosed:s,embedWhenOpen:d,lang:c,color:u,timeZone:_,onModalSubmit:p,fontWeights:y,serviceTimeRange:x,onOpen:v,onClose:w,openPicker:k}){f.default.tz.setDefault(_);const[F,N]=n.useState(k||!1),[P,G]=n.useState(e||f.default().valueOf()),[O,q]=n.useState(null),[W]=n.useState(b.default("datetimepicker-")),[T]=n.useState(function(){const e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)}()&&function(){if("undefined"==typeof window||null===window)return!1;const e=document.createElement("input");return e.type="date","date"===e.type&&(e.type="time","time"===e.type)}()),$=n.useRef(),X=n.useRef(),A=n.useRef(),z={lng:c};n.useEffect((()=>{Object.keys(R).forEach((e=>g.default.addResourceBundle(e,"translation",R[c])))}),[]),n.useEffect((()=>{f.default.locale(c)}),[c]);const D=null===e;n.useEffect((()=>{D?G(f.default().valueOf()):(O&&(clearInterval(O),q(null)),G(e))}),[e]),n.useEffect((()=>{if(!D)return;O&&clearInterval(O);const e=setInterval((()=>{const t=f.default().valueOf();f.default(P).isSame(t,"minute")||(clearInterval(e),q(null),G(t))}),5e3);return q(e),()=>clearInterval(e)}),[P]);const Z=n.useRef();n.useEffect((()=>{Z.current=F}));const V=e=>{const t=f.default(e);let n;return n=t.isSame(f.default(),"day")?g.default.t("today",z):t.isSame(f.default().add(1,"day"),"day")?g.default.t("tomorrow",z):t.format("dd D.M."),n=`${n.charAt(0).toUpperCase()}${n.slice(1)}`,n},L=e=>f.default(e).format("HH:mm"),M=(e,t)=>{const n=e.trim();if(null!==n.match(/^[0-9]{1,2}(\.|:)[0-9]{2}$/)){const e=n.includes(".")?".":":",i=n.split(e),a=Number(i[0]),l=!Number.isNaN(a)&&a>=0&&a<=23,o=Number(i[1]);if(!(!Number.isNaN(o)&&o>=0&&o<=59)||!l)return null;return f.default(t).hours(a).minutes(o).valueOf()}return null},I=f.default(P),j=f.default(P).startOf("day").valueOf();let H=[];const Y=f.default(j);for(;Y.isSame(j,"day");)H.push(Y.valueOf()),Y.add(15,"minutes");if(null===e){const e=3e5,t=Math.ceil(P/e)*e,n=Array(7).fill().map(((n,i)=>t+i*e)),i=H.map((e=>P-e)).findIndex((e=>e<=0));H.splice(i,0,...n),H=Array.from(new Set(H))}const U=f.default().startOf("day").hour(I.hour()).minute(I.minute()).valueOf(),K=Array(x).fill().map(((e,t)=>f.default(U).add(t,"day").valueOf()));function B(){A.current&&(A.current.innerHTML=g.default.t("accessible-closed",z),setTimeout((()=>{A.current.innerHTML=null}),100))}return m.default.createElement("fieldset",{className:E["dt-datetimepicker"],id:`${W}-root`,style:{"--color":`${u}`,"--font-weight-medium":y.medium}},m.default.createElement("legend",{className:E["sr-only"]},g.default.t("accessible-title",z)),m.default.createElement("span",{className:E["sr-only"]},g.default.t("accessible-update-instructions",z)),m.default.createElement(m.default.Fragment,null,m.default.createElement("div",{className:F?`${E.hidden} datetimepicker-top-row`:`${E["top-row-container"]} ${E.closed} datetimepicker-top-row`},m.default.createElement("label",{className:E["label-open"],htmlFor:`${W}-open`},m.default.createElement("span",{className:E["time-icon"]},m.default.createElement(h.default,{img:"time",color:u})),m.default.createElement("span",{className:E["sr-only"]},g.default.t("accessible-open",z)),m.default.createElement("span",{role:"alert",className:E["sr-only"],ref:A}),m.default.createElement("button",{id:`${W}-open`,type:"button",className:`${E.textbutton} ${E.active} ${E["open-button"]}`,"aria-controls":`${W}-root`,"aria-expanded":"false",onClick:()=>{N(!0),A.current&&(A.current.innerHTML=g.default.t("accessible-opened",z),setTimeout((()=>{A.current.innerHTML=null}),100)),v&&v()},ref:$},m.default.createElement("span",null,D&&"departure"===a?g.default.t("departure-now",z):m.default.createElement(m.default.Fragment,null,g.default.t("departure"===a?"departure":"arrival",z),` ${f.default().isSame(f.default(P),"day")?"":V(P).toLowerCase()} ${L(P)}`)),m.default.createElement("span",{className:E["dropdown-icon"]},m.default.createElement(h.default,{img:"arrow-dropdown",color:u})))),m.default.createElement("span",{className:E["right-edge"]},s)),m.default.createElement("div",null)),T?F&&m.default.createElement(S,{departureOrArrival:a,onNowClick:()=>{N(!1),B(),l()},lang:c,color:u,onSubmit:(e,t)=>{p(e,t),N(!1),B()},onCancel:()=>{N(!1),B(),w&&w()},getTimeDisplay:L,timeZone:_,timestamp:P,getDateDisplay:V,dateSelectItemCount:x,getDisplay:L,validateTime:M,fontWeights:y}):m.default.createElement(m.default.Fragment,null,m.default.createElement("div",{className:`${E["datetimepicker-open-container"]} ${F?"":E.hidden}`},m.default.createElement("div",{className:F?`${E["top-row-container"]} datetimepicker-top-row`:`${E.hidden} datetimepicker-top-row`}," ",m.default.createElement("span",{role:"alert",className:E["sr-only"],ref:A}),m.default.createElement("span",null),m.default.createElement("span",{className:E["departure-or-arrival-container"]},m.default.createElement("label",{htmlFor:`${W}-departure`,className:`${E["radio-textbutton-label"]}\n ${E["departure"===a?"active":void 0]}`},g.default.t("departure",z),m.default.createElement("input",{id:`${W}-departure`,name:"departureOrArrival",type:"radio",value:"departure",className:E["radio-textbutton"],onChange:()=>{o()},checked:"departure"===a})),m.default.createElement("label",{htmlFor:`${W}-arrival`,className:`${E["radio-textbutton-label"]}\n ${E["arrival"===a?"active":void 0]}`},g.default.t("arrival",z),m.default.createElement("input",{id:`${W}-arrival`,name:"departureOrArrival",type:"radio",value:"arrival",className:E["radio-textbutton"],onChange:()=>{r()},checked:"arrival"===a}))),m.default.createElement("button",{id:`${W}-now`,type:"button",className:E["departure-now-button"],onClick:()=>{N(!1),B(),w&&w(),l()},ref:X},g.default.t("departure-now",z)),m.default.createElement("span",{className:E["right-edge"]},m.default.createElement("button",{type:"button",className:E["close-button"],"aria-controls":`${W}-root`,"aria-expanded":"true",onClick:()=>{N(!1),B(),w&&w()}},m.default.createElement("span",{className:E["close-icon"]},m.default.createElement(h.default,{img:"close",color:u})),m.default.createElement("span",{className:E["sr-only"]},g.default.t("accessible-close",z))))),m.default.createElement("div",{className:F?`${E["picker-container"]}`:`${E.hidden} datetimepicker-top-row`},m.default.createElement(m.default.Fragment,null,m.default.createElement("span",{className:E["combobox-left"]},m.default.createElement(C,{value:P,onChange:e=>{i(e)},getDisplay:V,timeChoices:K,validate:()=>null,icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["date-input-icon"]}`},m.default.createElement(h.default,{img:"calendar",color:u})),id:`${W}-date`,label:g.default.t("date",z),disableTyping:!0,timeZone:_,datePicker:!0})),m.default.createElement("span",{className:E["combobox-right"]},m.default.createElement(C,{value:P,onChange:e=>{t(e)},getDisplay:L,timeChoices:H,validate:M,icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["time-input-icon"]}`},m.default.createElement(h.default,{img:"time",color:u})),id:`${W}-time`,label:g.default.t("time",z),timeZone:_}))))),m.default.createElement("span",{className:F?"":E.hidden},d),m.default.createElement("div",{className:F?"datetimepicker-bottom-row-open":""})))}function O({realtime:e,initialArriveBy:t,initialTimestamp:i,onDepartureClick:a,onArrivalClick:l,onTimeChange:o,onDateChange:r,onNowClick:s,embedWhenClosed:d,embedWhenOpen:c,lang:u,color:_,timeZone:p,fontWeights:b,serviceTimeRange:g,onOpen:h,onClose:x,openPicker:v}){f.default.locale(u),f.default.tz.setDefault(p);const w=e?null:f.default().valueOf(),[k,E]=n.useState(i?1e3*i:w),[C,R]=n.useState(!0===t?"arrival":"departure");n.useEffect((()=>{const e=null===k&&void 0===i,n=null===k||void 0===i,a=Math.round(k/1e3)===i;!e&&(n||!a)&&E(void 0===i?null:1e3*i),!t==("arrival"===C)&&R(!0===t?"arrival":"departure")}),[i,t]);const F=y.default((e=>{if(null===e)return E(f.default().valueOf()),void o(Math.round(f.default().valueOf()/1e3),"arrival"===C);E(e),o(Math.round(e/1e3),"arrival"===C)}),10),N=y.default((e=>{if(null===e)return E(f.default().valueOf()),void r(Math.round(f.default().valueOf()/1e3),"arrival"===C);E(e),r(Math.round(e/1e3),"arrival"===C)}),10);return m.default.createElement(G,{timestamp:k,onTimeChange:F,onDateChange:N,departureOrArrival:C,onNowClick:()=>{R("departure");const t=e?null:f.default().valueOf();E(t),s(Math.round(t/1e3))},onDepartureClick:()=>{let e=!1,t=k;if(null===k){const n=f.default().valueOf();E(n),t=n,e=!0}"departure"!==C&&(R("departure"),e=!0),e&&a(Math.round(t/1e3))},onArrivalClick:()=>{let e=!1,t=k;if(null===k){const n=f.default().valueOf();E(n),t=n,e=!0}"arrival"!==C&&(R("arrival"),e=!0),e&&l(Math.round(t/1e3))},embedWhenClosed:d,embedWhenOpen:c,lang:u,color:_,timeZone:p,onModalSubmit:(e,t)=>{E(e),R(t),o(e/1e3,"arrival"===t,!0)},fontWeights:b,serviceTimeRange:g,onOpen:h,onClose:x,openPicker:v})}"production"!==process.env.NODE_ENV&&(N.propTypes={value:p.default.number.isRequired,getDisplay:p.default.func.isRequired,onChange:p.default.func.isRequired,itemCount:p.default.number.isRequired,startTime:p.default.number.isRequired,id:p.default.string.isRequired,label:p.default.string.isRequired,icon:p.default.node,dateTimeCombined:p.default.bool,timeZone:p.default.string}),N.defaultProps={icon:null,dateTimeCombined:!1,timeZone:"Europe/Helsinki"},"production"!==process.env.NODE_ENV&&(P.propTypes={value:p.default.number.isRequired,getDisplay:p.default.func.isRequired,onChange:p.default.func.isRequired,id:p.default.string.isRequired,label:p.default.string.isRequired,icon:p.default.node,timeZone:p.default.string,validate:p.default.func.isRequired}),P.defaultProps={icon:null,timeZone:"Europe/Helsinki"},f.default.locale("en"),g.default.init({lng:"en",resources:{}}),Object.keys(R).forEach((e=>g.default.addResourceBundle(e,"translation",R[e]))),"production"!==process.env.NODE_ENV&&(S.propTypes={timeZone:p.default.string,departureOrArrival:p.default.oneOf(["departure","arrival"]).isRequired,onNowClick:p.default.func.isRequired,lang:p.default.string.isRequired,color:p.default.string,onSubmit:p.default.func.isRequired,onCancel:p.default.func.isRequired,timestamp:p.default.number.isRequired,getTimeDisplay:p.default.func.isRequired,dateSelectItemCount:p.default.number.isRequired,getDateDisplay:p.default.func.isRequired,validateTime:p.default.func.isRequired,fontWeights:p.default.shape({medium:p.default.number.isRequired}).isRequired}),S.defaultProps={color:"#007ac9",timeZone:"Europe/Helsinki"},f.default.locale("en"),g.default.init({lng:"fi",fallbackLng:"fi",defaultNS:"translation",interpolation:{escapeValue:!1}}),"production"!==process.env.NODE_ENV&&(G.propTypes={timestamp:p.default.number,timeZone:p.default.string,onTimeChange:p.default.func.isRequired,onDateChange:p.default.func.isRequired,departureOrArrival:p.default.oneOf(["departure","arrival"]).isRequired,onNowClick:p.default.func.isRequired,onDepartureClick:p.default.func.isRequired,onArrivalClick:p.default.func.isRequired,embedWhenClosed:p.default.node,embedWhenOpen:p.default.node,lang:p.default.string.isRequired,color:p.default.string,onModalSubmit:p.default.func.isRequired,fontWeights:p.default.shape({medium:p.default.number.isRequired}).isRequired,serviceTimeRange:p.default.number,onOpen:p.default.func,onClose:p.default.func,openPicker:p.default.bool}),G.defaultProps={timestamp:null,embedWhenClosed:null,embedWhenOpen:null,color:"#007ac9",timeZone:"Europe/Helsinki",serviceTimeRange:30,onOpen:null,onClose:null,openPicker:void 0},"production"!==process.env.NODE_ENV&&(O.propTypes={realtime:p.default.bool,initialTimestamp:p.default.number,initialArriveBy:p.default.bool,onDepartureClick:p.default.func.isRequired,onArrivalClick:p.default.func.isRequired,onTimeChange:p.default.func.isRequired,onDateChange:p.default.func.isRequired,onNowClick:p.default.func.isRequired,embedWhenClosed:p.default.node,embedWhenOpen:p.default.node,lang:p.default.string,color:p.default.string,timeZone:p.default.string,fontWeights:p.default.shape({medium:p.default.number}),serviceTimeRange:p.default.number,onOpen:p.default.func,onClose:p.default.func,openPicker:p.default.bool}),O.defaultProps={realtime:!1,initialArriveBy:void 0,initialTimestamp:void 0,embedWhenClosed:null,embedWhenOpen:null,lang:"en",color:"#007ac9",timeZone:"Europe/Helsinki",fontWeights:{medium:500},onOpen:null,onClose:null,openPicker:void 0},e.default=O,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prop-types"),require("react"),require("moment-timezone"),require("lodash/debounce"),require("moment/locale/fi"),require("lodash/uniqueId"),require("i18next"),require("@digitransit-component/digitransit-component-icon"),require("react-select"),require("classnames"),require("react-modal"),require("react-autosuggest")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","moment-timezone","lodash/debounce","moment/locale/fi","lodash/uniqueId","i18next","@digitransit-component/digitransit-component-icon","react-select","classnames","react-modal","react-autosuggest"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@digitransit-component/digitransit-component-datetimepicker"]={},e.PropTypes,e.React,e.moment,e.debounce,null,e.uniqueId,e.i18next,e.Icon,e.Select,e.cx,e.ReactModal,e.Autosuggest)}(this,(function(e,t,n,i,l,a,o,r,s,d,u,c,p){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=_(t),f=_(n),b=_(i),y=_(l),g=_(o),h=_(r),x=_(s),v=_(d),w=_(u),k=_(c),E=_(p);function N(e){let t=e;return 3===t.length&&t.split("").every((e=>Number.isInteger(Number(e))))&&(t=Number(t.slice(0,2))<=23?`${t.slice(0,2)}:${t[2]}`:`${t[0]}:${t.slice(1)}`),t}const C=(e,t)=>{const n=!Number.isNaN(e)&&e>=0&&e<=23,i=2===t.length?!Number.isNaN(t)&&Number(t)>=0&&Number(t<=59):!Number.isNaN(t)&&Number(t)>=0&&Number(t<=5);return n&&i};function R(e){if(e.length<=2)return!1;if(3===e.length){let t,n;if(e.includes(":"))[t,n]=e.split(":");else{if(!e.startsWith("0")){const i=e.split("");return 1===Number(i[0])||2===Number(i[0])&&Number(i[1]<=3)?[t,n]=[i[0].concat(i[1]),i[2]]:[t,n]=[i[0],i[1].concat(i[2])],!C(t,n)}if(t=e.substring(0,e.length-1),n=e.substring(e.length-1||0),Number(n)>5)return!0}return!C(t,n)}if(5===e.length||4===e.length){const t=e.split(":"),n=t[0],i=t[1];return!!(e.startsWith("0")&&1===i.length&&Number(i)>5)||!C(n,i)}return!1}const F=(e,t)=>{const n=e.trim();if(null!==n.match(/^[0-9]{1,2}(\.|:)[0-9]{2}$/)){const e=n.includes(".")?".":":",i=n.split(e),l=Number(i[0]),a=!Number.isNaN(l)&&l>=0&&l<=23,o=Number(i[1]);if(!(!Number.isNaN(o)&&o>=0&&o<=59)||!a)return null;return b.default(t).hours(l).minutes(o).valueOf()}return null};var P={"sr-only":"styles_sr-only__BrzYQ","dt-datetimepicker":"styles_dt-datetimepicker__PtoFG",hidden:"styles_hidden__6ySER","datetimepicker-open-container":"styles_datetimepicker-open-container__1dVr5","top-row-container":"styles_top-row-container__cXGjL",closed:"styles_closed__Fqe1r","time-icon":"styles_time-icon__ntgLZ","dropdown-icon":"styles_dropdown-icon__diYYB","close-icon":"styles_close-icon__-MzK5","label-open":"styles_label-open__Gmvov",textbutton:"styles_textbutton__T7wS2",active:"styles_active__4L82E","combobox-left":"styles_combobox-left__Sp4kh","combobox-right":"styles_combobox-right__Hg8kN","departure-or-arrival-container":"styles_departure-or-arrival-container__pJ-Iw","radio-textbutton-label":"styles_radio-textbutton-label__h-zfy","first-radio":"styles_first-radio__FWNoD","radio-textbutton":"styles_radio-textbutton__tsKET","departure-now-button":"styles_departure-now-button__VKMMK","open-button":"styles_open-button__c2B-6","close-button":"styles_close-button__2mfgI","right-edge":"styles_right-edge__29UYw","combobox-container":"styles_combobox-container__CLY9U","combobox-icon":"styles_combobox-icon__-0XPH","date-input-icon":"styles_date-input-icon__KMrj1","time-input-icon":"styles_time-input-icon__qkhC7","datetimepicker-select-container":"styles_datetimepicker-select-container__EVW1l","picker-container":"styles_picker-container__V02r4","combobox-mobile-container":"styles_combobox-mobile-container__u2DSO","mobile-modal-overlay":"styles_mobile-modal-overlay__8vF8L","mobile-modal-content":"styles_mobile-modal-content__fWRgy","top-row":"styles_top-row__h8xy1","modal-title":"styles_modal-title__EA3YD","tab-row":"styles_tab-row__orgwh","radio-tab-label":"styles_radio-tab-label__vIfup","input-row":"styles_input-row__2XXEY","input-container":"styles_input-container__USZlF","time-input-mobile":"styles_time-input-mobile__6e4A5","mobile-input-display":"styles_mobile-input-display__VUMd0","mobile-input-hidden":"styles_mobile-input-hidden__2KIuK",container:"styles_container__ihyhz",suggestion:"styles_suggestion__ZczJa",suggestionHighlighted:"styles_suggestionHighlighted__fzLiW",suggestionsContainerOpen:"styles_suggestionsContainerOpen__ISHXi",input:"styles_input__PAfbH","buttons-row":"styles_buttons-row__-3wsn","ready-button":"styles_ready-button__dH7Qc"};function S({value:e,onChange:t,getDisplay:i,timeChoices:l,id:a,label:o,icon:r,disableTyping:s,timeZone:d,datePicker:u,translationSettings:c}){b.default.tz.setDefault(d);const[p,_]=n.useState(i(e)),[m,y]=n.useState(!1),[g,x]=n.useState(!0),[k,E]=n.useState(!1);n.useEffect((()=>{_(i(e)),u||E(!1)}),[e]);const C=e=>{const n=Number(e);!Number.isNaN(n)&&b.default(n).isValid()&&b.default(n).valueOf()===n&&t(n)};const S=l.map((e=>({value:e.toString(),label:i(e)}))),G=u?S:S.filter((e=>e.label.split(":")[1]%15==0)),O=G.length>0?null==G?void 0:G.reduce(((t,n)=>Math.abs(e-t.value)<Math.abs(e-n.value)?t:n)):void 0,W=`${a}-input`,q=`${a}-label`,X=h.default.t("invalid-input",c);return f.default.createElement("label",{className:P["combobox-container"],htmlFor:W},f.default.createElement("span",{className:P["sr-only"],id:q},o," ",p),r,f.default.createElement(v.default,{"aria-labelledby":q,ariaLiveMessages:{guidance:e=>void 0===e.isDisabled&&k?X:".",onChange:()=>"",onFilter:()=>"",onFocus:({context:e,label:t})=>"menu"===e?t:""},options:S,inputId:W,onChange:t=>{const n=b.default(e).format("HH:mm"),l=F(p,e);if(m)return null!==l?(n!==p&&t.value===e?C(l):C(t.value),y(!1)):(t.value!==e?C(t.value):_(i(e)),y(!1)),void(u||E(!1));u||E(!1),C(t.value)},components:{IndicatorsContainer:()=>null},className:w.default(P["datetimepicker-select-container"],k&&"datetimepicker-invalid-input"),classNamePrefix:"datetimepicker-select",onInputChange:(e,{action:t})=>{if("menu-close"===t?x(!0):g&&x(!1),!(s||e&&!function(e){if(e.length<(null==p?void 0:p.length)){const t=R(e);return E(t),!0}if(/[a-zA-Z§ÄäÖö.-\s]/g.test(e))return!1;const t=R(e.length>5?e.slice(0,-1):e);return E(t),e.length<=5}(e))&&"input-change"===t){const t=N(e);_(t),y(!0)}},inputValue:!s&&p,value:O,noOptionsMessage:()=>"",filterOption:(e,t)=>{var n;if(u)return!0;const i=5===t.length||4===t.length&&1===t.split(":")[0].length,l=e.label.split(":")[1]%15==0,a=1===(null===(n=t.split(":")[1])||void 0===n?void 0:n.length);if(g&&l)return!0;if(a){const n=1===t.split(":")[0].length?"0".concat(t.split(":")[0]):t.split(":")[0],i=t.split(":")[1],l=e.label.split(":")[0],a=e.label.split(":")[1];if(n===l){const e=10*Number(i),t=Number(a)-e;return t>=0&&t<=9}}return i&&!g?4===t.length?"0".concat(t)===e.label:t===e.label:!!l&&((e,t)=>{const n=t.length<=2?t:t.split(":")[0],i=/^([0-1]?[0-9]|2[0-3])$/.test(n),l=1===n.length?"0".concat(t):t;return!i||e.label.split(":")[0]===l.split(":")[0]})(e,t)},controlShouldRenderValue:s,tabSelectsValue:!1,placeholder:"",onFocus:e=>{s||e.target.select()},onBlur:()=>{if(m){const t=F(p,e);null!==t?(C(t),y(!1)):(_(i(e)),y(!1))}u||E(!1)},onKeyDown:e=>{["ArrowDown","ArrowUp"].includes(e.key)&&y(!1)},isSearchable:!s}))}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===n&&i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}(".styles_sr-only__BrzYQ:not(:focus, :active) {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n\n.styles_dt-datetimepicker__PtoFG {\n border: none;\n padding: 0;\n margin: 0;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG button,\n .styles_dt-datetimepicker__PtoFG label {\n font-size: 1em;\n font-weight: inherit; }\n .styles_dt-datetimepicker__PtoFG label button {\n cursor: pointer;\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', Roboto, Arial, Georgia, serif; }\n .styles_dt-datetimepicker__PtoFG .styles_hidden__6ySER {\n display: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-open-container__1dVr5 {\n background-color: #f4f4f5;\n border-radius: 5px;\n padding: 15px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n display: flex;\n flex-wrap: wrap; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL.styles_closed__Fqe1r {\n margin: 11px 0 6px 18px; }\n @media screen and (max-width: 319px) {\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_time-icon__ntgLZ svg {\n width: 18px;\n height: 19px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB {\n margin-left: 9px;\n position: relative;\n top: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB svg {\n width: 14px;\n height: 10px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg {\n width: 12px;\n height: 12px;\n border-radius: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg path {\n stroke-width: 30; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label.styles_label-open__Gmvov {\n align-items: flex-start;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL button,\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n font-size: 1em;\n letter-spacing: -0.5px;\n line-height: 1; }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 9px;\n margin-top: 1px;\n background: none;\n border: none;\n color: #666;\n padding: 0; }\n @media screen and (min-width: 768px) {\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2.styles_active__4L82E {\n color: var(--color); }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-left__Sp4kh {\n position: relative;\n margin-right: 4px;\n width: 63%; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-right__Hg8kN {\n position: relative;\n margin-left: 4px;\n width: 37%; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-or-arrival-container__pJ-Iw {\n height: calc(1rem + 20px);\n background-color: #ddd;\n border-radius: 8px;\n display: flex;\n width: calc(5px + 13em); }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy {\n color: #333;\n margin: 2px;\n background: none;\n border-radius: 6px;\n padding: 9px 0;\n width: 50%;\n cursor: pointer;\n height: calc(1rem + 16px);\n text-align: center;\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.03em; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_active__4L82E {\n font-weight: 500;\n background: white; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy:focus-within {\n /* First apply outline that is used in Edge and Firefox */\n outline: 1px dotted #212121;\n /* Then override outline for webkit browsers like Chrome, this has no effect on other browsers */\n outline: 5px auto -webkit-focus-ring-color;\n /* stylelint-disable-line declaration-block-no-duplicate-properties */ }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_first-radio__FWNoD {\n margin: 0;\n display: flex;\n align-items: flex-start; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-now-button__VKMMK {\n font-family: inherit;\n letter-spacing: -0.02em;\n height: calc(1rem + 18px);\n color: var(--color);\n padding: 8px 0;\n width: 6.6875rem;\n background: white;\n border: 1px solid #888;\n border-radius: 30px;\n margin-left: 11px; }\n .styles_dt-datetimepicker__PtoFG .styles_open-button__c2B-6 {\n display: flex;\n margin-bottom: 0;\n margin-top: -1px;\n padding: 2px 0 2px 0; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI {\n transition: transform 0.2s;\n position: relative;\n top: -8px;\n right: -8px;\n border: 0;\n font-weight: normal;\n background: none;\n color: var(--color);\n padding: 0;\n line-height: normal; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI:hover {\n transform: scale(1.2); }\n .styles_dt-datetimepicker__PtoFG .styles_right-edge__29UYw {\n margin-left: auto;\n margin-right: 0;\n position: relative;\n top: -2px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-container__CLY9U {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH {\n color: var(--color);\n height: 40px;\n position: absolute;\n z-index: 7;\n pointer-events: none; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 14px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 svg {\n width: 20px;\n height: 18px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 8px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 svg {\n margin-top: 1px;\n width: 22px;\n height: 22px; }\n .styles_dt-datetimepicker__PtoFG .datetimepicker-invalid-input input {\n color: #f00 !important; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l {\n position: relative;\n height: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__control {\n cursor: inherit;\n height: 40px;\n border: 1px solid #888; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__value-container {\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__single-value {\n margin: 0 0 0 47px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input {\n background: inherit;\n position: relative;\n margin-left: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input {\n opacity: 1 !important;\n background: inherit;\n box-shadow: none;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333;\n font-family: inherit;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input:focus {\n box-shadow: none;\n outline: none;\n border: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu {\n z-index: 19;\n padding: 0;\n background: #fff;\n max-height: 250px;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list {\n max-height: 250px;\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option {\n height: 50px;\n border-top: 1px solid #ddd;\n padding: 13px 0 0 12px;\n letter-spacing: -0.6px;\n color: #333; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-selected {\n background: inherit; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-focused {\n background: #dfe5e8; }\n .styles_dt-datetimepicker__PtoFG .styles_picker-container__V02r4 {\n margin: 14px 0 0 0;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-mobile-container__u2DSO {\n flex-grow: 1; }\n\n.styles_mobile-modal-overlay__8vF8L {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 1000; }\n\n.styles_mobile-modal-content__fWRgy {\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', Roboto, Arial, Georgia, serif;\n background: white;\n width: 89%;\n position: absolute;\n left: 5.5%;\n padding: 31px 20px 33px 20px;\n top: 80px;\n border-radius: 5px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 {\n display: flex;\n justify-content: space-between;\n margin-bottom: 21px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_modal-title__EA3YD {\n font-weight: var(--font-weight-medium);\n font-size: 20px;\n line-height: 18px;\n letter-spacing: -0.5px;\n color: #333;\n padding: 6px 0 0 8px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_departure-now-button__VKMMK {\n background-color: white;\n font-family: inherit;\n padding: 5px 15px;\n border: 1px solid #888;\n border-radius: 50px;\n font-weight: var(--font-weight-medium);\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.02em;\n color: var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh {\n display: flex;\n border: 2px solid #ddd;\n border-radius: 5px;\n margin-bottom: 16px;\n background-color: #ddd; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup {\n padding: 9px 0;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.5px;\n border-radius: 3px;\n font-weight: normal;\n width: 50%;\n text-align: center;\n color: #333; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup.styles_active__4L82E {\n font-weight: var(--font-weight-medium);\n background-color: #fff; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY {\n display: flex;\n margin-bottom: 25px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:first-child {\n flex-basis: 60%;\n margin-right: 10px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:nth-child(2) {\n flex-basis: 40%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF {\n border: 1px solid #888;\n border-radius: 5px;\n display: flex;\n align-items: center;\n height: 40px;\n line-height: 1.5;\n font-size: 100%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF:focus-within {\n background: rgba(0, 122, 201, 0.06);\n border: 2px solid var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH {\n height: 18px;\n font-size: 18px;\n padding: 0 0 0 10px;\n border: none;\n position: relative;\n top: 3px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 > svg {\n height: 20px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .mobile-datetimepicker-invalid-input {\n color: #f00 !important; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_time-input-mobile__6e4A5 {\n font-family: inherit;\n box-shadow: none;\n font-size: 18px;\n letter-spacing: -0.5px;\n line-height: 20px;\n font-weight: var(--font-weight-medium);\n border: none;\n outline: none;\n background: none;\n width: 50px;\n margin-left: 10px;\n color: #333;\n height: 1.5265rem; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0 {\n position: relative;\n left: 10px;\n border: none;\n background: inherit;\n box-shadow: none;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-stretch: normal;\n font-style: normal;\n font-size: 16px;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0:focus {\n outline: none;\n box-shadow: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK {\n font-size: 16px;\n margin-bottom: 12px;\n height: 0;\n width: 0;\n background: inherit;\n color: transparent;\n outline: none;\n box-shadow: none;\n border: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK:focus {\n outline: none;\n box-shadow: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz {\n position: absolute;\n width: calc((100% - 50px) * 0.6);\n height: 25px;\n font-size: 15px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestion__ZczJa {\n list-style: none;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: 49px;\n height: 50px;\n margin: 0;\n padding: 0 0 0 16px;\n color: rgba(0, 0, 0, 0.87);\n background: white; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionHighlighted__fzLiW {\n background: #dfe5e8; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi {\n position: absolute;\n z-index: 19;\n max-height: 250px;\n overflow-x: hidden;\n overflow-y: scroll;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid;\n top: 42px;\n left: -2px;\n width: 100%;\n font-size: 16px;\n line-height: 1;\n color: rgba(0, 0, 0, 0.87); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi ul {\n padding: 0;\n margin: 0; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH {\n box-shadow: none;\n border: none;\n background: none;\n font-size: 16px;\n font-weight: var(--font-weight-medium);\n height: 25px;\n display: inline-block;\n font-family: inherit;\n line-height: 1.33;\n padding-left: 46px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH:focus {\n outline: none;\n border: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn {\n display: flex;\n flex-direction: column;\n font-size: 16px;\n font-weight: var(--font-weight-medium); }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button {\n background-color: white;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-size: 16px;\n letter-spacing: -0.02em;\n width: 100%;\n border-radius: 50px;\n height: 40px;\n color: var(--color);\n border: 1px solid #888; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button.styles_ready-button__dH7Qc {\n color: white;\n background-color: var(--color);\n border: none;\n margin-bottom: 10px; }\n"),"production"!==process.env.NODE_ENV&&(S.propTypes={value:m.default.number.isRequired,onChange:m.default.func.isRequired,getDisplay:m.default.func.isRequired,timeChoices:m.default.arrayOf(m.default.number).isRequired,id:m.default.string.isRequired,label:m.default.node.isRequired,icon:m.default.node.isRequired,disableTyping:m.default.bool,timeZone:m.default.string,datePicker:m.default.bool,translationSettings:m.default.shape({lng:m.default.string.isRequired})}),S.defaultProps={disableTyping:!1,timeZone:"Europe/Helsinki",datePicker:!1,translationSettings:{lng:"fi"}};const G={de:{today:"Heute",tomorrow:"Morgen","accessible-close":"Schließe die Auswahl","accessible-closed":"Auswahl geschlossen","accessible-open":"Öffne die Auswahl","accessible-opened":"Auswahl geöffnet","accessible-title":"Datum und Uhrzeitauswahl",arrival:"Ankunft",date:"Datum",departure:"Abfahrt","departure-now":"Abfahrt jetzt","choose-time":"Zeit wählen",ready:"Fertig",time:"Zeit",cancel:"Abbrechen"},en:{today:"Today",tomorrow:"Tomorrow","accessible-close":"Close the picker","accessible-closed":"Timepicker closed","accessible-open":"Open the picker","accessible-opened":"Timepicker opened","accessible-title":"Date and timepicker","accessible-update-instructions":"Changing time parameters will trigger a new search.",arrival:"Arrival",date:"Date",departure:"Departure","departure-now":"Leaving now",time:"Time","choose-time":"Choose time",ready:"Ready",cancel:"Cancel","invalid-input":"The time you entered is invalid"},fi:{today:"Tänään",tomorrow:"Huomenna","accessible-close":"Sulje valitsin","accessible-closed":"Valitsin suljettu","accessible-open":"Avaa valitsin","accessible-opened":"Valitsin avattu","accessible-title":"Aika- ja päivämäärävalitsin","accessible-update-instructions":"Aikavalintojen muuttaminen laukaisee uuden haun.",arrival:"Perillä",date:"Päivä",departure:"Lähtöaika","departure-now":"Lähtö nyt",time:"Aika","choose-time":"Valitse aika",ready:"Valmis",cancel:"Peruuta","invalid-input":"Syöttämäsi aika on virheellinen"},sv:{today:"I dag",tomorrow:"I morgon","accessible-close":"Stäng väljaren","accessible-closed":"Väljaren stängde","accessible-open":"Öppna väljaren","accessible-opened":"Väljaren öppnade","accessible-title":"Tid- och datumväljaren","accessible-update-instructions":"Om du ändrar tiderna, startas en ny sökning automatiskt.",arrival:"Anländer",date:"Datum",departure:"Avgångstid","departure-now":"Avgår nu",time:"Tid","choose-time":"Välj tid",ready:"Färdig",cancel:"Avbryt","invalid-input":"Tiden du angav är felaktig"}};function O(){const e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)}const W=["ref"];function q({value:e,getDisplay:t,onChange:i,itemCount:l,startTime:a,id:o,label:r,icon:s,timeZone:d}){b.default.tz.setDefault(d);const[u,c]=n.useState(!1),p=n.useRef(null),_=Array(l).fill().map(((e,t)=>b.default(a).add(t,"day").valueOf())),m=_.map((t=>e-t)).findIndex((e=>e<6e4));n.useLayoutEffect((()=>{u&&p.current&&(p.current.scrollTop=50*m)}),[e,u]);const y=!(navigator.userAgent.toLowerCase().indexOf("android")>-1),g=`${o}-input`,h=`${o}-label`;return f.default.createElement("label",{className:P["input-container"],htmlFor:g},f.default.createElement("span",null,s),f.default.createElement("span",{className:P["sr-only"],id:h},r),y?f.default.createElement("select",{className:P["mobile-input-display"],onChange:e=>i(Number(e.target.value)),value:e},_.map((e=>f.default.createElement("option",{key:e,value:e},t(e))))):f.default.createElement(E.default,{id:o,suggestions:_,getSuggestionValue:e=>e.toString(),renderSuggestion:e=>t(e),onSuggestionsFetchRequested:()=>null,shouldRenderSuggestions:()=>!0,inputProps:{value:t(e),onChange:(e,{newValue:t})=>{i(Number(t))},onFocus:()=>{c(!0)},onBlur:()=>{c(!1)},"aria-labelledby":h,"aria-autocomplete":"none",readOnly:!0},focusInputOnSuggestionClick:!1,onSuggestionsClearRequested:()=>null,renderSuggestionsContainer:({containerProps:e,children:t})=>{const{ref:n}=e,i=function(e,t){if(null==e)return{};var n,i,l={},a=Object.keys(e);for(i=0;i<a.length;i++)n=a[i],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,W);return f.default.createElement("div",Object.assign({tabIndex:"-1"},i,{ref:e=>{e&&(p.current=e,n(e))}}),t)},theme:P}))}function X({value:e,getDisplay:t,onChange:i,id:l,label:a,icon:o,timeZone:r}){const[s,d]=n.useState(t(e)),[u,c]=n.useState(!1);b.default.tz.setDefault(r);const p=`${l}-input`,_=`${l}-label`,m=n.useRef(null);return n.useLayoutEffect((()=>{m.current&&m.current.focus()}),[]),f.default.createElement("label",{className:P["input-container"],htmlFor:p},f.default.createElement("span",null,o),f.default.createElement("span",{className:P["sr-only"],id:_},a),f.default.createElement("input",{id:p,inputMode:"numeric",type:"text",maxLength:"6",className:w.default(P["time-input-mobile"],u&&"mobile-datetimepicker-invalid-input"),value:s,onFocus:e=>{e.target.setSelectionRange(0,0)},onChange:t=>{let n=t.target.value;const l=R(n);if(c(l),n.match(/[0-9]{3}:[0-9]{2}/)&&n.slice(1)===s&&(n=n.charAt(0)),n.length>5)return;const a=N(n);d(a);const o=F(a,e);o&&i(o)},ref:m}))}function $({departureOrArrival:e,onNowClick:t,lang:i,color:l,timeZone:a,onSubmit:o,onCancel:r,timestamp:s,getTimeDisplay:d,dateSelectItemCount:u,getDateDisplay:c,fontWeights:p}){b.default.tz.setDefault(a);const _={lng:i},[m,y]=n.useState(s),[v,w]=n.useState(e);const[E]=n.useState(g.default("datetimepicker-")),N=b.default().startOf("day").hour(b.default(m).hour()).minute(b.default(m).minute()).valueOf();return f.default.createElement(k.default,{appElement:document?document.querySelector("#app"):void 0,isOpen:!0,className:P["mobile-modal-content"],overlayClassName:P["mobile-modal-overlay"]},f.default.createElement("div",{style:{"--color":`${l}`,"--font-weight-medium":p.medium}},f.default.createElement("div",{className:P["top-row"]},f.default.createElement("h3",{className:P["modal-title"]},h.default.t("choose-time",_)),f.default.createElement("button",{type:"button",className:P["departure-now-button"],onClick:t},h.default.t("departure-now",_))),f.default.createElement("div",{className:P["tab-row"]},f.default.createElement("label",{htmlFor:`${E}-modal-departure`,className:`${P["radio-tab-label"]}\n ${P["departure"===v?"active":void 0]}`},h.default.t("departure",_),f.default.createElement("input",{id:`${E}-modal-departure`,name:"departureOrArrival",type:"radio",value:"departure",className:P["radio-textbutton"],onChange:()=>{w("departure")},checked:"departure"===v})),f.default.createElement("label",{htmlFor:`${E}-modal-arrival`,className:`${P["radio-tab-label"]}\n ${P["arrival"===v?"active":void 0]}`},h.default.t("arrival",_),f.default.createElement("input",{id:`${E}-modal-arrival`,name:"departureOrArrival",type:"radio",value:"arrival",className:P["radio-textbutton"],onChange:()=>{w("arrival")},checked:"arrival"===v}))),f.default.createElement("div",{className:P["input-row"]},f.default.createElement(q,{value:m,getDisplay:c,onChange:y,itemCount:u,startTime:N,id:`${E}-date`,label:h.default.t("date",_),icon:f.default.createElement("span",{className:`${P["combobox-icon"]} ${P["date-input-icon"]}`},f.default.createElement(x.default,{img:"calendar",color:l})),timeZone:a}),f.default.createElement(X,{value:m,getDisplay:d,onChange:y,id:`${E}-time`,label:h.default.t("time",_),icon:f.default.createElement("span",{className:`${P["combobox-icon"]} ${P["time-input-icon"]}`},f.default.createElement(x.default,{img:"time",color:l})),timeZone:a})),f.default.createElement("div",{className:P["buttons-row"]},f.default.createElement("button",{type:"button",className:P["ready-button"],onClick:()=>o(m,v)},h.default.t("ready",_)),f.default.createElement("button",{type:"button",className:P["cancel-button"],onClick:r},h.default.t("cancel",_)))))}function T({timestamp:e,onTimeChange:t,onDateChange:i,departureOrArrival:l,onNowClick:a,onDepartureClick:o,onArrivalClick:r,embedWhenClosed:s,embedWhenOpen:d,lang:u,color:c,timeZone:p,onModalSubmit:_,fontWeights:m,serviceTimeRange:y,onOpen:v,onClose:w,openPicker:k}){b.default.tz.setDefault(p);const[E,N]=n.useState(k||!1),[C,R]=n.useState(e||b.default().valueOf()),[F,W]=n.useState(null),[q]=n.useState(g.default("datetimepicker-")),[X]=n.useState(O()&&function(){if("undefined"==typeof window||null===window)return!1;const e=document.createElement("input");return e.type="date","date"===e.type&&(e.type="time","time"===e.type)}()),T=n.useRef(),A=n.useRef(),D=n.useRef(),z={lng:u};n.useEffect((()=>{Object.keys(G).forEach((e=>h.default.addResourceBundle(e,"translation",G[u])))}),[]),n.useEffect((()=>{b.default.locale(u)}),[u]);const Z=null===e;n.useEffect((()=>{Z?R(b.default().valueOf()):(F&&(clearInterval(F),W(null)),R(e))}),[e]),n.useEffect((()=>{if(!Z)return;F&&clearInterval(F);const e=setInterval((()=>{const t=b.default().valueOf();b.default(C).isSame(t,"minute")||(clearInterval(e),W(null),R(t))}),5e3);return W(e),()=>clearInterval(e)}),[C]);const V=n.useRef();n.useEffect((()=>{V.current=E}));const M=e=>{const t=b.default(e);let n;return n=t.isSame(b.default(),"day")?h.default.t("today",z):t.isSame(b.default().add(1,"day"),"day")?h.default.t("tomorrow",z):t.format("dd D.M."),n=`${n.charAt(0).toUpperCase()}${n.slice(1)}`,n},L=e=>b.default(e).format("HH:mm"),H=b.default(C),I=b.default(C).startOf("day").valueOf();let j=[];const Y=b.default(I);for(;Y.isSame(I,"day");)j.push(Y.valueOf()),O()?Y.add(15,"minutes"):Y.add(1,"minutes");if(null===e){const e=3e5,t=Math.ceil(C/e)*e,n=Array(7).fill().map(((n,i)=>t+i*e)),i=j.map((e=>C-e)).findIndex((e=>e<=0));j.splice(i,0,...n),j=Array.from(new Set(j))}const U=b.default().startOf("day").hour(H.hour()).minute(H.minute()).valueOf(),K=Array(y).fill().map(((e,t)=>b.default(U).add(t,"day").valueOf()));function B(){D.current&&(D.current.innerHTML=h.default.t("accessible-closed",z),setTimeout((()=>{D.current.innerHTML=null}),100))}return f.default.createElement("fieldset",{className:P["dt-datetimepicker"],id:`${q}-root`,style:{"--color":`${c}`,"--font-weight-medium":m.medium}},f.default.createElement("legend",{className:P["sr-only"]},h.default.t("accessible-title",z)),f.default.createElement("span",{className:P["sr-only"]},h.default.t("accessible-update-instructions",z)),f.default.createElement("div",{className:E?`${P.hidden} datetimepicker-top-row`:`${P["top-row-container"]} ${P.closed} datetimepicker-top-row`},f.default.createElement("label",{className:P["label-open"],htmlFor:`${q}-open`},f.default.createElement("span",{className:P["time-icon"]},f.default.createElement(x.default,{img:"time",color:c})),f.default.createElement("span",{className:P["sr-only"]},h.default.t("accessible-open",z)),f.default.createElement("span",{role:"alert",className:P["sr-only"],ref:D}),f.default.createElement("button",{id:`${q}-open`,type:"button",className:`${P.textbutton} ${P.active} ${P["open-button"]}`,"aria-controls":`${q}-root`,"aria-expanded":"false",onClick:()=>{N(!0),D.current&&(D.current.innerHTML=h.default.t("accessible-opened",z),setTimeout((()=>{D.current.innerHTML=null}),100)),v&&v()},ref:T},f.default.createElement("span",null,Z&&"departure"===l?h.default.t("departure-now",z):f.default.createElement(f.default.Fragment,null,h.default.t("departure"===l?"departure":"arrival",z),` ${b.default().isSame(b.default(C),"day")?"":M(C).toLowerCase()} ${L(C)}`)),f.default.createElement("span",{className:P["dropdown-icon"]},f.default.createElement(x.default,{img:"arrow-dropdown",color:c})))),f.default.createElement("span",{className:P["right-edge"]},s)),f.default.createElement("div",null),X?E&&f.default.createElement($,{departureOrArrival:l,onNowClick:()=>{N(!1),B(),a()},lang:u,color:c,onSubmit:(e,t)=>{_(e,t),N(!1),B()},onCancel:()=>{N(!1),B(),w&&w()},getTimeDisplay:L,timeZone:p,timestamp:C,getDateDisplay:M,dateSelectItemCount:y,getDisplay:L,fontWeights:m}):f.default.createElement(f.default.Fragment,null,f.default.createElement("div",{className:`${P["datetimepicker-open-container"]} ${E?"":P.hidden}`},f.default.createElement("div",{className:E?`${P["top-row-container"]} datetimepicker-top-row`:`${P.hidden} datetimepicker-top-row`}," ",f.default.createElement("span",{role:"alert",className:P["sr-only"],ref:D}),f.default.createElement("span",null),f.default.createElement("span",{className:P["departure-or-arrival-container"]},f.default.createElement("label",{htmlFor:`${q}-departure`,className:`${P["radio-textbutton-label"]}\n ${P["departure"===l?"active":void 0]}`},h.default.t("departure",z),f.default.createElement("input",{id:`${q}-departure`,name:"departureOrArrival",type:"radio",value:"departure",className:P["radio-textbutton"],onChange:()=>{o()},checked:"departure"===l})),f.default.createElement("label",{htmlFor:`${q}-arrival`,className:`${P["radio-textbutton-label"]}\n ${P["arrival"===l?"active":void 0]}`},h.default.t("arrival",z),f.default.createElement("input",{id:`${q}-arrival`,name:"departureOrArrival",type:"radio",value:"arrival",className:P["radio-textbutton"],onChange:()=>{r()},checked:"arrival"===l}))),f.default.createElement("button",{id:`${q}-now`,type:"button",className:P["departure-now-button"],onClick:()=>{N(!1),B(),w&&w(),a()},ref:A},h.default.t("departure-now",z)),f.default.createElement("span",{className:P["right-edge"]},f.default.createElement("button",{type:"button",className:P["close-button"],"aria-controls":`${q}-root`,"aria-expanded":"true",onClick:()=>{N(!1),B(),w&&w()}},f.default.createElement("span",{className:P["close-icon"]},f.default.createElement(x.default,{img:"close",color:c})),f.default.createElement("span",{className:P["sr-only"]},h.default.t("accessible-close",z))))),f.default.createElement("div",{className:E?`${P["picker-container"]}`:`${P.hidden} datetimepicker-top-row`},f.default.createElement("span",{className:P["combobox-left"]},f.default.createElement(S,{value:C,onChange:e=>{i(e)},getDisplay:M,timeChoices:K,validate:()=>null,icon:f.default.createElement("span",{className:`${P["combobox-icon"]} ${P["date-input-icon"]}`},f.default.createElement(x.default,{img:"calendar",color:c})),id:`${q}-date`,label:h.default.t("date",z),disableTyping:!0,timeZone:p,datePicker:!0})),f.default.createElement("span",{className:P["combobox-right"]},f.default.createElement(S,{value:C,onChange:e=>{t(e)},getDisplay:L,timeChoices:j,icon:f.default.createElement("span",{className:`${P["combobox-icon"]} ${P["time-input-icon"]}`},f.default.createElement(x.default,{img:"time",color:c})),id:`${q}-time`,label:h.default.t("time",z),timeZone:p,translationSettings:z})))),f.default.createElement("span",{className:E?"":P.hidden},d),f.default.createElement("div",{className:E?"datetimepicker-bottom-row-open":""})))}function A({realtime:e,initialArriveBy:t,initialTimestamp:i,onDepartureClick:l,onArrivalClick:a,onTimeChange:o,onDateChange:r,onNowClick:s,embedWhenClosed:d,embedWhenOpen:u,lang:c,color:p,timeZone:_,fontWeights:m,serviceTimeRange:g,onOpen:h,onClose:x,openPicker:v}){b.default.locale(c),b.default.tz.setDefault(_);const w=e?null:b.default().valueOf(),[k,E]=n.useState(i?1e3*i:w),[N,C]=n.useState(!0===t?"arrival":"departure");n.useEffect((()=>{const e=null===k&&void 0===i,n=null===k||void 0===i,l=Math.round(k/1e3)===i;!e&&(n||!l)&&E(void 0===i?null:1e3*i),!t==("arrival"===N)&&C(!0===t?"arrival":"departure")}),[i,t]);const R=y.default((e=>{if(null===e)return E(b.default().valueOf()),void o(Math.round(b.default().valueOf()/1e3),"arrival"===N);E(e),o(Math.round(e/1e3),"arrival"===N)}),10),F=y.default((e=>{if(null===e)return E(b.default().valueOf()),void r(Math.round(b.default().valueOf()/1e3),"arrival"===N);E(e),r(Math.round(e/1e3),"arrival"===N)}),10);return f.default.createElement(T,{timestamp:k,onTimeChange:R,onDateChange:F,departureOrArrival:N,onNowClick:()=>{C("departure");const t=e?null:b.default().valueOf();E(t),s(Math.round(t/1e3))},onDepartureClick:()=>{let e=!1,t=k;if(null===k){const n=b.default().valueOf();E(n),t=n,e=!0}"departure"!==N&&(C("departure"),e=!0),e&&l(Math.round(t/1e3))},onArrivalClick:()=>{let e=!1,t=k;if(null===k){const n=b.default().valueOf();E(n),t=n,e=!0}"arrival"!==N&&(C("arrival"),e=!0),e&&a(Math.round(t/1e3))},embedWhenClosed:d,embedWhenOpen:u,lang:c,color:p,timeZone:_,onModalSubmit:(e,t)=>{E(e),C(t),o(e/1e3,"arrival"===t,!0)},fontWeights:m,serviceTimeRange:g,onOpen:h,onClose:x,openPicker:v})}"production"!==process.env.NODE_ENV&&(q.propTypes={value:m.default.number.isRequired,getDisplay:m.default.func.isRequired,onChange:m.default.func.isRequired,itemCount:m.default.number.isRequired,startTime:m.default.number.isRequired,id:m.default.string.isRequired,label:m.default.string.isRequired,icon:m.default.node,dateTimeCombined:m.default.bool,timeZone:m.default.string}),q.defaultProps={icon:null,dateTimeCombined:!1,timeZone:"Europe/Helsinki"},"production"!==process.env.NODE_ENV&&(X.propTypes={value:m.default.number.isRequired,getDisplay:m.default.func.isRequired,onChange:m.default.func.isRequired,id:m.default.string.isRequired,label:m.default.string.isRequired,icon:m.default.node,timeZone:m.default.string}),X.defaultProps={icon:null,timeZone:"Europe/Helsinki"},b.default.locale("en"),h.default.init({lng:"en",resources:{}}),Object.keys(G).forEach((e=>h.default.addResourceBundle(e,"translation",G[e]))),"production"!==process.env.NODE_ENV&&($.propTypes={timeZone:m.default.string,departureOrArrival:m.default.oneOf(["departure","arrival"]).isRequired,onNowClick:m.default.func.isRequired,lang:m.default.string.isRequired,color:m.default.string,onSubmit:m.default.func.isRequired,onCancel:m.default.func.isRequired,timestamp:m.default.number.isRequired,getTimeDisplay:m.default.func.isRequired,dateSelectItemCount:m.default.number.isRequired,getDateDisplay:m.default.func.isRequired,fontWeights:m.default.shape({medium:m.default.number.isRequired}).isRequired}),$.defaultProps={color:"#007ac9",timeZone:"Europe/Helsinki"},b.default.locale("en"),h.default.init({lng:"fi",fallbackLng:"fi",defaultNS:"translation",interpolation:{escapeValue:!1}}),"production"!==process.env.NODE_ENV&&(T.propTypes={timestamp:m.default.number,timeZone:m.default.string,onTimeChange:m.default.func.isRequired,onDateChange:m.default.func.isRequired,departureOrArrival:m.default.oneOf(["departure","arrival"]).isRequired,onNowClick:m.default.func.isRequired,onDepartureClick:m.default.func.isRequired,onArrivalClick:m.default.func.isRequired,embedWhenClosed:m.default.node,embedWhenOpen:m.default.node,lang:m.default.string.isRequired,color:m.default.string,onModalSubmit:m.default.func.isRequired,fontWeights:m.default.shape({medium:m.default.number.isRequired}).isRequired,serviceTimeRange:m.default.number,onOpen:m.default.func,onClose:m.default.func,openPicker:m.default.bool}),T.defaultProps={timestamp:null,embedWhenClosed:null,embedWhenOpen:null,color:"#007ac9",timeZone:"Europe/Helsinki",serviceTimeRange:30,onOpen:null,onClose:null,openPicker:void 0},"production"!==process.env.NODE_ENV&&(A.propTypes={realtime:m.default.bool,initialTimestamp:m.default.number,initialArriveBy:m.default.bool,onDepartureClick:m.default.func.isRequired,onArrivalClick:m.default.func.isRequired,onTimeChange:m.default.func.isRequired,onDateChange:m.default.func.isRequired,onNowClick:m.default.func.isRequired,embedWhenClosed:m.default.node,embedWhenOpen:m.default.node,lang:m.default.string,color:m.default.string,timeZone:m.default.string,fontWeights:m.default.shape({medium:m.default.number}),serviceTimeRange:m.default.number,onOpen:m.default.func,onClose:m.default.func,openPicker:m.default.bool}),A.defaultProps={realtime:!1,initialArriveBy:void 0,initialTimestamp:void 0,embedWhenClosed:null,embedWhenOpen:null,lang:"en",color:"#007ac9",timeZone:"Europe/Helsinki",fontWeights:{medium:500},onOpen:null,onClose:null,openPicker:void 0},e.default=A,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|