!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:"0",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:"0",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:"Lorem Ipsum",plain_text_color:"#ffffff",squares_settings:{containers:[{id:"sq-container-403761",settings:{elements:[{settings:{name:"Paragraph",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://webcraftplugins.com/uploads/image-map-pro/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',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:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."}}},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=e&&t<=e+a&&i>=s&&i<=s+n}function isPointInsidePolygon(t,i,e){for(var s=!1,a=0,n=e.length-1;ai!=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(){this.parseSettings(),instances[this.settings.general.name]=this,this.id=100*Math.random();for(var t=0;t',1==parseInt(n.settings.zooming.enable_zooming,10)&&1==parseInt(n.settings.zooming.enable_navigator,10)&&(t+='
',t+=' ',t+=' ',t+='
',t+=' ',t+="
"),1==parseInt(n.settings.zooming.enable_zooming,10)&&1==parseInt(n.settings.zooming.enable_zoom_buttons,10)&&(t+='
',t+='
'),1==parseInt(n.settings.layers.enable_layers,10)){t+='
',t+='
',t+='
',t+=' ",t+="
"}t+=" ",t+='
',t+='
',t+='
',t+=' ',t+="
",t+="
",t+="
",t+="",n.root.html(t),n.wrap=n.root.find(".imp-wrap"),n.zoomWrap=n.root.find(".imp-zoom-wrap"),n.translateWrap=n.root.find(".imp-translate-wrap"),n.ui=n.wrap.find(".imp-ui"),n.root.addClass("imp-initialized"),n.root.attr("data-image-map-pro-id",n.settings.id),n.centerImageMap(),n.drawShapes(),n.addTooltips(),n.initFullscreen(),n.initZoom(),n.adjustSize(),n.initNavigator(),n.initLayers(),n.events(),n.APIEvents(),n.animateShapesLoop(),$.imageMapProInitialized(n.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(){n.openedTooltips.length>0&&n.updateTooltipPosition(n.openedTooltips[n.openedTooltips.length-1]),n.resetZoomAndPan(),fullscreenMap&&fullscreenMap.adjustSize(),n.adjustNavigatorSize()})},parseSettings:function(){this.settings.general.image_url&&(this.settings.image.url=this.settings.general.image_url)},loadImage:function(t,i,e){if(1==parseInt(this.settings.layers.enable_layers,10))for(var s=0;s'),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',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',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',"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;i1||i.deltaY>0&&t.targetZoom0)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))),$(t.target).is("video")||$(t.target).closest("video").length>0||-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;a0){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;a0&&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;i0&&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'),$("#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),s.find("video").trigger("pause"),s.find("iframe").each(function(){$(this).attr("src",$(this).attr("src"))})}$.imageMapProEventClosedTooltip(this.settings.general.name,this.settings.spots[t].title)}},hideAllTooltips:function(){for(var t=this.openedTooltips.slice(0),i=0;if&&(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 w={x:p,y:g};1==parseInt(this.settings.tooltips.constrain_tooltips,10)&&((w=fitRectToScreen(p+u,g+m,s,a)).x-=u,w.y-=m),1==parseInt(this.settings.runtime.is_fullscreen,10)&&(w.x+=u,w.y+=m),e.css({left:w.x,top:w.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,t.general.width=this.settings.general.naturalWidth,t.general.height=this.settings.general.naturalHeight;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.targetZoom1){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;go?(this.actualPanX>-a&&(this.actualPanX=-a),this.actualPanXh?(this.actualPanY>-n&&(this.actualPanY=-n),this.actualPanY0&&(this.actualPanX=0),this.actualPanY>0&&(this.actualPanY=0),this.actualPanXh?(this.actualPanX>-n&&(this.actualPanX=-n),this.actualPanXl?(this.actualPanY>-o&&(this.actualPanY=-o),this.actualPanY0&&(this.actualPanX=0),this.actualPanY>0&&(this.actualPanY=0),this.actualPanXa?(this.targetPanX>-e&&(this.targetPanX=-e),this.targetPanXn?(this.targetPanY>-s&&(this.targetPanY=-s),this.targetPanY0&&(this.targetPanX=0),this.targetPanY>0&&(this.targetPanY=0),this.targetPanXc)&&(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 y=this.getBoundingClientRect();u=i.clientX-y.left,m=i.clientY-y.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)}})});