! function(o, t, e, i) { o.imageMapProShapeDefaults = { id: "spot-0", title: "", type: "spot", x: -1, y: -1, width: 44, height: 44, connected_to: "", use_connected_shape_tooltip: 0, layerID: 0, text: { text: "Text", font_family: "sans-serif", font_size: 16, font_weight: 400, text_color: "#000000", text_opacity: 1 }, actions: { click: "no-action", link: "#", open_link_in_new_window: 1, script: "" }, default_style: { opacity: 1, border_radius: 50, background_color: "#000000", background_opacity: .4, border_width: 0, border_style: "solid", border_color: "#ffffff", border_opacity: 1, fill: "#000000", fill_opacity: .4, stroke_color: "#ffffff", stroke_opacity: .75, stroke_width: 0, stroke_dasharray: "10 10", stroke_linecap: "round", use_icon: 1, icon_type: "library", icon_svg_path: "M409.81,160.113C409.79,71.684,338.136,0,249.725,0C161.276,0,89.583,71.684,89.583,160.113 c0,76.325,119.274,280.238,151.955,334.638c1.72,2.882,4.826,4.641,8.178,4.641c3.351,0,6.468-1.759,8.168-4.631 C290.545,440.361,409.81,236.438,409.81,160.113z M249.716,283.999c-68.303,0-123.915-55.573-123.915-123.895 c0-68.313,55.592-123.895,123.915-123.895s123.876,55.582,123.876,123.895S318.029,283.999,249.716,283.999z", icon_svg_viewbox: "0 0 499.392 499.392", icon_fontawesome_id: "map-marker", icon_fill: "#000000", icon_url: "", icon_is_pin: 1, icon_shadow: 0 }, mouseover_style: { opacity: 1, border_radius: 50, background_color: "#ffffff", background_opacity: .4, border_width: 0, border_style: "solid", border_color: "#ffffff", border_opacity: 1, fill: "#ffffff", fill_opacity: .4, stroke_color: "#ffffff", stroke_opacity: .75, stroke_width: 0, stroke_dasharray: "10 10", stroke_linecap: "round", icon_fill: "#000000" }, tooltip_style: { enable_tooltip: 1, buffer: 40, border_radius: 5, padding: 20, background_color: "#000000", background_opacity: .9, position: "top", width: 300, auto_width: 1 }, tooltip_content: { content_type: "plain-text", plain_text: "Fügen Sie eine Bildbeschreibung ein.", plain_text_color: "#ffffff", squares_settings: { containers: [{ id: "sq-container-403761", settings: { elements: [{ settings: { name: "Text", iconClass: "fa fa-paragraph" } }] } }] } }, points: [], vs: [] }, o.imageMapProEditorDefaults = { id: 0, editor: { previewMode: 0, selected_shape: -1, tool: "spot", zoom: 1, currentLayer: 0, state: { dragging: !1 } }, runtime: { is_fullscreen: 0, layerID: 0 }, general: { name: "", shortcode: "", width: 1280, height: 776, naturalWidth: 1280, naturalHeight: 776, responsive: 1, preserve_quality: 1, pageload_animation: "none", center_image_map: 0 }, image: { url: "https://imagemarker.com/editor/public/images/demo.jpg" }, fullscreen: { enable_fullscreen_mode: 0, start_in_fullscreen_mode: 0, fullscreen_background: "#000000", fullscreen_button_position: 1, fullscreen_button_type: "icon_and_text", fullscreen_button_color: "#ffffff", fullscreen_button_text_color: "#222222" }, tooltips: { enable_tooltips: 1, show_tooltips: "mouseover", sticky_tooltips: 0, constrain_tooltips: 1, tooltip_animation: "none", fullscreen_tooltips: "mobile-only" }, zooming: { enable_zooming: 0, max_zoom: 16, limit_max_zoom_to_image_size: 0, enable_zoom_buttons: 1, enable_navigator: 1, zoom_button_text_color: "#000000", zoom_button_background_color: "#ffffff" }, layers: { enable_layers: 0, layers_list: [] }, custom_code: { custom_css: "", custom_js: "" }, spots: [] } }(jQuery, window, document); ! function(t, e, s, o) { var i = new Array; function n(t) { this.settings = t, this.containers = [], this.init() } function r(t) { this.settings = t, this.elements = [], this.init() } t.squaresRendererRegisterElement = function(t) { i[t.name] = t }, t.squaresRendererRenderObject = function(t) { if ("object" != typeof t) try { t = JSON.parse(t) } catch (e) { return console.log(e), console.log("Squares renderer failed to parse JSON: "), console.log(t), "" } return new n(t).render() }, n.prototype.init = function() { for (var t = 0; t < this.settings.containers.length; t++) this.containers[t] = new r(this.settings.containers[t]) }, n.prototype.render = function() { for (var t = "", e = 0; e < this.containers.length; e++) t += this.containers[e].render(); return t }, r.prototype.init = function() { if (this.settings.settings) for (var t = 0; t < this.settings.settings.elements.length; t++) this.elements[t] = new l(this.settings.settings.elements[t]) }, r.prototype.render = function() { var t = ""; if (t += '
', this.settings.settings) for (var e = 0; e < this.settings.settings.elements.length; e++) t += this.elements[e].render(); return t += '\t
', t += "
" }; var a = { layout: { box_model: { margin: { top: 0, bottom: 0, left: 0, right: 0 }, padding: { top: 10, bottom: 10, left: 10, right: 10 } }, use_grid: 1, column_span: { xs: { use: 0, class: "sq-col-xs-12", visible: 0 }, sm: { use: 0, class: "sq-col-sm-12", visible: 0 }, md: { use: 0, class: "sq-col-md-12", visible: 1 }, lg: { use: 1, class: "sq-col-lg-12", visible: 1 } }, width: "100", auto_width: 1, height: "100", auto_height: 1 }, style: { background_color: "#ffffff", background_opacity: "0", opacity: "1", box_shadow: "none", border_width: "0", border_style: "none", border_color: "#000000", border_opacity: "1", border_radius: "0" }, font: { font_family: "sans-serif", font_size: "14", font_weight: "normal", font_style: "normal", line_height: "22", text_color: "#ffffff", text_align: "left", text_decoration: "none", text_transform: "none", text_shadow: "" }, general: { id: "", classes: "", css: "" } }; function l(e) { this.settings = e.settings, this.defaults = t.extend(!0, {}, a), this.elementSpecificDefaults = {}, this.options = o, this.init(e) } function d(t) { var e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t); return e ? { r: parseInt(e[1], 16), g: parseInt(e[2], 16), b: parseInt(e[3], 16) } : null } l.prototype.init = function(e) { console.log(this.settings); var s = t.extend(!0, {}, i[this.settings.name].controls); for (var o in s) { var n = s[o]; for (var r in this.elementSpecificDefaults[o] = {}, n) { var a = n[r]; this.elementSpecificDefaults[o][r] = a.default } } this.defaults = t.extend(!0, {}, this.defaults, this.elementSpecificDefaults), this.options = t.extend(!0, {}, this.defaults, e.options) }, l.prototype.render = function() { var t = ""; return t += '
', t += i[this.settings.name].render(this.options), t += "
" }, l.prototype.generateLayoutClass = function() { var t = this.options.layout; if (1 == parseInt(t.use_grid, 10)) { var e = "", s = t.column_span; return 1 == parseInt(s.xs.use, 10) && (e += s.xs.class + " ", 0 == parseInt(s.xs.visible, 10) && (e += "sq-hidden-xs ")), 1 == parseInt(s.sm.use, 10) && (e += s.sm.class + " ", 0 == parseInt(s.sm.visible, 10) && (e += "sq-hidden-sm ")), 1 == parseInt(s.md.use, 10) && (e += s.md.class + " ", 0 == parseInt(s.md.visible, 10) && (e += "sq-hidden-md ")), 1 == parseInt(s.lg.use, 10) && (e += s.lg.class + " ", 0 == parseInt(s.lg.visible, 10) && (e += "sq-hidden-lg ")), e } return "" }, l.prototype.generateCSS = function() { var t = ""; t += "margin-top: " + (s = this.options.layout).box_model.margin.top + "px; ", t += "margin-bottom: " + s.box_model.margin.bottom + "px; ", t += "margin-left: " + s.box_model.margin.left + "px; ", t += "margin-right: " + s.box_model.margin.right + "px; ", t += "padding-top: " + s.box_model.padding.top + "px; ", t += "padding-bottom: " + s.box_model.padding.bottom + "px; ", t += "padding-left: " + s.box_model.padding.left + "px; ", t += "padding-right: " + s.box_model.padding.right + "px; ", 1 == parseInt(s.use_grid, 10) || (1 == parseInt(s.auto_width, 10) ? t += "width: auto; " : "" === s.width || isNaN(s.width) || (t += "width: " + s.width + "px; "), 1 == parseInt(s.auto_height, 10) ? t += "height: auto; " : "" === s.height || isNaN(s.height) || (t += "height: " + s.height + "px; ")), t += "float: left; "; var e, s = this.options.font; (this.options.fontStyles = "", s && (t += "font-family: " + s.font_family + "; ", this.options.fontStyles += "font-family: " + s.font_family + "; ", t += "font-size: " + s.font_size + "px; ", this.options.fontStyles += "font-size: " + s.font_size + "px; ", t += "font-weight: " + s.font_weight + "; ", this.options.fontStyles += "font-weight: " + s.font_weight + "; ", t += "font-style: " + s.font_style + "; ", this.options.fontStyles += "font-style: " + s.font_style + "; ", t += "line-height: " + s.line_height + "px; ", this.options.fontStyles += "line-height: " + s.line_height + "px; ", t += "color: " + s.text_color + "; ", this.options.fontStyles += "color: " + s.text_color + "; ", t += "text-align: " + s.text_align + "; ", this.options.fontStyles += "text-align: " + s.text_align + "; ", t += "text-decoration: " + s.text_decoration + "; ", this.options.fontStyles += "text-decoration: " + s.text_decoration + "; ", t += "text-transform: " + s.text_transform + "; ", this.options.fontStyles += "text-transform: " + s.text_transform + "; ", t += "text-shadow: " + s.text_shadow + "; ", this.options.fontStyles += "text-shadow: " + s.text_shadow + "; "), s = this.options.style) && (t += "background-color: rgba(" + (e = d(s.background_color)).r + ", " + e.g + ", " + e.b + ", " + s.background_opacity + "); ", t += "opacity: " + s.opacity + "; ", t += "box-shadow: " + s.box_shadow + "; ", t += "border-width: " + s.border_width + "px; ", t += "border-style: " + s.border_style + "; ", t += "border-color: rgba(" + (e = d(s.border_color)).r + ", " + e.g + ", " + e.b + ", " + s.border_opacity + "); ", t += "border-radius: " + s.border_radius + "px; "); return t } }(jQuery, window, document); ! function(e, t, a, s) { var l = { name: "Paragraph", iconClass: "fa fa-paragraph", controls: { text: { text: { name: "Text", type: "textarea", default: "Fügen Sie Ihre Bildbeschreibung ein." } } }, controlGroupIcons: { text: "fa fa-ellipsis-h" }, content: function() { var e = this.controls.text.text.getVal(); return e = e.replace(/\\(.)/gm, "$1"), '

' + e + "

" }, render: function(e) { var t = e.text.text; return t = t.replace(/\\(.)/gm, "$1"), '

' + t + "

" } }; e.squaresRegisterElement && e.squaresRegisterElement(l), e.squaresRendererRegisterElement(l); var o = { name: "Heading", iconClass: "fa fa-header", controls: { heading: { text: { name: "Text", type: "text", default: "Lorem Ipsum" }, heading: { name: "Heading", type: "select", options: ["h1", "h2", "h3"], default: "h3" } } }, controlGroupIcons: { heading: "fa fa-header" }, content: function() { return "<" + this.controls.heading.heading.getVal() + ' id="' + this.controls.general.id.getVal() + '" style="' + this.controls.general.css.getVal() + this.fontStyles + ' margin: 0; padding: 0;" class="' + this.controls.general.classes.getVal() + '">' + this.controls.heading.text.getVal() + "" }, render: function(e) { return "<" + e.heading.heading + ' id="' + e.general.id + '" style="' + e.general.css + e.fontStyles + ' margin: 0; padding: 0;" class="' + e.general.classes + '">' + e.heading.text + "" } }; e.squaresRegisterElement && e.squaresRegisterElement(o), e.squaresRendererRegisterElement(o); var n = { name: "Image", iconClass: "fa fa-camera", controls: { image: { url: { name: "Image URL", type: "wp media upload", default: "https://webcraftplugins.com/uploads/placeholder_image.png" }, image_is_a_link: { name: "Image is a Link", type: "switch", default: 0 }, link_to: { name: "Link to", type: "text", default: "#" } } }, controlGroupIcons: { image: "fa fa-camera" }, useFontControls: !1, content: function() { var e = ""; return 1 == parseInt(this.controls.image.image_is_a_link.getVal(), 10) && (e += ''), e += '', 1 == parseInt(this.controls.image.image_is_a_link.getVal(), 10) && (e += ""), e }, render: function(e) { var t = ""; return 1 == parseInt(e.image.image_is_a_link, 10) && (t += ''), t += '', 1 == parseInt(e.image.image_is_a_link, 10) && (t += ""), t } }; e.squaresRegisterElement && e.squaresRegisterElement(n), e.squaresRendererRegisterElement(n); var r = { name: "Video", iconClass: "fa fa-video-camera", controls: { video: { mp4_url: { name: "MP4 URL", type: "text", default: "http://webcraftplugins.com/uploads/example_video.mp4" }, webm_url: { name: "WEBM URL", type: "text", default: "http://webcraftplugins.com/uploads/example_video.webm" }, ogv_url: { name: "OGV URL", type: "text", default: "http://webcraftplugins.com/uploads/example_video.ogv" }, video_is_a_link: { name: "Video is a Link", type: "switch", default: 0 }, link_to: { name: "Link to", type: "text", default: "#" }, autoplay: { name: "Autoplay", type: "switch", default: 0 }, loop: { name: "Loop", type: "switch", default: 0 }, controls: { name: "Controls", type: "switch", default: 0 } } }, useFontControls: !1, controlGroupIcons: { video: "fa fa-video-camera" }, content: function() { var e = ""; 1 == parseInt(this.controls.video.video_is_a_link.getVal(), 10) && (e += ''); var t = ""; return 1 == parseInt(this.controls.video.autoplay.getVal(), 10) && (t += " autoplay "), 1 == parseInt(this.controls.video.loop.getVal(), 10) && (t += " loop "), 1 == parseInt(this.controls.video.controls.getVal(), 10) && (t += " controls "), e += "', 1 == parseInt(this.controls.video.video_is_a_link.getVal(), 10) && (e += ""), e }, render: function(e) { var t = ""; 1 == parseInt(e.video.video_is_a_link, 10) && (t += ''); var a = ""; return 1 == parseInt(e.video.autoplay, 10) && (a += " autoplay "), 1 == parseInt(e.video.loop, 10) && (a += " loop "), 1 == parseInt(e.video.controls, 10) && (a += " controls "), t += "', 1 == parseInt(e.video.video_is_a_link, 10) && (t += ""), t } }; e.squaresRegisterElement && e.squaresRegisterElement(r), e.squaresRendererRegisterElement(r); var i = { name: "YouTube", iconClass: "fa fa-youtube", useStyleControls: !1, useFontControls: !1, controls: { youtube: { embed_code: { name: "Embed Code", type: "textarea", default: '' }, allow_fullscreen: { name: "Allow Fullscreen", type: "switch", default: 1 }, iframe_width: { name: "iframe Width", type: "int", default: 320 }, iframe_auto_width: { name: "iframe Auto Width", type: "switch", default: 1 }, iframe_height: { name: "iframe Height", type: "int", default: 320 } } }, controlGroupIcons: { youtube: "fa fa-youtube" }, content: function() { var e = this.controls.youtube.embed_code.getVal(), t = ""; return t += '
', e = e.replace("allowfullscreen", ""), 1 == parseInt(this.controls.youtube.allow_fullscreen.getVal(), 10) && -1 == e.indexOf("allowfullscreen") && (e = e.replace(">", " allowfullscreen>")), t += e = (e = 1 == parseInt(this.controls.youtube.iframe_auto_width.getVal(), 10) ? e.replace(/width="\d+"/g, 'width="100%"') : e.replace(/width="\d+"/g, 'width="' + this.controls.youtube.iframe_width.getVal() + 'px"')).replace(/height="\d+"/g, 'height="' + this.controls.youtube.iframe_height.getVal() + 'px"'), t += "
" }, render: function(e) { var t = e.youtube.embed_code, a = ""; return a += '
', t = t.replace("allowfullscreen", ""), 1 == parseInt(e.youtube.allow_fullscreen, 10) && -1 == t.indexOf("allowfullscreen") && (t = t.replace(">", " allowfullscreen>")), a += t = (t = 1 == parseInt(e.youtube.iframe_auto_width, 10) ? t.replace(/width="\d+"/g, 'width="100%"') : t.replace(/width="\d+"/g, 'width="' + e.youtube.iframe_width + 'px"')).replace(/height="\d+"/g, 'height="' + e.youtube.iframe_height + 'px"'), a += "
" } }; e.squaresRegisterElement && e.squaresRegisterElement(i), e.squaresRendererRegisterElement(i); var d = { name: "Button", iconClass: "fa fa-link", controls: { button: { text: { name: "Text", type: "text", default: "Button" }, link_to: { name: "Link to", type: "text", default: "#" }, new_tab: { name: "Open in New Tab", type: "switch", default: 0 }, display: { name: "Display", type: "button group", options: ["inline-block", "block"], default: "inline-block" }, height: { name: "Height", type: "int", default: 44 }, bg_color: { name: "Background Color", type: "color", default: "#2196f3" }, text_color: { name: "Text Color", type: "color", default: "#ffffff" }, border_radius: { name: "Border Radius", type: "int", default: 10 }, padding: { name: "Padding Left/Right", type: "int", default: 20 } } }, controlGroupIcons: { button: "fa fa-link" }, content: function() { var e = ""; e += "display: " + this.controls.button.display.getVal() + "; ", e += "height: " + this.controls.button.height.getVal() + "px; ", e += "line-height: " + this.controls.button.height.getVal() + "px; ", e += "background-color: " + this.controls.button.bg_color.getVal() + "; ", e += "color: " + this.controls.button.text_color.getVal() + "; ", e += "border-radius: " + this.controls.button.border_radius.getVal() + "px; ", e += "padding-left: " + this.controls.button.padding.getVal() + "px; ", e += "padding-right: " + this.controls.button.padding.getVal() + "px; "; var t = ""; return 1 == parseInt(this.controls.button.new_tab.getVal(), 10) && (t = 'target="_blank"'), '
' + this.controls.button.text.getVal() + "
" }, render: function(e) { var t = ""; t += "display: " + e.button.display + "; ", t += "height: " + e.button.height + "px; ", t += "line-height: " + e.button.height + "px; ", t += "background-color: " + e.button.bg_color + "; ", t += "color: " + e.button.text_color + "; ", t += "border-radius: " + e.button.border_radius + "px; ", t += "padding-left: " + e.button.padding + "px; ", t += "padding-right: " + e.button.padding + "px; "; var a = ""; return 1 == parseInt(e.button.new_tab, 10) && (a = 'target="_blank"'), '
' + e.button.text + "
" } }; e.squaresRegisterElement && e.squaresRegisterElement(d), e.squaresRendererRegisterElement(d) }(jQuery, window, document); ! function($, window, document, undefined) { "use strict"; var fullscreenMap = undefined, fullscreenMapParent = undefined, touch = !1; $.imageMapProInitialized = function(t) {}, $.imageMapProEventHighlightedShape = function(t, i) {}, $.imageMapProEventUnhighlightedShape = function(t, i) {}, $.imageMapProEventClickedShape = function(t, i) {}, $.imageMapProEventOpenedTooltip = function(t, i) {}, $.imageMapProEventClosedTooltip = function(t, i) {}, $.imageMapProHighlightShape = function(t, i) { var e = $('[data-shape-title="' + i + '"]').data("index"), s = instances[t].settings.spots[e]; if (-1 == instances[t].apiHighlightedShapes.indexOf(e) && instances[t].apiHighlightedShapes.push(e), instances[t].connectedShapes[s.id]) for (var a = 0; a < instances[t].connectedShapes[s.id].length; a++) { var n = instances[t].connectedShapes[s.id][a].index; - 1 == instances[t].apiHighlightedShapes.indexOf(n) && instances[t].apiHighlightedShapes.push(n) } instances[t].highlightShape(e, !0) }, $.imageMapProUnhighlightShape = function(t, i) { var e = $('[data-shape-title="' + i + '"]').data("index"), s = instances[t].settings.spots[e]; if (-1 != instances[t].apiHighlightedShapes.indexOf(e)) { var a = instances[t].apiHighlightedShapes.indexOf(e); instances[t].apiHighlightedShapes.splice(a, 1) } if (instances[t].connectedShapes[s.id]) for (var n = 0; n < instances[t].connectedShapes[s.id].length; n++) { var o = instances[t].connectedShapes[s.id][n].index, h = instances[t].apiHighlightedShapes.indexOf(o); instances[t].apiHighlightedShapes.splice(h, 1), instances[t].unhighlightShape(o) } instances[t].unhighlightShape(e) }, $.imageMapProOpenTooltip = function(t, i) { var e = $('[data-shape-title="' + i + '"]').data("index"); instances[t].showTooltip(e), instances[t].updateTooltipPosition(e), -1 == instances[t].apiOpenedTooltips.indexOf(e) && instances[t].apiOpenedTooltips.push(e) }, $.imageMapProHideTooltip = function(t, i) { var e = $('[data-shape-title="' + i + '"]').data("index"); if (-1 != instances[t].apiOpenedTooltips.indexOf(e)) { var s = instances[t].apiOpenedTooltips.indexOf(e); instances[t].apiOpenedTooltips.splice(s, 1) } instances[t].hideTooltip(e) }, $.imageMapProReInitMap = function(t) { instances[t].init() }, $.imageMapProIsMobile = function() { return isMobile() }; var pluginName = "imageMapPro", default_settings = $.imageMapProEditorDefaults, default_spot_settings = $.imageMapProShapeDefaults, instances = new Array; function Plugin(t, i) { this.element = t, this.settings = $.extend(!0, {}, default_settings, i), this.root = $(t), this.wrap = undefined, this.zoomWrap = undefined, this.translateWrap = undefined, this.ui = undefined, this.uiNavigatorRoot = undefined, this.uiNavigatorWindowWidth = undefined, this.uiNavigatorWindowHeight = undefined, this.uiNavigatorImage = undefined, this.shapeContainer = undefined, this.shapeSvgContainer = undefined, this.fullscreenTooltipsContainer = undefined, this.visibleFullscreenTooltip = undefined, this.visibleFullscreenTooltipIndex = undefined, this.bodyOverflow = undefined, this.highlightedShapes = new Array, this.connectedShapes = new Array, this.openedTooltips = new Array, this.apiHighlightedShapes = new Array, this.apiOpenedTooltips = new Array, this.targetZoom = 1, this.zoom = 1, this.maxZoomLevel = 8, this.zoomMultiplier = 1.45, this.targetPanX = 0, this.actualPanX = 0, this.targetPanY = 0, this.actualPanY = 0, this.initialPanX = 0, this.initialPanY = 0, this.panDeltaY = 0, this.ix = 0, this.iy = 0, this.lastX = 0, this.lastY = 0, this.pinchInitial = [{ x: 0, y: 0 }, { x: 0, y: 0 }], this.pinchInitialDistance = 0, this.pinchInitialZoom = 0, this.navigatorRatio = 1, this.navigatorMarginX = 0, this.navigatorMarginY = 0, this.touch = !1, this.fullscreenTooltipVisible = !1, this.panning = !1, this.didPan = !1, this.panningOnNavigator = !1, this.pinching = !1, this.init() } function hexToRgb(t) { var i = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t); return i ? { r: parseInt(i[1], 16), g: parseInt(i[2], 16), b: parseInt(i[3], 16) } : null } function screenToImageMapSpace(t, i, e) { return { x: Math.round(1e3 * (t - e.offset().left)) / 1e3, y: Math.round(1e3 * (i - e.offset().top)) / 1e3 } } function isPointInsideRect(t, i, e, s, a, n) { return t >= e && t <= e + a && i >= s && i <= s + n } function isPointInsidePolygon(t, i, e) { for (var s = !1, a = 0, n = e.length - 1; a < e.length; n = a++) { var o = e[a][0], h = e[a][1], l = e[n][0], r = e[n][1]; h > i != r > i && t < (l - o) * (i - h) / (r - h) + o && (s = !s) } return s } function isPointInsideEllipse(t, i, e, s, a, n) { return (t - e) * (t - e) / (a * a) + (i - s) * (i - s) / (n * n) <= 1 } function fitRectToScreen(t, i, e, s) { return t < 0 && (t = 0), i < 0 && (i = 0), t > $(document).width() - e && (t = $(document).width() - e), i > $(document).height() - s && (i = $(document).height() - s), { x: t, y: i } } function shuffle(t) { for (var i, e, s = t.length; 0 !== s;) e = Math.floor(Math.random() * s), i = t[s -= 1], t[s] = t[e], t[e] = i; return t } function isMobile() { return !!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) } function lerp(t, i, e) { return t * (1 - e) + i * e } $.extend(Plugin.prototype, { init: function() { var t = this; t.parseSettings(), instances[this.settings.general.name] = this, this.id = 100 * Math.random(); for (var i = 0; i < t.settings.spots.length; i++) { var e = t.settings.spots[i], s = $.extend(!0, {}, default_spot_settings); e = $.extend(!0, s, e), t.settings.spots[i] = $.extend(!0, {}, e), t.settings.spots[i].title && 0 != t.settings.spots[i].title.length || (t.settings.spots[i].title = t.settings.spots[i].id), "" != e.connected_to && (this.connectedShapes[e.connected_to] || (this.connectedShapes[e.connected_to] = new Array), this.connectedShapes[e.connected_to].push({ id: e.id, index: i })) } var a = new Image; a.src = t.settings.image.url, t.loadImage(a, function() {}, function() { var i = ""; if (i += '
', i += '
', 1 == parseInt(t.settings.zooming.enable_zooming, 10) && 1 == parseInt(t.settings.zooming.enable_navigator, 10) && (i += '
', i += ' ', i += ' ', i += '
', i += ' ', i += "
"), 1 == parseInt(t.settings.zooming.enable_zooming, 10) && 1 == parseInt(t.settings.zooming.enable_zoom_buttons, 10) && (i += '
', i += '
'), 1 == parseInt(t.settings.layers.enable_layers, 10)) { i += '
', i += '
', i += '
', i += ' ", i += "
" } i += "
", i += '
', i += '
', i += '
', i += ' ', i += "
", i += "
", i += "
", i += "
", t.root.html(i), t.wrap = t.root.find(".imp-wrap"), t.zoomWrap = t.root.find(".imp-zoom-wrap"), t.translateWrap = t.root.find(".imp-translate-wrap"), t.ui = t.wrap.find(".imp-ui"), t.root.addClass("imp-initialized"), t.root.attr("data-image-map-pro-id", t.settings.id), t.centerImageMap(), t.drawShapes(), t.addTooltips(), t.initFullscreen(), t.initZoom(), t.adjustSize(), t.initNavigator(), t.initLayers(), t.events(), t.APIEvents(), t.animateShapesLoop(), $.imageMapProInitialized(t.settings.general.name) }), $(window).off("resize." + this.settings.general.id + this.settings.runtime.is_fullscreen), $(window).on("resize." + this.settings.general.id + this.settings.runtime.is_fullscreen, function() { t.openedTooltips.length > 0 && t.updateTooltipPosition(t.openedTooltips[t.openedTooltips.length - 1]), t.resetZoomAndPan(), fullscreenMap && fullscreenMap.adjustSize(), t.adjustNavigatorSize() }) }, parseSettings: function() { this.settings.general.image_url && (this.settings.image.url = this.settings.general.image_url) }, loadImage: function(t, i, e) { t.complete && t.naturalWidth !== undefined && t.naturalHeight !== undefined ? e() : (i(), $(t).on("load", function() { $(t).off("load"), e() })) }, centerImageMap: function() { 1 == parseInt(this.settings.general.center_image_map, 10) && this.wrap.css({ margin: "0 auto" }) }, adjustSize: function() { var t = this; if (1 == parseInt(t.settings.runtime.is_fullscreen, 10)) { var i = $(window).width() / $(window).height(), e = t.settings.general.width / t.settings.general.height; return e < i ? (t.settings.general.width = $(window).height() * e, t.settings.general.height = $(window).height()) : (t.settings.general.width = $(window).width(), t.settings.general.height = $(window).width() / e), void t.wrap.css({ width: t.settings.general.width, height: t.settings.general.height }) } if (1 == parseInt(t.settings.general.responsive, 10)) { if (1 == parseInt(t.settings.general.preserve_quality, 10)) { t.settings.general.naturalWidth || t.settings.general.width; t.wrap.css({ "max-width": t.settings.general.naturalWidth }) } } else t.wrap.css({ width: t.settings.general.width, height: t.settings.general.height }) }, drawShapes: function() { for (var t = this, i = 0; i < t.settings.spots.length; i++) { if ((h = t.settings.spots[i]).x = parseFloat(h.x), h.y = parseFloat(h.y), h.width = parseFloat(h.width), h.height = parseFloat(h.height), h.default_style.stroke_width = parseInt(h.default_style.stroke_width), h.mouseover_style.stroke_width = parseInt(h.mouseover_style.stroke_width), "poly" == h.type) for (var e = 0; e < h.points.length; e++) h.points[e].x = parseFloat(h.points[e].x), h.points[e].y = parseFloat(h.points[e].y) } t.settings.general.width = parseInt(t.settings.general.width), t.settings.general.height = parseInt(t.settings.general.height), t.zoomWrap.prepend('
'), t.shapeContainer = t.wrap.find(".imp-shape-container"); var s = "", a = t.settings.general.width, n = t.settings.general.height; 1 == parseInt(t.settings.general.responsive, 10) && (a = t.settings.general.naturalWidth, n = t.settings.general.naturalHeight); var o = ''; for (i = 0; i < t.settings.spots.length; i++) if (1 != parseInt(t.settings.layers.enable_layers, 10) || parseInt(t.settings.spots[i].layerID, 10) == parseInt(t.settings.runtime.layerID)) { var h = t.settings.spots[i], l = this.calcStyles(h.default_style, i); if ("spot" == h.type) if (1 == parseInt(h.default_style.use_icon, 10)) { var r = "imp-shape-spot"; if (1 == parseInt(h.default_style.icon_is_pin, 10) && (r += " imp-shape-spot-pin"), s += '
', s += ' ', s += "
" } if ("custom" == h.default_style.icon_type && h.default_style.icon_url.length > 0 && (s += ''), 1 == parseInt(h.default_style.icon_shadow, 10)) { var g = ""; g += "width: " + h.width + "px;", g += "height: " + h.height + "px;", s += '
' } s += "" } else s += '
'), t.fullscreenTooltipsContainer = $('.imp-fullscreen-tooltips-container[data-image-map-id="' + t.settings.id + '"]')); for (var i = "", e = 0; e < t.settings.spots.length; e++) { var s = "", a = hexToRgb((n = t.settings.spots[e]).tooltip_style.background_color) || { r: 0, b: 0, g: 0 }; if (s += "padding: " + n.tooltip_style.padding + "px;", s += "background: rgba(" + a.r + ", " + a.g + ", " + a.b + ", " + n.tooltip_style.background_opacity + ");", "none" == t.settings.tooltips.tooltip_animation && (s += "opacity: 0;"), "fade" == t.settings.tooltips.tooltip_animation && (s += "opacity: 0;", s += "transition-property: opacity;-moz-transition-property: opacity;-webkit-transition-property: opacity;"), "grow" == t.settings.tooltips.tooltip_animation && (s += "transform: scale(0, 0);-moz-transform: scale(0, 0);-webkit-transform: scale(0, 0);", s += "transition-property: transform;-moz-transition-property: -moz-transform;-webkit-transition-property: -webkit-transform;", s += "transform-origin: 50% 50%;-moz-transform-origin: 50% 50%;-webkit-transform-origin: 50% 50%;"), i += '
', i += '
', "plain-text" == n.tooltip_content.content_type) { s = ""; i += '
' + n.tooltip_content.plain_text + "
" } else n.tooltip_content.squares_json ? i += $.squaresRendererRenderObject(n.tooltip_content.squares_json) : i += $.squaresRendererRenderObject(n.tooltip_content.squares_settings); i += "
" } t.fullscreenTooltipsContainer.html(i) } else { for (i = "", e = 0; e < t.settings.spots.length; e++) { var n; s = "", a = hexToRgb((n = t.settings.spots[e]).tooltip_style.background_color) || { r: 0, b: 0, g: 0 }; if (s += "border-radius: " + n.tooltip_style.border_radius + "px;", s += "padding: " + n.tooltip_style.padding + "px;", s += "background: rgba(" + a.r + ", " + a.g + ", " + a.b + ", " + n.tooltip_style.background_opacity + ");", "none" == t.settings.tooltips.tooltip_animation && (s += "opacity: 0;"), "fade" == t.settings.tooltips.tooltip_animation && (s += "opacity: 0;", s += "transition-property: opacity;-moz-transition-property: opacity;-webkit-transition-property: opacity;"), "grow" == t.settings.tooltips.tooltip_animation && (s += "transform: scale(0, 0);-moz-transform: scale(0, 0);-webkit-transform: scale(0, 0);", s += "transition-property: transform;-moz-transition-property: -moz-transform;-webkit-transition-property: -webkit-transform;", "top" == n.tooltip_style.position && (s += "transform-origin: 50% 100%;-moz-transform-origin: 50% 100%;-webkit-transform-origin: 50% 100%;"), "bottom" == n.tooltip_style.position && (s += "transform-origin: 50% 0%;-moz-transform-origin: 50% 0%;-webkit-transform-origin: 50% 0%;"), "left" == n.tooltip_style.position && (s += "transform-origin: 100% 50%;-moz-transform-origin: 100% 50%;-webkit-transform-origin: 100% 50%;"), "right" == n.tooltip_style.position && (s += "transform-origin: 0% 50%;-moz-transform-origin: 0% 50%;-webkit-transform-origin: 0% 50%;")), i += '
', "top" == n.tooltip_style.position && (i += '
'), "bottom" == n.tooltip_style.position && (i += '
'), "left" == n.tooltip_style.position && (i += '
'), "right" == n.tooltip_style.position && (i += '
'), "plain-text" == n.tooltip_content.content_type) { s = ""; i += '
' + n.tooltip_content.plain_text + "
" } else n.tooltip_content.squares_json ? i += $.squaresRendererRenderObject(n.tooltip_content.squares_json) : i += $.squaresRendererRenderObject(n.tooltip_content.squares_settings); i += "
" } t.wrap.prepend(i) } }, initFullscreen: function() { if (1 == parseInt(this.settings.fullscreen.enable_fullscreen_mode, 10)) { var t = ""; t += "background: " + this.settings.fullscreen.fullscreen_button_color + "; ", t += "color: " + this.settings.fullscreen.fullscreen_button_text_color + "; "; var i = ''; 1 == parseInt(this.settings.runtime.is_fullscreen, 10) && (i = ''); var e = "Go Fullscreen"; 1 == parseInt(this.settings.runtime.is_fullscreen, 10) && (e = "Close Fullscreen"); var s = ""; "icon" == this.settings.fullscreen.fullscreen_button_type && (s += i), "text" == this.settings.fullscreen.fullscreen_button_type && (s += e), "icon_and_text" == this.settings.fullscreen.fullscreen_button_type && (s += i + " " + e); var a = ""; "icon" == this.settings.fullscreen.fullscreen_button_type && (a += "imp-fullscreen-button-icon-only"); var n = ""; n += '
', n += s, n += "
", this.ui.append(n), 1 == parseInt(this.settings.runtime.is_fullscreen, 10) && ($(window).scrollTop(0), fullscreenMap = this); var o = this.ui.find(".imp-fullscreen-button"); 1 != parseInt(this.settings.fullscreen.fullscreen_button_position, 10) && 4 != parseInt(this.settings.fullscreen.fullscreen_button_position, 10) || o.css({ "margin-left": -o.outerWidth() / 2 }), 1 == parseInt(this.settings.fullscreen.start_in_fullscreen_mode, 10) && 0 == this.settings.runtime.is_fullscreen && this.toggleFullscreen() } }, initNavigator: function() { 1 == parseInt(this.settings.zooming.enable_zooming, 10) && 1 == parseInt(this.settings.zooming.enable_navigator, 10) && (this.uiNavigatorRoot = this.ui.find(".imp-ui-navigator-root"), this.uiNavigatorImage = this.ui.find(".imp-ui-navigator-window-image"), this.adjustNavigatorSize()) }, initLayers: function() { if (0 != parseInt(this.settings.layers.enable_layers, 10)) { for (var t = !1, i = 0; i < this.settings.layers.layers_list.length; i++) parseInt(this.settings.layers.layers_list[i].id, 10) == parseInt(this.settings.runtime.layerID, 10) && (t = !0); t || (this.settings.runtime.layerID = this.settings.layers.layers_list[0].id), this.wrap.find(".imp-ui-layers-select").val(this.settings.runtime.layerID) } }, initZoom: function() { 1 == parseInt(this.settings.zooming.enable_zooming, 10) && (this.zoom = 1, this.targetZoom = 1, this.targetPanX = 0, this.actualPanX = 0, this.targetPanY = 0, this.actualPanY = 0, this.initialPanX = 0, this.initialPanY = 0, this.panDeltaY = 0, 1 == parseInt(this.settings.zooming.limit_max_zoom_to_image_size, 10) ? this.maxZoomLevel = this.settings.general.naturalWidth / this.wrap.width() : this.maxZoomLevel = this.settings.zooming.max_zoom) }, adjustNavigatorSize: function() { if (0 != parseInt(this.settings.zooming.enable_zooming, 10) && 0 != parseInt(this.settings.zooming.enable_navigator, 10)) if (1 == parseInt(this.settings.runtime.is_fullscreen, 10)) { this.navigatorRatio = this.uiNavigatorRoot.width() / this.settings.general.width; var t = this.settings.general.naturalWidth / this.settings.general.naturalHeight, i = window.innerWidth / window.innerHeight, e = 0, s = 0; t < i ? t < 1 ? (e = 150 * t, s = 150, this.uiNavigatorWindowWidth = s * i, this.uiNavigatorWindowHeight = s, this.navigatorMarginX = e / 2 - this.uiNavigatorWindowWidth / 2, this.navigatorMarginY = 0) : (e = 150, s = 150 / t, this.uiNavigatorWindowWidth = s * i, this.uiNavigatorWindowHeight = s, this.navigatorMarginX = e / 2 - this.uiNavigatorWindowWidth / 2, this.navigatorMarginY = 0) : t < 1 ? (e = 150 * t, s = 150, this.uiNavigatorWindowWidth = e, this.uiNavigatorWindowHeight = e / i, this.navigatorMarginX = 0, this.navigatorMarginY = s / 2 - this.uiNavigatorWindowHeight / 2) : (e = 150, s = 150 / t, this.uiNavigatorWindowWidth = e, this.uiNavigatorWindowHeight = e / i, this.navigatorMarginX = 0, this.navigatorMarginY = s / 2 - this.uiNavigatorWindowHeight / 2) } else this.navigatorRatio = this.uiNavigatorRoot.width() / this.wrap.width(), this.uiNavigatorWindowWidth = this.uiNavigatorRoot.width(), this.uiNavigatorWindowHeight = this.uiNavigatorRoot.height() }, measureTooltipSize: function(t) { if (!("always" == this.settings.tooltips.fullscreen_tooltips || "mobile-only" == this.settings.tooltips.fullscreen_tooltips && isMobile())) { var i = this.settings.spots[t], e = this.wrap.find('.imp-tooltip[data-index="' + t + '"]'); 0 == parseInt(i.tooltip_style.auto_width, 10) && e.css({ width: i.tooltip_style.width }), e.data("imp-measured-width", e.outerWidth()), e.data("imp-measured-height", e.outerHeight()) } }, animateShapesLoop: function() { if ("none" != this.settings.general.pageload_animation) for (var t = 750 / this.settings.spots.length, i = shuffle(this.settings.spots.slice()), e = 0; e < i.length; e++) this.animateShape(i[e], t * e) }, animateShape: function(t, i) { var e = this, s = $("#" + t.id); setTimeout(function() { "fade" == e.settings.general.pageload_animation && s.css({ opacity: t.default_style.opacity }), "grow" == e.settings.general.pageload_animation && s.css({ transform: "scale(1, 1)", "-moz-transform": "scale(1, 1)", "-webkit-transform": "scale(1, 1)" }) }, i) }, events: function() { var t = this; this.wrap.off("mousedown"), this.wrap.on("mousedown", function(i) { touch || t.handleEventStart(i) }), this.wrap.off("mousemove"), this.wrap.on("mousemove", function(i) { touch || t.handleEventMove(i) }), this.wrap.off("mouseup"), this.wrap.on("mouseup", function(i) { touch || t.handleEventEnd(i) }), this.wrap.off("mousewheel"), this.wrap.on("mousewheel", function(i) { if (!touch) return t.handleEventEnd(i), (1 != parseInt(t.settings.zooming.enable_zooming, 10) || !(i.deltaY < 0 && t.targetZoom > 1 || i.deltaY > 0 && t.targetZoom < t.maxZoomLevel)) && void 0 }), this.wrap.off("touchstart"), this.wrap.on("touchstart", function(i) { if (touch = !0, t.handleEventStart(i), t.pinching) return !1 }), this.wrap.off("touchmove"), this.wrap.on("touchmove", function(i) { return t.handleEventMove(i), (!t.panning || 0 == t.panDeltaY) && (!t.pinching && void 0) }), this.wrap.off("touchend"), this.wrap.on("touchend", function(i) { t.handleEventEnd(i) }), $(document).off("mousemove." + this.settings.id), $(document).on("mousemove." + this.settings.id, function(i) { if (!t.touch && (0 != $(i.target).closest(".imp-wrap").length && 0 != $(i.target).closest('[data-image-map-pro-id="' + t.settings.id + '"]').length || 0 != $(i.target).closest(".imp-fullscreen-tooltips-container").length || ("mouseover" == t.settings.tooltips.show_tooltips && 0 == $(i.target).closest("[data-imp-open-tooltip-on-mouseover]").length && 0 == $(i.target).closest("[data-imp-trigger-shape-on-mouseover]").length && t.hideAllTooltips(), 0 == $(i.target).closest("[data-imp-highlight-shape-on-mouseover]").length && 0 == $(i.target).closest("[data-imp-trigger-shape-on-mouseover]").length && t.unhighlightAllShapes()), t.panning)) { var e = t.getEventCoordinates(i); t.pan(e.x, e.y) } }), $(document).off("touchstart." + this.settings.id), $(document).on("touchstart." + this.settings.id, function(i) { 0 != $(i.target).closest(".imp-wrap").length && 0 != $(i.target).closest('[data-image-map-pro-id="' + t.settings.id + '"]').length || 0 != $(i.target).closest(".imp-fullscreen-tooltips-container").length || ("mouseover" == t.settings.tooltips.show_tooltips && 0 == $(i.target).closest("[data-imp-open-tooltip-on-mouseover]").length && 0 == $(i.target).closest("[data-imp-trigger-shape-on-mouseover]").length && t.hideAllTooltips(), 0 == $(i.target).closest("[data-imp-highlight-shape-on-mouseover]").length && 0 == $(i.target).closest("[data-imp-trigger-shape-on-mouseover]").length && t.unhighlightAllShapes()) }), $(document).off("mouseup." + this.settings.id), $(document).on("mouseup." + this.settings.id, function(i) { t.touch || (0 != $(i.target).closest(".imp-wrap").length && 0 != $(i.target).closest('[data-image-map-pro-id="' + t.settings.id + '"]').length || 0 != $(i.target).closest(".imp-fullscreen-tooltips-container").length || ("click" == t.settings.tooltips.show_tooltips && t.hideAllTooltips(), t.unhighlightAllShapes()), t.panning && (t.panning = !1)) }), $(document).off("touchend." + this.settings.id), $(document).on("touchend." + this.settings.id, function(i) { 0 != $(i.target).closest(".imp-wrap").length && 0 != $(i.target).closest('[data-image-map-pro-id="' + t.settings.id + '"]').length || 0 != $(i.target).closest(".imp-fullscreen-tooltips-container").length || ("click" == t.settings.tooltips.show_tooltips && t.hideAllTooltips(), t.unhighlightAllShapes()) }), $(document).off("click." + this.settings.id, ".imp-tooltip-close-button"), $(document).on("click." + this.settings.id, ".imp-tooltip-close-button", function() { t.hideAllTooltips() }), $(document).off("change." + this.settings.id, ".imp-ui-layers-select"), $(document).on("change." + this.settings.id, ".imp-ui-layers-select", function() { var i = t.wrap.find(".imp-ui-layers-select").val(); t.switchLayer(i) }) }, APIEvents: function() { var t = this; $(document).on("mouseover", "[data-imp-highlight-shape-on-mouseover]", function() { var i = $(this).data("imp-highlight-shape-on-mouseover"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"); t.highlightShape(s, !0) } }), $(document).on("mouseout", "[data-imp-highlight-shape-on-mouseover]", function() { $(this).data("imp-highlight-shape-on-mouseover"); var i = $(this).data("imp-image-map-name"); i || (i = t.settings.general.name), i == t.settings.general.name && t.unhighlightAllShapes() }), $(document).on("click", "[data-imp-highlight-shape-on-click]", function() { var i = $(this).data("imp-highlight-shape-on-click"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"), a = t.settings.spots[s]; if (t.highlightShape(s, !0), -1 == instances[e].apiHighlightedShapes.indexOf(s) && instances[e].apiHighlightedShapes.push(s), instances[e].connectedShapes[a.id]) for (var n = 0; n < instances[e].connectedShapes[a.id].length; n++) { var o = instances[e].connectedShapes[a.id][n].index; - 1 == instances[e].apiHighlightedShapes.indexOf(o) && instances[e].apiHighlightedShapes.push(o) } } }), $(document).on("mouseover", "[data-imp-unhighlight-shape-on-mouseover]", function() { var i = $(this).data("imp-unhighlight-shape-on-mouseover"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"), a = t.settings.spots[s]; if (-1 != instances[e].apiHighlightedShapes.indexOf(s)) { var n = instances[e].apiHighlightedShapes.indexOf(s); instances[e].apiHighlightedShapes.splice(n, 1) } if (instances[e].connectedShapes[a.id]) for (var o = 0; o < instances[e].connectedShapes[a.id].length; o++) { var h = instances[e].connectedShapes[a.id][o].index, l = instances[e].apiHighlightedShapes.indexOf(h); instances[e].apiHighlightedShapes.splice(l, 1), instances[e].unhighlightShape(h) } t.unhighlightShape(s) } }), $(document).on("click", "[data-imp-unhighlight-shape-on-click]", function() { var i = $(this).data("imp-unhighlight-shape-on-click"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"), a = t.settings.spots[s]; if (-1 != instances[e].apiHighlightedShapes.indexOf(s)) { var n = instances[e].apiHighlightedShapes.indexOf(s); instances[e].apiHighlightedShapes.splice(n, 1) } if (instances[e].connectedShapes[a.id]) for (var o = 0; o < instances[e].connectedShapes[a.id].length; o++) { var h = instances[e].connectedShapes[a.id][o].index, l = instances[e].apiHighlightedShapes.indexOf(h); instances[e].apiHighlightedShapes.splice(l, 1), instances[e].unhighlightShape(h) } t.unhighlightShape(s) } }), $(document).on("mouseover", "[data-imp-open-tooltip-on-mouseover]", function() { var i = $(this).data("imp-open-tooltip-on-mouseover"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"); t.showTooltip(s), t.updateTooltipPosition(s) } }), $(document).on("mouseout", "[data-imp-open-tooltip-on-mouseover]", function() { $(this).data("imp-open-tooltip-on-mouseover"); var i = $(this).data("imp-image-map-name"); i || (i = t.settings.general.name), i == t.settings.general.name && t.hideAllTooltips() }), $(document).on("click", "[data-imp-open-tooltip-on-click]", function() { var i = $(this).data("imp-open-tooltip-on-click"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"); t.showTooltip(s), t.updateTooltipPosition(s), -1 == instances[e].apiOpenedTooltips.indexOf(s) && instances[e].apiOpenedTooltips.push(s) } }), $(document).on("mouseover", "[data-imp-close-tooltip-on-mouseover]", function() { var i = $(this).data("imp-close-tooltip-on-mouseover"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"); if (-1 != instances[e].apiOpenedTooltips.indexOf(s)) { var a = instances[e].apiOpenedTooltips.indexOf(s); instances[e].apiOpenedTooltips.splice(a, 1) } t.hideTooltip(s) } }), $(document).on("click", "[data-imp-close-tooltip-on-click]", function() { var i = $(this).data("imp-close-tooltip-on-click"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"); if (-1 != instances[e].apiOpenedTooltips.indexOf(s)) { var a = instances[e].apiOpenedTooltips.indexOf(s); instances[e].apiOpenedTooltips.splice(a, 1) } t.hideTooltip(s) } }), $(document).on("mouseover", "[data-imp-trigger-shape-on-mouseover]", function() { var i = $(this).data("imp-trigger-shape-on-mouseover"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"); t.highlightShape(s, !0), t.showTooltip(s), t.updateTooltipPosition(s) } }), $(document).on("mouseout", "[data-imp-trigger-shape-on-mouseover]", function() { $(this).data("imp-trigger-shape-on-mouseover"); var i = $(this).data("imp-image-map-name"); i || (i = t.settings.general.name), i == t.settings.general.name && (t.unhighlightAllShapes(), t.hideAllTooltips()) }), $(document).on("click", "[data-imp-trigger-shape-on-click]", function() { var i = $(this).data("imp-trigger-shape-on-click"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"), a = t.settings.spots[s]; if (t.highlightShape(s, !0), t.showTooltip(s), t.updateTooltipPosition(s), -1 == instances[e].apiOpenedTooltips.indexOf(s) && instances[e].apiOpenedTooltips.push(s), -1 == instances[e].apiHighlightedShapes.indexOf(s) && instances[e].apiHighlightedShapes.push(s), instances[e].connectedShapes[a.id]) for (var n = 0; n < instances[e].connectedShapes[a.id].length; n++) { var o = instances[e].connectedShapes[a.id][n].index; - 1 == instances[e].apiHighlightedShapes.indexOf(o) && instances[e].apiHighlightedShapes.push(o) } } }), $(document).on("mouseover", "[data-imp-untrigger-shape-on-mouseover]", function() { var i = $(this).data("imp-untrigger-shape-on-mouseover"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"), a = t.settings.spots[s]; if (-1 != instances[e].apiHighlightedShapes.indexOf(s)) { var n = instances[e].apiHighlightedShapes.indexOf(s); instances[e].apiHighlightedShapes.splice(n, 1) } if (instances[e].connectedShapes[a.id]) for (var o = 0; o < instances[e].connectedShapes[a.id].length; o++) { var h = instances[e].connectedShapes[a.id][o].index, l = instances[e].apiHighlightedShapes.indexOf(h); instances[e].apiHighlightedShapes.splice(l, 1), instances[e].unhighlightShape(h) } if (t.unhighlightShape(s), -1 != instances[e].apiOpenedTooltips.indexOf(s)) { n = instances[e].apiOpenedTooltips.indexOf(s); instances[e].apiOpenedTooltips.splice(n, 1) } t.hideTooltip(s) } }), $(document).on("click", "[data-imp-untrigger-shape-on-click]", function() { var i = $(this).data("imp-untrigger-shape-on-click"), e = $(this).data("imp-image-map-name"); if (e || (e = t.settings.general.name), e == t.settings.general.name) { var s = $('[data-shape-title="' + i + '"]').data("index"), a = t.settings.spots[s]; if (-1 != instances[e].apiHighlightedShapes.indexOf(s)) { var n = instances[e].apiHighlightedShapes.indexOf(s); instances[e].apiHighlightedShapes.splice(n, 1) } if (instances[e].connectedShapes[a.id]) for (var o = 0; o < instances[e].connectedShapes[a.id].length; o++) { var h = instances[e].connectedShapes[a.id][o].index, l = instances[e].apiHighlightedShapes.indexOf(h); instances[e].apiHighlightedShapes.splice(l, 1), instances[e].unhighlightShape(h) } if (t.unhighlightShape(s), -1 != instances[e].apiOpenedTooltips.indexOf(s)) { n = instances[e].apiOpenedTooltips.indexOf(s); instances[e].apiOpenedTooltips.splice(n, 1) } t.hideTooltip(s) } }) }, disableEvents: function() { this.wrap.off("mousemove"), this.wrap.off("mouseup"), this.wrap.off("touchstart"), this.wrap.off("touchmove"), this.wrap.off("touchend"), $(document).off("mousemove." + this.settings.id), $(document).off("touchstart." + this.settings.id), $(document).off("click." + this.settings.id, ".imp-tooltip-close-button"), $(document).off("click." + this.settings.id, ".imp-fullscreen-button") }, handleEventStart: function(t) { var i = this.getEventCoordinates(t); if (1 == parseInt(this.settings.zooming.enable_zooming, 10)) { if ($(t.target).closest(".imp-ui-navigator-root").length > 0) return this.ix = i.x, this.iy = i.y, void(this.panningOnNavigator = !0); if (t.originalEvent.touches && t.originalEvent.touches.length > 1) return this.pinchInitial[0] = { x: t.originalEvent.touches[0].pageX, y: t.originalEvent.touches[0].pageY }, this.pinchInitial[1] = { x: t.originalEvent.touches[1].pageX, y: t.originalEvent.touches[1].pageY }, this.initialPanX = this.actualPanX, this.initialPanY = this.actualPanY, this.ix = (t.originalEvent.touches[0].pageX + t.originalEvent.touches[1].pageX) / 2, this.iy = (t.originalEvent.touches[0].pageY + t.originalEvent.touches[1].pageY) / 2, this.lastX = this.ix, this.lastY = this.iy, this.pinchInitialDistance = Math.sqrt(Math.pow(this.pinchInitial[1].x - this.pinchInitial[0].x, 2) + Math.pow(this.pinchInitial[1].y - this.pinchInitial[0].y, 2)), this.pinchInitialZoom = this.zoom, void(this.pinching = !0); this.panning || 0 != $(t.target).closest(".imp-ui").length || (this.ix = i.x, this.iy = i.y, this.initialPanX = this.actualPanX, this.initialPanY = this.actualPanY, this.panning = !0) } }, handleEventMove: function(t) { if (!this.fullscreenTooltipVisible) { var i = this.getEventRelativeCoordinates(t), e = this.matchShapeToCoords(i); if (1 == parseInt(this.settings.zooming.enable_zooming, 10)) { if (this.panningOnNavigator) { var s = ((n = this.getEventCoordinates(t)).x - this.uiNavigatorRoot.offset().left) / this.navigatorRatio * this.targetZoom, a = (n.y - this.uiNavigatorRoot.offset().top) / this.navigatorRatio * this.targetZoom; return void this.panTo(s, a) } if (this.pinching) return this.pinch(t), void(this.didPan = !0); if (this.panning) { var n = this.getEventCoordinates(t); return this.pan(n.x, n.y), void(this.didPan = !0) } } if (!this.isPointInsideVisibleTooltip(t) || 0 != parseInt(this.settings.tooltips.sticky_tooltips, 10)) { if (1 == $(t.target).closest(".imp-ui").length) return this.unhighlightAllShapes(), void("mouseover" == this.settings.tooltips.show_tooltips && this.hideAllTooltips()); - 1 != e && (this.didPan || (this.isShapeHighlighted(e) || (this.unhighlightAllShapes(), "mouseover" == this.settings.tooltips.show_tooltips && this.hideAllTooltips(), this.highlightShape(e, !0)), "mouseover" == this.settings.tooltips.show_tooltips && 1 == parseInt(this.settings.tooltips.enable_tooltips, 10) && 1 == parseInt(this.settings.spots[e].tooltip_style.enable_tooltip, 10) && this.showTooltip(e), this.openedTooltips.length > 0 && 1 == parseInt(this.settings.tooltips.sticky_tooltips, 10) && "mouseover" == this.settings.tooltips.show_tooltips && this.updateTooltipPosition(this.openedTooltips[this.openedTooltips.length - 1], t))), -1 == e && (this.unhighlightAllShapes(), "mouseover" == this.settings.tooltips.show_tooltips && this.hideAllTooltips()) } } }, handleEventEnd: function(t) { if (1 == parseInt(this.settings.zooming.enable_zooming, 10)) { if ("mousewheel" == t.type) return t.deltaY > 0 && this.zoomIn(t), void(t.deltaY < 0 && this.zoomOut(t)); if (this.panningOnNavigator && (this.panningOnNavigator = !1), $(t.target).closest(".imp-ui-navigator-root").length > 0) { var i = this.getEventCoordinates(t), e = (i.x - this.uiNavigatorRoot.offset().left) / this.navigatorRatio * this.targetZoom, s = (i.y - this.uiNavigatorRoot.offset().top) / this.navigatorRatio * this.targetZoom; return void this.panTo(e, s) } if ($(t.target).closest(".imp-ui-zoom-button").length > 0) return void($(t.target).closest(".imp-ui-zoom-button-zoom-in").length > 0 ? this.zoomIn() : this.zoomOut()); this.panning && (this.panning = !1), this.pinching && (this.pinching = !1) } if ($(t.target).closest(".imp-fullscreen-button").length > 0 && this.toggleFullscreen(), $(t.target).closest(".imp-ui-layer-switch-up").length > 0) for (var a = 0; a < this.settings.layers.layers_list.length; a++) if (this.settings.layers.layers_list[a].id == this.settings.runtime.layerID && a > 0) { var n = this.settings.layers.layers_list[a - 1].id; this.switchLayer(n); break } if ($(t.target).closest(".imp-ui-layer-switch-down").length > 0) for (a = 0; a < this.settings.layers.layers_list.length; a++) if (this.settings.layers.layers_list[a].id == this.settings.runtime.layerID && a < this.settings.layers.layers_list.length - 1) { n = this.settings.layers.layers_list[a + 1].id; this.switchLayer(n); break } if (0 == $(t.target).closest(".imp-tooltip").length && !this.fullscreenTooltipVisible) { if (1 == $(t.target).closest(".imp-ui").length) return this.unhighlightAllShapes(), void("mouseover" == this.settings.tooltips.show_tooltips && this.hideAllTooltips()); var o = this.getEventRelativeCoordinates(t); - 1 != (a = this.matchShapeToCoords(o)) && (this.didPan || (this.isShapeHighlighted(a) || (this.unhighlightAllShapes(), "mouseover" == this.settings.tooltips.show_tooltips && this.hideAllTooltips(), this.highlightShape(a, !0)), 1 == parseInt(this.settings.tooltips.enable_tooltips, 10) && 1 == parseInt(this.settings.spots[a].tooltip_style.enable_tooltip, 10) && this.showTooltip(a), this.openedTooltips.length > 0 && 1 == parseInt(this.settings.tooltips.sticky_tooltips, 10) && "mouseover" == this.settings.tooltips.show_tooltips && this.updateTooltipPosition(this.openedTooltips[this.openedTooltips.length - 1], t)), this.performClickAction(a)), -1 == a && (this.hideAllTooltips(), this.didPan || this.unhighlightAllShapes()), t.originalEvent.touches && 0 == t.originalEvent.touches.length && (this.didPan = !1), t.originalEvent.touches || (this.didPan = !1) } }, getEventRelativeCoordinates: function(t) { var i, e; if ("touchstart" == t.type || "touchmove" == t.type || "touchend" == t.type || "touchcancel" == t.type) { var s = t.originalEvent.touches[0] || t.originalEvent.changedTouches[0]; i = s.pageX, e = s.pageY } else "mousedown" != t.type && "mouseup" != t.type && "mousemove" != t.type && "mouseover" != t.type && "mouseout" != t.type && "mouseenter" != t.type && "mouseleave" != t.type || (i = t.pageX, e = t.pageY); return i -= this.zoomWrap.offset().left, e -= this.zoomWrap.offset().top, { x: i = i / (this.wrap.width() * this.zoom) * 100, y: e = e / (this.wrap.height() * this.zoom) * 100 } }, getEventCoordinates: function(t) { var i, e; if ("touchstart" == t.type || "touchmove" == t.type || "touchend" == t.type || "touchcancel" == t.type) { var s = t.originalEvent.touches[0] || t.originalEvent.changedTouches[0]; i = s.pageX, e = s.pageY } else "mousedown" != t.type && "mouseup" != t.type && "mousemove" != t.type && "mouseover" != t.type && "mouseout" != t.type && "mouseenter" != t.type && "mouseleave" != t.type || (i = t.pageX, e = t.pageY); return { x: i, y: e } }, matchShapeToCoords: function(t) { for (var i = this.settings.spots.length - 1; i >= 0; i--) if (1 != parseInt(this.settings.layers.enable_layers, 10) || parseInt(this.settings.spots[i].layerID, 10) == parseInt(this.settings.runtime.layerID)) { var e = this.settings.spots[i]; if ("poly" == e.type) { var s = t.x / 100 * this.zoomWrap.width(), a = t.y / 100 * this.zoomWrap.height(); if (isPointInsidePolygon(s = s * this.settings.general.naturalWidth / this.zoomWrap.width(), a = a * this.settings.general.naturalHeight / this.zoomWrap.height(), e.vs)) return i } if ("spot" == e.type) { var n = e.width < 44 ? 44 : e.width, o = e.height < 44 ? 44 : e.height; n /= this.zoom, o /= this.zoom; var s = t.x / 100 * this.wrap.width(), a = t.y / 100 * this.wrap.height(), h = e.x / 100 * this.wrap.width() - n / 2, l = e.y / 100 * this.wrap.height() - o / 2, r = n, p = o; if (1 == parseInt(e.default_style.icon_is_pin, 10) && 1 == parseInt(e.default_style.use_icon, 10) && (l -= o / 2, e.height < 44 && (l += e.height / 2)), isPointInsideRect(s, a, h, l, r, p)) return i } if ("rect" == e.type && isPointInsideRect(t.x, t.y, e.x, e.y, e.width, e.height)) return i; if ("oval" == e.type) if (isPointInsideEllipse(s = t.x, a = t.y, e.x + e.width / 2, e.y + e.height / 2, h = e.width / 2, l = e.height / 2)) return i; e.type } return -1 }, isPointInsideVisibleTooltip: function(t) { for (var i = 0; i < this.openedTooltips.length; i++) { var e = this.getEventCoordinates(t), s = this.wrap.find('.imp-tooltip[data-index="' + this.openedTooltips[i] + '"]'), a = this.openedTooltips[i]; e.x = (e.x - this.wrap.offset().left) / this.wrap.width() * 100, e.y = (e.y - this.wrap.offset().top) / this.wrap.height() * 100; var n = 0; n = "spot" == this.settings.spots[a].type ? this.settings.spots[a].tooltip_style.buffer : this.settings.spots[a].tooltip_style.buffer * this.zoom; var o = s.outerWidth(), h = s.outerHeight(), l = s.offset().left - this.wrap.offset().left, r = s.offset().top - this.wrap.offset().top; l = l / this.wrap.width() * 100, r = r / this.wrap.height() * 100, o = o / this.wrap.width() * 100, h = h / this.wrap.height() * 100; var p = []; if ("left" == this.settings.spots[a].tooltip_style.position) p = [ [l, r], [l + o, r], [l + o + (n = n / this.wrap.width() * 100), r + h - h / 3 - h / 3], [l + o + n, r + h - h / 3], [l + o, r + h], [l, r + h] ]; if ("right" == this.settings.spots[a].tooltip_style.position) p = [ [l, r], [l + o, r], [l + o, r + h], [l, r + h], [l - (n = n / this.wrap.width() * 100), r + h - h / 3], [l - n, r + h - h / 3 - h / 3] ]; if ("top" == this.settings.spots[a].tooltip_style.position) p = [ [l, r], [l + o, r], [l + o, r + h], [l + o - o / 3, r + h + (n = n / this.wrap.height() * 100)], [l + o - o / 3 - o / 3, r + h + n], [l, r + h] ]; if ("bottom" == this.settings.spots[a].tooltip_style.position) p = [ [l, r], [l + o - o / 3 - o / 3, r - (n = n / this.wrap.height() * 100)], [l + o - o / 3, r - n], [l + o, r], [l + o, r + h], [l, r + h] ]; return !!isPointInsidePolygon(e.x, e.y, p) } }, getIndexOfShapeWithID: function(t) { for (var i = 0; i < this.settings.spots.length; i++) if (this.settings.spots[i].id == t) return i }, calcStyles: function(t, i) { var e = this.settings.spots[i], s = ""; if ("spot" == e.type) { s += "left: " + e.x + "%;", s += "top: " + e.y + "%;", s += "width: " + e.width + "px;", s += "height: " + e.height + "px;", s += "opacity: " + t.opacity + ";", s += "transform: scale(" + 1 / this.zoom + ");"; var a = -e.width / 2, n = -e.height / 2; if (0 == parseInt(e.default_style.use_icon, 10)) { var o = hexToRgb(t.background_color) || { r: 0, b: 0, g: 0 }, h = hexToRgb(t.border_color) || { r: 0, b: 0, g: 0 }; s += "border-radius: " + t.border_radius + "px;", s += "background: rgba(" + o.r + ", " + o.g + ", " + o.b + ", " + t.background_opacity + ");", s += "border-width: " + t.border_width + "px;", s += "border-style: " + t.border_style + ";", s += "border-color: rgba(" + h.r + ", " + h.g + ", " + h.b + ", " + t.border_opacity + ");" } 1 == parseInt(e.default_style.use_icon, 10) && 1 == parseInt(e.default_style.icon_is_pin, 10) && (a = -e.height), s += "margin-left: " + n + "px;", s += "margin-top: " + a + "px;" } if ("text" == e.type) { var l = hexToRgb(e.text.text_color); s += "left: " + e.x + "%;", s += "top: " + e.y + "%;", s += "font-family: " + e.text.font_family + ";", s += "font-size: " + e.text.font_size + "px;", s += "font-weight: " + e.text.font_weight + ";", s += "color: rgba(" + l.r + ", " + l.g + ", " + l.b + ", " + e.text.text_opacity + ");" } if ("rect" == e.type || "oval" == e.type) { var r = t.border_radius + "px"; "oval" == e.type && (r = "50% 50%"); o = hexToRgb(t.background_color) || { r: 0, b: 0, g: 0 }, h = hexToRgb(t.border_color) || { r: 0, b: 0, g: 0 }; s += "left: " + e.x + "%;", s += "top: " + e.y + "%;", s += "width: " + e.width + "%;", s += "height: " + e.height + "%;", s += "opacity: " + t.opacity + ";", s += "background: rgba(" + o.r + ", " + o.g + ", " + o.b + ", " + t.background_opacity + ");", s += "border-width: " + t.border_width + "px;", s += "border-style: " + t.border_style + ";", s += "border-color: rgba(" + h.r + ", " + h.g + ", " + h.b + ", " + t.border_opacity + ");", s += "border-radius: " + r + ";" } if ("poly" == e.type) { var p = hexToRgb(t.fill) || { r: 0, b: 0, g: 0 }, g = hexToRgb(t.stroke_color) || { r: 0, b: 0, g: 0 }; s += "opacity: " + t.opacity + ";", s += "fill: rgba(" + p.r + ", " + p.g + ", " + p.b + ", " + t.fill_opacity + ");", s += "stroke: rgba(" + g.r + ", " + g.g + ", " + g.b + ", " + t.stroke_opacity + ");", s += "stroke-width: " + t.stroke_width + "px;", s += "stroke-dasharray: " + t.stroke_dasharray + ";", s += "stroke-linecap: " + t.stroke_linecap + ";" } return s }, applyStyles: function(t, i) { var e = this.settings.spots[i], s = this.wrap.find("#" + e.id), a = this.calcStyles(t, i); s.attr("style", a), "spot" == e.type && s.find("path").length > 0 && s.find("path").attr("style", "fill:" + t.icon_fill) }, highlightShape: function(t, i) { var e = this.settings.spots[t]; if (i && "" != e.connected_to) { var s = this.getIndexOfShapeWithID(e.connected_to); this.highlightShape(s, !0) } else { if (this.connectedShapes[e.id]) for (var a = 0; a < this.connectedShapes[e.id].length; a++) { s = this.connectedShapes[e.id][a].index; this.highlightShape(s, !1) } this.applyStyles(this.settings.spots[t].mouseover_style, t), $.imageMapProEventHighlightedShape(this.settings.general.name, e.title), -1 == this.highlightedShapes.indexOf(t) && this.highlightedShapes.push(t) } }, unhighlightShape: function(t) { var i = this.settings.spots[t]; if (-1 == this.apiHighlightedShapes.indexOf(t)) { this.applyStyles(i.default_style, t), $.imageMapProEventUnhighlightedShape(this.settings.general.name, i.title); var e = this.highlightedShapes.indexOf(t); this.highlightedShapes.splice(e, 1) } }, unhighlightAllShapes: function() { for (var t = this.highlightedShapes.slice(0), i = 0; i < t.length; i++) this.unhighlightShape(t[i]) }, isShapeHighlighted: function(t) { for (var i = 0; i < this.highlightedShapes.length; i++) if (this.highlightedShapes[i] == t) return !0; return !1 }, performClickAction: function(i) { var s = this.settings.spots[i]; "follow-link" == s.actions.click && (0 == $("#imp-temp-link").length && $("body").append(''), $("#imp-temp-link").attr("href", s.actions.link), 1 == parseInt(s.actions.open_link_in_new_window, 10) ? $("#imp-temp-link").attr("target", "_blank") : $("#imp-temp-link").removeAttr("target"), $("#imp-temp-link")[0].click()), "run-script" == s.actions.click && eval(s.actions.script.replace("
", "")), $.imageMapProEventClickedShape(this.settings.general.name, this.settings.spots[i].title) }, showTooltip: function(t, i) { var e = this.settings.spots[t]; if ("" == e.connected_to || 1 != parseInt(e.use_connected_shape_tooltip, 10)) { if (-1 == this.openedTooltips.indexOf(t)) { if (this.openedTooltips.length > 0 && this.hideAllTooltips(), -1 == this.openedTooltips.indexOf(t) && this.openedTooltips.push(t), "mobile-only" == this.settings.tooltips.fullscreen_tooltips && isMobile() || "always" == this.settings.tooltips.fullscreen_tooltips) { this.visibleFullscreenTooltip = $('.imp-fullscreen-tooltip[data-index="' + t + '"]'), this.visibleFullscreenTooltipIndex = t, this.fullscreenTooltipsContainer.show(), this.visibleFullscreenTooltip.show(); var s = this; setTimeout(function() { s.visibleFullscreenTooltip.addClass("imp-tooltip-visible") }, 20), this.fullscreenTooltipVisible = !0, this.bodyOverflow = $("body").css("overflow"), $("body").css({ overflow: "hidden" }) } else { var a = this.wrap.find('.imp-tooltip[data-index="' + t + '"]'); a.show(), setTimeout(function() { a.addClass("imp-tooltip-visible") }, 1), this.measureTooltipSize(t), this.updateTooltipPosition(t, i) } $.imageMapProEventOpenedTooltip(this.settings.general.name, this.settings.spots[t].title) } } else { var n = this.getIndexOfShapeWithID(e.connected_to); this.showTooltip(n) } }, hideTooltip: function(t) { if (-1 == this.apiOpenedTooltips.indexOf(t)) { var i = this.openedTooltips.indexOf(t); if (this.openedTooltips.splice(i, 1), "mobile-only" == this.settings.tooltips.fullscreen_tooltips && isMobile() || "always" == this.settings.tooltips.fullscreen_tooltips) { var e = this; (s = this.fullscreenTooltipsContainer.find('.imp-fullscreen-tooltip[data-index="' + t + '"]')).removeClass("imp-tooltip-visible"), setTimeout(function() { e.fullscreenTooltipsContainer.hide(), s.hide() }, 200), this.fullscreenTooltipVisible = !1, $("body").css({ overflow: this.bodyOverflow }) } else { var s; (s = this.wrap.find('.imp-tooltip[data-index="' + t + '"]')).removeClass("imp-tooltip-visible"), setTimeout(function() { s.hide() }, 200) } $.imageMapProEventClosedTooltip(this.settings.general.name, this.settings.spots[t].title) } }, hideAllTooltips: function() { for (var t = this.openedTooltips.slice(0), i = 0; i < t.length; i++) this.hideTooltip(t[i]) }, updateTooltipPosition: function(t, i) { if (!this.fullscreenTooltipVisible) { var e, s, a, n, o, h, l, r; s = (e = this.wrap.find('.imp-tooltip[data-index="' + t + '"]')).data("imp-measured-width"), a = e.data("imp-measured-height"), r = this.settings.spots[t]; var p, g, d = this.wrap.width(), c = this.wrap.height(), u = this.wrap.offset().left, m = this.wrap.offset().top, f = window.innerWidth, v = window.innerHeight; if (1 == parseInt(this.settings.tooltips.sticky_tooltips, 10) && i) { var w = this.getEventCoordinates(i); n = w.x - u, o = w.y - m, h = 0, l = 0 } else h = r.width / 100 * d, l = r.height / 100 * c, h *= this.zoom, l *= this.zoom, n = Math.round(10 * r.x) / 10 / 100 * d, o = Math.round(10 * r.y) / 10 / 100 * c, n = n * this.zoom + this.actualPanX, o = o * this.zoom + this.actualPanY; "spot" == r.type && (n -= r.width / 2, o -= r.height / 2, h = r.width, l = r.height), "spot" == r.type && 1 == parseInt(r.default_style.icon_is_pin, 10) && "spot" == r.type && 1 == parseInt(r.default_style.use_icon, 10) && (o -= l / 2), 1 == parseInt(this.settings.runtime.is_fullscreen, 10) ? (n + u < 0 && (h = h + n + u, n = -u), n + u + h > f && (h += f - (n + u + h)), o + m < 0 && (l = l + o + m, o = -m), o + m + l > v && (l += v - (o + m + l))) : (n < 0 && (h += n, n = 0), n + h > d && (h = d - n), o < 0 && (l += o, o = 0), o + l > c && (l = c - o)), "left" == r.tooltip_style.position && (p = n - s - 20, g = o + l / 2 - a / 2), "right" == r.tooltip_style.position && (p = n + h + 20, g = o + l / 2 - a / 2), "top" == r.tooltip_style.position && (p = n + h / 2 - s / 2, g = o - a - 20), "bottom" == r.tooltip_style.position && (p = n + h / 2 - s / 2, g = o + l + 20); var y = { x: p, y: g }; 1 == parseInt(this.settings.tooltips.constrain_tooltips, 10) && ((y = fitRectToScreen(p + u, g + m, s, a)).x -= u, y.y -= m), 1 == parseInt(this.settings.runtime.is_fullscreen, 10) && (y.x += u, y.y += m), e.css({ left: y.x, top: y.y }) } }, toggleFullscreen: function() { if (0 == parseInt(this.settings.runtime.is_fullscreen, 10)) { $("body").addClass("imp-fullscreen-mode"); var t = $.extend(!0, {}, this.settings); t.runtime.is_fullscreen = 1, t.id = "999999", t.general.responsive = 0; var i = ""; i += "background: " + this.settings.fullscreen.fullscreen_background, $("body").append('
'), $("#image-map-pro-" + t.id).imageMapPro(t), this.disableEvents(), fullscreenMapParent = this } else $("body").removeClass("imp-fullscreen-mode"), $("#imp-fullscreen-wrap").remove(), this.disableEvents(), fullscreenMapParent.events() }, resetZoomAndPan: function() { this.zoom = 1, this.targetZoom = 1, this.targetPanX = 0, this.targetPanY = 0, this.actualPanX = 0, this.actualPanY = 0, this.redraw() }, zoomIn: function(t) { if (this.targetZoom < this.maxZoomLevel) { var i = this.zoom * this.zoomMultiplier, e = 0, s = 0, a = this.wrap.width(), n = this.wrap.height(); t ? (e = t.pageX, s = t.pageY) : (e = this.wrap.offset().left + a / 2, s = this.wrap.offset().top + n / 2), this.applyZoom(i, e, s) } }, zoomOut: function(t) { if (this.targetZoom > 1) { var i = this.zoom / this.zoomMultiplier, e = 0, s = 0, a = this.wrap.width(), n = this.wrap.height(); t ? (e = t.pageX, s = t.pageY) : (e = this.wrap.offset().left + a / 2, s = this.wrap.offset().top + n / 2), this.applyZoom(i, e, s) } }, applyZoom: function(t, i, e) { this.targetZoom = this.zoom, this.targetPanX = this.actualPanX, this.targetPanY = this.actualPanY, this.redraw(), t > this.maxZoomLevel && (t = this.maxZoomLevel), t < 1 && (t = 1), this.targetZoom = t; var s = this.wrap.width(), a = this.wrap.height(), n = i - this.zoomWrap.offset().left, o = e - this.zoomWrap.offset().top, h = (s * this.targetZoom - s * this.zoom) / 2, l = (a * this.targetZoom - a * this.zoom) / 2, r = h * ((s * this.zoom / 2 - n) / (s * this.zoom / 2)), p = l * ((a * this.zoom / 2 - o) / (a * this.zoom / 2)); this.targetPanX -= h, this.targetPanY -= l, this.targetPanX += r, this.targetPanY += p; for (var g = 0; g < this.settings.spots.length; g++) { var d = this.settings.spots[g]; "spot" == d.type && this.wrap.find("#" + d.id).css({ transform: "scale(" + 1 / this.targetZoom + ")" }) } this.hideAllTooltips(), this.redraw() }, pan: function(t, i) { this.actualPanX = this.initialPanX - (this.ix - t), this.actualPanY = this.initialPanY - (this.iy - i); var e = this.wrap.width(), s = this.wrap.height(), a = this.wrap.offset().left, n = this.wrap.offset().top, o = window.innerWidth, h = window.innerHeight; 1 == parseInt(this.settings.runtime.is_fullscreen, 10) ? (e * this.zoom > o ? (this.actualPanX > -a && (this.actualPanX = -a), this.actualPanX < o - e * this.targetZoom - a && (this.actualPanX = o - e * this.targetZoom - a)) : this.actualPanX = (e - e * this.targetZoom) / 2, s * this.zoom > h ? (this.actualPanY > -n && (this.actualPanY = -n), this.actualPanY < h - s * this.targetZoom - n && (this.actualPanY = h - s * this.targetZoom - n)) : this.actualPanY = (s - s * this.targetZoom) / 2) : (this.actualPanX > 0 && (this.actualPanX = 0), this.actualPanY > 0 && (this.actualPanY = 0), this.actualPanX < e - e * this.targetZoom && (this.actualPanX = e - e * this.targetZoom), this.actualPanY < s - s * this.targetZoom && (this.actualPanY = s - s * this.targetZoom)), this.panDeltaY = Math.abs(this.actualPanY - this.targetPanY), this.targetPanX = this.actualPanX, this.targetPanY = this.actualPanY, this.hideAllTooltips(), this.redraw() }, panTo: function(t, i) { var e = -t + this.wrap.width() / 2, s = -i + this.wrap.height() / 2; this.panDeltaY = Math.abs(s - this.targetPanY), this.targetPanX = e, this.targetPanY = s, this.hideAllTooltips(), this.redraw() }, pinch: function(t) { var i = (t.originalEvent.touches[0].pageX + t.originalEvent.touches[1].pageX) / 2, e = (t.originalEvent.touches[0].pageY + t.originalEvent.touches[1].pageY) / 2; this.actualPanX += i - this.lastX, this.actualPanY += e - this.lastY; var s = this.wrap.width(), a = this.wrap.height(), n = this.wrap.offset().left, o = this.wrap.offset().top, h = window.innerWidth, l = window.innerHeight; 1 == parseInt(this.settings.runtime.is_fullscreen, 10) ? (s * this.zoom > h ? (this.actualPanX > -n && (this.actualPanX = -n), this.actualPanX < h - s * this.targetZoom - n && (this.actualPanX = h - s * this.targetZoom - n)) : this.actualPanX = (s - s * this.targetZoom) / 2, a * this.zoom > l ? (this.actualPanY > -o && (this.actualPanY = -o), this.actualPanY < l - a * this.targetZoom - o && (this.actualPanY = l - a * this.targetZoom - o)) : this.actualPanY = (a - a * this.targetZoom) / 2) : (this.actualPanX > 0 && (this.actualPanX = 0), this.actualPanY > 0 && (this.actualPanY = 0), this.actualPanX < s - s * this.targetZoom && (this.actualPanX = s - s * this.targetZoom), this.actualPanY < a - a * this.targetZoom && (this.actualPanY = a - a * this.targetZoom)), this.lastX = i, this.lastY = e; var r = Math.sqrt(Math.pow(t.originalEvent.touches[1].pageX - t.originalEvent.touches[0].pageX, 2) + Math.pow(t.originalEvent.touches[1].pageY - t.originalEvent.touches[0].pageY, 2)) / this.pinchInitialDistance; this.applyZoom(this.pinchInitialZoom * r, i, e) }, redraw: function() { var t = this.wrap.width(), i = this.wrap.height(); if (1 == parseInt(this.settings.runtime.is_fullscreen, 10)) { var e = this.wrap.offset().left, s = this.wrap.offset().top, a = $(window).width(), n = $(window).height(); t * this.zoom > a ? (this.targetPanX > -e && (this.targetPanX = -e), this.targetPanX < a - t * this.targetZoom - e && (this.targetPanX = a - t * this.targetZoom - e)) : this.targetPanX = (t - t * this.targetZoom) / 2, i * this.zoom > n ? (this.targetPanY > -s && (this.targetPanY = -s), this.targetPanY < n - i * this.targetZoom - s && (this.targetPanY = n - i * this.targetZoom - s)) : this.targetPanY = (i - i * this.targetZoom) / 2 } else this.targetPanX > 0 && (this.targetPanX = 0), this.targetPanY > 0 && (this.targetPanY = 0), this.targetPanX < t - t * this.targetZoom && (this.targetPanX = t - t * this.targetZoom), this.targetPanY < i - i * this.targetZoom && (this.targetPanY = i - i * this.targetZoom); if (this.zoom = lerp(this.zoom, this.targetZoom, .1), this.actualPanX = lerp(this.actualPanX, this.targetPanX, .1), this.actualPanY = lerp(this.actualPanY, this.targetPanY, .1), Math.abs(this.zoom - this.targetZoom) < .001 && (this.zoom = this.targetZoom), Math.abs(this.actualPanX - this.targetPanX) < 1 && (this.actualPanX = this.targetPanX), Math.abs(this.actualPanY - this.targetPanY) < 1 && (this.actualPanY = this.targetPanY), this.zoomWrap.css({ transform: "scale(" + this.zoom + ", " + this.zoom + ")" }), this.translateWrap.css({ transform: "translate(" + this.actualPanX + "px, " + this.actualPanY + "px)" }), 1 == parseInt(this.settings.zooming.enable_navigator, 10)) { var o = -this.actualPanX * this.navigatorRatio / this.zoom + this.navigatorMarginX / this.zoom, h = t * this.navigatorRatio - (o + 1 * this.uiNavigatorWindowWidth / this.zoom), l = -this.actualPanY * this.navigatorRatio / this.zoom + this.navigatorMarginY / this.zoom, r = i * this.navigatorRatio - (l + 1 * this.uiNavigatorWindowHeight / this.zoom); this.uiNavigatorImage.css({ "clip-path": "inset(" + l + "px " + h + "px " + r + "px " + o + "px)", "-webkit-clip-path": "inset(" + l + "px " + h + "px " + r + "px " + o + "px)", "-moz-clip-path": "inset(" + l + "px " + h + "px " + r + "px " + o + "px)" }) } var p = this; this.zoom == this.targetZoom && this.actualPanX == this.targetPanX && this.actualPanY == this.targetPanY || window.requestAnimationFrame(function() { p.redraw() }) }, switchLayer: function(t) { this.settings.runtime.layerID = t; for (var i = 0; i < this.settings.layers.layers_list.length; i++) if (parseInt(this.settings.layers.layers_list[i].id, 10) == parseInt(this.settings.runtime.layerID, 10)) { this.settings.image.url = this.settings.layers.layers_list[i].image_url, this.settings.general.width = this.settings.layers.layers_list[i].image_width, this.settings.general.naturalWidth = this.settings.layers.layers_list[i].image_width, this.settings.general.height = this.settings.layers.layers_list[i].image_height, this.settings.general.naturalHeight = this.settings.layers.layers_list[i].image_height; break } this.init() } }), $.fn[pluginName] = function(t) { return this.each(function() { $.data(this, "plugin_" + pluginName, new Plugin(this, t)) }) } }(jQuery, window, document), function(t) { "function" == typeof define && define.amd ? define(["jquery"], t) : "object" == typeof exports ? module.exports = t : t(jQuery) }(function(t) { function i(i) { var o = i || window.event, h = l.call(arguments, 1), r = 0, g = 0, d = 0, c = 0, u = 0, m = 0; if ((i = t.event.fix(o)).type = "mousewheel", "detail" in o && (d = -1 * o.detail), "wheelDelta" in o && (d = o.wheelDelta), "wheelDeltaY" in o && (d = o.wheelDeltaY), "wheelDeltaX" in o && (g = -1 * o.wheelDeltaX), "axis" in o && o.axis === o.HORIZONTAL_AXIS && (g = -1 * d, d = 0), r = 0 === d ? g : d, "deltaY" in o && (r = d = -1 * o.deltaY), "deltaX" in o && (g = o.deltaX, 0 === d && (r = -1 * g)), 0 !== d || 0 !== g) { if (1 === o.deltaMode) { var f = t.data(this, "mousewheel-line-height"); r *= f, d *= f, g *= f } else if (2 === o.deltaMode) { var v = t.data(this, "mousewheel-page-height"); r *= v, d *= v, g *= v } if (c = Math.max(Math.abs(d), Math.abs(g)), (!n || n > c) && (n = c, s(o, c) && (n /= 40)), s(o, c) && (r /= 40, g /= 40, d /= 40), r = Math[r >= 1 ? "floor" : "ceil"](r / n), g = Math[g >= 1 ? "floor" : "ceil"](g / n), d = Math[d >= 1 ? "floor" : "ceil"](d / n), p.settings.normalizeOffset && this.getBoundingClientRect) { var w = this.getBoundingClientRect(); u = i.clientX - w.left, m = i.clientY - w.top } return i.deltaX = g, i.deltaY = d, i.deltaFactor = n, i.offsetX = u, i.offsetY = m, i.deltaMode = 0, h.unshift(i, r, g, d), a && clearTimeout(a), a = setTimeout(e, 200), (t.event.dispatch || t.event.handle).apply(this, h) } } function e() { n = null } function s(t, i) { return p.settings.adjustOldDeltas && "mousewheel" === t.type && i % 120 == 0 } var a, n, o = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"], h = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"], l = Array.prototype.slice; if (t.event.fixHooks) for (var r = o.length; r;) t.event.fixHooks[o[--r]] = t.event.mouseHooks; var p = t.event.special.mousewheel = { version: "3.1.12", setup: function() { if (this.addEventListener) for (var e = h.length; e;) this.addEventListener(h[--e], i, !1); else this.onmousewheel = i; t.data(this, "mousewheel-line-height", p.getLineHeight(this)), t.data(this, "mousewheel-page-height", p.getPageHeight(this)) }, teardown: function() { if (this.removeEventListener) for (var e = h.length; e;) this.removeEventListener(h[--e], i, !1); else this.onmousewheel = null; t.removeData(this, "mousewheel-line-height"), t.removeData(this, "mousewheel-page-height") }, getLineHeight: function(i) { var e = t(i), s = e["offsetParent" in t.fn ? "offsetParent" : "parent"](); return s.length || (s = t("body")), parseInt(s.css("fontSize"), 10) || parseInt(e.css("fontSize"), 10) || 16 }, getPageHeight: function(i) { return t(i).height() }, settings: { adjustOldDeltas: !0, normalizeOffset: !0 } }; t.fn.extend({ mousewheel: function(t) { return t ? this.bind("mousewheel", t) : this.trigger("mousewheel") }, unmousewheel: function(t) { return this.unbind("mousewheel", t) } }) });