@dr.pogodin/react-utils 1.41.10 → 1.41.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/development/shared/components/Modal/index.js +4 -3
- package/build/development/shared/components/Modal/index.js.map +1 -1
- package/build/development/web.bundle.js +1 -1
- package/build/production/shared/components/Modal/index.js +4 -3
- package/build/production/shared/components/Modal/index.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/shared/components/Modal/index.d.ts +5 -4
- package/package.json +10 -10
- package/src/shared/components/Modal/index.tsx +9 -7
|
@@ -9,7 +9,6 @@ var _react = require("react");
|
|
|
9
9
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
10
10
|
var _reactThemes = _interopRequireDefault(require("@dr.pogodin/react-themes"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/* global document */
|
|
13
12
|
const baseTheme = {
|
|
14
13
|
"context": "-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___context___Szmbbz",
|
|
15
14
|
"ad": "-dr-pogodin-react-utils___src-shared-components-Modal-base-theme___ad___Ah-Nsc",
|
|
@@ -37,6 +36,7 @@ const BaseModal = ({
|
|
|
37
36
|
containerStyle,
|
|
38
37
|
dontDisableScrolling,
|
|
39
38
|
onCancel,
|
|
39
|
+
overlayStyle,
|
|
40
40
|
style,
|
|
41
41
|
testId,
|
|
42
42
|
testIdForOverlay,
|
|
@@ -88,9 +88,9 @@ const BaseModal = ({
|
|
|
88
88
|
}
|
|
89
89
|
overlayRef.current?.focus();
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
92
|
+
,
|
|
92
93
|
tabIndex: 0
|
|
93
|
-
/* eslint-enable jsx-a11y/no-noninteractive-tabindex */
|
|
94
94
|
}), []);
|
|
95
95
|
return portal ? /*#__PURE__*/_reactDom.default.createPortal(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
96
96
|
children: [focusLast, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -116,6 +116,7 @@ const BaseModal = ({
|
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
role: "button",
|
|
119
|
+
style: overlayStyle,
|
|
119
120
|
tabIndex: 0
|
|
120
121
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
121
122
|
"aria-modal": "true",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","require","_reactDom","_interopRequireDefault","_reactThemes","_jsxRuntime","baseTheme","S","BaseModal","cancelOnScrolling","children","containerStyle","dontDisableScrolling","onCancel","style","testId","testIdForOverlay","theme","containerRef","useRef","overlayRef","portal","setPortal","useState","useEffect","p","document","createElement","body","appendChild","removeChild","window","addEventListener","removeEventListener","classList","add","scrollingDisabledByModal","remove","focusLast","useMemo","jsx","onFocus","elems","current","querySelectorAll","i","length","focus","activeElement","tabIndex","ReactDom","createPortal","jsxs","Fragment","className","overlay","process","env","NODE_ENV","undefined","onClick","e","stopPropagation","onKeyDown","key","ref","node","role","container","onWheel","event","exports","_default","default","themed"],"sources":["../../../../../src/shared/components/Modal/index.tsx"],"sourcesContent":["/* global document */\n\nimport {\n type ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport ReactDom from 'react-dom';\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\nimport S from './styles.scss';\n\ntype PropsT = {\n cancelOnScrolling?: boolean;\n children?: ReactNode;\n dontDisableScrolling?: boolean;\n onCancel?: () => void;\n style?: React.CSSProperties;\n testId?: string;\n testIdForOverlay?: string;\n theme: Theme<'container' | 'overlay'>;\n\n /** @deprecated */\n containerStyle?: React.CSSProperties;\n};\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal: React.FunctionComponent<PropsT> = ({\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n style,\n testId,\n testIdForOverlay,\n theme,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const overlayRef = useRef<HTMLDivElement | null>(null);\n const [portal, setPortal] = useState<HTMLDivElement>();\n\n useEffect(() => {\n const p = document.createElement('div');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.removeChild(p);\n };\n }, []);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n useEffect(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n useEffect(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(S.scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(S.scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current?.querySelectorAll('*') as NodeListOf<HTMLElement>;\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i]?.focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current?.focus();\n }}\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n tabIndex={0}\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n />\n ), []);\n\n return portal ? ReactDom.createPortal(\n (\n <>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n data-testid={\n process.env.NODE_ENV === 'production'\n ? undefined : testIdForOverlay\n }\n onClick={(e) => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n ref={(node) => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n }}\n role=\"button\"\n tabIndex={0}\n />\n {\n // NOTE: These rules are disabled because our intention is to keep\n // the element non-interactive (thus not on the keyboard focus chain),\n // and it has `onClick` handler merely to stop propagation of click\n // events to its parent container. This is needed because, for example\n // when the modal is wrapped into an interactive element we don't want\n // any clicks inside the modal to bubble-up to that parent element\n // (because visually and logically the modal dialog does not belong\n // to its parent container, where it technically belongs from\n // the HTML mark-up perpective).\n /* eslint-disable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */\n }\n <div\n aria-modal=\"true\"\n className={theme.container}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={(e) => e.stopPropagation()}\n onWheel={(event) => event.stopPropagation()}\n ref={containerRef}\n role=\"dialog\"\n style={style ?? containerStyle}\n >\n {children}\n </div>\n {/* eslint-enable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */}\n <div\n onFocus={() => {\n overlayRef.current?.focus();\n }}\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n tabIndex={0}\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n />\n {focusLast}\n </>\n ),\n portal,\n ) : null;\n};\n\nexport default themed(BaseModal, 'Modal', baseTheme);\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n"],"mappings":";;;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAQA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IA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AAU,CAACuB,OAAO,EAAEI,KAAK,CAAC,CAAC;MAC7B;MACA;MACAE,QAAQ,EAAE;MACV;IAAA,CACD,CAAC,EACDX,SAAS;EAAA,CACV,CAAC,EAELjB,MACF,CAAC,GAAG,IAAI;AACV,CAAC;AAACkD,OAAA,CAAA/D,SAAA,GAAAA,SAAA;AAAA,IAAAgE,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEa,IAAAC,oBAAM,EAAClE,SAAS,EAAE,OAAO,EAAEF,SAAS,CAAC;AAEpD","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","require","_reactDom","_interopRequireDefault","_reactThemes","_jsxRuntime","baseTheme","S","BaseModal","cancelOnScrolling","children","containerStyle","dontDisableScrolling","onCancel","overlayStyle","style","testId","testIdForOverlay","theme","containerRef","useRef","overlayRef","portal","setPortal","useState","useEffect","p","document","createElement","body","appendChild","removeChild","window","addEventListener","removeEventListener","classList","add","scrollingDisabledByModal","remove","focusLast","useMemo","jsx","onFocus","elems","current","querySelectorAll","i","length","focus","activeElement","tabIndex","ReactDom","createPortal","jsxs","Fragment","className","overlay","process","env","NODE_ENV","undefined","onClick","e","stopPropagation","onKeyDown","key","ref","node","role","container","onWheel","event","exports","_default","default","themed"],"sources":["../../../../../src/shared/components/Modal/index.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type FunctionComponent,\n type ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport ReactDom from 'react-dom';\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\nimport S from './styles.scss';\n\ntype PropsT = {\n cancelOnScrolling?: boolean;\n children?: ReactNode;\n dontDisableScrolling?: boolean;\n onCancel?: () => void;\n overlayStyle?: CSSProperties;\n style?: CSSProperties;\n testId?: string;\n testIdForOverlay?: string;\n theme: Theme<'container' | 'overlay'>;\n\n /** @deprecated */\n containerStyle?: CSSProperties;\n};\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal: FunctionComponent<PropsT> = ({\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n overlayStyle,\n style,\n testId,\n testIdForOverlay,\n theme,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const overlayRef = useRef<HTMLDivElement | null>(null);\n const [portal, setPortal] = useState<HTMLDivElement>();\n\n useEffect(() => {\n const p = document.createElement('div');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.removeChild(p);\n };\n }, []);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n useEffect(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n useEffect(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(S.scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(S.scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current?.querySelectorAll('*') as NodeListOf<HTMLElement>;\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i]?.focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current?.focus();\n }}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n />\n ), []);\n\n return portal ? ReactDom.createPortal(\n (\n <>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n data-testid={\n process.env.NODE_ENV === 'production'\n ? undefined : testIdForOverlay\n }\n onClick={(e) => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n ref={(node) => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n }}\n role=\"button\"\n style={overlayStyle}\n tabIndex={0}\n />\n {\n // NOTE: These rules are disabled because our intention is to keep\n // the element non-interactive (thus not on the keyboard focus chain),\n // and it has `onClick` handler merely to stop propagation of click\n // events to its parent container. This is needed because, for example\n // when the modal is wrapped into an interactive element we don't want\n // any clicks inside the modal to bubble-up to that parent element\n // (because visually and logically the modal dialog does not belong\n // to its parent container, where it technically belongs from\n // the HTML mark-up perpective).\n /* eslint-disable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */\n }\n <div\n aria-modal=\"true\"\n className={theme.container}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={(e) => e.stopPropagation()}\n onWheel={(event) => event.stopPropagation()}\n ref={containerRef}\n role=\"dialog\"\n style={style ?? containerStyle}\n >\n {children}\n </div>\n {/* eslint-enable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */}\n <div\n onFocus={() => {\n overlayRef.current?.focus();\n }}\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n tabIndex={0}\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n />\n {focusLast}\n </>\n ),\n portal,\n ) : null;\n};\n\nexport default themed(BaseModal, 'Modal', baseTheme);\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAUA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF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C,GAAA;MACEC,OAAO,EAAEA,CAAA,KAAM;QACbrB,UAAU,CAACuB,OAAO,EAAEI,KAAK,CAAC,CAAC;MAC7B;MACA;MACAE,QAAQ,EAAE;MACV;IAAA,CACD,CAAC,EACDX,SAAS;EAAA,CACV,CAAC,EAELjB,MACF,CAAC,GAAG,IAAI;AACV,CAAC;AAACkD,OAAA,CAAAhE,SAAA,GAAAA,SAAA;AAAA,IAAAiE,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEa,IAAAC,oBAAM,EAACnE,SAAS,EAAE,OAAO,EAAEF,SAAS,CAAC;AAEpD","ignoreList":[]}
|
|
@@ -116,7 +116,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
116
116
|
\***********************************************/
|
|
117
117
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
118
118
|
|
|
119
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* binding */ BaseModal; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _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 _base_theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/Modal/base-theme.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles.scss */ \"./src/shared/components/Modal/styles.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n
|
|
119
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* binding */ BaseModal; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _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 _base_theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/Modal/base-theme.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles.scss */ \"./src/shared/components/Modal/styles.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal = _ref => {\n let {\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n overlayStyle,\n style,\n testId,\n testIdForOverlay,\n theme\n } = _ref;\n const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const overlayRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [portal, setPortal] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const p = document.createElement('div');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.removeChild(p);\n };\n }, []);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(_styles_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"].scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(_styles_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"].scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n const focusLast = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n onFocus: () => {\n var _containerRef$current, _overlayRef$current;\n const elems = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n var _elems$i;\n (_elems$i = elems[i]) === null || _elems$i === void 0 || _elems$i.focus();\n if (document.activeElement === elems[i]) return;\n }\n (_overlayRef$current = overlayRef.current) === null || _overlayRef$current === void 0 || _overlayRef$current.focus();\n }\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n ,\n tabIndex: 0\n }), []);\n return portal ? /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_1___default().createPortal(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {\n children: [focusLast, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n \"aria-label\": \"Cancel\",\n className: theme.overlay,\n \"data-testid\": false ? 0 : testIdForOverlay,\n onClick: e => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n },\n onKeyDown: e => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n },\n ref: node => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n },\n role: \"button\",\n style: overlayStyle,\n tabIndex: 0\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n \"aria-modal\": \"true\",\n className: theme.container,\n \"data-testid\": false ? 0 : testId,\n onClick: e => e.stopPropagation(),\n onWheel: event => event.stopPropagation(),\n ref: containerRef,\n role: \"dialog\",\n style: style !== null && style !== void 0 ? style : containerStyle,\n children: children\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n onFocus: () => {\n var _overlayRef$current2;\n (_overlayRef$current2 = overlayRef.current) === null || _overlayRef$current2 === void 0 || _overlayRef$current2.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: 0\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), focusLast]\n }), portal) : null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default()(BaseModal, 'Modal', _base_theme_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n/* Non-themed version of the Modal. */\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/index.tsx?");
|
|
120
120
|
|
|
121
121
|
/***/ }),
|
|
122
122
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.BaseModal=void 0;var _react=require("react");var _reactDom=_interopRequireDefault(require("react-dom"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _jsxRuntime=require("react/jsx-runtime")
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.BaseModal=void 0;var _react=require("react");var _reactDom=_interopRequireDefault(require("react-dom"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _jsxRuntime=require("react/jsx-runtime");const baseTheme={"context":"Szmbbz","ad":"Ah-Nsc","hoc":"Wki41G","overlay":"ye2BZo","container":"gyZ4rc"};const S={"scrollingDisabledByModal":"_5fRFtF"};/**
|
|
2
2
|
* The `<Modal>` component implements a simple themeable modal window, wrapped
|
|
3
3
|
* into the default theme. `<BaseModal>` exposes the base non-themed component.
|
|
4
4
|
* **Children:** Component children are rendered as the modal content.
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* clicks outside the modal, or presses Escape. It is expected to hide the
|
|
9
9
|
* modal.
|
|
10
10
|
* @param {ModalTheme} [props.theme] _Ad hoc_ theme.
|
|
11
|
-
*/const BaseModal=({cancelOnScrolling,children,containerStyle,dontDisableScrolling,onCancel,style,testId,testIdForOverlay,theme})=>{const containerRef=(0,_react.useRef)(null);const overlayRef=(0,_react.useRef)(null);const[portal,setPortal]=(0,_react.useState)();(0,_react.useEffect)(()=>{const p=document.createElement("div");document.body.appendChild(p);setPortal(p);return()=>{document.body.removeChild(p)}},[]);// Sets up modal cancellation of scrolling, if opted-in.
|
|
11
|
+
*/const BaseModal=({cancelOnScrolling,children,containerStyle,dontDisableScrolling,onCancel,overlayStyle,style,testId,testIdForOverlay,theme})=>{const containerRef=(0,_react.useRef)(null);const overlayRef=(0,_react.useRef)(null);const[portal,setPortal]=(0,_react.useState)();(0,_react.useEffect)(()=>{const p=document.createElement("div");document.body.appendChild(p);setPortal(p);return()=>{document.body.removeChild(p)}},[]);// Sets up modal cancellation of scrolling, if opted-in.
|
|
12
12
|
(0,_react.useEffect)(()=>{if(cancelOnScrolling&&onCancel){window.addEventListener("scroll",onCancel);window.addEventListener("wheel",onCancel)}return()=>{if(cancelOnScrolling&&onCancel){window.removeEventListener("scroll",onCancel);window.removeEventListener("wheel",onCancel)}}},[cancelOnScrolling,onCancel]);// Disables window scrolling, if it is not opted-out.
|
|
13
|
-
(0,_react.useEffect)(()=>{if(!dontDisableScrolling){document.body.classList.add(S.scrollingDisabledByModal)}return()=>{if(!dontDisableScrolling){document.body.classList.remove(S.scrollingDisabledByModal)}}},[dontDisableScrolling]);const focusLast=(0,_react.useMemo)(()=>/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{onFocus:()=>{const elems=containerRef.current?.querySelectorAll("*");for(let i=elems.length-1;i>=0;--i){elems[i]?.focus();if(document.activeElement===elems[i])return}overlayRef.current?.focus()}
|
|
13
|
+
(0,_react.useEffect)(()=>{if(!dontDisableScrolling){document.body.classList.add(S.scrollingDisabledByModal)}return()=>{if(!dontDisableScrolling){document.body.classList.remove(S.scrollingDisabledByModal)}}},[dontDisableScrolling]);const focusLast=(0,_react.useMemo)(()=>/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{onFocus:()=>{const elems=containerRef.current?.querySelectorAll("*");for(let i=elems.length-1;i>=0;--i){elems[i]?.focus();if(document.activeElement===elems[i])return}overlayRef.current?.focus()}// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
14
|
+
,tabIndex:0}),[]);return portal?/*#__PURE__*/_reactDom.default.createPortal(/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[focusLast,/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{"aria-label":"Cancel",className:theme.overlay,"data-testid":process.env.NODE_ENV==="production"?undefined:testIdForOverlay,onClick:e=>{if(onCancel){onCancel();e.stopPropagation()}},onKeyDown:e=>{if(e.key==="Escape"&&onCancel){onCancel();e.stopPropagation()}},ref:node=>{if(node&&node!==overlayRef.current){overlayRef.current=node;node.focus()}},role:"button",style:overlayStyle,tabIndex:0}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{"aria-modal":"true",className:theme.container,"data-testid":process.env.NODE_ENV==="production"?undefined:testId,onClick:e=>e.stopPropagation(),onWheel:event=>event.stopPropagation(),ref:containerRef,role:"dialog",style:style??containerStyle,children:children}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{onFocus:()=>{overlayRef.current?.focus()}/* eslint-disable jsx-a11y/no-noninteractive-tabindex */,tabIndex:0/* eslint-enable jsx-a11y/no-noninteractive-tabindex */}),focusLast]}),portal):null};exports.BaseModal=BaseModal;var _default=exports.default=(0,_reactThemes.default)(BaseModal,"Modal",baseTheme);/* Non-themed version of the Modal. */
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","require","_reactDom","_interopRequireDefault","_reactThemes","_jsxRuntime","baseTheme","S","BaseModal","cancelOnScrolling","children","containerStyle","dontDisableScrolling","onCancel","style","testId","testIdForOverlay","theme","containerRef","useRef","overlayRef","portal","setPortal","useState","useEffect","p","document","createElement","body","appendChild","removeChild","window","addEventListener","removeEventListener","classList","add","scrollingDisabledByModal","remove","focusLast","useMemo","jsx","onFocus","elems","current","querySelectorAll","i","length","focus","activeElement","tabIndex","ReactDom","createPortal","jsxs","Fragment","className","overlay","process","env","NODE_ENV","undefined","onClick","e","stopPropagation","onKeyDown","key","ref","node","role","container","onWheel","event","exports","_default","default","themed"],"sources":["../../../../../src/shared/components/Modal/index.tsx"],"sourcesContent":["/* global document */\n\nimport {\n type ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport ReactDom from 'react-dom';\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\nimport S from './styles.scss';\n\ntype PropsT = {\n cancelOnScrolling?: boolean;\n children?: ReactNode;\n dontDisableScrolling?: boolean;\n onCancel?: () => void;\n style?: React.CSSProperties;\n testId?: string;\n testIdForOverlay?: string;\n theme: Theme<'container' | 'overlay'>;\n\n /** @deprecated */\n containerStyle?: React.CSSProperties;\n};\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal: React.FunctionComponent<PropsT> = ({\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n style,\n testId,\n testIdForOverlay,\n theme,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const overlayRef = useRef<HTMLDivElement | null>(null);\n const [portal, setPortal] = useState<HTMLDivElement>();\n\n useEffect(() => {\n const p = document.createElement('div');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.removeChild(p);\n };\n }, []);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n useEffect(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n useEffect(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(S.scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(S.scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current?.querySelectorAll('*') as NodeListOf<HTMLElement>;\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i]?.focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current?.focus();\n }}\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n tabIndex={0}\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n />\n ), []);\n\n return portal ? ReactDom.createPortal(\n (\n <>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n data-testid={\n process.env.NODE_ENV === 'production'\n ? undefined : testIdForOverlay\n }\n onClick={(e) => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n ref={(node) => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n }}\n role=\"button\"\n tabIndex={0}\n />\n {\n // NOTE: These rules are disabled because our intention is to keep\n // the element non-interactive (thus not on the keyboard focus chain),\n // and it has `onClick` handler merely to stop propagation of click\n // events to its parent container. This is needed because, for example\n // when the modal is wrapped into an interactive element we don't want\n // any clicks inside the modal to bubble-up to that parent element\n // (because visually and logically the modal dialog does not belong\n // to its parent container, where it technically belongs from\n // the HTML mark-up perpective).\n /* eslint-disable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */\n }\n <div\n aria-modal=\"true\"\n className={theme.container}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={(e) => e.stopPropagation()}\n onWheel={(event) => event.stopPropagation()}\n ref={containerRef}\n role=\"dialog\"\n style={style ?? containerStyle}\n >\n {children}\n </div>\n {/* eslint-enable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */}\n <div\n onFocus={() => {\n overlayRef.current?.focus();\n }}\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n tabIndex={0}\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n />\n {focusLast}\n </>\n ),\n portal,\n ) : null;\n};\n\nexport default themed(BaseModal, 'Modal', baseTheme);\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n"],"mappings":"kMAEA,IAAAA,MAAA,CAAAC,OAAA,UAQA,IAAAC,SAAA,CAAAC,sBAAA,CAAAF,OAAA,eACA,IAAAG,YAAA,CAAAD,sBAAA,CAAAF,OAAA,8BAA8D,IAAAI,WAAA,CAAAJ,OAAA,sBAX9D,2BAAAK,SAAA,iGAAAC,CAAA,wCA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAC,SAA0C,CAAGA,CAAC,CAClDC,iBAAiB,CAC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|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","require","_reactDom","_interopRequireDefault","_reactThemes","_jsxRuntime","baseTheme","S","BaseModal","cancelOnScrolling","children","containerStyle","dontDisableScrolling","onCancel","overlayStyle","style","testId","testIdForOverlay","theme","containerRef","useRef","overlayRef","portal","setPortal","useState","useEffect","p","document","createElement","body","appendChild","removeChild","window","addEventListener","removeEventListener","classList","add","scrollingDisabledByModal","remove","focusLast","useMemo","jsx","onFocus","elems","current","querySelectorAll","i","length","focus","activeElement","tabIndex","ReactDom","createPortal","jsxs","Fragment","className","overlay","process","env","NODE_ENV","undefined","onClick","e","stopPropagation","onKeyDown","key","ref","node","role","container","onWheel","event","exports","_default","default","themed"],"sources":["../../../../../src/shared/components/Modal/index.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type FunctionComponent,\n type ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport ReactDom from 'react-dom';\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\nimport S from './styles.scss';\n\ntype PropsT = {\n cancelOnScrolling?: boolean;\n children?: ReactNode;\n dontDisableScrolling?: boolean;\n onCancel?: () => void;\n overlayStyle?: CSSProperties;\n style?: CSSProperties;\n testId?: string;\n testIdForOverlay?: string;\n theme: Theme<'container' | 'overlay'>;\n\n /** @deprecated */\n containerStyle?: CSSProperties;\n};\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal: FunctionComponent<PropsT> = ({\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n overlayStyle,\n style,\n testId,\n testIdForOverlay,\n theme,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const overlayRef = useRef<HTMLDivElement | null>(null);\n const [portal, setPortal] = useState<HTMLDivElement>();\n\n useEffect(() => {\n const p = document.createElement('div');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.removeChild(p);\n };\n }, []);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n useEffect(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n useEffect(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(S.scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(S.scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current?.querySelectorAll('*') as NodeListOf<HTMLElement>;\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i]?.focus();\n if (document.activeElement === elems[i]) return;\n }\n overlayRef.current?.focus();\n }}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n />\n ), []);\n\n return portal ? ReactDom.createPortal(\n (\n <>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n data-testid={\n process.env.NODE_ENV === 'production'\n ? undefined : testIdForOverlay\n }\n onClick={(e) => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n }}\n ref={(node) => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n }}\n role=\"button\"\n style={overlayStyle}\n tabIndex={0}\n />\n {\n // NOTE: These rules are disabled because our intention is to keep\n // the element non-interactive (thus not on the keyboard focus chain),\n // and it has `onClick` handler merely to stop propagation of click\n // events to its parent container. This is needed because, for example\n // when the modal is wrapped into an interactive element we don't want\n // any clicks inside the modal to bubble-up to that parent element\n // (because visually and logically the modal dialog does not belong\n // to its parent container, where it technically belongs from\n // the HTML mark-up perpective).\n /* eslint-disable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */\n }\n <div\n aria-modal=\"true\"\n className={theme.container}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n onClick={(e) => e.stopPropagation()}\n onWheel={(event) => event.stopPropagation()}\n ref={containerRef}\n role=\"dialog\"\n style={style ?? containerStyle}\n >\n {children}\n </div>\n {/* eslint-enable jsx-a11y/click-events-have-key-events,\n jsx-a11y/no-noninteractive-element-interactions */}\n <div\n onFocus={() => {\n overlayRef.current?.focus();\n }}\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */\n tabIndex={0}\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n />\n {focusLast}\n </>\n ),\n portal,\n ) : null;\n};\n\nexport default themed(BaseModal, 'Modal', baseTheme);\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n"],"mappings":"kMAAA,IAAAA,MAAA,CAAAC,OAAA,UAUA,IAAAC,SAAA,CAAAC,sBAAA,CAAAF,OAAA,eACA,IAAAG,YAAA,CAAAD,sBAAA,CAAAF,OAAA,8BAA8D,IAAAI,WAAA,CAAAJ,OAAA,4BAAAK,SAAA,iGAAAC,CAAA,wCAoB9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAC,SAAoC,CAAGA,CAAC,CAC5CC,iBAAiB,CACjBC,QAAQ,CACRC,cAAc,CACdC,oBAAoB,CACpBC,QAAQ,CACRC,YAAY,CACZC,KAAK,CACLC,MAAM,CACNC,gBAAgB,CAChBC,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
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet-async"),require("react-router")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-themes","cookie","dayjs","node-forge/lib/aes","node-forge/lib/forge","qs","react","react-dom","react-dom/client","react-helmet-async","react-router"],t):"object"==typeof exports?exports["@dr.pogodin/react-utils"]=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet-async"),require("react-router")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-themes"],e.cookie,e.dayjs,e["node-forge/lib/aes"],e["node-forge/lib/forge"],e.qs,e.react,e["react-dom"],e["react-dom/client"],e["react-helmet-async"],e["react-router"])}("undefined"!=typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__859__,__WEBPACK_EXTERNAL_MODULE__462__,__WEBPACK_EXTERNAL_MODULE__185__,__WEBPACK_EXTERNAL_MODULE__958__,__WEBPACK_EXTERNAL_MODULE__814__,__WEBPACK_EXTERNAL_MODULE__360__,__WEBPACK_EXTERNAL_MODULE__155__,__WEBPACK_EXTERNAL_MODULE__514__,__WEBPACK_EXTERNAL_MODULE__236__,__WEBPACK_EXTERNAL_MODULE__474__,__WEBPACK_EXTERNAL_MODULE__707__){return function(){"use strict";var __webpack_modules__={668:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:function(){return getInj}});var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(814),node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(958),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__),_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(540);let inj={};const metaElement="undefined"!=typeof document?document.querySelector('meta[itemprop="drpruinj"]'):null;if(metaElement){metaElement.remove();let data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decode64(metaElement.content);const{key:key}=(0,_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__.F)(),d=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().cipher.createDecipher("AES-CBC",key);d.start({iv:data.slice(0,key.length)}),d.update(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.createBuffer(data.slice(key.length))),d.finish(),data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decodeUtf8(d.output.data),inj=eval(`(${data})`)}else"undefined"!=typeof window&&window.REACT_UTILS_INJECTION?(inj=window.REACT_UTILS_INJECTION,delete window.REACT_UTILS_INJECTION):inj={};function getInj(){return inj}},969:function(e,t,n){n.d(t,{A:function(){return l}}),n(155);var r=n(236),o=n(474),a=n(707),i=n(126),_=n(668),s=n(922);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=document.getElementById("react-view");if(!n)throw Error("Failed to find container for React app");const l=(0,s.jsx)(i.GlobalStateProvider,{initialState:(0,_.A)().ISTATE||t.initialState,children:(0,s.jsx)(a.BrowserRouter,{children:(0,s.jsx)(o.HelmetProvider,{children:(0,s.jsx)(e,{})})})});t.dontHydrate?(0,r.createRoot)(n).render(l):(0,r.hydrateRoot)(n,l)}},540:function(e,t,n){let r;function o(){if(void 0===r)throw Error('"Build Info" has not been initialized yet');return r}n.d(t,{F:function(){return o}}),"undefined"!=typeof BUILD_INFO&&(r=BUILD_INFO)},48:function(e,t,n){n.d(t,{B:function(){return r},p:function(){return o}});const r="object"!=typeof process||!process.versions||!process.versions.node||!!n.g.REACT_UTILS_FORCE_CLIENT_SIDE,o=!r},724:function(e,t,n){n.r(t),n.d(t,{IS_CLIENT_SIDE:function(){return o.B},IS_SERVER_SIDE:function(){return o.p},buildTimestamp:function(){return _},getBuildInfo:function(){return r.F},isDevBuild:function(){return a},isProdBuild:function(){return i}});var r=n(540),o=n(48);function a(){return!1}function i(){return!0}function _(){return(0,r.F)().timestamp}},148:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{requireWeak:function(){return requireWeak},resolveWeak:function(){return resolveWeak}});var _isomorphy__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(724);function requireWeak(modulePath,basePath){if(_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE)return null;try{const{resolve:resolve}=eval("require")("path"),path=basePath?resolve(basePath,modulePath):modulePath,module=eval("require")(path);if(!("default"in module))return module;const{default:def,...named}=module,res=def;return Object.entries(named).forEach((e=>{let[t,n]=e;const r=res[t];if(void 0!==r){if(r!==n)throw Error("Conflict between default and named exports")}else res[t]=n})),res}catch{return null}}function resolveWeak(e){return e}},208:function(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},922:function(e,t,n){e.exports=n(208)},864:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__864__},126:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__126__},859:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__859__},462:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__462__},185:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__185__},958:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__958__},814:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__814__},360:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__360__},155:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__155__},514:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__514__},236:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__236__},474:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__474__},707:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__707__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Barrier:function(){return js_utils_.Barrier},BaseButton:function(){return BaseButton},BaseModal:function(){return BaseModal},Button:function(){return Button},Checkbox:function(){return components_Checkbox},CustomDropdown:function(){return CustomDropdown},Dropdown:function(){return NativeDropdown},Emitter:function(){return js_utils_.Emitter},GlobalStateProvider:function(){return react_global_state_.GlobalStateProvider},Input:function(){return components_Input},Link:function(){return components_Link},MetaTags:function(){return components_MetaTags},Modal:function(){return Modal},NavLink:function(){return components_NavLink},PageLayout:function(){return components_PageLayout},Semaphore:function(){return js_utils_.Semaphore},Switch:function(){return Switch},TextArea:function(){return components_TextArea},ThemeProvider:function(){return react_themes_.ThemeProvider},Throbber:function(){return components_Throbber},WithTooltip:function(){return WithTooltip},YouTubeVideo:function(){return components_YouTubeVideo},client:function(){return client},config:function(){return utils_config},getGlobalState:function(){return react_global_state_.getGlobalState},getSsrContext:function(){return getSsrContext},isomorphy:function(){return isomorphy},newAsyncDataEnvelope:function(){return react_global_state_.newAsyncDataEnvelope},server:function(){return server},splitComponent:function(){return splitComponent},themed:function(){return themed},time:function(){return utils_time},useAsyncCollection:function(){return react_global_state_.useAsyncCollection},useAsyncData:function(){return react_global_state_.useAsyncData},useGlobalState:function(){return react_global_state_.useGlobalState},webpack:function(){return webpack},withGlobalStateType:function(){return react_global_state_.withGlobalStateType},withRetries:function(){return js_utils_.withRetries}});var global={},react_themes_=__webpack_require__(859),react_themes_default=__webpack_require__.n(react_themes_),environment_check=__webpack_require__(48),webpack=__webpack_require__(148);const config=(environment_check.B?__webpack_require__(668).A().CONFIG:(0,webpack.requireWeak)("config"))||{};if(environment_check.B&&"undefined"!=typeof document){const e=__webpack_require__(462);config.CSRF=e.parse(document.cookie).csrfToken}var utils_config=config,isomorphy=__webpack_require__(724),external_cookie_=__webpack_require__(462),external_dayjs_=__webpack_require__(185),external_dayjs_default=__webpack_require__.n(external_dayjs_),external_react_=__webpack_require__(155),js_utils_=__webpack_require__(864),react_global_state_=__webpack_require__(126);const{getSsrContext:getSsrContext}=(0,react_global_state_.withGlobalStateType)();function useCurrent(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:n=5*js_utils_.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[r,o]=(0,react_global_state_.useGlobalState)(t,Date.now);return(0,external_react_.useEffect)((()=>{let t;const r=()=>{o((e=>{const t=Date.now();return Math.abs(t-e)>n?t:e})),e&&(t=setTimeout(r,n))};return r(),()=>{t&&clearTimeout(t)}}),[e,n,o]),r}function useTimezoneOffset(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=getSsrContext(!1),[r,o]=(0,react_global_state_.useGlobalState)(t,(()=>{var t;const r=e&&(null==n||null===(t=n.req)||void 0===t||null===(t=t.cookies)||void 0===t?void 0:t[e]);return r?parseInt(r,10):0}));return(0,external_react_.useEffect)((()=>{const t=(new Date).getTimezoneOffset();o(t),e&&(document.cookie=(0,external_cookie_.serialize)(e,t.toString(),{path:"/"}))}),[e,o]),r}const time={DAY_MS:js_utils_.DAY_MS,HOUR_MS:js_utils_.HOUR_MS,MIN_MS:js_utils_.MIN_MS,SEC_MS:js_utils_.SEC_MS,YEAR_MS:js_utils_.YEAR_MS,now:Date.now,timer:js_utils_.timer,useCurrent:useCurrent,useTimezoneOffset:useTimezoneOffset};var utils_time=Object.assign(external_dayjs_default(),time),jsx_runtime=__webpack_require__(922);let clientChunkGroups;isomorphy.IS_CLIENT_SIDE&&(clientChunkGroups=__webpack_require__(668).A().CHUNK_GROUPS||{});const refCounts={};function getPublicPath(){return(0,isomorphy.getBuildInfo)().publicPath}function bookStyleSheet(e,t,n){let r;const o=`${getPublicPath()}/${e}`,a=`${document.location.origin}${o}`;if(!t.has(a)){let e=document.querySelector(`link[href="${o}"]`);e||(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("href",o),document.head.appendChild(e)),r=new js_utils_.Barrier,e.addEventListener("load",(()=>r.resolve())),e.addEventListener("error",(()=>r.resolve()))}if(n){const e=refCounts[o]||0;refCounts[o]=1+e}return r}function getLoadedStyleSheets(){const e=new Set,{styleSheets:t}=document;for(let r=0;r<t.length;++r){var n;const o=null===(n=t[r])||void 0===n?void 0:n.href;o&&e.add(o)}return e}function assertChunkName(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}function bookStyleSheets(e,t,n){const r=[],o=t[e];if(!o)return Promise.resolve();const a=getLoadedStyleSheets();for(let e=0;e<o.length;++e){const t=o[e];if(null!=t&&t.endsWith(".css")){const e=bookStyleSheet(t,a,n);e&&r.push(e)}}return r.length?Promise.allSettled(r).then():Promise.resolve()}function freeStyleSheets(e,t){const n=t[e];if(n)for(let e=0;e<n.length;++e){const t=n[e];if(null!=t&&t.endsWith(".css")){const e=`${getPublicPath()}/${t}`,n=refCounts[e];n&&(n<=1?(document.head.querySelector(`link[href="${e}"]`).remove(),delete refCounts[e]):refCounts[e]=n-1)}}}const usedChunkNames=new Set;function splitComponent(e){let{chunkName:t,getComponent:n,placeholder:r}=e;if(isomorphy.IS_CLIENT_SIDE&&assertChunkName(t,clientChunkGroups),usedChunkNames.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);usedChunkNames.add(t);const o=(0,external_react_.lazy)((async()=>{const e=await n(),r="default"in e?e.default:e;return isomorphy.IS_CLIENT_SIDE&&await bookStyleSheets(t,clientChunkGroups,!1),{default:e=>{let{children:n,ref:o,...a}=e;if(isomorphy.IS_SERVER_SIDE){const{chunkGroups:e,chunks:n}=getSsrContext();assertChunkName(t,e),n.includes(t)||n.push(t)}return(0,external_react_.useInsertionEffect)((()=>(bookStyleSheets(t,clientChunkGroups,!0),()=>freeStyleSheets(t,clientChunkGroups))),[]),(0,jsx_runtime.jsx)(r,{...a,ref:o,children:n})}}}));return e=>{let{children:t,...n}=e;return(0,jsx_runtime.jsx)(external_react_.Suspense,{fallback:r,children:(0,jsx_runtime.jsx)(o,{...n,children:t})})}}const themed=react_themes_default();themed.COMPOSE=react_themes_.COMPOSE,themed.PRIORITY=react_themes_.PRIORITY;var external_react_dom_=__webpack_require__(514),external_react_dom_default=__webpack_require__.n(external_react_dom_),base_theme={overlay:"ye2BZo",context:"Szmbbz",ad:"Ah-Nsc",hoc:"Wki41G",container:"gyZ4rc"},styles={scrollingDisabledByModal:"_5fRFtF"};const BaseModal=e=>{let{cancelOnScrolling:t,children:n,containerStyle:r,dontDisableScrolling:o,onCancel:a,style:i,testId:_,testIdForOverlay:s,theme:l}=e;const c=(0,external_react_.useRef)(null),u=(0,external_react_.useRef)(null),[d,m]=(0,external_react_.useState)();(0,external_react_.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),m(e),()=>{document.body.removeChild(e)}}),[]),(0,external_react_.useEffect)((()=>(t&&a&&(window.addEventListener("scroll",a),window.addEventListener("wheel",a)),()=>{t&&a&&(window.removeEventListener("scroll",a),window.removeEventListener("wheel",a))})),[t,a]),(0,external_react_.useEffect)((()=>(o||document.body.classList.add(styles.scrollingDisabledByModal),()=>{o||document.body.classList.remove(styles.scrollingDisabledByModal)})),[o]);const p=(0,external_react_.useMemo)((()=>(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e,t;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll("*");for(let e=n.length-1;e>=0;--e){var r;if(null===(r=n[e])||void 0===r||r.focus(),document.activeElement===n[e])return}null===(t=u.current)||void 0===t||t.focus()},tabIndex:0})),[]);return d?external_react_dom_default().createPortal((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[p,(0,jsx_runtime.jsx)("div",{"aria-label":"Cancel",className:l.overlay,"data-testid":void 0,onClick:e=>{a&&(a(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&a&&(a(),e.stopPropagation())},ref:e=>{e&&e!==u.current&&(u.current=e,e.focus())},role:"button",tabIndex:0}),(0,jsx_runtime.jsx)("div",{"aria-modal":"true",className:l.container,"data-testid":void 0,onClick:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),ref:c,role:"dialog",style:null!=i?i:r,children:n}),(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e;null===(e=u.current)||void 0===e||e.focus()},tabIndex:0}),p]}),d):null};var Modal=react_themes_default()(BaseModal,"Modal",base_theme),style={overlay:"jKsMKG"};function isValue(e){const t=typeof e;return"number"===t||"string"===t}function optionValueName(e){var t;return isValue(e)?[e,e]:[e.value,null!==(t=e.name)&&void 0!==t?t:e.value]}function areEqual(e,t){return(null==e?void 0:e.left)===(null==t?void 0:t.left)&&(null==e?void 0:e.top)===(null==t?void 0:t.top)&&(null==e?void 0:e.width)===(null==t?void 0:t.width)}const Options=e=>{let{containerClass:t,containerStyle:n,filter:r,onCancel:o,onChange:a,optionClass:i,options:_,ref:s}=e;const l=(0,external_react_.useRef)(null);(0,external_react_.useImperativeHandle)(s,(()=>({measure:()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.parentElement;if(!t)return;const n=l.current.getBoundingClientRect(),r=window.getComputedStyle(t),o=parseFloat(r.marginBottom),a=parseFloat(r.marginTop);return n.height+=o+a,n}})),[]);const c=[];for(let e=0;e<_.length;++e){const t=_[e];if(void 0!==t&&(!r||r(t))){const[e,n]=optionValueName(t);c.push((0,jsx_runtime.jsx)("div",{className:i,onClick:t=>{a(e),t.stopPropagation()},onKeyDown:t=>{"Enter"===t.key&&(a(e),t.stopPropagation())},role:"button",tabIndex:0,children:n},e))}}return(0,jsx_runtime.jsx)(BaseModal,{cancelOnScrolling:!0,style:n,dontDisableScrolling:!0,onCancel:o,theme:{ad:"",hoc:"",container:t,context:"",overlay:style.overlay},children:(0,jsx_runtime.jsx)("div",{ref:l,children:c})})};var CustomDropdown_Options=Options,theme={container:"oQKv0Y",context:"_9Tod5r",ad:"R58zIg",hoc:"O-Tp1i",label:"YUPUNs",dropdown:"pNEyAA",option:"LD2Kzy",select:"LP5azC",arrow:"-wscve",active:"k2UDsV",upward:"HWRvu4"};const BaseCustomDropdown=e=>{let{filter:t,label:n,onChange:r,options:o,theme:a,value:i}=e;if(!o)throw Error("Internal error");const[_,s]=(0,external_react_.useState)(!1),l=(0,external_react_.useRef)(null),c=(0,external_react_.useRef)(null),[u,d]=(0,external_react_.useState)(),[m,p]=(0,external_react_.useState)(!1);(0,external_react_.useEffect)((()=>{if(!_)return;let e;const t=()=>{var n,r;const o=null===(n=l.current)||void 0===n?void 0:n.getBoundingClientRect(),a=null===(r=c.current)||void 0===r?void 0:r.measure();if(o&&a){var i,_;const e=o.bottom+a.height<(null!==(i=null===(_=window.visualViewport)||void 0===_?void 0:_.height)&&void 0!==i?i:0),t=o.top-a.height>0,n=!e&&t;p(n);const r=n?{top:o.top-a.height-1,left:o.left,width:o.width}:{left:o.left,top:o.bottom,width:o.width};d((e=>areEqual(e,r)?e:r))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[_]);const h=e=>{const t=window.visualViewport,n=l.current.getBoundingClientRect();s(!0),d({left:(null==t?void 0:t.width)||0,top:(null==t?void 0:t.height)||0,width:n.width}),e.stopPropagation()};let f=(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:""});for(let e=0;e<o.length;++e){const n=o[e];if(void 0!==n&&(!t||t(n))){const[e,t]=optionValueName(n);if(e===i){f=t;break}}}let x=a.container;_&&(x+=` ${a.active}`);let b=a.select||"";return m&&(x+=` ${a.upward}`,b+=` ${a.upward}`),(0,jsx_runtime.jsxs)("div",{className:x,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:a.label,children:n}),(0,jsx_runtime.jsxs)("div",{className:a.dropdown,onClick:h,onKeyDown:e=>{"Enter"===e.key&&h(e)},ref:l,role:"listbox",tabIndex:0,children:[f,(0,jsx_runtime.jsx)("div",{className:a.arrow})]}),_?(0,jsx_runtime.jsx)(CustomDropdown_Options,{containerClass:b,containerStyle:u,onCancel:()=>{s(!1)},onChange:e=>{s(!1),r&&r(e)},optionClass:a.option||"",options:o,ref:c}):null]})};var CustomDropdown=react_themes_default()(BaseCustomDropdown,"CustomDropdown",theme),NativeDropdown_theme={dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",option:"_27pZ6W",hiddenOption:"clAKFJ",select:"N0Fc14",invalid:"wL4umU"};const Dropdown=e=>{let{filter:t,label:n,onChange:r,options:o,testId:a,theme:i,value:_}=e;if(!o)throw Error("Internal error");let s=!1;const l=[];for(let e=0;e<o.length;++e){const n=o[e];if(void 0!==n&&(!t||t(n))){const[e,t]=optionValueName(n);s||(s=e===_),l.push((0,jsx_runtime.jsx)("option",{className:i.option,value:e,children:t},e))}}const c=s?null:(0,jsx_runtime.jsx)("option",{disabled:!0,className:i.hiddenOption,value:_,children:_},"__reactUtilsHiddenOption");let u=i.select;return s||(u+=` ${i.invalid}`),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:n}),(0,jsx_runtime.jsxs)("div",{className:i.dropdown,children:[(0,jsx_runtime.jsxs)("select",{className:u,"data-testid":void 0,onChange:r,value:_,children:[c,l]}),(0,jsx_runtime.jsx)("div",{className:i.arrow})]})]})};var NativeDropdown=react_themes_default()(Dropdown,"Dropdown",NativeDropdown_theme),Switch_theme={container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"};const BaseSwitch=e=>{let{label:t,onChange:n,options:r,theme:o,value:a}=e;if(!r||!o.option)throw Error("Internal error");const i=[];for(let e=0;e<(null==r?void 0:r.length);++e){const t=r[e];if(void 0!==t){const[e,r]=optionValueName(t);let _,s=o.option;e===a?s+=` ${o.selected}`:n&&(_=()=>n(e)),i.push(_?(0,jsx_runtime.jsx)("div",{className:s,onClick:_,onKeyDown:e=>{_&&"Enter"===e.key&&_()},role:"button",tabIndex:0,children:r},e):(0,jsx_runtime.jsx)("div",{className:s,children:r},e))}}return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[t?(0,jsx_runtime.jsx)("div",{className:o.label,children:t}):null,(0,jsx_runtime.jsx)("div",{className:o.options,children:i})]})};var Switch=react_themes_default()(BaseSwitch,"Switch",Switch_theme),external_react_router_=__webpack_require__(707),GenericLink_style={link:"zH52sA"};const GenericLink=e=>{let{children:t,className:n,disabled:r,enforceA:o,keepScrollPosition:a,onClick:i,onMouseDown:_,openNewTab:s,replace:l,routerLinkType:c,to:u,...d}=e;if(r||o||s||null!=u&&u.match(/^(#|(https?|mailto):)/))return(0,jsx_runtime.jsx)("a",{className:(n?n+" ":"")+"zH52sA",href:u,onClick:r?e=>e.preventDefault():i,onMouseDown:r?e=>e.preventDefault():_,rel:"noopener noreferrer",target:s?"_blank":"",children:t});const m=c;return(0,jsx_runtime.jsx)(m,{className:n,discover:"none",onMouseDown:_,replace:l,to:u,onClick:e=>{i&&i(e),a||window.scroll(0,0)},...d,children:t})};var components_GenericLink=GenericLink;const Link=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.Link});var components_Link=Link,Button_style={button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"};const BaseButton=e=>{let{active:t,children:n,disabled:r,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:s,replace:l,testId:c,theme:u,to:d}=e,m=u.button;return t&&u.active&&(m+=` ${u.active}`),r?(u.disabled&&(m+=` ${u.disabled}`),(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,children:n})):d?(0,jsx_runtime.jsx)(components_Link,{className:m,"data-testid":void 0,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:s,replace:l,to:d,children:n}):(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,onClick:a,onKeyDown:a&&(e=>{"Enter"===e.key&&a(e)}),onMouseDown:i,onPointerDown:_,role:"button",tabIndex:0,children:n})};var Button=react_themes_default()(BaseButton,"Button",Button_style),Checkbox_theme={checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",indeterminate:"N9bCb8",container:"Kr0g3M",label:"_3dML-O",disabled:"EzQra1"};const Checkbox=e=>{let{checked:t,disabled:n,label:r,onChange:o,testId:a,theme:i}=e,_=i.container;n&&(_+=` ${i.disabled}`);let s=i.checkbox;return"indeterminate"===t&&(s+=` ${i.indeterminate}`),(0,jsx_runtime.jsxs)("div",{className:_,children:[void 0===r?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:r}),(0,jsx_runtime.jsx)("input",{checked:void 0===t?void 0:!0===t,className:s,"data-testid":void 0,disabled:n,onChange:o,onClick:e=>e.stopPropagation(),type:"checkbox"})]})};var components_Checkbox=react_themes_default()(Checkbox,"Checkbox",Checkbox_theme),Input_theme={container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"};const Input=e=>{let{label:t,ref:n,testId:r,theme:o,...a}=e;return(0,jsx_runtime.jsxs)("span",{className:o.container,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:o.label,children:t}),(0,jsx_runtime.jsx)("input",{className:o.input,"data-testid":void 0,ref:n,...a})]})};var components_Input=react_themes_default()(Input,"Input",Input_theme),PageLayout_base_theme={container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"};const PageLayout=e=>{let{children:t,leftSidePanelContent:n,rightSidePanelContent:r,theme:o}=e;return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:n}),(0,jsx_runtime.jsx)("div",{className:o.mainPanel,children:t}),(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.rightSidePanel].join(" "),children:r})]})};var components_PageLayout=react_themes_default()(PageLayout,"PageLayout",PageLayout_base_theme),external_react_helmet_async_=__webpack_require__(474);const Context=(0,external_react_.createContext)({description:"",title:""}),MetaTags=e=>{let{children:t,description:n,extraMetaTags:r,image:o,siteName:a,socialDescription:i,socialTitle:_,title:s,url:l}=e;const c=_||s,u=i||n,d=(0,external_react_.useMemo)((()=>({description:n,image:o,siteName:a,socialDescription:i,socialTitle:_,title:s,url:l})),[n,o,a,i,_,s,l]),m=[];if(null!=r&&r.length)for(let e=0;e<r.length;++e){const{content:t,name:n}=r[e];m.push((0,jsx_runtime.jsx)("meta",{content:t,name:n},`extra-meta-tag-${e}`))}return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(external_react_helmet_async_.Helmet,{children:[(0,jsx_runtime.jsx)("title",{children:s}),(0,jsx_runtime.jsx)("meta",{name:"description",content:n}),(0,jsx_runtime.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,jsx_runtime.jsx)("meta",{name:"twitter:title",content:c}),(0,jsx_runtime.jsx)("meta",{name:"twitter:description",content:u}),o?(0,jsx_runtime.jsx)("meta",{name:"twitter:image",content:o}):null,a?(0,jsx_runtime.jsx)("meta",{name:"twitter:site",content:`@${a}`}):null,(0,jsx_runtime.jsx)("meta",{name:"og:title",content:c}),o?(0,jsx_runtime.jsx)("meta",{name:"og:image",content:o}):null,o?(0,jsx_runtime.jsx)("meta",{name:"og:image:alt",content:c}):null,(0,jsx_runtime.jsx)("meta",{name:"og:description",content:u}),a?(0,jsx_runtime.jsx)("meta",{name:"og:sitename",content:a}):null,l?(0,jsx_runtime.jsx)("meta",{name:"og:url",content:l}):null,m]}),t?(0,jsx_runtime.jsx)(Context.Provider,{value:d,children:t}):null]})};MetaTags.Context=Context;var components_MetaTags=MetaTags;const NavLink=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.NavLink});var components_NavLink=NavLink,Throbber_theme={container:"_7zdld4",context:"uIObt7",ad:"XIxe9o",hoc:"YOyORH",circle:"dBrB4g",bouncing:"TJe-6j"};const Throbber=e=>{let{theme:t}=e;return(0,jsx_runtime.jsxs)("span",{className:t.container,children:[(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle})]})};var components_Throbber=react_themes_default()(Throbber,"Throbber",Throbber_theme);let PLACEMENTS=function(e){return e.ABOVE_CURSOR="ABOVE_CURSOR",e.ABOVE_ELEMENT="ABOVE_ELEMENT",e.BELOW_CURSOR="BELOW_CURSOR",e.BELOW_ELEMENT="BELOW_ELEMENT",e}({});const ARROW_STYLE_DOWN=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),ARROW_STYLE_UP=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function createTooltipComponents(e){const t=document.createElement("div");e.arrow&&t.setAttribute("class",e.arrow);const n=document.createElement("div");e.content&&n.setAttribute("class",e.content);const r=document.createElement("div");return e.container&&r.setAttribute("class",e.container),r.appendChild(t),r.appendChild(n),document.body.appendChild(r),{container:r,arrow:t,content:n}}function calcTooltipRects(e){return{arrow:e.arrow.getBoundingClientRect(),container:e.container.getBoundingClientRect()}}function calcViewportRect(){const{scrollX:e,scrollY:t}=window,{documentElement:{clientHeight:n,clientWidth:r}}=document;return{left:e,right:e+r,top:t,bottom:t+n}}function calcPositionAboveXY(e,t,n){const{arrow:r,container:o}=n;return{arrowX:.5*(o.width-r.width),arrowY:o.height,containerX:e-o.width/2,containerY:t-o.height-r.height/1.5,baseArrowStyle:ARROW_STYLE_DOWN}}function setComponentPositions(e,t,n,r,o){const a=calcTooltipRects(o),i=calcViewportRect(),_=calcPositionAboveXY(e,t,a);if(_.containerX<i.left+6)_.containerX=i.left+6,_.arrowX=Math.max(6,e-_.containerX-a.arrow.width/2);else{const t=i.right-6-a.container.width;_.containerX>t&&(_.containerX=t,_.arrowX=Math.min(a.container.width-6,e-_.containerX-a.arrow.width/2))}_.containerY<i.top+6&&(_.containerY+=a.container.height+2*a.arrow.height,_.arrowY-=a.container.height+a.arrow.height,_.baseArrowStyle=ARROW_STYLE_UP);const s=`left:${_.containerX}px;top:${_.containerY}px`;o.container.setAttribute("style",s);const l=`${_.baseArrowStyle};left:${_.arrowX}px;top:${_.arrowY}px`;o.arrow.setAttribute("style",l)}const Tooltip=e=>{let{children:t,ref:n,theme:r}=e;const{current:o}=(0,external_react_.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[a,i]=(0,external_react_.useState)(null),_=(e,t,n,r)=>{o.lastElement=r,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=n,a&&setComponentPositions(e,t,n,r,a)};return(0,external_react_.useImperativeHandle)(n,(()=>({pointTo:_}))),(0,external_react_.useEffect)((()=>{const e=createTooltipComponents(r);return i(e),()=>{document.body.removeChild(e.container),i(null)}}),[r]),(0,external_react_.useEffect)((()=>{a&&setComponentPositions(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,a)}),[a,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),a?(0,external_react_dom_.createPortal)(t,a.content):null};var WithTooltip_Tooltip=Tooltip,default_theme={arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"};const Wrapper=e=>{let{children:t,placement:n=PLACEMENTS.ABOVE_CURSOR,tip:r,theme:o}=e;const{current:a}=(0,external_react_.useRef)({lastCursorX:0,lastCursorY:0,triggeredByTouch:!1,timerId:void 0}),i=(0,external_react_.useRef)(null),_=(0,external_react_.useRef)(null),[s,l]=(0,external_react_.useState)(!1);return(0,external_react_.useEffect)((()=>{if(s&&null!==r){i.current&&i.current.pointTo(a.lastCursorX+window.scrollX,a.lastCursorY+window.scrollY,n,_.current);const e=()=>l(!1);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)}}),[a.lastCursorX,a.lastCursorY,n,s,r]),(0,jsx_runtime.jsxs)("div",{className:o.wrapper,onMouseLeave:()=>l(!1),onMouseMove:e=>((e,t)=>{if(s){const r=_.current.getBoundingClientRect();e<r.left||e>r.right||t<r.top||t>r.bottom?l(!1):i.current&&i.current.pointTo(e+window.scrollX,t+window.scrollY,n,_.current)}else a.lastCursorX=e,a.lastCursorY=t,a.triggeredByTouch?a.timerId||(a.timerId=setTimeout((()=>{a.triggeredByTouch=!1,a.timerId=void 0,l(!0)}),300)):l(!0)})(e.clientX,e.clientY),onClick:()=>{a.timerId&&(clearTimeout(a.timerId),a.timerId=void 0,a.triggeredByTouch=!1)},onTouchStart:()=>{a.triggeredByTouch=!0},ref:_,role:"presentation",children:[s&&null!==r?(0,jsx_runtime.jsx)(WithTooltip_Tooltip,{ref:i,theme:o,children:r}):null,t]})},ThemedWrapper=react_themes_default()(Wrapper,"WithTooltip",default_theme),e=ThemedWrapper;e.PLACEMENTS=PLACEMENTS;var WithTooltip=e,external_qs_=__webpack_require__(360),external_qs_default=__webpack_require__.n(external_qs_),base={container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"},throbber={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"};const YouTubeVideo=e=>{var t;let{autoplay:n,src:r,theme:o,title:a}=e;const i=r.split("?");let _=i[0];const s=i[1],l=s?external_qs_default().parse(s):{};return _=`https://www.youtube.com/embed/${l.v||(null===(t=_)||void 0===t||null===(t=t.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===t?void 0:t[1])}`,delete l.v,l.autoplay=n?"1":"0",_+=`?${external_qs_default().stringify(l)}`,(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)(components_Throbber,{theme:throbber}),(0,jsx_runtime.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:o.video,src:_,title:a})]})};var components_YouTubeVideo=react_themes_default()(YouTubeVideo,"YouTubeVideo",base),TextArea_style={container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"};const TextArea=e=>{let{disabled:t,onBlur:n,onChange:r,onKeyDown:o,placeholder:a,theme:i,value:_}=e;const s=(0,external_react_.useRef)(null),[l,c]=(0,external_react_.useState)(),[u,d]=(0,external_react_.useState)(_||"");return void 0!==_&&u!==_&&d(_),(0,external_react_.useEffect)((()=>{const e=s.current;if(!e)return;const t=new ResizeObserver((()=>{c(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,external_react_.useEffect)((()=>{const e=s.current;e&&c(e.scrollHeight)}),[u]),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[(0,jsx_runtime.jsx)("textarea",{readOnly:!0,ref:s,className:`${i.textarea} ${i.hidden}`,value:u}),(0,jsx_runtime.jsx)("textarea",{disabled:t,onBlur:n,onChange:void 0===_?e=>{d(e.target.value)}:r,onKeyDown:o,placeholder:a,style:{height:l},className:i.textarea,value:u})]})};var components_TextArea=react_themes_default()(TextArea,"TextArea",TextArea_style),src_dirname="/";const server=webpack.requireWeak("./server",src_dirname),client=server?void 0:__webpack_require__(969).A;return __webpack_exports__}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet-async"),require("react-router")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-themes","cookie","dayjs","node-forge/lib/aes","node-forge/lib/forge","qs","react","react-dom","react-dom/client","react-helmet-async","react-router"],t):"object"==typeof exports?exports["@dr.pogodin/react-utils"]=t(require("@dr.pogodin/js-utils"),require("@dr.pogodin/react-global-state"),require("@dr.pogodin/react-themes"),require("cookie"),require("dayjs"),require("node-forge/lib/aes"),require("node-forge/lib/forge"),require("qs"),require("react"),require("react-dom"),require("react-dom/client"),require("react-helmet-async"),require("react-router")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-themes"],e.cookie,e.dayjs,e["node-forge/lib/aes"],e["node-forge/lib/forge"],e.qs,e.react,e["react-dom"],e["react-dom/client"],e["react-helmet-async"],e["react-router"])}("undefined"!=typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__859__,__WEBPACK_EXTERNAL_MODULE__462__,__WEBPACK_EXTERNAL_MODULE__185__,__WEBPACK_EXTERNAL_MODULE__958__,__WEBPACK_EXTERNAL_MODULE__814__,__WEBPACK_EXTERNAL_MODULE__360__,__WEBPACK_EXTERNAL_MODULE__155__,__WEBPACK_EXTERNAL_MODULE__514__,__WEBPACK_EXTERNAL_MODULE__236__,__WEBPACK_EXTERNAL_MODULE__474__,__WEBPACK_EXTERNAL_MODULE__707__){return function(){"use strict";var __webpack_modules__={668:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:function(){return getInj}});var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(814),node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(958),node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__),_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(540);let inj={};const metaElement="undefined"!=typeof document?document.querySelector('meta[itemprop="drpruinj"]'):null;if(metaElement){metaElement.remove();let data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decode64(metaElement.content);const{key:key}=(0,_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__.F)(),d=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().cipher.createDecipher("AES-CBC",key);d.start({iv:data.slice(0,key.length)}),d.update(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.createBuffer(data.slice(key.length))),d.finish(),data=node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decodeUtf8(d.output.data),inj=eval(`(${data})`)}else"undefined"!=typeof window&&window.REACT_UTILS_INJECTION?(inj=window.REACT_UTILS_INJECTION,delete window.REACT_UTILS_INJECTION):inj={};function getInj(){return inj}},969:function(e,t,n){n.d(t,{A:function(){return l}}),n(155);var r=n(236),o=n(474),a=n(707),i=n(126),_=n(668),s=n(922);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=document.getElementById("react-view");if(!n)throw Error("Failed to find container for React app");const l=(0,s.jsx)(i.GlobalStateProvider,{initialState:(0,_.A)().ISTATE||t.initialState,children:(0,s.jsx)(a.BrowserRouter,{children:(0,s.jsx)(o.HelmetProvider,{children:(0,s.jsx)(e,{})})})});t.dontHydrate?(0,r.createRoot)(n).render(l):(0,r.hydrateRoot)(n,l)}},540:function(e,t,n){let r;function o(){if(void 0===r)throw Error('"Build Info" has not been initialized yet');return r}n.d(t,{F:function(){return o}}),"undefined"!=typeof BUILD_INFO&&(r=BUILD_INFO)},48:function(e,t,n){n.d(t,{B:function(){return r},p:function(){return o}});const r="object"!=typeof process||!process.versions||!process.versions.node||!!n.g.REACT_UTILS_FORCE_CLIENT_SIDE,o=!r},724:function(e,t,n){n.r(t),n.d(t,{IS_CLIENT_SIDE:function(){return o.B},IS_SERVER_SIDE:function(){return o.p},buildTimestamp:function(){return _},getBuildInfo:function(){return r.F},isDevBuild:function(){return a},isProdBuild:function(){return i}});var r=n(540),o=n(48);function a(){return!1}function i(){return!0}function _(){return(0,r.F)().timestamp}},148:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{requireWeak:function(){return requireWeak},resolveWeak:function(){return resolveWeak}});var _isomorphy__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(724);function requireWeak(modulePath,basePath){if(_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE)return null;try{const{resolve:resolve}=eval("require")("path"),path=basePath?resolve(basePath,modulePath):modulePath,module=eval("require")(path);if(!("default"in module))return module;const{default:def,...named}=module,res=def;return Object.entries(named).forEach((e=>{let[t,n]=e;const r=res[t];if(void 0!==r){if(r!==n)throw Error("Conflict between default and named exports")}else res[t]=n})),res}catch{return null}}function resolveWeak(e){return e}},208:function(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},922:function(e,t,n){e.exports=n(208)},864:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__864__},126:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__126__},859:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__859__},462:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__462__},185:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__185__},958:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__958__},814:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__814__},360:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__360__},155:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__155__},514:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__514__},236:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__236__},474:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__474__},707:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__707__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Barrier:function(){return js_utils_.Barrier},BaseButton:function(){return BaseButton},BaseModal:function(){return BaseModal},Button:function(){return Button},Checkbox:function(){return components_Checkbox},CustomDropdown:function(){return CustomDropdown},Dropdown:function(){return NativeDropdown},Emitter:function(){return js_utils_.Emitter},GlobalStateProvider:function(){return react_global_state_.GlobalStateProvider},Input:function(){return components_Input},Link:function(){return components_Link},MetaTags:function(){return components_MetaTags},Modal:function(){return Modal},NavLink:function(){return components_NavLink},PageLayout:function(){return components_PageLayout},Semaphore:function(){return js_utils_.Semaphore},Switch:function(){return Switch},TextArea:function(){return components_TextArea},ThemeProvider:function(){return react_themes_.ThemeProvider},Throbber:function(){return components_Throbber},WithTooltip:function(){return WithTooltip},YouTubeVideo:function(){return components_YouTubeVideo},client:function(){return client},config:function(){return utils_config},getGlobalState:function(){return react_global_state_.getGlobalState},getSsrContext:function(){return getSsrContext},isomorphy:function(){return isomorphy},newAsyncDataEnvelope:function(){return react_global_state_.newAsyncDataEnvelope},server:function(){return server},splitComponent:function(){return splitComponent},themed:function(){return themed},time:function(){return utils_time},useAsyncCollection:function(){return react_global_state_.useAsyncCollection},useAsyncData:function(){return react_global_state_.useAsyncData},useGlobalState:function(){return react_global_state_.useGlobalState},webpack:function(){return webpack},withGlobalStateType:function(){return react_global_state_.withGlobalStateType},withRetries:function(){return js_utils_.withRetries}});var global={},react_themes_=__webpack_require__(859),react_themes_default=__webpack_require__.n(react_themes_),environment_check=__webpack_require__(48),webpack=__webpack_require__(148);const config=(environment_check.B?__webpack_require__(668).A().CONFIG:(0,webpack.requireWeak)("config"))||{};if(environment_check.B&&"undefined"!=typeof document){const e=__webpack_require__(462);config.CSRF=e.parse(document.cookie).csrfToken}var utils_config=config,isomorphy=__webpack_require__(724),external_cookie_=__webpack_require__(462),external_dayjs_=__webpack_require__(185),external_dayjs_default=__webpack_require__.n(external_dayjs_),external_react_=__webpack_require__(155),js_utils_=__webpack_require__(864),react_global_state_=__webpack_require__(126);const{getSsrContext:getSsrContext}=(0,react_global_state_.withGlobalStateType)();function useCurrent(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:n=5*js_utils_.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[r,o]=(0,react_global_state_.useGlobalState)(t,Date.now);return(0,external_react_.useEffect)((()=>{let t;const r=()=>{o((e=>{const t=Date.now();return Math.abs(t-e)>n?t:e})),e&&(t=setTimeout(r,n))};return r(),()=>{t&&clearTimeout(t)}}),[e,n,o]),r}function useTimezoneOffset(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=getSsrContext(!1),[r,o]=(0,react_global_state_.useGlobalState)(t,(()=>{var t;const r=e&&(null==n||null===(t=n.req)||void 0===t||null===(t=t.cookies)||void 0===t?void 0:t[e]);return r?parseInt(r,10):0}));return(0,external_react_.useEffect)((()=>{const t=(new Date).getTimezoneOffset();o(t),e&&(document.cookie=(0,external_cookie_.serialize)(e,t.toString(),{path:"/"}))}),[e,o]),r}const time={DAY_MS:js_utils_.DAY_MS,HOUR_MS:js_utils_.HOUR_MS,MIN_MS:js_utils_.MIN_MS,SEC_MS:js_utils_.SEC_MS,YEAR_MS:js_utils_.YEAR_MS,now:Date.now,timer:js_utils_.timer,useCurrent:useCurrent,useTimezoneOffset:useTimezoneOffset};var utils_time=Object.assign(external_dayjs_default(),time),jsx_runtime=__webpack_require__(922);let clientChunkGroups;isomorphy.IS_CLIENT_SIDE&&(clientChunkGroups=__webpack_require__(668).A().CHUNK_GROUPS||{});const refCounts={};function getPublicPath(){return(0,isomorphy.getBuildInfo)().publicPath}function bookStyleSheet(e,t,n){let r;const o=`${getPublicPath()}/${e}`,a=`${document.location.origin}${o}`;if(!t.has(a)){let e=document.querySelector(`link[href="${o}"]`);e||(e=document.createElement("link"),e.setAttribute("rel","stylesheet"),e.setAttribute("href",o),document.head.appendChild(e)),r=new js_utils_.Barrier,e.addEventListener("load",(()=>r.resolve())),e.addEventListener("error",(()=>r.resolve()))}if(n){const e=refCounts[o]||0;refCounts[o]=1+e}return r}function getLoadedStyleSheets(){const e=new Set,{styleSheets:t}=document;for(let r=0;r<t.length;++r){var n;const o=null===(n=t[r])||void 0===n?void 0:n.href;o&&e.add(o)}return e}function assertChunkName(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}function bookStyleSheets(e,t,n){const r=[],o=t[e];if(!o)return Promise.resolve();const a=getLoadedStyleSheets();for(let e=0;e<o.length;++e){const t=o[e];if(null!=t&&t.endsWith(".css")){const e=bookStyleSheet(t,a,n);e&&r.push(e)}}return r.length?Promise.allSettled(r).then():Promise.resolve()}function freeStyleSheets(e,t){const n=t[e];if(n)for(let e=0;e<n.length;++e){const t=n[e];if(null!=t&&t.endsWith(".css")){const e=`${getPublicPath()}/${t}`,n=refCounts[e];n&&(n<=1?(document.head.querySelector(`link[href="${e}"]`).remove(),delete refCounts[e]):refCounts[e]=n-1)}}}const usedChunkNames=new Set;function splitComponent(e){let{chunkName:t,getComponent:n,placeholder:r}=e;if(isomorphy.IS_CLIENT_SIDE&&assertChunkName(t,clientChunkGroups),usedChunkNames.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);usedChunkNames.add(t);const o=(0,external_react_.lazy)((async()=>{const e=await n(),r="default"in e?e.default:e;return isomorphy.IS_CLIENT_SIDE&&await bookStyleSheets(t,clientChunkGroups,!1),{default:e=>{let{children:n,ref:o,...a}=e;if(isomorphy.IS_SERVER_SIDE){const{chunkGroups:e,chunks:n}=getSsrContext();assertChunkName(t,e),n.includes(t)||n.push(t)}return(0,external_react_.useInsertionEffect)((()=>(bookStyleSheets(t,clientChunkGroups,!0),()=>freeStyleSheets(t,clientChunkGroups))),[]),(0,jsx_runtime.jsx)(r,{...a,ref:o,children:n})}}}));return e=>{let{children:t,...n}=e;return(0,jsx_runtime.jsx)(external_react_.Suspense,{fallback:r,children:(0,jsx_runtime.jsx)(o,{...n,children:t})})}}const themed=react_themes_default();themed.COMPOSE=react_themes_.COMPOSE,themed.PRIORITY=react_themes_.PRIORITY;var external_react_dom_=__webpack_require__(514),external_react_dom_default=__webpack_require__.n(external_react_dom_),base_theme={overlay:"ye2BZo",context:"Szmbbz",ad:"Ah-Nsc",hoc:"Wki41G",container:"gyZ4rc"},styles={scrollingDisabledByModal:"_5fRFtF"};const BaseModal=e=>{let{cancelOnScrolling:t,children:n,containerStyle:r,dontDisableScrolling:o,onCancel:a,overlayStyle:i,style:_,testId:s,testIdForOverlay:l,theme:c}=e;const u=(0,external_react_.useRef)(null),d=(0,external_react_.useRef)(null),[m,p]=(0,external_react_.useState)();(0,external_react_.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),p(e),()=>{document.body.removeChild(e)}}),[]),(0,external_react_.useEffect)((()=>(t&&a&&(window.addEventListener("scroll",a),window.addEventListener("wheel",a)),()=>{t&&a&&(window.removeEventListener("scroll",a),window.removeEventListener("wheel",a))})),[t,a]),(0,external_react_.useEffect)((()=>(o||document.body.classList.add(styles.scrollingDisabledByModal),()=>{o||document.body.classList.remove(styles.scrollingDisabledByModal)})),[o]);const h=(0,external_react_.useMemo)((()=>(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e,t;const n=null===(e=u.current)||void 0===e?void 0:e.querySelectorAll("*");for(let e=n.length-1;e>=0;--e){var r;if(null===(r=n[e])||void 0===r||r.focus(),document.activeElement===n[e])return}null===(t=d.current)||void 0===t||t.focus()},tabIndex:0})),[]);return m?external_react_dom_default().createPortal((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[h,(0,jsx_runtime.jsx)("div",{"aria-label":"Cancel",className:c.overlay,"data-testid":void 0,onClick:e=>{a&&(a(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&a&&(a(),e.stopPropagation())},ref:e=>{e&&e!==d.current&&(d.current=e,e.focus())},role:"button",style:i,tabIndex:0}),(0,jsx_runtime.jsx)("div",{"aria-modal":"true",className:c.container,"data-testid":void 0,onClick:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation(),ref:u,role:"dialog",style:null!=_?_:r,children:n}),(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e;null===(e=d.current)||void 0===e||e.focus()},tabIndex:0}),h]}),m):null};var Modal=react_themes_default()(BaseModal,"Modal",base_theme),style={overlay:"jKsMKG"};function isValue(e){const t=typeof e;return"number"===t||"string"===t}function optionValueName(e){var t;return isValue(e)?[e,e]:[e.value,null!==(t=e.name)&&void 0!==t?t:e.value]}function areEqual(e,t){return(null==e?void 0:e.left)===(null==t?void 0:t.left)&&(null==e?void 0:e.top)===(null==t?void 0:t.top)&&(null==e?void 0:e.width)===(null==t?void 0:t.width)}const Options=e=>{let{containerClass:t,containerStyle:n,filter:r,onCancel:o,onChange:a,optionClass:i,options:_,ref:s}=e;const l=(0,external_react_.useRef)(null);(0,external_react_.useImperativeHandle)(s,(()=>({measure:()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.parentElement;if(!t)return;const n=l.current.getBoundingClientRect(),r=window.getComputedStyle(t),o=parseFloat(r.marginBottom),a=parseFloat(r.marginTop);return n.height+=o+a,n}})),[]);const c=[];for(let e=0;e<_.length;++e){const t=_[e];if(void 0!==t&&(!r||r(t))){const[e,n]=optionValueName(t);c.push((0,jsx_runtime.jsx)("div",{className:i,onClick:t=>{a(e),t.stopPropagation()},onKeyDown:t=>{"Enter"===t.key&&(a(e),t.stopPropagation())},role:"button",tabIndex:0,children:n},e))}}return(0,jsx_runtime.jsx)(BaseModal,{cancelOnScrolling:!0,style:n,dontDisableScrolling:!0,onCancel:o,theme:{ad:"",hoc:"",container:t,context:"",overlay:style.overlay},children:(0,jsx_runtime.jsx)("div",{ref:l,children:c})})};var CustomDropdown_Options=Options,theme={container:"oQKv0Y",context:"_9Tod5r",ad:"R58zIg",hoc:"O-Tp1i",label:"YUPUNs",dropdown:"pNEyAA",option:"LD2Kzy",select:"LP5azC",arrow:"-wscve",active:"k2UDsV",upward:"HWRvu4"};const BaseCustomDropdown=e=>{let{filter:t,label:n,onChange:r,options:o,theme:a,value:i}=e;if(!o)throw Error("Internal error");const[_,s]=(0,external_react_.useState)(!1),l=(0,external_react_.useRef)(null),c=(0,external_react_.useRef)(null),[u,d]=(0,external_react_.useState)(),[m,p]=(0,external_react_.useState)(!1);(0,external_react_.useEffect)((()=>{if(!_)return;let e;const t=()=>{var n,r;const o=null===(n=l.current)||void 0===n?void 0:n.getBoundingClientRect(),a=null===(r=c.current)||void 0===r?void 0:r.measure();if(o&&a){var i,_;const e=o.bottom+a.height<(null!==(i=null===(_=window.visualViewport)||void 0===_?void 0:_.height)&&void 0!==i?i:0),t=o.top-a.height>0,n=!e&&t;p(n);const r=n?{top:o.top-a.height-1,left:o.left,width:o.width}:{left:o.left,top:o.bottom,width:o.width};d((e=>areEqual(e,r)?e:r))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[_]);const h=e=>{const t=window.visualViewport,n=l.current.getBoundingClientRect();s(!0),d({left:(null==t?void 0:t.width)||0,top:(null==t?void 0:t.height)||0,width:n.width}),e.stopPropagation()};let f=(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:""});for(let e=0;e<o.length;++e){const n=o[e];if(void 0!==n&&(!t||t(n))){const[e,t]=optionValueName(n);if(e===i){f=t;break}}}let x=a.container;_&&(x+=` ${a.active}`);let b=a.select||"";return m&&(x+=` ${a.upward}`,b+=` ${a.upward}`),(0,jsx_runtime.jsxs)("div",{className:x,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:a.label,children:n}),(0,jsx_runtime.jsxs)("div",{className:a.dropdown,onClick:h,onKeyDown:e=>{"Enter"===e.key&&h(e)},ref:l,role:"listbox",tabIndex:0,children:[f,(0,jsx_runtime.jsx)("div",{className:a.arrow})]}),_?(0,jsx_runtime.jsx)(CustomDropdown_Options,{containerClass:b,containerStyle:u,onCancel:()=>{s(!1)},onChange:e=>{s(!1),r&&r(e)},optionClass:a.option||"",options:o,ref:c}):null]})};var CustomDropdown=react_themes_default()(BaseCustomDropdown,"CustomDropdown",theme),NativeDropdown_theme={dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",option:"_27pZ6W",hiddenOption:"clAKFJ",select:"N0Fc14",invalid:"wL4umU"};const Dropdown=e=>{let{filter:t,label:n,onChange:r,options:o,testId:a,theme:i,value:_}=e;if(!o)throw Error("Internal error");let s=!1;const l=[];for(let e=0;e<o.length;++e){const n=o[e];if(void 0!==n&&(!t||t(n))){const[e,t]=optionValueName(n);s||(s=e===_),l.push((0,jsx_runtime.jsx)("option",{className:i.option,value:e,children:t},e))}}const c=s?null:(0,jsx_runtime.jsx)("option",{disabled:!0,className:i.hiddenOption,value:_,children:_},"__reactUtilsHiddenOption");let u=i.select;return s||(u+=` ${i.invalid}`),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:n}),(0,jsx_runtime.jsxs)("div",{className:i.dropdown,children:[(0,jsx_runtime.jsxs)("select",{className:u,"data-testid":void 0,onChange:r,value:_,children:[c,l]}),(0,jsx_runtime.jsx)("div",{className:i.arrow})]})]})};var NativeDropdown=react_themes_default()(Dropdown,"Dropdown",NativeDropdown_theme),Switch_theme={container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"};const BaseSwitch=e=>{let{label:t,onChange:n,options:r,theme:o,value:a}=e;if(!r||!o.option)throw Error("Internal error");const i=[];for(let e=0;e<(null==r?void 0:r.length);++e){const t=r[e];if(void 0!==t){const[e,r]=optionValueName(t);let _,s=o.option;e===a?s+=` ${o.selected}`:n&&(_=()=>n(e)),i.push(_?(0,jsx_runtime.jsx)("div",{className:s,onClick:_,onKeyDown:e=>{_&&"Enter"===e.key&&_()},role:"button",tabIndex:0,children:r},e):(0,jsx_runtime.jsx)("div",{className:s,children:r},e))}}return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[t?(0,jsx_runtime.jsx)("div",{className:o.label,children:t}):null,(0,jsx_runtime.jsx)("div",{className:o.options,children:i})]})};var Switch=react_themes_default()(BaseSwitch,"Switch",Switch_theme),external_react_router_=__webpack_require__(707),GenericLink_style={link:"zH52sA"};const GenericLink=e=>{let{children:t,className:n,disabled:r,enforceA:o,keepScrollPosition:a,onClick:i,onMouseDown:_,openNewTab:s,replace:l,routerLinkType:c,to:u,...d}=e;if(r||o||s||null!=u&&u.match(/^(#|(https?|mailto):)/))return(0,jsx_runtime.jsx)("a",{className:(n?n+" ":"")+"zH52sA",href:u,onClick:r?e=>e.preventDefault():i,onMouseDown:r?e=>e.preventDefault():_,rel:"noopener noreferrer",target:s?"_blank":"",children:t});const m=c;return(0,jsx_runtime.jsx)(m,{className:n,discover:"none",onMouseDown:_,replace:l,to:u,onClick:e=>{i&&i(e),a||window.scroll(0,0)},...d,children:t})};var components_GenericLink=GenericLink;const Link=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.Link});var components_Link=Link,Button_style={button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"};const BaseButton=e=>{let{active:t,children:n,disabled:r,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:s,replace:l,testId:c,theme:u,to:d}=e,m=u.button;return t&&u.active&&(m+=` ${u.active}`),r?(u.disabled&&(m+=` ${u.disabled}`),(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,children:n})):d?(0,jsx_runtime.jsx)(components_Link,{className:m,"data-testid":void 0,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:s,replace:l,to:d,children:n}):(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,onClick:a,onKeyDown:a&&(e=>{"Enter"===e.key&&a(e)}),onMouseDown:i,onPointerDown:_,role:"button",tabIndex:0,children:n})};var Button=react_themes_default()(BaseButton,"Button",Button_style),Checkbox_theme={checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",indeterminate:"N9bCb8",container:"Kr0g3M",label:"_3dML-O",disabled:"EzQra1"};const Checkbox=e=>{let{checked:t,disabled:n,label:r,onChange:o,testId:a,theme:i}=e,_=i.container;n&&(_+=` ${i.disabled}`);let s=i.checkbox;return"indeterminate"===t&&(s+=` ${i.indeterminate}`),(0,jsx_runtime.jsxs)("div",{className:_,children:[void 0===r?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:r}),(0,jsx_runtime.jsx)("input",{checked:void 0===t?void 0:!0===t,className:s,"data-testid":void 0,disabled:n,onChange:o,onClick:e=>e.stopPropagation(),type:"checkbox"})]})};var components_Checkbox=react_themes_default()(Checkbox,"Checkbox",Checkbox_theme),Input_theme={container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"};const Input=e=>{let{label:t,ref:n,testId:r,theme:o,...a}=e;return(0,jsx_runtime.jsxs)("span",{className:o.container,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:o.label,children:t}),(0,jsx_runtime.jsx)("input",{className:o.input,"data-testid":void 0,ref:n,...a})]})};var components_Input=react_themes_default()(Input,"Input",Input_theme),PageLayout_base_theme={container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"};const PageLayout=e=>{let{children:t,leftSidePanelContent:n,rightSidePanelContent:r,theme:o}=e;return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:n}),(0,jsx_runtime.jsx)("div",{className:o.mainPanel,children:t}),(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.rightSidePanel].join(" "),children:r})]})};var components_PageLayout=react_themes_default()(PageLayout,"PageLayout",PageLayout_base_theme),external_react_helmet_async_=__webpack_require__(474);const Context=(0,external_react_.createContext)({description:"",title:""}),MetaTags=e=>{let{children:t,description:n,extraMetaTags:r,image:o,siteName:a,socialDescription:i,socialTitle:_,title:s,url:l}=e;const c=_||s,u=i||n,d=(0,external_react_.useMemo)((()=>({description:n,image:o,siteName:a,socialDescription:i,socialTitle:_,title:s,url:l})),[n,o,a,i,_,s,l]),m=[];if(null!=r&&r.length)for(let e=0;e<r.length;++e){const{content:t,name:n}=r[e];m.push((0,jsx_runtime.jsx)("meta",{content:t,name:n},`extra-meta-tag-${e}`))}return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)(external_react_helmet_async_.Helmet,{children:[(0,jsx_runtime.jsx)("title",{children:s}),(0,jsx_runtime.jsx)("meta",{name:"description",content:n}),(0,jsx_runtime.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,jsx_runtime.jsx)("meta",{name:"twitter:title",content:c}),(0,jsx_runtime.jsx)("meta",{name:"twitter:description",content:u}),o?(0,jsx_runtime.jsx)("meta",{name:"twitter:image",content:o}):null,a?(0,jsx_runtime.jsx)("meta",{name:"twitter:site",content:`@${a}`}):null,(0,jsx_runtime.jsx)("meta",{name:"og:title",content:c}),o?(0,jsx_runtime.jsx)("meta",{name:"og:image",content:o}):null,o?(0,jsx_runtime.jsx)("meta",{name:"og:image:alt",content:c}):null,(0,jsx_runtime.jsx)("meta",{name:"og:description",content:u}),a?(0,jsx_runtime.jsx)("meta",{name:"og:sitename",content:a}):null,l?(0,jsx_runtime.jsx)("meta",{name:"og:url",content:l}):null,m]}),t?(0,jsx_runtime.jsx)(Context.Provider,{value:d,children:t}):null]})};MetaTags.Context=Context;var components_MetaTags=MetaTags;const NavLink=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.NavLink});var components_NavLink=NavLink,Throbber_theme={container:"_7zdld4",context:"uIObt7",ad:"XIxe9o",hoc:"YOyORH",circle:"dBrB4g",bouncing:"TJe-6j"};const Throbber=e=>{let{theme:t}=e;return(0,jsx_runtime.jsxs)("span",{className:t.container,children:[(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle})]})};var components_Throbber=react_themes_default()(Throbber,"Throbber",Throbber_theme);let PLACEMENTS=function(e){return e.ABOVE_CURSOR="ABOVE_CURSOR",e.ABOVE_ELEMENT="ABOVE_ELEMENT",e.BELOW_CURSOR="BELOW_CURSOR",e.BELOW_ELEMENT="BELOW_ELEMENT",e}({});const ARROW_STYLE_DOWN=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),ARROW_STYLE_UP=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function createTooltipComponents(e){const t=document.createElement("div");e.arrow&&t.setAttribute("class",e.arrow);const n=document.createElement("div");e.content&&n.setAttribute("class",e.content);const r=document.createElement("div");return e.container&&r.setAttribute("class",e.container),r.appendChild(t),r.appendChild(n),document.body.appendChild(r),{container:r,arrow:t,content:n}}function calcTooltipRects(e){return{arrow:e.arrow.getBoundingClientRect(),container:e.container.getBoundingClientRect()}}function calcViewportRect(){const{scrollX:e,scrollY:t}=window,{documentElement:{clientHeight:n,clientWidth:r}}=document;return{left:e,right:e+r,top:t,bottom:t+n}}function calcPositionAboveXY(e,t,n){const{arrow:r,container:o}=n;return{arrowX:.5*(o.width-r.width),arrowY:o.height,containerX:e-o.width/2,containerY:t-o.height-r.height/1.5,baseArrowStyle:ARROW_STYLE_DOWN}}function setComponentPositions(e,t,n,r,o){const a=calcTooltipRects(o),i=calcViewportRect(),_=calcPositionAboveXY(e,t,a);if(_.containerX<i.left+6)_.containerX=i.left+6,_.arrowX=Math.max(6,e-_.containerX-a.arrow.width/2);else{const t=i.right-6-a.container.width;_.containerX>t&&(_.containerX=t,_.arrowX=Math.min(a.container.width-6,e-_.containerX-a.arrow.width/2))}_.containerY<i.top+6&&(_.containerY+=a.container.height+2*a.arrow.height,_.arrowY-=a.container.height+a.arrow.height,_.baseArrowStyle=ARROW_STYLE_UP);const s=`left:${_.containerX}px;top:${_.containerY}px`;o.container.setAttribute("style",s);const l=`${_.baseArrowStyle};left:${_.arrowX}px;top:${_.arrowY}px`;o.arrow.setAttribute("style",l)}const Tooltip=e=>{let{children:t,ref:n,theme:r}=e;const{current:o}=(0,external_react_.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[a,i]=(0,external_react_.useState)(null),_=(e,t,n,r)=>{o.lastElement=r,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=n,a&&setComponentPositions(e,t,n,r,a)};return(0,external_react_.useImperativeHandle)(n,(()=>({pointTo:_}))),(0,external_react_.useEffect)((()=>{const e=createTooltipComponents(r);return i(e),()=>{document.body.removeChild(e.container),i(null)}}),[r]),(0,external_react_.useEffect)((()=>{a&&setComponentPositions(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,a)}),[a,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),a?(0,external_react_dom_.createPortal)(t,a.content):null};var WithTooltip_Tooltip=Tooltip,default_theme={arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"};const Wrapper=e=>{let{children:t,placement:n=PLACEMENTS.ABOVE_CURSOR,tip:r,theme:o}=e;const{current:a}=(0,external_react_.useRef)({lastCursorX:0,lastCursorY:0,triggeredByTouch:!1,timerId:void 0}),i=(0,external_react_.useRef)(null),_=(0,external_react_.useRef)(null),[s,l]=(0,external_react_.useState)(!1);return(0,external_react_.useEffect)((()=>{if(s&&null!==r){i.current&&i.current.pointTo(a.lastCursorX+window.scrollX,a.lastCursorY+window.scrollY,n,_.current);const e=()=>l(!1);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)}}),[a.lastCursorX,a.lastCursorY,n,s,r]),(0,jsx_runtime.jsxs)("div",{className:o.wrapper,onMouseLeave:()=>l(!1),onMouseMove:e=>((e,t)=>{if(s){const r=_.current.getBoundingClientRect();e<r.left||e>r.right||t<r.top||t>r.bottom?l(!1):i.current&&i.current.pointTo(e+window.scrollX,t+window.scrollY,n,_.current)}else a.lastCursorX=e,a.lastCursorY=t,a.triggeredByTouch?a.timerId||(a.timerId=setTimeout((()=>{a.triggeredByTouch=!1,a.timerId=void 0,l(!0)}),300)):l(!0)})(e.clientX,e.clientY),onClick:()=>{a.timerId&&(clearTimeout(a.timerId),a.timerId=void 0,a.triggeredByTouch=!1)},onTouchStart:()=>{a.triggeredByTouch=!0},ref:_,role:"presentation",children:[s&&null!==r?(0,jsx_runtime.jsx)(WithTooltip_Tooltip,{ref:i,theme:o,children:r}):null,t]})},ThemedWrapper=react_themes_default()(Wrapper,"WithTooltip",default_theme),e=ThemedWrapper;e.PLACEMENTS=PLACEMENTS;var WithTooltip=e,external_qs_=__webpack_require__(360),external_qs_default=__webpack_require__.n(external_qs_),base={container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"},throbber={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"};const YouTubeVideo=e=>{var t;let{autoplay:n,src:r,theme:o,title:a}=e;const i=r.split("?");let _=i[0];const s=i[1],l=s?external_qs_default().parse(s):{};return _=`https://www.youtube.com/embed/${l.v||(null===(t=_)||void 0===t||null===(t=t.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===t?void 0:t[1])}`,delete l.v,l.autoplay=n?"1":"0",_+=`?${external_qs_default().stringify(l)}`,(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)(components_Throbber,{theme:throbber}),(0,jsx_runtime.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:o.video,src:_,title:a})]})};var components_YouTubeVideo=react_themes_default()(YouTubeVideo,"YouTubeVideo",base),TextArea_style={container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"};const TextArea=e=>{let{disabled:t,onBlur:n,onChange:r,onKeyDown:o,placeholder:a,theme:i,value:_}=e;const s=(0,external_react_.useRef)(null),[l,c]=(0,external_react_.useState)(),[u,d]=(0,external_react_.useState)(_||"");return void 0!==_&&u!==_&&d(_),(0,external_react_.useEffect)((()=>{const e=s.current;if(!e)return;const t=new ResizeObserver((()=>{c(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,external_react_.useEffect)((()=>{const e=s.current;e&&c(e.scrollHeight)}),[u]),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[(0,jsx_runtime.jsx)("textarea",{readOnly:!0,ref:s,className:`${i.textarea} ${i.hidden}`,value:u}),(0,jsx_runtime.jsx)("textarea",{disabled:t,onBlur:n,onChange:void 0===_?e=>{d(e.target.value)}:r,onKeyDown:o,placeholder:a,style:{height:l},className:i.textarea,value:u})]})};var components_TextArea=react_themes_default()(TextArea,"TextArea",TextArea_style),src_dirname="/";const server=webpack.requireWeak("./server",src_dirname),client=server?void 0:__webpack_require__(969).A;return __webpack_exports__}()}));
|
|
3
3
|
//# sourceMappingURL=web.bundle.js.map
|