jQuery(document).ready(function($){var isSimpleBannerTextSet=simpleBannerScriptParams.simple_banner_text!="";var isSimpleBannerEnabledOnPage=!simpleBannerScriptParams.pro_version_enabled||(simpleBannerScriptParams.pro_version_enabled&&!simpleBannerScriptParams.disabled_on_current_page);var isSimpleBannerVisible=isSimpleBannerTextSet&&isSimpleBannerEnabledOnPage;if(isSimpleBannerVisible){if(!simpleBannerScriptParams.wp_body_open||!simpleBannerScriptParams.wp_body_open_enabled){var closeButton=simpleBannerScriptParams.close_button_enabled?'':'';$('
' +simpleBannerScriptParams.simple_banner_text +'
'+closeButton+'
').prependTo('body');} var bodyPaddingLeft=$('body').css('padding-left') var bodyPaddingRight=$('body').css('padding-right') if(bodyPaddingLeft!="0px"){$('head').append('');} if(bodyPaddingRight!="0px"){$('head').append('');} function scrollClass(){var scroll=document.documentElement.scrollTop;if(scroll>$("#simple-banner").height()){$("#simple-banner").addClass("simple-banner-scrolling");}else{$("#simple-banner").removeClass("simple-banner-scrolling");}} window.onscroll=function(){scrollClass()};} function closeBanner(){if(!simpleBannerScriptParams.keep_site_custom_css&&document.getElementById('simple-banner-site-custom-css'))document.getElementById('simple-banner-site-custom-css').remove();if(!simpleBannerScriptParams.keep_site_custom_js&&document.getElementById('simple-banner-site-custom-js'))document.getElementById('simple-banner-site-custom-js').remove();if(document.getElementById('simple-banner-header-margin'))document.getElementById('simple-banner-header-margin').remove();if(document.getElementById('simple-banner-header-padding'))document.getElementById('simple-banner-header-padding').remove();if(document.getElementById('simple-banner'))document.getElementById('simple-banner').remove();} if(isSimpleBannerVisible){var sbCookie="simplebannerclosed";if(simpleBannerScriptParams.close_button_enabled){if(getCookie(sbCookie)==="true"){closeBanner();setCookie(sbCookie,"true",simpleBannerScriptParams.close_button_expiration);}else{document.getElementById("simple-banner-close-button").onclick=function(){closeBanner();setCookie(sbCookie,"true",simpleBannerScriptParams.close_button_expiration);};}}else{if(getCookie(sbCookie)==="true"){document.cookie="simplebannerclosed=true; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";}}} function setCookie(cname,cvalue,expiration){var d;if(expiration===''||expiration==='0'||parseInt(expiration)){var exdays=parseInt(expiration)||0;d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));}else{d=new Date(expiration);} var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/";} function getCookie(cname){var name=cname+"=";var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i{const t=new Map;return t.largestIndex=0,t.set=function(e,i){""===e?e=t.largestIndex++:/^[0-9]+$/.test(e)&&(e=parseInt(e),t.largestIndex<=e&&(t.largestIndex=e+1)),Map.prototype.set.call(t,e,i)},t};this.tree=e();const i=/^(?[a-z][-a-z0-9_:]*)(?(?:\[(?:[a-z][-a-z0-9_:]*|[0-9]*)\])*)/i;for(const[t,n]of this.formData){const s=t.match(i);if(s)if(""===s.groups.array)this.tree.set(s.groups.name,n);else{const t=[...s.groups.array.matchAll(/\[([a-z][-a-z0-9_:]*|[0-9]*)\]/gi)].map((([t,e])=>e));t.unshift(s.groups.name);const i=t.pop();t.reduce(((t,i)=>{if(/^[0-9]+$/.test(i)&&(i=parseInt(i)),t.get(i)instanceof Map)return t.get(i);const n=e();return t.set(i,n),n}),this.tree).set(i,n)}}}t.r(e),t.d(e,{date:function(){return d},email:function(){return r},file:function(){return m},maxdate:function(){return x},maxfilesize:function(){return w},maxlength:function(){return u},maxnumber:function(){return v},mindate:function(){return g},minlength:function(){return f},minnumber:function(){return h},number:function(){return c},required:function(){return o},requiredfile:function(){return a},tel:function(){return l},url:function(){return p}}),i.prototype.entries=function(){return this.tree.entries()},i.prototype.get=function(t){return this.tree.get(t)},i.prototype.getAll=function(t){if(!this.has(t))return[];const e=t=>{const i=[];if(t instanceof Map)for(const[n,s]of t)i.push(...e(s));else""!==t&&i.push(t);return i};return e(this.get(t))},i.prototype.has=function(t){return this.tree.has(t)},i.prototype.keys=function(){return this.tree.keys()},i.prototype.values=function(){return this.tree.values()};var n=i;function s({rule:t,field:e,error:i,...n}){this.rule=t,this.field=e,this.error=i,this.properties=n}const o=function(t){if(0===t.getAll(this.field).length)throw new s(this)},a=function(t){if(0===t.getAll(this.field).length)throw new s(this)},r=function(t){if(!t.getAll(this.field).every((t=>{if((t=t.trim()).length<6)return!1;if(-1===t.indexOf("@",1))return!1;if(t.indexOf("@")!==t.lastIndexOf("@"))return!1;const[e,i]=t.split("@",2);if(!/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/.test(e))return!1;if(/\.{2,}/.test(i))return!1;if(/(?:^[ \t\n\r\0\x0B.]|[ \t\n\r\0\x0B.]$)/.test(i))return!1;const n=i.split(".");if(n.length<2)return!1;for(const t of n){if(/(?:^[ \t\n\r\0\x0B-]|[ \t\n\r\0\x0B-]$)/.test(t))return!1;if(!/^[a-z0-9-]+$/i.test(t))return!1}return!0})))throw new s(this)},p=function(t){const e=t.getAll(this.field);if(!e.every((t=>{if(""===(t=t.trim()))return!1;try{return(t=>-1!==["http","https","ftp","ftps","mailto","news","irc","irc6","ircs","gopher","nntp","feed","telnet","mms","rtsp","sms","svn","tel","fax","xmpp","webcal","urn"].indexOf(t))(new URL(t).protocol.replace(/:$/,""))}catch{return!1}})))throw new s(this)},l=function(t){if(!t.getAll(this.field).every((t=>(t=(t=t.trim()).replaceAll(/[()/.*#\s-]+/g,""),/^[+]?[0-9]+$/.test(t)))))throw new s(this)},c=function(t){if(!t.getAll(this.field).every((t=>(t=t.trim(),!!/^[-]?[0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)||!!/^[-]?(?:[0-9]+)?[.][0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)))))throw new s(this)},d=function(t){if(!t.getAll(this.field).every((t=>/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t.trim()))))throw new s(this)},m=function(t){if(!t.getAll(this.field).every((t=>t instanceof File&&this.accept?.some((e=>/^\.[a-z0-9]+$/i.test(e)?t.name.toLowerCase().endsWith(e.toLowerCase()):(t=>{const e=[],i=t.match(/^(?[a-z]+)\/(?[*]|[a-z0-9.+-]+)$/i);if(i){const t=i.groups.toplevel.toLowerCase(),n=i.groups.sub.toLowerCase();for(const[s,o]of(()=>{const t=new Map;return t.set("jpg|jpeg|jpe","image/jpeg"),t.set("gif","image/gif"),t.set("png","image/png"),t.set("bmp","image/bmp"),t.set("tiff|tif","image/tiff"),t.set("webp","image/webp"),t.set("ico","image/x-icon"),t.set("heic","image/heic"),t.set("asf|asx","video/x-ms-asf"),t.set("wmv","video/x-ms-wmv"),t.set("wmx","video/x-ms-wmx"),t.set("wm","video/x-ms-wm"),t.set("avi","video/avi"),t.set("divx","video/divx"),t.set("flv","video/x-flv"),t.set("mov|qt","video/quicktime"),t.set("mpeg|mpg|mpe","video/mpeg"),t.set("mp4|m4v","video/mp4"),t.set("ogv","video/ogg"),t.set("webm","video/webm"),t.set("mkv","video/x-matroska"),t.set("3gp|3gpp","video/3gpp"),t.set("3g2|3gp2","video/3gpp2"),t.set("txt|asc|c|cc|h|srt","text/plain"),t.set("csv","text/csv"),t.set("tsv","text/tab-separated-values"),t.set("ics","text/calendar"),t.set("rtx","text/richtext"),t.set("css","text/css"),t.set("htm|html","text/html"),t.set("vtt","text/vtt"),t.set("dfxp","application/ttaf+xml"),t.set("mp3|m4a|m4b","audio/mpeg"),t.set("aac","audio/aac"),t.set("ra|ram","audio/x-realaudio"),t.set("wav","audio/wav"),t.set("ogg|oga","audio/ogg"),t.set("flac","audio/flac"),t.set("mid|midi","audio/midi"),t.set("wma","audio/x-ms-wma"),t.set("wax","audio/x-ms-wax"),t.set("mka","audio/x-matroska"),t.set("rtf","application/rtf"),t.set("js","application/javascript"),t.set("pdf","application/pdf"),t.set("swf","application/x-shockwave-flash"),t.set("class","application/java"),t.set("tar","application/x-tar"),t.set("zip","application/zip"),t.set("gz|gzip","application/x-gzip"),t.set("rar","application/rar"),t.set("7z","application/x-7z-compressed"),t.set("exe","application/x-msdownload"),t.set("psd","application/octet-stream"),t.set("xcf","application/octet-stream"),t.set("doc","application/msword"),t.set("pot|pps|ppt","application/vnd.ms-powerpoint"),t.set("wri","application/vnd.ms-write"),t.set("xla|xls|xlt|xlw","application/vnd.ms-excel"),t.set("mdb","application/vnd.ms-access"),t.set("mpp","application/vnd.ms-project"),t.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),t.set("docm","application/vnd.ms-word.document.macroEnabled.12"),t.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),t.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),t.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),t.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),t.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),t.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),t.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),t.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),t.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),t.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),t.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),t.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),t.set("potm","application/vnd.ms-powerpoint.template.macroEnabled.12"),t.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),t.set("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"),t.set("sldm","application/vnd.ms-powerpoint.slide.macroEnabled.12"),t.set("onetoc|onetoc2|onetmp|onepkg","application/onenote"),t.set("oxps","application/oxps"),t.set("xps","application/vnd.ms-xpsdocument"),t.set("odt","application/vnd.oasis.opendocument.text"),t.set("odp","application/vnd.oasis.opendocument.presentation"),t.set("ods","application/vnd.oasis.opendocument.spreadsheet"),t.set("odg","application/vnd.oasis.opendocument.graphics"),t.set("odc","application/vnd.oasis.opendocument.chart"),t.set("odb","application/vnd.oasis.opendocument.database"),t.set("odf","application/vnd.oasis.opendocument.formula"),t.set("wp|wpd","application/wordperfect"),t.set("key","application/vnd.apple.keynote"),t.set("numbers","application/vnd.apple.numbers"),t.set("pages","application/vnd.apple.pages"),t})())("*"===n&&o.startsWith(t+"/")||o===i[0])&&e.push(...s.split("|"))}return e})(e).some((e=>(e="."+e.trim(),t.name.toLowerCase().endsWith(e.toLowerCase())))))))))throw new s(this)},f=function(t){const e=t.getAll(this.field);let i=0;if(e.forEach((t=>{"string"==typeof t&&(i+=t.length)})),0!==i&&i{"string"==typeof t&&(i+=t.length)})),parseInt(this.threshold)!(parseFloat(t)!(parseFloat(this.threshold)(t=t.trim(),!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&t(t=t.trim(),!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&this.threshold{t instanceof File&&(i+=t.size)})),parseInt(this.threshold){const a=(t.rules??[]).filter((({rule:t,...i})=>"function"==typeof e[t]&&("function"!=typeof e[t].matches||e[t].matches(i,o))));if(!a.length)return new Map;const r=new n(i);return a.reduce(((t,i)=>{const{rule:n,...o}=i;if(t.get(o.field)?.error)return t;try{e[n].call({rule:n,...o},r)}catch(e){if(e instanceof s)return t.set(o.field,e)}return t.set(o.field,{})}),new Map)},...null!==(b=window.swv)&&void 0!==b?b:{}}}(); !function(){"use strict";const e=e=>Math.abs(parseInt(e,10)),t=(e,t)=>{const a=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["validating","validating"],["payment_required","payment-required"]]);a.has(t)&&(t=a.get(t)),Array.from(a.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const r=e.getAttribute("data-status");return e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),r&&r!==t&&e.classList.remove(r),t},a=(e,t,a)=>{const r=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:a});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(r)},r=e=>{const{root:t,namespace:a="contact-form-7/v1"}=wpcf7.api;return n.reduceRight(((e,t)=>a=>t(a,e)),(e=>{let r,n,{url:o,path:c,endpoint:s,headers:i,body:l,data:d,...p}=e;"string"==typeof s&&(r=a.replace(/^\/|\/$/g,""),n=s.replace(/^\//,""),c=n?r+"/"+n:r),"string"==typeof c&&(-1!==t.indexOf("?")&&(c=c.replace("?","&")),c=c.replace(/^\//,""),o=t+c),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],d&&(l=JSON.stringify(d),i["Content-Type"]="application/json");const u={code:"fetch_error",message:"You are probably offline."},f={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(o||c||window.location.href,{...p,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw f}));throw f}))),(()=>{throw u}))}))(e)},n=[];function o(e){var a,r,n,o;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const l=e;if(void 0===(null===(a=e.wpcf7)||void 0===a?void 0:a.schema))return;const d={...e.wpcf7.schema};if(null===(r=i.target)||void 0===r||!r.closest(".wpcf7-form-control-wrap[data-name]"))return;if(null!==(n=i.target)&&void 0!==n&&n.closest(".novalidate"))return;const p=new FormData,u=[];for(const e of l.querySelectorAll(".wpcf7-form-control-wrap"))if(!e.closest(".novalidate")&&(e.querySelectorAll(":where( input, textarea, select ):enabled").forEach((e=>{if(e.name)switch(e.type){case"button":case"image":case"reset":case"submit":break;case"checkbox":case"radio":e.checked&&p.append(e.name,e.value);break;case"select-multiple":for(const t of e.selectedOptions)p.append(e.name,t.value);break;case"file":for(const t of e.files)p.append(e.name,t);break;default:p.append(e.name,e.value)}})),e.dataset.name&&(u.push(e.dataset.name),e.setAttribute("data-under-validation","1"),e.dataset.name===i.target.name.replace(/\[.*\]$/,""))))break;d.rules=(null!==(o=d.rules)&&void 0!==o?o:[]).filter((e=>{let{field:t}=e;return u.includes(t)}));const f=e.getAttribute("data-status");Promise.resolve(t(e,"validating")).then((t=>{if(void 0!==swv){const t=swv.validate(d,p,i);for(const[a,{error:r}]of t)s(e,a),void 0!==r&&c(e,a,r)}})).finally((()=>{t(e,f),e.querySelectorAll(".wpcf7-form-control-wrap[data-under-validation]").forEach((e=>{e.removeAttribute("data-under-validation")}))}))}r.use=e=>{n.unshift(e)};const c=(e,t,a)=>{var r;const n=`${null===(r=e.wpcf7)||void 0===r?void 0:r.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,""),o=e.querySelector(`.wpcf7-form-control-wrap[data-name="${t}"] .wpcf7-form-control`);(()=>{const t=document.createElement("li");t.setAttribute("id",n),o&&o.id?t.insertAdjacentHTML("beforeend",`${a}`):t.insertAdjacentText("beforeend",a),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(t)})(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((t=>{if("validating"===e.getAttribute("data-status")&&!t.dataset.underValidation)return;const r=document.createElement("span");r.classList.add("wpcf7-not-valid-tip"),r.setAttribute("aria-hidden","true"),r.insertAdjacentText("beforeend",a),t.appendChild(r),t.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),t.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.classList.add("wpcf7-not-valid"),e.setAttribute("aria-describedby",n),"function"==typeof e.setCustomValidity&&e.setCustomValidity(a),e.closest(".use-floating-validation-tip")&&(e.addEventListener("focus",(e=>{r.setAttribute("style","display: none")})),r.addEventListener("click",(e=>{r.setAttribute("style","display: none")})))}))}))},s=(e,t)=>{var a,r;const n=`${null===(a=e.wpcf7)||void 0===a?void 0:a.unitTag}-ve-${t}`.replaceAll(/[^0-9a-z_-]+/gi,"");null===(r=e.wpcf7.parent.querySelector(`.screen-reader-response ul li#${n}`))||void 0===r||r.remove(),e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${t}"]`).forEach((e=>{var t;null===(t=e.querySelector(".wpcf7-not-valid-tip"))||void 0===t||t.remove(),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid"),"function"==typeof e.setCustomValidity&&e.setCustomValidity("")}))}))};function i(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(wpcf7.blocked)return l(e),void t(e,"submitting");const o=new FormData(e);n.submitter&&n.submitter.name&&o.append(n.submitter.name,n.submitter.value);const s={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(o,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:o};r({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:o,wpcf7:{endpoint:"feedback",form:e,detail:s}}).then((r=>{const n=t(e,r.status);return s.status=r.status,s.apiResponse=r,["invalid","unaccepted","spam","aborted"].includes(n)?a(e,n,s):["sent","failed"].includes(n)&&a(e,`mail${n}`,s),a(e,"submit",s),r})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&t.invalid_fields.forEach((t=>{c(e,t.field,t.message)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}r.use(((e,r)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:r,detail:n}=e.wpcf7;l(r),a(r,"beforesubmit",n),t(r,"submitting")}return r(e)}));const l=e=>{e.querySelectorAll(".wpcf7-form-control-wrap").forEach((t=>{t.dataset.name&&s(e,t.dataset.name)})),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function d(e){const n=new FormData(e),o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(n,(e=>{const t=e[0],a=e[1];return!t.match(/^_/)&&{name:t,value:a}})).filter((e=>!1!==e)),formData:n};r({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:o}}).then((r=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,t(e,"mail_sent")):t(e,"init"),o.apiResponse=r,a(e,"reset",o)})).catch((e=>console.error(e)))}r.use(((e,a)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:a,detail:r}=e.wpcf7;l(a),t(a,"resetting")}return a(e)}));const p=(e,t)=>{for(const a in t){const r=t[a];e.querySelectorAll(`input[name="${a}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${a.replaceAll(":","")}`).forEach((e=>{e.setAttribute("src",r)}));const n=/([0-9]+)\.(png|gif|jpeg)$/.exec(r);n&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${a}"]`).forEach((e=>{e.value=n[1]}))}},u=(e,t)=>{for(const a in t){const r=t[a][0],n=t[a][1];e.querySelectorAll(`.wpcf7-form-control-wrap[data-name="${a}"]`).forEach((e=>{e.querySelector(`input[name="${a}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=r,e.querySelector(`input[name="_wpcf7_quiz_answer_${a}"]`).value=n}))}};function f(t){const a=new FormData(t);t.wpcf7={id:e(a.get("_wpcf7")),status:t.getAttribute("data-status"),pluginVersion:a.get("_wpcf7_version"),locale:a.get("_wpcf7_locale"),unitTag:a.get("_wpcf7_unit_tag"),containerPost:e(a.get("_wpcf7_container_post")),parent:t.closest(".wpcf7"),schema:void 0},t.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const a=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${a}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(t),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const a=t.querySelector("input.wpcf7-free-text"),r=t.querySelector('input[type="checkbox"], input[type="radio"]');a.disabled=!r.checked,e.addEventListener("change",(e=>{a.disabled=!r.checked,e.target===r&&r.checked&&a.focus()}))}))})(t),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let a=e.value.trim();a&&!a.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==a.indexOf(".")&&(a=a.replace(/^\/+/,""),a="http://"+a),e.value=a}))}))})(t),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const a=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&a.checked||!e.classList.contains("invert")&&!a.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(t),(t=>{const a=(t,a)=>{const r=e(t.getAttribute("data-starting-value")),n=e(t.getAttribute("data-maximum-value")),o=e(t.getAttribute("data-minimum-value")),c=t.classList.contains("down")?r-a.value.length:a.value.length;t.setAttribute("data-current-value",c),t.innerText=c,n&&n{e={init:!1,...e},t.querySelectorAll(".wpcf7-character-count").forEach((r=>{const n=r.getAttribute("data-target-name"),o=t.querySelector(`[name="${n}"]`);o&&(o.value=o.defaultValue,a(r,o),e.init&&o.addEventListener("keyup",(e=>{a(r,o)})))}))};r({init:!0}),t.addEventListener("wpcf7reset",(e=>{r()}))})(t),window.addEventListener("load",(e=>{wpcf7.cached&&t.reset()})),t.addEventListener("reset",(e=>{wpcf7.reset(t)})),t.addEventListener("submit",(e=>{wpcf7.submit(t,{submitter:e.submitter}),e.preventDefault()})),t.addEventListener("wpcf7submit",(e=>{e.detail.apiResponse.captcha&&p(t,e.detail.apiResponse.captcha),e.detail.apiResponse.quiz&&u(t,e.detail.apiResponse.quiz)})),t.addEventListener("wpcf7reset",(e=>{e.detail.apiResponse.captcha&&p(t,e.detail.apiResponse.captcha),e.detail.apiResponse.quiz&&u(t,e.detail.apiResponse.quiz)})),r({endpoint:`contact-forms/${t.wpcf7.id}/feedback/schema`,method:"GET"}).then((e=>{t.wpcf7.schema=e})),t.addEventListener("change",(e=>{e.target.closest(".wpcf7-form-control")&&wpcf7.validate(t,{target:e.target})}))}document.addEventListener("DOMContentLoaded",(e=>{var t;"undefined"!=typeof wpcf7?void 0!==wpcf7.api?"function"==typeof window.fetch?"function"==typeof window.FormData?"function"==typeof NodeList.prototype.forEach?"function"==typeof String.prototype.replaceAll?(wpcf7={init:f,submit:i,reset:d,validate:o,...null!==(t=wpcf7)&&void 0!==t?t:{}},document.querySelectorAll(".wpcf7 > form").forEach((e=>{wpcf7.init(e)}))):console.error("Your browser does not support String.replaceAll()."):console.error("Your browser does not support NodeList.forEach()."):console.error("Your browser does not support window.FormData()."):console.error("Your browser does not support window.fetch()."):console.error("wpcf7.api is not defined."):console.error("wpcf7 is not defined.")}))}(); !function(o){o.imageMapProShapeDefaults={id:"spot-0",title:"",type:"spot",x:-1,y:-1,width:44,height:44,x_image_background:-1,y_image_background:-1,width_image_background:44,height_image_background:44,connected_to:"",use_connected_shape_tooltip:0,layerID:0,static: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_type:"color",background_image_url:"",background_image_opacity:1,background_image_scale:1,background_image_offset_x:0,background_image_offset_y:0,background_color:"#000000",background_opacity:.4,border_width:0,border_style:"solid",border_color:"#ffffff",border_opacity:1,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_image_url:"",background_image_opacity:1,background_image_scale:1,background_image_offset_x:0,background_image_offset_y:0,background_color:"#ffffff",background_opacity:.4,border_width:0,border_style:"solid",border_color:"#ffffff",border_opacity:1,stroke_color:"#ffffff",stroke_opacity:.75,stroke_width:0,stroke_dasharray:"0",stroke_linecap:"round",icon_fill:"#000000"},tooltip:{enable_tooltip:1},tooltip_style:{buffer:40,border_radius:10,padding:15,background_color:"#222222",background_opacity:1,position:"top",width:225,auto_width:1,offset_x:0,offset_y:0},tooltip_content:{squares_settings:{containers:[{id:"sq-container-403761",settings:{elements:[{settings:{name:"Heading",iconClass:"fa fa-header"},options:{heading:{text:"My Shape"}}}]}}]}},points:[],vs:[],svgPathCommands:[],d:"",dEditor:""},o.imageMapProEditorDefaults={id:0,editor:{previewMode:0,selected_shape:-1,transform_tooltip_mode:0,tool:"spot",zoom:1,currentLayer:0,state:{dragging:!1},shapeCounter:{spots:0,rects:0,ovals:0,polys:0,texts:0,paths:0}},runtime:{is_fullscreen:0,layerID:0,menu_search_string:"",menu_scroll:0},general:{name:"",shortcode:"",width:800,height:450,naturalWidth:800,naturalHeight:450,responsive:1,preserve_quality:1,center_image_map:0},image:{url:""},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"},shapes:{pageload_animation:"none",glowing_shapes:0,glowing_shapes_color:"#ffffff",glow_opacity:.5,stop_glowing_on_mouseover:1},tooltips:{enable_tooltips:1,show_tooltips:"mouseover",show_title_on_mouseover:0,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",hold_ctrl_to_zoom:1},layers:{enable_layers:0,layers_list:[]},shapes_menu:{enable_shapes_menu:0,detached_menu:0,menu_position:"left",enable_search:1,group_by_floor:0,hide_children_of_connected_shapes:1},custom_code:{custom_css:"",custom_js:""},spots:[]}}(jQuery,(window,document)); !function(r,e){var a=new Array;function t(t){this.settings=t,this.containers=[],this.init()}function s(t){this.settings=t,this.elements=[],this.init()}r.squaresRendererRegisterElement=function(t){a[t.name]=t},r.squaresRendererRenderObject=function(e){if("object"!=typeof e)try{e=JSON.parse(e)}catch(t){return console.log(t),console.log("Squares renderer failed to parse JSON: "),console.log(e),""}return new t(e).render()},t.prototype.init=function(){for(var t=0;t',t+=a[this.settings.name].render(this.options),t+=""}},o.prototype.generateLayoutClass=function(){if(this.settings){var t=this.options.layout;if(1!=parseInt(t.use_grid,10))return"";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-sm ")),1==parseInt(s.sm.use,10)&&(e+=s.sm.class+" ",0==parseInt(s.sm.visible,10)&&(e+="sq-hidden-md ")),1==parseInt(s.md.use,10)&&(e+=s.md.class+" ",0==parseInt(s.md.visible,10)&&(e+="sq-hidden-lg ")),1==parseInt(s.lg.use,10)&&(e+=s.lg.class+" ",0==parseInt(s.lg.visible,10)&&(e+="sq-hidden-xl ")),e}},o.prototype.generateCSS=function(){if(this.settings){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; "));var e,s=this.options.font;if(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=n(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=n(s.border_color)).r+", "+e.g+", "+e.b+", "+s.border_opacity+"); ",t+="border-radius: "+s.border_radius+"px; ";return t}}}(jQuery,(window,void document)); !function(s,o){var e={name:"Paragraph",iconClass:"fa fa-paragraph",controls:{text:{text:{name:"Text",type:"textarea",default:"Lorem ipsum dolor sit amet, consectetuer adipiscing elit."}}},controlGroupIcons:{text:"fa fa-ellipsis-h"},content:function(){var e=this.controls.text.text.getVal();return e=(e=e.replace(/\\(.)/gm,"$1")).replace(/\n/gm,"
"),'

'+e+"

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

'+t+"

"}};s.squaresRegisterElement&&s.squaresRegisterElement(e),s.squaresRendererRegisterElement(e);var t={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+""}};s.squaresRegisterElement&&s.squaresRegisterElement(t),s.squaresRendererRegisterElement(t);var a={name:"Image",iconClass:"fa fa-camera",controls:{image:{url:{name:"Image URL",type:"text",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="";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+="");var t=new Image;function a(){}return t.src=this.controls.image.url.getVal(),t.complete||t.addEventListener("load",a),e},render:function(e){var t="";1==parseInt(e.image.image_is_a_link,10)&&(t+=''),t+='',1==parseInt(e.image.image_is_a_link,10)&&(t+="");var a=new Image;function l(){s(o).trigger("squares_image_loaded")}return a.src=e.image.url,a.complete?l():a.addEventListener("load",l),t}};s.squaresRegisterElement&&s.squaresRegisterElement(a),s.squaresRendererRegisterElement(a);var l={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}};s.squaresRegisterElement&&s.squaresRegisterElement(l),s.squaresRendererRegisterElement(l);var n={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+="
"}};s.squaresRegisterElement&&s.squaresRegisterElement(n),s.squaresRendererRegisterElement(n);var r={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"'),'"},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"'),'"}};s.squaresRegisterElement&&s.squaresRegisterElement(r),s.squaresRendererRegisterElement(r)}(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){},$.imageMapProEventSwitchedFloor=function(t,i){},$.imageMapProHighlightShape=function(t,i){var e=findImageMapWithName(t);if(e){var s=findShapeWithTitle(e.settings.general.name,i);if(s){var n=s.shape,a=s.index;if(-1===e.apiHighlightedShapes.indexOf(a)&&e.apiHighlightedShapes.push(a),e.connectedShapes[n.id])for(var o=0;o$(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],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}function easeOutBounce(t,i,e,s,n){return(i/=n)<1/2.75?s*(7.5625*i*i)+e:i<2/2.75?s*(7.5625*(i-=1.5/2.75)*i+.75)+e:i<2.5/2.75?s*(7.5625*(i-=2.25/2.75)*i+.9375)+e:s*(7.5625*(i-=2.625/2.75)*i+.984375)+e}$.extend(Plugin.prototype,{init:function(t){this.parseSettings(),(instances[this.settings.general.name]=this).id=100*Math.random(),this.connectedShapes=[];for(var i=0;i',i+='
',isTrue(this.settings.zooming.enable_zooming)&&isTrue(this.settings.zooming.enable_navigator)&&(i+='
',""!=this.settings.image.url&&(i+=' ',i+=' '),i+='
',""!=this.settings.image.url&&(i+=' '),i+="
"),isTrue(this.settings.zooming.enable_zooming)&&isTrue(this.settings.zooming.enable_zoom_buttons)&&(i+='
',i+='
'),isTrue(this.settings.layers.enable_layers)){i+='
',i+='
',i+='
',i+=' ",i+="
"}if(isTrue(this.settings.zooming.enable_zooming)&&isTrue(this.settings.zooming.hold_ctrl_to_zoom)){var n="CTRL";this.mac&&(n="⌘"),i+='
',i+='
',i+='
Hold
'+n+"
to Zoom
",i+="
",i+="
"}i+="
",i+='
',i+='
',i+='
',""!=this.settings.image.url&&(i+=' '),i+="
",i+="
",i+="
",i+="",this.root.html(i),this.wrap=this.root.find(".imp-wrap"),this.zoomWrap=this.root.find(".imp-zoom-wrap"),this.translateWrap=this.root.find(".imp-translate-wrap"),this.ui=this.wrap.find(".imp-ui"),this.scrollMessage=this.wrap.find(".imp-ui-scroll-message-wrap"),this.root.addClass("imp-initialized"),this.root.attr("data-image-map-pro-id",this.settings.id),$('[data-imp-tooltips-container="'+this.settings.id+'"]').remove(),$("body").prepend('
'),this.tooltipsContainer=$('[data-imp-tooltips-container="'+this.settings.id+'"]'),this.events(),this.centerImageMap(),this.drawShapes(),this.generateShapeStyleClasses(),this.addTooltips(),this.initFullscreen(),this.initZoom(),this.drawShapesMenu(),this.adjustSize(),this.initNavigator(),this.initLayers(),this.animateShapesLoop(),$.imageMapProInitialized(this.settings.general.name),t&&t()},parseSettings:function(){this.settings.general.image_url&&(this.settings.image.url=this.settings.general.image_url);for(var t=0;t'),this.zoomWrap.prepend('
'),this.shapeContainer=this.wrap.find(".imp-shape-container"),this.imageBackgroundsContainer=this.wrap.find(".imp-image-backgrounds-container");var e="",s=this.settings.general.width,n=this.settings.general.height;isTrue(this.settings.general.responsive)&&(s=this.settings.general.naturalWidth,n=this.settings.general.naturalHeight);var a='';for(t=0;t',e+=' ',e+=" "}if("custom"===y.default_style.icon_type&&0'),isTrue(y.default_style.icon_shadow)){var p="";p+="width: "+y.width+"px;",p+="height: "+y.height+"px;",e+='
'}if(isTrue(this.settings.shapes.glowing_shapes)){var l="";l+="width: "+y.width/3+"px;",l+="height: "+y.height/3+"px;",l+="margin-left: "+-y.width/6+"px;",l+="margin-top: "+-y.height/6+"px;",l+="border-radius: "+y.width/3+"px;",l+="background: rgba("+(d=hexToRgb(this.settings.shapes.glowing_shapes_color)||{r:0,b:0,g:0}).r+", "+d.g+", "+d.b+", "+this.settings.shapes.glow_opacity+");",e+='
'}e+=""}else{var g="";if(isTrue(this.settings.shapes.glowing_shapes)){l="";l+="box-shadow: 0 0 20px 15px rgba("+(d=hexToRgb(this.settings.shapes.glowing_shapes_color)||{r:0,b:0,g:0}).r+", "+d.g+", "+d.b+", "+this.settings.shapes.glow_opacity+");",g+='
'}e+='
'}e+='
'}e+='
'}}a+="";var v="";for(t=0;t
'}this.shapeContainer.html(e+a),this.imageBackgroundsContainer.html(v)},generateShapeStyleClasses:function(){$("style#"+this.settings.id).remove();var t=document.createElement("style");$(t).attr("id",this.settings.id);for(var i="",e=0;e';var s="";if(this.responsiveShapesMenu&&(s='
'),isTrue(this.settings.shapes_menu.enable_search)&&(t+='"),t+='
',isTrue(this.settings.shapes_menu.group_by_floor)&&isTrue(this.settings.layers.enable_layers))for(var n=0;n'+a.title+"
";for(var o=0;o'+h.title+"")}}else for(o=0;o'+h.title+"")}if(t+=" ",t+="",isTrue(this.settings.shapes_menu.detached_menu))$('[data-imp-detached-menu="'+this.settings.id+'"]').html(t),this.shapesMenuWrap=$('[data-imp-detached-menu="'+this.settings.id+'"]').find(".imp-shapes-menu-wrap");else if(this.responsiveShapesMenu){this.responsiveShapesMenuWrap||($("body").append('
'),this.responsiveShapesMenuWrap=$('.imp-responsive-menu[data-imp-id="'+this.settings.id+'"]')),this.responsiveShapesMenuWrap.append(t),this.shapesMenuWrap=this.responsiveShapesMenuWrap.find(".imp-shapes-menu-wrap");var r="";r+='
',r+='',r+="
",this.ui.append(r),this.shapesMenuResponsiveButton=this.ui.find(".imp-shapes-menu-button"),0<$(".imp-ui-layers-menu-wrap").length&&$(".imp-ui-layers-menu-wrap").css({right:70}),$("#imp-fullscreen-wrap").find(".imp-fullscreen-root-wrap").removeClass("imp-shapes-menu-left"),$("#imp-fullscreen-wrap").find(".imp-fullscreen-root-wrap").removeClass("imp-shapes-menu-right")}else isTrue(this.settings.runtime.is_fullscreen)?($("#imp-fullscreen-wrap").find(".imp-shapes-menu-wrap").remove(),$("#imp-fullscreen-wrap").append(t),0===$("#imp-fullscreen-wrap").find(".imp-fullscreen-root-wrap").length&&this.root.wrap('
'),this.shapesMenuWrap=$("#imp-fullscreen-wrap").find(".imp-shapes-menu-wrap"),"left"===this.settings.shapes_menu.menu_position?$("#imp-fullscreen-wrap").find(".imp-fullscreen-root-wrap").addClass("imp-shapes-menu-left"):$("#imp-fullscreen-wrap").find(".imp-fullscreen-root-wrap").addClass("imp-shapes-menu-right")):(0===this.root.find(".imp-shapes-menu-outer-wrap").length&&this.wrap.wrap('
'),"left"===this.settings.shapes_menu.menu_position?this.root.find(".imp-shapes-menu-outer-wrap").prepend(t):this.root.find(".imp-shapes-menu-outer-wrap").append(t),this.shapesMenuWrap=this.root.find(".imp-shapes-menu-wrap"),isTrue(this.settings.shapes_menu.enable_search)?this.shapesMenuWrap.height(this.wrap.height()-73):this.shapesMenuWrap.height(this.wrap.height()));this.shapesMenuWrap.find('input[data-image-map-pro-search-id="'+this.settings.id+'"]').val(this.settings.runtime.menu_search_string),this.updateMenuSearch(),this.shapesMenuWrap.find(".imp-shapes-menu-scroll-wrap").scrollTop(this.settings.runtime.menu_scroll)}},addTooltips:function(){if("always"===this.settings.tooltips.fullscreen_tooltips||"mobile-only"===this.settings.tooltips.fullscreen_tooltips&&isMobile()){this.fullscreenTooltipsContainer||($('.imp-fullscreen-tooltips-container[data-image-map-id="'+this.settings.id+'"]').remove(),$("body").prepend('
'),this.fullscreenTooltipsContainer=$('.imp-fullscreen-tooltips-container[data-image-map-id="'+this.settings.id+'"]'));for(var t="",i=0;i',t+='
',"plain-text"===n.tooltip_content.content_type){e="";t+='
'+n.tooltip_content.plain_text+"
"}else n.tooltip_content.squares_json?t+=$.squaresRendererRenderObject(n.tooltip_content.squares_json):t+=$.squaresRendererRenderObject(n.tooltip_content.squares_settings);t+=""}}this.fullscreenTooltipsContainer.html(t)}else{for(t="",i=0;i',"top"===n.tooltip_style.position&&(t+='
'),"bottom"===n.tooltip_style.position&&(t+='
'),"left"===n.tooltip_style.position&&(t+='
'),"right"===n.tooltip_style.position&&(t+='
');e="";e+="color: "+n.tooltip_content.plain_text_color+";";var a={containers:[{id:"sq-container-403761",settings:{elements:[{settings:{name:"Paragraph",iconClass:"fa fa-paragraph"},options:{text:{text:n.title}}}]}}]};t+='
'+$.squaresRendererRenderObject(a)+"
","plain-text"===n.tooltip_content.content_type?t+='
'+n.tooltip_content.plain_text+"
":n.tooltip_content.squares_json?t+=$.squaresRendererRenderObject(n.tooltip_content.squares_json):t+=$.squaresRendererRenderObject(n.tooltip_content.squares_settings),t+=""}}this.tooltipsContainer.prepend(t),isTrue(this.settings.tooltips.sticky_tooltips)&&this.tooltipsContainer.addClass("imp-sticky-tooltips")}},initFullscreen:function(){if(isTrue(this.settings.fullscreen.enable_fullscreen_mode)){var t="";t+="background: "+this.settings.fullscreen.fullscreen_button_color+"; ",t+="color: "+this.settings.fullscreen.fullscreen_button_text_color+"; ";var i='';isTrue(this.settings.runtime.is_fullscreen)&&(i='');var e="Go Fullscreen";isTrue(this.settings.runtime.is_fullscreen)&&(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 n="";"icon"===this.settings.fullscreen.fullscreen_button_type&&(n+="imp-fullscreen-button-icon-only");var a="";a+='
',a+=s,a+="
",this.ui.append(a),isTrue(this.settings.runtime.is_fullscreen)&&($(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}),isTrue(this.settings.fullscreen.start_in_fullscreen_mode)&&0===this.settings.runtime.is_fullscreen&&(this.settings.fullscreen.start_in_fullscreen_mode=0,this.toggleFullscreen())}},initNavigator:function(){isTrue(this.settings.zooming.enable_zooming)&&isTrue(this.settings.zooming.enable_navigator)&&(this.uiNavigatorRoot=this.ui.find(".imp-ui-navigator-root"),this.uiNavigatorImage=this.ui.find(".imp-ui-navigator-window-image"),this.adjustNavigatorSize())},initLayers:function(){if(isTrue(this.settings.layers.enable_layers)){for(var t=!1,i=0;ithis.wrapOffsetLeft&&i.xthis.wrapOffsetTop&&i.ythis.wrapOffsetLeft+this.wrapWidth||e.ythis.wrapOffsetTop+this.wrapHeight)&&(n=!0),s||!n){if(isTrue(this.settings.zooming.enable_zooming)){if(this.panningOnNavigator){var a=(e.x-this.uiNavigatorRoot.offset().left)/this.navigatorRatio*this.targetZoom,o=(e.y-this.uiNavigatorRoot.offset().top)/this.navigatorRatio*this.targetZoom;this.panTo(a,o)}if(this.pinching)return this.pinch(t),void(this.didPan=!0);if(this.panning){e=this.getEventCoordinates(t);return this.pan(e.x,e.y),void(this.didPan=!0)}}if(1===$(t.target).closest(".imp-ui").length)return this.unhighlightAllShapes(),void("mouseover"===this.settings.tooltips.show_tooltips&&this.hideAllTooltips());-1!==i&&(isTrue(this.settings.shapes.glowing_shapes)&&isTrue(this.settings.shapes.stop_glowing_on_mouseover)&&this.wrap.addClass("imp-no-glow"),this.didPan||(this.isShapeHighlighted(i)||(this.unhighlightAllShapes(),"mouseover"===this.settings.tooltips.show_tooltips&&this.hideAllTooltips(),isTrue(this.settings.tooltips.show_title_on_mouseover)&&"click"===this.settings.tooltips.show_tooltips&&this.hideAllTitles(),this.highlightShape(i,!0)),isTrue(this.settings.tooltips.enable_tooltips)&&("mouseover"===this.settings.tooltips.show_tooltips&&isTrue(this.settings.spots[i].tooltip.enable_tooltip)&&this.showTooltip(i),"click"===this.settings.tooltips.show_tooltips&&isTrue(this.settings.tooltips.show_title_on_mouseover)&&isTrue(this.settings.spots[i].tooltip.enable_tooltip)&&this.showTooltipTitle(i),0this.wrapOffsetLeft&&o.xthis.wrapOffsetTop&&o.ythis.wrapOffsetLeft+this.wrapWidth||o.ythis.wrapOffsetTop+this.wrapHeight)&&!this.settings.runtime.is_fullscreen)&&(this.hideAllTooltips(),this.didPan||this.unhighlightAllShapes()),t.originalEvent.touches&&0===t.originalEvent.touches.length&&(this.didPan=!1),t.originalEvent.touches||(this.didPan=!1)}}},handleKeyDownEvent:function(t){t.ctrlKey&&(this.ctrlKeyDown=!0),t.metaKey&&(this.cmdKeyDown=!0)},handleKeyUpEvent:function(t){this.ctrlKeyDown=!1,this.cmdKeyDown=!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;0<=i;i--)if(!isTrue(this.settings.layers.enable_layers)||parseInt(this.settings.spots[i].layerID,10)===parseInt(this.settings.runtime.layerID,10)){var e=this.settings.spots[i];if(!isTrue(e.static)){if("poly"===e.type||"path"===e.type){var s=t.x/100*this.zoomWrap.width(),n=t.y/100*this.zoomWrap.height();if(isPointInsidePolygon(s=s*this.settings.general.naturalWidth/this.zoomWrap.width(),n=n*this.settings.general.naturalHeight/this.zoomWrap.height(),e.vs))return i}if("spot"===e.type){var a=e.width<44?44:e.width,o=e.height<44?44:e.height;a/=this.zoom,o/=this.zoom;s=t.x/100*this.wrap.width(),n=t.y/100*this.wrap.height();var h=e.x/100*this.wrap.width()-a/2,r=e.y/100*this.wrap.height()-o/2,p=a,l=o;if(isTrue(e.default_style.icon_is_pin)&&isTrue(e.default_style.use_icon)&&(r-=o/2,e.height<44&&(r+=e.height/2)),isPointInsideRect(s,n,h,r,p,l))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,n=t.y,e.x+e.width/2,e.y+e.height/2,h=e.width/2,r=e.height/2))return i;e.type}}return-1},matchShapeToEvent:function(t){return $(t.target).hasClass("imp-shape")||0<$(t.target).closest(".imp-shape").length?$(t.target).data("index")||$(t.target).closest(".imp-shape").data("index"):-1},isPointInsideVisibleTooltip:function(t){for(var i=0;ir&&(r=s.x),s.y>p&&(p=s.y);for(e=0;er&&(r=i[e].x),i[e].y>p&&(p=i[e].y);n=r-o,a=p-h}else"spot"===s.type?((n/=this.wrapWidth)<25&&(n=25),(a/=this.wrapHeight)<25&&(a=25)):(n=s.width,a=s.height);var l=0;a<=n&&(l=n),nthis.maxZoomLevel&&(g=this.maxZoomLevel);var d=0,u=0;if(u="spot"===s.type?(d=s.x,s.y):(d=s.x+s.width/2,s.y+s.height/2),0'),$("#imp-temp-link").attr("href",s.actions.link),isTrue(s.actions.open_link_in_new_window)?$("#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("text"!==e.type&&-1==this.openedTooltips.indexOf(t)){if(isTrue(this.settings.tooltips.show_title_on_mouseover)&&"click"===this.settings.tooltips.show_tooltips)(a=this.tooltipsContainer.find('.imp-tooltip[data-index="'+t+'"]')).find(".imp-tooltip-title").hide(),a.find(".imp-tooltip-plain-text").show(),a.find(".squares-container").show(),a.css({left:0,top:0});if(""!=e.connected_to&&isTrue(e.use_connected_shape_tooltip)){var s=this.getIndexOfShapeWithID(e.connected_to);this.showTooltip(s)}else{if(0c&&(h+=c-(a+this.wrapOffsetLeft+h)),o+this.wrapOffsetTop<0&&(r=r+o+this.wrapOffsetTop,o=-this.wrapOffsetTop),o+this.wrapOffsetTop+r>m&&(r+=m-(o+this.wrapOffsetTop+r))):(a<0&&(h+=a,a=0),a+h>this.wrapWidth&&(h=this.wrapWidth-a),o<0&&(r+=o,o=0),o+r>this.wrapHeight&&(r=this.wrapHeight-o)),"left"===g.tooltip_style.position&&(d=a-s-20,u=o+r/2-n/2),"right"===g.tooltip_style.position&&(d=a+h+20,u=o+r/2-n/2),"top"===g.tooltip_style.position&&(d=a+h/2-s/2,u=o-n-20),"bottom"===g.tooltip_style.position&&(d=a+h/2-s/2,u=o+r+20);var v={x:d,y:u};isTrue(this.settings.tooltips.constrain_tooltips)&&((v=fitRectToScreen(d+this.wrapOffsetLeft,u+this.wrapOffsetTop,s,n)).x-=this.wrapOffsetLeft,v.y-=this.wrapOffsetTop),v.x+=g.tooltip_style.offset_x/100*this.wrapWidth,v.y+=g.tooltip_style.offset_y/100*this.wrapHeight,e.css({left:v.x+this.wrapOffsetLeft-this.tooltipsContainer.offset().left,top:v.y+this.wrapOffsetTop-this.tooltipsContainer.offset().top})}},updateOpenedTooltipsPosition:function(){for(var t=0;t
'),$("#image-map-pro-"+t.id).imageMapPro(t),this.disableEvents(),fullscreenMapParent=this}},resetZoomAndPan:function(){this.zoom=1,this.targetZoom=1,this.targetPanX=0,this.targetPanY=0,this.actualPanX=0,this.actualPanY=0,this.redraw(!1)},zoomIn:function(t){if(this.targetZoomthis.maxZoomLevel&&(t=this.maxZoomLevel),t<1&&(t=1),this.targetZoom=t;var s=(this.wrapWidth*this.targetZoom-this.wrapWidth*this.zoom)/2,n=(this.wrapHeight*this.targetZoom-this.wrapHeight*this.zoom)/2;if(i&&e){var a=i-this.zoomWrap.offset().left,o=e-this.zoomWrap.offset().top,h=s*((this.wrapWidth*this.zoom/2-a)/(this.wrapWidth*this.zoom/2)),r=n*((this.wrapHeight*this.zoom/2-o)/(this.wrapHeight*this.zoom/2));this.targetPanX-=s,this.targetPanY-=n,this.targetPanX+=h,this.targetPanY+=r}0h?(this.actualPanX>-a&&(this.actualPanX=-a),this.actualPanXr?(this.actualPanY>-o&&(this.actualPanY=-o),this.actualPanY$&');i!=e?($(this).show(),$(this).html(e)):($(this).hide(),$(this).html(i))})):(this.shapesMenuWrap.removeClass("imp-searching"),$(".imp-shapes-menu-shape-title, .imp-shapes-menu-layer-title").each(function(){$(this).show(),$(this).html($(this).data("imp-content"))})),this.settings.runtime.menu_search_string=s},displayScrollMessage:function(){this.scrollMessage.fadeIn(),clearTimeout(this.hideScrollMessageTimeout);var t=this;this.hideScrollMessageTimeout=setTimeout(function(){t.scrollMessage.fadeOut()},1e3)},showResponsiveShapesMenu:function(){this.responsiveShapesMenuWrap&&(this.responsiveShapesMenuWrap.addClass("imp-responsive-menu-visible"),$("body").addClass("imp-noscroll"))},hideResponsiveShapesMenu:function(){this.responsiveShapesMenuWrap&&(this.responsiveShapesMenuWrap.removeClass("imp-responsive-menu-visible"),$("body").removeClass("imp-noscroll"))}}),$.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(d){function i(t){var i=t||window.event,e=v.call(arguments,1),s=0,n=0,a=0,o=0,h=0,r=0;if((t=d.event.fix(i)).type="mousewheel","detail"in i&&(a=-1*i.detail),"wheelDelta"in i&&(a=i.wheelDelta),"wheelDeltaY"in i&&(a=i.wheelDeltaY),"wheelDeltaX"in i&&(n=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(n=-1*a,a=0),s=0===a?n:a,"deltaY"in i&&(s=a=-1*i.deltaY),"deltaX"in i&&(n=i.deltaX,0===a&&(s=-1*n)),0!==a||0!==n){if(1===i.deltaMode){var p=d.data(this,"mousewheel-line-height");s*=p,a*=p,n*=p}else if(2===i.deltaMode){var l=d.data(this,"mousewheel-page-height");s*=l,a*=l,n*=l}if(o=Math.max(Math.abs(a),Math.abs(n)),(!f||o480&&screen_size<=768){screen_type='ipads';}else if(screen_size>=1824){screen_type='large-screens';} if(screen_type!='desktop'&&map_obj.settings.mobile_specific==true){isMobile=true;if(map_obj.settings.screens&&map_obj.settings.screens[screen_type]){map_obj.settings.width_mobile=map_obj.settings.screens[screen_type].map_width_mobile;map_obj.settings.height_mobile=map_obj.settings.screens[screen_type].map_height_mobile;map_obj.settings.zoom=parseInt(map_obj.settings.screens[screen_type].map_zoom_level_mobile);map_obj.settings.draggable=(map_obj.settings.screens[screen_type].map_draggable_mobile!=='false');map_obj.settings.scroll_wheel=(map_obj.settings.screens[screen_type].map_scrolling_wheel_mobile!=='false');}else{map_obj.settings.width_mobile='';map_obj.settings.height_mobile='';} if(map_obj.settings.width_mobile!='') $(map_obj.element).css('width',map_obj.settings.width_mobile);if(map_obj.settings.height_mobile!='') $(map_obj.element).css('height',map_obj.settings.height_mobile);} var center=new google.maps.LatLng(map_obj.settings.center_lat,map_obj.settings.center_lng);map_obj.map=new google.maps.Map(map_obj.element,{zoom:parseInt(map_obj.settings.zoom),center:center,disableDoubleClickZoom:(map_obj.settings.scroll_wheel!='false'),scrollwheel:map_obj.settings.scroll_wheel,zoomControl:(map_obj.settings.zoom_control===true),fullscreenControl:(map_obj.settings.full_screen_control===true),fullscreenControlOptions:{position:eval("google.maps.ControlPosition."+map_obj.settings.full_screen_control_position)},zoomControlOptions:{style:eval("google.maps.ZoomControlStyle."+map_obj.settings.zoom_control_style),position:eval("google.maps.ControlPosition."+map_obj.settings.zoom_control_position)},mapTypeControl:(map_obj.settings.map_type_control==true),mapTypeControlOptions:{style:eval("google.maps.MapTypeControlStyle."+map_obj.settings.map_type_control_style),position:eval("google.maps.ControlPosition."+map_obj.settings.map_type_control_position)},scaleControl:(map_obj.settings.scale_control==true),streetViewControl:(map_obj.settings.street_view_control==true),streetViewControlOptions:{position:eval("google.maps.ControlPosition."+map_obj.settings.street_view_control_position)},overviewMapControl:(map_obj.settings.overview_map_control==true),overviewMapControlOptions:{opened:map_obj.settings.overview_map_control},draggable:map_obj.settings.draggable,mapTypeId:eval("google.maps.MapTypeId."+map_obj.settings.map_type_id),styles:eval(map_obj.map_data.styles),minZoom:parseInt(map_obj.settings.min_zoom),maxZoom:parseInt(map_obj.settings.max_zoom),gestureHandling:map_obj.settings.gesture,});map_obj.map_loaded();map_obj.responsive_map();map_obj.create_markers();map_obj.display_markers();if(map_obj.settings.map_control==true){if(typeof map_obj.settings.map_control_settings!='undefined'){var map_control_obj=new Map_Control();$.each(map_obj.settings.map_control_settings,function(k,val){var centerControlDiv=document.createElement('div');map_control_obj.create_element(centerControlDiv,map_obj.map,val.html);centerControlDiv.index=1;map_obj.map.controls[eval("google.maps.ControlPosition."+val.position)].push(centerControlDiv);});}} if(map_obj.map_data.street_view){map_obj.set_streetview(center);} if(map_obj.map_data.weather_layer){map_obj.set_weather_layer();} if(map_obj.map_data.bicyle_layer){map_obj.set_bicyle_layer();} if(map_obj.map_data.traffic_layer){map_obj.set_traffic_layer();} if(map_obj.map_data.transit_layer){map_obj.set_transit_layer();} if(map_obj.map_data.panoramio_layer){map_obj.set_panoramic_layer();} if(map_obj.map_data.overlay_setting){map_obj.set_overlay();} if(map_obj.settings.display_45_imagery=='45'){map_obj.set_45_imagery();} if(typeof map_obj.map_data.map_visual_refresh===true){map_obj.set_visual_refresh();} if(map_obj.map_data.marker_cluster){map_obj.set_marker_cluster();} if(map_obj.map_data.panning_control){map_obj.set_panning_control();} if(map_obj.map_data.kml_layer){map_obj.set_kml_layer();} if(map_obj.map_data.fusion_layer){map_obj.set_fusion_layer();} if(map_obj.settings.search_control==true){map_obj.show_search_control();} if(typeof map_obj.map_data.shapes!='undefined'){if(typeof map_obj.map_data.shapes.shape!='undefined'){map_obj.opened_info=map_obj.infowindow_marker;if(typeof map_obj.map_data.shapes.shape.polygons!='undefined') map_obj.create_polygon();if(typeof map_obj.map_data.shapes.shape.polylines!='undefined') map_obj.create_polyline();if(typeof map_obj.map_data.shapes.shape.circles!='undefined') map_obj.create_circle();if(typeof map_obj.map_data.shapes.shape.rectangles!='undefined') map_obj.create_rectangle();}} if(map_obj.map_data.routes){map_obj.create_routes();} if(map_obj.map_data.listing){if(map_obj.map_data.listing.default_sorting){var data_type='';if(map_obj.map_data.listing.default_sorting.orderby=='listorder'){data_type='num';} map_obj.sorting(map_obj.map_data.listing.default_sorting.orderby,map_obj.map_data.listing.default_sorting.inorder,data_type);}} if(map_obj.map_data.listing){$(map_obj.container).on('change','[data-filter="dropdown"]',function(){map_obj.update_filters();});$(map_obj.container).on('click','[data-filter="checklist"]',function(){map_obj.update_filters();});$(map_obj.container).on('click','[data-filter="list"]',function(){if($(this).hasClass('fc_selected')){$(this).removeClass('fc_selected');}else{$(this).addClass('fc_selected');} map_obj.update_filters();});map_obj.custom_filters();map_obj.display_filters_listing();$.each(map_obj.map_data.listing.filters,function(key,filter){$(map_obj.container).find('select[name="'+filter+'"]').on('change',function(){map_obj.update_filters();});});$(map_obj.container).find('[data-filter="map-sorting"]').on('change',function(){var order_data=$(this).val().split("__");var data_type='';if(order_data[0]!==''&&order_data[1]!==''){if(typeof order_data[2]!='undefined'){data_type=order_data[2];} map_obj.sorting(order_data[0],order_data[1],data_type);map_obj.update_places_listing();}});$(map_obj.container).find('[data-name="radius"]').on('change',function(){var search_data=$(map_obj.container).find('[data-input="wpgmp-search-text"]').val();if(search_data.length>=2&&$(this).val()!=''){map_obj.geocoder.geocode({"address":search_data},function(results,status){if(status==google.maps.GeocoderStatus.OK){map_obj.search_area=results[0].geometry.location;map_obj.update_filters();}});}else{map_obj.search_area='';map_obj.update_filters();}});$(map_obj.container).find('[data-filter="map-perpage-location-sorting"]').on('change',function(){map_obj.per_page_value=$(this).val();map_obj.update_filters();});$(map_obj.container).find('[data-input="wpgmp-search-text"]').on('keyup',function(){var search_data=$(this).val();$(map_obj.container).find('[data-filter="map-radius"]').val('');map_obj.search_area='';if(search_data.length>=2&&map_obj.map_data.listing.apply_default_radius==true){if(search_data.length>=2){map_obj.geocoder.geocode({"address":search_data},function(results,status){if(status==google.maps.GeocoderStatus.OK){map_obj.search_area=results[0].geometry.location;map_obj.update_filters();}});}}else{map_obj.update_filters();}});$(map_obj.container).find(".location_pagination"+map_obj.map_data.map_property.map_id).pagination(map_obj.show_places.length,{callback:map_obj.display_places_listing,map_data:map_obj,items_per_page:map_obj.map_data.listing.pagination.listing_per_page,prev_text:wpgmp_local.prev,next_text:wpgmp_local.next});$(map_obj.container).find('.wpgmp_locations').responsiveEqualHeightGrid();$(map_obj.container).find('[data-action="wpgmp-print"]').on('click',function(){if($('[data-container="wpgmp-listing-'+$(map_obj.element).attr("id")+'"]').length>0){$('[data-container="wpgmp-listing-'+$(map_obj.element).attr("id")+'"]').print();} if($('[data-container="wpgmp-custom-listing-'+$(map_obj.element).attr("id")+'"]').length>0) $('[data-container="wpgmp-custom-listing-'+$(map_obj.element).attr("id")+'"]').print();});} $('.wpgmp-shape-delete').click(function(){map_obj.deleteSelectedShape();$('.hiderow').hide();});$('select[name="shape_stroke_opacity"]').change(function(){map_obj.set_shapes_options(map_obj.selectedShape);});$('select[name="shape_stroke_weight"]').change(function(){map_obj.set_shapes_options(map_obj.selectedShape);});$('select[name="shape_stroke_color"]').change(function(){map_obj.set_shapes_options(map_obj.selectedShape);});$('select[name="shape_fill_opacity"]').change(function(){map_obj.set_shapes_options(map_obj.selectedShape);});$('select[name="shape_fill_color"]').change(function(){map_obj.set_shapes_options(map_obj.selectedShape);});$('input[name="shape_click_url"]').change(function(){map_obj.set_shapes_options(map_obj.selectedShape);});$('textarea[name="shape_click_message"]').blur(function(){map_obj.set_shapes_options(map_obj.selectedShape);});$("textarea[name='shape_path']").blur(function(){var cordinates=$(this).val().split(' ');if(cordinates.length==1){cordinates=$(this).val().split("\n");} var path=[];$.each(cordinates,function(ind,cordinate){var latlng=cordinate.split(',');path.push(new google.maps.LatLng(latlng[0],latlng[1]));});map_obj.selectedShape.setPath(path);});$("input[name='shape_radius']").blur(function(){var radius=parseFloat($(this).val());map_obj.selectedShape.setRadius(radius);});$("input[name='shape_center']").blur(function(){var latlng=$(this).val().split(',');map_obj.selectedShape.setCenter(new google.maps.LatLng(parseFloat(latlng[0]),parseFloat(latlng[1])));});$("input[name='shape_northeast']").blur(function(){var ea=$(this).val().split(',');var sw=$("input[name='shape_southwest']").val().split(',');map_obj.selectedShape.setBounds(new google.maps.LatLngBounds(new google.maps.LatLng(parseFloat(sw[0]),parseFloat(sw[1])),new google.maps.LatLng(parseFloat(ea[0]),parseFloat(ea[1]))));});$("input[name='shape_southwest']").blur(function(){var sw=$(this).val().split(',');var ea=$("input[name='shape_northeast']").val().split(',');map_obj.selectedShape.setBounds(new google.maps.LatLngBounds(new google.maps.LatLng(parseFloat(sw[0]),parseFloat(sw[1])),new google.maps.LatLng(parseFloat(ea[0]),parseFloat(ea[1]))));});$("input[name='shape_center']").blur(function(){var latlng=$(this).val().split(',');map_obj.selectedShape.setCenter(new google.maps.LatLng(parseFloat(latlng[0]),parseFloat(latlng[1])));});$('input[name="wpgmp_save_drawing"]').click(function(){var all_shapes_cordinate=[];all_shapes_cordinate.push('polylines='+map_obj.wpgmp_save_polylines().join('::'));all_shapes_cordinate.push('polygons='+map_obj.wpgmp_save_polygons().join('::'));all_shapes_cordinate.push('circles='+map_obj.wpgmp_save_circles().join('::'));all_shapes_cordinate.push('rectangles='+map_obj.wpgmp_save_rectangles().join('::'));map_obj.wpgmp_save_shapes(all_shapes_cordinate);});if(typeof map_obj.map_data.shapes!='undefined'){if(map_obj.map_data.shapes.drawing_editable===true){$('.wpgmp-overview .color').wpColorPicker({change:function(event,ui){map_obj.set_shapes_options(map_obj.selectedShape);}});}} if(typeof map_obj.map_data.map_tabs!='undefined'){this.map_widgets();$(map_obj.container).find(".wpgmp_toggle_main_container").find("div[id^='wpgmp_tab_']").css("display","none");if(map_obj.settings.infowindow_filter_only===false){$(map_obj.container).find("input[data-marker-category]").attr("checked",true);$(map_obj.container).find("input[data-marker-location]").attr("checked",true);} if(this.map_data.map_tabs.category_tab&&this.map_data.map_tabs.category_tab.select_all===true){$(map_obj.container).find('input[name="wpgmp_select_all"]').click(function(){if($(this).is(":checked")){$(map_obj.container).find("input[data-marker-category]").attr("checked",true);$(map_obj.container).find('input[data-marker-location]').attr('checked',true);}else{$(map_obj.container).find("input[data-marker-category]").attr("checked",false);$(map_obj.container).find('input[data-marker-location]').attr('checked',false);} map_obj.update_filters();});} $(map_obj.container).find(".wpgmp_toggle_container").click(function(){$(map_obj.container).find(".wpgmp_toggle_main_container").slideToggle("slow");if($(this).text()==wpgmp_local.hide){$(this).text(wpgmp_local.show);}else{$(this).text(wpgmp_local.hide);}});if(map_obj.map_data.map_tabs.hide_tabs_default===true){$(map_obj.container).find(".wpgmp_toggle_container").trigger('click');} $(map_obj.container).find(".wpgmp_specific_route_item").attr("checked",true);$(map_obj.container).find(".wpgmp_toggle_main_container").find("div[id^='wpgmp_tab_']").first().css("display","block");$(map_obj.container).on('click',"li[class^='wpgmp-tab-'] a",function(){$(map_obj.container).find("li[class^='wpgmp-tab-'] a").removeClass('active');$(this).addClass('active');$(map_obj.container).find(".wpgmp_toggle_main_container").find("div[id^='wpgmp_tab_']").css("display","none");$(map_obj.container).find(".wpgmp_toggle_main_container").find("#wpgmp_tab_"+$(this).parent().attr('rel')).css("display","block");});$(map_obj.container).on('change',"input[data-marker-category]",function(){var current_marker_id=$(this).data('marker-category');if($(this).is(":checked")===false) {$(this).closest('[data-container="wpgmp-category-tab-item"]').find('input[data-marker-location]').attr('checked',false);$(this).parent().parent().find('[data-parent-cat="'+current_marker_id+'"]').attr('checked',false);$(this).parent().parent().find('[data-parent-cat="'+current_marker_id+'"]').trigger('change');} else {$(this).closest('[data-container="wpgmp-category-tab-item"]').find('input[data-marker-location]').attr('checked',true);$(this).parent().parent().find('[data-parent-cat="'+current_marker_id+'"]').attr('checked',true);$(this).parent().parent().find('[data-parent-cat="'+current_marker_id+'"]').trigger('change');} map_obj.update_filters();});$(map_obj.container).find(".wpgmp_toggle_main_container").on('change',".wpgmp_specific_route_item",function(){var selected_route=map_obj.route_directions[$(this).val()];if($(this).is(":checked")===false){selected_route.setMap(null);}else{selected_route.setMap(map_obj.map);}});$(map_obj.container).on('change',"input[data-marker-location]",function(){map_obj.update_filters();});if(this.map_data.map_tabs.direction_tab&&this.map_data.map_tabs.direction_tab.dir_tab===true){$(this.container).find(".wpgmp_find_direction").click(function(){var start=$(map_obj.container).find('.start_point');var end=$(map_obj.container).find('.end_point');var travel_mode=$(map_obj.container).find('select[name="travel_mode"]').val();var travel_unit=$(map_obj.container).find('select[name="travel_unit"]').val();var direction_panel=$(map_obj.container).find('.directions-panel');var current_address='';if($(start).val()===""){$(start).focus();return false;} if($(end).val()===""){$(end).focus();return false;} var options={"start":start.val(),"end":end.val(),"mode":travel_mode,"unit":travel_unit,"direction_panel":direction_panel[0],"map":map_obj.map};map_obj.find_direction(options);});} $(this.container).find(".wpgmp_find_nearby_button").click(function(){var target=$(this).parent().parent();var lat=$(target).find(".wpgmp_auto_suggest").data('latitude');var lon=$(target).find(".wpgmp_auto_suggest").data('longitude');var radius=$(map_obj.container).find("input[name='wpgmp_radius']").val();var dim=$(map_obj.container).find("select[name='wpgmp_route_dimension']").val();var amenities=$(map_obj.container).find('input[name^="wpgmp_place_types"]:checked');var divide_by=1.60934;var service;if(dim=='miles'){divide_by=1.60934;}else{divide_by=1;} var circle_radius_meters=parseInt(radius)*divide_by*1000;if(amenities.length>0){if(map_obj.current_amenities.length>0){$.each(map_obj.current_amenities,function(am,amenity){amenity.marker.setMap(null);});} map_obj.amenity_infowindow=map_obj.infowindow_marker;var place_types=[];$.each(amenities,function(index,amenity){place_types.push($(amenity).val());});var request={location:new google.maps.LatLng(lat,lon),radius:circle_radius_meters,types:place_types};service=new google.maps.places.PlacesService(map_obj.map);service.nearbySearch(request,function(results,status){if(status==google.maps.places.PlacesServiceStatus.OK){for(var i=0;i
'+place.name+'
');else map_obj.amenity_infowindow.setContent(place.name);map_obj.amenity_infowindow.open(map,this);});map_obj.current_amenities.push(place);},wpgmp_image_type_overlays:function(){var map_obj=this;var imageMapType=new google.maps.ImageMapType({getTileUrl:function(coord,zoom){return['http://www.gstatic.com/io2010maps/tiles/5/L2_',zoom,'_',coord.x,'_',coord.y,'.png'].join('');},tileSize:new google.maps.Size(256,256)});map_obj.map.overlayMapTypes.push(imageMapType);},wpgmp_within_radius:function(place,search_area){var map_obj=this;var radius=$(map_obj.container).find('[data-name="radius"]').val();var dimension=map_obj.map_data.listing.radius_dimension;if(map_obj.map_data.listing.apply_default_radius==true&&radius==''){radius=map_obj.map_data.listing.default_radius;dimension=map_obj.map_data.listing.default_radius_dimension;} if(dimension=='km'){radius=parseInt(radius)*1000;}else{radius=parseInt(radius)*1609.34;} if(google.maps.geometry.spherical.computeDistanceBetween(place.marker.getPosition(),search_area)'+tab.title+'';else content+='
  • '+tab.title+'
  • ';});content+='';content+='
    ';$.each(this.tabs,function(index,tab){content+='
    ';content+=tab.content;content+='
    ';});content+='
    '+wpgmp_local.hide+'
    ';return content;},map_widgets:function(){var content='';if(this.map_data.map_tabs.category_tab&&this.map_data.map_tabs.category_tab.cat_tab===true) this.widget_category();if(this.map_data.map_tabs.direction_tab&&this.map_data.map_tabs.direction_tab.dir_tab===true) this.widget_directions();if(this.map_data.map_tabs.nearby_tab&&this.map_data.map_tabs.nearby_tab.near_tab===true) this.widget_nearby();if(this.map_data.map_tabs.route_tab&&this.map_data.map_tabs.route_tab.display_route_tab===true) this.widget_route_tab();if(this.map_data.map_tabs.extension_tabs){this.widget_extensions_tab();} content+=this.show_tabs();$(content).insertAfter(this.element);},widget_extensions_tab:function(){var map_obj=this;var new_tabs=map_obj.map_data.map_tabs.extension_tabs;if(typeof new_tabs!='undefined'&&new_tabs.length>0){$.each(new_tabs,function(index,tab){map_obj.add_tab(tab.title,tab.content);});}},widget_route_tab:function(){var route_data=this.map_data.map_tabs.route_tab.route_tab_data;var content='';if(this.map_data.map_tabs.route_tab.display_route_tab_data===true){content+='
    ';if(route_data){$.each(route_data,function(index,route){content+='
    ';content+='';var box='';content+=''+route.route_title+box+'';content+='
    ';content+='
    ';});} content+='
    ';} this.add_tab(this.map_data.map_tabs.route_tab.route_tab_title,content);},widget_nearby:function(){var content='
    ';content+='

     

    ';content+='

      

    ';if(typeof this.map_data.map_tabs.nearby_tab.nearby_amenities!='undefined'){var all_amenities=this.map_data.map_tabs.nearby_tab.nearby_amenities;if(all_amenities){content+='
    ';$.each(all_amenities,function(index,amenity){content+=" "+amenity+'';});}} content+='
    ';content+='

    ';this.add_tab(this.map_data.map_tabs.nearby_tab.nearby_tab_title,content);},widget_directions:function(){var content='';content='
    ';if(this.map_data.map_tabs.route_start_location=="textbox"){content+='

     

    ';}else if(this.map_data.map_tabs.route_start_location=="selectbox"){content+='

    ';} if(this.map_data.map_tabs.route_end_location=="textbox"){content+='

    ';}else if(this.map_data.map_tabs.route_end_location=="selectbox"){content+='

    ';} content+='

    ';content+='

    ';this.add_tab(this.map_data.map_tabs.direction_tab.direction_tab_title,content);},widget_category:function(){var map_obj=this;if(map_obj.map_data.map_tabs.category_tab.select_all===true){var content='
      '+wpgmp_local.select_all+'
    ';}else{var content='';} var categories_tab_data={};var child_categories_tab_data={};if(typeof map_obj.map_data.places!='undefined'){$.each(map_obj.map_data.places,function(index,place){if(typeof place.categories!='undefined'){$.each(place.categories,function(index,categories){var show=true;var parent_cat='';parent_cat=map_obj.search_category(map_obj.map_data.map_tabs.category_tab.child_cats,categories.id,[],categories_tab_data,child_categories_tab_data);if(parent_cat.length>0) show=false;if(typeof categories.type!="undefined"&&categories.type=='category'&&categories.name&&show==true){if(typeof categories_tab_data[categories.id]=="undefined"){categories_tab_data[categories.id]={};categories_tab_data[categories.id]['data']=[];} categories_tab_data[categories.id]['cat_id']=categories.id;categories_tab_data[categories.id]['cat_title']=categories.name;categories_tab_data[categories.id]['cat_marker_icon']=categories.icon;if(categories.extension_fields&&categories.extension_fields.cat_order){categories_tab_data[categories.id]['cat_order']=categories.extension_fields.cat_order;} var redirect_permalink="";if(place.location.redirect_permalink) redirect_permalink=place.location.redirect_permalink;var redirect_custom_link="";if(place.location.redirect_custom_link) redirect_custom_link=place.location.redirect_custom_link;categories_tab_data[categories.id]['data'].push({"cat_location_id":place.id,"cat_location_title":place.title,"cat_location_address":place.address,"cat_location_zoom":place.location.zoom,"onclick_action":place.location.onclick_action,"redirect_permalink":redirect_permalink,"redirect_custom_link":redirect_custom_link,});}else if(typeof categories.type!="undefined"&&categories.type=='category'&&categories.name&&show==false){if(typeof child_categories_tab_data[categories.id]=="undefined"){child_categories_tab_data[categories.id]={};child_categories_tab_data[categories.id]['data']=[];child_categories_tab_data[categories.id]['parent_cat']=parent_cat;} child_categories_tab_data[categories.id]['cat_id']=categories.id;child_categories_tab_data[categories.id]['cat_title']=categories.name;child_categories_tab_data[categories.id]['cat_marker_icon']=categories.icon;if(categories.extension_fields&&categories.extension_fields.cat_order){child_categories_tab_data[categories.id]['cat_order']=categories.extension_fields.cat_order;} var redirect_permalink="";if(place.location.redirect_permalink) redirect_permalink=place.location.redirect_permalink;var redirect_custom_link="";if(place.location.redirect_custom_link) redirect_custom_link=place.location.redirect_custom_link;child_categories_tab_data[categories.id]['data'].push({"cat_location_id":place.id,"cat_location_title":place.title,"cat_location_address":place.address,"cat_location_zoom":place.location.zoom,"onclick_action":place.location.onclick_action,"redirect_permalink":redirect_permalink,"redirect_custom_link":redirect_custom_link,});}});}});} var category_orders=[];if(typeof categories_tab_data!='undefined'){$.each(categories_tab_data,function(index,categories){var loc_count=categories.data.length;if(typeof child_categories_tab_data!="undefined"){$.each(child_categories_tab_data,function(c,ccat){if(ccat.parent_cat==categories.cat_id){loc_count=loc_count+ccat.data.length;$.each(child_categories_tab_data,function(cc,cccat){if(cccat.parent_cat==ccat.cat_id){loc_count=loc_count+cccat.data.length;}});}});} categories.loc_count=loc_count;if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='count'){category_orders.push(categories.loc_count);}else if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='category'){if(categories.cat_order){category_orders.push(categories.cat_order);}else if(!categories.cat_order&&map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id]&&map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id].extensions_fields){categories.cat_order=map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id].extensions_fields.cat_order;category_orders.push(categories.cat_order);}}else{if(categories.cat_title){category_orders.push(categories.cat_title);}else if(!categories.cat_title&&map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id]){categories.cat_title=map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id].group_map_title;category_orders.push(categories.cat_title);}}});} if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='category'){category_orders.sort(function(a,b){return a-b});}else if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='count'){category_orders.sort(function(a,b){return b-a});}else{category_orders.sort();} var ordered_categories=[];var check_cats=[];$.each(category_orders,function(index,cat_title){$.each(categories_tab_data,function(index,categories){var compare_with;if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='count'){compare_with=categories.loc_count;}else if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='category'){compare_with=categories.cat_order;}else{compare_with=categories.cat_title;} if(cat_title==compare_with&&$.inArray(categories.cat_id,check_cats)==-1){ordered_categories.push(categories);check_cats.push(categories.cat_id);}});});if(typeof ordered_categories!='undefined'){$.each(ordered_categories,function(index,categories){var category_image='';if(!categories.cat_title&&map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id]){categories.cat_title=map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id].group_map_title;} if(!categories.cat_marker_icon&&map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id]){categories.cat_marker_icon=map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id].group_marker;} if(typeof categories.cat_marker_icon!='undefined'){category_image='';} content+='
    ';content+='';var loc_count=categories.loc_count;;$.each(map_obj.map_data.map_tabs.category_tab.child_cats,function(k,v){if(v==categories.cat_id&&loc_count==0) loc_count="";});if(map_obj.map_data.map_tabs.category_tab.show_count===true&&loc_count!=""){location_count=" ("+loc_count+")";}else{location_count="";} content+=''+categories.cat_title+location_count+category_image+'';if(map_obj.map_data.map_tabs.category_tab.hide_location!==true){content+='
    ';content+='';content+='
    ';} content+='
    ';if(typeof child_categories_tab_data!="undefined"){var padding=20;content+=map_obj.display_sub_categories(child_categories_tab_data,categories.cat_id,'',padding);}});} map_obj.add_tab(map_obj.map_data.map_tabs.category_tab.cat_tab_title,content);},search_category:function(array,cat_id,index,categories_tab_data,child_categories_tab_data){var map_obj=this;var flag=true;$.each(array,function(k,i){if(k==cat_id){index=i;flag=false;if(typeof child_categories_tab_data[cat_id]=="undefined"){child_categories_tab_data[cat_id]={};child_categories_tab_data[cat_id]['data']=[];child_categories_tab_data[cat_id]['parent_cat']=i;child_categories_tab_data[cat_id]['cat_id']=cat_id;$.each(map_obj.categories,function(k,e){if(e.group_map_id==cat_id){child_categories_tab_data[cat_id]['cat_title']=e.group_map_title;child_categories_tab_data[cat_id]['cat_marker_icon']=e.group_marker;}});} index=map_obj.search_category(map_obj.map_data.map_tabs.category_tab.child_cats,i,index,categories_tab_data,child_categories_tab_data);}});if(flag==true){if(typeof categories_tab_data[cat_id]=="undefined"){categories_tab_data[cat_id]={};categories_tab_data[cat_id]['data']=[];categories_tab_data[cat_id]['cat_id']=cat_id;$.each(map_obj.categories,function(k,e){if(e.group_map_id==cat_id){categories_tab_data[cat_id]['cat_title']=e.group_map_title;categories_tab_data[cat_id]['cat_marker_icon']=e.group_marker;}});}} return index;},display_sub_categories:function(child_categories_tab_data,cat_id,content,padding){var map_obj=this;var category_orders=[];if(typeof child_categories_tab_data!='undefined'){$.each(child_categories_tab_data,function(index,categories){var loc_count=categories.data.length;if(typeof child_categories_tab_data!="undefined"){$.each(child_categories_tab_data,function(c,ccat){if(ccat.parent_cat==categories.cat_id){loc_count=loc_count+ccat.data.length;$.each(child_categories_tab_data,function(cc,cccat){if(cccat.parent_cat==ccat.cat_id){loc_count=loc_count+cccat.data.length;}});}});} categories.loc_count=loc_count;if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='count'){category_orders.push(categories.loc_count);}else if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='category'){if(categories.cat_order){category_orders.push(categories.cat_order);}else if(!categories.cat_order&&map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id]){categories.cat_order=map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id].extensions_fields.cat_order;category_orders.push(categories.cat_order);}}else{if(categories.cat_title){category_orders.push(categories.cat_title);}else if(!categories.cat_title&&map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id]){categories.cat_title=map_obj.map_data.map_tabs.category_tab.all_cats[categories.cat_id].group_map_title;category_orders.push(categories.cat_title);}}});} if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='category'){category_orders.sort(function(a,b){return a-b});}else if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='count'){category_orders.sort(function(a,b){return b-a});}else{category_orders.sort();} var ordered_categories=[];var check_cats=[];$.each(category_orders,function(index,cat_title){$.each(child_categories_tab_data,function(index,categories){var compare_with;if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='count'){compare_with=categories.loc_count;}else if(map_obj.map_data.map_tabs.category_tab.cat_order_by=='category'){compare_with=categories.cat_order;}else{compare_with=categories.cat_title;} if(cat_title==compare_with&&$.inArray(categories.cat_id,check_cats)==-1){ordered_categories.push(categories);check_cats.push(categories.cat_id);}});});$.each(ordered_categories,function(index,child_cat){if(child_cat.parent_cat==cat_id){var category_image='';if(!child_cat.cat_title&&map_obj.map_data.map_tabs.category_tab.all_cats[child_cat.cat_id]){child_cat.cat_title=map_obj.map_data.map_tabs.category_tab.all_cats[child_cat.cat_id].group_map_title;} if(!child_cat.cat_marker_icon&&map_obj.map_data.map_tabs.category_tab.all_cats[child_cat.cat_id]){child_cat.cat_marker_icon=map_obj.map_data.map_tabs.category_tab.all_cats[child_cat.cat_id].group_marker;} if(typeof child_cat.cat_marker_icon!='undefined'){category_image='';} content+='
    ';content+='';var loc_count=child_cat.loc_count;$.each(map_obj.map_data.map_tabs.category_tab.child_cats,function(k,v){if(v==child_cat.cat_id&&loc_count==0) loc_count="";});if(map_obj.map_data.map_tabs.category_tab.show_count===true&&loc_count!=""){location_count=" ("+loc_count+")";}else{location_count="";} content+=''+child_cat.cat_title+location_count+category_image+'';if(map_obj.map_data.map_tabs.category_tab.hide_location!==true){content+='
    ';content+='';content+='
    ';} content+='
    ';content+=map_obj.display_sub_categories(child_categories_tab_data,child_cat.cat_id,'',(padding+20));}else if((index+1)==child_categories_tab_data.length) return;});return content;},sorting:function(order_by,in_order,data_type){switch(order_by){case'category':this.places.sort(this.sortByCategory);this.show_places.sort(this.sortByCategory);if(in_order=='desc'){this.places.reverse();this.show_places.reverse();} break;case'title':this.map_data.places.sort(this.sortByTitle);this.show_places.sort(this.sortByTitle);if(in_order=='desc'){this.places.reverse();this.show_places.reverse();} break;case'address':this.map_data.places.sort(this.sortByAddress);this.show_places.sort(this.sortByAddress);if(in_order=='desc'){this.places.reverse();this.show_places.reverse();} break;default:var first_place=this.map_data.places[0];if(typeof first_place[order_by]!='undefined'){this.map_data.places.sort(this.sortByPlace(order_by,data_type));this.show_places.sort(this.sortByPlace(order_by,data_type));}else if(typeof first_place.location[order_by]!='undefined'){this.map_data.places.sort(this.sortByLocation(order_by,data_type));this.show_places.sort(this.sortByLocation(order_by,data_type));}else if(typeof first_place.location.extra_fields[order_by]!='undefined'){this.map_data.places.sort(this.sortByExtraFields(order_by,data_type));this.show_places.sort(this.sortByExtraFields(order_by,data_type));} if(in_order=='desc'){this.places.reverse();this.show_places.reverse();}}},sortByExtraFields:function(order_by,data_type){return function(a,b){if(typeof b.location.extra_fields[order_by]!='undefined'&&typeof a.location.extra_fields[order_by]!='undefined'){if(b.location.extra_fields[order_by]==null){b.location.extra_fields[order_by]='';} if(a.location.extra_fields[order_by]==null){a.location.extra_fields[order_by]='';} if(data_type=='num'){var a_val=parseInt(a.location.extra_fields[order_by]);var b_val=parseInt(b.location.extra_fields[order_by]);}else{var a_val=a.location.extra_fields[order_by].toLowerCase();var b_val=b.location.extra_fields[order_by].toLowerCase();} return((a_valb_val)?1:0));}}},sortByLocation:function(order_by,data_type){return function(a,b){if(b.location[order_by]&&a.location[order_by]){if(a.location[order_by]&&b.location[order_by]){var a_val=a.location[order_by].toLowerCase();var b_val=b.location[order_by].toLowerCase();if(data_type=='num'){a_val=parseInt(a_val);b_val=parseInt(b_val);} return((a_valb_val)?1:0));}}}},sortByPlace:function(order_by,data_type){return function(a,b){if(b[order_by]&&a[order_by]){if(a[order_by]&&b[order_by]){var a_val=a[order_by].toLowerCase();var b_val=b[order_by].toLowerCase();if(data_type=='num'){a_val=parseInt(a_val);b_val=parseInt(b_val);} return((a_valb_val)?1:0));}}}},sortByCategory:function(a,b){if(b.categories[0]&&a.categories[0]){if(a.categories[0].name&&b.categories[0].name){var a_val=a.categories[0].name.toLowerCase();var b_val=b.categories[0].name.toLowerCase();return((a_valb_val)?1:0));}}},sortByTitle:function(a,b){var a_val=a.title.toLowerCase();var b_val=b.title.toLowerCase();return((a_valb_val)?1:0));},sortByAddress:function(a,b){var a_val=a.address.toLowerCase();var b_val=b.address.toLowerCase();return((a_valb_val)?1:0));},update_filters:function(){var map_obj=this;var filters={};var all_dropdowns=$(map_obj.container).find('[data-filter="dropdown"]');var all_checkboxes=$(map_obj.container).find('[data-filter="checklist"]:checked');var all_list=$(map_obj.container).find('[data-filter="list"].fc_selected');$.each(all_dropdowns,function(index,element){if($(this).val()!=''){if(typeof filters[$(this).data('name')]=='undefined'){filters[$(this).data('name')]=[];} filters[$(this).data('name')].push($(this).val());}});$.each(all_checkboxes,function(index,element){if(typeof filters[$(this).data('name')]=='undefined'){filters[$(this).data('name')]=[];} filters[$(this).data('name')].push($(this).val());});$.each(all_list,function(index,element){if(typeof filters[$(this).data('name')]=='undefined'){filters[$(this).data('name')]=[];} filters[$(this).data('name')].push($(this).data('value').toString());});this.apply_filters(filters);},apply_filters:function(filters){var map_obj=this;var showAll=true;var show=true;map_obj.show_places=[];if(typeof map_obj.map_data.places!='undefined'){$.each(map_obj.map_data.places,function(place_key,place){show=true;enable_search_term=false;if($(map_obj.container).find('[data-input="wpgmp-search-text"]').length>0){search_term=$(map_obj.container).find('[data-input="wpgmp-search-text"]').val();search_term=search_term.toLowerCase();if(search_term.length>0){enable_search_term=true;}} if(typeof map_obj.map_data.map_url_params!='undefined'){if(typeof map_obj.map_data.map_url_params.search_text!='undefined'&&map_obj.map_data.map_url_params.search_text.length>0){search_term=map_obj.map_data.map_url_params.search_text;search_term=search_term.toLowerCase();if(search_term.length>0){enable_search_term=true;}}} if(typeof filters!='undefined'){$.each(filters,function(filter_key,filter_values){var in_fields=false;if($.isArray(filter_values)){if(typeof place.categories!='undefined'&&filter_key=="category"){$.each(place.categories,function(cat_index,category){if($.inArray(category.id,filter_values)>-1) in_fields=true;});} if(typeof place.custom_filters!='undefined'){$.each(place.custom_filters,function(k,val){if(filter_key==k){in_fields=false;if($.isArray(val)){$.each(val,function(index,value){if($.inArray(value,filter_values)>-1) in_fields=true;});}else if(val==filter.val) in_fields=true;}});} if(typeof place[filter_key]!='undefined'){if($.inArray(place[filter_key],filter_values)>-1){in_fields=true;}}else if(typeof place.location[filter_key]!='undefined'){if($.inArray(place.location[filter_key],filter_values)>-1){in_fields=true;}}else if(typeof place.location.extra_fields[filter_key]!='undefined'){if($.inArray(place.location.extra_fields[filter_key],filter_values)>-1){in_fields=true;}} if(in_fields==false) show=false;}else{filter.val="";}});} if(enable_search_term===true&&show===true){if(place.title.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.content.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.location.lat.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.location.lng.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.address&&place.address.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.location.state&&place.location.state.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.location.country&&place.location.country.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.location.postal_code&&place.location.postal_code.toLowerCase().indexOf(search_term)>=0){show=true;}else if(place.location.city&&place.location.city.toLowerCase().indexOf(search_term)>=0){show=true;}else if(typeof map_obj.search_area!='undefined'&&map_obj.search_area!=''&&map_obj.wpgmp_within_radius(place,map_obj.search_area)===true){show=true;}else{show=false;} if(typeof place.location.extra_fields!='undefined'){$.each(place.location.extra_fields,function(field,value){if(value&&value.toLowerCase().indexOf(search_term)>=0) show=true;});}} if(((map_obj.map_data.map_tabs&&map_obj.map_data.map_tabs.category_tab&&map_obj.map_data.map_tabs.category_tab.cat_tab===true)||$(map_obj.container).find('input[data-marker-category]').length>0)&&show!=false){var all_selected_category=$('input[data-marker-category]:checked');var in_checked_category=false;if(all_selected_category.length===0){if(typeof place.categories!='undefined'){$.each(place.categories,function(cat_index,category){if(category.id==='') in_checked_category=true;});}} $.each(all_selected_category,function(index,selected_category){var all_not_selected_location=$(selected_category).closest('[data-container="wpgmp-category-tab-item"]').find('input[data-marker-location]:not(:checked)');if(typeof place.categories!='undefined'){$.each(place.categories,function(cat_index,category){if(category.id==='') in_checked_category=true;else if(category.id==$(selected_category).data("marker-category")){in_checked_category=true;place.marker.setIcon(category.icon);}});} if(all_not_selected_location.length!==0){$.each(all_not_selected_location,function(index_loc,not_selected_location){if(place.id==$(not_selected_location).data("marker-location")){in_checked_category=false;}});}});if(in_checked_category===false) show=false;else show=true;var all_selected_location=$(map_obj.container).find('[data-container="wpgmp-category-tab-item"]').find('input[data-marker-location]:checked');if(all_selected_location.length!==0){$.each(all_selected_location,function(index_loc,selected_location){if(place.id==$(selected_location).data("marker-location")){show=true;}});}} place.marker.visible=show;place.marker.setVisible(show);if(show==false){place.infowindow.close();} place.marker.setAnimation(null);if(show===true) map_obj.show_places.push(place);});} if(map_obj.map_data.listing){if($(map_obj.container).find('[data-filter="map-sorting"]').val()){var order_data=$(map_obj.container).find('[data-filter="map-sorting"]').val().split("__");var data_type='';if(order_data[0]!==''&&order_data[1]!==''){if(typeof order_data[2]!='undefined'){data_type=order_data[2];} map_obj.sorting(order_data[0],order_data[1],data_type);}}else{if(map_obj.map_data.listing.default_sorting){var data_type='';if(map_obj.map_data.listing.default_sorting.orderby=='listorder'){data_type='num';} map_obj.sorting(map_obj.map_data.listing.default_sorting.orderby,map_obj.map_data.listing.default_sorting.inorder,data_type);}} map_obj.update_places_listing();} if(map_obj.map_data.marker_cluster){map_obj.set_marker_cluster();}},create_perpage_option:function(){var map_obj=this;var options='';var content='';content+='';return content;},create_sorting:function(){var options='';var content='';if(this.map_data.listing.display_sorting_filter===true){content+='';} return content;},create_radius:function(){var options='';var content='';if(this.map_data.listing.display_radius_filter===true){content+='';} return content;},custom_filters:function(){var map_obj=this;var options='';var places=this.map_data.places;var wpgmp_filters=this.map_data.filters;if(typeof wpgmp_filters=='undefined'||typeof wpgmp_filters.custom_filters=='undefined'||wpgmp_filters.custom_filters.length==0){return;} $.each(wpgmp_filters.custom_filters,function(template_shortcode,filter_options){var all_filters=[];var content='';var filters={};$.each(filter_options,function(filter_type,filter_parameter){$.each(filter_parameter,function(filter_name,filter_label){$.each(places,function(index,place){if(filter_name=='category'){if(typeof place.categories=='undefined'){place.categories={};} $.each(place.categories,function(cat_index,category){if(typeof filters[category.type]=='undefined'){filters[category.type]={};} if(category.name){filters[category.type][category.name]=category.id;}});}else{if(typeof place[filter_name]!='undefined'){if(typeof filters[filter_name]=='undefined'){filters[filter_name]={};} if(place[filter_name]){filters[filter_name][place[filter_name]]=place[filter_name];}} if(typeof place.location.extra_fields[filter_name]!='undefined'){if(typeof filters[filter_name]=='undefined'){filters[filter_name]={};} if(place.location.extra_fields[filter_name]){filters[filter_name][place.location.extra_fields[filter_name]]=place.location.extra_fields[filter_name];}} if(typeof place.location[filter_name]!='undefined'){if(typeof filters[filter_name]=='undefined'){filters[filter_name]={};} if(place.location[filter_name]){filters[filter_name][place.location[filter_name]]=place.location[filter_name];}} if(typeof place.custom_filters!='undefined'&&typeof place.custom_filters[filter_name]!='undefined'){if(typeof filters[filter_name]=='undefined'){filters[filter_name]={};} if(place.custom_filters[filter_name]){var options=place.custom_filters[filter_name];if($.isArray(options)){$.each(options,function(index,value){filters[filter_name][value]=value;});}else{filters[filter_name][options]=options;}}} if(filter_name=='radius'){if(typeof filters[filter_name]=='undefined'){filters[filter_name]={};} var radius_options=wpgmp_filters.radius_options;var radius_dimension=wpgmp_filters.radius_dimension;$.each(radius_options.split(','),function(id,name){if(radius_dimension=='miles'){filters[filter_name][name+' '+wpgmp_local.miles]=name;}else{filters[filter_name][name+' '+wpgmp_local.km]=name;}});}}});});if(filter_type=='dropdown'){if(typeof filters!='undefined'){$.each(filters,function(index,options){content+='';});}} if(filter_type=='checklist'){if(typeof filters!='undefined'){$.each(filters,function(index,options){content+='
    ';content+='';$.each(options,function(name,value){if(value!=''&&value!=null) content+=""+name;});content+='
    ';});}} if(filter_type=='list'){if(typeof filters!='undefined'){$.each(filters,function(index,options){content+='
    ';content+='
      ';$.each(options,function(name,value){if(value!=''&&value!=null) content+="
    • "+name+"
    • ";});content+='
    ';});}}});$(map_obj.container).find("."+template_shortcode).html(content);});},create_filters:function(){var options='';var filters={};var places=this.map_data.places;var wpgmp_listing_filter=this.map_data.listing;var wpgmp_alltfilter=wpgmp_listing_filter.display_taxonomies_all_filter;$.each(places,function(index,place){if(typeof place.categories=='undefined'){place.categories={};} $.each(place.categories,function(cat_index,category){if(typeof filters[category.type]=='undefined'){filters[category.type]={};} if(category.name){filters[category.type][category.name]=category.id;}});});var content='';$.each(filters,function(index,options){if(wpgmp_listing_filter.display_category_filter===true&&index=="category"){content+='';}else if(wpgmp_listing_filter.display_taxonomies_filter===true){if(wpgmp_alltfilter===null) return false;if(wpgmp_alltfilter.indexOf(index)>-1){content+='';}}});return content;},update_places_listing:function(){var map_obj=this;if(map_obj.per_page_value>0) map_obj.per_page_value=map_obj.per_page_value;else map_obj.per_page_value=map_obj.map_data.listing.pagination.listing_per_page;$(map_obj.container).find(".location_pagination"+map_obj.map_data.map_property.map_id).pagination(map_obj.show_places.length,{callback:map_obj.display_places_listing,map_data:map_obj,items_per_page:map_obj.per_page_value,prev_text:wpgmp_local.prev,next_text:wpgmp_local.next});},display_filters_listing:function(){if(this.map_data.listing){var wpgmpgl=this.map_data.listing.list_grid;var content='
    ';content+=this.display_filters();content+="
    ";content+="
    ";$(this.map_data.listing.listing_container).html(content);}},display_filters:function(){var content='';content+='
    '+this.map_data.listing.listing_header+'
    ';if(this.map_data.listing.display_search_form===true){content+='
    ';} content+='
    '+this.create_filters()+this.create_sorting()+'';if(this.map_data.listing.display_location_per_page_filter===true){content+=' '+this.create_perpage_option()+' ';} content+=' '+this.create_radius()+' ';if(this.map_data.listing.display_print_option===true){content+=' '+wpgmp_local.img_print;} if(this.map_data.listing.display_grid_option===true){content+=' '+wpgmp_local.img_grid+wpgmp_local.img_list;} content+='
    ';return content;},find_direction:function(options){var map_obj=this;var request={origin:options.start,destination:options.end,optimizeWaypoints:true,travelMode:eval("google.maps.TravelMode."+options.mode),unitSystem:eval("google.maps.UnitSystem."+options.unit)};map_obj.directionsService=new google.maps.DirectionsService();map_obj.directionsService.route(request,function(response,status){if(status==google.maps.DirectionsStatus.OK){map_obj.directionsDisplay.setMap(map_obj.map);map_obj.directionsDisplay.setDirections(response);if(false==map_obj.map_data.map_tabs.direction_tab.suppress_markers){map_obj.directionsDisplay.setPanel(options.direction_panel);$(options.direction_panel).css('display','block');}}});},display_places_listing:function(page_index,jq){var content='';var map_obj=this;var items_per_page=10;if(map_obj.items_per_page) items_per_page=map_obj.items_per_page;else items_per_page=map_obj.map_data.map_data.listing.pagination.listing_per_page;var data_source=map_obj.map_data.show_places;var listing_container=map_obj.map_data.map_data.listing.listing_container;var listing_placeholder=map_obj.map_data.map_data.listing.listing_placeholder;var max_elem=Math.min((page_index+1)*items_per_page,data_source.length);var link='';if(max_elem>0){for(var i=page_index*items_per_page;i'+place.title+'';}else if(place.location.onclick_action=="post"){link=''+place.title+'';}else if(place.location.onclick_action=="custom_link"){link=''+place.title+'';}} var image=[];var category_name=[];var wpgmp_arr={};if(place.categories){for(c=0;c");} if(place.categories[c].type=='category'&&place.categories[c].name!=''){category_name.push(place.categories[c].name);} if(place.categories[c].type!='category'){if(typeof place.categories[c].name=="undefined") continue;if(place.categories[c].name) var sep=',';if(typeof wpgmp_arr[place.categories[c].type]=="undefined") wpgmp_arr[place.categories[c].type]='';wpgmp_arr[place.categories[c].type]+=place.categories[c].name+sep;}}} var marker_image='';if(place.source=='post'){marker_image=place.location.extra_fields.post_featured_image;}else{marker_image=place.location.marker_image;} var replaceData={"{marker_id}":place.id,"{marker_title}":link,"{marker_address}":place.address,"{marker_latitude}":place.location.lat,"{marker_longitude}":place.location.lng,"{marker_city}":place.location.city,"{marker_state}":place.location.state,"{marker_country}":place.location.country,"{marker_postal_code}":place.location.postal_code,"{marker_zoom}":place.location.zoom,"{marker_icon}":image,"{marker_category}":category_name.join(","),"{marker_message}":place.content,"{marker_image}":marker_image,"{wpgmp_listing_html}":place.listing_hook};if(typeof place.location.extra_fields!='undefined'){for(var extra in place.location.extra_fields){if(!place.location.extra_fields[extra]){replaceData['{'+extra+'}']='
    ';}else{replaceData['{'+extra+'}']=place.location.extra_fields[extra];}}} if(wpgmp_arr){for(var n in wpgmp_arr){replaceData["{"+n+"}"]=wpgmp_remove_last_comma(wpgmp_arr[n]);}} function wpgmp_remove_last_comma(strng){var n=strng.lastIndexOf(",");var a=strng.substring(0,n) return a;} temp_listing_placeholder=temp_listing_placeholder.replace(/{[^{}]+}/g,function(match){if(match in replaceData){return(replaceData[match]);}else{return("");}});content+=temp_listing_placeholder;}}}else{content="
    "+wpgmp_local.wpgmp_location_no_results+"
    ";} content+='
    ';$(listing_container).find(".wpgmp_categories").html(content);$(listing_container).find(".wpgmp_empty").prev().remove();$(listing_container).find(".wpgmp_empty").remove();$(listing_container).find('.wpgmp_locations').responsiveEqualHeightGrid();return false;},open_infowindow:function(current_place){var map_obj=this;$.each(this.map_data.places,function(key,place){if(parseInt(place.id)==parseInt(current_place)&&place.marker.visible===true){map_obj.openInfoWindow(place);}});},place_info:function(place_id){var place_obj;$.each(this.places,function(index,place){if(parseInt(place.id)==parseInt(place_id)){place_obj=place;}});return place_obj;},create_routes:function(){var map_obj=this;if(this.map_data.routes){$.each(this.map_data.routes,function(index,routeobj){var directionsService=new google.maps.DirectionsService();var route_polyline={strokeColor:routeobj.route_stroke_color,strokeOpacity:routeobj.route_stroke_opacity,strokeWeight:routeobj.route_stroke_weight,clickable:routeobj.route_marker_draggable};var renderer_options={draggable:routeobj.route_marker_draggable,suppressMarkers:true,suppressInfoWindows:true,preserveViewport:true,polylineOptions:route_polyline,};var start=routeobj.start_location_data;var end=routeobj.end_location_data;var waypts=[];if(typeof routeobj.way_points!='undefined'){$.each(routeobj.way_points,function(point_index,place){waypts.push({location:place,stopover:true});});} var request={origin:start,destination:end,waypoints:waypts,optimizeWaypoints:routeobj.route_optimize_waypoints,travelMode:eval("google.maps.TravelMode."+routeobj.route_travel_mode),unitSystem:eval("google.maps.UnitSystem."+routeobj.route_unit_system),};directionsService.route(request,function(response,status){if(status==google.maps.DirectionsStatus.OK){directionsDisplay=new google.maps.DirectionsRenderer(renderer_options);directionsDisplay.setMap(map_obj.map);directionsDisplay.setDirections(response);directionsDisplay.setPanel($(".directions-panel-route"+routeobj.route_id+"").get(0));if(typeof routeobj.route_id!='undefined'){map_obj.route_directions[routeobj.route_id]=directionsDisplay;}}else{console.log(""+wpgmp_local.wpgmp_route_not_avilable+"");}});});}},enable_drawing:function(){var map_obj=this;map_obj.drawingmanager=new google.maps.drawing.DrawingManager({drawingMode:null,drawingControl:true,drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.CIRCLE,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE]},circleOptions:{fillColor:'#003dce',strokeColor:'#003dce',strokeWeight:'1',strokeOpacity:'0.5',zindex:1,fillOpacity:'0.5',editable:false,draggable:false},polygonOptions:{fillColor:'#003dce',strokeColor:'#003dce',strokeWeight:'1',strokeOpacity:'0.5',zindex:1,fillOpacity:'0.5',editable:false,draggable:false},polylineOptions:{fillColor:'#003dce',strokeColor:'#003dce',strokeWeight:'1',strokeOpacity:'0.5',zindex:1,fillOpacity:'0.5',editable:false,draggable:false},rectangleOptions:{fillColor:'#003dce',strokeColor:'#003dce',strokeWeight:'1',strokeOpacity:'0.5',zindex:1,fillOpacity:'0.5',editable:false,draggable:false}});map_obj.drawingmanager.setMap(map_obj.map);map_obj.event_listener(map_obj.drawingmanager,'circlecomplete',function(circle){map_obj.wpgmp_circles.push(circle);map_obj.wpgmp_shape_complete(circle,'circle');});map_obj.event_listener(map_obj.drawingmanager,'polygoncomplete',function(polygon){map_obj.wpgmp_polygons.push(polygon);map_obj.wpgmp_shape_complete(polygon,'polygon');});map_obj.event_listener(map_obj.drawingmanager,'polylinecomplete',function(polyline){map_obj.wpgmp_polylines.push(polyline);map_obj.wpgmp_shape_complete(polyline,'polyline');});map_obj.event_listener(map_obj.drawingmanager,'rectanglecomplete',function(rectangle){map_obj.wpgmp_rectangles.push(rectangle);map_obj.wpgmp_shape_complete(rectangle,'rectangle');});},create_polygon:function(){var map_obj=this;$.each(this.map_data.shapes.shape.polygons,function(index,polygon){var path=[];$.each(polygon.cordinates,function(ind,cordinate){var latlng=cordinate.split(',');path.push(new google.maps.LatLng(latlng[0],latlng[1]));});polygon.reference=new google.maps.Polygon({paths:path,strokeColor:polygon.settings.stroke_color,strokeOpacity:polygon.settings.stroke_opacity,strokeWeight:polygon.settings.stroke_weight,fillColor:polygon.settings.fill_color,fillOpacity:polygon.settings.fill_opacity});if(typeof map_obj.map_data.shapes!='undefined'){if(map_obj.map_data.shapes.drawing_editable===true){map_obj.event_listener(polygon.reference,"click",function(){map_obj.setSelection(polygon.reference);map_obj.get_shapes_options(polygon.reference,'polygon');});}else if(polygon.events.url!==''||polygon.events.message!==''){map_obj.event_listener(polygon.reference,"click",function(){if(polygon.events.url===''&&polygon.events.message!==''){var bounds=new google.maps.LatLngBounds();polygon.reference.getPath().forEach(function(element,index){bounds.extend(element);});$.each(map_obj.places,function(key,place){place.infowindow.close();});map_obj.opened_info.setPosition(bounds.getCenter());if(map_obj.settings.map_infowindow_customisations===true) map_obj.opened_info.setContent('
    '+polygon.events.message+'
    ');else map_obj.opened_info.setContent(polygon.events.message);map_obj.opened_info.open(map_obj.map,this);}else{window.location=polygon.events.url;}});}} polygon.reference.setMap(map_obj.map);map_obj.wpgmp_polygons.push(polygon.reference);map_obj.wpgmp_shape_events.push({'shape':polygon.reference,'url':polygon.events.url,'message':polygon.events.message});});},create_polyline:function(){var map_obj=this;$.each(this.map_data.shapes.shape.polylines,function(index,polyline){var path=[];if(typeof polyline.cordinates!='undefined'){$.each(polyline.cordinates,function(ind,cordinate){var latlng=cordinate.split(',');path.push(new google.maps.LatLng(latlng[0],latlng[1]));});polyline.reference=new google.maps.Polyline({path:path,strokeColor:polyline.settings.stroke_color,strokeOpacity:polyline.settings.stroke_opacity,strokeWeight:polyline.settings.stroke_weight});if(typeof map_obj.map_data.shapes!='undefined'){if(map_obj.map_data.shapes.drawing_editable===true){map_obj.event_listener(polyline.reference,"click",function(){map_obj.setSelection(polyline.reference);map_obj.get_shapes_options(polyline.reference,'polyline');});}else if(polyline.events.url!==''||polyline.events.message!==''){map_obj.event_listener(polyline.reference,"click",function(){if(polyline.events.url===''&&polyline.events.message!==''){var bounds=new google.maps.LatLngBounds();polyline.reference.getPath().forEach(function(element,index){bounds.extend(element);});$.each(map_obj.places,function(key,place){place.infowindow.close();});map_obj.opened_info.setPosition(bounds.getCenter());if(map_obj.settings.map_infowindow_customisations===true) map_obj.opened_info.setContent('
    '+polyline.events.message+'
    ');else map_obj.opened_info.setContent(polyline.events.message);map_obj.opened_info.open(map_obj.map,this);}else if(polyline.events.url!==''){window.location=polyline.events.url;}});}}} if(typeof polyline.reference!='undefined'){polyline.reference.setMap(map_obj.map);map_obj.wpgmp_polylines.push(polyline.reference);map_obj.wpgmp_shape_events.push({'shape':polyline.reference,'url':polyline.events.url,'message':polyline.events.message});}});},event_listener:function(obj,type,func){google.maps.event.addListener(obj,type,func);},create_circle:function(){var map_obj=this;$.each(this.map_data.shapes.shape.circles,function(index,circle){var path;$.each(circle.cordinates,function(ind,cordinate){var latlng=cordinate.split(',');path=new google.maps.LatLng(latlng[0],latlng[1]);});circle.reference=new google.maps.Circle({fillColor:circle.settings.fill_color,fillOpacity:circle.settings.fill_opacity,strokeColor:circle.settings.stroke_color,strokeOpacity:circle.settings.stroke_opacity,strokeWeight:circle.settings.stroke_weight,center:path,radius:parseInt(circle.settings.radius)});if(typeof map_obj.map_data.shapes!='undefined'){if(map_obj.map_data.shapes.drawing_editable===true){map_obj.event_listener(circle.reference,"click",function(){map_obj.setSelection(circle.reference);map_obj.get_shapes_options(circle.reference,'circle');});}else if(circle.events.url!==''||circle.events.message!==''){map_obj.event_listener(circle.reference,"click",function(){if(circle.events.url===''&&circle.events.message!==''){$.each(map_obj.places,function(key,place){place.infowindow.close();});map_obj.opened_info.setPosition(circle.reference.getCenter());if(map_obj.settings.map_infowindow_customisations===true) map_obj.opened_info.setContent('
    '+circle.events.message+'
    ');else map_obj.opened_info.setContent(circle.events.message);map_obj.opened_info.open(map_obj.map,this);}else if(circle.events.url!==''){window.location=circle.events.url;}});}} circle.reference.setMap(map_obj.map);map_obj.wpgmp_circles.push(circle.reference);map_obj.wpgmp_shape_events.push({'shape':circle.reference,'url':circle.events.url,'message':circle.events.message});});},create_rectangle:function(){var map_obj=this;$.each(this.map_data.shapes.shape.rectangles,function(index,rectangle){var left_latlng=rectangle.cordinates[0].split(',');var right_latlng=rectangle.cordinates[1].split(',');var path=new google.maps.LatLngBounds(new google.maps.LatLng(left_latlng[0],left_latlng[1]),new google.maps.LatLng(right_latlng[0],right_latlng[1]));rectangle.reference=new google.maps.Rectangle({bounds:path,fillColor:rectangle.settings.fill_color,fillOpacity:rectangle.settings.fill_opacity,strokeColor:rectangle.settings.stroke_color,strokeOpacity:rectangle.settings.stroke_opacity,strokeWeight:rectangle.settings.stroke_weight});if(typeof map_obj.map_data.shapes!='undefined'){if(map_obj.map_data.shapes.drawing_editable===true){map_obj.event_listener(rectangle.reference,"click",function(){map_obj.setSelection(rectangle.reference);map_obj.get_shapes_options(rectangle.reference,'rectangle');});}else if(rectangle.events.url!==''||rectangle.events.message!==''){map_obj.event_listener(rectangle.reference,"click",function(){if(rectangle.events.url===''&&rectangle.events.message!==''){$.each(map_obj.places,function(key,place){place.infowindow.close();});map_obj.opened_info.setPosition(rectangle.reference.getBounds().getCenter());if(map_obj.settings.map_infowindow_customisations===true) map_obj.opened_info.setContent('
    '+rectangle.events.message+'
    ');else map_obj.opened_info.setContent(rectangle.events.message);map_obj.opened_info.open(map_obj.map,this);}else if(rectangle.events.url!==''){window.location=rectangle.events.url;}});}} rectangle.reference.setMap(map_obj.map);map_obj.wpgmp_rectangles.push(rectangle.reference);map_obj.wpgmp_shape_events.push({'shape':rectangle.reference,'url':rectangle.events.url,'message':rectangle.events.message,});});},get_shapes_options:function(shape,type){$(".hiderow").show();$("input[name='shape_fill_color']").val(shape.fillColor);$("input[name='shape_fill_color']").parent().parent().find('.wp-color-result').css('background-color',shape.fillColor);$("select[name='shape_fill_opacity']").val(shape.fillOpacity);$("input[name='shape_stroke_color']").val(shape.strokeColor);$("input[name='shape_stroke_color']").parent().parent().find('.wp-color-result').css('background-color',shape.strokeColor);$("select[name='shape_stroke_opacity']").val(shape.strokeOpacity);$("select[name='shape_stroke_weight']").val(shape.strokeWeight);$("textarea[name='shape_path']").parent().hide();$("input[name='shape_radius']").parent().hide();$("input[name='shape_center']").parent().hide();$("input[name='shape_northeast']").parent().hide();$("input[name='shape_southwest']").parent().hide();var all_shape_events=this.wpgmp_shape_events;$.each(all_shape_events,function(i,shape_event){if(shape_event.shape==shape){$("input[name='shape_click_url']").val(shape_event.url);$("textarea[name='shape_click_message']").val(shape_event.message);}});if(type=='circle'){$("input[name='shape_radius']").parent().show();$("input[name='shape_radius']").val(shape.getRadius());$("input[name='shape_center']").parent().show();$("input[name='shape_center']").val(shape.getCenter().lat()+','+shape.getCenter().lng());}else if(type=='rectangle'){$("input[name='shape_northeast']").parent().show();$("input[name='shape_northeast']").val(shape.getBounds().getNorthEast().lat()+','+shape.getBounds().getNorthEast().lng());$("input[name='shape_southwest']").parent().show();$("input[name='shape_southwest']").val(shape.getBounds().getSouthWest().lat()+','+shape.getBounds().getSouthWest().lng());}else{var polygon_cordinate=[];var cordinates=shape.getPath();cordinates.forEach(function(latlng,index){var latlngin=[latlng.lat(),latlng.lng()];if(latlng.lat()!==""&&latlng.lng()!=="") polygon_cordinate.push(latlngin);});$("textarea[name='shape_path']").parent().show();$("textarea[name='shape_path']").val(polygon_cordinate.join(' '));}},set_shapes_options:function(shape){var polyOptions2={fillColor:$("input[name='shape_fill_color']").val(),fillOpacity:$("select[name='shape_fill_opacity']").val(),strokeColor:$("input[name='shape_stroke_color']").val(),strokeOpacity:$("select[name='shape_stroke_opacity']").val(),strokeWeight:$("select[name='shape_stroke_weight']").val(),};shape.setOptions(polyOptions2);var all_shape_events=this.wpgmp_shape_events;$.each(all_shape_events,function(i,shape_event){if(shape_event.shape==shape){shape_event.url=$("input[name='shape_click_url']").val();shape_event.message=$("textarea[name='shape_click_message']").val();}});},wpgmp_save_shapes:function(allcordinate){$("input[name='shapes_values']").val(allcordinate.join("|"));},wpgmp_shape_complete:function(shape,type){var map_obj=this;map_obj.setSelection(shape);map_obj.drawingmanager.setDrawingMode(null);if(typeof map_obj.map_data.shapes!='undefined'){if(map_obj.map_data.shapes.drawing_editable===true){map_obj.event_listener(shape,'click',function(){map_obj.setSelection(shape);map_obj.get_shapes_options(shape,type);});map_obj.wpgmp_shape_events.push({'shape':shape,'url':'','message':''});}}}, wpgmp_save_polylines:function(){var all_polylines=[];var map_obj=this;var wpgmp_polylines=map_obj.wpgmp_polylines;var all_shape_events=map_obj.wpgmp_shape_events;for(var i=0;imaxX)x=maxX;if(ymaxY)y=maxY;panning_map_obj.setCenter(new google.maps.LatLng(y,x));});google.maps.event.addListener(panning_map_obj,"zoom_changed",function(){if(panning_map_obj.getZoom()');wpgmp_iwOuter.on('click','.infowindow-close',function(event){$.each(map_obj.places,function(key,place){place.infowindow.close();place.marker.setAnimation(null);});});});}},resize_map:function(){var map_obj=this;var gmap=map_obj.map;var zoom=gmap.getZoom();var center=gmap.getCenter();google.maps.event.trigger(this.map,'resize');gmap.setZoom(zoom);gmap.setCenter(center);},responsive_map:function(){var map_obj=this;var gmap=map_obj.map;google.maps.event.addDomListener(window,"resize",function(){var zoom=gmap.getZoom();var center=gmap.getCenter();google.maps.event.trigger(gmap,"resize");gmap.setZoom(zoom);gmap.setCenter(center);gmap.getBounds();});},show_search_control:function(){var map_obj=this;var input=$('[data-input="map-search-control"]')[0];if(input!==undefined){var searchBox=new google.maps.places.SearchBox(input);map_obj.map.controls[eval("google.maps.ControlPosition."+map_obj.settings.search_control_position)].push(input);map_obj.map.addListener('bounds_changed',function(){searchBox.setBounds(map_obj.map.getBounds());});google.maps.event.addListener(searchBox,'places_changed',function(){var places=searchBox.getPlaces();if(places.length==0){return;} var bounds=new google.maps.LatLngBounds();places.forEach(function(place){if(!place.geometry){console.log("Returned place contains no geometry");return;} if(place.geometry.viewport){bounds.union(place.geometry.viewport);}else{bounds.extend(place.geometry.location);}});map_obj.map.fitBounds(bounds);});}},fit_bounds:function(){var map_obj=this;var places=map_obj.map_data.places;var bounds=new google.maps.LatLngBounds();places.forEach(function(place){if(place.location.lat&&place.location.lng){bounds.extend(new google.maps.LatLng(parseFloat(place.location.lat),parseFloat(place.location.lng)));}});map_obj.map.fitBounds(bounds);},create_markers:function(){var map_obj=this;var places=map_obj.map_data.places;var temp_listing_placeholder;var replaceData;var remove_keys=[];$.each(places,function(key,place){if(place.location.lat&&place.location.lng){if(typeof place.categories=='undefined'){place.categories={};} place.marker=new google.maps.Marker({position:new google.maps.LatLng(parseFloat(place.location.lat),parseFloat(place.location.lng)),icon:place.location.icon,url:place.url,draggable:place.location.draggable,map:map_obj.map,clickable:place.location.infowindow_disable,});if(map_obj.settings.infowindow_drop_animation===true){place.marker.setAnimation(google.maps.Animation.DROP);} if(map_obj.settings.infowindow_filter_only===true){place.marker.visible=false;place.marker.setVisible(false);} if(map_obj.map_data.page=='edit_location') map_obj.marker_bind(place.marker);var location_categories=[];if(typeof place.categories!='undefined'){for(var cat in place.categories){location_categories.push(place.categories[cat].name);}} var content='';var marker_image='';if(place.source=='post'){marker_image=place.location.extra_fields.post_featured_image;}else{marker_image=place.location.marker_image;} var temp_listing_placeholder='';if(place.source=='post'){temp_listing_placeholder=map_obj.settings.infowindow_geotags_setting;}else{temp_listing_placeholder=map_obj.settings.infowindow_setting;} if(typeof temp_listing_placeholder=='undefined'){temp_listing_placeholder=place.content;} replaceData={"{marker_id}":place.id,"{marker_title}":place.title,"{marker_address}":place.address,"{marker_latitude}":place.location.lat,"{marker_longitude}":place.location.lng,"{marker_city}":place.location.city,"{marker_state}":place.location.state,"{marker_country}":place.location.country,"{marker_postal_code}":place.location.postal_code,"{marker_zoom}":place.location.zoom,"{marker_icon}":place.location.icon,"{marker_category}":location_categories.join(','),"{marker_message}":place.content,"{marker_image}":marker_image};if(typeof place.location.extra_fields!='undefined'){for(var extra in place.location.extra_fields){if(!place.location.extra_fields[extra]){replaceData['{'+extra+'}']="
    ";}else{replaceData['{'+extra+'}']=place.location.extra_fields[extra];}}} temp_listing_placeholder=temp_listing_placeholder.replace(/{[^{}]+}/g,function(match){if(match in replaceData){return(replaceData[match]);}else{return("");}});content=temp_listing_placeholder;if(content===""){if(map_obj.settings.map_infowindow_customisations===true&&map_obj.settings.show_infowindow_header===true) content='
    '+place.title+'
    '+place.content+'
    ';else content='
    '+place.content+'
    ';}else{if(map_obj.settings.map_infowindow_customisations===true&&map_obj.settings.show_infowindow_header===true) content='
    '+place.title+'
    '+content+'
    ';else content='
    '+content+'
    ';} place.infowindow_data=content;place.infowindow=map_obj.infowindow_marker;if(place.location.infowindow_default_open===true){map_obj.openInfoWindow(place);}else if(map_obj.settings.default_infowindow_open===true){map_obj.openInfoWindow(place);} var on_event=map_obj.settings.infowindow_open_event;var bounce_on_event=map_obj.settings.infowindow_bounce_animation;map_obj.event_listener(place.marker,on_event,function(){$.each(map_obj.places,function(key,prev_place){prev_place.infowindow.close();prev_place.marker.setAnimation(null);});map_obj.openInfoWindow(place);if(bounce_on_event=='click'){map_obj.toggle_bounce(place.marker);}});if(bounce_on_event=='mouseover'&&on_event!='mouseover'){map_obj.event_listener(place.marker,'mouseover',function(){place.marker.setAnimation(google.maps.Animation.BOUNCE);});map_obj.event_listener(place.marker,'mouseout',function(){place.marker.setAnimation(null);});} if(bounce_on_event!=''){google.maps.event.addListener(place.infowindow,'closeclick',function(){place.marker.setAnimation(null);});} map_obj.places.push(place);}else{remove_keys.push(key);}});$.each(remove_keys,function(index,value){places.splice(value,1);});},toggle_bounce:function(marker){if(marker.getAnimation()!==null){marker.setAnimation(null);}else{marker.setAnimation(google.maps.Animation.BOUNCE);}},display_markers:function(){var map_obj=this;map_obj.show_places=[];map_obj.categories=[];var categories={};for(var i=0;i
    '+map_obj.settings.center_marker_infowindow+'
    ');else map_obj.map_center_info.setContent(map_obj.settings.center_marker_infowindow);map_obj.map_center_info.open(map_obj.map,this);});}},center_by_nearest:function(){var map_obj=this;this.get_current_location(function(user_position){if(!map_obj.user_location_marker){map_obj.user_location_marker=new google.maps.Marker({position:user_position,title:wpgmp_local.center_location_message,map:map_obj.map,icon:map_obj.settings.marker_default_icon});} map_obj.user_location_marker.setVisible(true);if(typeof map_obj.map_center_info=='undefined'){map_obj.map_center_info=map_obj.infowindow_marker;} if(map_obj.settings.center_marker_infowindow!=''){google.maps.event.addListener(map_obj.user_location_marker,'click',function(){map_obj.map_center_info.setPosition(user_position);if(map_obj.settings.map_infowindow_customisations===true) map_obj.map_center_info.setContent('
    '+map_obj.settings.center_marker_infowindow+'
    ');else map_obj.map_center_info.setContent(map_obj.settings.center_marker_infowindow);map_obj.map_center_info.open(map_obj.map,this);});} map_obj.map.setCenter(user_position);if(map_obj.settings.show_center_circle===true){map_obj.show_center_circle();}});},get_current_location:function(success_func,error_func){var map=this;if(typeof map.user_location=='undefined'){navigator.geolocation.getCurrentPosition(function(position){map.user_location=new google.maps.LatLng(position.coords.latitude,position.coords.longitude);if(success_func) success_func(map.user_location);},function(ErrorPosition){if(error_func) error_func(ErrorPosition);},{enableHighAccuracy:true,timeout:5000,maximumAge:0});}else{if(success_func) success_func(map.user_location);}},openInfoWindow:function(place){var map_obj=this;place.infowindow=map_obj.infowindow_marker;place.infowindow.setContent(place.infowindow_data);if(place.location.onclick_action=="custom_link"){if(place.location.open_new_tab=='yes') window.open(place.location.redirect_custom_link,'_blank');else window.open(place.location.redirect_custom_link,'_self');}else{place.infowindow.open(this.map,place.marker);if(typeof map_obj.settings.infowindow_click_change_center!='undefined'&&map_obj.settings.infowindow_click_change_center==true){map_obj.map.setCenter(place.marker.getPosition());} if(typeof map_obj.settings.infowindow_click_change_zoom!='undefined'&&map_obj.settings.infowindow_click_change_zoom>0){map_obj.map.setZoom(map_obj.settings.infowindow_click_change_zoom);} if(this.map_data.map_tabs&&this.map_data.map_tabs.direction_tab&&this.map_data.map_tabs.direction_tab.dir_tab===true){$(this.container).find('.start_point').val(place.address);}} $(map_obj.container).find(".wpgmp_empty").prev().remove();$(map_obj.container).find(".wpgmp_empty").remove();},};$.fn.maps=function(options,places){this.each(function(){if(!$.data(this,"wpgmp_maps")){$.data(this,"wpgmp_maps",new GoogleMaps(this,options,places));}});return this;};}(jQuery,window,document)); document.addEventListener("DOMContentLoaded",(t=>{var e;wpcf7_recaptcha={...null!==(e=wpcf7_recaptcha)&&void 0!==e?e:{}};const c=wpcf7_recaptcha.sitekey,{homepage:n,contactform:a}=wpcf7_recaptcha.actions,o=t=>{const{action:e,func:n,params:a}=t;grecaptcha.execute(c,{action:e}).then((t=>{const c=new CustomEvent("wpcf7grecaptchaexecuted",{detail:{action:e,token:t}});document.dispatchEvent(c)})).then((()=>{"function"==typeof n&&n(...a)})).catch((t=>console.error(t)))};if(grecaptcha.ready((()=>{o({action:n})})),document.addEventListener("change",(t=>{o({action:a})})),"undefined"!=typeof wpcf7&&"function"==typeof wpcf7.submit){const t=wpcf7.submit;wpcf7.submit=function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o({action:a,func:t,params:[e,c]})}}document.addEventListener("wpcf7grecaptchaexecuted",(t=>{const e=document.querySelectorAll('form.wpcf7-form input[name="_wpcf7_recaptcha_response"]');for(let c=0;c-1||(M._activeInstances.push(t),M._emitter.on(D,t._onMove),M._emitter.on(A,t._onCancel),M._emitter.on(b,t._onEnd),1===M._activeInstances.length&&M._bindListeners())},M._deactivateInstance=function(t){var e=M._activeInstances.indexOf(t);-1!==e&&(M._activeInstances.splice(e,1),M._emitter.off(D,t._onMove),M._emitter.off(A,t._onCancel),M._emitter.off(b,t._onEnd),M._activeInstances.length||M._unbindListeners())},M._bindListeners=function(){var t=M._events;window.addEventListener(t.move,M._onMove,R),window.addEventListener(t.end,M._onEnd,R),t.cancel&&window.addEventListener(t.cancel,M._onCancel,R)},M._unbindListeners=function(){var t=M._events;window.removeEventListener(t.move,M._onMove,R),window.removeEventListener(t.end,M._onEnd,R),t.cancel&&window.removeEventListener(t.cancel,M._onCancel,R)},M._getEventPointerId=function(t){return"number"==typeof t.pointerId?t.pointerId:t.changedTouches?t.changedTouches[0]?t.changedTouches[0].identifier:null:1},M._getTouchById=function(t,e){if("number"==typeof t.pointerId)return t.pointerId===e?t:null;if(t.changedTouches){for(var i=0;i-1&&(this._queue[n]=void 0),s?this._queue.unshift(t):this._queue.push(t),this._reads[t]=e,this._writes[t]=i,this._nextStep||(this._nextStep=y(this._step))},T.prototype.cancel=function(t){var e=this._queue.indexOf(t);e>-1&&(this._queue[e]=void 0,delete this._reads[t],delete this._writes[t])},T.prototype._step=function(){var t,e,i=this._queue,s=this._reads,n=this._writes,r=this._batch,o=this._batchReads,h=this._batchWrites,a=i.length;for(this._nextStep=null,e=0;en?n:e<0?Math.max(n+e+1,0):e}function K(t,e,i){if(!(t.length<2)){var s=J(t,e),n=J(t,i);s!==n&&t.splice(n,0,t.splice(s,1)[0])}}function Q(t,e,i){if(!(t.length<2)){var s,n=J(t,e),r=J(t,i);n!==r&&(s=t[n],t[n]=t[r],t[r]=s)}}var tt="cancel",et="finish",it="debounce",st=0;function nt(t,e){var i,s=++st+it;return e>0?function(n){void 0!==i&&(i=window.clearTimeout(i),k.cancel(s),n===et&&t()),n!==tt&&n!==et&&(i=window.setTimeout(function(){i=void 0,k.add(s,t,null,!0)},e))}:function(e){e!==tt&&t()}}function rt(t){var e=a(t,"transform");if(!e||"none"===e)return!1;var i=a(t,"display");return"inline"!==i&&"none"!==i}function ot(t,e){for(var i=window.document,s=(e?t:t.parentElement)||i;s&&s!==i&&"static"===a(s,"position")&&!rt(s);)s=s.parentElement||i;return s}function ht(t,e){return parseFloat(a(t,e))||0}var at={},_t={},lt={};function dt(t,e){var i,s=e||{};return s.left=0,s.top=0,t===document?s:(s.left=window.pageXOffset||0,s.top=window.pageYOffset||0,t.self===window.self?s:(i=t.getBoundingClientRect(),s.left+=i.left,s.top+=i.top,s.left+=ht(t,"border-left-width"),s.top+=ht(t,"border-top-width"),s))}function ct(t,e,i){return lt.left=0,lt.top=0,t===e?lt:i&&(t=ot(t,!0))===(e=ot(e,!0))?lt:(dt(t,at),dt(e,_t),lt.left=_t.left-at.left,lt.top=_t.top-at.top,lt)}var ut="overflow",ft="overflow-x",pt="overflow-y",mt="auto",gt="scroll";function yt(t){var e=a(t,ut);return e===mt||e===gt||((e=a(t,ft))===mt||e===gt||((e=a(t,pt))===mt||e===gt))}function vt(t,e,i){for(var s=i||[],n=e?t:t.parentNode;n&&n!==document;)n.getRootNode&&n instanceof DocumentFragment?n=n.getRootNode().host:(yt(n)&&s.push(n),n=n.parentNode);return s.push(window),s}var wt={},St="transform",Dt="none",bt=/^matrix3d/,At=/([^,]*,){4}/,Et=/([^,]*,){12}/,Ct=/[^,]*,/;function Lt(t){wt.x=0,wt.y=0;var e=a(t,St);if(!e||e===Dt)return wt;var i=bt.test(e),s=e.replace(i?Et:At,""),n=s.replace(Ct,"");return wt.x=parseFloat(s)||0,wt.y=parseFloat(n)||0,wt}function It(t,e){return"translateX("+t+"px) translateY("+e+"px)"}function Rt(t,e){t.classList?t.classList.remove(e):W(t,"."+e)&&(t.className=(" "+t.className+" ").replace(" "+e+" "," ").trim())}var xt,Pt,Mt,Tt,kt=0;function Xt(t){var e=t._element,i=t.getGrid(),s=i._settings;this._item=t,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=c(s.dragStartPredicate)?s.dragStartPredicate:Xt.defaultStartPredicate,this._startPredicateState=kt,this._startPredicateResult=void 0,this._hBlockedIndex=null,this._hX1=0,this._hX2=0,this._hY1=0,this._hY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._checkOverlap=this._checkOverlap.bind(this);var n=s.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=nt(this._checkOverlap,n),this._dragger=new M(e,s.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function Yt(t,e){return t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top?0:(Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left))*(Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top))/(Math.min(t.width,e.width)*Math.min(t.height,e.height))*100}function Gt(t){this._item=t,this._animate=new p,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._currentLeft=0,this._currentTop=0,this._nextLeft=0,this._nextTop=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this)}function Ht(){this._queue=[],this._isDestroyed=!1}function Ot(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._currentLeft=0,this._currentTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animateOptions={onFinish:this._finish.bind(this)},this._queue=new Ht,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}Xt.defaultStartPredicate=function(t,e,i){var s=t._drag,n=s._startPredicateData||s._setupStartPredicate(i);if(!e.isFinal)return!(!n.handleElement&&(n.handleElement=s._getStartPredicateHandle(e),!n.handleElement))&&(n.delay&&(n.event=e,n.delayTimer||(n.delayTimer=window.setTimeout(function(){n.delay=0,s._resolveStartPredicate(n.event)&&(s._forceResolveStartPredicate(n.event),s._resetStartPredicate())},n.delay))),s._resolveStartPredicate(e));s._finishStartPredicate(e)},Xt.defaultSortPredicate=(xt={},Pt={},Mt={},Tt=[],function(t,e){var i=t._drag,s=i._getGrid(),n=e&&"number"==typeof e.threshold?e.threshold:50,r=e&&"swap"===e.action?"swap":"move";xt.width=t._width,xt.height=t._height,xt.left=i._elementClientX,xt.top=i._elementClientY;var o=function(t,e,i){var s,n,r,o,h=null,a=e._settings.dragSort,_=-1;if(!0===a?(Tt[0]=e,n=Tt):n=a.call(e,t),!Array.isArray(n))return h;for(o=0;oi&&s>_&&(_=s,h=r));return Tt.length=0,h}(t,s,n);if(!o)return!1;var h,a,_,l,d,c=0,u=0,f=-1;for(o===s?(xt.left=i._gridX+t._marginLeft,xt.top=i._gridY+t._marginTop):(o._updateBorders(1,0,1,0),c=o._left+o._borderLeft,u=o._top+o._borderTop),d=0;df&&(h=d,f=l));return f=n&&(Mt.grid=o,Mt.index=h,Mt.action=r,Mt)}),Xt.prototype.stop=function(){var t=this._item,e=t._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(N(t._id),q(t._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),e.parentNode!==i._element&&(i._element.appendChild(e),e.style[n]=It(this._gridX,this._gridY)),Rt(e,i._settings.itemDraggingClass),this._reset(),this):this},Xt.prototype.destroy=function(){return this._isDestroyed?this:(this.stop(),this._dragger.destroy(),this._isDestroyed=!0,this)},Xt.prototype._getGrid=function(){return t[this._gridId]||null},Xt.prototype._reset=function(){this._isActive=!1,this._container=null,this._containingBlock=null,this._dragEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._elementClientX=0,this._elementClientY=0,this._containerDiffX=0,this._containerDiffY=0},Xt.prototype._bindScrollListeners=function(){var t,e,i=this._getGrid()._element,s=this._container,n=this._scrollers;if(n.length=0,vt(this._item._element,!1,n),s!==i)for(vt(i,!0,t=[]),e=0;e=s&&t.pageX=n&&t.pageY3&&e.minBounceBackAngle>0;if(h||(this._hBlockedIndex=null),Math.abs(r)>i||Math.abs(o)>i){if(h){var a=Math.atan2(r,o),_=Math.atan2(this._hX2-this._hX1,this._hY2-this._hY1),l=Math.atan2(Math.sin(a-_),Math.cos(a-_));Math.abs(l)>e.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=s,this._hY2=n,!0}return!1},Xt.prototype._resetStartPredicate=function(){var t=this._startPredicateData;t&&(t.delayTimer&&(t.delayTimer=window.clearTimeout(t.delayTimer)),this._startPredicateData=null)},Xt.prototype._checkOverlap=function(){if(this._isActive){var t,e,i,s,n,r,o,h=this._item,a=this._getGrid()._settings;(t=c(a.dragSortPredicate)?a.dragSortPredicate(h,this._dragEvent):Xt.defaultSortPredicate(h,a.dragSortPredicate))&&"number"==typeof t.index&&(o=(e=h.getGrid())!==(s=t.grid||e),i=e._items.indexOf(h),n=J(s._items,t.index,o),r="swap"===t.action?"swap":"move",(o||n!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,e._hasListeners("beforeSend")&&e._emit("beforeSend",{item:h,fromGrid:e,fromIndex:i,toGrid:s,toIndex:n}),s._hasListeners("beforeReceive")&&s._emit("beforeReceive",{item:h,fromGrid:e,fromIndex:i,toGrid:s,toIndex:n}),h._gridId=s._id,this._isMigrating=h._gridId!==this._gridId,e._items.splice(i,1),$(s._items,h,n),h._sortData=null,e._hasListeners("send")&&e._emit("send",{item:h,fromGrid:e,fromIndex:i,toGrid:s,toIndex:n}),s._hasListeners("receive")&&s._emit("receive",{item:h,fromGrid:e,fromIndex:i,toGrid:s,toIndex:n}),e.layout(),s.layout()):i!==n&&(this._hBlockedIndex=i,("swap"===r?Q:K)(e._items,i,n),e._hasListeners("move")&&e._emit("move",{item:h,fromIndex:i,toIndex:n,action:r}),e.layout())))}},Xt.prototype._finishMigration=function(){var t,e,i=this._item,s=i._release,r=i._element,o=i._isActive,h=i.getGrid(),a=h._element,_=h._settings,l=_.dragContainer||a,d=this._getGrid()._settings,c=r.parentNode;this._isMigrating=!1,this.destroy(),Rt(r,d.itemClass),Rt(r,d.itemVisibleClass),Rt(r,d.itemHiddenClass),j(r,_.itemClass),j(r,o?_.itemVisibleClass:_.itemHiddenClass),l!==c&&(l.appendChild(r),e=ct(c,l,!0),(t=Lt(r)).x-=e.left,t.y-=e.top),i._refreshDimensions(),i._refreshSortData(),e=ct(l,a,!0),s._containerDiffX=e.left,s._containerDiffY=e.top,i._drag=_.dragEnabled?new Xt(i):null,l!==c&&(r.style[n]=It(t.x,t.y)),i._child.removeAttribute("style"),f(i._child,o?_.visibleStyles:_.hiddenStyles),s.start()},Xt.prototype._preStartCheck=function(t){this._startPredicateState===kt&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,t),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(t)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(t)},Xt.prototype._preEndCheck=function(t){var e=2===this._startPredicateState;this._startPredicate(this._item,t),this._startPredicateState=kt,e&&this._isActive&&this._onEnd(t)},Xt.prototype._onStart=function(t){var e=this._item;if(e._isActive){var i,s=e._element,r=this._getGrid(),o=r._settings,h=e._release,a=e._migrate,_=r._element,l=o.dragContainer||_,d=ot(l,!0),c=Lt(s),u=c.x,f=c.y,p=s.getBoundingClientRect(),m=l!==_;this._resetHeuristics(t),m&&(i=ct(d,_)),e.isPositioning()&&e._layout.stop(!0,{transform:It(u,f)}),a._isActive&&(u-=a._containerDiffX,f-=a._containerDiffY,a.stop(!0,{transform:It(u,f)})),e.isReleasing()&&h._reset(),this._isActive=!0,this._dragEvent=t,this._container=l,this._containingBlock=d,this._elementClientX=p.left,this._elementClientY=p.top,this._left=this._gridX=u,this._top=this._gridY=f,o.dragPlaceholder.enabled&&e._dragPlaceholder.create(),r._emit("dragInit",e,t),m&&(this._containerDiffX=i.left,this._containerDiffY=i.top,s.parentNode===l?(this._gridX=u-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=u+this._containerDiffX,this._top=f+this._containerDiffY,l.appendChild(s),s.style[n]=It(this._left,this._top))),j(s,o.itemDraggingClass),this._bindScrollListeners(),r._emit("dragStart",e,t)}},Xt.prototype._onMove=function(t){var e=this._item;if(e._isActive){var i,s,n,r=this._getGrid()._settings.dragAxis;if("y"!==r){var o=t.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==r){var h=t.clientY-this._dragEvent.clientY;this._top+=h,this._gridY+=h,this._elementClientY+=h}this._dragEvent=t,i=e._id,s=this._prepareMove,n=this._applyMove,k.add(i+G,s,n,!0)}else this.stop()},Xt.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},Xt.prototype._applyMove=function(){var t=this._item;t._isActive&&(t._element.style[n]=It(this._left,this._top),this._getGrid()._emit("dragMove",t,this._dragEvent))},Xt.prototype._onScroll=function(t){var e,i,s,n=this._item;n._isActive?(this._scrollEvent=t,e=n._id,i=this._prepareScroll,s=this._applyScroll,k.add(e+H,i,s,!0)):this.stop()},Xt.prototype._prepareScroll=function(){var t=this._item;if(t._isActive){var e,i=t._element,s=this._getGrid(),n=s._settings,r=n.dragAxis,o=s._element,h=i.getBoundingClientRect(),a=this._elementClientX-h.left,_=this._elementClientY-h.top;this._container!==o&&(e=ct(this._containingBlock,o),this._containerDiffX=e.left,this._containerDiffY=e.top),"y"!==r&&(this._left+=a,this._gridX=this._left-this._containerDiffX),"x"!==r&&(this._top+=_,this._gridY=this._top-this._containerDiffY),n.dragSort&&this._checkOverlapDebounce()}},Xt.prototype._applyScroll=function(){var t=this._item;t._isActive&&(t._element.style[n]=It(this._left,this._top),this._getGrid()._emit("dragScroll",t,this._scrollEvent))},Xt.prototype._onEnd=function(t){var e=this._item,i=e._element,s=this._getGrid(),n=s._settings,r=e._release;e._isActive?(N(e._id),q(e._id),n.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),r._containerDiffX=this._containerDiffX,r._containerDiffY=this._containerDiffY,this._reset(),Rt(i,n.itemDraggingClass),s._emit("dragEnd",e,t),this._isMigrating?this._finishMigration():r.start()):this.stop()},Gt.prototype._onLayoutStart=function(){var t=this._item,e=t.getGrid(),i=e._items.indexOf(t),s=e._layout.slots[2*i],n=e._layout.slots[2*i+1];if(this._didMigrate||t._left!==s||t._top!==n){var r,o,h;if(s+=t._marginLeft,n+=t._marginTop,!(e._settings.dragPlaceholder.duration>0)||this._didMigrate){F(t._id);var a={transform:It(s,n)};return this._animate.isAnimating()?this._animate.stop(a):f(this._element,a),void(this._didMigrate&&(e.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=s,this._nextTop=n,r=t._id,o=this._setupAnimation,h=this._startAnimation,k.add(r+O,o,h)}},Gt.prototype._setupAnimation=function(){if(this.isActive()){var t=Lt(this._element);this._currentLeft=t.x,this._currentTop=t.y}},Gt.prototype._startAnimation=function(){if(this.isActive()){var t=this._animate,e=this._currentLeft,i=this._currentTop,s=this._nextLeft,n=this._nextTop,r={transform:It(s,n)};if(e!==s||i!==n){var o=this._item.getGrid()._settings.dragPlaceholder,h={transform:It(e,i)};t.start(h,r,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else t.isAnimating()&&t.stop(r)}},Gt.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},Gt.prototype._onReleaseEnd=function(t){if(t._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},Gt.prototype._onMigrate=function(t){if(t.item===this._item){var e=this._item.getGrid(),i=t.toGrid;e.off("dragReleaseEnd",this._onReleaseEnd),e.off("layoutStart",this._onLayoutStart),e.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},Gt.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var t,e=this._item,i=e.getGrid(),s=i._settings,n=this._animate;t=c(s.dragPlaceholder.createElement)?s.dragPlaceholder.createElement(e):window.document.createElement("div"),this._element=t,n._element=t,this._className=s.itemPlaceholderClass||"",this._className&&j(t,this._className);var r=e._left+e._marginLeft,o=e._top+e._marginTop;f(t,{display:"block",position:"absolute",left:"0",top:"0",width:e._width+"px",height:e._height+"px",transform:It(r,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),c(s.dragPlaceholder.onCreate)&&s.dragPlaceholder.onCreate(e,t),i.getElement().appendChild(t)}},Gt.prototype.reset=function(){if(this.isActive()){var t=this._element,e=this._item,i=e.getGrid(),s=i._settings,n=this._animate;this._resetAfterLayout=!1,F(e._id),n.stop(),n._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(Rt(t,this._className),this._className=""),t.parentNode.removeChild(t),this._element=null,c(s.dragPlaceholder.onRemove)&&s.dragPlaceholder.onRemove(e,t)}},Gt.prototype.updateDimensions=function(t,e){this.isActive()&&f(this._element,{width:t+"px",height:e+"px"})},Gt.prototype.isActive=function(){return!!this._element},Gt.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},Ht.prototype.add=function(t){return this._isDestroyed?this:(this._queue.push(t),this)},Ht.prototype.flush=function(t,e){if(this._isDestroyed)return this;var i,s=this._queue,n=s.length;if(!n)return this;var r=1===n,o=r?s[0]:s.slice(0);if(s.length=0,r)return o(t,e),this;for(i=0;i0;return l&&this._queue.flush(!0,o),d&&(a._isPositioningStarted=!0),c(e)&&this._queue.add(e),m?(this._isActive=!0,this._animateOptions.easing=p,this._animateOptions.duration=u,this._isInterrupted=l,s=o._id,n=this._setupAnimation,r=this._startAnimation,k.add(s+X,n,r),this):(this._updateOffsets(),this._updateTargetStyles(),i=o._animate.isAnimating(),this.stop(!1,this._targetStyles),!i&&f(h,this._targetStyles),this._skipNextAnimation=!1,this._finish())}},Ot.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,s=this._item;return i=s._id,k.cancel(i+X),s._animate.stop(e),Rt(s._element,s.getGrid()._settings.itemPositioningClass),this._isActive=!1,t&&this._queue.flush(!0,s),this},Ot.prototype.destroy=function(){return this._isDestroyed?this:(this.stop(!0,{}),this._queue.destroy(),this._item=this._currentStyles=this._targetStyles=this._animateOptions=null,this._isDestroyed=!0,this)},Ot.prototype._updateOffsets=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._offsetLeft=i._isActive?i._containerDiffX:e._isActive?e._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:e._isActive?e._containerDiffY:0}},Ot.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=It(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},Ot.prototype._finish=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._isActive&&(this._isActive=!1,Rt(t._element,t.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),e._isActive&&e.stop(),this._queue.flush(!1,t)}},Ot.prototype._setupAnimation=function(){var t=Lt(this._item._element);this._currentLeft=t.x,this._currentTop=t.y},Ot.prototype._startAnimation=function(){var t=this._item,e=t.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),t._left===this._currentLeft-this._offsetLeft&&t._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||j(t._element,e.itemPositioningClass),this._currentStyles.transform=It(this._currentLeft,this._currentTop),t._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var Bt={};function Nt(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}Nt.prototype.start=function(t,e,i){if(this._isDestroyed)return this;var s,r,o,h,a,_,l,d,c=this._item,u=c._element,p=c.isVisible(),m=c.getGrid(),g=m._settings,y=t._settings,v=t._element,w=t._items,S=m._items.indexOf(c),D=i||window.document.body;if("number"==typeof e)s=J(w,e,!0);else{if(!(r=t._getItem(e)))return this;s=w.indexOf(r)}return(c.isPositioning()||this._isActive||c.isReleasing())&&(l=(_=Lt(u)).x,d=_.y),c.isPositioning()&&c._layout.stop(!0,{transform:It(l,d)}),this._isActive&&(l-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:It(l,d)})),c.isReleasing()&&(l-=c._release._containerDiffX,d-=c._release._containerDiffY,c._release.stop(!0,{transform:It(l,d)})),c._visibility._stopAnimation(),c._drag&&c._drag.destroy(),c._visibility._queue.flush(!0,c),m._hasListeners("beforeSend")&&m._emit("beforeSend",{item:c,fromGrid:m,fromIndex:S,toGrid:t,toIndex:s}),t._hasListeners("beforeReceive")&&t._emit("beforeReceive",{item:c,fromGrid:m,fromIndex:S,toGrid:t,toIndex:s}),Rt(u,g.itemClass),Rt(u,g.itemVisibleClass),Rt(u,g.itemHiddenClass),j(u,y.itemClass),j(u,p?y.itemVisibleClass:y.itemHiddenClass),m._items.splice(S,1),$(w,c,s),c._gridId=t._id,D!==(o=u.parentNode)&&(D.appendChild(u),h=ct(D,o,!0),_||(l=(_=Lt(u)).x,d=_.y),u.style[n]=It(l+h.left,d+h.top)),c._child.removeAttribute("style"),f(c._child,p?y.visibleStyles:y.hiddenStyles),u.style.display=p?"block":"hidden",a=ct(D,v,!0),c._refreshDimensions(),c._refreshSortData(),c._drag=y.dragEnabled?new Xt(c):null,this._isActive=!0,this._container=D,this._containerDiffX=a.left,this._containerDiffY=a.top,m._hasListeners("send")&&m._emit("send",{item:c,fromGrid:m,fromIndex:S,toGrid:t,toIndex:s}),t._hasListeners("receive")&&t._emit("receive",{item:c,fromGrid:m,fromIndex:S,toGrid:t,toIndex:s}),this},Nt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,s=this._item,n=s._element,r=s.getGrid()._element;return this._container!==r&&(e||(t?(i=Lt(n),Bt.transform=It(i.x-this._containerDiffX,i.y-this._containerDiffY)):Bt.transform=It(s._left,s._top),e=Bt),r.appendChild(n),f(n,e)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},Nt.prototype.destroy=function(){return this._isDestroyed?this:(this.stop(!0),this._item=null,this._isDestroyed=!0,this)};var qt={};function Ft(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function zt(t){var e=t._isActive,i=t._element,s=t.getGrid()._settings;this._item=t,this._isDestroyed=!1,this._isHidden=!e,this._isHiding=!1,this._isShowing=!1,this._queue=new Ht,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=e?"block":"none",j(i,e?s.itemVisibleClass:s.itemHiddenClass),f(t._child,e?s.visibleStyles:s.hiddenStyles)}Ft.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var t=this._item,e=t.getGrid();return this._isActive=!0,j(t._element,e._settings.itemReleasingClass),e._emit("dragReleaseStart",t),t._layout.start(!1),this},Ft.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,s=this._item,n=s._element,r=s.getGrid(),o=r._element;return this._reset(),n.parentNode!==o&&(e||(t?(i=Lt(n),qt.transform=It(i.x-this._containerDiffX,i.y-this._containerDiffY)):qt.transform=It(s._left,s._top),e=qt),o.appendChild(n),f(n,e)),t||r._emit("dragReleaseEnd",s),this},Ft.prototype.destroy=function(){return this._isDestroyed?this:(this.stop(!0),this._item=null,this._isDestroyed=!0,this)},Ft.prototype._reset=function(){if(!this._isDestroyed){var t=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,Rt(t._element,t.getGrid()._settings.itemReleasingClass)}},zt.prototype.show=function(t,e){if(this._isDestroyed)return this;var i=this._item,s=i._element,n=this._queue,r=c(e)?e:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!t?(r&&n.add(r),this):(this._isShowing||(n.flush(!0,i),Rt(s,o.itemHiddenClass),j(s,o.itemVisibleClass),this._isHiding||(s.style.display="block")),r&&n.add(r),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,t,this._finishShow),this):(r&&r(!1,i),this)},zt.prototype.hide=function(t,e){if(this._isDestroyed)return this;var i=this._item,s=i._element,n=this._queue,r=c(e)?e:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(r&&r(!1,i),this):this._isHiding&&!t?(r&&n.add(r),this):(this._isHiding||(n.flush(!0,i),j(s,o.itemHiddenClass),Rt(s,o.itemVisibleClass)),r&&n.add(r),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,t,this._finishHide),this)},zt.prototype.destroy=function(){if(this._isDestroyed)return this;var t=this._item,e=t._element,i=t.getGrid(),s=this._queue,n=i._settings;return this._stopAnimation({}),s.flush(!0,t).destroy(),Rt(e,n.itemVisibleClass),Rt(e,n.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},zt.prototype._startAnimation=function(t,e,i){if(!this._isDestroyed){var s,n=this._item,r=n.getGrid()._settings,o=t?r.visibleStyles:r.hiddenStyles,h=parseInt(t?r.showDuration:r.hideDuration)||0,_=(t?r.showEasing:r.hideEasing)||"ease",d=e||h<=0;if(o){if(B(n._id),d)return n._animateChild.isAnimating()?n._animateChild.stop(o):f(n._child,o),void(i&&i());var c,u,p;c=n._id,u=function(){s=function(t,e){var i={};for(var s in e)i[s]=a(t,l(s));return i}(n._child,o)},p=function(){n._animateChild.start(s,o,{duration:h,easing:_,onFinish:i})},k.add(c+Y,u,p)}else i&&i()}},zt.prototype._stopAnimation=function(t){if(!this._isDestroyed){var e=this._item;B(e._id),e._animateChild.stop(t)}},zt.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Vt={};zt.prototype._finishHide=function(){if(this._isHidden){var t=this._item;this._isHiding=!1,Vt.transform=It(0,0),t._layout.stop(!0,Vt),t._element.style.display="none",this._queue.flush(!1,t)}};var Wt,jt,Ut,Zt,$t=0;function Jt(){return++$t}function Kt(t,e,i){var s=t._settings;this._id=Jt(),this._gridId=t._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=e,this._child=e.children[0],e.parentNode!==t._element&&t._element.appendChild(e),j(e,s.itemClass),"boolean"!=typeof i&&(i="none"!==a(e,"display")),this._isActive=i,e.style.left="0",e.style.top="0",e.style[n]=It(0,0),this._animate=new p(e),this._animateChild=new p(this._child),this._visibility=new zt(this),this._layout=new Ot(this),this._migrate=new Nt(this),this._release=new Ft(this),this._dragPlaceholder=new Gt(this),this._drag=s.dragEnabled?new Xt(this):null,this._refreshDimensions(),this._refreshSortData()}function Qt(){this._slots=[],this._slotSizes=[],this._freeSlots=[],this._newSlots=[],this._rectItem={},this._rectStore=[],this._rectId=0,this._layout={slots:null,setWidth:!1,setHeight:!1,width:!1,height:!1},this._sortRectsLeftTop=this._sortRectsLeftTop.bind(this),this._sortRectsTopLeft=this._sortRectsTopLeft.bind(this)}Kt.prototype.getGrid=function(){return t[this._gridId]},Kt.prototype.getElement=function(){return this._element},Kt.prototype.getWidth=function(){return this._width},Kt.prototype.getHeight=function(){return this._height},Kt.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Kt.prototype.getPosition=function(){return{left:this._left,top:this._top}},Kt.prototype.isActive=function(){return this._isActive},Kt.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Kt.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Kt.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Kt.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Kt.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Kt.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Kt.prototype.isDestroyed=function(){return this._isDestroyed},Kt.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var t=this._element,e=this._dragPlaceholder,i=t.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,ht(t,"margin-left")),this._marginRight=Math.max(0,ht(t,"margin-right")),this._marginTop=Math.max(0,ht(t,"margin-top")),this._marginBottom=Math.max(0,ht(t,"margin-bottom")),e&&e.updateDimensions(this._width,this._height)}},Kt.prototype._refreshSortData=function(){if(!this._isDestroyed){var t,e=this._sortData={},i=this.getGrid()._settings.sortData;for(t in i)e[t]=i[t](this,this._element)}},Kt.prototype._destroy=function(t){if(!this._isDestroyed){var e=this._element,i=this.getGrid(),s=i._settings,n=i._items.indexOf(this);this._release.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._animate.destroy(),this._animateChild.destroy(),this._dragPlaceholder.destroy(),this._drag&&this._drag.destroy(),e.removeAttribute("style"),this._child.removeAttribute("style"),Rt(e,s.itemClass),n>-1&&i._items.splice(n,1),t&&e.parentNode.removeChild(e),this._isActive=!1,this._isDestroyed=!0}},Qt.prototype.getLayout=function(t,e,i,s,n){var r,o=this._layout,h=!(!n||!n.fillGaps),a=!(!n||!n.horizontal),_=!(!n||!n.alignRight),l=!(!n||!n.alignBottom),d=!(!n||!n.rounding),c=this._slotSizes;if(o.slots=s||this._slots,o.width=a?0:d?Math.round(e):e,o.height=a?d?Math.round(i):i:0,o.setWidth=a,o.setHeight=!a,o.slots.length=0,c.length=0,!t.length)return o;for(r=0;rd.height&&(Wt.left>0&&u.push(this._addRect(0,d.height,Wt.left,1/0)),Wt.left+Wt.widthd.width&&(Wt.top>0&&u.push(this._addRect(d.width,0,1/0,Wt.top)),Wt.top+Wt.height.49&&r.height>.49&&(!e&&r.tope.left+e.width&&jt.push(this._addRect(e.left+e.width,t.top,t.left+t.width-(e.left+e.width),t.height)),t.tope.top+e.height&&jt.push(this._addRect(t.left,e.top+e.height,t.width,t.top+t.height-(e.top+e.height))),jt):(jt.push(this._addRect(t.left,t.top,t.width,t.height)),jt)}),Qt.prototype._doRectsOverlap=function(t,e){return!(t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top)},Qt.prototype._isRectWithinRect=function(t,e){return t.left>=e.left&&t.top>=e.top&&t.left+t.width<=e.left+e.width&&t.top+t.height<=e.top+e.height},Qt.prototype._purgeRects=(Ut={},Zt={},function(t){for(var e,i=t.length;i--;)if(e=t.length,t[i])for(this._getRect(t[i],Ut);e--;)if(t[e]&&i!==e&&this._isRectWithinRect(Ut,this._getRect(t[e],Zt))){t[i]=0;break}return t}),Qt.prototype._sortRectsTopLeft=function(){var t={},e={};return function(i,s){return this._getRect(i,t),this._getRect(s,e),t.tope.top?1:t.lefte.left?1:0}}(),Qt.prototype._sortRectsLeftTop=function(){var t={},e={};return function(i,s){return this._getRect(i,t),this._getRect(s,e),t.lefte.left?1:t.tope.top?1:0}}();var te="[object HTMLCollection]",ee="[object NodeList]";function ie(t){var e=Object.prototype.toString.call(t);return e===te||e===ee}var se="object",ne="[object Object]",re=Object.prototype.toString;function oe(t){return typeof t===se&&re.call(t)===ne}function he(t){return ie(t)?Array.prototype.slice.call(t):Array.prototype.concat(t)}var ae=new Qt,_e=function(){},le="number",de="string";function ce(e,s){var n,r,o,h=this;if(!((e=this._element=typeof e===de?window.document.querySelector(e):e).getRootNode?e.getRootNode({composed:!0})===document:window.document.body.contains(e))||e===window.document.documentElement)throw new Error("Container element must be an existing DOM element");c((n=this._settings=function(t,e){var i=ue({},t);e&&(i=ue(i,e));return i.visibleStyles=(e||0).visibleStyles||(t||0).visibleStyles,i.hiddenStyles=(e||0).hiddenStyles||(t||0).hiddenStyles,i}(ce.defaultOptions,s)).dragSort)||(n.dragSort=!!n.dragSort),this._id=Jt(),t[this._id]=h,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new i,j(e,n.containerClass),this._items=[],typeof(r=n.items)===de?he(e.children).forEach(function(t){("*"===r||W(t,r))&&h._items.push(new Kt(h,t))}):(Array.isArray(r)||ie(r))&&(this._items=he(r).map(function(t){return new Kt(h,t)})),typeof(o=n.layoutOnResize)!==le&&(o=!0===o?0:-1),o>=0&&window.addEventListener("resize",h._resizeHandler=nt(function(){h.refreshItems().layout()},o)),n.layoutOnInit&&this.layout(!0)}function ue(t,e){var i,s,n,r=Object.keys(e),o=r.length;for(n=0;n0)){var s=o._layout.id!==l,n=c(t)?t:i;c(n)&&n(s,_.items.slice(0)),!s&&o._hasListeners(e)&&o._emit(e,_.items.slice(0))}}if((_.setHeight&&typeof _.height===le||_.setWidth&&typeof _.width===le)&&(s="border-box"===a(h,"box-sizing")),_.setHeight&&(typeof _.height===le?h.style.height=(s?_.height+this._borderTop+this._borderBottom:_.height)+"px":h.style.height=_.height),_.setWidth&&(typeof _.width===le?h.style.width=(s?_.width+this._borderLeft+this._borderRight:_.width)+"px":h.style.width=_.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",_.items.slice(0)),!d)return f(),this;for(r=0;rl?1:0:ld?1:0)return c;return c||(s||(s=n(i)),c=r(o,h)),c}function h(o,h){var a=t(o,h);return e&&a&&(a=-a),a||(s||(s=n(i)),r(o,h))}return function(n,r){if(this._isDestroyed||this._items.length<2)return this;var a,_=this._items,l=r||0,d=l.layout?l.layout:void 0===l.layout;if(t=n,e=!!l.descending,i=_.slice(0),s=null,c(t))_.sort(h);else if(typeof t===de)t=n.trim().split(" ").map(function(t){return t.split(":")}),_.sort(o);else{if(!Array.isArray(t))return this;if(t.length!==_.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(a=0;a<_.length;a++){if(t.indexOf(_[a])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");_[a]=t[a]}e&&_.reverse()}return this._hasListeners("sort")&&this._emit("sort",_.slice(0),i),d&&this.layout("instant"===d,c(d)?d:void 0),this}}(),ce.prototype.move=function(t,e,i){if(this._isDestroyed||this._items.length<2)return this;var s,n,r=this._items,o=i||0,h=o.layout?o.layout:void 0===o.layout,a="swap"===o.action,_=a?"swap":"move",l=this._getItem(t),d=this._getItem(e);return l&&d&&l!==d&&(s=r.indexOf(l),n=r.indexOf(d),a?Q(r,s,n):K(r,s,n),this._hasListeners("move")&&this._emit("move",{item:l,fromIndex:s,toIndex:n,action:_}),h&&this.layout("instant"===h,c(h)?h:void 0)),this},ce.prototype.send=function(t,e,i,s){if(this._isDestroyed||e._isDestroyed||this===e)return this;if(!(t=this._getItem(t)))return this;var n=s||0,r=n.appendTo||window.document.body,o=n.layoutSender?n.layoutSender:void 0===n.layoutSender,h=n.layoutReceiver?n.layoutReceiver:void 0===n.layoutReceiver;return t._migrate.start(e,i,r),t._migrate._isActive&&t._isActive&&(o&&this.layout("instant"===o,c(o)?o:void 0),h&&e.layout("instant"===h,c(h)?h:void 0)),this},ce.prototype.destroy=function(e){if(this._isDestroyed)return this;var i,s=this._element,n=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i-1?t:this._items.length+t]||null;if(t instanceof Kt)return t._gridId===this._id?t:null;for(var e=0;ev&&a){var b=a.style;a=(a=a.currentStyle)&&a.filter||b.filter||"";/alpha/.test(a)&&(b.filter=a.replace(/alpha\([^)]*\)/i,""))}},forceStyles:function(a,b){a=e(a);a.attr("style")&&a.data("styles",a.attr("style")).removeAttr("style");a.css(b)},revertStyles:function(){e.each(h.array(arguments),function(a,b){b=e(b);b.removeAttr("style");b.attr("style","");b.data("styles")&&b.attr("style",b.data("styles")).data("styles",null)})},moveOut:function(a){h.forceStyles(a,{position:"absolute",left:-1E4})},moveIn:function(){h.revertStyles.apply(h,h.array(arguments))},hide:function(a,b,d){d=d||z;var c=e(a);a=c[0];c.data("opacity")||c.data("opacity",c.css("opacity"));var g={opacity:0};b?h.animate(a,g,{duration:b,complete:9>v&&a?function(){h.removeAlpha(a);a.style.visibility="hidden";d.call(a)}:d,stop:!0}):9>v&&a?(h.removeAlpha(a),a.style.visibility="hidden"):c.css(g)},show:function(a,b,d){d=d||z;var c=e(a);a=c[0];var g={opacity:parseFloat(c.data("opacity"))||1};b?(9>v&&(c.css("opacity",0),a.style.visibility="visible"),h.animate(a,g,{duration:b,complete:9>v&&a?function(){1==g.opacity&&h.removeAlpha(a);d.call(a)}:d,stop:!0})):9>v&&1==g.opacity&&a?(h.removeAlpha(a),a.style.visibility="visible"):c.css(g)},wait:function(a){f._waiters=f._waiters||[];a=e.extend({until:ea,success:z,error:function(){f.raise("Could not complete wait function.")},timeout:3E3},a);var b=h.timestamp(),d,c,g,k=function(){c=h.timestamp();d=c-b;h.removeFromArray(f._waiters,g);if(a.until(d))return a.success(),!1;if("number"==typeof a.timeout&&c>=b+a.timeout)return a.error(),!1;f._waiters.push(g=m.setTimeout(k,10))};f._waiters.push(g=m.setTimeout(k,10))},toggleQuality:function(a,b){7!==v&&8!==v||!a||"IMG"!=a.nodeName.toUpperCase()||("undefined"===typeof b&&(b="nearest-neighbor"===a.style.msInterpolationMode),a.style.msInterpolationMode=b?"bicubic":"nearest-neighbor")},insertStyleTag:function(a,b){if(!b||!e("#"+b).length){var d=n.createElement("style");b&&(d.id=b);w().head.appendChild(d);if(d.styleSheet)d.styleSheet.cssText=a;else{var c=n.createTextNode(a);d.appendChild(c)}}},loadScript:function(a,b){var d=!1,c=e("