@servicetitan/data-query 19.2.0 → 20.0.1
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/accessor.js +4 -8
- package/dist/accessor.js.map +1 -1
- package/dist/array.operators.js +33 -41
- package/dist/array.operators.js.map +1 -1
- package/dist/common.interfaces.js +1 -2
- package/dist/data-result.interface.js +1 -2
- package/dist/data-source/async-data-source.js +9 -16
- package/dist/data-source/async-data-source.js.map +1 -1
- package/dist/data-source/data-source.js +1 -2
- package/dist/data-source/in-memory-data-source.js +15 -22
- package/dist/data-source/in-memory-data-source.js.map +1 -1
- package/dist/data-source/index.js +2 -7
- package/dist/data-source/index.js.map +1 -1
- package/dist/filter-serialization.common.js +12 -24
- package/dist/filter-serialization.common.js.map +1 -1
- package/dist/filtering/filter-descriptor.interface.js +3 -7
- package/dist/filtering/filter-descriptor.interface.js.map +1 -1
- package/dist/filtering/filter-expression.factory.js +9 -14
- package/dist/filtering/filter-expression.factory.js.map +1 -1
- package/dist/filtering/filter-no-eval.js +28 -32
- package/dist/filtering/filter-no-eval.js.map +1 -1
- package/dist/filtering/filter.operators.js +8 -12
- package/dist/filtering/filter.operators.js.map +1 -1
- package/dist/funcs.js +4 -11
- package/dist/funcs.js.map +1 -1
- package/dist/grouping/aggregate.operators.js +5 -9
- package/dist/grouping/aggregate.operators.js.map +1 -1
- package/dist/grouping/group-descriptor.interface.js +1 -2
- package/dist/grouping/group-descriptor.interface.js.map +1 -1
- package/dist/grouping/group.operators.js +14 -19
- package/dist/grouping/group.operators.js.map +1 -1
- package/dist/index.js +13 -35
- package/dist/index.js.map +1 -1
- package/dist/mvc/deserialization.js +7 -12
- package/dist/mvc/deserialization.js.map +1 -1
- package/dist/mvc/operators.js +30 -35
- package/dist/mvc/operators.js.map +1 -1
- package/dist/odata-filtering.operators.js +15 -19
- package/dist/odata-filtering.operators.js.map +1 -1
- package/dist/odata.operators.js +9 -13
- package/dist/odata.operators.js.map +1 -1
- package/dist/sort-descriptor.js +1 -2
- package/dist/sorting/sort-array.operator.js +7 -11
- package/dist/sorting/sort-array.operator.js.map +1 -1
- package/dist/sorting/sort.js +3 -7
- package/dist/sorting/sort.js.map +1 -1
- package/dist/state.js +1 -2
- package/dist/transducers.js +27 -41
- package/dist/transducers.js.map +1 -1
- package/dist/utils.js +10 -23
- package/dist/utils.js.map +1 -1
- package/package.json +5 -4
package/dist/mvc/operators.js
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const accessor_1 = require("../accessor");
|
|
7
|
-
const funcs_1 = require("../funcs");
|
|
8
|
-
const filter_serialization_common_1 = require("../filter-serialization.common");
|
|
1
|
+
import { isCompositeFilterDescriptor } from '../filtering/filter-descriptor.interface';
|
|
2
|
+
import { isPresent, isNotNullOrEmptyString, isArray } from '../utils';
|
|
3
|
+
import { getter } from '../accessor';
|
|
4
|
+
import { compose, ifElse, identity } from '../funcs';
|
|
5
|
+
import { isStringValue, isDateValue, quote, serializeFilters, toUTC, encodeValue } from '../filter-serialization.common';
|
|
9
6
|
const toQueryString = values => values.reduce((acc, [key, value]) => [...acc, `${key}=${value}`], []);
|
|
10
7
|
const toObject = values => values.reduce((acc, [key, value]) => (Object.assign(Object.assign({}, acc), { [key]: value })), {});
|
|
11
8
|
const pairwise = key => value => [key, value];
|
|
12
9
|
const empty = () => null;
|
|
13
|
-
const isNotEmptyArray = value =>
|
|
14
|
-
const has = accessor => value =>
|
|
10
|
+
const isNotEmptyArray = value => isPresent(value) && isArray(value) && value.length > 0;
|
|
11
|
+
const has = accessor => value => isPresent(accessor(value));
|
|
15
12
|
const isNotEmpty = accessor => value => isNotEmptyArray(accessor(value));
|
|
16
|
-
const runOrEmpty = (predicate, fn) =>
|
|
13
|
+
const runOrEmpty = (predicate, fn) => ifElse(predicate, fn, empty);
|
|
17
14
|
const calcPage = ({ skip, take }) => Math.floor((skip || 0) / take) + 1;
|
|
18
15
|
const formatDescriptors = (accessor, formatter) => state => (accessor(state).map(formatter).join("~"));
|
|
19
16
|
const removeAfter = (what) => (str) => str.slice(0, str.indexOf(what));
|
|
20
|
-
const replace = (patterns) =>
|
|
17
|
+
const replace = (patterns) => compose(...patterns.map(([left, right]) => (s) => s.replace(new RegExp(left, "g"), right)));
|
|
21
18
|
const sanitizeDateLiterals = replace([["\"", ""], [":", "-"]]);
|
|
22
19
|
const removeAfterDot = removeAfter(".");
|
|
23
20
|
const directionFormatter = ({ field, dir = "asc" }) => `${field}-${dir}`;
|
|
24
21
|
const aggregateFormatter = ({ field, aggregate }) => `${field}-${aggregate}`;
|
|
25
|
-
const take =
|
|
26
|
-
const aggregates =
|
|
27
|
-
const skip =
|
|
28
|
-
const group =
|
|
29
|
-
const sort =
|
|
22
|
+
const take = getter("take");
|
|
23
|
+
const aggregates = getter("aggregates");
|
|
24
|
+
const skip = getter("skip");
|
|
25
|
+
const group = getter("group");
|
|
26
|
+
const sort = getter("sort", true);
|
|
30
27
|
const formatSort = formatDescriptors(sort, directionFormatter);
|
|
31
28
|
const formatGroup = formatDescriptors(group, directionFormatter);
|
|
32
29
|
const formatAggregates = formatDescriptors(aggregates, aggregateFormatter);
|
|
33
30
|
const prefixDateValue = value => `datetime'${value}'`;
|
|
34
|
-
const formatDateValue =
|
|
31
|
+
const formatDateValue = compose(prefixDateValue, removeAfterDot, sanitizeDateLiterals, JSON.stringify, toUTC);
|
|
35
32
|
const formatDate = ({ field, value, ignoreCase, operator }) => ({
|
|
36
33
|
value: formatDateValue(value),
|
|
37
34
|
field,
|
|
@@ -39,24 +36,24 @@ const formatDate = ({ field, value, ignoreCase, operator }) => ({
|
|
|
39
36
|
operator
|
|
40
37
|
});
|
|
41
38
|
const normalizeSort = (state) => Object.assign({}, state, {
|
|
42
|
-
sort: (sort(state) || []).filter(({ dir }) =>
|
|
39
|
+
sort: (sort(state) || []).filter(({ dir }) => isNotNullOrEmptyString(dir))
|
|
43
40
|
});
|
|
44
|
-
const transformSkip =
|
|
45
|
-
const transformTake =
|
|
46
|
-
const transformGroup =
|
|
47
|
-
const transformSort =
|
|
48
|
-
const transformAggregates =
|
|
41
|
+
const transformSkip = compose(pairwise('page'), calcPage);
|
|
42
|
+
const transformTake = compose(pairwise('pageSize'), take);
|
|
43
|
+
const transformGroup = compose(pairwise('group'), formatGroup);
|
|
44
|
+
const transformSort = compose(pairwise('sort'), formatSort);
|
|
45
|
+
const transformAggregates = compose(pairwise('aggregate'), formatAggregates);
|
|
49
46
|
const serializePage = runOrEmpty(has(skip), transformSkip);
|
|
50
47
|
const serializePageSize = runOrEmpty(has(take), transformTake);
|
|
51
48
|
const serializeGroup = runOrEmpty(isNotEmpty(group), transformGroup);
|
|
52
49
|
const serializeAggregates = runOrEmpty(has(aggregates), transformAggregates);
|
|
53
|
-
const serializeSort =
|
|
54
|
-
const hasField = ({ field }) =>
|
|
50
|
+
const serializeSort = compose(runOrEmpty(isNotEmpty(sort), transformSort), normalizeSort);
|
|
51
|
+
const hasField = ({ field }) => isNotNullOrEmptyString(field);
|
|
55
52
|
const filterFormatter = ({ field, operator, value }) => `${field}~${operator}~${value}`;
|
|
56
|
-
const dateFormatter =
|
|
57
|
-
const typedFormatter = encode => runOrEmpty(hasField,
|
|
53
|
+
const dateFormatter = ifElse(isDateValue, compose(filterFormatter, formatDate), filterFormatter);
|
|
54
|
+
const typedFormatter = encode => runOrEmpty(hasField, ifElse(isStringValue, compose(filterFormatter, quote, encode ? encodeValue : identity), dateFormatter));
|
|
58
55
|
const join = ({ logic }) => `~${logic}~`;
|
|
59
|
-
const serialize = encode =>
|
|
56
|
+
const serialize = encode => serializeFilters(filter => ifElse(isCompositeFilterDescriptor, serialize(encode), typedFormatter(encode))(filter), join);
|
|
60
57
|
const serializeFilter = ({ filter }, encode) => {
|
|
61
58
|
if (filter && filter.filters) {
|
|
62
59
|
const filters = serialize(encode)(filter);
|
|
@@ -179,10 +176,9 @@ const rules = (state, encode = true) => key => ({
|
|
|
179
176
|
* ```
|
|
180
177
|
* {% endplatform_content %}
|
|
181
178
|
*/
|
|
182
|
-
const toDataSourceRequestString = (state) => (toQueryString(Object.keys(state)
|
|
179
|
+
export const toDataSourceRequestString = (state) => (toQueryString(Object.keys(state)
|
|
183
180
|
.map(rules(state))
|
|
184
|
-
.filter(
|
|
185
|
-
exports.toDataSourceRequestString = toDataSourceRequestString;
|
|
181
|
+
.filter(isPresent)).join('&'));
|
|
186
182
|
/**
|
|
187
183
|
* Converts a [`DataSourceRequestState`]({% slug api_kendo-data-query_datasourcerequeststate %}) into an object
|
|
188
184
|
* that is compatible with the `DataSourceRequest` format in UI for ASP.NET MVC.
|
|
@@ -190,8 +186,7 @@ exports.toDataSourceRequestString = toDataSourceRequestString;
|
|
|
190
186
|
* @param {DataRequestState} state - The state that will be serialized.
|
|
191
187
|
* @returns {any} - The serialized state.
|
|
192
188
|
*/
|
|
193
|
-
const toDataSourceRequest = (state) => (toObject(Object.keys(state)
|
|
189
|
+
export const toDataSourceRequest = (state) => (toObject(Object.keys(state)
|
|
194
190
|
.map(rules(state, false))
|
|
195
|
-
.filter(
|
|
196
|
-
exports.toDataSourceRequest = toDataSourceRequest;
|
|
191
|
+
.filter(isPresent)));
|
|
197
192
|
//# sourceMappingURL=operators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../src/mvc/operators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../src/mvc/operators.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAEzG,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,OAAO,EAAQ,MAAM,UAAU,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAA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,iBAAiB,CAAC,KAAK,CAAC;CACnC,CAAC,GAAG,CAAC,CAAC,CAAC;AAkBR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAA6B,EAAU,EAAE,CAAC,CAChF,aAAa,CACT,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;KACb,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACjB,MAAM,CAAC,SAAS,CAAC,CACzB,CAAC,IAAI,CAAC,GAAG,CAAC,CACd,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAA6B,EAAO,EAAE,CAAC,CACvE,QAAQ,CACJ,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;KACb,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;KACxB,MAAM,CAAC,SAAS,CAAC,CACzB,CACJ,CAAC"}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const funcs_1 = require("./funcs");
|
|
6
|
-
const filter_serialization_common_1 = require("./filter-serialization.common");
|
|
7
|
-
const filter_operators_1 = require("./filtering/filter.operators");
|
|
1
|
+
import { isCompositeFilterDescriptor } from './filtering/filter-descriptor.interface';
|
|
2
|
+
import { compose, ifElse } from './funcs';
|
|
3
|
+
import { normalizeField, quote, toLower, isDateValue, isStringValue, serializeFilters, encodeValue, toUTC } from './filter-serialization.common';
|
|
4
|
+
import { normalizeFilters } from './filtering/filter.operators';
|
|
8
5
|
const formatDate = ({ utcDates }) => ({ field, value, ignoreCase, operator }) => ({
|
|
9
|
-
value: JSON.stringify(!utcDates ?
|
|
6
|
+
value: JSON.stringify(!utcDates ? toUTC(value) : value).replace(/"/g, ""),
|
|
10
7
|
field,
|
|
11
8
|
ignoreCase,
|
|
12
9
|
operator
|
|
13
10
|
});
|
|
14
11
|
const fnFormatter = ({ operator }) => ({ field, value }) => `${operator}(${field},${value})`;
|
|
15
12
|
const singleOperatorFormatter = ({ operator }) => ({ field, value }) => `${field} ${operator} ${value}`;
|
|
16
|
-
const stringFormat = formatter =>
|
|
13
|
+
const stringFormat = formatter => compose(formatter, encodeValue, quote, toLower, normalizeField);
|
|
17
14
|
const stringFnOperator = settings => stringFormat(fnFormatter(settings));
|
|
18
15
|
const stringOperator = settings => stringFormat(singleOperatorFormatter(settings));
|
|
19
|
-
const numericOperator = settings =>
|
|
20
|
-
const dateOperator = settings =>
|
|
21
|
-
const ifDate = settings =>
|
|
22
|
-
const typedOperator = settings =>
|
|
16
|
+
const numericOperator = settings => compose(singleOperatorFormatter(settings), normalizeField);
|
|
17
|
+
const dateOperator = settings => compose(singleOperatorFormatter(settings), normalizeField, formatDate(settings));
|
|
18
|
+
const ifDate = settings => ifElse(isDateValue, dateOperator(settings), numericOperator(settings));
|
|
19
|
+
const typedOperator = settings => ifElse(isStringValue, stringOperator(settings), ifDate(settings));
|
|
23
20
|
const appendEqual = str => `${str} eq -1`;
|
|
24
|
-
const nonValueExpression = formatter =>
|
|
21
|
+
const nonValueExpression = formatter => compose(formatter, normalizeField);
|
|
25
22
|
const filterOperators = (operator, settings) => ({
|
|
26
23
|
contains: stringFnOperator(Object.assign(Object.assign({}, settings), { operator: "contains" })),
|
|
27
|
-
doesnotcontain:
|
|
24
|
+
doesnotcontain: compose(appendEqual, stringFnOperator(Object.assign(Object.assign({}, settings), { operator: "indexof" }))),
|
|
28
25
|
endswith: stringFnOperator(Object.assign(Object.assign({}, settings), { operator: "endswith" })),
|
|
29
26
|
eq: typedOperator(Object.assign(Object.assign({}, settings), { operator: "eq" })),
|
|
30
27
|
gt: typedOperator(Object.assign(Object.assign({}, settings), { operator: "gt" })),
|
|
@@ -40,15 +37,14 @@ const filterOperators = (operator, settings) => ({
|
|
|
40
37
|
}[operator]);
|
|
41
38
|
const join = x => ` ${x.logic} `;
|
|
42
39
|
const serialize = settings => x => filterOperators(x.operator, settings)(x);
|
|
43
|
-
const serializeAll = settings =>
|
|
40
|
+
const serializeAll = settings => serializeFilters(filter => ifElse(isCompositeFilterDescriptor, serializeAll(settings), serialize(settings))(filter), join);
|
|
44
41
|
/**
|
|
45
42
|
* @hidden
|
|
46
43
|
*/
|
|
47
|
-
const serializeFilter = (filter, settings = {}) => {
|
|
44
|
+
export const serializeFilter = (filter, settings = {}) => {
|
|
48
45
|
if (filter.filters && filter.filters.length) {
|
|
49
|
-
return "$filter=" + serializeAll(settings)(
|
|
46
|
+
return "$filter=" + serializeAll(settings)(normalizeFilters(filter));
|
|
50
47
|
}
|
|
51
48
|
return "";
|
|
52
49
|
};
|
|
53
|
-
exports.serializeFilter = serializeFilter;
|
|
54
50
|
//# sourceMappingURL=odata-filtering.operators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odata-filtering.operators.js","sourceRoot":"","sources":["../src/odata-filtering.operators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"odata-filtering.operators.js","sourceRoot":"","sources":["../src/odata-filtering.operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACnI,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EACH,cAAc,EACd,KAAK,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,WAAW,EAEX,KAAK,EACR,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,MAAM,UAAU,GACZ,CAAC,EAAE,QAAQ,EAAiB,EAAE,EAAE,CAC5B,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE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
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const utils_1 = require("./utils");
|
|
5
|
-
const odata_filtering_operators_1 = require("./odata-filtering.operators");
|
|
6
|
-
const funcs_1 = require("./funcs");
|
|
1
|
+
import { isPresent, isNotNullOrEmptyString } from './utils';
|
|
2
|
+
import { serializeFilter } from './odata-filtering.operators';
|
|
3
|
+
import { ifElse, constant } from './funcs';
|
|
7
4
|
const serializeSort = (orderby) => {
|
|
8
5
|
const str = orderby
|
|
9
|
-
.filter(sort =>
|
|
6
|
+
.filter(sort => isPresent(sort.dir))
|
|
10
7
|
.map(sort => {
|
|
11
8
|
const order = sort.field.replace(/\./g, "/");
|
|
12
9
|
return sort.dir === "desc" ? order + " desc" : order;
|
|
13
10
|
}).join(",");
|
|
14
11
|
return str ? `$orderby=${str}` : str;
|
|
15
12
|
};
|
|
16
|
-
const emptyString =
|
|
13
|
+
const emptyString = constant('');
|
|
17
14
|
const concat = a => b => a + b;
|
|
18
|
-
const serializeKey = (strings, val) =>
|
|
15
|
+
const serializeKey = (strings, val) => ifElse(isPresent, concat(strings[0]), emptyString)(val);
|
|
19
16
|
const rules = (settings, state) => (key) => ({
|
|
20
|
-
"filter":
|
|
17
|
+
"filter": serializeFilter(state.filter || {}, settings),
|
|
21
18
|
"skip": serializeKey `$skip=${state.skip}`,
|
|
22
19
|
"sort": serializeSort(state.sort || []),
|
|
23
20
|
"take": serializeKey `$top=${state.take}`
|
|
@@ -30,9 +27,8 @@ const rules = (settings, state) => (key) => ({
|
|
|
30
27
|
* @param {ODataSettings} settings - The settings that are used during the serialization.
|
|
31
28
|
* @returns {string} - The serialized state.
|
|
32
29
|
*/
|
|
33
|
-
const toODataString = (state, settings = {}) => (Object.keys(state)
|
|
30
|
+
export const toODataString = (state, settings = {}) => (Object.keys(state)
|
|
34
31
|
.map(rules(settings, state))
|
|
35
|
-
.filter(
|
|
32
|
+
.filter(isNotNullOrEmptyString)
|
|
36
33
|
.join('&'));
|
|
37
|
-
exports.toODataString = toODataString;
|
|
38
34
|
//# sourceMappingURL=odata.operators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odata.operators.js","sourceRoot":"","sources":["../src/odata.operators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"odata.operators.js","sourceRoot":"","sources":["../src/odata.operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,aAAa,GAAG,CAAC,OAA8B,EAAU,EAAE;IAC7D,MAAM,GAAG,GAAG,OAAO;SACd,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnC,GAAG,CAAC,IAAI,CAAC,EAAE;QACR,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IACzD,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEjB,OAAO,GAAG,CAAC,CAAC,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AACjC,MAAM,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AAE/B,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;AAE/F,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACzC,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE,QAAQ,CAAC;IACvD,MAAM,EAAE,YAAY,CAAA,SAAS,KAAK,CAAC,IAAI,EAAE;IACzC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;IACvC,MAAM,EAAE,YAAY,CAAA,QAAQ,KAAK,CAAC,IAAI,EAAE;CAC3C,CAAC,GAAG,CAAC,CAAC,CAAC;AAYR,gCAAgC;AAEhC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAY,EAAE,WAA0B,EAAE,EAAU,EAAE,CAAC,CACjF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;KACb,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;KAC3B,MAAM,CAAC,sBAAsB,CAAC;KAC9B,IAAI,CAAC,GAAG,CAAC,CACjB,CAAC"}
|
package/dist/sort-descriptor.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.composeSortDescriptors = void 0;
|
|
4
|
-
const utils_1 = require("../utils");
|
|
5
|
-
const accessor_1 = require("../accessor");
|
|
1
|
+
import { isPresent, isBlank } from '../utils';
|
|
2
|
+
import { getter } from '../accessor';
|
|
6
3
|
const compare = (a, b) => {
|
|
7
|
-
if (
|
|
4
|
+
if (isBlank(a)) {
|
|
8
5
|
return a === b ? 0 : -1;
|
|
9
6
|
}
|
|
10
|
-
if (
|
|
7
|
+
if (isBlank(b)) {
|
|
11
8
|
return 1;
|
|
12
9
|
}
|
|
13
10
|
if (a.localeCompare) {
|
|
@@ -18,7 +15,7 @@ const compare = (a, b) => {
|
|
|
18
15
|
const compareDesc = (a, b) => compare(b, a);
|
|
19
16
|
const descriptorAsFunc = (descriptor, preprocessors = {}) => {
|
|
20
17
|
const prop = a => {
|
|
21
|
-
const value =
|
|
18
|
+
const value = getter(descriptor.field, true)(a);
|
|
22
19
|
const preprocessor = preprocessors[descriptor.field];
|
|
23
20
|
return preprocessor ? preprocessor(value) : value;
|
|
24
21
|
};
|
|
@@ -42,9 +39,8 @@ const initial = (_a, _b) => 0;
|
|
|
42
39
|
* ```
|
|
43
40
|
*/
|
|
44
41
|
// tslint:enable:max-line-length
|
|
45
|
-
const composeSortDescriptors = (descriptors, preprocessors = {}) => (descriptors
|
|
46
|
-
.filter(x =>
|
|
42
|
+
export const composeSortDescriptors = (descriptors, preprocessors = {}) => (descriptors
|
|
43
|
+
.filter(x => isPresent(x.dir))
|
|
47
44
|
.map((descriptor) => descriptorAsFunc(descriptor, preprocessors))
|
|
48
45
|
.reduce((acc, curr) => (a, b) => acc(a, b) || curr(a, b), initial));
|
|
49
|
-
exports.composeSortDescriptors = composeSortDescriptors;
|
|
50
46
|
//# sourceMappingURL=sort-array.operator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort-array.operator.js","sourceRoot":"","sources":["../../src/sorting/sort-array.operator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sort-array.operator.js","sourceRoot":"","sources":["../../src/sorting/sort-array.operator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAoBrC,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;IACrB,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3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M,sBAAsB,GAAG,CAAI,WAA6B,EAAE,gBAAkC,EAAE,EAAY,EAAE,CAAC,CACxH,WAAW;KACN,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KAC7B,GAAG,CAAC,CAAC,UAA0B,EAAE,EAAE,CAAC,gBAAgB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;KAChF,MAAM,CACH,CAAC,GAAa,EAAE,IAAc,EAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAC9E,OAAO,CACV,CACR,CAAC"}
|
package/dist/sorting/sort.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sort = void 0;
|
|
4
1
|
const merge = (data, left, middle, right, compare) => {
|
|
5
2
|
let leftLength = middle - left;
|
|
6
3
|
let rightLength = right - middle;
|
|
@@ -33,14 +30,13 @@ const merge = (data, left, middle, right, compare) => {
|
|
|
33
30
|
/**
|
|
34
31
|
* @hidden
|
|
35
32
|
*/
|
|
36
|
-
const sort = (data, start, end, compare) => {
|
|
33
|
+
export const sort = (data, start, end, compare) => {
|
|
37
34
|
if (end - start < 2) {
|
|
38
35
|
return;
|
|
39
36
|
}
|
|
40
37
|
const mid = (start + end) >>> 1; // tslint:disable-line:no-bitwise
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
sort(data, start, mid, compare);
|
|
39
|
+
sort(data, mid, end, compare);
|
|
43
40
|
merge(data, start, mid, end, compare);
|
|
44
41
|
};
|
|
45
|
-
exports.sort = sort;
|
|
46
42
|
//# sourceMappingURL=sort.js.map
|
package/dist/sorting/sort.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort.js","sourceRoot":"","sources":["../../src/sorting/sort.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sort.js","sourceRoot":"","sources":["../../src/sorting/sort.ts"],"names":[],"mappings":"AAEA,MAAM,KAAK,GAAG,CAAI,IAAS,EAAE,IAAY,EAAE,MAAc,EAAE,KAAa,EAAE,OAAiB,EAAE,EAAE;IAC3F,IAAI,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;IAEjC,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,UAAU,EAAE,GAAG,EAAE,EAAE;QACvC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC;KAC/B;IAED,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,OAAO,GAAG,MAAM,CAAC;IACrB,IAAI,IAAI,GAAG,IAAI,CAAC;IAEhB,GAAG;QACC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE;YAC3C,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC/B,WAAW,EAAE,CAAC;SACjB;aAAM;YACH,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC/B,UAAU,EAAE,CAAC;SAChB;KACJ,QAAQ,WAAW,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE;IAE5C,OAAO,UAAU,EAAE;QACf,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/B,UAAU,EAAE,CAAC;KAChB;IAED,OAAO,WAAW,EAAE;QAChB,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/B,WAAW,EAAE,CAAC;KACjB;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAI,IAAS,EAAE,KAAa,EAAE,GAAW,EAAE,OAAO,EAAO,EAAE;IAC3E,IAAI,GAAG,GAAG,KAAK,GAAG,CAAC,EAAE;QACjB,OAAO;KACV;IAED,MAAM,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,iCAAiC;IAElE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAChC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAE9B,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
package/dist/state.js
CHANGED
package/dist/transducers.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.exec = exports.skip = exports.takeWhile = exports.take = exports.isTransformerResult = exports.filter = exports.map = exports.concat = exports.aggregatesCombinator = exports.expandAggregates = exports.groupCombinator = void 0;
|
|
4
|
-
const utils_1 = require("./utils");
|
|
5
|
-
const accessor_1 = require("./accessor");
|
|
1
|
+
import { isPresent, isNumeric, isDate } from './utils';
|
|
2
|
+
import { getter } from './accessor';
|
|
6
3
|
const valueToString = (value) => {
|
|
7
|
-
value =
|
|
4
|
+
value = isPresent(value) && value.getTime ? value.getTime() : value;
|
|
8
5
|
return value + "";
|
|
9
6
|
};
|
|
10
7
|
/**
|
|
11
8
|
* @hidden
|
|
12
9
|
*/
|
|
13
|
-
const groupCombinator = (field, preprocessors = {}) => {
|
|
10
|
+
export const groupCombinator = (field, preprocessors = {}) => {
|
|
14
11
|
const prop = a => {
|
|
15
|
-
const value =
|
|
12
|
+
const value = getter(field, true)(a);
|
|
16
13
|
const preprocessor = preprocessors[field];
|
|
17
14
|
return preprocessor ? preprocessor(value) : value;
|
|
18
15
|
};
|
|
@@ -27,11 +24,10 @@ const groupCombinator = (field, preprocessors = {}) => {
|
|
|
27
24
|
return agg;
|
|
28
25
|
};
|
|
29
26
|
};
|
|
30
|
-
exports.groupCombinator = groupCombinator;
|
|
31
27
|
/**
|
|
32
28
|
* @hidden
|
|
33
29
|
*/
|
|
34
|
-
const expandAggregates = (result = {}) => {
|
|
30
|
+
export const expandAggregates = (result = {}) => {
|
|
35
31
|
Object.keys(result).forEach(field => {
|
|
36
32
|
const aggregates = result[field];
|
|
37
33
|
Object.keys(aggregates).forEach(aggregate => {
|
|
@@ -40,14 +36,13 @@ const expandAggregates = (result = {}) => {
|
|
|
40
36
|
});
|
|
41
37
|
return result;
|
|
42
38
|
};
|
|
43
|
-
exports.expandAggregates = expandAggregates;
|
|
44
39
|
const aggregatesFuncs = (name) => ({
|
|
45
40
|
average: () => {
|
|
46
41
|
let value = 0;
|
|
47
42
|
let count = 0;
|
|
48
43
|
return {
|
|
49
44
|
calc: (curr) => {
|
|
50
|
-
if (
|
|
45
|
+
if (isNumeric(curr)) {
|
|
51
46
|
value += curr;
|
|
52
47
|
count++;
|
|
53
48
|
}
|
|
@@ -55,7 +50,7 @@ const aggregatesFuncs = (name) => ({
|
|
|
55
50
|
value = curr;
|
|
56
51
|
}
|
|
57
52
|
},
|
|
58
|
-
result: () =>
|
|
53
|
+
result: () => isNumeric(value) ? value / count : value
|
|
59
54
|
};
|
|
60
55
|
},
|
|
61
56
|
count: () => {
|
|
@@ -69,8 +64,8 @@ const aggregatesFuncs = (name) => ({
|
|
|
69
64
|
let state = Number.NEGATIVE_INFINITY;
|
|
70
65
|
return {
|
|
71
66
|
calc: (value) => {
|
|
72
|
-
state =
|
|
73
|
-
if (state < value && (
|
|
67
|
+
state = isNumeric(state) || isDate(state) ? state : value;
|
|
68
|
+
if (state < value && (isNumeric(value) || isDate(value))) {
|
|
74
69
|
state = value;
|
|
75
70
|
}
|
|
76
71
|
},
|
|
@@ -81,8 +76,8 @@ const aggregatesFuncs = (name) => ({
|
|
|
81
76
|
let state = Number.POSITIVE_INFINITY;
|
|
82
77
|
return {
|
|
83
78
|
calc: (value) => {
|
|
84
|
-
state =
|
|
85
|
-
if (state > value && (
|
|
79
|
+
state = isNumeric(state) || isDate(state) ? state : value;
|
|
80
|
+
if (state > value && (isNumeric(value) || isDate(value))) {
|
|
86
81
|
state = value;
|
|
87
82
|
}
|
|
88
83
|
},
|
|
@@ -99,7 +94,7 @@ const aggregatesFuncs = (name) => ({
|
|
|
99
94
|
count_distinct: () => {
|
|
100
95
|
const state = new Set();
|
|
101
96
|
return {
|
|
102
|
-
calc: (value) => state.add(
|
|
97
|
+
calc: (value) => state.add(isPresent(value) && typeof value === 'object' && value.toString
|
|
103
98
|
? value.toString()
|
|
104
99
|
: value),
|
|
105
100
|
result: () => state.size,
|
|
@@ -109,15 +104,15 @@ const aggregatesFuncs = (name) => ({
|
|
|
109
104
|
/**
|
|
110
105
|
* @hidden
|
|
111
106
|
*/
|
|
112
|
-
const aggregatesCombinator = (descriptors, preprocessors = {}) => {
|
|
107
|
+
export const aggregatesCombinator = (descriptors, preprocessors = {}) => {
|
|
113
108
|
const functions = descriptors.map(descriptor => {
|
|
114
109
|
const fieldAccessor = a => {
|
|
115
|
-
const value =
|
|
110
|
+
const value = getter(descriptor.field, true)(a);
|
|
116
111
|
const preprocessor = preprocessors[descriptor.field];
|
|
117
112
|
return preprocessor ? preprocessor(value) : value;
|
|
118
113
|
};
|
|
119
114
|
const aggregateName = (descriptor.aggregate || "").toLowerCase();
|
|
120
|
-
const aggregateAccessor =
|
|
115
|
+
const aggregateAccessor = getter(aggregateName, true);
|
|
121
116
|
return (state, value) => {
|
|
122
117
|
const fieldAggregates = state[descriptor.field] || {};
|
|
123
118
|
const aggregateFunction = aggregateAccessor(fieldAggregates)
|
|
@@ -130,39 +125,34 @@ const aggregatesCombinator = (descriptors, preprocessors = {}) => {
|
|
|
130
125
|
});
|
|
131
126
|
return (state, value) => functions.reduce((agg, calc) => calc(agg, value), state);
|
|
132
127
|
};
|
|
133
|
-
exports.aggregatesCombinator = aggregatesCombinator;
|
|
134
128
|
/**
|
|
135
129
|
* @hidden
|
|
136
130
|
* Adds the value to the `arr` and produces a new array.
|
|
137
131
|
*
|
|
138
132
|
* > The original array will be modified.
|
|
139
133
|
*/
|
|
140
|
-
const concat = (arr, value) => {
|
|
134
|
+
export const concat = (arr, value) => {
|
|
141
135
|
arr.push(value);
|
|
142
136
|
return arr;
|
|
143
137
|
};
|
|
144
|
-
exports.concat = concat;
|
|
145
138
|
/**
|
|
146
139
|
* @hidden
|
|
147
140
|
* Returns a reducer that will apply the specified transformation to the value.
|
|
148
141
|
*/
|
|
149
|
-
const map = (transform) => ((reduce) => ((acc, curr, index) => reduce(acc, transform(curr, index))));
|
|
150
|
-
exports.map = map;
|
|
142
|
+
export const map = (transform) => ((reduce) => ((acc, curr, index) => reduce(acc, transform(curr, index))));
|
|
151
143
|
/**
|
|
152
144
|
* @hidden
|
|
153
145
|
* Returns a reducer that will filter out items which do not match the `Predicate`.
|
|
154
146
|
*/
|
|
155
|
-
const filter = (predicate) => ((reduce) => ((acc, curr) => predicate(curr) ? reduce(acc, curr) : acc));
|
|
156
|
-
exports.filter = filter;
|
|
147
|
+
export const filter = (predicate) => ((reduce) => ((acc, curr) => predicate(curr) ? reduce(acc, curr) : acc));
|
|
157
148
|
/**
|
|
158
149
|
* @hidden
|
|
159
150
|
*/
|
|
160
|
-
const isTransformerResult = (source) => {
|
|
161
|
-
return
|
|
151
|
+
export const isTransformerResult = (source) => {
|
|
152
|
+
return isPresent(source.__value);
|
|
162
153
|
};
|
|
163
|
-
exports.isTransformerResult = isTransformerResult;
|
|
164
154
|
const reduced = (x) => {
|
|
165
|
-
if (
|
|
155
|
+
if (isTransformerResult(x)) {
|
|
166
156
|
return x;
|
|
167
157
|
}
|
|
168
158
|
return {
|
|
@@ -174,34 +164,30 @@ const reduced = (x) => {
|
|
|
174
164
|
* @hidden
|
|
175
165
|
* Returns a reducer that will take the specified number of items.
|
|
176
166
|
*/
|
|
177
|
-
const take = (count) => ((reduce) => ((acc, curr) => count-- > 0 ? reduce(acc, curr) : reduced(acc)));
|
|
178
|
-
exports.take = take;
|
|
167
|
+
export const take = (count) => ((reduce) => ((acc, curr) => count-- > 0 ? reduce(acc, curr) : reduced(acc)));
|
|
179
168
|
/**
|
|
180
169
|
* @hidden
|
|
181
170
|
* Returns a reducer that will take the specified number of items.
|
|
182
171
|
*/
|
|
183
|
-
const takeWhile = (predicate) => ((reduce) => ((acc, curr) => predicate(curr) ? reduce(acc, curr) : reduced(acc)));
|
|
184
|
-
exports.takeWhile = takeWhile;
|
|
172
|
+
export const takeWhile = (predicate) => ((reduce) => ((acc, curr) => predicate(curr) ? reduce(acc, curr) : reduced(acc)));
|
|
185
173
|
/**
|
|
186
174
|
* @hidden
|
|
187
175
|
* Returns a reducer that will skip the specified number of items.
|
|
188
176
|
*/
|
|
189
|
-
const skip = (count) => ((reduce) => ((acc, curr) => count-- <= 0 ? reduce(acc, curr) : acc));
|
|
190
|
-
exports.skip = skip;
|
|
177
|
+
export const skip = (count) => ((reduce) => ((acc, curr) => count-- <= 0 ? reduce(acc, curr) : acc));
|
|
191
178
|
/**
|
|
192
179
|
* @hidden
|
|
193
180
|
* Transforms the data by applying the supplied transformer.
|
|
194
181
|
*/
|
|
195
|
-
const exec = (transform, initialValue, data) => {
|
|
182
|
+
export const exec = (transform, initialValue, data) => {
|
|
196
183
|
let result = initialValue;
|
|
197
184
|
for (let idx = 0, length = data.length; idx < length; idx++) {
|
|
198
185
|
result = transform(result, data[idx], idx);
|
|
199
|
-
if (
|
|
186
|
+
if (isTransformerResult(result)) {
|
|
200
187
|
result = result.__value;
|
|
201
188
|
break;
|
|
202
189
|
}
|
|
203
190
|
}
|
|
204
191
|
return result;
|
|
205
192
|
};
|
|
206
|
-
exports.exec = exec;
|
|
207
193
|
//# sourceMappingURL=transducers.js.map
|
package/dist/transducers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transducers.js","sourceRoot":"","sources":["../src/transducers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transducers.js","sourceRoot":"","sources":["../src/transducers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,MAAM,aAAa,GAAG,CAAC,KAAK,EAAU,EAAE;IACpC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACpE,OAAO,KAAK,GAAG,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,KAAK,EAAE,gBAAkC,EAAE,EAAE,EAAE;IAC9E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE;QACb,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,YAAY,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC,CAAC;IAEF,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAClB,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAE9B,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,GAA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