@chobantonov/jsonforms-react-extended-renderers 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +17 -2
- package/lib/AgGridControlRenderer.impl-BO-Z1x0Y.js +2 -0
- package/lib/AgGridControlRenderer.impl-BO-Z1x0Y.js.map +1 -0
- package/lib/AgGridControlRenderer.impl-BZS8_ocu.mjs +429 -0
- package/lib/AgGridControlRenderer.impl-BZS8_ocu.mjs.map +1 -0
- package/lib/DynamicJSXRenderer-Cyw40Kz0.js +2 -0
- package/lib/DynamicJSXRenderer-Cyw40Kz0.js.map +1 -0
- package/lib/DynamicJSXRenderer-DyB3ZpZV.mjs +109 -0
- package/lib/DynamicJSXRenderer-DyB3ZpZV.mjs.map +1 -0
- package/lib/MarkupLabelRenderer.impl-CWfdcUuH.mjs +12 -0
- package/lib/MarkupLabelRenderer.impl-CWfdcUuH.mjs.map +1 -0
- package/lib/MarkupLabelRenderer.impl-DnuzIPQg.js +2 -0
- package/lib/MarkupLabelRenderer.impl-DnuzIPQg.js.map +1 -0
- package/lib/MonacoControlRenderer.impl-BwgLGNMK.js +3 -0
- package/lib/MonacoControlRenderer.impl-BwgLGNMK.js.map +1 -0
- package/lib/MonacoControlRenderer.impl-CyjMHbOd.mjs +186 -0
- package/lib/MonacoControlRenderer.impl-CyjMHbOd.mjs.map +1 -0
- package/lib/RactiveTemplate-7L44A38e.js +2 -0
- package/lib/RactiveTemplate-7L44A38e.js.map +1 -0
- package/lib/RactiveTemplate-Cat7CxUp.mjs +74 -0
- package/lib/RactiveTemplate-Cat7CxUp.mjs.map +1 -0
- package/lib/ajv-localizers.cjs.js +2 -0
- package/lib/ajv-localizers.cjs.js.map +1 -0
- package/lib/ajv-localizers.esm.js +7 -0
- package/lib/ajv-localizers.esm.js.map +1 -0
- package/lib/ajvI18n-2UTyJv5g.js +2 -0
- package/lib/ajvI18n-2UTyJv5g.js.map +1 -0
- package/lib/ajvI18n-DO8FFvx1.mjs +227 -0
- package/lib/ajvI18n-DO8FFvx1.mjs.map +1 -0
- package/lib/celTemplate-Cl0alaCz.js +3 -0
- package/lib/celTemplate-Cl0alaCz.js.map +1 -0
- package/lib/celTemplate-D_AGhaIL.mjs +137 -0
- package/lib/celTemplate-D_AGhaIL.mjs.map +1 -0
- package/lib/components/DynamicJSXRenderer.d.ts +7 -0
- package/lib/components/ExtendedJsonForms.d.ts +80 -0
- package/lib/components/GenericAdditionalProperties.d.ts +4 -0
- package/lib/components/InterpolatedText.d.ts +34 -0
- package/lib/components/RactiveTemplate.d.ts +37 -0
- package/lib/components/editorRendererTypes.d.ts +139 -0
- package/lib/components/elementRender.d.ts +15 -0
- package/lib/configNamespaces-BFclHtB8.mjs +1 -0
- package/lib/configNamespaces-sboXDudL.js +1 -0
- package/lib/core/ajv.d.ts +82 -0
- package/lib/core/ajvI18n/bg.d.ts +2 -0
- package/lib/core/ajvI18n/index.d.ts +118 -0
- package/lib/core/ajvI18n/localizers.d.ts +20 -0
- package/lib/core/dynamicDefaults.d.ts +34 -0
- package/lib/core/keywords.d.ts +24 -0
- package/lib/core/transform.d.ts +29 -0
- package/lib/core/uiSchema.d.ts +48 -0
- package/lib/elementRender-Dbp2e-Cc.js +2 -0
- package/lib/elementRender-Dbp2e-Cc.js.map +1 -0
- package/lib/elementRender-y8MK9CCE.mjs +5 -0
- package/lib/elementRender-y8MK9CCE.mjs.map +1 -0
- package/lib/index.d.ts +41 -0
- package/lib/jsonforms-react-extended.cjs.js +16 -0
- package/lib/jsonforms-react-extended.cjs.js.map +1 -0
- package/lib/jsonforms-react-extended.esm.js +2335 -0
- package/lib/jsonforms-react-extended.esm.js.map +1 -0
- package/lib/locale/bg.d.ts +14 -0
- package/lib/markdown-C_y73Q0w.mjs +123 -0
- package/lib/markdown-C_y73Q0w.mjs.map +1 -0
- package/lib/markdown-CuqtpGVd.js +2 -0
- package/lib/markdown-CuqtpGVd.js.map +1 -0
- package/lib/objectWithoutProperties-6zedhz76.js +2 -0
- package/lib/objectWithoutProperties-6zedhz76.js.map +1 -0
- package/lib/objectWithoutProperties-yjQMyZ0y.mjs +58 -0
- package/lib/objectWithoutProperties-yjQMyZ0y.mjs.map +1 -0
- package/lib/renderers/AgGridControlRenderer.d.ts +10 -0
- package/lib/renderers/AgGridControlRenderer.impl.d.ts +4 -0
- package/lib/renderers/ButtonRenderer.d.ts +83 -0
- package/lib/renderers/GenericMixedRenderer.d.ts +9 -0
- package/lib/renderers/HorizontalLayoutRenderer.d.ts +5 -0
- package/lib/renderers/ImageViewRenderer.d.ts +48 -0
- package/lib/renderers/LinkRenderer.d.ts +23 -0
- package/lib/renderers/MarkupLabelRenderer.d.ts +35 -0
- package/lib/renderers/MarkupLabelRenderer.impl.d.ts +17 -0
- package/lib/renderers/MonacoControlRenderer.d.ts +8 -0
- package/lib/renderers/MonacoControlRenderer.impl.d.ts +4 -0
- package/lib/renderers/RactiveTemplateLayoutRenderer.d.ts +6 -0
- package/lib/renderers/SeparatorRenderer.d.ts +17 -0
- package/lib/renderers/SlotRenderer.d.ts +5 -0
- package/lib/renderers/SpacerRenderer.d.ts +5 -0
- package/lib/renderers/SplitLayoutRenderer.d.ts +18 -0
- package/lib/renderers/TemplateLayoutRenderer.d.ts +13 -0
- package/lib/renderers/TemplateRenderer.d.ts +17 -0
- package/lib/renderers/TsxTemplateLayoutRenderer.d.ts +111 -0
- package/lib/renderers/index.d.ts +13 -0
- package/lib/renderers/templateEngines.d.ts +43 -0
- package/lib/util/actionContext.d.ts +23 -0
- package/lib/util/additionalErrors.d.ts +77 -0
- package/lib/util/celEnvironment.d.ts +23 -0
- package/lib/util/celTemplate.d.ts +47 -0
- package/lib/util/childNames.d.ts +46 -0
- package/lib/util/configNamespaces.d.ts +1 -0
- package/lib/util/cron.d.ts +122 -0
- package/lib/util/editorControls.d.ts +8 -0
- package/lib/util/editorDiagnostics.d.ts +56 -0
- package/lib/util/extendedControls.d.ts +4 -0
- package/lib/util/extendedLocale.d.ts +32 -0
- package/lib/util/fileFilterValue.d.ts +3 -0
- package/lib/util/formContext.d.ts +54 -0
- package/lib/util/gridColumns.d.ts +6 -0
- package/lib/util/horizontalLayout.d.ts +10 -0
- package/lib/util/i18nDefaults.d.ts +45 -0
- package/lib/util/interpolate.d.ts +105 -0
- package/lib/util/labelFilterValue.d.ts +2 -0
- package/lib/util/lazyControl.d.ts +36 -0
- package/lib/util/lazyTemplate.d.ts +18 -0
- package/lib/util/markdown.d.ts +55 -0
- package/lib/util/markdownEscape.d.ts +27 -0
- package/lib/util/markup.d.ts +74 -0
- package/lib/util/maskControls.d.ts +2 -0
- package/lib/util/templateLang.d.ts +87 -0
- package/lib/util/templateUrls.d.ts +40 -0
- package/lib/util/urlPolicy.d.ts +42 -0
- package/lib/util/useCronPicker.d.ts +24 -0
- package/lib/util/useDurationControl.d.ts +99 -0
- package/lib/util/useEditorAppearance.d.ts +21 -0
- package/lib/util/useExtendedTranslator.d.ts +10 -0
- package/lib/util/useMonacoShadowStyles.d.ts +2 -0
- package/package.json +110 -3
- package/src/components/DynamicJSXRenderer.tsx +274 -0
- package/src/components/ExtendedJsonForms.tsx +329 -0
- package/src/components/GenericAdditionalProperties.tsx +362 -0
- package/src/components/InterpolatedText.tsx +114 -0
- package/src/components/RactiveTemplate.tsx +161 -0
- package/src/components/editorRendererTypes.ts +135 -0
- package/src/components/elementRender.ts +15 -0
- package/src/core/ajv.ts +177 -0
- package/src/core/ajvI18n/bg.ts +203 -0
- package/src/core/ajvI18n/index.ts +267 -0
- package/src/core/ajvI18n/localizers.ts +25 -0
- package/src/core/dynamicDefaults.ts +170 -0
- package/src/core/keywords.ts +71 -0
- package/src/core/transform.ts +137 -0
- package/src/core/uiSchema.ts +53 -0
- package/src/index.tsx +196 -0
- package/src/locale/bg.ts +51 -0
- package/src/renderers/AgGridControlRenderer.impl.tsx +788 -0
- package/src/renderers/AgGridControlRenderer.tsx +24 -0
- package/src/renderers/ButtonRenderer.tsx +328 -0
- package/src/renderers/GenericMixedRenderer.tsx +224 -0
- package/src/renderers/HorizontalLayoutRenderer.tsx +93 -0
- package/src/renderers/ImageViewRenderer.tsx +328 -0
- package/src/renderers/LinkRenderer.tsx +92 -0
- package/src/renderers/MarkupLabelRenderer.impl.tsx +26 -0
- package/src/renderers/MarkupLabelRenderer.tsx +327 -0
- package/src/renderers/MonacoControlRenderer.impl.tsx +351 -0
- package/src/renderers/MonacoControlRenderer.tsx +24 -0
- package/src/renderers/RactiveTemplateLayoutRenderer.tsx +172 -0
- package/src/renderers/SeparatorRenderer.tsx +55 -0
- package/src/renderers/SlotRenderer.tsx +34 -0
- package/src/renderers/SpacerRenderer.tsx +69 -0
- package/src/renderers/SplitLayoutRenderer.tsx +220 -0
- package/src/renderers/TemplateLayoutRenderer.tsx +394 -0
- package/src/renderers/TemplateRenderer.tsx +71 -0
- package/src/renderers/TsxTemplateLayoutRenderer.tsx +258 -0
- package/src/renderers/index.ts +14 -0
- package/src/renderers/templateEngines.tsx +100 -0
- package/src/util/actionContext.ts +29 -0
- package/src/util/additionalErrors.tsx +391 -0
- package/src/util/celEnvironment.ts +300 -0
- package/src/util/celTemplate.ts +267 -0
- package/src/util/childNames.ts +135 -0
- package/src/util/configNamespaces.ts +6 -0
- package/src/util/cron.ts +433 -0
- package/src/util/editorControls.ts +58 -0
- package/src/util/editorDiagnostics.ts +103 -0
- package/src/util/extendedControls.ts +34 -0
- package/src/util/extendedLocale.ts +67 -0
- package/src/util/fileFilterValue.ts +28 -0
- package/src/util/formContext.ts +74 -0
- package/src/util/gridColumns.ts +80 -0
- package/src/util/horizontalLayout.ts +59 -0
- package/src/util/i18nDefaults.ts +80 -0
- package/src/util/interpolate.ts +218 -0
- package/src/util/labelFilterValue.ts +49 -0
- package/src/util/lazyControl.tsx +66 -0
- package/src/util/lazyTemplate.tsx +110 -0
- package/src/util/markdown.tsx +345 -0
- package/src/util/markdownEscape.ts +29 -0
- package/src/util/markup.ts +144 -0
- package/src/util/maskControls.ts +6 -0
- package/src/util/templateLang.ts +145 -0
- package/src/util/templateUrls.ts +274 -0
- package/src/util/urlPolicy.ts +115 -0
- package/src/util/useCronPicker.ts +102 -0
- package/src/util/useDurationControl.ts +272 -0
- package/src/util/useEditorAppearance.ts +86 -0
- package/src/util/useExtendedTranslator.ts +25 -0
- package/src/util/useMonacoShadowStyles.ts +47 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createAjv as createDefaultAjv } from '@jsonforms/core';
|
|
2
|
+
import type { JsonFormsI18nState } from '@jsonforms/core';
|
|
3
|
+
import { AjvLocalizers } from './ajvI18n';
|
|
4
|
+
type Ajv = ReturnType<typeof createDefaultAjv>;
|
|
5
|
+
type Options = NonNullable<Parameters<typeof createDefaultAjv>[0]>;
|
|
6
|
+
/**
|
|
7
|
+
* The validator this renderer set is written against.
|
|
8
|
+
*
|
|
9
|
+
* JSON Forms' own `createAjv()` is deliberately plain, and three of the things
|
|
10
|
+
* it leaves off are things forms here rely on. The Svelte renderer family
|
|
11
|
+
* makes the same three choices, which is a useful check that this is the
|
|
12
|
+
* shape of validator these renderers expect rather than a local preference.
|
|
13
|
+
*
|
|
14
|
+
* | Option | Why |
|
|
15
|
+
* | --- | --- |
|
|
16
|
+
* | `$data: true` | Without it a `$data` bound does not merely go unenforced - the schema **fails to compile**, and the whole form stops. See below. |
|
|
17
|
+
* | `useDefaults: true` | A schema `default` is written into the data, which several renderers assume when they say a value "is" its default. |
|
|
18
|
+
* | `discriminator: true` | Lets a discriminated `oneOf` report the branch's own errors instead of every branch's. |
|
|
19
|
+
*
|
|
20
|
+
* **`$data` is the one that bites.** Ajv rejects `{"formatMinimum": {"$data": "1/from"}}`
|
|
21
|
+
* at compile time with `formatMinimum value must be ["string"]` unless the
|
|
22
|
+
* option is set, so a date range written the obvious way takes the form down
|
|
23
|
+
* rather than degrading. That is why this factory exists at all, and why the
|
|
24
|
+
* web component uses it by default.
|
|
25
|
+
*/
|
|
26
|
+
export interface FormsAjvOptions extends Options {
|
|
27
|
+
/** Extra formats to register, as `{ name: predicate }`. */
|
|
28
|
+
formats?: Record<string, (value: string) => boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* `ajv-keywords`, the extended `transform`, and the extra dynamic defaults.
|
|
31
|
+
*
|
|
32
|
+
* Not spelled `keywords`: Ajv already has an option by that name, which
|
|
33
|
+
* takes a `Vocabulary`. Two different things called the same thing in one
|
|
34
|
+
* options object is how a `true` ends up where a vocabulary was expected.
|
|
35
|
+
*
|
|
36
|
+
* On by default, and the reason is that **turning them off fails silently**.
|
|
37
|
+
* JSON Forms' factory sets `strictSchema: false`, so Ajv ignores a keyword
|
|
38
|
+
* it does not know: a schema carrying `transform` or `allRequired` compiles
|
|
39
|
+
* without complaint, validates less than it says, and leaves the data
|
|
40
|
+
* untransformed. Nothing throws and nothing is logged. These are what the
|
|
41
|
+
* Vue 2 forms in this organisation are already authored against, so the
|
|
42
|
+
* default has to be on.
|
|
43
|
+
*/
|
|
44
|
+
extendedKeywords?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* `ajv-errors`, so a schema can carry its own `errorMessage`.
|
|
47
|
+
*
|
|
48
|
+
* On by default. Requires `allErrors`, which this factory therefore turns on
|
|
49
|
+
* with it - see below.
|
|
50
|
+
*/
|
|
51
|
+
errorMessages?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Permits the `dynamic` dynamic default, which compiles a function from the
|
|
54
|
+
* schema. Off by default; section 14 requires the permission.
|
|
55
|
+
*
|
|
56
|
+
* **A getter is accepted, and is usually what you want.** Everywhere else in
|
|
57
|
+
* this project the permission comes from a *form's*
|
|
58
|
+
* `config.jsonformsExtended.security.allowScriptEvaluation`, but a validator
|
|
59
|
+
* is created once and shared by every form it validates - Ajv caches
|
|
60
|
+
* compiled schemas, so building one per form would recompile on every
|
|
61
|
+
* keystroke. A getter lets the one validator answer per form, the same way
|
|
62
|
+
* `i18n` lets it answer per locale.
|
|
63
|
+
*
|
|
64
|
+
* It is read when a schema **compiles**, not when it validates, because that
|
|
65
|
+
* is when `dynamicDefaults` generators are built.
|
|
66
|
+
*/
|
|
67
|
+
allowScriptEvaluation?: boolean | (() => boolean);
|
|
68
|
+
/**
|
|
69
|
+
* The form's i18n state, read at validation time.
|
|
70
|
+
*
|
|
71
|
+
* Supplying it turns on `errorMessage` translation. Ajv's **own** messages
|
|
72
|
+
* are localized only if `localizers` is supplied as well.
|
|
73
|
+
*/
|
|
74
|
+
i18n?: () => JsonFormsI18nState | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Ajv's message localizers - `ajvLocalizers` from
|
|
77
|
+
* `core/ajvI18n/localizers`, or a subset.
|
|
78
|
+
*/
|
|
79
|
+
localizers?: AjvLocalizers;
|
|
80
|
+
}
|
|
81
|
+
export declare const createFormsAjv: (options?: FormsAjvOptions) => Ajv;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { ErrorTranslator, JsonFormsI18nState } from '@jsonforms/core';
|
|
2
|
+
import type Ajv from 'ajv';
|
|
3
|
+
import type { ErrorObject } from 'ajv';
|
|
4
|
+
/**
|
|
5
|
+
* Localized validator messages, and `errorMessage` unwrapping.
|
|
6
|
+
*
|
|
7
|
+
* Two jobs that have to happen together, because both rewrite `errors` after
|
|
8
|
+
* a validation and each would undo the other if they ran separately:
|
|
9
|
+
*
|
|
10
|
+
* 1. **Translate Ajv's own messages** through `ajv-i18n`, so `must be >= 5`
|
|
11
|
+
* arrives in the form's language.
|
|
12
|
+
* 2. **Unwrap `ajv-errors`.** When a schema carries `errorMessage`, ajv-errors
|
|
13
|
+
* replaces the failures it covers with a single `errorMessage` error and
|
|
14
|
+
* marks the originals `emUsed`. Left alone, that collapses several
|
|
15
|
+
* per-property errors into one at the object's path - and JSON Forms maps
|
|
16
|
+
* errors to controls **by path**, so the fields stop showing them. Unwrapping
|
|
17
|
+
* restores the original errors and puts the schema's message on each.
|
|
18
|
+
*
|
|
19
|
+
* ## How this differs from the Vue 2 original
|
|
20
|
+
*
|
|
21
|
+
* The original takes a Vue `Ref` and sets each unwrapped message to a
|
|
22
|
+
* `computed()`, relying on the template to unwrap it on read. That is not
|
|
23
|
+
* portable: a JSON Forms `ErrorObject.message` is a `string`, and anything
|
|
24
|
+
* else reaches React as an object and renders as `[object Object]`.
|
|
25
|
+
*
|
|
26
|
+
* Here the translator is a **getter**, called at validation time, and the
|
|
27
|
+
* message is a plain string. The practical difference is when the message is
|
|
28
|
+
* resolved - on validation rather than on render - so a locale change has to
|
|
29
|
+
* revalidate to retranslate. JSON Forms already revalidates on an i18n change,
|
|
30
|
+
* so this costs nothing in the normal case and removes a Vue dependency from
|
|
31
|
+
* the contract.
|
|
32
|
+
*/
|
|
33
|
+
/** Ajv's localizers, keyed by language: what `ajv-i18n/localize` exports. */
|
|
34
|
+
export type AjvLocalizers = Record<string, ((errors: unknown) => void) | undefined>;
|
|
35
|
+
export interface AjvI18nOptions {
|
|
36
|
+
/**
|
|
37
|
+
* The current i18n state, read at validation time.
|
|
38
|
+
*
|
|
39
|
+
* A getter rather than a value because one Ajv instance outlives many
|
|
40
|
+
* locales; capturing the state would freeze the first one.
|
|
41
|
+
*/
|
|
42
|
+
i18n?: () => JsonFormsI18nState | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Ajv's own message localizers.
|
|
45
|
+
*
|
|
46
|
+
* Supplied by the caller, and **not** imported here on purpose: importing
|
|
47
|
+
* `ajv-i18n/localize` pulls every language it ships into the bundle whether
|
|
48
|
+
* the form has a translator or not. `ajvLocalizers` in `./localizers` is the
|
|
49
|
+
* one-line way to ask for all of them.
|
|
50
|
+
*/
|
|
51
|
+
localizers?: AjvLocalizers;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Bulgarian, which `ajv-i18n` does not ship.
|
|
55
|
+
*
|
|
56
|
+
* Upstream PR ajv-validator/ajv-i18n#312 has not landed. The `required`
|
|
57
|
+
* message is overridden after the base localizer runs, because the shipped
|
|
58
|
+
* form interpolates `missingProperty` - an untranslated property name - into
|
|
59
|
+
* the sentence.
|
|
60
|
+
*/
|
|
61
|
+
export declare const localizeBg: NonNullable<AjvLocalizers[string]>;
|
|
62
|
+
/**
|
|
63
|
+
* Expands `ajv-errors` wrappers back into the errors they replaced.
|
|
64
|
+
*
|
|
65
|
+
* Each recovered error keeps its own `instancePath`, so it still reaches the
|
|
66
|
+
* control it belongs to, and takes the schema's message. That message is run
|
|
67
|
+
* through the form's translator under `error.errorMessage.<message>`, so a
|
|
68
|
+
* schema can carry a key rather than a sentence; a message that resolves to
|
|
69
|
+
* nothing is used literally, which is the same rule the rest of this renderer
|
|
70
|
+
* set applies to labels.
|
|
71
|
+
*/
|
|
72
|
+
export declare const unwrapErrorMessageErrors: (errors: ErrorObject[] | null | undefined, i18n?: () => JsonFormsI18nState | undefined) => ErrorObject[];
|
|
73
|
+
/**
|
|
74
|
+
* Carries the **untranslated** message a schema's `errorMessage` supplied.
|
|
75
|
+
*
|
|
76
|
+
* Two things need it. A host using only the validation-time path reads
|
|
77
|
+
* `error.message`, which is already translated. A host using
|
|
78
|
+
* {@link createAjvErrorTranslator} needs the original key, because the locale
|
|
79
|
+
* may have changed since the validation that produced the error and core does
|
|
80
|
+
* not revalidate when it does.
|
|
81
|
+
*
|
|
82
|
+
* A `Symbol.for`, so it survives the error being copied between module
|
|
83
|
+
* instances - the same reasoning as `ElementRender`.
|
|
84
|
+
*/
|
|
85
|
+
export declare const SCHEMA_MESSAGE: unique symbol;
|
|
86
|
+
/** The catalog key a schema-authored message is looked up under. */
|
|
87
|
+
export declare const schemaMessageKey: (message: string) => string;
|
|
88
|
+
/**
|
|
89
|
+
* Localizes an error **when it is rendered**, which is core's own hook for it.
|
|
90
|
+
*
|
|
91
|
+
* Prefer this to the `localizers` option below wherever the form can change
|
|
92
|
+
* language without the data changing. The difference is when the message is
|
|
93
|
+
* produced:
|
|
94
|
+
*
|
|
95
|
+
* | | Produced | A locale change |
|
|
96
|
+
* | --- | --- | --- |
|
|
97
|
+
* | `createFormsAjv({ localizers })` | at **validation** | shows the old language until something revalidates |
|
|
98
|
+
* | this, as `i18n.translateError` | at **render** | takes effect immediately |
|
|
99
|
+
*
|
|
100
|
+
* That second row is not a detail. JSON Forms does **not** revalidate when the
|
|
101
|
+
* locale changes - verified - so a form whose data is untouched goes on
|
|
102
|
+
* displaying the previous language. The validation-time path exists because
|
|
103
|
+
* the Vue 2 original works that way and it needs no extra wiring; this is the
|
|
104
|
+
* one to reach for when the switch has to be visible.
|
|
105
|
+
*
|
|
106
|
+
* The two are safe together: `ajv-i18n` regenerates a message from the error's
|
|
107
|
+
* `keyword` and `params` rather than editing the existing text, so localizing
|
|
108
|
+
* twice is idempotent.
|
|
109
|
+
*/
|
|
110
|
+
export declare const createAjvErrorTranslator: (localizers: AjvLocalizers, getLocale: () => string | undefined) => ErrorTranslator;
|
|
111
|
+
/**
|
|
112
|
+
* Wraps `ajv.compile` so every validation's errors are localized and unwrapped.
|
|
113
|
+
*
|
|
114
|
+
* Ajv exposes no hook after validation, so the compiled function is wrapped.
|
|
115
|
+
* The wrapper copies `errors` back onto itself after each call because callers
|
|
116
|
+
* - JSON Forms among them - read `validate.errors`, not the return value.
|
|
117
|
+
*/
|
|
118
|
+
export declare const ajvTranslations: (ajv: Ajv, options?: AjvI18nOptions) => Ajv;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AjvLocalizers } from './index';
|
|
2
|
+
/**
|
|
3
|
+
* Every language `ajv-i18n` ships, plus Bulgarian.
|
|
4
|
+
*
|
|
5
|
+
* **In a module of its own, deliberately.** `ajv-i18n/localize` re-exports
|
|
6
|
+
* around twenty locales, and importing it costs that whether or not the form
|
|
7
|
+
* has a translator. Keeping it out of `createFormsAjv`'s import graph means a
|
|
8
|
+
* form that does not localize validator messages does not pay for the ability:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { createFormsAjv } from '@chobantonov/jsonforms-react-extended-renderers';
|
|
12
|
+
* import { ajvLocalizers } from '@chobantonov/jsonforms-react-extended-renderers/localizers';
|
|
13
|
+
*
|
|
14
|
+
* createFormsAjv({ i18n: () => i18nState, localizers: ajvLocalizers });
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* A host that ships two languages can pass `{ en: ajvLocalizers.en, bg: localizeBg }`
|
|
18
|
+
* instead and carry neither the rest nor this module.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ajvLocalizers: AjvLocalizers;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type Generator = (args: unknown) => () => unknown;
|
|
2
|
+
/**
|
|
3
|
+
* A default computed by a function **written in the schema**.
|
|
4
|
+
*
|
|
5
|
+
* ```json
|
|
6
|
+
* { "dynamicDefaults": { "ref": { "func": "dynamic", "args": { "func": "(a) => a.x" } } } }
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* The Vue 2 original compiles that string with `new Function` unconditionally.
|
|
10
|
+
* Here it is gated: a schema is data, it can arrive with the form, and
|
|
11
|
+
* compiling a string out of it is the same capability the template engines and
|
|
12
|
+
* `Button.script` need permission for. Section 14 is explicit - "String
|
|
13
|
+
* evaluation requires `jsonformsExtended.security.allowScriptEvaluation=true`"
|
|
14
|
+
* - and there is no reason this one entry point should be the exception.
|
|
15
|
+
*
|
|
16
|
+
* Without the permission it is **reported, not silently skipped**: a default
|
|
17
|
+
* that quietly does not appear is indistinguishable from a schema that never
|
|
18
|
+
* asked for one.
|
|
19
|
+
*/
|
|
20
|
+
export declare const makeDynamic: (allowScriptEvaluation: () => boolean) => Generator;
|
|
21
|
+
/**
|
|
22
|
+
* A default taken from the page's query string, including one after the hash.
|
|
23
|
+
*
|
|
24
|
+
* Guarded for a non-browser host: this package is rendered in jsdom by its own
|
|
25
|
+
* tests and may be server-rendered, where `window` is absent and the original
|
|
26
|
+
* threw.
|
|
27
|
+
*/
|
|
28
|
+
export declare const searchParams: Generator;
|
|
29
|
+
export declare const datetimeOffset: Generator;
|
|
30
|
+
export declare const timeOffset: Generator;
|
|
31
|
+
export declare const dateOffset: Generator;
|
|
32
|
+
/** One component of the offset date - `{ "unit": "year" }`. */
|
|
33
|
+
export declare const dateUnit: Generator;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type Ajv from 'ajv';
|
|
2
|
+
/**
|
|
3
|
+
* `ajv-keywords`, plus the extensions the Vue 2 `common` package added.
|
|
4
|
+
*
|
|
5
|
+
* Two of the three registrations here are **global mutations of the
|
|
6
|
+
* `ajv-keywords` module**, not of the Ajv instance: `dynamicDefaults.DEFAULTS`
|
|
7
|
+
* is a module-level table, so a generator registered for one validator is
|
|
8
|
+
* registered for every validator in the process. That is how the original
|
|
9
|
+
* works and it cannot be made per-instance without forking the plugin, so it
|
|
10
|
+
* is written down rather than hidden - and it is why {@link registerAjvKeywords}
|
|
11
|
+
* is idempotent instead of assuming it runs once.
|
|
12
|
+
*/
|
|
13
|
+
export interface AjvKeywordOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the `dynamic` default - which compiles a function from the schema
|
|
16
|
+
* - is permitted. Read when a schema compiles, so one validator can answer
|
|
17
|
+
* differently for different forms.
|
|
18
|
+
*
|
|
19
|
+
* Off by default. Section 14: "String evaluation requires
|
|
20
|
+
* `jsonformsExtended.security.allowScriptEvaluation=true`."
|
|
21
|
+
*/
|
|
22
|
+
allowScriptEvaluation?: () => boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const registerAjvKeywords: (ajv: Ajv, options?: AjvKeywordOptions) => Ajv;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CodeKeywordDefinition } from 'ajv';
|
|
2
|
+
/**
|
|
3
|
+
* `transform`, with more transformations than `ajv-keywords` defines.
|
|
4
|
+
*
|
|
5
|
+
* Ported from the Vue 2 `common` package, which is the reference for what
|
|
6
|
+
* forms in this organisation already author against. `ajv-keywords`' own
|
|
7
|
+
* `transform` is **not extensible** - its transformation table is a module
|
|
8
|
+
* constant with no registration hook - so the only way to add `capitalize`
|
|
9
|
+
* and `startCase` is to remove its keyword and register this one in its place.
|
|
10
|
+
* That is what `registerAjvKeywords` does, and it is why this file exists
|
|
11
|
+
* rather than a three-line plugin.
|
|
12
|
+
*
|
|
13
|
+
* Note that `transform` **mutates the data** as a side effect of validation,
|
|
14
|
+
* which is unusual for a validator and deliberate here: the legacy forms rely
|
|
15
|
+
* on it to normalise input. It runs `before: 'enum'` so a transformed value is
|
|
16
|
+
* what `enum` and `toEnumCase` compare against.
|
|
17
|
+
*/
|
|
18
|
+
type TransformName = 'trimStart' | 'trimEnd' | 'trimLeft' | 'trimRight' | 'trim' | 'toLowerCase' | 'toUpperCase' | 'toEnumCase' | 'capitalize' | 'startCase';
|
|
19
|
+
interface TransformConfig {
|
|
20
|
+
hash: Record<string, string | undefined>;
|
|
21
|
+
}
|
|
22
|
+
type Transform = (s: string, cfg?: TransformConfig) => string;
|
|
23
|
+
declare const transform: {
|
|
24
|
+
[key in TransformName]: Transform;
|
|
25
|
+
};
|
|
26
|
+
declare const getDef: (() => CodeKeywordDefinition) & {
|
|
27
|
+
transform: typeof transform;
|
|
28
|
+
};
|
|
29
|
+
export default getDef;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Layout, UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
/**
|
|
3
|
+
* What this project's UI model adds to core's element types.
|
|
4
|
+
*
|
|
5
|
+
* Section 2 lists the core types a TypeScript implementation may import, and
|
|
6
|
+
* then declares one of its own:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* export type NamedUISchemaElement = UISchemaElement & { name: string };
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* with "`name` is used where an element must be referenced, for example
|
|
13
|
+
* Categorization initial selection". Core does not declare `name` on
|
|
14
|
+
* `UISchemaElement` and this project does not control core, so the addition
|
|
15
|
+
* lives here - once, rather than as a cast at each of the half-dozen places
|
|
16
|
+
* that read it.
|
|
17
|
+
*
|
|
18
|
+
* **`name` is general, not a feature of any one element.** It is read by the
|
|
19
|
+
* `Template` registry lookup, `Slot` resolution, a Ractive partial, a
|
|
20
|
+
* `Button`'s action name and `Categorization.options.initial`. Any element in
|
|
21
|
+
* this set may carry one.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* An element that **has** a name, as section 2 declares it.
|
|
25
|
+
*
|
|
26
|
+
* Use it where a name is required for the element to mean anything - a
|
|
27
|
+
* `Template` invocation, a `Slot`, a registry entry looked up by name. `name`
|
|
28
|
+
* is required here on purpose: the type is the guarantee.
|
|
29
|
+
*/
|
|
30
|
+
export type NamedUISchemaElement = UISchemaElement & {
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Any element of this project's UI model: core's, plus an optional name.
|
|
35
|
+
*
|
|
36
|
+
* This is the type to read an arbitrary element through. It says what is true
|
|
37
|
+
* of every element here - that it *may* carry a name - without claiming one
|
|
38
|
+
* is present.
|
|
39
|
+
*/
|
|
40
|
+
export type ExtendedUISchemaElement = UISchemaElement & {
|
|
41
|
+
name?: string;
|
|
42
|
+
};
|
|
43
|
+
/** A layout whose children may be named. */
|
|
44
|
+
export type ExtendedLayout = Omit<Layout, 'elements'> & {
|
|
45
|
+
elements: ExtendedUISchemaElement[];
|
|
46
|
+
};
|
|
47
|
+
/** Whether an element carries a usable name. */
|
|
48
|
+
export declare const isNamedUISchemaElement: (uischema: UISchemaElement | undefined) => uischema is NamedUISchemaElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementRender-Dbp2e-Cc.js","names":["ElementRender"],"sources":["../src/components/elementRender.ts"],"sourcesContent":["/**\n * The marker a template layout puts on a child so the JSX engine's\n * `createElement` knows to render it.\n *\n * It lives in its own module, apart from the engine that reads it, purely so\n * that importing the marker does not import the engine. `DynamicJSXRenderer`\n * pulls in Sucrase at module scope; a renderer that only needed this symbol\n * would otherwise drag the whole compiler into the initial bundle and defeat\n * the code split around it.\n *\n * `Symbol.for` rather than `Symbol()`: the marker has to match across module\n * instances, which a duplicated dependency or a separately bundled chunk can\n * produce.\n */\nexport const ElementRender = Symbol.for('jsonforms.element.render');\n"],"mappings":"AAcA,IAAaA,EAAgB,OAAO,IAAI,0BAA0B,E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementRender-y8MK9CCE.mjs","names":["ElementRender"],"sources":["../src/components/elementRender.ts"],"sourcesContent":["/**\n * The marker a template layout puts on a child so the JSX engine's\n * `createElement` knows to render it.\n *\n * It lives in its own module, apart from the engine that reads it, purely so\n * that importing the marker does not import the engine. `DynamicJSXRenderer`\n * pulls in Sucrase at module scope; a renderer that only needed this symbol\n * would otherwise drag the whole compiler into the initial bundle and defeat\n * the code split around it.\n *\n * `Symbol.for` rather than `Symbol()`: the marker has to match across module\n * instances, which a duplicated dependency or a separately bundled chunk can\n * produce.\n */\nexport const ElementRender = Symbol.for('jsonforms.element.render');\n"],"mappings":";AAcA,IAAaA,IAAgB,OAAO,IAAI,0BAA0B"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { JsonFormsRendererRegistryEntry } from '@jsonforms/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type CreateExtendedRenderersOptions = {
|
|
4
|
+
components?: Record<string, React.ComponentType<any>>;
|
|
5
|
+
includeButtonRenderer?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const createExtendedRenderers: (componentsOrOptions?: Record<string, React.ComponentType<any>> | CreateExtendedRenderersOptions) => JsonFormsRendererRegistryEntry[];
|
|
8
|
+
export * from './renderers';
|
|
9
|
+
export * from './components/GenericAdditionalProperties';
|
|
10
|
+
export * from './util/actionContext';
|
|
11
|
+
export * from './util/horizontalLayout';
|
|
12
|
+
export * from './core/ajv';
|
|
13
|
+
export * from './core/keywords';
|
|
14
|
+
export * from './core/dynamicDefaults';
|
|
15
|
+
export * from './core/ajvI18n';
|
|
16
|
+
export { default as extendedTransformKeyword } from './core/transform';
|
|
17
|
+
export * from './core/uiSchema';
|
|
18
|
+
export * from './util/configNamespaces';
|
|
19
|
+
export * from './util/urlPolicy';
|
|
20
|
+
export * from './util/templateUrls';
|
|
21
|
+
export * from './util/additionalErrors';
|
|
22
|
+
export * from './components/ExtendedJsonForms';
|
|
23
|
+
export * from './util/editorDiagnostics';
|
|
24
|
+
export * from './util/extendedControls';
|
|
25
|
+
export * from './util/maskControls';
|
|
26
|
+
export * from './util/cron';
|
|
27
|
+
export * from './util/useCronPicker';
|
|
28
|
+
export * from './util/useDurationControl';
|
|
29
|
+
export * from './util/editorControls';
|
|
30
|
+
export * from './components/editorRendererTypes';
|
|
31
|
+
export * from './util/useEditorAppearance';
|
|
32
|
+
export * from './util/i18nDefaults';
|
|
33
|
+
export * from './util/useExtendedTranslator';
|
|
34
|
+
export * from './util/extendedLocale';
|
|
35
|
+
export * from './util/markup';
|
|
36
|
+
export * from './util/interpolate';
|
|
37
|
+
export * from './util/markdownEscape';
|
|
38
|
+
export * from './locale/bg';
|
|
39
|
+
export * from './renderers/MonacoControlRenderer';
|
|
40
|
+
export * from './renderers/AgGridControlRenderer';
|
|
41
|
+
export { TRUST_DYNAMIC_FUNCTIONS } from '@chobantonov/jsonforms-react-renderer-common/dynamic/dynamicConfig';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./ajvI18n-2UTyJv5g.js");require("./configNamespaces-sboXDudL.js");const t=require("./elementRender-Dbp2e-Cc.js"),n=require("./objectWithoutProperties-6zedhz76.js");let r=require("@chobantonov/jsonforms-react-renderer-common/locale/translate"),i=require("@chobantonov/jsonforms-react-renderer-common/layout/layoutContext"),a=require("@jsonforms/core"),o=require("@jsonforms/react"),s=require("react");s=e.u(s);let c=require("react/jsx-runtime"),l=require("@chobantonov/jsonforms-react-renderer-common/dynamic/DynamicUiProvider"),u=require("valtio"),d=require("@chobantonov/jsonforms-react-renderer-common/core/detailUiSchema"),f=require("@chobantonov/jsonforms-react-renderer-common/mixed/mixedSchema"),p=require("@chobantonov/jsonforms-react-renderer-common/objects/useAdditionalPropertyEntries"),m=require("@chobantonov/jsonforms-react-renderer-common/objects/additionalProperties"),h=require("ajv-errors");h=e.u(h);let g=require("ajv-keywords");g=e.u(g);let _=require("ajv-keywords/dist/definitions/dynamicDefaults");_=e.u(_);let v=require("ajv/dist/compile/codegen"),y=require("lodash/capitalize");y=e.u(y);let b=require("lodash/startCase");b=e.u(b);let x=require("dayjs");x=e.u(x);let S=require("dayjs/plugin/customParseFormat");S=e.u(S);let C=require("dayjs/plugin/duration");C=e.u(C);let w=require("dayjs/plugin/timezone");w=e.u(w);let T=require("dayjs/plugin/utc");T=e.u(T);let E=require("lodash/get");E=e.u(E);let D=require("lodash/isEqual");D=e.u(D);let O=require("@chobantonov/jsonforms-react-renderer-common/formats/maskControls"),k=require("@chobantonov/jsonforms-react-renderer-common/formats/duration"),A=require("@chobantonov/jsonforms-react-renderer-common/dynamic/dynamicConfig"),j=require("@chobantonov/jsonforms-react-renderer-common/core/configNamespaces");var M=(0,a.rankWith)(4,(0,a.and)((0,a.or)((0,a.uiTypeIs)(`HorizontalLayout`),(0,a.uiTypeIs)(`VerticalLayout`)),e=>{var t,n;return String((t=(n=e.options)==null?void 0:n.variant)==null?``:t).toLowerCase()===`splitter`})),N=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?`${e}px`:typeof e==`string`&&e.trim()?e.trim():void 0,P=e=>{let t=e.map(e=>{var t;let n=e==null||(t=e.options)==null||(t=t.layout)==null?void 0:t.weight;return typeof n==`number`&&Number.isFinite(n)&&n>0?n:1}),n=t.reduce((e,t)=>e+t,0);return t.map(e=>e/n*100)},ee=t=>{var n,a;let l=(0,r.useI18n)(),u=t.uischema,d=u.type===`HorizontalLayout`,f=(0,i.useEffectiveElements)(u.elements,t.path,t.config),p=f.length,[m,h]=s.default.useState([]),g=m.length===p?m:P(f),_=e.s(e.s({},t.config),u.options).resizable!==!1,v=((n=u.options)==null?void 0:n.wrap)===!0,y=s.default.useRef(),b=e.s(e.s({},t.config),u.options),x=(e,t,n=g)=>{let r=Math.max(1-n[e],Math.min(n[e+1]-1,t));h(n.map((t,n)=>n===e?t+r:n===e+1?t-r:t))};return t.visible?(0,c.jsx)(`div`,e.s(e.s({},v?{"data-layout-diagnostic":"`wrap` is not supported together with the splitter variant; ignored."}:{}),{},{style:{display:`flex`,flexDirection:d?`row`:`column`,width:`100%`,minWidth:0,height:d?void 0:(a=N(b.height))==null?`20rem`:a,minHeight:d?void 0:N(b.minHeight)},children:f.map((n,r)=>(0,c.jsxs)(s.default.Fragment,{children:[(0,c.jsx)(`div`,{style:{boxSizing:`border-box`,flex:`${g[r]} 1 0`,minWidth:0,minHeight:0,overflow:`auto`,padding:8},children:(0,c.jsx)(o.JsonFormsDispatch,{schema:t.schema,uischema:n,path:t.path,enabled:t.enabled,renderers:t.renderers,cells:t.cells})}),r<p-1&&(0,c.jsx)(`div`,e.s(e.s({role:`separator`},_?{tabIndex:0}:{"aria-disabled":!0}),{},{"aria-label":l(`layout.resizePane`,{index:r+1}),"aria-orientation":d?`vertical`:`horizontal`,"aria-valuemin":1,"aria-valuemax":g[r]+g[r+1]-1,"aria-valuenow":Math.round(g[r]),style:{flex:`0 0 6px`,background:`rgba(128,128,128,0.3)`,cursor:_?d?`col-resize`:`row-resize`:`default`,touchAction:`none`},onKeyDown:e=>{if(!_)return;let t=e.key===(d?`ArrowRight`:`ArrowDown`)?2:e.key===(d?`ArrowLeft`:`ArrowUp`)?-2:0;t&&(e.preventDefault(),x(r,t))},onPointerDown:e=>{if(!_)return;let t=e.currentTarget.parentElement.getBoundingClientRect(),n=d?t.width:t.height;n&&(e.preventDefault(),y.current={index:r,start:d?e.clientX:e.clientY,total:n,sizes:g},e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{let t=y.current;t&&x(t.index,((d?e.clientX:e.clientY)-t.start)/t.total*100,t.sizes)},onPointerUp:()=>{y.current=void 0},onPointerCancel:()=>{y.current=void 0},onLostPointerCapture:()=>{y.current=void 0}}))]},r))})):null},F=(0,o.withJsonFormsLayoutProps)(ee),I=e=>{let t=e==null?[]:e,n=Array.from({length:t.length},()=>void 0),r={},i=[];return t.forEach((e,t)=>{let a=e?(0,l.dynamicAuthoredElement)(e).name:void 0;typeof a==`string`&&a!==``&&(r[a]===void 0?(r[a]=t,n[t]=a):i.push(`template.duplicateChildName: children ${r[a]} and ${t} are both named ${JSON.stringify(a)}; the first one keeps the name.`))}),t.forEach((e,t)=>{if(n[t]!==void 0)return;let a=String(t);r[a]===void 0?(r[a]=t,n[t]=a):i.push(`template.childNameCollision: child ${t} has no name and its index ${JSON.stringify(a)} is already the name of child ${r[a]}, so it cannot be placed. Give it a name.`)}),{names:n,byName:r,diagnostics:i}},te=/\s([a-zA-Z](?:(?!-in-out)[-a-zA-Z_0-9])*-(?:in|out|in-out))(?=[\s/>=])/g,ne=e=>{let t=new Set,n;for(te.lastIndex=0;(n=te.exec(e))!==null;)t.add(n[1]);return[...t]};function re(t){let n=(0,s.useMemo)(()=>t==null?[]:t,[t]),r=(0,s.useMemo)(()=>I(n),[n]);return e.s({children:n},r)}var ie=({ctx:e,schema:t,uischema:n,fireActionEvent:r,external:i})=>{var a,o,s,c,l,u,d,f;return{external:i,config:e.config,readonly:e.readonly===!0,locale:(a=e.i18n)==null?void 0:a.locale,translate:(o=e.i18n)==null?void 0:o.translate,data:(s=e.core)==null?void 0:s.data,schema:t==null?(c=e.core)==null?void 0:c.schema:t,uischema:n,errors:(l=(u=e.core)==null?void 0:u.errors)==null?[]:l,additionalErrors:(d=(f=e.core)==null?void 0:f.additionalErrors)==null?[]:d,fireActionEvent:r}},ae=[`ractive`,`jsx`],oe=`ractive`,se=e=>typeof e==`string`&&ae.includes(e.toLowerCase())?e.toLowerCase():void 0,ce=e=>{var t;let n=(t=(0,j.extendedConfig)(e))==null?void 0:t.security;return!!n&&typeof n==`object`&&n.allowScriptEvaluation===!0},le=(e,t)=>{let n=e==null?void 0:e.lang;if(n!==void 0){let e=se(n);return e?{lang:e}:{requested:String(n),diagnostic:`unsupported`}}let r=(0,j.extendedConfig)(t),i=r==null?void 0:r.defaultTemplateLang;if(i!==void 0){let e=se(i);return e?{lang:e}:{requested:String(i),diagnostic:`unsupported`}}return{lang:oe}},ue=(t,n)=>{let r=le(t,n);return r.lang&&!ce(n)?e.s(e.s({},r),{},{diagnostic:`evaluation-disabled`}):r},de=e=>(0,a.rankWith)(2,(t,n,r)=>(0,a.uiTypeIs)(`TemplateLayout`)(t,n,r)?le(t,r==null?void 0:r.config).lang===e:!1),fe=(0,a.rankWith)(1,(0,a.uiTypeIs)(`TemplateLayout`)),pe={border:`1px solid currentColor`,borderRadius:4,padding:`0.75rem 1rem`,opacity:.85,fontSize:`0.9rem`},me=({uischema:e,config:t,visible:n})=>{let i=(0,r.useI18n)(),a=ue(e,t);if(n===!1||!a.diagnostic)return null;let o=a.diagnostic===`unsupported`?i(`template.unsupported`,{language:JSON.stringify(a.requested)}):i(`template.disabled`);return(0,c.jsx)(`div`,{role:`alert`,"data-template-diagnostic":a.diagnostic,style:pe,children:o})},he={"array.addRow":`Add row`,"array.removeSelected":`Remove selected`,"grid.loading":`Loading data grid...`,"grid.loadError":`Unable to load the data grid.`,"editor.loading":`Loading editor...`,"editor.loadError":`Unable to load the editor.`,"editor.maximize":`Maximize editor`,"editor.restore":`Restore editor`,"editor.invalidJson":`Enter valid JSON.`,"editor.languageErrors":`Code contains {count} errors. Review the marked locations in the editor.`,"editor.languageError":`Code contains 1 error. Review the marked location in the editor.`,"editor.chooseColor":`Choose a color`,"editor.chooseDuration":`Choose a duration`,"color.placeholder.hex":`#RRGGBB`,"color.placeholder.hex3":`#RGB`,"color.placeholder.rgb":`rgb(r, g, b)`,"color.placeholder.hsb":`hsb(h, s%, b%)`,"color.hex3Transparency":`Three-digit hex cannot store transparency. Enter an opaque color, or clear the value.`,"additionalProperties.add":`Add`,"additionalProperties.addLabel":`Add property`,"additionalProperties.addTo":`Add property to {label}`,"additionalProperties.namePlaceholder":`Property name`,"additionalProperties.rename":`Rename`,"additionalProperties.renameNamed":`Rename {name}`,"additionalProperties.save":`Save`,"additionalProperties.cancel":`Cancel`,"additionalProperties.delete":`Delete`,"additionalProperties.nameTaken":`Property '{name}' already defined`,"additionalProperties.nameInvalid":`Property name '{name}' is invalid`,"additionalProperties.namePattern":`Property name must match pattern: {pattern}`,"template.loading":`Loading template engine…`,"template.loadError":`The template engine could not be loaded.`,"template.renderError":`The template could not be rendered.`,"editor.ariaLabel":`Code editor`,"duration.invalid":`Enter an ISO 8601 duration, for example P2DT3H or P2W.`,"markup.markdownDisabled":`Markdown is turned off for this form, so this text is shown as written.`,"markup.unsupported":`Unsupported markup {markup}. This renderer set implements "plain" and "markdown".`,"markup.interpolationFailed":`Could not resolve: {detail}`},ge={"array.addRow":`Добавяне на ред`,"array.removeSelected":`Премахване на избраните`,"grid.loading":`Таблицата се зарежда...`,"grid.loadError":`Таблицата не може да бъде заредена.`,"editor.loading":`Редакторът се зарежда...`,"editor.loadError":`Редакторът не може да бъде зареден.`,"editor.maximize":`Максимизиране на редактора`,"editor.restore":`Възстановяване на редактора`,"editor.invalidJson":`Въведете валиден JSON.`,"editor.chooseColor":`Изберете цвят`,"editor.chooseDuration":`Изберете продължителност`,"template.loading":`Шаблонният механизъм се зарежда…`,"template.loadError":`Шаблонният механизъм не може да бъде зареден.`,"template.renderError":`Шаблонът не може да бъде изобразен.`,"editor.ariaLabel":`Редактор на код`,"duration.invalid":`Въведете продължителност по ISO 8601, например P2DT3H или P2W.`,"additionalProperties.add":`Добавяне`,"additionalProperties.addLabel":`Добавяне на свойство`,"additionalProperties.addTo":`Добавяне на свойство към {label}`,"additionalProperties.namePlaceholder":`Име на свойството`,"additionalProperties.rename":`Преименуване`,"additionalProperties.renameNamed":`Преименуване на {name}`,"additionalProperties.save":`Запазване`,"additionalProperties.cancel":`Отказ`,"additionalProperties.delete":`Изтриване`,"additionalProperties.nameTaken":`Свойството „{name}“ вече е дефинирано`,"additionalProperties.nameInvalid":`Името „{name}“ не е допустимо`,"additionalProperties.namePattern":`Името на свойството трябва да съответства на шаблона: {pattern}`,"markup.markdownDisabled":`Markdown е изключен за тази форма, затова текстът се показва както е написан.`,"markup.unsupported":`Неподдържано маркиране {markup}. Този набор от рендери поддържа „plain“ и „markdown“.`,"markup.interpolationFailed":`Неуспешно изчисляване: {detail}`},_e={en:{},bg:ge},L=_e,ve=e=>{L=e},ye=()=>L,be=e=>e.toLowerCase().replace(/_/g,`-`),xe=(t,n)=>{L=e.s(e.s({},L),{},{[be(t)]:n})},Se=e=>{var t;if(!e)return;let n=be(e);return(t=L[n])==null?L[n.split(`-`)[0]]:t},Ce=(e,t)=>{var n,r;return(n=(r=Se(e))==null?void 0:r[t])==null?he[t]:n},R=()=>{var e,t;let n=(0,o.useJsonForms)(),r=(e=n.i18n)==null?void 0:e.translate,i=(t=n.i18n)==null?void 0:t.locale;return(e,t)=>{let n=Ce(i,e),a=r?r(e,n,t):n;return Object.entries(t==null?{}:t).reduce((e,[t,n])=>e.replace(`{${t}}`,String(n)),a==null?n:a)}};function we(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function z(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){we(a,r,i,o,s,`next`,e)}function s(e){we(a,r,i,o,s,`throw`,e)}o(void 0)})}}var Te=class extends s.default.Component{constructor(...t){super(...t),e.c(this,`state`,{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`template.failed:`,e)}render(){return this.state.failed?this.props.describe():this.props.children}},Ee=(t,n)=>{let r=!1,i=(0,s.lazy)(z(function*(){let e=yield t();return r=!0,{default:e}})),a=t=>{let a=R();return(0,c.jsx)(Te,{describe:()=>{var e;return(0,c.jsx)(`div`,{role:`alert`,"data-template-load-error":!r||void 0,"data-template-render-error":r?!0:void 0,children:a(r?(e=n.renderError)==null?`template.renderError`:e:n.error)})},children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{"aria-busy":`true`,"aria-live":`polite`,"data-template-loading":!0,children:a(n.loading)}),children:(0,c.jsx)(i,e.s({},t))})})};return a.displayName=`LazyTemplate`,a},B={allowedSchemes:[`https`,`http`,`mailto`],allowRelative:!0,allowImageDataUrls:!1},V=e=>{let t=e==null?void 0:e[j.JSONFORMS_EXTENDED_CONFIG_KEY],n=t==null?void 0:t.security,r=n==null?void 0:n.urlPolicy;return r?{allowedSchemes:Array.isArray(r.allowedSchemes)?r.allowedSchemes.map(e=>String(e).toLowerCase()):B.allowedSchemes,allowRelative:r.allowRelative===void 0?B.allowRelative:r.allowRelative===!0,allowImageDataUrls:r.allowImageDataUrls===void 0?B.allowImageDataUrls:r.allowImageDataUrls===!0}:B},De=/^([a-zA-Z][a-zA-Z0-9+.-]*):/,H=(e,t=B)=>{var n;if(typeof e!=`string`)return!1;let r=e.replace(/[\u0000- ]/g,``);if(r===``)return!0;if(r.startsWith(`//`))return!1;let i=(n=De.exec(r))==null||(n=n[1])==null?void 0:n.toLowerCase();return i===void 0?t.allowRelative:t.allowedSchemes.includes(i)},Oe=/^data:image\/[a-zA-Z0-9.+-]+[;,]/,ke=(e,t=B)=>t.allowImageDataUrls&&typeof e==`string`&&Oe.test(e.replace(/[\u0000- ]/g,``))?!0:H(e,t),Ae=Ee(z(function*(){return(yield Promise.resolve().then(()=>require("./DynamicJSXRenderer-Cyw40Kz0.js"))).default}),{loading:`template.loading`,error:`template.loadError`,renderError:`template.renderError`}),je=(0,a.rankWith)(1,(0,a.uiTypeIs)(`TemplateLayout`)),Me=s.default.memo(function(t){return(0,c.jsx)(o.JsonFormsDispatch,e.s({},t))}),Ne=({path:n,enabled:r,schema:i,uischema:a,visible:d,renderers:f,cells:p,config:m,components:h={}})=>{var g,_,v,y;let b=ue(a,m),x=a.template,S=(0,l.useDynamicElements)((g=a.elements)==null?[]:g,n==null?``:n),{names:C,diagnostics:w}=(0,s.useMemo)(()=>I(a.elements),[a.elements]);(0,s.useEffect)(()=>{for(let e of w)console.warn(e)},[w]);let T=(0,s.useMemo)(()=>S.map((a,o)=>{let s=C[o],l=s==null?`\u0000unnamed:${o}`:s;return e.s(e.s({},a),{},{[t.t]:function(){return(0,c.jsx)(Me,{path:n,schema:i,enabled:r,renderers:f,cells:p,uischema:a},l)}})}),[p,r,f,i,S,C,n]),E=(0,s.useMemo)(()=>{let e={};return T.forEach((t,n)=>{let r=C[n];r!==void 0&&(e[r]=t)}),e},[T,C]),D=(0,s.useMemo)(()=>new Proxy(T,{get(e,t){return typeof t==`string`&&E[t]?E[t]:Reflect.get(e,t)}}),[T,E]),O=(0,o.useJsonForms)(),k=(0,l.useDynamicExternal)(),[{dataProxy:A,errorsProxy:j,additionalErrorsProxy:M}]=s.default.useState(()=>{var e,t,n;return{dataProxy:(0,u.proxy)({__val__:(e=O.core)==null?void 0:e.data}),errorsProxy:(0,u.proxy)({__val__:(t=O.core)==null?void 0:t.errors}),additionalErrorsProxy:(0,u.proxy)({__val__:(n=O.core)==null?void 0:n.additionalErrors})}});(0,s.useEffect)(()=>{var e,t,n;let r=(e,t)=>{if(t==null||e.__val__===null||e.__val__===void 0){e.__val__=t;return}let n=(e,t)=>{if(t!=null){if(Array.isArray(t)){if(!Array.isArray(e))return t;t.forEach((t,r)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){(!e[r]||typeof e[r]!=`object`||Array.isArray(e[r]))&&(e[r]={});let i=n(e[r],t);i!==void 0&&(e[r]=i)}else if(Array.isArray(t)){Array.isArray(e[r])||(e[r]=[]);let i=n(e[r],t);i!==void 0&&(e[r]=i)}else e[r]=t}),e.length>t.length&&e.splice(t.length)}else if(typeof t==`object`&&!Array.isArray(t)){if(typeof e!=`object`||Array.isArray(e))return t;Object.keys(t).forEach(r=>{if(t[r]&&typeof t[r]==`object`&&!Array.isArray(t[r])){(!e[r]||typeof e[r]!=`object`||Array.isArray(e[r]))&&(e[r]={});let i=n(e[r],t[r]);i!==void 0&&(e[r]=i)}else e[r]=t[r]})}else return t}},r=n(e.__val__,t);r!==void 0&&(e.__val__=r)};r(A,(e=O.core)==null?void 0:e.data),r(j,(t=O.core)==null?void 0:t.errors),r(M,(n=O.core)==null?void 0:n.additionalErrors)},[(_=O.core)==null?void 0:_.data,(v=O.core)==null?void 0:v.errors,(y=O.core)==null?void 0:y.additionalErrors,A,j,M]);let N=(0,s.useMemo)(()=>{var t,n;return e.s({elements:D,schema:i,uischema:a,data:A,errors:j,additionalErrors:M,translate:(t=O.i18n)==null?void 0:t.translate,locale:(n=O.i18n)==null?void 0:n.locale,context:ie({ctx:O,schema:i,uischema:a,external:k})},h)},[D,i,a,A,j,M,O,h,k]);if(!d)return null;let P=`
|
|
2
|
+
function Template(props) {
|
|
3
|
+
${`const { ${Object.keys(N).filter(e=>![`data`,`errors`,`additionalErrors`].includes(e)).join(`, `)} } = props;`}
|
|
4
|
+
|
|
5
|
+
const data = useTrackedSnapshot(props.data);
|
|
6
|
+
const errors = useTrackedSnapshot(props.errors);
|
|
7
|
+
const additionalErrors = useTrackedSnapshot(props.additionalErrors);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<React.Fragment>
|
|
11
|
+
${x.replace(/<\s*\/\s*React\.Fragment\s*>/g,``)}
|
|
12
|
+
</React.Fragment>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
`;return b.diagnostic?(0,c.jsx)(me,{uischema:a,config:m,visible:d}):(0,c.jsx)(Ae,{jsxTemplate:P,props:N,urlPolicy:V(m)})},Pe=Ee(z(function*(){return(yield Promise.resolve().then(()=>require("./RactiveTemplate-7L44A38e.js"))).RactiveTemplate}),{loading:`template.loading`,error:`template.loadError`,renderError:`template.renderError`}),Fe=`data-jsonforms-slot`,Ie=e=>{var t;let{uischema:n,schema:r,path:i,enabled:a,visible:u,renderers:d,cells:f,config:p}=e,m=(0,o.useJsonForms)(),h=(0,l.useDynamicExternal)(),g=ue(n,p),{children:_,names:v,diagnostics:y}=re(n.elements),b=JSON.stringify(v);(0,s.useEffect)(()=>{for(let e of y)console.warn(e)},[y]);let x=(t=n.template)==null?``:t;(0,s.useEffect)(()=>{let e=ne(x);e.length>0&&console.warn(`template.ractiveTransitionAttribute: ${JSON.stringify(e)} end in -in, -out or -in-out, which Ractive parses as transition directives. This profile registers no transitions, so they are dropped from the DOM. Rename them.`)},[x]);let S=(0,s.useMemo)(()=>{let e={};for(let t of JSON.parse(b))t!==null&&(e[t]=`<div ${Fe}="${t}"></div>`);return e},[b]),C=(0,s.useMemo)(()=>{let e={},t=I(_).names;return _.forEach((n,s)=>{let l=t[s];l!==void 0&&(e[l]=(0,c.jsx)(o.JsonFormsDispatch,{uischema:n,schema:r,path:i,enabled:a,renderers:d,cells:f}))}),e},[_,r,i,a,d,f]),w=(0,s.useMemo)(()=>{var e,t,i;return{data:(e=m.core)==null?void 0:e.data,errors:(t=m.core)==null?void 0:t.errors,context:ie({ctx:m,schema:r,uischema:n,external:h}),elements:I((i=n.elements)==null?[]:i).names.filter(e=>e!==void 0).map(e=>({name:e})),translate:(e,t)=>{var n,r,i,a;return(n=(r=(i=m.i18n)==null||(a=i.translate)==null?void 0:a.call(i,e,t))==null?t:r)==null?e:n}}},[m,r,n,h]);return u===!1?null:g.diagnostic?(0,c.jsx)(me,{uischema:n,config:p,visible:u}):(0,c.jsx)(Pe,{template:x,partials:S,data:w,slots:C,urlPolicy:V(p)})},Le=s.default.createContext(void 0),U=()=>s.default.useContext(Le),Re=(0,a.rankWith)(5,(0,a.and)((0,a.uiTypeIs)(`TemplateLayout`),e=>typeof(e==null?void 0:e.template)==`function`)),ze=s.default.createContext(void 0),Be=({name:e,children:t})=>{let n=s.default.useContext(ze),r=n==null?void 0:n.byName[e];if(!n||!r){var i;return console.warn(`template.unknownSlot: no child is named ${JSON.stringify(e)}; known names are ${JSON.stringify(Object.keys((i=n==null?void 0:n.byName)==null?{}:i))}.`),(0,c.jsx)(c.Fragment,{children:t==null?null:t})}return(0,c.jsx)(o.JsonFormsDispatch,{uischema:r,schema:n.schema,path:n.path,enabled:n.enabled,renderers:n.renderers,cells:n.cells})},Ve=e=>{var t,n,r,i,u;let{uischema:d,schema:f,path:p,enabled:m,visible:h,renderers:g,cells:_}=e,v=(0,o.useJsonForms)(),y=(0,l.useDynamicExternal)(),b=U(),{children:x,names:S,diagnostics:C}=re(d.elements);(0,s.useEffect)(()=>{for(let e of C)console.warn(e)},[C]);let w=(0,l.useDynamicElements)(x,p==null?``:p),T=(0,s.useMemo)(()=>{let e={};return w.forEach((t,n)=>{let r=S[n];r!==void 0&&(e[r]=t)}),e},[w,S]),E=(0,s.useCallback)((e,t)=>{var n;m!==!1&&((n=v.dispatch)==null||n.call(v,a.Actions.update(e,()=>t)))},[v,m]);if(h===!1)return null;let D=d.template;return typeof D==`function`?(0,c.jsx)(ze.Provider,{value:{byName:T,schema:f,path:p,enabled:m,renderers:g,cells:_},children:D({data:(t=v.core)==null?void 0:t.data,path:p==null?``:p,errors:(n=(r=v.core)==null?void 0:r.errors)==null?[]:n,schema:f,uischema:d,elements:T,Slot:Be,enabled:m!==!1,readonly:v.readonly===!0,handleChange:E,translate:(i=(u=v.i18n)==null?void 0:u.translate)==null?(e=>e):i,urlPolicy:V(v.config),context:ie({ctx:v,schema:f,uischema:d,fireActionEvent:b,external:y})})}):null},He=(0,o.withJsonFormsLayoutProps)(Ve),Ue=function(){var e=z(function*(e,t){if(typeof e==`function`){yield e.call(t,t);return}let n=Object.getPrototypeOf(z(function*(){})).constructor;yield new n(e).call(t)});return function(t,n){return e.apply(this,arguments)}}(),We=(0,a.rankWith)(2,(0,a.uiTypeIs)(`Button`)),Ge={border:`1px solid currentColor`,borderRadius:4,padding:`0.5rem 0.75rem`,opacity:.85,fontSize:`0.85rem`},Ke=({withProps:t=!0,ButtonComponent:n=`button`,buttonProps:i={},getButtonProps:l}={})=>{let u=t=>{var u,d,f,p,m,h;let{enabled:g,uischema:_,visible:v,config:y,t:b}=t,x=(0,r.useI18n)(),S=U(),C=(0,o.useJsonForms)(),[w,T]=(0,s.useState)(!1),E=(0,s.useRef)(!1),D=_,O=(u=(d=(f=(p=(0,a.deriveLabelForUISchemaElement)(D,b))==null?D.label:p)==null?D.text:f)==null?D.name:d)==null?x(`button.action`):u,k=D.script,A=(m=D.action)==null?k===void 0?D.name:void 0:m,j=(0,s.useMemo)(()=>{var e;return(e=D.params)==null?{}:e},[D.params]),M=(0,s.useCallback)(z(function*(){if(E.current)return;E.current=!0,T(!0);let e={action:A==null?``:A,label:O,params:j,element:D,context:C};try{k!==void 0&&A===void 0?yield Ue(k,e):yield S==null?void 0:S(e)}finally{E.current=!1,T(!1)}}),[A,O,j,k,D,S,C]);if((0,s.useEffect)(()=>{D.action!==void 0&&D.script!==void 0&&console.warn(`action.conflict: ${JSON.stringify(O)} declares both an action and a script, which are mutually exclusive. The action is used.`)},[D.action,D.script,O]),!v)return null;if(typeof k==`string`&&!ce(y))return(0,c.jsx)(`div`,{role:`alert`,"data-button-diagnostic":`script.evaluationDisabled`,style:Ge,children:x(`button.scriptDisabled`,{label:O})});let N=!g||((h=D.options)==null?void 0:h.disabled)===!0||w,P=l==null?void 0:l(e.s(e.s({},t),{},{pending:w,color:D.color,icon:D.icon}));return(0,c.jsx)(n,e.s(e.s(e.s({type:`button`},i),P),{},{disabled:N,"aria-busy":w||void 0,"data-button-pending":w||void 0,onClick:M,children:O}))};return t?(0,o.withJsonFormsLayoutProps)((0,o.withTranslateProps)(u)):u},qe=Ke(),W=s.default.createContext({}),Je=e=>typeof e.name==`string`,Ye=(0,a.rankWith)(2,(0,a.and)((0,a.uiTypeIs)(`Template`),Je)),Xe=t=>{var n;let r=(0,o.useJsonForms)(),i=s.default.useContext(W),a=t.uischema,l=s.default.useMemo(()=>{var t;return e.s(e.s({},i),((t=a.elements)==null?[]:t).reduce((e,t)=>{let n=t.name;return n&&(e[n]=t),e},{}))},[a.elements,i]),u=(n=r.uischemas)==null||(n=n.find(e=>e.uischema.name===a.name))==null?void 0:n.uischema;return!t.visible||!u?null:(0,c.jsx)(W.Provider,{value:l,children:(0,c.jsx)(o.JsonFormsDispatch,{schema:t.schema,uischema:u,path:t.path,enabled:t.enabled,renderers:t.renderers,cells:t.cells})})},Ze=(0,o.withJsonFormsLayoutProps)(Xe),Qe=(0,a.rankWith)(2,(0,a.uiTypeIs)(`Slot`)),$e=e=>{var t,n;let r=s.default.useContext(W),i=e.uischema,a=(t=i.elements)==null?void 0:t[0],l=i.name?(n=r[i.name])==null?a:n:a;return!e.visible||!l?null:(0,c.jsx)(o.JsonFormsDispatch,{schema:e.schema,uischema:l,path:e.path,enabled:e.enabled,renderers:e.renderers,cells:e.cells})},et=(0,o.withJsonFormsLayoutProps)($e),tt=(0,a.rankWith)(1,(0,a.uiTypeIs)(`Spacer`)),nt=32,rt=e=>typeof e==`number`?`${e}px`:e,it=e=>{let t=e==null?void 0:e.size;return typeof t==`number`&&Number.isFinite(t)?Math.max(0,t):typeof t==`string`&&t.trim().length>0?t:nt},at=({uischema:e,visible:t})=>{var n;let r=it(e),i=e==null||(n=e.options)==null||(n=n.layout)==null?void 0:n.weight,a=typeof i==`number`&&Number.isFinite(i)&&i>0;return t?(0,c.jsx)(`div`,{"aria-hidden":`true`,"data-spacer":!0,style:a?{flex:`${i} 1 0`,minWidth:0,minHeight:0}:{flexShrink:0,height:rt(r),width:`100%`}}):null},ot=(0,o.withJsonFormsLayoutProps)(at),st=(0,a.rankWith)(1,(0,a.uiTypeIs)(`ImageView`)),ct=e=>{if(e===void 0)return!1;let t=e.type;return t===void 0?!0:Array.isArray(t)?t.includes(`string`):t===`string`},lt=(e,t)=>{var n,r;let i=[],o=e.src,s=e.alt;s===void 0&&i.push({code:`image.missingAlt`,severity:`warning`,message:'ImageView requires a top-level `alt`. Use `alt: ""` to mark the image decorative.'});let c=s==null?``:s,l=V(t.config),u=e=>{if(e!==``){if(!ke(e,l))i.push({code:`image.urlRefused`,severity:`error`,message:`The image source is blocked by the configured URL policy. Use an allowed image URL or adjust the image URL policy.`});else return e}};if(o!==void 0)return{src:u(o),alt:c,diagnostics:i};if(e.scope===void 0)return i.push({code:`image.noSource`,severity:`error`,message:"ImageView requires at least one of `src` and `scope`."}),{alt:c,diagnostics:i};if(!ct(a.Resolve.schema((n=t.schema)==null?t.rootSchema:n,e.scope,t.rootSchema)))return i.push({code:`image.scopeNotString`,severity:`error`,message:`The schema at ${e.scope} does not permit strings.`,values:{scope:e.scope}}),{alt:c,diagnostics:i};let d=(0,a.composePaths)((r=t.path)==null?``:r,(0,a.toDataPath)(e.scope)),f=a.Resolve.data(t.data,d);return f==null||f===``?{alt:c,diagnostics:i}:typeof f==`string`?{src:u(f),alt:c,diagnostics:i}:(i.push({code:`image.nonStringSource`,severity:`error`,message:`The value at ${e.scope} is a ${typeof f}, not a URL string.`,values:{scope:e.scope,type:typeof f}}),{alt:c,diagnostics:i})},ut={border:`1px solid currentColor`,borderRadius:4,padding:`0.5rem 0.75rem`,boxSizing:`border-box`,minWidth:0,maxWidth:`100%`,display:`flex`,alignItems:`center`,gap:`0.5rem`,overflowWrap:`anywhere`,fontSize:`0.85rem`},dt=({diagnostic:e})=>{let t=(0,r.useI18n)(),[n,i]=s.default.useState(!1),a=s.default.useId();return(0,c.jsxs)(`div`,{role:`alert`,"data-image-diagnostic":e.code,style:ut,children:[(0,c.jsxs)(`span`,{style:{position:`relative`,display:`inline-flex`,flexShrink:0},onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[(0,c.jsx)(`button`,{type:`button`,"aria-label":t(`image.warningDetails`),"aria-describedby":n?a:void 0,onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>i(!0),onKeyDown:e=>{e.key===`Escape`&&i(!1)},style:{display:`inline-flex`,padding:0,border:0,background:`transparent`,color:`inherit`,cursor:`help`},children:(0,c.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,"aria-hidden":`true`,children:[(0,c.jsx)(`path`,{d:`M12 3 2 21h20L12 3Z`}),(0,c.jsx)(`path`,{d:`M12 9v5`}),(0,c.jsx)(`circle`,{cx:`12`,cy:`17`,r:`.75`})]})}),n&&(0,c.jsx)(`span`,{id:a,role:`tooltip`,style:{position:`absolute`,top:`100%`,left:0,zIndex:10,width:`min(22rem, 70vw)`,boxSizing:`border-box`,padding:`0.5rem 0.75rem`,background:`Canvas`,color:`CanvasText`,border:`1px solid currentColor`,borderRadius:4,overflowWrap:`anywhere`,fontWeight:`normal`},children:t(e.code,e.values)})]}),(0,c.jsx)(`span`,{children:e.code===`image.urlRefused`?t(`image.blocked`):t(`image.configurationWarning`)})]})},ft=({config:e,uischema:t,schema:n,path:r,visible:i})=>{var a,s;let l=(0,o.useJsonForms)(),u=lt(t,{schema:n,rootSchema:(a=l.core)==null?void 0:a.schema,data:(s=l.core)==null?void 0:s.data,path:r,config:e});return i===!1?null:(0,c.jsxs)(c.Fragment,{children:[u.src!==void 0&&(0,c.jsx)(`img`,{src:u.src,alt:u.alt,style:{maxWidth:`100%`,height:`auto`}}),u.diagnostics.map(e=>(0,c.jsx)(dt,{diagnostic:e},e.code))]})},pt=(0,o.withJsonFormsLayoutProps)(ft),mt=(0,a.rankWith)(1,(0,a.uiTypeIs)(`Separator`)),ht=({uischema:e,visible:t})=>{var n;return t===!1?null:((n=e.options)==null?void 0:n.vertical)===!0?(0,c.jsx)(`hr`,{"aria-orientation":`vertical`,"data-separator":`vertical`,style:{alignSelf:`stretch`,width:0,height:`auto`,margin:0,borderLeft:`1px solid currentColor`,borderTop:0,opacity:.3}}):(0,c.jsx)(`hr`,{"aria-orientation":`horizontal`,"data-separator":`horizontal`})},gt=(0,o.withJsonFormsLayoutProps)(ht),_t=(0,a.rankWith)(1,(0,a.uiTypeIs)(`Link`)),vt=(e,t)=>{let n=(t==null?``:t).split(/\s+/).filter(Boolean);if(e===`_blank`)for(let e of[`noopener`,`noreferrer`])n.includes(e)||n.push(e);return n.length>0?n.join(` `):void 0},yt=({uischema:e,visible:t,config:n,t:r})=>{var i,o;let s=e;if(!t)return null;let l=(i=(o=(0,a.deriveLabelForUISchemaElement)(s,r))==null?s.label:o)==null?s.href:i,u=s.href;return typeof u==`string`&&u!==``&&H(u,V(n))?(0,c.jsx)(`a`,{href:u,target:s.target,rel:vt(s.target,s.rel),children:l}):(0,c.jsx)(`span`,{"data-link-inert":!0,children:l})},bt=(0,o.withTranslateProps)((0,o.withJsonFormsLayoutProps)(yt)),xt=({label:e})=>(0,c.jsx)(`div`,{"aria-busy":`true`,"aria-live":`polite`,style:{minHeight:`4rem`},children:e}),St=({label:e})=>(0,c.jsx)(`div`,{role:`alert`,children:e}),Ct=class extends s.default.Component{constructor(...t){super(...t),e.c(this,`state`,{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}},wt=(t,n,r)=>{var i,a;let o=(i=n.Loading)==null?xt:i,l=(a=n.LoadError)==null?St:a,u=(0,s.lazy)(z(function*(){return{default:yield t()}})),d=t=>{let n=R();return(0,c.jsx)(Ct,{fallback:(0,c.jsx)(l,{label:n(r.error)}),children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(o,{label:n(r.loading)}),children:(0,c.jsx)(u,e.s({},t))})})};return d.displayName=`LazyControl(${r.loading})`,d},Tt=e=>{let t=[],n=``,r=0,i=()=>{n&&(t.push({kind:`literal`,text:n}),n=``)};for(;r<e.length;){let a=e[r];if(a===`{`&&e[r+1]===`{`){n+=`{`,r+=2;continue}if(a===`}`&&e[r+1]===`}`){n+=`}`,r+=2;continue}if(a!==`{`){n+=a,r+=1;continue}let o=r+1,s,c=!1;for(;o<e.length;){let t=e[o];if(s){if(t===`\\`){o+=2;continue}t===s&&(s=void 0)}else if(t===`"`||t===`'`)s=t;else if(t===`}`){c=!0;break}o+=1}if(!c){n+=e.slice(r);break}i(),t.push({kind:`expression`,source:e.slice(r+1,o)}),r=o+1}return i(),t},Et=e=>e.some(e=>e.kind===`expression`),Dt=e=>/\{\{\s*[A-Za-z_$][\w$]*(\.[\w$]+|\[[^\]]*\])*\s*\}\}/.test(e),Ot=e=>e==null?void 0:e[j.JSONFORMS_EXTENDED_CONFIG_KEY],kt=e=>{var t;return((t=Ot(e))==null||(t=t.dynamicValues)==null?void 0:t.enabled)===!0},At=[`data`,`item`,`config`,`context`],jt=e=>{var t;let n={locale:(t=e.locale)==null?`en`:t};if(e.dynamicAllowed){var r,i,a;n.data=(r=e.data)==null?{}:r,Object.defineProperty(n,"item",{enumerable:!0,get:()=>e.item}),n.config=(i=e.config)==null?{}:i,n.context=(a=e.context)==null?{}:a}return n},Mt=[`locale`],Nt=(t,n)=>e.s(e.s({},t),{},{locale:n==null?`en`:n}),Pt=e=>Object.keys(e==null?{}:e).filter(e=>Mt.includes(e)),Ft=e=>(e==null?void 0:e.interpolate)===!0,It=(0,s.lazy)(z(function*(){let{renderTemplate:e,resolveTextParams:t}=yield Promise.resolve().then(()=>require("./celTemplate-Cl0alaCz.js")).then(e=>e.t);return{default:({segments:n,textParams:r,namespaceScope:i,locale:a,translate:o,escape:s,children:l})=>{let u=t(r,i,a,o),d=e(n,Nt(u.params,a),s,a,o);return(0,c.jsx)(c.Fragment,{children:l({text:d.text,failures:[...u.failures,...d.failures]})})}}})),Lt=({segments:e,textParams:t,namespaceScope:n,locale:r,translate:i,escape:a,children:o,fallback:l})=>(0,c.jsx)(Ct,{fallback:l,children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`span`,{role:`status`,"aria-busy":`true`,children:`…`}),children:(0,c.jsx)(It,{segments:e,textParams:t,namespaceScope:n,locale:r,translate:i,escape:a,children:o})})}),Rt=e=>{let t=e.options,n=t==null?void 0:t.markup;return Ft(t)||n!==void 0&&n!==`plain`},zt=(0,a.rankWith)(3,(e,t,n)=>(0,a.uiTypeIs)(`Label`)(e,t,n)&&Rt(e)),Bt=(0,s.lazy)(z(function*(){return{default:(yield Promise.resolve().then(()=>require("./MarkupLabelRenderer.impl-DnuzIPQg.js"))).MarkdownText}})),Vt={display:`block`,fontSize:`0.85em`,opacity:.85},Ht=({uischema:e,text:t,visible:i,config:a,typography:l})=>{var u,d,f,p;let m=R(),h=(0,r.useI18n)(),g=(0,o.useJsonForms)();if(i===!1)return null;let _=e==null?void 0:e.options,v=n.i(_,a),y=t==null?``:t,b=v.diagnostic?(0,c.jsx)(`span`,{role:`alert`,"data-markup-diagnostic":v.diagnostic,style:Vt,children:v.diagnostic===`markdownDisabled`?m(`markup.markdownDisabled`):m(`markup.unsupported`,{markup:JSON.stringify(_==null?void 0:_.markup)})}):null,x=v.typography?l:void 0,S=v.interpolate?Tt(y):void 0,C=S&&Et(S)?S:void 0,w=S?S.map(e=>e.kind===`literal`?e.text:``).join(``):y,T=_==null?void 0:_.textParams,E=C?jt({data:(u=g.core)==null?void 0:u.data,get item(){return g.item},locale:(d=g.i18n)==null?void 0:d.locale,config:a,dynamicAllowed:kt(a)}):{},D=Pt(T);if(!v.markdown&&!C)return(0,c.jsxs)(`label`,{"data-markup-label":`plain`,children:[x?(0,c.jsx)(x,{block:!1,children:w}):w,b]});let O=e=>(0,c.jsx)(Ct,{fallback:e,children:(0,c.jsx)(s.Suspense,{fallback:e,children:(0,c.jsx)(Bt,{text:e,profile:n.r(a),urlPolicy:V(a)})})}),k=e=>v.markdown?O(e):e;return((e,t)=>{let n=x?(0,c.jsx)(x,{block:v.markdown,children:e}):e;return v.markdown?(0,c.jsxs)(`div`,{"data-markup-label":`markdown`,children:[n,t]}):(0,c.jsxs)(`label`,{"data-markup-label":`interpolated`,children:[n,t]})})(C?(0,c.jsx)(Lt,{segments:C,textParams:T,namespaceScope:E,locale:(f=g.i18n)==null?void 0:f.locale,translate:(p=g.i18n)==null?void 0:p.translate,escape:v.markdown?n.s:void 0,fallback:w,children:e=>(0,c.jsxs)(c.Fragment,{children:[k(e.text),e.failures.length>0||D.length>0?(0,c.jsx)(`span`,{role:`alert`,"data-markup-diagnostic":`interpolationFailed`,style:Vt,children:m(`markup.interpolationFailed`,{detail:[...D.map(e=>h(`markup.reservedParam`,{name:e})),...e.failures].join(`; `)})}):null]})}):k(w),b)},Ut=(0,o.withJsonFormsLabelProps)(Ht),Wt=t=>(0,o.withJsonFormsLabelProps)(n=>(0,c.jsx)(Ht,e.s(e.s({},n),{},{typography:t}))),Gt=(t,n,r)=>{let i=e.s(e.s({},typeof t==`object`?t:{}),{},{type:n});if(delete i.anyOf,delete i.oneOf,delete i.allOf,(0,f.removeInapplicableKeywords)(i,n),n===`object`){var a;i.additionalProperties=(a=i.additionalProperties)==null||a}else if(n===`array`){let e=(0,f.resolveMixedArrayItems)(i.items,r);i.items=e&&typeof e==`object`?e:{type:f.ANY_TYPES}}return i},Kt=({cells:e,data:t,enabled:n,handleChange:i,label:l,path:u,renderers:p,readonly:m,rootSchema:h,schema:g,uischema:_,visible:v})=>{let y=(0,r.useI18n)(),b=(0,r.useTranslator)(),x=(0,o.useJsonForms)(),S=(0,s.useMemo)(()=>{var e;return(e=x.uischemas)==null?[]:e},[x.uischemas]),C=(0,s.useMemo)(()=>(0,f.getSchemaTypes)(g),[g]),w=(0,f.getJsonDataType)(t),T=w&&C.includes(w)?w:w===`integer`&&C.includes(`number`)?`number`:null,E=(0,s.useMemo)(()=>T?Gt(g,T,h):void 0,[h,g,T]),D=(0,s.useMemo)(()=>E?(0,d.findMixedDetailUiSchema)(E,_,u,h,S==null?[]:S,a.findUISchema):void 0,[u,h,E,_,S]);if(!v)return null;let O=T!==`null`&&E&&D?(0,c.jsx)(o.JsonFormsDispatch,{schema:E,uischema:D,path:u,enabled:n,renderers:p,cells:e,readonly:m}):null,k=T===`object`||T===`array`;return(0,c.jsxs)(`div`,{className:`jsonforms-mixed-renderer`,children:[(0,c.jsxs)(`label`,{className:`jsonforms-mixed-renderer-type`,children:[l?(0,c.jsx)(`span`,{children:l}):null,(0,c.jsxs)(`select`,{disabled:!n,value:T==null?``:T,onChange:e=>{let t=e.currentTarget.value,n=Gt(g,t,h);i(u,(0,a.createDefaultValue)(n,h))},children:[(0,c.jsx)(`option`,{disabled:!0,value:``,children:y(`mixed.typePlaceholder`)}),C.map(e=>(0,c.jsx)(`option`,{value:e,children:b(`mixed.type.${e}`,e)},b(`mixed.type.${e}`,e)))]})]}),k?(0,c.jsxs)(`details`,{className:`jsonforms-mixed-renderer-detail`,open:!0,children:[(0,c.jsx)(`summary`,{children:T}),O]},T):O]})},qt=(e,t,n)=>{if(t&&typeof t==`boolean`)return!0;if(!t||typeof t!=`object`)return!1;if(Array.isArray(t.type)||t.type===void 0&&(0,a.isControl)(e))return!0;if(t.type===`object`){let r=e.scope;if(r){let e=(0,a.resolveSchema)(t,r,n==null?void 0:n.rootSchema);return Array.isArray(e==null?void 0:e.type)}}return!1},Jt=(0,f.mixedControlFor)(qt),Yt=(0,a.rankWith)(20,Jt),Xt=(0,o.withJsonFormsControlProps)(Kt),Zt=16,Qt=e=>e==null||e===`auto`||typeof e==`number`&&Number.isInteger(e)&&e>=2&&e<=16,$t=(e,t=`1rem`)=>{let n=e.map(e=>typeof e==`number`&&Qt(e)?e:void 0),r=[[]],i=n.every(e=>e===void 0),a=0;return n.forEach((e,t)=>{let n=e==null?2:e;!i&&a+n>16&&(r.push([]),a=0),r[r.length-1].push(t),a+=n}),r.flatMap((r,i)=>{let a=r.reduce((e,t)=>{var r;return e+((r=n[t])==null?0:r)},0),o=r.filter(e=>n[e]===void 0).length;return r.map(s=>{var c;let l=(c=n[s])==null?(16-a)/o:c,u=l/16;return{row:i,columns:l,style:{flex:`0 0 calc(${u*100}% - ${t} * ${(r.length-1)*u})`,minWidth:0},diagnostic:Qt(e[s])?void 0:`Columns must be Auto or an integer from 2 through 16.`}})})},en=(0,a.rankWith)(3,(0,a.uiTypeIs)(`HorizontalLayout`)),tn=e=>{var t;let n=(0,o.useJsonForms)(),r={jsonforms:n},i=((t=e.uischema.elements)==null?[]:t).map((e,t)=>({element:e,index:t})).filter(({element:t})=>{var i;return(0,a.isVisible)(t,(i=n.core)==null?void 0:i.data,e.path,(0,a.getAjv)(r),(0,a.getConfig)(r))}),s=`1rem`,l=$t(i.map(({element:e})=>{var t;return(t=e.options)==null?void 0:t.columns}),s);return e.visible?(0,c.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:s,width:`100%`,minWidth:0},children:Array.from(new Set(l.map(({row:e})=>e))).map(t=>(0,c.jsx)(`div`,{"data-columns-row":t,style:{display:`flex`,gap:s,minWidth:0},children:i.map(({element:n,index:r},i)=>{let a=l[i];return a.row===t?(0,c.jsx)(`div`,{style:a.style,"data-columns":a.columns,"data-columns-diagnostic":a.diagnostic,children:(0,c.jsx)(o.JsonFormsDispatch,{schema:e.schema,uischema:n,path:e.path,enabled:e.enabled,renderers:e.renderers,cells:e.cells})},`${e.path}-${r}`):null})},t))}):null},nn=(0,o.withJsonFormsLayoutProps)(tn),rn=(e,t)=>{let n=(0,m.toObjectSchema)(e),r=n.propertyNames;if(typeof r==`object`&&typeof r.$ref==`string`){var i;r=(i=(0,a.resolveSchema)(t,r.$ref,t))==null?r:i}if(typeof r==`object`&&r.pattern)return r.pattern;if(n.additionalProperties===!1&&n.patternProperties){let e=Object.keys(n.patternProperties);return e.length>0?e.join(`|`):void 0}},an=(e,t,n,r,i,a)=>{if(!t)return;if(typeof n==`object`&&n&&Object.prototype.hasOwnProperty.call(n,t)&&t!==a)return e(`additionalProperties.nameTaken`,{name:t});if(t.includes(`[`)||t.includes(`]`)||t.includes(`.`))return e(`additionalProperties.nameInvalid`,{name:t});let o=rn(r,i);if(o&&!new RegExp(o).test(t))return e(`additionalProperties.namePattern`,{pattern:o})},on=({cells:t,config:n,data:r,enabled:i,handleChange:l,label:u,path:d,readonly:f,renderers:h,rootSchema:g,schema:_,uischema:v})=>{let y=R(),[b,x]=(0,s.useState)(``),[S,C]=(0,s.useState)(null),[w,T]=(0,s.useState)(``),{maxPropertiesReached:E,minPropertiesReached:D,appliedOptions:O,objectData:k,allowIfMissing:A,additionalPropertyItems:j,shouldShow:M}=(0,p.useAdditionalPropertyItems)({data:r,schema:_,rootSchema:g,path:d,uischema:v,config:n});if(!M)return null;let N=b.trim(),P=an(y,N,r,_,g),ee=!i||f||O.restrict&&E||!!P||!N,F=!i||f||O.restrict&&D,I=()=>{if(ee)return;let t=(0,m.toAdditionalPropertyItem)(N,d,_,g,A),n=k?e.s({},k):{};n[N]=(0,a.createDefaultValue)(t.schema,g),l(d,n),x(``)},te=t=>{if(F||!k)return;let n=e.s({},k);delete n[t],l(d,n)},ne=e=>{let t=w.trim();!an(y,t,r,_,g,e)&&t&&t!==e&&k&&(l(d,(0,m.renamePropertyKey)(k,e,t)),C(null),T(``))};return(0,c.jsxs)(`div`,{className:`jsonforms-additional-properties`,children:[(0,c.jsxs)(`div`,{className:`jsonforms-additional-properties-add`,children:[(0,c.jsx)(`input`,{"aria-label":u?y(`additionalProperties.addTo`,{label:u}):y(`additionalProperties.addLabel`),disabled:!i||f,placeholder:y(`additionalProperties.namePlaceholder`),type:`text`,value:b,onChange:e=>x(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&I()}}),(0,c.jsx)(`button`,{disabled:ee,type:`button`,onClick:I,children:y(`additionalProperties.add`)})]}),P?(0,c.jsx)(`div`,{className:`jsonforms-additional-properties-error`,children:P}):null,(0,c.jsx)(`div`,{className:`jsonforms-additional-properties-list`,children:j.map(e=>{let n=S===e.propertyName,a=an(y,w.trim(),r,_,g,e.propertyName),s=!i||f||!!a||!w.trim()||w.trim()===e.propertyName;return(0,c.jsxs)(`div`,{className:`jsonforms-additional-property`,children:[(0,c.jsx)(`div`,{className:`jsonforms-additional-property-control`,children:(0,c.jsx)(o.JsonFormsDispatch,{schema:e.schema,uischema:e.uischema,path:e.path,enabled:i,renderers:h,cells:t,readonly:f})}),i?(0,c.jsx)(`div`,{className:`jsonforms-additional-property-actions`,children:n?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`input`,{"aria-label":y(`additionalProperties.renameNamed`,{name:e.propertyName}),autoFocus:!0,disabled:f,type:`text`,value:w,onChange:e=>T(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`?ne(e.propertyName):t.key===`Escape`&&(C(null),T(``))}}),(0,c.jsx)(`button`,{disabled:s,type:`button`,onClick:()=>ne(e.propertyName),children:y(`additionalProperties.save`)}),(0,c.jsx)(`button`,{type:`button`,onClick:()=>{C(null),T(``)},children:y(`additionalProperties.cancel`)}),a?(0,c.jsx)(`div`,{className:`jsonforms-additional-properties-error`,children:a}):null]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`button`,{disabled:f,type:`button`,onClick:()=>{C(e.propertyName),T(e.propertyName)},children:y(`additionalProperties.rename`)}),(0,c.jsx)(`button`,{disabled:F,type:`button`,onClick:()=>te(e.propertyName),children:y(`additionalProperties.delete`)})]})}):null]},e.propertyName)})})]})},G={trimStart:e=>e.trimStart(),trimEnd:e=>e.trimEnd(),trimLeft:e=>e.trimStart(),trimRight:e=>e.trimEnd(),trim:e=>e.trim(),toLowerCase:e=>e.toLowerCase(),toUpperCase:e=>e.toUpperCase(),toEnumCase:(e,t)=>(t==null?void 0:t.hash[un(e)])||e,capitalize:e=>(0,y.default)(e),startCase:e=>(0,b.default)(e)},sn=Object.assign(cn,{transform:G});function cn(){return{keyword:`transform`,schemaType:`array`,before:`enum`,code(e){let{gen:t,data:n,schema:r,parentSchema:i,it:a}=e,{parentData:o,parentDataProperty:s}=a,c=r;if(!c.length)return;let l;if(c.includes(`toEnumCase`)){let e=ln(i);l=t.scopeValue(`obj`,{ref:e,code:(0,v.stringify)(e)})}t.if(v._`typeof ${n} == "string" && ${o} !== undefined`,()=>{t.assign(n,u(c.slice())),t.assign(v._`${o}[${s}]`,n)});function u(e){if(!e.length)return n;let r=e.pop();if(!(r in G))throw Error(`transform: unknown transformation ${r}`);let i=t.scopeValue(`func`,{ref:G[r],code:v._`require("ajv-keywords/dist/definitions/transform").transform${(0,v.getProperty)(r)}`}),a=u(e);return l&&r===`toEnumCase`?v._`${i}(${a}, ${l})`:v._`${i}(${a})`}},metaSchema:{type:`array`,items:{type:`string`,enum:Object.keys(G)}}}}function ln(e){let t={hash:{}};if(!e.enum)throw Error(`transform: "toEnumCase" requires "enum"`);for(let n of e.enum){if(typeof n!=`string`)continue;let e=un(n);if(t.hash[e])throw Error(`transform: "toEnumCase" requires all lowercased "enum" values to be unique`);t.hash[e]=n}return t}function un(e){return e.toLowerCase()}x.default.extend(S.default),x.default.extend(T.default),x.default.extend(w.default),x.default.extend(C.default);var K=(e,t)=>{let n=e==null?void 0:e[t];return typeof n==`string`?n:void 0},dn=e=>t=>{let n=K(t,`func`);if(!n)throw Error(`missing argument 'func' for dynamicDefaults func 'dynamic'`);if(!e())return console.warn(`dynamicDefaults.evaluationDisabled: the 'dynamic' default compiles a function from the schema, which requires jsonformsExtended.security.allowScriptEvaluation. No default was applied.`),()=>void 0;try{let e=Function(`args`,`const func = ${n}; return func(args);`);return()=>{try{return e(t)}catch(e){console.error(`Error at dynamicDefaults 'dynamic': ${e}`);return}}}catch(e){return console.error(`Error at dynamicDefaults 'dynamic': ${e}`),()=>void 0}},fn=e=>{var t;let n=K(e,`param`);if(!n||typeof window>`u`||!window.location)return()=>void 0;let r=new URL(window.location.href),i=(t=r.searchParams.get(n))==null?void 0:t;if(i===void 0){let e=r.hash,t=e.indexOf(`?`);if(t>0&&t<e.length-1){var a;i=(a=new URLSearchParams(e.substring(t+1)).get(n))==null?void 0:a}}return()=>i},pn=e=>{let t=K(e,`duration`),n=K(e,`date`),r=n&&n!==`now`?n:new Date,i=K(e,`op`),a=i===`subtract`||i===`substract`,o=(0,x.default)(r);if(o.isValid()&&t){let e=x.default.duration(t);o=a?o.subtract(e):o.add(e)}return o},mn=e=>t=>{let n=pn(t),r=n.isValid()?n.local().format(e):void 0;return()=>r},hn=mn(`YYYY-MM-DDTHH:mm:ss.SSS`),gn=mn(`HH:mm:ss.SSS`),_n=mn(`YYYY-MM-DD`),vn=e=>{var t;let n=pn(e);if(!n.isValid())return()=>void 0;let r=(t=K(e,`unit`))==null?`millisecond`:t,i=n.local().get(r);return()=>i},yn=(e,t={})=>{var n;(0,g.default)(e),e.getKeyword(`transform`)&&e.removeKeyword(`transform`),e.addKeyword(sn());let r=_.default.DEFAULTS;return r.dynamic=dn((n=t.allowScriptEvaluation)==null?(()=>!1):n),r.searchParams=fn,r.datetime=hn,r.date=_n,r.time=gn,r.dateUnit=vn,e},bn=`0 0/15 * * * *`,q=[`second`,`minute`,`hour`,`dayOfMonth`,`month`,`dayOfWeek`],xn=[`SUN`,`MON`,`TUE`,`WED`,`THU`,`FRI`,`SAT`],Sn=[`JAN`,`FEB`,`MAR`,`APR`,`MAY`,`JUN`,`JUL`,`AUG`,`SEP`,`OCT`,`NOV`,`DEC`],J={second:[0,59],minute:[0,59],hour:[0,23],dayOfMonth:[1,31],month:[1,12],dayOfWeek:[0,6]};function Cn(e){if(e===`dayOfWeek`)return xn;if(e===`month`)return Sn}var wn={"@yearly":`0 0 0 1 1 *`,"@annually":`0 0 0 1 1 *`,"@monthly":`0 0 0 1 * *`,"@weekly":`0 0 0 * * 0`,"@daily":`0 0 0 * * *`,"@midnight":`0 0 0 * * *`,"@hourly":`0 0 * * * *`};function Y(e){var t;let n=e.trim();if(n===``)return;let r=((t=wn[n.toLowerCase()])==null?n:t).split(/\s+/);return r.length===6?r:void 0}function Tn(e){return e.join(` `)}function En(e,t){let n=Cn(t);if(n){let r=n.indexOf(e.toUpperCase());if(r>=0)return t===`month`?r+1:r}if(!/^\d+$/.test(e))return;let r=Number(e);if(t===`dayOfWeek`&&r===7)return 0;let[i,a]=J[t];return r>=i&&r<=a?r:void 0}function X(e,t){let[n,r]=J[t],i=()=>Array.from({length:r-n+1},(e,t)=>n+t),a=e.trim();if(a===``)return;if(a===`*`)return i();if(a===`?`)return t===`dayOfMonth`||t===`dayOfWeek`?i():void 0;let o=new Set;for(let e of a.split(`,`)){let[i,a,...s]=e.split(`/`);if(s.length>0)return;let c=1;if(a!==void 0){if(!/^\d+$/.test(a)||Number(a)<1)return;c=Number(a)}let l,u;if(i===`*`||i===`?`)[l,u]=[n,r];else{let[e,n,...o]=i.split(`-`);if(o.length>0)return;let s=En(e,t);if(s===void 0)return;if(n===void 0)[l,u]=a===void 0?[s,s]:[s,r];else{let e=En(n,t);if(e===void 0||e<s)return;[l,u]=[s,e]}}for(let e=l;e<=u;e+=c)o.add(e)}return[...o].sort((e,t)=>e-t)}function Dn(e,t){let n=Cn(t);return n?t===`month`?n[e-1]:n[e]:String(e)}function On(e,t){let[n,r]=J[t],i=[...new Set(e)].filter(e=>e>=n&&e<=r).sort((e,t)=>e-t);if(i.length===0||i.length===r-n+1)return`*`;if(Cn(t)===void 0&&i.length>2){let e=i[1]-i[0];if(i.every((t,n)=>n===0||t-i[n-1]===e)&&e>1&&i[i.length-1]+e>r)return i[0]===n?`*/${e}`:`${i[0]}/${e}`}let a=[],o=0;for(;o<i.length;){let e=o;for(;e+1<i.length&&i[e+1]===i[e]+1;)e+=1;let n=Dn(i[o],t);if(e-o>=2)a.push(`${n}-${Dn(i[e],t)}`);else for(let n=o;n<=e;n+=1)a.push(Dn(i[n],t));o=e+1}return a.join(`,`)}function kn(e,t){if(X(e,t)!==void 0||t===`dayOfMonth`&&(e===`L`||e===`LW`||/^L-\d+$/.test(e)||/^\d+W$/.test(e))||t===`dayOfWeek`&&(/^\d?L$/.test(e)||/^[A-Za-z]{3}L$/.test(e)||/^(?:\d|[A-Za-z]{3})#[1-5]$/.test(e)))return!0;let[n,r]=e.split(`-`);return r!==void 0&&En(n,t)!==void 0&&En(r,t)!==void 0}function An(e){let t=Y(e);if(!t)return`sixFields`;let n=q.findIndex((e,n)=>!kn(t[n],e));return n<0?void 0:q[n]}var jn=[[`year`,`month`],[`month`,`dayOfMonth`],[`week`,`dayOfWeek`],[`day`,`hour`],[`hour`,`minute`],[`minute`,`second`]];function Mn(e,t){let n=X(e,t),[r,i]=J[t];return n!==void 0&&n.length===i-r+1}function Nn(e){for(let[t,n]of jn)if(!Mn(e[q.indexOf(n)],n))return t;return`second`}function Pn(e){let t=jn.findIndex(([t])=>t===e);return t<0?[]:jn.slice(t).map(([,e])=>e).filter(t=>e!==`week`||t!==`dayOfMonth`)}function Fn(e,t){if(e.trim()===t.trim())return!0;let n=Y(e),r=Y(t);return!n||!r?!1:q.every((e,t)=>{let i=X(n[t],e),a=X(r[t],e);return i===void 0||a===void 0?n[t]===r[t]:i.length===a.length&&i.every((e,t)=>e===a[t])})}var In=[`*`,`*`,`*`,`*`,`*`,`*`],Ln={month:0,dayOfMonth:1,dayOfWeek:1,hour:2,minute:3,second:4};function Rn(e,t){let n=new Set(Pn(t));return q.map((t,r)=>{var i;return n.has(t)?(i=e[r])==null?`*`:i:`*`})}function zn(e,t){let n=Ln[t];return q.map((t,r)=>{var i;let a=(i=e[r])==null?`*`:i;return t!==`hour`&&t!==`minute`&&t!==`second`||Ln[t]<=n||!Mn(a,t)?a:On([J[t][0]],t)})}var Bn=[`formats`,`extendedKeywords`,`errorMessages`,`allowScriptEvaluation`,`i18n`,`localizers`],Vn=/^(#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\(.*\)|hsla?\(.*\)|hsb\(.*\)|transparent)$/i,Hn=(t={})=>{let{formats:r,extendedKeywords:i=!0,errorMessages:o=!0,allowScriptEvaluation:s=!1,i18n:c,localizers:l}=t,u=n.t(t,Bn),d=(0,a.createAjv)(e.s(e.s({useDefaults:!0,$data:!0,discriminator:!0},o?{allErrors:!0}:{}),u));d.addFormat(`color`,{type:`string`,validate:e=>Vn.test(e)}),d.addFormat(`cron`,{type:`string`,validate:e=>An(e)===void 0});for(let[e,t]of Object.entries(r==null?{}:r))d.addFormat(e,{type:`string`,validate:t});if(i&&yn(d,{allowScriptEvaluation:typeof s==`function`?s:()=>s===!0}),o){var f;(f=d.opts)!=null&&f.allErrors?(0,h.default)(d):console.warn("ajv.errorMessagesNeedAllErrors: `errorMessage` support was requested but `allErrors` is off, which ajv-errors requires. Schema-authored messages will not be applied.")}return(c||l)&&e.n(d,{i18n:c,localizers:l}),d},Un=e=>typeof(e==null?void 0:e.name)==`string`&&e.name!==``,Wn=`template.urlRefused`,Gn={href:`link`,src:`link`,srcSet:`image`,poster:`image`,background:`image`,action:`link`,formAction:`link`,cite:`link`,ping:`link`,manifest:`link`,profile:`link`,longDesc:`link`,codeBase:`link`,classID:`link`,xlinkHref:`link`},Kn={href:`link`,src:`link`,srcset:`image`,poster:`image`,background:`image`,action:`link`,formaction:`link`,cite:`link`,ping:`link`,manifest:`link`,profile:`link`,longdesc:`link`,codebase:`link`,classid:`link`,"xlink:href":`link`},qn=new Set([`img`,`image`,`source`,`input`]),Jn=(e,t,n)=>{if(t!==`src`)return n;let r=typeof e==`string`?e.toLowerCase():``;return qn.has(r)?`image`:`link`},Yn=(e,t,n)=>t===`image`?ke(e,n):H(e,n),Xn=(e,t)=>e===`ping`?t.split(/\s+/).filter(Boolean):t.split(`,`).map(e=>e.trim().split(/\s+/)[0]).filter(Boolean),Zn=e=>e===`srcSet`||e===`srcset`||e===`ping`,Qn=(e,t,n)=>{let r=`${Wn}: ${t}=${JSON.stringify(String(n))} is not permitted by the URL policy; the attribute was dropped.`;e?e(r):console.warn(r)},$n=(e,t)=>typeof e==`string`||typeof t==`string`,er=(e,t,n,r,i)=>{let a=Jn(e,t,n);return Zn(t)&&typeof r==`string`?Xn(t,r).every(e=>Yn(e,a,i)):Yn(r,a,i)},tr=(t,n,r=B,i)=>{var a;if(!n)return n;let o;for(let[a,c]of Object.entries(Gn)){var s;if(!Object.prototype.hasOwnProperty.call(n,a))continue;let l=n[a];l!=null&&$n(t,l)&&(er(t,a,c,String(l),r)||(o=(s=o)==null?e.s({},n):s,delete o[a],Qn(i,a,l)))}if(typeof t==`string`&&t.toLowerCase()===`object`&&typeof n.data==`string`&&!H(n.data,r)){var c;o=(c=o)==null?e.s({},n):c,delete o.data,Qn(i,`data`,n.data)}return(a=o)==null?n:a},nr=(e,t=B,n)=>{var r;if(!e)return 0;let i=0,a=Object.keys(Kn),o=a.map(e=>`[${e.replace(`:`,`\\:`)}]`).join(`,`),s=[...(r=e.matches)!=null&&r.call(e,o)?[e]:[],...Array.from(e.querySelectorAll(o))];for(let e of s){let r=e.tagName.toLowerCase();for(let o of a){let a=e.getAttribute(o);a!==null&&(er(r,o,Kn[o],a,t)||(e.removeAttribute(o),i+=1,Qn(n,o,a)))}}return i},rr=Symbol.for(`jsonforms.additionalError.owner`),ir=e=>e[rr]!==void 0,ar=e=>e[rr],or=`additionalErrors.noStore`,sr=e=>e.replace(/^\//,``).split(`/`).join(`.`),cr=(e,t)=>t===``||t===`/`?e:(0,E.default)(e,sr(t)),lr=()=>{let t=new Map,n=new Set,r=[],i=()=>{let e=[];return t.forEach(t=>e.push(...t.errors)),!(0,D.default)(e,r)&&(r=e,n.forEach(e=>e()),!0)},a=(n,r,a)=>{if(r.length===0){t.delete(n)&&i();return}let o=r.map(t=>{let r=e.s({},t);return r[rr]=n,r});t.set(n,{errors:o,clearOnChange:(a==null?void 0:a.clearOnChange)!==!1}),i()},o=e=>{t.delete(e)&&i()},s=()=>{t.size>0&&(t.clear(),i())},c=(n,r)=>{let a=!1;t.forEach((i,o)=>{if(!i.clearOnChange)return;let s=i.errors.filter(e=>{var t,i;return(0,D.default)(cr(n,(t=e.instancePath)==null?``:t),cr(r,(i=e.instancePath)==null?``:i))});s.length!==i.errors.length&&(a=!0,s.length===0?t.delete(o):t.set(o,e.s(e.s({},i),{},{errors:s})))}),a&&i()};return{publish:a,clear:o,clearAll:s,all:()=>r,subscribe:e=>(n.add(e),()=>n.delete(e)),middleware:(t,n,i)=>{var a,o;let s=i(t,n);(n==null?void 0:n.type)===`jsonforms/UPDATE`&&t!==s&&c(t==null?void 0:t.data,s.data);let l=r,u=((a=s.additionalErrors)==null?[]:a).filter(e=>!ir(e)),d=l.length===0?u:[...u,...l];return d.length===((o=s.additionalErrors)==null?[]:o).length&&d.every((e,t)=>{var n;return e===((n=s.additionalErrors)==null?void 0:n[t])})?s:e.s(e.s({},s),{},{additionalErrors:d})}}},ur=e=>ar(e),dr=(0,s.createContext)({inert:!0,publish:()=>void 0,clear:()=>void 0,clearAll:()=>void 0,all:()=>[],subscribe:()=>()=>void 0,middleware:(e,t,n)=>n(e,t)}),fr=({store:e,children:t})=>(0,c.jsx)(dr.Provider,{value:e,children:t}),pr=()=>(0,s.useContext)(dr),mr=(e,t,n)=>{let r=pr(),i=t.length>0;s.default.useEffect(()=>{r.inert&&i&&console.warn(`${or}: ${JSON.stringify(e)} has errors to publish, but this form installed no additional-error store, so they will not appear. Render the form with <ExtendedJsonForms>, or pass useAdditionalErrorProps(store) to <JsonForms> and wrap it in <AdditionalErrorStoreProvider>.`)},[r,e,i]);let a=(0,s.useRef)({errors:t,options:n});(0,s.useLayoutEffect)(()=>{a.current={errors:t,options:n}},[t,n]);let o=t.map(e=>`${e.instancePath}|${e.keyword}|${e.message}`).join(`\0`),c=(n==null?void 0:n.clearOnChange)!==!1;s.default.useEffect(()=>{r.publish(e,a.current.errors,a.current.options)},[r,e,o,c]),s.default.useEffect(()=>()=>{r.clear(e)},[r,e])},hr=()=>{let e=pr();return s.default.useSyncExternalStore(e.subscribe,e.all,e.all)},gr=[`readOnly`],Z=e=>{if(Array.isArray(e))return e.map(Z);if(typeof e!=`object`||!e||Object.getPrototypeOf(e)!==Object.prototype)return e;let t=Object.entries(e),r=!1,i={};for(let[a,o]of t)if(a===`options`&&typeof e.type==`string`&&o&&typeof o==`object`&&!Array.isArray(o)&&Object.prototype.hasOwnProperty.call(o,`readOnly`)){let{readOnly:e}=o;i[a]=Z(n.t(o,gr)),r=!0}else{let e=Z(o);i[a]=e,r||(r=e!==o)}return r?i:e},_r=e=>e&&Object.prototype.hasOwnProperty.call(e,`readOnly`)?Object.fromEntries(Object.entries(e).filter(([e])=>e!==`readOnly`)):e,vr=({store:e})=>{let t=(0,o.useJsonForms)(),n=t.dispatch,r=(0,s.useRef)(t.core);return(0,s.useLayoutEffect)(()=>{r.current=t.core},[t.core]),(0,s.useEffect)(()=>{if(n)return e.subscribe(()=>{let e=r.current;e&&n(a.Actions.updateCore(e.data,e.schema,e.uischema,{ajv:e.ajv,validationMode:e.validationMode}))})},[e,n]),null},yr=({external:e,store:t,onAction:n,ajv:r,data:i,schema:u,uischema:d,renderers:f,cells:p,config:m,uischemas:h,readonly:g,validationMode:_,i18n:v,additionalErrors:y,middleware:b,onChange:x})=>{let[S]=(0,s.useState)(lr),C=pr(),w=U(),T=t==null?C.inert?S:C:t,E=(0,s.useMemo)(()=>u===void 0?a.Generate.jsonSchema(i):u,[u,i]),D=(0,s.useMemo)(()=>typeof d==`object`?Z(d):a.Generate.uiSchema(E,void 0,void 0,E),[d,E]),O=(0,s.useMemo)(()=>b?(e,t,n)=>T.middleware(e,t,((e,t)=>b(e,t,n))):T.middleware,[T,b]),k=(0,s.useMemo)(()=>_r(m),[m]),A=(0,s.useMemo)(()=>(0,l.withDynamicRenderers)(f),[f]),j=(0,s.useMemo)(()=>(0,l.withDynamicCells)(p),[p]),M=(0,c.jsxs)(o.JsonFormsStateProvider,{initState:{core:{ajv:r,data:i,schema:E,uischema:D,validationMode:_,additionalErrors:y},config:k,uischemas:h,renderers:A,cells:j,readonly:g,i18n:v},onChange:x,middleware:O,children:[(0,c.jsx)(vr,{store:T}),(0,c.jsx)(o.JsonFormsDispatch,{})]}),N=(0,c.jsx)(fr,{store:T,children:(0,c.jsx)(l.DynamicUiProvider,{config:m,external:e,locale:v==null?void 0:v.locale,translate:v==null?void 0:v.translate,children:M})}),P=n==null?w:n;return P===w?N:(0,c.jsx)(Le.Provider,{value:P,children:N})},br=`editor.language`,xr=8,Sr=e=>(e==null?[]:e).filter(e=>{var t;return((t=e==null?void 0:e.severity)==null?0:t)>=8}).length,Cr=(e,t)=>{let n=e==null?void 0:e.propagateErrors;if(n!==void 0)return n===!0;let r=(0,j.extendedConfig)(t);return(r==null?void 0:r.propagateErrors)!==void 0&&r.propagateErrors===!0},wr=e=>e?`/${e.split(`.`).join(`/`)}`:``,Tr=({owner:e,path:t,language:n,errorCount:r,message:i})=>({instancePath:wr(t),schemaPath:``,keyword:br,message:i,params:{source:`monaco`,language:n,errorCount:r,owner:e}}),Er=(0,a.rankWith)(3,(0,a.and)(a.isStringControl,(0,a.or)((0,a.formatIs)(`color`),(0,a.optionIs)(`format`,`color`)))),Dr=(0,a.rankWith)(3,(0,a.and)(a.isStringControl,(0,a.or)((0,a.formatIs)(`duration`),(0,a.optionIs)(`format`,`duration`)))),Or=(0,a.rankWith)(3,(0,a.and)((0,a.uiTypeIs)(`Control`),(0,a.schemaTypeIs)(`null`))),kr=e=>typeof e==`string`?/^#[a-f\d]{6}$/i.test(e)?e:/^#[a-f\d]{3}$/i.test(e)?`#`+Array.from(e.slice(1),e=>e+e).join(``):/^#[a-f\d]{8}$/i.test(e)?e.slice(0,7):`#000000`:`#000000`,Ar=t=>{var n;let i=(0,r.useI18n)(),a=typeof t.data==`string`?t.data:``,[o,c]=(0,s.useState)(!1),[l,u]=(0,s.useState)(``),[d,f]=(0,s.useState)(),[p,m]=(0,s.useState)(!1),h=e.s(e.s({},t.config),t.uischema.options),g=h.showActions!==!1,_=!t.enabled||!!t.readonly,v=a.trim()===``?void 0:An(a),y=v?i(`cron.error.${v}`):``,b=e=>{_||Fn(e,a)||t.handleChange(t.path,e)},x=(n=Y(l))==null?In:n,S=e=>{u(e),m(!0),g||b(e)},C=(e,t)=>{let n=[...x],r=t.trim()!==``&&t!==`*`;n[q.indexOf(e)]=r?t:`*`,S(Tn(r?zn(n,e):n))},w=e=>{let t=Y(e);t&&f(Nn(t)),S(e)},T=e=>{_||e===d||(f(e),e===`second`?S(Tn(In)):Y(l)&&S(Tn(Rn(x,e))))},E=l.trim()===``?void 0:An(l),D=d?Pn(d):[];return{label:i,expression:a,open:o,setOpen:c,text:l,period:d,options:h,showActions:g,disabled:_,localError:y,draft:x,changeField:C,changeText:w,changePeriod:T,editedProblem:E,shownFields:D,hasCustomField:D.some(e=>{var t;return X((t=x[q.indexOf(e)])==null?`*`:t,e)===void 0}),openOn:e=>{if(!_){if(e){let e=Y(a);u(a),f(e?Nn(e):void 0),m(!1)}c(e)}},accept:()=>{p&&b(l),c(!1)}}},Q={weeks:0,years:0,months:0,days:0,hours:0,minutes:0,seconds:0},jr=Object.keys(Q),Mr=jr.filter(e=>e!==`weeks`),Nr=e=>typeof e==`string`&&/^P\d+W$/i.test(e.trim()),Pr=`hours`,Fr=9007199254740991,$=t=>{if(typeof t!=`string`)return null;let n=t.trim(),r=/^P(\d+)W$/i.exec(n);if(r)return e.s(e.s({},Q),{},{weeks:Number(r[1])});let i=/^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/i.exec(n);if(!i||!i.slice(1).some(Boolean)||/T$/i.test(n))return null;let[,a,o,s,c,l,u]=i,d={weeks:0,years:Number(a||0),months:Number(o||0),days:Number(s||0),hours:Number(c||0),minutes:Number(l||0),seconds:Number(u||0)};return Object.values(d).every(Number.isFinite)?d:null},Ir=e=>{let t=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Number.isFinite(t)?Math.max(0,Math.floor(t)):0]));return t.weeks?`P${t.weeks}W`:(0,k.formatDurationComponents)(t)},Lr=t=>{let n=R(),[r,i]=(0,s.useState)(!1),[a,o]=(0,s.useState)(e.s({},Q)),[c,l]=(0,s.useState)([]),[u,d]=(0,s.useState)(`components`),f=e.s(e.s({},t.config),t.uischema.options),p=!t.enabled||!!t.readonly,m=typeof t.data==`string`?t.data:``,h=e=>{p||t.handleChange(t.path,e)},g=e=>{let t=$(m);return t!==null&&jr.every(n=>t[n]===e[n])},_=e=>{g(e)||h(Ir(e))},v=e=>{f.showActions===!1&&_(e)},y=u===`weeks`?[`weeks`]:Mr.filter(e=>c.includes(e)),b=e=>{let t=Mr.filter(t=>e[t]>0);return t.length?t:[Pr]};return{open:r,draft:a,options:f,disabled:p,value:m,mode:u,activeFields:y,addableFields:u===`weeks`?[]:Mr.filter(e=>!c.includes(e)),error:t.errors||(m&&!$(m)?n(`duration.invalid`):``),showActions:f.showActions!==!1,openPicker:()=>{if(!p){var t;let n=(t=$(m))==null?e.s({},Q):t;o(n),d(Nr(m)?`weeks`:`components`),l(b(n)),i(!0)}},close:()=>i(!1),apply:()=>{_(a),i(!1)},changeText:e=>h(e||void 0),setMode:t=>{if(p||t===u)return;let n=e.s({},Q);d(t),o(n),l(t===`weeks`?[]:b(n)),v(n)},addField:e=>{p||e===`weeks`||l(t=>t.includes(e)?t:[...t,e])},removeField:t=>{if(p)return;l(e=>{let n=e.filter(e=>e!==t);return n.length?n:[Pr]});let n=e.s(e.s({},a),{},{[t]:0});o(n),v(n)},changePart:(t,n)=>{if(p)return;let r=e.s(e.s({},a),{},{[t]:Math.max(0,Math.min(Fr,Math.floor(n||0)))});o(r),v(r)}}},Rr=(0,a.rankWith)(25,(0,a.and)((0,a.uiTypeIs)(`Control`),(0,a.optionIs)(`format`,`code`),(0,a.or)((0,a.and)(a.isStringControl,e=>{var t,n;return typeof((t=e.options)==null?void 0:t.language)==`string`||typeof((n=e.options)==null?void 0:n[`:language`])==`string`}),(0,a.and)((0,a.optionIs)(`language`,`json`),(0,a.optionIs)(`convertJson`,!0))))),zr=(0,a.rankWith)(25,(0,a.and)((0,a.uiTypeIs)(`Control`),(0,a.schemaTypeIs)(`array`),(0,a.optionIs)(`variant`,`ag-grid`))),Br=(e,t)=>{let n=typeof e[`:language`]==`string`?a.Resolve.data(t,e[`:language`]):void 0;return typeof n==`string`&&n?n:e.language||`plaintext`},Vr=(e,t)=>e==null?``:t?JSON.stringify(e,null,2):String(e),Hr=(e,t)=>{if(!t)return{valid:!0,value:e||void 0};try{return{valid:!0,value:JSON.parse(e)}}catch(t){return{valid:!1,value:e}}},Ur=(e,t,n)=>{let[r,i]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{var t,n;let r=e.current;if(!r)return;let a=[],o=r;for(;o;){var s;a.push(o);let e=o.getRootNode();o=(s=o.parentElement)==null?e instanceof ShadowRoot?e.host:null:s}let c=(t=(n=window).matchMedia)==null?void 0:t.call(n,`(prefers-color-scheme: dark)`),l=()=>{for(let t of a){var e;let n=(e=getComputedStyle(t).backgroundColor.match(/[\d.]+/g))==null?void 0:e.map(Number);if(n&&n.length>=3&&(n.length<4||n[3]>.5)){i(n[0]*.299+n[1]*.587+n[2]*.114<128);return}}i(!!(c!=null&&c.matches))},u=new MutationObserver(l);return a.forEach(e=>u.observe(e,{attributes:!0,attributeFilter:[`class`,`style`,`mode`,`dark`]})),c==null||c.addEventListener(`change`,l),l(),()=>{u.disconnect(),c==null||c.removeEventListener(`change`,l)}},[e]),{customTheme:t&&![`light`,`dark`,`system`].includes(t)?t:void 0,isDark:t===`dark`?!0:t===`light`?!1:t!==`system`&&n!==void 0?n:r}},Wr=e=>(0,o.withJsonFormsControlProps)(wt(z(function*(){return(yield Promise.resolve().then(()=>require("./MonacoControlRenderer.impl-BwgLGNMK.js"))).createMonacoControl(e)}),e,{loading:`editor.loading`,error:`editor.loadError`})),Gr=e=>wt(z(function*(){return(yield Promise.resolve().then(()=>require("./AgGridControlRenderer.impl-BO-Z1x0Y.js"))).createAgGridControl(e)}),e,{loading:`grid.loading`,error:`grid.loadError`}),Kr=e=>(0,o.withJsonFormsControlProps)(Gr(e)),qr=t=>{var n;let r=t&&`components`in t?t:{components:t},i=r.components,a=(n=r.includeButtonRenderer)==null||n,c=(0,o.withJsonFormsLayoutProps)(t=>s.default.createElement(Ne,e.s(e.s({},t),{},{components:i})));return[{tester:M,renderer:F},{tester:tt,renderer:ot},{tester:st,renderer:pt},{tester:mt,renderer:gt},{tester:_t,renderer:bt},{tester:zt,renderer:Ut},...a?[{tester:We,renderer:qe}]:[],{tester:Re,renderer:He},{tester:de(`jsx`),renderer:c},{tester:de(`ractive`),renderer:(0,o.withJsonFormsLayoutProps)(Ie)},{tester:fe,renderer:(0,o.withJsonFormsLayoutProps)(me)},{tester:Ye,renderer:Ze},{tester:Qe,renderer:et}]};exports.AdditionalErrorStoreProvider=fr,exports.ButtonRenderer=qe,exports.CRON_FIELDS=q,exports.DAY_NAMES=xn,exports.DEFAULT_CRON=bn,exports.DYNAMIC_NAMESPACES=At,exports.EDITOR_DIAGNOSTIC_KEYWORD=br,exports.ExtendedJsonForms=yr,exports.FIELD_RANGE=J,exports.GenericAdditionalProperties=on,exports.GenericMixedRenderer=Xt,exports.GenericMixedRendererComponent=Kt,exports.HORIZONTAL_COLUMNS=Zt,exports.HandleActionContext=Le,exports.HorizontalColumnsLayoutRenderer=nn,exports.HorizontalColumnsLayoutRendererComponent=tn,exports.ImageViewRenderer=pt,exports.ImageViewRendererComponent=ft,Object.defineProperty(exports,"JSONFORMS_CONFIG_KEY",{enumerable:!0,get:function(){return j.JSONFORMS_CONFIG_KEY}}),Object.defineProperty(exports,"JSONFORMS_EXTENDED_CONFIG_KEY",{enumerable:!0,get:function(){return j.JSONFORMS_EXTENDED_CONFIG_KEY}}),exports.LinkRenderer=bt,exports.LinkRendererComponent=yt,exports.MONACO_SEVERITY_ERROR=xr,exports.MONTH_NAMES=Sn,exports.MarkupLabelRenderer=Ut,exports.MarkupLabelRendererComponent=Ht,exports.NOTHING_CHOSEN=In,exports.NO_STORE_DIAGNOSTIC=or,exports.RESERVED_TEXT_NAMES=Mt,exports.SCHEMA_MESSAGE=e.t,exports.SeparatorRenderer=gt,exports.SeparatorRendererComponent=ht,exports.SharedSplitLayout=ee,exports.SharedSplitLayoutRenderer=F,exports.SlotRenderer=et,exports.SlotRendererComponent=$e,exports.SpacerRenderer=ot,exports.SpacerRendererComponent=at,Object.defineProperty(exports,"TRUST_DYNAMIC_FUNCTIONS",{enumerable:!0,get:function(){return A.TRUST_DYNAMIC_FUNCTIONS}}),exports.TemplateLayoutRenderer=Ne,exports.TemplateRenderer=Ze,exports.TemplateRendererComponent=Xe,exports.TemplateSlotsContext=W,exports.TsxTemplateLayoutRenderer=He,exports.TsxTemplateLayoutRendererComponent=Ve,exports.URL_REFUSED_DIAGNOSTIC=Wn,exports.additionalErrorOwner=ur,exports.ajvTranslations=e.n,exports.bgExtendedLocale=ge,exports.buildNamespaceScope=jt,exports.buildTextScope=Nt,exports.buttonRendererTester=We,exports.canonicalUiOptions=Z,exports.colorPickerValue=kr,exports.countBlockingMarkers=Sr,exports.createAdditionalErrorStore=lr,exports.createAgGridControl=Gr,exports.createAgGridControlRenderer=Kr,exports.createAjvErrorTranslator=e.r,exports.createButtonRenderer=Ke,exports.createExtendedRenderers=qr,exports.createFormsAjv=Hn,exports.createMarkupLabelRenderer=Wt,exports.createMonacoControlRenderer=Wr,exports.cronProblem=An,exports.dateOffset=_n,exports.dateUnit=vn,exports.datetimeOffset=hn,exports.decodeEditorValue=Hr,exports.defaultExtendedLocales=_e,exports.defaultUrlPolicy=B,exports.durationComponentFields=Mr,exports.durationFieldMax=Fr,exports.durationFields=jr,exports.dynamicValuesEnabled=kt,exports.editorSummaryError=Tr,exports.emptyDurationParts=Q,exports.encodeEditorValue=Vr,exports.escapeMarkdown=n.s,exports.extendedAgGridTester=zr,exports.extendedColorTester=Er,Object.defineProperty(exports,"extendedConfig",{enumerable:!0,get:function(){return j.extendedConfig}}),exports.extendedDefault=Ce,exports.extendedDurationTester=Dr,exports.extendedI18nDefaults=he,Object.defineProperty(exports,"extendedMaskTester",{enumerable:!0,get:function(){return O.extendedMaskTester}}),exports.extendedNullTester=Or,exports.extendedTransformKeyword=sn,exports.fieldsForPeriod=Pn,exports.formatExtendedDuration=Ir,exports.formatField=On,exports.genericMixedControlTester=Yt,exports.getExtendedLocales=ye,exports.hasExpressions=Et,Object.defineProperty(exports,"hasMaskPattern",{enumerable:!0,get:function(){return O.hasMaskPattern}}),exports.hasTemplateName=Je,exports.horizontalColumnsLayoutTester=en,exports.horizontalLayoutWidths=$t,exports.imageViewRendererTester=st,exports.initialSplitSizes=P,exports.isAllowedImageUrl=ke,exports.isAllowedUrl=H,exports.isEvery=Mn,Object.defineProperty(exports,"isMaskPattern",{enumerable:!0,get:function(){return O.isMaskPattern}}),exports.isMixedControl=Jt,exports.isMixedSchema=qt,exports.isNamedUISchemaElement=Un,exports.isValidColumns=Qt,exports.isWeeksDuration=Nr,exports.joinCron=Tn,exports.labelFor=Dn,exports.linkRel=vt,exports.linkRendererTester=_t,exports.localizeBg=e.i,exports.looksLikeMustache=Dt,exports.makeDynamic=dn,exports.markdownEnabled=n.n,exports.markdownProfile=n.r,exports.markupLabelTester=zt,exports.monacoControlTester=Rr,exports.namedTemplateTester=Ye,exports.parseExtendedDuration=$,exports.parseField=X,exports.periodOf=Nn,exports.pointerFor=wr,exports.registerAjvKeywords=yn,exports.registerExtendedLocale=xe,exports.reservedParamNames=Pt,exports.resolveEditorLanguage=Br,exports.resolveExtendedLocale=Se,Object.defineProperty(exports,"resolveExtendedOption",{enumerable:!0,get:function(){return j.resolveExtendedOption}}),exports.resolveImageView=lt,exports.resolveMarkup=n.i,exports.resolvePropagateErrors=Cr,exports.resolveUrlPolicy=V,exports.sameExpression=Fn,exports.sanitizeUrlAttributes=nr,exports.sanitizeUrlProps=tr,exports.schemaForType=Gt,exports.schemaMessageKey=e.a,exports.searchParams=fn,exports.separatorRendererTester=mt,exports.setExtendedLocales=ve,exports.sharedSplitLayoutTester=M,exports.slotRendererTester=Qe,exports.spacerRendererTester=tt,exports.splitCron=Y,exports.splitCssSize=N,exports.splitTemplate=Tt,exports.standDown=Rn,exports.templateRendererTester=je,exports.timeOffset=gn,exports.tsxTemplateLayoutTester=Re,exports.typographyEnabled=n.a,exports.unwrapErrorMessageErrors=e.o,exports.useAdditionalErrorStore=pr,exports.useAdditionalErrors=hr,exports.useCronPicker=Ar,exports.useDurationControl=Lr,exports.useEditorAppearance=Ur,exports.useExtendedTranslator=R,exports.useHandleAction=U,exports.useOwnedAdditionalErrors=mr,exports.wantsInterpolation=Ft,exports.wantsMarkup=n.o,exports.withTimeDefaults=zn;
|
|
16
|
+
//# sourceMappingURL=jsonforms-react-extended.cjs.js.map
|