@dr.pogodin/react-utils 1.43.13 → 1.43.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/release.sh +1 -1
- package/build/development/server/renderer.js.map +1 -1
- package/build/development/shared/components/Button/index.js +4 -1
- package/build/development/shared/components/Button/index.js.map +1 -1
- package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
- package/build/development/shared/components/selectors/CustomDropdown/index.js +1 -1
- package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -1
- package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -1
- package/build/development/shared/utils/index.js.map +1 -1
- package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/development/shared/utils/splitComponent.js.map +1 -1
- package/build/development/web.bundle.js +4 -4
- package/build/production/server/renderer.js.map +1 -1
- package/build/production/shared/components/Button/index.js +2 -2
- package/build/production/shared/components/Button/index.js.map +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/index.js +1 -1
- package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -1
- package/build/production/shared/components/selectors/NativeDropdown/index.js.map +1 -1
- package/build/production/shared/utils/index.js.map +1 -1
- package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
- package/build/production/shared/utils/splitComponent.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/server/renderer.d.ts +1 -1
- package/build/types-code/shared/components/Button/index.d.ts +4 -3
- package/build/types-code/shared/utils/index.d.ts +1 -1
- package/config/eslint/default.mjs +20 -30
- package/package.json +14 -14
- package/src/server/renderer.tsx +5 -6
- package/src/shared/components/Button/index.tsx +15 -5
- package/src/shared/components/selectors/CustomDropdown/Options/index.tsx +2 -2
- package/src/shared/components/selectors/CustomDropdown/index.tsx +2 -2
- package/src/shared/components/selectors/NativeDropdown/index.tsx +2 -2
- package/src/shared/utils/index.ts +1 -1
- package/src/shared/utils/jest/E2eSsrEnv.ts +3 -3
- package/src/shared/utils/splitComponent.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2eSsrEnv.js","names":["_path","_interopRequireDefault","require","_lodash","_experimentalWorker","_jestEnvironmentJsdom","_memfs","_webpack","_renderer","_buildInfo","E2eSsrEnv","JsdomEnv","loadWebpackConfig","optionsString","pragmas","options","JSON","parse","defaults","context","testFolder","fs","global","webpackOutputFs","factoryPath","factory","path","resolve","rootDir","default","webpackConfig","buildInfo","existsSync","readFileSync","runWebpack","Error","compiler","webpack","outputFileSystem","Promise","done","fail","run","err","stats","hasErrors","console","error","toJson","errors","webpackStats","runSsr","logger","debug","noop","info","log","warn","cleanup","entry","p","module","exportName","entryExportName","Application","renderer","ssrFactory","status","markup","ssrRequest","cookie","send","set","value","locals","devMiddleware","ssrMarkup","ssrOptions","ssrStatus","constructor","config","docblockPragmas","requestString","request","url","csrfToken","projectConfig","dom","createFsFromVolume","Volume","dirname","testPath","withSsr","root","process","cwd","register","envName","babelEnv","extensions","setup","cache","setBuildInfo","undefined","REACT_UTILS_FORCE_CLIENT_SIDE","teardown","Object","keys","forEach","key","revert","exports"],"sources":["../../../../../src/shared/utils/jest/E2eSsrEnv.ts"],"sourcesContent":["/**\n * Jest environment for end-to-end SSR and client-side testing. It relies on\n * the standard react-utils mechanics to execute SSR of given scene, and also\n * Webpack build of the code for client-side execution, it further exposes\n * Jsdom environment for the client-side testing of the outcomes.\n */\n\n// BEWARE: The module is not imported into the JU module / the main assembly of\n// the library, because doing so easily breaks stuff:\n// 1) This module depends on Node-specific modules, which would make JU\n// incompatible with JsDom if included into JU.\n// 2) If this module is weakly imported from somewhere else in the lib,\n// it seems to randomly break tests using it for a different reason,\n// probably some sort of a require-loop, or some issues with weak\n// require in that scenario.\n\n// TODO: We need to add correct typing for environment options.\n\nimport path from 'path';\n\nimport type { Request, Response } from 'express';\nimport { defaults, noop, set } from 'lodash';\nimport type { ReactNode } from 'react';\n\n// As this environment is a part of the Jest testing utils,\n// we assume development dependencies are available when it is used.\n/* eslint-disable import/no-extraneous-dependencies */\nimport register from '@babel/register/experimental-worker';\n\nimport JsdomEnv from 'jest-environment-jsdom';\nimport { createFsFromVolume, Volume } from 'memfs';\nimport webpack, { type Configuration } from 'webpack';\n/* eslint-enable import/no-extraneous-dependencies */\n\nimport ssrFactory from 'server/renderer';\n\nimport type {\n EnvironmentContext,\n JestEnvironmentConfig,\n} from '@jest/environment';\n\nimport { setBuildInfo } from '../isomorphy/buildInfo';\n\nexport default class E2eSsrEnv extends JsdomEnv {\n pragmas: Record<string, string | string[]>;\n\n ssrRequest: object;\n\n rootDir: string;\n\n testFolder: string;\n\n withSsr: boolean;\n\n webpackStats?: webpack.StatsCompilation;\n\n /**\n * Loads Webpack config, and exposes it to the environment via global\n * webpackConfig object.\n */\n private loadWebpackConfig() {\n const optionsString = this.pragmas['webpack-config-options'] as string;\n\n const options = (optionsString ? JSON.parse(optionsString) : {}) as\n webpack.Configuration;\n\n defaults(options, {\n context: this.testFolder,\n fs: this.global.webpackOutputFs,\n });\n\n const factoryPath = this.pragmas['webpack-config-factory'] as string;\n // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports\n let factory = require(path.resolve(this.rootDir, factoryPath)) as\n (((ops: Configuration) => Configuration) | {\n default: (ops: Configuration) => Configuration;\n });\n factory = 'default' in factory ? factory.default : factory;\n\n this.global.webpackConfig = factory(options);\n\n const fs = this.global.webpackOutputFs;\n let buildInfo = `${options.context}/.build-info`;\n if (fs.existsSync(buildInfo)) {\n buildInfo = fs.readFileSync(buildInfo, 'utf8') as string;\n this.global.buildInfo = JSON.parse(buildInfo);\n }\n }\n\n /**\n * Executes Webpack build.\n * @return {Promise}\n */\n async runWebpack(): Promise<void> {\n this.loadWebpackConfig();\n\n if (!this.global.webpackConfig) throw Error('Failed to load Webpack config');\n const compiler = webpack(this.global.webpackConfig);\n\n // TODO: The \"as typeof compiler.outputFileSystem\" piece below is\n // a workaround for the Webpack regression:\n // https://github.com/webpack/webpack/issues/18242\n compiler.outputFileSystem = this.global.webpackOutputFs as\n typeof compiler.outputFileSystem;\n\n return new Promise<void>((done, fail) => {\n compiler.run((err, stats) => {\n if (err) fail(err);\n if (stats?.hasErrors()) {\n // eslint-disable-next-line no-console\n console.error(stats.toJson().errors);\n fail(Error('Webpack compilation failed'));\n }\n\n this.global.webpackStats = stats?.toJson();\n\n // Keeps reference to the raw Webpack stats object, which should be\n // explicitly passed to the server-side renderer alongside the request,\n // so that it can to pick up asset paths for different named chunks.\n this.webpackStats = stats;\n\n done();\n });\n });\n }\n\n async runSsr(): Promise<void> {\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString\n ? JSON.parse(optionsString) as Record<string, unknown>\n : {};\n\n // TODO: This is temporary to shortcut the logging added to SSR.\n options.logger ??= {\n debug: noop,\n info: noop,\n log: noop,\n warn: noop,\n };\n\n options.buildInfo ??= this.global.buildInfo;\n\n let cleanup: (() => void) | undefined;\n\n if (options.entry) {\n const p = path.resolve(this.testFolder, options.entry as string);\n // TODO: This sure can be replaced by a dynamic import().\n // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports\n const module = require(p) as NodeJS.Module;\n if ('cleanup' in module) cleanup = module.cleanup as () => void;\n\n const exportName = (options.entryExportName as string) || 'default';\n if (exportName in module) {\n options.Application = (\n module as unknown as Record<string, unknown>\n )[exportName] as ReactNode;\n }\n }\n\n const renderer = ssrFactory(this.global.webpackConfig!, options);\n let status = 200; // OK\n const markup = await new Promise<string>((done, fail) => {\n void renderer(\n this.ssrRequest as Request,\n\n // TODO: This will do for now, with the current implementation of\n // the renderer, but it will require a rework once the renderer is\n // updated to do streaming.\n ({\n cookie: noop,\n send: done,\n set: noop,\n status: (value: number) => {\n status = value;\n },\n\n // This is how up-to-date Webpack stats are passed to the server in\n // development mode, and we use this here always, instead of having\n // to pass some information via filesystem.\n locals: {\n webpack: {\n devMiddleware: {\n stats: this.webpackStats,\n },\n },\n },\n } as unknown) as Response,\n\n (error) => {\n // TODO: Strictly speaking, that error as Error casting is not all\n // correct, but it works, so no need to spend time on it right now.\n if (error) fail(error as Error);\n else done('');\n },\n );\n });\n\n this.global.ssrMarkup = markup;\n this.global.ssrOptions = options;\n this.global.ssrStatus = status;\n\n if (cleanup) cleanup();\n }\n\n constructor(\n config: JestEnvironmentConfig,\n context: EnvironmentContext,\n ) {\n const pragmas = context.docblockPragmas;\n\n const requestString = pragmas['ssr-request'] as string;\n const request = requestString\n ? JSON.parse(requestString) as Record<string, unknown>\n : {};\n\n request.url ??= '/';\n request.csrfToken = noop;\n\n // This ensures the initial JsDom URL matches the value we use for SSR.\n set(\n config.projectConfig,\n 'testEnvironmentOptions.url',\n `http://localhost${request.url as string}`,\n );\n\n super(config, context);\n\n this.global.dom = this.dom;\n this.global.webpackOutputFs = createFsFromVolume(new Volume());\n\n // Extracts necessary settings from config and context.\n const { projectConfig } = config;\n this.rootDir = projectConfig.rootDir;\n this.testFolder = path.dirname(context.testPath);\n this.withSsr = !pragmas['no-ssr'];\n this.ssrRequest = request;\n this.pragmas = pragmas;\n\n // The usual \"babel-jest\" transformation setup does not apply to\n // the environment code and imports from it, this workaround enables it.\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString\n ? JSON.parse(optionsString) as Record<string, unknown>\n : {};\n let root;\n switch (options.root) {\n case 'TEST':\n root = this.testFolder;\n break;\n default: root = process.cwd();\n }\n register({\n envName: options.babelEnv as string,\n extensions: ['.js', '.jsx', '.ts', '.tsx', '.svg'],\n root,\n });\n }\n\n async setup(): Promise<void> {\n await super.setup();\n await this.runWebpack();\n\n // NOTE: It is possible that the Webpack run above, and the SSR run below\n // load different versions of the same module (CommonJS, and ES), and it may\n // cause very confusing problems (e.g. see:\n // https://github.com/birdofpreyru/react-utils/issues/413).\n // It seems we can't reset the cache of ES modules, and Jest's module reset\n // does not reset modules loaded in this enviroment module, and also only\n // replacing entire cache object by and empty {} seems to help (in contrast\n // to deleting all entries by their keys, as it is done within .teardown()\n // method below). Thus, for now we do this as a hotfix, and we also reset\n // build info to undefined, because ES module version not beeing reset\n // triggers an error on the subsequent test using the environment.\n // TODO: Look for a cleaner solution.\n require.cache = {};\n setBuildInfo(undefined, true);\n\n if (this.withSsr) await this.runSsr();\n this.global.REACT_UTILS_FORCE_CLIENT_SIDE = true;\n }\n\n async teardown(): Promise<void> {\n delete this.global.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n // Resets module cache and @babel/register. Effectively this ensures that\n // the next time an instance of this environment is set up, all modules are\n // transformed by Babel from scratch, thus taking into account the latest\n // Babel config (which may change between different environment instances,\n // which does not seem to be taken into account by Babel / Node caches\n // automatically).\n Object.keys(require.cache).forEach((key) => {\n delete require.cache[key];\n });\n register.revert();\n await super.teardown();\n }\n}\n"],"mappings":"gLAkBA,IAAAA,KAAA,CAAAC,sBAAA,CAAAC,OAAA,UAGA,IAAAC,OAAA,CAAAD,OAAA,WAMA,IAAAE,mBAAA,CAAAH,sBAAA,CAAAC,OAAA,yCAEA,IAAAG,qBAAA,CAAAJ,sBAAA,CAAAC,OAAA,4BACA,IAAAI,MAAA,CAAAJ,OAAA,UACA,IAAAK,QAAA,CAAAN,sBAAA,CAAAC,OAAA,aAGA,IAAAM,SAAA,CAAAP,sBAAA,CAAAC,OAAA,8BAOA,IAAAO,UAAA,CAAAP,OAAA,2BAzCA;AACA;AACA;AACA;AACA;AACA,GAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AACA;AACA,sDAMA,qDAWe,KAAM,CAAAQ,SAAS,QAAS,CAAAC,6BAAS,CAa9C;AACF;AACA;AACA,KACUC,iBAAiBA,CAAA,CAAG,CAC1B,KAAM,CAAAC,aAAa,CAAG,IAAI,CAACC,OAAO,CAAC,wBAAwB,CAAW,CAEtE,KAAM,CAAAC,OAAO,CAAIF,aAAa,CAAGG,IAAI,CAACC,KAAK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IAAI,CAAGC,OAAO,CAACC,GAAG,CAAC,CAC9B,CACA,GAAAC,2BAAQ,EAAC,CACPC,OAAO,CAAElF,OAAO,CAACmF,QAAkB,CACnCC,UAAU,CAAE,CAAC,KAAK,CAAE,MAAM,CAAE,KAAK,CAAE,MAAM,CAAE,MAAM,CAAC,CAClDN,IACF,CAAC,CACH,CAEA,KAAM,CAAAO,KAAKA,CAAA,CAAkB,CAC3B,KAAM,MAAK,CAACA,KAAK,CAAC,CAAC,CACnB,KAAM,KAAI,CAAClE,UAAU,CAAC,CAAC,CAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAhC,OAAO,CAACmG,KAAK,CAAG,CAAC,CAAC,CAClB,GAAAC,uBAAY,EAACC,SAAS,CAAE,IAAI,CAAC,CAE7B,GAAI,IAAI,CAACX,OAAO,CAAE,KAAM,KAAI,CAACzC,MAAM,CAAC,CAAC,CACrC,IAAI,CAAC7B,MAAM,CAACkF,6BAA6B,CAAG,IAC9C,CAEA,KAAM,CAAAC,QAAQA,CAAA,CAAkB,CAC9B,MAAO,KAAI,CAACnF,MAAM,CAACkF,6BAA6B,CAEhD;AACA;AACA;AACA;AACA;AACA;AACAE,MAAM,CAACC,IAAI,CAACzG,OAAO,CAACmG,KAAK,CAAC,CAACO,OAAO,CAAEC,GAAG,EAAK,CAC1C,MAAO,CAAA3G,OAAO,CAACmG,KAAK,CAACQ,GAAG,CAC1B,CAAC,CAAC,CACFb,2BAAQ,CAACc,MAAM,CAAC,CAAC,CACjB,KAAM,MAAK,CAACL,QAAQ,CAAC,CACvB,CACF,CAACM,OAAA,CAAAlF,OAAA,CAAAnB,SAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"E2eSsrEnv.js","names":["_path","_interopRequireDefault","require","_lodash","_experimentalWorker","_jestEnvironmentJsdom","_memfs","_webpack","_renderer","_buildInfo","E2eSsrEnv","JsdomEnv","loadWebpackConfig","optionsString","pragmas","options","JSON","parse","defaults","context","testFolder","fs","global","webpackOutputFs","factoryPath","factory","path","resolve","rootDir","default","webpackConfig","buildInfo","existsSync","readFileSync","runWebpack","Error","compiler","webpack","outputFileSystem","Promise","done","fail","run","err","stats","hasErrors","console","error","toJson","errors","webpackStats","runSsr","logger","debug","noop","info","log","warn","cleanup","entry","p","module","exportName","entryExportName","Application","renderer","ssrFactory","status","markup","ssrRequest","cookie","send","set","value","locals","devMiddleware","ssrMarkup","ssrOptions","ssrStatus","constructor","config","docblockPragmas","requestString","request","url","csrfToken","projectConfig","dom","createFsFromVolume","Volume","dirname","testPath","withSsr","root","process","cwd","register","envName","babelEnv","extensions","setup","cache","setBuildInfo","undefined","REACT_UTILS_FORCE_CLIENT_SIDE","teardown","Object","keys","forEach","key","revert","exports"],"sources":["../../../../../src/shared/utils/jest/E2eSsrEnv.ts"],"sourcesContent":["/**\n * Jest environment for end-to-end SSR and client-side testing. It relies on\n * the standard react-utils mechanics to execute SSR of given scene, and also\n * Webpack build of the code for client-side execution, it further exposes\n * Jsdom environment for the client-side testing of the outcomes.\n */\n\n// BEWARE: The module is not imported into the JU module / the main assembly of\n// the library, because doing so easily breaks stuff:\n// 1) This module depends on Node-specific modules, which would make JU\n// incompatible with JsDom if included into JU.\n// 2) If this module is weakly imported from somewhere else in the lib,\n// it seems to randomly break tests using it for a different reason,\n// probably some sort of a require-loop, or some issues with weak\n// require in that scenario.\n\n// TODO: We need to add correct typing for environment options.\n\nimport path from 'path';\n\nimport type { Request, Response } from 'express';\nimport { defaults, noop, set } from 'lodash';\nimport type { ReactNode } from 'react';\n\n// As this environment is a part of the Jest testing utils,\n// we assume development dependencies are available when it is used.\n/* eslint-disable import/no-extraneous-dependencies */\nimport register from '@babel/register/experimental-worker';\n\nimport JsdomEnv from 'jest-environment-jsdom';\nimport { Volume, createFsFromVolume } from 'memfs';\nimport webpack, { type Configuration } from 'webpack';\n/* eslint-enable import/no-extraneous-dependencies */\n\nimport type {\n EnvironmentContext,\n JestEnvironmentConfig,\n} from '@jest/environment';\n\nimport ssrFactory from 'server/renderer';\n\nimport { setBuildInfo } from '../isomorphy/buildInfo';\n\nexport default class E2eSsrEnv extends JsdomEnv {\n pragmas: Record<string, string | string[]>;\n\n ssrRequest: object;\n\n rootDir: string;\n\n testFolder: string;\n\n withSsr: boolean;\n\n webpackStats?: webpack.StatsCompilation;\n\n /**\n * Loads Webpack config, and exposes it to the environment via global\n * webpackConfig object.\n */\n private loadWebpackConfig() {\n const optionsString = this.pragmas['webpack-config-options'] as string;\n\n const options = (optionsString ? JSON.parse(optionsString) : {}) as\n webpack.Configuration;\n\n defaults(options, {\n context: this.testFolder,\n fs: this.global.webpackOutputFs,\n });\n\n const factoryPath = this.pragmas['webpack-config-factory'] as string;\n // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports\n let factory = require(path.resolve(this.rootDir, factoryPath)) as\n (((ops: Configuration) => Configuration) | {\n default: (ops: Configuration) => Configuration;\n });\n factory = 'default' in factory ? factory.default : factory;\n\n this.global.webpackConfig = factory(options);\n\n const fs = this.global.webpackOutputFs;\n let buildInfo = `${options.context}/.build-info`;\n if (fs.existsSync(buildInfo)) {\n buildInfo = fs.readFileSync(buildInfo, 'utf8') as string;\n this.global.buildInfo = JSON.parse(buildInfo);\n }\n }\n\n /**\n * Executes Webpack build.\n * @return {Promise}\n */\n async runWebpack(): Promise<void> {\n this.loadWebpackConfig();\n\n if (!this.global.webpackConfig) throw Error('Failed to load Webpack config');\n const compiler = webpack(this.global.webpackConfig);\n\n // TODO: The \"as typeof compiler.outputFileSystem\" piece below is\n // a workaround for the Webpack regression:\n // https://github.com/webpack/webpack/issues/18242\n compiler.outputFileSystem = this.global.webpackOutputFs as\n typeof compiler.outputFileSystem;\n\n return new Promise<void>((done, fail) => {\n compiler.run((err, stats) => {\n if (err) fail(err);\n if (stats?.hasErrors()) {\n // eslint-disable-next-line no-console\n console.error(stats.toJson().errors);\n fail(Error('Webpack compilation failed'));\n }\n\n this.global.webpackStats = stats?.toJson();\n\n // Keeps reference to the raw Webpack stats object, which should be\n // explicitly passed to the server-side renderer alongside the request,\n // so that it can to pick up asset paths for different named chunks.\n this.webpackStats = stats;\n\n done();\n });\n });\n }\n\n async runSsr(): Promise<void> {\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString\n ? JSON.parse(optionsString) as Record<string, unknown>\n : {};\n\n // TODO: This is temporary to shortcut the logging added to SSR.\n options.logger ??= {\n debug: noop,\n info: noop,\n log: noop,\n warn: noop,\n };\n\n options.buildInfo ??= this.global.buildInfo;\n\n let cleanup: (() => void) | undefined;\n\n if (options.entry) {\n const p = path.resolve(this.testFolder, options.entry as string);\n // TODO: This sure can be replaced by a dynamic import().\n // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports\n const module = require(p) as NodeJS.Module;\n if ('cleanup' in module) cleanup = module.cleanup as () => void;\n\n const exportName = (options.entryExportName as string) || 'default';\n if (exportName in module) {\n options.Application = (\n module as unknown as Record<string, unknown>\n )[exportName] as ReactNode;\n }\n }\n\n const renderer = ssrFactory(this.global.webpackConfig!, options);\n let status = 200; // OK\n const markup = await new Promise<string>((done, fail) => {\n void renderer(\n this.ssrRequest as Request,\n\n // TODO: This will do for now, with the current implementation of\n // the renderer, but it will require a rework once the renderer is\n // updated to do streaming.\n ({\n cookie: noop,\n send: done,\n set: noop,\n status: (value: number) => {\n status = value;\n },\n\n // This is how up-to-date Webpack stats are passed to the server in\n // development mode, and we use this here always, instead of having\n // to pass some information via filesystem.\n locals: {\n webpack: {\n devMiddleware: {\n stats: this.webpackStats,\n },\n },\n },\n } as unknown) as Response,\n\n (error) => {\n // TODO: Strictly speaking, that error as Error casting is not all\n // correct, but it works, so no need to spend time on it right now.\n if (error) fail(error as Error);\n else done('');\n },\n );\n });\n\n this.global.ssrMarkup = markup;\n this.global.ssrOptions = options;\n this.global.ssrStatus = status;\n\n if (cleanup) cleanup();\n }\n\n constructor(\n config: JestEnvironmentConfig,\n context: EnvironmentContext,\n ) {\n const pragmas = context.docblockPragmas;\n\n const requestString = pragmas['ssr-request'] as string;\n const request = requestString\n ? JSON.parse(requestString) as Record<string, unknown>\n : {};\n\n request.url ??= '/';\n request.csrfToken = noop;\n\n // This ensures the initial JsDom URL matches the value we use for SSR.\n set(\n config.projectConfig,\n 'testEnvironmentOptions.url',\n `http://localhost${request.url as string}`,\n );\n\n super(config, context);\n\n this.global.dom = this.dom;\n this.global.webpackOutputFs = createFsFromVolume(new Volume());\n\n // Extracts necessary settings from config and context.\n const { projectConfig } = config;\n this.rootDir = projectConfig.rootDir;\n this.testFolder = path.dirname(context.testPath);\n this.withSsr = !pragmas['no-ssr'];\n this.ssrRequest = request;\n this.pragmas = pragmas;\n\n // The usual \"babel-jest\" transformation setup does not apply to\n // the environment code and imports from it, this workaround enables it.\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString\n ? JSON.parse(optionsString) as Record<string, unknown>\n : {};\n let root;\n switch (options.root) {\n case 'TEST':\n root = this.testFolder;\n break;\n default: root = process.cwd();\n }\n register({\n envName: options.babelEnv as string,\n extensions: ['.js', '.jsx', '.ts', '.tsx', '.svg'],\n root,\n });\n }\n\n async setup(): Promise<void> {\n await super.setup();\n await this.runWebpack();\n\n // NOTE: It is possible that the Webpack run above, and the SSR run below\n // load different versions of the same module (CommonJS, and ES), and it may\n // cause very confusing problems (e.g. see:\n // https://github.com/birdofpreyru/react-utils/issues/413).\n // It seems we can't reset the cache of ES modules, and Jest's module reset\n // does not reset modules loaded in this enviroment module, and also only\n // replacing entire cache object by and empty {} seems to help (in contrast\n // to deleting all entries by their keys, as it is done within .teardown()\n // method below). Thus, for now we do this as a hotfix, and we also reset\n // build info to undefined, because ES module version not beeing reset\n // triggers an error on the subsequent test using the environment.\n // TODO: Look for a cleaner solution.\n require.cache = {};\n setBuildInfo(undefined, true);\n\n if (this.withSsr) await this.runSsr();\n this.global.REACT_UTILS_FORCE_CLIENT_SIDE = true;\n }\n\n async teardown(): Promise<void> {\n delete this.global.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n // Resets module cache and @babel/register. Effectively this ensures that\n // the next time an instance of this environment is set up, all modules are\n // transformed by Babel from scratch, thus taking into account the latest\n // Babel config (which may change between different environment instances,\n // which does not seem to be taken into account by Babel / Node caches\n // automatically).\n Object.keys(require.cache).forEach((key) => {\n delete require.cache[key];\n });\n register.revert();\n await super.teardown();\n }\n}\n"],"mappings":"gLAkBA,IAAAA,KAAA,CAAAC,sBAAA,CAAAC,OAAA,UAGA,IAAAC,OAAA,CAAAD,OAAA,WAMA,IAAAE,mBAAA,CAAAH,sBAAA,CAAAC,OAAA,yCAEA,IAAAG,qBAAA,CAAAJ,sBAAA,CAAAC,OAAA,4BACA,IAAAI,MAAA,CAAAJ,OAAA,UACA,IAAAK,QAAA,CAAAN,sBAAA,CAAAC,OAAA,aAQA,IAAAM,SAAA,CAAAP,sBAAA,CAAAC,OAAA,8BAEA,IAAAO,UAAA,CAAAP,OAAA,2BAzCA;AACA;AACA;AACA;AACA;AACA,GAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAQA;AACA;AACA,sDAMA,qDAWe,KAAM,CAAAQ,SAAS,QAAS,CAAAC,6BAAS,CAa9C;AACF;AACA;AACA,KACUC,iBAAiBA,CAAA,CAAG,CAC1B,KAAM,CAAAC,aAAa,CAAG,IAAI,CAACC,OAAO,CAAC,wBAAwB,CAAW,CAEtE,KAAM,CAAAC,OAAO,CAAIF,aAAa,CAAGG,IAAI,CAACC,KAAK,CAACJ,aAAa,CAAC,CAAG,CAAC,CACvC,CAEvB,GAAAK,gBAAQ,EAACH,OAAO,CAAE,CAChBI,OAAO,CAAE,IAAI,CAACC,UAAU,CACxBC,EAAE,CAAE,IAAI,CAACC,MAAM,CAACC,eAClB,CAAC,CAAC,CAEF,KAAM,CAAAC,WAAW,CAAG,IAAI,CAACV,OAAO,CAAC,wBAAwB,CAAW,CACpE;AACA,GAAI,CAAAW,OAAO,CAAGvB,OAAO,CAACwB,aAAI,CA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KAAM,KAAI,CAAClE,UAAU,CAAC,CAAC,CAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAhC,OAAO,CAACmG,KAAK,CAAG,CAAC,CAAC,CAClB,GAAAC,uBAAY,EAACC,SAAS,CAAE,IAAI,CAAC,CAE7B,GAAI,IAAI,CAACX,OAAO,CAAE,KAAM,KAAI,CAACzC,MAAM,CAAC,CAAC,CACrC,IAAI,CAAC7B,MAAM,CAACkF,6BAA6B,CAAG,IAC9C,CAEA,KAAM,CAAAC,QAAQA,CAAA,CAAkB,CAC9B,MAAO,KAAI,CAACnF,MAAM,CAACkF,6BAA6B,CAEhD;AACA;AACA;AACA;AACA;AACA;AACAE,MAAM,CAACC,IAAI,CAACzG,OAAO,CAACmG,KAAK,CAAC,CAACO,OAAO,CAAEC,GAAG,EAAK,CAC1C,MAAO,CAAA3G,OAAO,CAACmG,KAAK,CAACQ,GAAG,CAC1B,CAAC,CAAC,CACFb,2BAAQ,CAACc,MAAM,CAAC,CAAC,CACjB,KAAM,MAAK,CAACL,QAAQ,CAAC,CACvB,CACF,CAACM,OAAA,CAAAlF,OAAA,CAAAnB,SAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splitComponent.js","names":["_react","require","_jsUtils","_globalState","_isomorphy","_jsxRuntime","clientChunkGroups","IS_CLIENT_SIDE","default","CHUNK_GROUPS","refCounts","getPublicPath","getBuildInfo","publicPath","bookStyleSheet","name","loadedSheets","refCount","res","path","fullPath","document","location","origin","has","link","querySelector","createElement","setAttribute","head","appendChild","Barrier","addEventListener","Error","resolve","current","getLoadedStyleSheets","Set","styleSheets","href","add","assertChunkName","chunkName","chunkGroups","bookStyleSheets","promises","assets","Promise","asset","endsWith","promise","push","length","allSettled","then","freeStyleSheets","pathRefCount","remove","usedChunkNames","splitComponent","getComponent","placeholder","LazyComponent","lazy","resolved","Component","Wrapper","children","ref","rest","IS_SERVER_SIDE","chunks","getSsrContext","includes","useInsertionEffect","jsx","CodeSplit","Suspense","fallback"],"sources":["../../../../src/shared/utils/splitComponent.tsx"],"sourcesContent":["/* global document */\n\nimport {\n type ComponentType,\n type FunctionComponent,\n type ReactNode,\n type RefObject,\n lazy,\n Suspense,\n useInsertionEffect,\n} from 'react';\n\nimport { Barrier } from '@dr.pogodin/js-utils';\n\nimport { type ChunkGroupsT, getSsrContext } from './globalState';\n\nimport {\n IS_CLIENT_SIDE,\n IS_SERVER_SIDE,\n getBuildInfo,\n} from './isomorphy';\n\n// Note: At the client side we can get chunk groups immediately when loading\n// the module; at the server-side we only can get them within React render flow.\n// Thus, we set and use the following variable at the client-side, and then when\n// needed on the server side, we'll fetch it differently.\nlet clientChunkGroups: ChunkGroupsT;\n\nif (IS_CLIENT_SIDE) {\n // TODO: Rewrite to avoid these overrides of ESLint rules.\n /* eslint-disable @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-require-imports,\n @typescript-eslint/no-unsafe-call,\n @typescript-eslint/no-unsafe-member-access */\n clientChunkGroups = require('client/getInj').default().CHUNK_GROUPS ?? {};\n /* eslint-enable @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-require-imports,\n @typescript-eslint/no-unsafe-call,\n @typescript-eslint/no-unsafe-member-access */\n}\n\nconst refCounts: Record<string, number> = {};\n\nfunction getPublicPath() {\n return getBuildInfo().publicPath;\n}\n\n/**\n * Client-side only! Ensures the specified CSS stylesheet is loaded into\n * the document; loads if it is missing; and does simple reference counting\n * to facilitate future clean-up.\n * @param name\n * @param loadedSheets\n * @param refCount\n * @return\n */\nfunction bookStyleSheet(\n name: string,\n loadedSheets: Set<string>,\n refCount: boolean,\n): Promise<void> | undefined {\n let res: Barrier<void> | undefined;\n const path = `${getPublicPath()}/${name}`;\n const fullPath = `${document.location.origin}${path}`;\n\n if (!loadedSheets.has(fullPath)) {\n let link = document.querySelector(`link[href=\"${path}\"]`);\n\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', path);\n document.head.appendChild(link);\n }\n\n res = new Barrier<void>();\n link.addEventListener('load', () => {\n if (!res) throw Error('Internal error');\n void res.resolve();\n });\n link.addEventListener('error', () => {\n if (!res) throw Error('Internal error');\n void res.resolve();\n });\n }\n\n if (refCount) {\n const current = refCounts[path] ?? 0;\n refCounts[path] = 1 + current;\n }\n\n return res;\n}\n\n/**\n * Generates the set of URLs for currently loaded, linked stylesheets.\n * @return\n */\nfunction getLoadedStyleSheets(): Set<string> {\n const res = new Set<string>();\n const { styleSheets } = document;\n for (const { href } of styleSheets) {\n if (href) res.add(href);\n }\n return res;\n}\n\nfunction assertChunkName(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n) {\n if (chunkGroups[chunkName]) return;\n throw Error(`Unknown chunk name \"${chunkName}\"`);\n}\n\n/**\n * Client-side only! Ensures all CSS stylesheets required for the specified\n * code chunk are loaded into the document; loads the missing ones; and does\n * simple reference counting to facilitate future clean-up.\n * @param chunkName Chunk name.\n * @param refCount\n * @return Resolves once all pending stylesheets, necessary for\n * the chunk, are either loaded, or failed to load.\n */\nexport async function bookStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n refCount: boolean,\n): Promise<void> {\n const promises = [];\n const assets = chunkGroups[chunkName];\n if (!assets) return Promise.resolve();\n\n const loadedSheets = getLoadedStyleSheets();\n\n for (const asset of assets) {\n if (asset.endsWith('.css')) {\n const promise = bookStyleSheet(asset, loadedSheets, refCount);\n if (promise) promises.push(promise);\n }\n }\n\n return promises.length\n ? Promise.allSettled(promises).then()\n : Promise.resolve();\n}\n\n/**\n * Client-side only! Frees from the document all CSS stylesheets that are\n * required by the specified chunk, and have reference counter equal to one\n * (for chunks with larger reference counter values, it just decrements\n * the reference counter).\n * @param {string} chunkName\n */\nexport function freeStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n): void {\n const assets = chunkGroups[chunkName];\n if (!assets) return;\n\n for (const asset of assets) {\n if (asset.endsWith('.css')) {\n const path = `${getPublicPath()}/${asset}`;\n\n const pathRefCount = refCounts[path];\n if (pathRefCount) {\n if (pathRefCount <= 1) {\n document.head.querySelector(`link[href=\"${path}\"]`)!.remove();\n delete refCounts[path];\n } else refCounts[path] = pathRefCount - 1;\n }\n }\n }\n}\n\n// Holds the set of chunk names already used for splitComponent() calls.\nconst usedChunkNames = new Set();\n\ntype ComponentOrModule<PropsT> = ComponentType<PropsT> | {\n default: ComponentType<PropsT>;\n};\n\n/**\n * Given an async component retrieval function `getComponent()` it creates\n * a special \"code split\" component, which uses <Suspense> to asynchronously\n * load on demand the code required by `getComponent()`.\n * @param options\n * @param options.chunkName\n * @param {function} options.getComponent\n * @param {React.Element} [options.placeholder]\n * @return {React.ElementType}\n */\nexport default function splitComponent<\n ComponentPropsT extends { children?: ReactNode; ref?: RefObject<unknown> },\n>({\n chunkName,\n getComponent,\n placeholder,\n}: {\n chunkName: string;\n getComponent: () => Promise<ComponentOrModule<ComponentPropsT>>;\n placeholder?: ReactNode;\n}): FunctionComponent<ComponentPropsT> {\n // On the client side we can check right away if the chunk name is known.\n if (IS_CLIENT_SIDE) assertChunkName(chunkName, clientChunkGroups);\n\n // The correct usage of splitComponent() assumes a single call per chunk.\n if (usedChunkNames.has(chunkName)) {\n throw Error(`Repeated splitComponent() call for the chunk \"${chunkName}\"`);\n } else usedChunkNames.add(chunkName);\n\n const LazyComponent = lazy(async () => {\n const resolved = await getComponent();\n const Component = 'default' in resolved ? resolved.default : resolved;\n\n // This pre-loads necessary stylesheets prior to the first mount of\n // the component (the lazy load function is executed by React one at\n // the frist mount).\n if (IS_CLIENT_SIDE) {\n await bookStyleSheets(chunkName, clientChunkGroups, false);\n }\n\n const Wrapper: FunctionComponent<ComponentPropsT> = ({\n children,\n ref,\n ...rest\n }) => {\n // On the server side we'll assert the chunk name here,\n // and also push it to the SSR chunks array.\n if (IS_SERVER_SIDE) {\n const { chunkGroups, chunks } = getSsrContext()!;\n assertChunkName(chunkName, chunkGroups);\n if (!chunks.includes(chunkName)) chunks.push(chunkName);\n }\n\n // This takes care about stylesheets management every time an instance of\n // this component is mounted / unmounted.\n useInsertionEffect(() => {\n void bookStyleSheets(chunkName, clientChunkGroups, true);\n return () => {\n freeStyleSheets(chunkName, clientChunkGroups);\n };\n }, []);\n\n return (\n <Component\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...(rest as unknown as ComponentPropsT)}\n ref={ref}\n >\n {children}\n </Component>\n );\n };\n\n return { default: Wrapper };\n });\n\n const CodeSplit: React.FunctionComponent<ComponentPropsT> = ({\n children,\n ...rest\n }: ComponentPropsT) => (\n <Suspense fallback={placeholder}>\n <LazyComponent\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest as Parameters<typeof LazyComponent>[0]}\n >\n {children}\n </LazyComponent>\n </Suspense>\n );\n\n return CodeSplit;\n}\n"],"mappings":"qLAEA,IAAAA,MAAA,CAAAC,OAAA,UAUA,IAAAC,QAAA,CAAAD,OAAA,yBAEA,IAAAE,YAAA,CAAAF,OAAA,kBAEA,IAAAG,UAAA,CAAAH,OAAA,gBAIqB,IAAAI,WAAA,CAAAJ,OAAA,sBApBrB,qBAsBA;AACA;AACA;AACA;AACA,GAAI,CAAAK,iBAA+B,CAEnC,GAAIC,yBAAc,CAAE,CAClB;AACA;AACF;AACA;AACA,iDACED,iBAAiB,CAAGL,OAAO,sBAAgB,CAAC,CAACO,OAAO,CAAC,CAAC,CAACC,YAAY,EAAI,CAAC,CAAC,CACzE;AACF;AACA;AACA,iDACA,CAEA,KAAM,CAAAC,SAAiC,CAAG,CAAC,CAAC,CAE5C,QAAS,CAAAC,aAAaA,CAAA,CAAG,CACvB,MAAO,GAAAC,uBAAY,EAAC,CAAC,CAACC,UACxB,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAAS,CAAAC,cAAcA,CACrBC,IAAY,CACZC,YAAyB,CACzBC,QAAiB,CACU,CAC3B,GAAI,CAAAC,GAA8B,CAClC,KAAM,CA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IO,IAAI,CAAAF,QAAA,CAEPA,QAAQ,CACI,CAAC,CACR,CACX,CAED,MAAO,CAAAS,SACT","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"splitComponent.js","names":["_react","require","_jsUtils","_globalState","_isomorphy","_jsxRuntime","clientChunkGroups","IS_CLIENT_SIDE","default","CHUNK_GROUPS","refCounts","getPublicPath","getBuildInfo","publicPath","bookStyleSheet","name","loadedSheets","refCount","res","path","fullPath","document","location","origin","has","link","querySelector","createElement","setAttribute","head","appendChild","Barrier","addEventListener","Error","resolve","current","getLoadedStyleSheets","Set","styleSheets","href","add","assertChunkName","chunkName","chunkGroups","bookStyleSheets","promises","assets","Promise","asset","endsWith","promise","push","length","allSettled","then","freeStyleSheets","pathRefCount","remove","usedChunkNames","splitComponent","getComponent","placeholder","LazyComponent","lazy","resolved","Component","Wrapper","children","ref","rest","IS_SERVER_SIDE","chunks","getSsrContext","includes","useInsertionEffect","jsx","CodeSplit","Suspense","fallback"],"sources":["../../../../src/shared/utils/splitComponent.tsx"],"sourcesContent":["/* global document */\n\nimport {\n type ComponentType,\n type FunctionComponent,\n type ReactNode,\n type RefObject,\n Suspense,\n lazy,\n useInsertionEffect,\n} from 'react';\n\nimport { Barrier } from '@dr.pogodin/js-utils';\n\nimport { type ChunkGroupsT, getSsrContext } from './globalState';\n\nimport {\n IS_CLIENT_SIDE,\n IS_SERVER_SIDE,\n getBuildInfo,\n} from './isomorphy';\n\n// Note: At the client side we can get chunk groups immediately when loading\n// the module; at the server-side we only can get them within React render flow.\n// Thus, we set and use the following variable at the client-side, and then when\n// needed on the server side, we'll fetch it differently.\nlet clientChunkGroups: ChunkGroupsT;\n\nif (IS_CLIENT_SIDE) {\n // TODO: Rewrite to avoid these overrides of ESLint rules.\n /* eslint-disable @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-require-imports,\n @typescript-eslint/no-unsafe-call,\n @typescript-eslint/no-unsafe-member-access */\n clientChunkGroups = require('client/getInj').default().CHUNK_GROUPS ?? {};\n /* eslint-enable @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-require-imports,\n @typescript-eslint/no-unsafe-call,\n @typescript-eslint/no-unsafe-member-access */\n}\n\nconst refCounts: Record<string, number> = {};\n\nfunction getPublicPath() {\n return getBuildInfo().publicPath;\n}\n\n/**\n * Client-side only! Ensures the specified CSS stylesheet is loaded into\n * the document; loads if it is missing; and does simple reference counting\n * to facilitate future clean-up.\n * @param name\n * @param loadedSheets\n * @param refCount\n * @return\n */\nfunction bookStyleSheet(\n name: string,\n loadedSheets: Set<string>,\n refCount: boolean,\n): Promise<void> | undefined {\n let res: Barrier<void> | undefined;\n const path = `${getPublicPath()}/${name}`;\n const fullPath = `${document.location.origin}${path}`;\n\n if (!loadedSheets.has(fullPath)) {\n let link = document.querySelector(`link[href=\"${path}\"]`);\n\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', path);\n document.head.appendChild(link);\n }\n\n res = new Barrier<void>();\n link.addEventListener('load', () => {\n if (!res) throw Error('Internal error');\n void res.resolve();\n });\n link.addEventListener('error', () => {\n if (!res) throw Error('Internal error');\n void res.resolve();\n });\n }\n\n if (refCount) {\n const current = refCounts[path] ?? 0;\n refCounts[path] = 1 + current;\n }\n\n return res;\n}\n\n/**\n * Generates the set of URLs for currently loaded, linked stylesheets.\n * @return\n */\nfunction getLoadedStyleSheets(): Set<string> {\n const res = new Set<string>();\n const { styleSheets } = document;\n for (const { href } of styleSheets) {\n if (href) res.add(href);\n }\n return res;\n}\n\nfunction assertChunkName(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n) {\n if (chunkGroups[chunkName]) return;\n throw Error(`Unknown chunk name \"${chunkName}\"`);\n}\n\n/**\n * Client-side only! Ensures all CSS stylesheets required for the specified\n * code chunk are loaded into the document; loads the missing ones; and does\n * simple reference counting to facilitate future clean-up.\n * @param chunkName Chunk name.\n * @param refCount\n * @return Resolves once all pending stylesheets, necessary for\n * the chunk, are either loaded, or failed to load.\n */\nexport async function bookStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n refCount: boolean,\n): Promise<void> {\n const promises = [];\n const assets = chunkGroups[chunkName];\n if (!assets) return Promise.resolve();\n\n const loadedSheets = getLoadedStyleSheets();\n\n for (const asset of assets) {\n if (asset.endsWith('.css')) {\n const promise = bookStyleSheet(asset, loadedSheets, refCount);\n if (promise) promises.push(promise);\n }\n }\n\n return promises.length\n ? Promise.allSettled(promises).then()\n : Promise.resolve();\n}\n\n/**\n * Client-side only! Frees from the document all CSS stylesheets that are\n * required by the specified chunk, and have reference counter equal to one\n * (for chunks with larger reference counter values, it just decrements\n * the reference counter).\n * @param {string} chunkName\n */\nexport function freeStyleSheets(\n chunkName: string,\n chunkGroups: ChunkGroupsT,\n): void {\n const assets = chunkGroups[chunkName];\n if (!assets) return;\n\n for (const asset of assets) {\n if (asset.endsWith('.css')) {\n const path = `${getPublicPath()}/${asset}`;\n\n const pathRefCount = refCounts[path];\n if (pathRefCount) {\n if (pathRefCount <= 1) {\n document.head.querySelector(`link[href=\"${path}\"]`)!.remove();\n delete refCounts[path];\n } else refCounts[path] = pathRefCount - 1;\n }\n }\n }\n}\n\n// Holds the set of chunk names already used for splitComponent() calls.\nconst usedChunkNames = new Set();\n\ntype ComponentOrModule<PropsT> = ComponentType<PropsT> | {\n default: ComponentType<PropsT>;\n};\n\n/**\n * Given an async component retrieval function `getComponent()` it creates\n * a special \"code split\" component, which uses <Suspense> to asynchronously\n * load on demand the code required by `getComponent()`.\n * @param options\n * @param options.chunkName\n * @param {function} options.getComponent\n * @param {React.Element} [options.placeholder]\n * @return {React.ElementType}\n */\nexport default function splitComponent<\n ComponentPropsT extends { children?: ReactNode; ref?: RefObject<unknown> },\n>({\n chunkName,\n getComponent,\n placeholder,\n}: {\n chunkName: string;\n getComponent: () => Promise<ComponentOrModule<ComponentPropsT>>;\n placeholder?: ReactNode;\n}): FunctionComponent<ComponentPropsT> {\n // On the client side we can check right away if the chunk name is known.\n if (IS_CLIENT_SIDE) assertChunkName(chunkName, clientChunkGroups);\n\n // The correct usage of splitComponent() assumes a single call per chunk.\n if (usedChunkNames.has(chunkName)) {\n throw Error(`Repeated splitComponent() call for the chunk \"${chunkName}\"`);\n } else usedChunkNames.add(chunkName);\n\n const LazyComponent = lazy(async () => {\n const resolved = await getComponent();\n const Component = 'default' in resolved ? resolved.default : resolved;\n\n // This pre-loads necessary stylesheets prior to the first mount of\n // the component (the lazy load function is executed by React one at\n // the frist mount).\n if (IS_CLIENT_SIDE) {\n await bookStyleSheets(chunkName, clientChunkGroups, false);\n }\n\n const Wrapper: FunctionComponent<ComponentPropsT> = ({\n children,\n ref,\n ...rest\n }) => {\n // On the server side we'll assert the chunk name here,\n // and also push it to the SSR chunks array.\n if (IS_SERVER_SIDE) {\n const { chunkGroups, chunks } = getSsrContext()!;\n assertChunkName(chunkName, chunkGroups);\n if (!chunks.includes(chunkName)) chunks.push(chunkName);\n }\n\n // This takes care about stylesheets management every time an instance of\n // this component is mounted / unmounted.\n useInsertionEffect(() => {\n void bookStyleSheets(chunkName, clientChunkGroups, true);\n return () => {\n freeStyleSheets(chunkName, clientChunkGroups);\n };\n }, []);\n\n return (\n <Component\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...(rest as unknown as ComponentPropsT)}\n ref={ref}\n >\n {children}\n </Component>\n );\n };\n\n return { default: Wrapper };\n });\n\n const CodeSplit: React.FunctionComponent<ComponentPropsT> = ({\n children,\n ...rest\n }: ComponentPropsT) => (\n <Suspense fallback={placeholder}>\n <LazyComponent\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...rest as Parameters<typeof LazyComponent>[0]}\n >\n {children}\n </LazyComponent>\n </Suspense>\n );\n\n return CodeSplit;\n}\n"],"mappings":"qLAEA,IAAAA,MAAA,CAAAC,OAAA,UAUA,IAAAC,QAAA,CAAAD,OAAA,yBAEA,IAAAE,YAAA,CAAAF,OAAA,kBAEA,IAAAG,UAAA,CAAAH,OAAA,g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iBAAiB,CAAE,IAAI,CAAC,CACxD,MAAO,IAAM,CACXiD,eAAe,CAACb,SAAS,CAAEpC,iBAAiB,CAC9C,CACF,CAAC,CAAE,EAAE,CAAC,CAEN,mBACE,GAAAD,WAAA,CAAAsE,GAAA,EAACV,SACC;AAAA,KACKI,IAAI,CACTD,GAAG,CAAEA,GAAI,CAAAD,QAAA,CAERA,QAAQ,CACA,CAEf,CAAC,CAED,MAAO,CAAE3D,OAAO,CAAE0D,OAAQ,CAC5B,CAAC,CAAC,CAEF,KAAM,CAAAU,SAAmD,CAAGA,CAAC,CAC3DT,QAAQ,CACR,GAAGE,IACY,CAAC,gBAChB,GAAAhE,WAAA,CAAAsE,GAAA,EAAC3E,MAAA,CAAA6E,QAAQ,EAACC,QAAQ,CAAEjB,WAAY,CAAAM,QAAA,cAC9B,GAAA9D,WAAA,CAAAsE,GAAA,EAACb,aACC;AAAA,KACIO,IAAI,CAAAF,QAAA,CAEPA,QAAQ,CACI,CAAC,CACR,CACX,CAED,MAAO,CAAAS,SACT","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){var n;r.d(t,{B:function(){return o},p:function(){return a}});const o="object"!=typeof process||!(null!==(n=process.versions)&&void 0!==n&&n.node)||!!r.g.REACT_UTILS_FORCE_CLIENT_SIDE,a=!o},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=>{let[t,r]=e;const n=res[t];if(n)res[t]=r;else if(n!==r)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 _},getBuildInfo:function(){return n.F},isDevBuild:function(){return a},isProdBuild:function(){return i}});var n=r(540),o=r(48);function a(){return!1}function i(){return!0}function _(){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 s}});var n=r(236),o=r(264),a=r(707),i=r(126),_=r(668),l=r(922);function s(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=document.getElementById("react-view");if(!s)throw Error("Failed to find container for React app");const c=(0,l.jsx)(i.GlobalStateProvider,{initialState:null!==(t=(0,_.A)().ISTATE)&&void 0!==t?t:r.initialState,children:(0,l.jsx)(a.BrowserRouter,{children:(0,l.jsx)(o.HelmetProvider,{children:(0,l.jsx)(e,{})})})});r.dontHydrate?(0,n.createRoot)(s).render(c):(0,n.hydrateRoot)(s,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},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},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),_ref;const config=null!==(_ref=environment_check.B?__webpack_require__(668).A().CONFIG:(0,webpack.requireWeak)("config"))&&void 0!==_ref?_ref:{};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(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:r=5*js_utils_.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=getSsrContext(!1),[n,o]=(0,react_global_state_.useGlobalState)(t,(()=>{const t=e&&(null==r?void 0: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;var _require$default$CHUN;isomorphy.IS_CLIENT_SIDE&&(clientChunkGroups=null!==(_require$default$CHUN=__webpack_require__(668).A().CHUNK_GROUPS)&&void 0!==_require$default$CHUN?_require$default$CHUN:{});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){var i;const e=null!==(i=refCounts[o])&&void 0!==i?i: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(e){let{chunkName:t,getComponent:r,placeholder:n}=e;if(isomorphy.IS_CLIENT_SIDE&&assertChunkName(t,clientChunkGroups),usedChunkNames.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);usedChunkNames.add(t);const o=(0,external_react_.lazy)((async()=>{const e=await r(),n="default"in e?e.default:e;return isomorphy.IS_CLIENT_SIDE&&await bookStyleSheets(t,clientChunkGroups,!1),{default:e=>{let{children:r,ref:o,...a}=e;if(isomorphy.IS_SERVER_SIDE){const{chunkGroups:e,chunks:r}=getSsrContext();assertChunkName(t,e),r.includes(t)||r.push(t)}return(0,external_react_.useInsertionEffect)((()=>(bookStyleSheets(t,clientChunkGroups,!0),()=>{freeStyleSheets(t,clientChunkGroups)})),[]),(0,jsx_runtime.jsx)(n,{...a,ref:o,children:r})}}}));return e=>{let{children:t,...r}=e;return(0,jsx_runtime.jsx)(external_react_.Suspense,{fallback:n,children:(0,jsx_runtime.jsx)(o,{...r,children:t})})}}const themed=react_themes_default();themed.COMPOSE=react_themes_.COMPOSE,themed.PRIORITY=react_themes_.PRIORITY;var react_helmet_=__webpack_require__(264),external_react_dom_=__webpack_require__(514),external_react_dom_default=__webpack_require__.n(external_react_dom_),base_theme={overlay:"ye2BZo",context:"Szmbbz",ad:"Ah-Nsc",hoc:"Wki41G",container:"gyZ4rc"},styles={scrollingDisabledByModal:"_5fRFtF"};const BaseModal=e=>{let{cancelOnScrolling:t,children:r,containerStyle:n,dontDisableScrolling:o,onCancel:a,overlayStyle:i,style:_,testId:l,testIdForOverlay:s,theme:c}=e;const u=(0,external_react_.useRef)(null),d=(0,external_react_.useRef)(null),[m,p]=(0,external_react_.useState)();(0,external_react_.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),p(e),()=>{document.body.removeChild(e)}}),[]),(0,external_react_.useEffect)((()=>(t&&a&&(window.addEventListener("scroll",a),window.addEventListener("wheel",a)),()=>{t&&a&&(window.removeEventListener("scroll",a),window.removeEventListener("wheel",a))})),[t,a]),(0,external_react_.useEffect)((()=>(o||document.body.classList.add(styles.scrollingDisabledByModal),()=>{o||document.body.classList.remove(styles.scrollingDisabledByModal)})),[o]);const f=(0,external_react_.useMemo)((()=>(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e;const t=u.current.querySelectorAll("*");for(let e=t.length-1;e>=0;--e)if(t[e].focus(),document.activeElement===t[e])return;null===(e=d.current)||void 0===e||e.focus()},tabIndex:0})),[]);return m?external_react_dom_default().createPortal((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[f,(0,jsx_runtime.jsx)("div",{"aria-label":"Cancel",className:c.overlay,"data-testid":void 0,onClick:e=>{a&&(a(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&a&&(a(),e.stopPropagation())},ref:e=>{e&&e!==d.current&&(d.current=e,e.focus())},role:"button",style:i,tabIndex:0}),(0,jsx_runtime.jsx)("div",{"aria-modal":"true",className:c.container,"data-testid":void 0,onClick:e=>{e.stopPropagation()},onWheel:e=>{e.stopPropagation()},ref:u,role:"dialog",style:null!=_?_:n,children:r}),(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e;null===(e=d.current)||void 0===e||e.focus()},tabIndex:0}),f]}),m):null};var Modal=react_themes_default()(BaseModal,"Modal",base_theme),style={overlay:"jKsMKG"};function isValue(e){const t=typeof e;return"number"===t||"string"===t}function optionValueName(e){var t;return isValue(e)?[e,e]:[e.value,null!==(t=e.name)&&void 0!==t?t:e.value]}function areEqual(e,t){return(null==e?void 0:e.left)===(null==t?void 0:t.left)&&(null==e?void 0:e.top)===(null==t?void 0:t.top)&&(null==e?void 0:e.width)===(null==t?void 0:t.width)}const Options=e=>{let{containerClass:t,containerStyle:r,filter:n,onCancel:o,onChange:a,optionClass:i,options:_,ref:l}=e;const s=(0,external_react_.useRef)(null);(0,external_react_.useImperativeHandle)(l,(()=>({measure:()=>{var e;const t=null===(e=s.current)||void 0===e?void 0:e.parentElement;if(!t)return;const r=s.current.getBoundingClientRect(),n=window.getComputedStyle(t),o=parseFloat(n.marginBottom),a=parseFloat(n.marginTop);return r.height+=o+a,r}})),[]);const c=[];for(const e of _)if(!n||n(e)){const[t,r]=optionValueName(e);c.push((0,jsx_runtime.jsx)("div",{className:i,onClick:e=>{a(t),e.stopPropagation()},onKeyDown:e=>{"Enter"===e.key&&(a(t),e.stopPropagation())},role:"button",tabIndex:0,children:r},t))}return(0,jsx_runtime.jsx)(BaseModal,{cancelOnScrolling:!0,dontDisableScrolling:!0,onCancel:o,style:r,theme:{ad:"",container:t,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=e=>{var t,r;let{filter:n,label:o,onChange:a,options:i,theme:_,value:l}=e;const[s,c]=(0,external_react_.useState)(!1),u=(0,external_react_.useRef)(null),d=(0,external_react_.useRef)(null),[m,p]=(0,external_react_.useState)(),[f,h]=(0,external_react_.useState)(!1);(0,external_react_.useEffect)((()=>{if(!s)return;let e;const t=()=>{var r,n;const o=null===(r=u.current)||void 0===r?void 0:r.getBoundingClientRect(),a=null===(n=d.current)||void 0===n?void 0:n.measure();if(o&&a){var i,_;const e=o.bottom+a.height<(null!==(i=null===(_=window.visualViewport)||void 0===_?void 0:_.height)&&void 0!==i?i:0),t=o.top-a.height>0,r=!e&&t;h(r);const n=r?{left:o.left,top:o.top-a.height-1,width:o.width}:{left:o.left,top:o.bottom,width:o.width};p((e=>areEqual(e,n)?e:n))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[s]);const b=e=>{var t,r;const n=window.visualViewport,o=u.current.getBoundingClientRect();c(!0),p({left:null!==(t=null==n?void 0:n.width)&&void 0!==t?t:0,top:null!==(r=null==n?void 0:n.height)&&void 0!==r?r:0,width:o.width}),e.stopPropagation()};let E=(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:""});for(const e of i)if(!n||n(e)){const[t,r]=optionValueName(e);if(t===l){E=r;break}}let x=_.container;s&&(x+=` ${_.active}`);let v=null!==(t=_.select)&&void 0!==t?t:"";return f&&(x+=` ${_.upward}`,v+=` ${_.upward}`),(0,jsx_runtime.jsxs)("div",{className:x,children:[void 0===o?null:(0,jsx_runtime.jsx)("div",{className:_.label,children:o}),(0,jsx_runtime.jsxs)("div",{className:_.dropdown,onClick:b,onKeyDown:e=>{"Enter"===e.key&&b(e)},ref:u,role:"listbox",tabIndex:0,children:[E,(0,jsx_runtime.jsx)("div",{className:_.arrow})]}),s?(0,jsx_runtime.jsx)(CustomDropdown_Options,{containerClass:v,containerStyle:m,onCancel:()=>{c(!1)},onChange:e=>{c(!1),a&&a(e)},optionClass:null!==(r=_.option)&&void 0!==r?r:"",options:i,ref:d}):null]})};var CustomDropdown=react_themes_default()(BaseCustomDropdown,"CustomDropdown",theme),NativeDropdown_theme={dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",option:"_27pZ6W",hiddenOption:"clAKFJ",select:"N0Fc14",invalid:"wL4umU"};const Dropdown=e=>{let{filter:t,label:r,onChange:n,options:o,testId:a,theme:i,value:_}=e,l=!1;const s=[];for(const e of o)if(!t||t(e)){const[t,r]=optionValueName(e);l||(l=t===_),s.push((0,jsx_runtime.jsx)("option",{className:i.option,value:t,children:r},t))}const c=l?null:(0,jsx_runtime.jsx)("option",{className:i.hiddenOption,disabled:!0,value:_,children:_},"__reactUtilsHiddenOption");let u=i.select;return l||(u+=` ${i.invalid}`),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[void 0===r?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:r}),(0,jsx_runtime.jsxs)("div",{className:i.dropdown,children:[(0,jsx_runtime.jsxs)("select",{className:u,"data-testid":void 0,onChange:n,value:_,children:[c,s]}),(0,jsx_runtime.jsx)("div",{className:i.arrow})]})]})};var NativeDropdown=react_themes_default()(Dropdown,"Dropdown",NativeDropdown_theme),Switch_theme={container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"};const BaseSwitch=e=>{let{label:t,onChange:r,options:n,theme:o,value:a}=e;if(!n||!o.option)throw Error("Internal error");const i=[];for(const e of n){const[t,n]=optionValueName(e);let _,l=o.option;t===a?l+=` ${o.selected}`:r&&(_=()=>{r(t)}),i.push(_?(0,jsx_runtime.jsx)("div",{className:l,onClick:_,onKeyDown:e=>{"Enter"===e.key&&_()},role:"button",tabIndex:0,children:n},t):(0,jsx_runtime.jsx)("div",{className:l,children:n},t))}return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[t?(0,jsx_runtime.jsx)("div",{className:o.label,children:t}):null,(0,jsx_runtime.jsx)("div",{className:o.options,children:i})]})};var Switch=react_themes_default()(BaseSwitch,"Switch",Switch_theme),external_react_router_=__webpack_require__(707),GenericLink_style={link:"zH52sA"};const GenericLink=e=>{let{children:t,className:r,disabled:n,enforceA:o,keepScrollPosition:a,onClick:i,onMouseDown:_,openNewTab:l,replace:s,routerLinkType:c,to:u,...d}=e;if(n||o||l||u.match(/^(#|(https?|mailto):)/))return(0,jsx_runtime.jsx)("a",{className:(r?r+" ":"")+"zH52sA",href:u,onClick:n?e=>{e.preventDefault()}:i,onMouseDown:n?e=>{e.preventDefault()}:_,rel:"noopener noreferrer",target:l?"_blank":"",children:t});const m=c;return(0,jsx_runtime.jsx)(m,{className:r,discover:"none",onClick:e=>{i&&i(e),a||window.scroll(0,0)},onMouseDown:_,replace:s,to:u,...d,children:t})};var components_GenericLink=GenericLink;const Link=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.Link});var components_Link=Link,Button_style={button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"};const BaseButton=e=>{let{active:t,children:r,disabled:n,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:l,replace:s,testId:c,theme:u,to:d}=e,m=u.button;return t&&u.active&&(m+=` ${u.active}`),n?(u.disabled&&(m+=` ${u.disabled}`),(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,children:r})):d?(0,jsx_runtime.jsx)(components_Link,{className:m,"data-testid":void 0,enforceA:o,onClick:a,onMouseDown:i,onPointerDown:_,openNewTab:l,replace:s,to:d,children:r}):(0,jsx_runtime.jsx)("div",{className:m,"data-testid":void 0,onClick:a,onKeyDown:a?e=>{"Enter"===e.key&&a(e)}:void 0,onMouseDown:i,onPointerDown:_,role:"button",tabIndex:0,children:r})};var Button=react_themes_default()(BaseButton,"Button",Button_style),Checkbox_theme={checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",indeterminate:"N9bCb8",container:"Kr0g3M",label:"_3dML-O",disabled:"EzQra1"};const Checkbox=e=>{let{checked:t,disabled:r,label:n,onChange:o,testId:a,theme:i}=e,_=i.container;r&&(_+=` ${i.disabled}`);let l=i.checkbox;return"indeterminate"===t&&(l+=` ${i.indeterminate}`),(0,jsx_runtime.jsxs)("div",{className:_,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:n}),(0,jsx_runtime.jsx)("input",{checked:void 0===t?void 0:!0===t,className:l,"data-testid":void 0,disabled:r,onChange:o,onClick:e=>{e.stopPropagation()},type:"checkbox"})]})};var components_Checkbox=react_themes_default()(Checkbox,"Checkbox",Checkbox_theme),Input_theme={container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"};const Input=e=>{let{label:t,ref:r,testId:n,theme:o,...a}=e;return(0,jsx_runtime.jsxs)("span",{className:o.container,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:o.label,children:t}),(0,jsx_runtime.jsx)("input",{className:o.input,"data-testid":void 0,ref:r,...a})]})};var components_Input=react_themes_default()(Input,"Input",Input_theme),PageLayout_base_theme={container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"};const PageLayout=e=>{let{children:t,leftSidePanelContent:r,rightSidePanelContent:n,theme:o}=e;return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:r}),(0,jsx_runtime.jsx)("div",{className:o.mainPanel,children:t}),(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.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=e=>{let{theme:t}=e;return(0,jsx_runtime.jsxs)("span",{className:t.container,children:[(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle})]})};var components_Throbber=react_themes_default()(Throbber,"Throbber",Throbber_theme);let PLACEMENTS=function(e){return e.ABOVE_CURSOR="ABOVE_CURSOR",e.ABOVE_ELEMENT="ABOVE_ELEMENT",e.BELOW_CURSOR="BELOW_CURSOR",e.BELOW_ELEMENT="BELOW_ELEMENT",e}({});const ARROW_STYLE_DOWN=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),ARROW_STYLE_UP=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function createTooltipComponents(e){const t=document.createElement("div");e.arrow&&t.setAttribute("class",e.arrow);const 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),i=calcViewportRect(),_=calcPositionAboveXY(e,t,a);if(_.containerX<i.left+6)_.containerX=i.left+6,_.arrowX=Math.max(6,e-_.containerX-a.arrow.width/2);else{const t=i.right-6-a.container.width;_.containerX>t&&(_.containerX=t,_.arrowX=Math.min(a.container.width-6,e-_.containerX-a.arrow.width/2))}_.containerY<i.top+6&&(_.containerY+=a.container.height+2*a.arrow.height,_.arrowY-=a.container.height+a.arrow.height,_.baseArrowStyle=ARROW_STYLE_UP);const l=`left:${_.containerX}px;top:${_.containerY}px`;o.container.setAttribute("style",l);const s=`${_.baseArrowStyle};left:${_.arrowX}px;top:${_.arrowY}px`;o.arrow.setAttribute("style",s)}const Tooltip=e=>{let{children:t,ref:r,theme:n}=e;const{current:o}=(0,external_react_.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[a,i]=(0,external_react_.useState)(null),_=(e,t,r,n)=>{o.lastElement=n,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=r,a&&setComponentPositions(e,t,r,n,a)};return(0,external_react_.useImperativeHandle)(r,(()=>({pointTo:_}))),(0,external_react_.useEffect)((()=>{const e=createTooltipComponents(n);return i(e),()=>{document.body.removeChild(e.container),i(null)}}),[n]),(0,external_react_.useEffect)((()=>{a&&setComponentPositions(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,a)}),[a,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),a?(0,external_react_dom_.createPortal)(t,a.content):null};var WithTooltip_Tooltip=Tooltip,default_theme={arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"};const Wrapper=e=>{let{children:t,placement:r=PLACEMENTS.ABOVE_CURSOR,tip:n,theme:o}=e;const{current:a}=(0,external_react_.useRef)({lastCursorX:0,lastCursorY:0,timerId:void 0,triggeredByTouch:!1}),i=(0,external_react_.useRef)(null),_=(0,external_react_.useRef)(null),[l,s]=(0,external_react_.useState)(!1);return(0,external_react_.useEffect)((()=>{if(l&&null!==n){i.current&&i.current.pointTo(a.lastCursorX+window.scrollX,a.lastCursorY+window.scrollY,r,_.current);const e=()=>{s(!1)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}}),[a.lastCursorX,a.lastCursorY,r,l,n]),(0,jsx_runtime.jsxs)("div",{className:o.wrapper,onClick:()=>{a.timerId&&(clearTimeout(a.timerId),a.timerId=void 0,a.triggeredByTouch=!1)},onMouseLeave:()=>{s(!1)},onMouseMove:e=>{((e,t)=>{if(l){const n=_.current.getBoundingClientRect();e<n.left||e>n.right||t<n.top||t>n.bottom?s(!1):i.current&&i.current.pointTo(e+window.scrollX,t+window.scrollY,r,_.current)}else{var n;a.lastCursorX=e,a.lastCursorY=t,a.triggeredByTouch?null!==(n=a.timerId)&&void 0!==n||(a.timerId=setTimeout((()=>{a.triggeredByTouch=!1,a.timerId=void 0,s(!0)}),300)):s(!0)}})(e.clientX,e.clientY)},onTouchStart:()=>{a.triggeredByTouch=!0},ref:_,role:"presentation",children:[l&&null!==n?(0,jsx_runtime.jsx)(WithTooltip_Tooltip,{ref:i,theme:o,children:n}):null,t]})},ThemedWrapper=react_themes_default()(Wrapper,"WithTooltip",default_theme),e=ThemedWrapper;e.PLACEMENTS=PLACEMENTS;var WithTooltip=e,external_qs_=__webpack_require__(360),external_qs_default=__webpack_require__.n(external_qs_),base={container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"},throbber={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"};const YouTubeVideo=e=>{var t,r;let{autoplay:n,src:o,theme:a,title:i}=e;const _=o.split("?");let[l]=_;const[,s]=_,c=s?external_qs_default().parse(s):{};return l=`https://www.youtube.com/embed/${null!==(t=c.v)&&void 0!==t?t:null===(r=l)||void 0===r||null===(r=r.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===r?void 0:r[1]}`,delete c.v,c.autoplay=n?"1":"0",l+=`?${external_qs_default().stringify(c)}`,(0,jsx_runtime.jsxs)("div",{className:a.container,children:[(0,jsx_runtime.jsx)(components_Throbber,{theme:throbber}),(0,jsx_runtime.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:a.video,src:l,title:i})]})};var components_YouTubeVideo=react_themes_default()(YouTubeVideo,"YouTubeVideo",base),TextArea_style={container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"};const TextArea=e=>{let{disabled:t,onBlur:r,onChange:n,onKeyDown:o,placeholder:a,theme:i,value:_}=e;const l=(0,external_react_.useRef)(null),[s,c]=(0,external_react_.useState)(),[u,d]=(0,external_react_.useState)(null!=_?_:"");return void 0!==_&&u!==_&&d(_),(0,external_react_.useEffect)((()=>{const e=l.current;if(!e)return;const t=new ResizeObserver((()=>{c(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,external_react_.useEffect)((()=>{const e=l.current;e&&c(e.scrollHeight)}),[u]),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[(0,jsx_runtime.jsx)("textarea",{className:`${i.textarea} ${i.hidden}`,readOnly:!0,ref:l,value:u}),(0,jsx_runtime.jsx)("textarea",{className:i.textarea,disabled:t,onBlur:r,onChange:void 0===_?e=>{d(e.target.value)}:n,onKeyDown:o,placeholder:a,style:{height:s},value:u})]})};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,r){var n;r.d(t,{B:function(){return o},p:function(){return a}});const o="object"!=typeof process||!(null!==(n=process.versions)&&void 0!==n&&n.node)||!!r.g.REACT_UTILS_FORCE_CLIENT_SIDE,a=!o},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=>{let[t,r]=e;const n=res[t];if(n)res[t]=r;else if(n!==r)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 _},getBuildInfo:function(){return n.F},isDevBuild:function(){return a},isProdBuild:function(){return i}});var n=r(540),o=r(48);function a(){return!1}function i(){return!0}function _(){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 l}});var n=r(236),o=r(264),a=r(707),i=r(126),_=r(668),s=r(922);function l(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const l=document.getElementById("react-view");if(!l)throw Error("Failed to find container for React app");const c=(0,s.jsx)(i.GlobalStateProvider,{initialState:null!==(t=(0,_.A)().ISTATE)&&void 0!==t?t:r.initialState,children:(0,s.jsx)(a.BrowserRouter,{children:(0,s.jsx)(o.HelmetProvider,{children:(0,s.jsx)(e,{})})})});r.dontHydrate?(0,n.createRoot)(l).render(c):(0,n.hydrateRoot)(l,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},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},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),_ref;const config=null!==(_ref=environment_check.B?__webpack_require__(668).A().CONFIG:(0,webpack.requireWeak)("config"))&&void 0!==_ref?_ref:{};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(){let{autorefresh:e=!1,globalStatePath:t="currentTime",precision:r=5*js_utils_.SEC_MS}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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(){let{cookieName:e="timezoneOffset",globalStatePath:t="timezoneOffset"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=getSsrContext(!1),[n,o]=(0,react_global_state_.useGlobalState)(t,(()=>{const t=e&&(null==r?void 0: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;var _require$default$CHUN;isomorphy.IS_CLIENT_SIDE&&(clientChunkGroups=null!==(_require$default$CHUN=__webpack_require__(668).A().CHUNK_GROUPS)&&void 0!==_require$default$CHUN?_require$default$CHUN:{});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){var i;const e=null!==(i=refCounts[o])&&void 0!==i?i: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(e){let{chunkName:t,getComponent:r,placeholder:n}=e;if(isomorphy.IS_CLIENT_SIDE&&assertChunkName(t,clientChunkGroups),usedChunkNames.has(t))throw Error(`Repeated splitComponent() call for the chunk "${t}"`);usedChunkNames.add(t);const o=(0,external_react_.lazy)((async()=>{const e=await r(),n="default"in e?e.default:e;return isomorphy.IS_CLIENT_SIDE&&await bookStyleSheets(t,clientChunkGroups,!1),{default:e=>{let{children:r,ref:o,...a}=e;if(isomorphy.IS_SERVER_SIDE){const{chunkGroups:e,chunks:r}=getSsrContext();assertChunkName(t,e),r.includes(t)||r.push(t)}return(0,external_react_.useInsertionEffect)((()=>(bookStyleSheets(t,clientChunkGroups,!0),()=>{freeStyleSheets(t,clientChunkGroups)})),[]),(0,jsx_runtime.jsx)(n,{...a,ref:o,children:r})}}}));return e=>{let{children:t,...r}=e;return(0,jsx_runtime.jsx)(external_react_.Suspense,{fallback:n,children:(0,jsx_runtime.jsx)(o,{...r,children:t})})}}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){var t;return isValue(e)?[e,e]:[e.value,null!==(t=e.name)&&void 0!==t?t: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=e=>{let{cancelOnScrolling:t,children:r,containerStyle:n,dontDisableScrolling:o,onCancel:a,overlayStyle:i,style:_,testId:s,testIdForOverlay:l,theme:c}=e;const u=(0,external_react_.useRef)(null),d=(0,external_react_.useRef)(null),[m,p]=(0,external_react_.useState)();(0,external_react_.useEffect)((()=>{const e=document.createElement("div");return document.body.appendChild(e),p(e),()=>{document.body.removeChild(e)}}),[]),(0,external_react_.useEffect)((()=>(t&&a&&(window.addEventListener("scroll",a),window.addEventListener("wheel",a)),()=>{t&&a&&(window.removeEventListener("scroll",a),window.removeEventListener("wheel",a))})),[t,a]),(0,external_react_.useEffect)((()=>(o||document.body.classList.add(styles.scrollingDisabledByModal),()=>{o||document.body.classList.remove(styles.scrollingDisabledByModal)})),[o]);const f=(0,external_react_.useMemo)((()=>(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e;const t=u.current.querySelectorAll("*");for(let e=t.length-1;e>=0;--e)if(t[e].focus(),document.activeElement===t[e])return;null===(e=d.current)||void 0===e||e.focus()},tabIndex:0})),[]);return m?external_react_dom_default().createPortal((0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[f,(0,jsx_runtime.jsx)("div",{"aria-label":"Cancel",className:c.overlay,"data-testid":void 0,onClick:e=>{a&&(a(),e.stopPropagation())},onKeyDown:e=>{"Escape"===e.key&&a&&(a(),e.stopPropagation())},ref:e=>{e&&e!==d.current&&(d.current=e,e.focus())},role:"button",style:i,tabIndex:0}),(0,jsx_runtime.jsx)("div",{"aria-modal":"true",className:c.container,"data-testid":void 0,onClick:e=>{e.stopPropagation()},onWheel:e=>{e.stopPropagation()},ref:u,role:"dialog",style:null!=_?_:n,children:r}),(0,jsx_runtime.jsx)("div",{onFocus:()=>{var e;null===(e=d.current)||void 0===e||e.focus()},tabIndex:0}),f]}),m):null};var Modal=react_themes_default()(BaseModal,"Modal",base_theme),style={overlay:"jKsMKG"};function areEqual(e,t){return(null==e?void 0:e.left)===(null==t?void 0:t.left)&&(null==e?void 0:e.top)===(null==t?void 0:t.top)&&(null==e?void 0:e.width)===(null==t?void 0:t.width)}const Options=e=>{let{containerClass:t,containerStyle:r,filter:n,onCancel:o,onChange:a,optionClass:i,options:_,ref:s}=e;const l=(0,external_react_.useRef)(null);(0,external_react_.useImperativeHandle)(s,(()=>({measure:()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.parentElement;if(!t)return;const r=l.current.getBoundingClientRect(),n=window.getComputedStyle(t),o=parseFloat(n.marginBottom),a=parseFloat(n.marginTop);return r.height+=o+a,r}})),[]);const c=[];for(const e of _)if(!n||n(e)){const[t,r]=optionValueName(e);c.push((0,jsx_runtime.jsx)("div",{className:i,onClick:e=>{a(t),e.stopPropagation()},onKeyDown:e=>{"Enter"===e.key&&(a(t),e.stopPropagation())},role:"button",tabIndex:0,children:r},t))}return(0,jsx_runtime.jsx)(BaseModal,{cancelOnScrolling:!0,dontDisableScrolling:!0,onCancel:o,style:r,theme:{ad:"",container:t,context:"",hoc:"",overlay:style.overlay},children:(0,jsx_runtime.jsx)("div",{ref:l,children:c})})};var CustomDropdown_Options=Options,theme={container:"oQKv0Y",context:"_9Tod5r",ad:"R58zIg",hoc:"O-Tp1i",label:"YUPUNs",dropdown:"pNEyAA",option:"LD2Kzy",select:"LP5azC",arrow:"-wscve",active:"k2UDsV",upward:"HWRvu4"};const BaseCustomDropdown=e=>{var t,r;let{filter:n,label:o,onChange:a,options:i,theme:_,value:s}=e;const[l,c]=(0,external_react_.useState)(!1),u=(0,external_react_.useRef)(null),d=(0,external_react_.useRef)(null),[m,p]=(0,external_react_.useState)(),[f,h]=(0,external_react_.useState)(!1);(0,external_react_.useEffect)((()=>{if(!l)return;let e;const t=()=>{var r,n;const o=null===(r=u.current)||void 0===r?void 0:r.getBoundingClientRect(),a=null===(n=d.current)||void 0===n?void 0:n.measure();if(o&&a){var i,_;const e=o.bottom+a.height<(null!==(i=null===(_=window.visualViewport)||void 0===_?void 0:_.height)&&void 0!==i?i:0),t=o.top-a.height>0,r=!e&&t;h(r);const n=r?{left:o.left,top:o.top-a.height-1,width:o.width}:{left:o.left,top:o.bottom,width:o.width};p((e=>areEqual(e,n)?e:n))}e=requestAnimationFrame(t)};return requestAnimationFrame(t),()=>{cancelAnimationFrame(e)}}),[l]);const b=e=>{var t,r;const n=window.visualViewport,o=u.current.getBoundingClientRect();c(!0),p({left:null!==(t=null==n?void 0:n.width)&&void 0!==t?t:0,top:null!==(r=null==n?void 0:n.height)&&void 0!==r?r:0,width:o.width}),e.stopPropagation()};let E=(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:""});for(const e of i)if(!n||n(e)){const[t,r]=optionValueName(e);if(t===s){E=r;break}}let x=_.container;l&&(x+=` ${_.active}`);let v=null!==(t=_.select)&&void 0!==t?t:"";return f&&(x+=` ${_.upward}`,v+=` ${_.upward}`),(0,jsx_runtime.jsxs)("div",{className:x,children:[void 0===o?null:(0,jsx_runtime.jsx)("div",{className:_.label,children:o}),(0,jsx_runtime.jsxs)("div",{className:_.dropdown,onClick:b,onKeyDown:e=>{"Enter"===e.key&&b(e)},ref:u,role:"listbox",tabIndex:0,children:[E,(0,jsx_runtime.jsx)("div",{className:_.arrow})]}),l?(0,jsx_runtime.jsx)(CustomDropdown_Options,{containerClass:v,containerStyle:m,onCancel:()=>{c(!1)},onChange:e=>{c(!1),a&&a(e)},optionClass:null!==(r=_.option)&&void 0!==r?r:"",options:i,ref:d}):null]})};var CustomDropdown=react_themes_default()(BaseCustomDropdown,"CustomDropdown",theme),NativeDropdown_theme={dropdown:"kI9A9U",context:"xHyZo4",ad:"ADu59e",hoc:"FTP2bb",arrow:"DubGkT",container:"WtSZPd",active:"ayMn7O",label:"K7JYKw",option:"_27pZ6W",hiddenOption:"clAKFJ",select:"N0Fc14",invalid:"wL4umU"};const Dropdown=e=>{let{filter:t,label:r,onChange:n,options:o,testId:a,theme:i,value:_}=e,s=!1;const l=[];for(const e of o)if(!t||t(e)){const[t,r]=optionValueName(e);s||(s=t===_),l.push((0,jsx_runtime.jsx)("option",{className:i.option,value:t,children:r},t))}const c=s?null:(0,jsx_runtime.jsx)("option",{className:i.hiddenOption,disabled:!0,value:_,children:_},"__reactUtilsHiddenOption");let u=i.select;return s||(u+=` ${i.invalid}`),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[void 0===r?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:r}),(0,jsx_runtime.jsxs)("div",{className:i.dropdown,children:[(0,jsx_runtime.jsxs)("select",{className:u,"data-testid":void 0,onChange:n,value:_,children:[c,l]}),(0,jsx_runtime.jsx)("div",{className:i.arrow})]})]})};var NativeDropdown=react_themes_default()(Dropdown,"Dropdown",NativeDropdown_theme),Switch_theme={container:"AWNvRj",context:"VMHfnP",ad:"HNliRC",hoc:"_2Ue-db",option:"fUfIAd",selected:"Wco-qk",options:"CZYtcC"};const BaseSwitch=e=>{let{label:t,onChange:r,options:n,theme:o,value:a}=e;if(!n||!o.option)throw Error("Internal error");const i=[];for(const e of n){const[t,n]=optionValueName(e);let _,s=o.option;t===a?s+=` ${o.selected}`:r&&(_=()=>{r(t)}),i.push(_?(0,jsx_runtime.jsx)("div",{className:s,onClick:_,onKeyDown:e=>{"Enter"===e.key&&_()},role:"button",tabIndex:0,children:n},t):(0,jsx_runtime.jsx)("div",{className:s,children:n},t))}return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[t?(0,jsx_runtime.jsx)("div",{className:o.label,children:t}):null,(0,jsx_runtime.jsx)("div",{className:o.options,children:i})]})};var Switch=react_themes_default()(BaseSwitch,"Switch",Switch_theme),external_react_router_=__webpack_require__(707),GenericLink_style={link:"zH52sA"};const GenericLink=e=>{let{children:t,className:r,disabled:n,enforceA:o,keepScrollPosition:a,onClick:i,onMouseDown:_,openNewTab:s,replace:l,routerLinkType:c,to:u,...d}=e;if(n||o||s||u.match(/^(#|(https?|mailto):)/))return(0,jsx_runtime.jsx)("a",{className:(r?r+" ":"")+"zH52sA",href:u,onClick:n?e=>{e.preventDefault()}:i,onMouseDown:n?e=>{e.preventDefault()}:_,rel:"noopener noreferrer",target:s?"_blank":"",children:t});const m=c;return(0,jsx_runtime.jsx)(m,{className:r,discover:"none",onClick:e=>{i&&i(e),a||window.scroll(0,0)},onMouseDown:_,replace:l,to:u,...d,children:t})};var components_GenericLink=GenericLink;const Link=e=>(0,jsx_runtime.jsx)(components_GenericLink,{...e,routerLinkType:external_react_router_.Link});var components_Link=Link,Button_style={button:"E1FNQT",context:"KM0v4f",ad:"_3jm1-Q",hoc:"_0plpDL",active:"MAe9O6",disabled:"Br9IWV"};const BaseButton=e=>{let{active:t,children:r,disabled:n,enforceA:o,onClick:a,onMouseDown:i,onMouseUp:_,onPointerDown:s,openNewTab:l,replace:c,testId:u,theme:d,to:m}=e,p=d.button;return t&&d.active&&(p+=` ${d.active}`),n?(d.disabled&&(p+=` ${d.disabled}`),(0,jsx_runtime.jsx)("div",{className:p,"data-testid":void 0,children:r})):m?(0,jsx_runtime.jsx)(components_Link,{className:p,"data-testid":void 0,enforceA:o,onClick:a,onMouseDown:i,onMouseUp:_,onPointerDown:s,openNewTab:l,replace:c,to:m,children:r}):(0,jsx_runtime.jsx)("div",{className:p,"data-testid":void 0,onClick:a,onKeyDown:a?e=>{"Enter"===e.key&&a(e)}:void 0,onMouseDown:i,onMouseUp:_,onPointerDown:s,role:"button",tabIndex:0,children:r})};var Button=react_themes_default()(BaseButton,"Button",Button_style),Checkbox_theme={checkbox:"A-f8qJ",context:"dNQcC6",ad:"earXxa",hoc:"qAPfQ6",indeterminate:"N9bCb8",container:"Kr0g3M",label:"_3dML-O",disabled:"EzQra1"};const Checkbox=e=>{let{checked:t,disabled:r,label:n,onChange:o,testId:a,theme:i}=e,_=i.container;r&&(_+=` ${i.disabled}`);let s=i.checkbox;return"indeterminate"===t&&(s+=` ${i.indeterminate}`),(0,jsx_runtime.jsxs)("div",{className:_,children:[void 0===n?null:(0,jsx_runtime.jsx)("div",{className:i.label,children:n}),(0,jsx_runtime.jsx)("input",{checked:void 0===t?void 0:!0===t,className:s,"data-testid":void 0,disabled:r,onChange:o,onClick:e=>{e.stopPropagation()},type:"checkbox"})]})};var components_Checkbox=react_themes_default()(Checkbox,"Checkbox",Checkbox_theme),Input_theme={container:"Cxx397",context:"X5WszA",ad:"_8s7GCr",hoc:"TVlBYc",input:"M07d4s",label:"gfbdq-"};const Input=e=>{let{label:t,ref:r,testId:n,theme:o,...a}=e;return(0,jsx_runtime.jsxs)("span",{className:o.container,children:[void 0===t?null:(0,jsx_runtime.jsx)("div",{className:o.label,children:t}),(0,jsx_runtime.jsx)("input",{className:o.input,"data-testid":void 0,ref:r,...a})]})};var components_Input=react_themes_default()(Input,"Input",Input_theme),PageLayout_base_theme={container:"T3cuHB",context:"m4mL-M",ad:"m3-mdC",hoc:"J15Z4H",mainPanel:"pPlQO2",sidePanel:"lqNh4h"};const PageLayout=e=>{let{children:t,leftSidePanelContent:r,rightSidePanelContent:n,theme:o}=e;return(0,jsx_runtime.jsxs)("div",{className:o.container,children:[(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.leftSidePanel].join(" "),children:r}),(0,jsx_runtime.jsx)("div",{className:o.mainPanel,children:t}),(0,jsx_runtime.jsx)("div",{className:[o.sidePanel,o.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=e=>{let{theme:t}=e;return(0,jsx_runtime.jsxs)("span",{className:t.container,children:[(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle}),(0,jsx_runtime.jsx)("span",{className:t.circle})]})};var components_Throbber=react_themes_default()(Throbber,"Throbber",Throbber_theme);let PLACEMENTS=function(e){return e.ABOVE_CURSOR="ABOVE_CURSOR",e.ABOVE_ELEMENT="ABOVE_ELEMENT",e.BELOW_CURSOR="BELOW_CURSOR",e.BELOW_ELEMENT="BELOW_ELEMENT",e}({});const ARROW_STYLE_DOWN=["border-bottom-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";"),ARROW_STYLE_UP=["border-top-color:transparent","border-left-color:transparent","border-right-color:transparent"].join(";");function createTooltipComponents(e){const t=document.createElement("div");e.arrow&&t.setAttribute("class",e.arrow);const 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),i=calcViewportRect(),_=calcPositionAboveXY(e,t,a);if(_.containerX<i.left+6)_.containerX=i.left+6,_.arrowX=Math.max(6,e-_.containerX-a.arrow.width/2);else{const t=i.right-6-a.container.width;_.containerX>t&&(_.containerX=t,_.arrowX=Math.min(a.container.width-6,e-_.containerX-a.arrow.width/2))}_.containerY<i.top+6&&(_.containerY+=a.container.height+2*a.arrow.height,_.arrowY-=a.container.height+a.arrow.height,_.baseArrowStyle=ARROW_STYLE_UP);const s=`left:${_.containerX}px;top:${_.containerY}px`;o.container.setAttribute("style",s);const l=`${_.baseArrowStyle};left:${_.arrowX}px;top:${_.arrowY}px`;o.arrow.setAttribute("style",l)}const Tooltip=e=>{let{children:t,ref:r,theme:n}=e;const{current:o}=(0,external_react_.useRef)({lastElement:void 0,lastPageX:0,lastPageY:0,lastPlacement:void 0}),[a,i]=(0,external_react_.useState)(null),_=(e,t,r,n)=>{o.lastElement=n,o.lastPageX=e,o.lastPageY=t,o.lastPlacement=r,a&&setComponentPositions(e,t,r,n,a)};return(0,external_react_.useImperativeHandle)(r,(()=>({pointTo:_}))),(0,external_react_.useEffect)((()=>{const e=createTooltipComponents(n);return i(e),()=>{document.body.removeChild(e.container),i(null)}}),[n]),(0,external_react_.useEffect)((()=>{a&&setComponentPositions(o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement,a)}),[a,o.lastPageX,o.lastPageY,o.lastPlacement,o.lastElement]),a?(0,external_react_dom_.createPortal)(t,a.content):null};var WithTooltip_Tooltip=Tooltip,default_theme={arrow:"M9gywF",ad:"_4xT7zE",hoc:"zd-vnH",context:"GdZucr",container:"f9gY8K",appearance:"L4ubm-",wrapper:"_4qDBRM"};const Wrapper=e=>{let{children:t,placement:r=PLACEMENTS.ABOVE_CURSOR,tip:n,theme:o}=e;const{current:a}=(0,external_react_.useRef)({lastCursorX:0,lastCursorY:0,timerId:void 0,triggeredByTouch:!1}),i=(0,external_react_.useRef)(null),_=(0,external_react_.useRef)(null),[s,l]=(0,external_react_.useState)(!1);return(0,external_react_.useEffect)((()=>{if(s&&null!==n){i.current&&i.current.pointTo(a.lastCursorX+window.scrollX,a.lastCursorY+window.scrollY,r,_.current);const e=()=>{l(!1)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}}),[a.lastCursorX,a.lastCursorY,r,s,n]),(0,jsx_runtime.jsxs)("div",{className:o.wrapper,onClick:()=>{a.timerId&&(clearTimeout(a.timerId),a.timerId=void 0,a.triggeredByTouch=!1)},onMouseLeave:()=>{l(!1)},onMouseMove:e=>{((e,t)=>{if(s){const n=_.current.getBoundingClientRect();e<n.left||e>n.right||t<n.top||t>n.bottom?l(!1):i.current&&i.current.pointTo(e+window.scrollX,t+window.scrollY,r,_.current)}else{var n;a.lastCursorX=e,a.lastCursorY=t,a.triggeredByTouch?null!==(n=a.timerId)&&void 0!==n||(a.timerId=setTimeout((()=>{a.triggeredByTouch=!1,a.timerId=void 0,l(!0)}),300)):l(!0)}})(e.clientX,e.clientY)},onTouchStart:()=>{a.triggeredByTouch=!0},ref:_,role:"presentation",children:[s&&null!==n?(0,jsx_runtime.jsx)(WithTooltip_Tooltip,{ref:i,theme:o,children:n}):null,t]})},ThemedWrapper=react_themes_default()(Wrapper,"WithTooltip",default_theme),e=ThemedWrapper;e.PLACEMENTS=PLACEMENTS;var WithTooltip=e,external_qs_=__webpack_require__(360),external_qs_default=__webpack_require__.n(external_qs_),base={container:"sXHM81",context:"veKyYi",ad:"r3ABzd",hoc:"YKcPnR",video:"SlV2zw"},throbber={container:"jTxmOX",context:"dzIcLh",ad:"_5a9XX1",hoc:"_7sH52O"};const YouTubeVideo=e=>{var t,r;let{autoplay:n,src:o,theme:a,title:i}=e;const _=o.split("?");let[s]=_;const[,l]=_,c=l?external_qs_default().parse(l):{};return s=`https://www.youtube.com/embed/${null!==(t=c.v)&&void 0!==t?t:null===(r=s)||void 0===r||null===(r=r.match(/\/([a-zA-Z0-9-_]*)$/))||void 0===r?void 0:r[1]}`,delete c.v,c.autoplay=n?"1":"0",s+=`?${external_qs_default().stringify(c)}`,(0,jsx_runtime.jsxs)("div",{className:a.container,children:[(0,jsx_runtime.jsx)(components_Throbber,{theme:throbber}),(0,jsx_runtime.jsx)("iframe",{allow:"autoplay",allowFullScreen:!0,className:a.video,src:s,title:i})]})};var components_YouTubeVideo=react_themes_default()(YouTubeVideo,"YouTubeVideo",base),TextArea_style={container:"dzMVIB",context:"KVPc7g",ad:"z2GQ0Z",hoc:"_8R1Qdj",textarea:"zd-OFg",hidden:"GiHBXI"};const TextArea=e=>{let{disabled:t,onBlur:r,onChange:n,onKeyDown:o,placeholder:a,theme:i,value:_}=e;const s=(0,external_react_.useRef)(null),[l,c]=(0,external_react_.useState)(),[u,d]=(0,external_react_.useState)(null!=_?_:"");return void 0!==_&&u!==_&&d(_),(0,external_react_.useEffect)((()=>{const e=s.current;if(!e)return;const t=new ResizeObserver((()=>{c(e.scrollHeight)}));return t.observe(e),()=>{t.disconnect()}}),[]),(0,external_react_.useEffect)((()=>{const e=s.current;e&&c(e.scrollHeight)}),[u]),(0,jsx_runtime.jsxs)("div",{className:i.container,children:[(0,jsx_runtime.jsx)("textarea",{className:`${i.textarea} ${i.hidden}`,readOnly:!0,ref:s,value:u}),(0,jsx_runtime.jsx)("textarea",{className:i.textarea,disabled:t,onBlur:r,onChange:void 0===_?e=>{d(e.target.value)}:n,onKeyDown:o,placeholder:a,style:{height:l},value:u})]})};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
|