@dr.pogodin/react-utils 1.14.2 → 1.15.1

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 (49) hide show
  1. package/bin/release.sh +1 -0
  2. package/build/development/shared/components/Button/index.js +1 -1
  3. package/build/development/shared/components/Checkbox/index.js +1 -1
  4. package/build/development/shared/components/CodeSplit/ClientSide.js +5 -4
  5. package/build/development/shared/components/CodeSplit/ClientSide.js.map +1 -1
  6. package/build/development/shared/components/Dropdown/index.js +1 -1
  7. package/build/development/shared/components/Input/index.js +1 -1
  8. package/build/development/shared/components/Modal/index.js +1 -1
  9. package/build/development/shared/components/PageLayout/index.js +1 -1
  10. package/build/development/shared/components/Throbber/index.js +1 -1
  11. package/build/development/shared/components/WithTooltip/index.js +1 -1
  12. package/build/development/shared/components/YouTubeVideo/index.js +2 -2
  13. package/build/development/shared/utils/Semaphore.js +42 -13
  14. package/build/development/shared/utils/Semaphore.js.map +1 -1
  15. package/build/development/web.bundle.js +6 -6
  16. package/build/production/shared/components/Button/index.js +1 -1
  17. package/build/production/shared/components/Button/index.js.map +1 -1
  18. package/build/production/shared/components/Checkbox/index.js +1 -1
  19. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  20. package/build/production/shared/components/CodeSplit/ClientSide.js +2 -2
  21. package/build/production/shared/components/CodeSplit/ClientSide.js.map +1 -1
  22. package/build/production/shared/components/Dropdown/index.js +1 -1
  23. package/build/production/shared/components/Dropdown/index.js.map +1 -1
  24. package/build/production/shared/components/Input/index.js +1 -1
  25. package/build/production/shared/components/Input/index.js.map +1 -1
  26. package/build/production/shared/components/Modal/index.js +1 -1
  27. package/build/production/shared/components/Modal/index.js.map +1 -1
  28. package/build/production/shared/components/PageLayout/index.js +1 -1
  29. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  30. package/build/production/shared/components/Throbber/index.js +1 -1
  31. package/build/production/shared/components/Throbber/index.js.map +1 -1
  32. package/build/production/shared/components/WithTooltip/index.js +1 -1
  33. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  34. package/build/production/shared/components/YouTubeVideo/index.js +1 -1
  35. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  36. package/build/production/shared/utils/Semaphore.js +15 -3
  37. package/build/production/shared/utils/Semaphore.js.map +1 -1
  38. package/build/production/web.bundle.js +1 -1
  39. package/build/production/web.bundle.js.map +1 -1
  40. package/config/babel/node-ssr.js +5 -67
  41. package/config/babel/webpack.js +10 -53
  42. package/node-entry.js +5 -0
  43. package/null.js +0 -0
  44. package/package.json +45 -22
  45. package/config/shared/utils.js +0 -20
  46. package/dev-styles.js +0 -7
  47. package/index.js +0 -32
  48. package/mixins.scss +0 -1
  49. package/prod-styles.js +0 -7
package/bin/release.sh CHANGED
@@ -14,6 +14,7 @@ sudo apt-get update && sudo apt-get install google-cloud-sdk
14
14
  # Releases documentation.
15
15
  echo $GCLOUD_KEY > ${HOME}/gcloud-key.json
16
16
  gcloud auth activate-service-account --key-file ${HOME}/gcloud-key.json
17
+ gcloud config set disable_prompts true
17
18
  gcloud config set project dr-pogodin-studio-website
18
19
  gsutil rsync -d -r docs/build gs://docs.pogodin.studio/react-utils
19
20
 
@@ -16,7 +16,7 @@ var _utils = require("../../utils");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
 
18
18
  // The <Button> component implements a standard button / button-like link.
19
- var defaultTheme = {
19
+ const defaultTheme = {
20
20
  "context": "-dr-pogodin-react-utils___src-shared-components-Button-style___context___KM0v4f",
21
21
  "ad": "-dr-pogodin-react-utils___src-shared-components-Button-style___ad___3jm1-Q",
22
22
  "hoc": "-dr-pogodin-react-utils___src-shared-components-Button-style___hoc___0plpDL",
@@ -13,7 +13,7 @@ var _utils = require("../../utils");
13
13
 
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
 
16
- var defaultTheme = {
16
+ const defaultTheme = {
17
17
  "context": "-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___context___dNQcC6",
18
18
  "ad": "-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___ad___earXxa",
19
19
  "hoc": "-dr-pogodin-react-utils___src-shared-components-Checkbox-theme___hoc___qAPfQ6",
@@ -72,7 +72,9 @@ function ClientSide({
72
72
  head.appendChild(link);
73
73
  }
74
74
 
75
- if (!link.dependants) link.dependants = new Set([chunkName]);else link.dependants.add(chunkName);
75
+ window.STYLESHEET_USAGE_COUNTERS ||= {};
76
+ window.STYLESHEET_USAGE_COUNTERS[path] ||= 0;
77
+ ++window.STYLESHEET_USAGE_COUNTERS[path];
76
78
  });
77
79
  } // Async loading of React component necessary to render the chunk.
78
80
 
@@ -140,10 +142,9 @@ function ClientSide({
140
142
  window.CHUNK_GROUPS[chunkName].forEach(item => {
141
143
  if (!item.endsWith('.css')) return;
142
144
  const path = `${publicPath}/${item}`;
143
- const link = document.querySelector(`link[href="${path}"]`);
144
- link.dependants.delete(chunkName);
145
145
 
146
- if (!link.dependants.size) {
146
+ if (--window.STYLESHEET_USAGE_COUNTERS[path] <= 0) {
147
+ const link = document.querySelector(`link[href="${path}"]`);
147
148
  const head = document.querySelector('head');
148
149
  head.removeChild(link);
149
150
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/CodeSplit/ClientSide.jsx"],"names":["ClientSide","chunkName","children","getClientSide","placeholder","serverSide","rest","current","heap","mounted","pendingStyles","renderInitialized","publicPath","window","CHUNK_GROUPS","forEach","asset","endsWith","path","link","document","querySelector","createElement","setAttribute","barrier","onload","resolve","onerror","push","head","appendChild","dependants","Set","add","data","maxage","time","YEAR_MS","createRender","Scene","default","render","setRender","length","node","__html","innerHTML","Promise","all","then","item","delete","size","removeChild"],"mappings":"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","sourcesContent":["/**\n * Client-side implementation of a split code chunk.\n */\n/* global document, window */\n/* eslint-disable react/jsx-props-no-spreading */\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useAsyncData } from '@dr.pogodin/react-global-state';\n\nimport { newBarrier } from 'utils/Barrier';\nimport { getBuildInfo } from 'utils/isomorphy';\nimport time from 'utils/time';\n\nexport default function ClientSide({\n chunkName,\n children,\n getClientSide,\n placeholder,\n\n // Not used in <ClientSide>, but should not go into \"...rest\" either.\n serverSide,\n\n ...rest\n}) {\n const { current: heap } = useRef({\n mounted: false,\n pendingStyles: [],\n renderInitialized: false,\n });\n\n // publicPath from buildInfo does not have a trailing slash at the end.\n const { publicPath } = getBuildInfo();\n\n // This code block initiates style loading as soon as possible, even prior to\n // the component loading, and it collects all style load / failure promises\n // into heap.pendingStyles array, allowing us to wait and thus avoid flash of\n // unstyled content issue (that's why we don't rely on mini-css-extract-plugin\n // to handle CSS chunk mounting and unmounting, which it is able to do).\n if (!heap.mounted) {\n heap.mounted = true;\n window.CHUNK_GROUPS[chunkName].forEach((asset) => {\n if (!asset.endsWith('.css')) return;\n const path = `${publicPath}/${asset}`;\n let link = document.querySelector(`link[href=\"${path}\"]`);\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('href', path);\n link.setAttribute('rel', 'stylesheet');\n\n const barrier = newBarrier();\n link.onload = barrier.resolve;\n\n // Even if the style load failed, still allow to mount the component,\n // abeit with broken styling.\n link.onerror = barrier.resolve;\n\n heap.pendingStyles.push(barrier);\n\n const head = document.querySelector('head');\n head.appendChild(link);\n }\n if (!link.dependants) link.dependants = new Set([chunkName]);\n else link.dependants.add(chunkName);\n });\n }\n\n // Async loading of React component necessary to render the chunk.\n const { data } = useAsyncData(\n `dr_pogodin_react_utils___split_components.${chunkName}`,\n getClientSide,\n { maxage: time.YEAR_MS },\n );\n\n const createRender = () => {\n const Scene = data.default || data;\n return (\n <div data-chunk-name={chunkName}>\n <Scene {...rest}>\n {children}\n </Scene>\n </div>\n );\n };\n\n const [render, setRender] = useState(() => {\n // No need to await anything, we can render the final component right away.\n if (data && !heap.pendingStyles.length) {\n heap.renderInitialized = true;\n return createRender();\n }\n\n // Try to reuse the markup rendered during SSR.\n const node = document.querySelector(`[data-chunk-name=${chunkName}]`);\n if (node) {\n return (\n <div\n /* eslint-disable react/no-danger */\n dangerouslySetInnerHTML={{ __html: node.innerHTML || '' }}\n /* eslint-disable react/no-danger */\n data-chunk-name={chunkName}\n />\n );\n }\n\n // Else render placeholder, or empty div.\n const Scene = placeholder || (() => null);\n return <div><Scene {...rest}>{children}</Scene></div>;\n });\n\n // At this point, if we have data, the absense of heap.renderInitialized flag\n // means we have to await styles loading; once it is done, and if we are still\n // mounted, we can set the final render.\n if (data && !heap.renderInitialized) {\n heap.renderInitialized = true;\n Promise.all(heap.pendingStyles).then(() => {\n if (heap.mounted) setRender(createRender());\n });\n }\n\n // This effectively fires only once, just before the component unmounts.\n useEffect(() => () => {\n heap.mounted = false;\n window.CHUNK_GROUPS[chunkName].forEach((item) => {\n if (!item.endsWith('.css')) return;\n const path = `${publicPath}/${item}`;\n const link = document.querySelector(`link[href=\"${path}\"]`);\n link.dependants.delete(chunkName);\n if (!link.dependants.size) {\n const head = document.querySelector('head');\n head.removeChild(link);\n }\n });\n }, [chunkName, heap, publicPath]);\n\n return render;\n}\n"],"file":"ClientSide.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/CodeSplit/ClientSide.jsx"],"names":["ClientSide","chunkName","children","getClientSide","placeholder","serverSide","rest","current","heap","mounted","pendingStyles","renderInitialized","publicPath","window","CHUNK_GROUPS","forEach","asset","endsWith","path","link","document","querySelector","createElement","setAttribute","barrier","onload","resolve","onerror","push","head","appendChild","STYLESHEET_USAGE_COUNTERS","data","maxage","time","YEAR_MS","createRender","Scene","default","render","setRender","length","node","__html","innerHTML","Promise","all","then","item","removeChild"],"mappings":"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","sourcesContent":["/**\n * Client-side implementation of a split code chunk.\n */\n/* global document, window */\n/* eslint-disable react/jsx-props-no-spreading */\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useAsyncData } from '@dr.pogodin/react-global-state';\n\nimport { newBarrier } from 'utils/Barrier';\nimport { getBuildInfo } from 'utils/isomorphy';\nimport time from 'utils/time';\n\nexport default function ClientSide({\n chunkName,\n children,\n getClientSide,\n placeholder,\n\n // Not used in <ClientSide>, but should not go into \"...rest\" either.\n serverSide,\n\n ...rest\n}) {\n const { current: heap } = useRef({\n mounted: false,\n pendingStyles: [],\n renderInitialized: false,\n });\n\n // publicPath from buildInfo does not have a trailing slash at the end.\n const { publicPath } = getBuildInfo();\n\n // This code block initiates style loading as soon as possible, even prior to\n // the component loading, and it collects all style load / failure promises\n // into heap.pendingStyles array, allowing us to wait and thus avoid flash of\n // unstyled content issue (that's why we don't rely on mini-css-extract-plugin\n // to handle CSS chunk mounting and unmounting, which it is able to do).\n if (!heap.mounted) {\n heap.mounted = true;\n window.CHUNK_GROUPS[chunkName].forEach((asset) => {\n if (!asset.endsWith('.css')) return;\n const path = `${publicPath}/${asset}`;\n let link = document.querySelector(`link[href=\"${path}\"]`);\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('href', path);\n link.setAttribute('rel', 'stylesheet');\n\n const barrier = newBarrier();\n link.onload = barrier.resolve;\n\n // Even if the style load failed, still allow to mount the component,\n // abeit with broken styling.\n link.onerror = barrier.resolve;\n\n heap.pendingStyles.push(barrier);\n\n const head = document.querySelector('head');\n head.appendChild(link);\n }\n window.STYLESHEET_USAGE_COUNTERS ||= {};\n window.STYLESHEET_USAGE_COUNTERS[path] ||= 0;\n ++window.STYLESHEET_USAGE_COUNTERS[path];\n });\n }\n\n // Async loading of React component necessary to render the chunk.\n const { data } = useAsyncData(\n `dr_pogodin_react_utils___split_components.${chunkName}`,\n getClientSide,\n { maxage: time.YEAR_MS },\n );\n\n const createRender = () => {\n const Scene = data.default || data;\n return (\n <div data-chunk-name={chunkName}>\n <Scene {...rest}>\n {children}\n </Scene>\n </div>\n );\n };\n\n const [render, setRender] = useState(() => {\n // No need to await anything, we can render the final component right away.\n if (data && !heap.pendingStyles.length) {\n heap.renderInitialized = true;\n return createRender();\n }\n\n // Try to reuse the markup rendered during SSR.\n const node = document.querySelector(`[data-chunk-name=${chunkName}]`);\n if (node) {\n return (\n <div\n /* eslint-disable react/no-danger */\n dangerouslySetInnerHTML={{ __html: node.innerHTML || '' }}\n /* eslint-disable react/no-danger */\n data-chunk-name={chunkName}\n />\n );\n }\n\n // Else render placeholder, or empty div.\n const Scene = placeholder || (() => null);\n return <div><Scene {...rest}>{children}</Scene></div>;\n });\n\n // At this point, if we have data, the absense of heap.renderInitialized flag\n // means we have to await styles loading; once it is done, and if we are still\n // mounted, we can set the final render.\n if (data && !heap.renderInitialized) {\n heap.renderInitialized = true;\n Promise.all(heap.pendingStyles).then(() => {\n if (heap.mounted) setRender(createRender());\n });\n }\n\n // This effectively fires only once, just before the component unmounts.\n useEffect(() => () => {\n heap.mounted = false;\n window.CHUNK_GROUPS[chunkName].forEach((item) => {\n if (!item.endsWith('.css')) return;\n const path = `${publicPath}/${item}`;\n if (--window.STYLESHEET_USAGE_COUNTERS[path] <= 0) {\n const link = document.querySelector(`link[href=\"${path}\"]`);\n const head = document.querySelector('head');\n head.removeChild(link);\n }\n });\n }, [chunkName, heap, publicPath]);\n\n return render;\n}\n"],"file":"ClientSide.js"}
@@ -15,7 +15,7 @@ var _utils = require("../../utils");
15
15
 
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
17
 
18
- var defaultTheme = {
18
+ const defaultTheme = {
19
19
  "context": "-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___context___haRIry",
20
20
  "ad": "-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___ad___D4XHG2",
21
21
  "hoc": "-dr-pogodin-react-utils___src-shared-components-Dropdown-theme___hoc___N3nd34",
@@ -13,7 +13,7 @@ var _utils = require("../../utils");
13
13
 
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
 
16
- var defaultTheme = {
16
+ const defaultTheme = {
17
17
  "context": "-dr-pogodin-react-utils___src-shared-components-Input-theme___context___X5WszA",
18
18
  "ad": "-dr-pogodin-react-utils___src-shared-components-Input-theme___ad___8s7GCr",
19
19
  "hoc": "-dr-pogodin-react-utils___src-shared-components-Input-theme___hoc___TVlBYc",
@@ -21,7 +21,7 @@ var _reactThemes = _interopRequireDefault(require("@dr.pogodin/react-themes"));
21
21
  var _jsxRuntime = require("react/jsx-runtime");
22
22
 
23
23
  /* global document */
24
- var baseTheme = {
24
+ const baseTheme = {
25
25
  "context": "-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___context___Szmbbz",
26
26
  "ad": "-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___ad___Ah-Nsc",
27
27
  "hoc": "-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___hoc___Wki41G",
@@ -13,7 +13,7 @@ var _utils = require("../../utils");
13
13
 
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
 
16
- var baseTheme = {
16
+ const baseTheme = {
17
17
  "context": "-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___context___m4mL-M",
18
18
  "ad": "-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___ad___m3-mdC",
19
19
  "hoc": "-dr-pogodin-react-utils___src-shared-components-PageLayout-base-theme___hoc___J15Z4H",
@@ -13,7 +13,7 @@ var _reactThemes = _interopRequireDefault(require("@dr.pogodin/react-themes"));
13
13
 
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
15
 
16
- var defaultTheme = {
16
+ const defaultTheme = {
17
17
  "context": "-dr-pogodin-react-utils___src-shared-components-Throbber-theme___context___uIObt7",
18
18
  "ad": "-dr-pogodin-react-utils___src-shared-components-Throbber-theme___ad___XIxe9o",
19
19
  "hoc": "-dr-pogodin-react-utils___src-shared-components-Throbber-theme___hoc___YOyORH",
@@ -22,7 +22,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
22
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
23
 
24
24
  /* global window */
25
- var defaultTheme = {
25
+ const defaultTheme = {
26
26
  "ad": "-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___ad___4xT7zE",
27
27
  "hoc": "-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___hoc___zd-vnH",
28
28
  "context": "-dr-pogodin-react-utils___src-shared-components-WithTooltip-default-theme___context___GdZucr",
@@ -19,14 +19,14 @@ var _Throbber = _interopRequireDefault(require("../Throbber"));
19
19
 
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
 
22
- var baseTheme = {
22
+ const baseTheme = {
23
23
  "context": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___context___veKyYi",
24
24
  "ad": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___ad___r3ABzd",
25
25
  "hoc": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___hoc___YKcPnR",
26
26
  "container": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___container___sXHM81",
27
27
  "video": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-base___video___SlV2zw"
28
28
  };
29
- var throbberTheme = {
29
+ const throbberTheme = {
30
30
  "context": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-throbber___context___dzIcLh",
31
31
  "ad": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-throbber___ad___5a9XX1",
32
32
  "hoc": "-dr-pogodin-react-utils___src-shared-components-YouTubeVideo-throbber___hoc___7sH52O",
@@ -11,11 +11,8 @@ var _Barrier = require("./Barrier");
11
11
  * Implements a simple semaphore for async code logic.
12
12
  */
13
13
  class Semaphore {
14
- #barrier;
15
- #ready;
16
-
17
- constructor(ready = false) {
18
- this.#ready = ready;
14
+ constructor(ready) {
15
+ this.#ready = !!ready;
19
16
  }
20
17
 
21
18
  get ready() {
@@ -23,11 +20,11 @@ class Semaphore {
23
20
  }
24
21
 
25
22
  setReady(ready) {
26
- this.#ready = ready;
23
+ const bool = !!ready;
27
24
 
28
- if (this.#barrier) {
29
- this.#barrier.resolve();
30
- this.#barrier = undefined;
25
+ if (this.#ready !== bool) {
26
+ this.#ready = bool;
27
+ if (bool && !this.#draining) this.#drainQueue();
31
28
  }
32
29
  }
33
30
  /**
@@ -42,12 +39,44 @@ class Semaphore {
42
39
  }
43
40
 
44
41
  async waitReady() {
45
- while (!this.#ready) {
46
- if (!this.#barrier) this.#barrier = (0, _Barrier.newBarrier)();
47
- await this.#barrier; // eslint-disable-line no-await-in-loop
42
+ if (!this.#ready || this.#queue.length) {
43
+ const barrier = (0, _Barrier.newBarrier)();
44
+ this.#queue.push(barrier);
45
+ await barrier;
48
46
  }
49
- }
47
+ } // Private members below this point.
48
+
49
+ /**
50
+ * If semaphore is ready, it releases the next barrier in the queue, if any,
51
+ * and reschedules itself for a call in the next event loop iteration.
52
+ * Otherwise, it breaks the queue draining loop, which will be restarted
53
+ * the next time the semaphore is set ready.
54
+ */
55
+
50
56
 
57
+ #drainQueue() {
58
+ if (this.#ready && this.#queue.length) {
59
+ const next = this.#queue.shift();
60
+ next.resolve(); // Re-schedules itself for the next event loop iteration.
61
+
62
+ if (this.#queue.length) {
63
+ setTimeout(this.#drainQueue.bind(this));
64
+ this.#draining = true;
65
+ return; // Exit here to avoid the drain loop termination below.
66
+ }
67
+ } // Cleans up for the drain loop termination.
68
+
69
+
70
+ this.#draining = false;
71
+ } // "true" when the drain queue process is running (and thus no need to start
72
+ // a new one).
73
+
74
+
75
+ #draining = false; // The array of barriers set for each async code flow awaiting for
76
+ // the Semaphore to become ready.
77
+
78
+ #queue = [];
79
+ #ready;
51
80
  }
52
81
 
53
82
  exports.default = Semaphore;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/shared/utils/Semaphore.js"],"names":["Semaphore","barrier","ready","constructor","setReady","resolve","undefined","seize","waitReady"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACe,MAAMA,SAAN,CAAgB;AAC7B,GAACC,OAAD;AAEA,GAACC,KAAD;;AAEAC,EAAAA,WAAW,CAACD,KAAK,GAAG,KAAT,EAAgB;AACzB,SAAK,CAACA,KAAN,GAAcA,KAAd;AACD;;AAEQ,MAALA,KAAK,GAAG;AAAE,WAAO,KAAK,CAACA,KAAb;AAAqB;;AAEnCE,EAAAA,QAAQ,CAACF,KAAD,EAAQ;AACd,SAAK,CAACA,KAAN,GAAcA,KAAd;;AACA,QAAI,KAAK,CAACD,OAAV,EAAmB;AACjB,WAAK,CAACA,OAAN,CAAcI,OAAd;AACA,WAAK,CAACJ,OAAN,GAAgBK,SAAhB;AACD;AACF;AAED;AACF;AACA;AACA;;;AACa,QAALC,KAAK,GAAG;AACZ,UAAM,KAAKC,SAAL,EAAN;AACA,SAAKJ,QAAL,CAAc,KAAd;AACD;;AAEc,QAATI,SAAS,GAAG;AAChB,WAAO,CAAC,KAAK,CAACN,KAAd,EAAqB;AACnB,UAAI,CAAC,KAAK,CAACD,OAAX,EAAoB,KAAK,CAACA,OAAN,GAAgB,0BAAhB;AACpB,YAAM,KAAK,CAACA,OAAZ,CAFmB,CAEE;AACtB;AACF;;AAjC4B","sourcesContent":["import { newBarrier } from './Barrier';\n\n/**\n * Implements a simple semaphore for async code logic.\n */\nexport default class Semaphore {\n #barrier;\n\n #ready;\n\n constructor(ready = false) {\n this.#ready = ready;\n }\n\n get ready() { return this.#ready; }\n\n setReady(ready) {\n this.#ready = ready;\n if (this.#barrier) {\n this.#barrier.resolve();\n this.#barrier = undefined;\n }\n }\n\n /**\n * Waits until the semaphore is ready, and marks it as non-ready (seizes it).\n * @return {Promise}\n */\n async seize() {\n await this.waitReady();\n this.setReady(false);\n }\n\n async waitReady() {\n while (!this.#ready) {\n if (!this.#barrier) this.#barrier = newBarrier();\n await this.#barrier; // eslint-disable-line no-await-in-loop\n }\n }\n}\n"],"file":"Semaphore.js"}
1
+ {"version":3,"sources":["../../../../src/shared/utils/Semaphore.js"],"names":["Semaphore","constructor","ready","setReady","bool","draining","drainQueue","seize","waitReady","queue","length","barrier","push","next","shift","resolve","setTimeout","bind"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACe,MAAMA,SAAN,CAAgB;AAC7BC,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACjB,SAAK,CAACA,KAAN,GAAc,CAAC,CAACA,KAAhB;AACD;;AAEQ,MAALA,KAAK,GAAG;AAAE,WAAO,KAAK,CAACA,KAAb;AAAqB;;AAEnCC,EAAAA,QAAQ,CAACD,KAAD,EAAQ;AACd,UAAME,IAAI,GAAG,CAAC,CAACF,KAAf;;AACA,QAAI,KAAK,CAACA,KAAN,KAAgBE,IAApB,EAA0B;AACxB,WAAK,CAACF,KAAN,GAAcE,IAAd;AACA,UAAIA,IAAI,IAAI,CAAC,KAAK,CAACC,QAAnB,EAA6B,KAAK,CAACC,UAAN;AAC9B;AACF;AAED;AACF;AACA;AACA;;;AACa,QAALC,KAAK,GAAG;AACZ,UAAM,KAAKC,SAAL,EAAN;AACA,SAAKL,QAAL,CAAc,KAAd;AACD;;AAEc,QAATK,SAAS,GAAG;AAChB,QAAI,CAAC,KAAK,CAACN,KAAP,IAAgB,KAAK,CAACO,KAAN,CAAYC,MAAhC,EAAwC;AACtC,YAAMC,OAAO,GAAG,0BAAhB;AACA,WAAK,CAACF,KAAN,CAAYG,IAAZ,CAAiBD,OAAjB;AACA,YAAMA,OAAN;AACD;AACF,GA9B4B,CAgC7B;;AAEA;AACF;AACA;AACA;AACA;AACA;;;AACE,GAACL,UAAU,GAAG;AACZ,QAAI,KAAK,CAACJ,KAAN,IAAe,KAAK,CAACO,KAAN,CAAYC,MAA/B,EAAuC;AACrC,YAAMG,IAAI,GAAG,KAAK,CAACJ,KAAN,CAAYK,KAAZ,EAAb;AACAD,MAAAA,IAAI,CAACE,OAAL,GAFqC,CAIrC;;AACA,UAAI,KAAK,CAACN,KAAN,CAAYC,MAAhB,EAAwB;AACtBM,QAAAA,UAAU,CAAC,KAAK,CAACV,UAAN,CAAiBW,IAAjB,CAAsB,IAAtB,CAAD,CAAV;AACA,aAAK,CAACZ,QAAN,GAAiB,IAAjB;AACA,eAHsB,CAGd;AACT;AACF,KAXW,CAaZ;;;AACA,SAAK,CAACA,QAAN,GAAiB,KAAjB;AACD,GAvD4B,CAyD7B;AACA;;;AACA,GAACA,QAAD,GAAY,KAAZ,CA3D6B,CA6D7B;AACA;;AACA,GAACI,KAAD,GAAS,EAAT;AAEA,GAACP,KAAD;AAjE6B","sourcesContent":["import { newBarrier } from './Barrier';\n\n/**\n * Implements a simple semaphore for async code logic.\n */\nexport default class Semaphore {\n constructor(ready) {\n this.#ready = !!ready;\n }\n\n get ready() { return this.#ready; }\n\n setReady(ready) {\n const bool = !!ready;\n if (this.#ready !== bool) {\n this.#ready = bool;\n if (bool && !this.#draining) this.#drainQueue();\n }\n }\n\n /**\n * Waits until the semaphore is ready, and marks it as non-ready (seizes it).\n * @return {Promise}\n */\n async seize() {\n await this.waitReady();\n this.setReady(false);\n }\n\n async waitReady() {\n if (!this.#ready || this.#queue.length) {\n const barrier = newBarrier();\n this.#queue.push(barrier);\n await barrier;\n }\n }\n\n // Private members below this point.\n\n /**\n * If semaphore is ready, it releases the next barrier in the queue, if any,\n * and reschedules itself for a call in the next event loop iteration.\n * Otherwise, it breaks the queue draining loop, which will be restarted\n * the next time the semaphore is set ready.\n */\n #drainQueue() {\n if (this.#ready && this.#queue.length) {\n const next = this.#queue.shift();\n next.resolve();\n\n // Re-schedules itself for the next event loop iteration.\n if (this.#queue.length) {\n setTimeout(this.#drainQueue.bind(this));\n this.#draining = true;\n return; // Exit here to avoid the drain loop termination below.\n }\n }\n\n // Cleans up for the drain loop termination.\n this.#draining = false;\n }\n\n // \"true\" when the drain queue process is running (and thus no need to start\n // a new one).\n #draining = false;\n\n // The array of barriers set for each async code flow awaiting for\n // the Semaphore to become ready.\n #queue = [];\n\n #ready;\n}\n"],"file":"Semaphore.js"}
@@ -36,7 +36,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
36
36
  \**********************/
37
37
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
38
38
 
39
- eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"api\": function() { return /* reexport default from dynamic */ axios__WEBPACK_IMPORTED_MODULE_2___default.a; },\n/* harmony export */ \"PT\": function() { return /* reexport module object */ prop_types__WEBPACK_IMPORTED_MODULE_3__; },\n/* harmony export */ \"getGlobalState\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.getGlobalState; },\n/* harmony export */ \"GlobalStateProvider\": function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.GlobalStateProvider; },\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 */ \"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 */ \"Input\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.Input; },\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 */ \"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 */ \"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 */ \"client\": function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.client; },\n/* harmony export */ \"Barrier\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ \"Emitter\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ \"JU\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.JU; },\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 */ \"config\": function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\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 */ \"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 */ \"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 */ \"server\": function() { return /* binding */ server; }\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\nvar server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.js?");
39
+ 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 /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_5__.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 */ \"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\nvar server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.js?");
40
40
 
41
41
  /***/ }),
42
42
 
@@ -66,7 +66,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var prop
66
66
  \********************************************************/
67
67
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
68
68
 
69
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ ClientSide; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"@babel/runtime/helpers/slicedToArray\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"@babel/runtime/helpers/defineProperty\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"@babel/runtime/helpers/objectWithoutProperties\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__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_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 _utils_Barrier__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/Barrier */ \"./src/shared/utils/Barrier.js\");\n/* harmony import */ var _utils_isomorphy__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/isomorphy */ \"./src/shared/utils/isomorphy.js\");\n/* harmony import */ var _utils_time__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/time */ \"./src/shared/utils/time.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nvar _excluded = [\"chunkName\", \"children\", \"getClientSide\", \"placeholder\", \"serverSide\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n/**\n * Client-side implementation of a split code chunk.\n */\n\n/* global document, window */\n\n/* eslint-disable react/jsx-props-no-spreading */\n\n\n\n\n\n\nfunction ClientSide(_ref) {\n var chunkName = _ref.chunkName,\n children = _ref.children,\n getClientSide = _ref.getClientSide,\n placeholder = _ref.placeholder,\n serverSide = _ref.serverSide,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(_ref, _excluded);\n\n var _useRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)({\n mounted: false,\n pendingStyles: [],\n renderInitialized: false\n }),\n heap = _useRef.current; // publicPath from buildInfo does not have a trailing slash at the end.\n\n\n var _getBuildInfo = (0,_utils_isomorphy__WEBPACK_IMPORTED_MODULE_6__.getBuildInfo)(),\n publicPath = _getBuildInfo.publicPath; // This code block initiates style loading as soon as possible, even prior to\n // the component loading, and it collects all style load / failure promises\n // into heap.pendingStyles array, allowing us to wait and thus avoid flash of\n // unstyled content issue (that's why we don't rely on mini-css-extract-plugin\n // to handle CSS chunk mounting and unmounting, which it is able to do).\n\n\n if (!heap.mounted) {\n heap.mounted = true;\n window.CHUNK_GROUPS[chunkName].forEach(function (asset) {\n if (!asset.endsWith('.css')) return;\n var path = \"\".concat(publicPath, \"/\").concat(asset);\n var link = document.querySelector(\"link[href=\\\"\".concat(path, \"\\\"]\"));\n\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('href', path);\n link.setAttribute('rel', 'stylesheet');\n var barrier = (0,_utils_Barrier__WEBPACK_IMPORTED_MODULE_5__.newBarrier)();\n link.onload = barrier.resolve; // Even if the style load failed, still allow to mount the component,\n // abeit with broken styling.\n\n link.onerror = barrier.resolve;\n heap.pendingStyles.push(barrier);\n var head = document.querySelector('head');\n head.appendChild(link);\n }\n\n if (!link.dependants) link.dependants = new Set([chunkName]);else link.dependants.add(chunkName);\n });\n } // Async loading of React component necessary to render the chunk.\n\n\n var _useAsyncData = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncData)(\"dr_pogodin_react_utils___split_components.\".concat(chunkName), getClientSide, {\n maxage: _utils_time__WEBPACK_IMPORTED_MODULE_7__[\"default\"].YEAR_MS\n }),\n data = _useAsyncData.data;\n\n var createRender = function createRender() {\n var Scene = data.default || data;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(\"div\", {\n \"data-chunk-name\": chunkName,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(Scene, _objectSpread(_objectSpread({}, rest), {}, {\n children: children\n }))\n });\n };\n\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(function () {\n // No need to await anything, we can render the final component right away.\n if (data && !heap.pendingStyles.length) {\n heap.renderInitialized = true;\n return createRender();\n } // Try to reuse the markup rendered during SSR.\n\n\n // Try to reuse the markup rendered during SSR.\n var node = document.querySelector(\"[data-chunk-name=\".concat(chunkName, \"]\"));\n\n if (node) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(\"div\", {\n /* eslint-disable react/no-danger */\n dangerouslySetInnerHTML: {\n __html: node.innerHTML || ''\n }\n /* eslint-disable react/no-danger */\n ,\n\n /* eslint-disable react/no-danger */\n \"data-chunk-name\": chunkName\n });\n } // Else render placeholder, or empty div.\n\n\n // Else render placeholder, or empty div.\n var Scene = placeholder || function () {\n return null;\n };\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(\"div\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(Scene, _objectSpread(_objectSpread({}, rest), {}, {\n children: children\n }))\n });\n }),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),\n render = _useState2[0],\n setRender = _useState2[1]; // At this point, if we have data, the absense of heap.renderInitialized flag\n // means we have to await styles loading; once it is done, and if we are still\n // mounted, we can set the final render.\n\n\n if (data && !heap.renderInitialized) {\n heap.renderInitialized = true;\n Promise.all(heap.pendingStyles).then(function () {\n if (heap.mounted) setRender(createRender());\n });\n } // This effectively fires only once, just before the component unmounts.\n\n\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n return function () {\n heap.mounted = false;\n window.CHUNK_GROUPS[chunkName].forEach(function (item) {\n if (!item.endsWith('.css')) return;\n var path = \"\".concat(publicPath, \"/\").concat(item);\n var link = document.querySelector(\"link[href=\\\"\".concat(path, \"\\\"]\"));\n link.dependants.delete(chunkName);\n\n if (!link.dependants.size) {\n var head = document.querySelector('head');\n head.removeChild(link);\n }\n });\n };\n }, [chunkName, heap, publicPath]);\n return render;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/CodeSplit/ClientSide.jsx?");
69
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ ClientSide; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"@babel/runtime/helpers/slicedToArray\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"@babel/runtime/helpers/defineProperty\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"@babel/runtime/helpers/objectWithoutProperties\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__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_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 _utils_Barrier__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/Barrier */ \"./src/shared/utils/Barrier.js\");\n/* harmony import */ var _utils_isomorphy__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/isomorphy */ \"./src/shared/utils/isomorphy.js\");\n/* harmony import */ var _utils_time__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/time */ \"./src/shared/utils/time.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nvar _excluded = [\"chunkName\", \"children\", \"getClientSide\", \"placeholder\", \"serverSide\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n/**\n * Client-side implementation of a split code chunk.\n */\n\n/* global document, window */\n\n/* eslint-disable react/jsx-props-no-spreading */\n\n\n\n\n\n\nfunction ClientSide(_ref) {\n var chunkName = _ref.chunkName,\n children = _ref.children,\n getClientSide = _ref.getClientSide,\n placeholder = _ref.placeholder,\n serverSide = _ref.serverSide,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(_ref, _excluded);\n\n var _useRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)({\n mounted: false,\n pendingStyles: [],\n renderInitialized: false\n }),\n heap = _useRef.current; // publicPath from buildInfo does not have a trailing slash at the end.\n\n\n var _getBuildInfo = (0,_utils_isomorphy__WEBPACK_IMPORTED_MODULE_6__.getBuildInfo)(),\n publicPath = _getBuildInfo.publicPath; // This code block initiates style loading as soon as possible, even prior to\n // the component loading, and it collects all style load / failure promises\n // into heap.pendingStyles array, allowing us to wait and thus avoid flash of\n // unstyled content issue (that's why we don't rely on mini-css-extract-plugin\n // to handle CSS chunk mounting and unmounting, which it is able to do).\n\n\n if (!heap.mounted) {\n heap.mounted = true;\n window.CHUNK_GROUPS[chunkName].forEach(function (asset) {\n var _window, _window$STYLESHEET_US;\n\n if (!asset.endsWith('.css')) return;\n var path = \"\".concat(publicPath, \"/\").concat(asset);\n var link = document.querySelector(\"link[href=\\\"\".concat(path, \"\\\"]\"));\n\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('href', path);\n link.setAttribute('rel', 'stylesheet');\n var barrier = (0,_utils_Barrier__WEBPACK_IMPORTED_MODULE_5__.newBarrier)();\n link.onload = barrier.resolve; // Even if the style load failed, still allow to mount the component,\n // abeit with broken styling.\n\n link.onerror = barrier.resolve;\n heap.pendingStyles.push(barrier);\n var head = document.querySelector('head');\n head.appendChild(link);\n }\n\n (_window = window).STYLESHEET_USAGE_COUNTERS || (_window.STYLESHEET_USAGE_COUNTERS = {});\n (_window$STYLESHEET_US = window.STYLESHEET_USAGE_COUNTERS)[path] || (_window$STYLESHEET_US[path] = 0);\n ++window.STYLESHEET_USAGE_COUNTERS[path];\n });\n } // Async loading of React component necessary to render the chunk.\n\n\n var _useAsyncData = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useAsyncData)(\"dr_pogodin_react_utils___split_components.\".concat(chunkName), getClientSide, {\n maxage: _utils_time__WEBPACK_IMPORTED_MODULE_7__[\"default\"].YEAR_MS\n }),\n data = _useAsyncData.data;\n\n var createRender = function createRender() {\n var Scene = data.default || data;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(\"div\", {\n \"data-chunk-name\": chunkName,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(Scene, _objectSpread(_objectSpread({}, rest), {}, {\n children: children\n }))\n });\n };\n\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(function () {\n // No need to await anything, we can render the final component right away.\n if (data && !heap.pendingStyles.length) {\n heap.renderInitialized = true;\n return createRender();\n } // Try to reuse the markup rendered during SSR.\n\n\n // Try to reuse the markup rendered during SSR.\n var node = document.querySelector(\"[data-chunk-name=\".concat(chunkName, \"]\"));\n\n if (node) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(\"div\", {\n /* eslint-disable react/no-danger */\n dangerouslySetInnerHTML: {\n __html: node.innerHTML || ''\n }\n /* eslint-disable react/no-danger */\n ,\n\n /* eslint-disable react/no-danger */\n \"data-chunk-name\": chunkName\n });\n } // Else render placeholder, or empty div.\n\n\n // Else render placeholder, or empty div.\n var Scene = placeholder || function () {\n return null;\n };\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(\"div\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(Scene, _objectSpread(_objectSpread({}, rest), {}, {\n children: children\n }))\n });\n }),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),\n render = _useState2[0],\n setRender = _useState2[1]; // At this point, if we have data, the absense of heap.renderInitialized flag\n // means we have to await styles loading; once it is done, and if we are still\n // mounted, we can set the final render.\n\n\n if (data && !heap.renderInitialized) {\n heap.renderInitialized = true;\n Promise.all(heap.pendingStyles).then(function () {\n if (heap.mounted) setRender(createRender());\n });\n } // This effectively fires only once, just before the component unmounts.\n\n\n (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(function () {\n return function () {\n heap.mounted = false;\n window.CHUNK_GROUPS[chunkName].forEach(function (item) {\n if (!item.endsWith('.css')) return;\n var path = \"\".concat(publicPath, \"/\").concat(item);\n\n if (--window.STYLESHEET_USAGE_COUNTERS[path] <= 0) {\n var link = document.querySelector(\"link[href=\\\"\".concat(path, \"\\\"]\"));\n var head = document.querySelector('head');\n head.removeChild(link);\n }\n });\n };\n }, [chunkName, heap, publicPath]);\n return render;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/CodeSplit/ClientSide.jsx?");
70
70
 
71
71
  /***/ }),
72
72
 
@@ -216,7 +216,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
216
216
  \****************************************/
217
217
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
218
218
 
219
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\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 */ \"client\": function() { return /* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; },\n/* harmony export */ \"Dropdown\": function() { return /* reexport safe */ _Dropdown__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ \"Input\": function() { return /* reexport safe */ _Input__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ \"Link\": function() { return /* reexport safe */ _Link__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ \"PageLayout\": function() { return /* reexport safe */ _PageLayout__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ \"MetaTags\": function() { return /* reexport safe */ _MetaTags__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ \"Modal\": function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ \"BaseModal\": function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_8__.BaseModal; },\n/* harmony export */ \"NavLink\": function() { return /* reexport safe */ _NavLink__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ \"ScalableRect\": function() { return /* reexport safe */ _ScalableRect__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ \"Throbber\": function() { return /* reexport safe */ _Throbber__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; },\n/* harmony export */ \"WithTooltip\": function() { return /* reexport safe */ _WithTooltip__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; },\n/* harmony export */ \"YouTubeVideo\": function() { return /* reexport safe */ _YouTubeVideo__WEBPACK_IMPORTED_MODULE_13__[\"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 _client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../client */ \"./src/client/index.jsx\");\n/* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Dropdown */ \"./src/shared/components/Dropdown/index.jsx\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Input */ \"./src/shared/components/Input/index.jsx\");\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Link */ \"./src/shared/components/Link.jsx\");\n/* harmony import */ var _PageLayout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PageLayout */ \"./src/shared/components/PageLayout/index.jsx\");\n/* harmony import */ var _MetaTags__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./MetaTags */ \"./src/shared/components/MetaTags.jsx\");\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Modal */ \"./src/shared/components/Modal/index.jsx\");\n/* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./NavLink */ \"./src/shared/components/NavLink.jsx\");\n/* harmony import */ var _ScalableRect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ScalableRect */ \"./src/shared/components/ScalableRect/index.jsx\");\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Throbber */ \"./src/shared/components/Throbber/index.jsx\");\n/* harmony import */ var _WithTooltip__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./WithTooltip */ \"./src/shared/components/WithTooltip/index.jsx\");\n/* harmony import */ var _YouTubeVideo__WEBPACK_IMPORTED_MODULE_13__ = __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?");
219
+ 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_8__.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_3__[\"default\"]; },\n/* harmony export */ \"Input\": function() { return /* reexport safe */ _Input__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; },\n/* harmony export */ \"Link\": function() { return /* reexport safe */ _Link__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ \"MetaTags\": function() { return /* reexport safe */ _MetaTags__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ \"Modal\": function() { return /* reexport safe */ _Modal__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ \"NavLink\": function() { return /* reexport safe */ _NavLink__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ \"PageLayout\": function() { return /* reexport safe */ _PageLayout__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; },\n/* harmony export */ \"ScalableRect\": function() { return /* reexport safe */ _ScalableRect__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ \"Throbber\": function() { return /* reexport safe */ _Throbber__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; },\n/* harmony export */ \"WithTooltip\": function() { return /* reexport safe */ _WithTooltip__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; },\n/* harmony export */ \"YouTubeVideo\": function() { return /* reexport safe */ _YouTubeVideo__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; },\n/* harmony export */ \"client\": function() { return /* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_2__[\"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 _client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../client */ \"./src/client/index.jsx\");\n/* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Dropdown */ \"./src/shared/components/Dropdown/index.jsx\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Input */ \"./src/shared/components/Input/index.jsx\");\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Link */ \"./src/shared/components/Link.jsx\");\n/* harmony import */ var _PageLayout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PageLayout */ \"./src/shared/components/PageLayout/index.jsx\");\n/* harmony import */ var _MetaTags__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./MetaTags */ \"./src/shared/components/MetaTags.jsx\");\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Modal */ \"./src/shared/components/Modal/index.jsx\");\n/* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./NavLink */ \"./src/shared/components/NavLink.jsx\");\n/* harmony import */ var _ScalableRect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ScalableRect */ \"./src/shared/components/ScalableRect/index.jsx\");\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Throbber */ \"./src/shared/components/Throbber/index.jsx\");\n/* harmony import */ var _WithTooltip__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./WithTooltip */ \"./src/shared/components/WithTooltip/index.jsx\");\n/* harmony import */ var _YouTubeVideo__WEBPACK_IMPORTED_MODULE_13__ = __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?");
220
220
 
221
221
  /***/ }),
222
222
 
@@ -246,7 +246,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
246
246
  \***************************************/
247
247
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
248
248
 
249
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Semaphore; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"@babel/runtime/helpers/asyncToGenerator\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"@babel/runtime/helpers/classCallCheck\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"@babel/runtime/helpers/createClass\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classPrivateFieldGet */ \"@babel/runtime/helpers/classPrivateFieldGet\");\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classPrivateFieldSet */ \"@babel/runtime/helpers/classPrivateFieldSet\");\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _Barrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Barrier */ \"./src/shared/utils/Barrier.js\");\n\n\n\n\n\n\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\n\n/**\n * Implements a simple semaphore for async code logic.\n */\n\nvar _barrier = /*#__PURE__*/new WeakMap();\n\nvar _ready = /*#__PURE__*/new WeakMap();\n\nvar Semaphore = /*#__PURE__*/function () {\n function Semaphore() {\n var ready = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Semaphore);\n\n _classPrivateFieldInitSpec(this, _barrier, {\n writable: true,\n value: void 0\n });\n\n _classPrivateFieldInitSpec(this, _ready, {\n writable: true,\n value: void 0\n });\n\n _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _ready, ready);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Semaphore, [{\n key: \"ready\",\n get: function get() {\n return _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _ready);\n }\n }, {\n key: \"setReady\",\n value: function setReady(ready) {\n _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _ready, ready);\n\n if (_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _barrier)) {\n _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _barrier).resolve();\n\n _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _barrier, undefined);\n }\n }\n /**\n * Waits until the semaphore is ready, and marks it as non-ready (seizes it).\n * @return {Promise}\n */\n\n }, {\n key: \"seize\",\n value: function () {\n var _seize = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.waitReady();\n\n case 2:\n this.setReady(false);\n\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function seize() {\n return _seize.apply(this, arguments);\n }\n\n return seize;\n }()\n }, {\n key: \"waitReady\",\n value: function () {\n var _waitReady = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _ready)) {\n _context2.next = 6;\n break;\n }\n\n if (!_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _barrier)) _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _barrier, (0,_Barrier__WEBPACK_IMPORTED_MODULE_6__.newBarrier)());\n _context2.next = 4;\n return _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _barrier);\n\n case 4:\n _context2.next = 0;\n break;\n\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function waitReady() {\n return _waitReady.apply(this, arguments);\n }\n\n return waitReady;\n }()\n }]);\n\n return Semaphore;\n}();\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/Semaphore.js?");
249
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Semaphore; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"@babel/runtime/helpers/asyncToGenerator\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"@babel/runtime/helpers/classCallCheck\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"@babel/runtime/helpers/createClass\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classPrivateFieldGet */ \"@babel/runtime/helpers/classPrivateFieldGet\");\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classPrivateFieldSet */ \"@babel/runtime/helpers/classPrivateFieldSet\");\n/* harmony import */ var _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _Barrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Barrier */ \"./src/shared/utils/Barrier.js\");\n\n\n\n\n\n\n\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\n\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\n\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\n\nfunction _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError(\"attempted to get private field on non-instance\"); } return fn; }\n\n\n/**\n * Implements a simple semaphore for async code logic.\n */\n\nvar _drainQueue = /*#__PURE__*/new WeakSet();\n\nvar _draining = /*#__PURE__*/new WeakMap();\n\nvar _queue = /*#__PURE__*/new WeakMap();\n\nvar _ready = /*#__PURE__*/new WeakMap();\n\nvar Semaphore = /*#__PURE__*/function () {\n function Semaphore(ready) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Semaphore);\n\n _classPrivateMethodInitSpec(this, _drainQueue);\n\n _classPrivateFieldInitSpec(this, _draining, {\n writable: true,\n value: false\n });\n\n _classPrivateFieldInitSpec(this, _queue, {\n writable: true,\n value: []\n });\n\n _classPrivateFieldInitSpec(this, _ready, {\n writable: true,\n value: void 0\n });\n\n _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _ready, !!ready);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Semaphore, [{\n key: \"ready\",\n get: function get() {\n return _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _ready);\n }\n }, {\n key: \"setReady\",\n value: function setReady(ready) {\n var bool = !!ready;\n\n if (_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _ready) !== bool) {\n _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _ready, bool);\n\n if (bool && !_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _draining)) _classPrivateMethodGet(this, _drainQueue, _drainQueue2).call(this);\n }\n }\n /**\n * Waits until the semaphore is ready, and marks it as non-ready (seizes it).\n * @return {Promise}\n */\n\n }, {\n key: \"seize\",\n value: function () {\n var _seize = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.waitReady();\n\n case 2:\n this.setReady(false);\n\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function seize() {\n return _seize.apply(this, arguments);\n }\n\n return seize;\n }()\n }, {\n key: \"waitReady\",\n value: function () {\n var _waitReady = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee2() {\n var barrier;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(!_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _ready) || _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _queue).length)) {\n _context2.next = 5;\n break;\n }\n\n barrier = (0,_Barrier__WEBPACK_IMPORTED_MODULE_6__.newBarrier)();\n\n _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _queue).push(barrier);\n\n _context2.next = 5;\n return barrier;\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function waitReady() {\n return _waitReady.apply(this, arguments);\n }\n\n return waitReady;\n }() // Private members below this point.\n\n /**\n * If semaphore is ready, it releases the next barrier in the queue, if any,\n * and reschedules itself for a call in the next event loop iteration.\n * Otherwise, it breaks the queue draining loop, which will be restarted\n * the next time the semaphore is set ready.\n */\n\n }]);\n\n return Semaphore;\n}();\n\nfunction _drainQueue2() {\n if (_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _ready) && _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _queue).length) {\n var next = _babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _queue).shift();\n\n next.resolve(); // Re-schedules itself for the next event loop iteration.\n\n if (_babel_runtime_helpers_classPrivateFieldGet__WEBPACK_IMPORTED_MODULE_3___default()(this, _queue).length) {\n setTimeout(_classPrivateMethodGet(this, _drainQueue, _drainQueue2).bind(this));\n\n _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _draining, true);\n\n return; // Exit here to avoid the drain loop termination below.\n }\n } // Cleans up for the drain loop termination.\n\n\n _babel_runtime_helpers_classPrivateFieldSet__WEBPACK_IMPORTED_MODULE_4___default()(this, _draining, false);\n}\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/Semaphore.js?");
250
250
 
251
251
  /***/ }),
252
252
 
@@ -266,7 +266,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _web
266
266
  \***********************************/
267
267
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
268
268
 
269
- 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_7__.Barrier; },\n/* harmony export */ \"newBarrier\": function() { return /* reexport safe */ _Barrier__WEBPACK_IMPORTED_MODULE_7__.newBarrier; },\n/* harmony export */ \"Emitter\": function() { return /* reexport safe */ _Emitter__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ \"Semaphore\": function() { return /* reexport safe */ _Semaphore__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ \"splitComponent\": function() { return /* reexport safe */ _splitComponent__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ \"withRetries\": function() { return /* binding */ withRetries; },\n/* harmony export */ \"config\": function() { return /* reexport safe */ _config__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ \"isomorphy\": function() { return /* reexport module object */ _isomorphy__WEBPACK_IMPORTED_MODULE_4__; },\n/* harmony export */ \"JU\": function() { return /* binding */ JU; },\n/* harmony export */ \"themed\": function() { return /* reexport default from dynamic */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default.a; },\n/* harmony export */ \"ThemeProvider\": function() { return /* reexport safe */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__.ThemeProvider; },\n/* harmony export */ \"time\": function() { return /* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ \"webpack\": function() { return /* reexport module object */ _webpack__WEBPACK_IMPORTED_MODULE_6__; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"@babel/runtime/helpers/asyncToGenerator\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ \"./src/shared/utils/config.js\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy.js\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./time */ \"./src/shared/utils/time.js\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.js\");\n/* harmony import */ var _Barrier__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Barrier */ \"./src/shared/utils/Barrier.js\");\n/* harmony import */ var _Emitter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Emitter */ \"./src/shared/utils/Emitter.js\");\n/* harmony import */ var _Semaphore__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Semaphore */ \"./src/shared/utils/Semaphore.js\");\n/* harmony import */ var _splitComponent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./splitComponent */ \"./src/shared/utils/splitComponent.js\");\n\n\n\n\n\n\n\n\n\n\n\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default().COMPOSE) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__.COMPOSE;\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default().PRIORITY) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__.PRIORITY; // 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.\n\nvar NODE_CONFIG_ENV;\n\ntry {\n NODE_CONFIG_ENV = process.env.NODE_CONFIG_ENV;\n} catch (_unused) {\n /* noop */\n}\n\nvar env = NODE_CONFIG_ENV || \"development\";\nvar JU = env !== 'production' && _webpack__WEBPACK_IMPORTED_MODULE_6__.requireWeak('./jest', __dirname);\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 */\n\nfunction withRetries(_x) {\n return _withRetries.apply(this, arguments);\n}\n\nfunction _withRetries() {\n _withRetries = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(action) {\n var maxRetries,\n interval,\n n,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n maxRetries = _args.length > 1 && _args[1] !== undefined ? _args[1] : 5;\n interval = _args.length > 2 && _args[2] !== undefined ? _args[2] : 1000;\n n = 1;\n\n case 3:\n _context.prev = 3;\n _context.next = 6;\n return action();\n\n case 6:\n return _context.abrupt(\"return\", _context.sent);\n\n case 9:\n _context.prev = 9;\n _context.t0 = _context[\"catch\"](3);\n\n if (!(n < maxRetries)) {\n _context.next = 16;\n break;\n }\n\n _context.next = 14;\n return _time__WEBPACK_IMPORTED_MODULE_5__[\"default\"].timer(interval);\n\n case 14:\n _context.next = 17;\n break;\n\n case 16:\n throw _context.t0;\n\n case 17:\n ++n;\n _context.next = 3;\n break;\n\n case 20:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[3, 9]]);\n }));\n return _withRetries.apply(this, arguments);\n}\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/index.js?");
269
+ 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_7__.Barrier; },\n/* harmony export */ \"Emitter\": function() { return /* reexport safe */ _Emitter__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; },\n/* harmony export */ \"JU\": function() { return /* binding */ JU; },\n/* harmony export */ \"Semaphore\": function() { return /* reexport safe */ _Semaphore__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; },\n/* harmony export */ \"ThemeProvider\": function() { return /* reexport safe */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__.ThemeProvider; },\n/* harmony export */ \"config\": function() { return /* reexport safe */ _config__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ \"isomorphy\": function() { return /* reexport module object */ _isomorphy__WEBPACK_IMPORTED_MODULE_4__; },\n/* harmony export */ \"newBarrier\": function() { return /* reexport safe */ _Barrier__WEBPACK_IMPORTED_MODULE_7__.newBarrier; },\n/* harmony export */ \"splitComponent\": function() { return /* reexport safe */ _splitComponent__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; },\n/* harmony export */ \"themed\": function() { return /* reexport default from dynamic */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default.a; },\n/* harmony export */ \"time\": function() { return /* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; },\n/* harmony export */ \"webpack\": function() { return /* reexport module object */ _webpack__WEBPACK_IMPORTED_MODULE_6__; },\n/* harmony export */ \"withRetries\": function() { return /* binding */ withRetries; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"@babel/runtime/helpers/asyncToGenerator\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ \"./src/shared/utils/config.js\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy.js\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./time */ \"./src/shared/utils/time.js\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.js\");\n/* harmony import */ var _Barrier__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Barrier */ \"./src/shared/utils/Barrier.js\");\n/* harmony import */ var _Emitter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Emitter */ \"./src/shared/utils/Emitter.js\");\n/* harmony import */ var _Semaphore__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Semaphore */ \"./src/shared/utils/Semaphore.js\");\n/* harmony import */ var _splitComponent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./splitComponent */ \"./src/shared/utils/splitComponent.js\");\n\n\n\n\n\n\n\n\n\n\n\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default().COMPOSE) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__.COMPOSE;\n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default().PRIORITY) = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__.PRIORITY; // 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.\n\nvar NODE_CONFIG_ENV;\n\ntry {\n NODE_CONFIG_ENV = process.env.NODE_CONFIG_ENV;\n} catch (_unused) {\n /* noop */\n}\n\nvar env = NODE_CONFIG_ENV || \"development\";\nvar JU = env !== 'production' && _webpack__WEBPACK_IMPORTED_MODULE_6__.requireWeak('./jest', __dirname);\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 */\n\nfunction withRetries(_x) {\n return _withRetries.apply(this, arguments);\n}\n\nfunction _withRetries() {\n _withRetries = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(action) {\n var maxRetries,\n interval,\n n,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n maxRetries = _args.length > 1 && _args[1] !== undefined ? _args[1] : 5;\n interval = _args.length > 2 && _args[2] !== undefined ? _args[2] : 1000;\n n = 1;\n\n case 3:\n _context.prev = 3;\n _context.next = 6;\n return action();\n\n case 6:\n return _context.abrupt(\"return\", _context.sent);\n\n case 9:\n _context.prev = 9;\n _context.t0 = _context[\"catch\"](3);\n\n if (!(n < maxRetries)) {\n _context.next = 16;\n break;\n }\n\n _context.next = 14;\n return _time__WEBPACK_IMPORTED_MODULE_5__[\"default\"].timer(interval);\n\n case 14:\n _context.next = 17;\n break;\n\n case 16:\n throw _context.t0;\n\n case 17:\n ++n;\n _context.next = 3;\n break;\n\n case 20:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[3, 9]]);\n }));\n return _withRetries.apply(this, arguments);\n}\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/index.js?");
270
270
 
271
271
  /***/ }),
272
272
 
@@ -276,7 +276,7 @@ eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* ha
276
276
  \***************************************/
277
277
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
278
278
 
279
- 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 */ \"isDevBuild\": function() { return /* binding */ isDevBuild; },\n/* harmony export */ \"isProdBuild\": function() { return /* binding */ isProdBuild; },\n/* harmony export */ \"getBuildInfo\": function() { return /* binding */ getBuildInfo; },\n/* harmony export */ \"buildTimestamp\": function() { return /* binding */ buildTimestamp; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"@babel/runtime/helpers/typeof\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n\n\n/* global window */\n\n/**\n * `true` within client-side environment (browser), `false` at server-side.\n */\nvar IS_CLIENT_SIDE = (typeof process === \"undefined\" ? \"undefined\" : _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(process)) !== 'object' || !process.versions || !process.versions.node;\n/**\n * `true` within the server-side environment (node), `false` at client-side.\n */\n\nvar IS_SERVER_SIDE = !IS_CLIENT_SIDE;\n/**\n * @ignore\n * @return {string} Code mode: \"development\" or \"production\".\n */\n\nfunction getMode() {\n return \"development\";\n}\n/**\n * Returns `true` if development version of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\n\n\nfunction isDevBuild() {\n return getMode() === 'development';\n}\n/**\n * Returns `true` if production build of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\n\nfunction isProdBuild() {\n return getMode() === 'production';\n}\n/**\n * Returns build info object.\n * @returns {object}\n */\n\nfunction getBuildInfo() {\n return (IS_CLIENT_SIDE ? window : __webpack_require__.g).TRU_BUILD_INFO;\n}\n/**\n * Returns build timestamp of the front-end JS bundle.\n * @return {string} ISO date/time string.\n */\n\nfunction buildTimestamp() {\n return getBuildInfo().timestamp;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy.js?");
279
+ 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 */ \"buildTimestamp\": function() { return /* binding */ buildTimestamp; },\n/* harmony export */ \"getBuildInfo\": function() { return /* binding */ getBuildInfo; },\n/* harmony export */ \"isDevBuild\": function() { return /* binding */ isDevBuild; },\n/* harmony export */ \"isProdBuild\": function() { return /* binding */ isProdBuild; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"@babel/runtime/helpers/typeof\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n\n\n/* global window */\n\n/**\n * `true` within client-side environment (browser), `false` at server-side.\n */\nvar IS_CLIENT_SIDE = (typeof process === \"undefined\" ? \"undefined\" : _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(process)) !== 'object' || !process.versions || !process.versions.node;\n/**\n * `true` within the server-side environment (node), `false` at client-side.\n */\n\nvar IS_SERVER_SIDE = !IS_CLIENT_SIDE;\n/**\n * @ignore\n * @return {string} Code mode: \"development\" or \"production\".\n */\n\nfunction getMode() {\n return \"development\";\n}\n/**\n * Returns `true` if development version of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\n\n\nfunction isDevBuild() {\n return getMode() === 'development';\n}\n/**\n * Returns `true` if production build of the code is running;\n * `false` otherwise.\n * @return {boolean}\n */\n\nfunction isProdBuild() {\n return getMode() === 'production';\n}\n/**\n * Returns build info object.\n * @returns {object}\n */\n\nfunction getBuildInfo() {\n return (IS_CLIENT_SIDE ? window : __webpack_require__.g).TRU_BUILD_INFO;\n}\n/**\n * Returns build timestamp of the front-end JS bundle.\n * @return {string} ISO date/time string.\n */\n\nfunction buildTimestamp() {\n return getBuildInfo().timestamp;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy.js?");
280
280
 
281
281
  /***/ }),
282
282
 
@@ -1,5 +1,5 @@
1
1
  "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _Link=_interopRequireDefault(require("../Link"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");// The <Button> component implements a standard button / button-like link.
2
- var defaultTheme={"context":"KM0v4f","ad":"_3jm1-Q","hoc":"_0plpDL","button":"E1FNQT","active":"MAe9O6","disabled":"Br9IWV"};function BaseButton({active,children,disabled,enforceA,onClick,onMouseDown,openNewTab,replace,theme,to}){let className=theme.button;if(active&&theme.active)className+=` ${theme.active}`;if(disabled){if(theme.disabled)className+=` ${theme.disabled}`;return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:className,children:children})}if(to){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Link.default,{className:className,enforceA:enforceA,onClick:onClick,onMouseDown:onMouseDown,openNewTab:openNewTab,replace:replace,to:to,children:children})}return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:className,onClick:onClick,onKeyPress:onClick,onMouseDown:onMouseDown,role:"button",tabIndex:0,children:children})}/**
2
+ const defaultTheme={"context":"KM0v4f","ad":"_3jm1-Q","hoc":"_0plpDL","button":"E1FNQT","active":"MAe9O6","disabled":"Br9IWV"};function BaseButton({active,children,disabled,enforceA,onClick,onMouseDown,openNewTab,replace,theme,to}){let className=theme.button;if(active&&theme.active)className+=` ${theme.active}`;if(disabled){if(theme.disabled)className+=` ${theme.disabled}`;return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:className,children:children})}if(to){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Link.default,{className:className,enforceA:enforceA,onClick:onClick,onMouseDown:onMouseDown,openNewTab:openNewTab,replace:replace,to:to,children:children})}return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:className,onClick:onClick,onKeyPress:onClick,onMouseDown:onMouseDown,role:"button",tabIndex:0,children:children})}/**
3
3
  * Button component theme: a map of CSS
4
4
  * class names to append to button elements:
5
5
  * @prop {string} [active] to the root element of active button.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/Button/index.jsx"],"names":["BaseButton","active","children","disabled","enforceA","onClick","onMouseDown","openNewTab","replace","theme","to","className","button","ThemedButton","defaultTheme","defaultProps","undefined","propTypes","PT","bool","node","func","themeType","isRequired","oneOfType","object","string"],"mappings":"gLAEA,6DAEA,qDAEA,kC,6CANA;6HAUA,QAASA,CAAAA,UAAT,CAAoB,CAClBC,MADkB,CAElBC,QAFkB,CAGlBC,QAHkB,CAIlBC,QAJkB,CAKlBC,OALkB,CAMlBC,WANkB,CAOlBC,UAPkB,CAQlBC,OARkB,CASlBC,KATkB,CAUlBC,EAVkB,CAApB,CAWG,CACD,GAAIC,CAAAA,SAAS,CAAGF,KAAK,CAACG,MAAtB,CACA,GAAIX,MAAM,EAAIQ,KAAK,CAACR,MAApB,CAA4BU,SAAS,EAAK,IAAGF,KAAK,CAACR,MAAO,EAA9B,CAC5B,GAAIE,QAAJ,CAAc,CACZ,GAAIM,KAAK,CAACN,QAAV,CAAoBQ,SAAS,EAAK,IAAGF,KAAK,CAACN,QAAS,EAAhC,CACpB,mBACE,2BAAK,SAAS,CAAEQ,SAAhB,UACGT,QADH,EAIH,CACD,GAAIQ,EAAJ,CAAQ,CACN,mBACE,oBAAC,aAAD,EACE,SAAS,CAAEC,SADb,CAEE,QAAQ,CAAEP,QAFZ,CAGE,OAAO,CAAEC,OAHX,CAIE,WAAW,CAAEC,WAJf,CAKE,UAAU,CAAEC,UALd,CAME,OAAO,CAAEC,OANX,CAOE,EAAE,CAAEE,EAPN,UASGR,QATH,EAYH,CACD,mBACE,2BACE,SAAS,CAAES,SADb,CAEE,OAAO,CAAEN,OAFX,CAGE,UAAU,CAAEA,OAHd,CAIE,WAAW,CAAEC,WAJf,CAKE,IAAI,CAAC,QALP,CAME,QAAQ,CAAE,CANZ,UAQGJ,QARH,EAWH,CAED;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAMW,CAAAA,YAAY,CAAG,kBAAO,QAAP,CAAiB,CACpC,QADoC,CAEpC,QAFoC,CAGpC,UAHoC,CAAjB,CAIlBC,YAJkB,EAIJd,UAJI,CAArB,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACAA,UAAU,CAACe,YAAX,CAA0B,CACxBd,MAAM,CAAE,KADgB,CAExBC,QAAQ,CAAEc,SAFc,CAGxBb,QAAQ,CAAE,KAHc,CAIxBC,QAAQ,CAAE,KAJc,CAKxBC,OAAO,CAAEW,SALe,CAMxBV,WAAW,CAAEU,SANW,CAOxBT,UAAU,CAAE,KAPY,CAQxBC,OAAO,CAAE,KARe,CASxBE,EAAE,CAAEM,SAToB,CAA1B,CAYAhB,UAAU,CAACiB,SAAX,CAAuB,CACrBhB,MAAM,CAAEiB,mBAAGC,IADU,CAErBjB,QAAQ,CAAEgB,mBAAGE,IAFQ,CAGrBjB,QAAQ,CAAEe,mBAAGC,IAHQ,CAIrBf,QAAQ,CAAEc,mBAAGC,IAJQ,CAKrBd,OAAO,CAAEa,mBAAGG,IALS,CAMrBf,WAAW,CAAEY,mBAAGG,IANK,CAOrBd,UAAU,CAAEW,mBAAGC,IAPM,CAQrBX,OAAO,CAAEU,mBAAGC,IARS,CASrBV,KAAK,CAAEI,YAAY,CAACS,SAAb,CAAuBC,UATT,CAUrBb,EAAE,CAAEQ,mBAAGM,SAAH,CAAa,CAACN,mBAAGO,MAAJ,CAAYP,mBAAGQ,MAAf,CAAb,CAViB,CAAvB,C,aAaeb,Y","sourcesContent":["// The <Button> component implements a standard button / button-like link.\n\nimport PT from 'prop-types';\n\nimport Link from 'components/Link';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './style.scss';\n\nfunction BaseButton({\n active,\n children,\n disabled,\n enforceA,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n theme,\n to,\n}) {\n let className = theme.button;\n if (active && theme.active) className += ` ${theme.active}`;\n if (disabled) {\n if (theme.disabled) className += ` ${theme.disabled}`;\n return (\n <div className={className}>\n {children}\n </div>\n );\n }\n if (to) {\n return (\n <Link\n className={className}\n enforceA={enforceA}\n onClick={onClick}\n onMouseDown={onMouseDown}\n openNewTab={openNewTab}\n replace={replace}\n to={to}\n >\n {children}\n </Link>\n );\n }\n return (\n <div\n className={className}\n onClick={onClick}\n onKeyPress={onClick}\n onMouseDown={onMouseDown}\n role=\"button\"\n tabIndex={0}\n >\n {children}\n </div>\n );\n}\n\n/**\n * Button component theme: a map of CSS\n * class names to append to button elements:\n * @prop {string} [active] to the root element of active button.\n * @prop {string} [button] to the root element of any button.\n * @prop {string} [disabled] to the root element of disabled button.\n */\nconst ThemedButton = themed('Button', [\n 'active',\n 'button',\n 'disabled',\n], defaultTheme)(BaseButton);\n\n/**\n * Implements themeable buttons, and button-line links (elements which look\n * like buttons, but behave as links) in the same uniform manner.\n * @param {object} [props] Component props.\n * @param {boolean} [props.active] Set `true` to render the button as\n * active, even if it is not active otherwise.\n * @param {boolean} [props.disabled] Set `true` to disable the button.\n * @param {boolean} [props.enforceA] When the button is rendered as `<Link>`\n * component, this prop enforces it to be rendered as a simple `<a>` element\n * (external link), rather than the React router's internal link.\n * See `<Link>` documentation to learn when links are rendered as `<a>`\n * by default.\n * @param {function} [props.onClick] Click event handler.\n * @param {function} [props.onMouseDown] Mouse down event handler.\n * @param {boolean} [props.openNewTab] Set `true` to open link in the new tab.\n * @param {boolean} [props.replace] When the button is rendered as\n * `<Link>`, and the target URL is internal, this property tells that\n * the new route should replace the last record in the browser's history,\n * rather than to be pushed as a new entry into the history stack.\n * @param {ButtonTheme} [props.theme] _Ad hoc_ button theme.\n * @param {object|string} [props.to] If specified, the button will be rendered\n * as `<Link>` (if not disabled), and it will point to the specified location\n * or URL.\n * @param {...any} [props....]\n * [Other properties of themeable components](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nBaseButton.defaultProps = {\n active: false,\n children: undefined,\n disabled: false,\n enforceA: false,\n onClick: undefined,\n onMouseDown: undefined,\n openNewTab: false,\n replace: false,\n to: undefined,\n};\n\nBaseButton.propTypes = {\n active: PT.bool,\n children: PT.node,\n disabled: PT.bool,\n enforceA: PT.bool,\n onClick: PT.func,\n onMouseDown: PT.func,\n openNewTab: PT.bool,\n replace: PT.bool,\n theme: ThemedButton.themeType.isRequired,\n to: PT.oneOfType([PT.object, PT.string]),\n};\n\nexport default ThemedButton;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/Button/index.jsx"],"names":["BaseButton","active","children","disabled","enforceA","onClick","onMouseDown","openNewTab","replace","theme","to","className","button","ThemedButton","defaultTheme","defaultProps","undefined","propTypes","PT","bool","node","func","themeType","isRequired","oneOfType","object","string"],"mappings":"gLAEA,6DAEA,qDAEA,kC,6CANA;+HAUA,QAASA,CAAAA,UAAT,CAAoB,CAClBC,MADkB,CAElBC,QAFkB,CAGlBC,QAHkB,CAIlBC,QAJkB,CAKlBC,OALkB,CAMlBC,WANkB,CAOlBC,UAPkB,CAQlBC,OARkB,CASlBC,KATkB,CAUlBC,EAVkB,CAApB,CAWG,CACD,GAAIC,CAAAA,SAAS,CAAGF,KAAK,CAACG,MAAtB,CACA,GAAIX,MAAM,EAAIQ,KAAK,CAACR,MAApB,CAA4BU,SAAS,EAAK,IAAGF,KAAK,CAACR,MAAO,EAA9B,CAC5B,GAAIE,QAAJ,CAAc,CACZ,GAAIM,KAAK,CAACN,QAAV,CAAoBQ,SAAS,EAAK,IAAGF,KAAK,CAACN,QAAS,EAAhC,CACpB,mBACE,2BAAK,SAAS,CAAEQ,SAAhB,UACGT,QADH,EAIH,CACD,GAAIQ,EAAJ,CAAQ,CACN,mBACE,oBAAC,aAAD,EACE,SAAS,CAAEC,SADb,CAEE,QAAQ,CAAEP,QAFZ,CAGE,OAAO,CAAEC,OAHX,CAIE,WAAW,CAAEC,WAJf,CAKE,UAAU,CAAEC,UALd,CAME,OAAO,CAAEC,OANX,CAOE,EAAE,CAAEE,EAPN,UASGR,QATH,EAYH,CACD,mBACE,2BACE,SAAS,CAAES,SADb,CAEE,OAAO,CAAEN,OAFX,CAGE,UAAU,CAAEA,OAHd,CAIE,WAAW,CAAEC,WAJf,CAKE,IAAI,CAAC,QALP,CAME,QAAQ,CAAE,CANZ,UAQGJ,QARH,EAWH,CAED;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAMW,CAAAA,YAAY,CAAG,kBAAO,QAAP,CAAiB,CACpC,QADoC,CAEpC,QAFoC,CAGpC,UAHoC,CAAjB,CAIlBC,YAJkB,EAIJd,UAJI,CAArB,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACAA,UAAU,CAACe,YAAX,CAA0B,CACxBd,MAAM,CAAE,KADgB,CAExBC,QAAQ,CAAEc,SAFc,CAGxBb,QAAQ,CAAE,KAHc,CAIxBC,QAAQ,CAAE,KAJc,CAKxBC,OAAO,CAAEW,SALe,CAMxBV,WAAW,CAAEU,SANW,CAOxBT,UAAU,CAAE,KAPY,CAQxBC,OAAO,CAAE,KARe,CASxBE,EAAE,CAAEM,SAToB,CAA1B,CAYAhB,UAAU,CAACiB,SAAX,CAAuB,CACrBhB,MAAM,CAAEiB,mBAAGC,IADU,CAErBjB,QAAQ,CAAEgB,mBAAGE,IAFQ,CAGrBjB,QAAQ,CAAEe,mBAAGC,IAHQ,CAIrBf,QAAQ,CAAEc,mBAAGC,IAJQ,CAKrBd,OAAO,CAAEa,mBAAGG,IALS,CAMrBf,WAAW,CAAEY,mBAAGG,IANK,CAOrBd,UAAU,CAAEW,mBAAGC,IAPM,CAQrBX,OAAO,CAAEU,mBAAGC,IARS,CASrBV,KAAK,CAAEI,YAAY,CAACS,SAAb,CAAuBC,UATT,CAUrBb,EAAE,CAAEQ,mBAAGM,SAAH,CAAa,CAACN,mBAAGO,MAAJ,CAAYP,mBAAGQ,MAAf,CAAb,CAViB,CAAvB,C,aAaeb,Y","sourcesContent":["// The <Button> component implements a standard button / button-like link.\n\nimport PT from 'prop-types';\n\nimport Link from 'components/Link';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './style.scss';\n\nfunction BaseButton({\n active,\n children,\n disabled,\n enforceA,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n theme,\n to,\n}) {\n let className = theme.button;\n if (active && theme.active) className += ` ${theme.active}`;\n if (disabled) {\n if (theme.disabled) className += ` ${theme.disabled}`;\n return (\n <div className={className}>\n {children}\n </div>\n );\n }\n if (to) {\n return (\n <Link\n className={className}\n enforceA={enforceA}\n onClick={onClick}\n onMouseDown={onMouseDown}\n openNewTab={openNewTab}\n replace={replace}\n to={to}\n >\n {children}\n </Link>\n );\n }\n return (\n <div\n className={className}\n onClick={onClick}\n onKeyPress={onClick}\n onMouseDown={onMouseDown}\n role=\"button\"\n tabIndex={0}\n >\n {children}\n </div>\n );\n}\n\n/**\n * Button component theme: a map of CSS\n * class names to append to button elements:\n * @prop {string} [active] to the root element of active button.\n * @prop {string} [button] to the root element of any button.\n * @prop {string} [disabled] to the root element of disabled button.\n */\nconst ThemedButton = themed('Button', [\n 'active',\n 'button',\n 'disabled',\n], defaultTheme)(BaseButton);\n\n/**\n * Implements themeable buttons, and button-line links (elements which look\n * like buttons, but behave as links) in the same uniform manner.\n * @param {object} [props] Component props.\n * @param {boolean} [props.active] Set `true` to render the button as\n * active, even if it is not active otherwise.\n * @param {boolean} [props.disabled] Set `true` to disable the button.\n * @param {boolean} [props.enforceA] When the button is rendered as `<Link>`\n * component, this prop enforces it to be rendered as a simple `<a>` element\n * (external link), rather than the React router's internal link.\n * See `<Link>` documentation to learn when links are rendered as `<a>`\n * by default.\n * @param {function} [props.onClick] Click event handler.\n * @param {function} [props.onMouseDown] Mouse down event handler.\n * @param {boolean} [props.openNewTab] Set `true` to open link in the new tab.\n * @param {boolean} [props.replace] When the button is rendered as\n * `<Link>`, and the target URL is internal, this property tells that\n * the new route should replace the last record in the browser's history,\n * rather than to be pushed as a new entry into the history stack.\n * @param {ButtonTheme} [props.theme] _Ad hoc_ button theme.\n * @param {object|string} [props.to] If specified, the button will be rendered\n * as `<Link>` (if not disabled), and it will point to the specified location\n * or URL.\n * @param {...any} [props....]\n * [Other properties of themeable components](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nBaseButton.defaultProps = {\n active: false,\n children: undefined,\n disabled: false,\n enforceA: false,\n onClick: undefined,\n onMouseDown: undefined,\n openNewTab: false,\n replace: false,\n to: undefined,\n};\n\nBaseButton.propTypes = {\n active: PT.bool,\n children: PT.node,\n disabled: PT.bool,\n enforceA: PT.bool,\n onClick: PT.func,\n onMouseDown: PT.func,\n openNewTab: PT.bool,\n replace: PT.bool,\n theme: ThemedButton.themeType.isRequired,\n to: PT.oneOfType([PT.object, PT.string]),\n};\n\nexport default ThemedButton;\n"],"file":"index.js"}