@abi-software/mapintegratedvuer 1.10.2-beta.0 → 1.10.2

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,20 +1,20 @@
1
1
  import { markRaw as F } from "vue";
2
- import { u as C, c as I, d as A, E as f, a as M, g as S, e as $, f as H, l as N } from "./index-Dm85KBw6.js";
3
- import { mapStores as L } from "pinia";
4
- const d = function(e) {
5
- return e ? [...new Set(e.map((t) => JSON.stringify(t)))].map(
6
- (t) => JSON.parse(t)
2
+ import { u as C, c as I, d as A, a as h, T as M, g as S, e as $, f as H, l as L } from "./index-DL73mn-k.js";
3
+ import { mapStores as N } from "pinia";
4
+ const d = function(t) {
5
+ return t ? [...new Set(t.map((e) => JSON.stringify(e)))].map(
6
+ (e) => JSON.parse(e)
7
7
  ) : [];
8
- }, m = [], v = async function(e, t) {
9
- const i = t.filter(
8
+ }, m = [], v = async function(t, e) {
9
+ const i = e.filter(
10
10
  (o) => m.some((a) => a.taxon === o)
11
11
  ), n = m.filter(
12
12
  (o) => i.includes(o.taxon)
13
- ), s = t.filter(
13
+ ), s = e.filter(
14
14
  (o) => !i.includes(o)
15
15
  );
16
16
  if (s.length) {
17
- const o = await e.queryLabels(s);
17
+ const o = await t.queryLabels(s);
18
18
  if (o.length)
19
19
  return o.forEach((a) => {
20
20
  let { entity: r, label: l } = a;
@@ -24,25 +24,25 @@ const d = function(e) {
24
24
  }), n;
25
25
  } else
26
26
  return n;
27
- }, g = function(e, t) {
28
- if (!e || !t) return !1;
29
- let i = JSON.stringify(e), n = JSON.stringify(t);
27
+ }, g = function(t, e) {
28
+ if (!t || !e) return !1;
29
+ let i = JSON.stringify(t), n = JSON.stringify(e);
30
30
  return i.indexOf(n) !== -1;
31
- }, p = (e, t) => {
32
- const i = e.name ?? e, n = t.name ?? t, s = i.toUpperCase(), o = n.toUpperCase();
31
+ }, p = (t, e) => {
32
+ const i = t.name ?? t, n = e.name ?? e, s = i.toUpperCase(), o = n.toUpperCase();
33
33
  return s < o ? -1 : s > o ? 1 : 0;
34
34
  };
35
35
  let P = function() {
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 = "sckan";
38
- }, this.createTooltipData = async function(e, t) {
36
+ this.initialise = function(t) {
37
+ this.flatmapAPI = t, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "sckan";
38
+ }, this.createTooltipData = async function(t, e) {
39
39
  let i = [];
40
- t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? i = t.feature.hyperlinks : i = this.rawURLs;
40
+ e.feature.hyperlinks && e.feature.hyperlinks.length > 0 ? i = e.feature.hyperlinks : i = this.rawURLs;
41
41
  let n;
42
- if (t.provenanceTaxonomy) {
42
+ if (e.provenanceTaxonomy) {
43
43
  n = [];
44
44
  try {
45
- const o = await v(e, t.provenanceTaxonomy);
45
+ const o = await v(t, e.provenanceTaxonomy);
46
46
  o.length && o.forEach((a) => {
47
47
  const { label: r } = a;
48
48
  n.push(r);
@@ -58,16 +58,16 @@ let P = function() {
58
58
  destinationsWithDatasets: this.destinationsWithDatasets,
59
59
  originsWithDatasets: this.originsWithDatasets,
60
60
  componentsWithDatasets: this.componentsWithDatasets,
61
- title: t.label,
62
- featureId: t.resource,
61
+ title: e.label,
62
+ featureId: e.resource,
63
63
  hyperlinks: i,
64
- provenanceTaxonomy: t.provenanceTaxonomy,
64
+ provenanceTaxonomy: e.provenanceTaxonomy,
65
65
  provenanceTaxonomyLabel: n,
66
66
  connectivitySource: this.connectivitySource
67
67
  };
68
- }, this.updateTooltipData = function(e) {
68
+ }, this.updateTooltipData = function(t) {
69
69
  return {
70
- ...e,
70
+ ...t,
71
71
  origins: this.origins,
72
72
  originsWithDatasets: this.originsWithDatasets,
73
73
  components: this.components,
@@ -76,16 +76,16 @@ let P = function() {
76
76
  destinationsWithDatasets: this.destinationsWithDatasets,
77
77
  connectivitySource: this.connectivitySource
78
78
  };
79
- }, this.createComponentsLabelList = function(e, t) {
79
+ }, this.createComponentsLabelList = function(t, e) {
80
80
  let i = [];
81
- return e.forEach((n) => {
82
- i.push(this.createLabelFromNeuralNode(n[0]), t), n.length === 2 && i.push(this.createLabelFromNeuralNode(n[1]), t);
81
+ return t.forEach((n) => {
82
+ i.push(this.createLabelFromNeuralNode(n[0]), e), n.length === 2 && i.push(this.createLabelFromNeuralNode(n[1]), e);
83
83
  }), i;
84
- }, this.createLabelLookup = function(e, t) {
84
+ }, this.createLabelLookup = function(t, e) {
85
85
  return new Promise(async (i) => {
86
86
  let n = {};
87
87
  this.uberons = [];
88
- const s = await v(e, t);
88
+ const s = await v(t, e);
89
89
  s.length && (s.forEach((o) => {
90
90
  const { taxon: a, label: r } = o;
91
91
  n[a] = r, this.uberons.push({
@@ -94,59 +94,59 @@ let P = function() {
94
94
  });
95
95
  }), i(n));
96
96
  });
97
- }, this.buildConnectivitySqlStatement = function(e) {
98
- let t = "select knowledge from knowledge where entity in (";
99
- if (e.length === 1)
100
- t += `'${e[0]}')`;
101
- else if (e.length > 1)
102
- for (let i in e)
103
- t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
104
- return t;
105
- }, this.buildLabelSqlStatement = function(e) {
106
- let t = "select entity, label from labels where entity in (";
107
- if (e.length === 1)
108
- t += `'${e[0]}')`;
109
- else if (e.length > 1)
110
- for (let i in e)
111
- t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
112
- return t;
113
- }, this.findAllIdsFromConnectivity = function(e) {
114
- let t = e.connectivity.flat(), i = [...new Set(t)], n = [];
97
+ }, this.buildConnectivitySqlStatement = function(t) {
98
+ let e = "select knowledge from knowledge where entity in (";
99
+ if (t.length === 1)
100
+ e += `'${t[0]}')`;
101
+ else if (t.length > 1)
102
+ for (let i in t)
103
+ e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
104
+ return e;
105
+ }, this.buildLabelSqlStatement = function(t) {
106
+ let e = "select entity, label from labels where entity in (";
107
+ if (t.length === 1)
108
+ e += `'${t[0]}')`;
109
+ else if (t.length > 1)
110
+ for (let i in t)
111
+ e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
112
+ return e;
113
+ }, this.findAllIdsFromConnectivity = function(t) {
114
+ let e = t.connectivity.flat(), i = [...new Set(e)], n = [];
115
115
  return i.forEach((s) => {
116
116
  Array.isArray(s) ? n.push(s.flat()) : n.push(s);
117
117
  }), [...new Set(n.flat())];
118
- }, this.flattenConnectivity = function(e) {
119
- let t = e.flat(), i = [...new Set(t)], n = [];
118
+ }, this.flattenConnectivity = function(t) {
119
+ let e = t.flat(), i = [...new Set(e)], n = [];
120
120
  return i.forEach((s) => {
121
121
  Array.isArray(s) ? n.push(s.flat()) : n.push(s);
122
122
  }), n.flat();
123
- }, this.findComponents = function(e, t, i, n) {
124
- let s = e.connectivity.flat(), o = d(s), a = [], r = !1;
123
+ }, this.findComponents = function(t, e, i, n) {
124
+ let s = t.connectivity.flat(), o = d(s), a = [], r = !1;
125
125
  return o.forEach((l) => {
126
- r = !1, g(t, l) && (r = !0), n && g(n, l) && (r = !0), g(i, l) && (r = !0), r || a.push(l);
126
+ r = !1, g(e, l) && (r = !0), n && g(n, l) && (r = !0), g(i, l) && (r = !0), r || a.push(l);
127
127
  }), a;
128
- }, this.retrieveFlatmapKnowledgeForEvent = async function(e, t) {
128
+ }, this.retrieveFlatmapKnowledgeForEvent = async function(t, e) {
129
129
  this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
130
- const i = t.resource;
130
+ const i = e.resource;
131
131
  if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !i || i.length === 0 || !i[0]) return;
132
- let n = this.queryForConnectivityNew(e, i[0]);
132
+ let n = this.queryForConnectivityNew(t, i[0]);
133
133
  return await Promise.all([n]);
134
- }, this.queryForConnectivityNew = function(e, t, i = "sckan", n = !0) {
134
+ }, this.queryForConnectivityNew = function(t, e, i = "sckan", n = !0) {
135
135
  return this.connectivitySource = i, new Promise((s) => {
136
- (i === "map" ? this.queryMapConnectivity(e.provenance.uuid, t) : e.queryKnowledge(t)).then((a) => {
136
+ (i === "map" ? this.queryMapConnectivity(t.provenance.uuid, e) : t.queryKnowledge(e)).then((a) => {
137
137
  if (this.checkConnectivityExists(a)) {
138
138
  let r = a;
139
- n ? this.processConnectivity(e, r).then((l) => {
139
+ n ? this.processConnectivity(t, r).then((l) => {
140
140
  a.references && (this.rawURLs = [...a.references]), s(l);
141
141
  }) : s(r);
142
142
  } else
143
143
  s(!1);
144
144
  }).catch((a) => {
145
- a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${t}.`), s(!1);
145
+ a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${e}.`), s(!1);
146
146
  });
147
147
  });
148
- }, this.queryMapConnectivity = async function(e, t) {
149
- const i = this.flatmapAPI + `flatmap/${e}/connectivity/${t}`;
148
+ }, this.queryMapConnectivity = async function(t, e) {
149
+ const i = this.flatmapAPI + `flatmap/${t}/connectivity/${e}`;
150
150
  try {
151
151
  const n = await fetch(i);
152
152
  if (!n.ok)
@@ -155,8 +155,8 @@ let P = function() {
155
155
  } catch (n) {
156
156
  throw new Error(n);
157
157
  }
158
- }, this.queryForConnectivity = function(e, t, i, n = !0) {
159
- const s = { sql: this.buildConnectivitySqlStatement(t) }, o = {
158
+ }, this.queryForConnectivity = function(t, e, i, n = !0) {
159
+ const s = { sql: this.buildConnectivitySqlStatement(e) }, o = {
160
160
  method: "POST",
161
161
  headers: {
162
162
  "Content-Type": "application/json"
@@ -169,7 +169,7 @@ let P = function() {
169
169
  fetch(`${this.flatmapAPI}knowledge/query/`, o).then((r) => r.json()).then((r) => {
170
170
  if (this.connectivityExists(r)) {
171
171
  let l = JSON.parse(r.values[0][0]);
172
- n ? this.processConnectivity(e, l).then((c) => {
172
+ n ? this.processConnectivity(t, l).then((c) => {
173
173
  a(c);
174
174
  }) : a(l);
175
175
  } else
@@ -178,23 +178,23 @@ let P = function() {
178
178
  r.name === "AbortError" || console.error("Error:", r), a(!1);
179
179
  });
180
180
  });
181
- }, this.checkConnectivityExists = function(e) {
182
- var t;
183
- return e && ((t = e.connectivity) == null ? void 0 : t.length);
184
- }, this.connectivityExists = function(e) {
185
- return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
186
- }, this.findIfNodeIsSingle = function(e) {
187
- return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
188
- }, this.createLabelFromNeuralNode = function(e, t) {
189
- let i = this.findIfNodeIsSingle(e);
181
+ }, this.checkConnectivityExists = function(t) {
182
+ var e;
183
+ return t && ((e = t.connectivity) == null ? void 0 : e.length);
184
+ }, this.connectivityExists = function(t) {
185
+ return !!(t.values && t.values.length > 0 && JSON.parse(t.values[0][0]).connectivity && JSON.parse(t.values[0][0]).connectivity.length > 0);
186
+ }, this.findIfNodeIsSingle = function(t) {
187
+ return t.length === 1 ? (console.error("Server returns a single node", t), t[0]) : t.length === 2 && t[1].length === 0 ? t[0] : !1;
188
+ }, this.createLabelFromNeuralNode = function(t, e) {
189
+ let i = this.findIfNodeIsSingle(t);
190
190
  if (i)
191
- return t[i];
192
- let n = t[e[0]];
193
- return e.length === 2 && e[1].length > 0 && e[1].forEach((s) => {
194
- t[s] == null ? n += `, ${s}` : n += `, ${t[s]}`;
191
+ return e[i];
192
+ let n = e[t[0]];
193
+ return t.length === 2 && t[1].length > 0 && t[1].forEach((s) => {
194
+ e[s] == null ? n += `, ${s}` : n += `, ${e[s]}`;
195
195
  }), n;
196
- }, this.flattenAndFindDatasets = function(e, t, i) {
197
- let n = this.flattenConnectivity(e), s = this.flattenConnectivity(t), o = this.flattenConnectivity(i);
196
+ }, this.flattenAndFindDatasets = function(t, e, i) {
197
+ let n = this.flattenConnectivity(t), s = this.flattenConnectivity(e), o = this.flattenConnectivity(i);
198
198
  this.originsWithDatasets = this.uberons.filter(
199
199
  (a) => n.indexOf(a.id) !== -1
200
200
  ).sort(p), this.componentsWithDatasets = this.uberons.filter(
@@ -202,20 +202,20 @@ let P = function() {
202
202
  ).sort(p), this.destinationsWithDatasets = this.uberons.filter(
203
203
  (a) => o.indexOf(a.id) !== -1
204
204
  ).sort(p);
205
- }, this.processConnectivity = function(e, t) {
205
+ }, this.processConnectivity = function(t, e) {
206
206
  return new Promise((i) => {
207
207
  let n = [], s = [], o;
208
- if (t && t["node-phenotypes"]) {
208
+ if (e && e["node-phenotypes"]) {
209
209
  const l = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
210
- l.forEach((h) => {
211
- h in t["node-phenotypes"] && n.push(...t["node-phenotypes"][h]);
212
- }), n = d(n), c.forEach((h) => {
213
- h in t["node-phenotypes"] && s.push(...t["node-phenotypes"][h]);
210
+ l.forEach((f) => {
211
+ f in e["node-phenotypes"] && n.push(...e["node-phenotypes"][f]);
212
+ }), n = d(n), c.forEach((f) => {
213
+ f in e["node-phenotypes"] && s.push(...e["node-phenotypes"][f]);
214
214
  }), s = d(s);
215
215
  } else
216
- s = d(t.axons), t.somas && t.somas.length > 0 && n.push(...t.somas), t.dendrites && t.dendrites.length > 0 && n.push(...t.dendrites), n = d(n), o = t.somas;
217
- const a = this.findComponents(t, s, n, o), r = this.findAllIdsFromConnectivity(t);
218
- this.createLabelLookup(e, r).then((l) => {
216
+ s = d(e.axons), e.somas && e.somas.length > 0 && n.push(...e.somas), e.dendrites && e.dendrites.length > 0 && n.push(...e.dendrites), n = d(n), o = e.somas;
217
+ const a = this.findComponents(e, s, n, o), r = this.findAllIdsFromConnectivity(e);
218
+ this.createLabelLookup(t, r).then((l) => {
219
219
  this.origins = n.map(
220
220
  (c) => this.createLabelFromNeuralNode(c, l)
221
221
  ).sort(p), this.components = a.map(
@@ -236,31 +236,31 @@ let P = function() {
236
236
  });
237
237
  });
238
238
  });
239
- }, this.buildPubmedSqlStatement = function(e) {
240
- let t = "select distinct publication from publications where entity in (";
241
- if (e.length === 1)
242
- t += `'${e[0]}')`;
243
- else if (e.length > 1)
244
- for (let i in e)
245
- t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
246
- return t;
247
- }, this.buildPubmedSqlStatementForModels = function(e) {
248
- return `select distinct publication from publications where entity = '${e}'`;
249
- }, this.flatmapQuery = function(e) {
250
- const t = { sql: e };
239
+ }, this.buildPubmedSqlStatement = function(t) {
240
+ let e = "select distinct publication from publications where entity in (";
241
+ if (t.length === 1)
242
+ e += `'${t[0]}')`;
243
+ else if (t.length > 1)
244
+ for (let i in t)
245
+ e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
246
+ return e;
247
+ }, this.buildPubmedSqlStatementForModels = function(t) {
248
+ return `select distinct publication from publications where entity = '${t}'`;
249
+ }, this.flatmapQuery = function(t) {
250
+ const e = { sql: t };
251
251
  return fetch(`${this.flatmapAPI}knowledge/query/`, {
252
252
  method: "POST",
253
253
  headers: {
254
254
  "Content-Type": "application/json"
255
255
  },
256
- body: JSON.stringify(t)
256
+ body: JSON.stringify(e)
257
257
  }).then((i) => i.json()).catch((i) => {
258
258
  console.error("Error:", i);
259
259
  });
260
260
  };
261
261
  };
262
- function T(e) {
263
- return e[0].toUpperCase() + e.substring(1);
262
+ function T(t) {
263
+ return t[0].toUpperCase() + t.substring(1);
264
264
  }
265
265
  const O = {
266
266
  emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
@@ -281,7 +281,7 @@ const O = {
281
281
  },
282
282
  inject: ["showGlobalSettings", "showOpenMapButton"],
283
283
  computed: {
284
- ...L(C, I, A),
284
+ ...N(C, I, A),
285
285
  idNamePair() {
286
286
  return this.splitFlowStore.idNamePair;
287
287
  },
@@ -309,25 +309,25 @@ const O = {
309
309
  onConnectivityItemClose() {
310
310
  if (this != null && this.alive) {
311
311
  if (this.multiflatmapRef) {
312
- const e = this.multiflatmapRef.getCurrentFlatmap();
313
- e && e.closeTooltip();
312
+ const t = this.multiflatmapRef.getCurrentFlatmap();
313
+ t && t.closeTooltip();
314
314
  }
315
315
  this.flatmapRef && this.flatmapRef.closeTooltip();
316
316
  }
317
317
  },
318
318
  getState: function() {
319
319
  },
320
- openMap: function(e) {
321
- f.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
320
+ openMap: function(t) {
321
+ h.emit("OpenNewMap", t), this.trackOpenMap(`open_new_${t}_map`);
322
322
  },
323
- onMapmanagerLoaded: function(e) {
324
- this.settingsStore.updateMapManager(e);
323
+ onMapmanagerLoaded: function(t) {
324
+ this.settingsStore.updateMapManager(t);
325
325
  },
326
- trackOpenMap: function(e) {
326
+ trackOpenMap: function(t) {
327
327
  M.sendEvent({
328
328
  event: "interaction_event",
329
329
  event_name: "portal_maps_open_map",
330
- category: e,
330
+ category: t,
331
331
  location: "open_new_map"
332
332
  });
333
333
  },
@@ -347,25 +347,25 @@ const O = {
347
347
  /**
348
348
  * Callback when the vuers emit a selected event.
349
349
  */
350
- resourceSelected: function(e, t) {
350
+ resourceSelected: function(t, e) {
351
351
  var a, r, l, c;
352
- const i = t[0];
352
+ const i = e[0];
353
353
  if (this.resourceHasAction(i)) {
354
- f.emit("PopoverActionClick", i);
354
+ h.emit("PopoverActionClick", i);
355
355
  return;
356
356
  }
357
357
  let n, s = !1;
358
358
  const o = {
359
359
  paneIndex: this.entry.id,
360
- type: e,
361
- resource: t,
360
+ type: t,
361
+ resource: e,
362
362
  internalName: void 0,
363
363
  eventType: void 0
364
364
  };
365
- if (e == "MultiFlatmap" || e == "Flatmap")
365
+ if (t == "MultiFlatmap" || t == "Flatmap")
366
366
  if (o.internalName = (a = i == null ? void 0 : i.feature) != null && a.label ? i.feature.label : this.idNamePair[i.feature.models], i.eventType == "click") {
367
367
  if (o.eventType = "selected", i.feature.type == "marker") {
368
- let h = o.internalName;
368
+ let f = o.internalName;
369
369
  if (this.settingsStore.isFeaturedMarkerIdentifier(i.feature.id))
370
370
  n = {
371
371
  type: "Search",
@@ -375,7 +375,7 @@ const O = {
375
375
  else {
376
376
  n = {
377
377
  type: "Facet",
378
- facet: h,
378
+ facet: f,
379
379
  facetPropPath: "anatomy.organ.category.name",
380
380
  facetSubPropPath: "anatomy.organ.name",
381
381
  term: "Anatomical structure"
@@ -383,24 +383,24 @@ const O = {
383
383
  let u = /* @__PURE__ */ new Set();
384
384
  i.feature["marker-terms"].forEach((y) => {
385
385
  u.add(y.label);
386
- }), u.add(h), u.size > 0 && (n = {
386
+ }), u.add(f), u.size > 0 && (n = {
387
387
  type: "Facets",
388
388
  labels: [...u]
389
389
  });
390
390
  }
391
- s = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
391
+ s = !0, t == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
392
392
  }
393
393
  } else i.eventType == "mouseenter" && (o.eventType = "highlighted", s = !0);
394
- else e == "Scaffold" && (i && ((((r = i.data) == null ? void 0 : r.id) === void 0 || ((l = i.data) == null ? void 0 : l.id) === "") && (i.data.id = (c = i.data) == null ? void 0 : c.group), o.internalName = i.data.id, i.data.lastActionOnMarker === !0 && (n = {
394
+ else t == "Scaffold" && (i && ((((r = i.data) == null ? void 0 : r.id) === void 0 || ((l = i.data) == null ? void 0 : l.id) === "") && (i.data.id = (c = i.data) == null ? void 0 : c.group), o.internalName = i.data.id, i.data.lastActionOnMarker === !0 && (n = {
395
395
  type: "Facet",
396
396
  facet: T(i.data.id),
397
397
  facetPropPath: "anatomy.organ.category.name",
398
398
  term: "Anatomical structure"
399
399
  })), o.eventType = "selected", s = !0);
400
- n && f.emit("PopoverActionClick", n), s && this.$emit("resource-selected", o);
400
+ n && h.emit("PopoverActionClick", n), s && this.$emit("resource-selected", o);
401
401
  },
402
- resourceHasAction: function(e) {
403
- return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
402
+ resourceHasAction: function(t) {
403
+ return t && (t.type === "URL" || t.type === "Search" || t.type === "Neuron Search" || t.type == "Facet" || t.type == "Facets");
404
404
  },
405
405
  /**
406
406
  * Check if this viewer is currently visible
@@ -415,39 +415,39 @@ const O = {
415
415
  * if it cannot be found in the map, it will perform several
416
416
  * calls to try to ge a valid name/id.
417
417
  */
418
- getNameAndIdFromSyncData: async function(e) {
419
- let t = e.internalName;
420
- t === void 0 && e.resource && (t = e.resource.label);
418
+ getNameAndIdFromSyncData: async function(t) {
419
+ let e = t.internalName;
420
+ e === void 0 && t.resource && (e = t.resource.label);
421
421
  let i;
422
- if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
423
- if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
424
- if (e.resource && e.resource.feature) {
425
- const o = S(e.resource.feature.models);
422
+ if (t.resource && t.resource.resource && (i = t.resource.resource[0]), this.entry.type === "Scaffold") {
423
+ if (this.$refs.scaffold.findObjectsWithGroupName(e).length === 0) {
424
+ if (t.resource && t.resource.feature) {
425
+ const o = S(t.resource.feature.models);
426
426
  if (o.length > 0) return o;
427
427
  }
428
- let s = $(t);
428
+ let s = $(e);
429
429
  if (s)
430
430
  return s;
431
- if (i && e.eventType === "selected")
431
+ if (i && t.eventType === "selected")
432
432
  return fetch(`${this.apiLocation}get-related-terms/${i}`).then((o) => o.json()).then((o) => {
433
433
  var a;
434
434
  if (((a = o.uberon) == null ? void 0 : a.array.length) > 0)
435
- return t = o.uberon.array[0].name.charAt(0).toUpperCase() + o.uberon.array[0].name.slice(1), i = o.uberon.array[0].id.toUpperCase(), { id: i, name: t };
435
+ return e = o.uberon.array[0].name.charAt(0).toUpperCase() + o.uberon.array[0].name.slice(1), i = o.uberon.array[0].id.toUpperCase(), { id: i, name: e };
436
436
  });
437
437
  }
438
438
  } else if (this.entry.type === "MultiFlatmap")
439
- if (t === "Bladder")
440
- t = "Urinary Bladder";
439
+ if (e === "Bladder")
440
+ e = "Urinary Bladder";
441
441
  else {
442
- const n = S(t);
443
- n.length > 0 && (t = n[0]);
442
+ const n = S(e);
443
+ n.length > 0 && (e = n[0]);
444
444
  }
445
- return { id: i, name: t };
445
+ return { id: i, name: e };
446
446
  },
447
447
  // Get the species and andaotmy info for the featured datasets
448
- getDatasetAnatomyInfo: function(e) {
449
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
450
- const i = t.result[0];
448
+ getDatasetAnatomyInfo: function(t) {
449
+ fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${t}`).then((e) => e.json()).then((e) => {
450
+ const i = e.result[0];
451
451
  let n;
452
452
  try {
453
453
  n = i.anatomy.organ[0].curie;
@@ -471,7 +471,7 @@ const O = {
471
471
  o = void 0;
472
472
  }
473
473
  this.settingsStore.updateFeaturedMarker({
474
- identifier: e,
474
+ identifier: t,
475
475
  marker: n,
476
476
  doi: s,
477
477
  species: o
@@ -480,25 +480,25 @@ const O = {
480
480
  },
481
481
  // Check if the old featured dataset api has any info
482
482
  oldFeaturedDatasetApiHasInfo: async function() {
483
- let t = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
484
- return !t.identifiers || t.identifiers.length == 0 ? !1 : t.identifiers;
483
+ let e = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
484
+ return !e.identifiers || e.identifiers.length == 0 ? !1 : e.identifiers;
485
485
  },
486
486
  // Check if the new featured dataset api has any info
487
487
  newFeaturedDatasetApiHasInfo: async function() {
488
- let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
489
- return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
488
+ let e = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
489
+ return !e.datasets || e.datasets.length == 0 ? !1 : e.datasets.map((i) => i.id);
490
490
  },
491
491
  /**
492
492
  * Get a list of featured datasets to display.
493
493
  */
494
494
  getFeaturedDatasets: async function() {
495
- let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
496
- if (t) e = t;
495
+ let t = [], e = await this.oldFeaturedDatasetApiHasInfo();
496
+ if (e) t = e;
497
497
  else {
498
498
  let i = await this.newFeaturedDatasetApiHasInfo();
499
- i && (e = i);
499
+ i && (t = i);
500
500
  }
501
- this.settingsStore.updateFeatured(e), e.forEach((i) => {
501
+ this.settingsStore.updateFeatured(t), t.forEach((i) => {
502
502
  this.getDatasetAnatomyInfo(i);
503
503
  });
504
504
  },
@@ -523,8 +523,8 @@ const O = {
523
523
  onHelpModeShowNext: function() {
524
524
  this.helpModeActiveItem += 1;
525
525
  },
526
- onHelpModeLastItem: function(e) {
527
- e && (this.helpModeLastItem = !0);
526
+ onHelpModeLastItem: function(t) {
527
+ t && (this.helpModeLastItem = !0);
528
528
  },
529
529
  onFinishHelpMode: function() {
530
530
  this.helpMode = !1, this.helpModeActiveItem = 0, this.helpModeLastItem = !1;
@@ -538,36 +538,36 @@ const O = {
538
538
  /**
539
539
  * End help-mode only if user clicks outside of help mode dialog.
540
540
  */
541
- checkEndHelpMouseDown: function(e) {
542
- e.target.closest(".help-mode-dialog") || this.endHelp();
541
+ checkEndHelpMouseDown: function(t) {
542
+ t.target.closest(".help-mode-dialog") || this.endHelp();
543
543
  },
544
- flatmapHighlight: async function(e, t, i, n) {
545
- let s = [...t, ...n];
544
+ flatmapHighlight: async function(t, e, i, n) {
545
+ let s = [...e, ...n];
546
546
  const o = this.settingsStore.globalSettings;
547
547
  if (o.highlightConnectedPaths) {
548
- const a = t.length ? t : n.length ? n : [], r = await e.retrieveConnectedPaths(a);
548
+ const a = e.length ? e : n.length ? n : [], r = await t.retrieveConnectedPaths(a);
549
549
  r && s.push(...r);
550
550
  }
551
551
  if (o.highlightDOIPaths) {
552
- const a = await e.searchConnectivitiesByReference(i);
552
+ const a = await t.searchConnectivitiesByReference(i);
553
553
  a && s.push(...a);
554
554
  }
555
555
  return s = [...new Set(s)], s;
556
556
  },
557
- sidebarHoverHighlight: function(e) {
558
- var t, i;
557
+ sidebarHoverHighlight: function(t) {
558
+ var e, i;
559
559
  if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
560
560
  const n = this.settingsStore.hoverAnatomies, s = this.settingsStore.hoverOrgans, o = this.settingsStore.hoverDOI, a = this.settingsStore.hoverConnectivity;
561
561
  let r = null, l = null;
562
- this.flatmapRef && (r = this.flatmapRef), this.multiflatmapRef && (r = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (l = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !s.length && !o && !a.length && ((this.multiflatmapRef || this.flatmapRef) && r ? ((t = r.mapImp) == null || t.clearSearchResults(), e.connectivityProcessed && ((i = r.mapImp) == null || i.setPaint({ dimmed: !0 }))) : this.scaffoldRef && l && l.changeHighlightedByName(s, "", !1)), this.highlightDelay = setTimeout(() => {
562
+ this.flatmapRef && (r = this.flatmapRef), this.multiflatmapRef && (r = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (l = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !s.length && !o && !a.length && ((this.multiflatmapRef || this.flatmapRef) && r ? ((e = r.mapImp) == null || e.clearSearchResults(), t.connectivityProcessed && ((i = r.mapImp) == null || i.setPaint({ dimmed: !0 }))) : this.scaffoldRef && l && l.changeHighlightedByName(s, "", !1)), this.highlightDelay = setTimeout(() => {
563
563
  (n.length || s.length || o || a.length) && ((this.multiflatmapRef || this.flatmapRef) && r ? this.flatmapHighlight(r, n, o, a).then((c) => {
564
564
  try {
565
565
  r.showConnectivityTooltips({
566
566
  connectivityInfo: { featureId: c },
567
567
  data: []
568
568
  });
569
- } catch (h) {
570
- if (console.log(h), a.length && r.mapImp) {
569
+ } catch (f) {
570
+ if (console.log(f), a.length && r.mapImp) {
571
571
  const u = r.mapImp.uuid;
572
572
  c.every(
573
573
  (w) => this.connectivityKnowledge[u].some(
@@ -580,33 +580,27 @@ const O = {
580
580
  }, 100);
581
581
  }
582
582
  },
583
- onAnnotationOpen: function(e) {
584
- f.emit("annotation-open", e);
583
+ onAnnotationOpen: function(t) {
584
+ h.emit("annotation-open", t);
585
585
  },
586
586
  onAnnotationClose: function() {
587
- f.emit("sidebar-annotation-close");
587
+ h.emit("sidebar-annotation-close");
588
588
  },
589
- updateOfflineAnnotationEnabled: function(e) {
590
- f.emit("update-offline-annotation-enabled", e);
589
+ updateOfflineAnnotationEnabled: function(t) {
590
+ h.emit("update-offline-annotation-enabled", t);
591
591
  },
592
- onConnectivityInfoOpen: function(e) {
593
- f.emit("connectivity-info-open", e);
592
+ onConnectivityInfoOpen: function(t) {
593
+ h.emit("connectivity-info-open", t);
594
594
  },
595
- onConnectivityError: function(e) {
596
- f.emit("connectivity-error", e);
595
+ onConnectivityError: function(t) {
596
+ h.emit("connectivity-error", t);
597
597
  },
598
598
  onConnectivityInfoClose: function() {
599
- f.emit("connectivity-info-close");
599
+ h.emit("connectivity-info-close");
600
600
  },
601
601
  onSidebarAnnotationClose: function() {
602
602
  },
603
- onNeuronConnectionClick: function(e) {
604
- f.emit("neuron-connection-click", e);
605
- },
606
- onNeuronConnectionFeatureClick: function(e) {
607
- f.emit("neuron-connection-feature-click", e);
608
- },
609
- showConnectivity: function(e) {
603
+ showConnectivity: function() {
610
604
  },
611
605
  showConnectivitiesByReference: function() {
612
606
  },
@@ -616,10 +610,10 @@ const O = {
616
610
  },
617
611
  setVisibilityFilter: function() {
618
612
  },
619
- loadConnectivityExplorerConfig: async function(e) {
620
- const t = e.mapImp, i = H(t), n = F(new P());
613
+ loadConnectivityExplorerConfig: async function(t) {
614
+ const e = t.mapImp, i = H(e), n = F(new P());
621
615
  n.initialise(this.flatmapAPI);
622
- const s = await N(t, n), o = t.uuid, a = t.pathways;
616
+ const s = await L(e, n), o = e.uuid, a = e.pathways;
623
617
  if (this.connectivityKnowledge[i] || (this.connectivityKnowledge[i] = s.filter((r) => {
624
618
  var l;
625
619
  return r.source === i && ((l = r.connectivity) == null ? void 0 : l.length);
@@ -627,7 +621,7 @@ const O = {
627
621
  const r = a ? a.paths : {};
628
622
  this.connectivityKnowledge[o] = this.connectivityKnowledge[i].filter((l) => l.id in r);
629
623
  }
630
- this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[o] || (this.connectivityFilterOptions[o] = await e.getFilterOptions()), this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivityFilterSources[o] || (this.connectivityFilterSources[o] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources), f.emit("species-layout-connectivity-update");
624
+ this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[o] || (this.connectivityFilterOptions[o] = await t.getFilterOptions()), this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivityFilterSources[o] || (this.connectivityFilterSources[o] = t.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources), h.emit("species-layout-connectivity-update");
631
625
  }
632
626
  },
633
627
  data: function() {
@@ -660,8 +654,8 @@ const O = {
660
654
  this.flatmapAPI = void 0, this.apiLocation = void 0, this.settingsStore.flatmapAPI && (this.flatmapAPI = this.settingsStore.flatmapAPI), this.settingsStore.sparcApi && (this.apiLocation = this.settingsStore.sparcApi), this.settingsStore.mapManager && (this.mapManager = this.settingsStore.mapManager);
661
655
  },
662
656
  watch: {
663
- helpMode: function(e) {
664
- e || (this.helpModeActiveItem = 0);
657
+ helpMode: function(t) {
658
+ t || (this.helpModeActiveItem = 0);
665
659
  }
666
660
  }
667
661
  };