@mirai/core 0.3.41 → 0.3.42
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/build/Core.js +34 -12
- package/build/Core.js.map +1 -1
- package/build/components/Environment/Environment.js +3 -2
- package/build/components/Environment/Environment.js.map +1 -1
- package/build/components/Finder/Finder.l10n.js +6 -3
- package/build/components/Finder/Finder.l10n.js.map +1 -1
- package/build/components/Session/Session.l10n.js +2 -1
- package/build/components/Session/Session.l10n.js.map +1 -1
- package/build/components/__shared__/BookingDates/BookingDates.l10n.js +4 -2
- package/build/components/__shared__/BookingDates/BookingDates.l10n.js.map +1 -1
- package/build/components/__shared__/FieldOccupation/FieldOccupation.l10n.js +2 -1
- package/build/components/__shared__/FieldOccupation/FieldOccupation.l10n.js.map +1 -1
- package/build/components/__shared__/FieldOccupation/helpers/getOccupationCaption.js +2 -1
- package/build/components/__shared__/FieldOccupation/helpers/getOccupationCaption.js.map +1 -1
- package/build/components/__shared__/FieldPromocode/FieldPromocode.l10n.js +2 -1
- package/build/components/__shared__/FieldPromocode/FieldPromocode.l10n.js.map +1 -1
- package/build/components/__shared__/Occupation/Occupation.l10n.js +4 -2
- package/build/components/__shared__/Occupation/Occupation.l10n.js.map +1 -1
- package/build/index.js +4 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/Core.js
CHANGED
|
@@ -18,45 +18,66 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
const ghosts = {};
|
|
21
|
+
const EVENT_INTENT_LOCALE = 'intentLocale';
|
|
21
22
|
const Core = _ref => {
|
|
22
23
|
let {
|
|
23
24
|
children,
|
|
24
|
-
components = []
|
|
25
|
+
components = [],
|
|
26
|
+
skeleton
|
|
25
27
|
} = _ref;
|
|
26
28
|
const {
|
|
27
29
|
isMobile,
|
|
28
30
|
isDesktop
|
|
29
31
|
} = (0, _ui.useDevice)();
|
|
30
32
|
const {
|
|
33
|
+
set,
|
|
31
34
|
value: {
|
|
32
35
|
currency,
|
|
33
36
|
locale = _locale.DEFAULT_LOCALE
|
|
34
37
|
}
|
|
35
38
|
} = (0, _dataSources.useStore)();
|
|
36
|
-
const [dictionary, setDictionary] = (0, _react.useState)(_services.ServiceDictionary.cache(
|
|
39
|
+
const [dictionary, setDictionary] = (0, _react.useState)(!skeleton ? _services.ServiceDictionary.cache(locale) : undefined);
|
|
37
40
|
(0, _react.useEffect)(() => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const handleIntentLocale = async _ref2 => {
|
|
42
|
+
let {
|
|
43
|
+
locale
|
|
44
|
+
} = _ref2;
|
|
45
|
+
const dictionary = await fetchDictionary(locale);
|
|
46
|
+
if (dictionary) set({
|
|
47
|
+
locale
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
_dataSources.Event.subscribe(EVENT_INTENT_LOCALE, handleIntentLocale);
|
|
51
|
+
return () => _dataSources.Event.unsubscribe(EVENT_INTENT_LOCALE, handleIntentLocale);
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
}, []);
|
|
54
|
+
(0, _react.useEffect)(() => {
|
|
55
|
+
if (!skeleton) fetchDictionary(locale);
|
|
56
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
57
|
}, [locale]);
|
|
58
|
+
const fetchDictionary = async locale => {
|
|
59
|
+
const cached = _services.ServiceDictionary.cache(locale);
|
|
60
|
+
if (cached) setDictionary(cached);
|
|
61
|
+
const next = await _services.ServiceDictionary.get(locale);
|
|
62
|
+
if (next) setDictionary(next);
|
|
63
|
+
return next;
|
|
64
|
+
};
|
|
44
65
|
return /*#__PURE__*/_react.default.createElement(_locale.LocaleProvider, {
|
|
45
66
|
currency,
|
|
46
67
|
dictionary,
|
|
47
68
|
locale
|
|
48
|
-
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Core.Notifications, null), components.filter(
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Core.Notifications, null), components.filter(_ref3 => {
|
|
49
70
|
let {
|
|
50
71
|
desktop,
|
|
51
72
|
mobile
|
|
52
|
-
} =
|
|
73
|
+
} = _ref3;
|
|
53
74
|
return !(isMobile && mobile === 'false') && !(isDesktop && desktop === 'false');
|
|
54
|
-
}).map((
|
|
75
|
+
}).map((_ref4, index) => {
|
|
55
76
|
let {
|
|
56
77
|
el,
|
|
57
78
|
component,
|
|
58
79
|
...props
|
|
59
|
-
} =
|
|
80
|
+
} = _ref4;
|
|
60
81
|
if (!ghosts[index]) ghosts[index] = (0, _helpers.getGhost)(el);
|
|
61
82
|
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_components.COMPONENTS[component], {
|
|
62
83
|
...props,
|
|
@@ -72,6 +93,7 @@ Core.propTypes = {
|
|
|
72
93
|
components: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
73
94
|
component: _propTypes.default.oneOf(Object.keys(_components.COMPONENTS)),
|
|
74
95
|
el: _propTypes.default.any
|
|
75
|
-
}))
|
|
96
|
+
})),
|
|
97
|
+
skeleton: _propTypes.default.bool
|
|
76
98
|
};
|
|
77
99
|
//# sourceMappingURL=Core.js.map
|
package/build/Core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Core.js","names":["_dataSources","require","_locale","_services","_ui","_propTypes","_interopRequireDefault","_react","_interopRequireWildcard","_reactDom","_components","_Core","_helpers","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","ghosts","Core","_ref","children","components","isMobile","isDesktop","useDevice","value","currency","locale","DEFAULT_LOCALE","useStore","dictionary","setDictionary","useState","ServiceDictionary","cache","useEffect","next","createElement","LocaleProvider","Fragment","Notifications","filter","
|
|
1
|
+
{"version":3,"file":"Core.js","names":["_dataSources","require","_locale","_services","_ui","_propTypes","_interopRequireDefault","_react","_interopRequireWildcard","_reactDom","_components","_Core","_helpers","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","ghosts","EVENT_INTENT_LOCALE","Core","_ref","children","components","skeleton","isMobile","isDesktop","useDevice","value","currency","locale","DEFAULT_LOCALE","useStore","dictionary","setDictionary","useState","ServiceDictionary","cache","undefined","useEffect","handleIntentLocale","_ref2","fetchDictionary","Event","subscribe","unsubscribe","cached","next","createElement","LocaleProvider","Fragment","Notifications","filter","_ref3","desktop","mobile","map","_ref4","index","el","component","props","getGhost","ReactDOM","createPortal","React","COMPONENTS","process","env","NODE_ENV","ghost","exports","propTypes","PropTypes","node","arrayOf","shape","oneOf","keys","any","bool"],"sources":["../src/Core.jsx"],"sourcesContent":["import { Event, useStore } from '@mirai/data-sources';\nimport { DEFAULT_LOCALE, LocaleProvider } from '@mirai/locale';\nimport { ServiceDictionary } from '@mirai/services';\nimport { useDevice } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { COMPONENTS } from './components';\nimport { Notifications } from './Core.Notifications';\nimport { getGhost } from './helpers';\n\nconst ghosts = {};\n\nconst EVENT_INTENT_LOCALE = 'intentLocale';\n\nconst Core = ({ children, components = [], skeleton }) => {\n const { isMobile, isDesktop } = useDevice();\n const {\n set,\n value: { currency, locale = DEFAULT_LOCALE },\n } = useStore();\n\n const [dictionary, setDictionary] = useState(!skeleton ? ServiceDictionary.cache(locale) : undefined);\n\n useEffect(() => {\n const handleIntentLocale = async ({ locale }) => {\n const dictionary = await fetchDictionary(locale);\n if (dictionary) set({ locale });\n };\n\n Event.subscribe(EVENT_INTENT_LOCALE, handleIntentLocale);\n return () => Event.unsubscribe(EVENT_INTENT_LOCALE, handleIntentLocale);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n if (!skeleton) fetchDictionary(locale);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [locale]);\n\n const fetchDictionary = async (locale) => {\n const cached = ServiceDictionary.cache(locale);\n if (cached) setDictionary(cached);\n\n const next = await ServiceDictionary.get(locale);\n if (next) setDictionary(next);\n\n return next;\n };\n\n return (\n <LocaleProvider {...{ currency, dictionary, locale }}>\n <>\n <Notifications />\n\n {components\n .filter(({ desktop, mobile }) => !(isMobile && mobile === 'false') && !(isDesktop && desktop === 'false'))\n .map(({ el, component, ...props }, index) => {\n if (!ghosts[index]) ghosts[index] = getGhost(el);\n\n return ReactDOM.createPortal(\n React.createElement(COMPONENTS[component], {\n ...props,\n ['data-testid']: process.env.NODE_ENV === 'production' ? component : undefined,\n ghost: ghosts[index],\n el,\n }),\n el,\n );\n })}\n </>\n {children}\n </LocaleProvider>\n );\n};\n\nCore.propTypes = {\n children: PropTypes.node,\n components: PropTypes.arrayOf(\n PropTypes.shape({\n component: PropTypes.oneOf(Object.keys(COMPONENTS)),\n el: PropTypes.any,\n }),\n ),\n skeleton: PropTypes.bool,\n};\n\nexport { Core };\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,I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ACwC,KAAK,CAAC,GAAG,IAAAI,iBAAQ,EAACH,EAAE,CAAC;IAEhD,oBAAOI,iBAAQ,CAACC,YAAY,eAC1BC,cAAK,CAACjB,aAAa,CAACkB,sBAAU,CAACN,SAAS,CAAC,EAAE;MACzC,GAAGC,KAAK;MACR,CAAC,aAAa,GAAGM,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAAGT,SAAS,GAAGtB,SAAS;MAC9EgC,KAAK,EAAEpD,MAAM,CAACwC,KAAK,CAAC;MACpBC;IACF,CAAC,CAAC,EACFA,EACF,CAAC;EACH,CAAC,CACH,CAAC,EACFrC,QACa,CAAC;AAErB,CAAC;AAACiD,OAAA,CAAAnD,IAAA,GAAAA,IAAA;AAEFA,IAAI,CAACoD,SAAS,GAAG;EACflD,QAAQ,EAAEmD,kBAAS,CAACC,IAAI;EACxBnD,UAAU,EAAEkD,kBAAS,CAACE,OAAO,CAC3BF,kBAAS,CAACG,KAAK,CAAC;IACdhB,SAAS,EAAEa,kBAAS,CAACI,KAAK,CAACrE,MAAM,CAACsE,IAAI,CAACZ,sBAAU,CAAC,CAAC;IACnDP,EAAE,EAAEc,kBAAS,CAACM;EAChB,CAAC,CACH,CAAC;EACDvD,QAAQ,EAAEiD,kBAAS,CAACO;AACtB,CAAC"}
|
|
@@ -15,6 +15,7 @@ var _Environment2 = require("./Environment.State");
|
|
|
15
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
const EVENT_INTENT_LOCALE = 'intentLocale';
|
|
18
19
|
const Environment = _ref => {
|
|
19
20
|
let {
|
|
20
21
|
currencies: showCurrencies = false,
|
|
@@ -28,13 +29,13 @@ const Environment = _ref => {
|
|
|
28
29
|
locale
|
|
29
30
|
}
|
|
30
31
|
} = (0, _dataSources.useStore)();
|
|
31
|
-
return showLocale || showCurrencies ? /*#__PURE__*/_react.default.createElement(_ui.View, {
|
|
32
|
+
return showLocale || showCurrencies || showState ? /*#__PURE__*/_react.default.createElement(_ui.View, {
|
|
32
33
|
row: true
|
|
33
34
|
}, showLocale && /*#__PURE__*/_react.default.createElement(_ui.Select, {
|
|
34
35
|
name: "locale",
|
|
35
36
|
options: _Environment.LOCALES,
|
|
36
37
|
value: locale,
|
|
37
|
-
onChange: value =>
|
|
38
|
+
onChange: value => _dataSources.Event.publish(EVENT_INTENT_LOCALE, {
|
|
38
39
|
locale: value
|
|
39
40
|
}),
|
|
40
41
|
className: style.container
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.js","names":["_dataSources","require","_locale","_ui","_propTypes","_interopRequireDefault","_react","_Environment","style","_interopRequireWildcard","_Environment2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","Environment","_ref","currencies","showCurrencies","locale","showLocale","state","showState","value","currency","useStore","createElement","View","row","Select","name","options","LOCALES","onChange","className","container","CURRENCIES","State","exports","propTypes","PropTypes","bool"],"sources":["../../../src/components/Environment/Environment.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { CURRENCIES } from '@mirai/locale';\nimport { Select, View } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { LOCALES } from './Environment.constants';\nimport * as style from './Environment.module.css';\nimport { State } from './Environment.State';\n\nexport const Environment = ({\n currencies: showCurrencies = false,\n locale: showLocale = true,\n state: showState = true,\n}) => {\n const {\n set,\n value: { currency, locale },\n } = useStore();\n\n return showLocale || showCurrencies ? (\n <View row>\n {showLocale && (\n <Select\n name=\"locale\"\n options={LOCALES}\n value={locale}\n onChange={(value) =>
|
|
1
|
+
{"version":3,"file":"Environment.js","names":["_dataSources","require","_locale","_ui","_propTypes","_interopRequireDefault","_react","_Environment","style","_interopRequireWildcard","_Environment2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","EVENT_INTENT_LOCALE","Environment","_ref","currencies","showCurrencies","locale","showLocale","state","showState","value","currency","useStore","createElement","View","row","Select","name","options","LOCALES","onChange","Event","publish","className","container","CURRENCIES","State","exports","propTypes","PropTypes","bool"],"sources":["../../../src/components/Environment/Environment.jsx"],"sourcesContent":["import { Event, useStore } from '@mirai/data-sources';\nimport { CURRENCIES } from '@mirai/locale';\nimport { Select, View } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { LOCALES } from './Environment.constants';\nimport * as style from './Environment.module.css';\nimport { State } from './Environment.State';\n\nconst EVENT_INTENT_LOCALE = 'intentLocale';\n\nexport const Environment = ({\n currencies: showCurrencies = false,\n locale: showLocale = true,\n state: showState = true,\n}) => {\n const {\n set,\n value: { currency, locale },\n } = useStore();\n\n return showLocale || showCurrencies || showState ? (\n <View row>\n {showLocale && (\n <Select\n name=\"locale\"\n options={LOCALES}\n value={locale}\n onChange={(value) => Event.publish(EVENT_INTENT_LOCALE, { locale: value })}\n className={style.container}\n />\n )}\n {showCurrencies && (\n <Select\n name=\"currency\"\n options={CURRENCIES}\n value={currency}\n onChange={(value) => set({ currency: value })}\n className={style.container}\n />\n )}\n {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AA,CAAAW,OAAA,CAAA4B,aAAA,CAAC1C,GAAA,CAAA6C,MAAM;IACLC,IAAI,EAAC,UAAU;IACfC,OAAO,EAAEO,kBAAW;IACpBf,KAAK,EAAEC,QAAS;IAChBS,QAAQ,EAAGV,KAAK,IAAKX,GAAG,CAAC;MAAEY,QAAQ,EAAED;IAAM,CAAC,CAAE;IAC9Ca,SAAS,EAAE/C,KAAK,CAACgD;EAAU,CAC5B,CACF,EACAf,SAAS,iBAAInC,MAAA,CAAAW,OAAA,CAAA4B,aAAA,CAACnC,aAAA,CAAAgD,KAAK,MAAE,CAClB,CAAC,GACL,IAAI;AACV,CAAC;AAACC,OAAA,CAAAzB,WAAA,GAAAA,WAAA;AAEFA,WAAW,CAAC0B,SAAS,GAAG;EACtBxB,UAAU,EAAEyB,kBAAS,CAACC,IAAI;EAC1BxB,MAAM,EAAEuB,kBAAS,CAACC,IAAI;EACtBtB,KAAK,EAAEqB,kBAAS,CAACC;AACnB,CAAC"}
|
|
@@ -6,13 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.L10N = void 0;
|
|
7
7
|
const L10N = exports.L10N = {
|
|
8
8
|
ACTION_BOOK: {
|
|
9
|
-
id: 'finder.place.cta'
|
|
9
|
+
id: 'finder.place.cta',
|
|
10
|
+
defaultMessage: 'Book'
|
|
10
11
|
},
|
|
11
12
|
LABEL_WHEN: {
|
|
12
|
-
id: 'finder.label.when'
|
|
13
|
+
id: 'finder.label.when',
|
|
14
|
+
defaultMessage: 'When'
|
|
13
15
|
},
|
|
14
16
|
LABEL_WHERE: {
|
|
15
|
-
id: 'finder.label.where'
|
|
17
|
+
id: 'finder.label.where',
|
|
18
|
+
defaultMessage: 'Where'
|
|
16
19
|
},
|
|
17
20
|
LABEL_WHERE_PLACEHOLDER: {
|
|
18
21
|
id: 'Dropdown.placeholder'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Finder.l10n.js","names":["L10N","exports","ACTION_BOOK","id","LABEL_WHEN","LABEL_WHERE","LABEL_WHERE_PLACEHOLDER"],"sources":["../../../src/components/Finder/Finder.l10n.js"],"sourcesContent":["export const L10N = {\n ACTION_BOOK: { id: 'finder.place.cta' },\n\n LABEL_WHEN: { id: 'finder.label.when' },\n LABEL_WHERE: { id: 'finder.label.where' },\n LABEL_WHERE_PLACEHOLDER: { id: 'Dropdown.placeholder' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,WAAW,EAAE;IAAEC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"Finder.l10n.js","names":["L10N","exports","ACTION_BOOK","id","defaultMessage","LABEL_WHEN","LABEL_WHERE","LABEL_WHERE_PLACEHOLDER"],"sources":["../../../src/components/Finder/Finder.l10n.js"],"sourcesContent":["export const L10N = {\n ACTION_BOOK: { id: 'finder.place.cta', defaultMessage: 'Book' },\n\n LABEL_WHEN: { id: 'finder.label.when', defaultMessage: 'When' },\n LABEL_WHERE: { id: 'finder.label.where', defaultMessage: 'Where' },\n LABEL_WHERE_PLACEHOLDER: { id: 'Dropdown.placeholder' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,WAAW,EAAE;IAAEC,EAAE,EAAE,kBAAkB;IAAEC,cAAc,EAAE;EAAO,CAAC;EAE/DC,UAAU,EAAE;IAAEF,EAAE,EAAE,mBAAmB;IAAEC,cAAc,EAAE;EAAO,CAAC;EAC/DE,WAAW,EAAE;IAAEH,EAAE,EAAE,oBAAoB;IAAEC,cAAc,EAAE;EAAQ,CAAC;EAClEG,uBAAuB,EAAE;IAAEJ,EAAE,EAAE;EAAuB;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Session.l10n.js","names":["L10N","exports","ACTION_ACCOUNT","id","ACTION_MODAL","ACTION_BACK","ACTION_BOOKINGS","ACTION_CHANGE_PASSWORD","ACTION_PROFILE","ACTION_RESET","ACTION_SIGNUP","CTA","CTA_RESET","CTA_LOGOUT","FORM_DESCRIPTION","FORM_RESET_DESCRIPTION","EMAIL_LABEL","LEVEL","PASSWORD_LABEL","TITLE","TITLE_RESET","TITLE_WELCOME","NOTIFICATION_ERROR","NOTIFICATION_FINISH_SIGNUP_TITLE","NOTIFICATION_FINISH_SIGNUP_DESCRIPTION","NOTIFICATION_FINISH_SIGNUP_ERROR","NOTIFICATION_SUCCESS_RESET"],"sources":["../../../src/components/Session/Session.l10n.js"],"sourcesContent":["export const L10N = {\n ACTION_ACCOUNT: { id: 'user.action.my_account' },\n ACTION_MODAL: { id: 'common.action.login' },\n ACTION_BACK: { id: 'user.action.back_login' },\n ACTION_BOOKINGS: { id: 'user.action.view_bookings' },\n ACTION_CHANGE_PASSWORD: { id: 'user.action.change_login_password' },\n ACTION_PROFILE: { id: 'user.action.view_profile' },\n ACTION_RESET: { id: 'user.action.reset' },\n ACTION_SIGNUP: { id: 'user.action.signup' },\n CTA: { id: 'common.action.login' },\n CTA_RESET: { id: 'user.action.cta_reset' },\n CTA_LOGOUT: { id: 'common.action.logout' },\n FORM_DESCRIPTION: { id: 'user.label.form_description' },\n FORM_RESET_DESCRIPTION: { id: 'user.label.form_reset_description' },\n EMAIL_LABEL: { id: 'common.label.email' },\n LEVEL: { id: 'user.label.level' },\n PASSWORD_LABEL: { id: 'common.label.password' },\n TITLE: { id: 'user.label.title_session' },\n TITLE_RESET: { id: 'user.action.reset' },\n TITLE_WELCOME: { id: 'user.label.title_welcome' },\n NOTIFICATION_ERROR: { id: 'common.notification.error_unknown' },\n NOTIFICATION_FINISH_SIGNUP_TITLE: { id: 'user.notification.activation_success' },\n NOTIFICATION_FINISH_SIGNUP_DESCRIPTION: { id: 'user.notification.finish_signup_description' },\n NOTIFICATION_FINISH_SIGNUP_ERROR: { id: 'user.notification.validation_error' },\n NOTIFICATION_SUCCESS_RESET: { id: 'user.notification.success_reset' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,cAAc,EAAE;IAAEC,EAAE,EAAE;EAAyB,CAAC;EAChDC,YAAY,EAAE;IAAED,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"Session.l10n.js","names":["L10N","exports","ACTION_ACCOUNT","id","ACTION_MODAL","defaultMessage","ACTION_BACK","ACTION_BOOKINGS","ACTION_CHANGE_PASSWORD","ACTION_PROFILE","ACTION_RESET","ACTION_SIGNUP","CTA","CTA_RESET","CTA_LOGOUT","FORM_DESCRIPTION","FORM_RESET_DESCRIPTION","EMAIL_LABEL","LEVEL","PASSWORD_LABEL","TITLE","TITLE_RESET","TITLE_WELCOME","NOTIFICATION_ERROR","NOTIFICATION_FINISH_SIGNUP_TITLE","NOTIFICATION_FINISH_SIGNUP_DESCRIPTION","NOTIFICATION_FINISH_SIGNUP_ERROR","NOTIFICATION_SUCCESS_RESET"],"sources":["../../../src/components/Session/Session.l10n.js"],"sourcesContent":["export const L10N = {\n ACTION_ACCOUNT: { id: 'user.action.my_account' },\n ACTION_MODAL: { id: 'common.action.login', defaultMessage: 'Log in' },\n ACTION_BACK: { id: 'user.action.back_login' },\n ACTION_BOOKINGS: { id: 'user.action.view_bookings' },\n ACTION_CHANGE_PASSWORD: { id: 'user.action.change_login_password' },\n ACTION_PROFILE: { id: 'user.action.view_profile' },\n ACTION_RESET: { id: 'user.action.reset' },\n ACTION_SIGNUP: { id: 'user.action.signup' },\n CTA: { id: 'common.action.login' },\n CTA_RESET: { id: 'user.action.cta_reset' },\n CTA_LOGOUT: { id: 'common.action.logout' },\n FORM_DESCRIPTION: { id: 'user.label.form_description' },\n FORM_RESET_DESCRIPTION: { id: 'user.label.form_reset_description' },\n EMAIL_LABEL: { id: 'common.label.email' },\n LEVEL: { id: 'user.label.level' },\n PASSWORD_LABEL: { id: 'common.label.password' },\n TITLE: { id: 'user.label.title_session' },\n TITLE_RESET: { id: 'user.action.reset' },\n TITLE_WELCOME: { id: 'user.label.title_welcome' },\n NOTIFICATION_ERROR: { id: 'common.notification.error_unknown' },\n NOTIFICATION_FINISH_SIGNUP_TITLE: { id: 'user.notification.activation_success' },\n NOTIFICATION_FINISH_SIGNUP_DESCRIPTION: { id: 'user.notification.finish_signup_description' },\n NOTIFICATION_FINISH_SIGNUP_ERROR: { id: 'user.notification.validation_error' },\n NOTIFICATION_SUCCESS_RESET: { id: 'user.notification.success_reset' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,cAAc,EAAE;IAAEC,EAAE,EAAE;EAAyB,CAAC;EAChDC,YAAY,EAAE;IAAED,EAAE,EAAE,qBAAqB;IAAEE,cAAc,EAAE;EAAS,CAAC;EACrEC,WAAW,EAAE;IAAEH,EAAE,EAAE;EAAyB,CAAC;EAC7CI,eAAe,EAAE;IAAEJ,EAAE,EAAE;EAA4B,CAAC;EACpDK,sBAAsB,EAAE;IAAEL,EAAE,EAAE;EAAoC,CAAC;EACnEM,cAAc,EAAE;IAAEN,EAAE,EAAE;EAA2B,CAAC;EAClDO,YAAY,EAAE;IAAEP,EAAE,EAAE;EAAoB,CAAC;EACzCQ,aAAa,EAAE;IAAER,EAAE,EAAE;EAAqB,CAAC;EAC3CS,GAAG,EAAE;IAAET,EAAE,EAAE;EAAsB,CAAC;EAClCU,SAAS,EAAE;IAAEV,EAAE,EAAE;EAAwB,CAAC;EAC1CW,UAAU,EAAE;IAAEX,EAAE,EAAE;EAAuB,CAAC;EAC1CY,gBAAgB,EAAE;IAAEZ,EAAE,EAAE;EAA8B,CAAC;EACvDa,sBAAsB,EAAE;IAAEb,EAAE,EAAE;EAAoC,CAAC;EACnEc,WAAW,EAAE;IAAEd,EAAE,EAAE;EAAqB,CAAC;EACzCe,KAAK,EAAE;IAAEf,EAAE,EAAE;EAAmB,CAAC;EACjCgB,cAAc,EAAE;IAAEhB,EAAE,EAAE;EAAwB,CAAC;EAC/CiB,KAAK,EAAE;IAAEjB,EAAE,EAAE;EAA2B,CAAC;EACzCkB,WAAW,EAAE;IAAElB,EAAE,EAAE;EAAoB,CAAC;EACxCmB,aAAa,EAAE;IAAEnB,EAAE,EAAE;EAA2B,CAAC;EACjDoB,kBAAkB,EAAE;IAAEpB,EAAE,EAAE;EAAoC,CAAC;EAC/DqB,gCAAgC,EAAE;IAAErB,EAAE,EAAE;EAAuC,CAAC;EAChFsB,sCAAsC,EAAE;IAAEtB,EAAE,EAAE;EAA8C,CAAC;EAC7FuB,gCAAgC,EAAE;IAAEvB,EAAE,EAAE;EAAqC,CAAC;EAC9EwB,0BAA0B,EAAE;IAAExB,EAAE,EAAE;EAAkC;AACtE,CAAC"}
|
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.L10N = void 0;
|
|
7
7
|
const L10N = exports.L10N = {
|
|
8
8
|
LABEL_CHECK_IN: {
|
|
9
|
-
id: 'common.label.check_in'
|
|
9
|
+
id: 'common.label.check_in',
|
|
10
|
+
defaultMessage: 'Check-in'
|
|
10
11
|
},
|
|
11
12
|
LABEL_CHECK_OUT: {
|
|
12
|
-
id: 'common.label.check_out'
|
|
13
|
+
id: 'common.label.check_out',
|
|
14
|
+
defaultMessage: 'Check-out'
|
|
13
15
|
},
|
|
14
16
|
LABEL_NIGHTS: {
|
|
15
17
|
id: 'finder.label.nights_stay'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingDates.l10n.js","names":["L10N","exports","LABEL_CHECK_IN","id","LABEL_CHECK_OUT","LABEL_NIGHTS","LABEL_MIN_NIGHTS","LABEL_MIN_NIGHTS_DEALS","LABEL_MIN_NIGHTS_REQUIRED"],"sources":["../../../../src/components/__shared__/BookingDates/BookingDates.l10n.js"],"sourcesContent":["export const L10N = {\n LABEL_CHECK_IN: { id: 'common.label.check_in' },\n LABEL_CHECK_OUT: { id: 'common.label.check_out' },\n LABEL_NIGHTS: { id: 'finder.label.nights_stay' },\n LABEL_MIN_NIGHTS: { id: 'finder.label.min_nights' },\n LABEL_MIN_NIGHTS_DEALS: { id: 'finder.label.min_nights_deals' },\n LABEL_MIN_NIGHTS_REQUIRED: { id: 'finder.label.min_nights_required' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,cAAc,EAAE;IAAEC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"BookingDates.l10n.js","names":["L10N","exports","LABEL_CHECK_IN","id","defaultMessage","LABEL_CHECK_OUT","LABEL_NIGHTS","LABEL_MIN_NIGHTS","LABEL_MIN_NIGHTS_DEALS","LABEL_MIN_NIGHTS_REQUIRED"],"sources":["../../../../src/components/__shared__/BookingDates/BookingDates.l10n.js"],"sourcesContent":["export const L10N = {\n LABEL_CHECK_IN: { id: 'common.label.check_in', defaultMessage: 'Check-in' },\n LABEL_CHECK_OUT: { id: 'common.label.check_out', defaultMessage: 'Check-out' },\n LABEL_NIGHTS: { id: 'finder.label.nights_stay' },\n LABEL_MIN_NIGHTS: { id: 'finder.label.min_nights' },\n LABEL_MIN_NIGHTS_DEALS: { id: 'finder.label.min_nights_deals' },\n LABEL_MIN_NIGHTS_REQUIRED: { id: 'finder.label.min_nights_required' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,cAAc,EAAE;IAAEC,EAAE,EAAE,uBAAuB;IAAEC,cAAc,EAAE;EAAW,CAAC;EAC3EC,eAAe,EAAE;IAAEF,EAAE,EAAE,wBAAwB;IAAEC,cAAc,EAAE;EAAY,CAAC;EAC9EE,YAAY,EAAE;IAAEH,EAAE,EAAE;EAA2B,CAAC;EAChDI,gBAAgB,EAAE;IAAEJ,EAAE,EAAE;EAA0B,CAAC;EACnDK,sBAAsB,EAAE;IAAEL,EAAE,EAAE;EAAgC,CAAC;EAC/DM,yBAAyB,EAAE;IAAEN,EAAE,EAAE;EAAmC;AACtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldOccupation.l10n.js","names":["L10N","exports","LABEL_WHO","id"],"sources":["../../../../src/components/__shared__/FieldOccupation/FieldOccupation.l10n.js"],"sourcesContent":["export const L10N = {\n LABEL_WHO: { id: 'finder.label.who' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,SAAS,EAAE;IAAEC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"FieldOccupation.l10n.js","names":["L10N","exports","LABEL_WHO","id","defaultMessage"],"sources":["../../../../src/components/__shared__/FieldOccupation/FieldOccupation.l10n.js"],"sourcesContent":["export const L10N = {\n LABEL_WHO: { id: 'finder.label.who', defaultMessage: 'Who' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,SAAS,EAAE;IAAEC,EAAE,EAAE,kBAAkB;IAAEC,cAAc,EAAE;EAAM;AAC7D,CAAC"}
|
|
@@ -36,7 +36,8 @@ const getOccupationCaption = function () {
|
|
|
36
36
|
guests += getCount(room, GUEST);
|
|
37
37
|
});
|
|
38
38
|
const captionRooms = translate({
|
|
39
|
-
id: "".concat(_Occupation2.L10N.LABEL_PLACE_TYPE.id, ".").concat(_Occupation.PLACE[type])
|
|
39
|
+
id: "".concat(_Occupation2.L10N.LABEL_PLACE_TYPE.id, ".").concat(_Occupation.PLACE[type]),
|
|
40
|
+
defaultMessage: '{rooms, plural, =1 {1 room} other {# rooms}}'
|
|
40
41
|
}, {
|
|
41
42
|
rooms: rooms.length
|
|
42
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOccupationCaption.js","names":["_helpers","require","_Occupation","_Occupation2","ADULT","CHILD","GUEST","TYPE","getOccupationCaption","rooms","arguments","length","undefined","translate","translateHelper","type","ACCOMMODATION_TYPE","ROOM","getCount","room","filterType","filter","reduce","previous","amount","adults","children","guests","forEach","captionRooms","id","concat","L10N","LABEL_PLACE_TYPE","PLACE","captionAdults","LABEL_OCCUPATION_TYPE","captionChildren","exports"],"sources":["../../../../../src/components/__shared__/FieldOccupation/helpers/getOccupationCaption.js"],"sourcesContent":["import { translate as translateHelper } from '../../../helpers';\nimport { ACCOMMODATION_TYPE, PLACE, TYPE } from '../../Occupation/Occupation.constants';\nimport { L10N } from '../../Occupation/Occupation.l10n';\n\nconst { ADULT, CHILD, GUEST } = TYPE;\n\nexport const getOccupationCaption = (rooms = [], translate = translateHelper, type = ACCOMMODATION_TYPE.ROOM) => {\n const getCount = (room, filterType) =>\n room.filter(({ type } = {}) => type === filterType).reduce((previous, { amount = 0 } = {}) => previous + amount, 0);\n\n let adults = 0;\n let children = 0;\n let guests = 0;\n\n rooms.forEach((room) => {\n adults += getCount(room, ADULT);\n children += getCount(room, CHILD);\n guests += getCount(room, GUEST);\n });\n\n const captionRooms = translate({
|
|
1
|
+
{"version":3,"file":"getOccupationCaption.js","names":["_helpers","require","_Occupation","_Occupation2","ADULT","CHILD","GUEST","TYPE","getOccupationCaption","rooms","arguments","length","undefined","translate","translateHelper","type","ACCOMMODATION_TYPE","ROOM","getCount","room","filterType","filter","reduce","previous","amount","adults","children","guests","forEach","captionRooms","id","concat","L10N","LABEL_PLACE_TYPE","PLACE","defaultMessage","captionAdults","LABEL_OCCUPATION_TYPE","captionChildren","exports"],"sources":["../../../../../src/components/__shared__/FieldOccupation/helpers/getOccupationCaption.js"],"sourcesContent":["import { translate as translateHelper } from '../../../helpers';\nimport { ACCOMMODATION_TYPE, PLACE, TYPE } from '../../Occupation/Occupation.constants';\nimport { L10N } from '../../Occupation/Occupation.l10n';\n\nconst { ADULT, CHILD, GUEST } = TYPE;\n\nexport const getOccupationCaption = (rooms = [], translate = translateHelper, type = ACCOMMODATION_TYPE.ROOM) => {\n const getCount = (room, filterType) =>\n room.filter(({ type } = {}) => type === filterType).reduce((previous, { amount = 0 } = {}) => previous + amount, 0);\n\n let adults = 0;\n let children = 0;\n let guests = 0;\n\n rooms.forEach((room) => {\n adults += getCount(room, ADULT);\n children += getCount(room, CHILD);\n guests += getCount(room, GUEST);\n });\n\n const captionRooms = translate(\n {\n id: `${L10N.LABEL_PLACE_TYPE.id}.${PLACE[type]}`,\n defaultMessage: '{rooms, plural, =1 {1 room} other {# rooms}}',\n },\n { rooms: rooms.length },\n );\n const captionAdults = translate(L10N.LABEL_OCCUPATION_TYPE[adults > 0 ? ADULT : GUEST], { adults, guests });\n const captionChildren = children > 0 ? translate(L10N.LABEL_OCCUPATION_TYPE[CHILD], { children }) : undefined;\n\n return `${captionAdults}${captionChildren ? `, ${captionChildren}` : ''} · ${captionRooms}`;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,MAAM;EAAEG,KAAK;EAAEC,KAAK;EAAEC;AAAM,CAAC,GAAGC,gBAAI;AAE7B,MAAMC,oBAAoB,GAAG,SAAAA,CAAA,EAA6E;EAAA,IAA5EC,KAAK,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAAA,IAAEG,SAAS,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGI,kBAAe;EAAA,IAAEC,IAAI,GAAAL,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGM,8BAAkB,CAACC,IAAI;EAC1G,MAAMC,QAAQ,GAAGA,CAACC,IAAI,EAAEC,UAAU,KAChCD,IAAI,CAACE,MAAM,CAAC;IAAA,IAAC;MAAEN;IAAK,CAAC,GAAAL,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;IAAA,OAAKK,IAAI,KA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O,eAAe,IAAK,EAAE,YAAAP,MAAA,CAAMF,YAAY;AAC3F,CAAC;AAACU,OAAA,CAAA/B,oBAAA,GAAAA,oBAAA"}
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.L10N = void 0;
|
|
7
7
|
const L10N = exports.L10N = {
|
|
8
8
|
LABEL_PROMO_CODE: {
|
|
9
|
-
id: 'common.label.promo_code'
|
|
9
|
+
id: 'common.label.promo_code',
|
|
10
|
+
defaultMessage: 'Code'
|
|
10
11
|
}
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=FieldPromocode.l10n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldPromocode.l10n.js","names":["L10N","exports","LABEL_PROMO_CODE","id"],"sources":["../../../../src/components/__shared__/FieldPromocode/FieldPromocode.l10n.js"],"sourcesContent":["export const L10N = {\n LABEL_PROMO_CODE: { id: 'common.label.promo_code' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,gBAAgB,EAAE;IAAEC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"FieldPromocode.l10n.js","names":["L10N","exports","LABEL_PROMO_CODE","id","defaultMessage"],"sources":["../../../../src/components/__shared__/FieldPromocode/FieldPromocode.l10n.js"],"sourcesContent":["export const L10N = {\n LABEL_PROMO_CODE: { id: 'common.label.promo_code', defaultMessage: 'Code' },\n};\n"],"mappings":";;;;;;AAAO,MAAMA,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,gBAAgB,EAAE;IAAEC,EAAE,EAAE,yBAAyB;IAAEC,cAAc,EAAE;EAAO;AAC5E,CAAC"}
|
|
@@ -39,13 +39,15 @@ const L10N = exports.L10N = {
|
|
|
39
39
|
LABEL_OCCUPATION_TYPE: {
|
|
40
40
|
// ! TODO: Should bind type
|
|
41
41
|
[ADULT]: {
|
|
42
|
-
id: 'finder.label.occupation_type_adult'
|
|
42
|
+
id: 'finder.label.occupation_type_adult',
|
|
43
|
+
defaultMessage: '{adults, plural, =1 {1 adult} other {# adults}}'
|
|
43
44
|
},
|
|
44
45
|
[CHILD]: {
|
|
45
46
|
id: 'finder.label.occupation_type_child'
|
|
46
47
|
},
|
|
47
48
|
[GUEST]: {
|
|
48
|
-
id: 'finder.label.occupation_type_guest'
|
|
49
|
+
id: 'finder.label.occupation_type_guest',
|
|
50
|
+
defaultMessage: '{guests, plural, =1 {1 guest} other {# guests}}'
|
|
49
51
|
}
|
|
50
52
|
},
|
|
51
53
|
LABEL_PLACE_TYPE: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Occupation.l10n.js","names":["_Occupation","require","ADULT","CHILD","GUEST","TYPE","L10N","exports","ACTION_ADD_PLACE_TYPE","id","ACTION_NEXT","ACTION_REMOVE","LABEL_AGE","LABEL_AGE_FROM","LABEL_AGE_HINT","LABEL_AGE_RANGE","LABEL_AGE_UP_TO","LABEL_OCCUPATION_TYPE","LABEL_PLACE_TYPE","LABEL_PLACE_TYPE_COUNT","NOTIFICATION_ERROR_UNFILLED_FIELDS","NOTIFICATION_WARNING_OCCUPATION"],"sources":["../../../../src/components/__shared__/Occupation/Occupation.l10n.js"],"sourcesContent":["import { TYPE } from './Occupation.constants';\n\nconst { ADULT, CHILD, GUEST } = TYPE;\n\nexport const L10N = {\n ACTION_ADD_PLACE_TYPE: { id: 'finder.action.add_place_type' }, // ! TODO: Should bind type\n ACTION_NEXT: { id: 'finder.action.next' },\n ACTION_REMOVE: { id: 'finder.action.remove' },\n\n LABEL_AGE: { id: 'common.label.age' },\n LABEL_AGE_FROM: { id: 'common.label.age_from' },\n LABEL_AGE_HINT: { id: 'common.label.age_hint' },\n LABEL_AGE_RANGE: { id: 'common.label.age_range' },\n LABEL_AGE_UP_TO: { id: 'common.label.age_up_to' },\n LABEL_OCCUPATION_TYPE: {\n // ! TODO: Should bind type\n [ADULT]: {
|
|
1
|
+
{"version":3,"file":"Occupation.l10n.js","names":["_Occupation","require","ADULT","CHILD","GUEST","TYPE","L10N","exports","ACTION_ADD_PLACE_TYPE","id","ACTION_NEXT","ACTION_REMOVE","LABEL_AGE","LABEL_AGE_FROM","LABEL_AGE_HINT","LABEL_AGE_RANGE","LABEL_AGE_UP_TO","LABEL_OCCUPATION_TYPE","defaultMessage","LABEL_PLACE_TYPE","LABEL_PLACE_TYPE_COUNT","NOTIFICATION_ERROR_UNFILLED_FIELDS","NOTIFICATION_WARNING_OCCUPATION"],"sources":["../../../../src/components/__shared__/Occupation/Occupation.l10n.js"],"sourcesContent":["import { TYPE } from './Occupation.constants';\n\nconst { ADULT, CHILD, GUEST } = TYPE;\n\nexport const L10N = {\n ACTION_ADD_PLACE_TYPE: { id: 'finder.action.add_place_type' }, // ! TODO: Should bind type\n ACTION_NEXT: { id: 'finder.action.next' },\n ACTION_REMOVE: { id: 'finder.action.remove' },\n\n LABEL_AGE: { id: 'common.label.age' },\n LABEL_AGE_FROM: { id: 'common.label.age_from' },\n LABEL_AGE_HINT: { id: 'common.label.age_hint' },\n LABEL_AGE_RANGE: { id: 'common.label.age_range' },\n LABEL_AGE_UP_TO: { id: 'common.label.age_up_to' },\n LABEL_OCCUPATION_TYPE: {\n // ! TODO: Should bind type\n [ADULT]: {\n id: 'finder.label.occupation_type_adult',\n defaultMessage: '{adults, plural, =1 {1 adult} other {# adults}}',\n },\n [CHILD]: { id: 'finder.label.occupation_type_child' },\n [GUEST]: {\n id: 'finder.label.occupation_type_guest',\n defaultMessage: '{guests, plural, =1 {1 guest} other {# guests}}',\n },\n },\n LABEL_PLACE_TYPE: { id: 'finder.label.place_type' }, // ! TODO: Should bind type\n LABEL_PLACE_TYPE_COUNT: { id: 'finder.label.place_type_count' }, // ! TODO: Should bind type\n\n NOTIFICATION_ERROR_UNFILLED_FIELDS: { id: 'common.notification.error_unfilled_fields' },\n NOTIFICATION_WARNING_OCCUPATION: { id: 'finder.notification.warning_occupation' },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,MAAM;EAAEC,KAAK;EAAEC,KAAK;EAAEC;AAAM,CAAC,GAAGC,gBAAI;AAE7B,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG;EAClBE,qBAAqB,EAAE;IAAEC,EAAE,EAAE;EAA+B,CAAC;EAAE;EAC/DC,WAAW,EAAE;IAAED,EAAE,EAAE;EAAqB,CAAC;EACzCE,aAAa,EAAE;IAAEF,EAAE,EAAE;EAAuB,CAAC;EAE7CG,SAAS,EAAE;IAAEH,EAAE,EAAE;EAAmB,CAAC;EACrCI,cAAc,EAAE;IAAEJ,EAAE,EAAE;EAAwB,CAAC;EAC/CK,cAAc,EAAE;IAAEL,EAAE,EAAE;EAAwB,CAAC;EAC/CM,eAAe,EAAE;IAAEN,EAAE,EAAE;EAAyB,CAAC;EACjDO,eAAe,EAAE;IAAEP,EAAE,EAAE;EAAyB,CAAC;EACjDQ,qBAAqB,EAAE;IACrB;IACA,CAACf,KAAK,GAAG;MACPO,EAAE,EAAE,oCAAoC;MACxCS,cAAc,EAAE;IAClB,CAAC;IACD,CAACf,KAAK,GAAG;MAAEM,EAAE,EAAE;IAAqC,CAAC;IACrD,CAACL,KAAK,GAAG;MACPK,EAAE,EAAE,oCAAoC;MACxCS,cAAc,EAAE;IAClB;EACF,CAAC;EACDC,gBAAgB,EAAE;IAAEV,EAAE,EAAE;EAA0B,CAAC;EAAE;EACrDW,sBAAsB,EAAE;IAAEX,EAAE,EAAE;EAAgC,CAAC;EAAE;;EAEjEY,kCAAkC,EAAE;IAAEZ,EAAE,EAAE;EAA4C,CAAC;EACvFa,+BAA+B,EAAE;IAAEb,EAAE,EAAE;EAAyC;AAClF,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -50,7 +50,7 @@ window.Mirai.core = async () => {
|
|
|
50
50
|
const components = (0, _helpers.findComponents)();
|
|
51
51
|
if (!components.length) return;
|
|
52
52
|
|
|
53
|
-
// 5.
|
|
53
|
+
// 5. 1st render
|
|
54
54
|
window && _reactDom.default.render( /*#__PURE__*/_react.default.createElement(_react.default.StrictMode, null, /*#__PURE__*/_react.default.createElement(_Core.Core, {
|
|
55
55
|
components,
|
|
56
56
|
skeleton: true
|
|
@@ -87,6 +87,9 @@ window.Mirai.core = async () => {
|
|
|
87
87
|
// 11. Initialize features
|
|
88
88
|
await _services.ServiceFeatures.initialize();
|
|
89
89
|
|
|
90
|
+
// 12. Initialize dictionary
|
|
91
|
+
if (!_services.ServiceDictionary.cache(store.locale)) await _services.ServiceDictionary.get(store.locale);
|
|
92
|
+
|
|
90
93
|
// 12. Render components
|
|
91
94
|
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(_react.default.StrictMode, null, /*#__PURE__*/_react.default.createElement(_dataSources.MetricsProvider, {
|
|
92
95
|
token: process.env.METRICS
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_dataSources","require","_services","_react","_interopRequireDefault","_reactDom","_Core","_Core2","_helpers","_package","obj","__esModule","default","window","Mirai","environment","process","env","NODE_ENV","Event","services","booking","SERVICE_BOOKING","club","SERVICE_CLUB","dictionary","SERVICE_DICTIONARY","engine","SERVICE_ENGINE","static","SERVICE_STATIC","user","SERVICE_USER","version","core","isProduction","isDevelopment","isPreproduction","console","log","concat","name","urlParams","fetchUrlParams","location","search","cookies","fetchCookies","COOKIE_CART","COOKIE_PESTANA","COOKIE_VALUES","session","fetchSession","loadEnvironment","undefined","instance","findInstance","components","findComponents","length","ReactDOM","render","createElement","StrictMode","Core","skeleton","el","config","fetchConfig","Sentry","SENTRY","loadSentry","theme","checkSession","id","setUser","store","consolidateStore","ServiceFeatures","initialize","MetricsProvider","token","METRICS","StoreProvider","value","addEventListener","event","persisted"],"sources":["../src/index.js"],"sourcesContent":["/* eslint-disable no-console */\nimport { Event, MetricsProvider, StoreProvider } from '@mirai/data-sources';\nimport { ServiceFeatures } from '@mirai/services';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { Core } from './Core';\nimport { COOKIE_CART, COOKIE_PESTANA, COOKIE_VALUES } from './Core.definition';\nimport {\n checkSession,\n consolidateStore,\n fetchConfig,\n fetchCookies,\n fetchSession,\n fetchUrlParams,\n findComponents,\n findInstance,\n loadEnvironment,\n loadSentry,\n theme,\n} from './helpers';\nimport { name, version } from '../package.json';\n\nwindow.Mirai = {\n ...window.Mirai,\n environment: process.env.NODE_ENV,\n Event,\n services: {\n booking: process.env.SERVICE_BOOKING,\n club: process.env.SERVICE_CLUB,\n dictionary: process.env.SERVICE_DICTIONARY,\n engine: process.env.SERVICE_ENGINE,\n static: process.env.SERVICE_STATIC,\n user: process.env.SERVICE_USER,\n },\n version,\n};\n\nwindow.Mirai.core = async () => {\n const isProduction = process.env.NODE_ENV === 'production';\n const isDevelopment = process.env.NODE_ENV === 'development';\n const isPreproduction = process.env.NODE_ENV === 'preproduction';\n\n console.log(\n `${isProduction ? '🟢' : isPreproduction ? '🟡' : isDevelopment ? '🔴' : '⚫️'} ${name} v${version} [${\n process.env.NODE_ENV\n }]`,\n );\n\n // 1. Fetch client-side dataSources\n const urlParams = fetchUrlParams(location.search);\n const cookies = fetchCookies([COOKIE_CART, COOKIE_PESTANA, COOKIE_VALUES]);\n let session = fetchSession(urlParams);\n\n // 2. Analize environment\n const environment = urlParams.env && isProduction ? loadEnvironment(urlParams.env) : undefined;\n if (environment) return;\n\n // 3. Find instance\n const instance = findInstance({ urlParams });\n if (!instance) return;\n\n // 4. Find components\n const components = findComponents();\n if (!components.length) return;\n\n // 5.
|
|
1
|
+
{"version":3,"file":"index.js","names":["_dataSources","require","_services","_react","_interopRequireDefault","_reactDom","_Core","_Core2","_helpers","_package","obj","__esModule","default","window","Mirai","environment","process","env","NODE_ENV","Event","services","booking","SERVICE_BOOKING","club","SERVICE_CLUB","dictionary","SERVICE_DICTIONARY","engine","SERVICE_ENGINE","static","SERVICE_STATIC","user","SERVICE_USER","version","core","isProduction","isDevelopment","isPreproduction","console","log","concat","name","urlParams","fetchUrlParams","location","search","cookies","fetchCookies","COOKIE_CART","COOKIE_PESTANA","COOKIE_VALUES","session","fetchSession","loadEnvironment","undefined","instance","findInstance","components","findComponents","length","ReactDOM","render","createElement","StrictMode","Core","skeleton","el","config","fetchConfig","Sentry","SENTRY","loadSentry","theme","checkSession","id","setUser","store","consolidateStore","ServiceFeatures","initialize","ServiceDictionary","cache","locale","get","MetricsProvider","token","METRICS","StoreProvider","value","addEventListener","event","persisted"],"sources":["../src/index.js"],"sourcesContent":["/* eslint-disable no-console */\nimport { Event, MetricsProvider, StoreProvider } from '@mirai/data-sources';\nimport { ServiceDictionary, ServiceFeatures } from '@mirai/services';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { Core } from './Core';\nimport { COOKIE_CART, COOKIE_PESTANA, COOKIE_VALUES } from './Core.definition';\nimport {\n checkSession,\n consolidateStore,\n fetchConfig,\n fetchCookies,\n fetchSession,\n fetchUrlParams,\n findComponents,\n findInstance,\n loadEnvironment,\n loadSentry,\n theme,\n} from './helpers';\nimport { name, version } from '../package.json';\n\nwindow.Mirai = {\n ...window.Mirai,\n environment: process.env.NODE_ENV,\n Event,\n services: {\n booking: process.env.SERVICE_BOOKING,\n club: process.env.SERVICE_CLUB,\n dictionary: process.env.SERVICE_DICTIONARY,\n engine: process.env.SERVICE_ENGINE,\n static: process.env.SERVICE_STATIC,\n user: process.env.SERVICE_USER,\n },\n version,\n};\n\nwindow.Mirai.core = async () => {\n const isProduction = process.env.NODE_ENV === 'production';\n const isDevelopment = process.env.NODE_ENV === 'development';\n const isPreproduction = process.env.NODE_ENV === 'preproduction';\n\n console.log(\n `${isProduction ? '🟢' : isPreproduction ? '🟡' : isDevelopment ? '🔴' : '⚫️'} ${name} v${version} [${\n process.env.NODE_ENV\n }]`,\n );\n\n // 1. Fetch client-side dataSources\n const urlParams = fetchUrlParams(location.search);\n const cookies = fetchCookies([COOKIE_CART, COOKIE_PESTANA, COOKIE_VALUES]);\n let session = fetchSession(urlParams);\n\n // 2. Analize environment\n const environment = urlParams.env && isProduction ? loadEnvironment(urlParams.env) : undefined;\n if (environment) return;\n\n // 3. Find instance\n const instance = findInstance({ urlParams });\n if (!instance) return;\n\n // 4. Find components\n const components = findComponents();\n if (!components.length) return;\n\n // 5. 1st render\n window &&\n ReactDOM.render(\n <React.StrictMode>\n <Core {...{ components }} skeleton />\n </React.StrictMode>,\n instance.el,\n );\n\n // 6. Analize id to fetch its config\n const config = await fetchConfig(instance);\n if (!config) return;\n window.Mirai.config = config;\n\n // 7. Sentry\n let Sentry = window.Mirai.Sentry;\n if (!Sentry && process.env.SENTRY) {\n Sentry = loadSentry(process.env.SENTRY, version);\n window.Mirai.Sentry = Sentry;\n }\n\n // 8. Theming\n theme(urlParams);\n\n // 9. Check session\n if (session && !(await checkSession(instance.id, config))) session = undefined;\n if (session && Sentry) Sentry.setUser(session);\n\n // 10. Consolidate store\n const store = consolidateStore({ config, cookies, instance, session, urlParams });\n\n // 11. Initialize features\n await ServiceFeatures.initialize();\n\n // 12. Initialize dictionary\n if (!ServiceDictionary.cache(store.locale)) await ServiceDictionary.get(store.locale);\n\n // 12. Render components\n ReactDOM.render(\n <React.StrictMode>\n <MetricsProvider token={process.env.METRICS}>\n <StoreProvider value={store}>\n <Core {...{ components }} />\n </StoreProvider>\n </MetricsProvider>\n </React.StrictMode>,\n instance.el,\n );\n};\n\nwindow.Mirai.core();\n\nif (window.Mirai.environment === 'production') {\n window.addEventListener('pageshow', (event) => event.persisted && window.Mirai.core());\n}\n"],"mappings":";;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA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