@rjsf/primereact 6.4.1 → 6.5.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/dist/index.cjs +17 -17
- package/dist/index.cjs.map +2 -2
- package/dist/primereact.esm.js +24 -20
- package/dist/primereact.esm.js.map +3 -3
- package/dist/primereact.umd.js +17 -17
- package/lib/RadioWidget/RadioWidget.js +4 -3
- package/lib/RadioWidget/RadioWidget.js.map +1 -1
- package/lib/SelectWidget/SelectWidget.js +13 -15
- package/lib/SelectWidget/SelectWidget.js.map +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js +1 -1
- package/lib/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/RadioWidget/RadioWidget.tsx +6 -3
- package/src/SelectWidget/SelectWidget.tsx +18 -16
- package/src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx +1 -0
package/dist/primereact.umd.js
CHANGED
|
@@ -495,7 +495,8 @@
|
|
|
495
495
|
onBlur: !readonly ? onKeyRenameBlur : void 0,
|
|
496
496
|
required,
|
|
497
497
|
style: { width: "100%" }
|
|
498
|
-
}
|
|
498
|
+
},
|
|
499
|
+
label
|
|
499
500
|
)
|
|
500
501
|
] }),
|
|
501
502
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children }),
|
|
@@ -925,8 +926,9 @@
|
|
|
925
926
|
const { id, htmlName, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
|
|
926
927
|
const primeProps = options.prime || {};
|
|
927
928
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
929
|
+
const optionValueFormat = utils.getOptionValueFormat(options);
|
|
928
930
|
const _onChange = (e) => {
|
|
929
|
-
onChange(utils.
|
|
931
|
+
onChange(utils.enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, emptyValue));
|
|
930
932
|
};
|
|
931
933
|
const _onBlur = () => onBlur(id, value);
|
|
932
934
|
const _onFocus = () => onFocus(id, value);
|
|
@@ -943,7 +945,7 @@
|
|
|
943
945
|
onFocus: _onFocus,
|
|
944
946
|
onBlur: _onBlur,
|
|
945
947
|
onChange: _onChange,
|
|
946
|
-
value:
|
|
948
|
+
value: utils.enumOptionValueEncoder(option.value, index, optionValueFormat),
|
|
947
949
|
checked,
|
|
948
950
|
disabled: disabled || itemDisabled || readonly,
|
|
949
951
|
"aria-describedby": utils.ariaDescribedByIds(id)
|
|
@@ -1007,14 +1009,13 @@
|
|
|
1007
1009
|
...dropdownProps
|
|
1008
1010
|
}) {
|
|
1009
1011
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
1012
|
+
const optionValueFormat = utils.getOptionValueFormat(options);
|
|
1010
1013
|
const primeProps = options.prime || {};
|
|
1011
1014
|
multiple = typeof multiple === "undefined" ? false : multiple;
|
|
1012
1015
|
const emptyValue = multiple ? [] : "";
|
|
1013
|
-
const
|
|
1014
|
-
const
|
|
1015
|
-
const
|
|
1016
|
-
const _onFocus = ({ target }) => onFocus(id, utils.enumOptionsValueForIndex(target && target.value, enumOptions, optEmptyVal));
|
|
1017
|
-
const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1016
|
+
const _onChange = (e) => onChange(utils.enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1017
|
+
const _onBlur = ({ target }) => onBlur(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1018
|
+
const _onFocus = ({ target }) => onFocus(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1018
1019
|
const { ...dropdownRemainingProps } = dropdownProps;
|
|
1019
1020
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1020
1021
|
dropdown.Dropdown,
|
|
@@ -1022,10 +1023,10 @@
|
|
|
1022
1023
|
id,
|
|
1023
1024
|
name: htmlName || id,
|
|
1024
1025
|
...primeProps,
|
|
1025
|
-
value:
|
|
1026
|
+
value: utils.enumOptionSelectedValue(value, enumOptions, !!multiple, optionValueFormat, emptyValue),
|
|
1026
1027
|
options: (enumOptions ?? []).map(({ value: value2, label: label2 }, i) => ({
|
|
1027
1028
|
label: label2,
|
|
1028
|
-
value:
|
|
1029
|
+
value: utils.enumOptionValueEncoder(value2, i, optionValueFormat),
|
|
1029
1030
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
|
|
1030
1031
|
})),
|
|
1031
1032
|
onChange: _onChange,
|
|
@@ -1054,23 +1055,22 @@
|
|
|
1054
1055
|
onFocus
|
|
1055
1056
|
}) {
|
|
1056
1057
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
1058
|
+
const optionValueFormat = utils.getOptionValueFormat(options);
|
|
1057
1059
|
const primeProps = options.prime || {};
|
|
1058
1060
|
const emptyValue = multiple ? [] : "";
|
|
1059
|
-
const
|
|
1060
|
-
const
|
|
1061
|
-
const
|
|
1062
|
-
const _onFocus = ({ target }) => onFocus(id, utils.enumOptionsValueForIndex(target && target.value, enumOptions, optEmptyVal));
|
|
1063
|
-
const selectedIndexes = utils.enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
1061
|
+
const _onChange = (e) => onChange(utils.enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1062
|
+
const _onBlur = ({ target }) => onBlur(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1063
|
+
const _onFocus = ({ target }) => onFocus(id, utils.enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
1064
1064
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1065
1065
|
multiselect.MultiSelect,
|
|
1066
1066
|
{
|
|
1067
1067
|
id,
|
|
1068
1068
|
name: htmlName || id,
|
|
1069
1069
|
...primeProps,
|
|
1070
|
-
value:
|
|
1070
|
+
value: utils.enumOptionSelectedValue(value, enumOptions, multiple, optionValueFormat, emptyValue),
|
|
1071
1071
|
options: (enumOptions ?? []).map(({ value: value2, label }, i) => ({
|
|
1072
1072
|
label,
|
|
1073
|
-
value:
|
|
1073
|
+
value: utils.enumOptionValueEncoder(value2, i, optionValueFormat),
|
|
1074
1074
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
|
|
1075
1075
|
})),
|
|
1076
1076
|
onChange: _onChange,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ariaDescribedByIds, enumOptionsIsSelected,
|
|
2
|
+
import { ariaDescribedByIds, enumOptionValueDecoder, enumOptionValueEncoder, enumOptionsIsSelected, getOptionValueFormat, optionId, } from '@rjsf/utils';
|
|
3
3
|
import { RadioButton } from 'primereact/radiobutton';
|
|
4
4
|
/** The `RadioWidget` is a widget for rendering a radio group.
|
|
5
5
|
* It is typically used with a string property constrained with enum options.
|
|
@@ -10,8 +10,9 @@ export default function RadioWidget(props) {
|
|
|
10
10
|
const { id, htmlName, value, disabled, readonly, onChange, onBlur, onFocus, options } = props;
|
|
11
11
|
const primeProps = (options.prime || {});
|
|
12
12
|
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
13
|
+
const optionValueFormat = getOptionValueFormat(options);
|
|
13
14
|
const _onChange = (e) => {
|
|
14
|
-
onChange(
|
|
15
|
+
onChange(enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, emptyValue));
|
|
15
16
|
};
|
|
16
17
|
const _onBlur = () => onBlur(id, value);
|
|
17
18
|
const _onFocus = () => onFocus(id, value);
|
|
@@ -19,7 +20,7 @@ export default function RadioWidget(props) {
|
|
|
19
20
|
enumOptions.map((option, index) => {
|
|
20
21
|
const checked = enumOptionsIsSelected(option.value, value);
|
|
21
22
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
22
|
-
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(RadioButton, { inputId: optionId(id, index), name: htmlName || id, ...primeProps, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, value:
|
|
23
|
+
return (_jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(RadioButton, { inputId: optionId(id, index), name: htmlName || id, ...primeProps, onFocus: _onFocus, onBlur: _onBlur, onChange: _onChange, value: enumOptionValueEncoder(option.value, index, optionValueFormat), checked: checked, disabled: disabled || itemDisabled || readonly, "aria-describedby": ariaDescribedByIds(id) }), _jsx("label", { htmlFor: optionId(id, index), style: { marginLeft: '8px' }, children: option.label })] }, index));
|
|
23
24
|
}) }));
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=RadioWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioWidget.js","sourceRoot":"","sources":["../../src/RadioWidget/RadioWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"RadioWidget.js","sourceRoot":"","sources":["../../src/RadioWidget/RadioWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,QAAQ,GAKT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAA0B,MAAM,wBAAwB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,KAA2B;IAE3B,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC9F,MAAM,UAAU,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAW,CAA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AAE,sBAAsB,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,CAAC,EACrE,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,IAAI,YAAY,IAAI,QAAQ,sBAC5B,kBAAkB,CAAC,EAAE,CAAC,GACxC,EACF,gBAAO,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,YAC9D,MAAM,CAAC,KAAK,GACP,KAfA,KAAK,CAgBT,CACP,CAAC;YACJ,CAAC,CAAC,GACA,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Dropdown } from 'primereact/dropdown';
|
|
3
|
-
import { ariaDescribedByIds,
|
|
3
|
+
import { ariaDescribedByIds, enumOptionSelectedValue, enumOptionValueDecoder, enumOptionValueEncoder, getOptionValueFormat, } from '@rjsf/utils';
|
|
4
4
|
import { MultiSelect } from 'primereact/multiselect';
|
|
5
5
|
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
6
6
|
* It is typically used with string properties constrained with enum options.
|
|
@@ -14,33 +14,31 @@ export default function SelectWidget(props) {
|
|
|
14
14
|
function SingleSelectWidget({ schema, id, htmlName, name, // remove this from dropdownProps
|
|
15
15
|
options, label, hideLabel, required, disabled, placeholder, readonly, value, multiple, autofocus, onChange, onBlur, onFocus, errorSchema, rawErrors = [], registry, uiSchema, hideError, ...dropdownProps }) {
|
|
16
16
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
17
|
+
const optionValueFormat = getOptionValueFormat(options);
|
|
17
18
|
const primeProps = (options.prime || {});
|
|
18
19
|
multiple = typeof multiple === 'undefined' ? false : multiple;
|
|
19
20
|
const emptyValue = multiple ? [] : '';
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const _onFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target && target.value, enumOptions, optEmptyVal));
|
|
24
|
-
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
21
|
+
const _onChange = (e) => onChange(enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
22
|
+
const _onBlur = ({ target }) => onBlur(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
23
|
+
const _onFocus = ({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
25
24
|
const { ...dropdownRemainingProps } = dropdownProps;
|
|
26
|
-
return (_jsx(Dropdown, { id: id, name: htmlName || id, ...primeProps, value:
|
|
25
|
+
return (_jsx(Dropdown, { id: id, name: htmlName || id, ...primeProps, value: enumOptionSelectedValue(value, enumOptions, !!multiple, optionValueFormat, emptyValue), options: (enumOptions !== null && enumOptions !== void 0 ? enumOptions : []).map(({ value, label }, i) => ({
|
|
27
26
|
label,
|
|
28
|
-
value:
|
|
27
|
+
value: enumOptionValueEncoder(value, i, optionValueFormat),
|
|
29
28
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
30
29
|
})), onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, placeholder: placeholder, disabled: disabled || readonly, autoFocus: autofocus, "aria-describedby": ariaDescribedByIds(id), ...dropdownRemainingProps }));
|
|
31
30
|
}
|
|
32
31
|
function MultiSelectWidget({ id, htmlName, options, disabled, placeholder, readonly, value, multiple = false, autofocus, onChange, onBlur, onFocus, }) {
|
|
33
32
|
const { enumOptions, enumDisabled, emptyValue: optEmptyVal } = options;
|
|
33
|
+
const optionValueFormat = getOptionValueFormat(options);
|
|
34
34
|
const primeProps = (options.prime || {});
|
|
35
35
|
const emptyValue = multiple ? [] : '';
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, multiple);
|
|
41
|
-
return (_jsx(MultiSelect, { id: id, name: htmlName || id, ...primeProps, value: !isEmpty && typeof selectedIndexes !== 'undefined' ? selectedIndexes : emptyValue, options: (enumOptions !== null && enumOptions !== void 0 ? enumOptions : []).map(({ value, label }, i) => ({
|
|
36
|
+
const _onChange = (e) => onChange(enumOptionValueDecoder(e.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
37
|
+
const _onBlur = ({ target }) => onBlur(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
38
|
+
const _onFocus = ({ target }) => onFocus(id, enumOptionValueDecoder(target && target.value, enumOptions, optionValueFormat, optEmptyVal));
|
|
39
|
+
return (_jsx(MultiSelect, { id: id, name: htmlName || id, ...primeProps, value: enumOptionSelectedValue(value, enumOptions, multiple, optionValueFormat, emptyValue), options: (enumOptions !== null && enumOptions !== void 0 ? enumOptions : []).map(({ value, label }, i) => ({
|
|
42
40
|
label,
|
|
43
|
-
value:
|
|
41
|
+
value: enumOptionValueEncoder(value, i, optionValueFormat),
|
|
44
42
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
45
43
|
})), onChange: _onChange, onBlur: _onBlur, onFocus: _onFocus, placeholder: placeholder, disabled: disabled || readonly, autoFocus: autofocus, display: options.display === 'chip' ? 'chip' : 'comma', "aria-describedby": ariaDescribedByIds(id), pt: { root: { style: { position: 'relative' } } } }));
|
|
46
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../src/SelectWidget/SelectWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"SelectWidget.js","sourceRoot":"","sources":["../../src/SelectWidget/SelectWidget.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ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AE,EAAE,EACN,IAAI,EAAE,QAAQ,IAAI,EAAE,KAChB,UAAU,EACd,KAAK,EAAE,uBAAuB,CAAI,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,UAAU,CAAC,EAC9F,OAAO,EAAE,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC;YACjE,KAAK;YACL,KAAK,EAAE,sBAAsB,CAAC,KAAK,EAAE,CAAC,EAAE,iBAAiB,CAAC;YAC1D,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC5E,CAAC,CAAC,EACH,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,EACjB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,IAAI,QAAQ,EAC9B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,sBACpC,kBAAkB,CAAC,EAAE,CAAC,EACxC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,GACjD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -16,6 +16,6 @@ export default function WrapIfAdditionalTemplate({ classNames, style, children,
|
|
|
16
16
|
if (!additional) {
|
|
17
17
|
return (_jsx("div", { className: classNames, style: style, children: children }));
|
|
18
18
|
}
|
|
19
|
-
return (_jsxs("div", { className: classNames, style: { ...style, display: 'flex', alignItems: 'flex-start', gap: '1rem' }, children: [_jsxs("div", { style: { flex: 1 }, children: [displayLabel && (_jsx("label", { htmlFor: `${id}-key`, style: { display: 'block', marginBottom: '0.5rem' }, children: keyLabel })), _jsx(InputText, { id: `${id}-key`, name: `${id}-key`, defaultValue: label, disabled: disabled || readonly, onBlur: !readonly ? onKeyRenameBlur : undefined, required: required, style: { width: '100%' } })] }), _jsx("div", { style: { flex: 1 }, children: children }), _jsx("div", { style: displayLabel ? { alignSelf: 'center', marginTop: `${margin}px` } : undefined, children: _jsx(RemoveButton, { id: buttonId(id, 'remove'), className: 'rjsf-object-property-remove', disabled: disabled || readonly, onClick: onRemoveProperty, registry: registry }) })] }, `${id}-key`));
|
|
19
|
+
return (_jsxs("div", { className: classNames, style: { ...style, display: 'flex', alignItems: 'flex-start', gap: '1rem' }, children: [_jsxs("div", { style: { flex: 1 }, children: [displayLabel && (_jsx("label", { htmlFor: `${id}-key`, style: { display: 'block', marginBottom: '0.5rem' }, children: keyLabel })), _jsx(InputText, { id: `${id}-key`, name: `${id}-key`, defaultValue: label, disabled: disabled || readonly, onBlur: !readonly ? onKeyRenameBlur : undefined, required: required, style: { width: '100%' } }, label)] }), _jsx("div", { style: { flex: 1 }, children: children }), _jsx("div", { style: displayLabel ? { alignSelf: 'center', marginTop: `${margin}px` } : undefined, children: _jsx(RemoveButton, { id: buttonId(id, 'remove'), className: 'rjsf-object-property-remove', disabled: disabled || readonly, onClick: onRemoveProperty, registry: registry }) })] }, `${id}-key`));
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=WrapIfAdditionalTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapIfAdditionalTemplate.js","sourceRoot":"","sources":["../../src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,wBAAwB,EACxB,QAAQ,EAIR,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CA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