@dr.pogodin/react-utils 1.43.33 → 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
@@ -24,15 +23,8 @@ Object.defineProperty(exports, "getErrorForCode", {
24
23
  return _httpStatusCodes.getReasonPhrase;
25
24
  }
26
25
  });
27
- Object.defineProperty(exports, "joi", {
28
- enumerable: true,
29
- get: function () {
30
- return _joi.default;
31
- }
32
- });
33
26
  exports.newError = newError;
34
27
  var _httpStatusCodes = require("http-status-codes");
35
- var _joi = _interopRequireDefault(require("joi"));
36
28
  /**
37
29
  * @category Utilities
38
30
  * @module server/errors
@@ -81,20 +73,6 @@ var _joi = _interopRequireDefault(require("joi"));
81
73
  * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request
82
74
  */
83
75
 
84
- /**
85
- * @static
86
- * @const joi
87
- * @desc An alias for [Joi library](https://joi.dev/api/?v=17.4.0),
88
- * which provides tooling for HTTP request validation. You can use it in any
89
- * way you would use that library import.
90
- * @example
91
- * import { server } from '@dr.pogodin/react-utils';
92
- * const { joi } = server.errors;
93
- * const requestBodySchema = joi.object({
94
- * sampleKey: joi.string().max(16).required(),
95
- * });
96
- */
97
-
98
76
  // TODO: It could accept the status code as a constructor argument.
99
77
  class ErrorWithStatus extends Error {
100
78
  status = _httpStatusCodes.StatusCodes.INTERNAL_SERVER_ERROR;
@@ -138,14 +116,14 @@ function fail(message, statusCode = _httpStatusCodes.StatusCodes.INTERNAL_SERVER
138
116
  * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad
139
117
  * Request).
140
118
  */
141
- function assert(value, schema, message = '', statusCode = _httpStatusCodes.StatusCodes.BAD_REQUEST) {
142
- const {
143
- error
144
- } = schema.validate(value, {
145
- abortEarly: false
146
- });
147
- if (error) {
148
- fail(message.concat(message ? '\n' : '', error.message), statusCode);
119
+ async function assert(value, schema, message = '', statusCode = _httpStatusCodes.StatusCodes.BAD_REQUEST) {
120
+ let result = schema['~standard'].validate(value);
121
+ if (result instanceof Promise) result = await result;
122
+ if (result.issues) {
123
+ let error = JSON.stringify(result.issues, null, 2);
124
+ if (message) error = `${message}\n\n${error}`;
125
+ throw fail(error, statusCode);
149
126
  }
127
+ return result.value;
150
128
  }
151
129
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":["_httpStatusCodes","require","_joi","_interopRequireDefault","ErrorWithStatus","Error","status","CODES","INTERNAL_SERVER_ERROR","newError","message","statusCode","error","fail","assert","value","schema","BAD_REQUEST","validate","abortEarly","concat"],"sources":["../../../../src/server/utils/errors.ts"],"sourcesContent":["/**\n * @category Utilities\n * @module server/errors\n * @desc\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { errors } = server;\n * ```\n * Server-side helpers for error handling.\n */\n\nimport {\n StatusCodes as CODES,\n ReasonPhrases as ERRORS,\n getReasonPhrase as getErrorForCode,\n} from 'http-status-codes';\n\nimport joi from 'joi';\n\n/**\n * @static\n * @const CODES\n * @desc An alias for\n * [StatusCodes object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and corresponding numeric codes.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { CODES } = server.errors;\n * console.log(CODES.BAD_REQUEST); // Prints: 400\n */\nexport { CODES };\n\n/**\n * @static\n * @const ERRORS\n * @desc An alias for\n * [ReasonPhrases object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and their pretty-printed forms.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { ERRORS } = server.errors;\n * console.log(ERRORS.BAD_REQUEST); // Prints: Bad Request\n */\nexport { ERRORS };\n\n/**\n * @static\n * @func getErrorForCode\n * @desc An alias for\n * [getReasonPhrase() function from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * Given an HTTP code it returns the corresponding error text.\n * @param {number} code HTTP code.\n * @return {string} HTTP error text.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request\n */\nexport { getErrorForCode };\n\n/**\n * @static\n * @const joi\n * @desc An alias for [Joi library](https://joi.dev/api/?v=17.4.0),\n * which provides tooling for HTTP request validation. You can use it in any\n * way you would use that library import.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { joi } = server.errors;\n * const requestBodySchema = joi.object({\n * sampleKey: joi.string().max(16).required(),\n * });\n */\nexport { joi };\n\n// TODO: It could accept the status code as a constructor argument.\nclass ErrorWithStatus extends Error {\n status: number = CODES.INTERNAL_SERVER_ERROR;\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { newError } = server.errors;\n * ```\n * Creates a new `Error` object with given message, and HTTP status code\n * attached as `status` field.\n * @param {string} message Error message.\n * @param {number} [statusCode=500] HTTP status code. Defaults to 500 (Internal\n * Server Error).\n * @return {Error}\n */\nexport function newError(\n message: string,\n statusCode = CODES.INTERNAL_SERVER_ERROR,\n): ErrorWithStatus {\n const error = new ErrorWithStatus(message);\n error.status = statusCode;\n return error;\n}\n\n/**\n * Throws an error with given message and HTTP status code.\n */\nexport function fail(\n message: string,\n statusCode: CODES = CODES.INTERNAL_SERVER_ERROR,\n): Error {\n throw newError(message, statusCode);\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { assert } = server.errors;\n * ```\n * Validates a value using given Joi schema, and throws an error with given\n * message and HTTP status code in case of the validation failure.\n * @param value\n * @param schema\n * @param [message] Error message.\n * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad\n * Request).\n */\nexport function assert(\n value: unknown,\n schema: joi.AnySchema,\n message = '',\n statusCode = CODES.BAD_REQUEST,\n): void {\n const { error } = schema.validate(value, { abortEarly: false });\n if (error) {\n fail(message.concat(message ? '\\n' : '', error.message), statusCode);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAAA,gBAAA,GAAAC,OAAA;AAMA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA,MAAMG,eAAe,SAASC,KAAK,CAAC;EAClCC,MAAM,GAAWC,4BAAK,CAACC,qBAAqB;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CACtBC,OAAe,EACfC,UAAU,GAAGJ,4BAAK,CAACC,qBAAqB,EACvB;EACjB,MAAMI,KAAK,GAAG,IAAIR,eAAe,CAACM,OAAO,CAAC;EAC1CE,KAAK,CAACN,MAAM,GAAGK,UAAU;EACzB,OAAOC,KAAK;AACd;;AAEA;AACA;AACA;AACO,SAASC,IAAIA,CAClBH,OAAe,EACfC,UAAiB,GAAGJ,4BAAK,CAACC,qBAAqB,EACxC;EACP,MAAMC,QAAQ,CAACC,OAAO,EAAEC,UAAU,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,MAAMA,CACpBC,KAAc,EACdC,MAAqB,EACrBN,OAAO,GAAG,EAAE,EACZC,UAAU,GAAGJ,4BAAK,CAACU,WAAW,EACxB;EACN,MAAM;IAAEL;EAAM,CAAC,GAAGI,MAAM,CAACE,QAAQ,CAACH,KAAK,EAAE;IAAEI,UAAU,EAAE;EAAM,CAAC,CAAC;EAC/D,IAAIP,KAAK,EAAE;IACTC,IAAI,CAACH,OAAO,CAACU,MAAM,CAACV,OAAO,GAAG,IAAI,GAAG,EAAE,EAAEE,KAAK,CAACF,OAAO,CAAC,EAAEC,UAAU,CAAC;EACtE;AACF","ignoreList":[]}
1
+ {"version":3,"file":"errors.js","names":["_httpStatusCodes","require","ErrorWithStatus","Error","status","CODES","INTERNAL_SERVER_ERROR","newError","message","statusCode","error","fail","assert","value","schema","BAD_REQUEST","result","validate","Promise","issues","JSON","stringify"],"sources":["../../../../src/server/utils/errors.ts"],"sourcesContent":["/**\n * @category Utilities\n * @module server/errors\n * @desc\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { errors } = server;\n * ```\n * Server-side helpers for error handling.\n */\n\nimport {\n StatusCodes as CODES,\n ReasonPhrases as ERRORS,\n getReasonPhrase as getErrorForCode,\n} from 'http-status-codes';\n\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\n\n/**\n * @static\n * @const CODES\n * @desc An alias for\n * [StatusCodes object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and corresponding numeric codes.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { CODES } = server.errors;\n * console.log(CODES.BAD_REQUEST); // Prints: 400\n */\nexport { CODES };\n\n/**\n * @static\n * @const ERRORS\n * @desc An alias for\n * [ReasonPhrases object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and their pretty-printed forms.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { ERRORS } = server.errors;\n * console.log(ERRORS.BAD_REQUEST); // Prints: Bad Request\n */\nexport { ERRORS };\n\n/**\n * @static\n * @func getErrorForCode\n * @desc An alias for\n * [getReasonPhrase() function from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * Given an HTTP code it returns the corresponding error text.\n * @param {number} code HTTP code.\n * @return {string} HTTP error text.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request\n */\nexport { getErrorForCode };\n\n// TODO: It could accept the status code as a constructor argument.\nclass ErrorWithStatus extends Error {\n status: number = CODES.INTERNAL_SERVER_ERROR;\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { newError } = server.errors;\n * ```\n * Creates a new `Error` object with given message, and HTTP status code\n * attached as `status` field.\n * @param {string} message Error message.\n * @param {number} [statusCode=500] HTTP status code. Defaults to 500 (Internal\n * Server Error).\n * @return {Error}\n */\nexport function newError(\n message: string,\n statusCode = CODES.INTERNAL_SERVER_ERROR,\n): ErrorWithStatus {\n const error = new ErrorWithStatus(message);\n error.status = statusCode;\n return error;\n}\n\n/**\n * Throws an error with given message and HTTP status code.\n */\nexport function fail(\n message: string,\n statusCode: CODES = CODES.INTERNAL_SERVER_ERROR,\n): Error {\n throw newError(message, statusCode);\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { assert } = server.errors;\n * ```\n * Validates a value using given Joi schema, and throws an error with given\n * message and HTTP status code in case of the validation failure.\n * @param value\n * @param schema\n * @param [message] Error message.\n * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad\n * Request).\n */\nexport async function assert<T extends StandardSchemaV1>(\n value: StandardSchemaV1.InferInput<T>,\n schema: T,\n message = '',\n statusCode = CODES.BAD_REQUEST,\n): Promise<StandardSchemaV1.InferOutput<T>> {\n let result = schema['~standard'].validate(value);\n if (result instanceof Promise) result = await result;\n\n if (result.issues) {\n let error = JSON.stringify(result.issues, null, 2);\n if (message) error = `${message}\\n\\n${error}`;\n throw fail(error, statusCode);\n }\n\n return result.value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAAA,gBAAA,GAAAC,OAAA;AAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA,MAAMC,eAAe,SAASC,KAAK,CAAC;EAClCC,MAAM,GAAWC,4BAAK,CAACC,qBAAqB;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CACtBC,OAAe,EACfC,UAAU,GAAGJ,4BAAK,CAACC,qBAAqB,EACvB;EACjB,MAAMI,KAAK,GAAG,IAAIR,eAAe,CAACM,OAAO,CAAC;EAC1CE,KAAK,CAACN,MAAM,GAAGK,UAAU;EACzB,OAAOC,KAAK;AACd;;AAEA;AACA;AACA;AACO,SAASC,IAAIA,CAClBH,OAAe,EACfC,UAAiB,GAAGJ,4BAAK,CAACC,qBAAqB,EACxC;EACP,MAAMC,QAAQ,CAACC,OAAO,EAAEC,UAAU,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeG,MAAMA,CAC1BC,KAAqC,EACrCC,MAAS,EACTN,OAAO,GAAG,EAAE,EACZC,UAAU,GAAGJ,4BAAK,CAACU,WAAW,EACY;EAC1C,IAAIC,MAAM,GAAGF,MAAM,CAAC,WAAW,CAAC,CAACG,QAAQ,CAACJ,KAAK,CAAC;EAChD,IAAIG,MAAM,YAAYE,OAAO,EAAEF,MAAM,GAAG,MAAMA,MAAM;EAEpD,IAAIA,MAAM,CAACG,MAAM,EAAE;IACjB,IAAIT,KAAK,GAAGU,IAAI,CAACC,SAAS,CAACL,MAAM,CAACG,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,IAAIX,OAAO,EAAEE,KAAK,GAAG,GAAGF,OAAO,OAAOE,KAAK,EAAE;IAC7C,MAAMC,IAAI,CAACD,KAAK,EAAED,UAAU,CAAC;EAC/B;EAEA,OAAOO,MAAM,CAACH,KAAK;AACrB","ignoreList":[]}
@@ -31,8 +31,15 @@ const Input = ({
31
31
  theme,
32
32
  ...rest
33
33
  }) => {
34
+ // NOTE: As of now, it is only updated when "theme.focused" is defined,
35
+ // as otherwise its value is not used.
36
+ const [focused, setFocused] = (0, _react.useState)(false);
34
37
  const localRef = (0, _react.useRef)(null);
35
38
  let containerClassName = theme.container;
39
+
40
+ // NOTE: As of now, "focused" can be true only when "theme.focused"
41
+ // is provided.
42
+ if (focused /* && theme.focused */) containerClassName += ` ${theme.focused}`;
36
43
  if (!rest.value && theme.empty) containerClassName += ` ${theme.empty}`;
37
44
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
38
45
  className: containerClassName,
@@ -53,7 +60,15 @@ const Input = ({
53
60
  // TODO: Avoid the spreading later.
54
61
  // eslint-disable-next-line react/jsx-props-no-spreading
55
62
  ,
56
- ...rest
63
+ ...rest,
64
+ onBlur: theme.focused ? e => {
65
+ setFocused(false);
66
+ rest.onBlur?.(e);
67
+ } : rest.onBlur,
68
+ onFocus: theme.focused ? e => {
69
+ setFocused(true);
70
+ rest.onFocus?.(e);
71
+ } : rest.onFocus
57
72
  })]
58
73
  });
59
74
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","require","_reactThemes","_interopRequireDefault","_jsxRuntime","defaultTheme","Input","label","ref","testId","theme","rest","localRef","useRef","containerClassName","container","value","empty","jsxs","className","onFocus","current","focus","children","undefined","jsx","input","process","env","NODE_ENV","_default","exports","default","themed"],"sources":["../../../../../src/shared/components/Input/index.tsx"],"sourcesContent":["import { type FunctionComponent, type Ref, useRef } from 'react';\n\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\n\ntype ThemeKeyT = 'container' | 'empty' | 'input' | 'label';\n\ntype PropsT = React.InputHTMLAttributes<HTMLInputElement> & {\n label?: React.ReactNode;\n ref?: Ref<HTMLInputElement>;\n testId?: string;\n theme: Theme<ThemeKeyT>;\n};\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input: FunctionComponent<PropsT> = ({\n label,\n ref,\n testId,\n theme,\n ...rest\n}) => {\n const localRef = useRef<HTMLInputElement>(null);\n\n let containerClassName = theme.container;\n if (!rest.value && theme.empty) containerClassName += ` ${theme.empty}`;\n\n return (\n <span\n className={containerClassName}\n onFocus={() => {\n // TODO: It does not really work if a callback-style `ref` is passed in,\n // we need a more complex logic to cover that case, but for now this serves\n // the case we need it for.\n if (typeof ref === 'object') ref?.current?.focus();\n else localRef.current?.focus();\n }}\n >\n {label === undefined ? null : <div className={theme.label}>{label}</div>}\n <input\n className={theme.input}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n ref={ref ?? localRef}\n\n // TODO: Avoid the spreading later.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n />\n </span>\n );\n};\n\nexport default themed(Input, 'Input', defaultTheme);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8D,IAAAG,WAAA,GAAAH,OAAA;AAAA,MAAAI,YAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAa9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAgC,GAAGA,CAAC;EACxCC,KAAK;EACLC,GAAG;EACHC,MAAM;EACNC,KAAK;EACL,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAmB,IAAI,CAAC;EAE/C,IAAIC,kBAAkB,GAAGJ,KAAK,CAACK,SAAS;EACxC,IAAI,CAACJ,IAAI,CAACK,KAAK,IAAIN,KAAK,CAACO,KAAK,EAAEH,kBAAkB,IAAI,IAAIJ,KAAK,CAACO,KAAK,EAAE;EAEvE,oBACE,IAAAb,WAAA,CAAAc,IAAA;IACEC,SAAS,EAAEL,kBAAmB;IAC9BM,OAAO,EAAEA,CAAA,KAAM;MACb;MACA;MACA;MACA,IAAI,OAAOZ,GAAG,KAAK,QAAQ,EAAEA,GAAG,EAAEa,OAAO,EAAEC,KAAK,CAAC,CAAC,CAAC,KAC9CV,QAAQ,CAACS,OAAO,EAAEC,KAAK,CAAC,CAAC;IAChC,CAAE;IAAAC,QAAA,GAEDhB,KAAK,KAAKiB,SAAS,GAAG,IAAI,gBAAG,IAAApB,WAAA,CAAAqB,GAAA;MAAKN,SAAS,EAAET,KAAK,CAACH,KAAM;MAAAgB,QAAA,EAAEhB;IAAK,CAAM,CAAC,eACxE,IAAAH,WAAA,CAAAqB,GAAA;MACEN,SAAS,EAAET,KAAK,CAACgB,KAAM;MACvB,eAAaC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAAGL,SAAS,GAAGf,MAAO;MACxED,GAAG,EAAEA,GAAG,IAAII;;MAEZ;MACA;MAAA;MAAA,GACID;IAAI,CACT,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,oBAAM,EAAC3B,KAAK,EAAE,OAAO,EAAED,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","require","_reactThemes","_interopRequireDefault","_jsxRuntime","defaultTheme","Input","label","ref","testId","theme","rest","focused","setFocused","useState","localRef","useRef","containerClassName","container","value","empty","jsxs","className","onFocus","current","focus","children","undefined","jsx","input","process","env","NODE_ENV","onBlur","e","_default","exports","default","themed"],"sources":["../../../../../src/shared/components/Input/index.tsx"],"sourcesContent":["import {\n type FunctionComponent,\n type Ref,\n useRef,\n useState,\n} from 'react';\n\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\n\ntype ThemeKeyT = 'container' | 'empty' | 'focused' | 'input' | 'label';\n\ntype PropsT = React.InputHTMLAttributes<HTMLInputElement> & {\n label?: React.ReactNode;\n ref?: Ref<HTMLInputElement>;\n testId?: string;\n theme: Theme<ThemeKeyT>;\n};\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input: FunctionComponent<PropsT> = ({\n label,\n ref,\n testId,\n theme,\n ...rest\n}) => {\n // NOTE: As of now, it is only updated when \"theme.focused\" is defined,\n // as otherwise its value is not used.\n const [focused, setFocused] = useState(false);\n\n const localRef = useRef<HTMLInputElement>(null);\n\n let containerClassName = theme.container;\n\n // NOTE: As of now, \"focused\" can be true only when \"theme.focused\"\n // is provided.\n if (focused /* && theme.focused */) containerClassName += ` ${theme.focused}`;\n\n if (!rest.value && theme.empty) containerClassName += ` ${theme.empty}`;\n\n return (\n <span\n className={containerClassName}\n onFocus={() => {\n // TODO: It does not really work if a callback-style `ref` is passed in,\n // we need a more complex logic to cover that case, but for now this serves\n // the case we need it for.\n if (typeof ref === 'object') ref?.current?.focus();\n else localRef.current?.focus();\n }}\n >\n {label === undefined ? null : <div className={theme.label}>{label}</div>}\n <input\n className={theme.input}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n ref={ref ?? localRef}\n\n // TODO: Avoid the spreading later.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n\n onBlur={theme.focused ? (e) => {\n setFocused(false);\n rest.onBlur?.(e);\n } : rest.onBlur}\n onFocus={theme.focused ? (e) => {\n setFocused(true);\n rest.onFocus?.(e);\n } : rest.onFocus}\n />\n </span>\n );\n};\n\nexport default themed(Input, 'Input', defaultTheme);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA8D,IAAAG,WAAA,GAAAH,OAAA;AAAA,MAAAI,YAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAa9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAgC,GAAGA,CAAC;EACxCC,KAAK;EACLC,GAAG;EACHC,MAAM;EACNC,KAAK;EACL,GAAGC;AACL,CAAC,KAAK;EACJ;EACA;EACA,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE7C,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAmB,IAAI,CAAC;EAE/C,IAAIC,kBAAkB,GAAGP,KAAK,CAACQ,SAAS;;EAExC;EACA;EACA,IAAIN,OAAO,CAAC,wBAAwBK,kBAAkB,IAAI,IAAIP,KAAK,CAACE,OAAO,EAAE;EAE7E,IAAI,CAACD,IAAI,CAACQ,KAAK,IAAIT,KAAK,CAACU,KAAK,EAAEH,kBAAkB,IAAI,IAAIP,KAAK,CAACU,KAAK,EAAE;EAEvE,oBACE,IAAAhB,WAAA,CAAAiB,IAAA;IACEC,SAAS,EAAEL,kBAAmB;IAC9BM,OAAO,EAAEA,CAAA,KAAM;MACb;MACA;MACA;MACA,IAAI,OAAOf,GAAG,KAAK,QAAQ,EAAEA,GAAG,EAAEgB,OAAO,EAAEC,KAAK,CAAC,CAAC,CAAC,KAC9CV,QAAQ,CAACS,OAAO,EAAEC,KAAK,CAAC,CAAC;IAChC,CAAE;IAAAC,QAAA,GAEDnB,KAAK,KAAKoB,SAAS,GAAG,IAAI,gBAAG,IAAAvB,WAAA,CAAAwB,GAAA;MAAKN,SAAS,EAAEZ,KAAK,CAACH,KAAM;MAAAmB,QAAA,EAAEnB;IAAK,CAAM,CAAC,eACxE,IAAAH,WAAA,CAAAwB,GAAA;MACEN,SAAS,EAAEZ,KAAK,CAACmB,KAAM;MACvB,eAAaC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,GAAGL,SAAS,GAAGlB,MAAO;MACxED,GAAG,EAAEA,GAAG,IAAIO;;MAEZ;MACA;MAAA;MAAA,GACIJ,IAAI;MAERsB,MAAM,EAAEvB,KAAK,CAACE,OAAO,GAAIsB,CAAC,IAAK;QAC7BrB,UAAU,CAAC,KAAK,CAAC;QACjBF,IAAI,CAACsB,MAAM,GAAGC,CAAC,CAAC;MAClB,CAAC,GAAGvB,IAAI,CAACsB,MAAO;MAChBV,OAAO,EAAEb,KAAK,CAACE,OAAO,GAAIsB,CAAC,IAAK;QAC9BrB,UAAU,CAAC,IAAI,CAAC;QAChBF,IAAI,CAACY,OAAO,GAAGW,CAAC,CAAC;MACnB,CAAC,GAAGvB,IAAI,CAACY;IAAQ,CAClB,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,oBAAM,EAAChC,KAAK,EAAE,OAAO,EAAED,YAAY,CAAC","ignoreList":[]}
@@ -136,7 +136,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-ext
136
136
  \***********************************************/
137
137
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
138
138
 
139
- eval("{__webpack_require__.r(__webpack_exports__);\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 _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Input/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input = ({\n label,\n ref,\n testId,\n theme,\n ...rest\n}) => {\n const localRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n let containerClassName = theme.container;\n if (!rest.value && theme.empty) containerClassName += ` ${theme.empty}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"span\", {\n className: containerClassName,\n onFocus: () => {\n // TODO: It does not really work if a callback-style `ref` is passed in,\n // we need a more complex logic to cover that case, but for now this serves\n // the case we need it for.\n if (typeof ref === 'object') ref?.current?.focus();else localRef.current?.focus();\n },\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"input\", {\n className: theme.input,\n \"data-testid\": false ? 0 : testId,\n ref: ref ?? localRef\n\n // TODO: Avoid the spreading later.\n // eslint-disable-next-line react/jsx-props-no-spreading\n ,\n ...rest\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(Input, 'Input', _theme_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Input/index.tsx?\n}");
139
+ eval("{__webpack_require__.r(__webpack_exports__);\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 _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Input/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input = ({\n label,\n ref,\n testId,\n theme,\n ...rest\n}) => {\n // NOTE: As of now, it is only updated when \"theme.focused\" is defined,\n // as otherwise its value is not used.\n const [focused, setFocused] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n const localRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n let containerClassName = theme.container;\n\n // NOTE: As of now, \"focused\" can be true only when \"theme.focused\"\n // is provided.\n if (focused /* && theme.focused */) containerClassName += ` ${theme.focused}`;\n if (!rest.value && theme.empty) containerClassName += ` ${theme.empty}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"span\", {\n className: containerClassName,\n onFocus: () => {\n // TODO: It does not really work if a callback-style `ref` is passed in,\n // we need a more complex logic to cover that case, but for now this serves\n // the case we need it for.\n if (typeof ref === 'object') ref?.current?.focus();else localRef.current?.focus();\n },\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"input\", {\n className: theme.input,\n \"data-testid\": false ? 0 : testId,\n ref: ref ?? localRef\n\n // TODO: Avoid the spreading later.\n // eslint-disable-next-line react/jsx-props-no-spreading\n ,\n ...rest,\n onBlur: theme.focused ? e => {\n setFocused(false);\n rest.onBlur?.(e);\n } : rest.onBlur,\n onFocus: theme.focused ? e => {\n setFocused(true);\n rest.onFocus?.(e);\n } : rest.onFocus\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(Input, 'Input', _theme_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Input/index.tsx?\n}");
140
140
 
141
141
  /***/ }),
142
142
 
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"CODES",{enumerable:true,get:function(){return _httpStatusCodes.StatusCodes}});Object.defineProperty(exports,"ERRORS",{enumerable:true,get:function(){return _httpStatusCodes.ReasonPhrases}});exports.assert=assert;exports.fail=fail;Object.defineProperty(exports,"getErrorForCode",{enumerable:true,get:function(){return _httpStatusCodes.getReasonPhrase}});Object.defineProperty(exports,"joi",{enumerable:true,get:function(){return _joi.default}});exports.newError=newError;var _httpStatusCodes=require("http-status-codes");var _joi=_interopRequireDefault(require("joi"));/**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"CODES",{enumerable:true,get:function(){return _httpStatusCodes.StatusCodes}});Object.defineProperty(exports,"ERRORS",{enumerable:true,get:function(){return _httpStatusCodes.ReasonPhrases}});exports.assert=assert;exports.fail=fail;Object.defineProperty(exports,"getErrorForCode",{enumerable:true,get:function(){return _httpStatusCodes.getReasonPhrase}});exports.newError=newError;var _httpStatusCodes=require("http-status-codes");/**
2
2
  * @category Utilities
3
3
  * @module server/errors
4
4
  * @desc
@@ -38,18 +38,6 @@
38
38
  * @example
39
39
  * import { server } from '@dr.pogodin/react-utils';
40
40
  * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request
41
- *//**
42
- * @static
43
- * @const joi
44
- * @desc An alias for [Joi library](https://joi.dev/api/?v=17.4.0),
45
- * which provides tooling for HTTP request validation. You can use it in any
46
- * way you would use that library import.
47
- * @example
48
- * import { server } from '@dr.pogodin/react-utils';
49
- * const { joi } = server.errors;
50
- * const requestBodySchema = joi.object({
51
- * sampleKey: joi.string().max(16).required(),
52
- * });
53
41
  */// TODO: It could accept the status code as a constructor argument.
54
42
  class ErrorWithStatus extends Error{status=_httpStatusCodes.StatusCodes.INTERNAL_SERVER_ERROR}/**
55
43
  * ```js
@@ -76,5 +64,5 @@ class ErrorWithStatus extends Error{status=_httpStatusCodes.StatusCodes.INTERNAL
76
64
  * @param [message] Error message.
77
65
  * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad
78
66
  * Request).
79
- */function assert(value,schema,message="",statusCode=_httpStatusCodes.StatusCodes.BAD_REQUEST){const{error}=schema.validate(value,{abortEarly:false});if(error){fail(message.concat(message?"\n":"",error.message),statusCode)}}
67
+ */async function assert(value,schema,message="",statusCode=_httpStatusCodes.StatusCodes.BAD_REQUEST){let result=schema["~standard"].validate(value);if(result instanceof Promise)result=await result;if(result.issues){let error=JSON.stringify(result.issues,null,2);if(message)error=`${message}\n\n${error}`;throw fail(error,statusCode)}return result.value}
80
68
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":["_httpStatusCodes","require","_joi","_interopRequireDefault","ErrorWithStatus","Error","status","CODES","INTERNAL_SERVER_ERROR","newError","message","statusCode","error","fail","assert","value","schema","BAD_REQUEST","validate","abortEarly","concat"],"sources":["../../../../src/server/utils/errors.ts"],"sourcesContent":["/**\n * @category Utilities\n * @module server/errors\n * @desc\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { errors } = server;\n * ```\n * Server-side helpers for error handling.\n */\n\nimport {\n StatusCodes as CODES,\n ReasonPhrases as ERRORS,\n getReasonPhrase as getErrorForCode,\n} from 'http-status-codes';\n\nimport joi from 'joi';\n\n/**\n * @static\n * @const CODES\n * @desc An alias for\n * [StatusCodes object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and corresponding numeric codes.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { CODES } = server.errors;\n * console.log(CODES.BAD_REQUEST); // Prints: 400\n */\nexport { CODES };\n\n/**\n * @static\n * @const ERRORS\n * @desc An alias for\n * [ReasonPhrases object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and their pretty-printed forms.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { ERRORS } = server.errors;\n * console.log(ERRORS.BAD_REQUEST); // Prints: Bad Request\n */\nexport { ERRORS };\n\n/**\n * @static\n * @func getErrorForCode\n * @desc An alias for\n * [getReasonPhrase() function from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * Given an HTTP code it returns the corresponding error text.\n * @param {number} code HTTP code.\n * @return {string} HTTP error text.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request\n */\nexport { getErrorForCode };\n\n/**\n * @static\n * @const joi\n * @desc An alias for [Joi library](https://joi.dev/api/?v=17.4.0),\n * which provides tooling for HTTP request validation. You can use it in any\n * way you would use that library import.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { joi } = server.errors;\n * const requestBodySchema = joi.object({\n * sampleKey: joi.string().max(16).required(),\n * });\n */\nexport { joi };\n\n// TODO: It could accept the status code as a constructor argument.\nclass ErrorWithStatus extends Error {\n status: number = CODES.INTERNAL_SERVER_ERROR;\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { newError } = server.errors;\n * ```\n * Creates a new `Error` object with given message, and HTTP status code\n * attached as `status` field.\n * @param {string} message Error message.\n * @param {number} [statusCode=500] HTTP status code. Defaults to 500 (Internal\n * Server Error).\n * @return {Error}\n */\nexport function newError(\n message: string,\n statusCode = CODES.INTERNAL_SERVER_ERROR,\n): ErrorWithStatus {\n const error = new ErrorWithStatus(message);\n error.status = statusCode;\n return error;\n}\n\n/**\n * Throws an error with given message and HTTP status code.\n */\nexport function fail(\n message: string,\n statusCode: CODES = CODES.INTERNAL_SERVER_ERROR,\n): Error {\n throw newError(message, statusCode);\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { assert } = server.errors;\n * ```\n * Validates a value using given Joi schema, and throws an error with given\n * message and HTTP status code in case of the validation failure.\n * @param value\n * @param schema\n * @param [message] Error message.\n * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad\n * Request).\n */\nexport function assert(\n value: unknown,\n schema: joi.AnySchema,\n message = '',\n statusCode = CODES.BAD_REQUEST,\n): void {\n const { error } = schema.validate(value, { abortEarly: false });\n if (error) {\n fail(message.concat(message ? '\\n' : '', error.message), statusCode);\n }\n}\n"],"mappings":"8oBAWA,IAAAA,gBAAA,CAAAC,OAAA,sBAMA,IAAAC,IAAA,CAAAC,sBAAA,CAAAF,OAAA,SAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA,KAAM,CAAAG,eAAe,QAAS,CAAAC,KAAM,CAClCC,MAAM,CAAWC,4BAAK,CAACC,qBACzB,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAC,QAAQA,CACtBC,OAAe,CACfC,UAAU,CAAGJ,4BAAK,CAACC,qBAAqB,CACvB,CACjB,KAAM,CAAAI,KAAK,CAAG,GAAI,CAAAR,eAAe,CAACM,OAAO,CAAC,CAC1CE,KAAK,CAACN,MAAM,CAAGK,UAAU,CACzB,MAAO,CAAAC,KACT,CAEA;AACA;AACA,GACO,QAAS,CAAAC,IAAIA,CAClBH,OAAe,CACfC,UAAiB,CAAGJ,4BAAK,CAACC,qBAAqB,CACxC,CACP,KAAM,CAAAC,QAAQ,CAACC,OAAO,CAAEC,UAAU,CACpC,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAG,MAAMA,CACpBC,KAAc,CACdC,MAAqB,CACrBN,OAAO,CAAG,EAAE,CACZC,UAAU,CAAGJ,4BAAK,CAACU,WAAW,CACxB,CACN,KAAM,CAAEL,KAAM,CAAC,CAAGI,MAAM,CAACE,QAAQ,CAACH,KAAK,CAAE,CAAEI,UAAU,CAAE,KAAM,CAAC,CAAC,CAC/D,GAAIP,KAAK,CAAE,CACTC,IAAI,CAACH,OAAO,CAACU,MAAM,CAACV,OAAO,CAAG,IAAI,CAAG,EAAE,CAAEE,KAAK,CAACF,OAAO,CAAC,CAAEC,UAAU,CACrE,CACF","ignoreList":[]}
1
+ {"version":3,"file":"errors.js","names":["_httpStatusCodes","require","ErrorWithStatus","Error","status","CODES","INTERNAL_SERVER_ERROR","newError","message","statusCode","error","fail","assert","value","schema","BAD_REQUEST","result","validate","Promise","issues","JSON","stringify"],"sources":["../../../../src/server/utils/errors.ts"],"sourcesContent":["/**\n * @category Utilities\n * @module server/errors\n * @desc\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { errors } = server;\n * ```\n * Server-side helpers for error handling.\n */\n\nimport {\n StatusCodes as CODES,\n ReasonPhrases as ERRORS,\n getReasonPhrase as getErrorForCode,\n} from 'http-status-codes';\n\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\n\n/**\n * @static\n * @const CODES\n * @desc An alias for\n * [StatusCodes object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and corresponding numeric codes.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { CODES } = server.errors;\n * console.log(CODES.BAD_REQUEST); // Prints: 400\n */\nexport { CODES };\n\n/**\n * @static\n * @const ERRORS\n * @desc An alias for\n * [ReasonPhrases object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and their pretty-printed forms.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { ERRORS } = server.errors;\n * console.log(ERRORS.BAD_REQUEST); // Prints: Bad Request\n */\nexport { ERRORS };\n\n/**\n * @static\n * @func getErrorForCode\n * @desc An alias for\n * [getReasonPhrase() function from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * Given an HTTP code it returns the corresponding error text.\n * @param {number} code HTTP code.\n * @return {string} HTTP error text.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request\n */\nexport { getErrorForCode };\n\n// TODO: It could accept the status code as a constructor argument.\nclass ErrorWithStatus extends Error {\n status: number = CODES.INTERNAL_SERVER_ERROR;\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { newError } = server.errors;\n * ```\n * Creates a new `Error` object with given message, and HTTP status code\n * attached as `status` field.\n * @param {string} message Error message.\n * @param {number} [statusCode=500] HTTP status code. Defaults to 500 (Internal\n * Server Error).\n * @return {Error}\n */\nexport function newError(\n message: string,\n statusCode = CODES.INTERNAL_SERVER_ERROR,\n): ErrorWithStatus {\n const error = new ErrorWithStatus(message);\n error.status = statusCode;\n return error;\n}\n\n/**\n * Throws an error with given message and HTTP status code.\n */\nexport function fail(\n message: string,\n statusCode: CODES = CODES.INTERNAL_SERVER_ERROR,\n): Error {\n throw newError(message, statusCode);\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { assert } = server.errors;\n * ```\n * Validates a value using given Joi schema, and throws an error with given\n * message and HTTP status code in case of the validation failure.\n * @param value\n * @param schema\n * @param [message] Error message.\n * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad\n * Request).\n */\nexport async function assert<T extends StandardSchemaV1>(\n value: StandardSchemaV1.InferInput<T>,\n schema: T,\n message = '',\n statusCode = CODES.BAD_REQUEST,\n): Promise<StandardSchemaV1.InferOutput<T>> {\n let result = schema['~standard'].validate(value);\n if (result instanceof Promise) result = await result;\n\n if (result.issues) {\n let error = JSON.stringify(result.issues, null, 2);\n if (message) error = `${message}\\n\\n${error}`;\n throw fail(error, statusCode);\n }\n\n return result.value;\n}\n"],"mappings":"geAWA,IAAAA,gBAAA,CAAAC,OAAA,sBAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA,KAAM,CAAAC,eAAe,QAAS,CAAAC,KAAM,CAClCC,MAAM,CAAWC,4BAAK,CAACC,qBACzB,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAC,QAAQA,CACtBC,OAAe,CACfC,UAAU,CAAGJ,4BAAK,CAACC,qBAAqB,CACvB,CACjB,KAAM,CAAAI,KAAK,CAAG,GAAI,CAAAR,eAAe,CAACM,OAAO,CAAC,CAC1CE,KAAK,CAACN,MAAM,CAAGK,UAAU,CACzB,MAAO,CAAAC,KACT,CAEA;AACA;AACA,GACO,QAAS,CAAAC,IAAIA,CAClBH,OAAe,CACfC,UAAiB,CAAGJ,4BAAK,CAACC,qBAAqB,CACxC,CACP,KAAM,CAAAC,QAAQ,CAACC,OAAO,CAAEC,UAAU,CACpC,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,cAAe,CAAAG,MAAMA,CAC1BC,KAAqC,CACrCC,MAAS,CACTN,OAAO,CAAG,EAAE,CACZC,UAAU,CAAGJ,4BAAK,CAACU,WAAW,CACY,CAC1C,GAAI,CAAAC,MAAM,CAAGF,MAAM,CAAC,WAAW,CAAC,CAACG,QAAQ,CAACJ,KAAK,CAAC,CAChD,GAAIG,MAAM,WAAY,CAAAE,OAAO,CAAEF,MAAM,CAAG,KAAM,CAAAA,MAAM,CAEpD,GAAIA,MAAM,CAACG,MAAM,CAAE,CACjB,GAAI,CAAAT,KAAK,CAAGU,IAAI,CAACC,SAAS,CAACL,MAAM,CAACG,MAAM,CAAE,IAAI,CAAE,CAAC,CAAC,CAClD,GAAIX,OAAO,CAAEE,KAAK,CAAG,GAAGF,OAAO,OAAOE,KAAK,EAAE,CAC7C,KAAM,CAAAC,IAAI,CAACD,KAAK,CAAED,UAAU,CAC9B,CAEA,MAAO,CAAAO,MAAM,CAACH,KAChB","ignoreList":[]}
@@ -5,10 +5,14 @@
5
5
  * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)
6
6
  * @param [props...] Any other properties are passed to the underlying
7
7
  * `<input>` element.
8
- */const Input=({label,ref,testId,theme,...rest})=>{const localRef=(0,_react.useRef)(null);let containerClassName=theme.container;if(!rest.value&&theme.empty)containerClassName+=` ${theme.empty}`;return/*#__PURE__*/(0,_jsxRuntime.jsxs)("span",{className:containerClassName,onFocus:()=>{// TODO: It does not really work if a callback-style `ref` is passed in,
8
+ */const Input=({label,ref,testId,theme,...rest})=>{// NOTE: As of now, it is only updated when "theme.focused" is defined,
9
+ // as otherwise its value is not used.
10
+ const[focused,setFocused]=(0,_react.useState)(false);const localRef=(0,_react.useRef)(null);let containerClassName=theme.container;// NOTE: As of now, "focused" can be true only when "theme.focused"
11
+ // is provided.
12
+ if(focused/* && theme.focused */)containerClassName+=` ${theme.focused}`;if(!rest.value&&theme.empty)containerClassName+=` ${theme.empty}`;return/*#__PURE__*/(0,_jsxRuntime.jsxs)("span",{className:containerClassName,onFocus:()=>{// TODO: It does not really work if a callback-style `ref` is passed in,
9
13
  // we need a more complex logic to cover that case, but for now this serves
10
14
  // the case we need it for.
11
15
  if(typeof ref==="object")ref?.current?.focus();else localRef.current?.focus()},children:[label===undefined?null:/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{className:theme.label,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsx)("input",{className:theme.input,"data-testid":process.env.NODE_ENV==="production"?undefined:testId,ref:ref??localRef// TODO: Avoid the spreading later.
12
16
  // eslint-disable-next-line react/jsx-props-no-spreading
13
- ,...rest})]})};var _default=exports.default=(0,_reactThemes.default)(Input,"Input",defaultTheme);
17
+ ,...rest,onBlur:theme.focused?e=>{setFocused(false);rest.onBlur?.(e)}:rest.onBlur,onFocus:theme.focused?e=>{setFocused(true);rest.onFocus?.(e)}:rest.onFocus})]})};var _default=exports.default=(0,_reactThemes.default)(Input,"Input",defaultTheme);
14
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_react","require","_reactThemes","_interopRequireDefault","_jsxRuntime","defaultTheme","Input","label","ref","testId","theme","rest","localRef","useRef","containerClassName","container","value","empty","jsxs","className","onFocus","current","focus","children","undefined","jsx","input","process","env","NODE_ENV","_default","exports","default","themed"],"sources":["../../../../../src/shared/components/Input/index.tsx"],"sourcesContent":["import { type FunctionComponent, type Ref, useRef } from 'react';\n\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\n\ntype ThemeKeyT = 'container' | 'empty' | 'input' | 'label';\n\ntype PropsT = React.InputHTMLAttributes<HTMLInputElement> & {\n label?: React.ReactNode;\n ref?: Ref<HTMLInputElement>;\n testId?: string;\n theme: Theme<ThemeKeyT>;\n};\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input: FunctionComponent<PropsT> = ({\n label,\n ref,\n testId,\n theme,\n ...rest\n}) => {\n const localRef = useRef<HTMLInputElement>(null);\n\n let containerClassName = theme.container;\n if (!rest.value && theme.empty) containerClassName += ` ${theme.empty}`;\n\n return (\n <span\n className={containerClassName}\n onFocus={() => {\n // TODO: It does not really work if a callback-style `ref` is passed in,\n // we need a more complex logic to cover that case, but for now this serves\n // the case we need it for.\n if (typeof ref === 'object') ref?.current?.focus();\n else localRef.current?.focus();\n }}\n >\n {label === undefined ? null : <div className={theme.label}>{label}</div>}\n <input\n className={theme.input}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n ref={ref ?? localRef}\n\n // TODO: Avoid the spreading later.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n />\n </span>\n );\n};\n\nexport default themed(Input, 'Input', defaultTheme);\n"],"mappings":"gLAAA,IAAAA,MAAA,CAAAC,OAAA,UAEA,IAAAC,YAAA,CAAAC,sBAAA,CAAAF,OAAA,8BAA8D,IAAAG,WAAA,CAAAH,OAAA,4BAAAI,YAAA,2GAa9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAC,KAAgC,CAAGA,CAAC,CACxCC,KAAK,CACLC,GAAG,CACHC,MAAM,CACNC,KAAK,CACL,GAAGC,IACL,CAAC,GAAK,CACJ,KAAM,CAAAC,QAAQ,CAAG,GAAAC,aAAM,EAAmB,IAAI,CAAC,CAE/C,GAAI,CAAAC,kBAAkB,CAAGJ,KAAK,CAACK,SAAS,CACxC,GAAI,CAACJ,IAAI,CAACK,KAAK,EAAIN,KAAK,CAACO,KAAK,CAAEH,kBAAkB,EAAI,IAAIJ,KAAK,CAACO,KAAK,EAAE,CAEvE,mBACE,GAAAb,WAAA,CAAAc,IAAA,UACEC,SAAS,CAAEL,kBAAmB,CAC9BM,OAAO,CAAEA,CAAA,GAAM,CACb;AACA;AACA;AACA,GAAI,MAAO,CAAAZ,GAAG,GAAK,QAAQ,CAAEA,GAAG,EAAEa,OAAO,EAAEC,KAAK,CAAC,CAAC,CAAC,IAC9C,CAAAV,QAAQ,CAACS,OAAO,EAAEC,KAAK,CAAC,CAC/B,CAAE,CAAAC,QAAA,EAEDhB,KAAK,GAAKiB,SAAS,CAAG,IAAI,cAAG,GAAApB,WAAA,CAAAqB,GAAA,SAAKN,SAAS,CAAET,KAAK,CAACH,KAAM,CAAAgB,QAAA,CAAEhB,KAAK,CAAM,CAAC,cACxE,GAAAH,WAAA,CAAAqB,GAAA,WACEN,SAAS,CAAET,KAAK,CAACgB,KAAM,CACvB,cAAaC,OAAO,CAACC,GAAG,CAACC,QAAQ,GAAK,YAAY,CAAGL,SAAS,CAAGf,MAAO,CACxED,GAAG,CAAEA,GAAG,EAAII,QAEZ;AACA;AAAA,IACID,IAAI,CACT,CAAC,EACE,CAEV,CAAC,CAAC,IAAAmB,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEa,GAAAC,oBAAM,EAAC3B,KAAK,CAAE,OAAO,CAAED,YAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_react","require","_reactThemes","_interopRequireDefault","_jsxRuntime","defaultTheme","Input","label","ref","testId","theme","rest","focused","setFocused","useState","localRef","useRef","containerClassName","container","value","empty","jsxs","className","onFocus","current","focus","children","undefined","jsx","input","process","env","NODE_ENV","onBlur","e","_default","exports","default","themed"],"sources":["../../../../../src/shared/components/Input/index.tsx"],"sourcesContent":["import {\n type FunctionComponent,\n type Ref,\n useRef,\n useState,\n} from 'react';\n\nimport themed, { type Theme } from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\n\ntype ThemeKeyT = 'container' | 'empty' | 'focused' | 'input' | 'label';\n\ntype PropsT = React.InputHTMLAttributes<HTMLInputElement> & {\n label?: React.ReactNode;\n ref?: Ref<HTMLInputElement>;\n testId?: string;\n theme: Theme<ThemeKeyT>;\n};\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input: FunctionComponent<PropsT> = ({\n label,\n ref,\n testId,\n theme,\n ...rest\n}) => {\n // NOTE: As of now, it is only updated when \"theme.focused\" is defined,\n // as otherwise its value is not used.\n const [focused, setFocused] = useState(false);\n\n const localRef = useRef<HTMLInputElement>(null);\n\n let containerClassName = theme.container;\n\n // NOTE: As of now, \"focused\" can be true only when \"theme.focused\"\n // is provided.\n if (focused /* && theme.focused */) containerClassName += ` ${theme.focused}`;\n\n if (!rest.value && theme.empty) containerClassName += ` ${theme.empty}`;\n\n return (\n <span\n className={containerClassName}\n onFocus={() => {\n // TODO: It does not really work if a callback-style `ref` is passed in,\n // we need a more complex logic to cover that case, but for now this serves\n // the case we need it for.\n if (typeof ref === 'object') ref?.current?.focus();\n else localRef.current?.focus();\n }}\n >\n {label === undefined ? null : <div className={theme.label}>{label}</div>}\n <input\n className={theme.input}\n data-testid={process.env.NODE_ENV === 'production' ? undefined : testId}\n ref={ref ?? localRef}\n\n // TODO: Avoid the spreading later.\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest}\n\n onBlur={theme.focused ? (e) => {\n setFocused(false);\n rest.onBlur?.(e);\n } : rest.onBlur}\n onFocus={theme.focused ? (e) => {\n setFocused(true);\n rest.onFocus?.(e);\n } : rest.onFocus}\n />\n </span>\n );\n};\n\nexport default themed(Input, 'Input', defaultTheme);\n"],"mappings":"gLAAA,IAAAA,MAAA,CAAAC,OAAA,UAOA,IAAAC,YAAA,CAAAC,sBAAA,CAAAF,OAAA,8BAA8D,IAAAG,WAAA,CAAAH,OAAA,4BAAAI,YAAA,2GAa9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAC,KAAgC,CAAGA,CAAC,CACxCC,KAAK,CACLC,GAAG,CACHC,MAAM,CACNC,KAAK,CACL,GAAGC,IACL,CAAC,GAAK,CACJ;AACA;AACA,KAAM,CAACC,OAAO,CAAEC,UAAU,CAAC,CAAG,GAAAC,eAAQ,EAAC,KAAK,CAAC,CAE7C,KAAM,CAAAC,QAAQ,CAAG,GAAAC,aAAM,EAAmB,IAAI,CAAC,CAE/C,GAAI,CAAAC,kBAAkB,CAAGP,KAAK,CAACQ,SAAS,CAExC;AACA;AACA,GAAIN,OAAQ,uBAAwBK,kBAAkB,EAAI,IAAIP,KAAK,CAACE,OAAO,EAAE,CAE7E,GAAI,CAACD,IAAI,CAACQ,KAAK,EAAIT,KAAK,CAACU,KAAK,CAAEH,kBAAkB,EAAI,IAAIP,KAAK,CAACU,KAAK,EAAE,CAEvE,mBACE,GAAAhB,WAAA,CAAAiB,IAAA,UACEC,SAAS,CAAEL,kBAAmB,CAC9BM,OAAO,CAAEA,CAAA,GAAM,CACb;AACA;AACA;AACA,GAAI,MAAO,CAAAf,GAAG,GAAK,QAAQ,CAAEA,GAAG,EAAEgB,OAAO,EAAEC,KAAK,CAAC,CAAC,CAAC,IAC9C,CAAAV,QAAQ,CAACS,OAAO,EAAEC,KAAK,CAAC,CAC/B,CAAE,CAAAC,QAAA,EAEDnB,KAAK,GAAKoB,SAAS,CAAG,IAAI,cAAG,GAAAvB,WAAA,CAAAwB,GAAA,SAAKN,SAAS,CAAEZ,KAAK,CAACH,KAAM,CAAAmB,QAAA,CAAEnB,KAAK,CAAM,CAAC,cACxE,GAAAH,WAAA,CAAAwB,GAAA,WACEN,SAAS,CAAEZ,KAAK,CAACmB,KAAM,CACvB,cAAaC,OAAO,CAACC,GAAG,CAACC,QAAQ,GAAK,YAAY,CAAGL,SAAS,CAAGlB,MAAO,CACxED,GAAG,CAAEA,GAAG,EAAIO,QAEZ;AACA;AAAA,IACIJ,IAAI,CAERsB,MAAM,CAAEvB,KAAK,CAACE,OAAO,CAAIsB,CAAC,EAAK,CAC7BrB,UAAU,CAAC,KAAK,CAAC,CACjBF,IAAI,CAACsB,MAAM,GAAGC,CAAC,CACjB,CAAC,CAAGvB,IAAI,CAACsB,MAAO,CAChBV,OAAO,CAAEb,KAAK,CAACE,OAAO,CAAIsB,CAAC,EAAK,CAC9BrB,UAAU,CAAC,IAAI,CAAC,CAChBF,IAAI,CAACY,OAAO,GAAGW,CAAC,CAClB,CAAC,CAAGvB,IAAI,CAACY,OAAQ,CAClB,CAAC,EACE,CAEV,CAAC,CAAC,IAAAY,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEa,GAAAC,oBAAM,EAAChC,KAAK,CAAE,OAAO,CAAED,YAAY,CAAC","ignoreList":[]}
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see web.bundle.js.LICENSE.txt */
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-helmet"),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-router")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-helmet","@dr.pogodin/react-themes","cookie","dayjs","node-forge/lib/aes","node-forge/lib/forge","qs","react","react-dom","react-dom/client","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-helmet"),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-router")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-helmet"],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-router"])}("undefined"!=typeof self?self:this,function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__264__,__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__707__){return function(){"use strict";var __webpack_modules__={48:function(e,t,r){r.d(t,{B:function(){return n},p:function(){return o}});const n="object"!=typeof process||!process.versions?.node||!!r.g.REACT_UTILS_FORCE_CLIENT_SIDE,o=!n},126:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__126__},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 req=eval("require"),{resolve:resolve}=req("path"),path=basePath?resolve(basePath,modulePath):modulePath,module=req(path);if(!("default"in module)||!module.default)return module;const{default:def,...named}=module,res=def;return Object.entries(named).forEach(([e,t])=>{const r=res[e];if(r)res[e]=t;else if(r!==t)throw Error("Conflict between default and named exports")}),res}catch{return null}}function resolveWeak(e){return e}},155:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__155__},185:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__185__},208:function(e,t){var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function o(e,t,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:o,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=o,t.jsxs=o},236:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__236__},264:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__264__},360:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__360__},462:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__462__},514:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__514__},540:function(e,t,r){let n;function o(){if(void 0===n)throw Error('"Build Info" has not been initialized yet');return n}r.d(t,{F:function(){return o}}),"undefined"!=typeof BUILD_INFO&&(n=BUILD_INFO)},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?null:document.querySelector('meta[itemprop="drpruinj"]');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}},707:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__707__},724:function(e,t,r){r.r(t),r.d(t,{IS_CLIENT_SIDE:function(){return o.B},IS_SERVER_SIDE:function(){return o.p},buildTimestamp:function(){return i},getBuildInfo:function(){return n.F},isDevBuild:function(){return a},isProdBuild:function(){return _}});var n=r(540),o=r(48);function a(){return!1}function _(){return!0}function i(){return(0,n.F)().timestamp}},814:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__814__},859:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__859__},864:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__864__},922:function(e,t,r){e.exports=r(208)},958:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__958__},969:function(e,t,r){r.d(t,{A:function(){return c}});var n=r(236),o=r(264),a=r(707),_=r(126),i=r(668),s=r(922);function c(e,t={}){const r=document.getElementById("react-view");if(!r)throw Error("Failed to find container for React app");const c=(0,s.jsx)(_.GlobalStateProvider,{initialState:(0,i.A)().ISTATE??t.initialState,children:(0,s.jsx)(a.BrowserRouter,{children:(0,s.jsx)(o.HelmetProvider,{children:(0,s.jsx)(e,{})})})});t.dontHydrate?(0,n.createRoot)(r).render(c):(0,n.hydrateRoot)(r,c)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.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 r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__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},Cached:function(){return js_utils_.Cached},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 react_helmet_.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},assertEmptyObject:function(){return js_utils_.assertEmptyObject},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_react_=__webpack_require__(155),external_dayjs_=__webpack_require__(185),external_dayjs_default=__webpack_require__.n(external_dayjs_),js_utils_=__webpack_require__(864),react_global_state_=__webpack_require__(126);const{getSsrContext:getSsrContext}=(0,react_global_state_.withGlobalStateType)();function useCurrent({autorefresh:e=!1,globalStatePath:t="currentTime",precision:r=5*js_utils_.SEC_MS}={}){const[n,o]=(0,react_global_state_.useGlobalState)(t,Date.now);return(0,external_react_.useEffect)(()=>{let t;const n=()=>{o(e=>{const t=Date.now();return Math.abs(t-e)>r?t:e}),e&&(t=setTimeout(n,r))};return n(),()=>{t&&clearTimeout(t)}},[e,r,o]),n}function useTimezoneOffset({cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}={}){const r=getSsrContext(!1),[n,o]=(0,react_global_state_.useGlobalState)(t,()=>{const t=e&&r?.req.cookies[e];return t?parseInt(t):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]),n}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,r){let n;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)),n=new js_utils_.Barrier,e.addEventListener("load",()=>{if(!n)throw Error("Internal error");n.resolve()}),e.addEventListener("error",()=>{if(!n)throw Error("Internal error");n.resolve()})}if(r){const e=refCounts[o]??0;refCounts[o]=1+e}return n}function getLoadedStyleSheets(){const e=new Set,{styleSheets:t}=document;for(const{href:r}of t)r&&e.add(r);return e}function assertChunkName(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}async function bookStyleSheets(e,t,r){const n=[],o=t[e];if(!o)return Promise.resolve();const a=getLoadedStyleSheets();for(const e of o)if(e.endsWith(".css")){const t=bookStyleSheet(e,a,r);t&&n.push(t)}return n.length?Promise.allSettled(n).then():Promise.resolve()}function freeStyleSheets(e,t){const r=t[e];if(r)for(const e of r)if(e.endsWith(".css")){const t=`${getPublicPath()}/${e}`,r=refCounts[t];r&&(r<=1?(document.head.querySelector(`link[href="${t}"]`).remove(),delete refCounts[t]):refCounts[t]=r-1)}}const usedChunkNames=new Set;function splitComponent({chunkName:e,getComponent:t,placeholder:r}){if(isomorphy.IS_CLIENT_SIDE&&assertChunkName(e,clientChunkGroups),usedChunkNames.has(e))throw Error(`Repeated splitComponent() call for the chunk "${e}"`);usedChunkNames.add(e);const n=(0,external_react_.lazy)(async()=>{const r=await t(),n="default"in r?r.default:r;return isomorphy.IS_CLIENT_SIDE&&await bookStyleSheets(e,clientChunkGroups,!1),{default:({children:t,ref:r,...o})=>{if(isomorphy.IS_SERVER_SIDE){const{chunkGroups:t,chunks:r}=getSsrContext();assertChunkName(e,t),r.includes(e)||r.push(e)}return(0,external_react_.useInsertionEffect)(()=>(bookStyleSheets(e,clientChunkGroups,!0),()=>{freeStyleSheets(e,clientChunkGroups)}),[]),(0,jsx_runtime.jsx)(n,{...o,ref:r,children:t})}}});return({children:e,...t})=>(0,jsx_runtime.jsx)(external_react_.Suspense,{fallback:r,children:(0,jsx_runtime.jsx)(n,{...t,children:e})})}const themed=react_themes_default();themed.COMPOSE=react_themes_.COMPOSE,themed.PRIORITY=react_themes_.PRIORITY;var react_helmet_=__webpack_require__(264);function isValue(e){const t=typeof e;return"number"===t||"string"===t}function optionValueName(e){return isValue(e)?[e,e]:[e.value,e.name??e.value]}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=({cancelOnScrolling:e,children:t,containerStyle:r,dontDisableScrolling:n,onCancel:o,overlayStyle:a,style:_,testId:i,testIdForOverlay:s,theme:c})=>{const l=(0,external_react_.useRef)(null),u=(0,external_react_.useRef)(null),[d,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)(()=>(e&&o&&(window.addEventListener("scroll",o),window.addEventListener("wheel",o)),()=>{e&&o&&(window.removeEventListener("scroll",o),window.removeEventListener("wheel",o))}),[e,o]),(0,external_react_.useEffect)(()=>(n||document.body.classList.add(styles.scrollingDisabledByModal),()=>{n||document.body.classList.remove(styles.scrollingDisabledByModal)}),[n]);const m=(0,external_react_.useMemo)(()=>(0,jsx_runtime.jsx)("div",{onFocus:()=>{const e=l.current.querySelectorAll("*");for(let t=e.length-1;t>=0;--t)if(e[t].focus(),document.activeElement===e[t])return;u.current?.focus()},tabIndex:0}),[]);return d?external_react_dom_default().createPortal((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[m,(0,jsx_runtime.jsx)("div",{"aria-label":"Cancel",className:c.overlay,"data-testid":void 0,onClick:e=>{o&&(o(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&o&&(o(),e.stopPropagation())},ref:e=>{e&&e!==u.current&&(u.current=e,e.focus())},role:"button",style:a,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:l,role:"dialog",style:_??r,children:t}),(0,jsx_runtime.jsx)("div",{onFocus:()=>{u.current?.focus()},tabIndex:0}),m]}),d):null};var Modal=react_themes_default()(BaseModal,"Modal",base_theme),style={overlay:"jKsMKG"};function areEqual(e,t){return e?.left===t?.left&&e?.top===t?.top&&e?.width===t?.width}const Options=({containerClass:e,containerStyle:t,filter:r,onCancel:n,onChange:o,optionClass:a,options:_,ref:i})=>{const s=(0,external_react_.useRef)(null);(0,external_react_.useImperativeHandle)(i,()=>({measure:()=>{const e=s.current?.parentElement;if(!e)return;const t=s.current.getBoundingClientRect(),r=window.getComputedStyle(e),n=parseFloat(r.marginBottom),o=parseFloat(r.marginTop);return t.height+=n+o,t}}),[]);const c=[];for(const e of _)if(!r||r(e)){const[t,r]=optionValueName(e);c.push((0,jsx_runtime.jsx)("div",{className:a,onClick:e=>{o(t),e.stopPropagation()},onKeyDown:e=>{"Enter"===e.key&&(o(t),e.stopPropagation())},role:"button",tabIndex:0,children:r},t))}return(0,jsx_runtime.jsx)(BaseModal,{cancelOnScrolling:!0,dontDisableScrolling:!0,onCancel:n,style:t,theme:{ad:"",container:e,context:"",hoc:"",overlay:style.overlay},children:(0,jsx_runtime.jsx)("div",{ref:s,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=({filter:e,label:t,onChange:r,options:n,theme:o,value:a})=>{const[_,i]=(0,external_react_.useState)(!1),s=(0,external_react_.useRef)(null),c=(0,external_react_.useRef)(null),[l,u]=(0,external_react_.useState)(),[d,p]=(0,external_react_.useState)(!1);(0,external_react_.useEffect)(()=>{if(!_)return;let e;const t=()=>{const r=s.current?.getBoundingClientRect(),n=c.current?.measure();if(r&&n){const e=r.bottom+n.height<(window.visualViewport?.height??0),t=r.top-n.height>0,o=!e&&t;p(o);const a=o?{left:r.left,top:r.top-n.height-1,width:r.width}:{left:r.left,top:r.bottom,width:r.width};u(e=>areEqual(e,a)?e:a)}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}},[_]);const m=e=>{const t=window.visualViewport,r=s.current.getBoundingClientRect();i(!0),u({left:t?.width??0,top:t?.height??0,width:r.width}),e.stopPropagation()};let f=(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"‌"});for(const t of n)if(!e||e(t)){const[e,r]=optionValueName(t);if(e===a){f=r;break}}let h=o.container;_&&(h+=` ${o.active}`);let b=o.select??"";return d&&(h+=` ${o.upward}`,b+=` ${o.upward}`),(0,jsx_runtime.jsxs)("div",{className:h,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:o.label,children:t}),(0,jsx_runtime.jsxs)("div",{className:o.dropdown,onClick:m,onKeyDown:e=>{"Enter"===e.key&&m(e)},ref:s,role:"listbox",tabIndex:0,children:[f,(0,jsx_runtime.jsx)("div",{className:o.arrow})]}),_?(0,jsx_runtime.jsx)(CustomDropdown_Options,{containerClass:b,containerStyle:l,onCancel:()=>{i(!1)},onChange:e=>{i(!1),r&&r(e)},optionClass:o.option??"",options:n,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=({filter:e,label:t,onChange:r,options:n,testId:o,theme:a,value:_})=>{let i=!1;const s=[];for(const t of n)if(!e||e(t)){const[e,r]=optionValueName(t);i||=e===_,s.push((0,jsx_runtime.jsx)("option",{className:a.option,value:e,children:r},e))}const c=i?null:(0,jsx_runtime.jsx)("option",{className:a.hiddenOption,disabled:!0,value:_,children:_},"__reactUtilsHiddenOption");let l=a.select;return i||(l+=` ${a.invalid}`),(0,jsx_runtime.jsxs)("div",{className:a.container,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:a.label,children:t}),(0,jsx_runtime.jsxs)("div",{className:a.dropdown,children:[(0,jsx_runtime.jsxs)("select",{className:l,"data-testid":void 0,onChange:r,value:_,children:[c,s]}),(0,jsx_runtime.jsx)("div",{className:a.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=({label:e,onChange:t,options:r,theme:n,value:o})=>{if(!r||!n.option)throw Error("Internal error");const a=[];for(const e of r){const[r,_]=optionValueName(e);let i,s=n.option;r===o?s+=` ${n.selected}`:t&&(i=()=>{t(r)}),a.push(i?(0,jsx_runtime.jsx)("div",{className:s,onClick:i,onKeyDown:e=>{"Enter"===e.key&&i()},role:"button",tabIndex:0,children:_},r):(0,jsx_runtime.jsx)("div",{className:s,children:_},r))}return(0,jsx_runtime.jsxs)("div",{className:n.container,children:[e?(0,jsx_runtime.jsx)("div",{className:n.label,children:e}):null,(0,jsx_runtime.jsx)("div",{className:n.options,children:a})]})};var Switch=react_themes_default()(BaseSwitch,"Switch",Switch_theme),external_react_router_=__webpack_require__(707),GenericLink_style={link:"zH52sA"};const GenericLink=({children:e,className:t,disabled:r,enforceA:n,keepScrollPosition:o,onClick:a,onMouseDown:_,openNewTab:i,replace:s,routerLinkType:c,to:l,...u})=>{if(r||n||i||l.match(/^(#|(https?|mailto):)/))return(0,jsx_runtime.jsx)("a",{className:(t?t+" ":"")+"zH52sA",href:l,onClick:r?e=>{e.preventDefault()}:a,onMouseDown:r?e=>{e.preventDefault()}:_,rel:"noopener noreferrer",target:i?"_blank":"",children:e});const d=c;return(0,jsx_runtime.jsx)(d,{className:t,discover:"none",onClick:e=>{a&&a(e),o||window.scroll(0,0)},onMouseDown:_,replace:s,to:l,...u,children:e})};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=({active:e,children:t,disabled:r,enforceA:n,onClick:o,onKeyDown:a,onKeyUp:_,onMouseDown:i,onMouseUp:s,onPointerDown:c,onPointerUp:l,openNewTab:u,replace:d,testId:p,theme:m,to:f})=>{let h=m.button;if(e&&m.active&&(h+=` ${m.active}`),r)return m.disabled&&(h+=` ${m.disabled}`),(0,jsx_runtime.jsx)("div",{className:h,"data-testid":void 0,children:t});let b=a;return!b&&o&&(b=e=>{"Enter"===e.key&&o(e)}),f?(0,jsx_runtime.jsx)(components_Link,{className:h,"data-testid":void 0,enforceA:n,onClick:o,onKeyUp:_,onMouseDown:i,onMouseUp:s,onPointerDown:c,onPointerUp:l,openNewTab:u,replace:d,to:f,children:t}):(0,jsx_runtime.jsx)("div",{className:h,"data-testid":void 0,onClick:o,onKeyDown:b,onKeyUp:_,onMouseDown:i,onMouseUp:s,onPointerDown:c,onPointerUp:l,role:"button",tabIndex:0,children:t})};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=({checked:e,disabled:t,label:r,onChange:n,testId:o,theme:a})=>{let _=a.container;t&&(_+=` ${a.disabled}`);let i=a.checkbox;return"indeterminate"===e&&(i+=` ${a.indeterminate}`),(0,jsx_runtime.jsxs)("div",{className:_,children:[void 0===r?null:(0,jsx_runtime.jsx)("div",{className:a.label,children:r}),(0,jsx_runtime.jsx)("input",{checked:void 0===e?void 0:!0===e,className:i,"data-testid":void 0,disabled:t,onChange:n,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=({label:e,ref:t,testId:r,theme:n,...o})=>{const a=(0,external_react_.useRef)(null);let _=n.container;return!o.value&&n.empty&&(_+=` ${n.empty}`),(0,jsx_runtime.jsxs)("span",{className:_,onFocus:()=>{"object"==typeof t?t?.current?.focus():a.current?.focus()},children:[void 0===e?null:(0,jsx_runtime.jsx)("div",{className:n.label,children:e}),(0,jsx_runtime.jsx)("input",{className:n.input,"data-testid":void 0,ref:t??a,...o})]})};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=({children:e,leftSidePanelContent:t,rightSidePanelContent:r,theme:n})=>(0,jsx_runtime.jsxs)("div",{className:n.container,children:[(0,jsx_runtime.jsx)("div",{className:[n.sidePanel,n.leftSidePanel].join(" "),children:t}),(0,jsx_runtime.jsx)("div",{className:n.mainPanel,children:e}),(0,jsx_runtime.jsx)("div",{className:[n.sidePanel,n.rightSidePanel].join(" "),children:r})]});var components_PageLayout=react_themes_default()(PageLayout,"PageLayout",PageLayout_base_theme);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=({theme:e})=>(0,jsx_runtime.jsxs)("span",{className:e.container,children:[(0,jsx_runtime.jsx)("span",{className:e.circle}),(0,jsx_runtime.jsx)("span",{className:e.circle}),(0,jsx_runtime.jsx)("span",{className:e.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 r=document.createElement("div");e.content&&r.setAttribute("class",e.content);const n=document.createElement("div");return e.container&&n.setAttribute("class",e.container),n.appendChild(t),n.appendChild(r),document.body.appendChild(n),{arrow:t,container:n,content:r}}function calcTooltipRects(e){return{arrow:e.arrow.getBoundingClientRect(),container:e.container.getBoundingClientRect()}}function calcViewportRect(){const{scrollX:e,scrollY:t}=window,{documentElement:{clientHeight:r,clientWidth:n}}=document;return{bottom:t+r,left:e,right:e+n,top:t}}function calcPositionAboveXY(e,t,r){const{arrow:n,container:o}=r;return{arrowX:.5*(o.width-n.width),arrowY:o.height,containerX:e-o.width/2,containerY:t-o.height-n.height/1.5,baseArrowStyle:ARROW_STYLE_DOWN}}function setComponentPositions(e,t,r,n,o){const a=calcTooltipRects(o),_=calcViewportRect(),i=calcPositionAboveXY(e,t,a);if(i.containerX<_.left+6)i.containerX=_.left+6,i.arrowX=Math.max(6,e-i.containerX-a.arrow.width/2);else{const t=_.right-6-a.container.width;i.containerX>t&&(i.containerX=t,i.arrowX=Math.min(a.container.width-6,e-i.containerX-a.arrow.width/2))}i.containerY<_.top+6&&(i.containerY+=a.container.height+2*a.arrow.height,i.arrowY-=a.container.height+a.arrow.height,i.baseArrowStyle=ARROW_STYLE_UP);const s=`left:${i.containerX}px;top:${i.containerY}px`;o.container.setAttribute("style",s);const c=`${i.baseArrowStyle};left:${i.arrowX}px;top:${i.arrowY}px`;o.arrow.setAttribute("style",c)}const Tooltip=({children:e,ref:t,theme:r})=>{const{current:n}=(0,external_react_.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[o,a]=(0,external_react_.useState)(null),_=(e,t,r,a)=>{n.lastElement=a,n.lastPageX=e,n.lastPageY=t,n.lastPlacement=r,o&&setComponentPositions(e,t,r,a,o)};return(0,external_react_.useImperativeHandle)(t,()=>({pointTo:_})),(0,external_react_.useEffect)(()=>{const e=createTooltipComponents(r);return a(e),()=>{document.body.removeChild(e.container),a(null)}},[r]),(0,external_react_.useEffect)(()=>{o&&setComponentPositions(n.lastPageX,n.lastPageY,n.lastPlacement,n.lastElement,o)},[o,n.lastPageX,n.lastPageY,n.lastPlacement,n.lastElement]),o?(0,external_react_dom_.createPortal)(e,o.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=({children:e,placement:t=PLACEMENTS.ABOVE_CURSOR,tip:r,theme:n})=>{const{current:o}=(0,external_react_.useRef)({lastCursorX:0,lastCursorY:0,timerId:void 0,triggeredByTouch:!1}),a=(0,external_react_.useRef)(null),_=(0,external_react_.useRef)(null),[i,s]=(0,external_react_.useState)(!1);return(0,external_react_.useEffect)(()=>{if(i&&null!==r){a.current&&a.current.pointTo(o.lastCursorX+window.scrollX,o.lastCursorY+window.scrollY,t,_.current);const e=()=>{s(!1)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}},[o.lastCursorX,o.lastCursorY,t,i,r]),(0,jsx_runtime.jsxs)("div",{className:n.wrapper,onClick:()=>{o.timerId&&(clearTimeout(o.timerId),o.timerId=void 0,o.triggeredByTouch=!1)},onMouseLeave:()=>{s(!1)},onMouseMove:e=>{((e,r)=>{if(i){const n=_.current.getBoundingClientRect();e<n.left||e>n.right||r<n.top||r>n.bottom?s(!1):a.current&&a.current.pointTo(e+window.scrollX,r+window.scrollY,t,_.current)}else o.lastCursorX=e,o.lastCursorY=r,o.triggeredByTouch?o.timerId??=setTimeout(()=>{o.triggeredByTouch=!1,o.timerId=void 0,s(!0)},300):s(!0)})(e.clientX,e.clientY)},onTouchStart:()=>{o.triggeredByTouch=!0},ref:_,role:"presentation",children:[i&&null!==r?(0,jsx_runtime.jsx)(WithTooltip_Tooltip,{ref:a,theme:n,children:r}):null,e]})},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=({autoplay:e,src:t,theme:r,title:n})=>{const o=t.split("?");let[a]=o;const[,_]=o,i=_?external_qs_default().parse(_):{},s=i.v??a?.match(/\/([a-zA-Z0-9-_]*)$/)?.[1];return a=`https://www.youtube.com/embed/${s}`,delete i.v,i.autoplay=e?"1":"0",a+=`?${external_qs_default().stringify(i)}`,(0,jsx_runtime.jsxs)("div",{className:r.container,children:[(0,jsx_runtime.jsx)(components_Throbber,{theme:throbber}),(0,jsx_runtime.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:r.video,src:a,title:n})]})};var components_YouTubeVideo=react_themes_default()(YouTubeVideo,"YouTubeVideo",base),TextArea_style={container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",label:"Vw9EKL",textarea:"zd-OFg",hidden:"GiHBXI"};const TextArea=({disabled:e,label:t,onBlur:r,onChange:n,onKeyDown:o,placeholder:a,testId:_,theme:i,value:s})=>{const c=(0,external_react_.useRef)(null),[l,u]=(0,external_react_.useState)(),d=(0,external_react_.useRef)(null),[p,m]=(0,external_react_.useState)(s??"");return void 0!==s&&p!==s&&m(s),(0,external_react_.useEffect)(()=>{const e=c.current;if(!e)return;const t=new ResizeObserver(()=>{u(e.scrollHeight)});return t.observe(e),()=>{t.disconnect()}},[]),(0,external_react_.useLayoutEffect)(()=>{const e=c.current;e&&u(e.scrollHeight)},[p]),(0,jsx_runtime.jsxs)("div",{className:i.container,onFocus:()=>{d.current?.focus()},children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:t}),(0,jsx_runtime.jsx)("textarea",{className:`${i.textarea} ${i.hidden}`,readOnly:!0,ref:c,tabIndex:-1,value:p||" "}),(0,jsx_runtime.jsx)("textarea",{className:i.textarea,"data-testid":void 0,disabled:e,onBlur:r,onChange:void 0===s?e=>{m(e.target.value)}:n,onKeyDown:o,placeholder:a,ref:d,style:{height:l},value:p})]})};var components_TextArea=react_themes_default()(TextArea,"TextArea",TextArea_style),src_dirname="/";if(__webpack_require__.g.REACT_UTILS_LIBRARY_LOADED)throw Error("React utils library is already loaded");__webpack_require__.g.REACT_UTILS_LIBRARY_LOADED=!0;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-helmet"),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-router")):"function"==typeof define&&define.amd?define(["@dr.pogodin/js-utils","@dr.pogodin/react-global-state","@dr.pogodin/react-helmet","@dr.pogodin/react-themes","cookie","dayjs","node-forge/lib/aes","node-forge/lib/forge","qs","react","react-dom","react-dom/client","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-helmet"),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-router")):e["@dr.pogodin/react-utils"]=t(e["@dr.pogodin/js-utils"],e["@dr.pogodin/react-global-state"],e["@dr.pogodin/react-helmet"],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-router"])}("undefined"!=typeof self?self:this,function(__WEBPACK_EXTERNAL_MODULE__864__,__WEBPACK_EXTERNAL_MODULE__126__,__WEBPACK_EXTERNAL_MODULE__264__,__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__707__){return function(){"use strict";var __webpack_modules__={48:function(e,t,n){n.d(t,{B:function(){return r},p:function(){return o}});const r="object"!=typeof process||!process.versions?.node||!!n.g.REACT_UTILS_FORCE_CLIENT_SIDE,o=!r},126:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__126__},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 req=eval("require"),{resolve:resolve}=req("path"),path=basePath?resolve(basePath,modulePath):modulePath,module=req(path);if(!("default"in module)||!module.default)return module;const{default:def,...named}=module,res=def;return Object.entries(named).forEach(([e,t])=>{const n=res[e];if(n)res[e]=t;else if(n!==t)throw Error("Conflict between default and named exports")}),res}catch{return null}}function resolveWeak(e){return e}},155:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__155__},185:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__185__},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},236:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__236__},264:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__264__},360:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__360__},462:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__462__},514:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__514__},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)},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?null:document.querySelector('meta[itemprop="drpruinj"]');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}},707:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__707__},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 i},getBuildInfo:function(){return r.F},isDevBuild:function(){return a},isProdBuild:function(){return _}});var r=n(540),o=n(48);function a(){return!1}function _(){return!0}function i(){return(0,r.F)().timestamp}},814:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__814__},859:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__859__},864:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__864__},922:function(e,t,n){e.exports=n(208)},958:function(e){e.exports=__WEBPACK_EXTERNAL_MODULE__958__},969:function(e,t,n){n.d(t,{A:function(){return c}});var r=n(236),o=n(264),a=n(707),_=n(126),i=n(668),s=n(922);function c(e,t={}){const n=document.getElementById("react-view");if(!n)throw Error("Failed to find container for React app");const c=(0,s.jsx)(_.GlobalStateProvider,{initialState:(0,i.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(c):(0,r.hydrateRoot)(n,c)}}},__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},Cached:function(){return js_utils_.Cached},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 react_helmet_.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},assertEmptyObject:function(){return js_utils_.assertEmptyObject},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_react_=__webpack_require__(155),external_dayjs_=__webpack_require__(185),external_dayjs_default=__webpack_require__.n(external_dayjs_),js_utils_=__webpack_require__(864),react_global_state_=__webpack_require__(126);const{getSsrContext:getSsrContext}=(0,react_global_state_.withGlobalStateType)();function useCurrent({autorefresh:e=!1,globalStatePath:t="currentTime",precision:n=5*js_utils_.SEC_MS}={}){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({cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}={}){const n=getSsrContext(!1),[r,o]=(0,react_global_state_.useGlobalState)(t,()=>{const t=e&&n?.req.cookies[e];return t?parseInt(t):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",()=>{if(!r)throw Error("Internal error");r.resolve()}),e.addEventListener("error",()=>{if(!r)throw Error("Internal 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(const{href:n}of t)n&&e.add(n);return e}function assertChunkName(e,t){if(!t[e])throw Error(`Unknown chunk name "${e}"`)}async function bookStyleSheets(e,t,n){const r=[],o=t[e];if(!o)return Promise.resolve();const a=getLoadedStyleSheets();for(const e of o)if(e.endsWith(".css")){const t=bookStyleSheet(e,a,n);t&&r.push(t)}return r.length?Promise.allSettled(r).then():Promise.resolve()}function freeStyleSheets(e,t){const n=t[e];if(n)for(const e of n)if(e.endsWith(".css")){const t=`${getPublicPath()}/${e}`,n=refCounts[t];n&&(n<=1?(document.head.querySelector(`link[href="${t}"]`).remove(),delete refCounts[t]):refCounts[t]=n-1)}}const usedChunkNames=new Set;function splitComponent({chunkName:e,getComponent:t,placeholder:n}){if(isomorphy.IS_CLIENT_SIDE&&assertChunkName(e,clientChunkGroups),usedChunkNames.has(e))throw Error(`Repeated splitComponent() call for the chunk "${e}"`);usedChunkNames.add(e);const r=(0,external_react_.lazy)(async()=>{const n=await t(),r="default"in n?n.default:n;return isomorphy.IS_CLIENT_SIDE&&await bookStyleSheets(e,clientChunkGroups,!1),{default:({children:t,ref:n,...o})=>{if(isomorphy.IS_SERVER_SIDE){const{chunkGroups:t,chunks:n}=getSsrContext();assertChunkName(e,t),n.includes(e)||n.push(e)}return(0,external_react_.useInsertionEffect)(()=>(bookStyleSheets(e,clientChunkGroups,!0),()=>{freeStyleSheets(e,clientChunkGroups)}),[]),(0,jsx_runtime.jsx)(r,{...o,ref:n,children:t})}}});return({children:e,...t})=>(0,jsx_runtime.jsx)(external_react_.Suspense,{fallback:n,children:(0,jsx_runtime.jsx)(r,{...t,children:e})})}const themed=react_themes_default();themed.COMPOSE=react_themes_.COMPOSE,themed.PRIORITY=react_themes_.PRIORITY;var react_helmet_=__webpack_require__(264);function isValue(e){const t=typeof e;return"number"===t||"string"===t}function optionValueName(e){return isValue(e)?[e,e]:[e.value,e.name??e.value]}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=({cancelOnScrolling:e,children:t,containerStyle:n,dontDisableScrolling:r,onCancel:o,overlayStyle:a,style:_,testId:i,testIdForOverlay:s,theme:c})=>{const l=(0,external_react_.useRef)(null),u=(0,external_react_.useRef)(null),[d,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)(()=>(e&&o&&(window.addEventListener("scroll",o),window.addEventListener("wheel",o)),()=>{e&&o&&(window.removeEventListener("scroll",o),window.removeEventListener("wheel",o))}),[e,o]),(0,external_react_.useEffect)(()=>(r||document.body.classList.add(styles.scrollingDisabledByModal),()=>{r||document.body.classList.remove(styles.scrollingDisabledByModal)}),[r]);const m=(0,external_react_.useMemo)(()=>(0,jsx_runtime.jsx)("div",{onFocus:()=>{const e=l.current.querySelectorAll("*");for(let t=e.length-1;t>=0;--t)if(e[t].focus(),document.activeElement===e[t])return;u.current?.focus()},tabIndex:0}),[]);return d?external_react_dom_default().createPortal((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[m,(0,jsx_runtime.jsx)("div",{"aria-label":"Cancel",className:c.overlay,"data-testid":void 0,onClick:e=>{o&&(o(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&o&&(o(),e.stopPropagation())},ref:e=>{e&&e!==u.current&&(u.current=e,e.focus())},role:"button",style:a,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:l,role:"dialog",style:_??n,children:t}),(0,jsx_runtime.jsx)("div",{onFocus:()=>{u.current?.focus()},tabIndex:0}),m]}),d):null};var Modal=react_themes_default()(BaseModal,"Modal",base_theme),style={overlay:"jKsMKG"};function areEqual(e,t){return e?.left===t?.left&&e?.top===t?.top&&e?.width===t?.width}const Options=({containerClass:e,containerStyle:t,filter:n,onCancel:r,onChange:o,optionClass:a,options:_,ref:i})=>{const s=(0,external_react_.useRef)(null);(0,external_react_.useImperativeHandle)(i,()=>({measure:()=>{const e=s.current?.parentElement;if(!e)return;const t=s.current.getBoundingClientRect(),n=window.getComputedStyle(e),r=parseFloat(n.marginBottom),o=parseFloat(n.marginTop);return t.height+=r+o,t}}),[]);const c=[];for(const e of _)if(!n||n(e)){const[t,n]=optionValueName(e);c.push((0,jsx_runtime.jsx)("div",{className:a,onClick:e=>{o(t),e.stopPropagation()},onKeyDown:e=>{"Enter"===e.key&&(o(t),e.stopPropagation())},role:"button",tabIndex:0,children:n},t))}return(0,jsx_runtime.jsx)(BaseModal,{cancelOnScrolling:!0,dontDisableScrolling:!0,onCancel:r,style:t,theme:{ad:"",container:e,context:"",hoc:"",overlay:style.overlay},children:(0,jsx_runtime.jsx)("div",{ref:s,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=({filter:e,label:t,onChange:n,options:r,theme:o,value:a})=>{const[_,i]=(0,external_react_.useState)(!1),s=(0,external_react_.useRef)(null),c=(0,external_react_.useRef)(null),[l,u]=(0,external_react_.useState)(),[d,p]=(0,external_react_.useState)(!1);(0,external_react_.useEffect)(()=>{if(!_)return;let e;const t=()=>{const n=s.current?.getBoundingClientRect(),r=c.current?.measure();if(n&&r){const e=n.bottom+r.height<(window.visualViewport?.height??0),t=n.top-r.height>0,o=!e&&t;p(o);const a=o?{left:n.left,top:n.top-r.height-1,width:n.width}:{left:n.left,top:n.bottom,width:n.width};u(e=>areEqual(e,a)?e:a)}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}},[_]);const m=e=>{const t=window.visualViewport,n=s.current.getBoundingClientRect();i(!0),u({left:t?.width??0,top:t?.height??0,width:n.width}),e.stopPropagation()};let f=(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"‌"});for(const t of r)if(!e||e(t)){const[e,n]=optionValueName(t);if(e===a){f=n;break}}let h=o.container;_&&(h+=` ${o.active}`);let b=o.select??"";return d&&(h+=` ${o.upward}`,b+=` ${o.upward}`),(0,jsx_runtime.jsxs)("div",{className:h,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:o.label,children:t}),(0,jsx_runtime.jsxs)("div",{className:o.dropdown,onClick:m,onKeyDown:e=>{"Enter"===e.key&&m(e)},ref:s,role:"listbox",tabIndex:0,children:[f,(0,jsx_runtime.jsx)("div",{className:o.arrow})]}),_?(0,jsx_runtime.jsx)(CustomDropdown_Options,{containerClass:b,containerStyle:l,onCancel:()=>{i(!1)},onChange:e=>{i(!1),n&&n(e)},optionClass:o.option??"",options:r,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=({filter:e,label:t,onChange:n,options:r,testId:o,theme:a,value:_})=>{let i=!1;const s=[];for(const t of r)if(!e||e(t)){const[e,n]=optionValueName(t);i||=e===_,s.push((0,jsx_runtime.jsx)("option",{className:a.option,value:e,children:n},e))}const c=i?null:(0,jsx_runtime.jsx)("option",{className:a.hiddenOption,disabled:!0,value:_,children:_},"__reactUtilsHiddenOption");let l=a.select;return i||(l+=` ${a.invalid}`),(0,jsx_runtime.jsxs)("div",{className:a.container,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:a.label,children:t}),(0,jsx_runtime.jsxs)("div",{className:a.dropdown,children:[(0,jsx_runtime.jsxs)("select",{className:l,"data-testid":void 0,onChange:n,value:_,children:[c,s]}),(0,jsx_runtime.jsx)("div",{className:a.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=({label:e,onChange:t,options:n,theme:r,value:o})=>{if(!n||!r.option)throw Error("Internal error");const a=[];for(const e of n){const[n,_]=optionValueName(e);let i,s=r.option;n===o?s+=` ${r.selected}`:t&&(i=()=>{t(n)}),a.push(i?(0,jsx_runtime.jsx)("div",{className:s,onClick:i,onKeyDown:e=>{"Enter"===e.key&&i()},role:"button",tabIndex:0,children:_},n):(0,jsx_runtime.jsx)("div",{className:s,children:_},n))}return(0,jsx_runtime.jsxs)("div",{className:r.container,children:[e?(0,jsx_runtime.jsx)("div",{className:r.label,children:e}):null,(0,jsx_runtime.jsx)("div",{className:r.options,children:a})]})};var Switch=react_themes_default()(BaseSwitch,"Switch",Switch_theme),external_react_router_=__webpack_require__(707),GenericLink_style={link:"zH52sA"};const GenericLink=({children:e,className:t,disabled:n,enforceA:r,keepScrollPosition:o,onClick:a,onMouseDown:_,openNewTab:i,replace:s,routerLinkType:c,to:l,...u})=>{if(n||r||i||l.match(/^(#|(https?|mailto):)/))return(0,jsx_runtime.jsx)("a",{className:(t?t+" ":"")+"zH52sA",href:l,onClick:n?e=>{e.preventDefault()}:a,onMouseDown:n?e=>{e.preventDefault()}:_,rel:"noopener noreferrer",target:i?"_blank":"",children:e});const d=c;return(0,jsx_runtime.jsx)(d,{className:t,discover:"none",onClick:e=>{a&&a(e),o||window.scroll(0,0)},onMouseDown:_,replace:s,to:l,...u,children:e})};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=({active:e,children:t,disabled:n,enforceA:r,onClick:o,onKeyDown:a,onKeyUp:_,onMouseDown:i,onMouseUp:s,onPointerDown:c,onPointerUp:l,openNewTab:u,replace:d,testId:p,theme:m,to:f})=>{let h=m.button;if(e&&m.active&&(h+=` ${m.active}`),n)return m.disabled&&(h+=` ${m.disabled}`),(0,jsx_runtime.jsx)("div",{className:h,"data-testid":void 0,children:t});let b=a;return!b&&o&&(b=e=>{"Enter"===e.key&&o(e)}),f?(0,jsx_runtime.jsx)(components_Link,{className:h,"data-testid":void 0,enforceA:r,onClick:o,onKeyUp:_,onMouseDown:i,onMouseUp:s,onPointerDown:c,onPointerUp:l,openNewTab:u,replace:d,to:f,children:t}):(0,jsx_runtime.jsx)("div",{className:h,"data-testid":void 0,onClick:o,onKeyDown:b,onKeyUp:_,onMouseDown:i,onMouseUp:s,onPointerDown:c,onPointerUp:l,role:"button",tabIndex:0,children:t})};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=({checked:e,disabled:t,label:n,onChange:r,testId:o,theme:a})=>{let _=a.container;t&&(_+=` ${a.disabled}`);let i=a.checkbox;return"indeterminate"===e&&(i+=` ${a.indeterminate}`),(0,jsx_runtime.jsxs)("div",{className:_,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:a.label,children:n}),(0,jsx_runtime.jsx)("input",{checked:void 0===e?void 0:!0===e,className:i,"data-testid":void 0,disabled:t,onChange:r,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=({label:e,ref:t,testId:n,theme:r,...o})=>{const[a,_]=(0,external_react_.useState)(!1),i=(0,external_react_.useRef)(null);let s=r.container;return a&&(s+=` ${r.focused}`),!o.value&&r.empty&&(s+=` ${r.empty}`),(0,jsx_runtime.jsxs)("span",{className:s,onFocus:()=>{"object"==typeof t?t?.current?.focus():i.current?.focus()},children:[void 0===e?null:(0,jsx_runtime.jsx)("div",{className:r.label,children:e}),(0,jsx_runtime.jsx)("input",{className:r.input,"data-testid":void 0,ref:t??i,...o,onBlur:r.focused?e=>{_(!1),o.onBlur?.(e)}:o.onBlur,onFocus:r.focused?e=>{_(!0),o.onFocus?.(e)}:o.onFocus})]})};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=({children:e,leftSidePanelContent:t,rightSidePanelContent:n,theme:r})=>(0,jsx_runtime.jsxs)("div",{className:r.container,children:[(0,jsx_runtime.jsx)("div",{className:[r.sidePanel,r.leftSidePanel].join(" "),children:t}),(0,jsx_runtime.jsx)("div",{className:r.mainPanel,children:e}),(0,jsx_runtime.jsx)("div",{className:[r.sidePanel,r.rightSidePanel].join(" "),children:n})]});var components_PageLayout=react_themes_default()(PageLayout,"PageLayout",PageLayout_base_theme);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=({theme:e})=>(0,jsx_runtime.jsxs)("span",{className:e.container,children:[(0,jsx_runtime.jsx)("span",{className:e.circle}),(0,jsx_runtime.jsx)("span",{className:e.circle}),(0,jsx_runtime.jsx)("span",{className:e.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),{arrow:t,container:r,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{bottom:t+n,left:e,right:e+r,top:t}}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),_=calcViewportRect(),i=calcPositionAboveXY(e,t,a);if(i.containerX<_.left+6)i.containerX=_.left+6,i.arrowX=Math.max(6,e-i.containerX-a.arrow.width/2);else{const t=_.right-6-a.container.width;i.containerX>t&&(i.containerX=t,i.arrowX=Math.min(a.container.width-6,e-i.containerX-a.arrow.width/2))}i.containerY<_.top+6&&(i.containerY+=a.container.height+2*a.arrow.height,i.arrowY-=a.container.height+a.arrow.height,i.baseArrowStyle=ARROW_STYLE_UP);const s=`left:${i.containerX}px;top:${i.containerY}px`;o.container.setAttribute("style",s);const c=`${i.baseArrowStyle};left:${i.arrowX}px;top:${i.arrowY}px`;o.arrow.setAttribute("style",c)}const Tooltip=({children:e,ref:t,theme:n})=>{const{current:r}=(0,external_react_.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[o,a]=(0,external_react_.useState)(null),_=(e,t,n,a)=>{r.lastElement=a,r.lastPageX=e,r.lastPageY=t,r.lastPlacement=n,o&&setComponentPositions(e,t,n,a,o)};return(0,external_react_.useImperativeHandle)(t,()=>({pointTo:_})),(0,external_react_.useEffect)(()=>{const e=createTooltipComponents(n);return a(e),()=>{document.body.removeChild(e.container),a(null)}},[n]),(0,external_react_.useEffect)(()=>{o&&setComponentPositions(r.lastPageX,r.lastPageY,r.lastPlacement,r.lastElement,o)},[o,r.lastPageX,r.lastPageY,r.lastPlacement,r.lastElement]),o?(0,external_react_dom_.createPortal)(e,o.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=({children:e,placement:t=PLACEMENTS.ABOVE_CURSOR,tip:n,theme:r})=>{const{current:o}=(0,external_react_.useRef)({lastCursorX:0,lastCursorY:0,timerId:void 0,triggeredByTouch:!1}),a=(0,external_react_.useRef)(null),_=(0,external_react_.useRef)(null),[i,s]=(0,external_react_.useState)(!1);return(0,external_react_.useEffect)(()=>{if(i&&null!==n){a.current&&a.current.pointTo(o.lastCursorX+window.scrollX,o.lastCursorY+window.scrollY,t,_.current);const e=()=>{s(!1)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}},[o.lastCursorX,o.lastCursorY,t,i,n]),(0,jsx_runtime.jsxs)("div",{className:r.wrapper,onClick:()=>{o.timerId&&(clearTimeout(o.timerId),o.timerId=void 0,o.triggeredByTouch=!1)},onMouseLeave:()=>{s(!1)},onMouseMove:e=>{((e,n)=>{if(i){const r=_.current.getBoundingClientRect();e<r.left||e>r.right||n<r.top||n>r.bottom?s(!1):a.current&&a.current.pointTo(e+window.scrollX,n+window.scrollY,t,_.current)}else o.lastCursorX=e,o.lastCursorY=n,o.triggeredByTouch?o.timerId??=setTimeout(()=>{o.triggeredByTouch=!1,o.timerId=void 0,s(!0)},300):s(!0)})(e.clientX,e.clientY)},onTouchStart:()=>{o.triggeredByTouch=!0},ref:_,role:"presentation",children:[i&&null!==n?(0,jsx_runtime.jsx)(WithTooltip_Tooltip,{ref:a,theme:r,children:n}):null,e]})},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=({autoplay:e,src:t,theme:n,title:r})=>{const o=t.split("?");let[a]=o;const[,_]=o,i=_?external_qs_default().parse(_):{},s=i.v??a?.match(/\/([a-zA-Z0-9-_]*)$/)?.[1];return a=`https://www.youtube.com/embed/${s}`,delete i.v,i.autoplay=e?"1":"0",a+=`?${external_qs_default().stringify(i)}`,(0,jsx_runtime.jsxs)("div",{className:n.container,children:[(0,jsx_runtime.jsx)(components_Throbber,{theme:throbber}),(0,jsx_runtime.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:n.video,src:a,title:r})]})};var components_YouTubeVideo=react_themes_default()(YouTubeVideo,"YouTubeVideo",base),TextArea_style={container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",label:"Vw9EKL",textarea:"zd-OFg",hidden:"GiHBXI"};const TextArea=({disabled:e,label:t,onBlur:n,onChange:r,onKeyDown:o,placeholder:a,testId:_,theme:i,value:s})=>{const c=(0,external_react_.useRef)(null),[l,u]=(0,external_react_.useState)(),d=(0,external_react_.useRef)(null),[p,m]=(0,external_react_.useState)(s??"");return void 0!==s&&p!==s&&m(s),(0,external_react_.useEffect)(()=>{const e=c.current;if(!e)return;const t=new ResizeObserver(()=>{u(e.scrollHeight)});return t.observe(e),()=>{t.disconnect()}},[]),(0,external_react_.useLayoutEffect)(()=>{const e=c.current;e&&u(e.scrollHeight)},[p]),(0,jsx_runtime.jsxs)("div",{className:i.container,onFocus:()=>{d.current?.focus()},children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:t}),(0,jsx_runtime.jsx)("textarea",{className:`${i.textarea} ${i.hidden}`,readOnly:!0,ref:c,tabIndex:-1,value:p||" "}),(0,jsx_runtime.jsx)("textarea",{className:i.textarea,"data-testid":void 0,disabled:e,onBlur:n,onChange:void 0===s?e=>{m(e.target.value)}:r,onKeyDown:o,placeholder:a,ref:d,style:{height:l},value:p})]})};var components_TextArea=react_themes_default()(TextArea,"TextArea",TextArea_style),src_dirname="/";if(__webpack_require__.g.REACT_UTILS_LIBRARY_LOADED)throw Error("React utils library is already loaded");__webpack_require__.g.REACT_UTILS_LIBRARY_LOADED=!0;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