@abi-software/mapintegratedvuer 1.9.2 → 1.9.3-beta.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,17 +1,17 @@
1
- import { markRaw as v } from "vue";
2
- import { u as b, p as M, q as A, E as f, T as C, r as S, s as F, v as $, x as H } from "./index-BcpVBq1h.js";
3
- import { mapStores as I } from "pinia";
1
+ import { markRaw as w } from "vue";
2
+ import { u as b, b as F, c as M, E as f, T as C, d as S, e as I, f as A, l as H } from "./index-DMpfPm6s.js";
3
+ import { mapStores as N } from "pinia";
4
4
  const d = function(e) {
5
5
  return e ? [...new Set(e.map((t) => JSON.stringify(t)))].map(
6
6
  (t) => JSON.parse(t)
7
7
  ) : [];
8
- }, g = [], w = async function(e, t) {
9
- const n = t.filter(
8
+ }, g = [], v = async function(e, t) {
9
+ const i = t.filter(
10
10
  (s) => g.some((a) => a.taxon === s)
11
- ), i = g.filter(
12
- (s) => n.includes(s.taxon)
11
+ ), n = g.filter(
12
+ (s) => i.includes(s.taxon)
13
13
  ), o = t.filter(
14
- (s) => !n.includes(s)
14
+ (s) => !i.includes(s)
15
15
  );
16
16
  if (o.length) {
17
17
  const s = await e.queryLabels(o);
@@ -20,32 +20,32 @@ const d = function(e) {
20
20
  let { entity: r, label: l } = a;
21
21
  l === "Mammalia" && (l = "Mammalia not otherwise specified");
22
22
  const c = { taxon: r, label: l };
23
- i.push(c), g.push(c);
24
- }), i;
23
+ n.push(c), g.push(c);
24
+ }), n;
25
25
  } else
26
- return i;
26
+ return n;
27
27
  }, y = function(e, t) {
28
28
  if (!e || !t) return !1;
29
- let n = JSON.stringify(e), i = JSON.stringify(t);
30
- return n.indexOf(i) !== -1;
29
+ let i = JSON.stringify(e), n = JSON.stringify(t);
30
+ return i.indexOf(n) !== -1;
31
31
  }, p = (e, t) => {
32
- const n = e.name ?? e, i = t.name ?? t, o = n.toUpperCase(), s = i.toUpperCase();
32
+ const i = e.name ?? e, n = t.name ?? t, o = i.toUpperCase(), s = n.toUpperCase();
33
33
  return o < s ? -1 : o > s ? 1 : 0;
34
34
  };
35
- let N = function() {
35
+ let $ = function() {
36
36
  this.initialise = function(e) {
37
37
  this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "sckan";
38
38
  }, this.createTooltipData = async function(e, t) {
39
- let n = [];
40
- t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? n = t.feature.hyperlinks : n = this.rawURLs;
41
- let i;
39
+ let i = [];
40
+ t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? i = t.feature.hyperlinks : i = this.rawURLs;
41
+ let n;
42
42
  if (t.provenanceTaxonomy) {
43
- i = [];
43
+ n = [];
44
44
  try {
45
- const s = await w(e, t.provenanceTaxonomy);
45
+ const s = await v(e, t.provenanceTaxonomy);
46
46
  s.length && s.forEach((a) => {
47
47
  const { label: r } = a;
48
- i.push(r);
48
+ n.push(r);
49
49
  });
50
50
  } catch (s) {
51
51
  console.log(s);
@@ -60,9 +60,9 @@ let N = function() {
60
60
  componentsWithDatasets: this.componentsWithDatasets,
61
61
  title: t.label,
62
62
  featureId: t.resource,
63
- hyperlinks: n,
63
+ hyperlinks: i,
64
64
  provenanceTaxonomy: t.provenanceTaxonomy,
65
- provenanceTaxonomyLabel: i,
65
+ provenanceTaxonomyLabel: n,
66
66
  connectivitySource: this.connectivitySource
67
67
  };
68
68
  }, this.updateTooltipData = function(e) {
@@ -77,66 +77,66 @@ let N = function() {
77
77
  connectivitySource: this.connectivitySource
78
78
  };
79
79
  }, this.createComponentsLabelList = function(e, t) {
80
- let n = [];
81
- return e.forEach((i) => {
82
- n.push(this.createLabelFromNeuralNode(i[0]), t), i.length === 2 && n.push(this.createLabelFromNeuralNode(i[1]), t);
83
- }), n;
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);
83
+ }), i;
84
84
  }, this.createLabelLookup = function(e, t) {
85
- return new Promise(async (n) => {
86
- let i = {};
85
+ return new Promise(async (i) => {
86
+ let n = {};
87
87
  this.uberons = [];
88
- const o = await w(e, t);
88
+ const o = await v(e, t);
89
89
  o.length && (o.forEach((s) => {
90
90
  const { taxon: a, label: r } = s;
91
- i[a] = r, this.uberons.push({
91
+ n[a] = r, this.uberons.push({
92
92
  id: a,
93
93
  name: r
94
94
  });
95
- }), n(i));
95
+ }), i(n));
96
96
  });
97
97
  }, this.buildConnectivitySqlStatement = function(e) {
98
98
  let t = "select knowledge from knowledge where entity in (";
99
99
  if (e.length === 1)
100
100
  t += `'${e[0]}')`;
101
101
  else if (e.length > 1)
102
- for (let n in e)
103
- t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
102
+ for (let i in e)
103
+ t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
104
104
  return t;
105
105
  }, this.buildLabelSqlStatement = function(e) {
106
106
  let t = "select entity, label from labels where entity in (";
107
107
  if (e.length === 1)
108
108
  t += `'${e[0]}')`;
109
109
  else if (e.length > 1)
110
- for (let n in e)
111
- t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
110
+ for (let i in e)
111
+ t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
112
112
  return t;
113
113
  }, this.findAllIdsFromConnectivity = function(e) {
114
- let t = e.connectivity.flat(), n = [...new Set(t)], i = [];
115
- return n.forEach((o) => {
116
- Array.isArray(o) ? i.push(o.flat()) : i.push(o);
117
- }), [...new Set(i.flat())];
114
+ let t = e.connectivity.flat(), i = [...new Set(t)], n = [];
115
+ return i.forEach((o) => {
116
+ Array.isArray(o) ? n.push(o.flat()) : n.push(o);
117
+ }), [...new Set(n.flat())];
118
118
  }, this.flattenConnectivity = function(e) {
119
- let t = e.flat(), n = [...new Set(t)], i = [];
120
- return n.forEach((o) => {
121
- Array.isArray(o) ? i.push(o.flat()) : i.push(o);
122
- }), i.flat();
123
- }, this.findComponents = function(e, t, n, i) {
119
+ let t = e.flat(), i = [...new Set(t)], n = [];
120
+ return i.forEach((o) => {
121
+ Array.isArray(o) ? n.push(o.flat()) : n.push(o);
122
+ }), n.flat();
123
+ }, this.findComponents = function(e, t, i, n) {
124
124
  let o = e.connectivity.flat(), s = d(o), a = [], r = !1;
125
125
  return s.forEach((l) => {
126
- r = !1, y(t, l) && (r = !0), i && y(i, l) && (r = !0), y(n, l) && (r = !0), r || a.push(l);
126
+ r = !1, y(t, l) && (r = !0), n && y(n, l) && (r = !0), y(i, l) && (r = !0), r || a.push(l);
127
127
  }), a;
128
128
  }, this.retrieveFlatmapKnowledgeForEvent = async function(e, t) {
129
129
  this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
130
- const n = t.resource;
131
- if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !n || n.length === 0 || !n[0]) return;
132
- let i = this.queryForConnectivityNew(e, n[0]);
133
- return await Promise.all([i]);
134
- }, this.queryForConnectivityNew = function(e, t, n = "sckan", i = !0) {
135
- return this.connectivitySource = n, new Promise((o) => {
136
- (n === "map" ? this.queryMapConnectivity(e.provenance.uuid, t) : e.queryKnowledge(t)).then((a) => {
130
+ const i = t.resource;
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]);
133
+ return await Promise.all([n]);
134
+ }, this.queryForConnectivityNew = function(e, t, i = "sckan", n = !0) {
135
+ return this.connectivitySource = i, new Promise((o) => {
136
+ (i === "map" ? this.queryMapConnectivity(e.provenance.uuid, t) : e.queryKnowledge(t)).then((a) => {
137
137
  if (this.checkConnectivityExists(a)) {
138
138
  let r = a;
139
- i ? this.processConnectivity(e, r).then((l) => {
139
+ n ? this.processConnectivity(e, r).then((l) => {
140
140
  a.references && (this.rawURLs = [...a.references]), o(l);
141
141
  }) : o(r);
142
142
  } else
@@ -146,40 +146,30 @@ let N = function() {
146
146
  });
147
147
  });
148
148
  }, this.queryMapConnectivity = async function(e, t) {
149
- const n = this.flatmapAPI + `flatmap/${e}/connectivity/${t}`;
149
+ const i = this.flatmapAPI + `flatmap/${e}/connectivity/${t}`;
150
150
  try {
151
- const i = await fetch(n);
152
- if (!i.ok)
153
- throw new Error(`Response status: ${i.status}`);
154
- return await i.json();
155
- } catch (i) {
156
- throw new Error(i);
157
- }
158
- }, this.queryMapPaths = async function(e) {
159
- const t = this.flatmapAPI + `flatmap/${e}/pathways`;
160
- try {
161
- const n = await fetch(t);
151
+ const n = await fetch(i);
162
152
  if (!n.ok)
163
153
  throw new Error(`Response status: ${n.status}`);
164
154
  return await n.json();
165
155
  } catch (n) {
166
156
  throw new Error(n);
167
157
  }
168
- }, this.queryForConnectivity = function(e, t, n, i = !0) {
158
+ }, this.queryForConnectivity = function(e, t, i, n = !0) {
169
159
  const o = { sql: this.buildConnectivitySqlStatement(t) }, s = {
170
160
  method: "POST",
171
161
  headers: {
172
162
  "Content-Type": "application/json"
173
163
  },
174
164
  body: JSON.stringify(o),
175
- ...n ? { signal: n } : {}
165
+ ...i ? { signal: i } : {}
176
166
  // add signal to header if it exists
177
167
  };
178
168
  return new Promise((a) => {
179
169
  fetch(`${this.flatmapAPI}knowledge/query/`, s).then((r) => r.json()).then((r) => {
180
170
  if (this.connectivityExists(r)) {
181
171
  let l = JSON.parse(r.values[0][0]);
182
- i ? this.processConnectivity(e, l).then((c) => {
172
+ n ? this.processConnectivity(e, l).then((c) => {
183
173
  a(c);
184
174
  }) : a(l);
185
175
  } else
@@ -196,45 +186,45 @@ let N = function() {
196
186
  }, this.findIfNodeIsSingle = function(e) {
197
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;
198
188
  }, this.createLabelFromNeuralNode = function(e, t) {
199
- let n = this.findIfNodeIsSingle(e);
200
- if (n)
201
- return t[n];
202
- let i = t[e[0]];
189
+ let i = this.findIfNodeIsSingle(e);
190
+ if (i)
191
+ return t[i];
192
+ let n = t[e[0]];
203
193
  return e.length === 2 && e[1].length > 0 && e[1].forEach((o) => {
204
- t[o] == null ? i += `, ${o}` : i += `, ${t[o]}`;
205
- }), i;
206
- }, this.flattenAndFindDatasets = function(e, t, n) {
207
- let i = this.flattenConnectivity(e), o = this.flattenConnectivity(t), s = this.flattenConnectivity(n);
194
+ t[o] == null ? n += `, ${o}` : n += `, ${t[o]}`;
195
+ }), n;
196
+ }, this.flattenAndFindDatasets = function(e, t, i) {
197
+ let n = this.flattenConnectivity(e), o = this.flattenConnectivity(t), s = this.flattenConnectivity(i);
208
198
  this.originsWithDatasets = this.uberons.filter(
209
- (a) => i.indexOf(a.id) !== -1
199
+ (a) => n.indexOf(a.id) !== -1
210
200
  ).sort(p), this.componentsWithDatasets = this.uberons.filter(
211
201
  (a) => o.indexOf(a.id) !== -1
212
202
  ).sort(p), this.destinationsWithDatasets = this.uberons.filter(
213
203
  (a) => s.indexOf(a.id) !== -1
214
204
  ).sort(p);
215
205
  }, this.processConnectivity = function(e, t) {
216
- return new Promise((n) => {
217
- let i = [], o = [], s;
206
+ return new Promise((i) => {
207
+ let n = [], o = [], s;
218
208
  if (t && t["node-phenotypes"]) {
219
209
  const l = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
220
210
  l.forEach((h) => {
221
- i.push(...t["node-phenotypes"][h]);
222
- }), i = d(i), c.forEach((h) => {
223
- o.push(...t["node-phenotypes"][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"] && o.push(...t["node-phenotypes"][h]);
224
214
  }), o = d(o);
225
215
  } else
226
- o = d(t.axons), t.somas && t.somas.length > 0 && i.push(...t.somas), t.dendrites && t.dendrites.length > 0 && i.push(...t.dendrites), i = d(i), s = t.somas;
227
- const a = this.findComponents(t, o, i, s), r = this.findAllIdsFromConnectivity(t);
216
+ o = 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), s = t.somas;
217
+ const a = this.findComponents(t, o, n, s), r = this.findAllIdsFromConnectivity(t);
228
218
  this.createLabelLookup(e, r).then((l) => {
229
- this.origins = i.map(
219
+ this.origins = n.map(
230
220
  (c) => this.createLabelFromNeuralNode(c, l)
231
221
  ).sort(p), this.components = a.map(
232
222
  (c) => this.createLabelFromNeuralNode(c, l)
233
223
  ).sort(p), this.destinations = o.map(
234
224
  (c) => this.createLabelFromNeuralNode(c, l)
235
- ).sort(p), this.flattenAndFindDatasets(i, a, o), n({
225
+ ).sort(p), this.flattenAndFindDatasets(n, a, o), i({
236
226
  ids: {
237
- dendrites: i,
227
+ dendrites: n,
238
228
  components: a,
239
229
  axons: o
240
230
  },
@@ -251,8 +241,8 @@ let N = function() {
251
241
  if (e.length === 1)
252
242
  t += `'${e[0]}')`;
253
243
  else if (e.length > 1)
254
- for (let n in e)
255
- t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
244
+ for (let i in e)
245
+ t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
256
246
  return t;
257
247
  }, this.buildPubmedSqlStatementForModels = function(e) {
258
248
  return `select distinct publication from publications where entity = '${e}'`;
@@ -264,12 +254,12 @@ let N = function() {
264
254
  "Content-Type": "application/json"
265
255
  },
266
256
  body: JSON.stringify(t)
267
- }).then((n) => n.json()).catch((n) => {
268
- console.error("Error:", n);
257
+ }).then((i) => i.json()).catch((i) => {
258
+ console.error("Error:", i);
269
259
  });
270
260
  };
271
261
  };
272
- function P(e) {
262
+ function T(e) {
273
263
  return e[0].toUpperCase() + e.substring(1);
274
264
  }
275
265
  const D = {
@@ -289,8 +279,9 @@ const D = {
289
279
  default: !1
290
280
  }
291
281
  },
282
+ inject: ["showGlobalSettings", "showOpenMapButton"],
292
283
  computed: {
293
- ...I(b, M, A),
284
+ ...N(b, F, M),
294
285
  idNamePair() {
295
286
  return this.splitFlowStore.idNamePair;
296
287
  },
@@ -305,12 +296,22 @@ const D = {
305
296
  },
306
297
  annotationSidebar() {
307
298
  return this.settingsStore.annotationSidebar;
299
+ },
300
+ // Hide local settings if global settings are shown
301
+ showLocalSettings() {
302
+ return !this.showGlobalSettings;
308
303
  }
309
304
  },
310
305
  mounted: function() {
311
306
  f.on("startHelp", () => {
312
307
  this.startHelp();
313
- }), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities;
308
+ }), f.on("connectivity-item-close", () => {
309
+ if (this.multiflatmapRef) {
310
+ const e = this.multiflatmapRef.getCurrentFlatmap();
311
+ e && e.closeTooltip();
312
+ }
313
+ this.flatmapRef && this.flatmapRef.closeTooltip();
314
+ }), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources;
314
315
  },
315
316
  methods: {
316
317
  toggleSyncMode: function() {
@@ -349,12 +350,12 @@ const D = {
349
350
  */
350
351
  resourceSelected: function(e, t) {
351
352
  var a, r, l, c;
352
- const n = t[0];
353
- if (this.resourceHasAction(n)) {
354
- f.emit("PopoverActionClick", n);
353
+ const i = t[0];
354
+ if (this.resourceHasAction(i)) {
355
+ f.emit("PopoverActionClick", i);
355
356
  return;
356
357
  }
357
- let i, o = !1;
358
+ let n, o = !1;
358
359
  const s = {
359
360
  paneIndex: this.entry.id,
360
361
  type: e,
@@ -363,17 +364,17 @@ const D = {
363
364
  eventType: void 0
364
365
  };
365
366
  if (e == "MultiFlatmap" || e == "Flatmap")
366
- if (s.internalName = (a = n == null ? void 0 : n.feature) != null && a.label ? n.feature.label : this.idNamePair[n.feature.models], n.eventType == "click")
367
- if (s.eventType = "selected", n.feature.type == "marker") {
367
+ if (s.internalName = (a = i == null ? void 0 : i.feature) != null && a.label ? i.feature.label : this.idNamePair[i.feature.models], i.eventType == "click")
368
+ if (s.eventType = "selected", i.feature.type == "marker") {
368
369
  let h = s.internalName;
369
- if (this.settingsStore.isFeaturedMarkerIdentifier(n.feature.id))
370
- i = {
370
+ if (this.settingsStore.isFeaturedMarkerIdentifier(i.feature.id))
371
+ n = {
371
372
  type: "Search",
372
- term: this.settingsStore.featuredMarkerDoi(n.feature.id),
373
+ term: this.settingsStore.featuredMarkerDoi(i.feature.id),
373
374
  featuredDataset: !0
374
375
  };
375
376
  else {
376
- i = {
377
+ n = {
377
378
  type: "Facet",
378
379
  facet: h,
379
380
  facetPropPath: "anatomy.organ.category.name",
@@ -381,23 +382,23 @@ const D = {
381
382
  term: "Anatomical structure"
382
383
  };
383
384
  let u = /* @__PURE__ */ new Set();
384
- n.feature["marker-terms"].forEach((m) => {
385
+ i.feature["marker-terms"].forEach((m) => {
385
386
  u.add(m.label);
386
- }), u.add(h), u.size > 0 && (i = {
387
+ }), u.add(h), u.size > 0 && (n = {
387
388
  type: "Facets",
388
389
  labels: [...u]
389
390
  });
390
391
  }
391
392
  o = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
392
- } else n.feature.type == "feature" && this.syncMode && (o = !0);
393
- else n.eventType == "mouseenter" && (s.eventType = "highlighted", o = !0);
394
- else e == "Scaffold" && (n && ((((r = n.data) == null ? void 0 : r.id) === void 0 || ((l = n.data) == null ? void 0 : l.id) === "") && (n.data.id = (c = n.data) == null ? void 0 : c.group), s.internalName = n.data.id, n.data.lastActionOnMarker === !0 && (i = {
393
+ } else i.feature.type == "feature" && this.syncMode && (o = !0);
394
+ else i.eventType == "mouseenter" && (s.eventType = "highlighted", o = !0);
395
+ 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), s.internalName = i.data.id, i.data.lastActionOnMarker === !0 && (n = {
395
396
  type: "Facet",
396
- facet: P(n.data.id),
397
+ facet: T(i.data.id),
397
398
  facetPropPath: "anatomy.organ.category.name",
398
399
  term: "Anatomical structure"
399
400
  })), s.eventType = "selected", o = !0);
400
- i && f.emit("PopoverActionClick", i), o && this.$emit("resource-selected", s);
401
+ n && f.emit("PopoverActionClick", n), o && this.$emit("resource-selected", s);
401
402
  },
402
403
  resourceHasAction: function(e) {
403
404
  return e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets";
@@ -418,53 +419,53 @@ const D = {
418
419
  getNameAndIdFromSyncData: async function(e) {
419
420
  let t = e.internalName;
420
421
  t === void 0 && e.resource && (t = e.resource.label);
421
- let n;
422
- if (e.resource && e.resource.resource && (n = e.resource.resource[0]), this.entry.type === "Scaffold") {
422
+ let i;
423
+ if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
423
424
  if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
424
425
  if (e.resource && e.resource.feature) {
425
426
  const s = S(e.resource.feature.models);
426
427
  if (s.length > 0) return s;
427
428
  }
428
- let o = F(t);
429
+ let o = I(t);
429
430
  if (o)
430
431
  return o;
431
- if (n && e.eventType === "selected")
432
- return fetch(`${this.apiLocation}get-related-terms/${n}`).then((s) => s.json()).then((s) => {
432
+ if (i && e.eventType === "selected")
433
+ return fetch(`${this.apiLocation}get-related-terms/${i}`).then((s) => s.json()).then((s) => {
433
434
  var a;
434
435
  if (((a = s.uberon) == null ? void 0 : a.array.length) > 0)
435
- return t = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), n = s.uberon.array[0].id.toUpperCase(), { id: n, name: t };
436
+ return t = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), i = s.uberon.array[0].id.toUpperCase(), { id: i, name: t };
436
437
  });
437
438
  }
438
439
  } else if (this.entry.type === "MultiFlatmap")
439
440
  if (t === "Bladder")
440
441
  t = "Urinary Bladder";
441
442
  else {
442
- const i = S(t);
443
- i.length > 0 && (t = i[0]);
443
+ const n = S(t);
444
+ n.length > 0 && (t = n[0]);
444
445
  }
445
- return { id: n, name: t };
446
+ return { id: i, name: t };
446
447
  },
447
448
  // Get the species and andaotmy info for the featured datasets
448
449
  getDatasetAnatomyInfo: function(e) {
449
450
  fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
450
- const n = t.result[0];
451
- let i;
451
+ const i = t.result[0];
452
+ let n;
452
453
  try {
453
- i = n.anatomy.organ[0].curie;
454
+ n = i.anatomy.organ[0].curie;
454
455
  } catch {
455
- i = void 0;
456
+ n = void 0;
456
457
  }
457
458
  let o;
458
459
  try {
459
- o = n.item.curie;
460
+ o = i.item.curie;
460
461
  } catch {
461
462
  o = void 0;
462
463
  }
463
464
  let s;
464
465
  try {
465
466
  let a = 0, r = !1;
466
- for (; !r && a < n.organisms.subject.length; ) {
467
- const l = n.organisms.subject[a];
467
+ for (; !r && a < i.organisms.subject.length; ) {
468
+ const l = i.organisms.subject[a];
468
469
  l.species && (s = l.species.name, r = !0), a += 1;
469
470
  }
470
471
  } catch {
@@ -472,7 +473,7 @@ const D = {
472
473
  }
473
474
  this.settingsStore.updateFeaturedMarker({
474
475
  identifier: e,
475
- marker: i,
476
+ marker: n,
476
477
  doi: o,
477
478
  species: s
478
479
  });
@@ -486,7 +487,7 @@ const D = {
486
487
  // Check if the new featured dataset api has any info
487
488
  newFeaturedDatasetApiHasInfo: async function() {
488
489
  let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
489
- return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((n) => n.id);
490
+ return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
490
491
  },
491
492
  /**
492
493
  * Get a list of featured datasets to display.
@@ -495,11 +496,11 @@ const D = {
495
496
  let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
496
497
  if (t) e = t;
497
498
  else {
498
- let n = await this.newFeaturedDatasetApiHasInfo();
499
- n && (e = n);
499
+ let i = await this.newFeaturedDatasetApiHasInfo();
500
+ i && (e = i);
500
501
  }
501
- this.settingsStore.updateFeatured(e), e.forEach((n) => {
502
- this.getDatasetAnatomyInfo(n);
502
+ this.settingsStore.updateFeatured(e), e.forEach((i) => {
503
+ this.getDatasetAnatomyInfo(i);
503
504
  });
504
505
  },
505
506
  zoomToFeatures: function() {
@@ -558,15 +559,15 @@ const D = {
558
559
  checkEndHelpMouseDown: function(e) {
559
560
  e.target.closest(".help-mode-dialog") || this.endHelp();
560
561
  },
561
- flatmapHighlight: async function(e, t, n, i) {
562
- let o = [...t, ...i];
562
+ flatmapHighlight: async function(e, t, i, n) {
563
+ let o = [...t, ...n];
563
564
  const s = this.settingsStore.globalSettings;
564
565
  if (s.highlightConnectedPaths) {
565
- const a = t.length ? t : i.length ? i : [], r = await e.retrieveConnectedPaths(a);
566
+ const a = t.length ? t : n.length ? n : [], r = await e.retrieveConnectedPaths(a);
566
567
  r && o.push(...r);
567
568
  }
568
569
  if (s.highlightDOIPaths) {
569
- const a = await e.searchConnectivitiesByReference(n);
570
+ const a = await e.searchConnectivitiesByReference(i);
570
571
  a && o.push(...a);
571
572
  }
572
573
  return o = [...new Set(o)], o;
@@ -574,12 +575,15 @@ const D = {
574
575
  cardHoverHighlight: function() {
575
576
  var e;
576
577
  if (this.visible) {
577
- const t = this.settingsStore.hoverAnatomies, n = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI, o = this.settingsStore.hoverConnectivity;
578
+ const t = this.settingsStore.hoverAnatomies, i = this.settingsStore.hoverOrgans, n = this.settingsStore.hoverDOI, o = this.settingsStore.hoverConnectivity;
578
579
  let s = null, a = null;
579
- this.flatmapRef && (s = this.flatmapRef), this.multiflatmapRef && (s = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (a = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !n.length && !i && !o.length && ((this.multiflatmapRef || this.flatmapRef) && s ? (e = s.mapImp) == null || e.clearSearchResults() : this.scaffoldRef && a && a.changeHighlightedByName(n, "", !1)), this.highlightDelay = setTimeout(() => {
580
- (t.length || n.length || i || o.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, i, o).then((r) => {
580
+ this.flatmapRef && (s = this.flatmapRef), this.multiflatmapRef && (s = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (a = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !i.length && !n && !o.length && ((this.multiflatmapRef || this.flatmapRef) && s ? (e = s.mapImp) == null || e.clearSearchResults() : this.scaffoldRef && a && a.changeHighlightedByName(i, "", !1)), this.highlightDelay = setTimeout(() => {
581
+ (t.length || i.length || n || o.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, n, o).then((r) => {
581
582
  try {
582
- s.zoomToFeatures(r);
583
+ s.showConnectivityTooltips({
584
+ connectivityInfo: { featureId: r },
585
+ data: []
586
+ });
583
587
  } catch (l) {
584
588
  if (console.log(l), o.length && s.mapImp) {
585
589
  const c = s.mapImp.uuid;
@@ -590,7 +594,7 @@ const D = {
590
594
  ) || s.mapImp.clearSearchResults();
591
595
  }
592
596
  }
593
- }) : this.scaffoldRef && a && a.changeHighlightedByName(n, "", !1));
597
+ }) : this.scaffoldRef && a && a.changeHighlightedByName(i, "", !1));
594
598
  }, 100);
595
599
  }
596
600
  },
@@ -600,6 +604,9 @@ const D = {
600
604
  onAnnotationClose: function() {
601
605
  f.emit("annotation-close");
602
606
  },
607
+ updateOfflineAnnotationEnabled: function(e) {
608
+ f.emit("update-offline-annotation-enabled", e);
609
+ },
603
610
  onConnectivityInfoOpen: function(e) {
604
611
  f.emit("connectivity-info-open", e);
605
612
  },
@@ -609,21 +616,18 @@ const D = {
609
616
  onConnectivityInfoClose: function() {
610
617
  f.emit("connectivity-info-close");
611
618
  },
612
- loadConnectivityKnowledge: async function(e) {
613
- const t = $(e), n = v(new N());
619
+ loadConnectivityExplorerConfig: async function(e) {
620
+ const t = e.mapImp, i = A(t), n = w(new $());
614
621
  n.initialise(this.flatmapAPI);
615
- const i = await H(e, n), o = e.uuid;
616
- if (this.connectivityKnowledge[t] || (this.connectivityKnowledge[t] = i.filter((s) => {
617
- var a;
618
- return s.source === t && ((a = s.connectivity) == null ? void 0 : a.length);
619
- }).sort((s, a) => s.label.localeCompare(a.label))), !this.connectivitiesStore.globalConnectivities[o]) {
620
- const s = await n.queryMapPaths(o), a = s ? s.paths : {};
621
- this.connectivityKnowledge[o] = i.filter((r) => {
622
- var l;
623
- return r.source === t && ((l = r.connectivity) == null ? void 0 : l.length) && r.id in a;
624
- }).sort((r, l) => r.label.localeCompare(l.label));
622
+ const o = await H(t, n), s = t.uuid, a = t.pathways;
623
+ if (this.connectivityKnowledge[i] || (this.connectivityKnowledge[i] = o.filter((r) => {
624
+ var l;
625
+ return r.source === i && ((l = r.connectivity) == null ? void 0 : l.length);
626
+ }).sort((r, l) => r.label.localeCompare(l.label))), !this.connectivityKnowledge[s]) {
627
+ const r = a ? a.paths : {};
628
+ this.connectivityKnowledge[s] = this.connectivityKnowledge[i].filter((l) => l.id in r);
625
629
  }
626
- this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), f.emit("species-layout-connectivity-update");
630
+ this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[s] || (this.connectivityFilterOptions[s] = await e.getFilterOptions()), this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivityFilterSources[s] || (this.connectivityFilterSources[s] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources), f.emit("species-layout-connectivity-update");
627
631
  }
628
632
  },
629
633
  data: function() {
@@ -646,6 +650,8 @@ const D = {
646
650
  isInHelp: !1,
647
651
  mapManager: void 0,
648
652
  connectivityKnowledge: {},
653
+ connectivityFilterOptions: {},
654
+ connectivityFilterSources: {},
649
655
  highlightDelay: void 0
650
656
  };
651
657
  },