@dr.pogodin/react-utils 1.23.9 → 1.23.10

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.
Files changed (69) hide show
  1. package/README.md +3 -2
  2. package/build/development/client/getInj.js.map +1 -1
  3. package/build/development/client/index.js.map +1 -1
  4. package/build/development/client/init.js.map +1 -1
  5. package/build/development/index.js.map +1 -1
  6. package/build/development/server/Cache.js.map +1 -1
  7. package/build/development/server/index.js.map +1 -1
  8. package/build/development/server/renderer.js.map +1 -1
  9. package/build/development/server/server.js.map +1 -1
  10. package/build/development/shared/components/Button/index.js.map +1 -1
  11. package/build/development/shared/components/Checkbox/index.js.map +1 -1
  12. package/build/development/shared/components/CodeSplit/index.js.map +1 -1
  13. package/build/development/shared/components/Dropdown/index.js.map +1 -1
  14. package/build/development/shared/components/GenericLink/index.js.map +1 -1
  15. package/build/development/shared/components/Input/index.js.map +1 -1
  16. package/build/development/shared/components/Link.js.map +1 -1
  17. package/build/development/shared/components/MetaTags.js.map +1 -1
  18. package/build/development/shared/components/Modal/index.js.map +1 -1
  19. package/build/development/shared/components/NavLink.js.map +1 -1
  20. package/build/development/shared/components/PageLayout/index.js.map +1 -1
  21. package/build/development/shared/components/ScalableRect/index.js.map +1 -1
  22. package/build/development/shared/components/Throbber/index.js.map +1 -1
  23. package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
  24. package/build/development/shared/components/WithTooltip/index.js.map +1 -1
  25. package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
  26. package/build/development/shared/utils/config.js.map +1 -1
  27. package/build/development/shared/utils/index.js.map +1 -1
  28. package/build/development/shared/utils/isomorphy/index.js.map +1 -1
  29. package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  30. package/build/development/shared/utils/jest/index.js.map +1 -1
  31. package/build/development/shared/utils/splitComponent.js.map +1 -1
  32. package/build/development/shared/utils/time.js.map +1 -1
  33. package/build/development/web.bundle.js +12 -12
  34. package/build/production/client/getInj.js.map +1 -1
  35. package/build/production/client/index.js.map +1 -1
  36. package/build/production/client/init.js.map +1 -1
  37. package/build/production/index.js.map +1 -1
  38. package/build/production/server/Cache.js.map +1 -1
  39. package/build/production/server/index.js +1 -1
  40. package/build/production/server/index.js.map +1 -1
  41. package/build/production/server/renderer.js.map +1 -1
  42. package/build/production/server/server.js.map +1 -1
  43. package/build/production/shared/components/Button/index.js.map +1 -1
  44. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  45. package/build/production/shared/components/CodeSplit/index.js.map +1 -1
  46. package/build/production/shared/components/Dropdown/index.js.map +1 -1
  47. package/build/production/shared/components/GenericLink/index.js.map +1 -1
  48. package/build/production/shared/components/Input/index.js.map +1 -1
  49. package/build/production/shared/components/Link.js.map +1 -1
  50. package/build/production/shared/components/MetaTags.js.map +1 -1
  51. package/build/production/shared/components/Modal/index.js.map +1 -1
  52. package/build/production/shared/components/NavLink.js.map +1 -1
  53. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  54. package/build/production/shared/components/ScalableRect/index.js.map +1 -1
  55. package/build/production/shared/components/Throbber/index.js.map +1 -1
  56. package/build/production/shared/components/WithTooltip/Tooltip.js.map +1 -1
  57. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  58. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  59. package/build/production/shared/utils/config.js.map +1 -1
  60. package/build/production/shared/utils/index.js.map +1 -1
  61. package/build/production/shared/utils/isomorphy/index.js.map +1 -1
  62. package/build/production/shared/utils/jest/E2eSsrEnv.js +1 -1
  63. package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  64. package/build/production/shared/utils/jest/index.js.map +1 -1
  65. package/build/production/shared/utils/splitComponent.js.map +1 -1
  66. package/build/production/shared/utils/time.js.map +1 -1
  67. package/build/production/web.bundle.js +1 -1
  68. package/build/production/web.bundle.js.map +1 -1
  69. package/package.json +21 -21
@@ -1 +1 @@
1
- {"version":3,"file":"time.js","names":["_cookie","_interopRequireDefault","require","_dayjs","_lodash","_react","_jsUtils","_reactGlobalState","useCurrent","autorefresh","globalStatePath","precision","dayjs","SEC_MS","now","setter","useGlobalState","Date","useEffect","timerId","update","old","neu","Math","abs","setTimeout","clearTimeout","useTimezoneOffset","cookieName","ssrContext","getSsrContext","offset","setOffset","value","req","cookies","parseInt","date","getTimezoneOffset","document","cookie","Cookie","serialize","path","assign","DAY_MS","HOUR_MS","MIN_MS","YEAR_MS","timer","_default","exports","default"],"sources":["../../../../src/shared/utils/time.js"],"sourcesContent":["/* global document */\n\nimport Cookie from 'cookie';\nimport dayjs from 'dayjs';\nimport { assign } from 'lodash';\nimport { useEffect } from 'react';\n\nimport {\n DAY_MS,\n HOUR_MS,\n MIN_MS,\n SEC_MS,\n YEAR_MS,\n timer,\n} from '@dr.pogodin/js-utils';\n\nimport { getSsrContext, useGlobalState } from '@dr.pogodin/react-global-state';\n\n/**\n * This react hook wraps Date.now() function in a SSR friendly way,\n * ensuring that all calls to useCurrent() within the same render return\n * exactly the same time (which is retrieved from Date.now() first, and\n * then stored in the global state to be reused in all other calls), which\n * is also passed and used in the first client side render, and then updated\n * with a finite precision to avoid infinite re-rendering loops.\n * @param {object} [options] Optional settings.\n * @param {string} [options.globalStatePath=\"currentTime\"] Global state path\n * to keep the current time value.\n * @param {number} [options.precision= 5 * time.SEC_MS] Current time precision.\n * The hook won't update the current time stored in the global state unless it\n * is different from Date.now() result by this number (in milliseconds).\n * Default to 5 seconds.\n * @param {boolean} [options.autorefresh=false] Set `true` to automatically\n * refresh time stored in the global state with the given `precision` (and\n * thus automatically re-rendering components dependent on this hook, or\n * the global state with the period equal to the `precision`.\n * @return {number} Unix timestamp in milliseconds.\n */\nexport function useCurrent({\n autorefresh = false,\n globalStatePath = 'currentTime',\n precision = 5 * dayjs.SEC_MS,\n} = {}) {\n const [now, setter] = useGlobalState(globalStatePath, Date.now);\n useEffect(() => {\n let timerId;\n const update = () => {\n setter((old) => {\n const neu = Date.now();\n return Math.abs(neu - old) > precision ? neu : old;\n });\n if (autorefresh) timerId = setTimeout(update, precision);\n };\n update();\n return () => {\n if (timerId) clearTimeout(timerId);\n };\n }, [autorefresh, precision, setter]);\n return now;\n}\n\n/**\n * Wraps the standard Date.getTimezoneOffset() method in a SSR-friendly way.\n * This hook retrieves the offset value at the client side and uses a cookie\n * to pass it to the server in subsequent requests from that user. At the server\n * side the value from cookie is used in renders and passed back to the client\n * via the global state. Prior to the value being known (in the very first\n * request from the user, when the cookie is still missing), zero value is used\n * as the default value.\n *\n * @param {object} [options] Optional settings.\n * @param {string} [options.cookieName=\"timezoneOffset\"] Optional. The name of\n * cookie to use to store the timezone offset. Defaults \"timezoneOffset\". Set\n * to a falsy value to forbid using cookies altogether (in that case the hook\n * will always return zero value at the server-side, and in the first render\n * at the client-side).\n * @param {string} [options.timezoneOffset=\"timezoneOffset\"] Optional.\n * The global state path to store the offset. Defaults \"timezoneOffset\".\n * @return {number} Timezone offset.\n */\nexport function useTimezoneOffset({\n cookieName = 'timezoneOffset',\n globalStatePath = 'timezoneOffset',\n} = {}) {\n const ssrContext = getSsrContext(false);\n const [offset, setOffset] = useGlobalState(globalStatePath, () => {\n const value = cookieName && ssrContext?.req?.cookies?.[cookieName];\n return value ? parseInt(value, 10) : 0;\n });\n useEffect(() => {\n const date = new Date();\n const value = date.getTimezoneOffset();\n setOffset(value);\n if (cookieName) {\n document.cookie = Cookie.serialize(cookieName, value, { path: '/' });\n }\n }, [cookieName, setOffset]);\n return offset;\n}\n\nassign(dayjs, {\n DAY_MS,\n HOUR_MS,\n MIN_MS,\n SEC_MS,\n YEAR_MS,\n now: Date.now,\n timer,\n useCurrent,\n useTimezoneOffset,\n});\n\nexport default dayjs;\n"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AA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IAAAC,+BAAa,EAAC,KAAK,CAAC;EACvC,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAhB,gCAAc,EAACN,eAAe,EAAE,MAAM;IAChE,MAAMuB,KAAK,GAAGL,UAAU,IAAIC,UAAU,EAAEK,GAAG,EAAEC,OAAO,GAAGP,UAAU,CAAC;IAClE,OAAOK,KAAK,GAAGG,QAAQ,CAACH,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC;EACxC,CAAC,CAAC;EACF,IAAAf,gBAAS,EAAC,MAAM;IACd,MAAMmB,IAAI,GAAG,IAAIpB,IAAI,EAAE;IACvB,MAAMgB,KAAK,GAAGI,IAAI,CAACC,iBAAiB,EAAE;IACtCN,SAAS,CAACC,KAAK,CAAC;IAChB,IAAIL,UAAU,EAAE;MACdW,QAAQ,CAACC,MAAM,GAAGC,eAAM,CAACC,SAAS,CAACd,UAAU,EAAEK,KAAK,EAAE;QAAEU,IAAI,EAAE;MAAI,CAAC,CAAC;IACtE;EACF,CAAC,EAAE,CAACf,UAAU,EAAEI,SAAS,CAAC,CAAC;EAC3B,OAAOD,MAAM;AACf;AAEA,IAAAa,cAAM,EAAChC,cAAK,EAAE;EACZiC,MAAM,EAANA,eAAM;EACNC,OAAO,EAAPA,gBAAO;EACPC,MAAM,EAANA,eAAM;EACNlC,MAAM,EAANA,eAAM;EACNmC,OAAO,EAAPA,gBAAO;EACPlC,GAAG,EAAEG,IAAI,CAACH,GAAG;EACbmC,KAAK,EAALA,cAAK;EACLzC,UAAU;EACVmB;AACF,CAAC,CAAC;AAAC,IAAAuB,QAAA,GAEYtC,cAAK;AAAAuC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"file":"time.js","names":["_cookie","_interopRequireDefault","require","_dayjs","_lodash","_react","_jsUtils","_reactGlobalState","useCurrent","autorefresh","globalStatePath","precision","dayjs","SEC_MS","now","setter","useGlobalState","Date","useEffect","timerId","update","old","neu","Math","abs","setTimeout","clearTimeout","useTimezoneOffset","cookieName","ssrContext","getSsrContext","offset","setOffset","value","req","cookies","parseInt","date","getTimezoneOffset","document","cookie","Cookie","serialize","path","assign","DAY_MS","HOUR_MS","MIN_MS","YEAR_MS","timer","_default","exports","default"],"sources":["../../../../src/shared/utils/time.js"],"sourcesContent":["/* global document */\n\nimport Cookie from 'cookie';\nimport dayjs from 'dayjs';\nimport { assign } from 'lodash';\nimport { useEffect } from 'react';\n\nimport {\n DAY_MS,\n HOUR_MS,\n MIN_MS,\n SEC_MS,\n YEAR_MS,\n timer,\n} from '@dr.pogodin/js-utils';\n\nimport { getSsrContext, useGlobalState } from '@dr.pogodin/react-global-state';\n\n/**\n * This react hook wraps Date.now() function in a SSR friendly way,\n * ensuring that all calls to useCurrent() within the same render return\n * exactly the same time (which is retrieved from Date.now() first, and\n * then stored in the global state to be reused in all other calls), which\n * is also passed and used in the first client side render, and then updated\n * with a finite precision to avoid infinite re-rendering loops.\n * @param {object} [options] Optional settings.\n * @param {string} [options.globalStatePath=\"currentTime\"] Global state path\n * to keep the current time value.\n * @param {number} [options.precision= 5 * time.SEC_MS] Current time precision.\n * The hook won't update the current time stored in the global state unless it\n * is different from Date.now() result by this number (in milliseconds).\n * Default to 5 seconds.\n * @param {boolean} [options.autorefresh=false] Set `true` to automatically\n * refresh time stored in the global state with the given `precision` (and\n * thus automatically re-rendering components dependent on this hook, or\n * the global state with the period equal to the `precision`.\n * @return {number} Unix timestamp in milliseconds.\n */\nexport function useCurrent({\n autorefresh = false,\n globalStatePath = 'currentTime',\n precision = 5 * dayjs.SEC_MS,\n} = {}) {\n const [now, setter] = useGlobalState(globalStatePath, Date.now);\n useEffect(() => {\n let timerId;\n const update = () => {\n setter((old) => {\n const neu = Date.now();\n return Math.abs(neu - old) > precision ? neu : old;\n });\n if (autorefresh) timerId = setTimeout(update, precision);\n };\n update();\n return () => {\n if (timerId) clearTimeout(timerId);\n };\n }, [autorefresh, precision, setter]);\n return now;\n}\n\n/**\n * Wraps the standard Date.getTimezoneOffset() method in a SSR-friendly way.\n * This hook retrieves the offset value at the client side and uses a cookie\n * to pass it to the server in subsequent requests from that user. At the server\n * side the value from cookie is used in renders and passed back to the client\n * via the global state. Prior to the value being known (in the very first\n * request from the user, when the cookie is still missing), zero value is used\n * as the default value.\n *\n * @param {object} [options] Optional settings.\n * @param {string} [options.cookieName=\"timezoneOffset\"] Optional. The name of\n * cookie to use to store the timezone offset. Defaults \"timezoneOffset\". Set\n * to a falsy value to forbid using cookies altogether (in that case the hook\n * will always return zero value at the server-side, and in the first render\n * at the client-side).\n * @param {string} [options.timezoneOffset=\"timezoneOffset\"] Optional.\n * The global state path to store the offset. Defaults \"timezoneOffset\".\n * @return {number} Timezone offset.\n */\nexport function useTimezoneOffset({\n cookieName = 'timezoneOffset',\n globalStatePath = 'timezoneOffset',\n} = {}) {\n const ssrContext = getSsrContext(false);\n const [offset, setOffset] = useGlobalState(globalStatePath, () => {\n const value = cookieName && ssrContext?.req?.cookies?.[cookieName];\n return value ? parseInt(value, 10) : 0;\n });\n useEffect(() => {\n const date = new Date();\n const value = date.getTimezoneOffset();\n setOffset(value);\n if (cookieName) {\n document.cookie = Cookie.serialize(cookieName, value, { path: '/' });\n }\n }, [cookieName, setOffset]);\n return offset;\n}\n\nassign(dayjs, {\n DAY_MS,\n HOUR_MS,\n MIN_MS,\n SEC_MS,\n YEAR_MS,\n now: Date.now,\n timer,\n useCurrent,\n useTimezoneOffset,\n});\n\nexport default dayjs;\n"],"mappings":";;;;;;;;;AAEA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AASA,IAAAK,iBAAA,GAAAL,OAAA;AAhBA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAK,GAAGL,UAAU,IAAIC,UAAU,EAAEK,GAAG,EAAEC,OAAO,GAAGP,UAAU,CAAC;IAClE,OAAOK,KAAK,GAAGG,QAAQ,CAACH,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC;EACxC,CAAC,CAAC;EACF,IAAAf,gBAAS,EAAC,MAAM;IACd,MAAMmB,IAAI,GAAG,IAAIpB,IAAI,CAAC,CAAC;IACvB,MAAMgB,KAAK,GAAGI,IAAI,CAACC,iBAAiB,CAAC,CAAC;IACtCN,SAAS,CAACC,KAAK,CAAC;IAChB,IAAIL,UAAU,EAAE;MACdW,QAAQ,CAACC,MAAM,GAAGC,eAAM,CAACC,SAAS,CAACd,UAAU,EAAEK,KAAK,EAAE;QAAEU,IAAI,EAAE;MAAI,CAAC,CAAC;IACtE;EACF,CAAC,EAAE,CAACf,UAAU,EAAEI,SAAS,CAAC,CAAC;EAC3B,OAAOD,MAAM;AACf;AAEA,IAAAa,cAAM,EAAChC,cAAK,EAAE;EACZiC,MAAM,EAANA,eAAM;EACNC,OAAO,EAAPA,gBAAO;EACPC,MAAM,EAANA,eAAM;EACNlC,MAAM,EAANA,eAAM;EACNmC,OAAO,EAAPA,gBAAO;EACPlC,GAAG,EAAEG,IAAI,CAACH,GAAG;EACbmC,KAAK,EAALA,cAAK;EACLzC,UAAU;EACVmB;AACF,CAAC,CAAC;AAAC,IAAAuB,QAAA,GAEYtC,cAAK;AAAAuC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -37,7 +37,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar
37
37
  /***/ (function(__unused_webpack_module, exports) {
38
38
 
39
39
  "use strict";
40
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Simple listeneable data Emitter.\n */\nclass Emitter {\n constructor() {\n this.p_listeners = [];\n }\n /**\n * Returns \"true\" if any listener is connected; \"false\" otherwise.\n * @return {boolean}\n */\n get hasListeners() {\n return !!this.p_listeners.length;\n }\n get listeners() { return this.p_listeners; }\n /**\n * Adds `listener` if it is not already connected.\n * @param {function} listener\n * @return {function} Unsubscribe function.\n */\n addListener(listener) {\n if (!this.p_listeners.includes(listener)) {\n this.p_listeners.push(listener);\n }\n return () => this.removeListener(listener);\n }\n /**\n * Calls every connected listener with the given arguments.\n * @param {...any} args\n */\n emit(...args) {\n const { p_listeners: listeners } = this;\n for (let i = 0; i < listeners.length; ++i) {\n listeners[i](...args);\n }\n }\n /**\n * Removes specified `listener`, if connected.\n * @param {function} listener\n */\n removeListener(listener) {\n const idx = this.p_listeners.indexOf(listener);\n if (idx >= 0)\n this.p_listeners.splice(idx, 1);\n }\n}\nexports[\"default\"] = Emitter;\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/@dr.pogodin/js-utils/js/Emitter.js?");
40
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n/**\n * Simple listeneable data Emitter.\n */\nclass Emitter {\n constructor() {\n this.p_listeners = [];\n }\n /**\n * Returns \"true\" if any listener is connected; \"false\" otherwise.\n * @return {boolean}\n */\n get hasListeners() {\n return !!this.p_listeners.length;\n }\n get listeners() { return this.p_listeners; }\n /**\n * Adds `listener` if it is not already connected.\n * @param {function} listener\n * @return {function} Unsubscribe function.\n */\n addListener(listener) {\n if (!this.p_listeners.includes(listener)) {\n this.p_listeners.push(listener);\n }\n return () => this.removeListener(listener);\n }\n /**\n * Calls every connected listener with the given arguments.\n * @param args\n */\n emit(...args) {\n const { p_listeners: listeners } = this;\n for (let i = 0; i < listeners.length; ++i) {\n listeners[i](...args);\n }\n }\n /**\n * Removes all connected listeners.\n */\n removeAllListeners() {\n this.p_listeners = [];\n }\n /**\n * Removes specified `listener`, if connected.\n * @param listener\n */\n removeListener(listener) {\n const idx = this.p_listeners.indexOf(listener);\n if (idx >= 0)\n this.p_listeners.splice(idx, 1);\n }\n}\nexports[\"default\"] = Emitter;\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./node_modules/@dr.pogodin/js-utils/js/Emitter.js?");
41
41
 
42
42
  /***/ }),
43
43
 
@@ -103,7 +103,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
103
103
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
104
104
 
105
105
  "use strict";
106
- eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Barrier\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ \"BaseModal\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.BaseModal; },\n/* harmony export */ \"Button\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Button; },\n/* harmony export */ \"Checkbox\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Checkbox; },\n/* harmony export */ \"Dropdown\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Dropdown; },\n/* harmony export */ \"Emitter\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ \"GlobalStateProvider\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.GlobalStateProvider; },\n/* harmony export */ \"Input\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Input; },\n/* harmony export */ \"JU\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.JU; },\n/* harmony export */ \"Link\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Link; },\n/* harmony export */ \"MetaTags\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.MetaTags; },\n/* harmony export */ \"Modal\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Modal; },\n/* harmony export */ \"NavLink\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.NavLink; },\n/* harmony export */ \"PT\": function() { return /* reexport module object */ prop_types__WEBPACK_IMPORTED_MODULE_3__; },\n/* harmony export */ \"PageLayout\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.PageLayout; },\n/* harmony export */ \"ScalableRect\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.ScalableRect; },\n/* harmony export */ \"Semaphore\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Semaphore; },\n/* harmony export */ \"ThemeProvider\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider; },\n/* harmony export */ \"Throbber\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Throbber; },\n/* harmony export */ \"WithTooltip\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.WithTooltip; },\n/* harmony export */ \"YouTubeVideo\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.YouTubeVideo; },\n/* harmony export */ \"api\": function() { return /* reexport default from dynamic */ axios__WEBPACK_IMPORTED_MODULE_2___default.a; },\n/* harmony export */ \"client\": function() { return /* binding */ client; },\n/* harmony export */ \"config\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\n/* harmony export */ \"getGlobalState\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.getGlobalState; },\n/* harmony export */ \"getSsrContext\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.getSsrContext; },\n/* harmony export */ \"isomorphy\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.isomorphy; },\n/* harmony export */ \"newBarrier\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.newBarrier; },\n/* harmony export */ \"server\": function() { return /* binding */ server; },\n/* harmony export */ \"splitComponent\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.splitComponent; },\n/* harmony export */ \"themed\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.themed; },\n/* harmony export */ \"time\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.time; },\n/* harmony export */ \"useAsyncCollection\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncCollection; },\n/* harmony export */ \"useAsyncData\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncData; },\n/* harmony export */ \"useGlobalState\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState; },\n/* harmony export */ \"webpack\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack; },\n/* harmony export */ \"withRetries\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _styles_global_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./styles/global.scss */ \"./src/styles/global.scss\");\n/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/utils */ \"./src/shared/utils/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"axios\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shared/components */ \"./src/shared/components/index.js\");\n\n\nconst server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\nconst client = server ? undefined : (__webpack_require__(/*! ./client */ \"./src/client/index.jsx\")[\"default\"]);\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.js?");
106
+ eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Button; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Checkbox; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Dropdown; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ GlobalStateProvider: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.GlobalStateProvider; },\n/* harmony export */ Input: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Input; },\n/* harmony export */ JU: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.JU; },\n/* harmony export */ Link: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Link; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.MetaTags; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Modal; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.NavLink; },\n/* harmony export */ PT: function() { return /* reexport module object */ prop_types__WEBPACK_IMPORTED_MODULE_3__; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.PageLayout; },\n/* harmony export */ ScalableRect: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.ScalableRect; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Semaphore; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Throbber; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.WithTooltip; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.YouTubeVideo; },\n/* harmony export */ api: function() { return /* reexport default from dynamic */ axios__WEBPACK_IMPORTED_MODULE_2___default.a; },\n/* harmony export */ client: function() { return /* binding */ client; },\n/* harmony export */ config: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\n/* harmony export */ getGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.getGlobalState; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.isomorphy; },\n/* harmony export */ newBarrier: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.newBarrier; },\n/* harmony export */ server: function() { return /* binding */ server; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.splitComponent; },\n/* harmony export */ themed: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.time; },\n/* harmony export */ useAsyncCollection: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncCollection; },\n/* harmony export */ useAsyncData: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncData; },\n/* harmony export */ useGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState; },\n/* harmony export */ webpack: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _styles_global_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./styles/global.scss */ \"./src/styles/global.scss\");\n/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/utils */ \"./src/shared/utils/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"axios\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shared/components */ \"./src/shared/components/index.js\");\n\n\nconst server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\nconst client = server ? undefined : (__webpack_require__(/*! ./client */ \"./src/client/index.jsx\")[\"default\"]);\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.js?");
107
107
 
108
108
  /***/ }),
109
109
 
@@ -202,7 +202,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
202
202
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
203
203
 
204
204
  "use strict";
205
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseModal\": function() { return /* binding */ BaseModal; }\n/* harmony export */ });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _base_theme_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/Modal/base-theme.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./styles.scss */ \"./src/shared/components/Modal/styles.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global document */\n\n\n\n\n\n\n\n\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\n\n\n\nfunction BaseModal(_ref) {\n let {\n children,\n onCancel,\n theme\n } = _ref;\n const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();\n const overlayRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();\n const [portal, setPortal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {\n const p = document.createElement('div');\n document.body.classList.add('scrolling-disabled-by-modal');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.classList.remove('scrolling-disabled-by-modal');\n document.body.removeChild(p);\n };\n }, []);\n const focusLast = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n onFocus: () => {\n const elems = containerRef.current.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i].focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: \"0\"\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), []);\n return portal ? /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_2___default().createPortal( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {\n children: [focusLast, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n \"aria-label\": \"Cancel\",\n className: theme.overlay,\n onClick: () => onCancel(),\n onKeyDown: e => {\n if (e.key === 'Escape') onCancel();\n },\n ref: node => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n },\n role: \"button\",\n tabIndex: \"0\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n \"aria-modal\": \"true\",\n className: theme.container,\n onWheel: event => event.stopPropagation(),\n ref: containerRef,\n role: \"dialog\",\n children: children\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n onFocus: () => {\n overlayRef.current.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: \"0\"\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), focusLast]\n }), portal) : null;\n}\nconst ThemedModal = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4___default()('Modal', ['container', 'overlay'], _base_theme_scss__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(BaseModal);\nBaseModal.propTypes = {\n onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),\n children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node),\n theme: ThemedModal.themeType.isRequired\n};\nBaseModal.defaultProps = {\n onCancel: lodash__WEBPACK_IMPORTED_MODULE_0__.noop,\n children: null\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ThemedModal);\n\n/* Non-themed version of the Modal. */\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/index.jsx?");
205
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* binding */ BaseModal; }\n/* harmony export */ });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _base_theme_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/Modal/base-theme.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./styles.scss */ \"./src/shared/components/Modal/styles.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global document */\n\n\n\n\n\n\n\n\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\n\n\n\nfunction BaseModal(_ref) {\n let {\n children,\n onCancel,\n theme\n } = _ref;\n const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();\n const overlayRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();\n const [portal, setPortal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)();\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {\n const p = document.createElement('div');\n document.body.classList.add('scrolling-disabled-by-modal');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.classList.remove('scrolling-disabled-by-modal');\n document.body.removeChild(p);\n };\n }, []);\n const focusLast = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n onFocus: () => {\n const elems = containerRef.current.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i].focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: \"0\"\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), []);\n return portal ? /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_2___default().createPortal( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {\n children: [focusLast, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n \"aria-label\": \"Cancel\",\n className: theme.overlay,\n onClick: () => onCancel(),\n onKeyDown: e => {\n if (e.key === 'Escape') onCancel();\n },\n ref: node => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n },\n role: \"button\",\n tabIndex: \"0\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n \"aria-modal\": \"true\",\n className: theme.container,\n onWheel: event => event.stopPropagation(),\n ref: containerRef,\n role: \"dialog\",\n children: children\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n onFocus: () => {\n overlayRef.current.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: \"0\"\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), focusLast]\n }), portal) : null;\n}\nconst ThemedModal = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_4___default()('Modal', ['container', 'overlay'], _base_theme_scss__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(BaseModal);\nBaseModal.propTypes = {\n onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),\n children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node),\n theme: ThemedModal.themeType.isRequired\n};\nBaseModal.defaultProps = {\n onCancel: lodash__WEBPACK_IMPORTED_MODULE_0__.noop,\n children: null\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (ThemedModal);\n\n/* Non-themed version of the Modal. */\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/index.jsx?");
206
206
 
207
207
  /***/ }),
208
208
 
@@ -257,7 +257,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var prop
257
257
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
258
258
 
259
259
  "use strict";
260
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PLACEMENTS\": function() { return /* binding */ PLACEMENTS; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/**\n * The actual tooltip component. It is rendered outside the regular document\n * hierarchy, and with sub-components managed without React to achieve the best\n * performance during animation.\n */\n/* global document, window */\n\n\n\n\n\n/* Valid placements of the rendered tooltip. They will be overriden when\n * necessary to fit the tooltip within the viewport. */\nconst PLACEMENTS = {\n ABOVE_CURSOR: 'ABOVE_CURSOR',\n ABOVE_ELEMENT: 'ABOVE_ELEMENT',\n BELOW_CURSOR: 'BELOW_CURSOR',\n BELOW_ELEMENT: 'BELOW_ELEMENT'\n};\nconst ARROW_STYLE_DOWN = ['border-bottom-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\nconst ARROW_STYLE_UP = ['border-top-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\n\n/**\n * Creates tooltip components.\n * @ignore\n * @param {object} theme Themes to use for tooltip container, arrow,\n * and content.\n * @return {object} Object with DOM references to the container components:\n * container, arrow, content.\n */\nfunction createTooltipComponents(theme) {\n const arrow = document.createElement('div');\n if (theme.arrow) arrow.setAttribute('class', theme.arrow);\n const content = document.createElement('div');\n if (theme.content) content.setAttribute('class', theme.content);\n const container = document.createElement('div');\n if (theme.container) container.setAttribute('class', theme.container);\n container.appendChild(arrow);\n container.appendChild(content);\n document.body.appendChild(container);\n return {\n container,\n arrow,\n content\n };\n}\n\n/**\n * Generates bounding client rectangles for tooltip components.\n * @ignore\n * @param {object} tooltip DOM references to the tooltip components.\n * @param {object} tooltip.arrow\n * @param {object} tooltip.container\n * @return {{ arrow: object, container}} Object holding tooltip rectangles in\n * two fields.\n */\nfunction calcTooltipRects(tooltip) {\n return {\n arrow: tooltip.arrow.getBoundingClientRect(),\n container: tooltip.container.getBoundingClientRect()\n };\n}\n\n/**\n * Calculates the document viewport size.\n * @ignore\n * @return {{x, y, width, height}}\n */\nfunction calcViewportRect() {\n const {\n pageXOffset,\n pageYOffset\n } = window;\n const {\n documentElement: {\n clientHeight,\n clientWidth\n }\n } = document;\n return {\n left: pageXOffset,\n right: pageXOffset + clientWidth,\n top: pageYOffset,\n bottom: pageYOffset + clientHeight\n };\n}\n\n/**\n * Calculates tooltip and arrow positions for the placement just above\n * the cursor.\n * @ignore\n * @param {number} x Cursor page-x position.\n * @param {number} y Cursor page-y position.\n * @param {object} tooltipRects Bounding client rectangles of tooltip parts.\n * @param {object} tooltipRects.arrow\n * @param {object} tooltipRects.container\n * @return {object} Contains the following fields:\n * - {number} arrowX\n * - {number} arrowY\n * - {number} containerX\n * - {number} containerY\n * - {string} baseArrowStyle\n */\nfunction calcPositionAboveXY(x, y, tooltipRects) {\n const {\n arrow,\n container\n } = tooltipRects;\n return {\n arrowX: 0.5 * (container.width - arrow.width),\n arrowY: container.height,\n containerX: x - container.width / 2,\n containerY: y - container.height - arrow.height / 1.5,\n // TODO: Instead of already setting the base style here, we should\n // introduce a set of constants for arrow directions, which will help\n // to do checks dependant on the arrow direction.\n baseArrowStyle: ARROW_STYLE_DOWN\n };\n}\n\n/*\nconst HIT = {\n NONE: false,\n LEFT: 'LEFT',\n RIGHT: 'RIGHT',\n TOP: 'TOP',\n BOTTOM: 'BOTTOM',\n};\n*/\n\n/**\n * Checks whether\n * @param {object} pos\n * @param {object} tooltipRects\n * @param {object} viewportRect\n * @return {HIT}\n */\n/*\nfunction checkViewportFit(pos, tooltipRects, viewportRect) {\n const { containerX, containerY } = pos;\n if (containerX < viewportRect.left + 6) return HIT.LEFT;\n if (containerX > viewportRect.right - 6) return HIT.RIGHT;\n return HIT.NONE;\n}\n*/\n\n/**\n * Shifts tooltip horizontally to fit into the viewport, while keeping\n * the arrow pointed to the XY point.\n * @param {number} x\n * @param {number} y\n * @param {object} pos\n * @param {number} pageXOffset\n * @param {number} pageXWidth\n */\n/*\nfunction xPageFitCorrection(x, y, pos, pageXOffset, pageXWidth) {\n if (pos.containerX < pageXOffset + 6) {\n pos.containerX = pageXOffset + 6;\n pos.arrowX = Math.max(6, pageX - containerX - arrowRect.width / 2);\n } else {\n const maxX = pageXOffset + docRect.width - containerRect.width - 6;\n if (containerX > maxX) {\n containerX = maxX;\n arrowX = Math.min(\n containerRect.width - 6,\n pageX - containerX - arrowRect.width / 2,\n );\n }\n }\n}\n*/\n\n/**\n * Sets positions of tooltip components to point the tooltip to the specified\n * page point.\n * @ignore\n * @param {number} pageX\n * @param {number} pageY\n * @param {PLACEMENTS} placement\n * @param {object} element DOM reference to the element wrapped by the tooltip.\n * @param {object} tooltip\n * @param {object} tooltip.arrow DOM reference to the tooltip arrow.\n * @param {object} tooltip.container DOM reference to the tooltip container.\n */\nfunction setComponentPositions(pageX, pageY, placement, element, tooltip) {\n const tooltipRects = calcTooltipRects(tooltip);\n const viewportRect = calcViewportRect();\n\n /* Default container coords: tooltip at the top. */\n const pos = calcPositionAboveXY(pageX, pageY, tooltipRects);\n if (pos.containerX < viewportRect.left + 6) {\n pos.containerX = viewportRect.left + 6;\n pos.arrowX = Math.max(6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n } else {\n const maxX = viewportRect.right - 6 - tooltipRects.container.width;\n if (pos.containerX > maxX) {\n pos.containerX = maxX;\n pos.arrowX = Math.min(tooltipRects.container.width - 6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n }\n }\n\n /* If tooltip has not enough space on top - make it bottom tooltip. */\n if (pos.containerY < viewportRect.top + 6) {\n pos.containerY += tooltipRects.container.height + 2 * tooltipRects.arrow.height;\n pos.arrowY -= tooltipRects.container.height + tooltipRects.arrow.height;\n pos.baseArrowStyle = ARROW_STYLE_UP;\n }\n const containerStyle = `left:${pos.containerX}px;top:${pos.containerY}px`;\n tooltip.container.setAttribute('style', containerStyle);\n const arrowStyle = `${pos.baseArrowStyle};left:${pos.arrowX}px;top:${pos.arrowY}px`;\n tooltip.arrow.setAttribute('style', arrowStyle);\n}\n\n/* The Tooltip component itself. */\nconst Tooltip = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => {\n let {\n children,\n theme\n } = _ref;\n const [components, setComponents] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);\n const pointTo = (pageX, pageY, placement, element) => components && setComponentPositions(pageX, pageY, placement, element, components);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({\n pointTo\n }));\n\n /* Inits and destroys tooltip components. */\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const x = createTooltipComponents(theme);\n setComponents(x);\n return () => {\n document.body.removeChild(x.container);\n setComponents(null);\n };\n }, [theme]);\n return components ? /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, components.content) : null;\n});\nTooltip.propTypes = {\n children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),\n theme: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape().isRequired\n};\nTooltip.defaultProps = {\n children: null\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/Tooltip.jsx?");
260
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PLACEMENTS: function() { return /* binding */ PLACEMENTS; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ \"prop-types\");\n/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);\n/**\n * The actual tooltip component. It is rendered outside the regular document\n * hierarchy, and with sub-components managed without React to achieve the best\n * performance during animation.\n */\n/* global document, window */\n\n\n\n\n\n/* Valid placements of the rendered tooltip. They will be overriden when\n * necessary to fit the tooltip within the viewport. */\nconst PLACEMENTS = {\n ABOVE_CURSOR: 'ABOVE_CURSOR',\n ABOVE_ELEMENT: 'ABOVE_ELEMENT',\n BELOW_CURSOR: 'BELOW_CURSOR',\n BELOW_ELEMENT: 'BELOW_ELEMENT'\n};\nconst ARROW_STYLE_DOWN = ['border-bottom-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\nconst ARROW_STYLE_UP = ['border-top-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\n\n/**\n * Creates tooltip components.\n * @ignore\n * @param {object} theme Themes to use for tooltip container, arrow,\n * and content.\n * @return {object} Object with DOM references to the container components:\n * container, arrow, content.\n */\nfunction createTooltipComponents(theme) {\n const arrow = document.createElement('div');\n if (theme.arrow) arrow.setAttribute('class', theme.arrow);\n const content = document.createElement('div');\n if (theme.content) content.setAttribute('class', theme.content);\n const container = document.createElement('div');\n if (theme.container) container.setAttribute('class', theme.container);\n container.appendChild(arrow);\n container.appendChild(content);\n document.body.appendChild(container);\n return {\n container,\n arrow,\n content\n };\n}\n\n/**\n * Generates bounding client rectangles for tooltip components.\n * @ignore\n * @param {object} tooltip DOM references to the tooltip components.\n * @param {object} tooltip.arrow\n * @param {object} tooltip.container\n * @return {{ arrow: object, container}} Object holding tooltip rectangles in\n * two fields.\n */\nfunction calcTooltipRects(tooltip) {\n return {\n arrow: tooltip.arrow.getBoundingClientRect(),\n container: tooltip.container.getBoundingClientRect()\n };\n}\n\n/**\n * Calculates the document viewport size.\n * @ignore\n * @return {{x, y, width, height}}\n */\nfunction calcViewportRect() {\n const {\n pageXOffset,\n pageYOffset\n } = window;\n const {\n documentElement: {\n clientHeight,\n clientWidth\n }\n } = document;\n return {\n left: pageXOffset,\n right: pageXOffset + clientWidth,\n top: pageYOffset,\n bottom: pageYOffset + clientHeight\n };\n}\n\n/**\n * Calculates tooltip and arrow positions for the placement just above\n * the cursor.\n * @ignore\n * @param {number} x Cursor page-x position.\n * @param {number} y Cursor page-y position.\n * @param {object} tooltipRects Bounding client rectangles of tooltip parts.\n * @param {object} tooltipRects.arrow\n * @param {object} tooltipRects.container\n * @return {object} Contains the following fields:\n * - {number} arrowX\n * - {number} arrowY\n * - {number} containerX\n * - {number} containerY\n * - {string} baseArrowStyle\n */\nfunction calcPositionAboveXY(x, y, tooltipRects) {\n const {\n arrow,\n container\n } = tooltipRects;\n return {\n arrowX: 0.5 * (container.width - arrow.width),\n arrowY: container.height,\n containerX: x - container.width / 2,\n containerY: y - container.height - arrow.height / 1.5,\n // TODO: Instead of already setting the base style here, we should\n // introduce a set of constants for arrow directions, which will help\n // to do checks dependant on the arrow direction.\n baseArrowStyle: ARROW_STYLE_DOWN\n };\n}\n\n/*\nconst HIT = {\n NONE: false,\n LEFT: 'LEFT',\n RIGHT: 'RIGHT',\n TOP: 'TOP',\n BOTTOM: 'BOTTOM',\n};\n*/\n\n/**\n * Checks whether\n * @param {object} pos\n * @param {object} tooltipRects\n * @param {object} viewportRect\n * @return {HIT}\n */\n/*\nfunction checkViewportFit(pos, tooltipRects, viewportRect) {\n const { containerX, containerY } = pos;\n if (containerX < viewportRect.left + 6) return HIT.LEFT;\n if (containerX > viewportRect.right - 6) return HIT.RIGHT;\n return HIT.NONE;\n}\n*/\n\n/**\n * Shifts tooltip horizontally to fit into the viewport, while keeping\n * the arrow pointed to the XY point.\n * @param {number} x\n * @param {number} y\n * @param {object} pos\n * @param {number} pageXOffset\n * @param {number} pageXWidth\n */\n/*\nfunction xPageFitCorrection(x, y, pos, pageXOffset, pageXWidth) {\n if (pos.containerX < pageXOffset + 6) {\n pos.containerX = pageXOffset + 6;\n pos.arrowX = Math.max(6, pageX - containerX - arrowRect.width / 2);\n } else {\n const maxX = pageXOffset + docRect.width - containerRect.width - 6;\n if (containerX > maxX) {\n containerX = maxX;\n arrowX = Math.min(\n containerRect.width - 6,\n pageX - containerX - arrowRect.width / 2,\n );\n }\n }\n}\n*/\n\n/**\n * Sets positions of tooltip components to point the tooltip to the specified\n * page point.\n * @ignore\n * @param {number} pageX\n * @param {number} pageY\n * @param {PLACEMENTS} placement\n * @param {object} element DOM reference to the element wrapped by the tooltip.\n * @param {object} tooltip\n * @param {object} tooltip.arrow DOM reference to the tooltip arrow.\n * @param {object} tooltip.container DOM reference to the tooltip container.\n */\nfunction setComponentPositions(pageX, pageY, placement, element, tooltip) {\n const tooltipRects = calcTooltipRects(tooltip);\n const viewportRect = calcViewportRect();\n\n /* Default container coords: tooltip at the top. */\n const pos = calcPositionAboveXY(pageX, pageY, tooltipRects);\n if (pos.containerX < viewportRect.left + 6) {\n pos.containerX = viewportRect.left + 6;\n pos.arrowX = Math.max(6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n } else {\n const maxX = viewportRect.right - 6 - tooltipRects.container.width;\n if (pos.containerX > maxX) {\n pos.containerX = maxX;\n pos.arrowX = Math.min(tooltipRects.container.width - 6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n }\n }\n\n /* If tooltip has not enough space on top - make it bottom tooltip. */\n if (pos.containerY < viewportRect.top + 6) {\n pos.containerY += tooltipRects.container.height + 2 * tooltipRects.arrow.height;\n pos.arrowY -= tooltipRects.container.height + tooltipRects.arrow.height;\n pos.baseArrowStyle = ARROW_STYLE_UP;\n }\n const containerStyle = `left:${pos.containerX}px;top:${pos.containerY}px`;\n tooltip.container.setAttribute('style', containerStyle);\n const arrowStyle = `${pos.baseArrowStyle};left:${pos.arrowX}px;top:${pos.arrowY}px`;\n tooltip.arrow.setAttribute('style', arrowStyle);\n}\n\n/* The Tooltip component itself. */\nconst Tooltip = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => {\n let {\n children,\n theme\n } = _ref;\n const [components, setComponents] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);\n const pointTo = (pageX, pageY, placement, element) => components && setComponentPositions(pageX, pageY, placement, element, components);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({\n pointTo\n }));\n\n /* Inits and destroys tooltip components. */\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const x = createTooltipComponents(theme);\n setComponents(x);\n return () => {\n document.body.removeChild(x.container);\n setComponents(null);\n };\n }, [theme]);\n return components ? /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, components.content) : null;\n});\nTooltip.propTypes = {\n children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),\n theme: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape().isRequired\n};\nTooltip.defaultProps = {\n children: null\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/Tooltip.jsx?");
261
261
 
262
262
  /***/ }),
263
263
 
@@ -290,7 +290,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var prop
290
290
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
291
291
 
292
292
  "use strict";
293
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BaseModal\": function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__.BaseModal; },\n/* harmony export */ \"Button\": function() { return /* reexport safe */ _Button__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; },\n/* harmony export */ \"Checkbox\": function() { return /* reexport safe */ _Checkbox__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ \"Dropdown\": function() { return /* reexport safe */ _Dropdown__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ \"Input\": function() { return /* reexport safe */ _Input__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ \"Link\": function() { return /* reexport safe */ _Link__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ \"MetaTags\": function() { return /* reexport safe */ _MetaTags__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ \"Modal\": function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ \"NavLink\": function() { return /* reexport safe */ _NavLink__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ \"PageLayout\": function() { return /* reexport safe */ _PageLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ \"ScalableRect\": function() { return /* reexport safe */ _ScalableRect__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ \"Throbber\": function() { return /* reexport safe */ _Throbber__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ \"WithTooltip\": function() { return /* reexport safe */ _WithTooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; },\n/* harmony export */ \"YouTubeVideo\": function() { return /* reexport safe */ _YouTubeVideo__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Button */ \"./src/shared/components/Button/index.jsx\");\n/* harmony import */ var _Checkbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Checkbox */ \"./src/shared/components/Checkbox/index.jsx\");\n/* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Dropdown */ \"./src/shared/components/Dropdown/index.jsx\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Input */ \"./src/shared/components/Input/index.jsx\");\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Link */ \"./src/shared/components/Link.jsx\");\n/* harmony import */ var _PageLayout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageLayout */ \"./src/shared/components/PageLayout/index.jsx\");\n/* harmony import */ var _MetaTags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetaTags */ \"./src/shared/components/MetaTags.jsx\");\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Modal */ \"./src/shared/components/Modal/index.jsx\");\n/* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavLink */ \"./src/shared/components/NavLink.jsx\");\n/* harmony import */ var _ScalableRect__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ScalableRect */ \"./src/shared/components/ScalableRect/index.jsx\");\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Throbber */ \"./src/shared/components/Throbber/index.jsx\");\n/* harmony import */ var _WithTooltip__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./WithTooltip */ \"./src/shared/components/WithTooltip/index.jsx\");\n/* harmony import */ var _YouTubeVideo__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./YouTubeVideo */ \"./src/shared/components/YouTubeVideo/index.jsx\");\n/**\n * Just an aggregation of all exported components into a single module.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/index.js?");
293
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _Button__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _Checkbox__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _Dropdown__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ Input: function() { return /* reexport safe */ _Input__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ Link: function() { return /* reexport safe */ _Link__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _MetaTags__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _NavLink__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _PageLayout__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ ScalableRect: function() { return /* reexport safe */ _ScalableRect__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _Throbber__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _WithTooltip__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _YouTubeVideo__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; }\n/* harmony export */ });\n/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Button */ \"./src/shared/components/Button/index.jsx\");\n/* harmony import */ var _Checkbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Checkbox */ \"./src/shared/components/Checkbox/index.jsx\");\n/* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Dropdown */ \"./src/shared/components/Dropdown/index.jsx\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Input */ \"./src/shared/components/Input/index.jsx\");\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Link */ \"./src/shared/components/Link.jsx\");\n/* harmony import */ var _PageLayout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageLayout */ \"./src/shared/components/PageLayout/index.jsx\");\n/* harmony import */ var _MetaTags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetaTags */ \"./src/shared/components/MetaTags.jsx\");\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Modal */ \"./src/shared/components/Modal/index.jsx\");\n/* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavLink */ \"./src/shared/components/NavLink.jsx\");\n/* harmony import */ var _ScalableRect__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ScalableRect */ \"./src/shared/components/ScalableRect/index.jsx\");\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Throbber */ \"./src/shared/components/Throbber/index.jsx\");\n/* harmony import */ var _WithTooltip__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./WithTooltip */ \"./src/shared/components/WithTooltip/index.jsx\");\n/* harmony import */ var _YouTubeVideo__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./YouTubeVideo */ \"./src/shared/components/YouTubeVideo/index.jsx\");\n/**\n * Just an aggregation of all exported components into a single module.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/index.js?");
294
294
 
295
295
  /***/ }),
296
296
 
@@ -301,7 +301,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
301
301
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
302
302
 
303
303
  "use strict";
304
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Barrier\": function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__.Barrier; },\n/* harmony export */ \"newBarrier\": function() { return /* binding */ newBarrier; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"./node_modules/@dr.pogodin/js-utils/js/index.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__);\n\n\n\n/**\n * Creates a new Barrier.\n * @deprecated Prefer using `Barrier` class construction directly,\n * i.e. `new Barrier(executor)` instead of `newBarrier(executor)`.\n * @returns {Barrier}\n */\nfunction newBarrier(executor) {\n return new _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__.Barrier(executor);\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/Barrier.js?");
304
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__.Barrier; },\n/* harmony export */ newBarrier: function() { return /* binding */ newBarrier; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"./node_modules/@dr.pogodin/js-utils/js/index.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__);\n\n\n\n/**\n * Creates a new Barrier.\n * @deprecated Prefer using `Barrier` class construction directly,\n * i.e. `new Barrier(executor)` instead of `newBarrier(executor)`.\n * @returns {Barrier}\n */\nfunction newBarrier(executor) {\n return new _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_0__.Barrier(executor);\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/Barrier.js?");
305
305
 
306
306
  /***/ }),
307
307
 
@@ -323,7 +323,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _iso
323
323
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
324
324
 
325
325
  "use strict";
326
- eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Barrier\": function() { return /* reexport safe */ _Barrier__WEBPACK_IMPORTED_MODULE_6__.Barrier; },\n/* harmony export */ \"Emitter\": function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Emitter; },\n/* harmony export */ \"JU\": function() { return /* binding */ JU; },\n/* harmony export */ \"Semaphore\": function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Semaphore; },\n/* harmony export */ \"ThemeProvider\": function() { return /* reexport safe */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.ThemeProvider; },\n/* harmony export */ \"config\": function() { return /* reexport safe */ _config__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ \"isomorphy\": function() { return /* reexport module object */ _isomorphy__WEBPACK_IMPORTED_MODULE_2__; },\n/* harmony export */ \"newBarrier\": function() { return /* reexport safe */ _Barrier__WEBPACK_IMPORTED_MODULE_6__.newBarrier; },\n/* harmony export */ \"splitComponent\": function() { return /* reexport safe */ _splitComponent__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ \"themed\": function() { return /* reexport default from dynamic */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default.a; },\n/* harmony export */ \"time\": function() { return /* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ \"webpack\": function() { return /* reexport module object */ _webpack__WEBPACK_IMPORTED_MODULE_4__; },\n/* harmony export */ \"withRetries\": function() { return /* binding */ withRetries; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ \"./src/shared/utils/config.js\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.js\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./time */ \"./src/shared/utils/time.js\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"./node_modules/@dr.pogodin/js-utils/js/index.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _Barrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Barrier */ \"./src/shared/utils/Barrier.js\");\n/* harmony import */ var _splitComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitComponent */ \"./src/shared/utils/splitComponent.js\");\n\n\n\n\n\n\n\n\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default().COMPOSE) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.COMPOSE;\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default().PRIORITY) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.PRIORITY;\n\n// Note: it should be done this way, as in some environments\n// \"process\" might not exist, and process.env.NODE_CONFIG_ENV\n// not injected by Webpack.\nlet NODE_CONFIG_ENV;\ntry {\n NODE_CONFIG_ENV = process.env.NODE_CONFIG_ENV;\n} catch {/* noop */}\nconst env = NODE_CONFIG_ENV || \"development\";\nconst JU = env !== 'production' && _webpack__WEBPACK_IMPORTED_MODULE_4__.requireWeak('./jest', __dirname);\n\n/**\n * @category Utilities\n * @global\n * @func withRetries\n * @desc\n * ```js\n * import { withRetries } from '@dr.pogodin/react-utils';\n * ```\n * Attempts to perform given asynchronous `action` up to `maxRetries` times,\n * with the given `interval` between attempts. If any attempt is successful,\n * the result is returned immediately, with no further attempts done;\n * otherwise, if all attempts fail, the result Promise rejects after the last\n * attempt.\n * @param {function} action\n * @param {number} [maxRetries=5] Optional. Maximum number of retries. Defaults\n * to 5 attempts.\n * @param {number} [interval=1000] Optional. Interval between retries [ms].\n * Defaults to 1 second.\n * @return {Promise} Resolves to the result of successful operation, or\n * rejects with the error from the latst failed attempt.\n * @example\n * import { withRetries } from '@dr.pogodin/react-utils';\n *\n * let firstCall = true;\n *\n * function sampleAction() {\n * if (!firstCall) return 'success';\n * firstCall = false;\n * throw Error('The first call to this method fails');\n * }\n *\n * withRetries(sampleAction).then(console.log);\n * // It will print 'success' after one second, once the second attempt\n * // is performed.\n */\nasync function withRetries(action) {\n let maxRetries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;\n let interval = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n /* eslint-disable no-await-in-loop */\n for (let n = 1;; ++n) {\n try {\n return await action();\n } catch (error) {\n if (n < maxRetries) await _time__WEBPACK_IMPORTED_MODULE_3__[\"default\"].timer(interval);else throw error;\n }\n }\n /* eslint-enable no-await-in-loop */\n}\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/index.js?");
326
+ eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _Barrier__WEBPACK_IMPORTED_MODULE_6__.Barrier; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Emitter; },\n/* harmony export */ JU: function() { return /* binding */ JU; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Semaphore; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.ThemeProvider; },\n/* harmony export */ config: function() { return /* reexport safe */ _config__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ isomorphy: function() { return /* reexport module object */ _isomorphy__WEBPACK_IMPORTED_MODULE_2__; },\n/* harmony export */ newBarrier: function() { return /* reexport safe */ _Barrier__WEBPACK_IMPORTED_MODULE_6__.newBarrier; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _splitComponent__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ themed: function() { return /* reexport default from dynamic */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default.a; },\n/* harmony export */ time: function() { return /* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ webpack: function() { return /* reexport module object */ _webpack__WEBPACK_IMPORTED_MODULE_4__; },\n/* harmony export */ withRetries: function() { return /* binding */ withRetries; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ \"./src/shared/utils/config.js\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.js\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./time */ \"./src/shared/utils/time.js\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"./node_modules/@dr.pogodin/js-utils/js/index.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _Barrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Barrier */ \"./src/shared/utils/Barrier.js\");\n/* harmony import */ var _splitComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitComponent */ \"./src/shared/utils/splitComponent.js\");\n\n\n\n\n\n\n\n\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default().COMPOSE) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.COMPOSE;\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default().PRIORITY) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.PRIORITY;\n\n// Note: it should be done this way, as in some environments\n// \"process\" might not exist, and process.env.NODE_CONFIG_ENV\n// not injected by Webpack.\nlet NODE_CONFIG_ENV;\ntry {\n NODE_CONFIG_ENV = process.env.NODE_CONFIG_ENV;\n} catch {/* noop */}\nconst env = NODE_CONFIG_ENV || \"development\";\nconst JU = env !== 'production' && _webpack__WEBPACK_IMPORTED_MODULE_4__.requireWeak('./jest', __dirname);\n\n/**\n * @category Utilities\n * @global\n * @func withRetries\n * @desc\n * ```js\n * import { withRetries } from '@dr.pogodin/react-utils';\n * ```\n * Attempts to perform given asynchronous `action` up to `maxRetries` times,\n * with the given `interval` between attempts. If any attempt is successful,\n * the result is returned immediately, with no further attempts done;\n * otherwise, if all attempts fail, the result Promise rejects after the last\n * attempt.\n * @param {function} action\n * @param {number} [maxRetries=5] Optional. Maximum number of retries. Defaults\n * to 5 attempts.\n * @param {number} [interval=1000] Optional. Interval between retries [ms].\n * Defaults to 1 second.\n * @return {Promise} Resolves to the result of successful operation, or\n * rejects with the error from the latst failed attempt.\n * @example\n * import { withRetries } from '@dr.pogodin/react-utils';\n *\n * let firstCall = true;\n *\n * function sampleAction() {\n * if (!firstCall) return 'success';\n * firstCall = false;\n * throw Error('The first call to this method fails');\n * }\n *\n * withRetries(sampleAction).then(console.log);\n * // It will print 'success' after one second, once the second attempt\n * // is performed.\n */\nasync function withRetries(action) {\n let maxRetries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;\n let interval = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n /* eslint-disable no-await-in-loop */\n for (let n = 1;; ++n) {\n try {\n return await action();\n } catch (error) {\n if (n < maxRetries) await _time__WEBPACK_IMPORTED_MODULE_3__[\"default\"].timer(interval);else throw error;\n }\n }\n /* eslint-enable no-await-in-loop */\n}\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/index.js?");
327
327
 
328
328
  /***/ }),
329
329
 
@@ -334,7 +334,7 @@ eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* ha
334
334
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
335
335
 
336
336
  "use strict";
337
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getBuildInfo\": function() { return /* binding */ getBuildInfo; },\n/* harmony export */ \"setBuildInfo\": function() { return /* binding */ setBuildInfo; }\n/* harmony export */ });\n// Encapsulates access to \"Build Info\" data.\n\n/* global BUILD_INFO */\n\nlet buildInfo;\n\n// On the client side \"BUILD_INFO\" should be injected by Webpack. Note, however,\n// that in test environment we may need situations were environment is mocked as\n// client-side, although no proper Webpack compilation is executed, thus no info\n// injected; because of this we don't do a hard environment check here.\nif (typeof window.__DEV_BUILD_INFO__ !== 'undefined') buildInfo = window.__DEV_BUILD_INFO__;\n\n/**\n * In scenarious where \"BUILD_INFO\" is not injected by Webpack (server-side,\n * tests, etc.) we expect the host codebase to explicitly set it before it is\n * ever requested. As a precaution, this function throws if build info has been\n * set already, unless `force` flag is explicitly set.\n * @param {object} info\n * @param {boolean} [force=false]\n */\nfunction setBuildInfo(info) {\n let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (buildInfo !== undefined && !force) {\n throw Error('\"Build Info\" is already initialized');\n }\n buildInfo = info;\n}\n\n/**\n * Returns \"Build Info\" object; throws if it has not been initialized yet.\n * @returns {object}\n */\nfunction getBuildInfo() {\n if (buildInfo === undefined) {\n throw Error('\"Build Info\" has not been initialized yet');\n }\n return buildInfo;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/buildInfo.js?");
337
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBuildInfo: function() { return /* binding */ getBuildInfo; },\n/* harmony export */ setBuildInfo: function() { return /* binding */ setBuildInfo; }\n/* harmony export */ });\n// Encapsulates access to \"Build Info\" data.\n\n/* global BUILD_INFO */\n\nlet buildInfo;\n\n// On the client side \"BUILD_INFO\" should be injected by Webpack. Note, however,\n// that in test environment we may need situations were environment is mocked as\n// client-side, although no proper Webpack compilation is executed, thus no info\n// injected; because of this we don't do a hard environment check here.\nif (typeof window.__DEV_BUILD_INFO__ !== 'undefined') buildInfo = window.__DEV_BUILD_INFO__;\n\n/**\n * In scenarious where \"BUILD_INFO\" is not injected by Webpack (server-side,\n * tests, etc.) we expect the host codebase to explicitly set it before it is\n * ever requested. As a precaution, this function throws if build info has been\n * set already, unless `force` flag is explicitly set.\n * @param {object} info\n * @param {boolean} [force=false]\n */\nfunction setBuildInfo(info) {\n let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (buildInfo !== undefined && !force) {\n throw Error('\"Build Info\" is already initialized');\n }\n buildInfo = info;\n}\n\n/**\n * Returns \"Build Info\" object; throws if it has not been initialized yet.\n * @returns {object}\n */\nfunction getBuildInfo() {\n if (buildInfo === undefined) {\n throw Error('\"Build Info\" has not been initialized yet');\n }\n return buildInfo;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/buildInfo.js?");
338
338
 
339
339
  /***/ }),
340
340
 
@@ -345,7 +345,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
345
345
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
346
346
 
347
347
  "use strict";
348
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"IS_CLIENT_SIDE\": function() { return /* binding */ IS_CLIENT_SIDE; },\n/* harmony export */ \"IS_SERVER_SIDE\": function() { return /* binding */ IS_SERVER_SIDE; }\n/* harmony export */ });\n// Checks for client- vs. server-side environment detection.\n\n/**\n * `true` within client-side environment (browser), `false` at server-side.\n */\nconst IS_CLIENT_SIDE = typeof process !== 'object' || !process.versions || !process.versions.node || !!__webpack_require__.g.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n/**\n * `true` within the server-side environment (node), `false` at client-side.\n */\nconst IS_SERVER_SIDE = !IS_CLIENT_SIDE;\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/environment-check.js?");
348
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IS_CLIENT_SIDE: function() { return /* binding */ IS_CLIENT_SIDE; },\n/* harmony export */ IS_SERVER_SIDE: function() { return /* binding */ IS_SERVER_SIDE; }\n/* harmony export */ });\n// Checks for client- vs. server-side environment detection.\n\n/**\n * `true` within client-side environment (browser), `false` at server-side.\n */\nconst IS_CLIENT_SIDE = typeof process !== 'object' || !process.versions || !process.versions.node || !!__webpack_require__.g.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n/**\n * `true` within the server-side environment (node), `false` at client-side.\n */\nconst IS_SERVER_SIDE = !IS_CLIENT_SIDE;\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/environment-check.js?");
349
349
 
350
350
  /***/ }),
351
351
 
@@ -356,7 +356,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
356
356
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
357
357
 
358
358
  "use strict";
359
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"IS_CLIENT_SIDE\": function() { return /* reexport safe */ _environment_check__WEBPACK_IMPORTED_MODULE_1__.IS_CLIENT_SIDE; },\n/* harmony export */ \"IS_SERVER_SIDE\": function() { return /* reexport safe */ _environment_check__WEBPACK_IMPORTED_MODULE_1__.IS_SERVER_SIDE; },\n/* harmony export */ \"buildTimestamp\": function() { return /* binding */ buildTimestamp; },\n/* harmony export */ \"getBuildInfo\": function() { return /* reexport safe */ _buildInfo__WEBPACK_IMPORTED_MODULE_0__.getBuildInfo; },\n/* harmony export */ \"isDevBuild\": function() { return /* binding */ isDevBuild; },\n/* harmony export */ \"isProdBuild\": function() { return /* binding */ isProdBuild; }\n/* harmony export */ });\n/* harmony import */ var _buildInfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./buildInfo */ \"./src/shared/utils/isomorphy/buildInfo.js\");\n/* harmony import */ var _environment_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./environment-check */ \"./src/shared/utils/isomorphy/environment-check.js\");\n\n\n\n/**\n * @ignore\n * @return {string} Code mode: \"development\" or \"production\".\n */\nfunction getMode() {\n return \"development\";\n}\n\n/**\n * Returns `true` if development version of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\nfunction isDevBuild() {\n return getMode() === 'development';\n}\n\n/**\n * Returns `true` if production build of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\nfunction isProdBuild() {\n return getMode() === 'production';\n}\n\n/**\n * Returns build timestamp of the front-end JS bundle.\n * @return {string} ISO date/time string.\n */\nfunction buildTimestamp() {\n return (0,_buildInfo__WEBPACK_IMPORTED_MODULE_0__.getBuildInfo)().timestamp;\n}\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/index.js?");
359
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IS_CLIENT_SIDE: function() { return /* reexport safe */ _environment_check__WEBPACK_IMPORTED_MODULE_1__.IS_CLIENT_SIDE; },\n/* harmony export */ IS_SERVER_SIDE: function() { return /* reexport safe */ _environment_check__WEBPACK_IMPORTED_MODULE_1__.IS_SERVER_SIDE; },\n/* harmony export */ buildTimestamp: function() { return /* binding */ buildTimestamp; },\n/* harmony export */ getBuildInfo: function() { return /* reexport safe */ _buildInfo__WEBPACK_IMPORTED_MODULE_0__.getBuildInfo; },\n/* harmony export */ isDevBuild: function() { return /* binding */ isDevBuild; },\n/* harmony export */ isProdBuild: function() { return /* binding */ isProdBuild; }\n/* harmony export */ });\n/* harmony import */ var _buildInfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./buildInfo */ \"./src/shared/utils/isomorphy/buildInfo.js\");\n/* harmony import */ var _environment_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./environment-check */ \"./src/shared/utils/isomorphy/environment-check.js\");\n\n\n\n/**\n * @ignore\n * @return {string} Code mode: \"development\" or \"production\".\n */\nfunction getMode() {\n return \"development\";\n}\n\n/**\n * Returns `true` if development version of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\nfunction isDevBuild() {\n return getMode() === 'development';\n}\n\n/**\n * Returns `true` if production build of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\nfunction isProdBuild() {\n return getMode() === 'production';\n}\n\n/**\n * Returns build timestamp of the front-end JS bundle.\n * @return {string} ISO date/time string.\n */\nfunction buildTimestamp() {\n return (0,_buildInfo__WEBPACK_IMPORTED_MODULE_0__.getBuildInfo)().timestamp;\n}\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/index.js?");
360
360
 
361
361
  /***/ }),
362
362
 
@@ -378,7 +378,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
378
378
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
379
379
 
380
380
  "use strict";
381
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"useCurrent\": function() { return /* binding */ useCurrent; },\n/* harmony export */ \"useTimezoneOffset\": function() { return /* binding */ useTimezoneOffset; }\n/* harmony export */ });\n/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ \"./node_modules/cookie/index.js\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ \"dayjs\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"./node_modules/@dr.pogodin/js-utils/js/index.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__);\n/* global document */\n\n\n\n\n\n\n\n\n/**\n * This react hook wraps Date.now() function in a SSR friendly way,\n * ensuring that all calls to useCurrent() within the same render return\n * exactly the same time (which is retrieved from Date.now() first, and\n * then stored in the global state to be reused in all other calls), which\n * is also passed and used in the first client side render, and then updated\n * with a finite precision to avoid infinite re-rendering loops.\n * @param {object} [options] Optional settings.\n * @param {string} [options.globalStatePath=\"currentTime\"] Global state path\n * to keep the current time value.\n * @param {number} [options.precision= 5 * time.SEC_MS] Current time precision.\n * The hook won't update the current time stored in the global state unless it\n * is different from Date.now() result by this number (in milliseconds).\n * Default to 5 seconds.\n * @param {boolean} [options.autorefresh=false] Set `true` to automatically\n * refresh time stored in the global state with the given `precision` (and\n * thus automatically re-rendering components dependent on this hook, or\n * the global state with the period equal to the `precision`.\n * @return {number} Unix timestamp in milliseconds.\n */\nfunction useCurrent() {\n let {\n autorefresh = false,\n globalStatePath = 'currentTime',\n precision = 5 * (dayjs__WEBPACK_IMPORTED_MODULE_1___default().SEC_MS)\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const [now, setter] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__.useGlobalState)(globalStatePath, Date.now);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {\n let timerId;\n const update = () => {\n setter(old => {\n const neu = Date.now();\n return Math.abs(neu - old) > precision ? neu : old;\n });\n if (autorefresh) timerId = setTimeout(update, precision);\n };\n update();\n return () => {\n if (timerId) clearTimeout(timerId);\n };\n }, [autorefresh, precision, setter]);\n return now;\n}\n\n/**\n * Wraps the standard Date.getTimezoneOffset() method in a SSR-friendly way.\n * This hook retrieves the offset value at the client side and uses a cookie\n * to pass it to the server in subsequent requests from that user. At the server\n * side the value from cookie is used in renders and passed back to the client\n * via the global state. Prior to the value being known (in the very first\n * request from the user, when the cookie is still missing), zero value is used\n * as the default value.\n *\n * @param {object} [options] Optional settings.\n * @param {string} [options.cookieName=\"timezoneOffset\"] Optional. The name of\n * cookie to use to store the timezone offset. Defaults \"timezoneOffset\". Set\n * to a falsy value to forbid using cookies altogether (in that case the hook\n * will always return zero value at the server-side, and in the first render\n * at the client-side).\n * @param {string} [options.timezoneOffset=\"timezoneOffset\"] Optional.\n * The global state path to store the offset. Defaults \"timezoneOffset\".\n * @return {number} Timezone offset.\n */\nfunction useTimezoneOffset() {\n let {\n cookieName = 'timezoneOffset',\n globalStatePath = 'timezoneOffset'\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const ssrContext = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__.getSsrContext)(false);\n const [offset, setOffset] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__.useGlobalState)(globalStatePath, () => {\n const value = cookieName && ssrContext?.req?.cookies?.[cookieName];\n return value ? parseInt(value, 10) : 0;\n });\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {\n const date = new Date();\n const value = date.getTimezoneOffset();\n setOffset(value);\n if (cookieName) {\n document.cookie = cookie__WEBPACK_IMPORTED_MODULE_0__.serialize(cookieName, value, {\n path: '/'\n });\n }\n }, [cookieName, setOffset]);\n return offset;\n}\n(0,lodash__WEBPACK_IMPORTED_MODULE_2__.assign)((dayjs__WEBPACK_IMPORTED_MODULE_1___default()), {\n DAY_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.DAY_MS,\n HOUR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.HOUR_MS,\n MIN_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.MIN_MS,\n SEC_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.SEC_MS,\n YEAR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.YEAR_MS,\n now: Date.now,\n timer: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.timer,\n useCurrent,\n useTimezoneOffset\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = ((dayjs__WEBPACK_IMPORTED_MODULE_1___default()));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/time.js?");
381
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useCurrent: function() { return /* binding */ useCurrent; },\n/* harmony export */ useTimezoneOffset: function() { return /* binding */ useTimezoneOffset; }\n/* harmony export */ });\n/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ \"./node_modules/cookie/index.js\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ \"dayjs\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"./node_modules/@dr.pogodin/js-utils/js/index.js\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__);\n/* global document */\n\n\n\n\n\n\n\n\n/**\n * This react hook wraps Date.now() function in a SSR friendly way,\n * ensuring that all calls to useCurrent() within the same render return\n * exactly the same time (which is retrieved from Date.now() first, and\n * then stored in the global state to be reused in all other calls), which\n * is also passed and used in the first client side render, and then updated\n * with a finite precision to avoid infinite re-rendering loops.\n * @param {object} [options] Optional settings.\n * @param {string} [options.globalStatePath=\"currentTime\"] Global state path\n * to keep the current time value.\n * @param {number} [options.precision= 5 * time.SEC_MS] Current time precision.\n * The hook won't update the current time stored in the global state unless it\n * is different from Date.now() result by this number (in milliseconds).\n * Default to 5 seconds.\n * @param {boolean} [options.autorefresh=false] Set `true` to automatically\n * refresh time stored in the global state with the given `precision` (and\n * thus automatically re-rendering components dependent on this hook, or\n * the global state with the period equal to the `precision`.\n * @return {number} Unix timestamp in milliseconds.\n */\nfunction useCurrent() {\n let {\n autorefresh = false,\n globalStatePath = 'currentTime',\n precision = 5 * (dayjs__WEBPACK_IMPORTED_MODULE_1___default().SEC_MS)\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const [now, setter] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__.useGlobalState)(globalStatePath, Date.now);\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {\n let timerId;\n const update = () => {\n setter(old => {\n const neu = Date.now();\n return Math.abs(neu - old) > precision ? neu : old;\n });\n if (autorefresh) timerId = setTimeout(update, precision);\n };\n update();\n return () => {\n if (timerId) clearTimeout(timerId);\n };\n }, [autorefresh, precision, setter]);\n return now;\n}\n\n/**\n * Wraps the standard Date.getTimezoneOffset() method in a SSR-friendly way.\n * This hook retrieves the offset value at the client side and uses a cookie\n * to pass it to the server in subsequent requests from that user. At the server\n * side the value from cookie is used in renders and passed back to the client\n * via the global state. Prior to the value being known (in the very first\n * request from the user, when the cookie is still missing), zero value is used\n * as the default value.\n *\n * @param {object} [options] Optional settings.\n * @param {string} [options.cookieName=\"timezoneOffset\"] Optional. The name of\n * cookie to use to store the timezone offset. Defaults \"timezoneOffset\". Set\n * to a falsy value to forbid using cookies altogether (in that case the hook\n * will always return zero value at the server-side, and in the first render\n * at the client-side).\n * @param {string} [options.timezoneOffset=\"timezoneOffset\"] Optional.\n * The global state path to store the offset. Defaults \"timezoneOffset\".\n * @return {number} Timezone offset.\n */\nfunction useTimezoneOffset() {\n let {\n cookieName = 'timezoneOffset',\n globalStatePath = 'timezoneOffset'\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const ssrContext = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__.getSsrContext)(false);\n const [offset, setOffset] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_5__.useGlobalState)(globalStatePath, () => {\n const value = cookieName && ssrContext?.req?.cookies?.[cookieName];\n return value ? parseInt(value, 10) : 0;\n });\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {\n const date = new Date();\n const value = date.getTimezoneOffset();\n setOffset(value);\n if (cookieName) {\n document.cookie = cookie__WEBPACK_IMPORTED_MODULE_0__.serialize(cookieName, value, {\n path: '/'\n });\n }\n }, [cookieName, setOffset]);\n return offset;\n}\n(0,lodash__WEBPACK_IMPORTED_MODULE_2__.assign)((dayjs__WEBPACK_IMPORTED_MODULE_1___default()), {\n DAY_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.DAY_MS,\n HOUR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.HOUR_MS,\n MIN_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.MIN_MS,\n SEC_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.SEC_MS,\n YEAR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.YEAR_MS,\n now: Date.now,\n timer: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_4__.timer,\n useCurrent,\n useTimezoneOffset\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = ((dayjs__WEBPACK_IMPORTED_MODULE_1___default()));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/time.js?");
382
382
 
383
383
  /***/ }),
384
384
 
@@ -389,7 +389,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
389
389
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
390
390
 
391
391
  "use strict";
392
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"requireWeak\": function() { return /* binding */ requireWeak; },\n/* harmony export */ \"resolveWeak\": function() { return /* binding */ resolveWeak; }\n/* harmony export */ });\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.js\");\n\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param {string} modulePath\n * @param {string} [basePath]\n * @return {object} Required module.\n */\nfunction requireWeak(modulePath, basePath) {\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE) return null;\n try {\n /* eslint-disable no-eval */\n const {\n resolve\n } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const {\n default: def,\n ...named\n } = eval('require')(path);\n /* eslint-enable no-eval */\n\n if (!def) return named;\n Object.entries(named).forEach(_ref => {\n let [key, value] = _ref;\n if (def[key]) throw Error('Conflict between default and named exports');\n def[key] = value;\n });\n return def;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nfunction resolveWeak(modulePath) {\n return modulePath;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/webpack.js?");
392
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ requireWeak: function() { return /* binding */ requireWeak; },\n/* harmony export */ resolveWeak: function() { return /* binding */ resolveWeak; }\n/* harmony export */ });\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.js\");\n\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param {string} modulePath\n * @param {string} [basePath]\n * @return {object} Required module.\n */\nfunction requireWeak(modulePath, basePath) {\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE) return null;\n try {\n /* eslint-disable no-eval */\n const {\n resolve\n } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const {\n default: def,\n ...named\n } = eval('require')(path);\n /* eslint-enable no-eval */\n\n if (!def) return named;\n Object.entries(named).forEach(_ref => {\n let [key, value] = _ref;\n if (def[key]) throw Error('Conflict between default and named exports');\n def[key] = value;\n });\n return def;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nfunction resolveWeak(modulePath) {\n return modulePath;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/webpack.js?");
393
393
 
394
394
  /***/ }),
395
395
 
@@ -1 +1 @@
1
- {"version":3,"file":"getInj.js","names":["_forge","_interopRequireDefault","require","_buildInfo","inj","document","querySelector","remove","key","getBuildInfo","forge","util","decode64","content","d","cipher","createDecipher","start","iv","slice","length","update","createBuffer","finish","decodeUtf8","output","data","eval","getInj"],"sources":["../../../src/client/getInj.js"],"sourcesContent":["// Encapsulates retrieval of server-side data injection into HTML template.\n\n/* global document */\n\n// Note: this way, only required part of \"node-forge\": AES, and some utils,\n// is bundled into client-side code.\nimport forge from 'node-forge/lib/forge';\nimport 'node-forge/lib/aes';\n\nimport { getBuildInfo } from 'utils/isomorphy/buildInfo';\n\n// Safeguard is needed here, because the server-side version of Docusaurus docs\n// is compiled (at least now) with settings suggesting it is a client-side\n// environment, but there is no document.\nlet inj = typeof document !== 'undefined'\n && document.querySelector('meta[itemprop=\"drpruinj\"]');\n\nif (inj) {\n inj.remove();\n const { key } = getBuildInfo();\n inj = forge.util.decode64(inj.content);\n const d = forge.cipher.createDecipher('AES-CBC', key);\n d.start({ iv: inj.slice(0, key.length) });\n d.update(forge.util.createBuffer(inj.slice(key.length)));\n d.finish();\n inj = forge.util.decodeUtf8(d.output.data);\n inj = eval(`(${inj})`); // eslint-disable-line no-eval\n} else {\n // Otherwise, a bunch of dependent stuff will easily fail in non-standard\n // environments, where no client-side initialization is performed. Like tests,\n // Docusaurus examples, etc.\n inj = {};\n}\n\nexport default function getInj() {\n return inj;\n}\n"],"mappings":"gLAMA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,0BACAA,OAAA,uBAEA,IAAAC,UAAA,CAAAD,OAAA,wCATA;AAEA,sBAEA;AACA;AAMA;AACA;AACA;AACA,GAAI,CAAAE,GAAG,CAAG,MAAO,CAAAC,QAAQ,GAAK,WAAW,EACpCA,QAAQ,CAACC,aAAa,CAAC,6BAA2B,CAAC,CAExD,GAAIF,GAAG,CAAE,CACPA,GAAG,CAACG,MAAM,EAAE,CACZ,KAAM,CAAEC,GAAI,CAAC,CAAG,GAAAC,uBAAY,GAAE,CAC9BL,GAAG,CAAGM,cAAK,CAACC,IAAI,CAACC,QAAQ,CAACR,GAAG,CAACS,OAAO,CAAC,CACtC,KAAM,CAAAC,CAAC,CAAGJ,cAAK,CAACK,MAAM,CAACC,cAAc,CAAC,SAAS,CAAER,GAAG,CAAC,CACrDM,CAAC,CAACG,KAAK,CAAC,CAAEC,EAAE,CAAEd,GAAG,CAACe,KAAK,CAAC,CAAC,CAAEX,GAAG,CAACY,MAAM,CAAE,CAAC,CAAC,CACzCN,CAAC,CAACO,MAAM,CAACX,cAAK,CAACC,IAAI,CAACW,YAAY,CAAClB,GAAG,CAACe,KAAK,CAACX,GAAG,CAACY,MAAM,CAAC,CAAC,CAAC,CACxDN,CAAC,CAACS,MAAM,EAAE,CACVnB,GAAG,CAAGM,cAAK,CAACC,IAAI,CAACa,UAAU,CAACV,CAAC,CAACW,MAAM,CAACC,IAAI,CAAC,CAC1CtB,GAAG,CAAGuB,IAAI,CAAE,IAAGvB,GAAI,GAAE,CAAC,CAAE;AAC1B,CAAC,IAAM,CACL;AACA;AACA;AACAA,GAAG,CAAG,CAAC,CACT,CAEe,QAAS,CAAAwB,MAAMA,CAAA,CAAG,CAC/B,MAAO,CAAAxB,GACT"}
1
+ {"version":3,"file":"getInj.js","names":["_forge","_interopRequireDefault","require","_buildInfo","inj","document","querySelector","remove","key","getBuildInfo","forge","util","decode64","content","d","cipher","createDecipher","start","iv","slice","length","update","createBuffer","finish","decodeUtf8","output","data","eval","getInj"],"sources":["../../../src/client/getInj.js"],"sourcesContent":["// Encapsulates retrieval of server-side data injection into HTML template.\n\n/* global document */\n\n// Note: this way, only required part of \"node-forge\": AES, and some utils,\n// is bundled into client-side code.\nimport forge from 'node-forge/lib/forge';\nimport 'node-forge/lib/aes';\n\nimport { getBuildInfo } from 'utils/isomorphy/buildInfo';\n\n// Safeguard is needed here, because the server-side version of Docusaurus docs\n// is compiled (at least now) with settings suggesting it is a client-side\n// environment, but there is no document.\nlet inj = typeof document !== 'undefined'\n && document.querySelector('meta[itemprop=\"drpruinj\"]');\n\nif (inj) {\n inj.remove();\n const { key } = getBuildInfo();\n inj = forge.util.decode64(inj.content);\n const d = forge.cipher.createDecipher('AES-CBC', key);\n d.start({ iv: inj.slice(0, key.length) });\n d.update(forge.util.createBuffer(inj.slice(key.length)));\n d.finish();\n inj = forge.util.decodeUtf8(d.output.data);\n inj = eval(`(${inj})`); // eslint-disable-line no-eval\n} else {\n // Otherwise, a bunch of dependent stuff will easily fail in non-standard\n // environments, where no client-side initialization is performed. Like tests,\n // Docusaurus examples, etc.\n inj = {};\n}\n\nexport default function getInj() {\n return inj;\n}\n"],"mappings":"gLAMA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,0BACAA,OAAA,uBAEA,IAAAC,UAAA,CAAAD,OAAA,wCATA;AAEA,sBAEA;AACA;AAMA;AACA;AACA;AACA,GAAI,CAAAE,GAAG,CAAG,MAAO,CAAAC,QAAQ,GAAK,WAAW,EACpCA,QAAQ,CAACC,aAAa,CAAC,6BAA2B,CAAC,CAExD,GAAIF,GAAG,CAAE,CACPA,GAAG,CAACG,MAAM,CAAC,CAAC,CACZ,KAAM,CAAEC,GAAI,CAAC,CAAG,GAAAC,uBAAY,EAAC,CAAC,CAC9BL,GAAG,CAAGM,cAAK,CAACC,IAAI,CAACC,QAAQ,CAACR,GAAG,CAACS,OAAO,CAAC,CACtC,KAAM,CAAAC,CAAC,CAAGJ,cAAK,CAACK,MAAM,CAACC,cAAc,CAAC,SAAS,CAAER,GAAG,CAAC,CACrDM,CAAC,CAACG,KAAK,CAAC,CAAEC,EAAE,CAAEd,GAAG,CAACe,KAAK,CAAC,CAAC,CAAEX,GAAG,CAACY,MAAM,CAAE,CAAC,CAAC,CACzCN,CAAC,CAACO,MAAM,CAACX,cAAK,CAACC,IAAI,CAACW,YAAY,CAAClB,GAAG,CAACe,KAAK,CAACX,GAAG,CAACY,MAAM,CAAC,CAAC,CAAC,CACxDN,CAAC,CAACS,MAAM,CAAC,CAAC,CACVnB,GAAG,CAAGM,cAAK,CAACC,IAAI,CAACa,UAAU,CAACV,CAAC,CAACW,MAAM,CAACC,IAAI,CAAC,CAC1CtB,GAAG,CAAGuB,IAAI,CAAE,IAAGvB,GAAI,GAAE,CAAC,CAAE;AAC1B,CAAC,IAAM,CACL;AACA;AACA;AACAA,GAAG,CAAG,CAAC,CACT,CAEe,QAAS,CAAAwB,MAAMA,CAAA,CAAG,CAC/B,MAAO,CAAAxB,GACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_reactGlobalState","require","_client","_reactRouterDom","_getInj","_interopRequireDefault","_jsxRuntime","Launch","Application","options","arguments","length","undefined","container","document","getElementById","scene","jsx","GlobalStateProvider","initialState","getInj","ISTATE","children","BrowserRouter","dontHydrate","root","createRoot","render","hydrateRoot"],"sources":["../../../src/client/index.jsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\n\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport getInj from './getInj';\n\n/**\n * Prepares and launches the app at client side.\n * @param {object} Application Root application component\n * @param {object} [options={}] Optional. Additional settings.\n */\nexport default function Launch(Application, options = {}) {\n const container = document.getElementById('react-view');\n const scene = (\n <GlobalStateProvider initialState={getInj().ISTATE}>\n <BrowserRouter>\n <Application />\n </BrowserRouter>\n </GlobalStateProvider>\n );\n\n if (options.dontHydrate) {\n const root = createRoot(container);\n root.render(scene);\n } else hydrateRoot(container, scene);\n}\n"],"mappings":"gLAGA,IAAAA,iBAAA,CAAAC,OAAA,mCAEA,IAAAC,OAAA,CAAAD,OAAA,qBACA,IAAAE,eAAA,CAAAF,OAAA,qBAEA,IAAAG,OAAA,CAAAC,sBAAA,CAAAJ,OAAA,cAA8B,IAAAK,WAAA,CAAAL,OAAA,sBAR9B;AACA,sBASA;AACA;AACA;AACA;AACA,GACe,QAAS,CAAAM,MAAMA,CAACC,WAAW,CAAgB,IAAd,CAAAC,OAAO,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CACtD,KAAM,CAAAG,SAAS,CAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC,CACvD,KAAM,CAAAC,KAAK,cACT,GAAAV,WAAA,CAAAW,GAAA,EAACjB,iBAAA,CAAAkB,mBAAmB,EAACC,YAAY,CAAE,GAAAC,eAAM,GAAE,CAACC,MAAO,CAAAC,QAAA,cACjD,GAAAhB,WAAA,CAAAW,GAAA,EAACd,eAAA,CAAAoB,aAAa,EAAAD,QAAA,cACZ,GAAAhB,WAAA,CAAAW,GAAA,EAACT,WAAW,IAAG,EACD,EAEnB,CAED,GAAIC,OAAO,CAACe,WAAW,CAAE,CACvB,KAAM,CAAAC,IAAI,CAAG,GAAAC,kBAAU,EAACb,SAAS,CAAC,CAClCY,IAAI,CAACE,MAAM,CAACX,KAAK,CACnB,CAAC,IAAM,GAAAY,mBAAW,EAACf,SAAS,CAAEG,KAAK,CACrC"}
1
+ {"version":3,"file":"index.js","names":["_reactGlobalState","require","_client","_reactRouterDom","_getInj","_interopRequireDefault","_jsxRuntime","Launch","Application","options","arguments","length","undefined","container","document","getElementById","scene","jsx","GlobalStateProvider","initialState","getInj","ISTATE","children","BrowserRouter","dontHydrate","root","createRoot","render","hydrateRoot"],"sources":["../../../src/client/index.jsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\n\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport getInj from './getInj';\n\n/**\n * Prepares and launches the app at client side.\n * @param {object} Application Root application component\n * @param {object} [options={}] Optional. Additional settings.\n */\nexport default function Launch(Application, options = {}) {\n const container = document.getElementById('react-view');\n const scene = (\n <GlobalStateProvider initialState={getInj().ISTATE}>\n <BrowserRouter>\n <Application />\n </BrowserRouter>\n </GlobalStateProvider>\n );\n\n if (options.dontHydrate) {\n const root = createRoot(container);\n root.render(scene);\n } else hydrateRoot(container, scene);\n}\n"],"mappings":"gLAGA,IAAAA,iBAAA,CAAAC,OAAA,mCAEA,IAAAC,OAAA,CAAAD,OAAA,qBACA,IAAAE,eAAA,CAAAF,OAAA,qBAEA,IAAAG,OAAA,CAAAC,sBAAA,CAAAJ,OAAA,cAA8B,IAAAK,WAAA,CAAAL,OAAA,sBAR9B;AACA,sBASA;AACA;AACA;AACA;AACA,GACe,QAAS,CAAAM,MAAMA,CAACC,WAAW,CAAgB,IAAd,CAAAC,OAAO,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CACtD,KAAM,CAAAG,SAAS,CAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC,CACvD,KAAM,CAAAC,KAAK,cACT,GAAAV,WAAA,CAAAW,GAAA,EAACjB,iBAAA,CAAAkB,mBAAmB,EAACC,YAAY,CAAE,GAAAC,eAAM,EAAC,CAAC,CAACC,MAAO,CAAAC,QAAA,cACjD,GAAAhB,WAAA,CAAAW,GAAA,EAACd,eAAA,CAAAoB,aAAa,EAAAD,QAAA,cACZ,GAAAhB,WAAA,CAAAW,GAAA,EAACT,WAAW,GAAE,CAAC,CACF,CAAC,CACG,CACtB,CAED,GAAIC,OAAO,CAACe,WAAW,CAAE,CACvB,KAAM,CAAAC,IAAI,CAAG,GAAAC,kBAAU,EAACb,SAAS,CAAC,CAClCY,IAAI,CAACE,MAAM,CAACX,KAAK,CACnB,CAAC,IAAM,GAAAY,mBAAW,EAACf,SAAS,CAAEG,KAAK,CACrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","names":["_buildInfo","require","buildInfo","getBuildInfo","process","env","NODE_ENV","console","warn","window","__DEV_BUILD_INFO__","BUILD_INFO","useServiceWorker","navigator","addEventListener","reg","serviceWorker","register","log","err"],"sources":["../../../src/client/init.js"],"sourcesContent":["/**\n * Initialization of client-side environment.\n */\n\n/* global BUILD_INFO, window */\n\nimport { getBuildInfo } from 'utils/isomorphy/buildInfo';\n\nconst buildInfo = getBuildInfo();\n\nif (process.env.NODE_ENV !== 'production') {\n console.warn('Dev mode: \"BUILD_INFO\" attached to the global \"window\"');\n // eslint-disable-next-line no-underscore-dangle\n window.__DEV_BUILD_INFO__ = BUILD_INFO;\n}\n\n/* TODO: A proper logger should be moved to `@dr.pogodin/react-utils`. */\n/* eslint-disable no-console */\nconst { useServiceWorker } = buildInfo;\nif (useServiceWorker) {\n const { navigator } = window;\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', async () => {\n try {\n // Note: no matter the \"publicPath\", we want to serve the service worker\n // from the web app root, to allow it control any and all pages of the\n // web app (otherwise, it will be restricted to the scope of its path).\n // The server takes it into account.\n const reg = await navigator\n .serviceWorker.register('/__service-worker.js');\n console.log('SW registered:', reg);\n } catch (err) {\n console.log('SW registration failed:', err);\n }\n });\n }\n}\n/* eslint-enable no-console */\n"],"mappings":"aAMA,IAAAA,UAAA,CAAAC,OAAA,wCANA;AACA;AACA,GAFA,CAIA,+BAIA,KAAM,CAAAC,SAAS,CAAG,GAAAC,uBAAY,GAAE,CAEhC,GAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,GAAK,YAAY,CAAE,CACzCC,OAAO,CAACC,IAAI,CAAC,4DAAwD,CAAC,CACtE;AACAC,MAAM,CAACC,kBAAkB,CAAGC,UAC9B,CAEA,0EACA,+BACA,KAAM,CAAEC,gBAAiB,CAAC,CAAGV,SAAS,CACtC,GAAIU,gBAAgB,CAAE,CACpB,KAAM,CAAEC,SAAU,CAAC,CAAGJ,MAAM,CAC5B,GAAI,eAAe,EAAI,CAAAI,SAAS,CAAE,CAChCJ,MAAM,CAACK,gBAAgB,CAAC,MAAM,CAAE,SAAY,CAC1C,GAAI,CACF;AACA;AACA;AACA;AACA,KAAM,CAAAC,GAAG,CAAG,KAAM,CAAAF,SAAS,CACxBG,aAAa,CAACC,QAAQ,CAAC,sBAAsB,CAAC,CACjDV,OAAO,CAACW,GAAG,CAAC,gBAAgB,CAAEH,GAAG,CACnC,CAAE,MAAOI,GAAG,CAAE,CACZZ,OAAO,CAACW,GAAG,CAAC,yBAAyB,CAAEC,GAAG,CAC5C,CACF,CAAC,CACH,CACF,CACA"}
1
+ {"version":3,"file":"init.js","names":["_buildInfo","require","buildInfo","getBuildInfo","process","env","NODE_ENV","console","warn","window","__DEV_BUILD_INFO__","BUILD_INFO","useServiceWorker","navigator","addEventListener","reg","serviceWorker","register","log","err"],"sources":["../../../src/client/init.js"],"sourcesContent":["/**\n * Initialization of client-side environment.\n */\n\n/* global BUILD_INFO, window */\n\nimport { getBuildInfo } from 'utils/isomorphy/buildInfo';\n\nconst buildInfo = getBuildInfo();\n\nif (process.env.NODE_ENV !== 'production') {\n console.warn('Dev mode: \"BUILD_INFO\" attached to the global \"window\"');\n // eslint-disable-next-line no-underscore-dangle\n window.__DEV_BUILD_INFO__ = BUILD_INFO;\n}\n\n/* TODO: A proper logger should be moved to `@dr.pogodin/react-utils`. */\n/* eslint-disable no-console */\nconst { useServiceWorker } = buildInfo;\nif (useServiceWorker) {\n const { navigator } = window;\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', async () => {\n try {\n // Note: no matter the \"publicPath\", we want to serve the service worker\n // from the web app root, to allow it control any and all pages of the\n // web app (otherwise, it will be restricted to the scope of its path).\n // The server takes it into account.\n const reg = await navigator\n .serviceWorker.register('/__service-worker.js');\n console.log('SW registered:', reg);\n } catch (err) {\n console.log('SW registration failed:', err);\n }\n });\n }\n}\n/* eslint-enable no-console */\n"],"mappings":"aAMA,IAAAA,UAAA,CAAAC,OAAA,wCANA;AACA;AACA,GAFA,CAIA,+BAIA,KAAM,CAAAC,SAAS,CAAG,GAAAC,uBAAY,EAAC,CAAC,CAEhC,GAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,GAAK,YAAY,CAAE,CACzCC,OAAO,CAACC,IAAI,CAAC,4DAAwD,CAAC,CACtE;AACAC,MAAM,CAACC,kBAAkB,CAAGC,UAC9B,CAEA,0EACA,+BACA,KAAM,CAAEC,gBAAiB,CAAC,CAAGV,SAAS,CACtC,GAAIU,gBAAgB,CAAE,CACpB,KAAM,CAAEC,SAAU,CAAC,CAAGJ,MAAM,CAC5B,GAAI,eAAe,EAAI,CAAAI,SAAS,CAAE,CAChCJ,MAAM,CAACK,gBAAgB,CAAC,MAAM,CAAE,SAAY,CAC1C,GAAI,CACF;AACA;AACA;AACA;AACA,KAAM,CAAAC,GAAG,CAAG,KAAM,CAAAF,SAAS,CACxBG,aAAa,CAACC,QAAQ,CAAC,sBAAsB,CAAC,CACjDV,OAAO,CAACW,GAAG,CAAC,gBAAgB,CAAEH,GAAG,CACnC,CAAE,MAAOI,GAAG,CAAE,CACZZ,OAAO,CAACW,GAAG,CAAC,yBAAyB,CAAEC,GAAG,CAC5C,CACF,CAAC,CACH,CACF,CACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_utils","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_axios","_interopRequireDefault","_PT","_interopRequireWildcard","PT","_reactGlobalState","_components","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","server","webpack","requireWeak","__dirname","client","undefined"],"sources":["../../src/index.js"],"sourcesContent":["import 'styles/global.scss';\n\nimport { webpack } from 'utils';\n\nconst server = webpack.requireWeak('./server', __dirname);\n\nconst client = server ? undefined : require('./client').default;\n\nexport { default as api } from 'axios';\nexport * as PT from 'prop-types';\n\nexport {\n getGlobalState,\n getSsrContext,\n GlobalStateProvider,\n useAsyncCollection,\n useAsyncData,\n useGlobalState,\n} from '@dr.pogodin/react-global-state';\n\nexport * from 'components';\nexport * from 'utils';\n\nexport { client, server };\n"],"mappings":"stCAEA,IAAAA,MAAA,CAAAC,OAAA,mBAmBAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,UAAAC,GAAA,KAAAA,GAAA,cAAAA,GAAA,0BAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,CAAAJ,GAAA,YAAAA,GAAA,IAAAK,OAAA,EAAAA,OAAA,CAAAL,GAAA,IAAAL,MAAA,CAAAK,GAAA,SAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,CAAAL,GAAA,EAAAO,UAAA,MAAAC,GAAA,SAAAA,CAAA,SAAAb,MAAA,CAAAK,GAAA,OAbA,IAAAS,MAAA,CAAAC,sBAAA,CAAAd,OAAA,WAAuC,IAAAe,GAAA,CAAAC,uBAAA,CAAAhB,OAAA,gBAAAS,OAAA,CAAAQ,EAAA,CAAAF,GAAA,CAGvC,IAAAG,iBAAA,CAAAlB,OAAA,mCASA,IAAAmB,WAAA,CAAAnB,OAAA,wBAAAC,MAAA,CAAAC,IAAA,CAAAiB,WAAA,EAAAhB,OAAA,UAAAC,GAAA,KAAAA,GAAA,cAAAA,GAAA,0BAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,CAAAJ,GAAA,YAAAA,GAAA,IAAAK,OAAA,EAAAA,OAAA,CAAAL,GAAA,IAAAe,WAAA,CAAAf,GAAA,SAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,CAAAL,GAAA,EAAAO,UAAA,MAAAC,GAAA,SAAAA,CAAA,SAAAO,WAAA,CAAAf,GAAA,OAA2B,SAAAgB,yBAAAC,WAAA,YAAAC,OAAA,8BAAAC,iBAAA,KAAAD,OAAA,KAAAE,gBAAA,KAAAF,OAAA,QAAAF,wBAAA,SAAAA,CAAAC,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":3,"file":"index.js","names":["_utils","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_axios","_interopRequireDefault","_PT","_interopRequireWildcard","PT","_reactGlobalState","_components","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","server","webpack","requireWeak","__dirname","client","undefined"],"sources":["../../src/index.js"],"sourcesContent":["import 'styles/global.scss';\n\nimport { webpack } from 'utils';\n\nconst server = webpack.requireWeak('./server', __dirname);\n\nconst client = server ? undefined : require('./client').default;\n\nexport { default as api } from 'axios';\nexport * as PT from 'prop-types';\n\nexport {\n getGlobalState,\n getSsrContext,\n GlobalStateProvider,\n useAsyncCollection,\n useAsyncData,\n useGlobalState,\n} from '@dr.pogodin/react-global-state';\n\nexport * from 'components';\nexport * from 'utils';\n\nexport { client, server };\n"],"mappings":"stCAEA,IAAAA,MAAA,CAAAC,OAAA,mBAmBAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,UAAAC,GAAA,KAAAA,GAAA,cAAAA,GAAA,0BAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,CAAAJ,GAAA,YAAAA,GAAA,IAAAK,OAAA,EAAAA,OAAA,CAAAL,GAAA,IAAAL,MAAA,CAAAK,GAAA,SAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,CAAAL,GAAA,EAAAO,UAAA,MAAAC,GAAA,SAAAA,CAAA,SAAAb,MAAA,CAAAK,GAAA,OAbA,IAAAS,MAAA,CAAAC,sBAAA,CAAAd,OAAA,WAAuC,IAAAe,GAAA,CAAAC,uBAAA,CAAAhB,OAAA,gBAAAS,OAAA,CAAAQ,EAAA,CAAAF,GAAA,CAGvC,IAAAG,iBAAA,CAAAlB,OAAA,mCASA,IAAAmB,WAAA,CAAAnB,OAAA,wBAAAC,MAAA,CAAA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AAAS,cAAA,CAAAoB,MAAA,CAAA1B,GAAA,CAAA6B,IAAA,OAAAH,MAAA,CAAA1B,GAAA,EAAAqB,GAAA,CAAArB,GAAA,IAAA0B,MAAA,CAAAH,OAAA,CAAAF,GAAA,IAAAG,KAAA,EAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,CAAAK,MAAA,SAAAA,MAAA,CAhB3B,KAAM,CAAAK,MAAM,CAAGC,cAAO,CAACC,WAAW,YAAaC,SAAS,CAAC,CAAC7B,OAAA,CAAA0B,MAAA,CAAAA,MAAA,CAE1D,KAAM,CAAAI,MAAM,CAAGJ,MAAM,CAAGK,SAAS,CAAGxC,OAAO,WAAW,CAAC,CAAC2B,OAAO,CAAClB,OAAA,CAAA8B,MAAA,CAAAA,MAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Cache.js","names":["Cache","constructor","maxSize","private","items","size","get","key","maxage","Number","MAX_VALUE","item","Date","now","timestamp","data","add","p","old","length","Object","entries","sort","a","b","i","exports","default"],"sources":["../../../src/server/Cache.js"],"sourcesContent":["/**\n * Implements the static cache.\n * @ignore\n */\nexport default class Cache {\n constructor(maxSize) {\n this.private = {\n items: {},\n maxSize,\n size: 0,\n };\n }\n\n /**\n * Cache lookup.\n * @ignore\n * @param {string} key Item key to look for.\n * @param {number} [maxage=Number.MAX_VALUE] Optional. The maximum age of\n * cached item to serve. Default to infinite.\n * @returns {string} Cached item, or null if the item is absent in cache,\n * or stale.\n */\n get({ key, maxage = Number.MAX_VALUE }) {\n const item = this.private.items[key];\n return item && Date.now() - item.timestamp < maxage ? item.data : null;\n }\n\n /**\n * Adds item to cache.\n * @ignore\n * @param {string} data Item to add.\n * @param {string} key Key to store the item at.\n */\n add(data, key) {\n const p = this.private;\n const old = p.items[key];\n if (old) p.size -= old.data.length;\n p.items[key] = { data, timestamp: Date.now() };\n p.size += data.length;\n if (p.size > p.maxSize) {\n const items = Object.entries(p.items);\n items.sort((a, b) => a[1].timestamp - b[1].timestamp);\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n delete p.items[item[0]];\n p.size -= item[1].data.length;\n if (p.size < p.maxSize / 2) break;\n }\n }\n }\n}\n"],"mappings":"6FAAA;AACA;AACA;AACA,GACe,KAAM,CAAAA,KAAM,CACzBC,WAAWA,CAACC,OAAO,CAAE,CACnB,IAAI,CAACC,OAAO,CAAG,CACbC,KAAK,CAAE,CAAC,CAAC,CACTF,OAAO,CACPG,IAAI,CAAE,CACR,CACF,CAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KACEC,GAAGA,CAAC,CAAEC,GAAG,CAAEC,MAAM,CAAGC,MAAM,CAACC,SAAU,CAAC,CAAE,CACtC,KAAM,CAAAC,IAAI,CAAG,IAAI,CAACR,OAAO,CAACC,KAAK,CAACG,GAAG,CAAC,CACpC,MAAO,CAAAI,IAAI,EAAIC,IAAI,CAACC,GAAG,EAAE,CAAGF,IAAI,CAACG,SAAS,CAAGN,MAAM,CAAGG,IAAI,CAACI,IAAI,CAAG,IACpE,CAEA;AACF;AACA;AACA;AACA;AACA,KACEC,GAAGA,CAACD,IAAI,CAAER,GAAG,CAAE,CACb,KAAM,CAAAU,CAAC,CAAG,IAAI,CAACd,OAAO,CACtB,KAAM,CAAAe,GAAG,CAAGD,CAAC,CAACb,KAAK,CAACG,GAAG,CAAC,CACxB,GAAIW,GAAG,CAAED,CAAC,CAACZ,IAAI,EAAIa,GAAG,CAACH,IAAI,CAACI,MAAM,CAClCF,CAAC,CAACb,KAAK,CAACG,GAAG,CAAC,CAAG,CAAEQ,IAAI,CAAED,SAAS,CAAEF,IAAI,CAACC,GAAG,EAAG,CAAC,CAC9CI,CAAC,CAACZ,IAAI,EAAIU,IAAI,CAACI,MAAM,CACrB,GAAIF,CAAC,CAACZ,IAAI,CAAGY,CAAC,CAACf,OAAO,CAAE,CACtB,KAAM,CAAAE,KAAK,CAAGgB,MAAM,CAACC,OAAO,CAACJ,CAAC,CAACb,KAAK,CAAC,CACrCA,KAAK,CAACkB,IAAI,CAAC,CAACC,CAAC,CAAEC,CAAC,GAAKD,CAAC,CAAC,CAAC,CAAC,CAACT,SAAS,CAAGU,CAAC,CAAC,CAAC,CAAC,CAACV,SAAS,CAAC,CACrD,IAAK,GAAI,CAAAW,CAAC,CAAG,CAAC,CAAEA,CAAC,CAAGrB,KAAK,CAACe,MAAM,CAAE,EAAEM,CAAC,CAAE,CACrC,KAAM,CAAAd,IAAI,CAAGP,KAAK,CAACqB,CAAC,CAAC,CACrB,MAAO,CAAAR,CAAC,CAACb,KAAK,CAACO,IAAI,CAAC,CAAC,CAAC,CAAC,CACvBM,CAAC,CAACZ,IAAI,EAAIM,IAAI,CAAC,CAAC,CAAC,CAACI,IAAI,CAACI,MAAM,CAC7B,GAAIF,CAAC,CAACZ,IAAI,CAAGY,CAAC,CAACf,OAAO,CAAG,CAAC,CAAE,KAC9B,CACF,CACF,CACF,CAACwB,OAAA,CAAAC,OAAA,CAAA3B,KAAA"}
1
+ {"version":3,"file":"Cache.js","names":["Cache","constructor","maxSize","private","items","size","get","key","maxage","Number","MAX_VALUE","item","Date","now","timestamp","data","add","p","old","length","Object","entries","sort","a","b","i","exports","default"],"sources":["../../../src/server/Cache.js"],"sourcesContent":["/**\n * Implements the static cache.\n * @ignore\n */\nexport default class Cache {\n constructor(maxSize) {\n this.private = {\n items: {},\n maxSize,\n size: 0,\n };\n }\n\n /**\n * Cache lookup.\n * @ignore\n * @param {string} key Item key to look for.\n * @param {number} [maxage=Number.MAX_VALUE] Optional. The maximum age of\n * cached item to serve. Default to infinite.\n * @returns {string} Cached item, or null if the item is absent in cache,\n * or stale.\n */\n get({ key, maxage = Number.MAX_VALUE }) {\n const item = this.private.items[key];\n return item && Date.now() - item.timestamp < maxage ? item.data : null;\n }\n\n /**\n * Adds item to cache.\n * @ignore\n * @param {string} data Item to add.\n * @param {string} key Key to store the item at.\n */\n add(data, key) {\n const p = this.private;\n const old = p.items[key];\n if (old) p.size -= old.data.length;\n p.items[key] = { data, timestamp: Date.now() };\n p.size += data.length;\n if (p.size > p.maxSize) {\n const items = Object.entries(p.items);\n items.sort((a, b) => a[1].timestamp - b[1].timestamp);\n for (let i = 0; i < items.length; ++i) {\n const item = items[i];\n delete p.items[item[0]];\n p.size -= item[1].data.length;\n if (p.size < p.maxSize / 2) break;\n }\n }\n }\n}\n"],"mappings":"6FAAA;AACA;AACA;AACA,GACe,KAAM,CAAAA,KAAM,CACzBC,WAAWA,CAACC,OAAO,CAAE,CACnB,IAAI,CAACC,OAAO,CAAG,CACbC,KAAK,CAAE,CAAC,CAAC,CACTF,OAAO,CACPG,IAAI,CAAE,CACR,CACF,CAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KACEC,GAAGA,CAAC,CAAEC,GAAG,CAAEC,MAAM,CAAGC,MAAM,CAACC,SAAU,CAAC,CAAE,CACtC,KAAM,CAAAC,IAAI,CAAG,IAAI,CAACR,OAAO,CAACC,KAAK,CAACG,GAAG,CAAC,CACpC,MAAO,CAAAI,IAAI,EAAIC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAGF,IAAI,CAACG,SAAS,CAAGN,MAAM,CAAGG,IAAI,CAACI,IAAI,CAAG,IACpE,CAEA;AACF;AACA;AACA;AACA;AACA,KACEC,GAAGA,CAACD,IAAI,CAAER,GAAG,CAAE,CACb,KAAM,CAAAU,CAAC,CAAG,IAAI,CAACd,OAAO,CACtB,KAAM,CAAAe,GAAG,CAAGD,CAAC,CAACb,KAAK,CAACG,GAAG,CAAC,CACxB,GAAIW,GAAG,CAAED,CAAC,CAACZ,IAAI,EAAIa,GAAG,CAACH,IAAI,CAACI,MAAM,CAClCF,CAAC,CAACb,KAAK,CAACG,GAAG,CAAC,CAAG,CAAEQ,IAAI,CAAED,SAAS,CAAEF,IAAI,CAACC,GAAG,CAAC,CAAE,CAAC,CAC9CI,CAAC,CAACZ,IAAI,EAAIU,IAAI,CAACI,MAAM,CACrB,GAAIF,CAAC,CAACZ,IAAI,CAAGY,CAAC,CAACf,OAAO,CAAE,CACtB,KAAM,CAAAE,KAAK,CAAGgB,MAAM,CAACC,OAAO,CAACJ,CAAC,CAACb,KAAK,CAAC,CACrCA,KAAK,CAACkB,IAAI,CAAC,CAACC,CAAC,CAAEC,CAAC,GAAKD,CAAC,CAAC,CAAC,CAAC,CAACT,SAAS,CAAGU,CAAC,CAAC,CAAC,CAAC,CAACV,SAAS,CAAC,CACrD,IAAK,GAAI,CAAAW,CAAC,CAAG,CAAC,CAAEA,CAAC,CAAGrB,KAAK,CAACe,MAAM,CAAE,EAAEM,CAAC,CAAE,CACrC,KAAM,CAAAd,IAAI,CAAGP,KAAK,CAACqB,CAAC,CAAC,CACrB,MAAO,CAAAR,CAAC,CAACb,KAAK,CAACO,IAAI,CAAC,CAAC,CAAC,CAAC,CACvBM,CAAC,CAACZ,IAAI,EAAIM,IAAI,CAAC,CAAC,CAAC,CAACI,IAAI,CAACI,MAAM,CAC7B,GAAIF,CAAC,CAACZ,IAAI,CAAGY,CAAC,CAACf,OAAO,CAAG,CAAC,CAAE,KAC9B,CACF,CACF,CACF,CAACwB,OAAA,CAAAC,OAAA,CAAA3B,KAAA"}
@@ -122,5 +122,5 @@
122
122
  * defaults to 1 second.
123
123
  * @return {Promise<{ expressServer: object, httpServer: object }>} Resolves to
124
124
  * an object with created Express and HTTP servers.
125
- */async function launch(webpackConfig,options){/* Options normalization. */const ops=options?(0,_lodash.cloneDeep)(options):{};ops.port=normalizePort(ops.port||process.env.PORT||3000);(0,_lodash.defaults)(ops,{httpsRedirect:true});if(ops.logger===undefined){ops.logger=(0,_renderer.newDefaultLogger)({defaultLogLevel:ops.defaultLoggerLogLevel})}/* Creates servers, resolves and sets the port. */const expressServer=await(0,_server.default)(webpackConfig,ops);let httpServer;if(ops.https){httpServer=_https.default.createServer({cert:ops.https.cert,key:ops.https.key},expressServer)}else httpServer=_http.default.createServer(expressServer);/* Sets error handler for HTTP(S) server. */httpServer.on("error",error=>{if(error.syscall!=="listen")throw error;const bind=(0,_lodash.isString)(ops.port)?`Pipe ${ops.port}`:`Port ${ops.port}`;/* Human-readable message for some specific listen errors. */switch(error.code){case"EACCES":ops.logger.error(`${bind} requires elevated privileges`);return process.exit(1);case"EADDRINUSE":ops.logger.error(`${bind} is already in use`);return process.exit(1);default:throw error;}});/* Listening event handler for HTTP(S) server. */httpServer.on("listening",()=>{const addr=httpServer.address();const bind=(0,_lodash.isString)(addr)?`pipe ${addr}`:`port ${addr.port}`;ops.logger.info(`Server listening on ${bind} in ${process.env.NODE_ENV} mode`)});httpServer.listen(ops.port);return{expressServer,httpServer}}launch.SCRIPT_LOCATIONS=_renderer.SCRIPT_LOCATIONS;var _default=launch;exports.default=_default;
125
+ */async function launch(webpackConfig,options){/* Options normalization. */const ops=options?(0,_lodash.cloneDeep)(options):{};ops.port=normalizePort(ops.port||process.env.PORT||3000);(0,_lodash.defaults)(ops,{httpsRedirect:true});if(ops.logger===undefined){ops.logger=(0,_renderer.newDefaultLogger)({defaultLogLevel:ops.defaultLoggerLogLevel})}/* Creates servers, resolves and sets the port. */const expressServer=await(0,_server.default)(webpackConfig,ops);let httpServer;if(ops.https){httpServer=_https.default.createServer({cert:ops.https.cert,key:ops.https.key},expressServer)}else httpServer=_http.default.createServer(expressServer);/* Sets error handler for HTTP(S) server. */httpServer.on("error",error=>{if(error.syscall!=="listen")throw error;const bind=(0,_lodash.isString)(ops.port)?`Pipe ${ops.port}`:`Port ${ops.port}`;/* Human-readable message for some specific listen errors. */switch(error.code){case"EACCES":ops.logger.error(`${bind} requires elevated privileges`);return process.exit(1);case"EADDRINUSE":ops.logger.error(`${bind} is already in use`);return process.exit(1);default:throw error}});/* Listening event handler for HTTP(S) server. */httpServer.on("listening",()=>{const addr=httpServer.address();const bind=(0,_lodash.isString)(addr)?`pipe ${addr}`:`port ${addr.port}`;ops.logger.info(`Server listening on ${bind} in ${process.env.NODE_ENV} mode`)});httpServer.listen(ops.port);return{expressServer,httpServer}}launch.SCRIPT_LOCATIONS=_renderer.SCRIPT_LOCATIONS;var _default=launch;exports.default=_default;
126
126
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["require","_lodash","_http","_interopRequireDefault","_https","_server","_interopRequireWildcard","_renderer","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","normalizePort","value","port","toNumber","isFinite","isNumber","launch","webpackConfig","options","ops","cloneDeep","process","env","PORT","defaults","httpsRedirect","logger","undefined","newDefaultLogger","defaultLogLevel","defaultLoggerLogLevel","expressServer","serverFactory","httpServer","https","createServer","cert","http","on","error","syscall","bind","isString","code","exit","addr","address","info","NODE_ENV","listen","SCRIPT_LOCATIONS","_default"],"sources":["../../../src/server/index.js"],"sourcesContent":["import 'source-map-support/register';\n\nimport {\n cloneDeep,\n defaults,\n isFinite,\n isNumber,\n isString,\n toNumber,\n} from 'lodash';\n\nimport http from 'http';\nimport https from 'https';\n\n/* Polyfill required by ReactJS. */\nimport 'raf/polyfill';\n\nimport serverFactory from './server';\nimport { SCRIPT_LOCATIONS, newDefaultLogger } from './renderer';\n\nexport { getDefaultCspSettings } from './server';\nexport * from './utils';\n\n/**\n * Normalizes a port into a number, string, or false.\n * TODO: Drop this function?\n * @ignore\n * @param {String} value Port name or number.\n * @return Port number (Number), name (String), or false.\n */\nfunction normalizePort(value) {\n const port = toNumber(value);\n if (isFinite(port)) return port; /* port number */\n if (!isNumber(port)) return value; /* named pipe */\n return false;\n}\n\n/**\n * Creates and launches web-server for ReactJS application. Allows zero\n * or detailed configuration, supports server-side rendering,\n * and development tools, including Hot Module Reloading (HMR).\n *\n * NOTE: Many of options defined below are passed down to the server and\n * renderer factories, and their declared default values are set in those\n * factories, rather than here.\n *\n * @param {object} webpackConfig Webpack configuration used to build\n * the frontend bundle. In production mode the server will read out of it\n * `context`, `publicPath`, and a few other parameters, necessary to locate\n * and serve the app bundle. In development mode the server will use entire\n * provided config to build the app bundle in memory, and further watch and\n * update it via HMR.\n * @param {object} [options] Additional parameters.\n * @param {Component} [options.Application] The root ReactJS component of\n * the app to use for the server-side rendering. When not provided\n * the server-side rendering is disabled.\n * @param {function} [options.beforeExpressJsError] Asynchronous callback\n * (`(server) => Promise<boolean>`) to be executed just before the default error\n * handler is added to ExpressJS server. If the callback is provided and its\n * result resolves to a truthy value, `react-utils` won't attach the default\n * error handler.\n * @param {function} [options.beforeExpressJsSetup] Asynchronous callback\n * (`(server) => Promise) to be executed right after ExpressJS server creation,\n * before any configuration is performed.\n * @param {BeforeRenderHook} [options.beforeRender] The hook to run just before\n * the server-side rendering. For each incoming request, it will be executed\n * just before the HTML markup is generated at the server. It allows to load\n * and provide the data necessary for server-side rendering, and also to inject\n * additional configuration and scripts into the generated HTML code.\n * @param {boolean} [options.noCsp] Set `true` to disable\n * Content-Security-Policy (CSP) headers altogether.\n * @param {function} [options.cspSettingsHook] A hook allowing\n * to customize [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)\n * settings for [helmet](https://github.com/helmetjs/helmet)'s\n * `contentSecurityPolicy` middleware on per-request basis.\n *\n * If provided it should be a with signature: \\\n * `(defaultSettings: object, req: object)` &rArr; `object` \\\n * which gets the default settings (also used without the hook),\n * and the incoming request object. The hook response will be passed\n * as options to the helmet `contentSecurityPolicy` middleware.\n *\n * Currently, the default settings is the following object in production\n * environment:\n * ```js\n * {\n * directives: {\n * defaultSrc: [\"'self'\"],\n * baseUri: [\"'self'\"],\n * blockAllMixedContent: [],\n * fontSrc: [\"'self'\", 'https:', 'data:'],\n * frameAncestors: [\"'self'\"],\n * frameSrc: [\"'self'\", 'https://*.youtube.com'],\n * imgSrc: [\"'self'\", 'data:'],\n * objectSrc: [\"'none'\"],\n * scriptSrc: [\"'self'\", \"'unsafe-eval'\", `'nonce-UNIQUE_NONCE_VALUE'`],\n * scriptSrcAttr: [\"'none'\"],\n * styleSrc: [\"'self'\", 'https:', \"'unsafe-inline'\"],\n * upgradeInsecureRequests: [] // Removed in dev mode.\n * }\n * }\n * ```\n * It matches the default value used by Helmet with a few updates:\n * - YouTube host is whitelisted in the `frameSrc` directive to ensure\n * the {@link YouTubeVideo} component works.\n * - An unique per-request nonce is added to `scriptSrc` directive to\n * whitelist auxiliary scripts injected by react-utils. The actual nonce\n * value can be fetched by host code via `.nonce` field of `req` argument\n * of `.beforeRender` hook.\n * - `upgradeInsecureRequests` directive is removed in development mode,\n * to simplify local testing with http requests.\n * @param {string} [options.defaultLoggerLogLevel='info'] Log level for\n * the default logger, which is created if no `logger` option provided.\n * @param {boolean} [options.devMode] Pass in `true` to start the server in\n * development mode.\n * @param {string} [options.favicon] Path to the favicon to use by the server.\n * By default no favicon is used.\n * @param {object} [options.https] If provided, HTTPS server will be started,\n * instead of HTTP otherwise. The object should provide SSL certificate and key\n * via two string fields: `cert`, and `key`.\n * @param {string} [options.https.cert] SSL Certificate.\n * @param {string} [options.https.key] SSL key.\n * @param {boolean} [options.httpsRedirect=true] Pass in `true` to enable\n * automatic redirection of all incoming HTTP requests to HTTPS.\n *\n * To smoothly use it at `localhost` you need to run the server in HTTPS mode,\n * and also properly create and install a self-signed SSL sertificate on your\n * system. This article is helpful:\n * [How to get HTTPS working on your local development environment in 5 minutes](https://medium.freecodecamp.org/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec)\n * @param {Logger} [options.logger] The logger to use at server side.\n * By default [`winston`](https://www.npmjs.com/package/winston) logger\n * with console transport is used. The logger you provide, or the default\n * `winston` logger otherwise, will be attached to the created ExpressJS server\n * object.\n * @param {function} [options.onExpressJsSetup] An async callback\n * (`(server) => Promise`) to be triggered when most of the server\n * configuration is completed, just before the server-side renderer,\n * and the default error handler are attached. You can use it to mount\n * custom API routes. The server-side logger can be accessed as `server.logger`.\n * @param {number|string} [options.port=3000] The port to start the server on.\n * @param {number} [options.staticCacheSize=1.e7] The maximum\n * static cache size in bytes. Defaults to ~10 MB.\n * @param {function} [options.staticCacheController] When given, it activates,\n * and controls the static caching of generated HTML markup. When this function\n * is provided, on each incoming request it is triggered with the request\n * passed in as the argument. To attempt to serve the response from the cache\n * it should return the object with the following fields:\n * - `key: string` &ndash; the cache key for the response;\n * - `maxage?: number` &ndash; the maximum age of cached result in ms.\n * If undefined - infinite age is assumed.\n * @param {number} [options.maxSsrRounds=10] Maximum number of SSR rounds.\n * @param {number} [options.ssrTimeout=1000] SSR timeout in milliseconds,\n * defaults to 1 second.\n * @return {Promise<{ expressServer: object, httpServer: object }>} Resolves to\n * an object with created Express and HTTP servers.\n */\nasync function launch(webpackConfig, options) {\n /* Options normalization. */\n const ops = options ? cloneDeep(options) : {};\n ops.port = normalizePort(ops.port || process.env.PORT || 3000);\n defaults(ops, { httpsRedirect: true });\n\n if (ops.logger === undefined) {\n ops.logger = newDefaultLogger({\n defaultLogLevel: ops.defaultLoggerLogLevel,\n });\n }\n\n /* Creates servers, resolves and sets the port. */\n const expressServer = await serverFactory(webpackConfig, ops);\n\n let httpServer;\n if (ops.https) {\n httpServer = https.createServer({\n cert: ops.https.cert,\n key: ops.https.key,\n }, expressServer);\n } else httpServer = http.createServer(expressServer);\n\n /* Sets error handler for HTTP(S) server. */\n httpServer.on('error', (error) => {\n if (error.syscall !== 'listen') throw error;\n const bind = isString(ops.port) ? `Pipe ${ops.port}` : `Port ${ops.port}`;\n\n /* Human-readable message for some specific listen errors. */\n switch (error.code) {\n case 'EACCES':\n ops.logger.error(`${bind} requires elevated privileges`);\n return process.exit(1);\n case 'EADDRINUSE':\n ops.logger.error(`${bind} is already in use`);\n return process.exit(1);\n default:\n throw error;\n }\n });\n\n /* Listening event handler for HTTP(S) server. */\n httpServer.on('listening', () => {\n const addr = httpServer.address();\n const bind = isString(addr) ? `pipe ${addr}` : `port ${addr.port}`;\n ops.logger.info(`Server listening on ${bind} in ${\n process.env.NODE_ENV} mode`);\n });\n\n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,CAAAiD,QAAA"}
1
+ {"version":3,"file":"index.js","names":["require","_lodash","_http","_interopRequireDefault","_https","_server","_interopRequireWildcard","_renderer","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","normalizePort","value","port","toNumber","isFinite","isNumber","launch","webpackConfig","options","ops","cloneDeep","process","env","PORT","defaults","httpsRedirect","logger","undefined","newDefaultLogger","defaultLogLevel","defaultLoggerLogLevel","expressServer","serverFactory","httpServer","https","createServer","cert","http","on","error","syscall","bind","isString","code","exit","addr","address","info","NODE_ENV","listen","SCRIPT_LOCATIONS","_default"],"sources":["../../../src/server/index.js"],"sourcesContent":["import 'source-map-support/register';\n\nimport {\n cloneDeep,\n defaults,\n isFinite,\n isNumber,\n isString,\n toNumber,\n} from 'lodash';\n\nimport http from 'http';\nimport https from 'https';\n\n/* Polyfill required by ReactJS. */\nimport 'raf/polyfill';\n\nimport serverFactory from './server';\nimport { SCRIPT_LOCATIONS, newDefaultLogger } from './renderer';\n\nexport { getDefaultCspSettings } from './server';\nexport * from './utils';\n\n/**\n * Normalizes a port into a number, string, or false.\n * TODO: Drop this function?\n * @ignore\n * @param {String} value Port name or number.\n * @return Port number (Number), name (String), or false.\n */\nfunction normalizePort(value) {\n const port = toNumber(value);\n if (isFinite(port)) return port; /* port number */\n if (!isNumber(port)) return value; /* named pipe */\n return false;\n}\n\n/**\n * Creates and launches web-server for ReactJS application. Allows zero\n * or detailed configuration, supports server-side rendering,\n * and development tools, including Hot Module Reloading (HMR).\n *\n * NOTE: Many of options defined below are passed down to the server and\n * renderer factories, and their declared default values are set in those\n * factories, rather than here.\n *\n * @param {object} webpackConfig Webpack configuration used to build\n * the frontend bundle. In production mode the server will read out of it\n * `context`, `publicPath`, and a few other parameters, necessary to locate\n * and serve the app bundle. In development mode the server will use entire\n * provided config to build the app bundle in memory, and further watch and\n * update it via HMR.\n * @param {object} [options] Additional parameters.\n * @param {Component} [options.Application] The root ReactJS component of\n * the app to use for the server-side rendering. When not provided\n * the server-side rendering is disabled.\n * @param {function} [options.beforeExpressJsError] Asynchronous callback\n * (`(server) => Promise<boolean>`) to be executed just before the default error\n * handler is added to ExpressJS server. If the callback is provided and its\n * result resolves to a truthy value, `react-utils` won't attach the default\n * error handler.\n * @param {function} [options.beforeExpressJsSetup] Asynchronous callback\n * (`(server) => Promise) to be executed right after ExpressJS server creation,\n * before any configuration is performed.\n * @param {BeforeRenderHook} [options.beforeRender] The hook to run just before\n * the server-side rendering. For each incoming request, it will be executed\n * just before the HTML markup is generated at the server. It allows to load\n * and provide the data necessary for server-side rendering, and also to inject\n * additional configuration and scripts into the generated HTML code.\n * @param {boolean} [options.noCsp] Set `true` to disable\n * Content-Security-Policy (CSP) headers altogether.\n * @param {function} [options.cspSettingsHook] A hook allowing\n * to customize [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)\n * settings for [helmet](https://github.com/helmetjs/helmet)'s\n * `contentSecurityPolicy` middleware on per-request basis.\n *\n * If provided it should be a with signature: \\\n * `(defaultSettings: object, req: object)` &rArr; `object` \\\n * which gets the default settings (also used without the hook),\n * and the incoming request object. The hook response will be passed\n * as options to the helmet `contentSecurityPolicy` middleware.\n *\n * Currently, the default settings is the following object in production\n * environment:\n * ```js\n * {\n * directives: {\n * defaultSrc: [\"'self'\"],\n * baseUri: [\"'self'\"],\n * blockAllMixedContent: [],\n * fontSrc: [\"'self'\", 'https:', 'data:'],\n * frameAncestors: [\"'self'\"],\n * frameSrc: [\"'self'\", 'https://*.youtube.com'],\n * imgSrc: [\"'self'\", 'data:'],\n * objectSrc: [\"'none'\"],\n * scriptSrc: [\"'self'\", \"'unsafe-eval'\", `'nonce-UNIQUE_NONCE_VALUE'`],\n * scriptSrcAttr: [\"'none'\"],\n * styleSrc: [\"'self'\", 'https:', \"'unsafe-inline'\"],\n * upgradeInsecureRequests: [] // Removed in dev mode.\n * }\n * }\n * ```\n * It matches the default value used by Helmet with a few updates:\n * - YouTube host is whitelisted in the `frameSrc` directive to ensure\n * the {@link YouTubeVideo} component works.\n * - An unique per-request nonce is added to `scriptSrc` directive to\n * whitelist auxiliary scripts injected by react-utils. The actual nonce\n * value can be fetched by host code via `.nonce` field of `req` argument\n * of `.beforeRender` hook.\n * - `upgradeInsecureRequests` directive is removed in development mode,\n * to simplify local testing with http requests.\n * @param {string} [options.defaultLoggerLogLevel='info'] Log level for\n * the default logger, which is created if no `logger` option provided.\n * @param {boolean} [options.devMode] Pass in `true` to start the server in\n * development mode.\n * @param {string} [options.favicon] Path to the favicon to use by the server.\n * By default no favicon is used.\n * @param {object} [options.https] If provided, HTTPS server will be started,\n * instead of HTTP otherwise. The object should provide SSL certificate and key\n * via two string fields: `cert`, and `key`.\n * @param {string} [options.https.cert] SSL Certificate.\n * @param {string} [options.https.key] SSL key.\n * @param {boolean} [options.httpsRedirect=true] Pass in `true` to enable\n * automatic redirection of all incoming HTTP requests to HTTPS.\n *\n * To smoothly use it at `localhost` you need to run the server in HTTPS mode,\n * and also properly create and install a self-signed SSL sertificate on your\n * system. This article is helpful:\n * [How to get HTTPS working on your local development environment in 5 minutes](https://medium.freecodecamp.org/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec)\n * @param {Logger} [options.logger] The logger to use at server side.\n * By default [`winston`](https://www.npmjs.com/package/winston) logger\n * with console transport is used. The logger you provide, or the default\n * `winston` logger otherwise, will be attached to the created ExpressJS server\n * object.\n * @param {function} [options.onExpressJsSetup] An async callback\n * (`(server) => Promise`) to be triggered when most of the server\n * configuration is completed, just before the server-side renderer,\n * and the default error handler are attached. You can use it to mount\n * custom API routes. The server-side logger can be accessed as `server.logger`.\n * @param {number|string} [options.port=3000] The port to start the server on.\n * @param {number} [options.staticCacheSize=1.e7] The maximum\n * static cache size in bytes. Defaults to ~10 MB.\n * @param {function} [options.staticCacheController] When given, it activates,\n * and controls the static caching of generated HTML markup. When this function\n * is provided, on each incoming request it is triggered with the request\n * passed in as the argument. To attempt to serve the response from the cache\n * it should return the object with the following fields:\n * - `key: string` &ndash; the cache key for the response;\n * - `maxage?: number` &ndash; the maximum age of cached result in ms.\n * If undefined - infinite age is assumed.\n * @param {number} [options.maxSsrRounds=10] Maximum number of SSR rounds.\n * @param {number} [options.ssrTimeout=1000] SSR timeout in milliseconds,\n * defaults to 1 second.\n * @return {Promise<{ expressServer: object, httpServer: object }>} Resolves to\n * an object with created Express and HTTP servers.\n */\nasync function launch(webpackConfig, options) {\n /* Options normalization. */\n const ops = options ? cloneDeep(options) : {};\n ops.port = normalizePort(ops.port || process.env.PORT || 3000);\n defaults(ops, { httpsRedirect: true });\n\n if (ops.logger === undefined) {\n ops.logger = newDefaultLogger({\n defaultLogLevel: ops.defaultLoggerLogLevel,\n });\n }\n\n /* Creates servers, resolves and sets the port. */\n const expressServer = await serverFactory(webpackConfig, ops);\n\n let httpServer;\n if (ops.https) {\n httpServer = https.createServer({\n cert: ops.https.cert,\n key: ops.https.key,\n }, expressServer);\n } else httpServer = http.createServer(expressServer);\n\n /* Sets error handler for HTTP(S) server. */\n httpServer.on('error', (error) => {\n if (error.syscall !== 'listen') throw error;\n const bind = isString(ops.port) ? `Pipe ${ops.port}` : `Port ${ops.port}`;\n\n /* Human-readable message for some specific listen errors. */\n switch (error.code) {\n case 'EACCES':\n ops.logger.error(`${bind} requires elevated privileges`);\n return process.exit(1);\n case 'EADDRINUSE':\n ops.logger.error(`${bind} is already in use`);\n return process.exit(1);\n default:\n throw error;\n }\n });\n\n /* Listening event handler for HTTP(S) server. */\n httpServer.on('listening', () => {\n const addr = httpServer.address();\n const bind = isString(addr) ? `pipe ${addr}` : `port ${addr.port}`;\n ops.logger.info(`Server listening on ${bind} in ${\n process.env.NODE_ENV} mode`);\n });\n\n httpServer.listen(ops.port);\n\n return {\n expressServer,\n httpServer,\n };\n}\n\nla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