import { _ as d, K as h, t as u, T as r, E as l } from "./index-B-W0fnek.js"; import { C as I } from "./ContentMixin-Bvii7mm_.js"; import { D as v, f as y } from "./style-DNyE_OHZ.js"; import { resolveComponent as s, openBlock as p, createElementBlock as g, createVNode as M, createBlock as S, createCommentVNode as C } from "vue"; const F = { name: "Flatmap", mixins: [I, v], components: { FlatmapVuer: y, HelpModeDialog: h }, methods: { getState: function() { return this.$refs.flatmap.getState(); }, /** * Perform a local search on this contentvuer */ search: function(e) { return this.$refs.flatmap.searchAndShowResult(e); }, getFlatmapImp() { var e; return (e = this.$refs.flatmap) == null ? void 0 : e.mapImp; }, flatmaprResourceSelected: function(e, t) { if (this.resourceSelected(e, t), t.eventType === "click" && t.feature.type === "feature") { const a = { label: t.label || "", id: t.feature.id || "", featureId: t.feature.featureId || "", taxonomy: t.taxonomy || "", resources: t.resource.join(", ") }, n = u(a); r.sendEvent({ event: "interaction_event", event_name: "portal_maps_connectivity", category: n, location: e + " " + this.$refs.flatmap.viewingMode }); } }, flatmapReadyCall: function(e) { let t = { id: this.entry.id, prov: this.getFlatmapImp().provenance }; l.emit("mapImpProv", t), this.$emit("flatmap-provenance-ready", t), this.flatmapReadyForMarkerUpdates(e), l.emit("mapLoaded", e); }, onPathwaySelectionChanged: function(e) { const { label: t, property: a, checked: n, selectionsTitle: i } = e; r.sendEvent({ event: "interaction_event", event_name: "portal_maps_pathway_change", category: t + " [" + a + "] " + n, location: i }); }, highlightFeatures: function(e) { let t = e.name; const a = this.$refs.flatmap.mapImp; if (t) { const n = a.search(t); n.featureIds[0] && a.highlightFeatures([ a.modelForFeature(n.featureIds[0]) ]); } }, /** * Append the list of suggested terms to suggestions */ searchSuggestions: function(e, t) { if (e && this.$refs.flatmap.mapImp) { const a = this.$refs.flatmap.mapImp.search(e); (a.__featureIds || a.featureIds).forEach((i) => { const o = this.$refs.flatmap.mapImp.annotation(i); o && o.label && t.push(o.label); }); } }, zoomToFeatures: function(e, t) { let a = e.name; const n = this.$refs.flatmap.mapImp; if (a) { const i = n.search(a); if (i.featureIds.length) { let o = n.modelForFeature(i.featureIds[0]); o ? (t && n.selectFeatures(o), n.zoomToFeatures(o)) : n.clearSearchResults(); } } else n.clearSearchResults(); }, changeViewingMode: function(e) { this.$refs.flatmap.changeViewingMode(e); } }, computed: { facetSpecies() { return this.settingsStore.facets.species; } }, mounted: function() { l.on("annotation-close", (e) => { const t = this.$refs.flatmap; e != null && e.tabClose && t && this.$refs.flatmap.annotationEventCallback({}, { type: "aborted" }); }), l.on("markerUpdate", () => { this.flatmapMarkerUpdate(void 0); }), l.on("hoverUpdate", () => { this.mapHoverHighlight(this.$refs.flatmap.mapImp); }), l.on("show-connectivity", (e) => { const { featureIds: t, offset: a } = e, n = this.$refs.flatmap; n && n.moveMap(t, { offsetX: a ? -150 : 0, zoom: 4 }); }); } }, w = { class: "viewer-container" }; function b(e, t, a, n, i, o) { const m = s("FlatmapVuer"), f = s("HelpModeDialog"); return p(), g("div", w, [ M(m, { state: e.entry.state, entry: e.entry.resource, onResourceSelected: t[0] || (t[0] = (c) => o.flatmaprResourceSelected(e.entry.type, c)), onPanZoomCallback: e.flatmapPanZoomCallback, name: e.entry.resource, style: { height: "100%", width: "100%" }, minZoom: e.entry.minZoom, helpMode: e.helpMode, helpModeActiveItem: e.helpModeActiveItem, helpModeInitialIndex: -1, helpModeDialog: e.useHelpModeDialog, onHelpModeLastItem: e.onHelpModeLastItem, onShownTooltip: e.onTooltipShown, onShownMapTooltip: e.onMapTooltipShown, onAnnotationOpen: e.onAnnotationOpen, onAnnotationClose: e.onAnnotationClose, annotationSidebar: e.annotationSidebar, onConnectivityInfoOpen: e.onConnectivityInfoOpen, onConnectivityInfoClose: e.onConnectivityInfoClose, onConnectivityGraphError: e.onConnectivityGraphError, connectivityInfoSidebar: e.connectivityInfoSidebar, pathControls: !0, ref: "flatmap", onReady: o.flatmapReadyCall, displayMinimap: !1, displayWarning: !0, enableOpenMapUI: !0, flatmapAPI: e.flatmapAPI, sparcAPI: e.apiLocation, onOpenMap: e.openMap, onPathwaySelectionChanged: o.onPathwaySelectionChanged }, null, 8, ["state", "entry", "onPanZoomCallback", "name", "minZoom", "helpMode", "helpModeActiveItem", "helpModeDialog", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "onAnnotationOpen", "onAnnotationClose", "annotationSidebar", "onConnectivityInfoOpen", "onConnectivityInfoClose", "onConnectivityGraphError", "connectivityInfoSidebar", "onReady", "flatmapAPI", "sparcAPI", "onOpenMap", "onPathwaySelectionChanged"]), e.helpMode && e.useHelpModeDialog ? (p(), S(f, { key: 0, ref: "flatmapHelp", flatmapRef: e.flatmapRef, lastItem: e.helpModeLastItem, onShowNext: e.onHelpModeShowNext, onFinishHelpMode: e.onFinishHelpMode }, null, 8, ["flatmapRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : C("", !0) ]); } const R = /* @__PURE__ */ d(F, [["render", b], ["__scopeId", "data-v-7635fa9b"]]); export { R as default };