@abi-software/mapintegratedvuer 1.17.1 → 1.17.3-simulation.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/{ConnectivityGraph-BL4B9GZX.js → ConnectivityGraph-9pXPgFJR.js} +2 -2
  2. package/dist/{ContentMixin-Djmb_gqk.js → ContentMixin-DIqgKIz6.js} +279 -536
  3. package/dist/Flatmap-D7GVPV7o.js +103422 -0
  4. package/dist/{Iframe-ByYxT4Yq.js → Iframe-CCEA3d9c.js} +2 -2
  5. package/dist/{MultiFlatmap-DSkdlRiS.js → MultiFlatmap-Cuke1uNp.js} +3 -3
  6. package/dist/{Plot-ymkHVq_A.js → Plot-B4oTBVAT.js} +2 -2
  7. package/dist/{Scaffold-bw7posKm.js → Scaffold-Czz8X5kL.js} +79 -53
  8. package/dist/Simulation-BKmz8zwm.js +107 -0
  9. package/dist/{index-CwfUgFL1.js → index-_b4VBGHk.js} +30002 -25408
  10. package/dist/mapintegratedvuer.js +1 -1
  11. package/dist/mapintegratedvuer.umd.cjs +4291 -229
  12. package/dist/style-CM86xE3J.js +119 -0
  13. package/dist/style.css +1 -1
  14. package/package.json +10 -5
  15. package/src/App.vue +285 -258
  16. package/src/assets/styles.scss +1 -1
  17. package/src/components/ContextCard.vue +0 -1
  18. package/src/components/DummyRouteComponent.vue +1 -0
  19. package/src/components/EventBus.ts +13 -0
  20. package/src/components/FloatingWindow.vue +142 -0
  21. package/src/components/MapContent.vue +9 -4
  22. package/src/components/PlotComponent.vue +56 -0
  23. package/src/components/SplitDialog.vue +1 -6
  24. package/src/components/SplitFlow.vue +504 -444
  25. package/src/components/scripts/utilities.js +1 -1
  26. package/src/components/viewers/Flatmap.vue +166 -83
  27. package/src/components/viewers/Simulation.vue +118 -11
  28. package/src/components.d.ts +3 -0
  29. package/src/main.js +9 -3
  30. package/src/mixins/ContentMixin.js +467 -406
  31. package/src/mixins/DynamicMarkerMixin.js +50 -17
  32. package/src/services/mapping.js +69 -0
  33. package/src/services/testData.js +71 -0
  34. package/src/stores/entries.js +1 -1
  35. package/src/stores/mapping.js +29 -0
  36. package/src/stores/settings.js +4 -0
  37. package/src/stores/simulationPlotStore.js +124 -0
  38. package/src/stores/splitFlow.js +425 -352
  39. package/src/types/simulation.js +18 -0
  40. package/dist/Flatmap-uPEQNDkK.js +0 -202
  41. package/dist/Simulation-C_gdqDes.js +0 -28
  42. package/dist/style-Czqe2bTf.js +0 -57
  43. package/src/components/EventBus.js +0 -3
@@ -1,322 +1,8 @@
1
- import { markRaw as y } from "vue";
2
- import { G as _, c as E, u as O, d as N, e as x, f as P, T as M, E as m, h as R, l as B, i as w, j as X, k as U } from "./index-CwfUgFL1.js";
3
- import { mapStores as k } from "pinia";
4
- const b = function(e) {
5
- return e ? [...new Set(e.map((n) => JSON.stringify(n)))].map(
6
- (n) => JSON.parse(n)
7
- ) : [];
8
- }, d = [], T = async function(e, n) {
9
- const r = n.filter(
10
- (i) => d.some((l) => l.taxon === i)
11
- ), t = d.filter(
12
- (i) => r.includes(i.taxon)
13
- ), a = n.filter(
14
- (i) => !r.includes(i)
15
- );
16
- if (a.length) {
17
- const i = await e.queryLabels(a);
18
- if (i.length)
19
- return i.forEach((l) => {
20
- let { entity: s, label: h } = l;
21
- h === "Mammalia" && (h = "Mammalia not otherwise specified");
22
- const o = { taxon: s, label: h };
23
- t.push(o), d.push(o);
24
- }), t;
25
- } else
26
- return t;
27
- }, L = function(e, n) {
28
- if (!e || !n) return !1;
29
- let r = JSON.stringify(e), t = JSON.stringify(n);
30
- return r.indexOf(t) !== -1;
31
- }, A = (e, n) => {
32
- const r = e.name ?? e, t = n.name ?? n, a = r.toUpperCase(), i = t.toUpperCase();
33
- return a < i ? -1 : a > i ? 1 : 0;
34
- };
35
- let S = function() {
36
- this.initialise = function(e) {
37
- this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.hasSingleConnectivityList = !1, this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "map", this.noMapConnectivity = !1;
38
- }, this.createTooltipData = async function(e, n) {
39
- let r = [];
40
- n.feature.hyperlinks && n.feature.hyperlinks.length > 0 ? r = n.feature.hyperlinks : r = this.rawURLs;
41
- let t;
42
- if (n.provenanceTaxonomy) {
43
- t = [];
44
- try {
45
- const i = await T(e, n.provenanceTaxonomy);
46
- i.length && i.forEach((l) => {
47
- const { label: s } = l;
48
- t.push(s);
49
- });
50
- } catch (i) {
51
- console.log(i);
52
- }
53
- }
54
- return {
55
- destinations: this.destinations,
56
- origins: this.origins,
57
- components: this.components,
58
- destinationsWithDatasets: this.destinationsWithDatasets,
59
- originsWithDatasets: this.originsWithDatasets,
60
- componentsWithDatasets: this.componentsWithDatasets,
61
- destinationsCombinations: this.destinationsCombinations,
62
- originsCombinations: this.originsCombinations,
63
- componentsCombinations: this.componentsCombinations,
64
- hasSingleConnectivityList: this.singleConnectivityList.length > 0,
65
- title: n.label,
66
- featureId: n.resource,
67
- hyperlinks: r,
68
- provenanceTaxonomy: n.provenanceTaxonomy,
69
- provenanceTaxonomyLabel: t,
70
- connectivitySource: this.connectivitySource,
71
- noMapConnectivity: this.noMapConnectivity
72
- };
73
- }, this.updateTooltipData = function(e) {
74
- return {
75
- ...e,
76
- origins: this.origins,
77
- originsWithDatasets: this.originsWithDatasets,
78
- components: this.components,
79
- componentsWithDatasets: this.componentsWithDatasets,
80
- destinations: this.destinations,
81
- destinationsWithDatasets: this.destinationsWithDatasets,
82
- destinationsCombinations: this.destinationsCombinations,
83
- originsCombinations: this.originsCombinations,
84
- componentsCombinations: this.componentsCombinations,
85
- connectivitySource: this.connectivitySource,
86
- noMapConnectivity: this.noMapConnectivity
87
- };
88
- }, this.createComponentsLabelList = function(e, n) {
89
- let r = [];
90
- return e.forEach((t) => {
91
- r.push(this.createLabelFromNeuralNode(t[0]), n), t.length === 2 && r.push(this.createLabelFromNeuralNode(t[1]), n);
92
- }), r;
93
- }, this.createLabelLookup = function(e, n) {
94
- return new Promise(async (r) => {
95
- let t = {};
96
- this.uberons = [];
97
- const a = await T(e, n);
98
- a.length && (a.forEach((i) => {
99
- const { taxon: l, label: s } = i;
100
- t[l] = s, this.uberons.push({
101
- id: l,
102
- name: s
103
- });
104
- }), r(t));
105
- });
106
- }, this.buildConnectivitySqlStatement = function(e) {
107
- let n = "select knowledge from knowledge where entity in (";
108
- if (e.length === 1)
109
- n += `'${e[0]}')`;
110
- else if (e.length > 1)
111
- for (let r in e)
112
- n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
113
- return n;
114
- }, this.buildLabelSqlStatement = function(e) {
115
- let n = "select entity, label from labels where entity in (";
116
- if (e.length === 1)
117
- n += `'${e[0]}')`;
118
- else if (e.length > 1)
119
- for (let r in e)
120
- n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
121
- return n;
122
- }, this.findAllIdsFromConnectivity = function(e) {
123
- let n = e.connectivity.flat(), r = [...new Set(n)], t = [];
124
- return r.forEach((a) => {
125
- Array.isArray(a) ? t.push(a.flat()) : t.push(a);
126
- }), [...new Set(t.flat())];
127
- }, this.flattenConnectivity = function(e) {
128
- let n = e.flat(), r = [...new Set(n)], t = [];
129
- return r.forEach((a) => {
130
- Array.isArray(a) ? t.push(a.flat()) : t.push(a);
131
- }), t.flat();
132
- }, this.findComponents = function(e, n, r, t) {
133
- let a = e.connectivity.flat(), i = b(a), l = [], s = !1;
134
- return i.forEach((h) => {
135
- s = !1, L(n, h) && (s = !0), t && L(t, h) && (s = !0), L(r, h) && (s = !0), s || l.push(h);
136
- }), l;
137
- }, this.retrieveFlatmapKnowledgeForEvent = async function(e, n) {
138
- this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
139
- const r = n.resource;
140
- if (this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.rawURLs = [], !r || r.length === 0 || !r[0]) return;
141
- let t = await this.queryForConnectivityNew(e, r[0]);
142
- return await Promise.all([t]);
143
- }, this.queryForConnectivityNew = async function(e, n, r = "map", t = !0) {
144
- const a = /^sckan-(\d{4})/.exec(e.knowledgeSource || ""), l = (a ? Number(a[1]) : 0) >= 2026, s = e.mapMetadata.uuid, h = this.flatmapAPI;
145
- return this.connectivitySource = l ? "sckan" : r, l && (this.singleConnectivityList = await _(h, s, n)), new Promise((o) => {
146
- (this.connectivitySource === "map" ? this.queryMapConnectivity(e.mapMetadata.uuid, n) : e.queryKnowledge(n)).then((c) => {
147
- if (this.checkConnectivityExists(c)) {
148
- this.connectivitySource === "map" && (this.noMapConnectivity = !1);
149
- let v = c;
150
- t ? this.processConnectivity(e, v).then((f) => {
151
- c.references && (this.rawURLs = [...c.references]), o(f);
152
- }) : o(v);
153
- } else this.connectivitySource === "map" ? (this.connectivitySource = "sckan", this.noMapConnectivity = !0, e.queryKnowledge(n).then((v) => {
154
- if (this.checkConnectivityExists(v)) {
155
- let f = v;
156
- t ? this.processConnectivity(e, f).then((p) => {
157
- v.references && (this.rawURLs = [...v.references]), o(p);
158
- }) : o(f);
159
- } else
160
- o(!1);
161
- }).catch(() => o(!1))) : o(!1);
162
- }).catch((c) => {
163
- c.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${n}.`), o(!1);
164
- });
165
- });
166
- }, this.queryMapConnectivity = async function(e, n) {
167
- const r = this.flatmapAPI + `flatmap/${e}/connectivity/${n}`;
168
- try {
169
- const t = await fetch(r);
170
- if (!t.ok)
171
- throw new Error(`Response status: ${t.status}`);
172
- return await t.json();
173
- } catch (t) {
174
- throw new Error(t);
175
- }
176
- }, this.queryForConnectivity = function(e, n, r, t = !0) {
177
- const a = { sql: this.buildConnectivitySqlStatement(n) }, i = {
178
- method: "POST",
179
- headers: {
180
- "Content-Type": "application/json"
181
- },
182
- body: JSON.stringify(a),
183
- ...r ? { signal: r } : {}
184
- // add signal to header if it exists
185
- };
186
- return new Promise((l) => {
187
- fetch(`${this.flatmapAPI}knowledge/query/`, i).then((s) => s.json()).then((s) => {
188
- if (this.connectivityExists(s)) {
189
- let h = JSON.parse(s.values[0][0]);
190
- t ? this.processConnectivity(e, h).then((o) => {
191
- l(o);
192
- }) : l(h);
193
- } else
194
- l(!1);
195
- }).catch((s) => {
196
- s.name === "AbortError" || console.error("Error:", s), l(!1);
197
- });
198
- });
199
- }, this.checkConnectivityExists = function(e) {
200
- var n;
201
- return e && ((n = e.connectivity) == null ? void 0 : n.length);
202
- }, this.connectivityExists = function(e) {
203
- return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
204
- }, this.findIfNodeIsSingle = function(e) {
205
- return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
206
- }, this.createLabelFromNeuralNode = function(e, n) {
207
- let r = this.findIfNodeIsSingle(e);
208
- if (r)
209
- return n[r];
210
- let t = n[e[0]];
211
- return e.length === 2 && e[1].length > 0 && e[1].forEach((a) => {
212
- n[a] == null ? t += `, ${a}` : t += `, ${n[a]}`;
213
- }), t;
214
- }, this.flattenAndFindDatasets = function(e, n, r) {
215
- let t = this.flattenConnectivity(e), a = this.flattenConnectivity(n), i = this.flattenConnectivity(r);
216
- this.originsWithDatasets = this.uberons.filter(
217
- (l) => t.indexOf(l.id) !== -1
218
- ).sort(A), this.componentsWithDatasets = this.uberons.filter(
219
- (l) => a.indexOf(l.id) !== -1
220
- ).sort(A), this.destinationsWithDatasets = this.uberons.filter(
221
- (l) => i.indexOf(l.id) !== -1
222
- ).sort(A), this.singleConnectivityList.length > 0 && this.singleConnectivityList.forEach((l) => {
223
- const { sckanNodeId: s, sckanNodeLabel: h, mapNodeId: o, mapNodeLabel: u } = l;
224
- r.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.destinationsCombinations.push({
225
- sckanId: s,
226
- sckanLabel: h,
227
- mapId: o,
228
- mapLabel: u
229
- }), o.forEach((c, v) => {
230
- const f = typeof c == "string" ? c : c[0];
231
- f && this.destinationsWithDatasets.push({
232
- id: f,
233
- name: u.split(",")[v]
234
- });
235
- })), e.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.originsCombinations.push({
236
- sckanId: s,
237
- sckanLabel: h,
238
- mapId: o,
239
- mapLabel: u
240
- }), o.forEach((c, v) => {
241
- const f = typeof c == "string" ? c : c[0];
242
- f && this.originsWithDatasets.push({
243
- id: f,
244
- name: u.split(",")[v]
245
- });
246
- })), n.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.componentsCombinations.push({
247
- sckanId: s,
248
- sckanLabel: h,
249
- mapId: o,
250
- mapLabel: u
251
- }), o.forEach((c, v) => {
252
- const f = typeof c == "string" ? c : c[0];
253
- f && this.componentsWithDatasets.push({
254
- id: f,
255
- name: u.split(",")[v]
256
- });
257
- }));
258
- });
259
- }, this.processConnectivity = function(e, n) {
260
- return new Promise((r) => {
261
- let t = [], a = [], i;
262
- if (n && n["node-phenotypes"]) {
263
- const h = ["ilxtr:hasSomaLocatedIn"], o = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
264
- h.forEach((u) => {
265
- u in n["node-phenotypes"] && t.push(...n["node-phenotypes"][u]);
266
- }), t = b(t), o.forEach((u) => {
267
- u in n["node-phenotypes"] && a.push(...n["node-phenotypes"][u]);
268
- }), a = b(a);
269
- } else
270
- a = b(n.axons), n.somas && n.somas.length > 0 && t.push(...n.somas), n.dendrites && n.dendrites.length > 0 && t.push(...n.dendrites), t = b(t), i = n.somas;
271
- const l = this.findComponents(n, a, t, i), s = this.findAllIdsFromConnectivity(n);
272
- this.createLabelLookup(e, s).then((h) => {
273
- this.origins = t.map(
274
- (o) => this.createLabelFromNeuralNode(o, h)
275
- ).sort(A), this.components = l.map(
276
- (o) => this.createLabelFromNeuralNode(o, h)
277
- ).sort(A), this.destinations = a.map(
278
- (o) => this.createLabelFromNeuralNode(o, h)
279
- ).sort(A), this.flattenAndFindDatasets(t, l, a), r({
280
- ids: {
281
- dendrites: t,
282
- components: l,
283
- axons: a
284
- },
285
- labels: {
286
- origins: this.origins,
287
- components: this.components,
288
- destinations: this.destinations
289
- }
290
- });
291
- });
292
- });
293
- }, this.buildPubmedSqlStatement = function(e) {
294
- let n = "select distinct publication from publications where entity in (";
295
- if (e.length === 1)
296
- n += `'${e[0]}')`;
297
- else if (e.length > 1)
298
- for (let r in e)
299
- n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
300
- return n;
301
- }, this.buildPubmedSqlStatementForModels = function(e) {
302
- return `select distinct publication from publications where entity = '${e}'`;
303
- }, this.queryKnowledge = async (e, n) => {
304
- const r = `${this.flatmapAPI}knowledge/query/`, a = await fetch(r, {
305
- method: "POST",
306
- headers: {
307
- Accept: "application/json"
308
- },
309
- body: JSON.stringify({ sql: e, params: n })
310
- });
311
- if (!a.ok)
312
- throw new Error(`Cannot access ${r}`);
313
- const i = await a.json();
314
- if ("error" in i)
315
- throw new TypeError(i.error);
316
- return i.values;
317
- };
318
- };
319
- const I = [
1
+ import { markRaw as M } from "vue";
2
+ import { d as T, c as w, e as I, f as S, h as _, T as F, E as f, i as b, j as C, k as O } from "./index-_b4VBGHk.js";
3
+ import { mapStores as E } from "pinia";
4
+ import { getKnowledgeSource as d, FlatmapQueries as L, loadAndStoreKnowledge as N } from "@abi-software/flatmapvuer";
5
+ const R = [
320
6
  {
321
7
  id: 0,
322
8
  nerve_id: "ILX:0793723",
@@ -1129,50 +815,50 @@ const I = [
1129
815
  "FMA subclasses (in human nerves)": ["FMA:6892", "FMA:6893"],
1130
816
  "subclass labels": ["Right T9 grey ramus communicans", "Left T9 grey ramus communicans"]
1131
817
  }
1132
- ], D = () => {
818
+ ], B = () => {
1133
819
  const e = {};
1134
- return I.forEach((n) => {
1135
- const r = n.nerve_id, t = n.label.toLowerCase(), a = n["subclass labels"];
1136
- if (r && t !== "nerve") {
1137
- if (!a.length)
820
+ return R.forEach((a) => {
821
+ const r = a.nerve_id, n = a.label.toLowerCase(), t = a["subclass labels"];
822
+ if (r && n !== "nerve") {
823
+ if (!t.length)
1138
824
  return;
1139
825
  r in e || (e[r] = {});
1140
- const i = a.map((l) => l.toLowerCase()).sort();
826
+ const s = t.map((l) => l.toLowerCase()).sort();
1141
827
  e[r] = {
1142
- nerve: t,
1143
- subNerves: i
828
+ nerve: n,
829
+ subNerves: s
1144
830
  };
1145
831
  }
1146
832
  }), e;
1147
- }, $ = () => {
1148
- let e = [], n = {
833
+ }, X = () => {
834
+ let e = [], a = {
1149
835
  key: "scaffold.connectivity.nerve",
1150
836
  label: "Nerves",
1151
837
  children: []
1152
838
  }, r = [];
1153
- for (const t of I) {
1154
- if (t.label === "nerve")
839
+ for (const n of R) {
840
+ if (n.label === "nerve")
1155
841
  continue;
1156
- let a = {
842
+ let t = {
1157
843
  facetPropPath: "scaffold.connectivity.nerve",
1158
844
  label: "",
1159
845
  children: []
1160
- }, i = [];
1161
- for (const [l, s] of Object.entries(t))
1162
- if (l === "label" && (a.label = s), l === "subclass labels")
1163
- for (const h of s)
1164
- i.push({
846
+ }, s = [];
847
+ for (const [l, i] of Object.entries(n))
848
+ if (l === "label" && (t.label = i), l === "subclass labels")
849
+ for (const o of i)
850
+ s.push({
1165
851
  facetPropPath: "scaffold.connectivity.subnerve",
1166
- label: h
852
+ label: o
1167
853
  });
1168
- i.length && (a.children = i.sort((l, s) => l.label.localeCompare(s.label)), r.push(a));
854
+ s.length && (t.children = s.sort((l, i) => l.label.localeCompare(i.label)), r.push(t));
1169
855
  }
1170
- return r.length && (n.children = r.sort((t, a) => t.label.localeCompare(a.label)), e.push(n)), e;
856
+ return r.length && (a.children = r.sort((n, t) => n.label.localeCompare(t.label)), e.push(a)), e;
1171
857
  };
1172
- function H(e) {
858
+ function x(e) {
1173
859
  return e[0].toUpperCase() + e.substring(1);
1174
860
  }
1175
- const K = {
861
+ const $ = {
1176
862
  emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
1177
863
  props: {
1178
864
  /**
@@ -1191,7 +877,7 @@ const K = {
1191
877
  },
1192
878
  inject: ["showGlobalSettings", "showOpenMapButton"],
1193
879
  computed: {
1194
- ...k(E, O, N, x),
880
+ ...E(T, w, I, S),
1195
881
  idNamePair() {
1196
882
  return this.splitFlowStore.idNamePair;
1197
883
  },
@@ -1216,18 +902,20 @@ const K = {
1216
902
  this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.iframeRef = this.$refs.iframe, this.plotRef = this.$refs.plot, this.simulationRef = this.$refs.simulation, (this.scaffoldRef || this.iframeRef || this.plotRef || this.simulationRef) && this.loadExplorerConfig(), this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources;
1217
903
  },
1218
904
  methods: {
1219
- toggleMinimap: function(e, n) {
905
+ toggleMinimap: function(e, a) {
1220
906
  var r;
1221
907
  if (this.multiflatmapRef && this.flatmapIsReady()) {
1222
- const t = this.multiflatmapRef.getCurrentFlatmap(), a = t == null ? void 0 : t.mapImp;
1223
- if (a)
908
+ const n = this.multiflatmapRef.getCurrentFlatmap(), t = n == null ? void 0 : n.mapImp;
909
+ if (t)
1224
910
  if (e === !0) {
1225
- if (n === !1) {
1226
- const i = ((r = a.options) == null ? void 0 : r.minimap) || { position: "top-right" };
1227
- a.createMinimap(i), t.addResizeButtonToMinimap(), t.minimapSmall = !1;
911
+ if (a === !1) {
912
+ const s = ((r = t.options) == null ? void 0 : r.minimap) || {
913
+ position: "top-right"
914
+ };
915
+ t.createMinimap(s), n.addResizeButtonToMinimap(), n.minimapSmall = !1;
1228
916
  }
1229
917
  } else
1230
- a.closeMinimap();
918
+ t.closeMinimap();
1231
919
  }
1232
920
  },
1233
921
  onConnectivityItemClose() {
@@ -1242,13 +930,13 @@ const K = {
1242
930
  getState: function() {
1243
931
  },
1244
932
  openMap: function(e) {
1245
- m.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
933
+ f.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
1246
934
  },
1247
935
  onMapmanagerLoaded: function(e) {
1248
936
  this.settingsStore.updateMapManager(e);
1249
937
  },
1250
938
  trackOpenMap: function(e) {
1251
- M.sendEvent({
939
+ F.sendEvent({
1252
940
  event: "interaction_event",
1253
941
  event_name: "portal_maps_open_map",
1254
942
  category: e,
@@ -1277,60 +965,66 @@ const K = {
1277
965
  /**
1278
966
  * Callback when the vuers emit a selected event.
1279
967
  */
1280
- resourceSelected: function(e, n) {
1281
- var l, s, h, o;
1282
- const r = n[0];
968
+ resourceSelected: function(e, a) {
969
+ var l, i, o, h;
970
+ const r = a[0];
1283
971
  if (this.resourceHasAction(r)) {
1284
- m.emit("PopoverActionClick", r);
972
+ f.emit("PopoverActionClick", r);
1285
973
  return;
1286
974
  }
1287
- let t, a = !1;
1288
- const i = {
975
+ let n, t = !1;
976
+ const s = {
1289
977
  paneIndex: this.entry.id,
1290
978
  type: e,
1291
- resource: n,
979
+ resource: a,
1292
980
  internalName: void 0,
1293
981
  eventType: void 0
1294
982
  };
1295
983
  if (e == "MultiFlatmap" || e == "Flatmap")
1296
- if (i.internalName = (l = r == null ? void 0 : r.feature) != null && l.label ? r.feature.label : this.idNamePair[r.feature.models], r.eventType == "click") {
1297
- if (i.eventType = "selected", r.feature.type == "marker") {
1298
- let u = i.internalName;
984
+ if (s.internalName = (l = r == null ? void 0 : r.feature) != null && l.label ? r.feature.label : this.idNamePair[r.feature.models], r.eventType == "click") {
985
+ if (s.eventType = "selected", r.feature.type == "marker") {
986
+ let c = s.internalName;
1299
987
  if (this.settingsStore.isFeaturedMarkerIdentifier(r.feature.id))
1300
- t = {
988
+ n = {
1301
989
  type: "Search",
1302
990
  term: this.settingsStore.featuredMarkerDoi(r.feature.id),
1303
991
  featuredDataset: !0
1304
992
  };
1305
993
  else {
1306
- t = {
1307
- type: "Facet",
1308
- facets: [u]
1309
- };
1310
- let c = /* @__PURE__ */ new Set();
1311
- if (r.feature["dataset-terms"].forEach((v) => {
1312
- c.add(v.label ? v.label : v.term);
1313
- }), c.size === 0 && c.add(u), t.facets = [...c], this.settingsStore.hasAppliedFacets(c) && this.settingsStore.appliedFacets.length <= c.size)
1314
- return;
1315
- if (this.settingsStore.appliedFacets.length) {
1316
- if (!this.settingsStore.hasAppliedFacets(c)) {
1317
- const v = [.../* @__PURE__ */ new Set([
1318
- ...this.settingsStore.appliedFacets,
1319
- ...c
1320
- ])];
1321
- this.settingsStore.updateAppliedFacets(v);
1322
- }
1323
- } else
1324
- c.size > 1 && (t.type = "Facets"), this.settingsStore.updateAppliedFacets(t.facets);
994
+ if (r.protocol) {
995
+ let u = r.feature.models ? r.feature.models : r.feature.variable;
996
+ !u && this.markerToUberonID && (u = this.markerToUberonID[r.feature.id]), n = {
997
+ type: "ProtocolSearch",
998
+ protocol: r.protocol,
999
+ term: u
1000
+ };
1001
+ } else {
1002
+ n = {
1003
+ type: "Facet",
1004
+ facets: [c]
1005
+ };
1006
+ let u = /* @__PURE__ */ new Set();
1007
+ if (r.feature["dataset-terms"].forEach((m) => {
1008
+ u.add(m.label ? m.label : m.term);
1009
+ }), u.size === 0 && u.add(c), n.facets = [...u], this.settingsStore.hasAppliedFacets(u) && this.settingsStore.appliedFacets.length <= u.size)
1010
+ return;
1011
+ if (this.settingsStore.appliedFacets.length) {
1012
+ if (!this.settingsStore.hasAppliedFacets(u)) {
1013
+ const m = [.../* @__PURE__ */ new Set([...this.settingsStore.appliedFacets, ...u])];
1014
+ this.settingsStore.updateAppliedFacets(m);
1015
+ }
1016
+ } else
1017
+ u.size > 1 && (n.type = "Facets"), this.settingsStore.updateAppliedFacets(n.facets);
1018
+ }
1019
+ t = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
1325
1020
  }
1326
- a = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
1327
1021
  }
1328
- } else r.eventType == "mouseenter" && (i.eventType = "highlighted", a = !0);
1329
- else e == "Scaffold" && (r && ((((s = r.data) == null ? void 0 : s.id) === void 0 || ((h = r.data) == null ? void 0 : h.id) === "") && (r.data.id = (o = r.data) == null ? void 0 : o.group), i.internalName = r.data.id, r.data.lastActionOnMarker === !0 && (t = {
1022
+ } else r.eventType == "mouseenter" && (s.eventType = "highlighted", t = !0);
1023
+ else e == "Scaffold" && (r && ((((i = r.data) == null ? void 0 : i.id) === void 0 || ((o = r.data) == null ? void 0 : o.id) === "") && (r.data.id = (h = r.data) == null ? void 0 : h.group), s.internalName = r.data.id, r.data.lastActionOnMarker === !0 && (n = {
1330
1024
  type: "Facet",
1331
- facets: [H(r.data.id)]
1332
- })), i.eventType = "selected", a = !0);
1333
- t && m.emit("PopoverActionClick", t), a && this.$emit("resource-selected", i);
1025
+ facets: [x(r.data.id)]
1026
+ })), s.eventType = "selected", t = !0);
1027
+ n && f.emit("PopoverActionClick", n), t && this.$emit("resource-selected", s);
1334
1028
  },
1335
1029
  resourceHasAction: function(e) {
1336
1030
  return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
@@ -1341,101 +1035,127 @@ const K = {
1341
1035
  * calls to try to ge a valid name/id.
1342
1036
  */
1343
1037
  getNameAndIdFromSyncData: async function(e) {
1344
- let n = e.internalName;
1345
- n === void 0 && e.resource && (n = e.resource.label);
1038
+ let a = e.internalName;
1039
+ a === void 0 && e.resource && (a = e.resource.label);
1346
1040
  let r;
1347
1041
  if (e.resource && e.resource.resource && (r = e.resource.resource[0]), this.entry.type === "Scaffold") {
1348
- if (this.$refs.scaffold.findObjectsWithGroupName(n).length === 0) {
1042
+ if (this.$refs.scaffold.findObjectsWithGroupName(a).length === 0) {
1349
1043
  if (e.resource && e.resource.feature) {
1350
- const i = w(e.resource.feature.models);
1351
- if (i.length > 0) return i;
1044
+ const s = b(e.resource.feature.models);
1045
+ if (s.length > 0) return s;
1352
1046
  }
1353
- let a = X(n);
1354
- if (a)
1355
- return a;
1047
+ let t = C(a);
1048
+ if (t)
1049
+ return t;
1356
1050
  if (r && e.eventType === "selected")
1357
- return fetch(`${this.apiLocation}get-related-terms/${r}`).then((i) => i.json()).then((i) => {
1051
+ return fetch(`${this.apiLocation}get-related-terms/${r}`).then((s) => s.json()).then((s) => {
1358
1052
  var l;
1359
- if (((l = i.uberon) == null ? void 0 : l.array.length) > 0)
1360
- return n = i.uberon.array[0].name.charAt(0).toUpperCase() + i.uberon.array[0].name.slice(1), r = i.uberon.array[0].id.toUpperCase(), { id: r, name: n };
1053
+ if (((l = s.uberon) == null ? void 0 : l.array.length) > 0)
1054
+ return a = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), r = s.uberon.array[0].id.toUpperCase(), { id: r, name: a };
1361
1055
  });
1362
1056
  }
1363
1057
  } else if (this.entry.type === "MultiFlatmap")
1364
- if (n === "Bladder")
1365
- n = "Urinary Bladder";
1058
+ if (a === "Bladder")
1059
+ a = "Urinary Bladder";
1366
1060
  else {
1367
- const t = w(n);
1368
- t.length > 0 && (n = t[0]);
1061
+ const n = b(a);
1062
+ n.length > 0 && (a = n[0]);
1369
1063
  }
1370
- return { id: r, name: n };
1064
+ return { id: r, name: a };
1371
1065
  },
1372
1066
  // Get the species and andaotmy info for the featured datasets
1373
1067
  getDatasetAnatomyInfo: function(e) {
1374
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((n) => n.json()).then((n) => {
1375
- const r = n.result[0];
1376
- let t;
1068
+ fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((a) => a.json()).then((a) => {
1069
+ const r = a.result[0];
1070
+ let n;
1377
1071
  try {
1378
- t = r.anatomy.organ[0].curie;
1072
+ n = r.anatomy.organ[0].curie;
1379
1073
  } catch {
1380
- t = void 0;
1074
+ n = void 0;
1381
1075
  }
1382
- let a;
1076
+ let t;
1383
1077
  try {
1384
- a = r.item.curie;
1078
+ t = r.item.curie;
1385
1079
  } catch {
1386
- a = void 0;
1080
+ t = void 0;
1387
1081
  }
1388
- let i;
1082
+ let s;
1389
1083
  try {
1390
- let l = 0, s = !1;
1391
- for (; !s && l < r.organisms.subject.length; ) {
1392
- const h = r.organisms.subject[l];
1393
- h.species && (i = h.species.name, s = !0), l += 1;
1084
+ let l = 0, i = !1;
1085
+ for (; !i && l < r.organisms.subject.length; ) {
1086
+ const o = r.organisms.subject[l];
1087
+ o.species && (s = o.species.name, i = !0), l += 1;
1394
1088
  }
1395
1089
  } catch {
1396
- i = void 0;
1090
+ s = void 0;
1397
1091
  }
1398
1092
  this.settingsStore.updateFeaturedMarker({
1399
1093
  identifier: e,
1400
- marker: t,
1401
- doi: a,
1402
- species: i
1094
+ marker: n,
1095
+ doi: t,
1096
+ species: s
1403
1097
  });
1404
1098
  });
1405
1099
  },
1406
1100
  // Check if the old featured dataset api has any info
1407
1101
  oldFeaturedDatasetApiHasInfo: async function() {
1408
- let n = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
1409
- return !n.identifiers || n.identifiers.length == 0 ? !1 : n.identifiers;
1102
+ let a = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
1103
+ return !a.identifiers || a.identifiers.length == 0 ? !1 : a.identifiers;
1410
1104
  },
1411
1105
  // Check if the new featured dataset api has any info
1412
1106
  newFeaturedDatasetApiHasInfo: async function() {
1413
- let n = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
1414
- return !n.datasets || n.datasets.length == 0 ? !1 : n.datasets.map((r) => r.id);
1107
+ let a = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
1108
+ return !a.datasets || a.datasets.length == 0 ? !1 : a.datasets.map((r) => r.id);
1415
1109
  },
1416
- flatmapResourceSelected: function(e, n) {
1110
+ flatmapResourceSelected: function(e, a) {
1417
1111
  var l;
1418
- this.resourceSelected(e, n);
1419
- const r = n[0], { eventType: t, feature: a } = r, { viewingMode: i } = this.settingsStore.globalSettings;
1420
- if (t === "click" && a.type === "feature" && ((l = a.models) != null && l.startsWith("ilxtr:"))) {
1421
- const s = [];
1422
- n.forEach((h) => {
1423
- const { models: o } = h.feature;
1424
- s.push(o);
1425
- }), M.sendEvent({
1112
+ this.resourceSelected(e, a);
1113
+ const r = a[0], { eventType: n, feature: t } = r, { viewingMode: s } = this.settingsStore.globalSettings;
1114
+ if (n === "click" && t.type === "feature" && ((l = t.models) != null && l.startsWith("ilxtr:"))) {
1115
+ const i = [];
1116
+ a.forEach((o) => {
1117
+ const { models: h } = o.feature;
1118
+ i.push(h);
1119
+ }), F.sendEvent({
1426
1120
  event: "interaction_event",
1427
1121
  event_name: "portal_maps_connectivity",
1428
- category: s.join(", "),
1429
- location: e + " " + i
1122
+ category: i.join(", "),
1123
+ location: e + " " + s
1430
1124
  });
1431
1125
  }
1126
+ if (n === "click" && t.type === "feature" && e === "Flatmap") {
1127
+ let i, o;
1128
+ if (t && t.variable) {
1129
+ const c = t.variable.split("/");
1130
+ c.length === 1 && (o = c[0]), c.length === 2 && (i = c[0], o = c[1]);
1131
+ }
1132
+ if (!o) {
1133
+ const c = this.mappingStore.mapToCellMLIdentifiers(t.mapUUID, t.id);
1134
+ i = c == null ? void 0 : c.component, o = c == null ? void 0 : c.variable;
1135
+ }
1136
+ if (!i || !o)
1137
+ return;
1138
+ const h = {
1139
+ component: i,
1140
+ featureId: t.id,
1141
+ label: t.label,
1142
+ mapId: t.mapUUID,
1143
+ offset: { left: 15, top: 15 },
1144
+ ownerId: this.entry.id,
1145
+ position: { x: this.elementX + this.left, y: this.elementY + this.top },
1146
+ protocol: r.protocol,
1147
+ variable: o,
1148
+ windowId: `simulation-window-${this.entry.id}-${i}-${o}`
1149
+ };
1150
+ this.simulationPlotStore.requestSimulation(h);
1151
+ }
1432
1152
  },
1433
1153
  /**
1434
1154
  * Get a list of featured datasets to display.
1435
1155
  */
1436
1156
  getFeaturedDatasets: async function() {
1437
- let e = [], n = await this.oldFeaturedDatasetApiHasInfo();
1438
- if (n) e = n;
1157
+ let e = [], a = await this.oldFeaturedDatasetApiHasInfo();
1158
+ if (a) e = a;
1439
1159
  else {
1440
1160
  let r = await this.newFeaturedDatasetApiHasInfo();
1441
1161
  r && (e = r);
@@ -1479,67 +1199,65 @@ const K = {
1479
1199
  checkEndHelpMouseDown: function(e) {
1480
1200
  e.target.closest(".help-mode-dialog") || this.endHelp();
1481
1201
  },
1482
- flatmapHighlight: async function(e, n, r, t) {
1483
- let a = [...n, ...t];
1484
- const i = this.settingsStore.globalSettings;
1485
- if (i.highlightConnectedPaths) {
1486
- const l = n.length ? n : t.length ? t : [], s = await e.retrieveConnectedPaths(l);
1487
- s && a.push(...s);
1202
+ flatmapHighlight: async function(e, a, r, n) {
1203
+ let t = [...a, ...n];
1204
+ const s = this.settingsStore.globalSettings;
1205
+ if (s.highlightConnectedPaths) {
1206
+ const l = a.length ? a : n.length ? n : [], i = await e.retrieveConnectedPaths(l);
1207
+ i && t.push(...i);
1488
1208
  }
1489
- if (i.highlightDOIPaths) {
1209
+ if (s.highlightDOIPaths) {
1490
1210
  const l = await e.searchConnectivitiesByReference(r);
1491
- l && a.push(...l);
1211
+ l && t.push(...l);
1492
1212
  }
1493
- return a = [...new Set(a)], a;
1213
+ return t = [...new Set(t)], t;
1494
1214
  },
1495
1215
  sidebarHoverHighlight: function(e) {
1496
- var n, r;
1216
+ var a, r;
1497
1217
  if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
1498
- const t = this.settingsStore.hoverAnatomies, a = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI, l = this.settingsStore.hoverConnectivity;
1499
- let s = null, h = null;
1500
- this.flatmapRef && (s = this.flatmapRef), this.multiflatmapRef && (s = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (h = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !a.length && !i && !l.length && ((this.multiflatmapRef || this.flatmapRef) && s ? s.mapImp && !s.mapImp.contextLost && ((n = s.mapImp) == null || n.clearSearchResults(), e.connectivityProcessed && ((r = s.mapImp) == null || r.setPaint({ dimmed: !0 }))) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1)), this.highlightDelay = setTimeout(() => {
1501
- (t.length || a.length || i || l.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, i, l).then((o) => {
1218
+ const n = this.settingsStore.hoverAnatomies, t = this.settingsStore.hoverOrgans, s = this.settingsStore.hoverDOI, l = this.settingsStore.hoverConnectivity;
1219
+ let i = null, o = null;
1220
+ this.flatmapRef && (i = this.flatmapRef), this.multiflatmapRef && (i = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (o = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !t.length && !s && !l.length && ((this.multiflatmapRef || this.flatmapRef) && i ? i.mapImp && !i.mapImp.contextLost && ((a = i.mapImp) == null || a.clearSearchResults(), e.connectivityProcessed && ((r = i.mapImp) == null || r.setPaint({ dimmed: !0 }))) : this.scaffoldRef && o && o.changeHighlightedByName(t, "", !1)), this.highlightDelay = setTimeout(() => {
1221
+ (n.length || t.length || s || l.length) && ((this.multiflatmapRef || this.flatmapRef) && i ? this.flatmapHighlight(i, n, s, l).then((h) => {
1502
1222
  try {
1503
- s.showConnectivityTooltips({
1504
- connectivityInfo: { featureId: o },
1223
+ i.showConnectivityTooltips({
1224
+ connectivityInfo: { featureId: h },
1505
1225
  data: []
1506
1226
  });
1507
- } catch (u) {
1508
- if (console.log(u), l.length && s.mapImp) {
1509
- const c = s.mapImp.uuid;
1510
- o.every(
1511
- (f) => this.connectivityKnowledge[c].some(
1512
- (p) => p.id === f
1513
- )
1514
- ) || s.mapImp && !s.mapImp.contextLost && s.mapImp.clearSearchResults();
1227
+ } catch {
1228
+ if (l.length && i.mapImp) {
1229
+ const u = i.mapImp.uuid;
1230
+ h.every(
1231
+ (v) => this.connectivityKnowledge[u].some((p) => p.id === v)
1232
+ ) || i.mapImp && !i.mapImp.contextLost && i.mapImp.clearSearchResults();
1515
1233
  }
1516
1234
  }
1517
- }) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1));
1235
+ }) : this.scaffoldRef && o && o.changeHighlightedByName(t, "", !1));
1518
1236
  }, 100);
1519
1237
  }
1520
1238
  },
1521
1239
  onAnnotationOpen: function(e) {
1522
- m.emit("annotation-open", e);
1240
+ f.emit("annotation-open", e);
1523
1241
  },
1524
1242
  onAnnotationClose: function() {
1525
- m.emit("sidebar-annotation-close");
1243
+ f.emit("sidebar-annotation-close");
1526
1244
  },
1527
1245
  updateOfflineAnnotationEnabled: function(e) {
1528
- m.emit("update-offline-annotation-enabled", e);
1246
+ f.emit("update-offline-annotation-enabled", e);
1529
1247
  },
1530
1248
  onConnectivityInfoOpen: function(e) {
1531
- m.emit("connectivity-info-open", e);
1249
+ f.emit("connectivity-info-open", e);
1532
1250
  },
1533
1251
  onConnectivityError: function(e) {
1534
- m.emit("connectivity-error", e);
1252
+ f.emit("connectivity-error", e);
1535
1253
  },
1536
1254
  onConnectivityInfoClose: function() {
1537
- m.emit("connectivity-info-close");
1255
+ f.emit("connectivity-info-close");
1538
1256
  },
1539
1257
  onSidebarAnnotationClose: function() {
1540
1258
  },
1541
1259
  onNeuronConnectionFeatureClick: function(e) {
1542
- m.emit("neuron-connection-feature-click", e);
1260
+ f.emit("neuron-connection-feature-click", e);
1543
1261
  },
1544
1262
  showConnectivity: function() {
1545
1263
  },
@@ -1551,115 +1269,140 @@ const K = {
1551
1269
  this.flatmapService = await this.mockUpFlatmapService(), this.loadConnectivityExplorerConfig(this.flatmapService);
1552
1270
  },
1553
1271
  mockUpFlatmapService: async function() {
1554
- const r = (await (await fetch(this.flatmapAPI)).json()).filter((u) => u.id === "human-flatmap_male").sort((u, c) => c.created.localeCompare(u.created))[0], t = r.uuid, a = r.sckan["knowledge-source"], l = await (await fetch(`${this.flatmapAPI}/flatmap/${t}/pathways`)).json();
1555
- this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
1556
- const s = {
1272
+ const r = (await (await fetch(this.flatmapAPI)).json()).filter((c) => c.id === "human-flatmap_male").sort((c, u) => u.created.localeCompare(c.created))[0], n = r.uuid, t = r.sckan["knowledge-source"], l = await (await fetch(`${this.flatmapAPI}/flatmap/${n}/pathways`)).json();
1273
+ this.flatmapQueries = M(new L()), this.flatmapQueries.initialise(this.flatmapAPI);
1274
+ const i = {
1557
1275
  mapMetadata: {
1558
- uuid: t,
1276
+ uuid: n,
1559
1277
  connectivity: {
1560
1278
  ...r.sckan
1561
1279
  }
1562
1280
  },
1563
1281
  pathways: l,
1564
1282
  resource: this.entry.resource,
1565
- knowledgeSource: a,
1566
- queryKnowledge: async (u) => {
1567
- const c = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", v = [a, u], f = await this.flatmapQueries.queryKnowledge(c, v);
1568
- return JSON.parse(f);
1283
+ knowledgeSource: t,
1284
+ queryKnowledge: async (c) => {
1285
+ const u = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", m = [t, c], v = await this.flatmapQueries.queryKnowledge(u, m);
1286
+ return JSON.parse(v);
1569
1287
  },
1570
- queryLabels: async (u) => {
1571
- const c = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(u.length - 1)}) order by entity, source desc`, v = [a, ...u], f = await this.flatmapQueries.queryKnowledge(c, v), p = [];
1288
+ queryLabels: async (c) => {
1289
+ const u = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(
1290
+ c.length - 1
1291
+ )}) order by entity, source desc`, m = [t, ...c], v = await this.flatmapQueries.queryKnowledge(u, m), p = [];
1572
1292
  let g;
1573
- for (const F of f)
1574
- if (F[1] !== g) {
1575
- const C = JSON.parse(F[2]);
1293
+ for (const A of v)
1294
+ if (A[1] !== g) {
1295
+ const y = JSON.parse(A[2]);
1576
1296
  p.push({
1577
- entity: F[1],
1578
- label: C.label || F[1]
1579
- }), g = F[1];
1297
+ entity: A[1],
1298
+ label: y.label || A[1]
1299
+ }), g = A[1];
1580
1300
  }
1581
1301
  return p;
1582
1302
  }
1583
- }, h = $();
1303
+ }, o = X();
1584
1304
  return {
1585
1305
  mockup: !0,
1586
- getFilterOptions: async (u, c) => {
1587
- const f = await U(this.flatmapAPI, u, c, void 0);
1588
- return [...h, ...f];
1306
+ getFilterOptions: async (c, u) => {
1307
+ const v = await O(
1308
+ this.flatmapAPI,
1309
+ c,
1310
+ u,
1311
+ void 0
1312
+ );
1313
+ return [...o, ...v];
1589
1314
  },
1590
- getTermNerveMaps: D,
1591
- mapImp: s
1315
+ getTermNerveMaps: B,
1316
+ mapImp: i
1592
1317
  };
1593
1318
  },
1594
1319
  loadConnectivityExplorerConfig: async function(e) {
1595
- var i;
1596
- const n = e.mapImp, r = R(n), t = e.mockup ? n.resource : n.uuid;
1597
- let a = [];
1320
+ var s;
1321
+ const a = e.mapImp, r = d(a), n = e.mockup ? a.resource : a.uuid;
1322
+ let t = [];
1598
1323
  if (!this.connectivityKnowledge[r]) {
1599
- this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
1600
- const l = await B(n, this.flatmapQueries);
1601
- this.connectivityKnowledge[r] = l.filter((s) => {
1602
- var h;
1603
- return (h = s.connectivity) == null ? void 0 : h.length;
1604
- }).sort((s, h) => s.label.localeCompare(h.label));
1324
+ this.flatmapQueries = M(new L()), this.flatmapQueries.initialise(this.flatmapAPI);
1325
+ const l = await N(a, this.flatmapQueries);
1326
+ this.connectivityKnowledge[r] = l.filter((i) => {
1327
+ var o;
1328
+ return (o = i.connectivity) == null ? void 0 : o.length;
1329
+ }).sort((i, o) => i.label.localeCompare(o.label));
1605
1330
  }
1606
- if (!this.connectivityKnowledge[t]) {
1607
- const l = ((i = n.pathways) == null ? void 0 : i.paths) || {};
1608
- this.connectivityKnowledge[t] = this.connectivityKnowledge[r].filter((s) => s.id in l);
1331
+ if (!this.connectivityKnowledge[n]) {
1332
+ const l = ((s = a.pathways) == null ? void 0 : s.paths) || {};
1333
+ this.connectivityKnowledge[n] = this.connectivityKnowledge[r].filter(
1334
+ (i) => i.id in l
1335
+ );
1609
1336
  }
1610
- if (!this.connectivityFilterOptions[t] && !e.mockup && (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), e.mockup) {
1611
- const l = e.getTermNerveMaps() || {}, s = JSON.parse(JSON.stringify(this.connectivityKnowledge[t]));
1612
- this.connectivityKnowledge[t] = s.map((o) => {
1613
- var c;
1614
- let u = o;
1615
- if ((c = o.nerves) != null && c.length) {
1616
- const f = o.nerves.flat(1 / 0).reduce((p, g) => (g in l && p.push(l[g]), p), []);
1617
- f != null && f.length && (a.push(...f), u["nerve-label"] = f.sort((p, g) => p.nerve.localeCompare(g.nerve)));
1337
+ if (!this.connectivityFilterOptions[n] && !e.mockup && (this.connectivityFilterOptions[n] = await e.getFilterOptions(
1338
+ a,
1339
+ this.connectivityKnowledge[n]
1340
+ )), e.mockup) {
1341
+ const l = e.getTermNerveMaps() || {}, i = JSON.parse(JSON.stringify(this.connectivityKnowledge[n]));
1342
+ this.connectivityKnowledge[n] = i.map((h) => {
1343
+ var u;
1344
+ let c = h;
1345
+ if ((u = h.nerves) != null && u.length) {
1346
+ const v = h.nerves.flat(1 / 0).reduce((p, g) => (g in l && p.push(l[g]), p), []);
1347
+ v != null && v.length && (t.push(...v), c["nerve-label"] = v.sort((p, g) => p.nerve.localeCompare(g.nerve)));
1618
1348
  }
1619
- return u;
1620
- }).filter((o) => o["nerve-label"]), this.connectivityFilterOptions[t] || (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), a = a.map((o) => o.nerve.toLowerCase());
1621
- const h = JSON.parse(JSON.stringify(this.connectivityFilterOptions[t]));
1622
- this.connectivityFilterOptions[t] = h.map((o) => {
1623
- if (o.key === "scaffold.connectivity.nerve") {
1624
- const u = o.children.filter((c) => a.includes(c.label.toLowerCase()));
1625
- return { ...o, children: u };
1349
+ return c;
1350
+ }).filter((h) => h["nerve-label"]), this.connectivityFilterOptions[n] || (this.connectivityFilterOptions[n] = await e.getFilterOptions(
1351
+ a,
1352
+ this.connectivityKnowledge[n]
1353
+ )), t = t.map((h) => h.nerve.toLowerCase());
1354
+ const o = JSON.parse(JSON.stringify(this.connectivityFilterOptions[n]));
1355
+ this.connectivityFilterOptions[n] = o.map((h) => {
1356
+ if (h.key === "scaffold.connectivity.nerve") {
1357
+ const c = h.children.filter((u) => t.includes(u.label.toLowerCase()));
1358
+ return { ...h, children: c };
1626
1359
  } else
1627
- return o;
1360
+ return h;
1628
1361
  });
1629
1362
  } else
1630
- this.connectivityFilterSources[t] || (this.connectivityFilterSources[t] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
1631
- this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), m.emit("species-layout-connectivity-update");
1363
+ this.connectivityFilterSources[n] || (this.connectivityFilterSources[n] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
1364
+ this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), f.emit("species-layout-connectivity-update");
1632
1365
  },
1633
1366
  knowledgeTooltipQuery: async function(e) {
1634
1367
  await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp, { resource: [e.id] });
1635
- let n = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
1368
+ let a = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
1636
1369
  resource: [e.id],
1637
1370
  label: e.label,
1638
1371
  provenanceTaxonomy: e.taxons,
1639
1372
  feature: []
1640
1373
  });
1641
- return n.knowledgeSource = R(this.flatmapService.mapImp), n.mapId = this.flatmapService.mapImp.mapMetadata.id, n.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, n["nerve-label"] = e["nerve-label"], n.ready = !0, n;
1374
+ return a.knowledgeSource = d(this.flatmapService.mapImp), a.mapId = this.flatmapService.mapImp.mapMetadata.id, a.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, a["nerve-label"] = e["nerve-label"], a.ready = !0, a;
1642
1375
  },
1643
1376
  getKnowledgeTooltip: async function(e) {
1644
- this.tooltipEntry = [], e.data.forEach((t) => this.tooltipEntry.push({ title: t.label, featureId: [t.id], ready: !1 })), m.emit("connectivity-info-open", this.tooltipEntry);
1645
- let n = [];
1646
- for (let t = 0; t < e.data.length; t++)
1647
- n.push(await this.knowledgeTooltipQuery(e.data[t]));
1648
- this.tooltipEntry = await Promise.all(n), this.tooltipEntry.map((t) => t.featureId[0]).length > 0 && m.emit("connectivity-info-open", this.tooltipEntry);
1377
+ this.tooltipEntry = [], e.data.forEach(
1378
+ (n) => this.tooltipEntry.push({
1379
+ title: n.label,
1380
+ featureId: [n.id],
1381
+ ready: !1
1382
+ })
1383
+ ), f.emit("connectivity-info-open", this.tooltipEntry);
1384
+ let a = [];
1385
+ for (let n = 0; n < e.data.length; n++)
1386
+ a.push(await this.knowledgeTooltipQuery(e.data[n]));
1387
+ this.tooltipEntry = await Promise.all(a), this.tooltipEntry.map((n) => n.featureId[0]).length > 0 && f.emit("connectivity-info-open", this.tooltipEntry);
1649
1388
  },
1650
- changeConnectivitySource: async function(e, n) {
1651
- var i, l;
1652
- const { entry: r, connectivitySource: t } = e, a = (l = (i = this == null ? void 0 : this.flatmapService) == null ? void 0 : i.mapImp) == null ? void 0 : l.mapMetadata.uuid;
1653
- n.includes(a) || (n.push(a), await this.flatmapQueries.queryForConnectivityNew(this.flatmapService.mapImp, r.featureId[0], t), this.tooltipEntry = this.tooltipEntry.map((s) => s.featureId[0] === r.featureId[0] ? this.flatmapQueries.updateTooltipData(s) : s), m.emit("connectivity-info-open", this.tooltipEntry));
1389
+ changeConnectivitySource: async function(e, a) {
1390
+ var s, l;
1391
+ const { entry: r, connectivitySource: n } = e, t = (l = (s = this == null ? void 0 : this.flatmapService) == null ? void 0 : s.mapImp) == null ? void 0 : l.mapMetadata.uuid;
1392
+ a.includes(t) || (a.push(t), await this.flatmapQueries.queryForConnectivityNew(
1393
+ this.flatmapService.mapImp,
1394
+ r.featureId[0],
1395
+ n
1396
+ ), this.tooltipEntry = this.tooltipEntry.map((i) => i.featureId[0] === r.featureId[0] ? this.flatmapQueries.updateTooltipData(i) : i), f.emit("connectivity-info-open", this.tooltipEntry));
1654
1397
  },
1655
1398
  trackEvent: function(e) {
1656
- M.sendEvent(e);
1399
+ F.sendEvent(e);
1657
1400
  }
1658
1401
  },
1659
1402
  data: function() {
1660
1403
  return {
1661
1404
  apiLocation: void 0,
1662
- activeSpecies: P,
1405
+ activeSpecies: _,
1663
1406
  scaffoldCamera: void 0,
1664
1407
  mainStyle: {
1665
1408
  height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
@@ -1695,5 +1438,5 @@ const K = {
1695
1438
  }
1696
1439
  };
1697
1440
  export {
1698
- K as C
1441
+ $ as C
1699
1442
  };