Version Description
- Added: KML URL is now output when there is an error loading the KML file
- Fixed: geocoder not recognizing some locations, including "lat,lng" entries
Download this release
Release Info
Developer | chrisvrichardson |
Plugin | MapPress Easy Google Maps |
Version | 2.73.17 |
Comparing to | |
See all releases |
Code changes from version 2.73.14 to 2.73.17
- build/index_mappress.js +1 -1
- build/index_mappress_admin.js +1 -1
- css/mappress.css +42 -56
- languages/mappress-google-maps-for-wordpress.pot +15 -32
- languages/texts.php +1 -5
- mappress.php +3 -3
- readme.txt +11 -1
- templates/map-directions.php +0 -18
- templates/map.php +1 -10
build/index_mappress.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{var t={273:(t,e,i)=>{"use strict";i.r(e);const o=wp.element.createElement,{Fragment:n,useEffect:s,useLayoutEffect:a,useRef:l,useState:p}=wp.element,__=t=>wp.i18n.__(t,"mappress-google-maps-for-wordpress");function r(t){const[e,i]=p({saddr:t.saddr?t.saddr:"",daddr:t.daddr?t.daddr:""});function n(t){i((e=>({...e,...t})))}function s(i,o){switch(i){case"close":t.onClose&&t.onClose();break;case"get-directions":a();break;case"keydown":13==o?s("get-directions"):27==o&&s("close");break;case"swap":n({saddr:e.daddr,daddr:e.saddr})}}function a(){let t=mappl10n.options.directionsServer;const i=e.saddr.trim(),o=e.daddr.trim();t="https://maps.google.com"==t?"https://www.google.com":t,-1==t.toLowerCase().indexOf("http")&&(t="https://"+t),t+="/maps/dir/?api=1&origin="+encodeURIComponent(i)+"&destination="+encodeURIComponent(o),window.open(t),s("close")}return"google"==mappl10n.options.directions?(a(),null):o("div",{className:"mapp-directions-component"},o("div",{className:"mapp-close",onClick:()=>s("close")}),o("div",null,o("input",{className:"mapp-dir-saddr",onChange:t=>n({saddr:t.target.value}),onKeyPress:t=>s("keydown",t.which),tabIndex:"1",placeholder:__("My location"),value:e.saddr}),o("div",{className:"mapp-dir-arrows",onClick:()=>s("swap")})),o("div",null,o("input",{className:"mapp-dir-daddr",onChange:t=>n({daddr:t.target.value}),onKeyPress:t=>s("keydown",t.which),tabIndex:"2",value:e.daddr})),o("div",{className:"mapp-dir-toolbar"},o("div",{className:"mapp-submit-button",onClick:()=>s("get-directions")},__("Get Directions"))))}window.mapp=window.mapp||{};const h=wp.element.createElement,d=t=>wp.i18n.__(t,"mappress-google-maps-for-wordpress"),_n=wp.i18n._n;var c;c=jQuery,mapp.Map=function(t,e){this.defaults={alignment:null,center:null,classname:null,editable:null,embed:null,height:null,initialOpenInfo:null,layers:null,layout:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,postid:null,query:null,search:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.hovered=null,this.isFullscreen=!1,this.iw=null,this.mapdata=t,this.opened=null,this.pagination={count:0,page:1},this.places=null,this.selected=null,this.settings=e||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.modal_=null,this.pois_=[],this.user_=null,this.xhr_,_.extend(this,this.defaults,this.mapdata,this.settings),this.poiList=void 0!==this.poiList&&null!=this.poiList?this.poiList:mappl10n.options.poiList,this.layout=this.layout?this.layout:mappl10n.options.layout,this.postid=this.postid?this.postid:mappl10n.options.postid},mapp.Map.prototype={display:function(){this.render(),this.div&&this.div.layout&&(this.sanity(),this.editable?this.templates={loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?this.templates={loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:this.templates={loop:"map-loop",item:"map-item",popup:"map-popup"},"leaflet"==mappl10n.options.engine?this.mapOpts=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null},this.mapOpts):this.mapOpts=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!this.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM}},this.mapOpts),this.mapOpts.minZoom=isNaN(parseInt(this.mapOpts.minZoom))?0:parseInt(this.mapOpts.minZoom),this.div&&this.div.canvas&&("leaflet"==mappl10n.options.engine?(this.map_=new L.Map(this.div.canvas.get(0),this.mapOpts),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_)):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),this.map_.setOptions(this.mapOpts),this.addLayers()),this.addGeolocateControl(),this.addMenu(),this.addPopup(),this.isFilterable()&&this.addFilters(),this.setMapTypeId(this.mapTypeId),this.clustering(),"postmodal"==mappl10n.options.mashupClick&&(this.modal_=new mapp.lib.Modal),this.places=new mapp.Places(c(".mapp-places",this.div.search),{map:this}),this.addUserLocation(),this.editable&&this.places.sel.focus(),c(this.places).on("search.mapp",((t,e)=>{this.onSearch(e)})),this.addEvents("click dragstart zoom_changed zoomstart",(t=>{"leaflet"==mappl10n.options.engine&&"click"==t.type&&t.originalEvent&&!t.originalEvent.target.matches(".mapp-canvas")||this.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(t=>{if(this.div.list&&this.div.list.length&&c.contains(this.div.list.get(0),t.target))return;const e=c(t.currentTarget),i=e.attr("data-mapp-action"),o=e.attr("data-mapp-"+i);t.preventDefault(),this.onAction(i,o,e)})),this.div.list.on("click","[data-mapp-action]",(t=>{const e=c(t.currentTarget),i=e.attr("data-mapp-action"),o=e.attr("data-mapp-"+i);this.onAction(i,o,e)})),new ResizeObserver(((t,e)=>{document.fullscreenElement?this.isFullscreen=!0:(this.isFullscreen?this.isFullscreen=!1:this.poiClose(),this.toggleView("mini"),this.resize())})).observe(this.div.layout.get(0)),mapp.event.addListener(this.map_,"maptypeid_changed baselayerchange",(()=>{this.set({dirty:!0})})),this.places.parse(this.center,(t=>{this.center=t&&t.geometry&&t.geometry.location?{lat:t.geometry.location.lat,lng:t.geometry.location.lng}:null,this.setPois(this.pois),this.initCenter()})),this.div.list.on("mouseenter","[data-mapp-poi]",(t=>{var e=c(t.currentTarget).attr("data-mapp-poi");this.poiHover(this.pois_[e])})),this.div.list.on("mouseleave","[data-mapp-poi]",(t=>{this.poiHover(null)}))))},initCenter:function(){setTimeout((()=>{this.recenter(),this.renderList(),this.isSearchable&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():mapp.event.addListenerOnce(this.map_,"idle",(()=>this.initOpen()))}),100)},initOpen:function(){const t=this.pois_.length?this.pois_[0]:null,e=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;t&&e&&!this.editable&&t.open()},addEvents:function(t,e){t=t.split(" ");for(var i=0;i<t.length;i++)mapp.event.addListener(this.map_,t[i],e)},addFilters:function(){c("body").on("click",(t=>{var e=c(t.target);e.hasClass("mapp-filters-toggle")||0!=e.closest(".mapp-filters-wrapper").length||this.div.layout.removeClass("mapp-view-filters")})),this.div.filters.on("change",(()=>{this.fetchPois()})),"top"==mappl10n.options.filtersPos&&new ResizeObserver(((t,e)=>{t.forEach((t=>{const e=this.div.canvas.get(0).clientHeight;c(".mapp-filters-body",this.div.layout).css({"max-height":e})}))})).observe(this.div.layout.get(0))},addGeolocateControl:function(){if(!mappl10n.options.ssl)return;const t=c(".mapp-geolocate-control-wrapper",this.div.layout).get(0);"google"==mappl10n.options.engine?this.map_.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(t):(L.Control.Geolocate=L.Control.extend({onAdd:e=>t,onRemove:()=>{}}),new L.Control.Geolocate({position:"bottomright"}).addTo(this.map_))},addLayers:function(){this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer};for(var t=c.makeArray(this.layers),e=0;e<t.length;e++){var i=t[e].trim(),o=i.split(".").pop();this.layers_[i]?this.toggleLayer(i):"kml"==o||"kmz"==o?this.layers_[i]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:i}):"json"==o&&(this.layers_[i]=new google.maps.Data({map:this.map_}).loadGeoJson(i))}},addMenu:function(){c("body").on("click",(t=>{var e=c(t.target),i=e.attr("data-mapp-action");e==this.div.menu||"menu-toggle"==i||e.closest(this.div.menu).length||this.toggleView("menu",!1)}))},addPopup:function(){var t=this.editable?"mapp-iw-edit":"mapp-iw";this.editable||(t+=" mapp-"+this.templates.popup),this.div.iw=c('<div class="'+t+'">').appendTo(this.div.canvas),this.iw=new mapp.Infobox(this.map_,{className:this.editable?"mapp-ib-edit":""}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(()=>{this.poiClose()}))},addSearchMove:function(){},addUserLocation:function(){mappl10n.options.userLocation&&mappl10n.options.ssl&&this.places.geolocate((t=>{if(t&&t.geometry&&t.geometry.location){const e=t.geometry.location,i=mapp.Icons.get("geolocation");"leaflet"==mappl10n.options.engine?this.user_=L.marker([e.lat,e.lng],{icon:i}).addTo(this.map_):(this.user_=new mapp.Marker({icon:i,position:new google.maps.LatLng(e.lat,e.lng)}),this.user_.setMap(this.map_))}}),!0)},clusterGetLatLng:function(t){if(this.clusterer){if("leaflet"==mappl10n.options.engine){var e=this.clusterer.getVisibleParent(t.overlay);return e?e.getLatLng():null}for(var i=this.clusterer.getClusters(),o=0;o<i.length;o++){var n=i[o].markers_;if(n.length>1)for(var s=0;s<n.length;s++)if(n[s]==t.overlay)return i[o].center_}}},clustering:function(){if(mappl10n.options.clustering&&!this.editable){let t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup(t):(t=_.extend(t,{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"}),this.clusterer=new MarkerClusterer(this.map_,[],t))}},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){var t=[];for(let e=0;e<this.pois_.length;e++)this.pois_[e].type||t.push(this.pois_[e].overlay);"leaflet"==mappl10n.options.engine?(this.clusterer.addLayers(t),this.map_.addLayer(this.clusterer)):this.clusterer.addMarkers(t)}},fetchPois:function(t){var e=new Date;this.poiClose();var i={action:"mapp_query",filters:c(":input",this.div.filters).serialize(),list:!!this.div.list.length,query:this.query,url:{href:window.location.href,search:window.location.search},debug:mappl10n.options.debug};this.xhr_&&this.xhr_.abort("cancel"),this.spinner(!0),this.xhr_=mapp.lib.ajax({data:i,callback:(i,o)=>{this.spinner(!1),i&&"OK"==i.status&&(this.setPois(i.data.pois),this.renderList(),mappl10n.options.debug&&mapp.lib.log("Results: "+i.data.pois.length+" ("+o.responseText.length/1e3+"K) AJAX: "+(new Date-e)+(i.data.timing?i.data.timing:"")),t&&t())}})},fitBounds:function(t){return this.map_.fitBounds(t)},getBounds:function(){try{return this.map_.getBounds()}catch(t){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(t){return null}},getMap:function(){return this.map_},getPois:function(){return this.pois_},getZoom:function(){try{return this.map_.getZoom()}catch(t){return null}},isFilterable:function(){return mappl10n.options.pro&&mappl10n.options.filters&&mappl10n.options.filters.length>0&&!this.editable&&this.query},isSearchable:function(){return!!this.editable},onAction:function(t,e,i){switch(t){case"center":this.toggleView("menu",!1),this.poiClose(),this.recenter();break;case"dir":this.renderDirections({isOpen:!0,from:null,to:this.opened});break;case"dir-from":this.renderDirections({isOpen:!0,from:this.opened,to:null});break;case"filters-reset":this.div.filters.find(":input").each(((t,e)=>{"hidden"!=e.type&&("checkbox"==e.type||"radio"==e.type?c(e).prop("checked",!1):c(e).val(""))})),this.fetchPois();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate((t=>{t&&t.geometry&&t.geometry.location&&this.setView(t.geometry.location,parseInt(mappl10n.options.poiZoom))}));break;case"layer":this.toggleLayer(e),this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":var o=i.attr("data-mapp-poi");this.poiOpen(this.pois_[o]);break;case"page":var n=parseInt(i.attr("data-mapp-page"));this.pagination.page=n,this.renderList();break;case"sidebar-toggle":this.toggleSidebar();break;case"view-map":this.toggleSidebar(!1);break;case"view-list":this.toggleSidebar(!0);break;default:return!0}},onSearch:function(t){if(t&&t.geometry){var e=t.geometry.location?t.geometry.location:null,i=t.geometry.viewport?t.geometry.viewport:null;if("leaflet"==mappl10n.options.engine)var o=new L.LatLng(e.lat,e.lng),n=i?new L.LatLngBounds(new L.LatLng(i.sw.lat,i.sw.lng),new L.LatLng(i.ne.lat,i.ne.lng)):o.toBounds(1e3*mappl10n.options.radius);else{var s=new google.maps.Circle({center:e,radius:1e3*mappl10n.options.radius});n=i?new google.maps.LatLngBounds(new google.maps.LatLng(i.sw.lat,i.sw.lng),new google.maps.LatLng(i.ne.lat,i.ne.lng)).union(s.getBounds()):s.getBounds()}n&&this.fitBounds(n),this.setView(e)}},poiClose:function(){this.poiHighlight(null),this.selected=null,this.opened=null,this.hovered=null,this.iw.close(),this.renderDirections({isOpen:!1}),c(this).triggerHandler("mapp.close")},poiHighlight:function(t){if("icon"!=mappl10n.options.highlight||"leaflet"!=mappl10n.options.engine||!this.editable){if(c("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),this.hovered&&this.hovered.highlight(!1),t){var e=c.inArray(t,this.pois_);c('[data-mapp-poi="'+e+'"]',this.div.list).addClass("mapp-selected"),t.highlight(!0)}this.selected&&(e=c.inArray(this.selected,this.pois_),c('[data-mapp-poi="'+e+'"]',this.div.list).addClass("mapp-selected"))}},poiHover:function(t){t&&this.opened==t||(mappl10n.options.tooltips||(this.poiHighlight(null),this.hovered=null),t&&(this.poiHighlight(t),this.hovered=t,mappl10n.options.tooltips&&!this.editable&&this.popupOpen(t,null,"popup")))},poiInsert:function(t){this.pois_.unshift(t),t.setMap(this),this.renderList(),this.set({dirty:!0})},poiOpen:function(t,e){if(this.poiClose(),this.selected=t,this.poiHighlight(t),this.query&&t.postid&&t.url&&!this.editable)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(t.url);case"postnew":return void window.open(t.url);case"postmodal":return this.modal_.open(),this.modal_.setContent('<div class="mapp-modal-spinner">'),void t.fetchPost((()=>this.modal_.setContent(t.html)))}this.div.layout.hasClass("mapp-view-mini")&&this.toggleSidebar(!1),this.popupOpen(t,e,"popup"),c(this).triggerHandler("mapp.open",t)},poiRemove:function(t){var e=c.inArray(t,this.pois_);-1!=e&&(this.pois_[e].setMap(null),this.pois_.splice(e,1),this.renderList()),this.set({dirty:!0})},popupClose:function(){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.editable||(this.iw.close(),this.renderDirections({isOpen:!1}),this.opened=null,c(this).triggerHandler("mapp.close"))},popupOpen:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"popup",o=null;this.popupClose(),e&&e.featureData?o=e.featureData:e&&e.propagatedFrom&&e.propagatedFrom.feature&&e.propagatedFrom.feature.properties&&(o=e.propagatedFrom.feature.properties),this.div.iw.html(t.render(i,o)),this.div.iw.toggleClass(" mapp-thumb-"+mappl10n.options.thumbsPopup,!!t.thumbnail);var n=this.clusterGetLatLng(t),s=n||t.getPosition(e);this.iw.open({position:s,anchorPoint:t.getAnchorPoint(e)}),this.opened=t},recenter:function(){var t=this.center&&this.center.hasOwnProperty("lat")&&this.center.hasOwnProperty("lng")?this.center:null,e=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null;if(t&&!e&&this.query)return void this.onSearch({geometry:{location:{lat:t.lat,lng:t.lng}}});if(t)return void this.setView(t,e||1);if(0==this.pois_.length)return void this.setView({lat:0,lng:0},e||1);if(1==this.pois_.length)return void this.pois_[0].center(e);let i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var o=0;o<this.pois_.length;o++){var n=this.pois_[o].getBounds(),s=this.pois_[o].getPosition();i=n?"leaflet"==mappl10n.options.engine?i.extend(n):i.union(n):i.extend(s)}e?this.setView(i.getCenter().toJSON(),e):this.fitBounds(i)},render:function(){let t=this.name?this.name+"-layout":"",e="mapp-layout",i=this.layout&&window.parent==window?this.layout:"left";if(e+="left"==i?" mapp-list-left":" mapp-inline",e+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",e+=this.classname?" "+this.classname:"",!document.body.classList.contains("block-editor-page")){let t=this.alignment?this.alignment:mappl10n.options.alignment;if(t){let i=" align"+t+" mapp-align-"+t;window.parent==window?e+=i:c(window.frameElement).parent().parent().addClass(i)}}var o=mapp.lib.template("map",{map:this,layout:i});if(this.sel){if(this.div.layout=c(this.sel),this.div.layout.html(o),this.div.layout.addClass(e),this.div.layout.attr("id",t),!this.div.layout.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name)}else{let i=c('<div id="'+t+'" class="'+e+'">');i.html(o);let n=c("#"+this.name+"-layout");if(!n.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);n.replaceWith(i),this.div.layout=i}c.each(["canvas","content","controls","directions","filters","header","list","menu","search","sidebar","wrapper"],((t,e)=>{this.div[e]=c(".mapp-"+e,this.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderDirections:function(t){let{isOpen:e,from:i,to:o}=t;if(e){const t=o?o.getAddress():"",e=i?i.getAddress():"";this.toggleView("directions",!0),wp.element.render(h(r,{saddr:e,daddr:t,onClose:()=>{wp.element.unmountComponentAtNode(this.div.directions.get(0)),this.toggleView("directions",!1)}}),this.div.directions.get(0))}else this.div.directions.legnth&&wp.element.unmountComponentAtNode(this.div.directions.get(0)),this.toggleView("directions",!1)},renderList:function(){var t=this.getBounds(),e=0;if(this.editable)return void this.div.layout.trigger("mapp.render");if(!this.poiList)return;let i=parseInt(mappl10n.options.poiListPageSize);i=isNaN(i)?20:i;const o=i*(this.pagination.page-1),n=o+i;if(!this.editable)for(var s=0;s<this.pois_.length;s++){let i=this.pois_[s];i.visible=!1,this.isSearchable()?t&&t.contains(i.getPosition())&&(i.visible=!0,e++):(i.visible=!0,e++),i.visible=e>=o&&e<=n&&i.visible}this.pagination.count=e,this.pagination.countString=sprintf(_n(d("%d Result"),d("%d Results"),this.pagination.count),this.pagination.count),this.div.list.html(mapp.lib.template(this.templates.loop,{map:this,pois:this.pois_,pageSize:i,pagination:this.pagination})),c(".mapp-filters-count",this.filters).html(this.pagination.countString),mappl10n.options.thumbsList&&this.div.list.addClass(" mapp-thumb-"+mappl10n.options.thumbsList)},renderMenu:function(){for(var t in this.layers_)c('[data-mapp-layer="'+t+'"]',this.div.layout).toggleClass("mapp-active",null!=this.layers_[t].getMap())},resetPois:function(){for(var t=0;t<this.pois_.length;t++)this.pois_[t].setMap(null);this.pois_=[],this.clustersReset()},resize:function(){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){const t="<a href='"+mappl10n.options.adminurl+"/admin.php?page=mappress'>"+d("MapPress Settings")+"</a>",e=jQuery&&jQuery.ui?jQuery.ui.version:"0.0",i="<a href ='http://mappresspro.com/mappress-faq' target='_blank'>"+d("MapPress FAQ")+"</a>",o="<a href='http://mappresspro.com/chris-contact', target='_blank'>"+d("contact support")+"</a>",n="<br/>"+sprintf(d("Please see the %s for help, or %s and provide this error message."),i,o),s=sprintf("<div class='mapp-errors-toolbar'><div class='mapp-errors-apikey'>%s</a></div>",d("Get an API Key"));this.div.layout.on("click",".mapp-errors-apikey",(()=>{window.open("https://mappresspro.com/how-to-get-a-google-maps-api-key")}));let a=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:d("Leaflet library not loaded"),text:d("A theme or plugin is preventing the Leaflet library from loading.")+n},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:d("Google Maps API not loaded"),text:d("A theme or plugin is preventing Google Maps from loading.")+n},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:d("Google Maps API key required"),text:sprintf(d("Please enter a Google Maps API key in the %s, or switch to Leaflet maps."),t)+s},{condition:c('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1,title:d("Google Maps API loaded multiple times"),text:d("A theme or plugin has loaded Google Maps twice")+n},{condition:"undefined"==typeof _,title:d("Underscore library not loaded"),text:d("A theme or plugin is preventing the underscore.js library from loading.")+n},{condition:e<"1.12",title:sprintf(d("Obsolete jQuery version: %s, must be >= 1.12"),e),text:d("A theme or plugin is loading an obsolete version of jQuery.")+n}];if(_.map(a,(t=>{if(t.condition){mappl10n.options.admin&&this.sanityOutput({title:t.title,text:t.text?t.text:""});let e=jQuery("<span>"+t.text.replace("<br/>","\n")+"</span>").text();console.error(d("Map error")+": "+t.title+" - "+e)}})),"google"==mappl10n.options.engine){const t=console.error;console.error=e=>{(e.includes("Google Maps JavaScript API")||e.includes("You have exceeded your request quota")||e.includes("You have exceeded your daily quota"))&&mappl10n.options.admin&&(e=e.replace(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi,((t,e,i)=>{let o=i;return o.match("^https?://")||(o="http://"+o),e+'<a href="'+o+'" target="_blank">'+i+"</a>"})),this.sanityOutput({title:d("Google Maps Error"),text:e})),t(e)}}},sanityOutput(t){if(!c(".mapp-errors-overlay",this.div.content).length){let t="<div class='mapp-errors-overlay'></div><div class='mapp-errors'><div class='mapp-errors-header'>"+d("Oops! Something went wrong.")+"</div><div class='mapp-errors-list'></div></div>";this.div.content.prepend(t)}c(".mapp-errors-list",this.div.content).append("<div class='mapp-errors-title'>"+t.title+"</div><div class='mapp-errors-text'>"+t.text+"</div>")},set:function(t){for(let i in t){var e=t[i];switch(i){case"dirty":this.dirty=e;break;case"mapTypeId":this.mapTypeId=e,this.setMapTypeId(e);break;case"poiList":this.poiList=null==e?mappl10n.options.poiList:e,this.toggleSidebar(mappl10n.options.poiListOpen),this.toggleView("mini");break;case"search":this.search=e;break;case"style":this.setStyle(e);break;case"title":this.title=e;break;default:this[i]=e}}},setMapTypeId:function(t){const e=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),i=_.find(e,(e=>e.id==t));!mappl10n.options.style||"roadmap"!=t&&"streets"!=t&&i||(t=mappl10n.options.style);let o=_.find(e,(e=>e.id==t));o=o||e[0],this.setStyle(o)},setPois:function(t){if(this.resetPois(),t)for(var e=0;e<t.length;e++){var i=new mapp.Poi(t[e]);this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this)}this.clustersSet()},setSize:function(t){var e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];let i={},o={};if(t&&t.hasOwnProperty("width")&&(i={width:t.width?t.width:e.width}),t&&t.hasOwnProperty("height")){let i=t.height?t.height:e.height;o="string"==typeof i&&i.includes("%")?{"padding-bottom":i,height:"auto"}:{"padding-bottom":0,height:i}}window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?(c(window.frameElement).parent().parent().css(i),c(window.frameElement).parent().css(o)):this.embed?(i={height:"100%"},o={"padding-bottom":0,height:"100%"}):(this.div.layout.css(i),this.div.wrapper.css(o)),this.resize()},setStyle:function(t){if("leaflet"==mappl10n.options.engine){let e={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">© Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">© OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[t.provider],i=c.extend({},e,t);L.tileLayer(e.url,i).addTo(this.map_)}else if(this.map_.setMapTypeId("standard"==t.type?t.id:"roadmap"),t.json){let e=null;try{e=JSON.parse(t.json)}catch(t){mapp.lib.log("Invalid JSON in map style")}this.map_.setOptions({styles:e||null})}else this.map_.setOptions({styles:null})},setView:function(t,e,i){"leaflet"==mappl10n.options.engine?(null==e&&(e=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(t,e,i)):(t=t&&!t.toJSON?{lat:parseFloat(t.lat),lng:parseFloat(t.lng)}:t,e=e?parseInt(e):null,t&&this.map_.setCenter(t),e&&this.map_.setZoom(e))},spinner:function(t){this.div.layout.toggleClass("mapp-busy",t)},toggleLayer:function(t,e){e=void 0!==e?e:null==this.layers_[t].getMap(),c.each(["traffic","bicycling","transit"],((t,e)=>{this.layers_[e].setMap(null)})),e&&this.layers_[t].setMap(this.map_)},toggleSidebar:function(t){this.div.layout.toggleClass("mapp-sidebar-open",t),this.isSidebarOpen=t,setTimeout((()=>this.resize()),100)},togglePois:function(t){t=!!t;for(var e=0;e<this.pois_.length;e++)this.pois_[e].setVisible(t)},toggleView:function(t,e){if("mini"==t){let t=this.div.layout.hasClass("mapp-view-mini"),e=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",e),void(e!=t&&this.toggleSidebar(!e))}e=void 0===e?!this.div.layout.hasClass("mapp-view-"+t):e,this.div.layout.toggleClass("mapp-view-"+t,e),"list"==t&&e&&this.renderList(),"menu"==t&&e&&this.renderMenu(),"directions"==t&&this.resize()},toJSON:function(){this.pois=[];for(var t=0;t<this.pois_.length;t++)this.pois.push(this.pois_[t].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,postid:this.postid,search:this.search,title:this.title,width:this.width,zoom:this.zoom}}}},397:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Directions=function(e,i){this.sel=t(e),this.map=i;var o=this;this.sel.on("keydown",(function(t){13==t.which?(o.getDirections(),t.preventDefault()):27==t.which&&o.close()})),this.sel.on("click","[data-mapp-action]",(function(e){var i=t(this).attr("data-mapp-action"),n=t(".mapp-dir-daddr",o.sel).val(),s=t(".mapp-dir-saddr",o.sel).val();switch(e.preventDefault(),i){case"dir-cancel":o.close();break;case"dir-get":o.getDirections();break;case"dir-swap":t(".mapp-dir-saddr",o.sel).val(n),t(".mapp-dir-daddr",o.sel).val(s)}})),this.open=function(e,i){"google"!=mappl10n.options.directions?(this.map.toggleView("directions",!0),t(".mapp-dir-saddr",this.sel).val(e),t(".mapp-dir-daddr",this.sel).val(i)):this.openGoogle(e,i)},this.close=function(){this.map.toggleView("directions",!1)},this.getDirections=function(){var e=t(".mapp-dir-saddr",this.sel).val().trim(),i=t(".mapp-dir-daddr",this.sel).val().trim();this.map.poiClose(),this.openGoogle(e,i)},this.openGoogle=function(t,e){var i=mappl10n.options.directionsServer;-1==(i="https://maps.google.com"==i?"https://www.google.com":i).toLowerCase().indexOf("http")&&(i="https://"+i),i+="/maps/dir/?api=1&origin="+encodeURIComponent(t)+"&destination="+encodeURIComponent(e),window.open(i)}}},442:(t,e,i)=>{"use strict";i.r(e);var o,n=i(991),s=i(574);window.mapp=window.mapp||{},mapp.geocoders={},o=jQuery,mapp.geocoders.algolia=function(t){this.map=t},mapp.geocoders.algolia.prototype={getDetails:function(t,e){e({formatted_address:t.value,name:t.name,geometry:{location:t.latlng}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(t,e){var i="https://places-dsn.algolia.net/1/places/query?query="+encodeURIComponent(t)+"&hitsPerPage=5";i=mappl10n.options.country?i+"&countries="+mappl10n.options.country.toLowerCase():i,i=mappl10n.options.language?i+"&language="+mappl10n.options.language.toLowerCase():i+"&language=en";var a=this.map.getMap().getCenter();a&&(i+="&aroundLatLng="+a.lat+","+a.lng),o.getJSON(i,(function(i){if(i&&i.hits&&i.hits.length>0){var o=i.hits.map((function(e,o){return(0,n.Z)({formatInputValue:s.Z,hit:e,hitIndex:o,query:t,rawAnswer:i})}));e(o)}else e(null)}))}},function(t){mapp.geocoders.google=function(e){this.map=e,this.token=null;var i=t('<div style="display:none">').appendTo("body");this.placesService=new google.maps.places.PlacesService(i.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,i.remove()},mapp.geocoders.google.prototype={getDetails:function(t,e){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var i={fields:["formatted_address","name","geometry"],placeId:t.place_id,sessionToken:this.token};this.placesService.getDetails(i,(function(t,i){if("OK"==i&&t&&t.geometry){if(t.geometry.location&&(t.geometry.location=t.geometry.location.toJSON()),t.geometry.viewport){var o=t.geometry.viewport.toJSON();t.geometry.viewport={sw:{lat:o.south,lng:o.west},ne:{lat:o.north,lng:o.east}}}e(t)}else e(null)}))},getFirstPrediction:function(e,i){this.getPredictions(e,(e=>{e&&t.isArray(e)?this.getDetails(e[0],(t=>i(t))):i(null)}))},getPredictions:function(t,e){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var i=this.map.getMap().getBounds();"leaflet"==mappl10n.options.engine&&(i=new google.maps.LatLngBounds(new google.maps.LatLng(i.getSouthWest().lat,i.getSouthWest().lng),new google.maps.LatLng(i.getNorthEast().lat,i.getNorthEast().lng)));var o={input:t,bounds:i=i||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:this.map.editable?null:["geocode"]};this.autocompleteService.getPlacePredictions(o,(function(t,i){"OK"==i&&t&&t.length?(t=(t=t.map((t=>(t.value=t.description,t)))).filter((t=>t.place_id)),e(t)):(i==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):i==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),e(null))}))}}}(jQuery),function(t){mapp.geocoders.mapbox=function(t){this.map=t},mapp.geocoders.mapbox.prototype={getDetails:function(t,e){let i=t.place_name,o=i.indexOf(","),n=i.indexOf(",",o+1);o>0&&(i=parseInt(i.substr(0,o))?i.substr(0,n).replace(",",""):i.substr(0,o));let s=t.bbox&&4==t.bbox.length?{sw:{lat:t.bbox[1],lng:t.bbox[0]},ne:{lat:t.bbox[3],lng:t.bbox[2]}}:null;e({formatted_address:t.place_name,name:i,geometry:{location:{lat:t.center[1],lng:t.center[0]},viewport:s}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(e,i){var o="https://api.mapbox.com/geocoding/v5/mapbox.places/"+e+".json?access_token="+mappl10n.options.mapbox;o=mappl10n.options.country?o+"&country="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&language="+mappl10n.options.language.toLowerCase():o;var n=this.map.getMap().getCenter();n&&(o+="&proximity="+n.lng+","+n.lat),mappl10n.options.searchBox&&(o+="&bbox="+mappl10n.options.searchBox),t.getJSON(o,(t=>{t&&t.features&&t.features.length>0?(t.features=t.features.map((t=>(t.value=t.label=t.place_name,t))),i(t.features)):i(null)}))}}}(jQuery),function(t){mapp.geocoders.nominatim=function(t){this.map=t},mapp.geocoders.nominatim.prototype={getDetails:function(t,e){let i=t.display_name,o=i.indexOf(","),n=i.indexOf(",",o+1);o>0&&(i=parseInt(i.substr(0,o))?i.substr(0,n).replace(",",""):i.substr(0,o));let s=t.boundingbox&&4==t.boundingbox.length?{sw:{lat:t.boundingbox[0],lng:t.boundingbox[2]},ne:{lat:t.boundingbox[1],lng:t.boundingbox[3]}}:null;e({formatted_address:t.display_name,name:i,geometry:{location:{lat:t.lat,lng:t.lon},viewport:s}})},getFirstPrediction(t,e){this.getPredictions(t,(t=>{t&&t.length?this.getDetails(t[0],(t=>e(t))):e(null)}))},getPredictions:function(e,i){var o="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(e);if(o=mappl10n.options.country?o+"&countrycodes="+mappl10n.options.country.toLowerCase():o,o=mappl10n.options.language?o+"&accept-language="+mappl10n.options.language.toLowerCase():o,mappl10n.options.searchBox)o+="&viewbox="+mappl10n.options.searchBox,o+="&bounded=1";else{var n=this.map.getMap().getBounds();if(n){let t=n.getSouthWest(),e=n.getNorthEast();o+="&viewbox="+t.lng+","+t.lat+","+e.lng+","+e.lat}}t.getJSON(o,(function(t){t&&t.length?(t=t.map((t=>(t.value=t.display_name,t))),i(t)):i(null)}))}}}(jQuery)},282:()=>{window.mapp=window.mapp||{},mapp.Icons={},mapp.Icons.get=function(t){var e=mapp.Icons.getUrl(t);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:e,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:e}},mapp.Icons.getUrl=function(t){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"}},689:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Infobox=function(e,i){this.map=e,this.anchorPoint=null,this.fudge=30,this.isOpen=!1,this.mapDiv="leaflet"==mappl10n.options.engine?e.getContainer():e.getDiv(),this.node=null,this.opts=_.extend({clip:!0,pan:!0},i),this.overlayView=null,this.position=null,this.size=null,this.wrapper=null,this.wrapper=t('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib-content"><div class="mapp-ib" tabindex="0"></div><div class="mapp-ib-tip"></div></div></div>'),this.wrapper.addClass(i.className),this.node=t(".mapp-ib-content",this.wrapper),"leaflet"==mappl10n.options.engine?mapp.event.addListener(this.map,"move",(t=>{this.isOpen&&this.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=()=>{this.isOpen&&this.draw()}),this.node.get(0).addEventListener("load",(()=>{"leaflet"==mappl10n.options.engine?this.open({position:this.position,anchorPoint:this.anchorPoint}):mapp.event.addListenerOnce(this.map,"panend",(t=>{this.open({position:this.position,anchorPoint:this.anchorPoint})}))}),{capture:!0});var o="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(o),"leaflet"==mappl10n.options.engine&&e.on("load",(()=>{L.DomEvent.disableClickPropagation(this.wrapper.get(0))}))},mapp.Infobox.prototype={close:function(){this.isOpen=!1,this.wrapper&&this.wrapper.removeClass("mapp-open")},draw:function(){if(document.fullscreenElement||this.map.isFullscreen)return;if(!this.position)return;let t,e,i;if(t=this.node.outerWidth(),e=this.node.outerHeight(),"leaflet"==mappl10n.options.engine)i=this.map.latLngToContainerPoint(this.position);else{const t=this.overlayView.getProjection();if(!t)return;i=t.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:i.x-t/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-i.y-this.anchorPoint.y})},getContent:function(){return t(".mapp-ib",this.node)},open:function(t){this.position=t.position,this.anchorPoint=t.anchorPoint?t.anchorPoint:{x:0,y:0},this.wrapper.addClass("mapp-open"),this.wrapper.css({left:0,bottom:0,width:"auto",height:"auto"}),this.wrapper.css({width:this.node.outerWidth(),height:this.node.outerHeight()}),this.draw(),this.pan(),this.isOpen=!0},pan:function(){const e=this.node.outerWidth(),i=this.node.outerHeight(),o=t(this.mapDiv).width(),n=t(this.mapDiv).height();if("leaflet"==mappl10n.options.engine)var s=this.map.latLngToContainerPoint(this.position);else{var a=this.overlayView.getProjection();s=a?a.fromLatLngToContainerPixel(this.position):null}if(!s)return;var l={x:s.x,y:s.y};s.x+e/2+this.anchorPoint.x>o-this.fudge?l.x=Math.max(o-e/2-this.anchorPoint.x-this.fudge,o/2-this.anchorPoint.x):s.x-e/2+this.anchorPoint.x<this.fudge&&(l.x=Math.min(e/2+this.anchorPoint.x+this.fudge,o/2-this.anchorPoint.x)),s.y+this.anchorPoint.y-i<this.fudge&&(l.y=i-this.anchorPoint.y+this.fudge),l.y>=n&&(l.y=n-this.fudge);const p={x:s.x-l.x,y:s.y-l.y};p.x<=-1||p.x>=1||p.y<=-1||p.y>=1?"leaflet"==mappl10n.options.engine?this.map.panBy([p.x,p.y]):(mapp.event.addListenerOnce(this.map,"idle",(t=>{mapp.event.trigger(this.map,"panend")})),this.map.panBy(p.x,p.y)):mapp.event.trigger(this.map,"panend")},setContent:function(e){t(".mapp-ib",this.node).empty().append(e)}}},628:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.lib={ajax:function(e){var i=this,o={callback:null,data:null,dataType:"json",silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(t,o,n){"json"==e.dataType&&e.url==mappl10n.options.ajaxurl&&"OK"!=t.status&&i.alert(t.status),"json"==e.dataType&&t.output?i.alert("AJAX Invalid Output\r\n"+t.output):e.callback&&e.callback(t,n)},error:function(t,o,n){"cancel"!=o&&(void 0!==n&&""!=n&&i.alert("AJAX ERROR\r\nTextStatus="+o+"\r\nError="+n+"\r\nResponseText="+t.responseText),e.callback&&e.callback(null))}};return e=t.extend(o,e),t.ajax(e)},alert:function(t){mappl10n.options.admin||mappl10n.options.debug?alert(t):window.console&&console.error(t)},jqVersionCheck:function(e){if(void 0===t||void 0===e)return!1;e=e.split("."),v=t.fn.jquery.split(".");for(var i=0;i<e.length;i++){var o=parseInt(e[i]),n=void 0!==v[i]?parseInt(v[i]):0;if(n!=o)return n>o}return!0},log:function(t){window.console&&console.error(t)},scrollTo:function(t,e,i){if(t&&e&&t.length&&e.length){var o=t.height(),n=e.outerHeight(!0),s=t.scrollTop(),a=s+e.position().top,l=a+n;a=a-o/2-n/2,i&&(a-=i.outerHeight(!0)),(a<s||l>s+o)&&t.scrollTop(a)}},template:function(e,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[e]){var o=mappl10n.options.templates?mappl10n.options.template[e]:t("#mapp-tmpl-"+e).html();if(!o)return"";mapp.lib.templates[e]=_.template(o,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return mapp.lib.templates[e](i)},uniqid:function(){return void 0===mapp.lib.uniqidCounter?mapp.lib.uniqidCounter=0:mapp.lib.uniqidCounter++,mapp.lib.uniqidCounter}},mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+t.fn.jquery),jQuery,"leaflet"==mappl10n.options.engine&&"undefined"!=typeof L&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6}),mapp.event={addListener:function(t,e,i){e=e.split(" ");for(var o=0;o<e.length;o++)"leaflet"==mappl10n.options.engine?t.on(e[o],i):google.maps.event.addListener(t,e[o],i)},addListenerOnce:function(t,e,i){e=e.split(" ");for(var o=0;o<e.length;o++)"leaflet"==mappl10n.options.engine?t.once(e[o],i):google.maps.event.addListenerOnce(t,e[o],i)},clearInstanceListeners:function(t){"leaflet"==mappl10n.options.engine?t.off():google.maps.event.clearInstanceListeners(t)},clearListeners:function(t,e){e=e.split(" ");for(var i=0;i<e.length;i++)"leaflet"==mappl10n.options.engine?t.off(e[i]):google.maps.event.clearListeners(t,e[i])},trigger:function(t,e,i){"leaflet"==mappl10n.options.engine?t.fire(e,i):google.maps.event.trigger(t,e,i)}},function(t){mapp.lib.Modal=function(){this.el=null;var e=this;this.el=t('<div class="mapp-modal" tabindex="0">').append('<div class="mapp-modal-backdrop">').append('<div class="mapp-modal-content" tabindex="1">'),this.el.hide(),this.el.on("click",".mapp-modal-backdrop",(function(){e.close()})),this.el.on("click",".mapp-modal-close",(function(){e.close()})),this.el.on("keydown",(function(t){27==t.which&&e.close()}))},mapp.lib.Modal.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.el.hide(),t("body").removeClass("mapp-modal-noscroll"))},focus:function(){t(".mapp-modal-focus",this.el).attr("tabindex",0),t(".mapp-modal-focus",this.el).focus()},open:function(){if(!this.el.parent().length){const e=t("body",window.parent.document);this.el.appendTo(e)}this.el.show(),t("body").addClass("mapp-modal-noscroll"),this.focus()},setContent:function(e){t(".mapp-modal-content",this.el).empty(),t(".mapp-modal-content",this.el).append('<div class="mapp-modal-close">×').append(e),this.focus()}}}(jQuery)},692:()=>{window.mapp=window.mapp||{},jQuery,mapp.load=function(){if("undefined"!=typeof mapp&&mapp.data)for(;mapp.data.length;){var t=mapp.data.pop();window[t.name]=new mapp.Map(t),window[t.name].display()}},mapp.load()},436:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Marker=function(t){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(t),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove()},mapp.Marker.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let i=e.fromLatLngToDivPixel(this.position),o=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};t(this.div).css({left:i.x-o.width/2,top:i.y-o.height})}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(t){let e="on"+t.type[0].toUpperCase()+t.type.slice(1);this[e]&&this[e](t)},onAdd:function(){let e=this.overlayView.getPanes();e&&(this.div=t('<div class="mapp-marker">'),this.div.appendTo(e.overlayMouseTarget),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div.get(0)),this.div.get(0).addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&mapp.event.trigger(this,"click"),this.dragging=null})),this.div.get(0).addEventListener("mouseenter",this),this.div.get(0).addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(t){mapp.event.trigger(this,"mouseover")},onMouseleave:function(t){mapp.event.trigger(this,"mouseout")},onPointerdown:function(t){const e=this.map.getDiv().getBoundingClientRect(),i=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:t.clientX,y:t.clientY},offset:{x:i.x-(t.clientX-e.left),y:i.y-(t.clientY-e.top)}},this.toggleDragEvents(!0)},onPointermove:function(t){if(Math.abs(t.clientX-this.dragging.startPixel.x)+Math.abs(t.clientY-this.dragging.startPixel.y)<3)return;const e=this.map.getDiv().getBoundingClientRect();let i={x:t.clientX-e.left+this.dragging.offset.x,y:t.clientY-e.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(i)),this.draw(),this.dragging.moved=!0,mapp.event.trigger(this,"dragstart")},onPointercancel:function(t){this.onPointerup(t)},onPointerup:function(t){this.dragging&&this.dragging.moved&&mapp.event.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(t,e){let i="set"+t[0].toUpperCase()+t.slice(1);this[i]&&this[i](e)},setDraggable:function(t){this.draggable=t,this.map&&(this.div.get(0).removeEventListener("pointerdown",this,{passive:!0}),t&&this.div.get(0).addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(t){if(void 0!==t&&(this.icon=t),this.icon&&this.div){let t='<img draggable="false" src="'+this.icon.url+'">';this.div.html(t);let e=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:e.width,height:e.height}),this.setZIndex(),this.draw()}},setMap:function(t){this.map=t,this.overlayView.setMap(t)},setPosition:function(t){this.position=t},setValues:function(t){for(const e in t)this.set(e,t[e])},setVisible:function(t){this.visible=t,this.div&&this.div.css("visibility",t?"visible":"hidden")},setZIndex:function(t){this.zIndex=void 0!==t?t:this.zIndex,this.div&&this.div.css("z-index",t)},toggleDragEvents(t){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),t&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},510:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Places=function(e,i){var o=this;this.sel=t(e),this.opts=t.extend({map:null},i);let n="";n="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"algolia",this.geocoder=new mapp.geocoders[n](this.opts.map),this.sel.on("keydown",(function(e){13==e.which&&(e.preventDefault(),e.stopImmediatePropagation(),o.sel.autocomplete("close"),o.parse(o.sel.val(),(function(e){e&&t(o).triggerHandler("search.mapp",e)})))})),t(".mapp-search-button",this.sel.parent()).on("click",(function(){o.parse(o.sel.val(),(function(e){e&&(o.sel.autocomplete("close"),t(o).triggerHandler("search.mapp",e))}))})),this.initAutocomplete()},mapp.Places.prototype={parse:function(t,e){var i="";if(t&&(i="string"==typeof(i=t&&t.name?t.name:t)?i.trim():i),i)if("string"!=typeof i||"http"!=i.substring(0,4))if("user"!=i)if(t&&t.geometry)e(t);else{var o=this.parseLatLng(t);o?e(o):this.geocoder.getFirstPrediction(t,(function(t){e(t)}))}else this.geolocate((function(t){e(t)}));else e(i);else e(null)},parseLatLng:function(t){var e;if(t.hasOwnProperty("lat")&&t.hasOwnProperty("lng"))e=t;else{var i=t&&t.name?t.name:t,o=(i="string"==typeof i?i.trim():i).split(",");if(2==o.length){var n=parseFloat(o[0]),s=parseFloat(o[1]);isNaN(n)||isNaN(s)||(e={lat:n,lng:s})}}return e?{name:e.lat+", "+e.lng,geometry:{location:e}}:null},geolocate:function(t,e){var i=this;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(e){var o={lat:e.coords.latitude,lng:e.coords.longitude};t({name:o.lat+", "+o.lng,geometry:{location:o}}),i.sel.val("")}),(function(i){if(!e){var o=i&&i.message?" : "+i.message:"";alert(mappl10n.no_geolocate+o)}t(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)},initAutocomplete:function(){var e=this;this.sel&&this.sel.length&&(this.sel.on("autocompleteselect",(function(i,o){e.geocoder.getDetails(o.item,(function(i){e.parse(i,(function(i){i&&t(e).triggerHandler("search.mapp",i)}))}))})),this.sel.autocomplete({appendTo:this.sel.parent(),autoFocus:!0,minLength:1,delay:"nominatim"===mappl10n.options.geocoder?500:0,source:(t,i)=>{e.geocoder.getPredictions(t.term,(function(t){i(t)}))}}))}}},548:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Poi=function(e){if(this.defaults={address:null,body:null,html:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},t.extend(this,this.defaults,e),e&&e.correctedAddress&&(this.address=e.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),e.viewport&&e.viewport.sw&&e.viewport.ne&&e.viewport.sw.lat){var i=e.viewport.sw,o=e.viewport.ne;"leaflet"==mappl10n.options.engine?this.viewport=new L.LatLngBounds(L.latLng(i.lat,i.lng),L.latLng(o.lat,o.lng)):this.viewport=new google.maps.LatLngBounds(new google.maps.LatLng(i.lat,i.lng),new google.maps.LatLng(o.lat,o.lng))}var n=[],s=[];if(!e.overlay)switch(this.type){case"polygon":if(e.poly&&e.poly.paths)for(var a=0;a<e.poly.paths.length;a++){n=[];for(var l=0;l<e.poly.paths[a].length;l++)n.push(new google.maps.LatLng(e.poly.paths[a][l].lat,e.poly.paths[a][l].lng));s.push(new google.maps.MVCArray(n))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(s)}),this.setColors(e.poly);break;case"polyline":if(e.poly&&e.poly.path)for(a=0;a<e.poly.path.length;a++)n.push(new google.maps.LatLng(e.poly.path[a].lat,e.poly.path[a].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(n)}),this.setColors(e.poly);break;case"circle":var p=new google.maps.LatLng(e.point.lat,e.point.lng);this.overlay=new google.maps.Circle({center:p,radius:parseFloat(e.poly.radius)}),this.setColors(e.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport}),this.setColors(e.poly);break;case"kml":var r=e.kml&&e.kml.url?e.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(r):new google.maps.KmlLayer({url:r,preserveViewport:!0,suppressInfoWindows:!0});break;default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([e.point.lat,e.point.lng]):this.overlay=new mapp.Marker({position:new google.maps.LatLng(e.point.lat,e.point.lng)})}e.type||this.set({iconid:e.iconid})},mapp.Poi.prototype={center:function(t){var e=this.getBounds();if("number"!=typeof t)if(e){var i=e.getNorthEast().toJSON().lng-e.getSouthWest().toJSON().lng;i<0&&(i+=360),t=Math.round(Math.log(360*this.map.div.canvas.width()/i/256)/Math.LN2),this.map.setView(this.getPosition(),t,{animate:!1})}else this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));else this.map.setView(this.getPosition(),t)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(t){switch(this.isPoly()?"poly":this.type){case"kml":return t&&t.pixelOffset?{x:t.pixelOffset.width,y:t.pixelOffset.height}:{x:0,y:0};case"poly":return{x:0,y:0};default:return mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32}}},getBounds:function(){var t;switch(this.type){case"polyline":t=new google.maps.LatLngBounds,this.overlay.getPath().forEach((function(e){t.extend(e)}));break;case"polygon":t=new google.maps.LatLngBounds,this.overlay.getPaths().forEach((function(e){e.forEach((function(e){t.extend(e)}))}));break;case"rectangle":case"circle":t=this.overlay.getBounds();break;case"kml":t=(t="leaflet"==mappl10n.options.engine?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport())||this.viewport;break;default:return this.viewport}return t},getColors:function(){var t={};for(var e in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})void 0!==this.overlay[e]&&(t[e]=this.overlay[e]);return t},getPosition:function(t){if(!this.type)return"leaflet"==mappl10n.options.engine?this.overlay.getLatLng():this.overlay.getPosition();if("kml"==this.type&&t&&t.latLng)return t.latLng;var e=this.getBounds();return e?e.getCenter():"leaflet"==mappl10n.options.engine?new L.latLng(0,0):new google.maps.LatLng(0,0)},getTemplateColors:function(){var t=this.getColors();return"polyline"==this.type?{color:t.strokeColor,opacity:100*t.strokeOpacity,weight:t.strokeWeight}:{color:t.fillColor,opacity:100*t.fillOpacity,weight:t.strokeWeight}},highlight:function(e){if(!this.type){var i="leaflet"==mappl10n.options.engine?t(this.overlay._icon):this.overlay.getDiv();if(i){switch(this.editable?"circle":mappl10n.options.highlight){case"circle":i.toggleClass("mapp-marker-circle",e);break;case"icon":var o=e?mapp.Icons.get(mappl10n.options.highlightIcon):mapp.Icons.get(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==o.options.iconUrl)return;this.overlay.setIcon(o);break;case"scale":i.addClass("mapp-marker"),i.toggleClass("mapp-marker-scale",e)}this.setZIndex(e?1e4:0)}}},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},open:function(t){this.map.poiOpen(this,t)},fetchPost:function(t){this.html?t():mapp.lib.ajax({type:"GET",data:{action:"mapp_get_post",postid:this.postid,nonce:mappl10n.options.nonce},dataType:"html",callback:e=>{this.html=e,t()}})},render:function(t,e){var i={};return i=_.extend(i,this,{icon:mapp.Icons.getUrl(this.iconid)}),e&&(i.body=e.description,i.title=e.name),i.thumbnail=mappl10n.options.thumbsPopup&&"popup"==t||mappl10n.options.thumbsList&&"item"==t?i.thumbnail:null,mapp.lib.template(this.map.templates[t],{poi:i,colors:this.getTemplateColors()})},set:function(t){for(var e in t){var i=t[e];switch(e){case"dirty":this.map.set({dirty:i});break;case"iconid":this.type||(this.iconid=i,this.overlay.setIcon(mapp.Icons.get(i)));break;default:this[e]=i}}this.map&&"undefined"!=typeof dirty&&this.map.set({dirty})},setColors:function(t){var e={};for(var i in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})t&&void 0!==t[i]&&(e[i]=t[i]);this.overlay.setOptions(e)},setEditable:function(t){var e=this;"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=t:this.overlay.setDraggable(t),this.isPoly()&&this.overlay.setEditable(t),mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay,"dragstart"),t&&(mapp.event.addListener(this.overlay,"dragstart",(function(){e.viewport=null,e.map.poiClose()})),mapp.event.addListener(this.overlay,"dragend",(function(){e.map.set({dirty:!0})})),"polygon"!=this.type&&"polyline"!=this.type||"leaflet"!=mappl10n.options.engine&&(mapp.event.addListener(this.overlay,"rightclick",(function(t){null!=t.vertex&&e.overlay.getPath().getLength()>2&&e.overlay.getPath().removeAt(t.vertex)})),mapp.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),mapp.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(function(){e.map.set({dirty:!0})})))))},setMap:function(t){var e=this;this.map=t,mapp.event.clearInstanceListeners(this.overlay),null!=t?("kml"==this.type&&("leaflet"==mappl10n.options.engine?(mapp.event.addListenerOnce(this.overlay,"ready",(function(){e.viewport=e.overlay.getBounds()})),mapp.event.addListenerOnce(this.overlay,"error",(function(){alert(mappl10n.kml_error)}))):(mapp.event.addListener(this.overlay,"defaultviewport_changed",(function(){e.viewport=e.overlay.getDefaultViewport()})),mapp.event.addListener(this.overlay,"status_changed",(function(){var t=e.overlay.getStatus();"OK"!=t&&alert(mappl10n.kml_error+":"+t)})))),this.setEditable(this.map.editable),!this.type&&this.map.clusterer||("leaflet"==mappl10n.options.engine?this.overlay.addTo(t.getMap()):this.overlay.setMap(t.getMap())),mapp.event.addListener(this.overlay,"click",(function(t){e.open(t)})),mapp.event.addListener(this.overlay,"mouseover",(function(t){e.map.poiHover(e)})),mapp.event.addListener(this.overlay,"mouseout",(function(t){e.map.poiHover(null)}))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setTemplateColors:function(t){let{color:e,opacity:i,weight:o}=t;i=i?i/100:void 0;var n="polyline"==this.type?{strokeColor:e,strokeOpacity:i,strokeWeight:o}:{fillColor:e,fillOpacity:i,strokeColor:e,strokeWeight:o,strokeOpacity:1};this.setColors(n)},setVisible:function(t){void 0!==this.overlay.setVisible&&this.overlay.setVisible(t)},setZIndex:function(t){"leaflet"==mappl10n.options.engine?this.type||this.overlay.setZIndexOffset(t):this.overlay.set("zIndex",t)},toJSON:function(){var t={address:this.address,body:this.body,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},e=this.getPosition();t.point=e.toJSON();var i=this.viewport?this.viewport:this.getBounds();if(i){var o=i.toJSON();t.viewport={sw:{lat:o.south,lng:o.west},ne:{lat:o.north,lng:o.east}}}if("kml"==this.type&&(t.kml=this.kml),this.isPoly())switch(t.poly=this.getColors(),this.type){case"circle":t.poly.radius=this.overlay.getRadius();break;case"polyline":t.poly.path=[],this.overlay.getPath().forEach((function(e){t.poly.path.push(e.toJSON())}));break;case"polygon":t.poly.paths=[],this.overlay.getPaths().forEach((function(e){var i=[];e.forEach((function(t){i.push(t.toJSON())})),t.poly.paths.push(i)}));break;case"rectangle":var n=this.overlay.getBounds();t.viewport={sw:n.getSouthWest().toJSON(),ne:n.getNorthEast().toJSON()}}return t}}},675:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=0;e<t.length;e++){var i=t[e].match(/country\/(.*)?/);if(i)return i[1]}return}},892:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e={country:"country",city:"city","amenity/bus_station":"busStop","amenity/townhall":"townhall","railway/station":"trainStation","aeroway/aerodrome":"airport","aeroway/terminal":"airport","aeroway/gate":"airport"};for(var i in e)if(-1!==t.indexOf(i))return e[i];return"address"}},991:(t,e,i)=>{"use strict";e.Z=function(t){var e=t.formatInputValue,i=t.hit,s=t.hitIndex,a=t.query,p=t.rawAnswer;try{var h=i.locale_names[0],d=i.country,c=i.administrative&&i.administrative[0]!==h?i.administrative[0]:void 0,g=i.city&&i.city[0]!==h?i.city[0]:void 0,m=i.suburb&&i.suburb[0]!==h?i.suburb[0]:void 0,u=i.county&&i.county[0]!==h?i.county[0]:void 0,v=i.postcode&&i.postcode.length?function(t,e){for(var i=e[0].value,o=[],n=1;n<e.length;++n)"none"!==e[n].matchLevel&&o.push({index:n,words:e[n].matchedWords});if(0===o.length)return{postcode:t[0],highlightedPostcode:i};return o.sort((function(t,e){return t.words>e.words?-1:t.words<e.words?1:t.index-e.index})),{postcode:t[o[0].index],highlightedPostcode:e[o[0].index].value}}(i.postcode,i._highlightResult.postcode):{postcode:void 0,highlightedPostcode:void 0},f=v.postcode,y=v.highlightedPostcode,w={name:r(i._highlightResult.locale_names),city:g?r(i._highlightResult.city):void 0,administrative:c?r(i._highlightResult.administrative):void 0,country:d?i._highlightResult.country.value:void 0,suburb:m?r(i._highlightResult.suburb):void 0,county:u?r(i._highlightResult.county):void 0,postcode:y},b={name:h,administrative:c,county:u,city:g,suburb:m,country:d,countryCode:(0,o.default)(i._tags),type:(0,n.default)(i._tags),latlng:{lat:i._geoloc.lat,lng:i._geoloc.lng},postcode:f,postcodes:i.postcode&&i.postcode.length?i.postcode:void 0},L=e(b);return l(l({},b),{},{highlight:w,hit:i,hitIndex:s,query:a,rawAnswer:p,value:L})}catch(t){return console.error("Could not parse object",i),console.error(t),{value:"Could not parse object"}}};var o=s(i(675)),n=s(i(892));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?a(Object(i),!0).forEach((function(e){p(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function p(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){for(var e=t[0].value,i=[],o=1;o<t.length;++o)"none"!==t[o].matchLevel&&i.push({index:o,words:t[o].matchedWords});return 0===i.length?e:(i.sort((function(t,e){return t.words>e.words?-1:t.words<e.words?1:t.index-e.index})),0===i[0].index?"".concat(e," (").concat(t[i[1].index].value,")"):"".concat(t[i[0].index].value," (").concat(e,")"))}},574:(t,e)=>{"use strict";e.Z=function(t){var e=t.administrative,i=t.city,o=t.country,n=t.name,s=t.type;return"".concat(n).concat("country"!==s&&void 0!==o?",":"","\n ").concat(i?"".concat(i,","):"","\n ").concat(e?"".concat(e,","):"","\n ").concat(o||"").replace(/\s*\n\s*/g," ").trim()}}},e={};function i(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,i),s.exports}i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(628),i(273),i(397),i(442),i(282),i(689),i(436),i(510),i(548),i(692)})();
|
1 |
+
(()=>{var t={658:(t,e,i)=>{"use strict";i.r(e);const s=wp.element.createElement,{Fragment:n,useEffect:o,useLayoutEffect:a,useRef:l,useState:p}=wp.element,__=t=>wp.i18n.__(t,"mappress-google-maps-for-wordpress");function r(t){const[e,i]=p({saddr:t.saddr?t.saddr:"",daddr:t.daddr?t.daddr:""});function n(t){i((e=>({...e,...t})))}function o(i,s){switch(i){case"close":t.onClose&&t.onClose();break;case"get-directions":a();break;case"keydown":13==s?o("get-directions"):27==s&&o("close");break;case"swap":n({saddr:e.daddr,daddr:e.saddr})}}function a(){let t=mappl10n.options.directionsServer;const i=e.saddr.trim(),s=e.daddr.trim();t="https://maps.google.com"==t?"https://www.google.com":t,-1==t.toLowerCase().indexOf("http")&&(t="https://"+t),t+="/maps/dir/?api=1&origin="+encodeURIComponent(i)+"&destination="+encodeURIComponent(s),window.open(t),o("close")}return"google"==mappl10n.options.directions?(a(),null):s("div",{className:"mapp-directions-component"},s("div",{className:"mapp-close",onClick:()=>o("close")}),s("div",null,s("input",{className:"mapp-dir-saddr",onChange:t=>n({saddr:t.target.value}),onKeyPress:t=>o("keydown",t.which),tabIndex:"1",placeholder:__("My location"),value:e.saddr}),s("div",{className:"mapp-dir-arrows",onClick:()=>o("swap")})),s("div",null,s("input",{className:"mapp-dir-daddr",onChange:t=>n({daddr:t.target.value}),onKeyPress:t=>o("keydown",t.which),tabIndex:"2",value:e.daddr})),s("div",{className:"mapp-dir-toolbar"},s("div",{className:"mapp-submit-button",onClick:()=>o("get-directions")},__("Get Directions"))))}wp.element.createElement;const{Fragment:h,useCallback:c,useEffect:d,useLayoutEffect:g,useMemo:u,useRef:m,useState:v}=wp.element;const f=wp.element.createElement,{Fragment:y,useCallback:w,useEffect:b,useLayoutEffect:k,useMemo:x,useRef:C,useState:P}=wp.element;function O(t){t={buttonLabel:null,className:"",delay:null,focus:!1,onFetch:null,onSelect:null,placeholder:"",selected:null,suggestions:[],title:"",...t};const e=C(null),i=C(null),[s,n]=P({isOpen:!1,value:""});function o(t){n((e=>({...e,...t})))}!function(t,e){const i=i=>{t.current&&!t.current.contains(i.target)&&e()};document.addEventListener("mousedown",i),document.addEventListener("touchstart",i)}(e,(()=>{s.isOpen&&o({isOpen:!1})})),b((()=>{t.focus&&i.current&&i.current.focus()}),[i.current]),b((()=>{s.map&&setMapTypeId(t.mapTypeId)}),[t.mapTypeId,s.map]);const a=function(t,e){const i=React.useRef(t);return React.useLayoutEffect((()=>{i.current=t})),React.useMemo((()=>_.debounce((function(){return i.current(...arguments)}),e)),[e])}((e=>{t.onFetch&&t.onFetch(e)}),t.delay);function l(){let e;o({isOpen:!1}),t.suggestions&&(e=null==s.selected?t.suggestions[0]:t.suggestions[s.selected]),t.onSelect({suggestion:e,value:p})}const p=s.selected>=0&&t.suggestions&&t.suggestions[s.selected]?t.suggestions[s.selected].value:s.value;return f("div",{className:"mapp-autocomplete",ref:e},f("div",{className:"mapp-autocomplete-wrapper"},f("input",{className:t.className,onChange:t=>{!function(t){o({value:t,selected:null}),a(t)}(t.target.value)},onKeyDownCapture:e=>function(e){switch(e.stopPropagation(),e.code){case"Backspace":o({isOpen:s.value.length>1});break;case"Enter":l();break;case"Escape":o({isOpen:!1});break;case"ArrowUp":if(e.preventDefault(),t.suggestions&&0!=s.selected){const e=null==s.selected?t.suggestions.length-1:s.selected-1;t.suggestions[e]&&o({isOpen:!0,selected:e})}else o({selected:null});break;case"ArrowDown":if(t.suggestions&&s.selected<t.suggestions.length-1){const e=null==s.selected?0:s.selected+1;t.suggestions[e]&&o({isOpen:!0,selected:e})}else o({selected:null});break;case"Tab":case"AltLeft":case"AltRight":case"ControlLeft":case"ControlRight":case"MetaLeft":case"MetaRight":break;default:o({isOpen:!0})}}(e),placeholder:t.placeholder,ref:i,title:t.title,type:"text",value:p}),s.isOpen&&f("div",{className:"mapp-autocomplete-list"},_.map(t.suggestions,((e,i)=>{const n="mapp-autocomplete-item"+(s.selected==i?" mapp-selected":"");return f("div",{className:n,key:i,onClick:()=>function(e,i){o({isOpen:!1,selected:i}),t.onSelect({suggestion:e})}(e,i)},e.value)})))),t.buttonLabel&&f("div",{className:"mapp-submit-button",onClick:()=>l()},t.buttonLabel))}wp.element.createElement;const{Fragment:S,useCallback:M,useEffect:I,useLayoutEffect:E,useRef:T,useState:V}=wp.element,A={google:function(){this.token=null;const t=document.createElement("div");this.placesService=new google.maps.places.PlacesService(t),this.autocompleteService=new google.maps.places.AutocompleteService}};A.google.prototype={getDetails:function(t){let{suggestion:e,callback:i}=t;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken,this.token=null;var s={fields:["formatted_address","name","geometry"],placeId:e.place_id,sessionToken:this.token};this.placesService.getDetails(s,(function(t,e){if("OK"==e&&t&&t.geometry){if(t.geometry.location&&(t.geometry.location=t.geometry.location.toJSON()),t.geometry.viewport){var s=t.geometry.viewport.toJSON();t.geometry.viewport={sw:{lat:s.south,lng:s.west},ne:{lat:s.north,lng:s.east}}}i(t)}else i(null)}))},getFirstPrediction:function(t){let{map:e,value:i,callback:s}=t;this.getPredictions({map:e,value:i,callback:t=>{t&&Array.isArray(t)?this.getDetails({suggestion:t[0],callback:t=>s(t)}):s(null)}})},getPredictions:function(t){let{map:e,value:i,includeBusinesses:s,callback:n}=t;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;var o=e?e.getBounds():null;"leaflet"==mappl10n.options.engine&&(o=new google.maps.LatLngBounds(new google.maps.LatLng(o.getSouthWest().lat,o.getSouthWest().lng),new google.maps.LatLng(o.getNorthEast().lat,o.getNorthEast().lng)));var a={input:i,bounds:o=o||new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180)),sessionToken:this.token,types:s?null:["geocode"]};this.autocompleteService.getPlacePredictions(a,(function(t,e){"OK"==e&&t&&t.length?(t=(t=t.map((t=>(t.value=t.description,t)))).filter((t=>t.place_id)),n(t)):(e==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):e==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),n(null))}))}},A.mapbox=function(){},A.mapbox.prototype={getDetails:function(t){let{suggestion:e,callback:i}=t,s=e.place_name,n=s.indexOf(","),o=s.indexOf(",",n+1);n>0&&(s=parseInt(s.substr(0,n))?s.substr(0,o).replace(",",""):s.substr(0,n));let a=e.bbox&&4==e.bbox.length?{sw:{lat:e.bbox[1],lng:e.bbox[0]},ne:{lat:e.bbox[3],lng:e.bbox[2]}}:null;i({formatted_address:e.place_name,name:s,geometry:{location:{lat:e.center[1],lng:e.center[0]},viewport:a}})},getFirstPrediction:function(t){let{map:e,value:i,callback:s}=t;this.getPredictions({map:e,value:i,callback:t=>{t&&t.length?this.getDetails({suggestion:t[0],callback:t=>s(t)}):s(null)}})},getPredictions:function(t){let{map:e,value:i,callback:s}=t;var n="https://api.mapbox.com/geocoding/v5/mapbox.places/"+i+".json?access_token="+mappl10n.options.mapbox;n=mappl10n.options.country?n+"&country="+mappl10n.options.country.toLowerCase():n,n=mappl10n.options.language?n+"&language="+mappl10n.options.language.toLowerCase():n;var o=e?e.getCenter():null;o&&(n+="&proximity="+o.lng+","+o.lat),mappl10n.options.searchBox&&(n+="&bbox="+mappl10n.options.searchBox),fetch(n).then((t=>t.json())).then((t=>{t&&t.features&&t.features.length>0?(t.features=t.features.map((t=>(t.value=t.label=t.place_name,t))),s(t.features)):s(null)}))}},A.nominatim=function(){},A.nominatim.prototype={getDetails:function(t){let{suggestion:e,callback:i}=t,s=e.display_name,n=s.indexOf(","),o=s.indexOf(",",n+1);n>0&&(s=parseInt(s.substr(0,n))?s.substr(0,o).replace(",",""):s.substr(0,n));let a=e.boundingbox&&4==e.boundingbox.length?{sw:{lat:e.boundingbox[0],lng:e.boundingbox[2]},ne:{lat:e.boundingbox[1],lng:e.boundingbox[3]}}:null;i({formatted_address:e.display_name,name:s,geometry:{location:{lat:e.lat,lng:e.lon},viewport:a}})},getFirstPrediction:function(t){let{map:e,value:i,callback:s}=t;this.getPredictions({map:e,value:i,callback:t=>{t&&t.length?this.getDetails({suggestion:t[0],callback:t=>s(t)}):s(null)}})},getPredictions:function(t){let{map:e,value:i,callback:s}=t;var n="https://nominatim.openstreetmap.org/search?format=json&dedupe=1&limit=5&q="+encodeURIComponent(i);if(n=mappl10n.options.country?n+"&countrycodes="+mappl10n.options.country.toLowerCase():n,n=mappl10n.options.language?n+"&accept-language="+mappl10n.options.language.toLowerCase():n,mappl10n.options.searchBox)n+="&viewbox="+mappl10n.options.searchBox,n+="&bounded=1";else{var o=e?e.getMap().getBounds():null;if(o){let t=o.getSouthWest(),e=o.getNorthEast();n+="&viewbox="+t.lng+","+t.lat+","+e.lng+","+e.lat}}fetch(n).then((t=>t.json())).then((t=>{t&&t.length?(t=t.map((t=>(t.value=t.display_name,t))),s(t)):s(null)}))}};const B=t=>{let{includeBusinesses:e}=t;function i(){let t="";return t="leaflet"!=mappl10n.options.engine?"google":mappl10n.options.geocoder?mappl10n.options.geocoder:"nominatim",new A[t]}function s(t,e){navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition((function(e){var i={lat:e.coords.latitude,lng:e.coords.longitude};t({name:i.lat+", "+i.lng,geometry:{location:i}})}),(function(i){if(!e){var s=i&&i.message?" : "+i.message:"";alert(mappl10n.no_geolocate+s)}t(null)}),{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4}):alert(mappl10n.no_geolocate)}return{geocode:function(t){let{map:n,suggestion:o,value:a,callback:l}=t;const p=i();a="string"==typeof a?a.trim():a,o||a?function(t){let{map:e,value:i,callback:n}=t;if(!i)return void n(null);if("http"==i.substring(0,4))return void n(i);if("user"==i)return void s((function(t){n(t)}));const o=i.split(",");if(2==o.length){const t=parseFloat(o[0]),e=parseFloat(o[1]);if(!isNaN(t)&&!isNaN(e))return void n({name:t+", "+e,geometry:{location:{lat:t,lng:e}}})}n(null)}({map:n,value:a,callback:t=>{t?l(t):o?p.getDetails({suggestion:o,callback:l}):p.getFirstPrediction({map:n,value:a,includeBusinesses:e,callback:l})}}):l(null)},geolocate:s,getPredictions:function(t){let{map:e,value:s,callback:n}=t;i().getPredictions({map:e,value:s,callback:n})}}},N=wp.element.createElement,{Fragment:z,useCallback:D,useEffect:j,useLayoutEffect:R,useRef:F,useState:J}=wp.element,G=t=>wp.i18n.__(t,"mappress-google-maps-for-wordpress");function H(t){t={buttonLabel:null,focus:!1,includeBusinesses:!1,map:null,onSearch:null,...t};const{geocode:e,getPredictions:i}=B({map:t.map,includeBusinesses:t.includeBusinesses}),[s,n]=J({suggestions:[]});return N(O,{buttonLabel:t.buttonLabel,className:"mapp-places",debounce:"nominatim"===mappl10n.options.geocoder?500:300,delay:"nominatim"==mappl10n.options.geocoder?500:50,focus:t.focus,onFetch:function(e){i({map:t.map,value:e,callback:t=>{var e;e={suggestions:t},n((t=>({...t,...e})))}})},onSelect:function(i){let{suggestion:s,value:n}=i;e({map:t.map,suggestion:s,value:n,callback:e=>{e&&t.onSearch(e)}})},placeholder:G("Search"),suggestions:s.suggestions,title:G("Enter an address, place, KML file URL, or lat,lng")})}window.mapp=window.mapp||{};const q=wp.element.createElement,Z=t=>wp.i18n.__(t,"mappress-google-maps-for-wordpress"),_n=wp.i18n._n;var U;U=jQuery,mapp.Map=function(t,e){this.defaults={alignment:null,center:null,classname:null,editable:null,embed:null,height:null,initialOpenInfo:null,layers:null,layout:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,onSearch:null,poiList:null,poiListOpen:null,poiListPageSize:null,pois:null,postid:null,query:null,search:null,sel:null,title:null,width:null,zoom:null},this.dirty=!1,this.hovered=null,this.isFullscreen=!1,this.iw=null,this.mapdata=t,this.opened=null,this.pagination={count:0,page:1},this.selected=null,this.settings=e||{},this.templates=null,this.clusterer=null,this.dir_=null,this.div={},this.layers_={},this.map_=null,this.modal_=null,this.pois_=[],this.user_=null,this.xhr_,_.extend(this,this.defaults,this.mapdata,this.settings),this.poiList=void 0!==this.poiList&&null!=this.poiList?this.poiList:mappl10n.options.poiList,this.layout=this.layout?this.layout:mappl10n.options.layout,this.postid=this.postid?this.postid:mappl10n.options.postid},mapp.Map.prototype={display:function(){const{geocode:t}=B({withBusinesses:this.editable});if(this.render(),!this.div||!this.div.layout)return;if(this.sanity(),this.editable?this.templates={loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?this.templates={loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:this.templates={loop:"map-loop",item:"map-item",popup:"map-popup"},"leaflet"==mappl10n.options.engine?this.mapOpts=_.extend({attribution:'Map data <a href="https://openstreetmap.org">OpenStreetMap</a>',minZoom:0,scrollWheelZoom:mappl10n.options.scrollWheel,worldCopyJump:!0,zoomControl:null},this.mapOpts):this.mapOpts=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,mapTypeControl:!1,minZoom:0,scaleControl:!0,streetViewControl:!this.query,streetViewControlOptions:{position:google.maps.ControlPosition.LEFT_BOTTOM}},this.mapOpts),this.mapOpts.minZoom=isNaN(parseInt(this.mapOpts.minZoom))?0:parseInt(this.mapOpts.minZoom),!this.div||!this.div.canvas)return;"leaflet"==mappl10n.options.engine?(this.map_=new L.Map(this.div.canvas.get(0),this.mapOpts),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_)):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),this.map_.setOptions(this.mapOpts),this.addLayers()),this.addGeolocateControl(),this.addMenu(),this.addPopup(),this.isFilterable()&&this.addFilters(),this.setMapTypeId(this.mapTypeId),this.clustering(),"postmodal"==mappl10n.options.mashupClick&&(this.modal_=new mapp.lib.Modal);const e=U(".mapp-search-container",this.div.layout);e.length&&wp.element.render(q(H,{buttonLabel:this.editable?Z("Add to map"):q("img",{src:mappl10n.options.baseurl+"/images/search.png"}),focus:this.editable,includeBusinesses:this.editable,map:this,onSearch:t=>{this.onSearch?this.onSearch(t):this.doSearch(t)}}),e.get(0)),this.addUserLocation(),this.addEvents("click dragstart zoom_changed zoomstart",(t=>{"leaflet"==mappl10n.options.engine&&"click"==t.type&&t.originalEvent&&!t.originalEvent.target.matches(".mapp-canvas")||this.poiClose()})),this.div.layout.on("click","[data-mapp-action]",(t=>{if(this.div.list&&this.div.list.length&&U.contains(this.div.list.get(0),t.target))return;const e=U(t.currentTarget),i=e.attr("data-mapp-action"),s=e.attr("data-mapp-"+i);t.preventDefault(),this.onAction(i,s,e)})),this.div.list.on("click","[data-mapp-action]",(t=>{const e=U(t.currentTarget),i=e.attr("data-mapp-action"),s=e.attr("data-mapp-"+i);this.onAction(i,s,e)})),new ResizeObserver(((t,e)=>{document.fullscreenElement?this.isFullscreen=!0:(this.isFullscreen?this.isFullscreen=!1:this.poiClose(),this.toggleView("mini"),this.resize())})).observe(this.div.layout.get(0)),mapp.event.addListener(this.map_,"maptypeid_changed baselayerchange",(()=>{this.set({dirty:!0})})),t({map:null,value:this.center,callback:t=>{this.center=t&&t.geometry&&t.geometry.location?{lat:t.geometry.location.lat,lng:t.geometry.location.lng}:null,this.setPois(this.pois),this.initCenter()}}),this.div.list.on("mouseenter","[data-mapp-poi]",(t=>{var e=U(t.currentTarget).attr("data-mapp-poi");this.poiHover(this.pois_[e])})),this.div.list.on("mouseleave","[data-mapp-poi]",(t=>{this.poiHover(null)}))},initCenter:function(){setTimeout((()=>{this.recenter(),this.renderList(),this.isSearchable&&!this.editable&&this.addSearchMove(),"leaflet"==mappl10n.options.engine?this.initOpen():mapp.event.addListenerOnce(this.map_,"idle",(()=>this.initOpen()))}),100)},initOpen:function(){const t=this.pois_.length?this.pois_[0]:null,e=null!=this.initialOpenInfo?this.initialOpenInfo:mappl10n.options.initialOpenInfo;t&&e&&!this.editable&&t.open()},addEvents:function(t,e){t=t.split(" ");for(var i=0;i<t.length;i++)mapp.event.addListener(this.map_,t[i],e)},addFilters:function(){U("body").on("click",(t=>{var e=U(t.target);e.hasClass("mapp-filters-toggle")||0!=e.closest(".mapp-filters-wrapper").length||this.div.layout.removeClass("mapp-view-filters")})),this.div.filters.on("change",(()=>{this.fetchPois()})),"top"==mappl10n.options.filtersPos&&new ResizeObserver(((t,e)=>{t.forEach((t=>{const e=this.div.canvas.get(0).clientHeight;U(".mapp-filters-body",this.div.layout).css({"max-height":e})}))})).observe(this.div.layout.get(0))},addGeolocateControl:function(){if(!mappl10n.options.ssl)return;const t=U(".mapp-geolocate-control-wrapper",this.div.layout).get(0);"google"==mappl10n.options.engine?this.map_.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(t):(L.Control.Geolocate=L.Control.extend({onAdd:e=>t,onRemove:()=>{}}),new L.Control.Geolocate({position:"bottomright"}).addTo(this.map_))},addLayers:function(){this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer};for(var t=U.makeArray(this.layers),e=0;e<t.length;e++){var i=t[e].trim(),s=i.split(".").pop();this.layers_[i]?this.toggleLayer(i):"kml"==s||"kmz"==s?this.layers_[i]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:i}):"json"==s&&(this.layers_[i]=new google.maps.Data({map:this.map_}).loadGeoJson(i))}},addMenu:function(){U("body").on("click",(t=>{var e=U(t.target),i=e.attr("data-mapp-action");e==this.div.menu||"menu-toggle"==i||e.closest(this.div.menu).length||this.toggleView("menu",!1)}))},addPopup:function(){var t=this.editable?"mapp-iw-edit":"mapp-iw";this.editable||(t+=" mapp-"+this.templates.popup),this.div.iw=U('<div class="'+t+'">').appendTo(this.div.canvas),this.iw=new mapp.Infobox(this.map_,{className:this.editable?"mapp-ib-edit":""}),this.iw.setContent(this.div.iw.get(0)),this.div.iw.on("click",".mapp-close",(()=>{this.poiClose()}))},addSearchMove:function(){},addUserLocation:function(){const{geolocate:t}=B({withBusinesses:this.editable});mappl10n.options.userLocation&&mappl10n.options.ssl&&t((t=>{if(t&&t.geometry&&t.geometry.location){const e=t.geometry.location,i=mapp.Icons.get("geolocation");"leaflet"==mappl10n.options.engine?this.user_=L.marker([e.lat,e.lng],{icon:i}).addTo(this.map_):(this.user_=new mapp.Marker({icon:i,position:new google.maps.LatLng(e.lat,e.lng)}),this.user_.setMap(this.map_))}}),!0)},clusterGetLatLng:function(t){if(this.clusterer){if("leaflet"==mappl10n.options.engine){var e=this.clusterer.getVisibleParent(t.overlay);return e?e.getLatLng():null}for(var i=this.clusterer.getClusters(),s=0;s<i.length;s++){var n=i[s].markers_;if(n.length>1)for(var o=0;o<n.length;o++)if(n[o]==t.overlay)return i[s].center_}}},clustering:function(){if(mappl10n.options.clustering&&!this.editable){let t=mappl10n.options.clusteringOptions?mappl10n.options.clusteringOptions:{};void 0!==t.disableClusteringAtZoom&&""==t.disableClusteringAtZoom&&(t.disableClusteringAtZoom=null),"leaflet"==mappl10n.options.engine?this.clusterer=L.markerClusterGroup(t):(t=_.extend(t,{imagePath:mappl10n.options.baseurl+"/lib/js-markerclustererplus-main/images/m"}),this.clusterer=new MarkerClusterer(this.map_,[],t))}},clustersReset:function(){this.clusterer&&("leaflet"==mappl10n.options.engine?this.clusterer.clearLayers():this.clusterer.clearMarkers())},clustersSet:function(){if(this.clusterer){var t=[];for(let e=0;e<this.pois_.length;e++)this.pois_[e].type||t.push(this.pois_[e].overlay);"leaflet"==mappl10n.options.engine?(this.clusterer.addLayers(t),this.map_.addLayer(this.clusterer)):this.clusterer.addMarkers(t)}},fetchPois:function(t){var e=new Date;this.poiClose();var i={action:"mapp_query",filters:U(":input",this.div.filters).serialize(),list:!!this.div.list.length,query:this.query,url:{href:window.location.href,search:window.location.search},debug:mappl10n.options.debug};this.xhr_&&this.xhr_.abort("cancel"),this.spinner(!0),this.xhr_=mapp.lib.ajax({data:i,callback:(i,s)=>{this.spinner(!1),i&&"OK"==i.status&&(this.setPois(i.data.pois),this.renderList(),mappl10n.options.debug&&mapp.lib.log("Results: "+i.data.pois.length+" ("+s.responseText.length/1e3+"K) AJAX: "+(new Date-e)+(i.data.timing?i.data.timing:"")),t&&t())}})},fitBounds:function(t){return this.map_.fitBounds(t)},getBounds:function(){try{return this.map_.getBounds()}catch(t){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(t){return null}},getMap:function(){return this.map_},getPois:function(){return this.pois_},getZoom:function(){try{return this.map_.getZoom()}catch(t){return null}},isFilterable:function(){return mappl10n.options.pro&&mappl10n.options.filters&&mappl10n.options.filters.length>0&&!this.editable&&this.query},isSearchable:function(){return!!this.editable},onAction:function(t,e,i){switch(t){case"center":this.toggleView("menu",!1),this.poiClose(),this.recenter();break;case"dir":this.renderDirections({isOpen:!0,from:null,to:this.opened});break;case"dir-from":this.renderDirections({isOpen:!0,from:this.opened,to:null});break;case"filters-reset":this.div.filters.find(":input").each(((t,e)=>{"hidden"!=e.type&&("checkbox"==e.type||"radio"==e.type?U(e).prop("checked",!1):U(e).val(""))})),this.fetchPois();break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":const{geolocate:t}=B({withBusinesses:this.editable});t((t=>{t&&t.geometry&&t.geometry.location&&this.setView(t.geometry.location,parseInt(mappl10n.options.poiZoom))}),!1);break;case"layer":this.toggleLayer(e),this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":var s=i.attr("data-mapp-poi");this.poiOpen(this.pois_[s]);break;case"page":var n=parseInt(i.attr("data-mapp-page"));this.pagination.page=n,this.renderList();break;case"sidebar-toggle":this.toggleSidebar();break;case"view-map":this.toggleSidebar(!1);break;case"view-list":this.toggleSidebar(!0);break;default:return!0}},doSearch:function(t){if(t&&t.geometry){var e=t.geometry.location?t.geometry.location:null,i=t.geometry.viewport?t.geometry.viewport:null;if("leaflet"==mappl10n.options.engine)var s=new L.LatLng(e.lat,e.lng),n=i?new L.LatLngBounds(new L.LatLng(i.sw.lat,i.sw.lng),new L.LatLng(i.ne.lat,i.ne.lng)):s.toBounds(1e3*mappl10n.options.radius);else{var o=new google.maps.Circle({center:e,radius:1e3*mappl10n.options.radius});n=i?new google.maps.LatLngBounds(new google.maps.LatLng(i.sw.lat,i.sw.lng),new google.maps.LatLng(i.ne.lat,i.ne.lng)).union(o.getBounds()):o.getBounds()}n&&this.fitBounds(n),this.setView(e)}},poiClose:function(){this.poiHighlight(null),this.selected=null,this.opened=null,this.hovered=null,this.iw.close(),this.renderDirections({isOpen:!1}),U(this).triggerHandler("mapp.close")},poiHighlight:function(t){if("icon"!=mappl10n.options.highlight||"leaflet"!=mappl10n.options.engine||!this.editable){if(U("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),this.hovered&&this.hovered.highlight(!1),t){var e=U.inArray(t,this.pois_);U('[data-mapp-poi="'+e+'"]',this.div.list),t.highlight(!0)}this.selected&&(e=U.inArray(this.selected,this.pois_),U('[data-mapp-poi="'+e+'"]',this.div.list).addClass("mapp-selected"))}},poiHover:function(t){t&&this.opened==t||(mappl10n.options.tooltips||(this.poiHighlight(null),this.hovered=null),t&&(this.poiHighlight(t),this.hovered=t,mappl10n.options.tooltips&&!this.editable&&this.popupOpen(t,null,"popup")))},poiInsert:function(t){this.pois_.unshift(t),t.setMap(this),this.renderList(),this.set({dirty:!0})},poiOpen:function(t,e){if(this.poiClose(),this.selected=t,this.poiHighlight(t),this.query&&t.postid&&t.url&&!this.editable)switch(mappl10n.options.mashupClick){case"post":return void window.location.assign(t.url);case"postnew":return void window.open(t.url);case"postmodal":return this.modal_.open(),this.modal_.setContent('<div class="mapp-modal-spinner">'),void t.fetchPost((()=>this.modal_.setContent(t.html)))}this.div.layout.hasClass("mapp-view-mini")&&this.toggleSidebar(!1),this.popupOpen(t,e,"popup"),U(this).triggerHandler("mapp.open",t)},poiRemove:function(t){var e=U.inArray(t,this.pois_);-1!=e&&(this.pois_[e].setMap(null),this.pois_.splice(e,1),this.renderList()),this.set({dirty:!0})},popupClose:function(){"icon"==mappl10n.options.highlight&&"leaflet"==mappl10n.options.engine&&this.editable||(this.iw.close(),this.renderDirections({isOpen:!1}),this.opened=null,U(this).triggerHandler("mapp.close"))},popupOpen:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"popup",s=null;this.popupClose(),e&&e.featureData?s=e.featureData:e&&e.propagatedFrom&&e.propagatedFrom.feature&&e.propagatedFrom.feature.properties&&(s=e.propagatedFrom.feature.properties),this.div.iw.html(t.render(i,s)),this.div.iw.toggleClass(" mapp-thumb-"+mappl10n.options.thumbsPopup,!!t.thumbnail);var n=this.clusterGetLatLng(t),o=n||t.getPosition(e);this.iw.open({position:o,anchorPoint:t.getAnchorPoint(e)}),this.opened=t},recenter:function(){var t=this.center&&this.center.hasOwnProperty("lat")&&this.center.hasOwnProperty("lng")?this.center:null,e=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null;if(t&&!e&&this.query)return void this.doSearch({geometry:{location:{lat:t.lat,lng:t.lng}}});if(t)return void this.setView(t,e||1);if(0==this.pois_.length)return void this.setView({lat:0,lng:0},e||1);if(1==this.pois_.length)return void this.pois_[0].center(e);let i="leaflet"==mappl10n.options.engine?new L.LatLngBounds:new google.maps.LatLngBounds;for(var s=0;s<this.pois_.length;s++){var n=this.pois_[s].getBounds(),o=this.pois_[s].getPosition();i=n?"leaflet"==mappl10n.options.engine?i.extend(n):i.union(n):i.extend(o)}e?this.setView(i.getCenter().toJSON(),e):this.fitBounds(i)},render:function(){let t=this.name?this.name+"-layout":"",e="mapp-layout",i=this.layout&&window.parent==window?this.layout:"left";if(e+="left"==i?" mapp-list-left":" mapp-inline",e+="leaflet"==mappl10n.options.engine?" mapp-leaflet ":" mapp-google ",e+=this.classname?" "+this.classname:"",!document.body.classList.contains("block-editor-page")){let t=this.alignment?this.alignment:mappl10n.options.alignment;if(t){let i=" align"+t+" mapp-align-"+t;window.parent==window?e+=i:U(window.frameElement).parent().parent().addClass(i)}}var s=mapp.lib.template("map",{map:this,layout:i});if(this.sel){if(this.div.layout=U(this.sel),this.div.layout.html(s),this.div.layout.addClass(e),this.div.layout.attr("id",t),!this.div.layout.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name)}else{let i=U('<div id="'+t+'" class="'+e+'">');i.html(s);let n=U("#"+this.name+"-layout");if(!n.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);n.replaceWith(i),this.div.layout=i}U.each(["canvas","content","controls","directions","filters","header","list","menu","search","sidebar","wrapper"],((t,e)=>{this.div[e]=U(".mapp-"+e,this.div.layout)})),this.setSize({width:this.width,height:this.height}),this.set({poiList:this.poiList})},renderDirections:function(t){let{isOpen:e,from:i,to:s}=t;if(e){const t=s?s.getAddress():"",e=i?i.getAddress():"";this.toggleView("directions",!0),wp.element.render(q(r,{saddr:e,daddr:t,onClose:()=>{wp.element.unmountComponentAtNode(this.div.directions.get(0)),this.toggleView("directions",!1)}}),this.div.directions.get(0))}else this.div.directions.length&&wp.element.unmountComponentAtNode(this.div.directions.get(0)),this.toggleView("directions",!1)},renderList:function(){var t=this.getBounds(),e=0;if(this.editable)return void this.div.layout.trigger("mapp.render");if(!this.poiList)return;let i=parseInt(mappl10n.options.poiListPageSize);i=isNaN(i)?20:i;const s=i*(this.pagination.page-1),n=s+i;if(!this.editable)for(var o=0;o<this.pois_.length;o++){let i=this.pois_[o];i.visible=!1,this.isSearchable()?t&&t.contains(i.getPosition())&&(i.visible=!0,e++):(i.visible=!0,e++),i.visible=e>=s&&e<=n&&i.visible}this.pagination.count=e,this.pagination.countString=sprintf(_n(Z("%d Result"),Z("%d Results"),this.pagination.count),this.pagination.count),this.div.list.html(mapp.lib.template(this.templates.loop,{map:this,pois:this.pois_,pageSize:i,pagination:this.pagination})),U(".mapp-filters-count",this.filters).html(this.pagination.countString),mappl10n.options.thumbsList&&this.div.list.addClass(" mapp-thumb-"+mappl10n.options.thumbsList)},renderMenu:function(){for(var t in this.layers_)U('[data-mapp-layer="'+t+'"]',this.div.layout).toggleClass("mapp-active",null!=this.layers_[t].getMap())},resetPois:function(){for(var t=0;t<this.pois_.length;t++)this.pois_[t].setMap(null);this.pois_=[],this.clustersReset()},resize:function(){this.map_&&("leaflet"==mappl10n.options.engine?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize"),this.toggleView("mini"))},sanity:function(){const t="<a href='"+mappl10n.options.adminurl+"/admin.php?page=mappress'>"+Z("MapPress Settings")+"</a>",e="<a href ='http://mappresspro.com/mappress-faq' target='_blank'>"+Z("MapPress FAQ")+"</a>",i="<a href='http://mappresspro.com/chris-contact', target='_blank'>"+Z("contact support")+"</a>",s="<br/>"+sprintf(Z("Please see the %s for help, or %s and provide this error message."),e,i),n=sprintf("<div class='mapp-errors-toolbar'><div class='mapp-errors-apikey'>%s</a></div>",Z("Get an API Key"));this.div.layout.on("click",".mapp-errors-apikey",(()=>{window.open("https://mappresspro.com/how-to-get-a-google-maps-api-key")}));let o=[{condition:"leaflet"==mappl10n.options.engine&&"undefined"==typeof L,title:Z("Leaflet library not loaded"),text:Z("A theme or plugin is preventing the Leaflet library from loading.")+s},{condition:"google"==mappl10n.options.engine&&"undefined"==typeof google,title:Z("Google Maps API not loaded"),text:Z("A theme or plugin is preventing Google Maps from loading.")+s},{condition:"google"==mappl10n.options.engine&&!mappl10n.options.apikey,title:Z("Google Maps API key required"),text:sprintf(Z("Please enter a Google Maps API key in the %s, or switch to Leaflet maps."),t)+n},{condition:U('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1,title:Z("Google Maps API loaded multiple times"),text:Z("A theme or plugin has loaded Google Maps twice")+s},{condition:"undefined"==typeof _,title:Z("Underscore library not loaded"),text:Z("A theme or plugin is preventing the underscore.js library from loading.")+s}];_.map(o,(t=>{if(t.condition){mappl10n.options.admin&&this.sanityOutput({title:t.title,text:t.text?t.text:""});let e=jQuery("<span>"+t.text.replace("<br/>","\n")+"</span>").text();console.error(Z("Map error")+": "+t.title+" - "+e)}}))},sanityOutput(t){if(!U(".mapp-errors-overlay",this.div.content).length){let t="<div class='mapp-errors-overlay'></div><div class='mapp-errors'><div class='mapp-errors-header'>"+Z("Oops! Something went wrong.")+"</div><div class='mapp-errors-list'></div></div>";this.div.content.prepend(t)}U(".mapp-errors-list",this.div.content).append("<div class='mapp-errors-title'>"+t.title+"</div><div class='mapp-errors-text'>"+t.text+"</div>")},set:function(t){for(let i in t){var e=t[i];switch(i){case"dirty":this.dirty=e;break;case"mapTypeId":this.mapTypeId=e,this.setMapTypeId(e);break;case"poiList":this.poiList=null==e?mappl10n.options.poiList:e,this.toggleSidebar(mappl10n.options.poiListOpen),this.toggleView("mini");break;case"search":this.search=e;break;case"style":this.setStyle(e);break;case"title":this.title=e;break;default:this[i]=e}}},setMapTypeId:function(t){const e=mappl10n.options.standardStyles.concat(mappl10n.options.userStyles),i=_.find(e,(e=>e.id==t));!mappl10n.options.style||"roadmap"!=t&&"streets"!=t&&i||(t=mappl10n.options.style);let s=_.find(e,(e=>e.id==t));s=s||e[0],this.setStyle(s)},setPois:function(t){if(this.resetPois(),t)for(var e=0;e<t.length;e++){var i=new mapp.Poi(t[e]);this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this)}this.clustersSet()},setSize:function(t){var e=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];let i={},s={};if(t&&t.hasOwnProperty("width")&&(i={width:t.width?t.width:e.width}),t&&t.hasOwnProperty("height")){let i=t.height?t.height:e.height;s="string"==typeof i&&i.includes("%")?{"padding-bottom":i,height:"auto"}:{"padding-bottom":0,height:i}}window.frameElement&&window.frameElement.classList.contains("mapp-iframe")?(U(window.frameElement).parent().parent().css(i),U(window.frameElement).parent().css(s)):this.embed?(i={height:"100%"},s={"padding-bottom":0,height:"100%"}):(this.div.layout.css(i),this.div.wrapper.css(s)),this.resize()},setStyle:function(t){if("leaflet"==mappl10n.options.engine){let e={mapbox:{accessToken:mappl10n.options.mapbox,attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://www.mapbox.com/about/maps" target="_blank">© Mapbox<a/>','<a href="https://www.openstreetmap.org/about/" target="_blank">© OpenStreetMap</a>'],url:"https://api.mapbox.com/styles/v1/{user}/{mapboxid}/tiles/256/{z}/{x}/{y}{r}?access_token={accessToken}&fresh=true",zoomOffset:0},osm:{attribution:['<a href="https://www.mappresspro.com" target="_blank">MapPress</a>','<a href="https://openstreetmap.org" target="_blank">Map data (c) OpenStreetMap</a>'],url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}}[t.provider],i=U.extend({},e,t);L.tileLayer(e.url,i).addTo(this.map_)}else if(this.map_.setMapTypeId("standard"==t.type?t.id:"roadmap"),t.json){let e=null;try{e=JSON.parse(t.json)}catch(t){mapp.lib.log("Invalid JSON in map style")}this.map_.setOptions({styles:e||null})}else this.map_.setOptions({styles:null})},setView:function(t,e,i){"leaflet"==mappl10n.options.engine?(null==e&&(e=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(t,e,i)):(t=t&&!t.toJSON?{lat:parseFloat(t.lat),lng:parseFloat(t.lng)}:t,e=e?parseInt(e):null,t&&this.map_.setCenter(t),e&&this.map_.setZoom(e))},spinner:function(t){this.div.layout.toggleClass("mapp-busy",t)},toggleLayer:function(t,e){e=void 0!==e?e:null==this.layers_[t].getMap(),U.each(["traffic","bicycling","transit"],((t,e)=>{this.layers_[e].setMap(null)})),e&&this.layers_[t].setMap(this.map_)},toggleSidebar:function(t){this.div.layout.toggleClass("mapp-sidebar-open",t),this.isSidebarOpen=t,setTimeout((()=>this.resize()),100)},togglePois:function(t){t=!!t;for(var e=0;e<this.pois_.length;e++)this.pois_[e].setVisible(t)},toggleView:function(t,e){if("mini"==t){let t=this.div.layout.hasClass("mapp-view-mini"),e=!("inline"==this.layout||!this.poiList)&&this.div.layout.width()<mappl10n.options.mini;return this.div.layout.toggleClass("mapp-view-mini",e),void(e!=t&&this.toggleSidebar(!e))}e=void 0===e?!this.div.layout.hasClass("mapp-view-"+t):e,this.div.layout.toggleClass("mapp-view-"+t,e),"list"==t&&e&&this.renderList(),"menu"==t&&e&&this.renderMenu(),"directions"==t&&this.resize()},toJSON:function(){this.pois=[];for(var t=0;t<this.pois_.length;t++)this.pois.push(this.pois_[t].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,postid:this.postid,search:this.search,title:this.title,width:this.width,zoom:this.zoom}}}},282:()=>{window.mapp=window.mapp||{},mapp.Icons={},mapp.Icons.get=function(t){var e=mapp.Icons.getUrl(t);return"leaflet"==mappl10n.options.engine?L.icon({iconUrl:e,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:e}},mapp.Icons.getUrl=function(t){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"}},689:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Infobox=function(e,i){this.map=e,this.anchorPoint=null,this.fudge=30,this.isOpen=!1,this.mapDiv="leaflet"==mappl10n.options.engine?e.getContainer():e.getDiv(),this.node=null,this.opts=_.extend({clip:!0,pan:!0},i),this.overlayView=null,this.position=null,this.size=null,this.wrapper=null,this.wrapper=t('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib-content"><div class="mapp-ib" tabindex="0"></div><div class="mapp-ib-tip"></div></div></div>'),this.wrapper.addClass(i.className),this.node=t(".mapp-ib-content",this.wrapper),"leaflet"==mappl10n.options.engine?mapp.event.addListener(this.map,"move",(t=>{this.isOpen&&this.draw()})):(this.overlayView=new google.maps.OverlayView,this.overlayView.onAdd=function(){},this.overlayView.setMap(this.map),this.overlayView.draw=()=>{this.isOpen&&this.draw()}),this.node.get(0).addEventListener("load",(()=>{"leaflet"==mappl10n.options.engine?this.open({position:this.position,anchorPoint:this.anchorPoint}):mapp.event.addListenerOnce(this.map,"panend",(t=>{this.open({position:this.position,anchorPoint:this.anchorPoint})}))}),{capture:!0});var s="leaflet"==mappl10n.options.engine?this.map.getContainer():this.map.getDiv();this.wrapper.appendTo(s),"leaflet"==mappl10n.options.engine&&e.on("load",(()=>{L.DomEvent.disableClickPropagation(this.wrapper.get(0))}))},mapp.Infobox.prototype={close:function(){this.isOpen=!1,this.wrapper&&this.wrapper.removeClass("mapp-open")},draw:function(){if(document.fullscreenElement||this.map.isFullscreen)return;if(!this.position)return;let t,e,i;if(t=this.node.outerWidth(),e=this.node.outerHeight(),"leaflet"==mappl10n.options.engine)i=this.map.latLngToContainerPoint(this.position);else{const t=this.overlayView.getProjection();if(!t)return;i=t.fromLatLngToContainerPixel(this.position)}this.wrapper.css({left:i.x-t/2+this.anchorPoint.x,bottom:this.mapDiv.clientHeight-i.y-this.anchorPoint.y})},getContent:function(){return t(".mapp-ib",this.node)},open:function(t){this.position=t.position,this.anchorPoint=t.anchorPoint?t.anchorPoint:{x:0,y:0},this.wrapper.addClass("mapp-open"),this.wrapper.css({left:0,bottom:0,width:"auto",height:"auto"}),this.wrapper.css({width:this.node.outerWidth(),height:this.node.outerHeight()}),this.draw(),this.pan(),this.isOpen=!0},pan:function(){const e=this.node.outerWidth(),i=this.node.outerHeight(),s=t(this.mapDiv).width(),n=t(this.mapDiv).height();if("leaflet"==mappl10n.options.engine)var o=this.map.latLngToContainerPoint(this.position);else{var a=this.overlayView.getProjection();o=a?a.fromLatLngToContainerPixel(this.position):null}if(!o)return;var l={x:o.x,y:o.y};o.x+e/2+this.anchorPoint.x>s-this.fudge?l.x=Math.max(s-e/2-this.anchorPoint.x-this.fudge,s/2-this.anchorPoint.x):o.x-e/2+this.anchorPoint.x<this.fudge&&(l.x=Math.min(e/2+this.anchorPoint.x+this.fudge,s/2-this.anchorPoint.x)),o.y+this.anchorPoint.y-i<this.fudge&&(l.y=i-this.anchorPoint.y+this.fudge),l.y>=n&&(l.y=n-this.fudge);const p={x:o.x-l.x,y:o.y-l.y};p.x<=-1||p.x>=1||p.y<=-1||p.y>=1?"leaflet"==mappl10n.options.engine?this.map.panBy([p.x,p.y]):(mapp.event.addListenerOnce(this.map,"idle",(t=>{mapp.event.trigger(this.map,"panend")})),this.map.panBy(p.x,p.y)):mapp.event.trigger(this.map,"panend")},setContent:function(e){t(".mapp-ib",this.node).empty().append(e)}}},628:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.lib={ajax:function(e){var i=this,s={callback:null,data:null,dataType:"json",silent:!1,type:"GET",url:mappl10n.options.ajaxurl,success:function(t,s,n){"json"==e.dataType&&e.url==mappl10n.options.ajaxurl&&"OK"!=t.status&&i.alert(t.status),"json"==e.dataType&&t.output?i.alert("AJAX Invalid Output\r\n"+t.output):e.callback&&e.callback(t,n)},error:function(t,s,n){"cancel"!=s&&(void 0!==n&&""!=n&&i.alert("AJAX ERROR\r\nTextStatus="+s+"\r\nError="+n+"\r\nResponseText="+t.responseText),e.callback&&e.callback(null))}};return e=t.extend(s,e),t.ajax(e)},alert:function(t){mappl10n.options.admin||mappl10n.options.debug?alert(t):window.console&&console.error(t)},jqVersionCheck:function(e){if(void 0===t||void 0===e)return!1;e=e.split("."),v=t.fn.jquery.split(".");for(var i=0;i<e.length;i++){var s=parseInt(e[i]),n=void 0!==v[i]?parseInt(v[i]):0;if(n!=s)return n>s}return!0},log:function(t){window.console&&console.error(t)},scrollTo:function(t,e,i){if(t&&e&&t.length&&e.length){var s=t.height(),n=e.outerHeight(!0),o=t.scrollTop(),a=o+e.position().top,l=a+n;a=a-s/2-n/2,i&&(a-=i.outerHeight(!0)),(a<o||l>o+s)&&t.scrollTop(a)}},template:function(e,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[e]){var s=mappl10n.options.templates?mappl10n.options.template[e]:t("#mapp-tmpl-"+e).html();if(!s)return"";mapp.lib.templates[e]=_.template(s,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g})}return mapp.lib.templates[e](i)},uniqid:function(){return void 0===mapp.lib.uniqidCounter?mapp.lib.uniqidCounter=0:mapp.lib.uniqidCounter++,mapp.lib.uniqidCounter}},mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+t.fn.jquery),jQuery,"leaflet"==mappl10n.options.engine&&"undefined"!=typeof L&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(1e6*this.lat)/1e6+", "+Math.round(1e6*this.lng)/1e6}),mapp.event={addListener:function(t,e,i){e=e.split(" ");for(var s=0;s<e.length;s++)"leaflet"==mappl10n.options.engine?t.on(e[s],i):google.maps.event.addListener(t,e[s],i)},addListenerOnce:function(t,e,i){e=e.split(" ");for(var s=0;s<e.length;s++)"leaflet"==mappl10n.options.engine?t.once(e[s],i):google.maps.event.addListenerOnce(t,e[s],i)},clearInstanceListeners:function(t){"leaflet"==mappl10n.options.engine?t.off():google.maps.event.clearInstanceListeners(t)},clearListeners:function(t,e){e=e.split(" ");for(var i=0;i<e.length;i++)"leaflet"==mappl10n.options.engine?t.off(e[i]):google.maps.event.clearListeners(t,e[i])},trigger:function(t,e,i){"leaflet"==mappl10n.options.engine?t.fire(e,i):google.maps.event.trigger(t,e,i)}},function(t){mapp.lib.Modal=function(){this.el=null;var e=this;this.el=t('<div class="mapp-modal" tabindex="0">').append('<div class="mapp-modal-backdrop">').append('<div class="mapp-modal-content" tabindex="1">'),this.el.hide(),this.el.on("click",".mapp-modal-backdrop",(function(){e.close()})),this.el.on("click",".mapp-modal-close",(function(){e.close()})),this.el.on("keydown",(function(t){27==t.which&&e.close()}))},mapp.lib.Modal.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.el.hide(),t("body").removeClass("mapp-modal-noscroll"))},focus:function(){t(".mapp-modal-focus",this.el).attr("tabindex",0),t(".mapp-modal-focus",this.el).focus()},open:function(){if(!this.el.parent().length){const e=t("body",window.parent.document);this.el.appendTo(e)}this.el.show(),t("body").addClass("mapp-modal-noscroll"),this.focus()},setContent:function(e){t(".mapp-modal-content",this.el).empty(),t(".mapp-modal-content",this.el).append('<div class="mapp-modal-close">×').append(e),this.focus()}}}(jQuery)},692:()=>{window.mapp=window.mapp||{},jQuery,mapp.load=function(){if("undefined"!=typeof mapp&&mapp.data)for(;mapp.data.length;){var t=mapp.data.pop();window[t.name]=new mapp.Map(t),window[t.name].display()}},mapp.load()},436:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Marker=function(t){this.anchorPoint=null,this.div=null,this.draggable=null,this.icon=null,this.map=null,this.position=null,this.visible=null,this.zIndex=0,this.setValues(t),this.overlayView=new google.maps.OverlayView,this.overlayView.draw=()=>this.draw(),this.overlayView.onAdd=()=>this.onAdd(),this.overlayView.onRemove=()=>this.onRemove()},mapp.Marker.prototype={draw:function(){if(!this.div||!this.icon)return;let e=this.overlayView.getProjection();if(e){let i=e.fromLatLngToDivPixel(this.position),s=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};t(this.div).css({left:i.x-s.width/2,top:i.y-s.height})}},getDiv:function(){return this.div},getDraggable:function(){return this.draggable},getMap:function(){return this.map},getPosition:function(){return this.position},getVisible:function(){return this.visible},handleEvent:function(t){let e="on"+t.type[0].toUpperCase()+t.type.slice(1);this[e]&&this[e](t)},onAdd:function(){let e=this.overlayView.getPanes();e&&(this.div=t('<div class="mapp-marker">'),this.div.appendTo(e.overlayMouseTarget),this.icon&&this.setIcon(),google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.div.get(0)),this.div.get(0).addEventListener("click",(()=>{(!this.dragging||this.dragging&&!this.dragging.moved)&&mapp.event.trigger(this,"click"),this.dragging=null})),this.div.get(0).addEventListener("mouseenter",this),this.div.get(0).addEventListener("mouseleave",this),this.setDraggable(this.draggable))},onMouseenter:function(t){mapp.event.trigger(this,"mouseover")},onMouseleave:function(t){mapp.event.trigger(this,"mouseout")},onPointerdown:function(t){const e=this.map.getDiv().getBoundingClientRect(),i=this.overlayView.getProjection().fromLatLngToContainerPixel(this.position);this.dragging={moved:!1,startPixel:{x:t.clientX,y:t.clientY},offset:{x:i.x-(t.clientX-e.left),y:i.y-(t.clientY-e.top)}},this.toggleDragEvents(!0)},onPointermove:function(t){if(Math.abs(t.clientX-this.dragging.startPixel.x)+Math.abs(t.clientY-this.dragging.startPixel.y)<3)return;const e=this.map.getDiv().getBoundingClientRect();let i={x:t.clientX-e.left+this.dragging.offset.x,y:t.clientY-e.top+this.dragging.offset.y};this.setPosition(this.overlayView.getProjection().fromContainerPixelToLatLng(i)),this.draw(),this.dragging.moved=!0,mapp.event.trigger(this,"dragstart")},onPointercancel:function(t){this.onPointerup(t)},onPointerup:function(t){this.dragging&&this.dragging.moved&&mapp.event.trigger(this,"dragend"),this.toggleDragEvents(!1)},onRemove:function(){this.div&&(this.toggleDragEvents(!1),this.div.remove(),this.div=null)},set:function(t,e){let i="set"+t[0].toUpperCase()+t.slice(1);this[i]&&this[i](e)},setDraggable:function(t){this.draggable=t,this.map&&(this.div.get(0).removeEventListener("pointerdown",this,{passive:!0}),t&&this.div.get(0).addEventListener("pointerdown",this,{passive:!0}))},setIcon:function(t){if(void 0!==t&&(this.icon=t),this.icon&&this.div){let t='<img draggable="false" src="'+this.icon.url+'">';this.div.html(t);let e=this.icon.scaledSize?this.icon.scaledSize:{width:32,height:32};this.div.css({width:e.width,height:e.height}),this.setZIndex(),this.draw()}},setMap:function(t){this.map=t,this.overlayView.setMap(t)},setPosition:function(t){this.position=t},setValues:function(t){for(const e in t)this.set(e,t[e])},setVisible:function(t){this.visible=t,this.div&&this.div.css("visibility",t?"visible":"hidden")},setZIndex:function(t){this.zIndex=void 0!==t?t:this.zIndex,this.div&&this.div.css("z-index",t)},toggleDragEvents(t){document.removeEventListener("pointermove",this,{passive:!0}),document.removeEventListener("pointerup",this,{passive:!0}),document.removeEventListener("pointercancel",this,{passive:!0}),t&&(document.addEventListener("pointermove",this,{passive:!0}),document.addEventListener("pointerup",this,{passive:!0}),document.addEventListener("pointercancel",this,{passive:!0}))}}},548:()=>{var t;window.mapp=window.mapp||{},t=jQuery,mapp.Poi=function(e){if(this.defaults={address:null,body:null,html:null,iconid:null,kml:null,map:null,overlay:null,postid:null,props:null,title:"",url:null,type:null,viewport:null},t.extend(this,this.defaults,e),e&&e.correctedAddress&&(this.address=e.correctedAddress),"leaflet"==mappl10n.options.engine&&this.isPoly()&&(this.type=null),e.viewport&&e.viewport.sw&&e.viewport.ne&&e.viewport.sw.lat){var i=e.viewport.sw,s=e.viewport.ne;"leaflet"==mappl10n.options.engine?this.viewport=new L.LatLngBounds(L.latLng(i.lat,i.lng),L.latLng(s.lat,s.lng)):this.viewport=new google.maps.LatLngBounds(new google.maps.LatLng(i.lat,i.lng),new google.maps.LatLng(s.lat,s.lng))}var n=[],o=[];if(!e.overlay)switch(this.type){case"polygon":if(e.poly&&e.poly.paths)for(var a=0;a<e.poly.paths.length;a++){n=[];for(var l=0;l<e.poly.paths[a].length;l++)n.push(new google.maps.LatLng(e.poly.paths[a][l].lat,e.poly.paths[a][l].lng));o.push(new google.maps.MVCArray(n))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)}),this.setColors(e.poly);break;case"polyline":if(e.poly&&e.poly.path)for(a=0;a<e.poly.path.length;a++)n.push(new google.maps.LatLng(e.poly.path[a].lat,e.poly.path[a].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(n)}),this.setColors(e.poly);break;case"circle":var p=new google.maps.LatLng(e.point.lat,e.point.lng);this.overlay=new google.maps.Circle({center:p,radius:parseFloat(e.poly.radius)}),this.setColors(e.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport}),this.setColors(e.poly);break;case"kml":var r=e.kml&&e.kml.url?e.kml.url:"";this.overlay="leaflet"==mappl10n.options.engine?omnivore.kml(r):new google.maps.KmlLayer({url:r,preserveViewport:!0,suppressInfoWindows:!0});break;default:"leaflet"==mappl10n.options.engine?this.overlay=L.marker([e.point.lat,e.point.lng]):this.overlay=new mapp.Marker({position:new google.maps.LatLng(e.point.lat,e.point.lng)})}e.type||this.set({iconid:e.iconid})},mapp.Poi.prototype={center:function(t){var e=this.getBounds();if("number"!=typeof t)if(e){var i=e.getNorthEast().toJSON().lng-e.getSouthWest().toJSON().lng;i<0&&(i+=360),t=Math.round(Math.log(360*this.map.div.canvas.width()/i/256)/Math.LN2),this.map.setView(this.getPosition(),t,{animate:!1})}else this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));else this.map.setView(this.getPosition(),t)},getAddress:function(){return this.address?this.address:this.getPosition().toUrlValue()},getAnchorPoint:function(t){switch(this.isPoly()?"poly":this.type){case"kml":return t&&t.pixelOffset?{x:t.pixelOffset.width,y:t.pixelOffset.height}:{x:0,y:0};case"poly":return{x:0,y:0};default:return mappl10n.options.iconScale&&mappl10n.options.iconScale[0]&&mappl10n.options.iconScale[1]?{x:0,y:0-mappl10n.options.iconScale[1]}:{x:0,y:-32}}},getBounds:function(){var t;switch(this.type){case"polyline":t=new google.maps.LatLngBounds,this.overlay.getPath().forEach((function(e){t.extend(e)}));break;case"polygon":t=new google.maps.LatLngBounds,this.overlay.getPaths().forEach((function(e){e.forEach((function(e){t.extend(e)}))}));break;case"rectangle":case"circle":t=this.overlay.getBounds();break;case"kml":t=(t="leaflet"==mappl10n.options.engine?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport())||this.viewport;break;default:return this.viewport}return t},getColors:function(){var t={};for(var e in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})void 0!==this.overlay[e]&&(t[e]=this.overlay[e]);return t},getPosition:function(t){if(!this.type)return"leaflet"==mappl10n.options.engine?this.overlay.getLatLng():this.overlay.getPosition();if("kml"==this.type&&t&&t.latLng)return t.latLng;const e=this.getBounds();return"leaflet"==mappl10n.options.engine?e&&e.isValid()?e.getCenter():new L.latLng(0,0):e?e.getCenter():new google.maps.LatLng(0,0)},getTemplateColors:function(){var t=this.getColors();return"polyline"==this.type?{color:t.strokeColor,opacity:100*t.strokeOpacity,weight:t.strokeWeight}:{color:t.fillColor,opacity:100*t.fillOpacity,weight:t.strokeWeight}},highlight:function(e){if(!this.type){var i="leaflet"==mappl10n.options.engine?t(this.overlay._icon):this.overlay.getDiv();if(i){switch(this.editable?"circle":mappl10n.options.highlight){case"circle":i.toggleClass("mapp-marker-circle",e);break;case"icon":var s=e?mapp.Icons.get(mappl10n.options.highlightIcon):mapp.Icons.get(this.iconid);if("leaflet"==mappl10n.options.engine&&this.overlay.getIcon().options.iconUrl==s.options.iconUrl)return;this.overlay.setIcon(s);break;case"scale":i.addClass("mapp-marker"),i.toggleClass("mapp-marker-scale",e)}this.setZIndex(e?1e4:0)}}},isPoly:function(){return-1!=jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])},open:function(t){this.map.poiOpen(this,t)},fetchPost:function(t){this.html?t():mapp.lib.ajax({type:"GET",data:{action:"mapp_get_post",postid:this.postid,nonce:mappl10n.options.nonce},dataType:"html",callback:e=>{this.html=e,t()}})},render:function(t,e){var i={};return i=_.extend(i,this,{icon:mapp.Icons.getUrl(this.iconid)}),e&&(i.body=e.description,i.title=e.name),i.thumbnail=mappl10n.options.thumbsPopup&&"popup"==t||mappl10n.options.thumbsList&&"item"==t?i.thumbnail:null,mapp.lib.template(this.map.templates[t],{poi:i,colors:this.getTemplateColors()})},set:function(t){for(var e in t){var i=t[e];switch(e){case"dirty":this.map.set({dirty:i});break;case"iconid":this.type||(this.iconid=i,this.overlay.setIcon(mapp.Icons.get(i)));break;default:this[e]=i}}this.map&&"undefined"!=typeof dirty&&this.map.set({dirty})},setColors:function(t){var e={};for(var i in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})t&&void 0!==t[i]&&(e[i]=t[i]);this.overlay.setOptions(e)},setEditable:function(t){var e=this;"kml"!=this.type&&("leaflet"==mappl10n.options.engine?this.overlay.options.draggable=t:this.overlay.setDraggable(t),this.isPoly()&&this.overlay.setEditable(t),mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay,"dragstart"),t&&(mapp.event.addListener(this.overlay,"dragstart",(function(){e.viewport=null,e.map.poiClose()})),mapp.event.addListener(this.overlay,"dragend",(function(){e.map.set({dirty:!0})})),"polygon"!=this.type&&"polyline"!=this.type||"leaflet"!=mappl10n.options.engine&&(mapp.event.addListener(this.overlay,"rightclick",(function(t){null!=t.vertex&&e.overlay.getPath().getLength()>2&&e.overlay.getPath().removeAt(t.vertex)})),mapp.event.clearListeners(this.overlay.getPath(),"insert_at remove_at set_at"),mapp.event.addListener(this.overlay.getPath(),"insert_at remove_at set_at",(function(){e.map.set({dirty:!0})})))))},setMap:function(t){var e=this;this.map=t,mapp.event.clearInstanceListeners(this.overlay),null!=t?("kml"==this.type&&("leaflet"==mappl10n.options.engine?(mapp.event.addListenerOnce(this.overlay,"ready",(()=>{this.viewport=this.overlay.getBounds()})),mapp.event.addListenerOnce(this.overlay,"error",(()=>{alert(mappl10n.kml_error+" : "+this.kml.url)}))):(mapp.event.addListener(this.overlay,"defaultviewport_changed",(()=>{this.viewport=this.overlay.getDefaultViewport()})),mapp.event.addListener(this.overlay,"status_changed",(()=>{"OK"!=this.overlay.getStatus()&&alert(mappl10n.kml_error+" : "+this.kml.url)})))),this.setEditable(this.map.editable),!this.type&&this.map.clusterer||("leaflet"==mappl10n.options.engine?this.overlay.addTo(t.getMap()):this.overlay.setMap(t.getMap())),mapp.event.addListener(this.overlay,"click",(function(t){e.open(t)})),mapp.event.addListener(this.overlay,"mouseover",(function(t){e.map.poiHover(e)})),mapp.event.addListener(this.overlay,"mouseout",(function(t){e.map.poiHover(null)}))):"leaflet"==mappl10n.options.engine?this.overlay.remove():this.overlay.setMap(null)},setTemplateColors:function(t){let{color:e,opacity:i,weight:s}=t;i=i?i/100:void 0;var n="polyline"==this.type?{strokeColor:e,strokeOpacity:i,strokeWeight:s}:{fillColor:e,fillOpacity:i,strokeColor:e,strokeWeight:s,strokeOpacity:1};this.setColors(n)},setVisible:function(t){void 0!==this.overlay.setVisible&&this.overlay.setVisible(t)},setZIndex:function(t){"leaflet"==mappl10n.options.engine?this.type||this.overlay.setZIndexOffset(t):this.overlay.set("zIndex",t)},toJSON:function(){var t={address:this.address,body:this.body,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},e=this.getPosition();t.point=e.toJSON();var i=this.viewport?this.viewport:this.getBounds();if(i){var s=i.toJSON();t.viewport={sw:{lat:s.south,lng:s.west},ne:{lat:s.north,lng:s.east}}}if("kml"==this.type&&(t.kml=this.kml),this.isPoly())switch(t.poly=this.getColors(),this.type){case"circle":t.poly.radius=this.overlay.getRadius();break;case"polyline":t.poly.path=[],this.overlay.getPath().forEach((function(e){t.poly.path.push(e.toJSON())}));break;case"polygon":t.poly.paths=[],this.overlay.getPaths().forEach((function(e){var i=[];e.forEach((function(t){i.push(t.toJSON())})),t.poly.paths.push(i)}));break;case"rectangle":var n=this.overlay.getBounds();t.viewport={sw:n.getSouthWest().toJSON(),ne:n.getNorthEast().toJSON()}}return t}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(628),i(658),i(282),i(689),i(436),i(548),i(692)})();
|
build/index_mappress_admin.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(()=>{var e={844:()=>{const e=wp.element.createElement,{Fragment:t,useEffect:a,useLayoutEffect:o,useRef:i,useState:n}=wp.element,{Button:s,Modal:l}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(t){const[o,i]=n({isOpen:!1,reason:"",reasonText:"",redirectUrl:null});function r(e){i((t=>({...t,...e})))}function p(e,t){switch(e){case"cancel":r({isOpen:!1});break;case"submit":r({isOpen:!1}),window.location.href=o.redirectUrl+"&mapp_reason="+o.reason+"&mapp_reason_text="+encodeURIComponent(o.reasonText.trim())}}return a((()=>{const e=jQuery("#deactivate-mappress-google-maps-for-wordpress");e.length&&(e.off("click.mapp"),e.on("click.mapp",(function(){return function(e){const t=e?jQuery(e).attr("href"):null;t&&r({isOpen:!0,redirectUrl:t})}(this),!1})))}),[]),o.isOpen?e(l,{isDismissible:!0,onRequestClose:()=>p("cancel"),shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:__("Feedback")},function(){const t=!o.reason||"other"==o.reason&&!o.reasonText;return sprintf("<a href='https://mappresspro.com/chris-contact' target='_blank'>%s</a>",__("contact me")),e("div",{className:"mapp-deactivate"},e("div",{className:"mapp-deactivate-content"},e("h2",null,__("Sorry to see you go! Need help?"),e(s,{className:"mapp-deactivate-help",isSecondary:!0,href:"https://mappresspro.com/chris-contact",target:"_blank"},__("Contact me"))),e("h2",null,__("If not, I'd really appreciate some feedback:")),function(){const t=[{value:"badday",label:__("I'm just having a bad day")},{value:"notworking",label:__("The plugin isn't working"),placeholder:__("What didn't work? Was there an error message?")},{value:"toohard",label:__("Too hard to use"),placeholder:__("How can I make it easier?")},{value:"feature",label:__("Missing feature"),placeholder:__("What's missing?")},{value:"other",label:__("Other"),placeholder:__("Can you provide any details?")}];return e("div",{className:"mapp-deactivate-reasons"},_.map(t,(t=>{const a=t.value==o.reason;return e("div",{className:"mapp-deactivate-reason",key:t.value},e("label",null,e("input",{checked:a,onChange:e=>r({reason:e.target.value}),type:"radio",value:t.value}),t.label),a&&t.placeholder&&e("div",null,e("textarea",{onChange:e=>r({reasonText:e.target.value}),placeholder:t.placeholder,value:o.reasonText})))})))}()),e("div",{className:"mapp-deactivate-footer"},e(s,{isSecondary:!0,disabled:t,onClick:()=>p("submit")},__("Deactivate")),e(s,{isPrimary:!0,onClick:()=>p("cancel")},__("Cancel"))))}()):null}jQuery(document).ready((function(){const t=jQuery("<div></div>").appendTo("body").get(0);wp.element.render(e(r),t)}))},215:(e,t,a)=>{"use strict";a.r(t);var o=a(525),i=a(143);window.mapp=window.mapp||{};const n=wp.element.createElement;var s;s=jQuery,mapp.Editor=function(e){this.drawingManager=null,this.map=e,this.poiEditor=null;var t=this;this.initialize=function(){this.map.display(),this.poiEditor=new mapp.PoiEditor(this.map),this.initDrawingManager(),s(this.map.places).off("search.mapp"),s(this.map.places).on("search.mapp",(function(e,a){t.insert(a)}))},this.insert=function(e){if(e)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),e.geometry){var a=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,o=e.name==a?"":a,i=new mapp.Poi({address:a,body:o,iconid:this.poiEditor.lastIcon,point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null});this.map.poiInsert(i),i.center()}else e.overlay?(this.map.poiHover(null),"marker"==e.type?(i=new mapp.Poi({body:"",iconid:null,overlay:null,point:e.overlay.getPosition().toJSON(),title:e.overlay.getPosition().toUrlValue(6),type:null}),e.overlay.setMap(null)):i=new mapp.Poi({body:"",iconid:null,overlay:e.overlay,title:mappl10n.shape,type:e.type}),this.map.poiInsert(i)):"string"==typeof e&&"http"==e.substring(0,4)&&(i=new mapp.Poi({iconid:this.poiEditor.lastIcon,kml:{url:e},title:"KML",type:"kml"}),t.map.poiInsert(i),mapp.event.addListenerOnce(i.overlay,"ready defaultviewport_changed",(function(){i.center()})))},this.initDrawingManager=function(){var e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};"leaflet"==mappl10n.options.engine||google.maps.drawing&&(this.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),this.drawingManager.setMap(this.map.getMap()),mapp.event.addListener(this.drawingManager,"overlaycomplete",(function(e){t.drawingManager.get("drawingMode")&&t.insert(e)})))},this.initialize.apply(this)},mapp.PoiEditor=function(e){this.map=e,this.poi=null,this.sel=null,this.lastIcon=null;var t=this;this.initialize=function(){this.sel=s(this.map.iw.getContent()),s(this.map).on("mapp.open",(function(e,a){t.render(a)})),s(this.map).on("mapp.close",(function(){t.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(e){e.preventDefault();var a=s(this).attr("data-mapp-poi");t[a]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(e){var a=s(this).hasClass("mapp-poi-visual");t.mce(a)})),this.sel.on("keydown",(function(e){13==e.which&&"mapp-poi-body"!=e.target.id&&(e.preventDefault(),t.save())}))},this.cancel=function(){this.map.poiClose()},this.initMCE=function(){if("undefined"!=typeof tinyMCE&&void 0!==tinyMCE.init){var e="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var t=window.tinyMCEPreInit.mceInit.content;e=void 0!==t.language?t.language:"en"}var a={mode:"none",height:"100%",convert_urls:!1,language:e,menubar:!1,plugins:"image,paste,textcolor,wordpress,wpeditimage,wplink,wpview",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(a),this.mce(!0)}},this.mce=function(e){var a=e?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(a,!1,"mapp-poi-body"),s(".mapp-poi-visual, .mapp-poi-html",t.sel).removeClass("mapp-active"),e?s(".mapp-poi-visual",t.sel).addClass("mapp-active"):s(".mapp-poi-html",t.sel).addClass("mapp-active")},this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.poiClose(),this.map.poiRemove(this.poi))},this.render=function(e){this.poi=e,this.renderColorPicker(this.poi),this.renderIconPicker(this.poi),this.initMCE()},this.renderColorPicker=function(e){document.getElementById("mapp-poi-colorpicker")&&wp.element.render(n(o.MappColorPicker,{...e.getTemplateColors(),isExtended:!0,onChange:t=>{e.set({dirty:!0}),e.setTemplateColors(t),this.map.renderList(),this.renderColorPicker(e)}}),document.getElementById("mapp-poi-colorpicker"))},this.renderIconPicker=function(e){document.getElementById("mapp-poi-iconpicker")&&wp.element.render(n(i.MappIconPicker,{iconid:e.iconid,onChange:t=>{e.set({dirty:!0,iconid:t}),this.lastIcon=t,this.map.renderList(),this.renderIconPicker(e)}}),document.getElementById("mapp-poi-iconpicker"))},this.save=function(){"undefined"!=typeof tinyMCE&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save(),this.poi.set({dirty:!0,title:s(".mapp-poi-title").val(),body:s(".mapp-poi-body").val()}),this.map.renderList(),this.map.poiClose()},this.initialize.apply(this)}},713:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>m});const o=wp.element.createElement,{addQueryArgs:i}=wp.url,{useCallback:n,useEffect:s,useState:l}=wp.element,{Button:r,Dropdown:p,Spinner:c,TextControl:d}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function m(e){const[t,a]=l({isFetching:!1,results:[],search:"",searchTerm:""});function r(e){a((t=>({...t,...e})))}s((()=>{t.isOpen&&(r({isFetching:!0}),wp.apiFetch({path:i("/wp/v2/search",{search:t.search,per_page:20})}).then((e=>{r({results:e,isFetching:!1})})))}),[t.search,t.isOpen]);const m=n(_.debounce((function(e){r({search:e})}),1e3),[]);function u(a,i){return o("div",{className:"mapp-attach-control"},o("div",{className:"mapp-attach-control-toolbar"},o(d,{autoComplete:"false",value:t.searchTerm,onChange:e=>{r({searchTerm:e}),m(e)},placeholder:__("Search")})),function(){if(t.isFetching)return o(c,null);if(t.results)return t.results.length?o("div",{className:"mapp-attach-items"},t.results.map((t=>o("div",{key:t.id,className:"mapp-attach-item",onClick:()=>{e.onChange(t.id,t.title)}},o("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),o("div",{className:"mapp-attach-item-type"},t.subtype))))):o("div",{},__("No posts found"))}())}return o("div",{onClick:e=>e.stopPropagation()},o(p,{onToggle:e=>r({isOpen:e}),renderToggle:e=>{let{isOpen:t,onToggle:a}=e;return o("a",{href:"#",onClick:a},__("Attach"))},renderContent:e=>{let{isOpen:t,onToggle:a}=e;return u()}}))}},525:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappColorPicker:()=>M});var o=a(824);const i=wp.element.createElement,{Fragment:n,useEffect:s,useLayoutEffect:l,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:d}=wp.data,{withState:m}=wp.compose,{Button:u,ColorPalette:h,ColorPicker:g,Dashicon:f,Dropdown:b,ExternalLink:y,Modal:v,Panel:k,PanelBody:w,PanelRow:C,Popover:x,RadioControl:S,Spinner:N,TabPanel:O}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function M(e){const[t,a]=c({isCustomOpen:!1,isOpen:!1});function l(e){a((t=>({...t,...e})))}function r(t,a){switch(t){case"close":l({isOpen:!1});break;case"open":l({isOpen:!0});break;case"select":e.onChange(a),r("close");break;case"set":e.onChange(a)}}return s((()=>{}),[]),i(n,null,i("span",{className:"mapp-colors-toggle",onClick:()=>r("open",null),style:{backgroundColor:e.color,border:e.isExtended?"1px solid "+e.color:"1px solid gray",opacity:e.isExtended&&e.opacity?e.opacity/100:1},tabIndex:0}),function(){if(!t.isOpen)return null;const a=_.map([100,90,80,70,60,50,40,30,20,10,0],(e=>({label:e+"%",value:e}))),n=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(e=>({label:e+"px",value:e})));return i(v,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:e=>r("close")},i("div",{className:"mapp-colors"},i("div",{className:"mapp-colors-list"},_.map([["yellow","yellowgreen","green","seagreen","blue","cornflowerblue","darkslateblue","purple","firebrick","red","darkorange","orange","saddlebrown"],["lightyellow","greenyellow","lightgreen","darkseagreen","lightblue","skyblue","slateblue","orchid","plum","pink","sandybrown","goldenrod","peru"],["white","lightgray","gray","black"]],((t,a)=>i("div",{key:a},_.map(t,(t=>i("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:()=>{l({isCustomOpen:!1}),r("select",{color:t})},style:{backgroundColor:t},title:t}))))))),t.isCustomOpen&&i(g,{color:e.color,onChangeComplete:e=>r("set",{color:e.hex}),disableAlpha:!0}),e.isExtended&&i(o.Select,{label:__("Opacity"),options:a,value:e.opacity?e.opacity:"",onChange:e=>r("set",{opacity:e})}),e.isExtended&&i(o.Select,{label:__("Stroke"),options:n,value:e.weight?e.weight:"",onChange:e=>r("set",{weight:e})}),i("div",{className:"mapp-colors-toolbar"},i(u,{isPrimary:!0,onClick:()=>r("close")},__("Done")),i(u,{onClick:()=>l({isCustomOpen:!t.isCustomOpen})},__("Custom color")))))}())}},371:(e,t,a)=>{"use strict";a.r(t);var o=a(477);wp&&wp.plugins&&wp.plugins.registerPlugin&&wp.editPost&&wp.plugins.registerPlugin("mappress-document-settings-panel",{render:function(){const{PluginDocumentSettingPanel:e}=wp.editPost,t=wp.element.createElement,{Fragment:a,useEffect:i,useLayoutEffect:n,useRef:s,useState:l}=wp.element,{Button:r,Spinner:p}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),[c,d]=l({isFetchingItems:!0,isPickerOpen:!1,items:null,pickerMapid:null,pickerMode:"list"});function m(e){d((t=>({...t,...e})))}function u(e,t){switch(e){case"open-library":m({isPickerOpen:!0,pickerMode:"list"});break;case"edit":m({isPickerOpen:!0,pickerMapid:t,pickerMode:"edit"});break;case"pick-close":m({isPickerOpen:!1,pickerMapid:null});break;case"pick-insert":const e=wp.blocks.createBlock("mappress/map",{mapid:t});wp.data.dispatch("core/block-editor").insertBlock(e,0),m({isPickerOpen:!1,pickerMapid:null})}}function h(e){let a=e.map_title?e.map_title:__("Untitled");return t("div",{className:"mapp-document-item",key:e.mapid+e.postid},t("a",{className:"mapp-document-col-map_title",href:"#",onClick:t=>u("edit",e.mapid)},a),t("div",{className:"mapp-document-col-mapid"},e.mapid))}return i((()=>{const e=e=>{m({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)})),i((()=>{mapp.store.fetchItems()}),[]),t(e,{title:"MapPress",className:"mapp-document-panel"},function(){const e=_.filter(c.items,(e=>e.postid==mappl10n.options.postid));let o;return o=c.isFetchingItems?t(p,null):e.length?t(a,null,t("div",{className:"mapp-document-header"},t("div",{className:"mapp-document-col-map_title"},__("Map title")),t("div",{className:"mapp-document-col-mapid"},null,__("Map ID"))),_.map(e,h)):t("div",{className:"mapp-document-message"},__("No maps found")),t("div",null,t("div",{className:"mapp-document-list"},o))}(),t(r,{icon:"portfolio",isSecondary:!0,onClick:()=>u("open-library")},__("Open map library")),function(){if(c.isPickerOpen)return t(o.default,{mapid:c.pickerMapid,mode:c.pickerMode,onAction:u,type:"post"})}())},icon:null})},999:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>v});var o=a(429),i=a(710);window.mapp=window.mapp||{};const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useRef:p,useState:c}=wp.element,{Button:d,Dropdown:m,Modal:u,Panel:h,PanelBody:g,Popover:f,Spinner:b,TextControl:y}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function v(e){const[t,a]=c({dragging:null,dragover:null,isFetchingMap:!!e.mapid,isPoiListOpen:!0,isSavingMap:!1,map:null,mapdata:null}),s=p(null);function r(e){a((t=>({...t,...e})))}function m(e){r({map:t.map})}function u(a,o){switch(a){case"change-settings":t.map.set(o),r({map:t.map});break;case"change-title":t.map.set({title:o}),r({map:t.map});break;case"close":e.onAction("edit-close");break;case"trash":confirm(mappl10n.delete_map_prompt)&&(mapp.store.trashMap({mapid:e.mapid}),e.onAction("edit-trash"));break;case"save":mapp.store.saveMap({mapdata:t.map.toJSON(),success:t=>{e.onAction("edit-save",t.mapid)}})}}return l((()=>{t.map&&(jQuery(t.map.div.layout).off("mapp.render",m),jQuery(t.map.div.layout).on("mapp.render",(e=>m())))}),[t.map]),l((()=>{const t=t=>{r({isFetchingMap:t.isFetchingMap,isSavingMap:t.isSavingMap,mapdata:t.maps[e.mapid]})};return mapp.store.subscribe(t),()=>mapp.store.unsubscribe(t)})),l((()=>{e.mapid&&mapp.store.fetchMap({mapid:e.mapid})}),[e.mapid]),l((()=>{if(t.isFetchingMap)return;let a={editable:!0,embed:!0,layout:"left",mapOpts:{streetViewControl:!1},menu:!1,name:"media-map",poiList:!1,sel:jQuery(s.current)};"map"!=e.context&&"mashup"!=e.context||(a.center=null,a.zoom=null);const o=new mapp.Map(t.mapdata,a);new mapp.Editor(o);r({map:o})}),[t.mapdata]),l((()=>{t.map&&setTimeout((()=>t.map.resize()),100)}),[t.isPoiListOpen]),n("div",{className:"mapp-edit"},function(){let e=t.map&&!t.isFetchingMap&&t.map.title?t.map.title:"",a=t.map&&!t.isFetchingMap?__("Untitled"):"";return n("div",{className:"mapp-gt-modal-header"},n(y,{className:"mapp-edit-title",placeholder:a,value:e,onChange:e=>u("change-title",e)}))}(),n("div",{className:"mapp-edit-main"},n("div",{className:"mapp-sidebar"+(t.isPoiListOpen?" mapp-sidebar-open":"")},n("div",{className:"mapp-sidebar-toggle",onClick:()=>r({isPoiListOpen:!t.isPoiListOpen})}),n("div",{className:"mapp-list mapp-edit-list"},n("div",{className:"mapp-edit-list-wrapper"},function(){if("mce"!=e.context&&"library"!=e.context)return null;if(!t.map)return null;const{center:a,height:i,poiList:s,search:l,width:r,zoom:p}=t.map;return n("div",{className:"mapp-gt-inspector"},n(o.MappSettings,{map:t.map,context:e.context,onAction:u,center:a,height:i,poiList:s,search:l,width:r,zoom:p}))}(),function(){if(!t.map)return;const e=function(e,a){let o=t.dragging,i=a;t.map.pois_.splice(i,0,t.map.pois_.splice(o,1)[0]),r({map:t.map,dragover:null})};return n("div",{className:"mapp-items"},_.map(t.map.pois_,((a,o)=>n("div",{className:t.dragover==o?"mapp-item mapp-edit-dragover":"mapp-item",draggable:!0,key:o,onClick:()=>t.map.poiOpen(t.map.pois_[o]),onDragOver:e=>e.preventDefault(),onDragStart:e=>r({dragging:o}),onDragEnter:e=>r({dragover:o}),onDragEnd:e=>r({dragging:null,dragover:null}),onDrop:t=>e(t,o)},n("img",{className:"mapp-icon",src:mapp.Icons.getUrl(a.iconid)}),n("div",{className:"mapp-title"},a.title)))))}()))),n("div",{className:"mapp-edit-map",key:e.mapid,ref:s,onKeyDown:e=>e.stopPropagation(),tabIndex:-1}),s.current&&t.map?n(i.m,{map:t.map,selected:t.map.mapTypeId,onChange:e=>u("change-settings",{mapTypeId:e})}):null),n("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:e=>e.stopPropagation()},n(d,{isPrimary:!0,isBusy:t.isSavingMap,onClick:()=>u("save")},__("Save")),n(d,{disabled:t.isSavingMap,onClick:()=>u("close")},__("Cancel")),n(d,{disabled:!e.mapid||t.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:()=>u("trash")},__("Trash"))))}},143:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappIconPicker:()=>O});var o=a(525),i=a(824);const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useCallback:p,useRef:c,useState:d}=wp.element,{useSelect:m}=wp.data,{withState:u}=wp.compose,{Button:h,ColorPicker:g,DropZone:f,DropZoneProvider:b,FormFileUpload:y,Modal:v,Popover:k,RangeControl:w,Spinner:C,TabPanel:x}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),S=[{id:"mapp-shapes",fontFamily:"Marker Shapes",glyphs:[{name:"circle",center:[16,16]},{name:"widepin",center:[16,14]},{name:"route",center:[16,16]},{name:"shield",center:[16,16]},{name:"squarepin",center:[16,15]},{name:"square",center:[16,16]},{name:"squarerounded",center:[16,16]},{name:"roundpin",center:[16,13]},{name:"pin",center:null},{name:"pindot",center:null}]}],N=[{id:"mapp-icons",className:"mapp-marker-icons",filePrefix:"mp",fontFamily:"Marker Icons",label:"Map icons",glyphs:["airport","amusement-park","aquarium","archery","art-gallery","assistive-listening","atm","audio-description","bakery","bank","bar","baseball","beauty-salon","bicycle-store","bicycling","boat-ramp","boat-tour","boating","book-store","bowling-alley","braille","bus-station","cafe","campground","canoe","car-dealer","car-rental","car-repair","car-wash","casino","cemetery","chairlift","church","city-hall","closed-captioning","clothing-store","compass","convenience-store","courthouse","cross-country-skiing","crosshairs","dentist","department-store","diving","doctor","electrician","electronics-store","embassy","expand","female","finance","fire-station","fish-cleaning","fishing-pier","fishing","florist","food","fullscreen","funeral-home","furniture-store","gas-station","contractor","golf","grocery","gym","hair-care","hang-gliding","hardware-store","health","hindu-temple","horse-riding","hospital","ice-fishing","ice-skating","inline-skating","insurance-agency","jet-skiing","jewelry-store","kayaking","laundry","lawyer","library","liquor-store","local-government","location-arrow","locksmith","lodging","low-vision-access","male","marina","mosque","motobike-trail","movie-rental","movie-theater","moving-company","museum","natural-feature","night-club","open-captioning","painter","park","parking","pet-store","pharmacy","physiotherapist","place-of-worship","playground","plumber","point-of-interest","police","political","post-box","post-office","rafting","real-estate-agency","restaurant","roofing-contractor","route","rv-park","sailing","school","scuba-diving","search","shopping-mall","sign-language","skateboarding","ski-jumping","skiing","sledding","snow-shoeing","snow","snowboarding","snowmobile","spa","stadium","storage","store","subway-station","surfing","swimming","synagogue","taxi-stand","tennis","toilet","trail-walking","train-station","transit-station","travel-agency","unisex","university","veterinary-care","viewing","volume-control-telephone","walking","waterskiing","whale-watching","wheelchair","wind-surfing","zoo"]},{id:"material-icons",className:"material-icons",filePrefix:"mi",fontFamily:"Material Icons",label:"Material Icons",glyphs:["ac_unit","access_alarm","access_alarms","access_time","access_time_filled","accessibility","accessibility_new","accessible","accessible_forward","account_balance","account_balance_wallet","account_box","account_circle","account_tree","ad_units","adb","add","add_a_photo","add_alarm","add_alert","add_box","add_business","add_chart","add_circle","add_circle_outline","add_comment","add_ic_call","add_link","add_location","add_location_alt","add_moderator","add_photo_alternate","add_reaction","add_road","add_shopping_cart","add_task","add_to_drive","add_to_home_screen","add_to_photos","add_to_queue","addchart","adjust","admin_panel_settings","ads_click","agriculture","air","airline_seat_flat","airline_seat_flat_angled","airline_seat_individual_suite","airline_seat_legroom_extra","airline_seat_legroom_normal","airline_seat_legroom_reduced","airline_seat_recline_extra","airline_seat_recline_normal","airplane_ticket","airplanemode_active","airplanemode_inactive","airplanemode_off","airplanemode_on","airplay","airport_shuttle","alarm","alarm_add","alarm_off","alarm_on","album","align_horizontal_center","align_horizontal_left","align_horizontal_right","align_vertical_bottom","align_vertical_center","align_vertical_top","all_inbox","all_inclusive","all_out","alt_route","alternate_email","amp_stories","analytics","anchor","android","animation","announcement","aod","apartment","api","app_blocking","app_registration","app_settings_alt","approval","apps","architecture","archive","area_chart","arrow_back","arrow_back_ios","arrow_back_ios_new","arrow_circle_down","arrow_circle_up","arrow_downward","arrow_drop_down","arrow_drop_down_circle","arrow_drop_up","arrow_forward","arrow_forward_ios","arrow_left","arrow_right","arrow_right_alt","arrow_upward","art_track","article","aspect_ratio","assessment","assignment","assignment_ind","assignment_late","assignment_return","assignment_returned","assignment_turned_in","assistant","assistant_direction","assistant_photo","atm","attach_email","attach_file","attach_money","attachment","attractions","attribution","audiotrack","auto_awesome","auto_awesome_mosaic","auto_awesome_motion","auto_delete","auto_fix_high","auto_fix_normal","auto_fix_off","auto_graph","auto_stories","autofps_select","autorenew","av_timer","baby_changing_station","back_hand","backpack","backspace","backup","backup_table","badge","bakery_dining","balcony","ballot","bar_chart","batch_prediction","bathroom","bathtub","battery_alert","battery_charging_full","battery_full","battery_saver","battery_std","battery_unknown","beach_access","bed","bedroom_baby","bedroom_child","bedroom_parent","bedtime","beenhere","bento","bike_scooter","biotech","blender","block","bloodtype","bluetooth","bluetooth_audio","bluetooth_connected","bluetooth_disabled","bluetooth_drive","bluetooth_searching","blur_circular","blur_linear","blur_off","blur_on","bolt","book","book_online","bookmark","bookmark_add","bookmark_added","bookmark_border","bookmark_outline","bookmark_remove","bookmarks","border_all","border_bottom","border_clear","border_color","border_horizontal","border_inner","border_left","border_outer","border_right","border_style","border_top","border_vertical","branding_watermark","breakfast_dining","brightness_1","brightness_2","brightness_3","brightness_4","brightness_5","brightness_6","brightness_7","brightness_auto","brightness_high","brightness_low","brightness_medium","broken_image","browser_not_supported","brunch_dining","brush","bubble_chart","bug_report","build","build_circle","bungalow","burst_mode","bus_alert","business","business_center","cabin","cable","cached","cake","calculate","calendar_today","calendar_view_day","calendar_view_month","calendar_view_week","call","call_end","call_made","call_merge","call_missed","call_missed_outgoing","call_received","call_split","call_to_action","camera","camera_alt","camera_enhance","camera_front","camera_indoor","camera_outdoor","camera_rear","camera_roll","cameraswitch","campaign","cancel","cancel_presentation","cancel_schedule_send","car_rental","car_repair","card_giftcard","card_membership","card_travel","carpenter","cases","casino","cast","cast_connected","cast_for_education","catching_pokemon","category","celebration","cell_wifi","center_focus_strong","center_focus_weak","chair","chair_alt","chalet","change_circle","change_history","charging_station","chat","chat_bubble","chat_bubble_outline","check","check_box","check_box_outline_blank","check_circle","check_circle_outline","checklist","checklist_rtl","checkroom","chevron_left","chevron_right","child_care","child_friendly","chrome_reader_mode","circle","circle_notifications","class","clean_hands","cleaning_services","clear","clear_all","close","close_fullscreen","closed_caption","closed_caption_disabled","closed_caption_off","cloud","cloud_circle","cloud_done","cloud_download","cloud_off","cloud_queue","cloud_upload","code","code_off","coffee","coffee_maker","collections","collections_bookmark","color_lens","colorize","comment","comment_bank","commute","compare","compare_arrows","compass_calibration","compost","compress","computer","confirmation_num","confirmation_number","connect_without_contact","connected_tv","construction","contact_mail","contact_page","contact_phone","contact_support","contactless","contacts","content_copy","content_cut","content_paste","content_paste_off","control_camera","control_point","control_point_duplicate","copy","copy_all","copyright","coronavirus","corporate_fare","cottage","countertops","create","create_new_folder","credit_card","credit_card_off","credit_score","crib","crop","crop_16_9","crop_3_2","crop_5_4","crop_7_5","crop_din","crop_free","crop_landscape","crop_original","crop_portrait","crop_rotate","crop_square","cruelty_free","cut","dangerous","dark_mode","dashboard","dashboard_customize","data_exploration","data_saver_off","data_saver_on","data_usage","date_range","deck","dehaze","delete","delete_forever","delete_outline","delete_sweep","delivery_dining","departure_board","description","design_services","desktop_access_disabled","desktop_mac","desktop_windows","details","developer_board","developer_board_off","developer_mode","device_hub","device_thermostat","device_unknown","devices","devices_other","dialer_sip","dialpad","dining","dinner_dining","directions","directions_bike","directions_boat","directions_boat_filled","directions_bus","directions_bus_filled","directions_car","directions_car_filled","directions_ferry","directions_off","directions_railway","directions_railway_filled","directions_run","directions_subway","directions_subway_filled","directions_train","directions_transit","directions_transit_filled","directions_walk","dirty_lens","disabled_by_default","disabled_visible","disc_full","dnd_forwardslash","dns","do_disturb","do_disturb_alt","do_disturb_off","do_disturb_on","do_not_disturb","do_not_disturb_alt","do_not_disturb_off","do_not_disturb_on","do_not_disturb_on_total_silence","do_not_step","do_not_touch","dock","document_scanner","domain","domain_disabled","domain_verification","done","done_all","done_outline","donut_large","donut_small","door_back","door_front","door_sliding","doorbell","double_arrow","downhill_skiing","download","download_done","download_for_offline","downloading","drafts","drag_handle","drag_indicator","draw","drive_eta","drive_file_move","drive_file_move_rtl","drive_file_rename_outline","drive_folder_upload","dry","dry_cleaning","duo","dvr","dynamic_feed","dynamic_form","e_mobiledata","earbuds","earbuds_battery","east","eco","edgesensor_high","edgesensor_low","edit","edit_attributes","edit_calendar","edit_location","edit_location_alt","edit_note","edit_notifications","edit_off","edit_road","eject","elderly","electric_bike","electric_car","electric_moped","electric_rickshaw","electric_scooter","electrical_services","elevator","email","emergency","emoji_emotions","emoji_events","emoji_flags","emoji_food_beverage","emoji_nature","emoji_objects","emoji_people","emoji_symbols","emoji_transportation","engineering","enhance_photo_translate","enhanced_encryption","equalizer","error","error_outline","escalator","escalator_warning","euro","euro_symbol","ev_station","event","event_available","event_busy","event_note","event_seat","exit_to_app","expand","expand_less","expand_more","explicit","explore","explore_off","exposure","exposure_minus_1","exposure_minus_2","exposure_neg_1","exposure_neg_2","exposure_plus_1","exposure_plus_2","exposure_zero","extension","extension_off","face","face_retouching_natural","face_retouching_off","face_unlock","facebook","fact_check","family_restroom","fast_forward","fast_rewind","fastfood","favorite","favorite_border","favorite_outline","featured_play_list","featured_video","feed","feedback","female","fence","festival","fiber_dvr","fiber_manual_record","fiber_new","fiber_pin","fiber_smart_record","file_copy","file_download","file_download_done","file_download_off","file_present","file_upload","filter","filter_1","filter_2","filter_3","filter_4","filter_5","filter_6","filter_7","filter_8","filter_9","filter_9_plus","filter_alt","filter_b_and_w","filter_center_focus","filter_drama","filter_frames","filter_hdr","filter_list","filter_none","filter_tilt_shift","filter_vintage","find_in_page","find_replace","fingerprint","fire_extinguisher","fireplace","first_page","fit_screen","fitness_center","flag","flaky","flare","flash_auto","flash_off","flash_on","flashlight_off","flashlight_on","flatware","flight","flight_land","flight_takeoff","flip","flip_camera_android","flip_camera_ios","flip_to_back","flip_to_front","flourescent","flutter_dash","fmd_bad","fmd_good","folder","folder_open","folder_shared","folder_special","follow_the_signs","font_download","font_download_off","food_bank","format_align_center","format_align_justify","format_align_left","format_align_right","format_bold","format_clear","format_color_fill","format_color_reset","format_color_text","format_indent_decrease","format_indent_increase","format_italic","format_line_spacing","format_list_bulleted","format_list_numbered","format_list_numbered_rtl","format_paint","format_quote","format_shapes","format_size","format_strikethrough","format_textdirection_l_to_r","format_textdirection_r_to_l","format_underline","format_underlined","forum","forward","forward_10","forward_30","forward_5","forward_to_inbox","foundation","free_breakfast","free_cancellation","front_hand","fullscreen","fullscreen_exit","functions","g_mobiledata","g_translate","gamepad","games","garage","gavel","generating_tokens","gesture","get_app","gif","gite","golf_course","gpp_bad","gpp_good","gpp_maybe","gps_fixed","gps_not_fixed","gps_off","grade","gradient","grading","grain","graphic_eq","grass","grid_3x3","grid_4x4","grid_goldenratio","grid_off","grid_on","grid_view","group","group_add","group_off","group_work","groups","h_mobiledata","h_plus_mobiledata","hail","handyman","hardware","hd","hdr_auto","hdr_auto_select","hdr_enhanced_select","hdr_off","hdr_off_select","hdr_on","hdr_on_select","hdr_plus","hdr_strong","hdr_weak","headphones","headphones_battery","headset","headset_mic","headset_off","healing","health_and_safety","hearing","hearing_disabled","height","help","help_center","help_outline","hevc","hide_image","hide_source","high_quality","highlight","highlight_alt","highlight_off","highlight_remove","hiking","history","history_edu","history_toggle_off","holiday_village","home","home_max","home_mini","home_repair_service","home_work","horizontal_distribute","horizontal_rule","horizontal_split","hot_tub","hotel","hotel_class","hourglass_bottom","hourglass_disabled","hourglass_empty","hourglass_full","hourglass_top","house","house_siding","houseboat","how_to_reg","how_to_vote","http","https","hvac","ice_skating","icecream","image","image_aspect_ratio","image_not_supported","image_search","imagesearch_roller","import_contacts","import_export","important_devices","inbox","incomplete_circle","indeterminate_check_box","info","input","insert_chart","insert_chart_outlined","insert_comment","insert_drive_file","insert_emoticon","insert_invitation","insert_link","insert_photo","insights","integration_instructions","inventory","inventory_2","invert_colors","invert_colors_off","invert_colors_on","ios_share","iron","iso","kayaking","keyboard","keyboard_alt","keyboard_arrow_down","keyboard_arrow_left","keyboard_arrow_right","keyboard_arrow_up","keyboard_backspace","keyboard_capslock","keyboard_control","keyboard_hide","keyboard_return","keyboard_tab","keyboard_voice","king_bed","kitchen","kitesurfing","label","label_important","label_off","landscape","language","laptop","laptop_chromebook","laptop_mac","laptop_windows","last_page","launch","layers","layers_clear","leaderboard","leak_add","leak_remove","leave_bags_at_home","legend_toggle","lens","lens_blur","library_add","library_add_check","library_books","library_music","light","light_mode","lightbulb","line_style","line_weight","linear_scale","link","link_off","linked_camera","liquor","list","list_alt","live_help","live_tv","living","local_activity","local_airport","local_atm","local_attraction","local_bar","local_cafe","local_car_wash","local_convenience_store","local_dining","local_drink","local_fire_department","local_florist","local_gas_station","local_grocery_store","local_hospital","local_hotel","local_laundry_service","local_library","local_mall","local_movies","local_offer","local_parking","local_pharmacy","local_phone","local_pizza","local_play","local_police","local_post_office","local_print_shop","local_printshop","local_restaurant","local_see","local_shipping","local_taxi","location_city","location_disabled","location_history","location_off","location_on","location_searching","lock","lock_clock","lock_open","login","logout","looks","looks_3","looks_4","looks_5","looks_6","looks_one","looks_two","loop","loupe","low_priority","loyalty","lte_mobiledata","lte_plus_mobiledata","luggage","lunch_dining","mail","mail_outline","male","manage_accounts","manage_search","map","maps_home_work","maps_ugc","margin","mark_as_unread","mark_chat_read","mark_chat_unread","mark_email_read","mark_email_unread","markunread","markunread_mailbox","masks","maximize","media_bluetooth_off","media_bluetooth_on","mediation","medical_services","medication","meeting_room","memory","menu","menu_book","menu_open","merge_type","message","messenger","messenger_outline","mic","mic_external_off","mic_external_on","mic_none","mic_off","microwave","military_tech","minimize","miscellaneous_services","missed_video_call","mms","mobile_friendly","mobile_off","mobile_screen_share","mobiledata_off","mode","mode_comment","mode_edit","mode_edit_outline","mode_night","mode_standby","model_training","monetization_on","money","money_off","money_off_csred","monitor","monitor_weight","monochrome_photos","mood","mood_bad","moped","more","more_horiz","more_time","more_vert","motion_photos_auto","motion_photos_off","motion_photos_on","motion_photos_pause","motion_photos_paused","motorcycle","mouse","move_to_inbox","movie","movie_creation","movie_filter","moving","mp","multiline_chart","multiple_stop","multitrack_audio","museum","music_note","music_off","music_video","my_library_add","my_library_books","my_library_music","my_location","nat","nature","nature_people","navigate_before","navigate_next","navigation","near_me","near_me_disabled","nearby_error","nearby_off","network_cell","network_check","network_locked","network_wifi","new_label","new_releases","next_plan","next_week","nfc","night_shelter","nightlife","nightlight","nightlight_round","nights_stay","no_accounts","no_backpack","no_cell","no_drinks","no_encryption","no_encryption_gmailerrorred","no_flash","no_food","no_luggage","no_meals","no_meeting_room","no_photography","no_sim","no_stroller","no_transfer","nordic_walking","north","north_east","north_west","not_accessible","not_interested","not_listed_location","not_started","note","note_add","note_alt","notes","notification_add","notification_important","notifications","notifications_active","notifications_none","notifications_off","notifications_on","notifications_paused","now_wallpaper","now_widgets","offline_bolt","offline_pin","offline_share","ondemand_video","online_prediction","opacity","open_in_browser","open_in_full","open_in_new","open_in_new_off","open_with","other_houses","outbond","outbound","outbox","outdoor_grill","outlet","outlined_flag","padding","pages","pageview","paid","palette","pan_tool","panorama","panorama_fish_eye","panorama_fisheye","panorama_horizontal","panorama_horizontal_select","panorama_photosphere","panorama_photosphere_select","panorama_vertical","panorama_vertical_select","panorama_wide_angle","panorama_wide_angle_select","paragliding","park","party_mode","password","paste","pattern","pause","pause_circle","pause_circle_filled","pause_circle_outline","pause_presentation","payment","payments","pedal_bike","pending","pending_actions","people","people_alt","people_outline","perm_camera_mic","perm_contact_cal","perm_contact_calendar","perm_data_setting","perm_device_info","perm_device_information","perm_identity","perm_media","perm_phone_msg","perm_scan_wifi","person","person_add","person_add_alt","person_add_alt_1","person_add_disabled","person_off","person_outline","person_pin","person_pin_circle","person_remove","person_remove_alt_1","person_search","personal_injury","personal_video","pest_control","pest_control_rodent","pets","phone","phone_android","phone_bluetooth_speaker","phone_callback","phone_disabled","phone_enabled","phone_forwarded","phone_in_talk","phone_iphone","phone_locked","phone_missed","phone_paused","phonelink","phonelink_erase","phonelink_lock","phonelink_off","phonelink_ring","phonelink_setup","photo","photo_album","photo_camera","photo_camera_back","photo_camera_front","photo_filter","photo_library","photo_size_select_actual","photo_size_select_large","photo_size_select_small","piano","piano_off","picture_as_pdf","picture_in_picture","picture_in_picture_alt","pie_chart","pie_chart_outline","pin","pin_drop","pin_end","pin_invoke","pivot_table_chart","place","plagiarism","play_arrow","play_circle","play_circle_fill","play_circle_filled","play_circle_outline","play_disabled","play_for_work","play_lesson","playlist_add","playlist_add_check","playlist_play","plumbing","plus_one","podcasts","point_of_sale","policy","poll","polymer","pool","portable_wifi_off","portrait","post_add","power","power_input","power_off","power_settings_new","precision_manufacturing","pregnant_woman","present_to_all","preview","price_change","price_check","print","print_disabled","priority_high","privacy_tip","private_connectivity","production_quantity_limits","psychology","public","public_off","publish","published_with_changes","push_pin","qr_code","qr_code_2","qr_code_scanner","query_builder","query_stats","question_answer","queue","queue_music","queue_play_next","quick_contacts_dialer","quick_contacts_mail","quickreply","quiz","r_mobiledata","radar","radio","radio_button_checked","radio_button_off","radio_button_on","radio_button_unchecked","railway_alert","ramen_dining","rate_review","raw_off","raw_on","read_more","real_estate_agent","receipt","receipt_long","recent_actors","recommend","record_voice_over","recycling","redeem","redo","reduce_capacity","refresh","remember_me","remove","remove_circle","remove_circle_outline","remove_done","remove_from_queue","remove_moderator","remove_red_eye","remove_shopping_cart","reorder","repeat","repeat_on","repeat_one","repeat_one_on","replay","replay_10","replay_30","replay_5","replay_circle_filled","reply","reply_all","report","report_gmailerrorred","report_off","report_problem","request_page","request_quote","reset_tv","restart_alt","restaurant","restaurant_menu","restore","restore_from_trash","restore_page","reviews","rice_bowl","ring_volume","roofing","room","room_preferences","room_service","rotate_90_degrees_ccw","rotate_left","rotate_right","rounded_corner","router","rowing","rss_feed","rsvp","rtt","rule","rule_folder","run_circle","running_with_errors","rv_hookup","safety_divider","sailing","sanitizer","satellite","save","save_alt","saved_search","savings","scanner","scatter_plot","schedule","schedule_send","schema","school","science","score","screen_lock_landscape","screen_lock_portrait","screen_lock_rotation","screen_rotation","screen_search_desktop","screen_share","screenshot","sd","sd_card","sd_card_alert","sd_storage","search","search_off","security","security_update","security_update_good","security_update_warning","segment","select_all","self_improvement","sell","send","send_and_archive","send_to_mobile","sensor_door","sensor_window","sensors","sensors_off","sentiment_dissatisfied","sentiment_neutral","sentiment_satisfied","sentiment_satisfied_alt","sentiment_very_dissatisfied","sentiment_very_satisfied","set_meal","settings","settings_accessibility","settings_applications","settings_backup_restore","settings_bluetooth","settings_brightness","settings_cell","settings_display","settings_ethernet","settings_input_antenna","settings_input_component","settings_input_composite","settings_input_hdmi","settings_input_svideo","settings_overscan","settings_phone","settings_power","settings_remote","settings_suggest","settings_system_daydream","settings_voice","share","share_arrival_time","share_location","shield","shop","shop_2","shop_two","shopping_bag","shopping_basket","shopping_cart","short_text","shortcut","show_chart","shower","shuffle","shuffle_on","shutter_speed","sick","signal_cellular_0_bar","signal_cellular_4_bar","signal_cellular_alt","signal_cellular_connected_no_internet_0_bar","signal_cellular_connected_no_internet_4_bar","signal_cellular_no_sim","signal_cellular_nodata","signal_cellular_null","signal_cellular_off","signal_wifi_0_bar","signal_wifi_4_bar","signal_wifi_4_bar_lock","signal_wifi_bad","signal_wifi_connected_no_internet_4","signal_wifi_off","signal_wifi_statusbar_4_bar","signal_wifi_statusbar_connected_no_internet_4","signal_wifi_statusbar_null","sim_card","sim_card_alert","sim_card_download","single_bed","sip","skateboarding","skip_next","skip_previous","sledding","slideshow","slow_motion_video","smart_button","smart_display","smart_screen","smart_toy","smartphone","smoke_free","smoking_rooms","sms","sms_failed","snippet_folder","snooze","snowboarding","snowmobile","snowshoeing","soap","social_distance","sort","sort_by_alpha","source","south","south_east","south_west","spa","space_bar","space_dashboard","speaker","speaker_group","speaker_notes","speaker_notes_off","speaker_phone","speed","spellcheck","splitscreen","sports","sports_bar","sports_baseball","sports_basketball","sports_cricket","sports_esports","sports_football","sports_golf","sports_handball","sports_hockey","sports_kabaddi","sports_mma","sports_motorsports","sports_rugby","sports_score","sports_soccer","sports_tennis","sports_volleyball","square_foot","stacked_bar_chart","stacked_line_chart","stairs","star","star_border","star_border_purple500","star_half","star_outline","star_purple500","star_rate","stars","stay_current_landscape","stay_current_portrait","stay_primary_landscape","stay_primary_portrait","sticky_note_2","stop","stop_circle","stop_screen_share","storage","store","store_mall_directory","storefront","storm","straighten","stream","streetview","strikethrough_s","stroller","style","subdirectory_arrow_left","subdirectory_arrow_right","subject","subscript","subscriptions","subtitles","subtitles_off","subway","summarize","superscript","supervised_user_circle","supervisor_account","support","support_agent","surfing","surround_sound","swap_calls","swap_horiz","swap_horizontal_circle","swap_vert","swap_vert_circle","swap_vertical_circle","swipe","switch_account","switch_camera","switch_left","switch_right","switch_video","sync","sync_alt","sync_disabled","sync_problem","system_security_update","system_security_update_good","system_security_update_warning","system_update","system_update_alt","system_update_tv","tab","tab_unselected","table_chart","table_rows","table_view","tablet","tablet_android","tablet_mac","tag","tag_faces","takeout_dining","tap_and_play","tapas","task","task_alt","taxi_alert","terrain","text_fields","text_format","text_rotate_up","text_rotate_vertical","text_rotation_angledown","text_rotation_angleup","text_rotation_down","text_rotation_none","text_snippet","textsms","texture","theater_comedy","theaters","thermostat","thermostat_auto","thumb_down","thumb_down_alt","thumb_down_off_alt","thumb_up","thumb_up_alt","thumb_up_off_alt","thumbs_up_down","time_to_leave","timelapse","timeline","timer","timer_10","timer_10_select","timer_3","timer_3_select","timer_off","tips_and_updates","title","toc","today","toggle_off","toggle_on","toll","tonality","topic","touch_app","tour","toys","track_changes","traffic","train","tram","transfer_within_a_station","transform","transgender","transit_enterexit","translate","travel_explore","trending_down","trending_flat","trending_neutral","trending_up","trip_origin","try","tty","tune","tungsten","turned_in","turned_in_not","tv","tv_off","two_wheeler","umbrella","unarchive","undo","unfold_less","unfold_more","unpublished","unsubscribe","upcoming","update","update_disabled","upgrade","upload","upload_file","usb","usb_off","verified","verified_user","vertical_align_bottom","vertical_align_center","vertical_align_top","vertical_distribute","vertical_split","vibration","video_call","video_camera_back","video_camera_front","video_collection","video_label","video_library","video_settings","video_stable","videocam","videocam_off","videogame_asset","videogame_asset_off","view_agenda","view_array","view_carousel","view_column","view_comfortable","view_comfy","view_compact","view_day","view_headline","view_in_ar","view_list","view_module","view_quilt","view_sidebar","view_stream","view_week","vignette","villa","visibility","visibility_off","voice_chat","voice_over_off","voicemail","volume_down","volume_mute","volume_off","volume_up","volunteer_activism","vpn_key","vpn_lock","vrpano","wallet_giftcard","wallet_membership","wallet_travel","wallpaper","warning","warning_amber","wash","watch","watch_later","water","water_damage","water_drop","waterfall_chart","waves","waving_hand","wb_auto","wb_cloudy","wb_incandescent","wb_iridescent","wb_shade","wb_sunny","wb_twilight","wc","web","web_asset","web_asset_off","weekend","west","whatshot","wheelchair_pickup","where_to_vote","widgets","wifi","wifi_calling","wifi_calling_3","wifi_lock","wifi_off","wifi_protected_setup","wifi_tethering","wifi_tethering_error_rounded","wifi_tethering_off","window","wine_bar","work","work_off","work_outline","workspaces","wrap_text","wrong_location","wysiwyg","yard","youtube_searched_for","zoom_in","zoom_out","zoom_out_map"]}];function O(e){const[t,a]=d({defaultIcon:mappl10n.options.defaultIcon,filename:null,filter:"",glyph:"",glyphColor:"white",glyphFont:N[0],glyphSize:20,isOpen:!1,mode:"list",shape:"circle",shapeColor:"gray",shapeFont:S[0],toDelete:[],userIcons:mappl10n.options.userIcons});function r(e){a((t=>({...t,...e})))}function p(a,o){switch(a){case"bulk-select":let a=[...t.toDelete],i=t.toDelete.indexOf(o.iconid);i>=0?a.splice(i,1):a.push(o.iconid),r({toDelete:a});break;case"close":r({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&mapp.lib.ajax({type:"POST",data:{action:"mapp_icon_delete",iconids:t.toDelete,nonce:mappl10n.options.nonce},callback:function(a){a&&"OK"==a.status?(t.toDelete.indexOf(e.iconid)>=0&&!function(e){if(!e)return!1;let t=e.replace(/.png|.gif|.jpg/gi,"").toLowerCase();return mappl10n.options.standardIcons.indexOf(t)>=0}(e.iconid)&&e.onChange(null),mappl10n.options.userIcons=a.data,r({toDelete:[],mode:"list",userIcons:mappl10n.options.userIcons})):alert("Delete error: "+a.status)}});break;case"edit-cancel":r({mode:"list"});break;case"edit-save":!function(e){const a=32,o=2;let i=document.createElement("canvas");i.width=a*o,i.height=a*o,i.style.imageRendering="pixelated";let n=i.getContext("2d");n.font=a*o+"px "+t.shapeFont.fontFamily,n.fillStyle=t.shapeColor,n.textBaseline="bottom",n.fillText(t.shape,0,a*o),n.strokeStyle="white",n.strokeText(t.shape,1,a*o);const s=_.findWhere(t.shapeFont.glyphs,{name:t.shape});if(t.glyph&&s.center){n.imageSmoothingEnabled=!1,n.font=t.glyphSize*o+"px "+t.glyphFont.fontFamily,n.fillStyle=t.glyphColor;const e=[s.center[0]*o,s.center[1]*o];n.fillText(t.glyph,e[0]-t.glyphSize,e[1]+t.glyphSize)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(i):i.toBlob((e=>{let a=new FormData;a.append("image0",e,t.filename),m(a)}),"image/png",100)}();break;case"edit-upload":!function(e){let t=new FormData;_.map(e,((e,a)=>{e.type.match("image.*")?t.append("image"+a,e):alert("File "+e.name+" is not an image.")})),m(t)}(o);break;case"list-select":e.onChange&&e.onChange(o),p("close");break;case"mode":r("bulk"==o?{mode:o,toDelete:[]}:{mode:o});break;case"open":r({isOpen:!0})}}function c(a){const o="user"==a?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(o,(o=>{if("standard"==a&&function(e){return mappl10n.options.userIcons.indexOf(e)>=0}(o+".png"))return"";let i="mapp-icon-wrapper";return"bulk"==t.mode&&t.toDelete.indexOf(o)>=0?i+=" mapp-bulk-selected":"list"!=t.mode||e.iconid!=o&&e.iconid+".png"!=o||(i+=" mapp-selected"),n("div",{alt:o,className:i,key:o,onClick:()=>{"list"==t.mode?p("list-select",o):"user"==a&&p("bulk-select",{iconid:o,type:a})}},n("img",{className:"mapp-icon",src:mapp.Icons.getUrl(o),title:o}))}))}function m(t){t.append("action","mapp_icon_save"),t.append("nonce",mappl10n.options.nonce),mapp.lib.ajax({type:"POST",contentType:!1,processData:!1,data:t,success:t=>{t&&"OK"==t.status?(mappl10n.options.userIcons=t.data.icons,r({userIcons:mappl10n.options.userIcons}),r({mode:"list"}),e.onChange&&e.onChange(t.data.filename)):alert("Upload error: "+t.status)}})}return l((()=>{let e=t.glyph?t.glyph:t.shape;e+=".png",r({filename:e})}),[t.shape,t.shapeColor,t.glyphFont,t.glyph,t.glyphColor,t.glyphSize]),n(s,null,n("img",{className:"mapp-icon",onClick:()=>p("open",null),src:mapp.Icons.getUrl(e.iconid)}),"list"==t.mode&&t.isOpen&&n(v,{title:n("div",{className:"mapp-icons-title"},__("Select icon"),n(h,{disabled:"bulk"==t.mode,isPrimary:!0,onClick:()=>p("mode","edit")},__("New icon"))),className:"mapp-icons-modal",onRequestClose:()=>p("close")},n("div",{className:"mapp-icons"},n("div",{className:"mapp-icons-list"},mappl10n.options.userIcons.length>0&&n("div",{className:"mapp-icons-list-title"},__("Custom icons")),n("div",{className:"mapp-icons-user"},c("user")),mappl10n.options.userIcons.length>0&&n("div",{className:"mapp-icons-list-title"},__("Standard icons")),n("div",{className:"mapp-icons-standard"},c("standard"))),n("div",{className:"mapp-icons-toolbar"},n("div",null,n(h,{disabled:"bulk"==t.mode,isSecondary:!0,onClick:()=>p("list-select",null)},__("Use default icon")),mappl10n.options.userIcons.length>0&&n(h,{isTertiary:!0,onClick:()=>p("mode","bulk")},__("Edit list"))),n("div",{className:"mapp-icons-filename"},e.iconid?e.iconid:__("No icon selected"))))),"bulk"==t.mode&&t.isOpen&&n(v,{title:n("div",{className:"mapp-icons-title"},__("Select icons to delete")),className:"mapp-icons-modal",onRequestClose:()=>p("close")},n("div",{className:"mapp-icons"},n("div",{className:"mapp-icons-list"},n("div",{className:"mapp-icons-user"},c("user"))),n("div",{className:"mapp-icons-toolbar"},n("div",null,n(h,{isDestructive:!0,disabled:t.toDelete.length<1,onClick:()=>p("delete")},__("Delete")),n(h,{isSecondary:!0,onClick:()=>p("mode","list")},__("Cancel")))))),"edit"==t.mode&&n(v,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:()=>p("edit-cancel"),shouldCloseOnClickOutside:!1},n("div",{className:"mapp-icons-edit"},n("div",{id:"mapp-edit-debug"}),n("section",null,n("h2",null,__("Shape")),n("span",{className:"mapp-icons-edit-shapes",style:{color:t.shapeColor,fontFamily:t.shapeFont.fontFamily}},_.map(t.shapeFont.glyphs,((e,a)=>{const o=t.shape==e.name;return n("span",{className:"mapp-icons-edit-shape-wrapper"+(o?" mapp-selected":""),key:e.name,onClick:()=>r({shape:e.name}),title:e.name},n("span",{className:"mapp-icons-edit-shape"},e.name,e.center&&t.glyph&&n("div",{className:"mapp-icons-edit-shape-glyph "+t.glyphFont.className,style:{left:e.center[0],top:e.center[1],color:t.glyphColor,fontSize:t.glyphSize,width:t.glyphSize}},t.glyph)))})))),n("section",{className:"mapp-icons-edit-font"},n("h2",null,__("Font")),n(i.Select,{value:t.glyphFont.id,options:_.map(N,(e=>({value:e.id,label:e.label}))),onChange:e=>r({glyphFont:_.findWhere(N,{id:e}),glyph:null})}),n("span",null,__("Font size")),n(w,{initialPosition:20,min:16,max:24,value:t.glyphSize,onChange:e=>r({glyphSize:e})})),n("section",null,n("h2",null,__("Color")),n("span",{className:"mapp-icons-edit-colors"},n(o.MappColorPicker,{color:t.shapeColor,isExtended:!1,onChange:e=>r({shapeColor:e.color})}),n("span",null,__("Fill")),n(o.MappColorPicker,{color:t.glyphColor,isExtended:!1,onChange:e=>r({glyphColor:e.color})}),n("span",null,__("Stroke")))),function(){const e=_.filter(t.glyphFont.glyphs,(e=>!t.filter||e.includes(t.filter)));return n("div",{className:"mapp-icons-edit-glyphs"},n("section",{className:"mapp-icons-edit-search"},n("h2",null,__("Search")),n(i.Input,{value:t.filter,onChange:e=>r({filter:e})})),n("div",{className:"mapp-icons-edit-glyph-list",style:{color:t.glyphColor}},_.map(e,((e,a)=>n("div",{tabIndex:0,className:"mapp-icons-edit-glyph-wrapper"+(t.glyph==e?" mapp-selected":""),key:a,onClick:()=>r({glyph:t.glyph==e?null:e})},n("span",{className:"mapp-icons-edit-glyph "+t.glyphFont.className},e),n("div",{className:"mapp-icons-edit-glyph-title"},e.replaceAll("_"," ")))))))}(),n("div",{className:"mapp-icons-edit-toolbar"},n("div",{className:"mapp-icons-edit-toolbar-left"},n(h,{isPrimary:!0,onClick:()=>p("edit-save")},__("Save")),n(h,{isSecondary:!0,onClick:()=>p("edit-cancel")},__("Cancel")),n(i.Input,{className:"mapp-icons-filename",value:t.filename,onChange:e=>r({filename:e})})),n("div",null,n(y,{accept:"image/*",icon:"upload",multiple:!0,onChange:e=>{p("edit-upload",e.target.files)}},__("Upload icons")))))))}},816:(e,t,a)=>{"use strict";a.r(t);var o=a(429),i=a(477);window.mapp=window.mapp||{};const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useRef:p,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){const{BaseControl:t,Button:a,ButtonGroup:r,CheckboxControl:d,Dropdown:m,Modal:u,Panel:_,PanelBody:h,PanelRow:g,Placeholder:f,RadioControl:b,SelectControl:y,TextControl:v,ToggleControl:k,Toolbar:w,ToolbarButton:C,ToolbarGroup:x}=wp.components,{BlockControls:S,InspectorControls:N}=wp.blockEditor,[O,M]=c({isOpen:!1,map:null,mapdata:void 0,pickerMode:"list",pickerMapid:null}),P=p(null);function I(e){M((t=>({...t,...e})))}function z(t,a){switch(t){case"add":I({isOpen:!0,pickerMapid:null,pickerMode:"edit"}),e.setAttributes({center:void 0,zoom:void 0});break;case"change-settings":e.setAttributes(a);break;case"edit":I({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"edit"});break;case"edit-close":case"pick-close":I({isOpen:!1});break;case"pick-trash":e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),I({isOpen:!1});break;case"pick-insert":case"pick-duplicate":a!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:a,zoom:void 0}),I({isOpen:!1});break;case"open":I({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"list"})}}function E(){return n(S,null,n(void 0!==x?x:w,null,e.attributes.mapid&&n(C,{icon:"edit",label:__("Edit map"),onClick:()=>z("edit")}),n(C,{icon:"portfolio",label:__("Map Library"),onClick:()=>z("open")})))}function T(){if(O.isOpen)return n(i.default,{mapid:O.pickerMapid,mode:O.pickerMode,onAction:z,type:"post"})}return l((()=>{const t=t=>{I({mapdata:t.maps[e.attributes.mapid]})};return mapp.store.subscribe(t),()=>mapp.store.unsubscribe(t)})),l((()=>{e.attributes.mapid&&mapp.store.fetchMap({mapid:e.attributes.mapid})}),[e.attributes.mapid]),l((()=>{e.attributes.mapid&&P.current&&O.mapdata&&function(){let t=new mapp.Map(O.mapdata,{alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:e.attributes.poiList,search:e.attributes.search,sel:jQuery(P.current),width:e.attributes.width,zoom:e.attributes.zoom});t.display(),I({map:t})}()}),[O.mapdata,e.attributes.search]),l((()=>{"wide"!=e.attributes.align&&"full"!=e.attributes.align||(e.setAttributes({width:"100%"}),O.map&&O.map.setSize({width:"100%"}))}),[e.attributes.align]),e.attributes.preview?n("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):e.attributes.mapid&&null!==O.mapdata?n(s,null,E(),function(){if(!O.map)return null;const{align:t,center:a,height:i,poiList:s,search:l,width:r,zoom:p}=e.attributes;return n(N,null,n("div",{className:"mapp-gt-inspector"},n(o.MappSettings,{map:O.map,alignment:t,context:"map",onAction:z,center:a,height:i,poiList:s,search:l,width:r,zoom:p})))}(),n("div",{className:"mapp-gt",ref:P}),T()):n(s,null,n(s,null,E(),n(f,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},n(a,{icon:"portfolio",isSecondary:!0,onClick:()=>z("open")},__("Map Library")))),T())}mappl10n.options.postid&&wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:mappl10n.options.blockCategory,attributes:{center:{type:"string"},height:{type:"string",default:""},initialOpenDirections:{type:"boolean"},mapid:{type:"string"},mapOpts:{type:"object"},poiList:{type:"boolean"},preview:{type:"boolean",default:!1},search:{type:"boolean"},width:{type:"string",default:""},zoom:{type:"number"}},supports:{align:["full","wide","center","left","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:e=>e.named.center},height:{type:"string",shortcode:e=>e.named.height},initialOpenDirections:{type:"boolean",shortcode:e=>"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections||void 0},mapid:{type:"string",shortcode:e=>e.named.mapid},poiList:{type:"boolean",shortcode:e=>"true"==e.named.poiList||"true"==e.named.poilist||void 0},search:{type:"boolean",shortcode:e=>"true"==e.named.search||"true"==e.named.search||void 0},width:{type:"string",shortcode:e=>e.named.width},zoom:{type:"number",shortcode:e=>parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}},{type:"block",blocks:["core/shortcode"],isMatch:e=>{let{text:t}=e;var a=wp.shortcode.regexp("mappress");return a.lastIndex=0,a.test(t)},transform:e=>{let{text:t}=e;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return n(d,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},378:(e,t,a)=>{"use strict";a.r(t);a(429),a(670),a(308);window.mapp=window.mapp||{};wp.element.createElement;const{Fragment:o,useEffect:i,useLayoutEffect:n,useRef:s,useState:l}=wp.element,{BaseControl:r,Button:p,ButtonGroup:c,Card:d,CardBody:m,CardFooter:u,CardHeader:_,CheckboxControl:h,ExternalLink:g,HorizontalRule:f,Panel:b,PanelBody:y,PanelRow:v,Placeholder:k,RadioControl:w,SelectControl:C,TabPanel:x,TextControl:S,TextareaControl:N,ToggleControl:O,Toolbar:M}=wp.components,{useSelect:P}=wp.data},498:(e,t,a)=>{"use strict";a.r(t);var o=a(477);window.mapp=window.mapp||{};const i=wp.element.createElement,{Fragment:n,useEffect:s,useLayoutEffect:l,useRef:r,useState:p}=wp.element,{Button:c,Dashicon:d,Modal:m}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function u(e){const[t,a]=p({isOpen:!0,mapid:null});function s(e){a((t=>({...t,...e})))}function l(e,t){switch(e){case"pick-close":s({isOpen:!1,mapid:null});break;case"pick-insert":s({isOpen:!1});var a='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(a);break;case"open":s({isOpen:!0,mapid:r()})}}function r(){const e="undefined"!=typeof tinyMCE&&tinyMCE?tinyMCE.get("content"):null,t=e&&e.selection?e.selection.getSel():null;if(!t||void 0===t.anchorOffset||!t.anchorNode||!t.anchorNode.data)return null;let a=null,o=t.anchorNode.data,i=-1;for(let e=t.anchorOffset-1;e>=0;e--){let t=o[e];if("["==t){i=e;break}if("]"==t||"<"==t||">"==t)break}return i>=0&&(a=wp.shortcode.next("mappress",o,i),a)?a.shortcode.attrs.named.mapid:null}return i(n,null,i("button",{className:"button",type:"button",onClick:e=>{e.preventDefault(),l("open")}},i(d,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&i(o.default,{context:"mce",mapid:t.mapid,onAction:l}))}jQuery(document).on("click",".mapp-mce-button",(e=>{const t=e.currentTarget.parentElement;wp.element.render(i(u),t)}))},670:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappMultiSelect:()=>b});const o=wp.element.createElement,{Fragment:i,useEffect:n,useLayoutEffect:s,useRef:l,useState:r}=wp.element,{BaseControl:p,Button:c,CheckboxControl:d,Panel:m,PanelBody:u,PanelRow:h,Spinner:g,TextControl:f}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function b(e){const t=l(null),a=l(null),[i,s]=r({isOpen:!1,filter:"",filteredOptions:[]});function c(e){s((t=>({...t,...e})))}function m(t){let a=_.findWhere(e.options,{value:t});return a?a.label:t}function u(){let t;return e.values instanceof Array?t=[...e.values]:e.values&&(t=[e.values]),t||[]}function h(t,a){let o=u(),i=o.indexOf(t);(a=void 0!==a?a:-1==i)?o.push(t):o.splice(i,1),e.onChange(o)}function g(){return i.isOpen?o("div",{className:"mapp-select-dropdown-wrapper"},o("div",{className:"mapp-select-dropdown"},!i.isOpen||!e.options||e.options.length<10?null:o("div",{className:"mapp-select-filter",ref:a},o(f,{autoComplete:"off",placeholder:__("Search"),value:i.filter,onChange:e=>c({filter:e})})),o("div",{className:"mapp-select-dropdown-list"},function(){const e=u();if(0==i.filteredOptions.length)return o("div",{className:"mapp-select-dropdown-item"},__("No results"));return i.filteredOptions.map((t=>o(d,{className:"mapp-select-dropdown-item",checked:e.includes(t.value),key:t.value,onChange:e=>h(t.value,e),label:t.label})))}()))):null}return n((()=>{if(e.options)if(i.filter){let t=i.filter.toUpperCase();c({filteredOptions:e.options.filter((e=>0==e.label.toUpperCase().indexOf(t)))})}else c({filteredOptions:e.options})}),[e.options,i.filter]),n((()=>{i.isOpen&&a.current&&(jQuery("input",jQuery(a.current)).focus(),c({filter:""}))}),[i.isOpen]),o(p,{className:"mapp-select",label:e.label},o("div",{ref:t,tabIndex:0,onBlur:e=>function(e){event.relatedTarget||document.activeElement,t.current.contains(e.relatedTarget)||c({isOpen:!1})}(e)},function(){const t=u();return t instanceof Array&&t.map((e=>m(e))),void 0===e.options?o("div",{className:"mapp-select-input"},o("div",{className:"mapp-select-tokens"}),o("span",{className:"dashicons dashicons-arrow-down-alt2"})):o("div",{className:"mapp-select-input",onClick:()=>c({isOpen:!i.isOpen})},o("div",{className:"mapp-select-tokens"},t.map((e=>o("span",{className:"mapp-select-token",key:e,onClick:t=>{t.stopPropagation(),h(e,!1)}},m(e))))),o("span",{className:"dashicons "+(i.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))}(),g()))}},218:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>y});var o=a(824),i=a(143),n=a(710);const s=wp.element.createElement,{Fragment:l,useEffect:r,useLayoutEffect:p,useCallback:c,useRef:d,useState:m}=wp.element,{useSelect:u}=wp.data,{Button:h,Dashicon:g,FormTokenField:f,Modal:b}=wp.components,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function y(e){const[t,a]=m({...e,isCheckingLicense:!1,isSaving:!1}),p=d(null);function c(e){a((t=>({...t,...e})))}function b(e){return _.map(e,((e,t)=>({value:t,label:e})))}function y(e,t){return e&&Array.isArray(e)&&e.length?(_.map(e,(e=>{for(let t in e)"string"==typeof e[t]&&(e[t]=e[t].trim())})),t?e.filter((e=>{for(let t in e)if(!e[t]||0==e[t].length)return!1;return!0})):e.filter((e=>!(e.hasOwnProperty("key")&&!e.key)))):[]}function v(e,a){switch(e){case"license-check":c({isCheckingLicense:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:t.license},callback:e=>{if(c({isCheckingLicense:!1}),e&&"OK"==e.status){let a={...t.helpers};a.license_status=e.data,c({helpers:a})}}});break;case"reset":c({isSaving:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:e=>{c({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}});break;case"save":let e={...t};delete e.helpers,e.filters=y(e.filters,!1),e.metaKeys=y(e.metaKeys,!0),e.sizes=y(e.sizes,!0),e.autoicons&&e.autoicons.values&&(e.autoicons.values=y(e.autoicons.values,!0)),c({isSaving:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:JSON.stringify(e)},callback:e=>{c({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}})}}return r((()=>{if(p.current){new mapp.Map(t.helpers.demo_map,{sel:jQuery(p.current)}).display()}}),[]),r((()=>{mappl10n.options.engine!=t.engine&&v("save")}),[t.engine]),s("div",{className:"mapp-options"},s("form",{onSubmit:e=>{e.preventDefault(),v("save")}},s(o.Section,{title:__("Sample Map"),className:"mapp-demo-section"},s("div",{className:"mapp-options-demo",ref:p})),mappl10n.options.pro&&(!t.helpers.is_multisite||t.helpers.is_super_admin||t.helpers.is_main_site)&&s(o.Section,{title:__("License")},s(o.Option,{title:__("MapPress license key"),className:"mapp-option-license"},s(o.Input,{value:t.license,name:"license",onChange:e=>{let a={...t.helpers};a.license_status="",c({license:e,helpers:a})},size:37,placeholder:__("Enter license to enable automatic updates")}),function(){const e=t.helpers.license_status,a=s(h,{isSecondary:!0,href:"https://mappresspro.com/mappress"},__("Get license")),o=s(h,{isBusy:t.isCheckingLicense,isSecondary:!0,onClick:()=>v("license-check")},__("Check now")),i=s(h,{isLink:!0,target:"_blank",href:"https://mappresspro.com/account"},__("Your account"));return t.license?"active"==e?s("span",{className:"mapp-license-status"},s(g,{icon:"yes"}),__("Active")):s(l,null,o,i,e&&!t.isCheckingLicense&&s("div",null,s(g,{icon:"no"}),"inactive"==e?__("License is invalid or expired"):e)):a}()),s(o.Option,{title:__("Beta versions")},s(o.Checkbox,{label:__("Enable updates for beta versions"),checked:t.betas,onChange:e=>c({betas:e})}))),s(o.Section,{title:__("Basic Settings")},s(o.Option,{title:__("Mapping API")},s(o.Radios,{options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:e=>{c({engine:e,geocoder:"google"==e?"google":""})},checked:t.engine,help:{href:"#toc-picking-a-mapping-api",text:__("Leaflet is free and requires no API key. Google requires an API key and has usage limits.")}})),"leaflet"==t.engine&&function(){const e=[{value:"nominatim",label:"Nominatim",disabled:t.mapbox,hide:!!t.mapbox},{value:"mapbox",label:"MapBox",disabled:!t.mapbox},{value:"google",label:"Google",disabled:!t.apiKey}];let a={};return"nominatim"==t.geocoder&&(a={text:__("Nominatim is free but inaccurate. Consider using Mapbox or Google instead."),type:"warning"}),a.href="#toc-picking-a-geocoder",s(o.Option,{title:__("Geocoder")},s(o.Radios,{options:e,checked:t.geocoder,onChange:e=>c({geocoder:e}),help:a}))}(),"leaflet"==t.engine&&function(){const e=s(h,{isSecondary:!0,href:"https://account.mapbox.com/access-tokens/",target:"_blank"},__("Get an Access Token"));return s(o.Option,{title:__("Mapbox access token")},s("div",{className:"mapp-option-mapbox"},s(o.Input,{name:"mapbox",value:t.mapbox,onChange:e=>{c({mapbox:e}),c({geocoder:e?"mapbox":"nominatim"})},placeholder:__("Enter token to use Mapbox"),size:50}),e),s("div",{className:"mapp-help-text"},__("Mapbox makes Leaflet maps look great and provides an excellent geocoder.")))}(),function(){const e=s(h,{isSecondary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key",target:"_blank"},__("Get an API Key"));return s(o.Option,{title:__("Google API key"),className:"mapp-option-apikey"},s(o.Input,{name:"apiKey",value:t.apiKey,onChange:e=>{c({apiKey:e})},placeholder:"google"==t.engine?__("Enter API key to use Google maps"):__("Enter API key to use Google geocoder"),size:50}),e)}()),s(o.Section,{title:__("Map Settings")},s(o.Option,{title:__("Automatic display")},s(o.Radios,{options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:t.autodisplay,onChange:e=>c({autodisplay:e})})),s(o.Option,{title:__("Map alignment")},s(o.Radios,{options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:t.alignment,onChange:e=>c({alignment:e})})),s(o.Option,{title:__("Directions")},s(o.Radios,{checked:t.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:e=>c({directions:e})})),s(o.Option,{title:__("Mini width")},s(o.Input,{value:t.mini,onChange:e=>c({mini:e}),size:3,label:__("Width (px) to use map/list toggle buttons")})),"leaflet"==mappl10n.options.engine&&s(o.Option,{title:__("Scroll wheel zoom")},s(o.Checkbox,{checked:t.scrollWheel,label:__("Enable map zoom with mouse scroll wheel"),onChange:e=>c({scrollWheel:e})}))),s(o.Section,{title:__("POIs")},s(o.Option,{title:__("Default zoom")},s(o.Select,{label:__("Default zoom when displaying a single POI"),value:t.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(e=>({value:e,label:e}))),onChange:e=>c({poiZoom:e})})),s(o.Option,{title:__("Hover")},s(o.Checkbox,{checked:t.tooltips,label:__("Open POIs on hover"),onChange:e=>c({tooltips:e})})),s(o.Option,{title:__("Open first POI")},s(o.Checkbox,{checked:t.initialOpenInfo,onChange:e=>c({initialOpenInfo:e}),label:__("Open first POI when a map is displayed")}))),s(o.Section,{title:__("POI List")},s(o.Option,{title:__("Display")},s(o.Checkbox,{checked:t.poiList,label:__("Show a list of POIs with each map"),onChange:e=>c({poiList:e})})),s(o.Option,{title:__("Position")},s("div",{className:"mapp-option-poilist-radios"},s(o.Radios,{checked:t.layout,options:[{value:"left",label:__("Left of map")},{value:"inline",label:__("Below map")}],onChange:e=>c({layout:e})}))),"left"==t.layout&&s(o.Option,{title:__("Initial open")},s("div",{className:"mapp-option-poilist-open"},s(o.Checkbox,{checked:t.poiListOpen,label:__("Open list when map is displayed"),onChange:e=>c({poiListOpen:e})}))),s(o.Option,{title:__("Paging")},s("div",{className:"mapp-option-poilist-page-size"},s(o.Input,{labelRight:__("POIs per page"),max:999,min:1,onChange:e=>c({poiListPageSize:e}),size:3,type:"number",value:t.poiListPageSize}))),s(o.Option,{title:__("Sort")},s(o.Checkbox,{checked:t.sort,label:__("Sort POI list by title"),onChange:e=>c({sort:e})}))),s(o.Section,{title:__("Styled Maps")},s(o.Option,{title:__("Default style")},s("div",{className:"mapp-option-style"},s(n.m,{selected:t.style,onChange:e=>{c({style:e}),mappl10n.options.style=e}}),s("div",null,__('Replace the default "roadmap" or "streets" style'))))),mappl10n.options.pro&&s(o.Section,{title:__("Icons")},s(o.Option,{title:__("Default icon")},s(i.MappIconPicker,{iconid:t.defaultIcon,onChange:e=>{mappl10n.options.defaultIcon=e,c({defaultIcon:e})}})),s(o.Option,{title:__("Icon directory")},s("code",null,t.helpers.icon_directory)),s(o.Option,{title:__("Highlight selected POI")},s(o.Radios,{checked:t.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:e=>c({highlight:e})}),"icon"==t.highlight&&s(i.MappIconPicker,{defaultIcon:t.defaultIcon,iconid:t.highlightIcon,onChange:e=>c({highlightIcon:e})})),function(){let e=t.iconScale&&Array.isArray(t.iconScale)?[...t.iconScale]:[0,0];return s(o.Option,{title:__("Icon size")},s(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[0]=t>0?t:"",c({iconScale:e}))},size:3,type:"number",value:e[0]?e[0]:""}),s("span",null," X "),s(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[1]=t>0?t:"",c({iconScale:e}))},size:3,type:"number",value:e[1]?e[1]:""}),s("span",null," (px) "))}(),function(){let e=b(t.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});const a=u((e=>{if("post_type"==t.autoicons.key)return b(t.helpers.post_types);const a=wp.data.select("core").getEntityRecords("taxonomy",t.autoicons.key,{per_page:-1,_fields:"id,name,slug"});return a?a.map((e=>({value:e.slug,label:e.name}))):[]}),[t.autoicons.key]);return s(o.Option,{title:__("Automatic icons")},s(o.Select,{label:__('Be sure to set "Show in REST API" for custom taxonomies'),value:t.autoicons?t.autoicons.key:null,options:e,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.key=e,a.values=[],c({autoicons:a})},placeholder:""}),s(o.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:a},{id:"value",label:__("Icon"),type:"icon"}],data:t.autoicons.values,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.values=e,c({autoicons:a})}}))}()),s(o.Section,{title:__("Clustering")},s(o.Option,{title:__("Clustering")},s(o.Checkbox,{checked:t.clustering,label:__("Enable marker clustering"),onChange:e=>c({clustering:e})})),function(){let e=t.clusteringOptions?t.clusteringOptions:{};const a=(t,a)=>{e[t]=a,c({clusteringOptions:e})};if("google"==t.engine){const t="https://github.com/googlemaps/v3-utility-library/blob/3fca406/packages/markerclustererplus/src/markerclusterer.ts",i=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return s("div",{className:"mapp-option-clustering-options"},s(o.Option,{title:__("Max zoom")},s(o.Select,{help:{href:t},label:s(l,null,__("Disable clustering at zoom"),s("code",null,"maxZoom")),onChange:e=>a("maxZoom",e),options:_.map(i,(e=>({value:e,label:e}))),placeholder:__("None"),value:e.maxZoom})))}{const t="https://github.com/Leaflet/Leaflet.markercluster#all-options",i=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return s("div",{className:"mapp-option-clustering-options"},s(o.Option,{title:__("Max zoom")},s(o.Select,{help:{href:t},label:s(l,null,__("Disable clustering at zoom"),s("code",null,"disableClusteringAtZoom")),onChange:e=>a("disableClusteringAtZoom",e),options:_.map(i,(e=>({value:e,label:e}))),placeholder:__("Auto"),value:e.disableClusteringAtZoom})),s(o.Option,{title:__("Spiderfy")},s(o.Checkbox,{checked:e.spiderfyOnMaxZoom,help:{href:t},label:s(l,null,__("Spiderfy"),s("code",null,"spiderfyOnMaxZoom")),onChange:e=>a("spiderfyOnMaxZoom",e)})))}}()),mappl10n.options.pro&&s(o.Section,{title:__("Mashups")},function(){const e=[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}];return s(o.Option,{title:__("Marker click")},s(o.Radios,{checked:t.mashupClick,options:e,onChange:e=>c({mashupClick:e})}))}(),s(o.Option,{title:__("Popup content")},s(o.Radios,{checked:t.mashupBody,options:[{value:"poi",label:__("POI title + POI body")},{value:"post",label:__("Post title + post excerpt")}],onChange:e=>c({mashupBody:e})})),s(o.Option,{title:__("KMLs")},s(o.Checkbox,{checked:t.mashupKml,label:__("Include KML POIs in mashups"),onChange:e=>c({mashupKml:e})}))),mappl10n.options.pro&&s(o.Section,{title:__("Search")},s(o.Option,{title:__("Search")},s(o.Checkbox,{checked:t.search,label:__("Enable search for mashups"),onChange:e=>c({search:e})})),s(o.Option,{title:__("Search radius")},s(o.Select,{help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},label:__("Minimum search radius (km)"),value:t.radius,options:_.map([1,5,10,15,25,50,75,100,200,300],(e=>({value:e,label:e}))),onChange:e=>c({radius:e})})),s(o.Option,{title:__("Search country")},s(o.Select,{label:__("Country code for searches"),value:t.country,options:_.map(["","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","VG","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CK","CR","HR","CU","CW","CY","CZ","CD","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","CI","JM","JP","JE","JO","KZ","KE","KI","XK","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","KP","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","CG","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","KR","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","VI","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","WF","EH","YE","ZM","ZW"],(e=>({value:e,label:e}))),onChange:e=>c({country:e}),help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}})),mappl10n.options.ssl?s(o.Option,{title:__("User location")},s(o.Checkbox,{checked:t.userLocation,label:__("Show user location on map"),onChange:e=>c({userLocation:e})})):null,function(){if("google"!=t.engine)return s(o.Option,{title:__("Bounding box")},s(o.Input,{onChange:e=>c({searchBox:e}),help:{text:__("Restrict searches to a bounding box (optional)"),href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},placeholder:"SW lon, SW lat, NE lng, NE lat",size:45,value:t.searchBox}))}()),mappl10n.options.pro&&s(o.Section,{title:__("Filter")},s(o.Option,{title:__("Filters position")},s(o.Radios,{options:[{value:"top",label:__("Top")},{value:"list",label:__("POI list")}],checked:t.filtersPos,onChange:e=>c({filtersPos:e})})),s(o.Option,{className:"mapp-option-filters",title:__("Filters")},s(o.MappCrudList,{data:t.filters,isDraggable:!0,onChangeData:e=>{c({filters:e})},onRender:e=>function(e){let{row:a,rowId:i,onChange:n,onDelete:l,...r}=e,p=b(t.helpers.taxonomies);const c=[{label:__("Post type"),value:"post"},{label:__("Text search"),value:"text"},{label:"──────────",value:"",disabled:!0},...p],d=function(e){const t=_.findWhere(c,{value:e.key});return t?t.label:__("New filter")},m="text"==a.key?[{value:"input",label:__("Input")}]:[{value:"checkbox",label:__("Checkboxes")},{value:"radio",label:__("Radio buttons")},{value:"select",label:__("Select")}];return s(o.MappExpand,{actions:s("div",null,s(h,{icon:"trash",onClick:()=>l(),title:__("Delete")})),className:"mapp-option-filter",initialOpen:!a.key,showToggle:!0,title:d(a)},s("div",{className:"mapp-option-filter-row"},s(o.Select,{labelTop:__("Filter type"),value:a.key,options:c,onChange:e=>n({key:e,format:"text"==e?"input":"checkbox"}),placeholder:""}),s(o.Select,{labelTop:__("Format"),value:a.format,options:m,placeholder:"",onChange:e=>n({format:e})}),s(o.Input,{labelTop:__("Label"),placeholder:d(a),value:a.label,onChange:e=>n({label:e})}),"post"!=a.key&&"meta"!=a.key&&"text"!=a.key&&s(o.Select,{labelTop:__("Sort"),value:a.sort,options:[{value:"name",label:__("Name")},{value:"slug",label:__("Slug")}],onChange:e=>n({sort:e})})),a.key&&"meta"!=a.key&&"text"!=a.key&&s("div",{className:"mapp-option-filter-row mapp-option-filter-tokens"},s(f,{label:__("Include"),value:a.include,onChange:e=>n({include:e}),__experimentalShowHowTo:!1}),s(f,{label:__("Exclude"),value:a.exclude,onChange:e=>n({exclude:e})})))}(e)}))),mappl10n.options.pro&&s(o.Section,{title:__("Generate Maps from Custom Fields")},s(o.Option,{title:__("Post types")},s(o.Checkboxes,{values:t.postTypes,options:b(t.helpers.post_types),onChange:e=>c({postTypes:e})})),s(o.Option,{title:__("Custom fields")},s(o.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:b(t.helpers.meta_fields)},{id:"value",label:__("Custom field"),type:"select",options:b(t.helpers.meta_keys)}],data:t.metaKeys,onChange:e=>{c({metaKeys:e})}})),s(o.Option,{title:__("Overwrite")},s(o.Checkbox,{label:__("Overwrite maps when posts are saved"),checked:t.metaSyncSave,onChange:e=>{c({metaSyncSave:e})}})),"google"==t.engine&&s(o.Option,{title:__("Google Server API key")},s(o.Input,{name:"apiKeyServer",value:t.apiKeyServer,onChange:e=>c({apiKeyServer:e}),size:50,help:{text:__("Server API key for geocoding. Only required if client key is restricted by referrer."),href:"https://mappresspro.com/mappress-documentation/#toc-google-api-keys"}})),function(){let e=__("No errors found");return t.helpers.geocoding_errors&&t.helpers.geocoding_errors.length>0&&(e=_.map(t.helpers.geocoding_errors,(e=>s("div",{key:e.ID},s("a",{href:mappl10n.options.editurl+"?post="+e.ID+"&action=edit"},e.post_title),s("span",null," : "+e.error))))),s(o.Option,{title:__("Geocoding errors")},e)}()),mappl10n.options.pro&&mappl10n.options.acfActive&&s(o.Section,{title:__("Frontend Forms")},s(o.Option,{title:__("Advanced Custom Fields")},s(o.Input,{className:"mapp-option-acf",name:"acf",value:t.acf,onChange:e=>{c({acf:e})},placeholder:__("ACF field"),size:20}),__("ACF map field to include on MapPress mashups"),s(o.Help,{text:__("To generate MapPress maps from ACF fields, leave this blank and use the Geocoding section"),href:"https://mappresspro.com/mappress-documentation/#toc-frontend-forms"}))),mappl10n.options.pro&&s(o.Section,{title:__("Templates")},s(o.Option,{title:__("Custom templates")},s(o.MappTemplateEditor)),s(o.Option,{title:__("Mashup thumbnails")},s(o.Select,{label:__("Popups"),onChange:e=>c({thumbsPopup:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsPopup}),s(o.Select,{label:__("POI lists"),onChange:e=>c({thumbsList:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsList})),s(o.Option,{title:__("Thumbnail size")},s(o.Select,{onChange:e=>c({thumbSize:e}),options:b(t.helpers.thumbnail_sizes),value:t.thumbSize}),s("span",null," "+__("or")+" "),s(o.Input,{value:t.thumbWidth,onChange:e=>c({thumbWidth:e}),type:"number",min:0,max:9999}),s("span",null," X "),s(o.Input,{value:t.thumbHeight,onChange:e=>c({thumbHeight:e}),type:"number",min:0,max:9999}),s("span",null," (px) "))),s(o.Section,{title:__("Localization")},function(){const e="leaflet"==t.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport";return s(o.Option,{title:__("Language")},s(o.Select,{value:t.language,options:b(t.helpers.languages),onChange:e=>c({language:e}),help:{href:e,text:__("Language for searches and Google map controls")}}))}(),s(o.Option,{title:__("Directions server")},s(o.Input,{value:t.directionsServer,onChange:e=>c({directionsServer:e}),size:25}))),s(o.Section,{title:__("Miscellaneous")},s(o.Option,{title:__("Map sizes")},s(o.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:t.sizes,onChange:(e,t)=>c({sizes:e,size:t}),selectionColumn:"rowid",selected:t.size})),t.helpers.jetpack?null:s(o.Option,{title:__("Scripts")},s(o.Checkbox,{checked:t.footer,label:__("Output scripts in footer"),onChange:e=>c({footer:e}),help:{text:__("Disable footer scripts if maps are output using AJAX")}})),s(o.Option,{title:"WPML"},s(o.Checkbox,{checked:t.wpml,label:__("Copy maps when overwriting a translation"),onChange:e=>c({wpml:e}),help:{href:"https://mappresspro.com/mappress-documentation#wpml"}})),s(o.Option,{title:__("Compatibility")},s("div",null,s(o.Checkbox,{checked:t.deregister,label:__("Prevent loading Google Maps multiple times"),onChange:e=>c({deregister:e})})),s("div",null,s(o.Checkbox,{checked:t.iframes,label:__("Output maps in iframes to prevent compatibility issues"),onChange:e=>c({iframes:e})})))),s("div",{className:"mapp-options-toolbar"},s(h,{isBusy:t.isSaving,className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),s(h,{isBusy:t.isSaving,isSecondary:!0,onClick:()=>v("reset")},__("Reset Defaults")))))}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-options-settings")&&wp.element.render(s(y,mappress_options_state),document.getElementById("mapp-options-settings"))}))},824:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Control:()=>f,Help:()=>b,Checkbox:()=>y,Checkboxes:()=>v,Input:()=>k,Radios:()=>C,Select:()=>x,Textarea:()=>S,Section:()=>N,Option:()=>O,MappGrid:()=>M,MappCrudList:()=>P,MappExpand:()=>I,MappTemplateEditor:()=>z});var o=a(143);const i=wp.element.createElement,{Fragment:n,useEffect:s,useLayoutEffect:l,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:d}=wp.data,{Button:m,Dashicon:u,Modal:h,TabPanel:g}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){let{className:t,help:a,type:o,...s}=e;const l=Array.isArray(s.children)?n:"label";let r="mapp-control";return o&&(r+=" mapp-control-"+o),t&&(r+=" "+t),i("div",{className:r},s.labelTop&&i("div",{className:"mapp-label-top"},s.labelTop),i(l,null,s.labelLeft&&i("span",null,s.labelLeft),s.children,(s.label||s.labelRight)&&i("span",null,s.label||s.labelRight)),a&&i(b,a))}function b(e){let t="mapp-help-text";e.type&&(t+=" mapp-help-"+e.type);let a=null;return e.href&&(a="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),i(n,null,a&&i("a",{className:"mapp-help-link",href:a,target:"_blank"},i(u,{icon:"editor-help"})),e.text&&i("div",{className:t},e.text))}function y(e){let{checked:t,className:a,disabled:o,onChange:n,value:s,...l}=e;return i(f,{type:"checkbox",...l},i("input",{checked:void 0!==t&&t,className:a,disabled:o,onChange:e=>n(e.target.checked),type:"checkbox",value:s}))}function v(e){let{label:t,onChange:a,options:o,values:n,...s}=e;return i(f,{type:"checkboxes",...s},_.map(o,((e,t)=>{let o=n?n.indexOf(e.value):-1;return i(y,{key:t,label:e.label,value:e.value,checked:o>=0,disabled:e.disabled,onChange:t=>{let i=[...n];t&&-1==o&&a(i.concat(e.value)),!t&&o>=0&&(i.splice(o,1),a(i))}})})))}function k(e){let{autoFocus:t,disabled:a,max:o,min:n,name:s,onChange:l,placeholder:r,size:p,trim:c,type:d,value:m,...u}=e;return l?i(f,{type:"input",...u},i("input",{autoFocus:t,disabled:a,max:o,min:n,name:s,onChange:e=>l(c?e.target.value.trim():e.target.value),placeholder:r,size:p,type:d||"text",value:null!==m?m:""})):"Missing onChange handler in Input Control"}const w=function(e){let{checked:t,className:a,disabled:o,onChange:n,value:s,...l}=e;return i(f,{type:"radio",...l},i("input",{checked:t,className:a,disabled:o,onChange:e=>n(e.target.value),type:"radio",value:s}))};function C(e){let{checked:t,label:a,onChange:o,options:n,...s}=e;return i(f,{type:"radios",...s},_.map(n,((e,a)=>{if(!e.hide)return i(w,{key:a,value:e.value,checked:t==e.value||null==t&&""==e.value,onChange:e=>o(e),disabled:e.disabled,label:e.label})})))}function x(e){let{className:t,onChange:a,options:o,placeholder:n,value:s,...l}=e,r=[...o];return void 0!==n&&r.unshift({value:"",label:n}),i(f,{type:"select",...l},i("select",{className:t,value:null!=s?s:"",onChange:e=>a(e.target.value)},_.map(r,((e,t)=>i("option",{key:t,value:e.value,disabled:e.disabled},e.label)))))}function S(e){let{className:t,onChange:a,...o}=e;return i(f,{type:"textarea",...o},i("textarea",{className:t,onChange:e=>a(e.target.value)}))}function N(e){let t=e.className?" "+e.className:"";return i("div",{className:"mapp-option-section"+t},i("h2",null,e.title),e.children)}function O(e){const t=e.className?"mapp-option "+e.className:"mapp-option";return i("div",{className:t},i("div",{className:"mapp-option-title"},e.title),i("div",{className:"mapp-option-value"},e.children))}function M(e){const[t,a]=c({dragging:null,dragover:null});function n(e){a((t=>({...t,...e})))}function s(a,o){let i=[...e.data];switch(a){case"add":let a={};_.map(e.cols,(e=>{a[e.id]=""})),i.push(a),e.onChange(i,e.selected);break;case"change":i[o.i][o.id]=o.value,e.onChange(i,e.selected);break;case"delete":let s;i.splice(o,1),s=o==e.selected?null:o<e.selected?e.selected-1:e.selected,e.onChange(i,s);break;case"select":n({selected:o}),e.onChange(i,o);break;case"sort":let l=t.dragging,r=l<o?o-1:o;i.splice(r,0,i.splice(l,1)[0]),e.onChange(i,r),n({dragover:null})}}return i("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&i("div",{className:"mapp-grid-table"},function(){const t=e.selectionColumn?i("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,a=i("div",{className:"mapp-grid-cell",key:"actions"},"");return i("div",{className:"mapp-grid-header"},i("div",{className:"mapp-grid-row"},t,_.map(e.cols,(e=>i("div",{className:"mapp-grid-cell",key:e.id},e.label))),a))}(),i("div",{className:"mapp-grid-body"},_.map(e.data,((a,l)=>function(a,l){return i("div",{className:"mapp-grid-row"+(t.dragover==l?" mapp-dragover":""),draggable:!0,key:l,onDragOver:e=>e.preventDefault(),onDragStart:e=>n({dragging:l}),onDragEnter:e=>n({dragover:l}),onDragEnd:e=>n({dragging:null,dragover:null}),onDrop:e=>s("sort",l)},function(t,a){if(!e.selectionColumn)return null;let o,n;return"rowid"==e.selectionColumn?o=a:t[e.selectionColumn]?o=t[e.selectionColumn]:n=!0,"checkbox"===e.selectionType?i("div",{className:"mapp-grid-cell"},i(y,{value:o,checked:e.selected==o,disabled:n,onChange:e=>{s("select",e?o:null)}})):i("div",{className:"mapp-grid-cell"},i(w,{checked:e.selected==o,onChange:()=>s("select",o)}))}(a,l),_.map(e.cols,((t,a)=>i("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:l+"-"+a},function(t,a){if(a.onRender)return a.onRender({id:a.id,value:e.data[t][a.id],onChange:e=>s("change",{i:t,id:a.id,value:e})});switch(a.type){case"icon":return i(o.MappIconPicker,{iconid:e.data[t][a.id],onChange:e=>s("change",{i:t,id:a.id,value:e})});default:return i(k,{size:e.data[t][a.size],value:e.data[t][a.id],onChange:e=>s("change",{i:t,id:a.id,value:e})});case"select":return i(x,{value:e.data[t][a.id],options:a.options,onChange:e=>{s("change",{i:t,id:a.id,value:e})},placeholder:""})}}(l,t)))),function(e){return i("div",{className:"mapp-grid-cell",key:"delete"},i(m,{icon:"trash",onClick:()=>s("delete",e)}))}(l))}(a,l))))),i("div",{className:"mapp-grid-toolbar"},i(m,{isSecondary:!0,onClick:()=>s("add")},__("Add"))))}function P(e){let{data:t,isDraggable:a,onAdd:o,onChangeData:n,onRender:l,...r}=e;const[p,d]=c({dragging:null,dragover:null,isDraggable:!1});function u(e){d((t=>({...t,...e})))}function h(e,a,i){let s=[...t];switch(e){case"add":const e=o?o():{};s.push(e),n(s);break;case"change":s[i]={...t[i],...a},n(s);break;case"delete":confirm(mappl10n.delete_prompt)&&(s.splice(a,1),n(s));break;case"sort":let l=p.dragging,r=l<a?a-1:a;s.splice(r,0,s.splice(l,1)[0]),n(s),u({dragover:null})}}return s((()=>{}),[]),i("div",{className:"mapp-crud-list"},_.map(t,((e,t)=>i("div",{className:"mapp-crud-row"+(p.dragover==t?" mapp-dragover":""),draggable:a,key:t,onDragOver:e=>e.preventDefault(),onDragStart:e=>u({dragging:t}),onDragEnter:e=>u({dragover:t}),onDragEnd:e=>u({dragging:null,dragover:null}),onDrop:e=>h("sort",t)},l({row:e,rowId:t,onChange:e=>h("change",e,t),onDelete:()=>h("delete",t)})))),i("div",{className:"mapp-crud-toolbar"},i(m,{isSecondary:!0,onClick:()=>h("add")},__("Add"))))}function I(e){let{actions:t,initialOpen:a,showToggle:o,subTitle:n,title:s,...l}=e;const[r,p]=c({isOpen:!o||a});function d(e,t){if("toggle"===e)o&&(a={isOpen:!r.isOpen},p((e=>({...e,...a}))));var a}let m="mapp-expand";return m+=r.isOpen?"":" mapp-expand-closed",m+=l.className?" "+l.className:"",i("div",{className:m},i("div",{className:"mapp-expand-header",onClick:()=>d("toggle")},i("div",null,s,n),o&&i("div",null,i(u,{icon:r.isOpen?"arrow-up":"arrow-down"}))),i("div",{className:"mapp-expand-body"},l.children),t&&i("div",{className:"mapp-expand-footer"},t))}function z(e){const[t,a]=c({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null});function o(e){a((t=>({...t,...e})))}const s=r((e=>{if(null!=e){let a=wp.codeEditor.initialize(e);a.codemirror.setSize("auto","auto"),a.codemirror.setOption("readOnly","editor"!=t.tab),o({codeEditor:a})}}),[]);function l(e,a){switch(e){case"close":o({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&(mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_delete",name:t.template.name,nonce:mappl10n.options.nonce}}),o({isOpen:!1}));break;case"insert":let e=t.codeEditor.codemirror.getDoc(),i=e.getCursor();e.replaceRange("{{{poi."+a+"}}}",i);break;case"open":mapp.lib.ajax({type:"GET",data:{action:"mapp_tpl_get",name:a,nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status&&o({isOpen:!0,name:a,tab:"editor",template:e.data.template,tokens:e.data.tokens})}});break;case"save":let n="editor"==t.tab?t.codeEditor.codemirror.getValue():t.template.content;mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_save",content:n,name:t.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&o({isOpen:!1,template:null,tokens:null})}});break;case"tab-select":if("editor"!=a){let e={...t.template};e.content=t.codeEditor.codemirror.getValue(),o({template:e})}o({tab:a})}}function p(){const e=t.template.name+" ("+(t.template.exists?__("Custom"):__("New"))+")";return i("div",{className:"mapp-templates-name"},e)}return i("div",{className:"mapp-templates"},function(){const e=[{name:"map-popup",label:__("Map popup")},{name:"map-item",label:__("Map list item")},{name:"mashup-popup",label:__("Mashup popup")},{name:"mashup-item",label:__("Mashup list item")}];return i("div",{className:"mapp-templates-list"},_.map(e,((e,t)=>i("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:t=>{t.preventDefault(),l("open",e.name)}},e.label))))}(),t.isOpen&&t.template?i(h,{title:p(),className:"mapp-templates-modal",onRequestClose:()=>l("close"),shouldCloseOnClickOutside:!1},i(g,{className:"mapp-templates-tabs",onSelect:e=>l("tab-select",e),tabs:[{name:"editor",title:__("Editor")},{name:"standard",title:__("Default")}]},(e=>function(){const e=i("div",{className:"mapp-templates-tokens"},_.map(t.tokens,((e,t)=>i("code",{onClick:()=>l("insert",e.token),key:t,title:e.label},e.label)))),a=i("div",{className:"mapp-templates-path"},t.template.path);return i(n,null,"editor"==t.tab&&a,"editor"==t.tab&&e,i("div",{className:"editor"==t.tab?"mapp-templates-editor":"mapp-templates-standard"},i("textarea",{ref:s,defaultValue:"editor"==t.tab?t.template.content:t.template.standard})))}())),i("div",{className:"mapp-templates-toolbar"},i(m,{isPrimary:!0,onClick:()=>l("save")},__("Save")),i(m,{isSecondary:!0,onClick:()=>l("close")},__("Cancel")),t.template.exists&&i("a",{onClick:e=>{e.preventDefault(),l("delete")}},__("Delete")))):null)}},149:(e,t,a)=>{"use strict";a.d(t,{S:()=>b});const o=wp.element.createElement,{select:i}=wp.data,{Fragment:n,useEffect:s,useLayoutEffect:l,useRef:r,useState:p}=wp.element,{BaseControl:c,Button:d,Dashicon:m,Modal:u,PanelBody:_,RadioControl:h,Spinner:g,TextControl:f}=wp.components,{sprintf}=wp.i18n;function b(e){function t(t,a){const o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.onChange(e.page+1);break;case"prev":e.onChange(e.page-1)}}return function(){const a=Math.ceil(e.count/e.pageSize),i=e.page<=1,n=e.page>=a;return o("div",{className:"mapp-paginate"},o(d,{disabled:i,onClick:()=>t("first"),isSecondary:!0},"«"),o(d,{disabled:i,onClick:()=>t("prev"),isSecondary:!0},"‹"),o("div",{className:"mapp-paginate-count"},sprintf((s="%d of %d",wp.i18n.__(s,"mappress-google-maps-for-wordpress")),e.page,a)),o(d,{disabled:n,onClick:()=>t("next"),isSecondary:!0},"›"),o(d,{disabled:n,onClick:()=>t("last"),isSecondary:!0},"»"));var s}()}},477:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>C});var o=a(713),i=a(999),n=a(149),s=a(677);window.mapp=window.mapp||{};const l=wp.element.createElement,{select:r}=wp.data,{Fragment:p,useEffect:c,useLayoutEffect:d,useRef:m,useState:u}=wp.element,{BaseControl:h,Button:g,Dashicon:f,Icon:b,Modal:y,PanelBody:v,Spinner:k,TextControl:w}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function C(e){const[t,a]=u({counts:{all:null,trashed:null,post:null},filter:"all",isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:""}),{addSnackbar:p,renderSnackbar:d}=(0,s.D)(),h=m(null),v=m(null),C=m(null);function x(e){a((t=>({...t,...e})))}function S(a,o){switch(a){case"attach":mapp.store.mutateMap(o.mapid,o.mapdata);break;case"add-new":x({mode:"edit",mapid:null});break;case"close":e.onAction("pick-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(mapp.store.destroyMap(o),p(__("Map deleted"))),v.current&&v.current.focus();break;case"detach":mapp.store.mutateMap(o,{postid:0});break;case"duplicate":mapp.store.duplicateMap({mapid:o,success:e=>{p(__("Map copied")),x({mapid:e.mapid}),h.current&&(h.current.scrollTop=0)}});break;case"edit":if("trash"==t.filter)return;x({mode:"edit",mapid:o});break;case"edit-close":"edit"==e.mode?e.onAction("pick-close"):x({mode:"list"});break;case"edit-save":"edit"==e.mode?e.onAction("pick-close",o):(x({mode:"list",mapid:o}),p(sprintf(__("Map %d saved"),o)));break;case"filter":x({filter:o});break;case"insert":e.onAction("pick-insert",o);break;case"page":x({page:o}),h.current&&(h.current.scrollTop=0);break;case"restore":mapp.store.mutateMap(o,{status:"",postid:0}),p(__("Map restored"));break;case"shortcode":let a=jQuery("<input>");jQuery("body").append(a),a.val('[mappress mapid="'+o+'"]').select(),document.execCommand("copy"),a.remove(),p(__("Shortcode copied"));break;case"sort":mapp.store.setSort({sortBy:o,sortAsc:mapp.store.state.sortBy!=o||!mapp.store.state.sortAsc});break;case"trash":case"edit-trash":mapp.store.mutateMap(o,{status:"trashed"}),p(__("Map moved to trash")),t.mapid&&o==t.mapid&&e.onAction("pick-trash",o)}}function N(a){let i,n=a.mapid==t.mapid;i=a.map_title?a.map_title:__("Untitled");let s,p=function(t){let a;return a="map"==e.context||"mashup"==e.context&&t.postid==mappl10n.options.postid?r("core/editor").getEditedPostAttribute("title"):t.post_title,a=a||__("Untitled"),t.postid>0&&t.postid==mappl10n.options.postid&&(a=__("Current post")),t.postid>0?t.postid==mappl10n.options.postid?a:l("a",{href:mappl10n.options.editurl+"?post="+t.postid+"&action=edit",target:"_blank",title:__("Edit post")},a):__("Unattached")}(a);s="trash"==t.filter?[{action:"restore",label:__("Restore")},{action:"destroy",label:__("Delete Permanently"),isDestructive:!0}]:[{action:"edit",label:__("Edit")},{action:"insert",label:__("Insert into post"),hide:"library"==e.context},{action:"duplicate",label:__("Copy")},{action:"trash",label:__("Trash")}],s=l("div",{className:"mapp-pick-actions"},s.map((e=>!e.hide&&l("a",{className:e.isDestructive?"mapp-destructive":"",href:"#",key:e.action,onClick:t=>{t.stopPropagation(),t.preventDefault(),S(e.action,a.mapid)}},e.label))));let c=null;return c=a.postid>0?l("a",{href:"#",onClick:()=>S("detach",a.mapid)},__("Detach")):"library"==e.context?l(o.default,{onChange:(e,t)=>S("attach",{mapid:a.mapid,mapdata:{postid:e,post_title:t}})},__("Attach")):l("a",{href:"#",onClick:()=>S("attach",{mapid:a.mapid,mapdata:{postid:mappl10n.options.postid,post_title:null}})},__("Attach")),l("div",{className:"mapp-pick-item"+(n?" mapp-selected":""),key:a.mapid+"|"+a.postid,ref:n?C:null},l("div",{className:"mapp-pick-col-mapid",onClick:e=>S("edit",a.mapid)},a.mapid),l("div",{className:"mapp-pick-col-map_title",onClick:e=>S("edit",a.mapid)},l("div",null,i),l("div",null,s)),l("div",{className:"mapp-pick-col-post_title"},p,l("div",null,c)),"library"==e.context&&l("div",{className:"mapp-pick-col-shortcode"},l(g,{isSmall:!0,isSecondary:!0,onClick:e=>{e.stopPropagation(),e.preventDefault(),S("shortcode",a.mapid)}},__("Copy"))))}c((()=>{const e=e=>{if(!e.isFetchingItems){let t={all:0,post:0,trash:0};_.map(e.items,(e=>{"trashed"==e.status?t.trash++:(t.all++,e.postid==mappl10n.options.postid&&t.post++)})),x({counts:t})}x({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)})),c((()=>{mapp.store.fetchItems()}),[]),c((()=>{x({page:1})}),[t.filter,t.search]),c((()=>{"list"==t.mode&&v.current&&v.current.focus()}),[t.mode]);const O=_.filter(t.items,(function(a){if("trash"==t.filter)return"trashed"==a.status;if("trashed"==a.status)return!1;if("post"==t.filter&&a.postid!=mappl10n.options.postid)return!1;if("current"==t.filter&&a.mapid!=e.mapid)return!1;var o=t.search.toLowerCase();return!o||(a.mapid.indexOf(o)>=0||(!!(a.post_title&&a.post_title.toLowerCase().indexOf(o)>=0)||!!(a.map_title&&a.map_title.toLowerCase().indexOf(o)>=0)))}));let M=l("div",{className:"mapp-list-panel"},l("div",{className:"mapp-gt-modal-header"},l("div",{className:"mapp-gt-modal-header-title"},l("h1",null,__("Maps")),l(g,{isPrimary:!0,onClick:()=>S("add-new")},__("Add New"))),l(g,{onClick:()=>S("close"),icon:"no-alt"})),function(){let a=[{label:__("All"),value:"all"},{label:__("Attached to post"),value:"post",hide:"library"==e.context},{label:__("Selected"),value:"current",hide:"library"==e.context||!e.mapid},{label:__("Trash"),value:"trash"}];return l("div",{className:"mapp-pick-filter-wrapper"},l("div",{className:"mapp-pick-filter-tabs"},_.map(a,((e,a)=>{const o="mapp-pick-filter-tab"+(t.filter==e.value?" mapp-active":""),i="current"!=e.value?t.counts[e.value]:null;if(!e.hide)return l("div",{className:o,href:"#",key:a,onClick:()=>S("filter",e.value)},e.label,null!=i&&l("span",{className:"mapp-pick-filter-count"},i))}))),function(){if("trash"!=t.filter)return l("div",{className:"mapp-pick-search-wrapper"},l(w,{ref:v,className:"mapp-pick-search",tabIndex:1,placeholder:__("post title, map title, or map id"),onChange:e=>x({search:e}),size:50,value:t.search}),l(b,{icon:"search"}),(t.isFetchingItems||t.isAttaching&&"library"!=e.context)&&l(k,null))}())}(),function(a){if(a){const e=20*(t.page-1),o=e+20;a=a.slice(e,o)}let o="";return o=t.isFetchingItems?null:a.length?_.map(a,N):l("div",{className:"mapp-pick-message"},__("No maps found")),l("div",{className:"mapp-pick-items-section"},l("div",{className:"mapp-pick-items",ref:h},function(){let t=[{id:"mapid",label:__("ID"),sortable:!0},{id:"map_title",label:__("Map title"),sortable:!0},{id:"post_title",label:__("Attached to"),sortable:!0}];"library"==e.context&&t.push({id:"shortcode",label:__("Shortcode"),sortable:!1});return l("div",{className:"mapp-pick-items-header"},_.map(t,(e=>l("div",{className:"mapp-pick-col-"+e.id,onClick:()=>S("sort",e.id),key:e.id},e.label,e.sortable&&mapp.store.state.sortBy==e.id&&l(f,{icon:mapp.store.state.sortAsc?"arrow-up":"arrow-down"}),e.sortable&&mapp.store.state.sortBy!=e.id&&l(f,{icon:"leftright"})))))}(),o))}(O),function(e){return l("div",{className:"mapp-pick-toolbar"},function(e){return e&&e.length?l(n.S,{count:e?e.length:0,onChange:e=>S("page",e),page:t.page,pageSize:20}):null}(e))}(O)),P=null;if("edit"==t.mode){let a=l("div",{className:"mapp-edit-panel"},l(i.default,{context:e.context,mapid:t.mapid,onAction:S}));P="library"==e.context?l(y,{className:"mapp-gt-modal",isDismissible:!1},a):a}const I="mapp-pick mapp-mode-"+t.mode+" mapp-context-"+e.context;return"library"==e.context?l("div",{className:I},M,P,d()):l(y,{className:"mapp-gt-modal "+I,isDismissible:"list"==t.mode,onRequestClose:()=>S("close"),shouldCloseOnEsc:"list"==t.mode,shouldCloseOnClickOutside:"list"==t.mode},M,P,d())}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-library")&&(mappl10n.options.postid=0,wp.element.render(l(C,{context:"library"}),document.getElementById("mapp-library")))}))},429:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappSettings:()=>y});var o=a(710),i=a(677),n=a(824);window.mapp=window.mapp||{};const s=wp.element.createElement,{Fragment:l,useEffect:r,useLayoutEffect:p,useRef:c,useState:d}=wp.element,{BaseControl:m,Button:u,ButtonGroup:_,Dashicon:h,Dropdown:g,Panel:f,PanelBody:b}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function y(e){const[t,a]=d({});const{addSnackbar:r,renderSnackbar:p}=(0,i.D)();function c(e){if(!e||"string"!=typeof e)return e;const t={px:2048,vw:100,vh:100,"%":100};let a=parseInt(e),o=2048,i="";for(var n in t)e.includes(n)&&(i=n,o=t[n]);return a>o?o+i:e}function m(t,a){let o=null;switch(t){case"poiList":e.map.set({poiList:a}),o={poiList:a};break;case"search":e.map.set({search:a}),o={search:a};break;case"size":a.hasOwnProperty("height")&&(a.height=c(a.height)),a.hasOwnProperty("width")&&(a.width=c(a.width)),e.map.setSize(a),o=a;break;case"style-set-maptypeid":e.map&&e.map.set({mapTypeId:a}),o={mapTypeId:a};break;case"viewport-reset":e.map.center=e.map.zoom=null,e.map.recenter(),o={center:void 0,zoom:void 0},r(__("Viewport automatic"));break;case"viewport-set":let t=e.map.getCenter().toJSON();e.map.center=t,e.map.zoom=e.map.getZoom(),o={center:t.lat+","+t.lng,zoom:e.map.getZoom()},r(__("Viewport set"))}o&&e.onAction("change-settings",o)}const h="mce"!=e.context&&"library"!=e.context;return s("div",{className:"mapp-settings"},s(b,{title:__("Map settings"),initialOpen:h},"map"==e.context&&function(){const t=e.map.title?e.map.title:__("Untitled");return s("div",{className:"mapp-settings-row mapp-settings-title"},s(n.Control,{labelTop:__("Title")},t),s(n.Control,{labelTop:__("Map ID")},e.map.mapid))}(),function(){if("mashup"==e.context)return s("div",{className:"mapp-settings-row mapp-style-toggle"},s("div",null,__("Style")),s(o.m,{map:e.map,selected:e.map.mapTypeId,onChange:e=>m("style-set-maptypeid",e)}))}(),function(){mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];var t=mappl10n.options.sizes.map(((e,t)=>({label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1})));t.unshift({height:"",label:__("Default"),value:0,width:""}),t.push({label:__("Custom"),value:"custom",disabled:!0});for(var a="custom",o=0;o<t.length-1;o++)t[o].width==e.width&&t[o].height==e.height&&(a=o);return s(l,null,s("div",{className:"mapp-settings-row"},s(n.Select,{className:"mapp-settings-dims-select",help:"",labelTop:__("Size"),value:a,options:t,onChange:e=>m("size",{width:t[e].width,height:t[e].height})})),s("div",{className:"mapp-settings-row"},s(n.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vw")},labelTop:__("Width"),onChange:e=>m("size",{width:e}),value:e.width?e.width:""}),s(n.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vh")},labelTop:__("Height"),onChange:e=>m("size",{height:e}),value:e.height?e.height:""})))}(),s("div",{className:"mapp-settings-row"},s(n.Control,{className:"mapp-settings-viewport",labelTop:__("Center/Zoom")},s(_,{label:__("Center/Zoom")},s(u,{onClick:()=>m("viewport-reset"),isPressed:!e.center,isSmall:!0},__("Automatic")),s(u,{onClick:()=>m("viewport-set"),isPressed:e.center,isSmall:!0},__("Set"))))),void 0,p()))}},677:(e,t,a)=>{"use strict";a.d(t,{D:()=>l});const{useEffect:o,useState:i}=wp.element,{createContext:n}=React,s=wp.element.createElement,l=()=>{const[e,t]=i({snackbars:[]});function a(e){t((t=>({...t,...e})))}o((()=>{if(e.snackbars.length){const t=setTimeout((()=>{let t=[...e.snackbars];t.shift(),a({snackbars:t})}),5e3);return()=>clearTimeout(t)}}),[e.snackbars]);return{addSnackbar:t=>a({snackbars:[...e.snackbars,t]}),renderSnackbar:()=>s("div",{className:"mapp-snackbars"},e.snackbars.map(((e,t)=>s("div",{className:"mapp-snackbar mapp-snackbar-show",key:t},e))))}}},787:()=>{window.mapp=window.mapp||{};mapp.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"mapid",sortAsc:!1,maps:{},items:[]}},mapp.Store.prototype={createMap:function(){let{success:e=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isFetchingMap=!1,this.publish(),e()},destroyMap:function(e){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:e,nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status&&(delete this.state.maps[e],this.destroyItem(e)),this.publish()}})},duplicateMap:function(){let{mapid:e,success:t=(()=>{}),failure:a=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isSavingMap=!0,this.publish(),mapp.lib.ajax({type:"POST",data:{action:"mapp_duplicate",mapid:e,postid:mappl10n.options.postid,nonce:mappl10n.options.nonce},callback:e=>{if(e&&"OK"==e.status){let a=e.data,o=a.mapid;this.state.maps[o]=a,this.saveItem(o,a),t(a)}else a();this.state.isSavingMap=!1,this.publish()}})},fetchMap:function(e){let{mapid:t,success:a=(()=>{}),failure:o=(()=>{})}=e;if(void 0!==this.state.maps[t])return this.publish(),void a(this.state.maps[t]);this.state.isFetchingMap=!0,this.publish(),mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status?(this.state.maps[t]=e.data,a(e.data)):this.state.maps[t]=null,this.state.isFetchingMap=!1,this.publish()}})},mutateMap:function(e,t){this.state.isSavingMap=!0,this.saveItem(e,t),this.publish(),mapp.lib.ajax({type:"POST",data:{action:"mapp_mutate",mapid:e,mapdata:t,nonce:mappl10n.options.nonce},callback:e=>{this.state.isSavingMap=!1,this.publish()}})},saveMap:function(){let{mapdata:e,success:t=(()=>{}),failure:a=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isSavingMap=!0,this.publish(),mapp.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(e),nonce:mappl10n.options.nonce},callback:o=>{if(o&&"OK"==o.status){const a=o.data;e.mapid=a,this.state.maps[a]=e,this.saveItem(a,e),t(e)}else a();this.state.isSavingMap=!1,this.publish()}})},destroyItem:function(e){let t=this.state.items?this.state.items:[],a=_.findIndex(t,{mapid:e});a>-1&&t.splice(a,1),this.state.items=[...t],this.publish()},fetchItems(){let{success:e=(()=>{}),failure:t=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.state.itemsFetched)return e(this.state.items),void this.publish();this.state.isFetchingItems=!0,this.publish(),mapp.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:a=>{a&&"OK"==a.status?(this.state.items=a.data,this.sort(),e(this.state.items),this.state.itemsFetched=!0):t(),this.state.isFetchingItems=!1,this.sort(),this.publish()}})},saveItem:function(e,t){let a=this.state.items?this.state.items:[],o=_.findWhere(a,{mapid:e});o?(_.map(["mapid","title","postid","post_title","status"],(e=>{void 0!==t[e]&&(o[e]=t[e])})),o={...o}):(o={mapid:e,map_title:t.title,postid:mappl10n.options.postid,post_title:null},a.unshift(o))},setSort:function(e){e.sortBy&&(this.state.sortBy=e.sortBy),void 0!==e.sortAsc&&(this.state.sortAsc=e.sortAsc),this.sort(),this.publish()},sort:function(e,t){const a=(o="untitled",wp.i18n.__(o,"mappress-google-maps-for-wordpress"));var o;this.state.items.sort(((e,t)=>function(e,t,o,i){if(i=i?1:-1,"mapid"==o)return i*(Number(e.mapid)-Number(t.mapid));let n=e[o]?e[o]:a,s=t[o]?t[o]:a,l=i*n.localeCompare(s);return 0==l?Number(e.mapid)-Number(t.mapid):l}(e,t,this.state.sortBy,this.state.sortAsc)))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){let e=[...this.subs];for(let t of e)t(this.state)}},mapp.store=new mapp.Store},710:(e,t,a)=>{"use strict";a.d(t,{m:()=>k});var o=a(824),i=a(149);const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useRef:p,useState:c}=wp.element,{Button:d,Dashicon:m,ExternalLink:u,Icon:h,Modal:g,Panel:f,PanelBody:b,PanelRow:y,Spinner:v}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function k(e){const[t,a]=c({apiKey:"6a0cfe9e-3670-4598-a63e-f1627b5c9e56",isOpen:!1,isBusy:!1,isSearching:!1,mapboxError:"",mapboxId:"",mapboxName:"",mapboxUser:"",mapboxUrl:"",mapboxParsedUrl:"",mode:"pick",page:1,snazzyPagination:null,snazzySearch:"",snazzySelected:null,snazzyStyles:null,standardStyles:mappl10n.options.standardStyles,userStyles:mappl10n.options.userStyles});function l(e){a((t=>({...t,...e})))}function r(a){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=_.findIndex(t.userStyles,{id:a.id});i>=0&&!o&&!confirm(__("Style already exists, overwrite?"))||(l({isBusy:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_style_save",style:a,nonce:mappl10n.options.nonce},callback:t=>{l({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,l({mode:"pick",userStyles:t.data}),e.onChange(a.id))}}))}function p(e){l({isSearching:!0,snazzyStyles:null}),mapp.lib.ajax({type:"GET",data:{sort:"popular",page:e,pageSize:20,text:t.snazzySearch,key:t.apiKey},url:"https://snazzymaps.com/explore.json",callback:function(e){if(l({isSearching:!1,snazzyPagination:e&&e.pagination?e.pagination:null}),e&&e.styles){l({snazzyStyles:_.map(e.styles,((e,t)=>(e.id=e.id+"",e)))})}else alert("Error: unable to fetch styles")}})}function m(e,t){t="large"==t||"small"==t?t:"small",t=800;let a=mappl10n.options.baseurl+"/images/json_style.png";if("leaflet"==mappl10n.options.engine?mappl10n.options.mapbox?e.user&&e.mapboxid&&(a="https://api.mapbox.com/styles/v1/"+e.user+"/"+e.mapboxid+"/static/-122.4194,37.7749,10,0/800x800?access_token="+mappl10n.options.mapbox):a=mappl10n.options.baseurl+"/images/osm.png":e.imageUrl&&(a=e.imageUrl),a)return n("img",{src:a,title:e.name})}function f(a,o){switch(a){case"close":case"pick-cancel":l({isOpen:!1});break;case"json-add":l({mode:"json-add"});break;case"json-cancel":case"mapbox-cancel":case"snazzy-cancel":l({mode:"pick"});break;case"json-edit":e.onChange(o.id),l({mode:"json-edit"});break;case"json-save":r(o,!0);break;case"mapbox-add":case"snazzy-add":alert(__("Please upgrade to MapPress Pro to use custom styles"));break;case"mapbox-change-url":{let e,t,a;e=o.trim().toLowerCase(),e=e.replace(".html","").replace("https://api.mapbox.com/styles/v1/","").replace("mapbox://styles/",""),e=e.split("?")[0];let i=e.split("/");2==i.length&&(t=i[0],a=i[1]),l({mapboxUrl:o,mapboxUser:t,mapboxId:a});break}case"mapbox-edit":e.onChange(o.id),l({mode:"mapbox",mapboxId:o.mapboxid,mapboxName:o.name,mapboxUrl:o.url,mapboxUser:o.user});break;case"mapbox-save":t.mapboxName&&t.mapboxUser&&r({id:t.mapboxId,name:t.mapboxName,mapboxid:t.mapboxId,provider:"mapbox",url:t.mapboxUrl,user:t.mapboxUser});break;case"mode":l({mode:o});break;case"open":"leaflet"!=mappl10n.options.engine||mappl10n.options.mapbox?l({isOpen:!0}):alert(__("Please enter a Mapbox access token in the MapPress settings screen to use styled maps."));break;case"pick-delete":confirm(mappl10n.delete_prompt)&&(i=o,_.findIndex(t.userStyles,{id:i})<0?mapp.lib.alert("Invalid delete"):(l({isBusy:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_style_delete",id:i,nonce:mappl10n.options.nonce},callback:t=>{l({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,l({userStyles:t.data}),e.selected==i&&e.onChange(null))}})));break;case"pick-select":e.onChange(o),l({isOpen:!1});break;case"snazzy-save":{let e=_.findWhere(t.snazzyStyles,{id:o});e&&r({id:o,imageUrl:e.imageUrl,json:e.json,name:e.name});break}case"snazzy-search":p()}var i}function b(){let a;return"json-add"==t.mode?a={id:null,name:"",json:""}:"json-edit"==t.mode&&(a=e.selected?_.findWhere(t.userStyles,{id:e.selected}):null),n(w,{style:a,onSave:e=>f("json-save",e),onCancel:()=>f("json-cancel")})}function y(e){let a;return a=e.styles&&e.styles.length?_.map(e.styles,((t,a)=>function(e,t){let a,o="mapp-style"+(t.selected==e.id?" mapp-selected":"");(t.onEdit||t.onDelete)&&(a=n("div",{className:"mapp-style-actions"},n("a",{onClick:()=>t.onEdit(e)},__("Edit")),n(h,{icon:"trash",onClick:()=>t.onDelete(e.id)})));return n("div",{className:o,key:e.id},n("div",{className:"mapp-style-image",onClick:()=>t.onSelect(e.id)},m(e)),n("div",{className:"mapp-style-details"},n("div",{className:"mapp-style-title"},e.name),a))}(t,e))):t.isSearching?"":n("div",{className:"mapp-style-list-msg"},__("No results")),n("div",{className:"mapp-style-list-wrapper"},n("div",{className:"mapp-style-list-header"},e.title),n("div",{className:"mapp-style-list"},a))}return n(s,null,function(){const a=t.standardStyles.concat(t.userStyles);let o=!mappl10n.options.style||"roadmap"!=e.selected&&"streets"!=e.selected&&e.selected?e.selected:mappl10n.options.style,i=_.findWhere(a,{id:o});return i=i||t.standardStyles[0],n(d,{className:"mapp-style-toggle",icon:m(i),iconSize:75,isSecondary:!0,onClick:()=>f("open",null),title:i.name})}(),"edit"==t.mode&&t.isOpen&&renderEdit(),"json-add"==t.mode&&t.isOpen&&b(),"json-edit"==t.mode&&t.isOpen&&b(),"mapbox"==t.mode&&t.isOpen&&function(){let e=t.mapboxUser&&t.mapboxId?m({user:t.mapboxUser,mapboxid:t.mapboxId,name:t.mapboxName},"large"):null;const a=!t.mapboxUser||!t.mapboxId||!t.mapboxName;return n(g,{title:__("Add style"),className:"mapp-style-modal",onRequestClose:()=>f("mapbox-cancel"),shouldCloseOnClickOutside:!0},n("div",{className:"mapp-style-mapbox-title"},__("Enter style from Mapbox Studio"),n(u,{href:"https://studio.mapbox.com"})),n("form",{className:"mapp-style-mapbox-form",onSubmit:e=>{e.stopPropagation(),e.preventDefault(),f("mapbox-save")}},n("label",null,n(o.Input,{autoFocus:!0,className:"mapp-style-mapbox-url",labelTop:n(s,null,__("MapBox Share URL"),n(o.Help,{href:"#toc-mapbox-studio-styles"})),onChange:e=>f("mapbox-change-url",e),value:t.mapboxUrl})),n("label",null,n("div",{className:"mapp-style-mapbox-label"},__("Style name")),n(o.Input,{className:"mapp-style-mapbox-name",value:t.mapboxName,onChange:e=>l({mapboxName:e})})),n("div",{className:"mapp-style-mapbox-preview"},e),n("div",{className:"mapp-style-toolbar"},n("div",null,n(d,{isBusy:t.isBusy,isPrimary:!0,disabled:a,type:"submit"},__("Save")),n(d,{isBusy:t.isBusy,onClick:()=>f("mapbox-cancel")},__("Cancel"))))))}(),"pick"==t.mode&&t.isOpen&&function(){let a="";return t.userStyles&&t.userStyles.length&&(a=y({selected:e.selected,onEdit:e=>"leaflet"==mappl10n.options.engine?f("mapbox-edit"):f("json-edit",e),onDelete:e=>f("pick-delete",e),onSelect:e=>f("pick-select",e),styles:t.userStyles,title:__("Custom styles")})),n(g,{title:n("div",{className:"mapp-style-header"},__("Select a style")),className:"mapp-style-modal",onRequestClose:()=>f("close")},n("div",{className:"mapp-style-list-wrapper"},y({onSelect:e=>f("pick-select",e),selected:e.selected,styles:t.standardStyles,title:__("Standard styles")}),a),n("div",{className:"mapp-style-toolbar"},n("div",null,n(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>"leaflet"==mappl10n.options.engine?f("mapbox-add"):f("json-add")},__("New style")),"google"==mappl10n.options.engine&&n(d,{isBusy:t.isBusy,isSecondary:!0,onClick:()=>f("snazzy-add")},__("Download style")),n(d,{isBusy:t.isBusy,onClick:()=>f("pick-cancel")},__("Cancel")))))}(),"snazzy"==t.mode&&t.isOpen&&(t.snazzySelected,n(g,{title:__("Download style"),className:"mapp-style-modal mapp-style-modal-snazzy",onRequestClose:()=>f("snazzy-cancel"),shouldCloseOnClickOutside:!0},n("form",{className:"mapp-style-snazzy-form",onSubmit:e=>{f("snazzy-search"),e.preventDefault()}},n(o.Input,{className:"mapp-style-snazzy-search",value:t.search,placeholder:__("Search"),onChange:e=>l({snazzySearch:e})}),t.isSearching&&n(v,null),!t.isSearching&&n(d,{isPrimary:!0,icon:"search",onClick:()=>f("snazzy-search")})),y({selected:t.snazzySelected,styles:t.snazzyStyles,onSelect:e=>l({snazzySelected:e})}),n("div",{className:"mapp-style-toolbar"},n("div",null,n(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>f("snazzy-save",t.snazzySelected)},__("Save")),n(d,{isBusy:t.isBusy,onClick:()=>f("snazzy-cancel")},__("Cancel"))),function(){const e=t.snazzyPagination;return e&&t.snazzyStyles&&t.snazzyStyles.length?n(i.S,{count:e.totalItems,onChange:e=>p(e),page:e.currentPage,pageSize:e.pageSize}):null}()))))}function w(e){const[t,a]=c((()=>{let t={...e.style},a="";try{a=JSON.stringify(JSON.parse(t.json),null,2)}catch(e){}return t.json=a,{style:t}}));function i(e){a((t=>({...t,...e})))}function s(a,o){let n={...t.style};switch(a){case"cancel":e.onCancel();break;case"change-json":n.json=o,i({style:n});break;case"change-name":n.name=o,i({style:n});break;case"save":n.json=n.json?JSON.stringify(JSON.parse(n.json)):"",e.onSave(n)}}let l;if(t.style.json)try{JSON.parse(t.style.json)}catch(e){l=e.toString()}let r=l?"mapp-json mapp-json-error":"mapp-json";return n(g,{title:n(o.Input,{value:t.style.name,onChange:e=>s("change-name",e),placeholder:__("Enter style name")}),className:"mapp-style-modal mapp-json-modal",onRequestClose:()=>s("cancel"),shouldCloseOnClickOutside:!0},n("div",null,__("JSON")),n("div",{className:r},n("textarea",{value:t.style.json,spellCheck:!1,onChange:e=>s("change-json",e.target.value)})),n("div",{className:"mapp-json-error"},l||""),n("div",{className:"mapp-json-toolbar"},n("div",null,n(d,{disabled:l,isBusy:t.isBusy,isPrimary:!0,onClick:()=>s("save")},__("Save")),n(d,{isBusy:t.isBusy,onClick:()=>s("cancel")},__("Cancel")))))}},214:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappCard:()=>g});a(824);const o=wp.element.createElement,{Fragment:i,useEffect:n,useLayoutEffect:s,useCallback:l,useRef:r,useState:p}=wp.element,{useSelect:c}=wp.data,{Button:d,Dashicon:m,ExternalLink:u,Guide:_,Modal:h}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function g(e){let{icon:t,title:a,...i}=e;return o("div",{className:"mapp-support-card"},a&&o("div",{className:"mapp-support-card-title"},o("h3",null,t&&o(m,{icon:t}),a)),o("div",{className:"mapp-support-card-content"},i.children))}document.getElementById("mapp-support-page")&&wp.element.render(o((function(e){const[t,a]=p({engine:e.engine?e.engine:"leaflet",isOpen:e.isOpen,apiKey:e.apiKey,mapbox:e.mapbox});function s(e){a((t=>({...t,...e})))}function l(e){return o("div",{className:"mapp-guide-engine"+(e.selected?" mapp-selected":""),onClick:()=>e.onClick()},o("h2",{className:"mapp-guide-engine-title"},e.title),o("div",{className:"mapp-guide-engine-content"},e.content))}return r(null),n((()=>{}),[]),o("div",{className:"mapp-support"},o(i,null,o("div",{className:"mapp-support-section"},o("div",{className:"mapp-support-header"},o("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),o("h1",null,__("MapPress Support")),o("i",null,__("Build amazing maps with the easiest and most powerful mapping plugin available")),o("div",null,o(d,{className:"mapp-support-guide-toggle",isPrimary:!0,onClick:()=>s({isOpen:!0})},__("Open Setup Wizard"))))),o("div",{className:"mapp-support-section"},o("div",{className:"mapp-support-cards"},o(g,{icon:"book",title:__("Documentation")},o("p",null,__("Detailed plugin documentation:")),o(u,{href:"https://mappresspro.com/mappress-documentation/"},__("Documentation")),o(u,{href:"https://mappresspro.com/whats-new/"},__("What's new")),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Creating your first map"))),o(g,{icon:"warning",title:__("Troubleshooting")},o("p",null,o("b",null,__("Check for a plugin or theme conflict:"))),o("ol",null,o("li",null,__("Deactivate ALL other plugins")),o("li",null,__("Switch to a standard WordPress theme")),o("li",null,__("If the maps are working, reactivate one by one to find the conflict."))),o("p",null,__("For more info:")),o(u,{href:"https://mappresspro.com/mappress-faq/"},__("MapPress FAQ"))),o(g,{icon:"megaphone",title:__("Support")},o("p",null,__("Need some help?")),o(u,{href:"https://mappresspro.com/forums/forum/mappress-support/"},__("Support forum")),o(u,{href:"https://mappresspro.com/chris-contact/"},__("Contact")))))),function(){if(t.isOpen)return o(_,{className:"mapp-guide",onFinish:()=>function(e,a){if("save"===e){let e;s({isOpen:!1}),e="google"==t.engine?"google":t.mapbox?"mapbox":"nominatim",mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",nonce:mappl10n.options.nonce,settings:{engine:t.engine,apiKey:t.apiKey,mapbox:t.mapbox,geocoder:e}},callback:e=>{"OK"!=e.status&&alert("Unable to save settings. Please check the support troubleshooting guide.")}})}}("save"),pages:[{content:o("div",{className:"mapp-guide-page mapp-guide-engines"},o("h1",null,__("Please Choose a Mapping API")),o("p",null,__("MapPress supports both Leaflet and Google mapping APIs."),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-picking-a-mapping-api"},__("Learn more"))),o("div",{className:"mapp-guide-engines"},l({onClick:()=>s({engine:"leaflet"}),selected:"leaflet"==t.engine,title:"Leaflet",content:o("ul",null,o("li",null,__("No API key")),o("li",null,__("Free unlimited usage")),o("li",null,__("Good functionality")),o("li",null,__("Best for high traffic sites")))}),l({onClick:()=>s({engine:"google"}),selected:"google"==t.engine,title:"Google",content:o("ul",null,o("li",null,__("API key required")),o("li",null,__("Limited free usage")),o("li",null,__("Excellent functionality")),o("li",null,__("Best for low traffic sites")))}))),image:o("div",{className:"mapp-guide-header mapp-guide-image-small"},o("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),o("h1",null,__("Welcome to MapPress!")))},{content:"google"==t.engine?o("div",{className:"mapp-guide-page mapp-guide-apikey"},o("h1",null,__("Google API Key")),o("p",null,__("Google requires an API key to use Google Maps. Please enter your key below.")),o(d,{isPrimary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key/",target:"_blank"},__("Get an API Key")),o("input",{className:"mapp-guide-apikey",onChange:e=>s({apiKey:e.target.value}),placeholder:__("Enter your API key here"),value:t.apiKey})):o("div",{className:"mapp-guide-page mapp-guide-apikey"},o("h1",null,__("Sign up with Mapbox")),o("p",null,__("Mapbox makes Leaflet better with great-looking map tiles, styled maps, and a powerful geocoder.")," "+__("A generous free tier means it's free for most sites."),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-using-mapbox-with-leaflet"},__("Learn more"))),o(d,{isPrimary:!0,href:"https://account.mapbox.com/auth/signup/",target:"_blank"},__("Get Mapbox Access Token")),o("input",{className:"mapp-guide-apikey",onChange:e=>s({mapbox:e.target.value}),placeholder:__("Enter your access token here"),value:t.mapbox})),image:o("div",{className:"mapp-guide-header mapp-guide-image-small"},"google"==t.engine&&o("img",{src:mappl10n.options.baseurl+"/images/google_logo.png"}),"leaflet"==t.engine&&o("img",{src:mappl10n.options.baseurl+"/images/mapbox_logo_white.png"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-gutenberg"},o("h1",null,__("Maps in the Block Editor")),o("p",null,__("MapPress provides custom block types for the Gutenberg editor.")),o("p",null,__("Just insert a MapPress Map block to get started."),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-gutenberg-block-editor"},__("Learn more")))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/gutenberg_map_block.gif"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-classic"},o("h1",null,__("Maps in the Classic Editor")),o("p",null,__('MapPress also supports the "classic" editor. Just click the MapPress button to open the map library.')),o("p",null,o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-classic-editor"},__("Learn more")))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/classic_map.gif"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-library"},o("h1",null,__("Map Library")),o("p",null,__("The Map Library provides an easy way to see and edit all of your maps. The library can be opened in the post editor or from the MapPress menu.")),o("p",null,o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Learn more")))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/library_menu.gif"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-end"},o("h1",null,__("Happy Mapping")),o("p",null,__("Enjoy the plugin! Replay this guide any time from the MapPress support menu."))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/icon-128x128"}))}]})}())}),mappress_support_state),document.getElementById("mapp-support-page"))},308:(e,t,a)=>{"use strict";e.exports=function(e,t){var o=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),i=o.length,n=void 0,s=void 0,l=void 0,r=void 0,p=void 0,c=void 0,d=void 0,m=void 0,u=void 0,_=void 0,h=void 0,g=void 0,f=void 0,b=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},y="undefined"!=typeof window?window:a.g;y.$locutus=y.$locutus||{};var v=y.$locutus;for(v.php=v.php||{},t||(t=y),n=0;n<i&&(u=b((m=o[n].split("="))[0]),_=m.length<2?"":b(m[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));n++){for(;" "===u.charAt(0);)u=u.slice(1);if(u.indexOf("\0")>-1&&(u=u.slice(0,u.indexOf("\0"))),u&&"["!==u.charAt(0)){for(g=[],h=0,s=0;s<u.length;s++)if("["!==u.charAt(s)||h){if("]"===u.charAt(s)&&h&&(g.length||g.push(u.slice(0,h-1)),g.push(u.substr(h,s-h)),h=0,"["!==u.charAt(s+1)))break}else h=s+1;for(g.length||(g=[u]),s=0;s<g[0].length&&(" "!==(d=g[0].charAt(s))&&"."!==d&&"["!==d||(g[0]=g[0].substr(0,s)+"_"+g[0].substr(s+1)),"["!==d);s++);for(c=t,s=0,f=g.length;s<f;s++){if(p=c,(""===(u=g[s].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==s){for(r in l=-1,c)c.hasOwnProperty(r)&&+r>l&&r.match(/^\d+$/g)&&(l=+r);u=l+1}Object(c[u])!==c[u]&&(c[u]={}),c=c[u]}p[u]=_}}}}},t={};function a(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a(787),a(844),a(215),a(713),a(525),a(371),a(999),a(143),a(816),a(378),a(498),a(670),a(218),a(824),a(477),a(429),a(214)})();
|
1 |
+
(()=>{var e={844:()=>{const e=wp.element.createElement,{Fragment:t,useEffect:a,useLayoutEffect:o,useRef:i,useState:n}=wp.element,{Button:s,Modal:l}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function r(t){const[o,i]=n({isOpen:!1,reason:"",reasonText:"",redirectUrl:null});function r(e){i((t=>({...t,...e})))}function p(e,t){switch(e){case"cancel":r({isOpen:!1});break;case"submit":r({isOpen:!1}),window.location.href=o.redirectUrl+"&mapp_reason="+o.reason+"&mapp_reason_text="+encodeURIComponent(o.reasonText.trim())}}return a((()=>{const e=jQuery("#deactivate-mappress-google-maps-for-wordpress");e.length&&(e.off("click.mapp"),e.on("click.mapp",(function(){return function(e){const t=e?jQuery(e).attr("href"):null;t&&r({isOpen:!0,redirectUrl:t})}(this),!1})))}),[]),o.isOpen?e(l,{isDismissible:!0,onRequestClose:()=>p("cancel"),shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:__("Feedback")},function(){const t=!o.reason||"other"==o.reason&&!o.reasonText;return sprintf("<a href='https://mappresspro.com/chris-contact' target='_blank'>%s</a>",__("contact me")),e("div",{className:"mapp-deactivate"},e("div",{className:"mapp-deactivate-content"},e("h2",null,__("Sorry to see you go! Need help?"),e(s,{className:"mapp-deactivate-help",isSecondary:!0,href:"https://mappresspro.com/chris-contact",target:"_blank"},__("Contact me"))),e("h2",null,__("If not, I'd really appreciate some feedback:")),function(){const t=[{value:"badday",label:__("I'm just having a bad day")},{value:"notworking",label:__("The plugin isn't working"),placeholder:__("What didn't work? Was there an error message?")},{value:"toohard",label:__("Too hard to use"),placeholder:__("How can I make it easier?")},{value:"feature",label:__("Missing feature"),placeholder:__("What's missing?")},{value:"other",label:__("Other"),placeholder:__("Can you provide any details?")}];return e("div",{className:"mapp-deactivate-reasons"},_.map(t,(t=>{const a=t.value==o.reason;return e("div",{className:"mapp-deactivate-reason",key:t.value},e("label",null,e("input",{checked:a,onChange:e=>r({reason:e.target.value}),type:"radio",value:t.value}),t.label),a&&t.placeholder&&e("div",null,e("textarea",{onChange:e=>r({reasonText:e.target.value}),placeholder:t.placeholder,value:o.reasonText})))})))}()),e("div",{className:"mapp-deactivate-footer"},e(s,{isSecondary:!0,disabled:t,onClick:()=>p("submit")},__("Deactivate")),e(s,{isPrimary:!0,onClick:()=>p("cancel")},__("Cancel"))))}()):null}jQuery(document).ready((function(){const t=jQuery("<div></div>").appendTo("body").get(0);wp.element.render(e(r),t)}))},215:(e,t,a)=>{"use strict";a.r(t);var o=a(525),i=a(143);window.mapp=window.mapp||{};const n=wp.element.createElement;var s;s=jQuery,mapp.Editor=function(e){this.drawingManager=null,this.map=e,this.poiEditor=null;var t=this;this.initialize=function(){this.map.display(),this.poiEditor=new mapp.PoiEditor(this.map),this.initDrawingManager(),this.map.onSearch=e=>{this.insert(e)}},this.insert=function(e){if(e)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),e.geometry){var a=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,o=e.name==a?"":a,i=new mapp.Poi({address:a,body:o,iconid:this.poiEditor.lastIcon,point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null});this.map.poiInsert(i),i.center()}else e.overlay?(this.map.poiHover(null),"marker"==e.type?(i=new mapp.Poi({body:"",iconid:null,overlay:null,point:e.overlay.getPosition().toJSON(),title:e.overlay.getPosition().toUrlValue(6),type:null}),e.overlay.setMap(null)):i=new mapp.Poi({body:"",iconid:null,overlay:e.overlay,title:mappl10n.shape,type:e.type}),this.map.poiInsert(i)):"string"==typeof e&&"http"==e.substring(0,4)&&(i=new mapp.Poi({iconid:this.poiEditor.lastIcon,kml:{url:e},title:"KML",type:"kml"}),t.map.poiInsert(i),mapp.event.addListenerOnce(i.overlay,"ready defaultviewport_changed",(function(){i.center()})))},this.initDrawingManager=function(){var e={fillColor:"#0000FF",fillOpacity:.4,strokeColor:"#0000FF",strokeOpacity:1,strokeWeight:2};"leaflet"==mappl10n.options.engine||google.maps.drawing&&(this.drawingManager=new google.maps.drawing.DrawingManager({drawingControlOptions:{position:google.maps.ControlPosition.TOP_CENTER,drawingModes:[google.maps.drawing.OverlayType.MARKER,google.maps.drawing.OverlayType.POLYGON,google.maps.drawing.OverlayType.POLYLINE,google.maps.drawing.OverlayType.RECTANGLE,google.maps.drawing.OverlayType.CIRCLE]},circleOptions:e,polygonOptions:e,polylineOptions:e,rectangleOptions:e}),this.drawingManager.setMap(this.map.getMap()),mapp.event.addListener(this.drawingManager,"overlaycomplete",(function(e){t.drawingManager.get("drawingMode")&&t.insert(e)})))},this.initialize.apply(this)},mapp.PoiEditor=function(e){this.map=e,this.poi=null,this.sel=null,this.lastIcon=null;var t=this;this.initialize=function(){this.sel=s(this.map.iw.getContent()),s(this.map).on("mapp.open",(function(e,a){t.render(a)})),s(this.map).on("mapp.close",(function(){t.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(e){e.preventDefault();var a=s(this).attr("data-mapp-poi");t[a]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(e){var a=s(this).hasClass("mapp-poi-visual");t.mce(a)})),this.sel.on("keydown",(function(e){13==e.which&&"mapp-poi-body"!=e.target.id&&(e.preventDefault(),t.save())}))},this.cancel=function(){this.map.poiClose()},this.initMCE=function(){if("undefined"!=typeof tinyMCE&&void 0!==tinyMCE.init){var e="en";if(void 0!==window.tinyMCEPreInit&&void 0!==window.tinyMCEPreInit.mceInit&&void 0!==window.tinyMCEPreInit.mceInit.content){var t=window.tinyMCEPreInit.mceInit.content;e=void 0!==t.language?t.language:"en"}var a={mode:"none",height:"100%",convert_urls:!1,language:e,menubar:!1,plugins:"image,paste,textcolor,wordpress,wpeditimage,wplink,wpview",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.init(a),this.mce(!0)}},this.mce=function(e){var a=e?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(a,!1,"mapp-poi-body"),s(".mapp-poi-visual, .mapp-poi-html",t.sel).removeClass("mapp-active"),e?s(".mapp-poi-visual",t.sel).addClass("mapp-active"):s(".mapp-poi-html",t.sel).addClass("mapp-active")},this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.poiClose(),this.map.poiRemove(this.poi))},this.render=function(e){this.poi=e,this.renderColorPicker(this.poi),this.renderIconPicker(this.poi),this.initMCE()},this.renderColorPicker=function(e){document.getElementById("mapp-poi-colorpicker")&&wp.element.render(n(o.MappColorPicker,{...e.getTemplateColors(),isExtended:!0,onChange:t=>{e.set({dirty:!0}),e.setTemplateColors(t),this.map.renderList(),this.renderColorPicker(e)}}),document.getElementById("mapp-poi-colorpicker"))},this.renderIconPicker=function(e){document.getElementById("mapp-poi-iconpicker")&&wp.element.render(n(i.MappIconPicker,{iconid:e.iconid,onChange:t=>{e.set({dirty:!0,iconid:t}),this.lastIcon=t,this.map.renderList(),this.renderIconPicker(e)}}),document.getElementById("mapp-poi-iconpicker"))},this.save=function(){"undefined"!=typeof tinyMCE&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save(),this.poi.set({dirty:!0,title:s(".mapp-poi-title").val(),body:s(".mapp-poi-body").val()}),this.map.renderList(),this.map.poiClose()},this.initialize.apply(this)}},713:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>m});const o=wp.element.createElement,{addQueryArgs:i}=wp.url,{useCallback:n,useEffect:s,useState:l}=wp.element,{Button:r,Dropdown:p,Spinner:c,TextControl:d}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function m(e){const[t,a]=l({isFetching:!1,results:[],search:"",searchTerm:""});function r(e){a((t=>({...t,...e})))}s((()=>{t.isOpen&&(r({isFetching:!0}),wp.apiFetch({path:i("/wp/v2/search",{search:t.search,per_page:20})}).then((e=>{r({results:e,isFetching:!1})})))}),[t.search,t.isOpen]);const m=n(_.debounce((function(e){r({search:e})}),1e3),[]);function u(a,i){return o("div",{className:"mapp-attach-control"},o("div",{className:"mapp-attach-control-toolbar"},o(d,{autoComplete:"false",value:t.searchTerm,onChange:e=>{r({searchTerm:e}),m(e)},placeholder:__("Search")})),function(){if(t.isFetching)return o(c,null);if(t.results)return t.results.length?o("div",{className:"mapp-attach-items"},t.results.map((t=>o("div",{key:t.id,className:"mapp-attach-item",onClick:()=>{e.onChange(t.id,t.title)}},o("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),o("div",{className:"mapp-attach-item-type"},t.subtype))))):o("div",{},__("No posts found"))}())}return o("div",{onClick:e=>e.stopPropagation()},o(p,{onToggle:e=>r({isOpen:e}),renderToggle:e=>{let{isOpen:t,onToggle:a}=e;return o("a",{href:"#",onClick:a},__("Attach"))},renderContent:e=>{let{isOpen:t,onToggle:a}=e;return u()}}))}},525:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappColorPicker:()=>M});var o=a(824);const i=wp.element.createElement,{Fragment:n,useEffect:s,useLayoutEffect:l,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:d}=wp.data,{withState:m}=wp.compose,{Button:u,ColorPalette:h,ColorPicker:g,Dashicon:f,Dropdown:b,ExternalLink:y,Modal:v,Panel:k,PanelBody:w,PanelRow:C,Popover:x,RadioControl:S,Spinner:N,TabPanel:O}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function M(e){const[t,a]=c({isCustomOpen:!1,isOpen:!1});function l(e){a((t=>({...t,...e})))}function r(t,a){switch(t){case"close":l({isOpen:!1});break;case"open":l({isOpen:!0});break;case"select":e.onChange(a),r("close");break;case"set":e.onChange(a)}}return s((()=>{}),[]),i(n,null,i("span",{className:"mapp-colors-toggle",onClick:()=>r("open",null),style:{backgroundColor:e.color,border:e.isExtended?"1px solid "+e.color:"1px solid gray",opacity:e.isExtended&&e.opacity?e.opacity/100:1},tabIndex:0}),function(){if(!t.isOpen)return null;const a=_.map([100,90,80,70,60,50,40,30,20,10,0],(e=>({label:e+"%",value:e}))),n=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(e=>({label:e+"px",value:e})));return i(v,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:e=>r("close")},i("div",{className:"mapp-colors"},i("div",{className:"mapp-colors-list"},_.map([["yellow","yellowgreen","green","seagreen","blue","cornflowerblue","darkslateblue","purple","firebrick","red","darkorange","orange","saddlebrown"],["lightyellow","greenyellow","lightgreen","darkseagreen","lightblue","skyblue","slateblue","orchid","plum","pink","sandybrown","goldenrod","peru"],["white","lightgray","gray","black"]],((t,a)=>i("div",{key:a},_.map(t,(t=>i("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:()=>{l({isCustomOpen:!1}),r("select",{color:t})},style:{backgroundColor:t},title:t}))))))),t.isCustomOpen&&i(g,{color:e.color,onChangeComplete:e=>r("set",{color:e.hex}),disableAlpha:!0}),e.isExtended&&i(o.Select,{label:__("Opacity"),options:a,value:e.opacity?e.opacity:"",onChange:e=>r("set",{opacity:e})}),e.isExtended&&i(o.Select,{label:__("Stroke"),options:n,value:e.weight?e.weight:"",onChange:e=>r("set",{weight:e})}),i("div",{className:"mapp-colors-toolbar"},i(u,{isPrimary:!0,onClick:()=>r("close")},__("Done")),i(u,{onClick:()=>l({isCustomOpen:!t.isCustomOpen})},__("Custom color")))))}())}},371:(e,t,a)=>{"use strict";a.r(t);var o=a(477);wp&&wp.plugins&&wp.plugins.registerPlugin&&wp.editPost&&wp.plugins.registerPlugin("mappress-document-settings-panel",{render:function(){const{PluginDocumentSettingPanel:e}=wp.editPost,t=wp.element.createElement,{Fragment:a,useEffect:i,useLayoutEffect:n,useRef:s,useState:l}=wp.element,{Button:r,Spinner:p}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),[c,d]=l({isFetchingItems:!0,isPickerOpen:!1,items:null,pickerMapid:null,pickerMode:"list"});function m(e){d((t=>({...t,...e})))}function u(e,t){switch(e){case"open-library":m({isPickerOpen:!0,pickerMode:"list"});break;case"edit":m({isPickerOpen:!0,pickerMapid:t,pickerMode:"edit"});break;case"pick-close":m({isPickerOpen:!1,pickerMapid:null});break;case"pick-insert":const e=wp.blocks.createBlock("mappress/map",{mapid:t});wp.data.dispatch("core/block-editor").insertBlock(e,0),m({isPickerOpen:!1,pickerMapid:null})}}function h(e){let a=e.map_title?e.map_title:__("Untitled");return t("div",{className:"mapp-document-item",key:e.mapid+e.postid},t("a",{className:"mapp-document-col-map_title",href:"#",onClick:t=>u("edit",e.mapid)},a),t("div",{className:"mapp-document-col-mapid"},e.mapid))}return i((()=>{const e=e=>{m({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)})),i((()=>{mapp.store.fetchItems()}),[]),t(e,{title:"MapPress",className:"mapp-document-panel"},function(){const e=_.filter(c.items,(e=>e.postid==mappl10n.options.postid));let o;return o=c.isFetchingItems?t(p,null):e.length?t(a,null,t("div",{className:"mapp-document-header"},t("div",{className:"mapp-document-col-map_title"},__("Map title")),t("div",{className:"mapp-document-col-mapid"},null,__("Map ID"))),_.map(e,h)):t("div",{className:"mapp-document-message"},__("No maps found")),t("div",null,t("div",{className:"mapp-document-list"},o))}(),t(r,{icon:"portfolio",isSecondary:!0,onClick:()=>u("open-library")},__("Open map library")),function(){if(c.isPickerOpen)return t(o.default,{mapid:c.pickerMapid,mode:c.pickerMode,onAction:u,type:"post"})}())},icon:null})},999:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>v});var o=a(429),i=a(710);window.mapp=window.mapp||{};const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useRef:p,useState:c}=wp.element,{Button:d,Dropdown:m,Modal:u,Panel:h,PanelBody:g,Popover:f,Spinner:b,TextControl:y}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function v(e){const[t,a]=c({dragging:null,dragover:null,isFetchingMap:!!e.mapid,isPoiListOpen:!0,isSavingMap:!1,map:null,mapdata:null}),s=p(null);function r(e){a((t=>({...t,...e})))}function m(e){r({map:t.map})}function u(a,o){switch(a){case"change-settings":t.map.set(o),r({map:t.map});break;case"change-title":t.map.set({title:o}),r({map:t.map});break;case"close":e.onAction("edit-close");break;case"trash":confirm(mappl10n.delete_map_prompt)&&(mapp.store.trashMap({mapid:e.mapid}),e.onAction("edit-trash"));break;case"save":mapp.store.saveMap({mapdata:t.map.toJSON(),success:t=>{e.onAction("edit-save",t.mapid)}})}}return l((()=>{t.map&&(jQuery(t.map.div.layout).off("mapp.render",m),jQuery(t.map.div.layout).on("mapp.render",(e=>m())))}),[t.map]),l((()=>{const t=t=>{r({isFetchingMap:t.isFetchingMap,isSavingMap:t.isSavingMap,mapdata:t.maps[e.mapid]})};return mapp.store.subscribe(t),()=>mapp.store.unsubscribe(t)})),l((()=>{e.mapid&&mapp.store.fetchMap({mapid:e.mapid})}),[e.mapid]),l((()=>{if(t.isFetchingMap)return;let a={editable:!0,embed:!0,layout:"left",mapOpts:{streetViewControl:!1},menu:!1,name:"media-map",poiList:!1,sel:jQuery(s.current)};"map"!=e.context&&"mashup"!=e.context||(a.center=null,a.zoom=null);const o=new mapp.Map(t.mapdata,a);new mapp.Editor(o);r({map:o})}),[t.mapdata]),l((()=>{t.map&&setTimeout((()=>t.map.resize()),100)}),[t.isPoiListOpen]),n("div",{className:"mapp-edit"},function(){let e=t.map&&!t.isFetchingMap&&t.map.title?t.map.title:"",a=t.map&&!t.isFetchingMap?__("Untitled"):"";return n("div",{className:"mapp-gt-modal-header"},n(y,{className:"mapp-edit-title",placeholder:a,value:e,onChange:e=>u("change-title",e)}))}(),n("div",{className:"mapp-edit-main"},n("div",{className:"mapp-sidebar"+(t.isPoiListOpen?" mapp-sidebar-open":"")},n("div",{className:"mapp-sidebar-toggle",onClick:()=>r({isPoiListOpen:!t.isPoiListOpen})}),n("div",{className:"mapp-list mapp-edit-list"},n("div",{className:"mapp-edit-list-wrapper"},function(){if("mce"!=e.context&&"library"!=e.context)return null;if(!t.map)return null;const{center:a,height:i,poiList:s,search:l,width:r,zoom:p}=t.map;return n("div",{className:"mapp-gt-inspector"},n(o.MappSettings,{map:t.map,context:e.context,onAction:u,center:a,height:i,poiList:s,search:l,width:r,zoom:p}))}(),function(){if(!t.map)return;const e=function(e,a){let o=t.dragging,i=a;t.map.pois_.splice(i,0,t.map.pois_.splice(o,1)[0]),r({map:t.map,dragover:null})};return n("div",{className:"mapp-items"},_.map(t.map.pois_,((a,o)=>n("div",{className:t.dragover==o?"mapp-item mapp-edit-dragover":"mapp-item",draggable:!0,key:o,onClick:()=>t.map.poiOpen(t.map.pois_[o]),onDragOver:e=>e.preventDefault(),onDragStart:e=>r({dragging:o}),onDragEnter:e=>r({dragover:o}),onDragEnd:e=>r({dragging:null,dragover:null}),onDrop:t=>e(t,o)},n("img",{className:"mapp-icon",src:mapp.Icons.getUrl(a.iconid)}),n("div",{className:"mapp-title"},a.title)))))}()))),n("div",{className:"mapp-edit-map",key:e.mapid,ref:s,onKeyDown:e=>e.stopPropagation(),tabIndex:-1}),s.current&&t.map?n(i.m,{map:t.map,selected:t.map.mapTypeId,onChange:e=>u("change-settings",{mapTypeId:e})}):null),n("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:e=>e.stopPropagation()},n(d,{isPrimary:!0,isBusy:t.isSavingMap,onClick:()=>u("save")},__("Save")),n(d,{disabled:t.isSavingMap,onClick:()=>u("close")},__("Cancel")),n(d,{disabled:!e.mapid||t.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:()=>u("trash")},__("Trash"))))}},143:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappIconPicker:()=>O});var o=a(525),i=a(824);const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useCallback:p,useRef:c,useState:d}=wp.element,{useSelect:m}=wp.data,{withState:u}=wp.compose,{Button:h,ColorPicker:g,DropZone:f,DropZoneProvider:b,FormFileUpload:y,Modal:v,Popover:k,RangeControl:w,Spinner:C,TabPanel:x}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress"),S=[{id:"mapp-shapes",fontFamily:"Marker Shapes",glyphs:[{name:"circle",center:[16,16]},{name:"widepin",center:[16,14]},{name:"route",center:[16,16]},{name:"shield",center:[16,16]},{name:"squarepin",center:[16,15]},{name:"square",center:[16,16]},{name:"squarerounded",center:[16,16]},{name:"roundpin",center:[16,13]},{name:"pin",center:null},{name:"pindot",center:null}]}],N=[{id:"mapp-icons",className:"mapp-marker-icons",filePrefix:"mp",fontFamily:"Marker Icons",label:"Map icons",glyphs:["airport","amusement-park","aquarium","archery","art-gallery","assistive-listening","atm","audio-description","bakery","bank","bar","baseball","beauty-salon","bicycle-store","bicycling","boat-ramp","boat-tour","boating","book-store","bowling-alley","braille","bus-station","cafe","campground","canoe","car-dealer","car-rental","car-repair","car-wash","casino","cemetery","chairlift","church","city-hall","closed-captioning","clothing-store","compass","convenience-store","courthouse","cross-country-skiing","crosshairs","dentist","department-store","diving","doctor","electrician","electronics-store","embassy","expand","female","finance","fire-station","fish-cleaning","fishing-pier","fishing","florist","food","fullscreen","funeral-home","furniture-store","gas-station","contractor","golf","grocery","gym","hair-care","hang-gliding","hardware-store","health","hindu-temple","horse-riding","hospital","ice-fishing","ice-skating","inline-skating","insurance-agency","jet-skiing","jewelry-store","kayaking","laundry","lawyer","library","liquor-store","local-government","location-arrow","locksmith","lodging","low-vision-access","male","marina","mosque","motobike-trail","movie-rental","movie-theater","moving-company","museum","natural-feature","night-club","open-captioning","painter","park","parking","pet-store","pharmacy","physiotherapist","place-of-worship","playground","plumber","point-of-interest","police","political","post-box","post-office","rafting","real-estate-agency","restaurant","roofing-contractor","route","rv-park","sailing","school","scuba-diving","search","shopping-mall","sign-language","skateboarding","ski-jumping","skiing","sledding","snow-shoeing","snow","snowboarding","snowmobile","spa","stadium","storage","store","subway-station","surfing","swimming","synagogue","taxi-stand","tennis","toilet","trail-walking","train-station","transit-station","travel-agency","unisex","university","veterinary-care","viewing","volume-control-telephone","walking","waterskiing","whale-watching","wheelchair","wind-surfing","zoo"]},{id:"material-icons",className:"material-icons",filePrefix:"mi",fontFamily:"Material Icons",label:"Material Icons",glyphs:["ac_unit","access_alarm","access_alarms","access_time","access_time_filled","accessibility","accessibility_new","accessible","accessible_forward","account_balance","account_balance_wallet","account_box","account_circle","account_tree","ad_units","adb","add","add_a_photo","add_alarm","add_alert","add_box","add_business","add_chart","add_circle","add_circle_outline","add_comment","add_ic_call","add_link","add_location","add_location_alt","add_moderator","add_photo_alternate","add_reaction","add_road","add_shopping_cart","add_task","add_to_drive","add_to_home_screen","add_to_photos","add_to_queue","addchart","adjust","admin_panel_settings","ads_click","agriculture","air","airline_seat_flat","airline_seat_flat_angled","airline_seat_individual_suite","airline_seat_legroom_extra","airline_seat_legroom_normal","airline_seat_legroom_reduced","airline_seat_recline_extra","airline_seat_recline_normal","airplane_ticket","airplanemode_active","airplanemode_inactive","airplanemode_off","airplanemode_on","airplay","airport_shuttle","alarm","alarm_add","alarm_off","alarm_on","album","align_horizontal_center","align_horizontal_left","align_horizontal_right","align_vertical_bottom","align_vertical_center","align_vertical_top","all_inbox","all_inclusive","all_out","alt_route","alternate_email","amp_stories","analytics","anchor","android","animation","announcement","aod","apartment","api","app_blocking","app_registration","app_settings_alt","approval","apps","architecture","archive","area_chart","arrow_back","arrow_back_ios","arrow_back_ios_new","arrow_circle_down","arrow_circle_up","arrow_downward","arrow_drop_down","arrow_drop_down_circle","arrow_drop_up","arrow_forward","arrow_forward_ios","arrow_left","arrow_right","arrow_right_alt","arrow_upward","art_track","article","aspect_ratio","assessment","assignment","assignment_ind","assignment_late","assignment_return","assignment_returned","assignment_turned_in","assistant","assistant_direction","assistant_photo","atm","attach_email","attach_file","attach_money","attachment","attractions","attribution","audiotrack","auto_awesome","auto_awesome_mosaic","auto_awesome_motion","auto_delete","auto_fix_high","auto_fix_normal","auto_fix_off","auto_graph","auto_stories","autofps_select","autorenew","av_timer","baby_changing_station","back_hand","backpack","backspace","backup","backup_table","badge","bakery_dining","balcony","ballot","bar_chart","batch_prediction","bathroom","bathtub","battery_alert","battery_charging_full","battery_full","battery_saver","battery_std","battery_unknown","beach_access","bed","bedroom_baby","bedroom_child","bedroom_parent","bedtime","beenhere","bento","bike_scooter","biotech","blender","block","bloodtype","bluetooth","bluetooth_audio","bluetooth_connected","bluetooth_disabled","bluetooth_drive","bluetooth_searching","blur_circular","blur_linear","blur_off","blur_on","bolt","book","book_online","bookmark","bookmark_add","bookmark_added","bookmark_border","bookmark_outline","bookmark_remove","bookmarks","border_all","border_bottom","border_clear","border_color","border_horizontal","border_inner","border_left","border_outer","border_right","border_style","border_top","border_vertical","branding_watermark","breakfast_dining","brightness_1","brightness_2","brightness_3","brightness_4","brightness_5","brightness_6","brightness_7","brightness_auto","brightness_high","brightness_low","brightness_medium","broken_image","browser_not_supported","brunch_dining","brush","bubble_chart","bug_report","build","build_circle","bungalow","burst_mode","bus_alert","business","business_center","cabin","cable","cached","cake","calculate","calendar_today","calendar_view_day","calendar_view_month","calendar_view_week","call","call_end","call_made","call_merge","call_missed","call_missed_outgoing","call_received","call_split","call_to_action","camera","camera_alt","camera_enhance","camera_front","camera_indoor","camera_outdoor","camera_rear","camera_roll","cameraswitch","campaign","cancel","cancel_presentation","cancel_schedule_send","car_rental","car_repair","card_giftcard","card_membership","card_travel","carpenter","cases","casino","cast","cast_connected","cast_for_education","catching_pokemon","category","celebration","cell_wifi","center_focus_strong","center_focus_weak","chair","chair_alt","chalet","change_circle","change_history","charging_station","chat","chat_bubble","chat_bubble_outline","check","check_box","check_box_outline_blank","check_circle","check_circle_outline","checklist","checklist_rtl","checkroom","chevron_left","chevron_right","child_care","child_friendly","chrome_reader_mode","circle","circle_notifications","class","clean_hands","cleaning_services","clear","clear_all","close","close_fullscreen","closed_caption","closed_caption_disabled","closed_caption_off","cloud","cloud_circle","cloud_done","cloud_download","cloud_off","cloud_queue","cloud_upload","code","code_off","coffee","coffee_maker","collections","collections_bookmark","color_lens","colorize","comment","comment_bank","commute","compare","compare_arrows","compass_calibration","compost","compress","computer","confirmation_num","confirmation_number","connect_without_contact","connected_tv","construction","contact_mail","contact_page","contact_phone","contact_support","contactless","contacts","content_copy","content_cut","content_paste","content_paste_off","control_camera","control_point","control_point_duplicate","copy","copy_all","copyright","coronavirus","corporate_fare","cottage","countertops","create","create_new_folder","credit_card","credit_card_off","credit_score","crib","crop","crop_16_9","crop_3_2","crop_5_4","crop_7_5","crop_din","crop_free","crop_landscape","crop_original","crop_portrait","crop_rotate","crop_square","cruelty_free","cut","dangerous","dark_mode","dashboard","dashboard_customize","data_exploration","data_saver_off","data_saver_on","data_usage","date_range","deck","dehaze","delete","delete_forever","delete_outline","delete_sweep","delivery_dining","departure_board","description","design_services","desktop_access_disabled","desktop_mac","desktop_windows","details","developer_board","developer_board_off","developer_mode","device_hub","device_thermostat","device_unknown","devices","devices_other","dialer_sip","dialpad","dining","dinner_dining","directions","directions_bike","directions_boat","directions_boat_filled","directions_bus","directions_bus_filled","directions_car","directions_car_filled","directions_ferry","directions_off","directions_railway","directions_railway_filled","directions_run","directions_subway","directions_subway_filled","directions_train","directions_transit","directions_transit_filled","directions_walk","dirty_lens","disabled_by_default","disabled_visible","disc_full","dnd_forwardslash","dns","do_disturb","do_disturb_alt","do_disturb_off","do_disturb_on","do_not_disturb","do_not_disturb_alt","do_not_disturb_off","do_not_disturb_on","do_not_disturb_on_total_silence","do_not_step","do_not_touch","dock","document_scanner","domain","domain_disabled","domain_verification","done","done_all","done_outline","donut_large","donut_small","door_back","door_front","door_sliding","doorbell","double_arrow","downhill_skiing","download","download_done","download_for_offline","downloading","drafts","drag_handle","drag_indicator","draw","drive_eta","drive_file_move","drive_file_move_rtl","drive_file_rename_outline","drive_folder_upload","dry","dry_cleaning","duo","dvr","dynamic_feed","dynamic_form","e_mobiledata","earbuds","earbuds_battery","east","eco","edgesensor_high","edgesensor_low","edit","edit_attributes","edit_calendar","edit_location","edit_location_alt","edit_note","edit_notifications","edit_off","edit_road","eject","elderly","electric_bike","electric_car","electric_moped","electric_rickshaw","electric_scooter","electrical_services","elevator","email","emergency","emoji_emotions","emoji_events","emoji_flags","emoji_food_beverage","emoji_nature","emoji_objects","emoji_people","emoji_symbols","emoji_transportation","engineering","enhance_photo_translate","enhanced_encryption","equalizer","error","error_outline","escalator","escalator_warning","euro","euro_symbol","ev_station","event","event_available","event_busy","event_note","event_seat","exit_to_app","expand","expand_less","expand_more","explicit","explore","explore_off","exposure","exposure_minus_1","exposure_minus_2","exposure_neg_1","exposure_neg_2","exposure_plus_1","exposure_plus_2","exposure_zero","extension","extension_off","face","face_retouching_natural","face_retouching_off","face_unlock","facebook","fact_check","family_restroom","fast_forward","fast_rewind","fastfood","favorite","favorite_border","favorite_outline","featured_play_list","featured_video","feed","feedback","female","fence","festival","fiber_dvr","fiber_manual_record","fiber_new","fiber_pin","fiber_smart_record","file_copy","file_download","file_download_done","file_download_off","file_present","file_upload","filter","filter_1","filter_2","filter_3","filter_4","filter_5","filter_6","filter_7","filter_8","filter_9","filter_9_plus","filter_alt","filter_b_and_w","filter_center_focus","filter_drama","filter_frames","filter_hdr","filter_list","filter_none","filter_tilt_shift","filter_vintage","find_in_page","find_replace","fingerprint","fire_extinguisher","fireplace","first_page","fit_screen","fitness_center","flag","flaky","flare","flash_auto","flash_off","flash_on","flashlight_off","flashlight_on","flatware","flight","flight_land","flight_takeoff","flip","flip_camera_android","flip_camera_ios","flip_to_back","flip_to_front","flourescent","flutter_dash","fmd_bad","fmd_good","folder","folder_open","folder_shared","folder_special","follow_the_signs","font_download","font_download_off","food_bank","format_align_center","format_align_justify","format_align_left","format_align_right","format_bold","format_clear","format_color_fill","format_color_reset","format_color_text","format_indent_decrease","format_indent_increase","format_italic","format_line_spacing","format_list_bulleted","format_list_numbered","format_list_numbered_rtl","format_paint","format_quote","format_shapes","format_size","format_strikethrough","format_textdirection_l_to_r","format_textdirection_r_to_l","format_underline","format_underlined","forum","forward","forward_10","forward_30","forward_5","forward_to_inbox","foundation","free_breakfast","free_cancellation","front_hand","fullscreen","fullscreen_exit","functions","g_mobiledata","g_translate","gamepad","games","garage","gavel","generating_tokens","gesture","get_app","gif","gite","golf_course","gpp_bad","gpp_good","gpp_maybe","gps_fixed","gps_not_fixed","gps_off","grade","gradient","grading","grain","graphic_eq","grass","grid_3x3","grid_4x4","grid_goldenratio","grid_off","grid_on","grid_view","group","group_add","group_off","group_work","groups","h_mobiledata","h_plus_mobiledata","hail","handyman","hardware","hd","hdr_auto","hdr_auto_select","hdr_enhanced_select","hdr_off","hdr_off_select","hdr_on","hdr_on_select","hdr_plus","hdr_strong","hdr_weak","headphones","headphones_battery","headset","headset_mic","headset_off","healing","health_and_safety","hearing","hearing_disabled","height","help","help_center","help_outline","hevc","hide_image","hide_source","high_quality","highlight","highlight_alt","highlight_off","highlight_remove","hiking","history","history_edu","history_toggle_off","holiday_village","home","home_max","home_mini","home_repair_service","home_work","horizontal_distribute","horizontal_rule","horizontal_split","hot_tub","hotel","hotel_class","hourglass_bottom","hourglass_disabled","hourglass_empty","hourglass_full","hourglass_top","house","house_siding","houseboat","how_to_reg","how_to_vote","http","https","hvac","ice_skating","icecream","image","image_aspect_ratio","image_not_supported","image_search","imagesearch_roller","import_contacts","import_export","important_devices","inbox","incomplete_circle","indeterminate_check_box","info","input","insert_chart","insert_chart_outlined","insert_comment","insert_drive_file","insert_emoticon","insert_invitation","insert_link","insert_photo","insights","integration_instructions","inventory","inventory_2","invert_colors","invert_colors_off","invert_colors_on","ios_share","iron","iso","kayaking","keyboard","keyboard_alt","keyboard_arrow_down","keyboard_arrow_left","keyboard_arrow_right","keyboard_arrow_up","keyboard_backspace","keyboard_capslock","keyboard_control","keyboard_hide","keyboard_return","keyboard_tab","keyboard_voice","king_bed","kitchen","kitesurfing","label","label_important","label_off","landscape","language","laptop","laptop_chromebook","laptop_mac","laptop_windows","last_page","launch","layers","layers_clear","leaderboard","leak_add","leak_remove","leave_bags_at_home","legend_toggle","lens","lens_blur","library_add","library_add_check","library_books","library_music","light","light_mode","lightbulb","line_style","line_weight","linear_scale","link","link_off","linked_camera","liquor","list","list_alt","live_help","live_tv","living","local_activity","local_airport","local_atm","local_attraction","local_bar","local_cafe","local_car_wash","local_convenience_store","local_dining","local_drink","local_fire_department","local_florist","local_gas_station","local_grocery_store","local_hospital","local_hotel","local_laundry_service","local_library","local_mall","local_movies","local_offer","local_parking","local_pharmacy","local_phone","local_pizza","local_play","local_police","local_post_office","local_print_shop","local_printshop","local_restaurant","local_see","local_shipping","local_taxi","location_city","location_disabled","location_history","location_off","location_on","location_searching","lock","lock_clock","lock_open","login","logout","looks","looks_3","looks_4","looks_5","looks_6","looks_one","looks_two","loop","loupe","low_priority","loyalty","lte_mobiledata","lte_plus_mobiledata","luggage","lunch_dining","mail","mail_outline","male","manage_accounts","manage_search","map","maps_home_work","maps_ugc","margin","mark_as_unread","mark_chat_read","mark_chat_unread","mark_email_read","mark_email_unread","markunread","markunread_mailbox","masks","maximize","media_bluetooth_off","media_bluetooth_on","mediation","medical_services","medication","meeting_room","memory","menu","menu_book","menu_open","merge_type","message","messenger","messenger_outline","mic","mic_external_off","mic_external_on","mic_none","mic_off","microwave","military_tech","minimize","miscellaneous_services","missed_video_call","mms","mobile_friendly","mobile_off","mobile_screen_share","mobiledata_off","mode","mode_comment","mode_edit","mode_edit_outline","mode_night","mode_standby","model_training","monetization_on","money","money_off","money_off_csred","monitor","monitor_weight","monochrome_photos","mood","mood_bad","moped","more","more_horiz","more_time","more_vert","motion_photos_auto","motion_photos_off","motion_photos_on","motion_photos_pause","motion_photos_paused","motorcycle","mouse","move_to_inbox","movie","movie_creation","movie_filter","moving","mp","multiline_chart","multiple_stop","multitrack_audio","museum","music_note","music_off","music_video","my_library_add","my_library_books","my_library_music","my_location","nat","nature","nature_people","navigate_before","navigate_next","navigation","near_me","near_me_disabled","nearby_error","nearby_off","network_cell","network_check","network_locked","network_wifi","new_label","new_releases","next_plan","next_week","nfc","night_shelter","nightlife","nightlight","nightlight_round","nights_stay","no_accounts","no_backpack","no_cell","no_drinks","no_encryption","no_encryption_gmailerrorred","no_flash","no_food","no_luggage","no_meals","no_meeting_room","no_photography","no_sim","no_stroller","no_transfer","nordic_walking","north","north_east","north_west","not_accessible","not_interested","not_listed_location","not_started","note","note_add","note_alt","notes","notification_add","notification_important","notifications","notifications_active","notifications_none","notifications_off","notifications_on","notifications_paused","now_wallpaper","now_widgets","offline_bolt","offline_pin","offline_share","ondemand_video","online_prediction","opacity","open_in_browser","open_in_full","open_in_new","open_in_new_off","open_with","other_houses","outbond","outbound","outbox","outdoor_grill","outlet","outlined_flag","padding","pages","pageview","paid","palette","pan_tool","panorama","panorama_fish_eye","panorama_fisheye","panorama_horizontal","panorama_horizontal_select","panorama_photosphere","panorama_photosphere_select","panorama_vertical","panorama_vertical_select","panorama_wide_angle","panorama_wide_angle_select","paragliding","park","party_mode","password","paste","pattern","pause","pause_circle","pause_circle_filled","pause_circle_outline","pause_presentation","payment","payments","pedal_bike","pending","pending_actions","people","people_alt","people_outline","perm_camera_mic","perm_contact_cal","perm_contact_calendar","perm_data_setting","perm_device_info","perm_device_information","perm_identity","perm_media","perm_phone_msg","perm_scan_wifi","person","person_add","person_add_alt","person_add_alt_1","person_add_disabled","person_off","person_outline","person_pin","person_pin_circle","person_remove","person_remove_alt_1","person_search","personal_injury","personal_video","pest_control","pest_control_rodent","pets","phone","phone_android","phone_bluetooth_speaker","phone_callback","phone_disabled","phone_enabled","phone_forwarded","phone_in_talk","phone_iphone","phone_locked","phone_missed","phone_paused","phonelink","phonelink_erase","phonelink_lock","phonelink_off","phonelink_ring","phonelink_setup","photo","photo_album","photo_camera","photo_camera_back","photo_camera_front","photo_filter","photo_library","photo_size_select_actual","photo_size_select_large","photo_size_select_small","piano","piano_off","picture_as_pdf","picture_in_picture","picture_in_picture_alt","pie_chart","pie_chart_outline","pin","pin_drop","pin_end","pin_invoke","pivot_table_chart","place","plagiarism","play_arrow","play_circle","play_circle_fill","play_circle_filled","play_circle_outline","play_disabled","play_for_work","play_lesson","playlist_add","playlist_add_check","playlist_play","plumbing","plus_one","podcasts","point_of_sale","policy","poll","polymer","pool","portable_wifi_off","portrait","post_add","power","power_input","power_off","power_settings_new","precision_manufacturing","pregnant_woman","present_to_all","preview","price_change","price_check","print","print_disabled","priority_high","privacy_tip","private_connectivity","production_quantity_limits","psychology","public","public_off","publish","published_with_changes","push_pin","qr_code","qr_code_2","qr_code_scanner","query_builder","query_stats","question_answer","queue","queue_music","queue_play_next","quick_contacts_dialer","quick_contacts_mail","quickreply","quiz","r_mobiledata","radar","radio","radio_button_checked","radio_button_off","radio_button_on","radio_button_unchecked","railway_alert","ramen_dining","rate_review","raw_off","raw_on","read_more","real_estate_agent","receipt","receipt_long","recent_actors","recommend","record_voice_over","recycling","redeem","redo","reduce_capacity","refresh","remember_me","remove","remove_circle","remove_circle_outline","remove_done","remove_from_queue","remove_moderator","remove_red_eye","remove_shopping_cart","reorder","repeat","repeat_on","repeat_one","repeat_one_on","replay","replay_10","replay_30","replay_5","replay_circle_filled","reply","reply_all","report","report_gmailerrorred","report_off","report_problem","request_page","request_quote","reset_tv","restart_alt","restaurant","restaurant_menu","restore","restore_from_trash","restore_page","reviews","rice_bowl","ring_volume","roofing","room","room_preferences","room_service","rotate_90_degrees_ccw","rotate_left","rotate_right","rounded_corner","router","rowing","rss_feed","rsvp","rtt","rule","rule_folder","run_circle","running_with_errors","rv_hookup","safety_divider","sailing","sanitizer","satellite","save","save_alt","saved_search","savings","scanner","scatter_plot","schedule","schedule_send","schema","school","science","score","screen_lock_landscape","screen_lock_portrait","screen_lock_rotation","screen_rotation","screen_search_desktop","screen_share","screenshot","sd","sd_card","sd_card_alert","sd_storage","search","search_off","security","security_update","security_update_good","security_update_warning","segment","select_all","self_improvement","sell","send","send_and_archive","send_to_mobile","sensor_door","sensor_window","sensors","sensors_off","sentiment_dissatisfied","sentiment_neutral","sentiment_satisfied","sentiment_satisfied_alt","sentiment_very_dissatisfied","sentiment_very_satisfied","set_meal","settings","settings_accessibility","settings_applications","settings_backup_restore","settings_bluetooth","settings_brightness","settings_cell","settings_display","settings_ethernet","settings_input_antenna","settings_input_component","settings_input_composite","settings_input_hdmi","settings_input_svideo","settings_overscan","settings_phone","settings_power","settings_remote","settings_suggest","settings_system_daydream","settings_voice","share","share_arrival_time","share_location","shield","shop","shop_2","shop_two","shopping_bag","shopping_basket","shopping_cart","short_text","shortcut","show_chart","shower","shuffle","shuffle_on","shutter_speed","sick","signal_cellular_0_bar","signal_cellular_4_bar","signal_cellular_alt","signal_cellular_connected_no_internet_0_bar","signal_cellular_connected_no_internet_4_bar","signal_cellular_no_sim","signal_cellular_nodata","signal_cellular_null","signal_cellular_off","signal_wifi_0_bar","signal_wifi_4_bar","signal_wifi_4_bar_lock","signal_wifi_bad","signal_wifi_connected_no_internet_4","signal_wifi_off","signal_wifi_statusbar_4_bar","signal_wifi_statusbar_connected_no_internet_4","signal_wifi_statusbar_null","sim_card","sim_card_alert","sim_card_download","single_bed","sip","skateboarding","skip_next","skip_previous","sledding","slideshow","slow_motion_video","smart_button","smart_display","smart_screen","smart_toy","smartphone","smoke_free","smoking_rooms","sms","sms_failed","snippet_folder","snooze","snowboarding","snowmobile","snowshoeing","soap","social_distance","sort","sort_by_alpha","source","south","south_east","south_west","spa","space_bar","space_dashboard","speaker","speaker_group","speaker_notes","speaker_notes_off","speaker_phone","speed","spellcheck","splitscreen","sports","sports_bar","sports_baseball","sports_basketball","sports_cricket","sports_esports","sports_football","sports_golf","sports_handball","sports_hockey","sports_kabaddi","sports_mma","sports_motorsports","sports_rugby","sports_score","sports_soccer","sports_tennis","sports_volleyball","square_foot","stacked_bar_chart","stacked_line_chart","stairs","star","star_border","star_border_purple500","star_half","star_outline","star_purple500","star_rate","stars","stay_current_landscape","stay_current_portrait","stay_primary_landscape","stay_primary_portrait","sticky_note_2","stop","stop_circle","stop_screen_share","storage","store","store_mall_directory","storefront","storm","straighten","stream","streetview","strikethrough_s","stroller","style","subdirectory_arrow_left","subdirectory_arrow_right","subject","subscript","subscriptions","subtitles","subtitles_off","subway","summarize","superscript","supervised_user_circle","supervisor_account","support","support_agent","surfing","surround_sound","swap_calls","swap_horiz","swap_horizontal_circle","swap_vert","swap_vert_circle","swap_vertical_circle","swipe","switch_account","switch_camera","switch_left","switch_right","switch_video","sync","sync_alt","sync_disabled","sync_problem","system_security_update","system_security_update_good","system_security_update_warning","system_update","system_update_alt","system_update_tv","tab","tab_unselected","table_chart","table_rows","table_view","tablet","tablet_android","tablet_mac","tag","tag_faces","takeout_dining","tap_and_play","tapas","task","task_alt","taxi_alert","terrain","text_fields","text_format","text_rotate_up","text_rotate_vertical","text_rotation_angledown","text_rotation_angleup","text_rotation_down","text_rotation_none","text_snippet","textsms","texture","theater_comedy","theaters","thermostat","thermostat_auto","thumb_down","thumb_down_alt","thumb_down_off_alt","thumb_up","thumb_up_alt","thumb_up_off_alt","thumbs_up_down","time_to_leave","timelapse","timeline","timer","timer_10","timer_10_select","timer_3","timer_3_select","timer_off","tips_and_updates","title","toc","today","toggle_off","toggle_on","toll","tonality","topic","touch_app","tour","toys","track_changes","traffic","train","tram","transfer_within_a_station","transform","transgender","transit_enterexit","translate","travel_explore","trending_down","trending_flat","trending_neutral","trending_up","trip_origin","try","tty","tune","tungsten","turned_in","turned_in_not","tv","tv_off","two_wheeler","umbrella","unarchive","undo","unfold_less","unfold_more","unpublished","unsubscribe","upcoming","update","update_disabled","upgrade","upload","upload_file","usb","usb_off","verified","verified_user","vertical_align_bottom","vertical_align_center","vertical_align_top","vertical_distribute","vertical_split","vibration","video_call","video_camera_back","video_camera_front","video_collection","video_label","video_library","video_settings","video_stable","videocam","videocam_off","videogame_asset","videogame_asset_off","view_agenda","view_array","view_carousel","view_column","view_comfortable","view_comfy","view_compact","view_day","view_headline","view_in_ar","view_list","view_module","view_quilt","view_sidebar","view_stream","view_week","vignette","villa","visibility","visibility_off","voice_chat","voice_over_off","voicemail","volume_down","volume_mute","volume_off","volume_up","volunteer_activism","vpn_key","vpn_lock","vrpano","wallet_giftcard","wallet_membership","wallet_travel","wallpaper","warning","warning_amber","wash","watch","watch_later","water","water_damage","water_drop","waterfall_chart","waves","waving_hand","wb_auto","wb_cloudy","wb_incandescent","wb_iridescent","wb_shade","wb_sunny","wb_twilight","wc","web","web_asset","web_asset_off","weekend","west","whatshot","wheelchair_pickup","where_to_vote","widgets","wifi","wifi_calling","wifi_calling_3","wifi_lock","wifi_off","wifi_protected_setup","wifi_tethering","wifi_tethering_error_rounded","wifi_tethering_off","window","wine_bar","work","work_off","work_outline","workspaces","wrap_text","wrong_location","wysiwyg","yard","youtube_searched_for","zoom_in","zoom_out","zoom_out_map"]}];function O(e){const[t,a]=d({defaultIcon:mappl10n.options.defaultIcon,filename:null,filter:"",glyph:"",glyphColor:"white",glyphFont:N[0],glyphSize:20,isOpen:!1,mode:"list",shape:"circle",shapeColor:"gray",shapeFont:S[0],toDelete:[],userIcons:mappl10n.options.userIcons});function r(e){a((t=>({...t,...e})))}function p(a,o){switch(a){case"bulk-select":let a=[...t.toDelete],i=t.toDelete.indexOf(o.iconid);i>=0?a.splice(i,1):a.push(o.iconid),r({toDelete:a});break;case"close":r({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&mapp.lib.ajax({type:"POST",data:{action:"mapp_icon_delete",iconids:t.toDelete,nonce:mappl10n.options.nonce},callback:function(a){a&&"OK"==a.status?(t.toDelete.indexOf(e.iconid)>=0&&!function(e){if(!e)return!1;let t=e.replace(/.png|.gif|.jpg/gi,"").toLowerCase();return mappl10n.options.standardIcons.indexOf(t)>=0}(e.iconid)&&e.onChange(null),mappl10n.options.userIcons=a.data,r({toDelete:[],mode:"list",userIcons:mappl10n.options.userIcons})):alert("Delete error: "+a.status)}});break;case"edit-cancel":r({mode:"list"});break;case"edit-save":!function(e){const a=32,o=2;let i=document.createElement("canvas");i.width=a*o,i.height=a*o,i.style.imageRendering="pixelated";let n=i.getContext("2d");n.font=a*o+"px "+t.shapeFont.fontFamily,n.fillStyle=t.shapeColor,n.textBaseline="bottom",n.fillText(t.shape,0,a*o),n.strokeStyle="white",n.strokeText(t.shape,1,a*o);const s=_.findWhere(t.shapeFont.glyphs,{name:t.shape});if(t.glyph&&s.center){n.imageSmoothingEnabled=!1,n.font=t.glyphSize*o+"px "+t.glyphFont.fontFamily,n.fillStyle=t.glyphColor;const e=[s.center[0]*o,s.center[1]*o];n.fillText(t.glyph,e[0]-t.glyphSize,e[1]+t.glyphSize)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(i):i.toBlob((e=>{let a=new FormData;a.append("image0",e,t.filename),m(a)}),"image/png",100)}();break;case"edit-upload":!function(e){let t=new FormData;_.map(e,((e,a)=>{e.type.match("image.*")?t.append("image"+a,e):alert("File "+e.name+" is not an image.")})),m(t)}(o);break;case"list-select":e.onChange&&e.onChange(o),p("close");break;case"mode":r("bulk"==o?{mode:o,toDelete:[]}:{mode:o});break;case"open":r({isOpen:!0})}}function c(a){const o="user"==a?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(o,(o=>{if("standard"==a&&function(e){return mappl10n.options.userIcons.indexOf(e)>=0}(o+".png"))return"";let i="mapp-icon-wrapper";return"bulk"==t.mode&&t.toDelete.indexOf(o)>=0?i+=" mapp-bulk-selected":"list"!=t.mode||e.iconid!=o&&e.iconid+".png"!=o||(i+=" mapp-selected"),n("div",{alt:o,className:i,key:o,onClick:()=>{"list"==t.mode?p("list-select",o):"user"==a&&p("bulk-select",{iconid:o,type:a})}},n("img",{className:"mapp-icon",src:mapp.Icons.getUrl(o),title:o}))}))}function m(t){t.append("action","mapp_icon_save"),t.append("nonce",mappl10n.options.nonce),mapp.lib.ajax({type:"POST",contentType:!1,processData:!1,data:t,success:t=>{t&&"OK"==t.status?(mappl10n.options.userIcons=t.data.icons,r({userIcons:mappl10n.options.userIcons}),r({mode:"list"}),e.onChange&&e.onChange(t.data.filename)):alert("Upload error: "+t.status)}})}return l((()=>{let e=t.glyph?t.glyph:t.shape;e+=".png",r({filename:e})}),[t.shape,t.shapeColor,t.glyphFont,t.glyph,t.glyphColor,t.glyphSize]),n(s,null,n("img",{className:"mapp-icon",onClick:()=>p("open",null),src:mapp.Icons.getUrl(e.iconid)}),"list"==t.mode&&t.isOpen&&n(v,{title:n("div",{className:"mapp-icons-title"},__("Select icon"),n(h,{disabled:"bulk"==t.mode,isPrimary:!0,onClick:()=>p("mode","edit")},__("New icon"))),className:"mapp-icons-modal",onRequestClose:()=>p("close")},n("div",{className:"mapp-icons"},n("div",{className:"mapp-icons-list"},mappl10n.options.userIcons.length>0&&n("div",{className:"mapp-icons-list-title"},__("Custom icons")),n("div",{className:"mapp-icons-user"},c("user")),mappl10n.options.userIcons.length>0&&n("div",{className:"mapp-icons-list-title"},__("Standard icons")),n("div",{className:"mapp-icons-standard"},c("standard"))),n("div",{className:"mapp-icons-toolbar"},n("div",null,n(h,{disabled:"bulk"==t.mode,isSecondary:!0,onClick:()=>p("list-select",null)},__("Use default icon")),mappl10n.options.userIcons.length>0&&n(h,{isTertiary:!0,onClick:()=>p("mode","bulk")},__("Edit list"))),n("div",{className:"mapp-icons-filename"},e.iconid?e.iconid:__("No icon selected"))))),"bulk"==t.mode&&t.isOpen&&n(v,{title:n("div",{className:"mapp-icons-title"},__("Select icons to delete")),className:"mapp-icons-modal",onRequestClose:()=>p("close")},n("div",{className:"mapp-icons"},n("div",{className:"mapp-icons-list"},n("div",{className:"mapp-icons-user"},c("user"))),n("div",{className:"mapp-icons-toolbar"},n("div",null,n(h,{isDestructive:!0,disabled:t.toDelete.length<1,onClick:()=>p("delete")},__("Delete")),n(h,{isSecondary:!0,onClick:()=>p("mode","list")},__("Cancel")))))),"edit"==t.mode&&n(v,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:()=>p("edit-cancel"),shouldCloseOnClickOutside:!1},n("div",{className:"mapp-icons-edit"},n("div",{id:"mapp-edit-debug"}),n("section",null,n("h2",null,__("Shape")),n("span",{className:"mapp-icons-edit-shapes",style:{color:t.shapeColor,fontFamily:t.shapeFont.fontFamily}},_.map(t.shapeFont.glyphs,((e,a)=>{const o=t.shape==e.name;return n("span",{className:"mapp-icons-edit-shape-wrapper"+(o?" mapp-selected":""),key:e.name,onClick:()=>r({shape:e.name}),title:e.name},n("span",{className:"mapp-icons-edit-shape"},e.name,e.center&&t.glyph&&n("div",{className:"mapp-icons-edit-shape-glyph "+t.glyphFont.className,style:{left:e.center[0],top:e.center[1],color:t.glyphColor,fontSize:t.glyphSize,width:t.glyphSize}},t.glyph)))})))),n("section",{className:"mapp-icons-edit-font"},n("h2",null,__("Font")),n(i.Select,{value:t.glyphFont.id,options:_.map(N,(e=>({value:e.id,label:e.label}))),onChange:e=>r({glyphFont:_.findWhere(N,{id:e}),glyph:null})}),n("span",null,__("Font size")),n(w,{initialPosition:20,min:16,max:24,value:t.glyphSize,onChange:e=>r({glyphSize:e})})),n("section",null,n("h2",null,__("Color")),n("span",{className:"mapp-icons-edit-colors"},n(o.MappColorPicker,{color:t.shapeColor,isExtended:!1,onChange:e=>r({shapeColor:e.color})}),n("span",null,__("Fill")),n(o.MappColorPicker,{color:t.glyphColor,isExtended:!1,onChange:e=>r({glyphColor:e.color})}),n("span",null,__("Stroke")))),function(){const e=_.filter(t.glyphFont.glyphs,(e=>!t.filter||e.includes(t.filter)));return n("div",{className:"mapp-icons-edit-glyphs"},n("section",{className:"mapp-icons-edit-search"},n("h2",null,__("Search")),n(i.Input,{value:t.filter,onChange:e=>r({filter:e})})),n("div",{className:"mapp-icons-edit-glyph-list",style:{color:t.glyphColor}},_.map(e,((e,a)=>n("div",{tabIndex:0,className:"mapp-icons-edit-glyph-wrapper"+(t.glyph==e?" mapp-selected":""),key:a,onClick:()=>r({glyph:t.glyph==e?null:e})},n("span",{className:"mapp-icons-edit-glyph "+t.glyphFont.className},e),n("div",{className:"mapp-icons-edit-glyph-title"},e.replaceAll("_"," ")))))))}(),n("div",{className:"mapp-icons-edit-toolbar"},n("div",{className:"mapp-icons-edit-toolbar-left"},n(h,{isPrimary:!0,onClick:()=>p("edit-save")},__("Save")),n(h,{isSecondary:!0,onClick:()=>p("edit-cancel")},__("Cancel")),n(i.Input,{className:"mapp-icons-filename",value:t.filename,onChange:e=>r({filename:e})})),n("div",null,n(y,{accept:"image/*",icon:"upload",multiple:!0,onChange:e=>{p("edit-upload",e.target.files)}},__("Upload icons")))))))}},816:(e,t,a)=>{"use strict";a.r(t);var o=a(429),i=a(477);window.mapp=window.mapp||{};const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useRef:p,useState:c}=wp.element,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function d(e){const{BaseControl:t,Button:a,ButtonGroup:r,CheckboxControl:d,Dropdown:m,Modal:u,Panel:_,PanelBody:h,PanelRow:g,Placeholder:f,RadioControl:b,SelectControl:y,TextControl:v,ToggleControl:k,Toolbar:w,ToolbarButton:C,ToolbarGroup:x}=wp.components,{BlockControls:S,InspectorControls:N}=wp.blockEditor,[O,M]=c({isOpen:!1,map:null,mapdata:void 0,pickerMode:"list",pickerMapid:null}),P=p(null);function I(e){M((t=>({...t,...e})))}function z(t,a){switch(t){case"add":I({isOpen:!0,pickerMapid:null,pickerMode:"edit"}),e.setAttributes({center:void 0,zoom:void 0});break;case"change-settings":e.setAttributes(a);break;case"edit":I({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"edit"});break;case"edit-close":case"pick-close":I({isOpen:!1});break;case"pick-trash":e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),I({isOpen:!1});break;case"pick-insert":case"pick-duplicate":a!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:a,zoom:void 0}),I({isOpen:!1});break;case"open":I({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"list"})}}function E(){return n(S,null,n(void 0!==x?x:w,null,e.attributes.mapid&&n(C,{icon:"edit",label:__("Edit map"),onClick:()=>z("edit")}),n(C,{icon:"portfolio",label:__("Map Library"),onClick:()=>z("open")})))}function T(){if(O.isOpen)return n(i.default,{mapid:O.pickerMapid,mode:O.pickerMode,onAction:z,type:"post"})}return l((()=>{const t=t=>{I({mapdata:t.maps[e.attributes.mapid]})};return mapp.store.subscribe(t),()=>mapp.store.unsubscribe(t)})),l((()=>{e.attributes.mapid&&mapp.store.fetchMap({mapid:e.attributes.mapid})}),[e.attributes.mapid]),l((()=>{e.attributes.mapid&&P.current&&O.mapdata&&function(){let t=new mapp.Map(O.mapdata,{alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:e.attributes.poiList,search:e.attributes.search,sel:jQuery(P.current),width:e.attributes.width,zoom:e.attributes.zoom});t.display(),I({map:t})}()}),[O.mapdata,e.attributes.search]),l((()=>{"wide"!=e.attributes.align&&"full"!=e.attributes.align||(e.setAttributes({width:"100%"}),O.map&&O.map.setSize({width:"100%"}))}),[e.attributes.align]),e.attributes.preview?n("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):e.attributes.mapid&&null!==O.mapdata?n(s,null,E(),function(){if(!O.map)return null;const{align:t,center:a,height:i,poiList:s,search:l,width:r,zoom:p}=e.attributes;return n(N,null,n("div",{className:"mapp-gt-inspector"},n(o.MappSettings,{map:O.map,alignment:t,context:"map",onAction:z,center:a,height:i,poiList:s,search:l,width:r,zoom:p})))}(),n("div",{className:"mapp-gt",ref:P}),T()):n(s,null,n(s,null,E(),n(f,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},n(a,{icon:"portfolio",isSecondary:!0,onClick:()=>z("open")},__("Map Library")))),T())}mappl10n.options.postid&&wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:mappl10n.options.blockCategory,attributes:{center:{type:"string"},height:{type:"string",default:""},initialOpenDirections:{type:"boolean"},mapid:{type:"string"},mapOpts:{type:"object"},poiList:{type:"boolean"},preview:{type:"boolean",default:!1},search:{type:"boolean"},width:{type:"string",default:""},zoom:{type:"number"}},supports:{align:["full","wide","center","left","right"]},transforms:{from:[{type:"shortcode",tag:"mappress",attributes:{center:{type:"string",shortcode:e=>e.named.center},height:{type:"string",shortcode:e=>e.named.height},initialOpenDirections:{type:"boolean",shortcode:e=>"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections||void 0},mapid:{type:"string",shortcode:e=>e.named.mapid},poiList:{type:"boolean",shortcode:e=>"true"==e.named.poiList||"true"==e.named.poilist||void 0},search:{type:"boolean",shortcode:e=>"true"==e.named.search||"true"==e.named.search||void 0},width:{type:"string",shortcode:e=>e.named.width},zoom:{type:"number",shortcode:e=>parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}},{type:"block",blocks:["core/shortcode"],isMatch:e=>{let{text:t}=e;var a=wp.shortcode.regexp("mappress");return a.lastIndex=0,a.test(t)},transform:e=>{let{text:t}=e;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return n(d,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},378:(e,t,a)=>{"use strict";a.r(t);a(429),a(670),a(308);window.mapp=window.mapp||{};wp.element.createElement;const{Fragment:o,useEffect:i,useLayoutEffect:n,useRef:s,useState:l}=wp.element,{BaseControl:r,Button:p,ButtonGroup:c,Card:d,CardBody:m,CardFooter:u,CardHeader:_,CheckboxControl:h,ExternalLink:g,HorizontalRule:f,Panel:b,PanelBody:y,PanelRow:v,Placeholder:k,RadioControl:w,SelectControl:C,TabPanel:x,TextControl:S,TextareaControl:N,ToggleControl:O,Toolbar:M}=wp.components,{useSelect:P}=wp.data},498:(e,t,a)=>{"use strict";a.r(t);var o=a(477);window.mapp=window.mapp||{};const i=wp.element.createElement,{Fragment:n,useEffect:s,useLayoutEffect:l,useRef:r,useState:p}=wp.element,{Button:c,Dashicon:d,Modal:m}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function u(e){const[t,a]=p({isOpen:!0,mapid:null});function s(e){a((t=>({...t,...e})))}function l(e,t){switch(e){case"pick-close":s({isOpen:!1,mapid:null});break;case"pick-insert":s({isOpen:!1});var a='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(a);break;case"open":s({isOpen:!0,mapid:r()})}}function r(){const e="undefined"!=typeof tinyMCE&&tinyMCE?tinyMCE.get("content"):null,t=e&&e.selection?e.selection.getSel():null;if(!t||void 0===t.anchorOffset||!t.anchorNode||!t.anchorNode.data)return null;let a=null,o=t.anchorNode.data,i=-1;for(let e=t.anchorOffset-1;e>=0;e--){let t=o[e];if("["==t){i=e;break}if("]"==t||"<"==t||">"==t)break}return i>=0&&(a=wp.shortcode.next("mappress",o,i),a)?a.shortcode.attrs.named.mapid:null}return i(n,null,i("button",{className:"button",type:"button",onClick:e=>{e.preventDefault(),l("open")}},i(d,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&i(o.default,{context:"mce",mapid:t.mapid,onAction:l}))}jQuery(document).on("click",".mapp-mce-button",(e=>{const t=e.currentTarget.parentElement;wp.element.render(i(u),t)}))},670:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappMultiSelect:()=>b});const o=wp.element.createElement,{Fragment:i,useEffect:n,useLayoutEffect:s,useRef:l,useState:r}=wp.element,{BaseControl:p,Button:c,CheckboxControl:d,Panel:m,PanelBody:u,PanelRow:h,Spinner:g,TextControl:f}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function b(e){const t=l(null),a=l(null),[i,s]=r({isOpen:!1,filter:"",filteredOptions:[]});function c(e){s((t=>({...t,...e})))}function m(t){let a=_.findWhere(e.options,{value:t});return a?a.label:t}function u(){let t;return e.values instanceof Array?t=[...e.values]:e.values&&(t=[e.values]),t||[]}function h(t,a){let o=u(),i=o.indexOf(t);(a=void 0!==a?a:-1==i)?o.push(t):o.splice(i,1),e.onChange(o)}function g(){return i.isOpen?o("div",{className:"mapp-select-dropdown-wrapper"},o("div",{className:"mapp-select-dropdown"},!i.isOpen||!e.options||e.options.length<10?null:o("div",{className:"mapp-select-filter",ref:a},o(f,{autoComplete:"off",placeholder:__("Search"),value:i.filter,onChange:e=>c({filter:e})})),o("div",{className:"mapp-select-dropdown-list"},function(){const e=u();if(0==i.filteredOptions.length)return o("div",{className:"mapp-select-dropdown-item"},__("No results"));return i.filteredOptions.map((t=>o(d,{className:"mapp-select-dropdown-item",checked:e.includes(t.value),key:t.value,onChange:e=>h(t.value,e),label:t.label})))}()))):null}return n((()=>{if(e.options)if(i.filter){let t=i.filter.toUpperCase();c({filteredOptions:e.options.filter((e=>0==e.label.toUpperCase().indexOf(t)))})}else c({filteredOptions:e.options})}),[e.options,i.filter]),n((()=>{i.isOpen&&a.current&&(jQuery("input",jQuery(a.current)).focus(),c({filter:""}))}),[i.isOpen]),o(p,{className:"mapp-select",label:e.label},o("div",{ref:t,tabIndex:0,onBlur:e=>function(e){event.relatedTarget||document.activeElement,t.current.contains(e.relatedTarget)||c({isOpen:!1})}(e)},function(){const t=u();return t instanceof Array&&t.map((e=>m(e))),void 0===e.options?o("div",{className:"mapp-select-input"},o("div",{className:"mapp-select-tokens"}),o("span",{className:"dashicons dashicons-arrow-down-alt2"})):o("div",{className:"mapp-select-input",onClick:()=>c({isOpen:!i.isOpen})},o("div",{className:"mapp-select-tokens"},t.map((e=>o("span",{className:"mapp-select-token",key:e,onClick:t=>{t.stopPropagation(),h(e,!1)}},m(e))))),o("span",{className:"dashicons "+(i.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))}(),g()))}},218:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>y});var o=a(824),i=a(143),n=a(710);const s=wp.element.createElement,{Fragment:l,useEffect:r,useLayoutEffect:p,useCallback:c,useRef:d,useState:m}=wp.element,{useSelect:u}=wp.data,{Button:h,Dashicon:g,FormTokenField:f,Modal:b}=wp.components,{sprintf}=wp.i18n,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function y(e){const[t,a]=m({...e,isCheckingLicense:!1,isSaving:!1}),p=d(null);function c(e){a((t=>({...t,...e})))}function b(e){return _.map(e,((e,t)=>({value:t,label:e})))}function y(e,t){return e&&Array.isArray(e)&&e.length?(_.map(e,(e=>{for(let t in e)"string"==typeof e[t]&&(e[t]=e[t].trim())})),t?e.filter((e=>{for(let t in e)if(!e[t]||0==e[t].length)return!1;return!0})):e.filter((e=>!(e.hasOwnProperty("key")&&!e.key)))):[]}function v(e,a){switch(e){case"license-check":c({isCheckingLicense:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:t.license},callback:e=>{if(c({isCheckingLicense:!1}),e&&"OK"==e.status){let a={...t.helpers};a.license_status=e.data,c({helpers:a})}}});break;case"reset":c({isSaving:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:e=>{c({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}});break;case"save":let e={...t};delete e.helpers,e.filters=y(e.filters,!1),e.metaKeys=y(e.metaKeys,!0),e.sizes=y(e.sizes,!0),e.autoicons&&e.autoicons.values&&(e.autoicons.values=y(e.autoicons.values,!0)),c({isSaving:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:JSON.stringify(e)},callback:e=>{c({isSaving:!1}),e&&"OK"==e.status&&window.location.reload()}})}}return r((()=>{if(p.current){new mapp.Map(t.helpers.demo_map,{sel:jQuery(p.current)}).display()}}),[]),r((()=>{mappl10n.options.engine!=t.engine&&v("save")}),[t.engine]),s("div",{className:"mapp-options"},s("form",{onSubmit:e=>{e.preventDefault(),v("save")}},s(o.Section,{title:__("Sample Map"),className:"mapp-demo-section"},s("div",{className:"mapp-options-demo",ref:p})),mappl10n.options.pro&&(!t.helpers.is_multisite||t.helpers.is_super_admin||t.helpers.is_main_site)&&s(o.Section,{title:__("License")},s(o.Option,{title:__("MapPress license key"),className:"mapp-option-license"},s(o.Input,{value:t.license,name:"license",onChange:e=>{let a={...t.helpers};a.license_status="",c({license:e,helpers:a})},size:37,placeholder:__("Enter license to enable automatic updates")}),function(){const e=t.helpers.license_status,a=s(h,{isSecondary:!0,href:"https://mappresspro.com/mappress"},__("Get license")),o=s(h,{isBusy:t.isCheckingLicense,isSecondary:!0,onClick:()=>v("license-check")},__("Check now")),i=s(h,{isLink:!0,target:"_blank",href:"https://mappresspro.com/account"},__("Your account"));return t.license?"active"==e?s("span",{className:"mapp-license-status"},s(g,{icon:"yes"}),__("Active")):s(l,null,o,i,e&&!t.isCheckingLicense&&s("div",null,s(g,{icon:"no"}),"inactive"==e?__("License is invalid or expired"):e)):a}()),s(o.Option,{title:__("Beta versions")},s(o.Checkbox,{label:__("Enable updates for beta versions"),checked:t.betas,onChange:e=>c({betas:e})}))),s(o.Section,{title:__("Basic Settings")},s(o.Option,{title:__("Mapping API")},s(o.Radios,{options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:e=>{c({engine:e,geocoder:"google"==e?"google":""})},checked:t.engine,help:{href:"#toc-picking-a-mapping-api",text:__("Leaflet is free and requires no API key. Google requires an API key and has usage limits.")}})),"leaflet"==t.engine&&function(){const e=[{value:"nominatim",label:"Nominatim",disabled:t.mapbox,hide:!!t.mapbox},{value:"mapbox",label:"MapBox",disabled:!t.mapbox},{value:"google",label:"Google",disabled:!t.apiKey}];let a={};return"nominatim"==t.geocoder&&(a={text:__("Nominatim is free but inaccurate. Consider using Mapbox or Google instead."),type:"warning"}),a.href="#toc-picking-a-geocoder",s(o.Option,{title:__("Geocoder")},s(o.Radios,{options:e,checked:t.geocoder,onChange:e=>c({geocoder:e}),help:a}))}(),"leaflet"==t.engine&&function(){const e=s(h,{isSecondary:!0,href:"https://account.mapbox.com/access-tokens/",target:"_blank"},__("Get an Access Token"));return s(o.Option,{title:__("Mapbox access token")},s("div",{className:"mapp-option-mapbox"},s(o.Input,{name:"mapbox",value:t.mapbox,onChange:e=>{c({mapbox:e}),c({geocoder:e?"mapbox":"nominatim"})},placeholder:__("Enter token to use Mapbox"),size:50}),e),s("div",{className:"mapp-help-text"},__("Mapbox makes Leaflet maps look great and provides an excellent geocoder.")))}(),function(){const e=s(h,{isSecondary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key",target:"_blank"},__("Get an API Key"));return s(o.Option,{title:__("Google API key"),className:"mapp-option-apikey"},s(o.Input,{name:"apiKey",value:t.apiKey,onChange:e=>{c({apiKey:e})},placeholder:"google"==t.engine?__("Enter API key to use Google maps"):__("Enter API key to use Google geocoder"),size:50}),e)}()),s(o.Section,{title:__("Map Settings")},s(o.Option,{title:__("Automatic display")},s(o.Radios,{options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:t.autodisplay,onChange:e=>c({autodisplay:e})})),s(o.Option,{title:__("Map alignment")},s(o.Radios,{options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:t.alignment,onChange:e=>c({alignment:e})})),s(o.Option,{title:__("Directions")},s(o.Radios,{checked:t.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:e=>c({directions:e})})),s(o.Option,{title:__("Mini width")},s(o.Input,{value:t.mini,onChange:e=>c({mini:e}),size:3,label:__("Width (px) to use map/list toggle buttons")})),"leaflet"==mappl10n.options.engine&&s(o.Option,{title:__("Scroll wheel zoom")},s(o.Checkbox,{checked:t.scrollWheel,label:__("Enable map zoom with mouse scroll wheel"),onChange:e=>c({scrollWheel:e})}))),s(o.Section,{title:__("POIs")},s(o.Option,{title:__("Default zoom")},s(o.Select,{label:__("Default zoom when displaying a single POI"),value:t.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(e=>({value:e,label:e}))),onChange:e=>c({poiZoom:e})})),s(o.Option,{title:__("Hover")},s(o.Checkbox,{checked:t.tooltips,label:__("Open POIs on hover"),onChange:e=>c({tooltips:e})})),s(o.Option,{title:__("Open first POI")},s(o.Checkbox,{checked:t.initialOpenInfo,onChange:e=>c({initialOpenInfo:e}),label:__("Open first POI when a map is displayed")}))),s(o.Section,{title:__("POI List")},s(o.Option,{title:__("Display")},s(o.Checkbox,{checked:t.poiList,label:__("Show a list of POIs with each map"),onChange:e=>c({poiList:e})})),s(o.Option,{title:__("Position")},s("div",{className:"mapp-option-poilist-radios"},s(o.Radios,{checked:t.layout,options:[{value:"left",label:__("Left of map")},{value:"inline",label:__("Below map")}],onChange:e=>c({layout:e})}))),"left"==t.layout&&s(o.Option,{title:__("Initial open")},s("div",{className:"mapp-option-poilist-open"},s(o.Checkbox,{checked:t.poiListOpen,label:__("Open list when map is displayed"),onChange:e=>c({poiListOpen:e})}))),s(o.Option,{title:__("Paging")},s("div",{className:"mapp-option-poilist-page-size"},s(o.Input,{labelRight:__("POIs per page"),max:999,min:1,onChange:e=>c({poiListPageSize:e}),size:3,type:"number",value:t.poiListPageSize}))),s(o.Option,{title:__("Sort")},s(o.Checkbox,{checked:t.sort,label:__("Sort POI list by title"),onChange:e=>c({sort:e})}))),s(o.Section,{title:__("Styled Maps")},s(o.Option,{title:__("Default style")},s("div",{className:"mapp-option-style"},s(n.m,{selected:t.style,onChange:e=>{c({style:e}),mappl10n.options.style=e}}),s("div",null,__('Replace the default "roadmap" or "streets" style'))))),mappl10n.options.pro&&s(o.Section,{title:__("Icons")},s(o.Option,{title:__("Default icon")},s(i.MappIconPicker,{iconid:t.defaultIcon,onChange:e=>{mappl10n.options.defaultIcon=e,c({defaultIcon:e})}})),s(o.Option,{title:__("Icon directory")},s("code",null,t.helpers.icon_directory)),s(o.Option,{title:__("Highlight selected POI")},s(o.Radios,{checked:t.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:e=>c({highlight:e})}),"icon"==t.highlight&&s(i.MappIconPicker,{defaultIcon:t.defaultIcon,iconid:t.highlightIcon,onChange:e=>c({highlightIcon:e})})),function(){let e=t.iconScale&&Array.isArray(t.iconScale)?[...t.iconScale]:[0,0];return s(o.Option,{title:__("Icon size")},s(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[0]=t>0?t:"",c({iconScale:e}))},size:3,type:"number",value:e[0]?e[0]:""}),s("span",null," X "),s(o.Input,{min:0,max:64,onChange:t=>{t<=64&&(e[1]=t>0?t:"",c({iconScale:e}))},size:3,type:"number",value:e[1]?e[1]:""}),s("span",null," (px) "))}(),function(){let e=b(t.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});const a=u((e=>{if("post_type"==t.autoicons.key)return b(t.helpers.post_types);const a=wp.data.select("core").getEntityRecords("taxonomy",t.autoicons.key,{per_page:-1,_fields:"id,name,slug"});return a?a.map((e=>({value:e.slug,label:e.name}))):[]}),[t.autoicons.key]);return s(o.Option,{title:__("Automatic icons")},s(o.Select,{label:__('Be sure to set "Show in REST API" for custom taxonomies'),value:t.autoicons?t.autoicons.key:null,options:e,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.key=e,a.values=[],c({autoicons:a})},placeholder:""}),s(o.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:a},{id:"value",label:__("Icon"),type:"icon"}],data:t.autoicons.values,onChange:e=>{let a=t.autoicons?{...t.autoicons}:[];a.values=e,c({autoicons:a})}}))}()),s(o.Section,{title:__("Clustering")},s(o.Option,{title:__("Clustering")},s(o.Checkbox,{checked:t.clustering,label:__("Enable marker clustering"),onChange:e=>c({clustering:e})})),function(){let e=t.clusteringOptions?t.clusteringOptions:{};const a=(t,a)=>{e[t]=a,c({clusteringOptions:e})};if("google"==t.engine){const t="https://github.com/googlemaps/v3-utility-library/blob/3fca406/packages/markerclustererplus/src/markerclusterer.ts",i=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return s("div",{className:"mapp-option-clustering-options"},s(o.Option,{title:__("Max zoom")},s(o.Select,{help:{href:t},label:s(l,null,__("Disable clustering at zoom"),s("code",null,"maxZoom")),onChange:e=>a("maxZoom",e),options:_.map(i,(e=>({value:e,label:e}))),placeholder:__("None"),value:e.maxZoom})))}{const t="https://github.com/Leaflet/Leaflet.markercluster#all-options",i=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18];return s("div",{className:"mapp-option-clustering-options"},s(o.Option,{title:__("Max zoom")},s(o.Select,{help:{href:t},label:s(l,null,__("Disable clustering at zoom"),s("code",null,"disableClusteringAtZoom")),onChange:e=>a("disableClusteringAtZoom",e),options:_.map(i,(e=>({value:e,label:e}))),placeholder:__("Auto"),value:e.disableClusteringAtZoom})),s(o.Option,{title:__("Spiderfy")},s(o.Checkbox,{checked:e.spiderfyOnMaxZoom,help:{href:t},label:s(l,null,__("Spiderfy"),s("code",null,"spiderfyOnMaxZoom")),onChange:e=>a("spiderfyOnMaxZoom",e)})))}}()),mappl10n.options.pro&&s(o.Section,{title:__("Mashups")},function(){const e=[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}];return s(o.Option,{title:__("Marker click")},s(o.Radios,{checked:t.mashupClick,options:e,onChange:e=>c({mashupClick:e})}))}(),s(o.Option,{title:__("Popup content")},s(o.Radios,{checked:t.mashupBody,options:[{value:"poi",label:__("POI title + POI body")},{value:"post",label:__("Post title + post excerpt")}],onChange:e=>c({mashupBody:e})})),s(o.Option,{title:__("KMLs")},s(o.Checkbox,{checked:t.mashupKml,label:__("Include KML POIs in mashups"),onChange:e=>c({mashupKml:e})}))),mappl10n.options.pro&&s(o.Section,{title:__("Search")},s(o.Option,{title:__("Search")},s(o.Checkbox,{checked:t.search,label:__("Enable search for mashups"),onChange:e=>c({search:e})})),s(o.Option,{title:__("Search radius")},s(o.Select,{help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},label:__("Minimum search radius (km)"),value:t.radius,options:_.map([1,5,10,15,25,50,75,100,200,300],(e=>({value:e,label:e}))),onChange:e=>c({radius:e})})),s(o.Option,{title:__("Search country")},s(o.Select,{label:__("Country code for searches"),value:t.country,options:_.map(["","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BQ","BA","BW","BV","BR","IO","VG","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CK","CR","HR","CU","CW","CY","CZ","CD","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","CI","JM","JP","JE","JO","KZ","KE","KI","XK","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","KP","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","CG","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SX","SK","SI","SB","SO","ZA","GS","KR","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","VI","UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","WF","EH","YE","ZM","ZW"],(e=>({value:e,label:e}))),onChange:e=>c({country:e}),help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}})),mappl10n.options.ssl?s(o.Option,{title:__("User location")},s(o.Checkbox,{checked:t.userLocation,label:__("Show user location on map"),onChange:e=>c({userLocation:e})})):null,function(){if("google"!=t.engine)return s(o.Option,{title:__("Bounding box")},s(o.Input,{onChange:e=>c({searchBox:e}),help:{text:__("Restrict searches to a bounding box (optional)"),href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},placeholder:"SW lon, SW lat, NE lng, NE lat",size:45,value:t.searchBox}))}()),mappl10n.options.pro&&s(o.Section,{title:__("Filter")},s(o.Option,{title:__("Filters position")},s(o.Radios,{options:[{value:"top",label:__("Top")},{value:"list",label:__("POI list")}],checked:t.filtersPos,onChange:e=>c({filtersPos:e})})),s(o.Option,{className:"mapp-option-filters",title:__("Filters")},s(o.MappCrudList,{data:t.filters,isDraggable:!0,onChangeData:e=>{c({filters:e})},onRender:e=>function(e){let{row:a,rowId:i,onChange:n,onDelete:l,...r}=e,p=b(t.helpers.taxonomies);const c=[{label:__("Post type"),value:"post"},{label:__("Text search"),value:"text"},{label:"──────────",value:"",disabled:!0},...p],d=function(e){const t=_.findWhere(c,{value:e.key});return t?t.label:__("New filter")},m="text"==a.key?[{value:"input",label:__("Input")}]:[{value:"checkbox",label:__("Checkboxes")},{value:"radio",label:__("Radio buttons")},{value:"select",label:__("Select")}];return s(o.MappExpand,{actions:s("div",null,s(h,{icon:"trash",onClick:()=>l(),title:__("Delete")})),className:"mapp-option-filter",initialOpen:!a.key,showToggle:!0,title:d(a)},s("div",{className:"mapp-option-filter-row"},s(o.Select,{labelTop:__("Filter type"),value:a.key,options:c,onChange:e=>n({key:e,format:"text"==e?"input":"checkbox"}),placeholder:""}),s(o.Select,{labelTop:__("Format"),value:a.format,options:m,placeholder:"",onChange:e=>n({format:e})}),s(o.Input,{labelTop:__("Label"),placeholder:d(a),value:a.label,onChange:e=>n({label:e})}),"post"!=a.key&&"meta"!=a.key&&"text"!=a.key&&s(o.Select,{labelTop:__("Sort"),value:a.sort,options:[{value:"name",label:__("Name")},{value:"slug",label:__("Slug")}],onChange:e=>n({sort:e})})),a.key&&"meta"!=a.key&&"text"!=a.key&&s("div",{className:"mapp-option-filter-row mapp-option-filter-tokens"},s(f,{label:__("Include"),value:a.include,onChange:e=>n({include:e}),__experimentalShowHowTo:!1}),s(f,{label:__("Exclude"),value:a.exclude,onChange:e=>n({exclude:e})})))}(e)}))),mappl10n.options.pro&&s(o.Section,{title:__("Generate Maps from Custom Fields")},s(o.Option,{title:__("Post types")},s(o.Checkboxes,{values:t.postTypes,options:b(t.helpers.post_types),onChange:e=>c({postTypes:e})})),s(o.Option,{title:__("Custom fields")},s(o.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:b(t.helpers.meta_fields)},{id:"value",label:__("Custom field"),type:"select",options:b(t.helpers.meta_keys)}],data:t.metaKeys,onChange:e=>{c({metaKeys:e})}})),s(o.Option,{title:__("Overwrite")},s(o.Checkbox,{label:__("Overwrite maps when posts are saved"),checked:t.metaSyncSave,onChange:e=>{c({metaSyncSave:e})}})),"google"==t.engine&&s(o.Option,{title:__("Google Server API key")},s(o.Input,{name:"apiKeyServer",value:t.apiKeyServer,onChange:e=>c({apiKeyServer:e}),size:50,help:{text:__("Server API key for geocoding. Only required if client key is restricted by referrer."),href:"https://mappresspro.com/mappress-documentation/#toc-google-api-keys"}})),function(){let e=__("No errors found");return t.helpers.geocoding_errors&&t.helpers.geocoding_errors.length>0&&(e=_.map(t.helpers.geocoding_errors,(e=>s("div",{key:e.ID},s("a",{href:mappl10n.options.editurl+"?post="+e.ID+"&action=edit"},e.post_title),s("span",null," : "+e.error))))),s(o.Option,{title:__("Geocoding errors")},e)}()),mappl10n.options.pro&&mappl10n.options.acfActive&&s(o.Section,{title:__("Frontend Forms")},s(o.Option,{title:__("Advanced Custom Fields")},s(o.Input,{className:"mapp-option-acf",name:"acf",value:t.acf,onChange:e=>{c({acf:e})},placeholder:__("ACF field"),size:20}),__("ACF map field to include on MapPress mashups"),s(o.Help,{text:__("To generate MapPress maps from ACF fields, leave this blank and use the Geocoding section"),href:"https://mappresspro.com/mappress-documentation/#toc-frontend-forms"}))),mappl10n.options.pro&&s(o.Section,{title:__("Templates")},s(o.Option,{title:__("Custom templates")},s(o.MappTemplateEditor)),s(o.Option,{title:__("Mashup thumbnails")},s(o.Select,{label:__("Popups"),onChange:e=>c({thumbsPopup:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsPopup}),s(o.Select,{label:__("POI lists"),onChange:e=>c({thumbsList:e}),options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:t.thumbsList})),s(o.Option,{title:__("Thumbnail size")},s(o.Select,{onChange:e=>c({thumbSize:e}),options:b(t.helpers.thumbnail_sizes),value:t.thumbSize}),s("span",null," "+__("or")+" "),s(o.Input,{value:t.thumbWidth,onChange:e=>c({thumbWidth:e}),type:"number",min:0,max:9999}),s("span",null," X "),s(o.Input,{value:t.thumbHeight,onChange:e=>c({thumbHeight:e}),type:"number",min:0,max:9999}),s("span",null," (px) "))),s(o.Section,{title:__("Localization")},function(){const e="leaflet"==t.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport";return s(o.Option,{title:__("Language")},s(o.Select,{value:t.language,options:b(t.helpers.languages),onChange:e=>c({language:e}),help:{href:e,text:__("Language for searches and Google map controls")}}))}(),s(o.Option,{title:__("Directions server")},s(o.Input,{value:t.directionsServer,onChange:e=>c({directionsServer:e}),size:25}))),s(o.Section,{title:__("Miscellaneous")},s(o.Option,{title:__("Map sizes")},s(o.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:t.sizes,onChange:(e,t)=>c({sizes:e,size:t}),selectionColumn:"rowid",selected:t.size})),t.helpers.jetpack?null:s(o.Option,{title:__("Scripts")},s(o.Checkbox,{checked:t.footer,label:__("Output scripts in footer"),onChange:e=>c({footer:e}),help:{text:__("Disable footer scripts if maps are output using AJAX")}})),s(o.Option,{title:"WPML"},s(o.Checkbox,{checked:t.wpml,label:__("Copy maps when overwriting a translation"),onChange:e=>c({wpml:e}),help:{href:"https://mappresspro.com/mappress-documentation#wpml"}})),s(o.Option,{title:__("Compatibility")},s("div",null,s(o.Checkbox,{checked:t.deregister,label:__("Prevent loading Google Maps multiple times"),onChange:e=>c({deregister:e})})),s("div",null,s(o.Checkbox,{checked:t.iframes,label:__("Output maps in iframes to prevent compatibility issues"),onChange:e=>c({iframes:e})})))),s("div",{className:"mapp-options-toolbar"},s(h,{isBusy:t.isSaving,className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),s(h,{isBusy:t.isSaving,isSecondary:!0,onClick:()=>v("reset")},__("Reset Defaults")))))}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-options-settings")&&wp.element.render(s(y,mappress_options_state),document.getElementById("mapp-options-settings"))}))},824:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Control:()=>f,Help:()=>b,Checkbox:()=>y,Checkboxes:()=>v,Input:()=>k,Radios:()=>C,Select:()=>x,Textarea:()=>S,Section:()=>N,Option:()=>O,MappGrid:()=>M,MappCrudList:()=>P,MappExpand:()=>I,MappTemplateEditor:()=>z});var o=a(143);const i=wp.element.createElement,{Fragment:n,useEffect:s,useLayoutEffect:l,useCallback:r,useRef:p,useState:c}=wp.element,{useSelect:d}=wp.data,{Button:m,Dashicon:u,Modal:h,TabPanel:g}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function f(e){let{className:t,help:a,type:o,...s}=e;const l=Array.isArray(s.children)?n:"label";let r="mapp-control";return o&&(r+=" mapp-control-"+o),t&&(r+=" "+t),i("div",{className:r},s.labelTop&&i("div",{className:"mapp-label-top"},s.labelTop),i(l,null,s.labelLeft&&i("span",null,s.labelLeft),s.children,(s.label||s.labelRight)&&i("span",null,s.label||s.labelRight)),a&&i(b,a))}function b(e){let t="mapp-help-text";e.type&&(t+=" mapp-help-"+e.type);let a=null;return e.href&&(a="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),i(n,null,a&&i("a",{className:"mapp-help-link",href:a,target:"_blank"},i(u,{icon:"editor-help"})),e.text&&i("div",{className:t},e.text))}function y(e){let{checked:t,className:a,disabled:o,onChange:n,value:s,...l}=e;return i(f,{type:"checkbox",...l},i("input",{checked:void 0!==t&&t,className:a,disabled:o,onChange:e=>n(e.target.checked),type:"checkbox",value:s}))}function v(e){let{label:t,onChange:a,options:o,values:n,...s}=e;return i(f,{type:"checkboxes",...s},_.map(o,((e,t)=>{let o=n?n.indexOf(e.value):-1;return i(y,{key:t,label:e.label,value:e.value,checked:o>=0,disabled:e.disabled,onChange:t=>{let i=[...n];t&&-1==o&&a(i.concat(e.value)),!t&&o>=0&&(i.splice(o,1),a(i))}})})))}function k(e){let{autoFocus:t,disabled:a,max:o,min:n,name:s,onChange:l,placeholder:r,size:p,trim:c,type:d,value:m,...u}=e;return l?i(f,{type:"input",...u},i("input",{autoFocus:t,disabled:a,max:o,min:n,name:s,onChange:e=>l(c?e.target.value.trim():e.target.value),placeholder:r,size:p,type:d||"text",value:null!==m?m:""})):"Missing onChange handler in Input Control"}const w=function(e){let{checked:t,className:a,disabled:o,onChange:n,value:s,...l}=e;return i(f,{type:"radio",...l},i("input",{checked:t,className:a,disabled:o,onChange:e=>n(e.target.value),type:"radio",value:s}))};function C(e){let{checked:t,label:a,onChange:o,options:n,...s}=e;return i(f,{type:"radios",...s},_.map(n,((e,a)=>{if(!e.hide)return i(w,{key:a,value:e.value,checked:t==e.value||null==t&&""==e.value,onChange:e=>o(e),disabled:e.disabled,label:e.label})})))}function x(e){let{className:t,onChange:a,options:o,placeholder:n,value:s,...l}=e,r=[...o];return void 0!==n&&r.unshift({value:"",label:n}),i(f,{type:"select",...l},i("select",{className:t,value:null!=s?s:"",onChange:e=>a(e.target.value)},_.map(r,((e,t)=>i("option",{key:t,value:e.value,disabled:e.disabled},e.label)))))}function S(e){let{className:t,onChange:a,...o}=e;return i(f,{type:"textarea",...o},i("textarea",{className:t,onChange:e=>a(e.target.value)}))}function N(e){let t=e.className?" "+e.className:"";return i("div",{className:"mapp-option-section"+t},i("h2",null,e.title),e.children)}function O(e){const t=e.className?"mapp-option "+e.className:"mapp-option";return i("div",{className:t},i("div",{className:"mapp-option-title"},e.title),i("div",{className:"mapp-option-value"},e.children))}function M(e){const[t,a]=c({dragging:null,dragover:null});function n(e){a((t=>({...t,...e})))}function s(a,o){let i=[...e.data];switch(a){case"add":let a={};_.map(e.cols,(e=>{a[e.id]=""})),i.push(a),e.onChange(i,e.selected);break;case"change":i[o.i][o.id]=o.value,e.onChange(i,e.selected);break;case"delete":let s;i.splice(o,1),s=o==e.selected?null:o<e.selected?e.selected-1:e.selected,e.onChange(i,s);break;case"select":n({selected:o}),e.onChange(i,o);break;case"sort":let l=t.dragging,r=l<o?o-1:o;i.splice(r,0,i.splice(l,1)[0]),e.onChange(i,r),n({dragover:null})}}return i("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&i("div",{className:"mapp-grid-table"},function(){const t=e.selectionColumn?i("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,a=i("div",{className:"mapp-grid-cell",key:"actions"},"");return i("div",{className:"mapp-grid-header"},i("div",{className:"mapp-grid-row"},t,_.map(e.cols,(e=>i("div",{className:"mapp-grid-cell",key:e.id},e.label))),a))}(),i("div",{className:"mapp-grid-body"},_.map(e.data,((a,l)=>function(a,l){return i("div",{className:"mapp-grid-row"+(t.dragover==l?" mapp-dragover":""),draggable:!0,key:l,onDragOver:e=>e.preventDefault(),onDragStart:e=>n({dragging:l}),onDragEnter:e=>n({dragover:l}),onDragEnd:e=>n({dragging:null,dragover:null}),onDrop:e=>s("sort",l)},function(t,a){if(!e.selectionColumn)return null;let o,n;return"rowid"==e.selectionColumn?o=a:t[e.selectionColumn]?o=t[e.selectionColumn]:n=!0,"checkbox"===e.selectionType?i("div",{className:"mapp-grid-cell"},i(y,{value:o,checked:e.selected==o,disabled:n,onChange:e=>{s("select",e?o:null)}})):i("div",{className:"mapp-grid-cell"},i(w,{checked:e.selected==o,onChange:()=>s("select",o)}))}(a,l),_.map(e.cols,((t,a)=>i("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:l+"-"+a},function(t,a){if(a.onRender)return a.onRender({id:a.id,value:e.data[t][a.id],onChange:e=>s("change",{i:t,id:a.id,value:e})});switch(a.type){case"icon":return i(o.MappIconPicker,{iconid:e.data[t][a.id],onChange:e=>s("change",{i:t,id:a.id,value:e})});default:return i(k,{size:e.data[t][a.size],value:e.data[t][a.id],onChange:e=>s("change",{i:t,id:a.id,value:e})});case"select":return i(x,{value:e.data[t][a.id],options:a.options,onChange:e=>{s("change",{i:t,id:a.id,value:e})},placeholder:""})}}(l,t)))),function(e){return i("div",{className:"mapp-grid-cell",key:"delete"},i(m,{icon:"trash",onClick:()=>s("delete",e)}))}(l))}(a,l))))),i("div",{className:"mapp-grid-toolbar"},i(m,{isSecondary:!0,onClick:()=>s("add")},__("Add"))))}function P(e){let{data:t,isDraggable:a,onAdd:o,onChangeData:n,onRender:l,...r}=e;const[p,d]=c({dragging:null,dragover:null,isDraggable:!1});function u(e){d((t=>({...t,...e})))}function h(e,a,i){let s=[...t];switch(e){case"add":const e=o?o():{};s.push(e),n(s);break;case"change":s[i]={...t[i],...a},n(s);break;case"delete":confirm(mappl10n.delete_prompt)&&(s.splice(a,1),n(s));break;case"sort":let l=p.dragging,r=l<a?a-1:a;s.splice(r,0,s.splice(l,1)[0]),n(s),u({dragover:null})}}return s((()=>{}),[]),i("div",{className:"mapp-crud-list"},_.map(t,((e,t)=>i("div",{className:"mapp-crud-row"+(p.dragover==t?" mapp-dragover":""),draggable:a,key:t,onDragOver:e=>e.preventDefault(),onDragStart:e=>u({dragging:t}),onDragEnter:e=>u({dragover:t}),onDragEnd:e=>u({dragging:null,dragover:null}),onDrop:e=>h("sort",t)},l({row:e,rowId:t,onChange:e=>h("change",e,t),onDelete:()=>h("delete",t)})))),i("div",{className:"mapp-crud-toolbar"},i(m,{isSecondary:!0,onClick:()=>h("add")},__("Add"))))}function I(e){let{actions:t,initialOpen:a,showToggle:o,subTitle:n,title:s,...l}=e;const[r,p]=c({isOpen:!o||a});function d(e,t){if("toggle"===e)o&&(a={isOpen:!r.isOpen},p((e=>({...e,...a}))));var a}let m="mapp-expand";return m+=r.isOpen?"":" mapp-expand-closed",m+=l.className?" "+l.className:"",i("div",{className:m},i("div",{className:"mapp-expand-header",onClick:()=>d("toggle")},i("div",null,s,n),o&&i("div",null,i(u,{icon:r.isOpen?"arrow-up":"arrow-down"}))),i("div",{className:"mapp-expand-body"},l.children),t&&i("div",{className:"mapp-expand-footer"},t))}function z(e){const[t,a]=c({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null});function o(e){a((t=>({...t,...e})))}const s=r((e=>{if(null!=e){let a=wp.codeEditor.initialize(e);a.codemirror.setSize("auto","auto"),a.codemirror.setOption("readOnly","editor"!=t.tab),o({codeEditor:a})}}),[]);function l(e,a){switch(e){case"close":o({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&(mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_delete",name:t.template.name,nonce:mappl10n.options.nonce}}),o({isOpen:!1}));break;case"insert":let e=t.codeEditor.codemirror.getDoc(),i=e.getCursor();e.replaceRange("{{{poi."+a+"}}}",i);break;case"open":mapp.lib.ajax({type:"GET",data:{action:"mapp_tpl_get",name:a,nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status&&o({isOpen:!0,name:a,tab:"editor",template:e.data.template,tokens:e.data.tokens})}});break;case"save":let n="editor"==t.tab?t.codeEditor.codemirror.getValue():t.template.content;mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_save",content:n,name:t.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&o({isOpen:!1,template:null,tokens:null})}});break;case"tab-select":if("editor"!=a){let e={...t.template};e.content=t.codeEditor.codemirror.getValue(),o({template:e})}o({tab:a})}}function p(){const e=t.template.name+" ("+(t.template.exists?__("Custom"):__("New"))+")";return i("div",{className:"mapp-templates-name"},e)}return i("div",{className:"mapp-templates"},function(){const e=[{name:"map-popup",label:__("Map popup")},{name:"map-item",label:__("Map list item")},{name:"mashup-popup",label:__("Mashup popup")},{name:"mashup-item",label:__("Mashup list item")}];return i("div",{className:"mapp-templates-list"},_.map(e,((e,t)=>i("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:t=>{t.preventDefault(),l("open",e.name)}},e.label))))}(),t.isOpen&&t.template?i(h,{title:p(),className:"mapp-templates-modal",onRequestClose:()=>l("close"),shouldCloseOnClickOutside:!1},i(g,{className:"mapp-templates-tabs",onSelect:e=>l("tab-select",e),tabs:[{name:"editor",title:__("Editor")},{name:"standard",title:__("Default")}]},(e=>function(){const e=i("div",{className:"mapp-templates-tokens"},_.map(t.tokens,((e,t)=>i("code",{onClick:()=>l("insert",e.token),key:t,title:e.label},e.label)))),a=i("div",{className:"mapp-templates-path"},t.template.path);return i(n,null,"editor"==t.tab&&a,"editor"==t.tab&&e,i("div",{className:"editor"==t.tab?"mapp-templates-editor":"mapp-templates-standard"},i("textarea",{ref:s,defaultValue:"editor"==t.tab?t.template.content:t.template.standard})))}())),i("div",{className:"mapp-templates-toolbar"},i(m,{isPrimary:!0,onClick:()=>l("save")},__("Save")),i(m,{isSecondary:!0,onClick:()=>l("close")},__("Cancel")),t.template.exists&&i("a",{onClick:e=>{e.preventDefault(),l("delete")}},__("Delete")))):null)}},149:(e,t,a)=>{"use strict";a.d(t,{S:()=>b});const o=wp.element.createElement,{select:i}=wp.data,{Fragment:n,useEffect:s,useLayoutEffect:l,useRef:r,useState:p}=wp.element,{BaseControl:c,Button:d,Dashicon:m,Modal:u,PanelBody:_,RadioControl:h,Spinner:g,TextControl:f}=wp.components,{sprintf}=wp.i18n;function b(e){function t(t,a){const o=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(o);break;case"next":e.onChange(e.page+1);break;case"prev":e.onChange(e.page-1)}}return function(){const a=Math.ceil(e.count/e.pageSize),i=e.page<=1,n=e.page>=a;return o("div",{className:"mapp-paginate"},o(d,{disabled:i,onClick:()=>t("first"),isSecondary:!0},"«"),o(d,{disabled:i,onClick:()=>t("prev"),isSecondary:!0},"‹"),o("div",{className:"mapp-paginate-count"},sprintf((s="%d of %d",wp.i18n.__(s,"mappress-google-maps-for-wordpress")),e.page,a)),o(d,{disabled:n,onClick:()=>t("next"),isSecondary:!0},"›"),o(d,{disabled:n,onClick:()=>t("last"),isSecondary:!0},"»"));var s}()}},477:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>C});var o=a(713),i=a(999),n=a(149),s=a(677);window.mapp=window.mapp||{};const l=wp.element.createElement,{select:r}=wp.data,{Fragment:p,useEffect:c,useLayoutEffect:d,useRef:m,useState:u}=wp.element,{BaseControl:h,Button:g,Dashicon:f,Icon:b,Modal:y,PanelBody:v,Spinner:k,TextControl:w}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function C(e){const[t,a]=u({counts:{all:null,trashed:null,post:null},filter:"all",isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:""}),{addSnackbar:p,renderSnackbar:d}=(0,s.D)(),h=m(null),v=m(null),C=m(null);function x(e){a((t=>({...t,...e})))}function S(a,o){switch(a){case"attach":mapp.store.mutateMap(o.mapid,o.mapdata);break;case"add-new":x({mode:"edit",mapid:null});break;case"close":e.onAction("pick-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(mapp.store.destroyMap(o),p(__("Map deleted"))),v.current&&v.current.focus();break;case"detach":mapp.store.mutateMap(o,{postid:0});break;case"duplicate":mapp.store.duplicateMap({mapid:o,success:e=>{p(__("Map copied")),x({mapid:e.mapid}),h.current&&(h.current.scrollTop=0)}});break;case"edit":if("trash"==t.filter)return;x({mode:"edit",mapid:o});break;case"edit-close":"edit"==e.mode?e.onAction("pick-close"):x({mode:"list"});break;case"edit-save":"edit"==e.mode?e.onAction("pick-close",o):(x({mode:"list",mapid:o}),p(sprintf(__("Map %d saved"),o)));break;case"filter":x({filter:o});break;case"insert":e.onAction("pick-insert",o);break;case"page":x({page:o}),h.current&&(h.current.scrollTop=0);break;case"restore":mapp.store.mutateMap(o,{status:"",postid:0}),p(__("Map restored"));break;case"shortcode":let a=jQuery("<input>");jQuery("body").append(a),a.val('[mappress mapid="'+o+'"]').select(),document.execCommand("copy"),a.remove(),p(__("Shortcode copied"));break;case"sort":mapp.store.setSort({sortBy:o,sortAsc:mapp.store.state.sortBy!=o||!mapp.store.state.sortAsc});break;case"trash":case"edit-trash":mapp.store.mutateMap(o,{status:"trashed"}),p(__("Map moved to trash")),t.mapid&&o==t.mapid&&e.onAction("pick-trash",o)}}function N(a){let i,n=a.mapid==t.mapid;i=a.map_title?a.map_title:__("Untitled");let s,p=function(t){let a;return a="map"==e.context||"mashup"==e.context&&t.postid==mappl10n.options.postid?r("core/editor").getEditedPostAttribute("title"):t.post_title,a=a||__("Untitled"),t.postid>0&&t.postid==mappl10n.options.postid&&(a=__("Current post")),t.postid>0?t.postid==mappl10n.options.postid?a:l("a",{href:mappl10n.options.editurl+"?post="+t.postid+"&action=edit",target:"_blank",title:__("Edit post")},a):__("Unattached")}(a);s="trash"==t.filter?[{action:"restore",label:__("Restore")},{action:"destroy",label:__("Delete Permanently"),isDestructive:!0}]:[{action:"edit",label:__("Edit")},{action:"insert",label:__("Insert into post"),hide:"library"==e.context},{action:"duplicate",label:__("Copy")},{action:"trash",label:__("Trash")}],s=l("div",{className:"mapp-pick-actions"},s.map((e=>!e.hide&&l("a",{className:e.isDestructive?"mapp-destructive":"",href:"#",key:e.action,onClick:t=>{t.stopPropagation(),t.preventDefault(),S(e.action,a.mapid)}},e.label))));let c=null;return c=a.postid>0?l("a",{href:"#",onClick:()=>S("detach",a.mapid)},__("Detach")):"library"==e.context?l(o.default,{onChange:(e,t)=>S("attach",{mapid:a.mapid,mapdata:{postid:e,post_title:t}})},__("Attach")):l("a",{href:"#",onClick:()=>S("attach",{mapid:a.mapid,mapdata:{postid:mappl10n.options.postid,post_title:null}})},__("Attach")),l("div",{className:"mapp-pick-item"+(n?" mapp-selected":""),key:a.mapid+"|"+a.postid,ref:n?C:null},l("div",{className:"mapp-pick-col-mapid",onClick:e=>S("edit",a.mapid)},a.mapid),l("div",{className:"mapp-pick-col-map_title",onClick:e=>S("edit",a.mapid)},l("div",null,i),l("div",null,s)),l("div",{className:"mapp-pick-col-post_title"},p,l("div",null,c)),"library"==e.context&&l("div",{className:"mapp-pick-col-shortcode"},l(g,{isSmall:!0,isSecondary:!0,onClick:e=>{e.stopPropagation(),e.preventDefault(),S("shortcode",a.mapid)}},__("Copy"))))}c((()=>{const e=e=>{if(!e.isFetchingItems){let t={all:0,post:0,trash:0};_.map(e.items,(e=>{"trashed"==e.status?t.trash++:(t.all++,e.postid==mappl10n.options.postid&&t.post++)})),x({counts:t})}x({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),()=>mapp.store.unsubscribe(e)})),c((()=>{mapp.store.fetchItems()}),[]),c((()=>{x({page:1})}),[t.filter,t.search]),c((()=>{"list"==t.mode&&v.current&&v.current.focus()}),[t.mode]);const O=_.filter(t.items,(function(a){if("trash"==t.filter)return"trashed"==a.status;if("trashed"==a.status)return!1;if("post"==t.filter&&a.postid!=mappl10n.options.postid)return!1;if("current"==t.filter&&a.mapid!=e.mapid)return!1;var o=t.search.toLowerCase();return!o||(a.mapid.indexOf(o)>=0||(!!(a.post_title&&a.post_title.toLowerCase().indexOf(o)>=0)||!!(a.map_title&&a.map_title.toLowerCase().indexOf(o)>=0)))}));let M=l("div",{className:"mapp-list-panel"},l("div",{className:"mapp-gt-modal-header"},l("div",{className:"mapp-gt-modal-header-title"},l("h1",null,__("Maps")),l(g,{isPrimary:!0,onClick:()=>S("add-new")},__("Add New"))),l(g,{onClick:()=>S("close"),icon:"no-alt"})),function(){let a=[{label:__("All"),value:"all"},{label:__("Attached to post"),value:"post",hide:"library"==e.context},{label:__("Selected"),value:"current",hide:"library"==e.context||!e.mapid},{label:__("Trash"),value:"trash"}];return l("div",{className:"mapp-pick-filter-wrapper"},l("div",{className:"mapp-pick-filter-tabs"},_.map(a,((e,a)=>{const o="mapp-pick-filter-tab"+(t.filter==e.value?" mapp-active":""),i="current"!=e.value?t.counts[e.value]:null;if(!e.hide)return l("div",{className:o,href:"#",key:a,onClick:()=>S("filter",e.value)},e.label,null!=i&&l("span",{className:"mapp-pick-filter-count"},i))}))),function(){if("trash"!=t.filter)return l("div",{className:"mapp-pick-search-wrapper"},l(w,{ref:v,className:"mapp-pick-search",tabIndex:1,placeholder:__("post title, map title, or map id"),onChange:e=>x({search:e}),size:50,value:t.search}),l(b,{icon:"search"}),(t.isFetchingItems||t.isAttaching&&"library"!=e.context)&&l(k,null))}())}(),function(a){if(a){const e=20*(t.page-1),o=e+20;a=a.slice(e,o)}let o="";return o=t.isFetchingItems?null:a.length?_.map(a,N):l("div",{className:"mapp-pick-message"},__("No maps found")),l("div",{className:"mapp-pick-items-section"},l("div",{className:"mapp-pick-items",ref:h},function(){let t=[{id:"mapid",label:__("ID"),sortable:!0},{id:"map_title",label:__("Map title"),sortable:!0},{id:"post_title",label:__("Attached to"),sortable:!0}];"library"==e.context&&t.push({id:"shortcode",label:__("Shortcode"),sortable:!1});return l("div",{className:"mapp-pick-items-header"},_.map(t,(e=>l("div",{className:"mapp-pick-col-"+e.id,onClick:()=>S("sort",e.id),key:e.id},e.label,e.sortable&&mapp.store.state.sortBy==e.id&&l(f,{icon:mapp.store.state.sortAsc?"arrow-up":"arrow-down"}),e.sortable&&mapp.store.state.sortBy!=e.id&&l(f,{icon:"leftright"})))))}(),o))}(O),function(e){return l("div",{className:"mapp-pick-toolbar"},function(e){return e&&e.length?l(n.S,{count:e?e.length:0,onChange:e=>S("page",e),page:t.page,pageSize:20}):null}(e))}(O)),P=null;if("edit"==t.mode){let a=l("div",{className:"mapp-edit-panel"},l(i.default,{context:e.context,mapid:t.mapid,onAction:S}));P="library"==e.context?l(y,{className:"mapp-gt-modal",isDismissible:!1},a):a}const I="mapp-pick mapp-mode-"+t.mode+" mapp-context-"+e.context;return"library"==e.context?l("div",{className:I},M,P,d()):l(y,{className:"mapp-gt-modal "+I,isDismissible:"list"==t.mode,onRequestClose:()=>S("close"),shouldCloseOnEsc:"list"==t.mode,shouldCloseOnClickOutside:"list"==t.mode},M,P,d())}window.addEventListener("DOMContentLoaded",(e=>{document.getElementById("mapp-library")&&(mappl10n.options.postid=0,wp.element.render(l(C,{context:"library"}),document.getElementById("mapp-library")))}))},429:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappSettings:()=>y});var o=a(710),i=a(677),n=a(824);window.mapp=window.mapp||{};const s=wp.element.createElement,{Fragment:l,useEffect:r,useLayoutEffect:p,useRef:c,useState:d}=wp.element,{BaseControl:m,Button:u,ButtonGroup:_,Dashicon:h,Dropdown:g,Panel:f,PanelBody:b}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function y(e){const[t,a]=d({});const{addSnackbar:r,renderSnackbar:p}=(0,i.D)();function c(e){if(!e||"string"!=typeof e)return e;const t={px:2048,vw:100,vh:100,"%":100};let a=parseInt(e),o=2048,i="";for(var n in t)e.includes(n)&&(i=n,o=t[n]);return a>o?o+i:e}function m(t,a){let o=null;switch(t){case"poiList":e.map.set({poiList:a}),o={poiList:a};break;case"search":e.map.set({search:a}),o={search:a};break;case"size":a.hasOwnProperty("height")&&(a.height=c(a.height)),a.hasOwnProperty("width")&&(a.width=c(a.width)),e.map.setSize(a),o=a;break;case"style-set-maptypeid":e.map&&e.map.set({mapTypeId:a}),o={mapTypeId:a};break;case"viewport-reset":e.map.center=e.map.zoom=null,e.map.recenter(),o={center:void 0,zoom:void 0},r(__("Viewport automatic"));break;case"viewport-set":let t=e.map.getCenter().toJSON();e.map.center=t,e.map.zoom=e.map.getZoom(),o={center:t.lat+","+t.lng,zoom:e.map.getZoom()},r(__("Viewport set"))}o&&e.onAction("change-settings",o)}const h="mce"!=e.context&&"library"!=e.context;return s("div",{className:"mapp-settings"},s(b,{title:__("Map settings"),initialOpen:h},"map"==e.context&&function(){const t=e.map.title?e.map.title:__("Untitled");return s("div",{className:"mapp-settings-row mapp-settings-title"},s(n.Control,{labelTop:__("Title")},t),s(n.Control,{labelTop:__("Map ID")},e.map.mapid))}(),function(){if("mashup"==e.context)return s("div",{className:"mapp-settings-row mapp-style-toggle"},s("div",null,__("Style")),s(o.m,{map:e.map,selected:e.map.mapTypeId,onChange:e=>m("style-set-maptypeid",e)}))}(),function(){mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0];var t=mappl10n.options.sizes.map(((e,t)=>({label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1})));t.unshift({height:"",label:__("Default"),value:0,width:""}),t.push({label:__("Custom"),value:"custom",disabled:!0});for(var a="custom",o=0;o<t.length-1;o++)t[o].width==e.width&&t[o].height==e.height&&(a=o);return s(l,null,s("div",{className:"mapp-settings-row"},s(n.Select,{className:"mapp-settings-dims-select",help:"",labelTop:__("Size"),value:a,options:t,onChange:e=>m("size",{width:t[e].width,height:t[e].height})})),s("div",{className:"mapp-settings-row"},s(n.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vw")},labelTop:__("Width"),onChange:e=>m("size",{width:e}),value:e.width?e.width:""}),s(n.Input,{className:"mapp-settings-dims-custom",help:{text:__("px, %, vh")},labelTop:__("Height"),onChange:e=>m("size",{height:e}),value:e.height?e.height:""})))}(),s("div",{className:"mapp-settings-row"},s(n.Control,{className:"mapp-settings-viewport",labelTop:__("Center/Zoom")},s(_,{label:__("Center/Zoom")},s(u,{onClick:()=>m("viewport-reset"),isPressed:!e.center,isSmall:!0},__("Automatic")),s(u,{onClick:()=>m("viewport-set"),isPressed:e.center,isSmall:!0},__("Set"))))),void 0,p()))}},677:(e,t,a)=>{"use strict";a.d(t,{D:()=>l});const{useEffect:o,useState:i}=wp.element,{createContext:n}=React,s=wp.element.createElement,l=()=>{const[e,t]=i({snackbars:[]});function a(e){t((t=>({...t,...e})))}o((()=>{if(e.snackbars.length){const t=setTimeout((()=>{let t=[...e.snackbars];t.shift(),a({snackbars:t})}),5e3);return()=>clearTimeout(t)}}),[e.snackbars]);return{addSnackbar:t=>a({snackbars:[...e.snackbars,t]}),renderSnackbar:()=>s("div",{className:"mapp-snackbars"},e.snackbars.map(((e,t)=>s("div",{className:"mapp-snackbar mapp-snackbar-show",key:t},e))))}}},787:()=>{window.mapp=window.mapp||{};mapp.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"mapid",sortAsc:!1,maps:{},items:[]}},mapp.Store.prototype={createMap:function(){let{success:e=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isFetchingMap=!1,this.publish(),e()},destroyMap:function(e){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:e,nonce:mappl10n.options.nonce},callback:t=>{t&&"OK"==t.status&&(delete this.state.maps[e],this.destroyItem(e)),this.publish()}})},duplicateMap:function(){let{mapid:e,success:t=(()=>{}),failure:a=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isSavingMap=!0,this.publish(),mapp.lib.ajax({type:"POST",data:{action:"mapp_duplicate",mapid:e,postid:mappl10n.options.postid,nonce:mappl10n.options.nonce},callback:e=>{if(e&&"OK"==e.status){let a=e.data,o=a.mapid;this.state.maps[o]=a,this.saveItem(o,a),t(a)}else a();this.state.isSavingMap=!1,this.publish()}})},fetchMap:function(e){let{mapid:t,success:a=(()=>{}),failure:o=(()=>{})}=e;if(void 0!==this.state.maps[t])return this.publish(),void a(this.state.maps[t]);this.state.isFetchingMap=!0,this.publish(),mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:e=>{e&&"OK"==e.status?(this.state.maps[t]=e.data,a(e.data)):this.state.maps[t]=null,this.state.isFetchingMap=!1,this.publish()}})},mutateMap:function(e,t){this.state.isSavingMap=!0,this.saveItem(e,t),this.publish(),mapp.lib.ajax({type:"POST",data:{action:"mapp_mutate",mapid:e,mapdata:t,nonce:mappl10n.options.nonce},callback:e=>{this.state.isSavingMap=!1,this.publish()}})},saveMap:function(){let{mapdata:e,success:t=(()=>{}),failure:a=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.isSavingMap=!0,this.publish(),mapp.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(e),nonce:mappl10n.options.nonce},callback:o=>{if(o&&"OK"==o.status){const a=o.data;e.mapid=a,this.state.maps[a]=e,this.saveItem(a,e),t(e)}else a();this.state.isSavingMap=!1,this.publish()}})},destroyItem:function(e){let t=this.state.items?this.state.items:[],a=_.findIndex(t,{mapid:e});a>-1&&t.splice(a,1),this.state.items=[...t],this.publish()},fetchItems(){let{success:e=(()=>{}),failure:t=(()=>{})}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.state.itemsFetched)return e(this.state.items),void this.publish();this.state.isFetchingItems=!0,this.publish(),mapp.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:a=>{a&&"OK"==a.status?(this.state.items=a.data,this.sort(),e(this.state.items),this.state.itemsFetched=!0):t(),this.state.isFetchingItems=!1,this.sort(),this.publish()}})},saveItem:function(e,t){let a=this.state.items?this.state.items:[],o=_.findWhere(a,{mapid:e});o?(_.map(["mapid","title","postid","post_title","status"],(e=>{void 0!==t[e]&&(o[e]=t[e])})),o={...o}):(o={mapid:e,map_title:t.title,postid:mappl10n.options.postid,post_title:null},a.unshift(o))},setSort:function(e){e.sortBy&&(this.state.sortBy=e.sortBy),void 0!==e.sortAsc&&(this.state.sortAsc=e.sortAsc),this.sort(),this.publish()},sort:function(e,t){const a=(o="untitled",wp.i18n.__(o,"mappress-google-maps-for-wordpress"));var o;this.state.items.sort(((e,t)=>function(e,t,o,i){if(i=i?1:-1,"mapid"==o)return i*(Number(e.mapid)-Number(t.mapid));let n=e[o]?e[o]:a,s=t[o]?t[o]:a,l=i*n.localeCompare(s);return 0==l?Number(e.mapid)-Number(t.mapid):l}(e,t,this.state.sortBy,this.state.sortAsc)))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){let e=[...this.subs];for(let t of e)t(this.state)}},mapp.store=new mapp.Store},710:(e,t,a)=>{"use strict";a.d(t,{m:()=>k});var o=a(824),i=a(149);const n=wp.element.createElement,{Fragment:s,useEffect:l,useLayoutEffect:r,useRef:p,useState:c}=wp.element,{Button:d,Dashicon:m,ExternalLink:u,Icon:h,Modal:g,Panel:f,PanelBody:b,PanelRow:y,Spinner:v}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function k(e){const[t,a]=c({apiKey:"6a0cfe9e-3670-4598-a63e-f1627b5c9e56",isOpen:!1,isBusy:!1,isSearching:!1,mapboxError:"",mapboxId:"",mapboxName:"",mapboxUser:"",mapboxUrl:"",mapboxParsedUrl:"",mode:"pick",page:1,snazzyPagination:null,snazzySearch:"",snazzySelected:null,snazzyStyles:null,standardStyles:mappl10n.options.standardStyles,userStyles:mappl10n.options.userStyles});function l(e){a((t=>({...t,...e})))}function r(a){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=_.findIndex(t.userStyles,{id:a.id});i>=0&&!o&&!confirm(__("Style already exists, overwrite?"))||(l({isBusy:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_style_save",style:a,nonce:mappl10n.options.nonce},callback:t=>{l({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,l({mode:"pick",userStyles:t.data}),e.onChange(a.id))}}))}function p(e){l({isSearching:!0,snazzyStyles:null}),mapp.lib.ajax({type:"GET",data:{sort:"popular",page:e,pageSize:20,text:t.snazzySearch,key:t.apiKey},url:"https://snazzymaps.com/explore.json",callback:function(e){if(l({isSearching:!1,snazzyPagination:e&&e.pagination?e.pagination:null}),e&&e.styles){l({snazzyStyles:_.map(e.styles,((e,t)=>(e.id=e.id+"",e)))})}else alert("Error: unable to fetch styles")}})}function m(e,t){t="large"==t||"small"==t?t:"small",t=800;let a=mappl10n.options.baseurl+"/images/json_style.png";if("leaflet"==mappl10n.options.engine?mappl10n.options.mapbox?e.user&&e.mapboxid&&(a="https://api.mapbox.com/styles/v1/"+e.user+"/"+e.mapboxid+"/static/-122.4194,37.7749,10,0/800x800?access_token="+mappl10n.options.mapbox):a=mappl10n.options.baseurl+"/images/osm.png":e.imageUrl&&(a=e.imageUrl),a)return n("img",{src:a,title:e.name})}function f(a,o){switch(a){case"close":case"pick-cancel":l({isOpen:!1});break;case"json-add":l({mode:"json-add"});break;case"json-cancel":case"mapbox-cancel":case"snazzy-cancel":l({mode:"pick"});break;case"json-edit":e.onChange(o.id),l({mode:"json-edit"});break;case"json-save":r(o,!0);break;case"mapbox-add":case"snazzy-add":alert(__("Please upgrade to MapPress Pro to use custom styles"));break;case"mapbox-change-url":{let e,t,a;e=o.trim().toLowerCase(),e=e.replace(".html","").replace("https://api.mapbox.com/styles/v1/","").replace("mapbox://styles/",""),e=e.split("?")[0];let i=e.split("/");2==i.length&&(t=i[0],a=i[1]),l({mapboxUrl:o,mapboxUser:t,mapboxId:a});break}case"mapbox-edit":e.onChange(o.id),l({mode:"mapbox",mapboxId:o.mapboxid,mapboxName:o.name,mapboxUrl:o.url,mapboxUser:o.user});break;case"mapbox-save":t.mapboxName&&t.mapboxUser&&r({id:t.mapboxId,name:t.mapboxName,mapboxid:t.mapboxId,provider:"mapbox",url:t.mapboxUrl,user:t.mapboxUser});break;case"mode":l({mode:o});break;case"open":"leaflet"!=mappl10n.options.engine||mappl10n.options.mapbox?l({isOpen:!0}):alert(__("Please enter a Mapbox access token in the MapPress settings screen to use styled maps."));break;case"pick-delete":confirm(mappl10n.delete_prompt)&&(i=o,_.findIndex(t.userStyles,{id:i})<0?mapp.lib.alert("Invalid delete"):(l({isBusy:!0}),mapp.lib.ajax({type:"POST",data:{action:"mapp_style_delete",id:i,nonce:mappl10n.options.nonce},callback:t=>{l({isBusy:!1}),t&&"OK"==t.status&&(mappl10n.options.userStyles=t.data,l({userStyles:t.data}),e.selected==i&&e.onChange(null))}})));break;case"pick-select":e.onChange(o),l({isOpen:!1});break;case"snazzy-save":{let e=_.findWhere(t.snazzyStyles,{id:o});e&&r({id:o,imageUrl:e.imageUrl,json:e.json,name:e.name});break}case"snazzy-search":p()}var i}function b(){let a;return"json-add"==t.mode?a={id:null,name:"",json:""}:"json-edit"==t.mode&&(a=e.selected?_.findWhere(t.userStyles,{id:e.selected}):null),n(w,{style:a,onSave:e=>f("json-save",e),onCancel:()=>f("json-cancel")})}function y(e){let a;return a=e.styles&&e.styles.length?_.map(e.styles,((t,a)=>function(e,t){let a,o="mapp-style"+(t.selected==e.id?" mapp-selected":"");(t.onEdit||t.onDelete)&&(a=n("div",{className:"mapp-style-actions"},n("a",{onClick:()=>t.onEdit(e)},__("Edit")),n(h,{icon:"trash",onClick:()=>t.onDelete(e.id)})));return n("div",{className:o,key:e.id},n("div",{className:"mapp-style-image",onClick:()=>t.onSelect(e.id)},m(e)),n("div",{className:"mapp-style-details"},n("div",{className:"mapp-style-title"},e.name),a))}(t,e))):t.isSearching?"":n("div",{className:"mapp-style-list-msg"},__("No results")),n("div",{className:"mapp-style-list-wrapper"},n("div",{className:"mapp-style-list-header"},e.title),n("div",{className:"mapp-style-list"},a))}return n(s,null,function(){const a=t.standardStyles.concat(t.userStyles);let o=!mappl10n.options.style||"roadmap"!=e.selected&&"streets"!=e.selected&&e.selected?e.selected:mappl10n.options.style,i=_.findWhere(a,{id:o});return i=i||t.standardStyles[0],n(d,{className:"mapp-style-toggle",icon:m(i),iconSize:75,isSecondary:!0,onClick:()=>f("open",null),title:i.name})}(),"edit"==t.mode&&t.isOpen&&renderEdit(),"json-add"==t.mode&&t.isOpen&&b(),"json-edit"==t.mode&&t.isOpen&&b(),"mapbox"==t.mode&&t.isOpen&&function(){let e=t.mapboxUser&&t.mapboxId?m({user:t.mapboxUser,mapboxid:t.mapboxId,name:t.mapboxName},"large"):null;const a=!t.mapboxUser||!t.mapboxId||!t.mapboxName;return n(g,{title:__("Add style"),className:"mapp-style-modal",onRequestClose:()=>f("mapbox-cancel"),shouldCloseOnClickOutside:!0},n("div",{className:"mapp-style-mapbox-title"},__("Enter style from Mapbox Studio"),n(u,{href:"https://studio.mapbox.com"})),n("form",{className:"mapp-style-mapbox-form",onSubmit:e=>{e.stopPropagation(),e.preventDefault(),f("mapbox-save")}},n("label",null,n(o.Input,{autoFocus:!0,className:"mapp-style-mapbox-url",labelTop:n(s,null,__("MapBox Share URL"),n(o.Help,{href:"#toc-mapbox-studio-styles"})),onChange:e=>f("mapbox-change-url",e),value:t.mapboxUrl})),n("label",null,n("div",{className:"mapp-style-mapbox-label"},__("Style name")),n(o.Input,{className:"mapp-style-mapbox-name",value:t.mapboxName,onChange:e=>l({mapboxName:e})})),n("div",{className:"mapp-style-mapbox-preview"},e),n("div",{className:"mapp-style-toolbar"},n("div",null,n(d,{isBusy:t.isBusy,isPrimary:!0,disabled:a,type:"submit"},__("Save")),n(d,{isBusy:t.isBusy,onClick:()=>f("mapbox-cancel")},__("Cancel"))))))}(),"pick"==t.mode&&t.isOpen&&function(){let a="";return t.userStyles&&t.userStyles.length&&(a=y({selected:e.selected,onEdit:e=>"leaflet"==mappl10n.options.engine?f("mapbox-edit"):f("json-edit",e),onDelete:e=>f("pick-delete",e),onSelect:e=>f("pick-select",e),styles:t.userStyles,title:__("Custom styles")})),n(g,{title:n("div",{className:"mapp-style-header"},__("Select a style")),className:"mapp-style-modal",onRequestClose:()=>f("close")},n("div",{className:"mapp-style-list-wrapper"},y({onSelect:e=>f("pick-select",e),selected:e.selected,styles:t.standardStyles,title:__("Standard styles")}),a),n("div",{className:"mapp-style-toolbar"},n("div",null,n(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>"leaflet"==mappl10n.options.engine?f("mapbox-add"):f("json-add")},__("New style")),"google"==mappl10n.options.engine&&n(d,{isBusy:t.isBusy,isSecondary:!0,onClick:()=>f("snazzy-add")},__("Download style")),n(d,{isBusy:t.isBusy,onClick:()=>f("pick-cancel")},__("Cancel")))))}(),"snazzy"==t.mode&&t.isOpen&&(t.snazzySelected,n(g,{title:__("Download style"),className:"mapp-style-modal mapp-style-modal-snazzy",onRequestClose:()=>f("snazzy-cancel"),shouldCloseOnClickOutside:!0},n("form",{className:"mapp-style-snazzy-form",onSubmit:e=>{f("snazzy-search"),e.preventDefault()}},n(o.Input,{className:"mapp-style-snazzy-search",value:t.search,placeholder:__("Search"),onChange:e=>l({snazzySearch:e})}),t.isSearching&&n(v,null),!t.isSearching&&n(d,{isPrimary:!0,icon:"search",onClick:()=>f("snazzy-search")})),y({selected:t.snazzySelected,styles:t.snazzyStyles,onSelect:e=>l({snazzySelected:e})}),n("div",{className:"mapp-style-toolbar"},n("div",null,n(d,{isBusy:t.isBusy,isPrimary:!0,onClick:()=>f("snazzy-save",t.snazzySelected)},__("Save")),n(d,{isBusy:t.isBusy,onClick:()=>f("snazzy-cancel")},__("Cancel"))),function(){const e=t.snazzyPagination;return e&&t.snazzyStyles&&t.snazzyStyles.length?n(i.S,{count:e.totalItems,onChange:e=>p(e),page:e.currentPage,pageSize:e.pageSize}):null}()))))}function w(e){const[t,a]=c((()=>{let t={...e.style},a="";try{a=JSON.stringify(JSON.parse(t.json),null,2)}catch(e){}return t.json=a,{style:t}}));function i(e){a((t=>({...t,...e})))}function s(a,o){let n={...t.style};switch(a){case"cancel":e.onCancel();break;case"change-json":n.json=o,i({style:n});break;case"change-name":n.name=o,i({style:n});break;case"save":n.json=n.json?JSON.stringify(JSON.parse(n.json)):"",e.onSave(n)}}let l;if(t.style.json)try{JSON.parse(t.style.json)}catch(e){l=e.toString()}let r=l?"mapp-json mapp-json-error":"mapp-json";return n(g,{title:n(o.Input,{value:t.style.name,onChange:e=>s("change-name",e),placeholder:__("Enter style name")}),className:"mapp-style-modal mapp-json-modal",onRequestClose:()=>s("cancel"),shouldCloseOnClickOutside:!0},n("div",null,__("JSON")),n("div",{className:r},n("textarea",{value:t.style.json,spellCheck:!1,onChange:e=>s("change-json",e.target.value)})),n("div",{className:"mapp-json-error"},l||""),n("div",{className:"mapp-json-toolbar"},n("div",null,n(d,{disabled:l,isBusy:t.isBusy,isPrimary:!0,onClick:()=>s("save")},__("Save")),n(d,{isBusy:t.isBusy,onClick:()=>s("cancel")},__("Cancel")))))}},214:(e,t,a)=>{"use strict";a.r(t),a.d(t,{MappCard:()=>g});a(824);const o=wp.element.createElement,{Fragment:i,useEffect:n,useLayoutEffect:s,useCallback:l,useRef:r,useState:p}=wp.element,{useSelect:c}=wp.data,{Button:d,Dashicon:m,ExternalLink:u,Guide:_,Modal:h}=wp.components,__=e=>wp.i18n.__(e,"mappress-google-maps-for-wordpress");function g(e){let{icon:t,title:a,...i}=e;return o("div",{className:"mapp-support-card"},a&&o("div",{className:"mapp-support-card-title"},o("h3",null,t&&o(m,{icon:t}),a)),o("div",{className:"mapp-support-card-content"},i.children))}document.getElementById("mapp-support-page")&&wp.element.render(o((function(e){const[t,a]=p({engine:e.engine?e.engine:"leaflet",isOpen:e.isOpen,apiKey:e.apiKey,mapbox:e.mapbox});function s(e){a((t=>({...t,...e})))}function l(e){return o("div",{className:"mapp-guide-engine"+(e.selected?" mapp-selected":""),onClick:()=>e.onClick()},o("h2",{className:"mapp-guide-engine-title"},e.title),o("div",{className:"mapp-guide-engine-content"},e.content))}return r(null),n((()=>{}),[]),o("div",{className:"mapp-support"},o(i,null,o("div",{className:"mapp-support-section"},o("div",{className:"mapp-support-header"},o("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),o("h1",null,__("MapPress Support")),o("i",null,__("Build amazing maps with the easiest and most powerful mapping plugin available")),o("div",null,o(d,{className:"mapp-support-guide-toggle",isPrimary:!0,onClick:()=>s({isOpen:!0})},__("Open Setup Wizard"))))),o("div",{className:"mapp-support-section"},o("div",{className:"mapp-support-cards"},o(g,{icon:"book",title:__("Documentation")},o("p",null,__("Detailed plugin documentation:")),o(u,{href:"https://mappresspro.com/mappress-documentation/"},__("Documentation")),o(u,{href:"https://mappresspro.com/whats-new/"},__("What's new")),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Creating your first map"))),o(g,{icon:"warning",title:__("Troubleshooting")},o("p",null,o("b",null,__("Check for a plugin or theme conflict:"))),o("ol",null,o("li",null,__("Deactivate ALL other plugins")),o("li",null,__("Switch to a standard WordPress theme")),o("li",null,__("If the maps are working, reactivate one by one to find the conflict."))),o("p",null,__("For more info:")),o(u,{href:"https://mappresspro.com/mappress-faq/"},__("MapPress FAQ"))),o(g,{icon:"megaphone",title:__("Support")},o("p",null,__("Need some help?")),o(u,{href:"https://mappresspro.com/forums/forum/mappress-support/"},__("Support forum")),o(u,{href:"https://mappresspro.com/chris-contact/"},__("Contact")))))),function(){if(t.isOpen)return o(_,{className:"mapp-guide",onFinish:()=>function(e,a){if("save"===e){let e;s({isOpen:!1}),e="google"==t.engine?"google":t.mapbox?"mapbox":"nominatim",mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",nonce:mappl10n.options.nonce,settings:{engine:t.engine,apiKey:t.apiKey,mapbox:t.mapbox,geocoder:e}},callback:e=>{"OK"!=e.status&&alert("Unable to save settings. Please check the support troubleshooting guide.")}})}}("save"),pages:[{content:o("div",{className:"mapp-guide-page mapp-guide-engines"},o("h1",null,__("Please Choose a Mapping API")),o("p",null,__("MapPress supports both Leaflet and Google mapping APIs."),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-picking-a-mapping-api"},__("Learn more"))),o("div",{className:"mapp-guide-engines"},l({onClick:()=>s({engine:"leaflet"}),selected:"leaflet"==t.engine,title:"Leaflet",content:o("ul",null,o("li",null,__("No API key")),o("li",null,__("Free unlimited usage")),o("li",null,__("Good functionality")),o("li",null,__("Best for high traffic sites")))}),l({onClick:()=>s({engine:"google"}),selected:"google"==t.engine,title:"Google",content:o("ul",null,o("li",null,__("API key required")),o("li",null,__("Limited free usage")),o("li",null,__("Excellent functionality")),o("li",null,__("Best for low traffic sites")))}))),image:o("div",{className:"mapp-guide-header mapp-guide-image-small"},o("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),o("h1",null,__("Welcome to MapPress!")))},{content:"google"==t.engine?o("div",{className:"mapp-guide-page mapp-guide-apikey"},o("h1",null,__("Google API Key")),o("p",null,__("Google requires an API key to use Google Maps. Please enter your key below.")),o(d,{isPrimary:!0,href:"https://mappresspro.com/how-to-get-a-google-maps-api-key/",target:"_blank"},__("Get an API Key")),o("input",{className:"mapp-guide-apikey",onChange:e=>s({apiKey:e.target.value}),placeholder:__("Enter your API key here"),value:t.apiKey})):o("div",{className:"mapp-guide-page mapp-guide-apikey"},o("h1",null,__("Sign up with Mapbox")),o("p",null,__("Mapbox makes Leaflet better with great-looking map tiles, styled maps, and a powerful geocoder.")," "+__("A generous free tier means it's free for most sites."),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-using-mapbox-with-leaflet"},__("Learn more"))),o(d,{isPrimary:!0,href:"https://account.mapbox.com/auth/signup/",target:"_blank"},__("Get Mapbox Access Token")),o("input",{className:"mapp-guide-apikey",onChange:e=>s({mapbox:e.target.value}),placeholder:__("Enter your access token here"),value:t.mapbox})),image:o("div",{className:"mapp-guide-header mapp-guide-image-small"},"google"==t.engine&&o("img",{src:mappl10n.options.baseurl+"/images/google_logo.png"}),"leaflet"==t.engine&&o("img",{src:mappl10n.options.baseurl+"/images/mapbox_logo_white.png"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-gutenberg"},o("h1",null,__("Maps in the Block Editor")),o("p",null,__("MapPress provides custom block types for the Gutenberg editor.")),o("p",null,__("Just insert a MapPress Map block to get started."),o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-gutenberg-block-editor"},__("Learn more")))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/gutenberg_map_block.gif"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-classic"},o("h1",null,__("Maps in the Classic Editor")),o("p",null,__('MapPress also supports the "classic" editor. Just click the MapPress button to open the map library.')),o("p",null,o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-classic-editor"},__("Learn more")))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/classic_map.gif"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-library"},o("h1",null,__("Map Library")),o("p",null,__("The Map Library provides an easy way to see and edit all of your maps. The library can be opened in the post editor or from the MapPress menu.")),o("p",null,o(u,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Learn more")))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/library_menu.gif"}))},{content:o("div",{className:"mapp-guide-page mapp-guide-end"},o("h1",null,__("Happy Mapping")),o("p",null,__("Enjoy the plugin! Replay this guide any time from the MapPress support menu."))),image:o("div",{className:"mapp-guide-header"},o("img",{src:mappl10n.options.baseurl+"/images/icon-128x128"}))}]})}())}),mappress_support_state),document.getElementById("mapp-support-page"))},308:(e,t,a)=>{"use strict";e.exports=function(e,t){var o=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),i=o.length,n=void 0,s=void 0,l=void 0,r=void 0,p=void 0,c=void 0,d=void 0,m=void 0,u=void 0,_=void 0,h=void 0,g=void 0,f=void 0,b=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},y="undefined"!=typeof window?window:a.g;y.$locutus=y.$locutus||{};var v=y.$locutus;for(v.php=v.php||{},t||(t=y),n=0;n<i&&(u=b((m=o[n].split("="))[0]),_=m.length<2?"":b(m[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));n++){for(;" "===u.charAt(0);)u=u.slice(1);if(u.indexOf("\0")>-1&&(u=u.slice(0,u.indexOf("\0"))),u&&"["!==u.charAt(0)){for(g=[],h=0,s=0;s<u.length;s++)if("["!==u.charAt(s)||h){if("]"===u.charAt(s)&&h&&(g.length||g.push(u.slice(0,h-1)),g.push(u.substr(h,s-h)),h=0,"["!==u.charAt(s+1)))break}else h=s+1;for(g.length||(g=[u]),s=0;s<g[0].length&&(" "!==(d=g[0].charAt(s))&&"."!==d&&"["!==d||(g[0]=g[0].substr(0,s)+"_"+g[0].substr(s+1)),"["!==d);s++);for(c=t,s=0,f=g.length;s<f;s++){if(p=c,(""===(u=g[s].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==s){for(r in l=-1,c)c.hasOwnProperty(r)&&+r>l&&r.match(/^\d+$/g)&&(l=+r);u=l+1}Object(c[u])!==c[u]&&(c[u]={}),c=c[u]}p[u]=_}}}}},t={};function a(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a(787),a(844),a(215),a(713),a(525),a(371),a(999),a(143),a(816),a(378),a(498),a(670),a(218),a(824),a(477),a(429),a(214)})();
|
css/mappress.css
CHANGED
@@ -298,6 +298,18 @@ only screen and (min-device-pixel-ratio: 2) {
|
|
298 |
padding: 10px;
|
299 |
}
|
300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
.mapp-list .mapp-info {
|
302 |
align-items: center;
|
303 |
display: flex;
|
@@ -309,18 +321,6 @@ only screen and (min-device-pixel-ratio: 2) {
|
|
309 |
padding: 10px;
|
310 |
}
|
311 |
|
312 |
-
.mapp-list .mapp-item.mapp-selected {
|
313 |
-
background-color: #f6f6f6;
|
314 |
-
}
|
315 |
-
|
316 |
-
.mapp-list .mapp-item.mapp-selected .mapp-title {
|
317 |
-
font-weight: 500;
|
318 |
-
}
|
319 |
-
|
320 |
-
.mapp-list .mapp-item:hover {
|
321 |
-
background-color: #f6f6f6;
|
322 |
-
}
|
323 |
-
|
324 |
.mapp-list .mapp-item .mapp-icon {
|
325 |
border: none; /* 2011 */
|
326 |
max-width: 32px !important; /* 2012 tries to override */
|
@@ -419,22 +419,39 @@ only screen and (min-device-pixel-ratio: 2) {
|
|
419 |
Search
|
420 |
-----------------------------------------------------------------------------------
|
421 |
*/
|
422 |
-
.mapp-search {
|
423 |
display: flex;
|
424 |
flex: 1;
|
425 |
-
max-width: 700px;
|
426 |
position: relative;
|
427 |
}
|
428 |
|
429 |
-
|
430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
}
|
432 |
|
433 |
-
.mapp-
|
434 |
background-color: white !important; /* Algolia uses 240,240,240 */
|
|
|
435 |
border: 1px solid #bbb ;
|
436 |
box-shadow: none ;
|
437 |
color: black ;
|
|
|
|
|
438 |
line-height: 100%;
|
439 |
margin: 0 ;
|
440 |
padding: 5px 10px;
|
@@ -442,46 +459,20 @@ only screen and (min-device-pixel-ratio: 2) {
|
|
442 |
width: 100% ;
|
443 |
}
|
444 |
|
445 |
-
.mapp-
|
446 |
-
color: black !important; /* Themes */
|
447 |
-
}
|
448 |
-
|
449 |
-
/* GT editor interferes w/image */
|
450 |
-
.mapp-search .mapp-search-button img {
|
451 |
-
max-width: none;
|
452 |
-
padding: 0;
|
453 |
-
border: none;
|
454 |
-
}
|
455 |
-
|
456 |
-
|
457 |
-
/*
|
458 |
-
-----------------------------------------------------------------------------------
|
459 |
-
Jquery autocomplete (WP doesn't include any styles)
|
460 |
-
-----------------------------------------------------------------------------------
|
461 |
-
*/
|
462 |
-
.ui-helper-hidden-accessible {
|
463 |
-
display: none;
|
464 |
-
}
|
465 |
-
|
466 |
-
.mapp-search .ui-autocomplete {
|
467 |
-
background: none;
|
468 |
background-color: white;
|
469 |
border: 1px solid lightgray;
|
470 |
box-shadow: 0px 1px 2px grey;
|
471 |
-
color: inherit;
|
472 |
cursor: pointer;
|
473 |
-
font: inherit;
|
474 |
-
list-style: none;
|
475 |
-
margin: 0;
|
476 |
-
max-width: 100%;
|
477 |
overflow-x: hidden;
|
478 |
overflow-y: auto;
|
479 |
-
padding: 0;
|
480 |
position: absolute;
|
|
|
|
|
481 |
z-index: 10000;
|
482 |
}
|
483 |
|
484 |
-
.mapp-
|
485 |
background-color: inherit;
|
486 |
border-bottom: 1px solid lightgray;
|
487 |
border-top: none;
|
@@ -492,24 +483,19 @@ only screen and (min-device-pixel-ratio: 2) {
|
|
492 |
cursor: inherit;
|
493 |
font: inherit;
|
494 |
margin: 0;
|
495 |
-
padding:
|
496 |
}
|
497 |
|
498 |
-
.mapp-
|
499 |
-
background-color: #
|
500 |
}
|
501 |
|
502 |
-
.mapp-
|
503 |
text-overflow: ellipsis;
|
504 |
overflow: hidden;
|
505 |
white-space: nowrap;
|
506 |
}
|
507 |
|
508 |
-
.mapp-search .ui-autocomplete li.ui-state-focus {
|
509 |
-
background-image: none;
|
510 |
-
background-color: #f6f6f6;
|
511 |
-
}
|
512 |
-
|
513 |
/*
|
514 |
-----------------------------------------------------------------------------------
|
515 |
Filters
|
298 |
padding: 10px;
|
299 |
}
|
300 |
|
301 |
+
.mapp-list .mapp-item.mapp-selected {
|
302 |
+
background-color: #eaeaea;
|
303 |
+
}
|
304 |
+
|
305 |
+
.mapp-list .mapp-item.mapp-selected .mapp-title {
|
306 |
+
font-weight: bold;
|
307 |
+
}
|
308 |
+
|
309 |
+
.mapp-list .mapp-item:hover {
|
310 |
+
background-color: #eaeaea;
|
311 |
+
}
|
312 |
+
|
313 |
.mapp-list .mapp-info {
|
314 |
align-items: center;
|
315 |
display: flex;
|
321 |
padding: 10px;
|
322 |
}
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
.mapp-list .mapp-item .mapp-icon {
|
325 |
border: none; /* 2011 */
|
326 |
max-width: 32px !important; /* 2012 tries to override */
|
419 |
Search
|
420 |
-----------------------------------------------------------------------------------
|
421 |
*/
|
422 |
+
.mapp-search-container {
|
423 |
display: flex;
|
424 |
flex: 1;
|
|
|
425 |
position: relative;
|
426 |
}
|
427 |
|
428 |
+
/*
|
429 |
+
-----------------------------------------------------------------------------------
|
430 |
+
React autocomplete
|
431 |
+
-----------------------------------------------------------------------------------
|
432 |
+
*/
|
433 |
+
|
434 |
+
.mapp-autocomplete {
|
435 |
+
align-items: center;
|
436 |
+
display: flex;
|
437 |
+
flex: 1;
|
438 |
+
}
|
439 |
+
|
440 |
+
.mapp-autocomplete-wrapper {
|
441 |
+
display: flex;
|
442 |
+
flex: 1;
|
443 |
+
height: 100%;
|
444 |
+
position: relative;
|
445 |
}
|
446 |
|
447 |
+
.mapp-autocomplete input.mapp-places {
|
448 |
background-color: white !important; /* Algolia uses 240,240,240 */
|
449 |
+
border: none;
|
450 |
border: 1px solid #bbb ;
|
451 |
box-shadow: none ;
|
452 |
color: black ;
|
453 |
+
flex: 1;
|
454 |
+
height: 35px;
|
455 |
line-height: 100%;
|
456 |
margin: 0 ;
|
457 |
padding: 5px 10px;
|
459 |
width: 100% ;
|
460 |
}
|
461 |
|
462 |
+
.mapp-autocomplete-list {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
background-color: white;
|
464 |
border: 1px solid lightgray;
|
465 |
box-shadow: 0px 1px 2px grey;
|
|
|
466 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
467 |
overflow-x: hidden;
|
468 |
overflow-y: auto;
|
|
|
469 |
position: absolute;
|
470 |
+
top: 100%;
|
471 |
+
width: 100%;
|
472 |
z-index: 10000;
|
473 |
}
|
474 |
|
475 |
+
.mapp-autocomplete-item {
|
476 |
background-color: inherit;
|
477 |
border-bottom: 1px solid lightgray;
|
478 |
border-top: none;
|
483 |
cursor: inherit;
|
484 |
font: inherit;
|
485 |
margin: 0;
|
486 |
+
padding: 8px;
|
487 |
}
|
488 |
|
489 |
+
.mapp-autocomplete-item:hover, .mapp-autocomplete-item.mapp-selected {
|
490 |
+
background-color: #eaeaea;
|
491 |
}
|
492 |
|
493 |
+
.mapp-autocomplete-item {
|
494 |
text-overflow: ellipsis;
|
495 |
overflow: hidden;
|
496 |
white-space: nowrap;
|
497 |
}
|
498 |
|
|
|
|
|
|
|
|
|
|
|
499 |
/*
|
500 |
-----------------------------------------------------------------------------------
|
501 |
Filters
|
languages/mappress-google-maps-for-wordpress.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: MapPress Maps for WordPress 2.73.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
|
@@ -260,7 +260,7 @@ msgstr ""
|
|
260 |
|
261 |
#: mappress_settings.php:423
|
262 |
#: mappress_settings.php:454
|
263 |
-
#: templates/map.php:
|
264 |
msgid "Get help"
|
265 |
msgstr ""
|
266 |
|
@@ -398,16 +398,6 @@ msgstr ""
|
|
398 |
msgid "Map ID"
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: templates/map-directions.php:5
|
402 |
-
msgid "My location"
|
403 |
-
msgstr ""
|
404 |
-
|
405 |
-
#: templates/map-directions.php:14
|
406 |
-
#: templates/map-popup.php:5
|
407 |
-
#: templates/mashup-popup.php:6
|
408 |
-
msgid "Get Directions"
|
409 |
-
msgstr ""
|
410 |
-
|
411 |
#: templates/map-filters.php:4
|
412 |
msgid "Filter"
|
413 |
msgstr ""
|
@@ -428,47 +418,40 @@ msgstr ""
|
|
428 |
msgid "%d of %d"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: templates/map.php:
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
#: templates/map.php:33
|
436 |
-
msgid "Search"
|
437 |
-
msgstr ""
|
438 |
-
|
439 |
-
#: templates/map.php:33
|
440 |
-
msgid "Enter an address, place, KML file URL, or lat,lng"
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: templates/map.php:
|
444 |
-
msgid "
|
445 |
msgstr ""
|
446 |
|
447 |
-
#: templates/map.php:
|
448 |
msgid "Menu"
|
449 |
msgstr ""
|
450 |
|
451 |
-
#: templates/map.php:
|
452 |
msgid "Center map"
|
453 |
msgstr ""
|
454 |
|
455 |
-
#: templates/map.php:
|
456 |
msgid "Traffic"
|
457 |
msgstr ""
|
458 |
|
459 |
-
#: templates/map.php:
|
460 |
msgid "Bicycling"
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: templates/map.php:
|
464 |
msgid "Transit"
|
465 |
msgstr ""
|
466 |
|
467 |
-
#: templates/map.php:
|
468 |
msgid "List"
|
469 |
msgstr ""
|
470 |
|
471 |
-
#: templates/map.php:
|
472 |
msgid "Map"
|
473 |
msgstr ""
|
474 |
|
2 |
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: MapPress Maps for WordPress 2.73.17\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-03-11T03:26:41+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
|
260 |
|
261 |
#: mappress_settings.php:423
|
262 |
#: mappress_settings.php:454
|
263 |
+
#: templates/map.php:63
|
264 |
msgid "Get help"
|
265 |
msgstr ""
|
266 |
|
398 |
msgid "Map ID"
|
399 |
msgstr ""
|
400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
#: templates/map-filters.php:4
|
402 |
msgid "Filter"
|
403 |
msgstr ""
|
418 |
msgid "%d of %d"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: templates/map-popup.php:5
|
422 |
+
#: templates/mashup-popup.php:6
|
423 |
+
msgid "Get Directions"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
msgstr ""
|
425 |
|
426 |
+
#: templates/map.php:13
|
427 |
+
msgid "Your Location"
|
428 |
msgstr ""
|
429 |
|
430 |
+
#: templates/map.php:54
|
431 |
msgid "Menu"
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: templates/map.php:56
|
435 |
msgid "Center map"
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: templates/map.php:59
|
439 |
msgid "Traffic"
|
440 |
msgstr ""
|
441 |
|
442 |
+
#: templates/map.php:60
|
443 |
msgid "Bicycling"
|
444 |
msgstr ""
|
445 |
|
446 |
+
#: templates/map.php:61
|
447 |
msgid "Transit"
|
448 |
msgstr ""
|
449 |
|
450 |
+
#: templates/map.php:72
|
451 |
msgid "List"
|
452 |
msgstr ""
|
453 |
|
454 |
+
#: templates/map.php:73
|
455 |
msgid "Map"
|
456 |
msgstr ""
|
457 |
|
languages/texts.php
CHANGED
@@ -89,17 +89,13 @@ __("Show POI list");
|
|
89 |
__("Other Settings");
|
90 |
__("Example: initialopeninfo=\"true\"");
|
91 |
__("Map ID");
|
92 |
-
__("My location");
|
93 |
-
__("Get Directions");
|
94 |
__("Filter");
|
95 |
__("Reset");
|
96 |
__("Done");
|
97 |
__("Results");
|
98 |
__("%d of %d");
|
|
|
99 |
__("Your Location");
|
100 |
-
__("Search");
|
101 |
-
__("Enter an address, place, KML file URL, or lat,lng");
|
102 |
-
__("Add to map");
|
103 |
__("Menu");
|
104 |
__("Center map");
|
105 |
__("Traffic");
|
89 |
__("Other Settings");
|
90 |
__("Example: initialopeninfo=\"true\"");
|
91 |
__("Map ID");
|
|
|
|
|
92 |
__("Filter");
|
93 |
__("Reset");
|
94 |
__("Done");
|
95 |
__("Results");
|
96 |
__("%d of %d");
|
97 |
+
__("Get Directions");
|
98 |
__("Your Location");
|
|
|
|
|
|
|
99 |
__("Menu");
|
100 |
__("Center map");
|
101 |
__("Traffic");
|
mappress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Maps for WordPress
|
|
4 |
Plugin URI: https://www.mappresspro.com
|
5 |
Author URI: https://www.mappresspro.com
|
6 |
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
-
Version: 2.73.
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Scott DeJonge for his wonderful icons
|
@@ -36,7 +36,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
|
|
36 |
}
|
37 |
|
38 |
class Mappress {
|
39 |
-
const VERSION = '2.73.
|
40 |
|
41 |
static
|
42 |
$baseurl,
|
@@ -726,7 +726,7 @@ class Mappress {
|
|
726 |
wp_register_script('mappress-leaflet-markercluster', $lib . "/Leaflet.markercluster/leaflet.markercluster.js", null, '1.4.1', $footer);
|
727 |
|
728 |
// Dependencies
|
729 |
-
$deps = array('jquery', '
|
730 |
if (self::$options->engine == 'leaflet')
|
731 |
$deps = array_merge(array('mappress-leaflet', 'mappress-omnivore'), $deps);
|
732 |
if (self::$options->engine != 'leaflet' || self::$options->geocoder == 'google')
|
4 |
Plugin URI: https://www.mappresspro.com
|
5 |
Author URI: https://www.mappresspro.com
|
6 |
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
+
Version: 2.73.17
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Scott DeJonge for his wonderful icons
|
36 |
}
|
37 |
|
38 |
class Mappress {
|
39 |
+
const VERSION = '2.73.17';
|
40 |
|
41 |
static
|
42 |
$baseurl,
|
726 |
wp_register_script('mappress-leaflet-markercluster', $lib . "/Leaflet.markercluster/leaflet.markercluster.js", null, '1.4.1', $footer);
|
727 |
|
728 |
// Dependencies
|
729 |
+
$deps = array('jquery', 'underscore', 'wp-element', 'wp-i18n');
|
730 |
if (self::$options->engine == 'leaflet')
|
731 |
$deps = array_merge(array('mappress-leaflet', 'mappress-omnivore'), $deps);
|
732 |
if (self::$options->engine != 'leaflet' || self::$options->geocoder == 'google')
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: maps, google maps, map, map markers, google map, leaflet maps, leaflet map
|
|
5 |
Requires at least: 5.3
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.9
|
8 |
-
Stable tag: 2.73.
|
9 |
|
10 |
== Description ==
|
11 |
MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
|
@@ -89,6 +89,16 @@ Please see the plugin documentation pages:
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
= 2.73.14 =
|
93 |
* Fixed: check for wp-config settings preventing file changes
|
94 |
|
5 |
Requires at least: 5.3
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.9
|
8 |
+
Stable tag: 2.73.17
|
9 |
|
10 |
== Description ==
|
11 |
MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
|
89 |
|
90 |
== Changelog ==
|
91 |
|
92 |
+
= 2.73.17 =
|
93 |
+
* Added: KML URL is now output when there is an error loading the KML file
|
94 |
+
* Fixed: geocoder not recognizing some locations, including "lat,lng" entries
|
95 |
+
|
96 |
+
= 2.73.16 =
|
97 |
+
* Fixed: autocomplete not creating new POIs
|
98 |
+
|
99 |
+
= 2.73.15 =
|
100 |
+
* Changed: replaced JQuery Autocomplete with new search box
|
101 |
+
|
102 |
= 2.73.14 =
|
103 |
* Fixed: check for wp-config settings preventing file changes
|
104 |
|
templates/map-directions.php
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<# if (!map.editable && mappl10n.options.directions != 'google') { #>
|
2 |
-
<div class='mapp-directions'>
|
3 |
-
<span class='mapp-close' data-mapp-action='dir-cancel'></span>
|
4 |
-
<div>
|
5 |
-
<input class='mapp-dir-saddr' tabindex='1' placeholder='<?php _e("My location", 'mappress-google-maps-for-wordpress');?>' />
|
6 |
-
<span data-mapp-action='dir-swap' class='mapp-dir-arrows'></span>
|
7 |
-
</div>
|
8 |
-
|
9 |
-
<div>
|
10 |
-
<input class='mapp-dir-daddr' tabindex='2'/>
|
11 |
-
</div>
|
12 |
-
|
13 |
-
<div class='mapp-dir-toolbar'>
|
14 |
-
<span class='mapp-submit-button' data-mapp-action='dir-get'><?php _e('Get Directions', 'mappress-google-maps-for-wordpress'); ?></span>
|
15 |
-
</div>
|
16 |
-
<div class='mapp-dir-renderer'></div>
|
17 |
-
</div>
|
18 |
-
<# } #>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/map.php
CHANGED
@@ -29,16 +29,7 @@
|
|
29 |
<# if (isSearchable || isFilterable) { #>
|
30 |
<div class='mapp-header'>
|
31 |
<# if (isSearchable) { #>
|
32 |
-
<div class='mapp-search'>
|
33 |
-
<input class='mapp-places' type='text' placeholder='<?php _e('Search', 'mappress-google-maps-for-wordpress'); ?>' title='<?php _e('Enter an address, place, KML file URL, or lat,lng', 'mappress-google-maps-for-wordpress');?>'/>
|
34 |
-
<div class='mapp-submit-button mapp-search-button'>
|
35 |
-
<# if (map.editable) { #>
|
36 |
-
+ <?php _e('Add to map', 'mappress-google-maps-for-wordpress'); ?>
|
37 |
-
<# } else { #>
|
38 |
-
<img src='<# print(mappl10n.options.baseurl + "/images/search.png"); #>'>
|
39 |
-
<# } #>
|
40 |
-
</div>
|
41 |
-
</div>
|
42 |
<# } #>
|
43 |
<# if (isFilterable && mappl10n.options.filtersPos == 'top') { #>
|
44 |
<# print(mapp.lib.template('map-filters', { map : map })); #>
|
29 |
<# if (isSearchable || isFilterable) { #>
|
30 |
<div class='mapp-header'>
|
31 |
<# if (isSearchable) { #>
|
32 |
+
<div class='mapp-search-container'></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
<# } #>
|
34 |
<# if (isFilterable && mappl10n.options.filtersPos == 'top') { #>
|
35 |
<# print(mapp.lib.template('map-filters', { map : map })); #>
|