@pipelinesolucoes/form 1.2.0-beta.24 → 1.2.0-beta.26

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/README.md CHANGED
@@ -24,7 +24,8 @@ A biblioteca inclui os seguintes componentes:
24
24
  Faz a validação do e-mail, dispara um `onSubmit` assíncrono (obrigatório) e exibe a mensagem retornada.
25
25
 
26
26
  - **TextFieldPassword**
27
- Componente de campo de senha baseado no TextField do Material UI, com botão para alternar entre mostrar/ocultar a senha. O componente:
27
+ Componente de campo de senha baseado no TextField do Material UI, com botão para alternar entre mostrar/ocultar a senha.
28
+ O componente:
28
29
  - Retorna somente a senha digitada via `onPasswordChange`
29
30
  - Valida obrigatório + formato (regex) e exibe mensagens de erro automaticamente
30
31
  - Dispara um "evento" de validação via `onValidationChange`
@@ -37,6 +38,11 @@ A biblioteca inclui os seguintes componentes:
37
38
  Campo de texto numérico com suporte a validações comuns e customizadas, construído sobre o TextField do Material UI e
38
39
  estilizado via Design System da Pipeline.
39
40
 
41
+ - **TextFieldBirthDateWithAge**
42
+ Campo de data de nascimento com entrada somente numérica, máscara `dd/mm/yyyy`,
43
+ validações comuns (required, min/maxLength, pattern) + validação customizada,
44
+ e cálculo automático de idade exibido na label.
45
+
40
46
  - **NotificationSnackbar**
41
47
  Componente que exibe uma notificação no topo da tela utilizando o Snackbar e Alert do Material UI.
42
48
  ---
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ import { TypographyVariant } from '@mui/material/styles';
3
+ import { BorderProps, ColorProps, LayoutProps } from '@pipelinesolucoes/theme';
4
+ interface TextFieldBirthDateWithAgeProps extends Omit<ColorProps, 'backgroundHover' | 'colorHover'>, Omit<BorderProps, 'border'>, Pick<LayoutProps, 'height' | 'padding'> {
5
+ id?: string;
6
+ label?: string;
7
+ placeholder?: string;
8
+ value?: string;
9
+ textVariant?: TypographyVariant;
10
+ disabled?: boolean;
11
+ minLength?: number;
12
+ maxLength?: number;
13
+ required?: boolean;
14
+ requiredMessage?: string;
15
+ pattern?: RegExp | string;
16
+ patternMessage?: string;
17
+ showErrorOn?: 'change' | 'blur';
18
+ validate?: (value: string) => string | null | undefined;
19
+ onChange?: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
20
+ onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
21
+ /**
22
+ * Callback disparado sempre que a idade puder ser calculada.
23
+ * Retorna `null` quando a data é inválida ou incompleta.
24
+ */
25
+ onAgeChange?: (age: number | null) => void;
26
+ }
27
+ /**
28
+ * Campo de data de nascimento com entrada somente numérica, máscara `dd/mm/yyyy`,
29
+ * validações comuns (required, min/maxLength, pattern) + validação customizada,
30
+ * e cálculo automático de idade exibido na label.
31
+ *
32
+ * Regras:
33
+ * - O usuário digita apenas números.
34
+ * - Ao digitar, o valor é formatado automaticamente como `dd/mm/yyyy`.
35
+ * - Quando a data estiver completa e for válida, a idade é calculada e exibida na label.
36
+ * - Erros sempre têm prioridade no helperText (a label não exibe idade quando há erro).
37
+ *
38
+ * Tokens de estilo (ordem de prioridade):
39
+ * - props do componente
40
+ * - `theme.pipelinesolucoes.forms.field`
41
+ * - fallback interno (constantes `fb*`)
42
+ *
43
+ * @param {string} [id] Identificador do campo.
44
+ * @param {string} [label] Rótulo exibido acima do campo.
45
+ * @param {string} [placeholder='dd/mm/aaaa'] Placeholder do input.
46
+ * @param {string} [value] Valor do campo (controlado).
47
+ * @param {boolean} [disabled=false] Define se o campo está desabilitado.
48
+ *
49
+ * @param {number} [minLength] Número mínimo de caracteres para validação (após máscara).
50
+ * @param {number} [maxLength] Número máximo de caracteres para validação (após máscara).
51
+ *
52
+ * @param {boolean} [required=false] Define se é obrigatório.
53
+ * @param {string} [requiredMessage='Campo obrigatório'] Mensagem de obrigatório.
54
+ * @param {RegExp | string} [pattern] Pattern para validação do valor formatado.
55
+ * @param {string} [patternMessage='Formato inválido'] Mensagem do pattern.
56
+ * @param {'change' | 'blur'} [showErrorOn='blur'] Momento de exibir o erro.
57
+ * @param {(value: string) => string | null | undefined} [validate] Validação customizada do valor formatado.
58
+ *
59
+ * @param {(age: number | null) => void} [onAgeChange] Callback com a idade calculada (ou null se inválido/incompleto).
60
+ * @param {(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onChange] Callback disparado ao alterar (já com valor formatado).
61
+ * @param {(event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onBlur] Callback disparado ao perder o foco.
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * const Example = () => {
66
+ * const [birthDate, setBirthDate] = React.useState('');
67
+ *
68
+ * return (
69
+ * <TextFieldBirthDateWithAge
70
+ * label="Data de nascimento"
71
+ * value={birthDate}
72
+ * required
73
+ * showErrorOn="blur"
74
+ * onChange={(e) => setBirthDate(e.target.value)}
75
+ * onAgeChange={(age) => console.log('idade', age)}
76
+ * />
77
+ * );
78
+ * };
79
+ * ```
80
+ */
81
+ declare const TextFieldBirthDateWithAge: React.FC<TextFieldBirthDateWithAgeProps>;
82
+ export default TextFieldBirthDateWithAge;
@@ -0,0 +1,237 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { useTheme } from '@mui/material/styles';
4
+ import { TextFieldStyled } from '../style/TextFieldStyle';
5
+ import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbheigth, fbpadding, } from '../constant';
6
+ const onlyNumbers = (raw) => (raw !== null && raw !== void 0 ? raw : '').replace(/[^\d]/g, '');
7
+ const formatBirthDate = (raw) => {
8
+ const digits = onlyNumbers(raw).slice(0, 8);
9
+ if (digits.length <= 2)
10
+ return digits;
11
+ if (digits.length <= 4)
12
+ return `${digits.slice(0, 2)}/${digits.slice(2)}`;
13
+ return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4)}`;
14
+ };
15
+ const isValidBirthDate = (formatted) => {
16
+ if (!/^\d{2}\/\d{2}\/\d{4}$/.test(formatted))
17
+ return false;
18
+ const [ddStr, mmStr, yyyyStr] = formatted.split('/');
19
+ const dd = Number(ddStr);
20
+ const mm = Number(mmStr);
21
+ const yyyy = Number(yyyyStr);
22
+ if (!Number.isFinite(dd) || !Number.isFinite(mm) || !Number.isFinite(yyyy))
23
+ return false;
24
+ if (yyyy < 1900 || yyyy > 3000)
25
+ return false;
26
+ if (mm < 1 || mm > 12)
27
+ return false;
28
+ if (dd < 1 || dd > 31)
29
+ return false;
30
+ const date = new Date(yyyy, mm - 1, dd);
31
+ if (Number.isNaN(date.getTime()))
32
+ return false;
33
+ // garante que não "normalizou" (ex.: 31/02 vira 02/03)
34
+ return (date.getFullYear() === yyyy &&
35
+ date.getMonth() === mm - 1 &&
36
+ date.getDate() === dd);
37
+ };
38
+ const calculateAgeFromFormatted = (formatted) => {
39
+ if (!isValidBirthDate(formatted))
40
+ return null;
41
+ const [ddStr, mmStr, yyyyStr] = formatted.split('/');
42
+ const dd = Number(ddStr);
43
+ const mm = Number(mmStr);
44
+ const yyyy = Number(yyyyStr);
45
+ const birth = new Date(yyyy, mm - 1, dd);
46
+ const today = new Date();
47
+ // Não permitir data no futuro
48
+ const todayAtMidnight = new Date(today.getFullYear(), today.getMonth(), today.getDate());
49
+ if (birth.getTime() > todayAtMidnight.getTime())
50
+ return null;
51
+ let age = today.getFullYear() - birth.getFullYear();
52
+ const monthDiff = today.getMonth() - birth.getMonth();
53
+ if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birth.getDate())) {
54
+ age--;
55
+ }
56
+ return age >= 0 ? age : null;
57
+ };
58
+ const computeError = (value, { required, requiredMessage, minLength, maxLength, pattern, patternMessage, validate, }) => {
59
+ const v = value !== null && value !== void 0 ? value : '';
60
+ if (required && v.trim().length === 0)
61
+ return requiredMessage || 'Campo obrigatório';
62
+ if (typeof minLength === 'number' && v.length < minLength) {
63
+ return `Mínimo de ${minLength} caracteres`;
64
+ }
65
+ if (typeof maxLength === 'number' && v.length > maxLength) {
66
+ return `Máximo de ${maxLength} caracteres`;
67
+ }
68
+ if (pattern) {
69
+ const re = typeof pattern === 'string' ? new RegExp(pattern) : pattern;
70
+ if (!re.test(v))
71
+ return patternMessage || 'Formato inválido';
72
+ }
73
+ if (validate) {
74
+ const customMsg = validate(v);
75
+ if (typeof customMsg === 'string' && customMsg)
76
+ return customMsg;
77
+ }
78
+ return null;
79
+ };
80
+ /**
81
+ * Campo de data de nascimento com entrada somente numérica, máscara `dd/mm/yyyy`,
82
+ * validações comuns (required, min/maxLength, pattern) + validação customizada,
83
+ * e cálculo automático de idade exibido na label.
84
+ *
85
+ * Regras:
86
+ * - O usuário digita apenas números.
87
+ * - Ao digitar, o valor é formatado automaticamente como `dd/mm/yyyy`.
88
+ * - Quando a data estiver completa e for válida, a idade é calculada e exibida na label.
89
+ * - Erros sempre têm prioridade no helperText (a label não exibe idade quando há erro).
90
+ *
91
+ * Tokens de estilo (ordem de prioridade):
92
+ * - props do componente
93
+ * - `theme.pipelinesolucoes.forms.field`
94
+ * - fallback interno (constantes `fb*`)
95
+ *
96
+ * @param {string} [id] Identificador do campo.
97
+ * @param {string} [label] Rótulo exibido acima do campo.
98
+ * @param {string} [placeholder='dd/mm/aaaa'] Placeholder do input.
99
+ * @param {string} [value] Valor do campo (controlado).
100
+ * @param {boolean} [disabled=false] Define se o campo está desabilitado.
101
+ *
102
+ * @param {number} [minLength] Número mínimo de caracteres para validação (após máscara).
103
+ * @param {number} [maxLength] Número máximo de caracteres para validação (após máscara).
104
+ *
105
+ * @param {boolean} [required=false] Define se é obrigatório.
106
+ * @param {string} [requiredMessage='Campo obrigatório'] Mensagem de obrigatório.
107
+ * @param {RegExp | string} [pattern] Pattern para validação do valor formatado.
108
+ * @param {string} [patternMessage='Formato inválido'] Mensagem do pattern.
109
+ * @param {'change' | 'blur'} [showErrorOn='blur'] Momento de exibir o erro.
110
+ * @param {(value: string) => string | null | undefined} [validate] Validação customizada do valor formatado.
111
+ *
112
+ * @param {(age: number | null) => void} [onAgeChange] Callback com a idade calculada (ou null se inválido/incompleto).
113
+ * @param {(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onChange] Callback disparado ao alterar (já com valor formatado).
114
+ * @param {(event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void} [onBlur] Callback disparado ao perder o foco.
115
+ *
116
+ * @example
117
+ * ```tsx
118
+ * const Example = () => {
119
+ * const [birthDate, setBirthDate] = React.useState('');
120
+ *
121
+ * return (
122
+ * <TextFieldBirthDateWithAge
123
+ * label="Data de nascimento"
124
+ * value={birthDate}
125
+ * required
126
+ * showErrorOn="blur"
127
+ * onChange={(e) => setBirthDate(e.target.value)}
128
+ * onAgeChange={(age) => console.log('idade', age)}
129
+ * />
130
+ * );
131
+ * };
132
+ * ```
133
+ */
134
+ const TextFieldBirthDateWithAge = ({ id, label, placeholder = 'dd/mm/aaaa', value = '', textVariant, background, backgroundFocused, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, height, disabled = false, minLength, maxLength, required = false, requiredMessage = 'Campo obrigatório', pattern, patternMessage = 'Formato inválido', validate, showErrorOn = 'blur', onChange, onBlur, onAgeChange, }) => {
135
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
136
+ const [touched, setTouched] = React.useState(false);
137
+ const formattedValue = React.useMemo(() => formatBirthDate(value), [value]);
138
+ const computedAge = React.useMemo(() => {
139
+ if (formattedValue.length !== 10)
140
+ return null;
141
+ return calculateAgeFromFormatted(formattedValue);
142
+ }, [formattedValue]);
143
+ React.useEffect(() => {
144
+ onAgeChange === null || onAgeChange === void 0 ? void 0 : onAgeChange(computedAge);
145
+ }, [computedAge, onAgeChange]);
146
+ const errorMessage = React.useMemo(() => {
147
+ const v = formattedValue;
148
+ const baseError = showErrorOn === 'change'
149
+ ? computeError(v, { required, requiredMessage, minLength, maxLength, pattern, patternMessage, validate })
150
+ : showErrorOn === 'blur' && touched
151
+ ? computeError(v, { required, requiredMessage, minLength, maxLength, pattern, patternMessage, validate })
152
+ : null;
153
+ if (baseError)
154
+ return baseError;
155
+ if (v.length === 10 && !isValidBirthDate(v))
156
+ return 'Data inválida';
157
+ if (v.length === 10 && isValidBirthDate(v) && computedAge === null)
158
+ return 'Data inválida';
159
+ return null;
160
+ }, [
161
+ formattedValue,
162
+ required,
163
+ requiredMessage,
164
+ minLength,
165
+ maxLength,
166
+ pattern,
167
+ patternMessage,
168
+ validate,
169
+ showErrorOn,
170
+ touched,
171
+ computedAge,
172
+ ]);
173
+ const computedLabel = computedAge !== null && !errorMessage
174
+ ? `${label !== null && label !== void 0 ? label : ''} (${computedAge} anos)`.trim()
175
+ : label;
176
+ const handleBlur = (event) => {
177
+ if (!touched)
178
+ setTouched(true);
179
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
180
+ };
181
+ const handleChange = (event) => {
182
+ if (!onChange)
183
+ return;
184
+ const next = formatBirthDate(event.target.value);
185
+ const syntheticEvent = Object.assign(Object.assign({}, event), { target: Object.assign(Object.assign({}, event.target), { value: next }), currentTarget: Object.assign(Object.assign({}, event.currentTarget), { value: next }) });
186
+ onChange(syntheticEvent);
187
+ };
188
+ const handleKeyDown = (event) => {
189
+ const allowed = [
190
+ 'Backspace',
191
+ 'Delete',
192
+ 'Tab',
193
+ 'Enter',
194
+ 'Escape',
195
+ 'ArrowLeft',
196
+ 'ArrowRight',
197
+ 'ArrowUp',
198
+ 'ArrowDown',
199
+ 'Home',
200
+ 'End',
201
+ ];
202
+ if (allowed.includes(event.key))
203
+ return;
204
+ if (event.ctrlKey || event.metaKey)
205
+ return;
206
+ if (!/^\d$/.test(event.key)) {
207
+ event.preventDefault();
208
+ }
209
+ };
210
+ const theme = useTheme();
211
+ const field = (_b = (_a = theme.pipelinesolucoes) === null || _a === void 0 ? void 0 : _a.forms) === null || _b === void 0 ? void 0 : _b.field;
212
+ const bg = (_c = background !== null && background !== void 0 ? background : field === null || field === void 0 ? void 0 : field.background) !== null && _c !== void 0 ? _c : fbbackground;
213
+ const bgFocused = (_d = backgroundFocused !== null && backgroundFocused !== void 0 ? backgroundFocused : field === null || field === void 0 ? void 0 : field.backgroundFocused) !== null && _d !== void 0 ? _d : bg;
214
+ const bgDisabled = (_e = backgroundDisabled !== null && backgroundDisabled !== void 0 ? backgroundDisabled : field === null || field === void 0 ? void 0 : field.backgroundDisabled) !== null && _e !== void 0 ? _e : fbbackgroundDisabled;
215
+ const txt = (_f = color !== null && color !== void 0 ? color : field === null || field === void 0 ? void 0 : field.color) !== null && _f !== void 0 ? _f : fbcolor;
216
+ const txtDisabled = (_g = colorDisabled !== null && colorDisabled !== void 0 ? colorDisabled : field === null || field === void 0 ? void 0 : field.colorDisabled) !== null && _g !== void 0 ? _g : fbcolorDisabled;
217
+ const br = (_h = borderRadius !== null && borderRadius !== void 0 ? borderRadius : field === null || field === void 0 ? void 0 : field.borderRadius) !== null && _h !== void 0 ? _h : fbborderRadius;
218
+ const sh = (_j = boxShadow !== null && boxShadow !== void 0 ? boxShadow : field === null || field === void 0 ? void 0 : field.boxShadow) !== null && _j !== void 0 ? _j : fbboxShadow;
219
+ const bd = (_k = borderColor !== null && borderColor !== void 0 ? borderColor : field === null || field === void 0 ? void 0 : field.borderColor) !== null && _k !== void 0 ? _k : fbborderColor;
220
+ const bdFocused = (_l = colorFocused !== null && colorFocused !== void 0 ? colorFocused : field === null || field === void 0 ? void 0 : field.colorFocused) !== null && _l !== void 0 ? _l : fbcolorFocused;
221
+ const pad = (_m = padding !== null && padding !== void 0 ? padding : field === null || field === void 0 ? void 0 : field.padding) !== null && _m !== void 0 ? _m : fbpadding;
222
+ const hg = (_o = height !== null && height !== void 0 ? height : field === null || field === void 0 ? void 0 : field.height) !== null && _o !== void 0 ? _o : fbheigth;
223
+ const typo = (_q = (_p = (textVariant && theme.typography[textVariant])) !== null && _p !== void 0 ? _p : field === null || field === void 0 ? void 0 : field.typography) !== null && _q !== void 0 ? _q : theme.typography.body1;
224
+ const helperText = errorMessage ? errorMessage : '\u00A0';
225
+ return (_jsx(TextFieldStyled, { id: id, label: computedLabel, placeholder: placeholder, value: formattedValue, typo: typo, onChange: handleChange, onBlur: handleBlur, background: bg, backgroundFocused: bgFocused, backgroundDisabled: bgDisabled, colorText: txt, colorFocused: bdFocused, colorDisabled: txtDisabled, borderRadius: br, boxShadow: sh, borderColor: bd, padding: pad, disabled: disabled, required: required, fullWidth: true, height: hg, error: Boolean(errorMessage), helperText: helperText, onKeyDown: handleKeyDown, slotProps: {
226
+ input: {
227
+ inputProps: {
228
+ inputMode: 'numeric',
229
+ pattern: '[0-9]*',
230
+ maxLength: 10,
231
+ },
232
+ },
233
+ } }));
234
+ };
235
+ TextFieldBirthDateWithAge.displayName = 'TextFieldBirthDateWithAge';
236
+ export default TextFieldBirthDateWithAge;
237
+ //# sourceMappingURL=TextFieldBirthDateWithAge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextFieldBirthDateWithAge.js","sourceRoot":"","sources":["../../src/components/TextFieldBirthDateWithAge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EACd,QAAQ,EACR,SAAS,GACV,MAAM,aAAa,CAAC;AAsCrB,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAEvE,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE;IACtC,MAAM,MAAM,GAAG,WAAW,C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B,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV,SAAS,EAAE,SAAS;oBACpB,OAAO,EAAE,QAAQ;oBACjB,SAAS,EAAE,EAAE;iBACd;aACF;SACF,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,yBAAyB,CAAC,WAAW,GAAG,2BAA2B,CAAC;AAEpE,eAAe,yBAAyB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -9,5 +9,6 @@ export { default as ChipList } from './components/ChipList';
9
9
  export { default as TextFieldValidate } from './components/TextFieldValidate';
10
10
  export { default as TextFieldPassword } from './components/TextFieldPassword';
11
11
  export { default as TextFieldNumberValidate } from './components/TextFieldNumberValidate';
12
+ export { default as TextFieldBirthDateWithAge } from './components/TextFieldBirthDateWithAge';
12
13
  export * from './utils/validateTelefone';
13
14
  export * from './utils/validateEmail';
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export { default as ChipList } from './components/ChipList';
9
9
  export { default as TextFieldValidate } from './components/TextFieldValidate';
10
10
  export { default as TextFieldPassword } from './components/TextFieldPassword';
11
11
  export { default as TextFieldNumberValidate } from './components/TextFieldNumberValidate';
12
+ export { default as TextFieldBirthDateWithAge } from './components/TextFieldBirthDateWithAge';
12
13
  export * from './utils/validateTelefone';
13
14
  export * from './utils/validateEmail';
14
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE1E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAC,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAC,MAAM,yCAAyC,CAAC;AAEzF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC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