@platforma-sdk/model 1.53.10 → 1.53.13
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/annotations/converter.cjs +11 -11
- package/dist/annotations/converter.cjs.map +1 -1
- package/dist/annotations/converter.d.ts +1 -1
- package/dist/annotations/converter.d.ts.map +1 -1
- package/dist/annotations/converter.js +11 -11
- package/dist/annotations/converter.js.map +1 -1
- package/dist/annotations/index.d.ts +2 -2
- package/dist/annotations/types.d.ts +4 -4
- package/dist/bconfig/index.d.ts +5 -5
- package/dist/bconfig/lambdas.d.ts +7 -7
- package/dist/bconfig/lambdas.d.ts.map +1 -1
- package/dist/bconfig/normalization.cjs.map +1 -1
- package/dist/bconfig/normalization.d.ts +3 -3
- package/dist/bconfig/normalization.js.map +1 -1
- package/dist/bconfig/types.cjs.map +1 -1
- package/dist/bconfig/types.d.ts +2 -2
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/types.js.map +1 -1
- package/dist/bconfig/util.d.ts +4 -4
- package/dist/bconfig/v3.d.ts +3 -3
- package/dist/block_api_v1.d.ts +2 -2
- package/dist/block_api_v1.d.ts.map +1 -1
- package/dist/block_api_v2.d.ts +2 -2
- package/dist/block_api_v2.d.ts.map +1 -1
- package/dist/block_api_v3.d.ts +3 -3
- package/dist/block_migrations.cjs +10 -10
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts.map +1 -1
- package/dist/block_migrations.js +10 -10
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +11 -11
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +8 -8
- package/dist/block_model.d.ts.map +1 -1
- package/dist/block_model.js +11 -11
- package/dist/block_model.js.map +1 -1
- package/dist/block_state_patch.d.ts +2 -2
- package/dist/block_state_util.cjs +1 -1
- package/dist/block_state_util.cjs.map +1 -1
- package/dist/block_state_util.d.ts +3 -3
- package/dist/block_state_util.js +1 -1
- package/dist/block_state_util.js.map +1 -1
- package/dist/block_storage.cjs +10 -10
- package/dist/block_storage.cjs.map +1 -1
- package/dist/block_storage.d.ts +2 -2
- package/dist/block_storage.d.ts.map +1 -1
- package/dist/block_storage.js +10 -10
- package/dist/block_storage.js.map +1 -1
- package/dist/block_storage_vm.cjs +22 -22
- package/dist/block_storage_vm.cjs.map +1 -1
- package/dist/block_storage_vm.d.ts +1 -1
- package/dist/block_storage_vm.d.ts.map +1 -1
- package/dist/block_storage_vm.js +22 -22
- package/dist/block_storage_vm.js.map +1 -1
- package/dist/builder.cjs +32 -23
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.d.ts +7 -7
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +32 -23
- package/dist/builder.js.map +1 -1
- package/dist/components/PFrameForGraphs.cjs +7 -6
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +4 -4
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.js +7 -6
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlAnnotations/filter.d.ts +14 -14
- package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.cjs +46 -46
- package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts +10 -34
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.js +46 -46
- package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
- package/dist/components/PlAnnotations/index.d.ts +2 -2
- package/dist/components/PlAnnotations/types.d.ts +2 -2
- package/dist/components/PlDataTable.cjs +19 -20
- package/dist/components/PlDataTable.cjs.map +1 -1
- package/dist/components/PlDataTable.d.ts +27 -27
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/components/PlDataTable.js +19 -20
- package/dist/components/PlDataTable.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.cjs +2 -2
- package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts +6 -6
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.js +2 -2
- package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
- package/dist/components/PlSelectionModel.cjs.map +1 -1
- package/dist/components/PlSelectionModel.d.ts +1 -1
- package/dist/components/PlSelectionModel.js.map +1 -1
- package/dist/components/index.d.ts +5 -5
- package/dist/config/actions.cjs +39 -39
- package/dist/config/actions.cjs.map +1 -1
- package/dist/config/actions.d.ts +9 -9
- package/dist/config/actions.d.ts.map +1 -1
- package/dist/config/actions.js +39 -39
- package/dist/config/actions.js.map +1 -1
- package/dist/config/actions_kinds.d.ts +30 -30
- package/dist/config/actions_kinds.d.ts.map +1 -1
- package/dist/config/index.d.ts +6 -6
- package/dist/config/model.d.ts +28 -28
- package/dist/config/model_meta.d.ts +1 -1
- package/dist/config/type_engine.d.ts +3 -3
- package/dist/config/type_util.d.ts +2 -2
- package/dist/env_value.cjs +1 -1
- package/dist/env_value.cjs.map +1 -1
- package/dist/env_value.js +1 -1
- package/dist/env_value.js.map +1 -1
- package/dist/filters/converter.cjs +36 -32
- package/dist/filters/converter.cjs.map +1 -1
- package/dist/filters/converter.d.ts +2 -2
- package/dist/filters/converter.d.ts.map +1 -1
- package/dist/filters/converter.js +36 -32
- package/dist/filters/converter.js.map +1 -1
- package/dist/filters/index.d.ts +2 -2
- package/dist/filters/types.d.ts +33 -33
- package/dist/filters/types.d.ts.map +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/internal.cjs +7 -7
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.ts +4 -4
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +7 -7
- package/dist/internal.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/pframe.cjs +1 -1
- package/dist/pframe.cjs.map +1 -1
- package/dist/pframe.d.ts +1 -1
- package/dist/pframe.js +1 -1
- package/dist/pframe.js.map +1 -1
- package/dist/pframe_utils/columns.cjs +23 -15
- package/dist/pframe_utils/columns.cjs.map +1 -1
- package/dist/pframe_utils/columns.d.ts +3 -3
- package/dist/pframe_utils/columns.d.ts.map +1 -1
- package/dist/pframe_utils/columns.js +23 -15
- package/dist/pframe_utils/columns.js.map +1 -1
- package/dist/pframe_utils/index.cjs +25 -25
- package/dist/pframe_utils/index.cjs.map +1 -1
- package/dist/pframe_utils/index.d.ts +3 -3
- package/dist/pframe_utils/index.d.ts.map +1 -1
- package/dist/pframe_utils/index.js +25 -25
- package/dist/pframe_utils/index.js.map +1 -1
- package/dist/platforma.d.ts +7 -7
- package/dist/platforma.d.ts.map +1 -1
- package/dist/raw_globals.cjs +4 -1
- package/dist/raw_globals.cjs.map +1 -1
- package/dist/raw_globals.d.ts +2 -2
- package/dist/raw_globals.d.ts.map +1 -1
- package/dist/raw_globals.js +4 -1
- package/dist/raw_globals.js.map +1 -1
- package/dist/ref_util.cjs +4 -4
- package/dist/ref_util.cjs.map +1 -1
- package/dist/ref_util.d.ts +1 -1
- package/dist/ref_util.js +4 -4
- package/dist/ref_util.js.map +1 -1
- package/dist/render/accessor.cjs +24 -24
- package/dist/render/accessor.cjs.map +1 -1
- package/dist/render/accessor.d.ts +10 -10
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/accessor.js +24 -24
- package/dist/render/accessor.js.map +1 -1
- package/dist/render/api.cjs +23 -23
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +11 -11
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +23 -23
- package/dist/render/api.js.map +1 -1
- package/dist/render/future.cjs.map +1 -1
- package/dist/render/future.d.ts +1 -1
- package/dist/render/future.js.map +1 -1
- package/dist/render/index.d.ts +6 -6
- package/dist/render/internal.cjs +4 -4
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +7 -7
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/render/internal.js +4 -4
- package/dist/render/internal.js.map +1 -1
- package/dist/render/traversal_ops.d.ts +1 -1
- package/dist/render/util/axis_filtering.cjs +48 -44
- package/dist/render/util/axis_filtering.cjs.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +2 -2
- package/dist/render/util/axis_filtering.js +48 -44
- package/dist/render/util/axis_filtering.js.map +1 -1
- package/dist/render/util/column_collection.cjs +42 -35
- package/dist/render/util/column_collection.cjs.map +1 -1
- package/dist/render/util/column_collection.d.ts +4 -4
- package/dist/render/util/column_collection.d.ts.map +1 -1
- package/dist/render/util/column_collection.js +42 -35
- package/dist/render/util/column_collection.js.map +1 -1
- package/dist/render/util/index.d.ts +4 -4
- package/dist/render/util/label.cjs +15 -21
- package/dist/render/util/label.cjs.map +1 -1
- package/dist/render/util/label.d.ts +2 -2
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/label.js +15 -21
- package/dist/render/util/label.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +56 -54
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +5 -5
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.js +56 -54
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/dist/render/util/pframe_upgraders.cjs +6 -6
- package/dist/render/util/pframe_upgraders.cjs.map +1 -1
- package/dist/render/util/pframe_upgraders.d.ts +1 -1
- package/dist/render/util/pframe_upgraders.d.ts.map +1 -1
- package/dist/render/util/pframe_upgraders.js +6 -6
- package/dist/render/util/pframe_upgraders.js.map +1 -1
- package/dist/render/util/split_selectors.d.ts +1 -1
- package/dist/render/util/split_selectors.d.ts.map +1 -1
- package/dist/sdk_info.cjs.map +1 -1
- package/dist/sdk_info.js.map +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +23 -21
- package/src/annotations/converter.test.ts +98 -101
- package/src/annotations/converter.ts +21 -17
- package/src/annotations/index.ts +2 -2
- package/src/annotations/types.ts +4 -4
- package/src/bconfig/index.ts +5 -5
- package/src/bconfig/lambdas.ts +10 -12
- package/src/bconfig/normalization.ts +5 -5
- package/src/bconfig/types.ts +3 -5
- package/src/bconfig/util.ts +3 -3
- package/src/bconfig/v3.ts +3 -3
- package/src/block_api_v1.ts +7 -3
- package/src/block_api_v2.ts +7 -3
- package/src/block_api_v3.ts +3 -3
- package/src/block_migrations.test.ts +66 -67
- package/src/block_migrations.ts +16 -16
- package/src/block_model.ts +76 -140
- package/src/block_state_patch.ts +2 -2
- package/src/block_state_util.ts +4 -4
- package/src/block_storage.test.ts +106 -99
- package/src/block_storage.ts +22 -25
- package/src/block_storage_vm.ts +41 -35
- package/src/builder.ts +107 -95
- package/src/components/PFrameForGraphs.test.ts +261 -255
- package/src/components/PFrameForGraphs.ts +35 -22
- package/src/components/PlAnnotations/filter.ts +21 -15
- package/src/components/PlAnnotations/filters_ui.test.ts +230 -73
- package/src/components/PlAnnotations/filters_ui.ts +138 -105
- package/src/components/PlAnnotations/index.ts +2 -2
- package/src/components/PlAnnotations/types.ts +2 -2
- package/src/components/PlDataTable.ts +177 -164
- package/src/components/PlMultiSequenceAlignment.ts +11 -18
- package/src/components/PlSelectionModel.ts +1 -1
- package/src/components/index.ts +5 -5
- package/src/config/actions.ts +64 -59
- package/src/config/actions_kinds.ts +38 -34
- package/src/config/index.ts +6 -6
- package/src/config/model.ts +28 -28
- package/src/config/model_meta.ts +1 -1
- package/src/config/type_engine.ts +3 -3
- package/src/config/type_util.ts +2 -2
- package/src/env_value.ts +2 -2
- package/src/filters/converter.test.ts +185 -144
- package/src/filters/converter.ts +47 -35
- package/src/filters/index.ts +2 -2
- package/src/filters/types.ts +44 -39
- package/src/global.d.ts +1 -1
- package/src/index.ts +24 -24
- package/src/internal.ts +27 -17
- package/src/pframe.ts +3 -3
- package/src/pframe_utils/columns.ts +81 -31
- package/src/pframe_utils/index.ts +65 -43
- package/src/platforma.ts +44 -21
- package/src/raw_globals.ts +13 -7
- package/src/ref_util.ts +6 -6
- package/src/render/accessor.ts +43 -44
- package/src/render/api.ts +102 -78
- package/src/render/future.ts +2 -2
- package/src/render/index.ts +6 -6
- package/src/render/internal.ts +11 -12
- package/src/render/traversal_ops.ts +1 -1
- package/src/render/util/axis_filtering.ts +67 -52
- package/src/render/util/column_collection.ts +171 -91
- package/src/render/util/index.ts +4 -4
- package/src/render/util/label.test.ts +139 -139
- package/src/render/util/label.ts +42 -33
- package/src/render/util/pcolumn_data.ts +111 -75
- package/src/render/util/pframe_upgraders.ts +24 -13
- package/src/render/util/split_selectors.ts +6 -1
- package/src/sdk_info.ts +1 -1
- package/src/typing.test.ts +56 -56
- package/src/version.ts +1 -1
package/dist/filters/types.d.ts
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import type { PColumnSpec, SUniversalPColumnId } from
|
|
2
|
-
export type SimplifiedPColumnSpec = Pick<PColumnSpec,
|
|
1
|
+
import type { PColumnSpec, SUniversalPColumnId } from "@milaboratories/pl-model-common";
|
|
2
|
+
export type SimplifiedPColumnSpec = Pick<PColumnSpec, "valueType" | "annotations">;
|
|
3
3
|
export type SimplifiedUniversalPColumnEntry = {
|
|
4
4
|
id: SUniversalPColumnId;
|
|
5
5
|
label: string;
|
|
6
6
|
obj: SimplifiedPColumnSpec;
|
|
7
7
|
};
|
|
8
|
-
export type FilterSpecNode<Leaf, CommonNode = {}, CommonLeaf = {}> = CommonLeaf & Leaf | CommonNode & {
|
|
9
|
-
type:
|
|
8
|
+
export type FilterSpecNode<Leaf, CommonNode = {}, CommonLeaf = {}> = (CommonLeaf & Leaf) | (CommonNode & {
|
|
9
|
+
type: "not";
|
|
10
10
|
filter: FilterSpecNode<Leaf, CommonNode, CommonLeaf>;
|
|
11
|
-
} | CommonNode & {
|
|
12
|
-
type:
|
|
11
|
+
}) | (CommonNode & {
|
|
12
|
+
type: "or";
|
|
13
13
|
filters: FilterSpecNode<Leaf, CommonNode, CommonLeaf>[];
|
|
14
|
-
} | CommonNode & {
|
|
15
|
-
type:
|
|
14
|
+
}) | (CommonNode & {
|
|
15
|
+
type: "and";
|
|
16
16
|
filters: FilterSpecNode<Leaf, CommonNode, CommonLeaf>[];
|
|
17
|
-
};
|
|
17
|
+
});
|
|
18
18
|
export type FilterSpecLeaf<T = SUniversalPColumnId> = {
|
|
19
19
|
type: undefined;
|
|
20
20
|
} | {
|
|
21
|
-
type:
|
|
21
|
+
type: "isNA";
|
|
22
22
|
column: T;
|
|
23
23
|
} | {
|
|
24
|
-
type:
|
|
24
|
+
type: "isNotNA";
|
|
25
25
|
column: T;
|
|
26
26
|
} | {
|
|
27
|
-
type:
|
|
27
|
+
type: "patternEquals";
|
|
28
28
|
column: T;
|
|
29
29
|
value: string;
|
|
30
30
|
} | {
|
|
31
|
-
type:
|
|
31
|
+
type: "patternNotEquals";
|
|
32
32
|
column: T;
|
|
33
33
|
value: string;
|
|
34
34
|
} | {
|
|
35
|
-
type:
|
|
35
|
+
type: "patternContainSubsequence";
|
|
36
36
|
column: T;
|
|
37
37
|
value: string;
|
|
38
38
|
} | {
|
|
39
|
-
type:
|
|
39
|
+
type: "patternNotContainSubsequence";
|
|
40
40
|
column: T;
|
|
41
41
|
value: string;
|
|
42
42
|
} | {
|
|
43
|
-
type:
|
|
43
|
+
type: "patternMatchesRegularExpression";
|
|
44
44
|
column: T;
|
|
45
45
|
value: string;
|
|
46
46
|
} | {
|
|
47
|
-
type:
|
|
47
|
+
type: "patternFuzzyContainSubsequence";
|
|
48
48
|
column: T;
|
|
49
49
|
value: string;
|
|
50
50
|
maxEdits?: number;
|
|
51
51
|
substitutionsOnly?: boolean;
|
|
52
52
|
wildcard?: string;
|
|
53
53
|
} | {
|
|
54
|
-
type:
|
|
54
|
+
type: "inSet";
|
|
55
55
|
column: T;
|
|
56
56
|
value: string[];
|
|
57
57
|
} | {
|
|
58
|
-
type:
|
|
58
|
+
type: "notInSet";
|
|
59
59
|
column: T;
|
|
60
60
|
value: string[];
|
|
61
61
|
} | {
|
|
62
|
-
type:
|
|
62
|
+
type: "topN";
|
|
63
63
|
column: T;
|
|
64
64
|
n: number;
|
|
65
65
|
} | {
|
|
66
|
-
type:
|
|
66
|
+
type: "bottomN";
|
|
67
67
|
column: T;
|
|
68
68
|
n: number;
|
|
69
69
|
} | {
|
|
70
|
-
type:
|
|
70
|
+
type: "equal";
|
|
71
71
|
column: T;
|
|
72
72
|
x: number;
|
|
73
73
|
} | {
|
|
74
|
-
type:
|
|
74
|
+
type: "notEqual";
|
|
75
75
|
column: T;
|
|
76
76
|
x: number;
|
|
77
77
|
} | {
|
|
78
|
-
type:
|
|
78
|
+
type: "lessThan";
|
|
79
79
|
column: T;
|
|
80
80
|
x: number;
|
|
81
81
|
} | {
|
|
82
|
-
type:
|
|
82
|
+
type: "greaterThan";
|
|
83
83
|
column: T;
|
|
84
84
|
x: number;
|
|
85
85
|
} | {
|
|
86
|
-
type:
|
|
86
|
+
type: "lessThanOrEqual";
|
|
87
87
|
column: T;
|
|
88
88
|
x: number;
|
|
89
89
|
} | {
|
|
90
|
-
type:
|
|
90
|
+
type: "greaterThanOrEqual";
|
|
91
91
|
column: T;
|
|
92
92
|
x: number;
|
|
93
93
|
} | {
|
|
94
|
-
type:
|
|
94
|
+
type: "equalToColumn";
|
|
95
95
|
column: T;
|
|
96
96
|
rhs: T;
|
|
97
97
|
} | {
|
|
98
|
-
type:
|
|
98
|
+
type: "lessThanColumn";
|
|
99
99
|
column: T;
|
|
100
100
|
rhs: T;
|
|
101
101
|
minDiff?: number;
|
|
102
102
|
} | {
|
|
103
|
-
type:
|
|
103
|
+
type: "greaterThanColumn";
|
|
104
104
|
column: T;
|
|
105
105
|
rhs: T;
|
|
106
106
|
minDiff?: number;
|
|
107
107
|
} | {
|
|
108
|
-
type:
|
|
108
|
+
type: "lessThanColumnOrEqual";
|
|
109
109
|
column: T;
|
|
110
110
|
rhs: T;
|
|
111
111
|
minDiff?: number;
|
|
112
112
|
} | {
|
|
113
|
-
type:
|
|
113
|
+
type: "greaterThanColumnOrEqual";
|
|
114
114
|
column: T;
|
|
115
115
|
rhs: T;
|
|
116
116
|
minDiff?: number;
|
|
@@ -118,7 +118,7 @@ export type FilterSpecLeaf<T = SUniversalPColumnId> = {
|
|
|
118
118
|
export type FilterSpec<Leaf extends FilterSpecLeaf<unknown> = FilterSpecLeaf<SUniversalPColumnId>, CommonNode = {}, CommonLeaf = CommonNode> = FilterSpecNode<Leaf, CommonNode, CommonLeaf>;
|
|
119
119
|
export type FilterSpecType = Exclude<FilterSpec, {
|
|
120
120
|
type: undefined;
|
|
121
|
-
}>[
|
|
121
|
+
}>["type"];
|
|
122
122
|
export type FilterSpecOfType<T extends FilterSpecType> = Extract<FilterSpec, {
|
|
123
123
|
type: T;
|
|
124
124
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/filters/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAExF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,aAAa,CAAC,CAAC;AAEnF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,EAAE,EAAE,mBAAmB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,qBAAqB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,IAC7D,UAAU,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/filters/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAExF,MAAM,MAAM,qBAAqB,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O,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,cAAc,IAAI,OAAO,CAAC,UAAU,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export { BlockModelV3 } from
|
|
6
|
-
export { DataModel, DataModelBuilder, DataUnrecoverableError, isDataUnrecoverableError, defineDataVersions, defaultRecover, makeDataVersioned, } from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * as JsRenderInternal from
|
|
24
|
-
export { getEnvironmentValue } from
|
|
1
|
+
export * from "./block_state_patch";
|
|
2
|
+
export * from "./block_state_util";
|
|
3
|
+
export * from "./block_storage";
|
|
4
|
+
export * from "./builder";
|
|
5
|
+
export { BlockModelV3 } from "./block_model";
|
|
6
|
+
export { DataModel, DataModelBuilder, DataUnrecoverableError, isDataUnrecoverableError, defineDataVersions, defaultRecover, makeDataVersioned, } from "./block_migrations";
|
|
7
|
+
export * from "./bconfig";
|
|
8
|
+
export * from "./components";
|
|
9
|
+
export * from "./config";
|
|
10
|
+
export * from "./pframe";
|
|
11
|
+
export * from "./platforma";
|
|
12
|
+
export * from "./ref_util";
|
|
13
|
+
export * from "./render";
|
|
14
|
+
export * from "./sdk_info";
|
|
15
|
+
export * from "./raw_globals";
|
|
16
|
+
export * from "./block_api_v1";
|
|
17
|
+
export * from "./block_api_v2";
|
|
18
|
+
export * from "./filters";
|
|
19
|
+
export * from "./annotations";
|
|
20
|
+
export * from "./pframe_utils";
|
|
21
|
+
export * from "@milaboratories/pl-model-common";
|
|
22
|
+
export * from "@milaboratories/pl-error-like";
|
|
23
|
+
export * as JsRenderInternal from "./render/internal";
|
|
24
|
+
export { getEnvironmentValue } from "./env_value";
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/internal.cjs
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
/** Utility code helping to identify whether the code is running in actual UI environment */
|
|
4
4
|
function isInUI() {
|
|
5
|
-
return (typeof globalThis.getPlatforma !==
|
|
5
|
+
return (typeof globalThis.getPlatforma !== "undefined" || typeof globalThis.platforma !== "undefined");
|
|
6
6
|
}
|
|
7
7
|
/** Utility code helping to retrieve a platforma instance form the environment */
|
|
8
8
|
function getPlatformaInstance(config) {
|
|
9
|
-
if (config && typeof globalThis.getPlatforma ===
|
|
9
|
+
if (config && typeof globalThis.getPlatforma === "function")
|
|
10
10
|
return globalThis.getPlatforma(config);
|
|
11
|
-
else if (typeof globalThis.platforma !==
|
|
11
|
+
else if (typeof globalThis.platforma !== "undefined")
|
|
12
12
|
return globalThis.platforma;
|
|
13
13
|
else
|
|
14
|
-
throw new Error(
|
|
14
|
+
throw new Error("Can't get platforma instance.");
|
|
15
15
|
}
|
|
16
16
|
function tryGetCfgRenderCtx() {
|
|
17
|
-
if (typeof globalThis.cfgRenderCtx !==
|
|
17
|
+
if (typeof globalThis.cfgRenderCtx !== "undefined")
|
|
18
18
|
return globalThis.cfgRenderCtx;
|
|
19
19
|
else
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
|
22
22
|
function getCfgRenderCtx() {
|
|
23
|
-
if (typeof globalThis.cfgRenderCtx !==
|
|
23
|
+
if (typeof globalThis.cfgRenderCtx !== "undefined")
|
|
24
24
|
return globalThis.cfgRenderCtx;
|
|
25
25
|
else
|
|
26
|
-
throw new Error(
|
|
26
|
+
throw new Error("Not in config rendering context");
|
|
27
27
|
}
|
|
28
28
|
function tryRegisterCallback(key, callback) {
|
|
29
29
|
const ctx = tryGetCfgRenderCtx();
|
package/dist/internal.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.cjs","sources":["../src/internal.ts"],"sourcesContent":["import type { OutputWithStatus } from
|
|
1
|
+
{"version":3,"file":"internal.cjs","sources":["../src/internal.ts"],"sourcesContent":["import type { OutputWithStatus } from \"@milaboratories/pl-model-common\";\nimport {} from \"./global\";\nimport type { Platforma, PlatformaApiVersion } from \"./platforma\";\nimport type { FutureHandle, GlobalCfgRenderCtx } from \"./render/internal\";\nimport type { ConfigRenderLambda, ConfigRenderLambdaFlags } from \"./bconfig\";\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== \"undefined\" || typeof globalThis.platforma !== \"undefined\"\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, OutputWithStatus<unknown>> = Record<\n string,\n OutputWithStatus<unknown>\n >,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: {\n sdkVersion: string;\n apiVersion: PlatformaApiVersion;\n}): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === \"function\")\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== \"undefined\")\n return globalThis.platforma as Platforma<Args, Outputs, UiState, Href>;\n else throw new Error(\"Can't get platforma instance.\");\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n else throw new Error(\"Not in config rendering context\");\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\n/**\n * Registers a callback, replacing any existing callback with the same key.\n * Use this for callbacks that have a default value but can be overridden.\n *\n * @param key - The callback registry key\n * @param callback - The callback function to register\n * @returns true if registered, false if not in render context\n */\nexport function replaceCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\n//\n// ConfigRenderLambda helpers\n//\n\n/** Options for creating a ConfigRenderLambda descriptor */\nexport type CreateLambdaOptions = ConfigRenderLambdaFlags & {\n /** The callback registry key */\n handle: string;\n};\n\n/** Creates a ConfigRenderLambda descriptor without registering a callback. */\nexport function createRenderLambda<T = unknown>(opts: CreateLambdaOptions): ConfigRenderLambda<T> {\n const { handle, ...flags } = opts;\n return {\n __renderLambda: true,\n handle,\n ...flags,\n } as ConfigRenderLambda<T>;\n}\n\n/** Registers a callback and returns a ConfigRenderLambda descriptor. */\nexport function createAndRegisterRenderLambda<T = unknown>(\n opts: CreateLambdaOptions & {\n lambda: (...args: any[]) => any;\n },\n replace?: boolean,\n): ConfigRenderLambda<T> {\n const { handle, lambda, ...flags } = opts;\n\n if (replace) {\n replaceCallback(handle, lambda);\n } else {\n tryRegisterCallback(handle, lambda);\n }\n\n return createRenderLambda<T>({ handle, ...flags });\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n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AI,CAAC,SAAS,CAAC;AAC7C;;;;;;;;;;;;"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { OutputWithStatus } from
|
|
2
|
-
import type { Platforma, PlatformaApiVersion } from
|
|
3
|
-
import type { FutureHandle, GlobalCfgRenderCtx } from
|
|
4
|
-
import type { ConfigRenderLambda, ConfigRenderLambdaFlags } from
|
|
1
|
+
import type { OutputWithStatus } from "@milaboratories/pl-model-common";
|
|
2
|
+
import type { Platforma, PlatformaApiVersion } from "./platforma";
|
|
3
|
+
import type { FutureHandle, GlobalCfgRenderCtx } from "./render/internal";
|
|
4
|
+
import type { ConfigRenderLambda, ConfigRenderLambdaFlags } from "./bconfig";
|
|
5
5
|
/** Utility code helping to identify whether the code is running in actual UI environment */
|
|
6
6
|
export declare function isInUI(): boolean;
|
|
7
7
|
/** Utility code helping to retrieve a platforma instance form the environment */
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAE7E,4FAA4F;AAC5F,wBAAgB,MAAM,YAIrB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAA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M,CAAC;CAChB,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,mBAAmB,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAOhG;AAED,wEAAwE;AACxE,wBAAgB,6BAA6B,CAAC,CAAC,GAAG,OAAO,EACvD,IAAI,EAAE,mBAAmB,GAAG;IAC1B,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;CACjC,EACD,OAAO,CAAC,EAAE,OAAO,GAChB,kBAAkB,CAAC,CAAC,CAAC,CAUvB;AAID,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,QAU5F"}
|
package/dist/internal.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/** Utility code helping to identify whether the code is running in actual UI environment */
|
|
2
2
|
function isInUI() {
|
|
3
|
-
return (typeof globalThis.getPlatforma !==
|
|
3
|
+
return (typeof globalThis.getPlatforma !== "undefined" || typeof globalThis.platforma !== "undefined");
|
|
4
4
|
}
|
|
5
5
|
/** Utility code helping to retrieve a platforma instance form the environment */
|
|
6
6
|
function getPlatformaInstance(config) {
|
|
7
|
-
if (config && typeof globalThis.getPlatforma ===
|
|
7
|
+
if (config && typeof globalThis.getPlatforma === "function")
|
|
8
8
|
return globalThis.getPlatforma(config);
|
|
9
|
-
else if (typeof globalThis.platforma !==
|
|
9
|
+
else if (typeof globalThis.platforma !== "undefined")
|
|
10
10
|
return globalThis.platforma;
|
|
11
11
|
else
|
|
12
|
-
throw new Error(
|
|
12
|
+
throw new Error("Can't get platforma instance.");
|
|
13
13
|
}
|
|
14
14
|
function tryGetCfgRenderCtx() {
|
|
15
|
-
if (typeof globalThis.cfgRenderCtx !==
|
|
15
|
+
if (typeof globalThis.cfgRenderCtx !== "undefined")
|
|
16
16
|
return globalThis.cfgRenderCtx;
|
|
17
17
|
else
|
|
18
18
|
return undefined;
|
|
19
19
|
}
|
|
20
20
|
function getCfgRenderCtx() {
|
|
21
|
-
if (typeof globalThis.cfgRenderCtx !==
|
|
21
|
+
if (typeof globalThis.cfgRenderCtx !== "undefined")
|
|
22
22
|
return globalThis.cfgRenderCtx;
|
|
23
23
|
else
|
|
24
|
-
throw new Error(
|
|
24
|
+
throw new Error("Not in config rendering context");
|
|
25
25
|
}
|
|
26
26
|
function tryRegisterCallback(key, callback) {
|
|
27
27
|
const ctx = tryGetCfgRenderCtx();
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sources":["../src/internal.ts"],"sourcesContent":["import type { OutputWithStatus } from
|
|
1
|
+
{"version":3,"file":"internal.js","sources":["../src/internal.ts"],"sourcesContent":["import type { OutputWithStatus } from \"@milaboratories/pl-model-common\";\nimport {} from \"./global\";\nimport type { Platforma, PlatformaApiVersion } from \"./platforma\";\nimport type { FutureHandle, GlobalCfgRenderCtx } from \"./render/internal\";\nimport type { ConfigRenderLambda, ConfigRenderLambdaFlags } from \"./bconfig\";\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== \"undefined\" || typeof globalThis.platforma !== \"undefined\"\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, OutputWithStatus<unknown>> = Record<\n string,\n OutputWithStatus<unknown>\n >,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: {\n sdkVersion: string;\n apiVersion: PlatformaApiVersion;\n}): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === \"function\")\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== \"undefined\")\n return globalThis.platforma as Platforma<Args, Outputs, UiState, Href>;\n else throw new Error(\"Can't get platforma instance.\");\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== \"undefined\") return globalThis.cfgRenderCtx;\n else throw new Error(\"Not in config rendering context\");\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\n/**\n * Registers a callback, replacing any existing callback with the same key.\n * Use this for callbacks that have a default value but can be overridden.\n *\n * @param key - The callback registry key\n * @param callback - The callback function to register\n * @returns true if registered, false if not in render context\n */\nexport function replaceCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\n//\n// ConfigRenderLambda helpers\n//\n\n/** Options for creating a ConfigRenderLambda descriptor */\nexport type CreateLambdaOptions = ConfigRenderLambdaFlags & {\n /** The callback registry key */\n handle: string;\n};\n\n/** Creates a ConfigRenderLambda descriptor without registering a callback. */\nexport function createRenderLambda<T = unknown>(opts: CreateLambdaOptions): ConfigRenderLambda<T> {\n const { handle, ...flags } = opts;\n return {\n __renderLambda: true,\n handle,\n ...flags,\n } as ConfigRenderLambda<T>;\n}\n\n/** Registers a callback and returns a ConfigRenderLambda descriptor. */\nexport function createAndRegisterRenderLambda<T = unknown>(\n opts: CreateLambdaOptions & {\n lambda: (...args: any[]) => any;\n },\n replace?: boolean,\n): ConfigRenderLambda<T> {\n const { handle, lambda, ...flags } = opts;\n\n if (replace) {\n replaceCallback(handle, lambda);\n } else {\n tryRegisterCallback(handle, lambda);\n }\n\n return createRenderLambda<T>({ handle, ...flags });\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n"],"names":[],"mappings":"AAMA;SACgB,MAAM,GAAA;AACpB,IAAA,QACE,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;AAEjG;AAEA;AACM,SAAU,oBAAoB,CAQlC,MAGD,EAAA;AACC,IAAA,IAAI,MAAM,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,UAAU;AACzD,QAAA,OAAO,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;AACnC,SAAA,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;QAClD,OAAO,UAAU,CAAC,SAAoD;;AACnE,QAAA,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC;AACvD;SAEgB,kBAAkB,GAAA;AAChC,IAAA,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,YAAY;;AAC7E,QAAA,OAAO,SAAS;AACvB;SAEgB,eAAe,GAAA;AAC7B,IAAA,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,YAAY;;AAC7E,QAAA,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC;AACzD;AAEM,SAAU,mBAAmB,CAAC,GAAW,EAAE,QAAiC,EAAA;AAChF,IAAA,MAAM,GAAG,GAAG,kBAAkB,EAAE;IAChC,IAAI,GAAG,KAAK,SAAS;AAAE,QAAA,OAAO,KAAK;AACnC,IAAA,IAAI,GAAG,IAAI,GAAG,CAAC,gBAAgB;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAA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C7C,GAAG,CAAC,KAAK,CAAC;YACZ;AACF,QAAA,CAAC;AACD,QAAA,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;IAChC;IACA,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,IAAI,CAAC,SAAS,CAAC;AAC7C;;;;"}
|
package/dist/package.json.cjs
CHANGED
package/dist/package.json.js
CHANGED
package/dist/pframe.cjs
CHANGED
|
@@ -30,7 +30,7 @@ class PFrameImpl {
|
|
|
30
30
|
}
|
|
31
31
|
getPlatforma() {
|
|
32
32
|
if (platforma === undefined) {
|
|
33
|
-
throw new Error(
|
|
33
|
+
throw new Error("Platforma instance is not available in the current context.");
|
|
34
34
|
}
|
|
35
35
|
return platforma;
|
|
36
36
|
}
|
package/dist/pframe.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pframe.cjs","sources":["../src/pframe.ts"],"sourcesContent":["import type {\n CalculateTableDataRequest,\n CalculateTableDataResponse,\n FindColumnsRequest,\n FindColumnsResponse,\n PColumnIdAndSpec,\n PColumnSpec,\n PFrame,\n PFrameHandle,\n PObjectId,\n TableRange,\n UniqueValuesRequest,\n UniqueValuesResponse,\n} from
|
|
1
|
+
{"version":3,"file":"pframe.cjs","sources":["../src/pframe.ts"],"sourcesContent":["import type {\n CalculateTableDataRequest,\n CalculateTableDataResponse,\n FindColumnsRequest,\n FindColumnsResponse,\n PColumnIdAndSpec,\n PColumnSpec,\n PFrame,\n PFrameHandle,\n PObjectId,\n TableRange,\n UniqueValuesRequest,\n UniqueValuesResponse,\n} from \"@milaboratories/pl-model-common\";\nimport { patchInSetFilters } from \"./render/util/pframe_upgraders\";\n\nexport class PFrameImpl implements PFrame {\n constructor(private readonly handle: PFrameHandle) {}\n\n public async findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse> {\n return await this.getPlatforma().pFrameDriver.findColumns(this.handle, request);\n }\n\n public async getColumnSpec(columnId: PObjectId): Promise<PColumnSpec | null> {\n return await this.getPlatforma().pFrameDriver.getColumnSpec(this.handle, columnId);\n }\n\n public async listColumns(): Promise<PColumnIdAndSpec[]> {\n return await this.getPlatforma().pFrameDriver.listColumns(this.handle);\n }\n\n public async calculateTableData(\n request: CalculateTableDataRequest<PObjectId>,\n range?: TableRange,\n ): Promise<CalculateTableDataResponse> {\n if (!cfgRenderCtx.featureFlags?.pFrameInSetFilterSupport) {\n request = {\n ...request,\n filters: patchInSetFilters(request.filters),\n };\n }\n return await this.getPlatforma().pFrameDriver.calculateTableData(this.handle, request, range);\n }\n\n public async getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse> {\n return await this.getPlatforma().pFrameDriver.getUniqueValues(this.handle, request);\n }\n\n private getPlatforma() {\n if (platforma === undefined) {\n throw new Error(\"Platforma instance is not available in the current context.\");\n }\n return platforma;\n }\n}\n"],"names":["patchInSetFilters"],"mappings":";;;;MAgBa,UAAU,CAAA;AACQ,IAAA,MAAA;AAA7B,IAAA,WAAA,CAA6B,MAAoB,EAAA;QAApB,IAAA,CAAA,MAAM,GAAN,MAAM;IAAiB;IAE7C,MAAM,WAAW,CAAC,OAA2B,EAAA;AAClD,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;IACjF;IAEO,MAAM,aAAa,CAAC,QAAmB,EAAA;AAC5C,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;IACpF;AAEO,IAAA,MAAM,WAAW,GAAA;AACtB,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;IACxE;AAEO,IAAA,MAAM,kBAAkB,CAC7B,OAA6C,EAC7C,KAAkB,EAAA;AAElB,QAAA,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,wBAAwB,EAAE;AACxD,YAAA,OAAO,GAAG;AACR,gBAAA,GAAG,OAAO;AACV,gBAAA,OAAO,EAAEA,kCAAiB,CAAC,OAAO,CAAC,OAAO,CAAC;aAC5C;QACH;AACA,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IAC/F;IAEO,MAAM,eAAe,CAAC,OAA4B,EAAA;AACvD,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;IACrF;IAEQ,YAAY,GAAA;AAClB,QAAA,IAAI,SAAS,KAAK,SAAS,EAAE;AAC3B,YAAA,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC;QAChF;AACA,QAAA,OAAO,SAAS;IAClB;AACD;;;;"}
|
package/dist/pframe.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CalculateTableDataRequest, CalculateTableDataResponse, FindColumnsRequest, FindColumnsResponse, PColumnIdAndSpec, PColumnSpec, PFrame, PFrameHandle, PObjectId, TableRange, UniqueValuesRequest, UniqueValuesResponse } from
|
|
1
|
+
import type { CalculateTableDataRequest, CalculateTableDataResponse, FindColumnsRequest, FindColumnsResponse, PColumnIdAndSpec, PColumnSpec, PFrame, PFrameHandle, PObjectId, TableRange, UniqueValuesRequest, UniqueValuesResponse } from "@milaboratories/pl-model-common";
|
|
2
2
|
export declare class PFrameImpl implements PFrame {
|
|
3
3
|
private readonly handle;
|
|
4
4
|
constructor(handle: PFrameHandle);
|
package/dist/pframe.js
CHANGED
|
@@ -28,7 +28,7 @@ class PFrameImpl {
|
|
|
28
28
|
}
|
|
29
29
|
getPlatforma() {
|
|
30
30
|
if (platforma === undefined) {
|
|
31
|
-
throw new Error(
|
|
31
|
+
throw new Error("Platforma instance is not available in the current context.");
|
|
32
32
|
}
|
|
33
33
|
return platforma;
|
|
34
34
|
}
|
package/dist/pframe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pframe.js","sources":["../src/pframe.ts"],"sourcesContent":["import type {\n CalculateTableDataRequest,\n CalculateTableDataResponse,\n FindColumnsRequest,\n FindColumnsResponse,\n PColumnIdAndSpec,\n PColumnSpec,\n PFrame,\n PFrameHandle,\n PObjectId,\n TableRange,\n UniqueValuesRequest,\n UniqueValuesResponse,\n} from
|
|
1
|
+
{"version":3,"file":"pframe.js","sources":["../src/pframe.ts"],"sourcesContent":["import type {\n CalculateTableDataRequest,\n CalculateTableDataResponse,\n FindColumnsRequest,\n FindColumnsResponse,\n PColumnIdAndSpec,\n PColumnSpec,\n PFrame,\n PFrameHandle,\n PObjectId,\n TableRange,\n UniqueValuesRequest,\n UniqueValuesResponse,\n} from \"@milaboratories/pl-model-common\";\nimport { patchInSetFilters } from \"./render/util/pframe_upgraders\";\n\nexport class PFrameImpl implements PFrame {\n constructor(private readonly handle: PFrameHandle) {}\n\n public async findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse> {\n return await this.getPlatforma().pFrameDriver.findColumns(this.handle, request);\n }\n\n public async getColumnSpec(columnId: PObjectId): Promise<PColumnSpec | null> {\n return await this.getPlatforma().pFrameDriver.getColumnSpec(this.handle, columnId);\n }\n\n public async listColumns(): Promise<PColumnIdAndSpec[]> {\n return await this.getPlatforma().pFrameDriver.listColumns(this.handle);\n }\n\n public async calculateTableData(\n request: CalculateTableDataRequest<PObjectId>,\n range?: TableRange,\n ): Promise<CalculateTableDataResponse> {\n if (!cfgRenderCtx.featureFlags?.pFrameInSetFilterSupport) {\n request = {\n ...request,\n filters: patchInSetFilters(request.filters),\n };\n }\n return await this.getPlatforma().pFrameDriver.calculateTableData(this.handle, request, range);\n }\n\n public async getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse> {\n return await this.getPlatforma().pFrameDriver.getUniqueValues(this.handle, request);\n }\n\n private getPlatforma() {\n if (platforma === undefined) {\n throw new Error(\"Platforma instance is not available in the current context.\");\n }\n return platforma;\n }\n}\n"],"names":[],"mappings":";;MAgBa,UAAU,CAAA;AACQ,IAAA,MAAA;AAA7B,IAAA,WAAA,CAA6B,MAAoB,EAAA;QAApB,IAAA,CAAA,MAAM,GAAN,MAAM;IAAiB;IAE7C,MAAM,WAAW,CAAC,OAA2B,EAAA;AAClD,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;IACjF;IAEO,MAAM,aAAa,CAAC,QAAmB,EAAA;AAC5C,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;IACpF;AAEO,IAAA,MAAM,WAAW,GAAA;AACtB,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;IACxE;AAEO,IAAA,MAAM,kBAAkB,CAC7B,OAA6C,EAC7C,KAAkB,EAAA;AAElB,QAAA,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,wBAAwB,EAAE;AACxD,YAAA,OAAO,GAAG;AACR,gBAAA,GAAG,OAAO;AACV,gBAAA,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC;aAC5C;QACH;AACA,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;IAC/F;IAEO,MAAM,eAAe,CAAC,OAA4B,EAAA;AACvD,QAAA,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC;IACrF;IAEQ,YAAY,GAAA;AAClB,QAAA,IAAI,SAAS,KAAK,SAAS,EAAE;AAC3B,YAAA,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC;QAChF;AACA,QAAA,OAAO,SAAS;IAClB;AACD;;;;"}
|
|
@@ -11,7 +11,10 @@ function getAllRelatedColumns(ctx, predicate) {
|
|
|
11
11
|
// if current block doesn't produce own columns then use all columns from result pool
|
|
12
12
|
const columns = new column_collection.PColumnCollection();
|
|
13
13
|
columns.addColumnProvider(ctx.resultPool);
|
|
14
|
-
const allColumns = columns.getColumns(predicate, {
|
|
14
|
+
const allColumns = columns.getColumns(predicate, {
|
|
15
|
+
dontWaitAllData: true,
|
|
16
|
+
overrideLabelAnnotation: false,
|
|
17
|
+
}) ?? [];
|
|
15
18
|
const allAxes = new Map(allColumns
|
|
16
19
|
.flatMap((column) => plModelCommon.getNormalizedAxesList(column.spec.axesSpec))
|
|
17
20
|
.map((axisSpec) => {
|
|
@@ -22,7 +25,7 @@ function getAllRelatedColumns(ctx, predicate) {
|
|
|
22
25
|
const extendedColumns = PFrameForGraphs.enrichCompatible(allAxes, allColumns);
|
|
23
26
|
return extendedColumns;
|
|
24
27
|
}
|
|
25
|
-
function getRelatedColumns(ctx, { columns: rootColumns, predicate }) {
|
|
28
|
+
function getRelatedColumns(ctx, { columns: rootColumns, predicate, }) {
|
|
26
29
|
// if current block has its own columns then take from result pool only compatible with them
|
|
27
30
|
const columns = new column_collection.PColumnCollection();
|
|
28
31
|
columns.addColumnProvider(ctx.resultPool);
|
|
@@ -39,7 +42,9 @@ function getRelatedColumns(ctx, { columns: rootColumns, predicate }) {
|
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
// all linker columns always go to pFrame - even it's impossible to use some of them they all are hidden
|
|
42
|
-
const linkerColumns = columns.getColumns((spec) => predicate(spec) && plModelCommon.isLinkerColumn(spec), {
|
|
45
|
+
const linkerColumns = columns.getColumns((spec) => predicate(spec) && plModelCommon.isLinkerColumn(spec), {
|
|
46
|
+
dontWaitAllData: true,
|
|
47
|
+
}) ?? [];
|
|
43
48
|
const availableWithLinkersAxes = PFrameForGraphs.getAvailableWithLinkersAxes(linkerColumns, blockAxes);
|
|
44
49
|
// all possible axes from connected linkers
|
|
45
50
|
for (const item of availableWithLinkersAxes) {
|
|
@@ -48,10 +53,11 @@ function getRelatedColumns(ctx, { columns: rootColumns, predicate }) {
|
|
|
48
53
|
}
|
|
49
54
|
const blockAxesArr = Array.from(blockAxes.values());
|
|
50
55
|
// all compatible with block columns but without label columns
|
|
51
|
-
let compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) &&
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
let compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) &&
|
|
57
|
+
spec.axesSpec.some((axisSpec) => {
|
|
58
|
+
const axisId = plModelCommon.getAxisId(axisSpec);
|
|
59
|
+
return blockAxesArr.some((selectorAxisSpec) => plModelCommon.matchAxisId(plModelCommon.getAxisId(selectorAxisSpec), axisId));
|
|
60
|
+
}), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((column) => !plModelCommon.isLabelColumn(column.spec));
|
|
55
61
|
// extend axes set for label columns request
|
|
56
62
|
for (const c of compatibleWithoutLabels) {
|
|
57
63
|
for (const spec of plModelCommon.getNormalizedAxesList(c.spec.axesSpec)) {
|
|
@@ -61,15 +67,17 @@ function getRelatedColumns(ctx, { columns: rootColumns, predicate }) {
|
|
|
61
67
|
}
|
|
62
68
|
const allAxesArr = Array.from(allAxes.values());
|
|
63
69
|
// extend allowed columns - add columns thad doesn't have axes from block, but have all axes in 'allAxes' list (that means all axes from linkers or from 'hanging' of other selected columns)
|
|
64
|
-
compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) &&
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) &&
|
|
71
|
+
spec.axesSpec.every((axisSpec) => {
|
|
72
|
+
const axisId = plModelCommon.getAxisId(axisSpec);
|
|
73
|
+
return allAxesArr.some((selectorAxisSpec) => plModelCommon.matchAxisId(plModelCommon.getAxisId(selectorAxisSpec), axisId));
|
|
74
|
+
}), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((column) => !plModelCommon.isLabelColumn(column.spec));
|
|
68
75
|
// label columns must be compatible with full set of axes - block axes and axes from compatible columns from result pool
|
|
69
|
-
const compatibleLabels = (columns.getColumns((spec) => predicate(spec) &&
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
const compatibleLabels = (columns.getColumns((spec) => predicate(spec) &&
|
|
77
|
+
spec.axesSpec.some((axisSpec) => {
|
|
78
|
+
const axisId = plModelCommon.getAxisId(axisSpec);
|
|
79
|
+
return allAxesArr.some((selectorAxisSpec) => plModelCommon.matchAxisId(plModelCommon.getAxisId(selectorAxisSpec), axisId));
|
|
80
|
+
}), { dontWaitAllData: true, overrideLabelAnnotation: false }) ?? []).filter((column) => plModelCommon.isLabelColumn(column.spec));
|
|
73
81
|
const compatible = [...compatibleWithoutLabels, ...compatibleLabels];
|
|
74
82
|
// additional columns are duplicates with extra fields in domains for compatibility if there are ones with partial match
|
|
75
83
|
const extendedColumns = PFrameForGraphs.enrichCompatible(blockAxes, compatible);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.cjs","sources":["../../src/pframe_utils/columns.ts"],"sourcesContent":["import type { PColumn, PColumnSpec, PColumnLazy, PFrameDef } from
|
|
1
|
+
{"version":3,"file":"columns.cjs","sources":["../../src/pframe_utils/columns.ts"],"sourcesContent":["import type { PColumn, PColumnSpec, PColumnLazy, PFrameDef } from \"@milaboratories/pl-model-common\";\nimport {\n getNormalizedAxesList,\n getAxisId,\n canonicalizeJson,\n isLinkerColumn,\n matchAxisId,\n isLabelColumn,\n} from \"@milaboratories/pl-model-common\";\nimport type { AxesVault } from \"../components\";\nimport { enrichCompatible, getAvailableWithLinkersAxes } from \"../components\";\nimport type { RenderCtxBase, PColumnDataUniversal } from \"../render\";\nimport { PColumnCollection } from \"../render\";\n\nexport function getAllRelatedColumns<A, U>(\n ctx: RenderCtxBase<A, U>,\n predicate: (spec: PColumnSpec) => boolean,\n): PFrameDef<PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>> {\n // if current block doesn't produce own columns then use all columns from result pool\n const columns = new PColumnCollection();\n columns.addColumnProvider(ctx.resultPool);\n const allColumns =\n columns.getColumns(predicate, {\n dontWaitAllData: true,\n overrideLabelAnnotation: false,\n }) ?? [];\n\n const allAxes: AxesVault = new Map(\n allColumns\n .flatMap((column) => getNormalizedAxesList(column.spec.axesSpec))\n .map((axisSpec) => {\n const axisId = getAxisId(axisSpec);\n return [canonicalizeJson(axisId), axisSpec];\n }),\n );\n\n // additional columns are duplicates with extra fields in domains for compatibility if there are ones with partial match\n const extendedColumns = enrichCompatible(allAxes, allColumns);\n\n return extendedColumns;\n}\n\nexport function getRelatedColumns<A, U>(\n ctx: RenderCtxBase<A, U>,\n {\n columns: rootColumns,\n predicate,\n }: {\n columns: PColumn<PColumnDataUniversal>[];\n predicate: (spec: PColumnSpec) => boolean;\n },\n): PFrameDef<PColumn<PColumnDataUniversal> | PColumnLazy<undefined | PColumnDataUniversal>> {\n // if current block has its own columns then take from result pool only compatible with them\n const columns = new PColumnCollection();\n columns.addColumnProvider(ctx.resultPool);\n columns.addColumns(rootColumns);\n\n // all possible axes from block columns\n const blockAxes: AxesVault = new Map();\n // axes from block columns and compatible result pool columns\n const allAxes: AxesVault = new Map();\n for (const c of rootColumns) {\n for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n const aid = getAxisId(spec);\n blockAxes.set(canonicalizeJson(aid), spec);\n allAxes.set(canonicalizeJson(aid), spec);\n }\n }\n\n // all linker columns always go to pFrame - even it's impossible to use some of them they all are hidden\n const linkerColumns =\n columns.getColumns((spec) => predicate(spec) && isLinkerColumn(spec), {\n dontWaitAllData: true,\n }) ?? [];\n const availableWithLinkersAxes = getAvailableWithLinkersAxes(linkerColumns, blockAxes);\n\n // all possible axes from connected linkers\n for (const item of availableWithLinkersAxes) {\n blockAxes.set(...item);\n allAxes.set(...item);\n }\n\n const blockAxesArr = Array.from(blockAxes.values());\n // all compatible with block columns but without label columns\n let compatibleWithoutLabels = (\n columns.getColumns(\n (spec) =>\n predicate(spec) &&\n spec.axesSpec.some((axisSpec) => {\n const axisId = getAxisId(axisSpec);\n return blockAxesArr.some((selectorAxisSpec) =>\n matchAxisId(getAxisId(selectorAxisSpec), axisId),\n );\n }),\n { dontWaitAllData: true, overrideLabelAnnotation: false },\n ) ?? []\n ).filter((column) => !isLabelColumn(column.spec));\n\n // extend axes set for label columns request\n for (const c of compatibleWithoutLabels) {\n for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {\n const aid = getAxisId(spec);\n allAxes.set(canonicalizeJson(aid), spec);\n }\n }\n\n const allAxesArr = Array.from(allAxes.values());\n // extend allowed columns - add columns thad doesn't have axes from block, but have all axes in 'allAxes' list (that means all axes from linkers or from 'hanging' of other selected columns)\n compatibleWithoutLabels = (\n columns.getColumns(\n (spec) =>\n predicate(spec) &&\n spec.axesSpec.every((axisSpec) => {\n const axisId = getAxisId(axisSpec);\n return allAxesArr.some((selectorAxisSpec) =>\n matchAxisId(getAxisId(selectorAxisSpec), axisId),\n );\n }),\n { dontWaitAllData: true, overrideLabelAnnotation: false },\n ) ?? []\n ).filter((column) => !isLabelColumn(column.spec));\n\n // label columns must be compatible with full set of axes - block axes and axes from compatible columns from result pool\n const compatibleLabels = (\n columns.getColumns(\n (spec) =>\n predicate(spec) &&\n spec.axesSpec.some((axisSpec) => {\n const axisId = getAxisId(axisSpec);\n return allAxesArr.some((selectorAxisSpec) =>\n matchAxisId(getAxisId(selectorAxisSpec), axisId),\n );\n }),\n { dontWaitAllData: true, overrideLabelAnnotation: false },\n ) ?? []\n ).filter((column) => isLabelColumn(column.spec));\n\n const compatible = [...compatibleWithoutLabels, ...compatibleLabels];\n\n // additional columns are duplicates with extra fields in domains for compatibility if there are ones with partial match\n const extendedColumns = enrichCompatible(blockAxes, compatible);\n\n return extendedColumns;\n}\n"],"names":["PColumnCollection","getNormalizedAxesList","getAxisId","canonicalizeJson","enrichCompatible","isLinkerColumn","getAvailableWithLinkersAxes","matchAxisId","isLabelColumn"],"mappings":";;;;;;;;;AAcM,SAAU,oBAAoB,CAClC,GAAwB,EACxB,SAAyC,EAAA;;AAGzC,IAAA,MAAM,OAAO,GAAG,IAAIA,mCAAiB,EAAE;AACvC,IAAA,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC;AACzC,IAAA,MAAM,UAAU,GACd,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE;AAC5B,QAAA,eAAe,EAAE,IAAI;AACrB,QAAA,uBAAuB,EAAE,KAAK;KAC/B,CAAC,IAAI,EAAE;AAEV,IAAA,MAAM,OAAO,GAAc,IAAI,GAAG,CAChC;AACG,SAAA,OAAO,CAAC,CAAC,MAAM,KAAKC,mCAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC/D,SAAA,GAAG,CAAC,CAAC,QAAQ,KAAI;AAChB,QAAA,MAAM,MAAM,GAAGC,uBAAS,CAAC,QAAQ,CAAC;QAClC,OAAO,CAACC,8BAAgB,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAC7C,CAAC,CAAC,CACL;;IAGD,MAAM,eAAe,GAAGC,gCAAgB,CAAC,OAAO,EAAE,UAAU,CAAC;AAE7D,IAAA,OAAO,eAAe;AACxB;AAEM,SAAU,iBAAiB,CAC/B,GAAwB,EACxB,EACE,OAAO,EAAE,WAAW,EACpB,SAAS,GAIV,EAAA;;AAGD,IAAA,MAAM,OAAO,GAAG,IAAIJ,mCAAiB,EAAE;AACvC,IAAA,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC;AACzC,IAAA,OAAO,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