x25 17.4.38 → 17.4.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare type InputTemplatePropTypes = {
3
+ readonly disabled?: boolean;
3
4
  readonly autoFocus?: boolean;
4
5
  readonly input: any;
5
6
  readonly label: string;
@@ -18,5 +19,5 @@ declare type InputTemplatePropTypes = {
18
19
  readonly right?: string;
19
20
  readonly inputRef?: (callback: (node: any) => void) => void;
20
21
  };
21
- export declare const InputTemplate: ({ input, theType, label, inputRef, autoFocus, inputClass, divClass, placeholder, left, tabIndex, right, autoComplete, meta: { submitting, touched, error }, }: InputTemplatePropTypes) => JSX.Element;
22
+ export declare const InputTemplate: ({ input, theType, label, inputRef, autoFocus, inputClass, divClass, placeholder, left, tabIndex, right, autoComplete, disabled, meta: { submitting, touched, error }, }: InputTemplatePropTypes) => JSX.Element;
22
23
  export {};
@@ -18,14 +18,14 @@ exports.InputTemplate = void 0;
18
18
  var classnames_1 = __importDefault(require("classnames"));
19
19
  var react_1 = __importDefault(require("react"));
20
20
  var InputTemplate = function (_a) {
21
- var input = _a.input, theType = _a.theType, label = _a.label, inputRef = _a.inputRef, autoFocus = _a.autoFocus, inputClass = _a.inputClass, divClass = _a.divClass, placeholder = _a.placeholder, left = _a.left, tabIndex = _a.tabIndex, right = _a.right, autoComplete = _a.autoComplete, _b = _a.meta, submitting = _b.submitting, touched = _b.touched, error = _b.error;
21
+ var input = _a.input, theType = _a.theType, label = _a.label, inputRef = _a.inputRef, autoFocus = _a.autoFocus, inputClass = _a.inputClass, divClass = _a.divClass, placeholder = _a.placeholder, left = _a.left, tabIndex = _a.tabIndex, right = _a.right, autoComplete = _a.autoComplete, disabled = _a.disabled, _b = _a.meta, submitting = _b.submitting, touched = _b.touched, error = _b.error;
22
22
  var warningClass = "".concat(touched && error ? " is-invalid" : ""), customClass = "".concat(inputClass ? " ".concat(inputClass) : ""), classForInput = "form-control ".concat(warningClass).concat(customClass), classForDiv = "form-group row mt-md-2 ".concat(divClass ? divClass : "");
23
23
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)("".concat(classForDiv, " d-flex"), {
24
24
  "is-invalid": touched && error,
25
25
  }) },
26
26
  react_1.default.createElement("label", { className: "".concat(left ? left : "col-md-4 text-md-end", " form-control-label align-self-center"), htmlFor: input.name }, label),
27
27
  react_1.default.createElement("div", { className: "".concat(right ? right : "col-md-8", " align-self-center") },
28
- react_1.default.createElement("input", __assign({}, input, { "aria-label": label, autoComplete: autoComplete, autoFocus: autoFocus, className: classForInput, disabled: submitting, id: input.name, placeholder: placeholder, ref: inputRef ? inputRef : null, tabIndex: tabIndex, type: theType })),
28
+ react_1.default.createElement("input", __assign({}, input, { "aria-label": label, autoComplete: autoComplete, autoFocus: autoFocus, className: classForInput, disabled: submitting || disabled, id: input.name, placeholder: placeholder, ref: inputRef ? inputRef : null, tabIndex: tabIndex, type: theType })),
29
29
  react_1.default.createElement("div", { className: "invalid-feedback" }, touched && error ? (react_1.default.createElement("span", null, error)) : null))));
30
30
  };
31
31
  exports.InputTemplate = InputTemplate;
@@ -1 +1 @@
1
- {"version":3,"file":"InputTemplate.js","sourceRoot":"","sources":["../../src/Inputs/InputTemplate.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAmBA,0DAAoC;AACpC,gDAA0B;AAEnB,IAAM,aAAa,GAAG,UAAC,EAIL;QAHvB,KAAK,WAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAAA,EAAE,SAAS,eAAA,EAAE,UAAU,gBAAA,EAAE,QAAQ,cAAA,EAChE,WAAW,iBAAA,EAAE,IAAI,UAAA,EAAE,QAAQ,cAAA,EAAE,KAAK,WAAA,EAAE,YAAY,kBAAA,EAChD,YAAoC,EAA5B,UAAU,gBAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA;IAElC,IACE,YAAY,GAAG,UAAG,OAAO,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S,EAAE,SAAS,EACpB,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,UAAU,IAAI,QAAQ,EAChC,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,WAAW,EACxC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,OAAO,IACb;YACF,uCAAK,SAAS,EAAC,kBAAkB,IAC9B,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAClB,4CACG,KAAK,CACD,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA3CW,QAAA,aAAa,iBA2CxB"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare type NumericPropTypes = {
3
+ precision?: number;
3
4
  autoFocus?: boolean;
4
5
  currency?: boolean;
5
6
  optional?: boolean;
@@ -9,7 +9,7 @@ var react_1 = __importDefault(require("react"));
9
9
  var utility_1 = require("../utility");
10
10
  var common_1 = require("./common");
11
11
  var NumericInput = function (props) {
12
- var customClass = props.customClass, input = props.input, label = props.label, currency = props.currency, tabIndex = props.tabIndex, onRegisterRef = props.onRegisterRef, _a = props.formatValue, formatValue = _a === void 0 ? utility_1.formatZeroValue : _a, size = props.size, placeholder = props.placeholder, _b = props.meta, submitting = _b.submitting, touched = _b.touched, error = _b.error, _c = react_1.default.useState(props.input.value), value = _c[0], setValue = _c[1], noCurrency = (typeof currency === "undefined" || currency === false), valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
12
+ var _a = props.precision, precision = _a === void 0 ? 2 : _a, customClass = props.customClass, input = props.input, label = props.label, currency = props.currency, tabIndex = props.tabIndex, onRegisterRef = props.onRegisterRef, _b = props.formatValue, formatValue = _b === void 0 ? utility_1.formatZeroValue : _b, size = props.size, placeholder = props.placeholder, _c = props.meta, submitting = _c.submitting, touched = _c.touched, error = _c.error, _d = react_1.default.useState(props.input.value), value = _d[0], setValue = _d[1], noCurrency = (typeof currency === "undefined" || currency === false), valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
13
13
  setValue(targetValue);
14
14
  var valueToStore = targetValue;
15
15
  if ((0, common_1.isFloat)((0, common_1.floatToEnglishComma)(targetValue))) {
@@ -17,7 +17,7 @@ var NumericInput = function (props) {
17
17
  }
18
18
  input.onChange(valueToStore);
19
19
  }, handleBlur = function (event) {
20
- var newValue = (0, common_1.clearFloatOnBlur)(value), hasChanged = value !== newValue;
20
+ var newValue = (0, common_1.clearFloatOnBlur)(value, precision), hasChanged = value !== newValue;
21
21
  if (hasChanged) {
22
22
  updateValue(newValue);
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NumericInput.js","sourceRoot":"","sources":["../../src/Inputs/NumericInput.tsx"],"names":[],"mappings":";;;;;;AAyBA,0DAAoC;AACpC,gDAA0B;AAC1B,sCAA6C;AAE7C,mCAAgG;AAEzF,IACL,YAAY,GAAG,UAAC,KAAwB;IAGlC,IAAA,WAAW,GAET,KAAK,YAFI,EAAE,KAAK,GAEhB,KAAK,MAFW,EAAE,KAAK,GAEvB,KAAK,MAFkB,EAAE,QAAQ,GAEjC,KAAK,SAF4B,EAAE,QAAQ,GAE3C,KAAK,SAFsC,EAAE,aAAa,GAE1D,KAAK,cAFqD,EAAE,KAE5D,KAAK,YAFoF,EAA7B,WAAW,mBAAG,yBAAe,KAAA,EAC3F,IAAI,GACF,KAAK,KADH,EAAE,WAAW,GACf,KAAK,YADU,EAAE,KACjB,KAAK,KADgD,EAA5B,UAAU,gBAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA,EAGvD,KAAoB,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAApD,KAAK,QAAA,EAAE,QAAQ,QAAA,EAEhB,UAAU,GAAG,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,KAAK,CAAC,E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AY,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,WAAW,EAAE,WAAW,IAAI,KAAK,EACjC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,WAAW,GAClB,CACH,CAAC;IAEJ,eAAK,CAAC,SAAS,CAAC;QACd,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,EAAE;YAC9C,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SAC1B;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,IAAI,UAAU,EAAE;QACd,OAAO,cAAc,CAAC;KACvB;IAED,OAAO,CACL,uCAAK,SAAS,EAAC,aAAa;QACzB,cAAc;QACf,uCAAK,SAAS,EAAC,oBAAoB;YACjC,wCAAM,SAAS,EAAC,kBAAkB,IAC/B,QAAQ,CACJ,CACH,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAnFF,QAAA,YAAY,gBAmFV"}
@@ -1,24 +1,25 @@
1
1
  /// <reference types="react" />
2
2
  declare type NumericPropTypes = {
3
- optional?: boolean;
4
- size?: number;
3
+ autoFocus?: boolean;
5
4
  customClass?: any;
6
5
  divClass?: any;
7
6
  input: any;
7
+ inputClass?: string;
8
8
  label?: string;
9
+ left?: string;
10
+ optional?: boolean;
11
+ precision?: number;
12
+ placeholder?: string;
13
+ right?: string;
14
+ size?: number;
15
+ tabIndex?: number;
16
+ type: string;
17
+ value?: string;
9
18
  meta: {
10
19
  error?: string;
11
20
  submitting: boolean;
12
21
  touched: boolean;
13
22
  };
14
- placeholder?: string;
15
- value?: string;
16
- autoFocus?: boolean;
17
- type: string;
18
- inputClass?: string;
19
- left?: string;
20
- tabIndex?: number;
21
- right?: string;
22
23
  formatValue: (raw: any, optional?: boolean) => string;
23
24
  normalizeValue: (raw: string | null) => any;
24
25
  onBlur?: () => void;
@@ -9,7 +9,7 @@ var react_1 = __importDefault(require("react"));
9
9
  var utility_1 = require("../utility");
10
10
  var common_1 = require("./common");
11
11
  var NumericTemplate = function (props) {
12
- var input = props.input, right = props.right, tabIndex = props.tabIndex, divClass = props.divClass, label = props.label, onRegisterRef = props.onRegisterRef, _a = props.meta, submitting = _a.submitting, touched = _a.touched, error = _a.error, _b = props.formatValue, formatValue = _b === void 0 ? utility_1.formatZeroValue : _b, type = props.type, autoFocus = props.autoFocus, inputClass = props.inputClass, placeholder = props.placeholder, left = props.left, size = props.size, _c = react_1.default.useState(props.input.value), value = _c[0], setValue = _c[1], valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
12
+ var _a = props.precision, precision = _a === void 0 ? 2 : _a, input = props.input, right = props.right, tabIndex = props.tabIndex, divClass = props.divClass, label = props.label, onRegisterRef = props.onRegisterRef, _b = props.meta, submitting = _b.submitting, touched = _b.touched, error = _b.error, _c = props.formatValue, formatValue = _c === void 0 ? utility_1.formatZeroValue : _c, type = props.type, autoFocus = props.autoFocus, inputClass = props.inputClass, placeholder = props.placeholder, left = props.left, size = props.size, _d = react_1.default.useState(props.input.value), value = _d[0], setValue = _d[1], valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
13
13
  setValue(targetValue);
14
14
  var valueToStore = targetValue;
15
15
  if ((0, common_1.isFloat)((0, common_1.floatToEnglishComma)(targetValue))) {
@@ -17,7 +17,7 @@ var NumericTemplate = function (props) {
17
17
  }
18
18
  input.onChange(valueToStore);
19
19
  }, handleBlur = function (event) {
20
- var newValue = (0, common_1.clearFloatOnBlur)(value), hasChanged = value !== newValue;
20
+ var newValue = (0, common_1.clearFloatOnBlur)(value, precision), hasChanged = value !== newValue;
21
21
  if (hasChanged) {
22
22
  updateValue(newValue);
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NumericTemplate.js","sourceRoot":"","sources":["../../src/Inputs/NumericTemplate.tsx"],"names":[],"mappings":";;;;;;AA6BA,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AAA,eAAe,mBA0Fb"}
@@ -17,5 +17,5 @@ declare type SelectMonthPropTypes = {
17
17
  submitting: boolean;
18
18
  };
19
19
  };
20
- declare const SimpleCustomSelect: ({ autoFocus, isImmutable, showEmptyOption, valueKey, nameKey, data, tabIndex, input, id, inputClass, meta: { submitting, touched, error }, }: SelectMonthPropTypes) => JSX.Element;
20
+ declare const SimpleCustomSelect: ({ autoFocus, isImmutable, showEmptyOption, valueKey, nameKey, data, tabIndex, input, id, inputClass, disabled, meta: { submitting, touched, error }, }: SelectMonthPropTypes) => JSX.Element;
21
21
  export default SimpleCustomSelect;
@@ -14,15 +14,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var react_1 = __importDefault(require("react"));
18
17
  var classnames_1 = __importDefault(require("classnames"));
18
+ var react_1 = __importDefault(require("react"));
19
19
  var utility_1 = require("../../utility");
20
20
  var SimpleCustomSelect = function (_a) {
21
- var autoFocus = _a.autoFocus, isImmutable = _a.isImmutable, showEmptyOption = _a.showEmptyOption, _b = _a.valueKey, valueKey = _b === void 0 ? "value" : _b, _c = _a.nameKey, nameKey = _c === void 0 ? "name" : _c, data = _a.data, tabIndex = _a.tabIndex, input = _a.input, id = _a.id, inputClass = _a.inputClass, _d = _a.meta, submitting = _d.submitting, touched = _d.touched, error = _d.error;
21
+ var autoFocus = _a.autoFocus, isImmutable = _a.isImmutable, showEmptyOption = _a.showEmptyOption, _b = _a.valueKey, valueKey = _b === void 0 ? "value" : _b, _c = _a.nameKey, nameKey = _c === void 0 ? "name" : _c, data = _a.data, tabIndex = _a.tabIndex, input = _a.input, id = _a.id, inputClass = _a.inputClass, disabled = _a.disabled, _d = _a.meta, submitting = _d.submitting, touched = _d.touched, error = _d.error;
22
22
  var theClasses = (0, classnames_1.default)("custom-select ".concat(inputClass || ""), {
23
23
  "is-invalid": touched && error,
24
24
  }), customID = "custom-select-".concat(input.name).concat(id || "");
25
- return (react_1.default.createElement("select", __assign({}, input, { autoFocus: autoFocus, className: theClasses, disabled: submitting, id: customID, tabIndex: tabIndex }),
25
+ return (react_1.default.createElement("select", __assign({}, input, { autoFocus: autoFocus, className: theClasses, disabled: submitting || disabled, id: customID, tabIndex: tabIndex }),
26
26
  showEmptyOption ? react_1.default.createElement("option", { value: "" }, utility_1.words.Select) : null,
27
27
  isImmutable ? data.map(function (current) {
28
28
  var value = current.get(valueKey), name = current.get(nameKey);
@@ -1 +1 @@
1
- {"version":3,"file":"Simple.js","sourceRoot":"","sources":["../../../src/Inputs/Selects/Simple.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAkBA,gDAA0B;AAC1B,0DAAoC;AACpC,yCAAsC;AAEtC,IAAM,kBAAkB,GAAG,UAAC,EAIL;QAHrB,SAAS,eAAA,EAAE,WAAW,iBAAA,EAAE,eAAe,qBAAA,EAAE,gBAAkB,EAAlB,QAAQ,mBAAG,OAAO,KAAA,EAAE,eAAgB,EAAhB,OAAO,mBAAG,MAAM,KAAA,EAC7E,IAAI,UAAA,EAAE,QAAQ,cAAA,EAAE,KAAK,WAAA,EAAE,EAAE,QAAA,EAAE,UAAU,gBAAA,EACrC,YAAoC,EAA5B,UAAU,gBAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA;IAElC,IACE,UAAU,GAAG,IAAA,oBAAU,EAAC,wBAAiB,UAAU,IAAI,EAAE,CAAE,EAAE;QAC3D,YAAY,EAAE,OAAO,IAAI,KAAK;KAC/B,CAAC,EACF,QAAQ,GAAG,wBAAiB,KAAK,CAAC,IAAI,SAAG,EAAE,IAAI,EAAE,CAAE,CAAC;IAEtD,OAAO,CACL,qDACM,KAAK,IACT,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,UAAU,EACpB,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,QAAQ;QACjB,eAAe,CAAC,CAAC,CAAC,0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BAAU,EAAC,wBAAiB,UAAU,IAAI,EAAE,CAAE,EAAE;QAC3D,YAAY,EAAE,OAAO,IAAI,KAAK;KAC/B,CAAC,EACF,QAAQ,GAAG,wBAAiB,KAAK,CAAC,IAAI,SAAG,EAAE,IAAI,EAAE,CAAE,CAAC;IAEtD,OAAO,CACL,qDACM,KAAK,IACT,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,UAAU,IAAI,QAAQ,EAChC,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,QAAQ;QACjB,eAAe,CAAC,CAAC,CAAC,0CAAQ,KAAK,EAAC,EAAE,IAAE,eAAK,CAAC,MAAM,CAAU,CAAC,CAAC,CAAC,IAAI;QACjE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAC,OAAa;YACpC,IACE,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAC7B,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAE9B,OAAO,CACL,0CAAQ,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAC7B,IAAI,CACE,CACV,CAAC;QACJ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAC,EAGR;gBAFL,KAAC,QAAS,EAAE,KAAK,SAAA,EACjB,KAAC,OAAQ,EAAE,IAAI,SAAA;YACL,OAAA,CACV,0CAAQ,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAC7B,IAAI,CACE,CACV;QAJW,CAIX,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,kBAAkB,CAAC"}
@@ -1,4 +1 @@
1
- export function floatToEnglishComma(raw: any): string;
2
- export function isFloat(raw: any): boolean;
3
- export function getFloatValueToStore(raw: any): number;
4
- export function clearFloatOnBlur(value: any): any;
1
+ export declare const floatToEnglishComma: (raw: any) => string, isFloat: (raw: string) => boolean, getFloatValueToStore: (raw: any) => number, clearFloatOnBlur: (value: any, precision: number) => any;
package/Inputs/common.js CHANGED
@@ -12,13 +12,13 @@ var floatToEnglishComma = function (raw) { return String(raw).replace(",", ".");
12
12
  return parsedValue;
13
13
  }
14
14
  return 0;
15
- }, clearFloatOnBlur = function (value) {
16
- var parts = floatToLocalComma(value).split(","), shouldRemoveComma = parts.length === 2 && (parts[1] === "" || Number(parts[1]) === 0), shouldCutTo2Decimals = parts.length === 2 && parts[1].length > 2;
15
+ }, clearFloatOnBlur = function (value, precision) {
16
+ var parts = floatToLocalComma(value).split(","), shouldRemoveComma = parts.length === 2 && (parts[1] === "" || Number(parts[1]) === 0), shouldCutToPrecision = parts.length === 2 && parts[1].length > precision;
17
17
  if (shouldRemoveComma) {
18
18
  return parts[0];
19
19
  }
20
- if (shouldCutTo2Decimals) {
21
- var beforeDot = parts[0], afterDot = parts[1].substring(0, 2);
20
+ if (shouldCutToPrecision) {
21
+ var beforeDot = parts[0], afterDot = parts[1].substring(0, precision);
22
22
  return "".concat(beforeDot, ",").concat(afterDot);
23
23
  }
24
24
  return value;
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/Inputs/common.js"],"names":[],"mappings":";AAAA,2CAA2C;;;AAE3C,IACE,iBAAiB,GAAG,UAAC,GAAG,IAAK,OAAA,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAA7B,CAA6B,CAAC;AAEtD,IACL,mBAAmB,GAAG,UAAC,GAAG,IAAK,OAAA,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAA7B,CAA6B,EAC5D,OAAO,GAAG,UAAC,GAAG;IACZ,IAAM,UAAU,GAAG,qBAAqB,CAAC;IAEzC,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC,EACD,oBAAoB,GAAG,UAAC,GAAG;IACzB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