@abi-software/mapintegratedvuer 1.16.3 → 1.17.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.
@@ -1,51 +1,51 @@
1
1
  import { markRaw as y } from "vue";
2
- import { c as C, u as E, d as O, e as N, E as f, T as b, f as R, h as x, i as w, l as P, j as B, J as X } from "./index-E1q0fbBZ.js";
3
- import { mapStores as U } from "pinia";
4
- const M = function(e) {
5
- return e ? [...new Set(e.map((r) => JSON.stringify(r)))].map(
6
- (r) => JSON.parse(r)
2
+ import { G as _, c as E, u as O, d as N, e as x, E as m, T as M, f as R, h as P, i as w, l as B, j as X, k as U } from "./index-raNlNgsS.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
7
  ) : [];
8
- }, d = [], T = async function(e, r) {
9
- const t = r.filter(
10
- (i) => d.some((s) => s.taxon === i)
11
- ), n = d.filter(
12
- (i) => t.includes(i.taxon)
13
- ), a = r.filter(
14
- (i) => !t.includes(i)
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
15
  );
16
16
  if (a.length) {
17
17
  const i = await e.queryLabels(a);
18
18
  if (i.length)
19
- return i.forEach((s) => {
20
- let { entity: l, label: o } = s;
21
- o === "Mammalia" && (o = "Mammalia not otherwise specified");
22
- const c = { taxon: l, label: o };
23
- n.push(c), d.push(c);
24
- }), n;
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
25
  } else
26
- return n;
27
- }, L = function(e, r) {
28
- if (!e || !r) return !1;
29
- let t = JSON.stringify(e), n = JSON.stringify(r);
30
- return t.indexOf(n) !== -1;
31
- }, A = (e, r) => {
32
- const t = e.name ?? e, n = r.name ?? r, a = t.toUpperCase(), i = n.toUpperCase();
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
33
  return a < i ? -1 : a > i ? 1 : 0;
34
34
  };
35
35
  let S = function() {
36
36
  this.initialise = function(e) {
37
- this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "map", this.noMapConnectivity = !1;
38
- }, this.createTooltipData = async function(e, r) {
39
- let t = [];
40
- r.feature.hyperlinks && r.feature.hyperlinks.length > 0 ? t = r.feature.hyperlinks : t = this.rawURLs;
41
- let n;
42
- if (r.provenanceTaxonomy) {
43
- n = [];
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
44
  try {
45
- const i = await T(e, r.provenanceTaxonomy);
46
- i.length && i.forEach((s) => {
47
- const { label: l } = s;
48
- n.push(l);
45
+ const i = await T(e, n.provenanceTaxonomy);
46
+ i.length && i.forEach((l) => {
47
+ const { label: s } = l;
48
+ t.push(s);
49
49
  });
50
50
  } catch (i) {
51
51
  console.log(i);
@@ -58,11 +58,15 @@ let S = function() {
58
58
  destinationsWithDatasets: this.destinationsWithDatasets,
59
59
  originsWithDatasets: this.originsWithDatasets,
60
60
  componentsWithDatasets: this.componentsWithDatasets,
61
- title: r.label,
62
- featureId: r.resource,
63
- hyperlinks: t,
64
- provenanceTaxonomy: r.provenanceTaxonomy,
65
- provenanceTaxonomyLabel: n,
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,
66
70
  connectivitySource: this.connectivitySource,
67
71
  noMapConnectivity: this.noMapConnectivity
68
72
  };
@@ -75,167 +79,207 @@ let S = function() {
75
79
  componentsWithDatasets: this.componentsWithDatasets,
76
80
  destinations: this.destinations,
77
81
  destinationsWithDatasets: this.destinationsWithDatasets,
82
+ destinationsCombinations: this.destinationsCombinations,
83
+ originsCombinations: this.originsCombinations,
84
+ componentsCombinations: this.componentsCombinations,
78
85
  connectivitySource: this.connectivitySource,
79
86
  noMapConnectivity: this.noMapConnectivity
80
87
  };
81
- }, this.createComponentsLabelList = function(e, r) {
82
- let t = [];
83
- return e.forEach((n) => {
84
- t.push(this.createLabelFromNeuralNode(n[0]), r), n.length === 2 && t.push(this.createLabelFromNeuralNode(n[1]), r);
85
- }), t;
86
- }, this.createLabelLookup = function(e, r) {
87
- return new Promise(async (t) => {
88
- let n = {};
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 = {};
89
96
  this.uberons = [];
90
- const a = await T(e, r);
97
+ const a = await T(e, n);
91
98
  a.length && (a.forEach((i) => {
92
- const { taxon: s, label: l } = i;
93
- n[s] = l, this.uberons.push({
94
- id: s,
95
- name: l
99
+ const { taxon: l, label: s } = i;
100
+ t[l] = s, this.uberons.push({
101
+ id: l,
102
+ name: s
96
103
  });
97
- }), t(n));
104
+ }), r(t));
98
105
  });
99
106
  }, this.buildConnectivitySqlStatement = function(e) {
100
- let r = "select knowledge from knowledge where entity in (";
107
+ let n = "select knowledge from knowledge where entity in (";
101
108
  if (e.length === 1)
102
- r += `'${e[0]}')`;
109
+ n += `'${e[0]}')`;
103
110
  else if (e.length > 1)
104
- for (let t in e)
105
- r += `'${e[t]}'${t >= e.length - 1 ? ")" : ","} `;
106
- return r;
111
+ for (let r in e)
112
+ n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
113
+ return n;
107
114
  }, this.buildLabelSqlStatement = function(e) {
108
- let r = "select entity, label from labels where entity in (";
115
+ let n = "select entity, label from labels where entity in (";
109
116
  if (e.length === 1)
110
- r += `'${e[0]}')`;
117
+ n += `'${e[0]}')`;
111
118
  else if (e.length > 1)
112
- for (let t in e)
113
- r += `'${e[t]}'${t >= e.length - 1 ? ")" : ","} `;
114
- return r;
119
+ for (let r in e)
120
+ n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
121
+ return n;
115
122
  }, this.findAllIdsFromConnectivity = function(e) {
116
- let r = e.connectivity.flat(), t = [...new Set(r)], n = [];
117
- return t.forEach((a) => {
118
- Array.isArray(a) ? n.push(a.flat()) : n.push(a);
119
- }), [...new Set(n.flat())];
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())];
120
127
  }, this.flattenConnectivity = function(e) {
121
- let r = e.flat(), t = [...new Set(r)], n = [];
122
- return t.forEach((a) => {
123
- Array.isArray(a) ? n.push(a.flat()) : n.push(a);
124
- }), n.flat();
125
- }, this.findComponents = function(e, r, t, n) {
126
- let a = e.connectivity.flat(), i = M(a), s = [], l = !1;
127
- return i.forEach((o) => {
128
- l = !1, L(r, o) && (l = !0), n && L(n, o) && (l = !0), L(t, o) && (l = !0), l || s.push(o);
129
- }), s;
130
- }, this.retrieveFlatmapKnowledgeForEvent = async function(e, r) {
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) {
131
138
  this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
132
- const t = r.resource;
133
- if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !t || t.length === 0 || !t[0]) return;
134
- let n = this.queryForConnectivityNew(e, t[0]);
135
- return await Promise.all([n]);
136
- }, this.queryForConnectivityNew = function(e, r, t = "map", n = !0) {
137
- return this.connectivitySource = t, new Promise((a) => {
138
- (t === "map" ? this.queryMapConnectivity(e.mapMetadata.uuid, r) : e.queryKnowledge(r)).then((s) => {
139
- if (this.checkConnectivityExists(s)) {
140
- t === "map" && (this.noMapConnectivity = !1);
141
- let l = s;
142
- n ? this.processConnectivity(e, l).then((o) => {
143
- s.references && (this.rawURLs = [...s.references]), a(o);
144
- }) : a(l);
145
- } else t === "map" ? (this.connectivitySource = "sckan", this.noMapConnectivity = !0, e.queryKnowledge(r).then((l) => {
146
- if (this.checkConnectivityExists(l)) {
147
- let o = l;
148
- n ? this.processConnectivity(e, o).then((c) => {
149
- l.references && (this.rawURLs = [...l.references]), a(c);
150
- }) : a(o);
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);
151
159
  } else
152
- a(!1);
153
- }).catch(() => a(!1))) : a(!1);
154
- }).catch((s) => {
155
- s.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${r}.`), a(!1);
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);
156
164
  });
157
165
  });
158
- }, this.queryMapConnectivity = async function(e, r) {
159
- const t = this.flatmapAPI + `flatmap/${e}/connectivity/${r}`;
166
+ }, this.queryMapConnectivity = async function(e, n) {
167
+ const r = this.flatmapAPI + `flatmap/${e}/connectivity/${n}`;
160
168
  try {
161
- const n = await fetch(t);
162
- if (!n.ok)
163
- throw new Error(`Response status: ${n.status}`);
164
- return await n.json();
165
- } catch (n) {
166
- throw new Error(n);
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);
167
175
  }
168
- }, this.queryForConnectivity = function(e, r, t, n = !0) {
169
- const a = { sql: this.buildConnectivitySqlStatement(r) }, i = {
176
+ }, this.queryForConnectivity = function(e, n, r, t = !0) {
177
+ const a = { sql: this.buildConnectivitySqlStatement(n) }, i = {
170
178
  method: "POST",
171
179
  headers: {
172
180
  "Content-Type": "application/json"
173
181
  },
174
182
  body: JSON.stringify(a),
175
- ...t ? { signal: t } : {}
183
+ ...r ? { signal: r } : {}
176
184
  // add signal to header if it exists
177
185
  };
178
- return new Promise((s) => {
179
- fetch(`${this.flatmapAPI}knowledge/query/`, i).then((l) => l.json()).then((l) => {
180
- if (this.connectivityExists(l)) {
181
- let o = JSON.parse(l.values[0][0]);
182
- n ? this.processConnectivity(e, o).then((c) => {
183
- s(c);
184
- }) : s(o);
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);
185
193
  } else
186
- s(!1);
187
- }).catch((l) => {
188
- l.name === "AbortError" || console.error("Error:", l), s(!1);
194
+ l(!1);
195
+ }).catch((s) => {
196
+ s.name === "AbortError" || console.error("Error:", s), l(!1);
189
197
  });
190
198
  });
191
199
  }, this.checkConnectivityExists = function(e) {
192
- var r;
193
- return e && ((r = e.connectivity) == null ? void 0 : r.length);
200
+ var n;
201
+ return e && ((n = e.connectivity) == null ? void 0 : n.length);
194
202
  }, this.connectivityExists = function(e) {
195
203
  return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
196
204
  }, this.findIfNodeIsSingle = function(e) {
197
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;
198
- }, this.createLabelFromNeuralNode = function(e, r) {
199
- let t = this.findIfNodeIsSingle(e);
200
- if (t)
201
- return r[t];
202
- let n = r[e[0]];
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]];
203
211
  return e.length === 2 && e[1].length > 0 && e[1].forEach((a) => {
204
- r[a] == null ? n += `, ${a}` : n += `, ${r[a]}`;
205
- }), n;
206
- }, this.flattenAndFindDatasets = function(e, r, t) {
207
- let n = this.flattenConnectivity(e), a = this.flattenConnectivity(r), i = this.flattenConnectivity(t);
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);
208
216
  this.originsWithDatasets = this.uberons.filter(
209
- (s) => n.indexOf(s.id) !== -1
217
+ (l) => t.indexOf(l.id) !== -1
210
218
  ).sort(A), this.componentsWithDatasets = this.uberons.filter(
211
- (s) => a.indexOf(s.id) !== -1
219
+ (l) => a.indexOf(l.id) !== -1
212
220
  ).sort(A), this.destinationsWithDatasets = this.uberons.filter(
213
- (s) => i.indexOf(s.id) !== -1
214
- ).sort(A);
215
- }, this.processConnectivity = function(e, r) {
216
- return new Promise((t) => {
217
- let n = [], a = [], i;
218
- if (r && r["node-phenotypes"]) {
219
- const o = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
220
- o.forEach((u) => {
221
- u in r["node-phenotypes"] && n.push(...r["node-phenotypes"][u]);
222
- }), n = M(n), c.forEach((u) => {
223
- u in r["node-phenotypes"] && a.push(...r["node-phenotypes"][u]);
224
- }), a = M(a);
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);
225
269
  } else
226
- a = M(r.axons), r.somas && r.somas.length > 0 && n.push(...r.somas), r.dendrites && r.dendrites.length > 0 && n.push(...r.dendrites), n = M(n), i = r.somas;
227
- const s = this.findComponents(r, a, n, i), l = this.findAllIdsFromConnectivity(r);
228
- this.createLabelLookup(e, l).then((o) => {
229
- this.origins = n.map(
230
- (c) => this.createLabelFromNeuralNode(c, o)
231
- ).sort(A), this.components = s.map(
232
- (c) => this.createLabelFromNeuralNode(c, o)
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)
233
277
  ).sort(A), this.destinations = a.map(
234
- (c) => this.createLabelFromNeuralNode(c, o)
235
- ).sort(A), this.flattenAndFindDatasets(n, s, a), t({
278
+ (o) => this.createLabelFromNeuralNode(o, h)
279
+ ).sort(A), this.flattenAndFindDatasets(t, l, a), r({
236
280
  ids: {
237
- dendrites: n,
238
- components: s,
281
+ dendrites: t,
282
+ components: l,
239
283
  axons: a
240
284
  },
241
285
  labels: {
@@ -247,25 +291,25 @@ let S = function() {
247
291
  });
248
292
  });
249
293
  }, this.buildPubmedSqlStatement = function(e) {
250
- let r = "select distinct publication from publications where entity in (";
294
+ let n = "select distinct publication from publications where entity in (";
251
295
  if (e.length === 1)
252
- r += `'${e[0]}')`;
296
+ n += `'${e[0]}')`;
253
297
  else if (e.length > 1)
254
- for (let t in e)
255
- r += `'${e[t]}'${t >= e.length - 1 ? ")" : ","} `;
256
- return r;
298
+ for (let r in e)
299
+ n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
300
+ return n;
257
301
  }, this.buildPubmedSqlStatementForModels = function(e) {
258
302
  return `select distinct publication from publications where entity = '${e}'`;
259
- }, this.queryKnowledge = async (e, r) => {
260
- const t = `${this.flatmapAPI}/knowledge/query/`, a = await fetch(t, {
303
+ }, this.queryKnowledge = async (e, n) => {
304
+ const r = `${this.flatmapAPI}knowledge/query/`, a = await fetch(r, {
261
305
  method: "POST",
262
306
  headers: {
263
307
  Accept: "application/json"
264
308
  },
265
- body: JSON.stringify({ sql: e, params: r })
309
+ body: JSON.stringify({ sql: e, params: n })
266
310
  });
267
311
  if (!a.ok)
268
- throw new Error(`Cannot access ${t}`);
312
+ throw new Error(`Cannot access ${r}`);
269
313
  const i = await a.json();
270
314
  if ("error" in i)
271
315
  throw new TypeError(i.error);
@@ -1085,50 +1129,50 @@ const I = [
1085
1129
  "FMA subclasses (in human nerves)": ["FMA:6892", "FMA:6893"],
1086
1130
  "subclass labels": ["Right T9 grey ramus communicans", "Left T9 grey ramus communicans"]
1087
1131
  }
1088
- ], $ = () => {
1132
+ ], D = () => {
1089
1133
  const e = {};
1090
- return I.forEach((r) => {
1091
- const t = r.nerve_id, n = r.label.toLowerCase(), a = r["subclass labels"];
1092
- if (t && n !== "nerve") {
1134
+ return I.forEach((n) => {
1135
+ const r = n.nerve_id, t = n.label.toLowerCase(), a = n["subclass labels"];
1136
+ if (r && t !== "nerve") {
1093
1137
  if (!a.length)
1094
1138
  return;
1095
- t in e || (e[t] = {});
1096
- const i = a.map((s) => s.toLowerCase()).sort();
1097
- e[t] = {
1098
- nerve: n,
1139
+ r in e || (e[r] = {});
1140
+ const i = a.map((l) => l.toLowerCase()).sort();
1141
+ e[r] = {
1142
+ nerve: t,
1099
1143
  subNerves: i
1100
1144
  };
1101
1145
  }
1102
1146
  }), e;
1103
- }, H = () => {
1104
- let e = [], r = {
1147
+ }, $ = () => {
1148
+ let e = [], n = {
1105
1149
  key: "scaffold.connectivity.nerve",
1106
1150
  label: "Nerves",
1107
1151
  children: []
1108
- }, t = [];
1109
- for (const n of I) {
1110
- if (n.label === "nerve")
1152
+ }, r = [];
1153
+ for (const t of I) {
1154
+ if (t.label === "nerve")
1111
1155
  continue;
1112
1156
  let a = {
1113
1157
  facetPropPath: "scaffold.connectivity.nerve",
1114
1158
  label: "",
1115
1159
  children: []
1116
1160
  }, i = [];
1117
- for (const [s, l] of Object.entries(n))
1118
- if (s === "label" && (a.label = l), s === "subclass labels")
1119
- for (const o of l)
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)
1120
1164
  i.push({
1121
1165
  facetPropPath: "scaffold.connectivity.subnerve",
1122
- label: o
1166
+ label: h
1123
1167
  });
1124
- i.length && (a.children = i.sort((s, l) => s.label.localeCompare(l.label)), t.push(a));
1168
+ i.length && (a.children = i.sort((l, s) => l.label.localeCompare(s.label)), r.push(a));
1125
1169
  }
1126
- return t.length && (r.children = t.sort((n, a) => n.label.localeCompare(a.label)), e.push(r)), e;
1170
+ return r.length && (n.children = r.sort((t, a) => t.label.localeCompare(a.label)), e.push(n)), e;
1127
1171
  };
1128
- function D(e) {
1172
+ function H(e) {
1129
1173
  return e[0].toUpperCase() + e.substring(1);
1130
1174
  }
1131
- const J = {
1175
+ const K = {
1132
1176
  emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
1133
1177
  props: {
1134
1178
  /**
@@ -1147,7 +1191,7 @@ const J = {
1147
1191
  },
1148
1192
  inject: ["showGlobalSettings", "showOpenMapButton"],
1149
1193
  computed: {
1150
- ...U(C, E, O, N),
1194
+ ...k(E, O, N, x),
1151
1195
  idNamePair() {
1152
1196
  return this.splitFlowStore.idNamePair;
1153
1197
  },
@@ -1172,15 +1216,15 @@ const J = {
1172
1216
  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;
1173
1217
  },
1174
1218
  methods: {
1175
- toggleMinimap: function(e, r) {
1176
- var t;
1177
- if (this.multiflatmapRef) {
1178
- const n = this.multiflatmapRef.getCurrentFlatmap(), a = n == null ? void 0 : n.mapImp;
1219
+ toggleMinimap: function(e, n) {
1220
+ var r;
1221
+ if (this.multiflatmapRef && this.flatmapIsReady()) {
1222
+ const t = this.multiflatmapRef.getCurrentFlatmap(), a = t == null ? void 0 : t.mapImp;
1179
1223
  if (a)
1180
1224
  if (e === !0) {
1181
- if (r === !1) {
1182
- const i = ((t = a.options) == null ? void 0 : t.minimap) || { position: "top-right" };
1183
- a.createMinimap(i), n.addResizeButtonToMinimap(), n.minimapSmall = !1;
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;
1184
1228
  }
1185
1229
  } else
1186
1230
  a.closeMinimap();
@@ -1198,13 +1242,13 @@ const J = {
1198
1242
  getState: function() {
1199
1243
  },
1200
1244
  openMap: function(e) {
1201
- f.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
1245
+ m.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
1202
1246
  },
1203
1247
  onMapmanagerLoaded: function(e) {
1204
1248
  this.settingsStore.updateMapManager(e);
1205
1249
  },
1206
1250
  trackOpenMap: function(e) {
1207
- b.sendEvent({
1251
+ M.sendEvent({
1208
1252
  event: "interaction_event",
1209
1253
  event_name: "portal_maps_open_map",
1210
1254
  category: e,
@@ -1233,60 +1277,60 @@ const J = {
1233
1277
  /**
1234
1278
  * Callback when the vuers emit a selected event.
1235
1279
  */
1236
- resourceSelected: function(e, r) {
1237
- var s, l, o, c;
1238
- const t = r[0];
1239
- if (this.resourceHasAction(t)) {
1240
- f.emit("PopoverActionClick", t);
1280
+ resourceSelected: function(e, n) {
1281
+ var l, s, h, o;
1282
+ const r = n[0];
1283
+ if (this.resourceHasAction(r)) {
1284
+ m.emit("PopoverActionClick", r);
1241
1285
  return;
1242
1286
  }
1243
- let n, a = !1;
1287
+ let t, a = !1;
1244
1288
  const i = {
1245
1289
  paneIndex: this.entry.id,
1246
1290
  type: e,
1247
- resource: r,
1291
+ resource: n,
1248
1292
  internalName: void 0,
1249
1293
  eventType: void 0
1250
1294
  };
1251
1295
  if (e == "MultiFlatmap" || e == "Flatmap")
1252
- if (i.internalName = (s = t == null ? void 0 : t.feature) != null && s.label ? t.feature.label : this.idNamePair[t.feature.models], t.eventType == "click") {
1253
- if (i.eventType = "selected", t.feature.type == "marker") {
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") {
1254
1298
  let u = i.internalName;
1255
- if (this.settingsStore.isFeaturedMarkerIdentifier(t.feature.id))
1256
- n = {
1299
+ if (this.settingsStore.isFeaturedMarkerIdentifier(r.feature.id))
1300
+ t = {
1257
1301
  type: "Search",
1258
- term: this.settingsStore.featuredMarkerDoi(t.feature.id),
1302
+ term: this.settingsStore.featuredMarkerDoi(r.feature.id),
1259
1303
  featuredDataset: !0
1260
1304
  };
1261
1305
  else {
1262
- n = {
1306
+ t = {
1263
1307
  type: "Facet",
1264
1308
  facets: [u]
1265
1309
  };
1266
- let h = /* @__PURE__ */ new Set();
1267
- if (t.feature["dataset-terms"].forEach((m) => {
1268
- h.add(m.label ? m.label : m.term);
1269
- }), h.size === 0 && h.add(u), n.facets = [...h], this.settingsStore.hasAppliedFacets(h) && this.settingsStore.appliedFacets.length <= h.size)
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)
1270
1314
  return;
1271
1315
  if (this.settingsStore.appliedFacets.length) {
1272
- if (!this.settingsStore.hasAppliedFacets(h)) {
1273
- const m = [.../* @__PURE__ */ new Set([
1316
+ if (!this.settingsStore.hasAppliedFacets(c)) {
1317
+ const v = [.../* @__PURE__ */ new Set([
1274
1318
  ...this.settingsStore.appliedFacets,
1275
- ...h
1319
+ ...c
1276
1320
  ])];
1277
- this.settingsStore.updateAppliedFacets(m);
1321
+ this.settingsStore.updateAppliedFacets(v);
1278
1322
  }
1279
1323
  } else
1280
- h.size > 1 && (n.type = "Facets"), this.settingsStore.updateAppliedFacets(n.facets);
1324
+ c.size > 1 && (t.type = "Facets"), this.settingsStore.updateAppliedFacets(t.facets);
1281
1325
  }
1282
1326
  a = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
1283
1327
  }
1284
- } else t.eventType == "mouseenter" && (i.eventType = "highlighted", a = !0);
1285
- else e == "Scaffold" && (t && ((((l = t.data) == null ? void 0 : l.id) === void 0 || ((o = t.data) == null ? void 0 : o.id) === "") && (t.data.id = (c = t.data) == null ? void 0 : c.group), i.internalName = t.data.id, t.data.lastActionOnMarker === !0 && (n = {
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 = {
1286
1330
  type: "Facet",
1287
- facets: [D(t.data.id)]
1331
+ facets: [H(r.data.id)]
1288
1332
  })), i.eventType = "selected", a = !0);
1289
- n && f.emit("PopoverActionClick", n), a && this.$emit("resource-selected", i);
1333
+ t && m.emit("PopoverActionClick", t), a && this.$emit("resource-selected", i);
1290
1334
  },
1291
1335
  resourceHasAction: function(e) {
1292
1336
  return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
@@ -1297,63 +1341,63 @@ const J = {
1297
1341
  * calls to try to ge a valid name/id.
1298
1342
  */
1299
1343
  getNameAndIdFromSyncData: async function(e) {
1300
- let r = e.internalName;
1301
- r === void 0 && e.resource && (r = e.resource.label);
1302
- let t;
1303
- if (e.resource && e.resource.resource && (t = e.resource.resource[0]), this.entry.type === "Scaffold") {
1304
- if (this.$refs.scaffold.findObjectsWithGroupName(r).length === 0) {
1344
+ let n = e.internalName;
1345
+ n === void 0 && e.resource && (n = e.resource.label);
1346
+ let r;
1347
+ if (e.resource && e.resource.resource && (r = e.resource.resource[0]), this.entry.type === "Scaffold") {
1348
+ if (this.$refs.scaffold.findObjectsWithGroupName(n).length === 0) {
1305
1349
  if (e.resource && e.resource.feature) {
1306
1350
  const i = R(e.resource.feature.models);
1307
1351
  if (i.length > 0) return i;
1308
1352
  }
1309
- let a = x(r);
1353
+ let a = P(n);
1310
1354
  if (a)
1311
1355
  return a;
1312
- if (t && e.eventType === "selected")
1313
- return fetch(`${this.apiLocation}get-related-terms/${t}`).then((i) => i.json()).then((i) => {
1314
- var s;
1315
- if (((s = i.uberon) == null ? void 0 : s.array.length) > 0)
1316
- return r = i.uberon.array[0].name.charAt(0).toUpperCase() + i.uberon.array[0].name.slice(1), t = i.uberon.array[0].id.toUpperCase(), { id: t, name: r };
1356
+ if (r && e.eventType === "selected")
1357
+ return fetch(`${this.apiLocation}get-related-terms/${r}`).then((i) => i.json()).then((i) => {
1358
+ 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 };
1317
1361
  });
1318
1362
  }
1319
1363
  } else if (this.entry.type === "MultiFlatmap")
1320
- if (r === "Bladder")
1321
- r = "Urinary Bladder";
1364
+ if (n === "Bladder")
1365
+ n = "Urinary Bladder";
1322
1366
  else {
1323
- const n = R(r);
1324
- n.length > 0 && (r = n[0]);
1367
+ const t = R(n);
1368
+ t.length > 0 && (n = t[0]);
1325
1369
  }
1326
- return { id: t, name: r };
1370
+ return { id: r, name: n };
1327
1371
  },
1328
1372
  // Get the species and andaotmy info for the featured datasets
1329
1373
  getDatasetAnatomyInfo: function(e) {
1330
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((r) => r.json()).then((r) => {
1331
- const t = r.result[0];
1332
- let n;
1374
+ fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((n) => n.json()).then((n) => {
1375
+ const r = n.result[0];
1376
+ let t;
1333
1377
  try {
1334
- n = t.anatomy.organ[0].curie;
1378
+ t = r.anatomy.organ[0].curie;
1335
1379
  } catch {
1336
- n = void 0;
1380
+ t = void 0;
1337
1381
  }
1338
1382
  let a;
1339
1383
  try {
1340
- a = t.item.curie;
1384
+ a = r.item.curie;
1341
1385
  } catch {
1342
1386
  a = void 0;
1343
1387
  }
1344
1388
  let i;
1345
1389
  try {
1346
- let s = 0, l = !1;
1347
- for (; !l && s < t.organisms.subject.length; ) {
1348
- const o = t.organisms.subject[s];
1349
- o.species && (i = o.species.name, l = !0), s += 1;
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;
1350
1394
  }
1351
1395
  } catch {
1352
1396
  i = void 0;
1353
1397
  }
1354
1398
  this.settingsStore.updateFeaturedMarker({
1355
1399
  identifier: e,
1356
- marker: n,
1400
+ marker: t,
1357
1401
  doi: a,
1358
1402
  species: i
1359
1403
  });
@@ -1361,27 +1405,27 @@ const J = {
1361
1405
  },
1362
1406
  // Check if the old featured dataset api has any info
1363
1407
  oldFeaturedDatasetApiHasInfo: async function() {
1364
- let r = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
1365
- return !r.identifiers || r.identifiers.length == 0 ? !1 : r.identifiers;
1408
+ let n = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
1409
+ return !n.identifiers || n.identifiers.length == 0 ? !1 : n.identifiers;
1366
1410
  },
1367
1411
  // Check if the new featured dataset api has any info
1368
1412
  newFeaturedDatasetApiHasInfo: async function() {
1369
- let r = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
1370
- return !r.datasets || r.datasets.length == 0 ? !1 : r.datasets.map((t) => t.id);
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);
1371
1415
  },
1372
- flatmapResourceSelected: function(e, r) {
1373
- var s;
1374
- this.resourceSelected(e, r);
1375
- const t = r[0], { eventType: n, feature: a } = t, { viewingMode: i } = this.settingsStore.globalSettings;
1376
- if (n === "click" && a.type === "feature" && ((s = a.models) != null && s.startsWith("ilxtr:"))) {
1377
- const l = [];
1378
- r.forEach((o) => {
1379
- const { models: c } = o.feature;
1380
- l.push(c);
1381
- }), b.sendEvent({
1416
+ flatmapResourceSelected: function(e, n) {
1417
+ 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({
1382
1426
  event: "interaction_event",
1383
1427
  event_name: "portal_maps_connectivity",
1384
- category: l.join(", "),
1428
+ category: s.join(", "),
1385
1429
  location: e + " " + i
1386
1430
  });
1387
1431
  }
@@ -1390,14 +1434,14 @@ const J = {
1390
1434
  * Get a list of featured datasets to display.
1391
1435
  */
1392
1436
  getFeaturedDatasets: async function() {
1393
- let e = [], r = await this.oldFeaturedDatasetApiHasInfo();
1394
- if (r) e = r;
1437
+ let e = [], n = await this.oldFeaturedDatasetApiHasInfo();
1438
+ if (n) e = n;
1395
1439
  else {
1396
- let t = await this.newFeaturedDatasetApiHasInfo();
1397
- t && (e = t);
1440
+ let r = await this.newFeaturedDatasetApiHasInfo();
1441
+ r && (e = r);
1398
1442
  }
1399
- this.settingsStore.updateFeatured(e), e.forEach((t) => {
1400
- this.getDatasetAnatomyInfo(t);
1443
+ this.settingsStore.updateFeatured(e), e.forEach((r) => {
1444
+ this.getDatasetAnatomyInfo(r);
1401
1445
  });
1402
1446
  },
1403
1447
  flatmapMarkerUpdate() {
@@ -1435,67 +1479,67 @@ const J = {
1435
1479
  checkEndHelpMouseDown: function(e) {
1436
1480
  e.target.closest(".help-mode-dialog") || this.endHelp();
1437
1481
  },
1438
- flatmapHighlight: async function(e, r, t, n) {
1439
- let a = [...r, ...n];
1482
+ flatmapHighlight: async function(e, n, r, t) {
1483
+ let a = [...n, ...t];
1440
1484
  const i = this.settingsStore.globalSettings;
1441
1485
  if (i.highlightConnectedPaths) {
1442
- const s = r.length ? r : n.length ? n : [], l = await e.retrieveConnectedPaths(s);
1443
- l && a.push(...l);
1486
+ const l = n.length ? n : t.length ? t : [], s = await e.retrieveConnectedPaths(l);
1487
+ s && a.push(...s);
1444
1488
  }
1445
1489
  if (i.highlightDOIPaths) {
1446
- const s = await e.searchConnectivitiesByReference(t);
1447
- s && a.push(...s);
1490
+ const l = await e.searchConnectivitiesByReference(r);
1491
+ l && a.push(...l);
1448
1492
  }
1449
1493
  return a = [...new Set(a)], a;
1450
1494
  },
1451
1495
  sidebarHoverHighlight: function(e) {
1452
- var r, t;
1496
+ var n, r;
1453
1497
  if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
1454
- const n = this.settingsStore.hoverAnatomies, a = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI, s = this.settingsStore.hoverConnectivity;
1455
- let l = null, o = null;
1456
- this.flatmapRef && (l = this.flatmapRef), this.multiflatmapRef && (l = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (o = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !a.length && !i && !s.length && ((this.multiflatmapRef || this.flatmapRef) && l ? l.mapImp && !l.mapImp.contextLost && ((r = l.mapImp) == null || r.clearSearchResults(), e.connectivityProcessed && ((t = l.mapImp) == null || t.setPaint({ dimmed: !0 }))) : this.scaffoldRef && o && o.changeHighlightedByName(a, "", !1)), this.highlightDelay = setTimeout(() => {
1457
- (n.length || a.length || i || s.length) && ((this.multiflatmapRef || this.flatmapRef) && l ? this.flatmapHighlight(l, n, i, s).then((c) => {
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) => {
1458
1502
  try {
1459
- l.showConnectivityTooltips({
1460
- connectivityInfo: { featureId: c },
1503
+ s.showConnectivityTooltips({
1504
+ connectivityInfo: { featureId: o },
1461
1505
  data: []
1462
1506
  });
1463
1507
  } catch (u) {
1464
- if (console.log(u), s.length && l.mapImp) {
1465
- const h = l.mapImp.uuid;
1466
- c.every(
1467
- (v) => this.connectivityKnowledge[h].some(
1468
- (p) => p.id === v
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
1469
1513
  )
1470
- ) || l.mapImp && !l.mapImp.contextLost && l.mapImp.clearSearchResults();
1514
+ ) || s.mapImp && !s.mapImp.contextLost && s.mapImp.clearSearchResults();
1471
1515
  }
1472
1516
  }
1473
- }) : this.scaffoldRef && o && o.changeHighlightedByName(a, "", !1));
1517
+ }) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1));
1474
1518
  }, 100);
1475
1519
  }
1476
1520
  },
1477
1521
  onAnnotationOpen: function(e) {
1478
- f.emit("annotation-open", e);
1522
+ m.emit("annotation-open", e);
1479
1523
  },
1480
1524
  onAnnotationClose: function() {
1481
- f.emit("sidebar-annotation-close");
1525
+ m.emit("sidebar-annotation-close");
1482
1526
  },
1483
1527
  updateOfflineAnnotationEnabled: function(e) {
1484
- f.emit("update-offline-annotation-enabled", e);
1528
+ m.emit("update-offline-annotation-enabled", e);
1485
1529
  },
1486
1530
  onConnectivityInfoOpen: function(e) {
1487
- f.emit("connectivity-info-open", e);
1531
+ m.emit("connectivity-info-open", e);
1488
1532
  },
1489
1533
  onConnectivityError: function(e) {
1490
- f.emit("connectivity-error", e);
1534
+ m.emit("connectivity-error", e);
1491
1535
  },
1492
1536
  onConnectivityInfoClose: function() {
1493
- f.emit("connectivity-info-close");
1537
+ m.emit("connectivity-info-close");
1494
1538
  },
1495
1539
  onSidebarAnnotationClose: function() {
1496
1540
  },
1497
1541
  onNeuronConnectionFeatureClick: function(e) {
1498
- f.emit("neuron-connection-feature-click", e);
1542
+ m.emit("neuron-connection-feature-click", e);
1499
1543
  },
1500
1544
  showConnectivity: function() {
1501
1545
  },
@@ -1507,115 +1551,115 @@ const J = {
1507
1551
  this.flatmapService = await this.mockUpFlatmapService(), this.loadConnectivityExplorerConfig(this.flatmapService);
1508
1552
  },
1509
1553
  mockUpFlatmapService: async function() {
1510
- const t = (await (await fetch(this.flatmapAPI)).json()).filter((u) => u.id === "human-flatmap_male").sort((u, h) => h.created.localeCompare(u.created))[0], n = t.uuid, a = t.sckan["knowledge-source"], s = await (await fetch(`${this.flatmapAPI}/flatmap/${n}/pathways`)).json();
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();
1511
1555
  this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
1512
- const l = {
1556
+ const s = {
1513
1557
  mapMetadata: {
1514
- uuid: n,
1558
+ uuid: t,
1515
1559
  connectivity: {
1516
- ...t.sckan
1560
+ ...r.sckan
1517
1561
  }
1518
1562
  },
1519
- pathways: s,
1563
+ pathways: l,
1520
1564
  resource: this.entry.resource,
1521
1565
  knowledgeSource: a,
1522
1566
  queryKnowledge: async (u) => {
1523
- const h = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", m = [a, u], v = await this.flatmapQueries.queryKnowledge(h, m);
1524
- return JSON.parse(v);
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);
1525
1569
  },
1526
1570
  queryLabels: async (u) => {
1527
- const h = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(u.length - 1)}) order by entity, source desc`, m = [a, ...u], v = await this.flatmapQueries.queryKnowledge(h, m), p = [];
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 = [];
1528
1572
  let g;
1529
- for (const F of v)
1573
+ for (const F of f)
1530
1574
  if (F[1] !== g) {
1531
- const _ = JSON.parse(F[2]);
1575
+ const C = JSON.parse(F[2]);
1532
1576
  p.push({
1533
1577
  entity: F[1],
1534
- label: _.label || F[1]
1578
+ label: C.label || F[1]
1535
1579
  }), g = F[1];
1536
1580
  }
1537
1581
  return p;
1538
1582
  }
1539
- }, o = H();
1583
+ }, h = $();
1540
1584
  return {
1541
1585
  mockup: !0,
1542
- getFilterOptions: async (u, h) => {
1543
- const v = await X(this.flatmapAPI, u, h, void 0);
1544
- return [...o, ...v];
1586
+ getFilterOptions: async (u, c) => {
1587
+ const f = await U(this.flatmapAPI, u, c, void 0);
1588
+ return [...h, ...f];
1545
1589
  },
1546
- getTermNerveMaps: $,
1547
- mapImp: l
1590
+ getTermNerveMaps: D,
1591
+ mapImp: s
1548
1592
  };
1549
1593
  },
1550
1594
  loadConnectivityExplorerConfig: async function(e) {
1551
1595
  var i;
1552
- const r = e.mapImp, t = w(r), n = e.mockup ? r.resource : r.uuid;
1596
+ const n = e.mapImp, r = w(n), t = e.mockup ? n.resource : n.uuid;
1553
1597
  let a = [];
1554
- if (!this.connectivityKnowledge[t]) {
1598
+ if (!this.connectivityKnowledge[r]) {
1555
1599
  this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
1556
- const s = await P(r, this.flatmapQueries);
1557
- this.connectivityKnowledge[t] = s.filter((l) => {
1558
- var o;
1559
- return (o = l.connectivity) == null ? void 0 : o.length;
1560
- }).sort((l, o) => l.label.localeCompare(o.label));
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));
1561
1605
  }
1562
- if (!this.connectivityKnowledge[n]) {
1563
- const s = ((i = r.pathways) == null ? void 0 : i.paths) || {};
1564
- this.connectivityKnowledge[n] = this.connectivityKnowledge[t].filter((l) => l.id in s);
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);
1565
1609
  }
1566
- if (!this.connectivityFilterOptions[n] && !e.mockup && (this.connectivityFilterOptions[n] = await e.getFilterOptions(r, this.connectivityKnowledge[n])), e.mockup) {
1567
- const s = e.getTermNerveMaps() || {}, l = JSON.parse(JSON.stringify(this.connectivityKnowledge[n]));
1568
- this.connectivityKnowledge[n] = l.map((c) => {
1569
- var h;
1570
- let u = c;
1571
- if ((h = c.nerves) != null && h.length) {
1572
- const v = c.nerves.flat(1 / 0).reduce((p, g) => (g in s && p.push(s[g]), p), []);
1573
- v != null && v.length && (a.push(...v), u["nerve-label"] = v.sort((p, g) => p.nerve.localeCompare(g.nerve)));
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)));
1574
1618
  }
1575
1619
  return u;
1576
- }).filter((c) => c["nerve-label"]), this.connectivityFilterOptions[n] || (this.connectivityFilterOptions[n] = await e.getFilterOptions(r, this.connectivityKnowledge[n])), a = a.map((c) => c.nerve.toLowerCase());
1577
- const o = JSON.parse(JSON.stringify(this.connectivityFilterOptions[n]));
1578
- this.connectivityFilterOptions[n] = o.map((c) => {
1579
- if (c.key === "scaffold.connectivity.nerve") {
1580
- const u = c.children.filter((h) => a.includes(h.label.toLowerCase()));
1581
- return { ...c, children: 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 };
1582
1626
  } else
1583
- return c;
1627
+ return o;
1584
1628
  });
1585
1629
  } else
1586
- this.connectivityFilterSources[n] || (this.connectivityFilterSources[n] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
1587
- this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), f.emit("species-layout-connectivity-update");
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");
1588
1632
  },
1589
1633
  knowledgeTooltipQuery: async function(e) {
1590
1634
  await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp, { resource: [e.id] });
1591
- let r = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
1635
+ let n = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
1592
1636
  resource: [e.id],
1593
1637
  label: e.label,
1594
1638
  provenanceTaxonomy: e.taxons,
1595
1639
  feature: []
1596
1640
  });
1597
- return r.knowledgeSource = w(this.flatmapService.mapImp), r.mapId = this.flatmapService.mapImp.mapMetadata.id, r.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, r["nerve-label"] = e["nerve-label"], r.ready = !0, r;
1641
+ return n.knowledgeSource = w(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;
1598
1642
  },
1599
1643
  getKnowledgeTooltip: async function(e) {
1600
- this.tooltipEntry = [], e.data.forEach((n) => this.tooltipEntry.push({ title: n.label, featureId: [n.id], ready: !1 })), f.emit("connectivity-info-open", this.tooltipEntry);
1601
- let r = [];
1602
- for (let n = 0; n < e.data.length; n++)
1603
- r.push(await this.knowledgeTooltipQuery(e.data[n]));
1604
- this.tooltipEntry = await Promise.all(r), this.tooltipEntry.map((n) => n.featureId[0]).length > 0 && f.emit("connectivity-info-open", this.tooltipEntry);
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);
1605
1649
  },
1606
- changeConnectivitySource: async function(e, r) {
1607
- var i, s;
1608
- const { entry: t, connectivitySource: n } = e, a = (s = (i = this == null ? void 0 : this.flatmapService) == null ? void 0 : i.mapImp) == null ? void 0 : s.mapMetadata.uuid;
1609
- r.includes(a) || (r.push(a), await this.flatmapQueries.queryForConnectivityNew(this.flatmapService.mapImp, t.featureId[0], n), this.tooltipEntry = this.tooltipEntry.map((l) => l.featureId[0] === t.featureId[0] ? this.flatmapQueries.updateTooltipData(l) : l), f.emit("connectivity-info-open", this.tooltipEntry));
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));
1610
1654
  },
1611
1655
  trackEvent: function(e) {
1612
- b.sendEvent(e);
1656
+ M.sendEvent(e);
1613
1657
  }
1614
1658
  },
1615
1659
  data: function() {
1616
1660
  return {
1617
1661
  apiLocation: void 0,
1618
- activeSpecies: B,
1662
+ activeSpecies: X,
1619
1663
  scaffoldCamera: void 0,
1620
1664
  mainStyle: {
1621
1665
  height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
@@ -1651,5 +1695,5 @@ const J = {
1651
1695
  }
1652
1696
  };
1653
1697
  export {
1654
- J as C
1698
+ K as C
1655
1699
  };