@evlop/commons 1.0.261 → 1.0.263

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.
@@ -0,0 +1,8 @@
1
+ declare const ExpressionHelper: {
2
+ breakTemplateStringToExpressionsAndStaticString: (templateString: string) => any[];
3
+ safelyCompileStringTemplate: (variables: string[]) => (templateString: string) => TimerHandler;
4
+ safelyCompileExpression: (variables: string[]) => (expression: string) => Function;
5
+ evaluateExpressionForValue: (expression: string) => any;
6
+ };
7
+ export default ExpressionHelper;
8
+ //# sourceMappingURL=ExpressionHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionHelper.d.ts","sourceRoot":"","sources":["../../../../src/edl/ExpressionHelper.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,gBAAgB;sEAC8C,MAAM;6CAwB/B,MAAM,EAAE,sBAEvB,MAAM;yCAWM,MAAM,EAAE,kBAExB,MAAM;6CAMa,MAAM;CAGhD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // Regex to match expressions in EDL
4
+ const expressionRegex = /{(\((?:(?!\)\}).)*\)|[^{}]*)}/g;
5
+ const ExpressionHelper = {
6
+ breakTemplateStringToExpressionsAndStaticString: (templateString) => {
7
+ const parts = [];
8
+ const regex = new RegExp(expressionRegex);
9
+ let match;
10
+ let lastIndex = 0;
11
+ while ((match = regex.exec(templateString)) !== null) {
12
+ const startIndex = match.index;
13
+ const endIndex = startIndex + match[0].length;
14
+ if (startIndex > lastIndex) {
15
+ parts.push({ startIndex, endIndex, type: 'string', value: templateString.slice(lastIndex, startIndex) });
16
+ }
17
+ parts.push({ startIndex, endIndex, type: 'expression', value: match[1] });
18
+ lastIndex = endIndex;
19
+ }
20
+ if (lastIndex < templateString.length) {
21
+ parts.push({ startIndex: lastIndex, endIndex: templateString.length, type: 'string', value: templateString.slice(lastIndex) });
22
+ }
23
+ return parts;
24
+ },
25
+ safelyCompileStringTemplate: (variables) => {
26
+ const variableNamesString = `{ ${variables.join(', ')} }`;
27
+ return (templateString) => {
28
+ try {
29
+ // replace all the {expression} with ${ expression } and wrap the whole template in a function
30
+ const processedTemplate = templateString.replace(expressionRegex, "${ $1 }");
31
+ if (processedTemplate === templateString)
32
+ return templateString;
33
+ return new Function(variableNamesString, `return \`${processedTemplate}\`;`);
34
+ }
35
+ catch (e) { }
36
+ };
37
+ },
38
+ safelyCompileExpression: (variables) => {
39
+ const variableNamesString = `{ ${variables.join(', ')} }`;
40
+ return (expression) => {
41
+ try {
42
+ return new Function(variableNamesString, `return ${expression};`);
43
+ }
44
+ catch (e) { }
45
+ };
46
+ },
47
+ evaluateExpressionForValue: (expression) => {
48
+ return eval(`(${expression})`);
49
+ }
50
+ };
51
+ exports.default = ExpressionHelper;
52
+ //# sourceMappingURL=ExpressionHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionHelper.js","sourceRoot":"","sources":["../../../../src/edl/ExpressionHelper.ts"],"names":[],"mappings":";;AAAA,oCAAoC;AACpC,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEzD,MAAM,gBAAgB,GAAG;IACvB,+CAA+C,EAAE,CAAC,cAAsB,EAAE,EAAE;QAC1E,MAAM,KAAK,GAAG,EAAE,CAAC;QAEjB,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC;QAC1C,IAAI,KAAK,CAAC;QACV,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,IAAI,EAAE;YACpD,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;YAC/B,MAAM,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC9C,IAAG,UAAU,GAAG,SAAS,EAAC;gB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D,OAAO,CAAC,UAAkB,EAAE,EAAE;YAC5B,IAAG;gBACD,OAAO,IAAI,QAAQ,CAAC,mBAAmB,EAAE,UAAU,UAAU,GAAG,CAAC,CAAC;aACnE;YAAC,OAAM,CAAC,EAAC,GAAE;QACd,CAAC,CAAA;IACH,CAAC;IACD,0BAA0B,EAAE,CAAC,UAAkB,EAAE,EAAE;QACjD,OAAO,IAAI,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC;IACjC,CAAC;CACF,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
@@ -1,3 +1,3 @@
1
- declare function parseEDL(edlString: string, additionalVariables: Set<string>): any[];
1
+ declare function parseEDL(_edlString: string, additionalVariables: Set<string>): any[];
2
2
  export default parseEDL;
3
3
  //# sourceMappingURL=parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/edl/parser.ts"],"names":[],"mappings":"AAqHA,iBAAS,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,SAiIlE;AAGD,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/edl/parser.ts"],"names":[],"mappings":"AAgLA,iBAAS,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,SAsKnE;AAGD,eAAe,QAAQ,CAAC"}
@@ -1,61 +1,18 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const lodash_1 = require("lodash");
4
7
  const he_1 = require("he");
8
+ const ExpressionHelper_1 = __importDefault(require("./ExpressionHelper"));
5
9
  const inbuiltVariables = ['context', 'data', 'setRuntimeData', 'setState', 'setStates', 'state', 'dispatchAction', 'createAction'];
6
- // Regex to match expressions in EDL
7
- const expressionRegex = /{(\((?:(?!\)\}).)*\)|[^{}]*)}/g;
8
- // Regex to match opening tag in EDL
9
- const openingTagRegex = /<([a-zA-Z0-9_]+)((?:\s+[a-zA-Z0-9_\-\.\:]+=(?:"[^"]*"|'[^']*'|`[^`]*`|\{\{(?:(?!\}\}).)*\}\}|\{\[(?:(?!\]\}).)*\]\}|\{\((?:(?!\)\}).)*\)\}|\{[^\}]*\}))*)\s*(\/)?>/s;
10
10
  // Regex to match closing tag in EDL
11
11
  const closingTagRegex = /<\/([a-zA-Z0-9_]+)>/;
12
- // Regex to match attributes
13
- const attributeRegex = /([a-zA-Z0-9_\-\.\:]+)=("[^"]*"|'[^']*'|`[^`]*`|\{\{(?:(?!\}\}).)*\}\}|\{\[(?:(?!\]\}).)*\]\}|\{\((?:(?!\)\}).)*\)\}|\{[^\}]*\})/sg;
14
- // Regex to split the JSX string into tokens using opening or closing tag regex pattern
15
- const openingOrClosingTagRegex = /(<(?:\/)?(?:[a-zA-Z0-9_]+)(?:(?:\s+[a-zA-Z0-9_\-\.\:]+=(?:"[^"]*"|'[^']*'|`[^`]*`|\{\{(?:(?!\}\}).)*\}\}|\{\[(?:(?!\]\}).)*\]\}|\{\((?:(?!\)\}).)*\)\}|\{[^\}]*\}))*)\s*(?:\/)?>)/s;
16
- const TemplateCompiler = {
17
- breakTemplateStringToExpressionsAndStaticString: (templateString) => {
18
- const parts = [];
19
- const regex = new RegExp(expressionRegex);
20
- let match;
21
- let lastIndex = 0;
22
- while ((match = regex.exec(templateString)) !== null) {
23
- const startIndex = match.index;
24
- const endIndex = startIndex + match[0].length;
25
- if (startIndex > lastIndex) {
26
- parts.push({ startIndex, endIndex, type: 'string', value: templateString.slice(lastIndex, startIndex) });
27
- }
28
- parts.push({ startIndex, endIndex, type: 'expression', value: match[1] });
29
- lastIndex = endIndex;
30
- }
31
- if (lastIndex < templateString.length) {
32
- parts.push({ startIndex: lastIndex, endIndex: templateString.length, type: 'string', value: templateString.slice(lastIndex) });
33
- }
34
- return parts;
35
- },
36
- compileStringTemplate: (variables) => {
37
- const variableNamesString = `{ ${variables.join(', ')} }`;
38
- return (templateString) => {
39
- try {
40
- // replace all the {expression} with ${ expression } and wrap the whole template in a function
41
- const processedTemplate = templateString.replace(expressionRegex, "${ $1 }");
42
- if (processedTemplate === templateString)
43
- return templateString;
44
- return new Function(variableNamesString, `return \`${processedTemplate}\`;`);
45
- }
46
- catch (e) { }
47
- };
48
- },
49
- compileExpression: variables => {
50
- const variableNamesString = `{ ${variables.join(', ')} }`;
51
- return (expression) => {
52
- try {
53
- return new Function(variableNamesString, `return ${expression};`);
54
- }
55
- catch (e) { }
56
- };
57
- }
58
- };
12
+ // Regex to match attributes - now supports valueless attributes
13
+ const attributeRegex = /([a-zA-Z0-9_\-\.\:]+)(?:=("[^"]*"|'[^']*'|`[^`]*`|\{[^\}]*\}))?/sg;
14
+ // Regex to match opening tag in EDL along with attributes
15
+ const openingTagRegex = /<([a-zA-Z0-9_]+)((?:\s+[a-zA-Z0-9_\-\.\:]+(?:=(?:"[^"]*"|'[^']*'|`[^`]*`|\{[^\}]*\}))?)*)\s*(\/)?>/s;
59
16
  function generateUniqueId() {
60
17
  return lodash_1.random(1000, 9999999999).toString(36);
61
18
  }
@@ -83,6 +40,110 @@ function extractScriptsAndVariables(inputString) {
83
40
  });
84
41
  return { cleanedString, scriptsById, variables: Array.from(allVariables) };
85
42
  }
43
+ const expressionBracketOpeningClosingPairs = {
44
+ '{': '}',
45
+ '(': ')',
46
+ '[': ']',
47
+ '`': '`',
48
+ '"': '"',
49
+ "'": "'",
50
+ };
51
+ const stringDelimiters = new Set(['`', '"', "'"]);
52
+ const openingBrackets = new Set(Object.keys(expressionBracketOpeningClosingPairs));
53
+ const closingBrackets = new Set(Object.values(expressionBracketOpeningClosingPairs));
54
+ const allBrackets = new Set([...openingBrackets, ...closingBrackets]);
55
+ const expressionStartSymbol = '{';
56
+ const tagOpenSymbol = '<';
57
+ const tagCloseSymbol = '>';
58
+ // look for { and go untill }, counting all (, {, } and ), untill all opening braces are matched with closing braces
59
+ function extractExpressions(inputString) {
60
+ let cleanedString = inputString;
61
+ const tokens = [];
62
+ const expressionBracketsStack = [];
63
+ let expressionStartPosition = -1;
64
+ // track the position of tag open and close
65
+ let startingTag = null;
66
+ for (let i = 0; i < inputString.length; i++) {
67
+ const char = inputString[i];
68
+ // Start new expression when we find an opening brace
69
+ if (expressionBracketsStack.length === 0) {
70
+ if (char === expressionStartSymbol) {
71
+ expressionStartPosition = i + 1;
72
+ expressionBracketsStack.push(char);
73
+ continue;
74
+ }
75
+ else if (char === tagOpenSymbol) {
76
+ startingTag = {
77
+ type: 'tag_start',
78
+ tagStartType: inputString[i + 1] === '/' ? 'closing' : 'opening',
79
+ index: i,
80
+ };
81
+ tokens.push(startingTag);
82
+ continue;
83
+ }
84
+ else if (char === tagCloseSymbol && startingTag) {
85
+ const closingTag = {
86
+ type: 'tag_end',
87
+ index: i,
88
+ tagEndType: null,
89
+ };
90
+ if (inputString[i - 1] === '/') {
91
+ closingTag.tagEndType = 'selfClosing';
92
+ }
93
+ tokens.push(closingTag);
94
+ startingTag = -1;
95
+ continue;
96
+ }
97
+ }
98
+ if (expressionBracketsStack.length === 0)
99
+ continue; // if expression has not started yet, skip it
100
+ if (!allBrackets.has(char))
101
+ continue; // if the character is not a bracket, skip it
102
+ if (inputString[i - 1] === '\\')
103
+ continue; // if the character is escaped, skip it
104
+ const lastOpenedBracket = expressionBracketsStack[expressionBracketsStack.length - 1];
105
+ const requiredClosingBracket = expressionBracketOpeningClosingPairs[lastOpenedBracket];
106
+ if (char === requiredClosingBracket) {
107
+ expressionBracketsStack.pop();
108
+ if (expressionBracketsStack.length === 0) {
109
+ tokens.push({ type: 'expression', start: expressionStartPosition, end: i - 1 });
110
+ }
111
+ }
112
+ else if (stringDelimiters.has(lastOpenedBracket)) { // if a string delimiter is opened, we dont care obout other opening brackets
113
+ continue;
114
+ }
115
+ else if (openingBrackets.has(char)) {
116
+ expressionBracketsStack.push(char);
117
+ }
118
+ }
119
+ let correctionFactor = 0;
120
+ const expressions = {};
121
+ const splitIndexes = [];
122
+ for (const token of tokens) {
123
+ const { type, start, end } = token;
124
+ switch (type) {
125
+ case 'tag_start': {
126
+ const { index } = token;
127
+ splitIndexes.push(index - correctionFactor);
128
+ break;
129
+ }
130
+ case 'tag_end': {
131
+ const { index } = token;
132
+ splitIndexes.push(index - correctionFactor + 1);
133
+ break;
134
+ }
135
+ case 'expression':
136
+ const expression = inputString.slice(start, end + 1);
137
+ const uniqueId = generateUniqueId();
138
+ expressions[uniqueId] = expression;
139
+ const newString = cleanedString.slice(0, start - correctionFactor) + uniqueId + cleanedString.slice(end - correctionFactor + 1);
140
+ cleanedString = newString;
141
+ correctionFactor += expression.length - uniqueId.length;
142
+ break;
143
+ }
144
+ }
145
+ return { expressions, cleanedString, tagPositions: splitIndexes };
146
+ }
86
147
  const asVariableRegex = /:as="([^"]+)"/g;
87
148
  function extractAsVariables(inputString) {
88
149
  const asVariables = new Set();
@@ -93,22 +154,51 @@ function extractAsVariables(inputString) {
93
154
  return Array.from(asVariables);
94
155
  }
95
156
  // This function takes a JSX string as input and returns an array of objects representing the parsed JSX structure.
96
- function parseEDL(edlString, additionalVariables) {
157
+ function parseEDL(_edlString, additionalVariables) {
158
+ let edlString = _edlString;
97
159
  // separate the scripts and extract variables from the edl string
98
160
  const { cleanedString: edlStringWithCodeRemovedFromScript, scriptsById, variables: scriptVariables } = extractScriptsAndVariables(edlString);
161
+ edlString = edlStringWithCodeRemovedFromScript;
99
162
  // remove unnecessary whitespace from the edl string, after code has been removed from the script tags
100
- const edlStringWithCodeRemovedFromScriptAndWhitespaceRemoved = removeUnnecessaryWhitespace(edlStringWithCodeRemovedFromScript);
163
+ edlString = removeUnnecessaryWhitespace(edlString);
164
+ // extract expressions from the edl string
165
+ const { expressions: expressionsById, cleanedString: edlStringWithCodeRemovedFromScriptAndExpressionsRemoved, tagPositions: edlTagPositions } = extractExpressions(edlString);
166
+ edlString = edlStringWithCodeRemovedFromScriptAndExpressionsRemoved;
101
167
  // Extract :as variables and include them in the union
102
- const asVariables = extractAsVariables(edlStringWithCodeRemovedFromScriptAndWhitespaceRemoved);
168
+ const asVariables = extractAsVariables(edlString);
103
169
  const variables = lodash_1.union(inbuiltVariables, Array.from(additionalVariables), scriptVariables, asVariables);
104
- const compileStringTemplate = TemplateCompiler.compileStringTemplate(variables);
105
- const compileExpression = TemplateCompiler.compileExpression(variables);
106
- const breakTemplateStringToExpressionsAndStaticString = TemplateCompiler.breakTemplateStringToExpressionsAndStaticString;
170
+ const safelyCompileStringTemplate = ExpressionHelper_1.default.safelyCompileStringTemplate(variables);
171
+ const safelyCompileExpression = ExpressionHelper_1.default.safelyCompileExpression(variables);
172
+ const evaluateExpressionForValue = ExpressionHelper_1.default.evaluateExpressionForValue;
173
+ const breakTemplateStringToExpressionsAndStaticString = ExpressionHelper_1.default.breakTemplateStringToExpressionsAndStaticString;
174
+ const safelyEvaluateExpressionForValueOrFunction = expression => {
175
+ try {
176
+ const evaluatedValue = evaluateExpressionForValue(expression);
177
+ if (typeof evaluatedValue === 'function')
178
+ throw new Error("Function cannot ke kept as static prop");
179
+ return evaluatedValue;
180
+ }
181
+ catch (e) {
182
+ return safelyCompileExpression(expression);
183
+ }
184
+ };
107
185
  // Initialize an empty array to store the final JSX objects
108
186
  const jsxObjects = [];
109
187
  // Initialize an empty stack to keep track of the nested JSX elements
110
188
  const jsxStack = [];
111
- String(edlStringWithCodeRemovedFromScript).split(openingOrClosingTagRegex).forEach(token => {
189
+ // split the string by tag positions
190
+ const tagPositions = [...edlTagPositions];
191
+ if (tagPositions[0] !== 0)
192
+ tagPositions.unshift(0);
193
+ if (tagPositions[tagPositions.length - 1] !== edlString.length)
194
+ tagPositions.push(edlString.length);
195
+ const tagGroups = [];
196
+ for (let i = 0; i < tagPositions.length - 1; i++) {
197
+ const positionDiff = tagPositions[i + 1] - tagPositions[i];
198
+ // if(positionDiff <= 1) continue;
199
+ tagGroups.push(edlString.substring(tagPositions[i], tagPositions[i + 1]));
200
+ }
201
+ tagGroups.forEach(token => {
112
202
  // If the token is an empty string, skip it
113
203
  if (token.trim() === '') {
114
204
  return;
@@ -116,7 +206,7 @@ function parseEDL(edlString, additionalVariables) {
116
206
  // If the token is not an opening or closing JSX tag, treat it as plain text
117
207
  if (token[0] !== '<') {
118
208
  const parentNode = jsxStack[jsxStack.length - 1];
119
- const parts = breakTemplateStringToExpressionsAndStaticString(he_1.decode(token)).map(({ type, value }) => type == 'expression' ? compileExpression(value) : value);
209
+ const parts = breakTemplateStringToExpressionsAndStaticString(he_1.decode(token)).map(({ type, value }) => type == 'expression' ? safelyEvaluateExpressionForValueOrFunction(expressionsById[value]) : value);
120
210
  if (parentNode) {
121
211
  parentNode.children.push(...parts);
122
212
  }
@@ -148,21 +238,30 @@ function parseEDL(edlString, additionalVariables) {
148
238
  if (attributeName === 'class') {
149
239
  attributeName = 'className';
150
240
  }
151
- const value = attributeMatch[2].slice(1, -1);
241
+ if (!attributeMatch[2]) {
242
+ lodash_1.set(staticProps, attributeName, true);
243
+ continue;
244
+ }
245
+ const value = attributeMatch[2]?.slice(1, -1);
246
+ const startingBracket = attributeMatch[2]?.[0];
152
247
  // Check if the attribute value is dynamic (enclosed in curly braces) either variable or js expression
153
- const isDynamicProp = attributeMatch[2].startsWith("{");
154
- const isTemplateProp = attributeMatch[2].startsWith("`");
155
- if (isDynamicProp) {
248
+ const isJavascriptExpressionProp = startingBracket === '{';
249
+ const isTemplateProp = startingBracket === '`';
250
+ if (isJavascriptExpressionProp) {
251
+ const expression = expressionsById[value];
156
252
  try {
157
- // If the value is dynamic compile it so it can be ran against scope data
158
- variableProps[attributeName] = compileExpression(value);
159
- }
160
- catch (error) {
161
- // ignore the attribute if cannot be compiled
253
+ const evaluatedValue = safelyEvaluateExpressionForValueOrFunction(expression);
254
+ if (typeof evaluatedValue === 'function') {
255
+ variableProps[attributeName] = safelyCompileExpression(expression);
256
+ }
257
+ else {
258
+ lodash_1.set(staticProps, attributeName, evaluatedValue);
259
+ }
162
260
  }
261
+ catch (error) { }
163
262
  }
164
263
  else if (isTemplateProp) {
165
- variableProps[attributeName] = compileStringTemplate(value);
264
+ variableProps[attributeName] = safelyCompileStringTemplate(value);
166
265
  }
167
266
  else {
168
267
  // If the value is not dynamic, assign it directly to the props object
@@ -181,7 +280,7 @@ function parseEDL(edlString, additionalVariables) {
181
280
  delete newElement.staticProps[':scriptId'];
182
281
  const code = scriptsById[scriptId].code;
183
282
  const exportVariables = scriptsById[scriptId].variables;
184
- newElement.variableProps[':function'] = compileExpression(`()=>{ ${code} \n setRuntimeData({ ${exportVariables.join(', ')} }); }`);
283
+ newElement.variableProps[':function'] = safelyCompileExpression(`()=>{ ${code} \n setRuntimeData({ ${exportVariables.join(', ')} }); }`);
185
284
  }
186
285
  // If there's a parent node, add the new element as a child to the parent node
187
286
  if (jsxStack.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/edl/parser.ts"],"names":[],"mappings":";;AAAA,mCAAgE;AAChE,2BAAkD;AAElD,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAEnI,oCAAoC;AACpC,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEzD,oCAAoC;AACpC,MAAM,eAAe,GAAG,qKAAqK,CAAC;AAE9L,oCAAoC;AACpC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAE9C,4BAA4B;AAC5B,MAAM,cAAc,GAAG,mIAAmI,CAAC;AAE3J,uFAAuF;AACvF,MAAM,wBAAwB,GAAG,oLAAoL,CAAA;AAErN,MAAM,gBAAgB,GAAG;IAEvB,+CAA+C,EAAE,CAAC,cAAsB,EAAE,EAAE;QAC1E,MAAM,KAAK,GAAG,EAAE,CAAC;QAEjB,MAA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