@cccsaurora/clue-ui 1.2.0-dev.254 → 1.2.0
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/ActionForm-pWyIi01Z.js +4460 -0
- package/AnnotationDetails-11P7yhyx.js +160 -0
- package/AnnotationPreview-BGqlBBcp.js +140 -0
- package/ClueEnrichContext-DDZf646J.js +418 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-BiTi0iqu.js +180 -0
- package/_Uint8Array-TJBs9NS2.js +101 -0
- package/_baseAssignValue-CNMLQZco.js +20 -0
- package/_baseClone-DajKHDCs.js +207 -0
- package/_baseExtremum-DhV10dXG.js +27 -0
- package/_baseFlatten-C8CjmqQ-.js +72 -0
- package/_baseGet-DSZygzyq.js +79 -0
- package/_baseIsEqual-C08cUUpA.js +147 -0
- package/_baseIteratee-DGZdhdqr.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-CGlHphLr.js +79 -0
- package/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/_createAggregator-BvcoTZto.js +53 -0
- package/_getPrototype-Dm06JiGv.js +5 -0
- package/_getTag-Cfxlub3L.js +90 -0
- package/_setToArray-C7yMOeww.js +29 -0
- package/cloneDeep-wjl3XmFj.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +10 -21
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +91 -111
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +69 -88
- package/components/display/graph/visualizations/cloud/index.js +81 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +13 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +81 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +305 -407
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +5770 -8678
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +117 -155
- package/components/fetchers/PreviewModal.js +17 -20
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +33 -43
- package/countBy-pIyxNZhO.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-CH7kz5Ix.js +8 -0
- package/groupBy-yNrpdipq.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.js +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +2 -2
- package/hooks/useAnnotations.js +31 -47
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-BBckr5AQ.js +1263 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +68 -84
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +65 -77
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BHAe_V9n.js +12768 -0
- package/index-CA5CUNZO.js +975 -0
- package/index-D_ZywK71.js +358 -0
- package/index-Dj5C04IX.js +568 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +60 -60
- package/package.json +1 -1
- package/sortBy-0BpKRt8p.js +79 -0
- package/sumBy-Do6Ff4Bw.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/useClueTypeConfig-77zd_zdF.js +2292 -0
- package/utils/chain.js +64 -91
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +10 -35
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +27 -41
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-D5hPDE7N.js +129 -0
- package/ActionForm-C0aE9HUv.js +0 -5941
- package/AnnotationDetails-CEou0vCc.js +0 -175
- package/AnnotationPreview-CLMVD6Ec.js +0 -188
- package/ClueEnrichContext-BkD9ZwM9.js +0 -541
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-WmuDdwuH.js +0 -222
- package/_Uint8Array-DdG4KLKn.js +0 -128
- package/_baseAssignValue-CGTuELqU.js +0 -25
- package/_baseClone-BpWiBnMp.js +0 -283
- package/_baseExtremum-BY663UjY.js +0 -33
- package/_baseFlatten-B69cDsaV.js +0 -92
- package/_baseGet-Bx3A4Qfp.js +0 -108
- package/_baseIsEqual-B4IufFlL.js +0 -208
- package/_baseIteratee-7AQvAy1o.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-B8fK6hI-.js +0 -115
- package/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/_createAggregator-CwGPThny.js +0 -63
- package/_getPrototype-CblfEidB.js +0 -5
- package/_getTag-jwz4XLoZ.js +0 -126
- package/_setToArray-CaPKQhcz.js +0 -33
- package/cloneDeep-DmUylbkM.js +0 -8
- package/countBy-DqlU5OwT.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-DSsNkRQs.js +0 -8
- package/groupBy-ChDRT7uy.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-AMfoEg_6.js +0 -696
- package/index-B6C2a_Lg.js +0 -1172
- package/index-C12gPw2W.js +0 -17698
- package/index-DCKkHTvx.js +0 -15750
- package/index-UkW8Sur3.js +0 -465
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/last-CUCl67Im.js +0 -7
- package/sortBy-C7mGPI_D.js +0 -100
- package/sumBy-CGALjmwQ.js +0 -8
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-D2tf4-NM.js +0 -3289
- package/utils-71DpzFrA.js +0 -199
|
@@ -1,553 +1,290 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E = {
|
|
2
2
|
lvlIdx: 0,
|
|
3
3
|
lvl: "",
|
|
4
4
|
req: [],
|
|
5
5
|
groups: [],
|
|
6
6
|
subgroups: []
|
|
7
|
-
}
|
|
8
|
-
const defaultDisabled = {
|
|
7
|
+
}, N = {
|
|
9
8
|
groups: [],
|
|
10
9
|
levels: []
|
|
11
10
|
};
|
|
12
|
-
class
|
|
11
|
+
class O extends Error {
|
|
13
12
|
}
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const unused = [];
|
|
54
|
-
if (!c12n) {
|
|
55
|
-
return [returnSet.sort(), unused];
|
|
56
|
-
}
|
|
57
|
-
const partSet = c12n.toUpperCase().split("/");
|
|
58
|
-
for (const p of partSet) {
|
|
59
|
-
if (p in c12nDef.access_req_map_lts) {
|
|
60
|
-
returnSet.push(c12nDef.access_req_map_lts[p]);
|
|
61
|
-
} else if (p in c12nDef.access_req_map_stl) {
|
|
62
|
-
returnSet.push(p);
|
|
63
|
-
} else if (p in c12nDef.access_req_aliases) {
|
|
64
|
-
for (const a of c12nDef.access_req_aliases[p]) {
|
|
65
|
-
returnSet.push(a);
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
unused.push(p);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (format === "long" && !isMobile) {
|
|
72
|
-
const out = [];
|
|
73
|
-
for (const r of returnSet) {
|
|
74
|
-
out.push(c12nDef.access_req_map_stl[r]);
|
|
75
|
-
}
|
|
76
|
-
return [out.sort(), unused];
|
|
77
|
-
}
|
|
78
|
-
return [returnSet.sort(), unused];
|
|
79
|
-
};
|
|
80
|
-
const getGroups = (groupParts, c12nDef, format, isMobile, autoSelect = false) => {
|
|
81
|
-
var _a, _b, _c, _d;
|
|
82
|
-
let g1Set = /* @__PURE__ */ new Set();
|
|
83
|
-
let g2Set = /* @__PURE__ */ new Set();
|
|
84
|
-
let others = /* @__PURE__ */ new Set();
|
|
85
|
-
const groups = [];
|
|
86
|
-
const subgroups = [];
|
|
87
|
-
for (const grpPart of groupParts) {
|
|
88
|
-
if (!grpPart) {
|
|
13
|
+
const I = (i, s, o, p) => {
|
|
14
|
+
let u = null;
|
|
15
|
+
return s != null && i != null && (u = s.levels_map[i.toString()]), u === void 0 || u == null ? (console.error(
|
|
16
|
+
`[classificationParser] Classification level number '${i}' was not found in your classification definition.`
|
|
17
|
+
), "INVALID") : o === "long" && !p ? s.levels_map_stl[u] : u;
|
|
18
|
+
}, T = (i, s) => {
|
|
19
|
+
let o = null;
|
|
20
|
+
const [p, u, r] = (i == null ? void 0 : i.split(/\/\/(.*)/)) ?? [null, null, null], a = p == null ? void 0 : p.toUpperCase();
|
|
21
|
+
return s.levels_map[a] !== void 0 ? o = s.levels_map[a] : s.levels_map_lts[a] !== void 0 ? o = s.levels_map[s.levels_map_lts[a]] : s.levels_aliases[a] !== void 0 ? o = s.levels_map[s.levels_aliases[a]] : (o = -1, console.error(
|
|
22
|
+
`[classificationParser] Classification level '${p}' was not found in your classification definition.`
|
|
23
|
+
)), typeof o != "number" && (o = parseInt(o)), [o, u];
|
|
24
|
+
}, $ = (i, s, o, p) => {
|
|
25
|
+
const u = [], r = [];
|
|
26
|
+
if (!i)
|
|
27
|
+
return [u.sort(), r];
|
|
28
|
+
const a = i.toUpperCase().split("/");
|
|
29
|
+
for (const m of a)
|
|
30
|
+
if (m in s.access_req_map_lts)
|
|
31
|
+
u.push(s.access_req_map_lts[m]);
|
|
32
|
+
else if (m in s.access_req_map_stl)
|
|
33
|
+
u.push(m);
|
|
34
|
+
else if (m in s.access_req_aliases)
|
|
35
|
+
for (const d of s.access_req_aliases[m])
|
|
36
|
+
u.push(d);
|
|
37
|
+
else
|
|
38
|
+
r.push(m);
|
|
39
|
+
if (o === "long" && !p) {
|
|
40
|
+
const m = [];
|
|
41
|
+
for (const d of u)
|
|
42
|
+
m.push(s.access_req_map_stl[d]);
|
|
43
|
+
return [m.sort(), r];
|
|
44
|
+
}
|
|
45
|
+
return [u.sort(), r];
|
|
46
|
+
}, U = (i, s, o, p, u = !1) => {
|
|
47
|
+
var l, h, e, S;
|
|
48
|
+
let r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
|
|
49
|
+
const d = [], _ = [];
|
|
50
|
+
for (const t of i) {
|
|
51
|
+
if (!t)
|
|
89
52
|
continue;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
tsg = tsg.trim();
|
|
98
|
-
groups.push(tsg);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
} else {
|
|
102
|
-
subgroups.push(gp);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
for (const g of groups) {
|
|
106
|
-
if (g in c12nDef.groups_map_lts) {
|
|
107
|
-
g1Set.add(c12nDef.groups_map_lts[g]);
|
|
108
|
-
} else if (g in c12nDef.groups_map_stl) {
|
|
109
|
-
g1Set.add(g);
|
|
110
|
-
} else if (g in c12nDef.groups_aliases) {
|
|
111
|
-
for (const a of c12nDef.groups_aliases[g]) {
|
|
112
|
-
g1Set.add(a);
|
|
113
|
-
}
|
|
114
|
-
} else {
|
|
115
|
-
others.add(g);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
for (const g of subgroups) {
|
|
119
|
-
if (g in c12nDef.subgroups_map_lts) {
|
|
120
|
-
g2Set.add(c12nDef.subgroups_map_lts[g]);
|
|
121
|
-
} else if (g in c12nDef.subgroups_map_stl) {
|
|
122
|
-
g2Set.add(g);
|
|
123
|
-
} else if (g in c12nDef.subgroups_aliases) {
|
|
124
|
-
for (const sa of c12nDef.subgroups_aliases[g]) {
|
|
125
|
-
g2Set.add(sa);
|
|
126
|
-
}
|
|
127
|
-
} else if (g in c12nDef.groups_aliases) {
|
|
128
|
-
const grps = c12nDef.groups_aliases[g];
|
|
129
|
-
if (grps.length > 1) {
|
|
130
|
-
console.error(`[classificationParser] Unclear use of alias ${g}`);
|
|
131
|
-
}
|
|
132
|
-
g1Set.add(grps[0]);
|
|
133
|
-
} else {
|
|
134
|
-
g1Set.add(g);
|
|
135
|
-
console.error(`[classificationParser] Unknown component ${g}`);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if (c12nDef.dynamic_groups) {
|
|
139
|
-
for (const o of others) {
|
|
140
|
-
g1Set.add(o);
|
|
141
|
-
}
|
|
142
|
-
others = /* @__PURE__ */ new Set();
|
|
143
|
-
}
|
|
144
|
-
for (const subgroup of g2Set) {
|
|
145
|
-
const required = (_b = (_a = c12nDef.params_map) == null ? void 0 : _a[subgroup]) == null ? void 0 : _b.require_group;
|
|
146
|
-
if (!!required) {
|
|
147
|
-
g1Set.add(required);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
for (const subgroup of g2Set) {
|
|
151
|
-
const limitedToGroup = (_d = (_c = c12nDef.params_map) == null ? void 0 : _c[subgroup]) == null ? void 0 : _d.limited_to_group;
|
|
152
|
-
if (limitedToGroup !== null && limitedToGroup !== void 0) {
|
|
153
|
-
if (g1Set.size > 1 || g1Set.size === 1 && !g1Set.has(limitedToGroup)) {
|
|
154
|
-
console.error(
|
|
155
|
-
`[classificationParser] Subgroup ${subgroup} is limited to group ${limitedToGroup} (found: ${Array.from(
|
|
156
|
-
g1Set
|
|
157
|
-
).toString()})`
|
|
158
|
-
);
|
|
53
|
+
const f = t.toUpperCase();
|
|
54
|
+
if (f.startsWith("REL ")) {
|
|
55
|
+
const g = new Set(f.replace("REL TO ", "").replace("REL ", "").split(","));
|
|
56
|
+
for (let c of g) {
|
|
57
|
+
c = c.trim();
|
|
58
|
+
for (let v of c.split("/"))
|
|
59
|
+
v = v.trim(), d.push(v);
|
|
159
60
|
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
61
|
+
} else
|
|
62
|
+
_.push(f);
|
|
63
|
+
}
|
|
64
|
+
for (const t of d)
|
|
65
|
+
if (t in s.groups_map_lts)
|
|
66
|
+
r.add(s.groups_map_lts[t]);
|
|
67
|
+
else if (t in s.groups_map_stl)
|
|
68
|
+
r.add(t);
|
|
69
|
+
else if (t in s.groups_aliases)
|
|
70
|
+
for (const f of s.groups_aliases[t])
|
|
71
|
+
r.add(f);
|
|
72
|
+
else
|
|
73
|
+
m.add(t);
|
|
74
|
+
for (const t of _)
|
|
75
|
+
if (t in s.subgroups_map_lts)
|
|
76
|
+
a.add(s.subgroups_map_lts[t]);
|
|
77
|
+
else if (t in s.subgroups_map_stl)
|
|
78
|
+
a.add(t);
|
|
79
|
+
else if (t in s.subgroups_aliases)
|
|
80
|
+
for (const f of s.subgroups_aliases[t])
|
|
81
|
+
a.add(f);
|
|
82
|
+
else if (t in s.groups_aliases) {
|
|
83
|
+
const f = s.groups_aliases[t];
|
|
84
|
+
f.length > 1 && console.error(`[classificationParser] Unclear use of alias ${t}`), r.add(f[0]);
|
|
85
|
+
} else
|
|
86
|
+
r.add(t), console.error(`[classificationParser] Unknown component ${t}`);
|
|
87
|
+
if (s.dynamic_groups) {
|
|
88
|
+
for (const t of m)
|
|
89
|
+
r.add(t);
|
|
90
|
+
m = /* @__PURE__ */ new Set();
|
|
91
|
+
}
|
|
92
|
+
for (const t of a) {
|
|
93
|
+
const f = (h = (l = s.params_map) == null ? void 0 : l[t]) == null ? void 0 : h.require_group;
|
|
94
|
+
f && r.add(f);
|
|
95
|
+
}
|
|
96
|
+
for (const t of a) {
|
|
97
|
+
const f = (S = (e = s.params_map) == null ? void 0 : e[t]) == null ? void 0 : S.limited_to_group;
|
|
98
|
+
f != null && (r.size > 1 || r.size === 1 && !r.has(f)) && console.error(
|
|
99
|
+
`[classificationParser] Subgroup ${t} is limited to group ${f} (found: ${Array.from(
|
|
100
|
+
r
|
|
101
|
+
).toString()})`
|
|
102
|
+
);
|
|
187
103
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
104
|
+
if (u && r && (r = /* @__PURE__ */ new Set([...r, ...s.groups_auto_select_short])), u && a && (a = /* @__PURE__ */ new Set([...a, ...s.subgroups_auto_select_short])), o === "long" && !p) {
|
|
105
|
+
const t = [];
|
|
106
|
+
for (const g of r)
|
|
107
|
+
t.push(g in s.groups_map_stl ? s.groups_map_stl[g] : g);
|
|
108
|
+
const f = [];
|
|
109
|
+
for (const g of a)
|
|
110
|
+
f.push(s.subgroups_map_stl[g]);
|
|
111
|
+
return { groups: t.sort(), subgroups: f.sort(), others: Array.from(m).sort() };
|
|
112
|
+
}
|
|
113
|
+
return { groups: Array.from(r).sort(), subgroups: Array.from(a).sort(), others: Array.from(m).sort() };
|
|
114
|
+
}, b = (i, s, o, p) => {
|
|
115
|
+
const [u, r] = T(i, s), [a, m] = $(r, s, o, p), { groups: d, subgroups: _, others: l } = U(m, s, o, p);
|
|
116
|
+
return l.length > 0 && console.error(`[classificationParser] Unparsable classification parts: ${l.join(",")}`), {
|
|
117
|
+
lvlIdx: u,
|
|
118
|
+
lvl: I(u, s, o, p),
|
|
119
|
+
req: a,
|
|
120
|
+
groups: d,
|
|
121
|
+
subgroups: _
|
|
194
122
|
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
if (
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
return c12nDef.subgroups_map_lts[g] || g;
|
|
242
|
-
});
|
|
243
|
-
let out = lvl;
|
|
244
|
-
let requiredLvlIdx = 0;
|
|
245
|
-
for (const r of req) {
|
|
246
|
-
const rl = !!((_b = (_a = c12nDef.params_map) == null ? void 0 : _a[r]) == null ? void 0 : _b.require_lvl) ? c12nDef.params_map[r].require_lvl : 0;
|
|
247
|
-
requiredLvlIdx = Math.max(requiredLvlIdx, rl);
|
|
248
|
-
}
|
|
249
|
-
out = getLevelText(Math.max(lvlIdx, requiredLvlIdx), c12nDef, format, isMobile);
|
|
250
|
-
const reqGrp = /* @__PURE__ */ new Set();
|
|
251
|
-
for (const r of req) {
|
|
252
|
-
if (!!((_c = c12nDef.params_map[r]) == null ? void 0 : _c.is_required_group)) {
|
|
253
|
-
reqGrp.add(r);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
const tempReq = Array.from(new Set([...req].filter((x) => !reqGrp.has(x))));
|
|
257
|
-
if (tempReq.length > 0) {
|
|
258
|
-
out += "//" + tempReq.sort().join("/");
|
|
259
|
-
}
|
|
260
|
-
if (reqGrp.size > 0) {
|
|
261
|
-
out += "//" + Array.from(reqGrp).sort().join("/");
|
|
262
|
-
}
|
|
263
|
-
let tempSubGroups = [...subgroups];
|
|
264
|
-
if (!!longFormat) {
|
|
265
|
-
if (subgroups.length > 0 && c12nDef.subgroups_auto_select.length > 0 && !skipAutoSelect) {
|
|
266
|
-
tempSubGroups = Array.from(/* @__PURE__ */ new Set([...subgroups, ...c12nDef.subgroups_auto_select])).sort();
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
269
|
-
if (subgroups.length > 0 && c12nDef.subgroups_auto_select_short.length > 0 && !skipAutoSelect) {
|
|
270
|
-
tempSubGroups = Array.from(/* @__PURE__ */ new Set([...subgroups, ...c12nDef.subgroups_auto_select_short])).sort();
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
let tempGroups = [];
|
|
274
|
-
for (const sg of tempSubGroups) {
|
|
275
|
-
const rGrp = (_d = c12nDef.params_map[sg]) == null ? void 0 : _d.require_group;
|
|
276
|
-
if (!!rGrp) {
|
|
277
|
-
tempGroups.push(rGrp);
|
|
278
|
-
}
|
|
279
|
-
const limToGrp = (_e = c12nDef.params_map[sg]) == null ? void 0 : _e.limited_to_group;
|
|
280
|
-
if (!!limToGrp) {
|
|
281
|
-
if (limToGrp in tempGroups) {
|
|
282
|
-
tempGroups = [limToGrp];
|
|
283
|
-
} else {
|
|
284
|
-
tempGroups = [];
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
for (const g of tempGroups) {
|
|
289
|
-
if (!!longFormat) {
|
|
290
|
-
groups.push(c12nDef.groups_map_stl[g] || g);
|
|
291
|
-
} else {
|
|
292
|
-
groups.push(c12nDef.groups_map_lts[g] || g);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
groups = Array.from(new Set(groups));
|
|
296
|
-
if (!!longFormat) {
|
|
297
|
-
if (groups.length > 0 && c12nDef.groups_auto_select.length > 0 && !skipAutoSelect) {
|
|
298
|
-
groups = Array.from(/* @__PURE__ */ new Set([...groups, ...c12nDef.groups_auto_select])).sort();
|
|
299
|
-
}
|
|
300
|
-
} else {
|
|
301
|
-
if (groups.length > 0 && c12nDef.groups_auto_select_short.length > 0 && !skipAutoSelect) {
|
|
302
|
-
groups = Array.from(/* @__PURE__ */ new Set([...groups, ...c12nDef.groups_auto_select_short])).sort();
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
if (groups.length > 0) {
|
|
306
|
-
groups = groups.sort();
|
|
307
|
-
out += reqGrp.size > 0 ? "/" : "//";
|
|
308
|
-
if (groups.length === 1) {
|
|
309
|
-
const grp = groups[0];
|
|
310
|
-
const displayName = ((_f = c12nDef.params_map[grp]) == null ? void 0 : _f.solitary_display_name) || grp;
|
|
311
|
-
out += displayName !== grp ? displayName : groupDelim + grp;
|
|
312
|
-
} else {
|
|
313
|
-
if (!longFormat) {
|
|
314
|
-
for (const [alias, values] of Object.entries(c12nDef.groups_aliases)) {
|
|
315
|
-
if (values.length > 1) {
|
|
316
|
-
if (JSON.stringify(values.sort()) === JSON.stringify(groups)) {
|
|
317
|
-
groups = [alias];
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
out += groupDelim + groups.sort().join(", ");
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
if (tempSubGroups.length > 0) {
|
|
326
|
-
if (groups.length > 0 || reqGrp.size > 0) {
|
|
327
|
-
out += "/";
|
|
123
|
+
}, z = (i, s) => {
|
|
124
|
+
if (s.length <= 0) return !0;
|
|
125
|
+
const o = new Set(i), p = new Set(s);
|
|
126
|
+
for (const u of p)
|
|
127
|
+
if (!o.has(u))
|
|
128
|
+
return !1;
|
|
129
|
+
return !0;
|
|
130
|
+
}, R = (i, s) => {
|
|
131
|
+
if (s.length === 0) return !0;
|
|
132
|
+
const o = new Set(s), p = new Set(i);
|
|
133
|
+
for (const u of o)
|
|
134
|
+
if (p.has(u))
|
|
135
|
+
return !0;
|
|
136
|
+
return !1;
|
|
137
|
+
}, x = (i, s, o, p, u = !1) => {
|
|
138
|
+
var v, w, y, L, A, C;
|
|
139
|
+
if (!s.enforce || s.invalid_mode) return s.UNRESTRICTED;
|
|
140
|
+
const r = !(o === "short" || p), a = r ? "REL TO " : "REL ", { lvlIdx: m, lvl: d } = i;
|
|
141
|
+
let { groups: _, subgroups: l, req: h } = i;
|
|
142
|
+
h = h.map((n) => r ? s.access_req_map_stl[n] || n : s.access_req_map_lts[n] || n), _ = _.map((n) => r ? s.groups_map_stl[n] || n : s.groups_map_lts[n] || n), l = l.map((n) => r ? s.subgroups_map_stl[n] || n : s.subgroups_map_lts[n] || n);
|
|
143
|
+
let e = d, S = 0;
|
|
144
|
+
for (const n of h) {
|
|
145
|
+
const q = (w = (v = s.params_map) == null ? void 0 : v[n]) != null && w.require_lvl ? s.params_map[n].require_lvl : 0;
|
|
146
|
+
S = Math.max(S, q);
|
|
147
|
+
}
|
|
148
|
+
e = I(Math.max(m, S), s, o, p);
|
|
149
|
+
const t = /* @__PURE__ */ new Set();
|
|
150
|
+
for (const n of h)
|
|
151
|
+
(y = s.params_map[n]) != null && y.is_required_group && t.add(n);
|
|
152
|
+
const f = Array.from(new Set([...h].filter((n) => !t.has(n))));
|
|
153
|
+
f.length > 0 && (e += "//" + f.sort().join("/")), t.size > 0 && (e += "//" + Array.from(t).sort().join("/"));
|
|
154
|
+
let g = [...l];
|
|
155
|
+
r ? l.length > 0 && s.subgroups_auto_select.length > 0 && !u && (g = Array.from(/* @__PURE__ */ new Set([...l, ...s.subgroups_auto_select])).sort()) : l.length > 0 && s.subgroups_auto_select_short.length > 0 && !u && (g = Array.from(/* @__PURE__ */ new Set([...l, ...s.subgroups_auto_select_short])).sort());
|
|
156
|
+
let c = [];
|
|
157
|
+
for (const n of g) {
|
|
158
|
+
const q = (L = s.params_map[n]) == null ? void 0 : L.require_group;
|
|
159
|
+
q && c.push(q);
|
|
160
|
+
const P = (A = s.params_map[n]) == null ? void 0 : A.limited_to_group;
|
|
161
|
+
P && (P in c ? c = [P] : c = []);
|
|
162
|
+
}
|
|
163
|
+
for (const n of c)
|
|
164
|
+
r ? _.push(s.groups_map_stl[n] || n) : _.push(s.groups_map_lts[n] || n);
|
|
165
|
+
if (_ = Array.from(new Set(_)), r ? _.length > 0 && s.groups_auto_select.length > 0 && !u && (_ = Array.from(/* @__PURE__ */ new Set([..._, ...s.groups_auto_select])).sort()) : _.length > 0 && s.groups_auto_select_short.length > 0 && !u && (_ = Array.from(/* @__PURE__ */ new Set([..._, ...s.groups_auto_select_short])).sort()), _.length > 0)
|
|
166
|
+
if (_ = _.sort(), e += t.size > 0 ? "/" : "//", _.length === 1) {
|
|
167
|
+
const n = _[0], q = ((C = s.params_map[n]) == null ? void 0 : C.solitary_display_name) || n;
|
|
168
|
+
e += q !== n ? q : a + n;
|
|
328
169
|
} else {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
for (const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
const
|
|
345
|
-
disabled: defaultDisabled,
|
|
346
|
-
parts: defaultParts
|
|
347
|
-
};
|
|
348
|
-
const applyClassificationRules = (parts, c12nDef, format, isMobile, userClassification = false) => {
|
|
349
|
-
const longFormat = format === "short" || !!isMobile ? false : true;
|
|
350
|
-
const requireLvl = {};
|
|
351
|
-
const limitedToGroup = {};
|
|
352
|
-
const requireGroup = {};
|
|
353
|
-
const partsToCheck = ["req", "groups", "subgroups"];
|
|
354
|
-
const retParts = { ...parts };
|
|
355
|
-
const disabledList = {
|
|
170
|
+
if (!r)
|
|
171
|
+
for (const [n, q] of Object.entries(s.groups_aliases))
|
|
172
|
+
q.length > 1 && JSON.stringify(q.sort()) === JSON.stringify(_) && (_ = [n]);
|
|
173
|
+
e += a + _.sort().join(", ");
|
|
174
|
+
}
|
|
175
|
+
return g.length > 0 && (_.length > 0 || t.size > 0 ? e += "/" : e += "//", e += g.sort().join("/")), e;
|
|
176
|
+
}, j = (i) => {
|
|
177
|
+
const s = [];
|
|
178
|
+
for (const o in i.levels_map)
|
|
179
|
+
isNaN(parseInt(o)) || s.push(i.levels_map[o]);
|
|
180
|
+
return s;
|
|
181
|
+
}, F = {
|
|
182
|
+
disabled: N,
|
|
183
|
+
parts: E
|
|
184
|
+
}, J = (i, s, o, p, u = !1) => {
|
|
185
|
+
const r = !(o === "short" || p), a = {}, m = {}, d = {}, _ = ["req", "groups", "subgroups"], l = { ...i }, h = {
|
|
356
186
|
levels: [],
|
|
357
187
|
groups: []
|
|
358
188
|
};
|
|
359
|
-
for (const
|
|
360
|
-
if ({}.hasOwnProperty.call(
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const part = retParts[partsToCheck[partName]];
|
|
376
|
-
for (const value of part) {
|
|
377
|
-
let triggerAutoSelect = false;
|
|
378
|
-
if (value) {
|
|
379
|
-
if (value in requireLvl) {
|
|
380
|
-
if (retParts.lvlIdx < requireLvl[value]) {
|
|
381
|
-
retParts.lvlIdx = requireLvl[value];
|
|
382
|
-
retParts.lvl = getLevelText(requireLvl[value], c12nDef, format, isMobile);
|
|
383
|
-
}
|
|
384
|
-
const levels = levelList(c12nDef);
|
|
385
|
-
for (const l of levels) {
|
|
386
|
-
if (c12nDef.levels_map[l] < requireLvl[value]) {
|
|
387
|
-
disabledList.levels.push(l);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
189
|
+
for (const e in s.params_map)
|
|
190
|
+
if ({}.hasOwnProperty.call(s.params_map, e)) {
|
|
191
|
+
const S = s.params_map[e];
|
|
192
|
+
"require_lvl" in S && (a[e] = S.require_lvl), "limited_to_group" in S && (m[e] = S.limited_to_group), "require_group" in S && (d[e] = S.require_group);
|
|
193
|
+
}
|
|
194
|
+
for (const e in _)
|
|
195
|
+
if ({}.hasOwnProperty.call(_, e)) {
|
|
196
|
+
const S = l[_[e]];
|
|
197
|
+
for (const t of S) {
|
|
198
|
+
let f = !1;
|
|
199
|
+
if (t) {
|
|
200
|
+
if (t in a) {
|
|
201
|
+
l.lvlIdx < a[t] && (l.lvlIdx = a[t], l.lvl = I(a[t], s, o, p));
|
|
202
|
+
const g = j(s);
|
|
203
|
+
for (const c of g)
|
|
204
|
+
s.levels_map[c] < a[t] && h.levels.push(c);
|
|
390
205
|
}
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
const gShort = c12nDef.groups_map_lts[group] || group;
|
|
399
|
-
if (!retParts.groups.includes(gShort) && !retParts.groups.includes(gLong)) {
|
|
400
|
-
retParts.groups.push(group);
|
|
401
|
-
}
|
|
206
|
+
if (t in d) {
|
|
207
|
+
const g = s.groups_map_stl[d[t]] || d[t], c = s.groups_map_lts[d[t]] || d[t];
|
|
208
|
+
if (!l.groups.includes(g) && !l.groups.includes(c)) {
|
|
209
|
+
l.groups.push(c);
|
|
210
|
+
for (const v of s.groups_auto_select) {
|
|
211
|
+
const w = s.groups_map_stl[v] || v, y = s.groups_map_lts[v] || v;
|
|
212
|
+
!l.groups.includes(y) && !l.groups.includes(w) && l.groups.push(v);
|
|
402
213
|
}
|
|
403
214
|
}
|
|
404
215
|
}
|
|
405
|
-
if (
|
|
406
|
-
for (const
|
|
407
|
-
const
|
|
408
|
-
if (
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
if (retParts.groups.includes(gShort)) {
|
|
412
|
-
retParts.groups.splice(retParts.groups.indexOf(gShort), 1);
|
|
413
|
-
} else if (retParts.groups.includes(gLong)) {
|
|
414
|
-
retParts.groups.splice(retParts.groups.indexOf(gLong), 1);
|
|
415
|
-
}
|
|
216
|
+
if (t in m)
|
|
217
|
+
for (const g in s.groups_map_stl) {
|
|
218
|
+
const c = s.groups_map_lts[m[t]] || m[t];
|
|
219
|
+
if (g !== c) {
|
|
220
|
+
const v = s.groups_map_stl[g];
|
|
221
|
+
h.groups.push(g), l.groups.includes(g) ? l.groups.splice(l.groups.indexOf(g), 1) : l.groups.includes(v) && l.groups.splice(l.groups.indexOf(v), 1);
|
|
416
222
|
}
|
|
417
223
|
}
|
|
418
|
-
|
|
419
|
-
if (!userClassification && partsToCheck[partName] === "groups") {
|
|
420
|
-
triggerAutoSelect = true;
|
|
421
|
-
}
|
|
224
|
+
!u && _[e] === "groups" && (f = !0);
|
|
422
225
|
}
|
|
423
|
-
if (
|
|
424
|
-
for (const
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
if (!retParts.groups.includes(gLong) && !retParts.groups.includes(gShort)) {
|
|
428
|
-
retParts.groups.push(group);
|
|
429
|
-
}
|
|
226
|
+
if (f)
|
|
227
|
+
for (const g of s.groups_auto_select) {
|
|
228
|
+
const c = s.groups_map_stl[g] || g, v = s.groups_map_lts[g] || g;
|
|
229
|
+
!l.groups.includes(c) && !l.groups.includes(v) && l.groups.push(g);
|
|
430
230
|
}
|
|
431
|
-
}
|
|
432
231
|
}
|
|
433
232
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
return c12nDef.access_req_map_stl[r] || r;
|
|
438
|
-
}
|
|
439
|
-
return c12nDef.access_req_map_lts[r] || r;
|
|
440
|
-
});
|
|
441
|
-
retParts.groups = retParts.groups.sort().map((g) => {
|
|
442
|
-
if (!!longFormat) {
|
|
443
|
-
return c12nDef.groups_map_stl[g] || g;
|
|
444
|
-
}
|
|
445
|
-
return c12nDef.groups_map_lts[g] || g;
|
|
446
|
-
});
|
|
447
|
-
retParts.subgroups = retParts.subgroups.sort().map((sg) => {
|
|
448
|
-
if (!!longFormat) {
|
|
449
|
-
return c12nDef.subgroups_map_stl[sg] || sg;
|
|
450
|
-
}
|
|
451
|
-
return c12nDef.subgroups_map_lts[sg] || sg;
|
|
452
|
-
});
|
|
453
|
-
disabledList.groups = disabledList.groups.sort().map((g) => {
|
|
454
|
-
if (!!longFormat) {
|
|
455
|
-
return c12nDef.groups_map_stl[g] || g;
|
|
456
|
-
}
|
|
457
|
-
return c12nDef.groups_map_lts[g] || g;
|
|
458
|
-
});
|
|
459
|
-
disabledList.levels = disabledList.levels.sort().map((l) => {
|
|
460
|
-
if (!!longFormat) {
|
|
461
|
-
return c12nDef.levels_map_stl[l] || l;
|
|
462
|
-
}
|
|
463
|
-
return c12nDef.levels_map_lts[l] || l;
|
|
464
|
-
});
|
|
465
|
-
if (!!longFormat) {
|
|
466
|
-
retParts.lvl = c12nDef.levels_map_stl[retParts.lvl] || retParts.lvl;
|
|
467
|
-
} else {
|
|
468
|
-
retParts.lvl = c12nDef.levels_map_lts[retParts.lvl] || retParts.lvl;
|
|
469
|
-
}
|
|
470
|
-
return {
|
|
471
|
-
disabled: disabledList,
|
|
472
|
-
parts: retParts
|
|
233
|
+
return l.req = l.req.sort().map((e) => r ? s.access_req_map_stl[e] || e : s.access_req_map_lts[e] || e), l.groups = l.groups.sort().map((e) => r ? s.groups_map_stl[e] || e : s.groups_map_lts[e] || e), l.subgroups = l.subgroups.sort().map((e) => r ? s.subgroups_map_stl[e] || e : s.subgroups_map_lts[e] || e), h.groups = h.groups.sort().map((e) => r ? s.groups_map_stl[e] || e : s.groups_map_lts[e] || e), h.levels = h.levels.sort().map((e) => r ? s.levels_map_stl[e] || e : s.levels_map_lts[e] || e), r ? l.lvl = s.levels_map_stl[l.lvl] || l.lvl : l.lvl = s.levels_map_lts[l.lvl] || l.lvl, {
|
|
234
|
+
disabled: h,
|
|
235
|
+
parts: l
|
|
473
236
|
};
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
);
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
if (!
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
if (!c12n_2) {
|
|
502
|
-
return normalizedClassification(c12n1Parts, c12nDef, format, isMobile);
|
|
503
|
-
}
|
|
504
|
-
const req = Array.from(/* @__PURE__ */ new Set([...c12n1Parts.req, ...c12n2Parts.req]));
|
|
505
|
-
const groups = getMaxGroups(c12n1Parts.groups, c12n2Parts.groups);
|
|
506
|
-
const subgroups = getMaxGroups(c12n1Parts.subgroups, c12n2Parts.subgroups);
|
|
507
|
-
const lvlIdx = Math.max(c12n1Parts.lvlIdx, c12n2Parts.lvlIdx);
|
|
508
|
-
const out = {
|
|
509
|
-
lvlIdx,
|
|
510
|
-
lvl: getLevelText(lvlIdx, c12nDef, format, isMobile),
|
|
511
|
-
req,
|
|
512
|
-
groups,
|
|
513
|
-
subgroups
|
|
237
|
+
}, G = (i, s) => {
|
|
238
|
+
let o = /* @__PURE__ */ new Set();
|
|
239
|
+
if (i.length > 0 && s.length > 0) {
|
|
240
|
+
const p = new Set(s);
|
|
241
|
+
o = new Set([...i].filter((u) => p.has(u)));
|
|
242
|
+
} else
|
|
243
|
+
o = /* @__PURE__ */ new Set([...i, ...s]);
|
|
244
|
+
return i.length > 0 && s.length > 0 && o.size <= 0 && (o = /* @__PURE__ */ new Set([...i, ...s]), console.error(
|
|
245
|
+
`[classificationParser] Could not find any intersection between the groups. ${i.toString()} & ${s.toString()}`
|
|
246
|
+
)), Array.from(o);
|
|
247
|
+
}, V = (i, s, o, p, u) => {
|
|
248
|
+
if (!o.enforce || o.invalid_mode) {
|
|
249
|
+
const e = b(o.UNRESTRICTED, o, p, u);
|
|
250
|
+
return x(e, o, p, u);
|
|
251
|
+
}
|
|
252
|
+
const r = b(i, o, p, u), a = b(s, o, p, u);
|
|
253
|
+
if (!i)
|
|
254
|
+
return x(a, o, p, u);
|
|
255
|
+
if (!s)
|
|
256
|
+
return x(r, o, p, u);
|
|
257
|
+
const m = Array.from(/* @__PURE__ */ new Set([...r.req, ...a.req])), d = G(r.groups, a.groups), _ = G(r.subgroups, a.subgroups), l = Math.max(r.lvlIdx, a.lvlIdx), h = {
|
|
258
|
+
lvlIdx: l,
|
|
259
|
+
lvl: I(l, o, p, u),
|
|
260
|
+
req: m,
|
|
261
|
+
groups: d,
|
|
262
|
+
subgroups: _
|
|
514
263
|
};
|
|
515
|
-
return
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
if (
|
|
519
|
-
if (!enforce) return true;
|
|
520
|
-
if (!c12n) return true;
|
|
264
|
+
return x(h, o, p, u);
|
|
265
|
+
}, W = (i, s, o, p = !1, u = !0) => {
|
|
266
|
+
if (o.invalid_mode) return !1;
|
|
267
|
+
if (!p || !s) return !0;
|
|
521
268
|
try {
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
return true;
|
|
529
|
-
}
|
|
530
|
-
return false;
|
|
531
|
-
} catch (e) {
|
|
532
|
-
if (e instanceof InvalidClassification) {
|
|
533
|
-
if (!!ignoreInvalid) {
|
|
534
|
-
return false;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
throw e;
|
|
269
|
+
const r = b(i, o, "long", !1), a = b(s, o, "long", !1);
|
|
270
|
+
return Number(r.lvlIdx) >= Number(a.lvlIdx) ? !(!z(r.req, a.req) || !R(r.groups, a.groups) || !R(r.subgroups, a.subgroups)) : !1;
|
|
271
|
+
} catch (r) {
|
|
272
|
+
if (r instanceof O && u)
|
|
273
|
+
return !1;
|
|
274
|
+
throw r;
|
|
538
275
|
}
|
|
539
276
|
};
|
|
540
277
|
export {
|
|
541
|
-
InvalidClassification,
|
|
542
|
-
applyClassificationRules,
|
|
543
|
-
canSeeGroups,
|
|
544
|
-
canSeeRequired,
|
|
545
|
-
defaultClassificationValidator,
|
|
546
|
-
defaultDisabled,
|
|
547
|
-
defaultParts,
|
|
548
|
-
getLevelText,
|
|
549
|
-
getMaxClassification,
|
|
550
|
-
getParts,
|
|
551
|
-
isAccessible,
|
|
552
|
-
normalizedClassification
|
|
278
|
+
O as InvalidClassification,
|
|
279
|
+
J as applyClassificationRules,
|
|
280
|
+
R as canSeeGroups,
|
|
281
|
+
z as canSeeRequired,
|
|
282
|
+
F as defaultClassificationValidator,
|
|
283
|
+
N as defaultDisabled,
|
|
284
|
+
E as defaultParts,
|
|
285
|
+
I as getLevelText,
|
|
286
|
+
V as getMaxClassification,
|
|
287
|
+
b as getParts,
|
|
288
|
+
W as isAccessible,
|
|
289
|
+
x as normalizedClassification
|
|
553
290
|
};
|