MapPress Easy Google Maps - Version 2.67.2

Version Description

  • Fixed: unmounted component error from WP widgets screen unounting map
  • Fixed: warning about invalid block category on map library screen
  • Fixed: warning about toolbargroup vs toolbar
  • Fixed: empty mashup filters not saving, and warning about boolean count setting
  • Fixed: error from trimArray when saving settings
Download this release

Release Info

Developer chrisvrichardson
Plugin Icon 128x128 MapPress Easy Google Maps
Version 2.67.2
Comparing to
See all releases

Code changes from version 2.67.1 to 2.67.2

build/index_mappress_admin.js CHANGED
@@ -1 +1 @@
1
- (()=>{var e={844:()=>{function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(t){for(var a=1;a<arguments.length;a++){var o=null!=arguments[a]?arguments[a]:{};a%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var r=wp.element.createElement,i=wp.element,l=(i.Fragment,i.useEffect),s=(i.useLayoutEffect,i.useRef,i.useState),p=wp.components,c=p.Button,u=p.Modal,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function m(e){var n,o,i=a(s({isOpen:!1,reason:"",reasonText:"",redirectUrl:null}),2),p=i[0],m=i[1];function d(e){m((function(n){return t(t({},n),e)}))}function f(e,t){switch(e){case"cancel":d({isOpen:!1});break;case"submit":d({isOpen:!1}),window.location.href=p.redirectUrl+"&mapp_reason="+p.reason+"&mapp_reason_text="+encodeURIComponent(p.reasonText.trim())}}return l((function(){var e=jQuery("#deactivate-mappress-google-maps-for-wordpress");e.length&&(e.off("click.mapp"),e.on("click.mapp",(function(){var e,t;return(t=(e=this)?jQuery(e).attr("href"):null)&&d({isOpen:!0,redirectUrl:t}),!1})))}),[]),p.isOpen?r(u,{isDismissible:!0,onRequestClose:function(){return f("cancel")},shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:__("Feedback")},(o="other"==p.reason&&!p.reasonText,sprintf("<a href='https://mappresspro.com/chris-contact' target='_blank'>%s</a>",__("contact me")),r("div",{className:"mapp-deactivate"},r("div",{className:"mapp-deactivate-content"},r("h2",null,__("Could you take a moment to let me know why you're deactivating?")),r("p",null,__("Please contact me directly for help or feedback!"),r(c,{isLink:!0,className:"mapp-deactivate-help",isSecondary:!0,href:"https://mappresspro.com/chris-contact",target:"_blank"},__("Contact"))),(n=[{value:"notworking",label:__("The plugin isn't working"),placeholder:__("Could you provide some details or error messages, so I can fix the issue?")},{value:"notexpected",label:__("It's not what I expected"),placeholder:__("What did you expect, or what features were lacking?")},{value:"toohard",label:__("It's too hard to use"),placeholder:__("Can you suggest how to make it easier?")},{value:"feature",label:__("It's missing a key feature"),placeholder:__("What features were missing?")},{value:"temporary",label:__("I'm only deactivating temporarily")},{value:"other",label:__("Other"),placeholder:__("Could you please tell me more? I'm always looking for ways to improve the plugin.")}],r("div",{className:"mapp-deactivate-reasons"},_.map(n,(function(e){var t=e.value==p.reason;return r("div",{className:"mapp-deactivate-reason",key:e.value},r("label",null,r("input",{checked:t,onChange:function(e){return d({reason:e.target.value})},type:"radio",value:e.value}),e.label),t&&e.placeholder&&r("div",null,r("textarea",{onChange:function(e){return d({reasonText:e.target.value})},placeholder:e.placeholder,value:p.reasonText})))}))))),r("div",{className:"mapp-deactivate-footer"},r(c,{isSecondary:!0,disabled:o,onClick:function(){return f("submit")}},__("Deactivate")),r(c,{isPrimary:!0,onClick:function(){return f("cancel")}},__("Cancel")))))):null}jQuery(document).ready((function(){var e=jQuery("<div></div>").appendTo("body").get(0);wp.element.render(r(m),e)}))},215:(e,t,n)=>{"use strict";n.r(t);var a=n(525),o=n(143);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s,p=window.mapp||{},c=wp.element.createElement;s=jQuery,p.Editor=function(e){this.drawingManager=null,this.map=e,this.poiEditor=null;var t=this;this.initialize=function(){this.map.display(),this.poiEditor=new p.PoiEditor(this.map),this.initDrawingManager(),s(this.map.places).off("search.mapp"),s(this.map.places).on("search.mapp",(function(e,n){t.insert(n)}))},this.insert=function(e){if(e)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),e.geometry){var n=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,a=e.name==n?"":n,o=new p.Poi({address:n,body:a,iconid:this.poiEditor.lastIcon,point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null});this.map.poiInsert(o),o.center()}else e.overlay?(this.map.poiHover(null),"marker"==e.type?(o=new p.Poi({body:"",iconid:null,overlay:null,point:e.overlay.getPosition().toJSON(),title:e.overlay.getPosition().toUrlValue(6),type:null}),e.overlay.setMap(null)):o=new p.Poi({body:"",iconid:null,overlay:e.overlay,title:mappl10n.shape,type:e.type}),this.map.poiInsert(o)):"string"==typeof e&&"http"==e.substring(0,4)&&(o=new p.Poi({iconid:this.poiEditor.lastIcon,kml:{url:e},title:"KML",type:"kml"}),t.map.poiInsert(o),p.event.addListenerOnce(o.overlay,"ready defaultviewport_changed",(function(){o.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()),p.event.addListener(this.drawingManager,"overlaycomplete",(function(e){t.drawingManager.get("drawingMode")&&t.insert(e)})))},this.initialize.apply(this)},p.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,n){t.render(n)})),s(this.map).on("mapp.close",(function(){t.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(e){e.preventDefault();var n=s(this).attr("data-mapp-poi");t[n]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(e){var n=s(this).hasClass("mapp-poi-visual");t.mce(n)})),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 n={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(n),this.mce(!0)}},this.mce=function(e){var n=e?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(n,!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){var t=this;document.getElementById("mapp-poi-colorpicker")&&wp.element.render(c(a.MappColorPicker,i(i({},e.getTemplateColors()),{},{isExtended:!0,onChange:function(n){e.set({dirty:!0}),e.setTemplateColors(n),t.map.renderList(),t.renderColorPicker(e)}})),document.getElementById("mapp-poi-colorpicker"))},this.renderIconPicker=function(e){var t=this;document.getElementById("mapp-poi-iconpicker")&&wp.element.render(c(o.MappIconPicker,{iconid:e.iconid,onChange:function(n){e.set({dirty:!0,iconid:n}),t.lastIcon=n,t.map.renderList(),t.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,n)=>{"use strict";function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}n.r(t),n.d(t,{default:()=>y});var s=wp.element.createElement,p=wp.url.addQueryArgs,c=wp.element,u=c.useCallback,m=c.useEffect,d=c.useState,f=wp.components,h=(f.Button,f.Dropdown),g=f.Spinner,b=f.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function y(e){var t=i(d({isFetching:!1,results:[],search:"",searchTerm:""}),2),n=t[0],a=t[1];function r(e){a((function(t){return o(o({},t),e)}))}m((function(){n.isOpen&&(r({isFetching:!0}),wp.apiFetch({path:p("/wp/v2/search",{search:n.search,per_page:20})}).then((function(e){r({results:e,isFetching:!1})})))}),[n.search,n.isOpen]);var l=u(_.debounce((function(e){r({search:e})}),1e3),[]);function c(t,a){return s("div",{className:"mapp-attach-control"},s("div",{className:"mapp-attach-control-toolbar"},s(b,{autoComplete:"false",value:n.searchTerm,onChange:function(e){r({searchTerm:e}),l(e)},placeholder:__("Search")})),function(){if(n.isFetching)return s(g,null);if(n.results)return n.results.length?s("div",{className:"mapp-attach-items"},n.results.map((function(t){return s("div",{key:t.id,className:"mapp-attach-item",onClick:function(){e.onChange(t.id,t.title)}},s("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),s("div",{className:"mapp-attach-item-type"},t.type))}))):s("div",{},__("No posts found"))}())}return s("div",{onClick:function(e){return e.stopPropagation()}},s(h,{onToggle:function(e){return r({isOpen:e})},renderToggle:function(e){e.isOpen;var t=e.onToggle;return s("a",{href:"#",onClick:t},__("Attach"))},renderContent:function(e){e.isOpen,e.onToggle;return c()}}))}},525:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappColorPicker:()=>y});var a=n(824);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=c.useEffect,d=(c.useLayoutEffect,c.useCallback,c.useRef,c.useState),f=(wp.data.useSelect,wp.compose.withState,wp.components),h=f.Button,g=(f.ColorPalette,f.ColorPicker),b=(f.Dashicon,f.Dropdown,f.ExternalLink,f.Modal),__=(f.Panel,f.PanelBody,f.PanelRow,f.Popover,f.RadioControl,f.Spinner,f.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function y(e){var t=l(d({isCustomOpen:!1,isOpen:!1}),2),n=t[0],o=t[1];function i(e){o((function(t){return r(r({},t),e)}))}function s(t,n){switch(t){case"close":i({isOpen:!1});break;case"open":i({isOpen:!0});break;case"select":e.onChange(n),s("close");break;case"set":e.onChange(n)}}return m((function(){}),[]),p(u,null,p("span",{className:"mapp-colors-toggle",onClick:function(){return s("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(!n.isOpen)return null;var t=_.map([100,90,80,70,60,50,40,30,20,10,0],(function(e){return{label:e+"%",value:e}})),o=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(function(e){return{label:e+"px",value:e}}));return p(b,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:function(e){return s("close")}},p("div",{className:"mapp-colors"},p("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"]],(function(t,n){return p("div",{key:n},_.map(t,(function(t){return p("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:function(){i({isCustomOpen:!1}),s("select",{color:t})},style:{backgroundColor:t},title:t})})))}))),n.isCustomOpen&&p(g,{color:e.color,onChangeComplete:function(e){return s("set",{color:e.hex})},disableAlpha:!0}),e.isExtended&&p(a.Select,{label:__("Opacity"),options:t,value:e.opacity?e.opacity:"",onChange:function(e){return s("set",{opacity:e})}}),e.isExtended&&p(a.Select,{label:__("Stroke"),options:o,value:e.weight?e.weight:"",onChange:function(e){return s("set",{weight:e})}}),p("div",{className:"mapp-colors-toolbar"},p(h,{isPrimary:!0,onClick:function(){return s("close")}},__("Done")),p(h,{onClick:function(){return i({isCustomOpen:!n.isCustomOpen})}},__("Custom color")))))}())}},371:(e,t,n)=>{"use strict";n.r(t);var a=n(477);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}wp&&wp.plugins&&wp.plugins.registerPlugin&&wp.editPost&&wp.plugins.registerPlugin("mappress-document-settings-panel",{render:function(){var e,t,n=wp.editPost.PluginDocumentSettingPanel,o=wp.element.createElement,i=wp.element,s=i.Fragment,p=i.useEffect,c=(i.useLayoutEffect,i.useRef,i.useState),u=wp.components,m=u.Button,d=u.Spinner,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")},f=l(c({isFetchingItems:!0,isPickerOpen:!1,items:null,pickerMapid:null,pickerMode:"list"}),2),h=f[0],g=f[1];function b(e){g((function(t){return r(r({},t),e)}))}function y(e,t){switch(e){case"open-library":b({isPickerOpen:!0,pickerMode:"list"});break;case"edit":b({isPickerOpen:!0,pickerMapid:t,pickerMode:"edit"});break;case"pick-close":b({isPickerOpen:!1,pickerMapid:null});break;case"pick-insert":var n=wp.blocks.createBlock("mappress/map",{mapid:t});wp.data.dispatch("core/block-editor").insertBlock(n,0),b({isPickerOpen:!1,pickerMapid:null})}}function v(e){var t=e.map_title?e.map_title:__("Untitled");return o("div",{className:"mapp-document-item",key:e.mapid+e.postid},o("a",{className:"mapp-document-col-map_title",href:"#",onClick:function(t){return y("edit",e.mapid)}},t),o("div",{className:"mapp-document-col-mapid"},e.mapid))}return p((function(){var e=function(e){b({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),function(){return mapp.store.unsubscribe(e)}})),p((function(){mapp.store.fetchItems()}),[]),o(n,{title:"MapPress",className:"mapp-document-panel"},(t=_.filter(h.items,(function(e){return e.postid==mappl10n.options.postid})),e=h.isFetchingItems?o(d,null):t.length?o(s,null,o("div",{className:"mapp-document-header"},o("div",{className:"mapp-document-col-map_title"},__("Map title")),o("div",{className:"mapp-document-col-mapid"},null,__("Map ID"))),_.map(t,v)):o("div",{className:"mapp-document-message"},__("No maps found")),o("div",null,o("div",{className:"mapp-document-list"},e))),o(m,{icon:"portfolio",isSecondary:!0,onClick:function(){return y("open-library")}},__("Open map library")),function(){if(h.isPickerOpen)return o(a.default,{mapid:h.pickerMapid,mode:h.pickerMode,onAction:y,type:"post"})}())},icon:null})},999:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var a=n(429),o=n(710);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=window.mapp||{},u=wp.element.createElement,m=wp.element,d=(m.Fragment,m.useEffect),f=(m.useLayoutEffect,m.useRef),h=m.useState,g=wp.components,b=g.Button,y=(g.Dropdown,g.Modal,g.Panel,g.PanelBody,g.Popover,g.Spinner,g.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n,r=s(h({dragging:null,dragover:null,isFetchingMap:!!e.mapid,isPoiListOpen:!0,isSavingMap:!1,map:null,mapdata:null}),2),l=r[0],p=r[1],m=f(null);function g(e){p((function(t){return i(i({},t),e)}))}function v(e){g({map:l.map})}function w(t,n){switch(t){case"change-settings":l.map.set(n),g({map:l.map});break;case"change-title":l.map.set({dirty:!0,title:n}),g({map:l.map});break;case"close":e.onAction("edit-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(c.store.destroyMap({mapid:e.mapid}),e.onAction("edit-destroy"));break;case"save":c.store.saveMap({mapdata:l.map.toJSON(),success:function(t){l.map.set({dirty:!1}),e.onAction("edit-save",t.mapid)}})}}return d((function(){l.map&&(jQuery(l.map.div.list).off("render",v),jQuery(l.map.div.list).on("render",(function(e){return v()})))}),[l.map]),d((function(){var t=function(t){g({isFetchingMap:t.isFetchingMap,isSavingMap:t.isSavingMap,mapdata:t.maps[e.mapid]})};return c.store.subscribe(t),function(){return c.store.unsubscribe(t)}})),d((function(){e.mapid&&c.store.fetchMap({mapid:e.mapid})}),[e.mapid]),d((function(){if(!l.isFetchingMap){var t={editable:!0,embed:!0,layout:"left",mapOpts:{streetViewControl:!1},menu:!1,name:"media-map",poiList:!1,sel:jQuery(m.current)};"map"!=e.context&&"mashup"!=e.context||(t.center=null,t.zoom=null);var n=new c.Map(l.mapdata,t);new c.Editor(n);g({map:n})}}),[l.mapdata]),d((function(){l.map&&setTimeout((function(){return l.map.resize()}),100)}),[l.isPoiListOpen]),u("div",{className:"mapp-edit"},(t=l.map&&!l.isFetchingMap&&l.map.title?l.map.title:"",n=l.map&&!l.isFetchingMap?__("Untitled"):"",u("div",{className:"mapp-gt-modal-header"},u(y,{className:"mapp-edit-title",placeholder:n,value:t,onChange:function(e){return w("change-title",e)}}))),u("div",{className:"mapp-edit-main"},u("div",{className:"mapp-list mapp-edit-list"+(l.isPoiListOpen?" mapp-list-open":"")},u("div",{className:"mapp-edit-list-wrapper"},function(){if("mce"!=e.context&&"library"!=e.context)return null;if(!l.map)return null;var t=l.map,n=t.center,o=t.height,r=t.poiList,i=t.width,s=t.zoom;return u("div",{className:"mapp-gt-inspector"},u(a.MappSettings,{map:l.map,context:e.context,onAction:w,center:n,height:o,poiList:r,width:i,zoom:s}))}(),function(){if(l.map){var e=function(e,t){var n=l.dragging,a=n<a?t-1:t;l.map.pois_.splice(a,0,l.map.pois_.splice(n,1)[0]),g({map:l.map,dragover:null})};return u("div",{className:"mapp-items"},_.map(l.map.pois_,(function(t,n){return u("div",{className:l.dragover==n?"mapp-item mapp-edit-dragover":"mapp-item",draggable:!0,key:n,onClick:function(){return l.map.poiOpen(l.map.pois_[n])},onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return g({dragging:n})},onDragEnter:function(e){return g({dragover:n})},onDragEnd:function(e){return g({dragging:null,dragover:null})},onDrop:function(t){return e(t,n)}},u("img",{className:"mapp-icon",src:c.Icons.getUrl(t.iconid)}),u("div",{className:"mapp-title"},t.title))})))}}()),u("div",{className:"mapp-list-toggle",onClick:function(){return g({isPoiListOpen:!l.isPoiListOpen})}})),u("div",{className:"mapp-edit-map",key:e.mapid,ref:m,onKeyDown:function(e){return e.stopPropagation()},tabIndex:-1}),m.current&&l.map?u(o.m,{map:l.map,selected:l.map.mapTypeId,onChange:function(e){return w("change-settings",{mapTypeId:e})}}):null),u("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:function(e){return e.stopPropagation()}},u(b,{isPrimary:!0,isBusy:l.isSavingMap,onClick:function(){return w("save")}},__("Save")),u(b,{disabled:l.isSavingMap,onClick:function(){return w("close")}},__("Cancel")),u(b,{disabled:!e.mapid||l.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:function(){return w("destroy")}},__("Delete"))))}},143:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappIconPicker:()=>w});var a=n(525),o=n(824);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=wp.element.createElement,u=wp.element,m=u.Fragment,d=u.useEffect,f=(u.useLayoutEffect,u.useCallback,u.useRef,u.useState),h=(wp.data.useSelect,wp.compose.withState,wp.components),g=h.Button,b=(h.ColorPicker,h.DropZone,h.DropZoneProvider,h.FormFileUpload),y=h.Modal,__=(h.Popover,h.Spinner,h.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")}),v={"fa-regular-400":{label:"Font Awesome Regular",glyphs:[{name:"address-book",codepoint:""}]},"mapp-icons":{label:"Map icons",glyphs:[{name:"abseiling",codepoint:59392},{name:"accounting",codepoint:59393},{name:"airport",codepoint:59394},{name:"amusement-park",codepoint:59395},{name:"aquarium",codepoint:59396},{name:"archery",codepoint:59397},{name:"art-gallery",codepoint:59398},{name:"assistive-listening-system",codepoint:59399},{name:"atm",codepoint:59400},{name:"audio-description",codepoint:59401},{name:"bakery",codepoint:59402},{name:"bank",codepoint:59403},{name:"bar",codepoint:59404},{name:"baseball",codepoint:59405},{name:"beauty-salon",codepoint:59406},{name:"bicycle-store",codepoint:59407},{name:"bicycling",codepoint:59408},{name:"boat-ramp",codepoint:59409},{name:"boat-tour",codepoint:59410},{name:"boating",codepoint:59411},{name:"book-store",codepoint:59412},{name:"bowling-alley",codepoint:59413},{name:"braille",codepoint:59414},{name:"bus-station",codepoint:59415},{name:"cafe",codepoint:59416},{name:"campground",codepoint:59417},{name:"canoe",codepoint:59418},{name:"car-dealer",codepoint:59419},{name:"car-rental",codepoint:59420},{name:"car-repair",codepoint:59421},{name:"car-wash",codepoint:59422},{name:"casino",codepoint:59423},{name:"cemetery",codepoint:59424},{name:"chairlift",codepoint:59425},{name:"church",codepoint:59426},{name:"skip",codepoint:59427},{name:"city-hall",codepoint:59428},{name:"climbing",codepoint:59429},{name:"closed-captioning",codepoint:59430},{name:"clothing-store",codepoint:59431},{name:"compass",codepoint:59432},{name:"convenience-store",codepoint:59433},{name:"courthouse",codepoint:59434},{name:"cross-country-skiing",codepoint:59435},{name:"crosshairs",codepoint:59436},{name:"dentist",codepoint:59437},{name:"department-store",codepoint:59438},{name:"diving",codepoint:59439},{name:"doctor",codepoint:59440},{name:"electrician",codepoint:59441},{name:"electronics-store",codepoint:59442},{name:"embassy",codepoint:59443},{name:"expand",codepoint:59444},{name:"female",codepoint:59445},{name:"finance",codepoint:59446},{name:"fire-station",codepoint:59447},{name:"fish-cleaning",codepoint:59448},{name:"fishing-pier",codepoint:59449},{name:"fishing",codepoint:59450},{name:"florist",codepoint:59451},{name:"food",codepoint:59452},{name:"fullscreen",codepoint:59453},{name:"funeral-home",codepoint:59454},{name:"furniture-store",codepoint:59455},{name:"gas-station",codepoint:59456},{name:"general-contractor",codepoint:59457},{name:"golf",codepoint:59458},{name:"grocery-or-supermarket",codepoint:59459},{name:"gym",codepoint:59460},{name:"hair-care",codepoint:59461},{name:"hang-gliding",codepoint:59462},{name:"hardware-store",codepoint:59463},{name:"health",codepoint:59464},{name:"hindu-temple",codepoint:59465},{name:"horse-riding",codepoint:59466},{name:"hospital",codepoint:59467},{name:"ice-fishing",codepoint:59468},{name:"ice-skating",codepoint:59469},{name:"inline-skating",codepoint:59470},{name:"insurance-agency",codepoint:59471},{name:"jet-skiing",codepoint:59472},{name:"jewelry-store",codepoint:59473},{name:"kayaking",codepoint:59474},{name:"laundry",codepoint:59475},{name:"lawyer",codepoint:59476},{name:"library",codepoint:59477},{name:"liquor-store",codepoint:59478},{name:"local-government",codepoint:59479},{name:"location-arrow",codepoint:59480},{name:"locksmith",codepoint:59481},{name:"lodging",codepoint:59482},{name:"low-vision-access",codepoint:59483},{name:"male",codepoint:59484},{name:"skip",codepoint:59485},{name:"marina",codepoint:59486},{name:"mosque",codepoint:59487},{name:"motobike-trail",codepoint:59488},{name:"movie-rental",codepoint:59489},{name:"movie-theater",codepoint:59490},{name:"moving-company",codepoint:59491},{name:"museum",codepoint:59492},{name:"natural-feature",codepoint:59493},{name:"night-club",codepoint:59494},{name:"open-captioning",codepoint:59495},{name:"painter",codepoint:59496},{name:"park",codepoint:59497},{name:"parking",codepoint:59498},{name:"pet-store",codepoint:59499},{name:"pharmacy",codepoint:59500},{name:"physiotherapist",codepoint:59501},{name:"place-of-worship",codepoint:59502},{name:"playground",codepoint:59503},{name:"plumber",codepoint:59504},{name:"point-of-interest",codepoint:59505},{name:"police",codepoint:59506},{name:"political",codepoint:59507},{name:"post-box",codepoint:59508},{name:"post-office",codepoint:59509},{name:"skip",codepoint:59510},{name:"skip",codepoint:59511},{name:"rafting",codepoint:59512},{name:"real-estate-agency",codepoint:59513},{name:"restaurant",codepoint:59514},{name:"roofing-contractor",codepoint:59515},{name:"skip",codepoint:59516},{name:"route",codepoint:59517},{name:"rv-park",codepoint:59518},{name:"sailing",codepoint:59519},{name:"school",codepoint:59520},{name:"scuba-diving",codepoint:59521},{name:"search",codepoint:59522},{name:"skip",codepoint:59523},{name:"shopping-mall",codepoint:59524},{name:"sign-language",codepoint:59525},{name:"skateboarding",codepoint:59526},{name:"ski-jumping",codepoint:59527},{name:"skiing",codepoint:59528},{name:"sledding",codepoint:59529},{name:"snow-shoeing",codepoint:59530},{name:"snow",codepoint:59531},{name:"snowboarding",codepoint:59532},{name:"snowmobile",codepoint:59533},{name:"spa",codepoint:59534},{name:"skip",codepoint:59535},{name:"skip",codepoint:59536},{name:"skip",codepoint:59537},{name:"stadium",codepoint:59538},{name:"storage",codepoint:59539},{name:"store",codepoint:59540},{name:"subway-station",codepoint:59541},{name:"surfing",codepoint:59542},{name:"swimming",codepoint:59543},{name:"synagogue",codepoint:59544},{name:"taxi-stand",codepoint:59545},{name:"tennis",codepoint:59546},{name:"toilet",codepoint:59547},{name:"trail-walking",codepoint:59548},{name:"train-station",codepoint:59549},{name:"transit-station",codepoint:59550},{name:"travel-agency",codepoint:59551},{name:"unisex",codepoint:59552},{name:"university",codepoint:59553},{name:"veterinary-care",codepoint:59554},{name:"viewing",codepoint:59555},{name:"volume-control-telephone",codepoint:59556},{name:"walking",codepoint:59557},{name:"waterskiing",codepoint:59558},{name:"whale-watching",codepoint:59559},{name:"wheelchair",codepoint:59560},{name:"wind-surfing",codepoint:59561},{name:"zoo",codepoint:59562}]},"mapp-shapes":{label:"Map shapes",glyphs:[{name:"circle",codepoint:59648,center:[16,16]},{name:"widepin",codepoint:59649,center:[16,14]},{name:"route",codepoint:59650,center:[16,14]},{name:"shield",codepoint:59651,center:[16,14]},{name:"squarepin",codepoint:59653,center:[16,14]},{name:"square",codepoint:59652,center:[16,16]},{name:"squarerounded",codepoint:59654,center:[16,16]},{name:"roundpin",codepoint:59657,center:[16,13]},{name:"pin",codepoint:59655,center:null},{name:"pindot",codepoint:59656,center:null}]}};function w(e){var t,n,r,l=s(f({defaultIcon:mappl10n.options.defaultIcon,filename:null,fillColor:"gray",filter:"",glyph:"",glyphColor:"white",glyphFont:"mapp-icons",isFontLoaded:!1,isOpen:!1,mode:"list",shape:"circle",shapeFont:"mapp-shapes",showNames:!0,strokeColor:"black",strokeWidth:4,urls:{},userIcons:mappl10n.options.userIcons}),2),p=l[0],u=l[1];function h(e){u((function(t){return i(i({},t),e)}))}function w(t,n){switch(t){case"close":h({isOpen:!1});break;case"edit-cancel":h({mode:"list"});break;case"edit-save":!function(e){p.glyphFont;var t=2,n=32*t,a=16*t,o=document.createElement("canvas");o.width=n,o.height=n,o.style.imageRendering="pixelated";var r=o.getContext("2d");r.font=n+"px "+p.shapeFont,r.fillStyle=p.fillColor,r.textBaseline="bottom";var i=_.findWhere(v[p.shapeFont].glyphs,{name:p.shape});r.fillText(String.fromCharCode(i.codepoint),0,n);var l=1,s=l*t;if(r.strokeStyle="white",r.lineWidth=s,r.font=n-l*t+"px "+p.shapeFont,r.strokeText(String.fromCharCode(i.codepoint),l,n-l),i.center){r.imageSmoothingEnabled=!1,r.font=a+"px "+p.glyphFont,r.fillStyle=p.glyphColor;var c=[i.center[0]*t,i.center[1]*t],u=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph});r.fillText(String.fromCharCode(u.codepoint),c[0]-a/2,c[1]+a/2)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(o):o.toBlob((function(e){var t=new FormData;t.append("image0",e,p.filename),k(t)}),"image/png",100)}();break;case"edit-upload":a=n,o=new FormData,_.map(a,(function(e,t){e.type.match("image.*")?o.append("image"+t,e):alert("File "+e.name+" is not an image.")})),k(o);break;case"list-clear":e.onChange&&e.onChange(null),w("close");break;case"list-delete":e.iconid&&confirm(mappl10n.delete_prompt)&&mapp.lib.ajax({type:"POST",data:{action:"mapp_icon_delete",iconids:e.iconid,nonce:mappl10n.options.nonce},callback:function(t){if(t&&"OK"==t.status){var n=mappl10n.options.userIcons.indexOf(e.iconid);n>=0&&void 0!==mappl10n.options.userIcons[n+1]?e.onChange(mappl10n.options.userIcons[n+1]):e.onChange(null),mappl10n.options.userIcons=t.data,h({userIcons:mappl10n.options.userIcons})}else alert("Delete error: "+t.status)}});break;case"list-select":e.onChange&&(n==e.iconid?e.onChange(null):e.onChange(n));break;case"mode":h({mode:n});break;case"open":h({isOpen:!0})}var a,o}function O(t){var n="user"==t?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(n,(function(t){return c("div",{alt:t,className:e.iconid==t?"mapp-icon-wrapper mapp-selected":"mapp-icon-wrapper",key:t,onClick:function(){return w("list-select",t)}},c("img",{className:"mapp-icon",src:mapp.Icons.getUrl(t),title:t}))}))}function k(e){e.append("action","mapp_icon_save"),e.append("nonce",mappl10n.options.nonce),mapp.lib.ajax({type:"POST",contentType:!1,processData:!1,data:e,success:function(e){e&&"OK"==e.status?(mappl10n.options.userIcons=e.data.icons,h({userIcons:mappl10n.options.userIcons}),h({mode:"list"}),w("list-select",e.data.filename)):alert("Upload error: "+e.status)}})}return d((function(){var e=[];_.map(v,(function(t,n){var a=new FontFace(n,"url("+mappl10n.options.baseurl+"/pro/fonts/"+n+".woff?"+mappl10n.options.version+")");document.fonts.add(a),e.push(a.loaded)})),Promise.all(e).then((function(){h({isFontLoaded:!0})}))}),[]),d((function(){h({filename:p.shape+"_"+p.fillColor.replace("#","")+(p.glyph?"_"+p.glyph:"")+".png"})}),[p.shape,p.fillColor,p.glyph]),c(m,null,c("img",{className:"mapp-icon",onClick:function(){return w("open",null)},src:mapp.Icons.getUrl(e.iconid)}),"list"==p.mode&&function(){if(!p.isOpen)return null;var t=e.iconid&&mappl10n.options.userIcons.indexOf(e.iconid)>=0;return c(y,{title:c("div",{className:"mapp-icons-header"},__("Select an icon"),c(g,{isSecondary:!0,onClick:function(){return w("mode","edit")}},__("New icon"))),className:"mapp-icons-modal",onRequestClose:function(){return w("close")}},c("div",{className:"mapp-icons"},c("div",{className:"mapp-icons-list"},c("div",{className:"mapp-icons-user"},O("user")),c("div",{className:"mapp-icons-standard"},O("standard"))),c("div",{className:"mapp-icons-edit-filename"},e.iconid?e.iconid:__("No icon selected")),c("div",{className:"mapp-icons-toolbar"},c("div",null,c(g,{isPrimary:!0,onClick:function(){return w("close")}},__("OK")),c(g,{isSecondary:!0,onClick:function(){return w("list-clear")}},__("Use default icon"))),c(g,{isDestructive:!0,onClick:function(){return w("list-delete")},disabled:!t},__("Delete")))))}(),"edit"==p.mode&&c(y,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:function(){return w("edit-cancel")},shouldCloseOnClickOutside:!1},c("div",{className:"mapp-icons-edit"},c("div",{id:"mapp-edit-debug"}),c("div",{className:"mapp-icons-edit-shape-section"},c("div",{className:"mapp-icons-edit-header"},__("Shape")),(t=v[p.shapeFont],n=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph}),r=n?String.fromCharCode(n.codepoint):null,c("div",{className:"mapp-icons-edit-shapes",style:{color:p.fillColor,fontFamily:p.shapeFont}},_.map(t.glyphs,(function(e,t){var a=p.shape==e.name;return c("span",{className:"mapp-icons-edit-shape-wrapper"+(a?" mapp-selected":""),key:e.name,onClick:function(){return h({shape:e.name})},title:e.name},c("span",{className:"mapp-icons-edit-shape"},String.fromCharCode(e.codepoint),e.center&&n&&c("span",{className:"mapp-icons-edit-glyph",style:{left:e.center[0],top:e.center[1],color:p.glyphColor,fontFamily:p.glyphFont}},r)))}))))),c("div",{className:"mapp-icons-edit-color-section"},c("span",{className:"mapp-icons-edit-header"},__("Color")),c(a.MappColorPicker,{color:p.fillColor,isExtended:!1,onChange:function(e){return h({fillColor:e.color})}})),c("div",{className:"mapp-icons-edit-glyph-section"},c("div",{className:"mapp-icons-edit-search"},c("div",{className:"mapp-icons-edit-header"},__("Search")),c(o.Input,{onChange:function(e){return h({filter:e})}})),function(){p.glyphFont;var e=_.filter(v[p.glyphFont].glyphs,(function(e){return(!p.filter||e.name.includes(p.filter))&&"skip"!=e.name}));return c("div",{className:"mapp-icons-edit-glyph-list",style:{color:p.glyphColor,fontFamily:p.glyphFont}},_.map(e,(function(e,t){return c("div",{className:"mapp-icons-edit-glyph-wrapper"+(p.glyph==e.name?" mapp-selected":""),key:t,onClick:function(){return h({glyph:p.glyph==e.name?null:e.name})}},c("span",{className:"mapp-icons-edit-glyph"},String.fromCharCode(e.codepoint)),c("div",{className:"mapp-icons-edit-glyph-title"},e.name))})))}()),c("div",{className:"mapp-icons-edit-toolbar"},c("div",null,c(g,{isPrimary:!0,onClick:function(){return w("edit-save")}},__("Save")),c(g,{isSecondary:!0,onClick:function(){return w("edit-cancel")}},__("Cancel"))),c(b,{accept:"image/*",icon:"upload",multiple:!0,onChange:function(e){w("edit-upload",e.target.files)}},__("Upload icons"))))))}},938:(e,t,n)=>{"use strict";n.r(t);var a=n(477);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}window.mapp;var i=wp.element.createElement,l=wp.element,s=(l.Fragment,l.render,l.useEffect),p=(l.useLayoutEffect,l.useRef,l.useState),c=wp.components;c.Button,c.Modal;document.getElementById("mapp-library")&&(mappl10n.options.postid=0,wp.element.render(i((function(e){var t=o(p({mapid:null}),2),n=t[0];return t[1],s((function(){}),[]),i(a.default,{context:"library",mapid:n.mapid,onAction:function(e,t){switch(e){case"pick-shortcode":var n=jQuery("<input>");jQuery("body").append(n),n.val('[mappress mapid="'+t+'"]').select(),document.execCommand("copy"),n.remove(),alert((a="Shortcode copied",wp.i18n.__(a,"mappress-google-maps-for-wordpress")))}var a}})})),document.getElementById("mapp-library")))},816:(e,t,n)=>{"use strict";n.r(t);var a=n(429),o=n(477);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=window.mapp||{},u=wp.element.createElement,m=wp.element,d=m.Fragment,f=m.useEffect,h=(m.useLayoutEffect,m.useRef),g=m.useState,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function b(e){var t=wp.components,n=(t.BaseControl,t.Button),r=(t.ButtonGroup,t.CheckboxControl,t.Dropdown,t.Modal,t.Panel,t.PanelBody,t.PanelRow,t.Placeholder),l=(t.RadioControl,t.SelectControl,t.TextControl,t.ToggleControl,t.Toolbar),p=t.ToolbarButton,m=(t.ToolbarGroup,wp.blockEditor),b=m.BlockControls,y=m.InspectorControls,v=s(g({isOpen:!1,map:null,mapdata:null,pickerMode:"list",pickerMapid:null}),2),w=v[0],O=v[1],k=h(null);function C(e){O((function(t){return i(i({},t),e)}))}function S(t,n){switch(t){case"add":C({isOpen:!0,pickerMapid:null,pickerMode:"edit"}),e.setAttributes({center:void 0,zoom:void 0});break;case"change-settings":e.setAttributes(n);break;case"edit":C({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"edit"});break;case"edit-close":C({isOpen:!1});break;case"pick-destroy":e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),C({isOpen:!1});break;case"pick-close":C({isOpen:!1});break;case"pick-insert":case"pick-duplicate":n!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:n,zoom:void 0}),C({isOpen:!1});break;case"open":C({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"list"})}}function P(){var t=void 0!==t?t:l;return u(b,null,u(t,null,e.attributes.mapid&&u(p,{icon:"edit",label:__("Edit map"),onClick:function(){return S("edit")}}),u(p,{icon:"portfolio",label:__("Map Library"),onClick:function(){return S("open")}})))}function j(){if(w.isOpen)return u(o.default,{mapid:w.pickerMapid,mode:w.pickerMode,onAction:S,type:"post"})}return f((function(){var t=function(t){var n=t.maps[e.attributes.mapid];n&&C({mapdata:n})};return c.store.subscribe(t),function(){return c.store.unsubscribe(t)}})),f((function(){e.attributes.mapid&&c.store.fetchMap({mapid:e.attributes.mapid,failure:function(){return C({mapdata:void 0})}})}),[e.attributes.mapid]),f((function(){var t;e.attributes.mapid&&k.current&&w.mapdata&&((t=new c.Map(w.mapdata,{alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:e.attributes.poiList,sel:jQuery(k.current),width:e.attributes.width,zoom:e.attributes.zoom})).display(),C({map:t}))}),[w.mapdata]),f((function(){"wide"!=e.attributes.align&&"full"!=e.attributes.align||(e.setAttributes({width:"100%"}),w.map&&w.map.setSize({width:"100%"}))}),[e.attributes.align]),e.attributes.preview?u("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):e.attributes.mapid&&void 0!==w.mapdata?u(d,null,P(),function(){if(!w.map)return null;var t=e.attributes,n=t.align,o=t.center,r=t.height,i=t.poiList,l=t.width,s=t.zoom;return u(y,null,u("div",{className:"mapp-gt-inspector"},u(a.MappSettings,{map:w.map,alignment:n,context:"map",onAction:S,center:o,height:r,poiList:i,width:l,zoom:s})))}(),u("div",{className:"mapp-gt",ref:k}),j()):u(d,null,u(d,null,P(),u(r,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},u(n,{icon:"portfolio",isSecondary:!0,onClick:function(){return S("open")}},__("Map Library")))),j())}wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:"mappress",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},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:function(e){return e.named.center}},height:{type:"string",shortcode:function(e){return e.named.height}},initialOpenDirections:{type:"boolean",shortcode:function(e){return"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections}},mapid:{type:"string",shortcode:function(e){return e.named.mapid}},poiList:{type:"boolean",shortcode:function(e){return"true"==e.named.poiList||"true"==e.named.poilist}},width:{type:"string",shortcode:function(e){return e.named.width}},zoom:{type:"number",shortcode:function(e){return parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}}},{type:"block",blocks:["core/shortcode"],isMatch:function(e){var t=e.text,n=wp.shortcode.regexp("mappress");return n.lastIndex=0,n.test(t)},transform:function(e){var t=e.text;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return u(b,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},378:(e,t,n)=>{"use strict";n.r(t);n(429),n(670),n(308);window.mapp,wp.element.createElement;var a=wp.element,o=(a.Fragment,a.useEffect,a.useLayoutEffect,a.useRef,a.useState,wp.components);o.BaseControl,o.Button,o.ButtonGroup,o.Card,o.CardBody,o.CardFooter,o.CardHeader,o.CheckboxControl,o.ExternalLink,o.HorizontalRule,o.Panel,o.PanelBody,o.PanelRow,o.Placeholder,o.RadioControl,o.SelectControl,o.TabPanel,o.TextControl,o.TextareaControl,o.ToggleControl,o.Toolbar,wp.data.useSelect},498:(e,t,n)=>{"use strict";n.r(t);var a=n(477);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}window.mapp;var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=(c.useEffect,c.useLayoutEffect,c.useRef,c.useState),d=wp.components,f=(d.Button,d.Dashicon),__=(d.Modal,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function h(){var e=l(m({isOpen:!1,mapid:null}),2),t=e[0],n=e[1];function o(e){n((function(t){return r(r({},t),e)}))}function i(e,t){switch(e){case"pick-close":o({isOpen:!1,mapid:null});break;case"pick-insert":o({isOpen:!1});var n='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(n);break;case"open":o({isOpen:!0,mapid:s()})}}function s(){var e=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;for(var n=null,a=t.anchorNode.data,o=-1,r=t.anchorOffset-1;r>=0;r--){var i=a[r];if("["==i){o=r;break}if("]"==i||"<"==i||">"==i)break}return o>=0&&(n=wp.shortcode.next("mappress",a,o))?n.shortcode.attrs.named.mapid:null}return p(u,null,p("button",{className:"button",type:"button",onClick:function(e){e.preventDefault(),i("open")}},p(f,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&p(a.default,{context:"mce",mapid:t.mapid,onAction:i}))}Array.from(document.getElementsByClassName("mapp-mce")).forEach((function(e,t){return wp.element.render(p(h),e)}))},670:(e,t,n)=>{"use strict";function a(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}n.r(t),n.d(t,{MappMultiSelect:()=>v});var c=wp.element.createElement,u=wp.element,m=(u.Fragment,u.useEffect),d=(u.useLayoutEffect,u.useRef),f=u.useState,h=wp.components,g=h.BaseControl,b=(h.Button,h.CheckboxControl),y=(h.Panel,h.PanelBody,h.PanelRow,h.Spinner,h.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n=d(null),o=d(null),i=l(f({isOpen:!1,filter:"",filteredOptions:[]}),2),s=i[0],p=i[1];function u(e){p((function(t){return r(r({},t),e)}))}function h(t){var n=_.findWhere(e.options,{value:t});return n?n.label:t}function v(){var t;return e.values instanceof Array?t=a(e.values):e.values&&(t=[e.values]),t||[]}function w(t,n){var a=v(),o=a.indexOf(t);(n=void 0!==n?n:-1==o)?a.push(t):a.splice(o,1),e.onChange(a)}function O(){return s.isOpen?c("div",{className:"mapp-select-dropdown-wrapper"},c("div",{className:"mapp-select-dropdown"},!s.isOpen||!e.options||e.options.length<10?null:c("div",{className:"mapp-select-filter",ref:o},c(y,{autoComplete:"off",placeholder:__("Search"),value:s.filter,onChange:function(e){return u({filter:e})}})),c("div",{className:"mapp-select-dropdown-list"},(t=v(),0==s.filteredOptions.length?c("div",{className:"mapp-select-dropdown-item"},__("No results")):s.filteredOptions.map((function(e){return c(b,{className:"mapp-select-dropdown-item",checked:t.includes(e.value),key:e.value,onChange:function(t){return w(e.value,t)},label:e.label})})))))):null;var t}return m((function(){if(e.options)if(s.filter){var t=s.filter.toUpperCase();u({filteredOptions:e.options.filter((function(e){return 0==e.label.toUpperCase().indexOf(t)}))})}else u({filteredOptions:e.options})}),[e.options,s.filter]),m((function(){s.isOpen&&o.current&&(jQuery("input",jQuery(o.current)).focus(),u({filter:""}))}),[s.isOpen]),c(g,{className:"mapp-select",label:e.label},c("div",{ref:n,tabIndex:0,onBlur:function(e){return function(e){event.relatedTarget||document.activeElement,n.current.contains(e.relatedTarget)||u({isOpen:!1})}(e)}},((t=v())instanceof Array&&t.map((function(e){return h(e)})),void 0===e.options?c("div",{className:"mapp-select-input"},c("div",{className:"mapp-select-tokens"}),c("span",{className:"dashicons dashicons-arrow-down-alt2"})):c("div",{className:"mapp-select-input",onClick:function(){return u({isOpen:!s.isOpen})}},c("div",{className:"mapp-select-tokens"},t.map((function(e){return c("span",{className:"mapp-select-token",key:e,onClick:function(t){t.stopPropagation(),w(e,!1)}},h(e))}))),c("span",{className:"dashicons "+(s.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))),O()))}},218:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>C});var a=n(824),o=n(143),r=n(710);function i(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var d=wp.element.createElement,f=wp.element,h=f.Fragment,g=f.useEffect,b=(f.useLayoutEffect,f.useCallback,f.useRef),y=f.useState,v=wp.data.useSelect,w=wp.components,O=w.Button,k=w.Dashicon,__=(w.ExternalLink,w.Modal,w.Panel,w.PanelBody,w.PanelRow,w.Popover,w.RadioControl,w.Spinner,w.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function C(e){var t,n,l,p,u,m,f=c(y(s({},mappress_options_state)),2),w=f[0],C=f[1],S=b(null);function P(e){C((function(t){return s(s({},t),e)}))}function j(e){return _.map(e,(function(e,t){return{value:t,label:e}}))}function x(e){return e?e.length?(_.map(e,(function(e){for(var t in e)"string"==typeof e[t]&&(e[t]=e[t].trim())})),e.filter((function(e){for(var t in e)if(0==e[t].length)return!1;return!0}))):[]:e}function N(e,t){switch(e){case"license-check":mapp.lib.ajax({type:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:w.license},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"reset":mapp.lib.ajax({type:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"save":var n=s({},w);delete n.helpers,n.filters=x(n.filters),n.metaKeys=x(n.metaKeys),n.sizes=x(n.sizes),n.autoicons&&n.autoicons.values&&(n.autoicons.values=x(n.autoicons.values)),mapp.lib.ajax({type:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:n},callback:function(e){e&&"OK"==e.status&&window.location.reload()}})}}return g((function(){S.current&&new mapp.Map(w.helpers.demo_map,{sel:jQuery(S.current)}).display()}),[]),g((function(){mappl10n.options.engine!=w.engine&&N("save")}),[w.engine]),d("div",{className:"mapp-options"},d("form",{onSubmit:function(e){e.preventDefault(),N("save")}},d(a.Section,{title:__("Sample Map"),className:"mapp-demo-section"},d("div",{className:"mapp-options-demo",ref:S})),mappl10n.options.pro&&(!w.helpers.is_multisite||w.helpers.is_super_admin||w.helpers.is_main_site)&&d(a.Section,{title:__("License")},d(a.Option,{title:__("MapPress license key")},d(a.Input,{value:w.license,onChange:function(e){return P({license:e})},size:37,placeholder:__("Enter license to enable automatic updates")}),(m=d("a",{className:"mapp-license-status",href:"https://mappresspro.com/account",target:"_blank"},__("Get license")),w.license&&w.helpers.license_status?"active"==w.helpers.license_status?d("span",{className:"mapp-license-status"},d(k,{icon:"yes"}),__("Active")):d(h,null,d(O,{className:"mapp-options-check-license",isSecondary:!0,onClick:function(){return N("license-check")}},__("Check now")),d("div",null,d(k,{icon:"no"}),w.helpers.license_message)):m)),d(a.Checkbox,{title:__("Beta versions"),label:__("Enable updates for beta versions"),checked:w.betas,onChange:function(e){return P({betas:e})}})),d(a.Section,{title:__("Basic Settings")},d(a.Radios,{title:__("Mapping API"),options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:function(e){P({engine:e,geocoder:"google"==e?"google":""})},checked:w.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"==w.engine&&(u={},w.mapbox||(u={text:"Recommended: Mapbox provides great looking maps and an excellent geocoder",type:"warning"}),u.href="https://www.mapbox.com/help/define-access-token/",d(a.Input,{className:"mapp-option-mapbox",name:"mapbox",title:__("Mapbox access token"),value:w.mapbox,onChange:function(e){P({mapbox:e})},placeholder:__("Enter token to use Mapbox features"),help:u})),d(a.Input,{title:__("Google API key"),name:"apiKey",value:w.apiKey,onChange:function(e){P({apiKey:e})},placeholder:__("Enter key to use Google maps or geocoder"),size:50,help:{href:"https://mappresspro.com/mappress-faq/#toc-google-maps-api-keys"}}),"leaflet"==w.engine&&function(){var e=[{value:"nominatim",label:"Nominatim"},{value:"mapbox",label:"MapBox",disabled:!w.mapbox},{value:"google",label:"Google",disabled:!w.apiKey},{value:"",label:__("Algolia")}],t={};return""==w.geocoder?t={text:__("Algolia is discontinuing their geocoder in 2022."),type:"warning"}:"nominatim"==w.geocoder?t={text:__("Nominatim is free but inaccurate. Please consider using Mapbox or Google instead."),type:"warning"}:"google"!=w.geocoder||w.apiKey?"mapbox"!=w.geocoder||w.mapbox||(t={text:__("A Mapbox access token is required to use the Mapbox geocoder"),type:"error"}):t={text:__("A google API key is required to use the Google geocoder"),type:"error"},t.href="#toc-picking-a-geocoder",d(a.Option,{title:__("Geocoder")},d(a.Radios,{options:e,checked:w.geocoder,onChange:function(e){return P({geocoder:e})},help:t}))}()),d(a.Section,{title:__("Map Settings")},d(a.Checkboxes,{title:__("Post types"),values:w.postTypes,options:j(w.helpers.post_types),onChange:function(e){return P({postTypes:e})}}),d(a.Radios,{title:__("Automatic display"),options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:w.autodisplay,onChange:function(e){return P({autodisplay:e})}}),d(a.Radios,{title:__("Map alignment"),options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:w.alignment,onChange:function(e){return P({alignment:e})}}),d(a.Radios,{title:__("Directions"),checked:w.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:function(e){return P({directions:e})}}),d(a.Checkbox,{title:__("POI list"),checked:w.poiList,label:__("Show a list of POIs with each map"),onChange:function(e){return P({poiList:e})}}),mappl10n.options.pro&&d(a.Radios,{title:__("POI list layout"),checked:w.layout,options:[{value:"left",label:"Left of map"},{value:"inline",label:__("Below map")}],onChange:function(e){return P({layout:e})}}),d(a.Input,{title:__("Mini width"),value:w.mini,onChange:function(e){return P({mini:e})},size:3,label:__("Width (px) to hide the POI list")}),d(a.Checkbox,{title:__("Sort"),checked:w.sort,label:__("Sort POI list by title"),onChange:function(e){return P({sort:e})}}),"leaflet"==mappl10n.options.engine&&d(a.Checkbox,{title:__("Scroll wheel zoom"),checked:w.scrollWheel,label:__("Enable map zoom with mouse scroll wheel"),onChange:function(e){return P({scrollWheel:e})}})),mappl10n.options.pro&&d(a.Section,{title:__("Styled Maps")},d(a.Option,{title:__("Default style")},d("div",{className:"mapp-option-style"},d(r.m,{selected:w.style,onChange:function(e){P({style:e}),mappl10n.options.style=e}}),d("div",null,__('Replace the default "roadmap" or "streets" style'))))),d(a.Section,{title:__("POI Settings")},d(a.Select,{title:__("Default zoom"),label:__("Default zoom when displaying a single POI"),value:w.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(function(e){return{value:e,label:e}})),onChange:function(e){return P({poiZoom:e})}}),d(a.Checkbox,{title:__("Hover"),checked:w.tooltips,label:__("Open POIs on hover"),onChange:function(e){return P({tooltips:e})}}),d(a.Checkbox,{title:__("Open first POI"),checked:w.initialOpenInfo,onChange:function(e){return P({initialOpenInfo:e})},label:__("Open first POI")})),mappl10n.options.pro&&d(a.Section,{title:__("Icons")},d(a.Option,{title:__("Default icon")},d(o.MappIconPicker,{iconid:w.defaultIcon,onChange:function(e){mappl10n.options.defaultIcon=e,P({defaultIcon:e})}})),d(a.Option,{title:__("Icon directory")},d("code",null,w.helpers.icon_directory)),d(a.Option,{title:__("Highlight selected POI")},d(a.Radios,{checked:w.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:function(e){return P({highlight:e})}}),"icon"==w.highlight&&d(o.MappIconPicker,{defaultIcon:w.defaultIcon,iconid:w.highlightIcon,onChange:function(e){return P({highlightIcon:e})}})),(p=w.iconScale&&Array.isArray(w.iconScale)?i(w.iconScale):[0,0],d(a.Option,{title:__("Icon scaling")},d(a.Input,{value:p[0]?p[0]:"",onChange:function(e){e<=64&&(p[0]=e>0?e:"",P({iconScale:p}))},type:"number",min:0,max:64}),d("span",null," X "),d(a.Input,{value:p[1]?p[1]:"",onChange:function(e){e<=64&&(p[1]=e>0?e:"",P({iconScale:p}))},type:"number",min:0,max:64}),d("span",null," (px) "))),function(){var e=j(w.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});var t=v((function(e){if("post_type"==w.autoicons.key)return j(w.helpers.post_types);var t=wp.data.select("core").getEntityRecords("taxonomy",w.autoicons.key,{per_page:-1,_fields:"id,name,slug"});return t?t.map((function(e){return{value:e.slug,label:e.name}})):[]}),[w.autoicons.key]);return d(a.Option,{title:__("Automatic icons")},d(a.Select,{value:w.autoicons?w.autoicons.key:null,options:e,onChange:function(e){var t=w.autoicons?s({},w.autoicons):[];t.key=e,t.values=[],P({autoicons:t})},placeholder:""}),d(a.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:t},{id:"value",label:__("Icon"),type:"icon"}],data:w.autoicons.values,onChange:function(e){var t=w.autoicons?s({},w.autoicons):[];t.values=e,P({autoicons:t})}}))}()),d(a.Section,{title:__("Clustering")},d(a.Checkbox,{title:__("Clustering"),checked:w.clustering,label:__("Enable marker clustering"),onChange:function(e){return P({clustering:e})}}),function(){var e=w.clusteringOptions?w.clusteringOptions:{},t=function(t,n){e[t]=n,P({clusteringOptions:e})};if("google"==w.engine){return d("div",{className:"mapp-option-clustering-options"},d(a.Select,{help:{href:"https://github.com/googlemaps/v3-utility-library/blob/3fca406/packages/markerclustererplus/src/markerclusterer.ts"},label:d(h,null,__("Disable clustering at zoom"),d("code",null,"maxZoom")),onChange:function(e){return t("maxZoom",e)},options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(function(e){return{value:e,label:e}})),placeholder:__("None"),title:__("Max zoom"),value:e.maxZoom}))}var n="https://github.com/Leaflet/Leaflet.markercluster#all-options";return d("div",{className:"mapp-option-clustering-options"},d(a.Select,{help:{href:n},label:d(h,null,__("Disable clustering at zoom"),d("code",null,"disableClusteringAtZoom")),onChange:function(e){return t("disableClusteringAtZoom",e)},options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(function(e){return{value:e,label:e}})),placeholder:__("Auto"),title:__("Max zoom"),value:e.disableClusteringAtZoom}),d(a.Checkbox,{checked:e.spiderfyOnMaxZoom,help:{href:n},label:d(h,null,__("Spiderfy"),d("code",null,"spiderfyOnMaxZoom")),onChange:function(e){return t("spiderfyOnMaxZoom",e)},title:__("Spiderfy")}))}()),mappl10n.options.pro&&d(a.Section,{title:__("Mashups")},d(a.Option,{title:__("Filters")},d(a.MappGrid,{cols:[{id:"key",label:__("Taxonomy"),onRender:function(e){var t=j(w.helpers.taxonomies).map((function(t){return t.disabled=t.value!=e.value&&_.findWhere(w.filters,{key:t.value}),t}));return d(a.Select,{value:e.value,options:t,onChange:e.onChange,placeholder:""})}},{id:"sort",label:__("Sort"),onRender:function(e){return d(a.Select,{value:e.value,options:[{value:"name",label:__("Name")},{value:"slug",label:__("Slug")}],onChange:e.onChange})}},{id:"count",label:__("Show counts"),onRender:function(e){return d(a.Checkbox,{checked:e.value,onChange:e.onChange})}}],data:w.filters,onChange:function(e){P({filters:e})}})),(l=[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}],d(a.Radios,{title:__("Marker click"),checked:w.mashupClick,options:l,onChange:function(e){return P({mashupClick:e})}})),d(a.Radios,{title:__("Popup content"),checked:w.mashupBody,options:[{value:"poi",label:__("POI title + POI body")},{value:"post",label:__("Post title + post excerpt")}],onChange:function(e){return P({mashupBody:e})}}),d(a.Checkbox,{title:__("KMLs"),checked:w.mashupKml,label:__("Include KML POIs in mashups"),onChange:function(e){return P({mashupKml:e})}})),mappl10n.options.pro&&d(a.Section,{title:__("Mashup Search")},d(a.Checkbox,{title:__("Search"),checked:w.search,label:__("Enable search"),onChange:function(e){return P({search:e})}}),d(a.Select,{help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},title:__("Search radius"),label:__("Minimum search radius (km)"),value:w.radius,options:_.map([1,5,10,15,25,50,75,100,200,300],(function(e){return{value:e,label:e}})),onChange:function(e){return P({radius:e})}}),d(a.Select,{title:__("Search country"),label:__("Country code for searches"),value:w.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"],(function(e){return{value:e,label:e}})),onChange:function(e){return P({country:e})},help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}}),mappl10n.options.ssl?d(a.Checkbox,{title:__("User location"),checked:w.userLocation,label:__("Show user location on map"),onChange:function(e){return P({userLocation:e})}}):null,function(){if("google"!=w.engine)return d(a.Input,{onChange:function(e){return P({searchBox:e})},help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},label:__("Restrict searches to a bounding box (optional)"),title:__("Bounding box"),placeholder:"SW lon, SW lat, NE lng, NE lat",size:45,trim:!0,value:w.searchBox})}()),mappl10n.options.pro&&d(a.Section,{title:__("Geocoding")},d(a.Option,{title:__("Geocoding fields")},d(a.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:j(w.helpers.meta_fields)},{id:"value",label:__("Custom field"),type:"select",options:j(w.helpers.meta_keys)}],data:w.metaKeys,onChange:function(e){P({metaKeys:e})}})),d(a.Checkbox,{title:__("Overwrite"),label:__("Overwrite maps when posts are saved"),checked:w.metaSyncSave,onChange:function(e){P({metaSyncSave:e})}}),"google"==w.engine&&d(a.Input,{title:__("Google Server API key"),name:"apiKeyServer",value:w.apiKeyServer,onChange:function(e){return P({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"}}),(n=__("No errors found"),w.helpers.geocoding_errors&&w.helpers.geocoding_errors.length>0&&(n=_.map(w.helpers.geocoding_errors,(function(e){return d("div",{key:e.ID},d("a",{href:mappl10n.options.editurl+"?post="+e.ID+"&action=edit"},e.post_title),d("span",null," : "+e.error))}))),d(a.Option,{title:__("Geocoding errors")},n))),mappl10n.options.pro&&mappl10n.options.acfActive&&d(a.Section,{title:__("Frontend Forms")},d(a.Option,{title:__("Advanced Custom Fields")},d(a.Input,{className:"mapp-option-acf",name:"acf",value:w.acf,onChange:function(e){P({acf:e})},placeholder:__("ACF field"),size:20}),__("ACF map field to include on MapPress mashups"),d(a.Help,{text:__("To generate MapPress maps from ACF fields, leave this blank and use the Geocoding section"),href:"#"}))),mappl10n.options.pro&&d(a.Section,{title:__("Templates")},d(a.Option,{title:__("Custom templates")},d(a.MappTemplateEditor)),d(a.Option,{title:__("Mashup thumbnails")},d(a.Select,{label:__("Popups"),onChange:function(e){return P({thumbsPopup:e})},options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:w.thumbsPopup}),d(a.Select,{label:__("POI lists"),onChange:function(e){return P({thumbsList:e})},options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:w.thumbsList})),d(a.Option,{title:__("Thumbnail size")},d(a.Select,{onChange:function(e){return P({thumbSize:e})},options:j(w.helpers.thumbnail_sizes),value:w.thumbSize}),d("span",null," "+__("or")+" "),d(a.Input,{value:w.thumbWidth,onChange:function(e){return P({thumbWidth:e})},type:"number",min:0,max:9999}),d("span",null," X "),d(a.Input,{value:w.thumbHeight,onChange:function(e){return P({thumbHeight:e})},type:"number",min:0,max:9999}),d("span",null," (px) "))),d(a.Section,{title:__("Localization")},(t="leaflet"==w.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport",d(a.Select,{title:__("Language"),label:__("Language for searches and Google map controls"),value:w.language,options:j(w.helpers.languages),onChange:function(e){return P({language:e})},help:{href:t}})),d(a.Input,{title:__("Directions server"),value:w.directionsServer,onChange:function(e){return P({directionsServer:e})},size:25})),d(a.Section,{title:__("Miscellaneous")},d(a.Option,{title:__("Map sizes")},d(a.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:w.sizes,onChange:function(e,t){return P({sizes:e,size:t})},selectionColumn:"rowid",selected:w.size})),w.helpers.jetpack?null:d(a.Checkbox,{title:__("Scripts"),checked:w.footer,label:__("Output scripts in footer"),onChange:function(e){return P({footer:e})},help:{text:__("Disable footer scripts if maps are output using AJAX")}}),d(a.Checkbox,{title:"WPML",checked:w.wpml,label:__("Copy maps when overwriting a translation"),onChange:function(e){return P({wpml:e})},help:{href:"https://mappresspro.com/mappress-documentation#wpml"}}),d(a.Checkbox,{title:__("Compatiblity"),checked:w.deregister,label:__("Output maps in iframes to prevent compatibility issues"),onChange:function(e){return P({deregister:e})}})),d("div",{className:"mapp-options-toolbar"},d(O,{className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),d(O,{isSecondary:!0,onClick:function(){return N("reset")}},__("Reset Defaults")))))}document.getElementById("mapp-options-settings")&&wp.element.render(d(C),document.getElementById("mapp-options-settings"))},824:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Checkbox:()=>C,Checkboxes:()=>S,Help:()=>P,Input:()=>j,Radios:()=>N,Select:()=>M,Textarea:()=>I,Section:()=>A,Option:()=>E,MappGrid:()=>D,MappTemplateEditor:()=>T});var a=n(143);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var m=wp.element.createElement,d=wp.element,f=d.Fragment,h=d.useEffect,g=(d.useLayoutEffect,d.useCallback),b=(d.useRef,d.useState),y=(wp.data.useSelect,wp.components),v=y.Button,w=(y.ColorPicker,y.Dashicon),O=(y.Dropdown,y.ExternalLink,y.Modal),k=(y.Panel,y.PanelBody,y.PanelRow,y.Popover,y.RadioControl,y.Spinner,y.TabPanel),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function C(e){var t=e.checked,n=e.title,a=e.label,o=e.onChange,r=e.help,i=u(e,["checked","title","label","onChange","help"]),l=m(f,null,m("label",null,m("input",p({type:"checkbox",onChange:function(e){o&&o(e.target.checked)},checked:void 0!==t&&t},i)),a&&m("span",{className:"mapp-option-label"},a)),r&&m(P,r));return n?m(E,{title:n},l):l}function S(e){var t=m(f,null,_.map(e.options,(function(t,n){var a=e.values?e.values.indexOf(t.value):-1;return m(C,{key:n,label:t.label,value:t.value,checked:a>=0,onChange:function(n){var o=r(e.values);n&&-1==a&&e.onChange(o.concat(t.value)),!n&&a>=0&&(o.splice(a,1),e.onChange(o))}})})),e.help&&m(P,e.help));return e.title?m(E,{title:e.title},t):t}function P(e){var t="mapp-help-text";e.type&&(t+=" mapp-help-"+e.type);var n=null;return e.href&&(n="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),m(f,null,n&&m("a",{className:"mapp-help-link",href:n,target:"_blank"},m(w,{icon:"editor-help"})),e.text&&m("div",{className:t},e.text))}function j(e){var t=e.title,n=e.value,a=e.label,o=e.onChange,r=e.help,i=e.trim,l=e.type,s=u(e,["title","value","label","onChange","help","trim","type"]);if(!o)return"Missing onChange handler in Input component";i=void 0===i||i;var c=m(f,null,m("input",p({value:null!==n?n:"",onChange:function(e){return o(i?e.target.value.trim():e.target.value)},type:l||"text"},s)),a&&m("span",{className:"mapp-option-label"},a),r&&m(P,r));return t?m(E,{title:t},c):c}var x=function(e){var t=e.onChange,n=e.label,a=u(e,["onChange","label"]);return m("label",null,m("input",p({type:"radio",onChange:function(e){return t(e.target.value)}},a)),n&&m("span",{className:"mapp-option-label"},n))};function N(e){var t=m(f,null,_.map(e.options,(function(t,n){return m(x,{key:n,value:t.value,checked:e.checked==t.value,onChange:function(t){return e.onChange(t)},disabled:t.disabled,label:t.label})})),e.help&&m(P,e.help));return e.title?m(E,{title:e.title},t):t}function M(e){var t=e.title,n=e.value,a=e.label,o=e.onChange,i=e.options,l=e.help,s=e.placeholder,c=u(e,["title","value","label","onChange","options","help","placeholder"]),d=r(i);void 0!==s&&d.unshift({value:"",label:s});var h=m(f,null,m("select",p({value:null!=n?n:"",onChange:function(e){return o(e.target.value)}},c),_.map(d,(function(e,t){return m("option",{key:t,value:e.value,disabled:e.disabled},e.label)}))),a&&m("span",{className:"mapp-option-label"},a),l&&m(P,l));return t?m(E,{title:t},h):h}function I(e){var t=e.title,n=e.onChange,a=e.label,o=e.help,r=u(e,["title","onChange","label","help"]),i=m(f,null,m("textarea",p({onChange:function(e){return n(e.target.value)}},r)),a&&m("span",{className:"mapp-option-label"},a),o&&m(P,o));return t?m(E,{title:t},i):i}function A(e){var t=e.className?" "+e.className:"";return m("div",{className:"mapp-option-section"+t},m("h2",null,e.title),e.children)}function E(e){return m("div",{className:"mapp-option"},m("div",{className:"mapp-option-title"},e.title),m("div",{className:"mapp-option-value"},e.children))}function D(e){var t,n,i=o(b({dragging:null,dragover:null}),2),l=i[0],s=i[1];function c(e){s((function(t){return p(p({},t),e)}))}function u(t,n){var a=r(e.data);switch(t){case"add":var o={};_.map(e.cols,(function(e){o[e.id]=""})),a.push(o),e.onChange(a,e.selected);break;case"change":a[n.i][n.id]=n.value,e.onChange(a,e.selected);break;case"delete":var i;a.splice(n,1),i=n==e.selected?null:n<e.selected?e.selected-1:e.selected,e.onChange(a,i);break;case"select":c({selected:n}),e.onChange(a,n);break;case"sort":var s=l.dragging,p=s<p?n-1:n;a.splice(p,0,a.splice(s,1)[0]),e.onChange(a,p),c({dragover:null})}}return h((function(){}),[]),m("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&m("div",{className:"mapp-grid-table"},(t=e.selectionColumn?m("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,n=m("div",{className:"mapp-grid-cell",key:"actions"},""),m("div",{className:"mapp-grid-header"},m("div",{className:"mapp-grid-row"},t,_.map(e.cols,(function(e){return m("div",{className:"mapp-grid-cell",key:e.id},e.label)})),n))),m("div",{className:"mapp-grid-body"},_.map(e.data,(function(t,n){return function(t,n){return m("div",{className:"mapp-grid-row"+(l.dragover==n?" mapp-dragover":""),draggable:!0,key:n,onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return c({dragging:n})},onDragEnter:function(e){return c({dragover:n})},onDragEnd:function(e){return c({dragging:null,dragover:null})},onDrop:function(e){return u("sort",n)}},function(t,n){if(!e.selectionColumn)return null;var a,o;switch("rowid"==e.selectionColumn?a=n:t[e.selectionColumn]?a=t[e.selectionColumn]:o=!0,e.selectionType){case"checkbox":return m("div",{className:"mapp-grid-cell"},m(C,{value:a,checked:e.selected==a,disabled:o,onChange:function(e){u("select",e?a:null)}}));case"radio":default:return m("div",{className:"mapp-grid-cell"},m(x,{checked:e.selected==a,onChange:function(){return u("select",a)}}))}}(t,n),_.map(e.cols,(function(t,o){return m("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:n+"-"+o},function(t,n){if(n.onRender)return n.onRender({id:n.id,value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});switch(n.type){case"icon":return m(a.MappIconPicker,{iconid:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"input":default:return m(j,{size:e.data[t][n.size],value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"select":return m(M,{value:e.data[t][n.id],options:n.options,onChange:function(e){u("change",{i:t,id:n.id,value:e})},placeholder:""})}}(n,t))})),function(e){return m("div",{className:"mapp-grid-cell",key:"delete"},m(v,{icon:"trash",onClick:function(){return u("delete",e)}}))}(n))}(t,n)})))),m("div",{className:"mapp-grid-toolbar"},m(v,{isSecondary:!0,onClick:function(){return u("add")}},__("Add"))))}function T(e){var t=o(b({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null}),2),n=t[0],a=t[1];function r(e){a((function(t){return p(p({},t),e)}))}var i,l,s=g((function(e){if(null!=e){var t=wp.codeEditor.initialize(e);t.codemirror.setSize("auto","auto"),t.codemirror.setOption("readOnly","editor"!=n.tab),r({codeEditor:t})}}),[]);function c(e,t){switch(e){case"close":r({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&(mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_delete",name:n.template.name,nonce:mappl10n.options.nonce}}),r({isOpen:!1}));break;case"insert":var a=n.codeEditor.codemirror.getDoc(),o=a.getCursor();a.replaceRange("{{{poi."+t+"}}}",o);break;case"open":mapp.lib.ajax({type:"GET",data:{action:"mapp_tpl_get",name:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!0,name:t,tab:"editor",template:e.data.template,tokens:e.data.tokens})}});break;case"save":var i="editor"==n.tab?n.codeEditor.codemirror.getValue():n.template.content;mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_save",content:i,name:n.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!1,template:null,tokens:null})}});break;case"tab-select":if("editor"!=t){var l=p({},n.template);l.content=n.codeEditor.codemirror.getValue(),r({template:l})}r({tab:t})}}return m("div",{className:"mapp-templates"},(l=[{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")}],m("div",{className:"mapp-templates-list"},_.map(l,(function(e,t){return m("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:function(t){t.preventDefault(),c("open",e.name)}},e.label)})))),n.isOpen&&n.template?m(O,{title:(i=n.template.name+" ("+(n.template.exists?__("Custom"):__("New"))+")",m("div",{className:"mapp-templates-name"},i)),className:"mapp-templates-modal",onRequestClose:function(){return c("close")},shouldCloseOnClickOutside:!1},m(k,{className:"mapp-templates-tabs",onSelect:function(e){return c("tab-select",e)},tabs:[{name:"editor",title:__("Editor")},{name:"standard",title:__("Default")}]},(function(e){return t=m("div",{className:"mapp-templates-tokens"},_.map(n.tokens,(function(e,t){return m("code",{onClick:function(){return c("insert",e)},key:t,title:e},e)}))),a=m("div",{className:"mapp-templates-path"},n.template.path),m(f,null,"editor"==n.tab&&a,"editor"==n.tab&&t,m("div",{className:"editor"==n.tab?"mapp-templates-editor":"mapp-templates-standard"},m("textarea",{ref:s,defaultValue:"editor"==n.tab?n.template.content:n.template.standard})));var t,a})),m("div",{className:"mapp-templates-toolbar"},m(v,{isPrimary:!0,onClick:function(){return c("save")}},__("Save")),m(v,{isSecondary:!0,onClick:function(){return c("close")}},__("Cancel")),n.template.exists&&m("a",{onClick:function(e){e.preventDefault(),c("delete")}},__("Delete")))):null)}},149:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var a=wp.element.createElement,o=(wp.data.select,wp.element),r=(o.Fragment,o.useEffect,o.useLayoutEffect,o.useRef,o.useState,wp.components),i=(r.BaseControl,r.Button),sprintf=(r.Dashicon,r.Modal,r.PanelBody,r.RadioControl,r.Spinner,r.TextControl,wp.i18n.sprintf);function l(e){function t(t,n){var a=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(a);break;case"next":e.onChange(e.page+1);break;case"prev":e.onChange(e.page-1)}}return o=Math.ceil(e.count/e.pageSize),r=e.page<=1,l=e.page>=o,a("div",{className:"mapp-paginate"},a(i,{disabled:r,onClick:function(){return t("first")},isSecondary:!0},"«"),a(i,{disabled:r,onClick:function(){return t("prev")},isSecondary:!0},"‹"),a("div",{className:"mapp-paginate-count"},sprintf((n="%d of %d",wp.i18n.__(n,"mappress-google-maps-for-wordpress")),e.page,o)),a(i,{disabled:l,onClick:function(){return t("next")},isSecondary:!0},"›"),a(i,{disabled:l,onClick:function(){return t("last")},isSecondary:!0},"»"));var n,o,r,l}},477:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>P});var a=n(713),o=n(999),r=n(149);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var u=window.mapp||{},m=wp.element.createElement,d=wp.data.select,f=wp.element,h=(f.Fragment,f.useEffect),g=(f.useLayoutEffect,f.useRef),b=f.useState,y=wp.components,v=(y.BaseControl,y.Button),w=y.Dashicon,O=y.Modal,k=(y.PanelBody,y.RadioControl),C=y.Spinner,S=y.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function P(e){var t=p(b({isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:"",type:mappl10n.options.postid?"post":"all"}),2),n=t[0],i=t[1],s=g(null),c=g(null);function f(e){i((function(t){return l(l({},t),e)}))}function y(t,a){switch(t){case"attach":u.store.mutateMap({mapdata:a});break;case"add-new":f({mode:"edit",mapid:null});break;case"change-type":f({type:a});break;case"close":e.onAction("pick-close");break;case"duplicate":u.store.duplicateMap({mapid:a,success:function(e){alert(__("Map copied")),f({mapid:e.mapid}),jQuery(".mapp-pick-items").scrollTop(0)}});break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(u.store.destroyMap({mapid:a}),a==n.mapid&&e.onAction("pick-destroy",a)),s.current.focus();break;case"edit":f({mode:"edit",mapid:a});break;case"edit-close":"edit"==e.mode?e.onAction("pick-close"):f({mode:"list"});break;case"edit-destroy":f({mode:"list",mapid:null}),e.onAction("pick-destroy",a);break;case"edit-save":"edit"==e.mode?e.onAction("pick-close",a):f({mode:"list",mapid:a});break;case"insert":e.onAction("pick-insert",a);break;case"shortcode":e.onAction("pick-shortcode",a);break;case"sort":u.store.setSort({sortBy:a,sortAsc:u.store.state.sortBy!=a||!u.store.state.sortAsc})}}function P(t){var o,r=t.mapid==n.mapid;o=t.map_title?t.map_title:__("Untitled");var i=function(t){var n;return n=(n="map"==e.context||"mashup"==e.context&&t.postid==mappl10n.options.postid?d("core/editor").getEditedPostAttribute("title"):t.post_title)||__("Untitled"),t.postid>0&&t.postid==mappl10n.options.postid&&(n=__("Current post")),t.postid>0?t.postid==mappl10n.options.postid?n:m("a",{href:mappl10n.options.editurl+"?post="+t.postid+"&action=edit",target:"_blank",title:__("Edit post")},n):__("Unattached")}(t),l=[{action:"edit",label:__("Edit")},{action:"insert",label:__("Insert into post")},{action:"duplicate",label:__("Copy")},{action:"shortcode",label:__("Shortcode")},{action:"destroy",label:__("Delete")}];"library"==e.context?l.splice(1,1):l.splice(3,1),l=m("div",{className:"mapp-pick-actions"},l.map((function(e){return m("a",{href:"#",key:e.action,onClick:function(n){n.stopPropagation(),n.preventDefault(),y(e.action,t.mapid)}},e.label)})));var s=null;return s=t.postid>0?m("a",{href:"#",onClick:function(){return y("attach",{mapid:t.mapid,postid:0})}},__("Detach")):"library"==e.context?m(a.default,{onChange:function(e,n){return y("attach",{mapid:t.mapid,postid:e,post_title:n})}},__("Attach")):m("a",{href:"#",onClick:function(){return y("attach",{mapid:t.mapid,postid:mappl10n.options.postid,post_title:null})}},__("Attach")),m("div",{className:"mapp-pick-item"+(r?" mapp-selected":""),key:t.mapid+"|"+t.postid,ref:r?c:null},m("div",{className:"mapp-pick-col-map_title",onClick:function(e){return y("edit",t.mapid)}},m("div",null,o),m("div",null,l)),m("div",{className:"mapp-pick-col-mapid"},t.mapid),m("div",{className:"mapp-pick-col-post_title"},i,m("div",null,s)))}h((function(){var e=function(e){f({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return u.store.subscribe(e),function(){return u.store.unsubscribe(e)}})),h((function(){s.current&&s.current.focus(),u.store.fetchItems()}),[]),h((function(){f({page:1})}),[n.type,n.search]),h((function(){c.current&&u.lib.scrollTo(jQuery(".mapp-pick-items"),jQuery(c.current))}),[n.type,n.items]);var j=_.filter(n.items,(function(t){if("post"==n.type&&t.postid!=mappl10n.options.postid)return!1;if("current"==n.type&&t.mapid!=e.mapid)return!1;var a=n.search.toLowerCase();return!a||(t.mapid.indexOf(a)>=0||(!!(t.post_title&&t.post_title.toLowerCase().indexOf(a)>=0)||!!(t.map_title&&t.map_title.toLowerCase().indexOf(a)>=0)))})),x=m("div",{className:"mapp-list-panel"},m("div",{className:"mapp-gt-modal-header"},m("div",{className:"mapp-gt-modal-header-title"},m("h1",null,__("Select a map")),m(v,{isPrimary:!0,onClick:function(){return y("add-new")}},__("Add New"))),m(v,{onClick:function(){return y("close")},icon:"no-alt"})),function(){var t=[{label:__("Attached to post"),value:"post"},{label:__("All maps"),value:"all"}];e.mapid&&t.unshift({label:__("Current map"),value:"current"});var a="library"==e.context?null:m(k,{className:"mapp-pick-type",options:t,onChange:function(e){return y("change-type",e)},selected:n.type}),o=n.isFetchingItems||n.isAttaching&&"library"!=e.context;return m("div",{className:"mapp-pick-filter"},o&&m(C,null),m(S,{ref:s,className:"mapp-pick-search",tabIndex:1,label:__("Search"),placeholder:__("post title, map title, or map id"),onChange:function(e){return f({search:e})}}),a)}(),function(e){if(e){var t=20*(n.page-1),a=t+20;e=e.slice(t,a)}var o,r="";return r=n.isFetchingItems?null:e.length?_.map(e,P):m("div",{className:"mapp-pick-message"},__("No maps found")),m("div",{className:"mapp-pick-items-section"},m("div",{className:"mapp-pick-items"},(o={map_title:__("Map title"),mapid:__("Map ID"),post_title:__("Attached to")},m("div",{className:"mapp-pick-items-header"},_.map(o,(function(e,t){return m("div",{className:"mapp-pick-col-"+t,onClick:function(){return y("sort",t)},key:t},e,u.store.state.sortBy==t&&m(w,{icon:u.store.state.sortAsc?"arrow-up":"arrow-down"}))})))),r))}(j),function(e){return m("div",{className:"mapp-pick-toolbar"},function(e){return e&&e.length?m(r.Z,{count:e?e.length:0,onChange:function(e){return f({page:e})},page:n.page,pageSize:20}):null}(e))}(j)),N=null;if("edit"==n.mode){var M=m("div",{className:"mapp-edit-panel"},m(o.default,{context:e.context,mapid:n.mapid,onAction:y}));N="library"==e.context?m(O,{className:"mapp-gt-modal",isDismissible:!1},M):M}var I="mapp-pick mapp-mode-"+n.mode+" mapp-context-"+e.context;return"library"==e.context?m("div",{className:I},x,N):m(O,{className:"mapp-gt-modal "+I,isDismissible:"list"==n.mode,onRequestClose:function(){return y("close")},shouldCloseOnEsc:"list"==n.mode,shouldCloseOnClickOutside:"list"==n.mode},x,N)}},429:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappSettings:()=>y});var a=n(710);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}window.mapp;var i=wp.element.createElement,l=wp.element,s=l.Fragment,p=(l.useEffect,l.useLayoutEffect,l.useRef,l.useState),c=wp.components,u=c.BaseControl,m=c.Button,d=c.ButtonGroup,f=(c.Dashicon,c.Dropdown,c.Panel,c.PanelBody),h=c.PanelRow,g=(c.RadioControl,c.SelectControl),b=c.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function y(e){var t,n=o(p({}),2);n[0],n[1];function r(e){if(!e||"string"!=typeof e)return e;var t={px:2048,vw:100,vh:100,"%":100},n=parseInt(e),a=2048,o="";for(var r in t)e.includes(r)&&(o=r,a=t[r]);return n>a?a+o:e}function l(t,n){var a=null;switch(t){case"poiList":e.map.set({poiList:n}),a={poiList:n};break;case"size":n.hasOwnProperty("height")&&(n.height=r(n.height)),n.hasOwnProperty("width")&&(n.width=r(n.width)),e.map.setSize(n),a=n;break;case"style-set-maptypeid":e.map&&e.map.set({mapTypeId:n}),a={mapTypeId:n};break;case"viewport-reset":e.map.center=e.map.zoom=null,e.map.recenter(),a={center:void 0,zoom:void 0};break;case"viewport-set":var o=e.map.getCenter().toJSON();e.map.center=o,e.map.zoom=e.map.getZoom(),a={center:o.lat+","+o.lng,zoom:e.map.getZoom()},"mce"==e.context||"library"==e.context?alert(__("Viewport set")):wp.data.dispatch("core/notices").createNotice("success",__("Viewport set"),{type:"snackbar",isDismissible:!0})}a&&e.onAction("change-settings",a)}return i("div",{className:"mapp-settings"},i(f,{title:__("Map settings")},(t=e.map.title?e.map.title:__("Untitled"),i(h,null,"map"==e.context&&i(u,{className:"mapp-settings-title"},t),i(u,{className:"mapp-settings-id",label:__("Map ID")},e.map.mapid))),function(){if("mashup"==e.context)return i(h,{className:"mapp-style-toggle"},__("Style"),i(a.m,{map:e.map,selected:e.map.mapTypeId,onChange:function(e){return l("style-set-maptypeid",e)}}))}(),function(){var t=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=mappl10n.options.sizes.map((function(e,t){return{label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1}}));n.unshift({height:"",label:__("Default"),value:0,width:""}),n.push({label:__("Custom"),value:"custom",disabled:!0});for(var a="custom",o=0;o<n.length-1;o++)n[o].width==e.width&&n[o].height==e.height&&(a=o);return i(s,null,i(g,{className:"mapp-settings-dims-select",help:"",label:__("Size"),value:a,options:n,onChange:function(e){return l("size",{width:n[e].width,height:n[e].height})}}),i(h,null,i(b,{className:"mapp-settings-dims-custom",help:__("px, %, vw"),label:__("Width"),onChange:function(e){return l("size",{width:e})},placeholder:t.width,value:e.width?e.width:""}),i(b,{className:"mapp-settings-dims-custom",help:__("px, %, vh"),label:__("Height"),onChange:function(e){return l("size",{height:e})},placeholder:t.height,value:e.height?e.height:""})))}(),(e.center&&(e.center.lat,e.center.lng,__("Zoom"),e.zoom),i(s,null,i(u,{className:"mapp-settings-viewport",label:__("Center/Zoom")},i(d,{label:__("Center/Zoom")},i(m,{onClick:function(){return l("viewport-reset")},isPressed:!e.center,isSmall:!0},__("Automatic")),i(m,{onClick:function(){return l("viewport-set")},isPressed:e.center,isSmall:!0},__("Set"))))))))}},787:()=>{function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var r=window.mapp||{};r.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"map_title",sortAsc:!0,maps:{},items:[]}},r.Store.prototype={createMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t;this.state.isFetchingMap=!1,this.publish(),n()},destroyMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;r.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(delete l.state.maps[t],l.destroyItem(t),a(t)):i(),l.publish()}})},duplicateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_duplicate",mapid:t,postid:mappl10n.options.postid,nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),a(t)}else i();l.state.isSavingMap=!1,l.publish()}})},fetchMap:function(e){var t=e.mapid,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;if(void 0!==this.state.maps[t])return l.publish(),void a(this.state.maps[t]);this.state.isFetchingMap=!0,l.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(l.state.maps[t]=e.data,a(e.data)):i(),l.state.isFetchingMap=!1,l.publish()}})},mutateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;this.state.isSavingMap=!0,this.saveItem(t),this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_mutate",mapdata:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(l.state.maps[e.data.mapid]=e.data,a(t)):i(),l.state.isSavingMap=!1,l.publish()}})},saveMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(t),nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),a(t)}else i();l.state.isSavingMap=!1,l.publish()}})},destroyItem:function(e){var t=this.state.items?this.state.items:[],a=_.findIndex(t,{mapid:e});a>-1&&t.splice(a,1),this.state.items=n(t),this.publish()},fetchItems:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t,a=e.failure,o=void 0===a?function(){}:a,i=this;if(this.state.itemsFetched)return n(this.state.items),void i.publish();this.state.isFetchingItems=!0,i.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(i.state.items=e.data,i.sort(),n(i.state.items),i.state.itemsFetched=!0):o(),i.state.isFetchingItems=!1,i.sort(),i.publish()}})},saveItem:function(n){var a=this.state.items?this.state.items:[],o=_.findWhere(a,{mapid:n.mapid});o?(o.mapid=void 0!==n.mapid?n.mapid:o.mapid,o.map_title=void 0!==n.title?n.title:o.map_title,o.postid=void 0!==n.postid?n.postid:o.postid,o.post_title=void 0!==n.post_title?n.post_title:o.post_title,o=function(n){for(var a=1;a<arguments.length;a++){var o=null!=arguments[a]?arguments[a]:{};a%2?e(Object(o),!0).forEach((function(e){t(n,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({},o)):(o={mapid:n.mapid,map_title:n.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){var n,a=this,o=(n="untitled",wp.i18n.__(n,"mappress-google-maps-for-wordpress"));this.state.items.sort((function(e,t){return function(e,t,n,a){if(a=a?1:-1,"mapid"==n)return a*(Number(e.mapid)-Number(t.mapid));var r=e[n]?e[n]:o,i=t[n]?t[n]:o,l=a*r.localeCompare(i);return 0==l?Number(e.mapid)-Number(t.mapid):l}(e,t,a.state.sortBy,a.state.sortAsc)}))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){var e,t=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(_e){throw _e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw i}}}}(n(this.subs));try{for(t.s();!(e=t.n()).done;){(0,e.value)(this.state)}}catch(e){t.e(e)}finally{t.f()}}},r.store=new r.Store},710:(e,t,n)=>{"use strict";n.d(t,{m:()=>w});var a=n(824),o=n(149);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=wp.element.createElement,u=wp.element,m=u.Fragment,d=(u.useEffect,u.useLayoutEffect,u.useRef,u.useState),f=wp.components,h=f.Button,g=(f.Dashicon,f.ExternalLink),b=f.Icon,y=f.Modal,v=(f.Panel,f.PanelBody,f.PanelRow,f.Spinner),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function w(e){var t,n,r,l,p,u,f,w=s(d({apiKey:"6a0cfe9e-3670-4598-a63e-f1627b5c9e56",snazzyPagination:null,snazzySearch:"",snazzyStyles:null,isOpen:!1,isSaving:!0,isSearching:!1,json:"",map:null,mapboxError:"",mapboxId:"",mapboxName:"",mapboxUser:"",mapboxUrl:"",mapboxParsedUrl:"",mode:"pick",page:1,style:mappl10n.options.style,standardStyles:mappl10n.options.standardStyles,userStyles:mappl10n.options.userStyles}),2),O=w[0],k=w[1];function C(e){k((function(t){return i(i({},t),e)}))}function S(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=_.findIndex(O.userStyles,{id:t.id});if(a>=0){if(!n&&!confirm(__("Style already exists, overwrite?")))return;mappl10n.options.userStyles[a]=t}else mappl10n.options.userStyles.push(t);C({isOpen:!1,mode:"pick",userStyles:mappl10n.options.userStyles,selected:t.id}),e.onChange(t.id),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",settings:"leaflet"==mappl10n.options.engine?{stylesMapbox:mappl10n.options.userStyles}:{stylesGoogle:mappl10n.options.userStyles},nonce:mappl10n.options.nonce},callback:function(e){}})}function P(e){C({isSearching:!0,snazzyStyles:null}),mapp.lib.ajax({type:"GET",data:{sort:"popular",page:e,pageSize:20,text:O.snazzySearch,key:O.apiKey},url:"https://snazzymaps.com/explore.json",callback:function(e){(C({isSearching:!1,snazzyPagination:e&&e.pagination?e.pagination:null}),e&&e.styles)?C({snazzyStyles:_.map(e.styles,(function(e,t){return e.id=e.id+"",e}))}):alert("Error: unable to fetch styles")}})}function j(e,t){t="large"==t||"small"==t?t:"small",t=800;var n=mappl10n.options.baseurl+"/images/roadmap.png";return"leaflet"==mappl10n.options.engine?mappl10n.options.mapbox?e.user&&e.mapboxid&&(n="https://api.mapbox.com/styles/v1/"+e.user+"/"+e.mapboxid+"/static/-122.4194,37.7749,10,0/800x800?access_token="+mappl10n.options.mapbox):n=mappl10n.options.baseurl+"/images/osm.png":e.imageUrl&&(n=e.imageUrl),c("img",{src:n,title:e.name})}function x(t,n){switch(t){case"close":C({isOpen:!1});break;case"json-cancel":C({mode:"pick"});break;case"json-change":C({json:n});break;case"json-save":var a=_.findWhere(O.userStyles,{id:e.selected});a&&(a.json=JSON.stringify(JSON.parse(O.json)),S(a,!0));break;case"mapbox-cancel":C({mode:"pick"});break;case"mapbox-change-url":var o,r,i=n.trim().toLowerCase().replace(".html","").replace("https://api.mapbox.com/styles/v1/","").replace("mapbox://styles/","").split("?")[0].split("/");2==i.length&&(o=i[0],r=i[1]),C({mapboxUrl:n,mapboxUser:o,mapboxId:r});break;case"mapbox-save":O.mapboxName&&O.mapboxUser&&S({id:O.mapboxId,name:O.mapboxName,mapboxid:O.mapboxId,provider:"mapbox",url:O.mapboxUrl,user:O.mapboxUser});break;case"mode":C({mode:n});break;case"open":"leaflet"!=mappl10n.options.engine||mappl10n.options.mapbox?C({isOpen:!0}):alert(__("Please enter a Mapbox access token in the MapPress settings screen."));break;case"pick-add":alert(__("Please upgrade to MapPress Pro to use custom styles"));break;case"pick-cancel":C({isOpen:!1});break;case"pick-delete":confirm(mappl10n.delete_prompt)&&function(t){var n=_.findIndex(O.userStyles,{id:t});if(n<0)mapp.lib.alert("Invalid delete");else{var a=O.userStyles;a.splice(n,1),mappl10n.options.userStyles=a,C({userStyles:a}),e.selected==t&&e.onChange(null),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",settings:"leaflet"==mappl10n.options.engine?{stylesMapbox:a}:{stylesGoogle:a},nonce:mappl10n.options.nonce},callback:function(e){}})}}(n);break;case"pick-edit":e.onChange(n.id),"leaflet"==mappl10n.options.engine?C({mode:"mapbox",mapboxId:n.mapboxid,mapboxName:n.name,mapboxUrl:n.url,mapboxUser:n.user}):C({json:n.json,mode:"json"});break;case"pick-select":e.onChange(n.id),C({isOpen:!1});break;case"snazzy-cancel":C({mode:"pick"});break;case"snazzy-save":var l=n;l&&S({id:l.id,imageUrl:l.imageUrl,json:l.json,name:l.name});break;case"snazzy-search":P()}}function N(e){var t;return t=e.styles&&e.styles.length?_.map(e.styles,(function(t,n){return function(e,t){var n="mapp-style"+(t.selected==e.id?" mapp-selected":""),a=t.onDelete?c(b,{icon:"trash",onClick:function(){return t.onDelete(e.id)}}):null,o=t.onEdit?c("a",{onClick:function(){return t.onEdit(e)}},__("Edit")):null;return c("div",{className:n,key:e.id},c("div",{className:"mapp-style-image",onClick:function(){return t.onSelect(e)}},j(e)),c("div",{className:"mapp-style-details"},c("div",{className:"mapp-style-title"},e.name),c("div",{className:"mapp-style-actions"},o,a)))}(t,e)})):O.isSearching?"":c("div",{className:"mapp-style-list-msg"},__("No results")),c("div",{className:"mapp-style-list-wrapper"},c("div",{className:"mapp-style-list-header"},e.title),c("div",{className:"mapp-style-list"},t))}return c(m,null,(p=O.standardStyles.concat(O.userStyles),u=!mappl10n.options.style||"roadmap"!=e.selected&&"streets"!=e.selected&&e.selected?e.selected:mappl10n.options.style,f=(f=_.findWhere(p,{id:u}))||O.standardStyles[0],c(h,{className:"mapp-style-toggle",icon:j(f),iconSize:75,isSecondary:!0,onClick:function(){return x("open",null)},title:f.name})),"edit"==O.mode&&O.isOpen&&renderEdit(),"json"==O.mode&&O.isOpen&&function(){var e,t,n;try{e=JSON.parse(O.json),t=JSON.stringify(e,null,2)}catch(e){n=e.toString(),t=O.json}var a=n?"mapp-style-json mapp-style-error":"mapp-style-json";return c(y,{title:__("Edit style JSON"),className:"mapp-style-modal",onRequestClose:function(){return x("json-cancel")},shouldCloseOnClickOutside:!0},c("div",{className:a},c("textarea",{value:t,spellCheck:!1,onChange:function(e){return x("json-change",e.target.value)}})),c("div",{className:"mapp-style-json-error"},n||""),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{disabled:n,isPrimary:!0,onClick:function(){return x("json-save")}},__("Save")),c(h,{onClick:function(){return x("json-cancel")}},__("Cancel")))))}(),"mapbox"==O.mode&&O.isOpen&&(r=O.mapboxUser&&O.mapboxId?j({user:O.mapboxUser,mapboxid:O.mapboxId,name:O.mapboxName},"large"):null,l=!O.mapboxUser||!O.mapboxId||!O.mapboxName,c(y,{title:__("Add style"),className:"mapp-style-modal",onRequestClose:function(){return x("mapbox-cancel")},shouldCloseOnClickOutside:!0},c("div",{className:"mapp-style-mapbox-title"},__("Enter style from Mapbox Studio"),c(g,{href:"https://studio.mapbox.com"})),c("form",{className:"mapp-style-mapbox-form",onSubmit:function(e){e.stopPropagation(),e.preventDefault(),x("mapbox-save",O.snazzySelected)}},c("label",null,c("span",{className:"mapp-style-mapbox-label"},__("MapBox Share URL")),c(a.Help,{href:"#toc-mapbox-studio-styles"}),c(a.Input,{autoFocus:!0,className:"mapp-style-mapbox-url",value:O.mapboxUrl,onChange:function(e){return x("mapbox-change-url",e)}})),c("label",null,c("div",{className:"mapp-style-mapbox-label"},__("Style name")),c(a.Input,{className:"mapp-style-mapbox-name",value:O.mapboxName,onChange:function(e){return C({mapboxName:e})}})),c("div",{className:"mapp-style-mapbox-preview"},r),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{isPrimary:!0,disabled:l,type:"submit"},__("Save")),c(h,{onClick:function(){return x("mapbox-cancel")}},__("Cancel"))))))),"pick"==O.mode&&O.isOpen&&(n="",O.userStyles&&O.userStyles.length&&(n=N({selected:e.selected,onEdit:function(e){return x("pick-edit",e)},onDelete:function(e){return x("pick-delete",e)},onSelect:function(e){return x("pick-select",e)},styles:O.userStyles,title:__("Custom styles")})),c(y,{title:c("div",{className:"mapp-style-header"},__("Select a style")),className:"mapp-style-modal",onRequestClose:function(){return x("close")}},c("div",{className:"mapp-style-list-wrapper"},N({onSelect:function(e){return x("pick-select",e)},selected:e.selected,styles:O.standardStyles,title:__("Standard styles")}),n),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{isPrimary:!0,onClick:function(){return x("pick-add")}},__("New style")),c(h,{onClick:function(){return x("pick-cancel")}},__("Cancel")))))),"snazzy"==O.mode&&O.isOpen&&(O.snazzySelected,c(y,{title:__("Download style"),className:"mapp-style-modal mapp-style-modal-snazzy",onRequestClose:function(){return x("snazzy-cancel")},shouldCloseOnClickOutside:!0},c("form",{className:"mapp-style-snazzy-form",onSubmit:function(e){x("snazzy-search"),e.preventDefault()}},c(a.Input,{className:"mapp-style-snazzy-search",value:O.search,placeholder:__("Search"),onChange:function(e){return C({snazzySearch:e})}}),O.isSearching&&c(v,null),!O.isSearching&&c(h,{isPrimary:!0,icon:"search",onClick:function(){return x("snazzy-search")}})),N({selected:O.snazzySelected,styles:O.snazzyStyles,onSelect:function(e){return x("snazzy-save",e)}}),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{onClick:function(){return x("snazzy-cancel")}},__("Cancel"))),(t=O.snazzyPagination)&&O.snazzyStyles&&O.snazzyStyles.length?c(o.Z,{count:t.totalItems,onChange:function(e){return P(e)},page:t.currentPage,pageSize:t.pageSize}):null))))}},214:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappCard:()=>w});n(824);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=c.useEffect,d=(c.useLayoutEffect,c.useCallback,c.useRef),f=c.useState,h=(wp.data.useSelect,wp.components),g=h.Button,b=h.Dashicon,y=h.ExternalLink,v=h.Guide,__=(h.Modal,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function w(e){var t=e.icon,n=e.title,a=s(e,["icon","title"]);return p("div",{className:"mapp-support-card"},n&&p("div",{className:"mapp-support-card-title"},p("h3",null,t&&p(b,{icon:t}),n)),p("div",{className:"mapp-support-card-content"},a.children))}document.getElementById("mapp-support-page")&&wp.element.render(p((function(e){var t=i(f({engine:e.engine?e.engine:"leaflet",isOpen:e.isOpen,apiKey:e.apiKey,mapbox:e.mapbox}),2),n=t[0],a=t[1];function r(e){a((function(t){return o(o({},t),e)}))}function l(e){return p("div",{className:"mapp-guide-engine"+(e.selected?" mapp-selected":""),onClick:function(){return e.onClick()}},p("h2",{className:"mapp-guide-engine-title"},e.title),p("div",{className:"mapp-guide-engine-content"},e.content))}return d(null),m((function(){}),[]),p("div",{className:"mapp-support"},p(u,null,p("div",{className:"mapp-support-section"},p("div",{className:"mapp-support-header"},p("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),p("h1",null,__("Welcome to MapPress")),p("i",null,__("Build amazing maps with the easiest and most powerful mapping plugin available")),p("div",null,p("p",null,__("Get started with the setup wizard:"),p(g,{className:"mapp-support-guide-toggle",isPrimary:!0,onClick:function(){return r({isOpen:!0})}},__("Open Wizard")))))),p("div",{className:"mapp-support-section"},p("div",{className:"mapp-support-cards"},p(w,{icon:"book",title:__("Documentation")},p("p",null,__("Detailed plugin documentation:")),p(y,{href:"https://mappresspro.com/mappress-documentation/"},__("Documentation")),p(y,{href:"https://mappresspro.com/whats-new/"},__("What's new")),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Creating your first map"))),p(w,{icon:"warning",title:__("Troubleshooting")},p("p",null,p("b",null,__("Check for a plugin or theme conflict:"))),p("ol",null,p("li",null,__("Deactivate ALL other plugins")),p("li",null,__("Switch to a standard WordPress theme")),p("li",null,__("If the maps are working, reactivate one by one to find the conflict."))),p("p",null,__("For more info:")),p(y,{href:"https://mappresspro.com/mappress-faq/"},__("MapPress FAQ"))),p(w,{icon:"megaphone",title:__("Support")},p("p",null,__("Need some help?")),p(y,{href:"https://mappresspro.com/forums/forum/mappress-support/"},__("Support forum")),p(y,{href:"https://mappresspro.com/chris-contact/"},__("Contact")))))),function(){if(n.isOpen)return p(v,{className:"mapp-guide",onFinish:function(){return function(e,t){switch(e){case"save":r({isOpen:!1}),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",nonce:mappl10n.options.nonce,settings:{engine:n.engine,apiKey:n.apiKey,mapbox:n.mapbox}},callback:function(e){"OK"!=e.status&&alert("Unable to save settings. Please check the support troubleshooting guide.")}})}}("save")},pages:[{content:p("div",{className:"mapp-guide-page mapp-guide-engines"},p("h1",null,__("Choose a Mapping API")),p("p",null,__("MapPress supports both Leaflet and Google mapping APIs."),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-picking-a-mapping-api"},__("Learn more"))),p("div",{className:"mapp-guide-engines"},l({onClick:function(){return r({engine:"leaflet"})},selected:"leaflet"==n.engine,title:"Leaflet",content:p("ul",null,p("li",null,__("No API key")),p("li",null,__("Free unlimited usage")),p("li",null,__("Good functionality")),p("li",null,__("Best for high traffic sites")))}),l({onClick:function(){return r({engine:"google"})},selected:"google"==n.engine,title:"Google",content:p("ul",null,p("li",null,__("API key required")),p("li",null,__("Limited free usage")),p("li",null,__("Excellent functionality")),p("li",null,__("Best for low traffic sites")))}))),image:p("div",{className:"mapp-guide-image mapp-guide-image-small"},p("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}))},{content:"google"==n.engine?p("div",{className:"mapp-guide-page mapp-guide-apikey"},p("h1",null,__("Get a Google API Key")),p("p",null,__("Google requires an API key and billing information.")),p("p",null,__("Use the button below to get an API key with the correct mapping libraries selected"),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-google-api-keys"},__("Learn more"))),p(g,{isPrimary:!0,href:"https://console.cloud.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend,places_backend,geolocation,static_maps_backend&keyType=CLIENT_SIDE&reusekey=true",target:"_blank"},__("Get API Key")),p("input",{className:"mapp-guide-apikey",onChange:function(e){return r({apiKey:e.target.value})},placeholder:__("Enter your API key here"),value:n.apiKey})):p("div",{className:"mapp-guide-page mapp-guide-apikey"},p("h1",null,__("Sign up with Mapbox")),p("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."),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-using-mapbox-with-leaflet"},__("Learn more"))),p(g,{isPrimary:!0,href:"https://account.mapbox.com/auth/signup/",target:"_blank"},__("Get Mapbox Access Token")),p("input",{className:"mapp-guide-apikey",onChange:function(e){return r({mapbox:e.target.value})},placeholder:__("Enter your access token here"),value:n.mapbox})),image:p("div",{className:"mapp-guide-image mapp-guide-image-small"},p("img",{src:mappl10n.options.baseurl+"/images/mapbox_logo_white.png"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-gutenberg"},p("h1",null,__("Maps in the Block Editor")),p("p",null,__("MapPress provides custom block types for the Gutenberg editor.")),p("p",null,__("Just insert a MapPress Map block to get started."),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-gutenberg-block-editor"},__("Learn more")))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/gutenberg_map_block.gif"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-classic"},p("h1",null,__("Maps in the Classic Editor")),p("p",null,__('MapPress also supports the "classic" editor. Just click the MapPress button to open the map library.')),p("p",null,p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-classic-editor"},__("Learn more")))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/classic_map.gif"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-library"},p("h1",null,__("Map Library")),p("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.")),p("p",null,p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Learn more")))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/library_menu.gif"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-end"},p("h1",null,__("Happy Mapping")),p("p",null,__("Enjoy the plugin! Replay this guide any time from the MapPress support menu."))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/icon-128x128"}))}]})}())}),mappress_support_state),document.getElementById("mapp-support-page"))},308:(e,t,n)=>{"use strict";e.exports=function(e,t){var a,o,r,i,l,s,p,c,u,m,d,f,h,g=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),b=g.length,y=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},v="undefined"!=typeof window?window:n.g;v.$locutus=v.$locutus||{};var w=v.$locutus;for(w.php=w.php||{},t||(t=v),a=0;a<b&&(u=y((c=g[a].split("="))[0]),m=c.length<2?"":y(c[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));a++){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(f=[],d=0,o=0;o<u.length;o++)if("["!==u.charAt(o)||d){if("]"===u.charAt(o)&&d&&(f.length||f.push(u.slice(0,d-1)),f.push(u.substr(d,o-d)),d=0,"["!==u.charAt(o+1)))break}else d=o+1;for(f.length||(f=[u]),o=0;o<f[0].length&&(" "!==(p=f[0].charAt(o))&&"."!==p&&"["!==p||(f[0]=f[0].substr(0,o)+"_"+f[0].substr(o+1)),"["!==p);o++);for(s=t,o=0,h=f.length;o<h;o++){if(l=s,(""===(u=f[o].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==o){for(i in r=-1,s)s.hasOwnProperty(i)&&+i>r&&i.match(/^\d+$/g)&&(r=+i);u=r+1}Object(s[u])!==s[u]&&(s[u]={}),s=s[u]}l[u]=m}}}}},t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(787),n(844),n(215),n(713),n(525),n(371),n(999),n(143),n(938),n(816),n(378),n(498),n(670),n(218),n(824),n(477),n(429),n(214)})();
1
+ (()=>{var e={844:()=>{function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(t){for(var a=1;a<arguments.length;a++){var o=null!=arguments[a]?arguments[a]:{};a%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var r=wp.element.createElement,i=wp.element,l=(i.Fragment,i.useEffect),s=(i.useLayoutEffect,i.useRef,i.useState),p=wp.components,c=p.Button,u=p.Modal,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function m(e){var n,o,i=a(s({isOpen:!1,reason:"",reasonText:"",redirectUrl:null}),2),p=i[0],m=i[1];function d(e){m((function(n){return t(t({},n),e)}))}function f(e,t){switch(e){case"cancel":d({isOpen:!1});break;case"submit":d({isOpen:!1}),window.location.href=p.redirectUrl+"&mapp_reason="+p.reason+"&mapp_reason_text="+encodeURIComponent(p.reasonText.trim())}}return l((function(){var e=jQuery("#deactivate-mappress-google-maps-for-wordpress");e.length&&(e.off("click.mapp"),e.on("click.mapp",(function(){var e,t;return(t=(e=this)?jQuery(e).attr("href"):null)&&d({isOpen:!0,redirectUrl:t}),!1})))}),[]),p.isOpen?r(u,{isDismissible:!0,onRequestClose:function(){return f("cancel")},shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,title:__("Feedback")},(o="other"==p.reason&&!p.reasonText,sprintf("<a href='https://mappresspro.com/chris-contact' target='_blank'>%s</a>",__("contact me")),r("div",{className:"mapp-deactivate"},r("div",{className:"mapp-deactivate-content"},r("h2",null,__("Could you take a moment to let me know why you're deactivating?")),r("p",null,__("Please contact me directly for help or feedback!"),r(c,{isLink:!0,className:"mapp-deactivate-help",isSecondary:!0,href:"https://mappresspro.com/chris-contact",target:"_blank"},__("Contact"))),(n=[{value:"notworking",label:__("The plugin isn't working"),placeholder:__("Could you provide some details or error messages, so I can fix the issue?")},{value:"notexpected",label:__("It's not what I expected"),placeholder:__("What did you expect, or what features were lacking?")},{value:"toohard",label:__("It's too hard to use"),placeholder:__("Can you suggest how to make it easier?")},{value:"feature",label:__("It's missing a key feature"),placeholder:__("What features were missing?")},{value:"temporary",label:__("I'm only deactivating temporarily")},{value:"other",label:__("Other"),placeholder:__("Could you please tell me more? I'm always looking for ways to improve the plugin.")}],r("div",{className:"mapp-deactivate-reasons"},_.map(n,(function(e){var t=e.value==p.reason;return r("div",{className:"mapp-deactivate-reason",key:e.value},r("label",null,r("input",{checked:t,onChange:function(e){return d({reason:e.target.value})},type:"radio",value:e.value}),e.label),t&&e.placeholder&&r("div",null,r("textarea",{onChange:function(e){return d({reasonText:e.target.value})},placeholder:e.placeholder,value:p.reasonText})))}))))),r("div",{className:"mapp-deactivate-footer"},r(c,{isSecondary:!0,disabled:o,onClick:function(){return f("submit")}},__("Deactivate")),r(c,{isPrimary:!0,onClick:function(){return f("cancel")}},__("Cancel")))))):null}jQuery(document).ready((function(){var e=jQuery("<div></div>").appendTo("body").get(0);wp.element.render(r(m),e)}))},215:(e,t,n)=>{"use strict";n.r(t);var a=n(525),o=n(143);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s,p=window.mapp||{},c=wp.element.createElement;s=jQuery,p.Editor=function(e){this.drawingManager=null,this.map=e,this.poiEditor=null;var t=this;this.initialize=function(){this.map.display(),this.poiEditor=new p.PoiEditor(this.map),this.initDrawingManager(),s(this.map.places).off("search.mapp"),s(this.map.places).on("search.mapp",(function(e,n){t.insert(n)}))},this.insert=function(e){if(e)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.poiClose(),e.geometry){var n=e.formatted_address?e.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,a=e.name==n?"":n,o=new p.Poi({address:n,body:a,iconid:this.poiEditor.lastIcon,point:e.geometry.location,title:e.name,viewport:e.geometry.viewport?e.geometry.viewport:null});this.map.poiInsert(o),o.center()}else e.overlay?(this.map.poiHover(null),"marker"==e.type?(o=new p.Poi({body:"",iconid:null,overlay:null,point:e.overlay.getPosition().toJSON(),title:e.overlay.getPosition().toUrlValue(6),type:null}),e.overlay.setMap(null)):o=new p.Poi({body:"",iconid:null,overlay:e.overlay,title:mappl10n.shape,type:e.type}),this.map.poiInsert(o)):"string"==typeof e&&"http"==e.substring(0,4)&&(o=new p.Poi({iconid:this.poiEditor.lastIcon,kml:{url:e},title:"KML",type:"kml"}),t.map.poiInsert(o),p.event.addListenerOnce(o.overlay,"ready defaultviewport_changed",(function(){o.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()),p.event.addListener(this.drawingManager,"overlaycomplete",(function(e){t.drawingManager.get("drawingMode")&&t.insert(e)})))},this.initialize.apply(this)},p.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,n){t.render(n)})),s(this.map).on("mapp.close",(function(){t.mce(!1)})),this.sel.on("click","[data-mapp-poi]",(function(e){e.preventDefault();var n=s(this).attr("data-mapp-poi");t[n]()})),this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",(function(e){var n=s(this).hasClass("mapp-poi-visual");t.mce(n)})),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 n={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(n),this.mce(!0)}},this.mce=function(e){var n=e?"mceAddEditor":"mceRemoveEditor";"undefined"!=typeof tinyMCE&&tinyMCE.execCommand(n,!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){var t=this;document.getElementById("mapp-poi-colorpicker")&&wp.element.render(c(a.MappColorPicker,i(i({},e.getTemplateColors()),{},{isExtended:!0,onChange:function(n){e.set({dirty:!0}),e.setTemplateColors(n),t.map.renderList(),t.renderColorPicker(e)}})),document.getElementById("mapp-poi-colorpicker"))},this.renderIconPicker=function(e){var t=this;document.getElementById("mapp-poi-iconpicker")&&wp.element.render(c(o.MappIconPicker,{iconid:e.iconid,onChange:function(n){e.set({dirty:!0,iconid:n}),t.lastIcon=n,t.map.renderList(),t.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,n)=>{"use strict";function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}n.r(t),n.d(t,{default:()=>y});var s=wp.element.createElement,p=wp.url.addQueryArgs,c=wp.element,u=c.useCallback,m=c.useEffect,d=c.useState,f=wp.components,h=(f.Button,f.Dropdown),g=f.Spinner,b=f.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function y(e){var t=i(d({isFetching:!1,results:[],search:"",searchTerm:""}),2),n=t[0],a=t[1];function r(e){a((function(t){return o(o({},t),e)}))}m((function(){n.isOpen&&(r({isFetching:!0}),wp.apiFetch({path:p("/wp/v2/search",{search:n.search,per_page:20})}).then((function(e){r({results:e,isFetching:!1})})))}),[n.search,n.isOpen]);var l=u(_.debounce((function(e){r({search:e})}),1e3),[]);function c(t,a){return s("div",{className:"mapp-attach-control"},s("div",{className:"mapp-attach-control-toolbar"},s(b,{autoComplete:"false",value:n.searchTerm,onChange:function(e){r({searchTerm:e}),l(e)},placeholder:__("Search")})),function(){if(n.isFetching)return s(g,null);if(n.results)return n.results.length?s("div",{className:"mapp-attach-items"},n.results.map((function(t){return s("div",{key:t.id,className:"mapp-attach-item",onClick:function(){e.onChange(t.id,t.title)}},s("div",{className:"mapp-attach-item-title"},t.title?t.title:__("Untitled")),s("div",{className:"mapp-attach-item-type"},t.type))}))):s("div",{},__("No posts found"))}())}return s("div",{onClick:function(e){return e.stopPropagation()}},s(h,{onToggle:function(e){return r({isOpen:e})},renderToggle:function(e){e.isOpen;var t=e.onToggle;return s("a",{href:"#",onClick:t},__("Attach"))},renderContent:function(e){e.isOpen,e.onToggle;return c()}}))}},525:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappColorPicker:()=>y});var a=n(824);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=c.useEffect,d=(c.useLayoutEffect,c.useCallback,c.useRef,c.useState),f=(wp.data.useSelect,wp.compose.withState,wp.components),h=f.Button,g=(f.ColorPalette,f.ColorPicker),b=(f.Dashicon,f.Dropdown,f.ExternalLink,f.Modal),__=(f.Panel,f.PanelBody,f.PanelRow,f.Popover,f.RadioControl,f.Spinner,f.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function y(e){var t=l(d({isCustomOpen:!1,isOpen:!1}),2),n=t[0],o=t[1];function i(e){o((function(t){return r(r({},t),e)}))}function s(t,n){switch(t){case"close":i({isOpen:!1});break;case"open":i({isOpen:!0});break;case"select":e.onChange(n),s("close");break;case"set":e.onChange(n)}}return m((function(){}),[]),p(u,null,p("span",{className:"mapp-colors-toggle",onClick:function(){return s("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(!n.isOpen)return null;var t=_.map([100,90,80,70,60,50,40,30,20,10,0],(function(e){return{label:e+"%",value:e}})),o=_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],(function(e){return{label:e+"px",value:e}}));return p(b,{title:__("Select a color"),className:"mapp-colors-modal",onRequestClose:function(e){return s("close")}},p("div",{className:"mapp-colors"},p("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"]],(function(t,n){return p("div",{key:n},_.map(t,(function(t){return p("span",{className:"mapp-color"+(t==e.color?" mapp-selected":""),key:t,onClick:function(){i({isCustomOpen:!1}),s("select",{color:t})},style:{backgroundColor:t},title:t})})))}))),n.isCustomOpen&&p(g,{color:e.color,onChangeComplete:function(e){return s("set",{color:e.hex})},disableAlpha:!0}),e.isExtended&&p(a.Select,{label:__("Opacity"),options:t,value:e.opacity?e.opacity:"",onChange:function(e){return s("set",{opacity:e})}}),e.isExtended&&p(a.Select,{label:__("Stroke"),options:o,value:e.weight?e.weight:"",onChange:function(e){return s("set",{weight:e})}}),p("div",{className:"mapp-colors-toolbar"},p(h,{isPrimary:!0,onClick:function(){return s("close")}},__("Done")),p(h,{onClick:function(){return i({isCustomOpen:!n.isCustomOpen})}},__("Custom color")))))}())}},371:(e,t,n)=>{"use strict";n.r(t);var a=n(477);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}wp&&wp.plugins&&wp.plugins.registerPlugin&&wp.editPost&&wp.plugins.registerPlugin("mappress-document-settings-panel",{render:function(){var e,t,n=wp.editPost.PluginDocumentSettingPanel,o=wp.element.createElement,i=wp.element,s=i.Fragment,p=i.useEffect,c=(i.useLayoutEffect,i.useRef,i.useState),u=wp.components,m=u.Button,d=u.Spinner,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")},f=l(c({isFetchingItems:!0,isPickerOpen:!1,items:null,pickerMapid:null,pickerMode:"list"}),2),h=f[0],g=f[1];function b(e){g((function(t){return r(r({},t),e)}))}function y(e,t){switch(e){case"open-library":b({isPickerOpen:!0,pickerMode:"list"});break;case"edit":b({isPickerOpen:!0,pickerMapid:t,pickerMode:"edit"});break;case"pick-close":b({isPickerOpen:!1,pickerMapid:null});break;case"pick-insert":var n=wp.blocks.createBlock("mappress/map",{mapid:t});wp.data.dispatch("core/block-editor").insertBlock(n,0),b({isPickerOpen:!1,pickerMapid:null})}}function v(e){var t=e.map_title?e.map_title:__("Untitled");return o("div",{className:"mapp-document-item",key:e.mapid+e.postid},o("a",{className:"mapp-document-col-map_title",href:"#",onClick:function(t){return y("edit",e.mapid)}},t),o("div",{className:"mapp-document-col-mapid"},e.mapid))}return p((function(){var e=function(e){b({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return mapp.store.subscribe(e),function(){return mapp.store.unsubscribe(e)}})),p((function(){mapp.store.fetchItems()}),[]),o(n,{title:"MapPress",className:"mapp-document-panel"},(t=_.filter(h.items,(function(e){return e.postid==mappl10n.options.postid})),e=h.isFetchingItems?o(d,null):t.length?o(s,null,o("div",{className:"mapp-document-header"},o("div",{className:"mapp-document-col-map_title"},__("Map title")),o("div",{className:"mapp-document-col-mapid"},null,__("Map ID"))),_.map(t,v)):o("div",{className:"mapp-document-message"},__("No maps found")),o("div",null,o("div",{className:"mapp-document-list"},e))),o(m,{icon:"portfolio",isSecondary:!0,onClick:function(){return y("open-library")}},__("Open map library")),function(){if(h.isPickerOpen)return o(a.default,{mapid:h.pickerMapid,mode:h.pickerMode,onAction:y,type:"post"})}())},icon:null})},999:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var a=n(429),o=n(710);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=window.mapp||{},u=wp.element.createElement,m=wp.element,d=(m.Fragment,m.useEffect),f=(m.useLayoutEffect,m.useRef),h=m.useState,g=wp.components,b=g.Button,y=(g.Dropdown,g.Modal,g.Panel,g.PanelBody,g.Popover,g.Spinner,g.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n,r=s(h({dragging:null,dragover:null,isFetchingMap:!!e.mapid,isPoiListOpen:!0,isSavingMap:!1,map:null,mapdata:null}),2),l=r[0],p=r[1],m=f(null);function g(e){p((function(t){return i(i({},t),e)}))}function v(e){g({map:l.map})}function w(t,n){switch(t){case"change-settings":l.map.set(n),g({map:l.map});break;case"change-title":l.map.set({dirty:!0,title:n}),g({map:l.map});break;case"close":e.onAction("edit-close");break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(c.store.destroyMap({mapid:e.mapid}),e.onAction("edit-destroy"));break;case"save":c.store.saveMap({mapdata:l.map.toJSON(),success:function(t){l.map.set({dirty:!1}),e.onAction("edit-save",t.mapid)}})}}return d((function(){l.map&&(jQuery(l.map.div.list).off("render",v),jQuery(l.map.div.list).on("render",(function(e){return v()})))}),[l.map]),d((function(){var t=function(t){g({isFetchingMap:t.isFetchingMap,isSavingMap:t.isSavingMap,mapdata:t.maps[e.mapid]})};return c.store.subscribe(t),function(){return c.store.unsubscribe(t)}})),d((function(){e.mapid&&c.store.fetchMap({mapid:e.mapid})}),[e.mapid]),d((function(){if(!l.isFetchingMap){var t={editable:!0,embed:!0,layout:"left",mapOpts:{streetViewControl:!1},menu:!1,name:"media-map",poiList:!1,sel:jQuery(m.current)};"map"!=e.context&&"mashup"!=e.context||(t.center=null,t.zoom=null);var n=new c.Map(l.mapdata,t);new c.Editor(n);g({map:n})}}),[l.mapdata]),d((function(){l.map&&setTimeout((function(){return l.map.resize()}),100)}),[l.isPoiListOpen]),u("div",{className:"mapp-edit"},(t=l.map&&!l.isFetchingMap&&l.map.title?l.map.title:"",n=l.map&&!l.isFetchingMap?__("Untitled"):"",u("div",{className:"mapp-gt-modal-header"},u(y,{className:"mapp-edit-title",placeholder:n,value:t,onChange:function(e){return w("change-title",e)}}))),u("div",{className:"mapp-edit-main"},u("div",{className:"mapp-list mapp-edit-list"+(l.isPoiListOpen?" mapp-list-open":"")},u("div",{className:"mapp-edit-list-wrapper"},function(){if("mce"!=e.context&&"library"!=e.context)return null;if(!l.map)return null;var t=l.map,n=t.center,o=t.height,r=t.poiList,i=t.width,s=t.zoom;return u("div",{className:"mapp-gt-inspector"},u(a.MappSettings,{map:l.map,context:e.context,onAction:w,center:n,height:o,poiList:r,width:i,zoom:s}))}(),function(){if(l.map){var e=function(e,t){var n=l.dragging,a=n<a?t-1:t;l.map.pois_.splice(a,0,l.map.pois_.splice(n,1)[0]),g({map:l.map,dragover:null})};return u("div",{className:"mapp-items"},_.map(l.map.pois_,(function(t,n){return u("div",{className:l.dragover==n?"mapp-item mapp-edit-dragover":"mapp-item",draggable:!0,key:n,onClick:function(){return l.map.poiOpen(l.map.pois_[n])},onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return g({dragging:n})},onDragEnter:function(e){return g({dragover:n})},onDragEnd:function(e){return g({dragging:null,dragover:null})},onDrop:function(t){return e(t,n)}},u("img",{className:"mapp-icon",src:c.Icons.getUrl(t.iconid)}),u("div",{className:"mapp-title"},t.title))})))}}()),u("div",{className:"mapp-list-toggle",onClick:function(){return g({isPoiListOpen:!l.isPoiListOpen})}})),u("div",{className:"mapp-edit-map",key:e.mapid,ref:m,onKeyDown:function(e){return e.stopPropagation()},tabIndex:-1}),m.current&&l.map?u(o.m,{map:l.map,selected:l.map.mapTypeId,onChange:function(e){return w("change-settings",{mapTypeId:e})}}):null),u("div",{className:"mapp-edit-toolbar",tabIndex:-1,onKeyDown:function(e){return e.stopPropagation()}},u(b,{isPrimary:!0,isBusy:l.isSavingMap,onClick:function(){return w("save")}},__("Save")),u(b,{disabled:l.isSavingMap,onClick:function(){return w("close")}},__("Cancel")),u(b,{disabled:!e.mapid||l.isSavingMap,isDestructive:!0,className:"mapp-edit-delete",onClick:function(){return w("destroy")}},__("Delete"))))}},143:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappIconPicker:()=>w});var a=n(525),o=n(824);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=wp.element.createElement,u=wp.element,m=u.Fragment,d=u.useEffect,f=(u.useLayoutEffect,u.useCallback,u.useRef,u.useState),h=(wp.data.useSelect,wp.compose.withState,wp.components),g=h.Button,b=(h.ColorPicker,h.DropZone,h.DropZoneProvider,h.FormFileUpload),y=h.Modal,__=(h.Popover,h.Spinner,h.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")}),v={"fa-regular-400":{label:"Font Awesome Regular",glyphs:[{name:"address-book",codepoint:""}]},"mapp-icons":{label:"Map icons",glyphs:[{name:"abseiling",codepoint:59392},{name:"accounting",codepoint:59393},{name:"airport",codepoint:59394},{name:"amusement-park",codepoint:59395},{name:"aquarium",codepoint:59396},{name:"archery",codepoint:59397},{name:"art-gallery",codepoint:59398},{name:"assistive-listening-system",codepoint:59399},{name:"atm",codepoint:59400},{name:"audio-description",codepoint:59401},{name:"bakery",codepoint:59402},{name:"bank",codepoint:59403},{name:"bar",codepoint:59404},{name:"baseball",codepoint:59405},{name:"beauty-salon",codepoint:59406},{name:"bicycle-store",codepoint:59407},{name:"bicycling",codepoint:59408},{name:"boat-ramp",codepoint:59409},{name:"boat-tour",codepoint:59410},{name:"boating",codepoint:59411},{name:"book-store",codepoint:59412},{name:"bowling-alley",codepoint:59413},{name:"braille",codepoint:59414},{name:"bus-station",codepoint:59415},{name:"cafe",codepoint:59416},{name:"campground",codepoint:59417},{name:"canoe",codepoint:59418},{name:"car-dealer",codepoint:59419},{name:"car-rental",codepoint:59420},{name:"car-repair",codepoint:59421},{name:"car-wash",codepoint:59422},{name:"casino",codepoint:59423},{name:"cemetery",codepoint:59424},{name:"chairlift",codepoint:59425},{name:"church",codepoint:59426},{name:"skip",codepoint:59427},{name:"city-hall",codepoint:59428},{name:"climbing",codepoint:59429},{name:"closed-captioning",codepoint:59430},{name:"clothing-store",codepoint:59431},{name:"compass",codepoint:59432},{name:"convenience-store",codepoint:59433},{name:"courthouse",codepoint:59434},{name:"cross-country-skiing",codepoint:59435},{name:"crosshairs",codepoint:59436},{name:"dentist",codepoint:59437},{name:"department-store",codepoint:59438},{name:"diving",codepoint:59439},{name:"doctor",codepoint:59440},{name:"electrician",codepoint:59441},{name:"electronics-store",codepoint:59442},{name:"embassy",codepoint:59443},{name:"expand",codepoint:59444},{name:"female",codepoint:59445},{name:"finance",codepoint:59446},{name:"fire-station",codepoint:59447},{name:"fish-cleaning",codepoint:59448},{name:"fishing-pier",codepoint:59449},{name:"fishing",codepoint:59450},{name:"florist",codepoint:59451},{name:"food",codepoint:59452},{name:"fullscreen",codepoint:59453},{name:"funeral-home",codepoint:59454},{name:"furniture-store",codepoint:59455},{name:"gas-station",codepoint:59456},{name:"general-contractor",codepoint:59457},{name:"golf",codepoint:59458},{name:"grocery-or-supermarket",codepoint:59459},{name:"gym",codepoint:59460},{name:"hair-care",codepoint:59461},{name:"hang-gliding",codepoint:59462},{name:"hardware-store",codepoint:59463},{name:"health",codepoint:59464},{name:"hindu-temple",codepoint:59465},{name:"horse-riding",codepoint:59466},{name:"hospital",codepoint:59467},{name:"ice-fishing",codepoint:59468},{name:"ice-skating",codepoint:59469},{name:"inline-skating",codepoint:59470},{name:"insurance-agency",codepoint:59471},{name:"jet-skiing",codepoint:59472},{name:"jewelry-store",codepoint:59473},{name:"kayaking",codepoint:59474},{name:"laundry",codepoint:59475},{name:"lawyer",codepoint:59476},{name:"library",codepoint:59477},{name:"liquor-store",codepoint:59478},{name:"local-government",codepoint:59479},{name:"location-arrow",codepoint:59480},{name:"locksmith",codepoint:59481},{name:"lodging",codepoint:59482},{name:"low-vision-access",codepoint:59483},{name:"male",codepoint:59484},{name:"skip",codepoint:59485},{name:"marina",codepoint:59486},{name:"mosque",codepoint:59487},{name:"motobike-trail",codepoint:59488},{name:"movie-rental",codepoint:59489},{name:"movie-theater",codepoint:59490},{name:"moving-company",codepoint:59491},{name:"museum",codepoint:59492},{name:"natural-feature",codepoint:59493},{name:"night-club",codepoint:59494},{name:"open-captioning",codepoint:59495},{name:"painter",codepoint:59496},{name:"park",codepoint:59497},{name:"parking",codepoint:59498},{name:"pet-store",codepoint:59499},{name:"pharmacy",codepoint:59500},{name:"physiotherapist",codepoint:59501},{name:"place-of-worship",codepoint:59502},{name:"playground",codepoint:59503},{name:"plumber",codepoint:59504},{name:"point-of-interest",codepoint:59505},{name:"police",codepoint:59506},{name:"political",codepoint:59507},{name:"post-box",codepoint:59508},{name:"post-office",codepoint:59509},{name:"skip",codepoint:59510},{name:"skip",codepoint:59511},{name:"rafting",codepoint:59512},{name:"real-estate-agency",codepoint:59513},{name:"restaurant",codepoint:59514},{name:"roofing-contractor",codepoint:59515},{name:"skip",codepoint:59516},{name:"route",codepoint:59517},{name:"rv-park",codepoint:59518},{name:"sailing",codepoint:59519},{name:"school",codepoint:59520},{name:"scuba-diving",codepoint:59521},{name:"search",codepoint:59522},{name:"skip",codepoint:59523},{name:"shopping-mall",codepoint:59524},{name:"sign-language",codepoint:59525},{name:"skateboarding",codepoint:59526},{name:"ski-jumping",codepoint:59527},{name:"skiing",codepoint:59528},{name:"sledding",codepoint:59529},{name:"snow-shoeing",codepoint:59530},{name:"snow",codepoint:59531},{name:"snowboarding",codepoint:59532},{name:"snowmobile",codepoint:59533},{name:"spa",codepoint:59534},{name:"skip",codepoint:59535},{name:"skip",codepoint:59536},{name:"skip",codepoint:59537},{name:"stadium",codepoint:59538},{name:"storage",codepoint:59539},{name:"store",codepoint:59540},{name:"subway-station",codepoint:59541},{name:"surfing",codepoint:59542},{name:"swimming",codepoint:59543},{name:"synagogue",codepoint:59544},{name:"taxi-stand",codepoint:59545},{name:"tennis",codepoint:59546},{name:"toilet",codepoint:59547},{name:"trail-walking",codepoint:59548},{name:"train-station",codepoint:59549},{name:"transit-station",codepoint:59550},{name:"travel-agency",codepoint:59551},{name:"unisex",codepoint:59552},{name:"university",codepoint:59553},{name:"veterinary-care",codepoint:59554},{name:"viewing",codepoint:59555},{name:"volume-control-telephone",codepoint:59556},{name:"walking",codepoint:59557},{name:"waterskiing",codepoint:59558},{name:"whale-watching",codepoint:59559},{name:"wheelchair",codepoint:59560},{name:"wind-surfing",codepoint:59561},{name:"zoo",codepoint:59562}]},"mapp-shapes":{label:"Map shapes",glyphs:[{name:"circle",codepoint:59648,center:[16,16]},{name:"widepin",codepoint:59649,center:[16,14]},{name:"route",codepoint:59650,center:[16,14]},{name:"shield",codepoint:59651,center:[16,14]},{name:"squarepin",codepoint:59653,center:[16,14]},{name:"square",codepoint:59652,center:[16,16]},{name:"squarerounded",codepoint:59654,center:[16,16]},{name:"roundpin",codepoint:59657,center:[16,13]},{name:"pin",codepoint:59655,center:null},{name:"pindot",codepoint:59656,center:null}]}};function w(e){var t,n,r,l=s(f({defaultIcon:mappl10n.options.defaultIcon,filename:null,fillColor:"gray",filter:"",glyph:"",glyphColor:"white",glyphFont:"mapp-icons",isFontLoaded:!1,isOpen:!1,mode:"list",shape:"circle",shapeFont:"mapp-shapes",showNames:!0,strokeColor:"black",strokeWidth:4,urls:{},userIcons:mappl10n.options.userIcons}),2),p=l[0],u=l[1];function h(e){u((function(t){return i(i({},t),e)}))}function w(t,n){switch(t){case"close":h({isOpen:!1});break;case"edit-cancel":h({mode:"list"});break;case"edit-save":!function(e){p.glyphFont;var t=2,n=32*t,a=16*t,o=document.createElement("canvas");o.width=n,o.height=n,o.style.imageRendering="pixelated";var r=o.getContext("2d");r.font=n+"px "+p.shapeFont,r.fillStyle=p.fillColor,r.textBaseline="bottom";var i=_.findWhere(v[p.shapeFont].glyphs,{name:p.shape});r.fillText(String.fromCharCode(i.codepoint),0,n);var l=1,s=l*t;if(r.strokeStyle="white",r.lineWidth=s,r.font=n-l*t+"px "+p.shapeFont,r.strokeText(String.fromCharCode(i.codepoint),l,n-l),i.center){r.imageSmoothingEnabled=!1,r.font=a+"px "+p.glyphFont,r.fillStyle=p.glyphColor;var c=[i.center[0]*t,i.center[1]*t],u=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph});r.fillText(String.fromCharCode(u.codepoint),c[0]-a/2,c[1]+a/2)}"undefined"!=typeof debug?document.getElementById("mapp-edit-debug").append(o):o.toBlob((function(e){var t=new FormData;t.append("image0",e,p.filename),k(t)}),"image/png",100)}();break;case"edit-upload":a=n,o=new FormData,_.map(a,(function(e,t){e.type.match("image.*")?o.append("image"+t,e):alert("File "+e.name+" is not an image.")})),k(o);break;case"list-clear":e.onChange&&e.onChange(null),w("close");break;case"list-delete":e.iconid&&confirm(mappl10n.delete_prompt)&&mapp.lib.ajax({type:"POST",data:{action:"mapp_icon_delete",iconids:e.iconid,nonce:mappl10n.options.nonce},callback:function(t){if(t&&"OK"==t.status){var n=mappl10n.options.userIcons.indexOf(e.iconid);n>=0&&void 0!==mappl10n.options.userIcons[n+1]?e.onChange(mappl10n.options.userIcons[n+1]):e.onChange(null),mappl10n.options.userIcons=t.data,h({userIcons:mappl10n.options.userIcons})}else alert("Delete error: "+t.status)}});break;case"list-select":e.onChange&&(n==e.iconid?e.onChange(null):e.onChange(n));break;case"mode":h({mode:n});break;case"open":h({isOpen:!0})}var a,o}function O(t){var n="user"==t?mappl10n.options.userIcons:mappl10n.options.standardIcons;return _.map(n,(function(t){return c("div",{alt:t,className:e.iconid==t?"mapp-icon-wrapper mapp-selected":"mapp-icon-wrapper",key:t,onClick:function(){return w("list-select",t)}},c("img",{className:"mapp-icon",src:mapp.Icons.getUrl(t),title:t}))}))}function k(e){e.append("action","mapp_icon_save"),e.append("nonce",mappl10n.options.nonce),mapp.lib.ajax({type:"POST",contentType:!1,processData:!1,data:e,success:function(e){e&&"OK"==e.status?(mappl10n.options.userIcons=e.data.icons,h({userIcons:mappl10n.options.userIcons}),h({mode:"list"}),w("list-select",e.data.filename)):alert("Upload error: "+e.status)}})}return d((function(){var e=[];_.map(v,(function(t,n){var a=new FontFace(n,"url("+mappl10n.options.baseurl+"/pro/fonts/"+n+".woff?"+mappl10n.options.version+")");document.fonts.add(a),e.push(a.loaded)})),Promise.all(e).then((function(){h({isFontLoaded:!0})}))}),[]),d((function(){h({filename:p.shape+"_"+p.fillColor.replace("#","")+(p.glyph?"_"+p.glyph:"")+".png"})}),[p.shape,p.fillColor,p.glyph]),c(m,null,c("img",{className:"mapp-icon",onClick:function(){return w("open",null)},src:mapp.Icons.getUrl(e.iconid)}),"list"==p.mode&&function(){if(!p.isOpen)return null;var t=e.iconid&&mappl10n.options.userIcons.indexOf(e.iconid)>=0;return c(y,{title:c("div",{className:"mapp-icons-header"},__("Select an icon"),c(g,{isSecondary:!0,onClick:function(){return w("mode","edit")}},__("New icon"))),className:"mapp-icons-modal",onRequestClose:function(){return w("close")}},c("div",{className:"mapp-icons"},c("div",{className:"mapp-icons-list"},c("div",{className:"mapp-icons-user"},O("user")),c("div",{className:"mapp-icons-standard"},O("standard"))),c("div",{className:"mapp-icons-edit-filename"},e.iconid?e.iconid:__("No icon selected")),c("div",{className:"mapp-icons-toolbar"},c("div",null,c(g,{isPrimary:!0,onClick:function(){return w("close")}},__("OK")),c(g,{isSecondary:!0,onClick:function(){return w("list-clear")}},__("Use default icon"))),c(g,{isDestructive:!0,onClick:function(){return w("list-delete")},disabled:!t},__("Delete")))))}(),"edit"==p.mode&&c(y,{title:__("Create new icon"),className:"mapp-icons-edit-modal",onRequestClose:function(){return w("edit-cancel")},shouldCloseOnClickOutside:!1},c("div",{className:"mapp-icons-edit"},c("div",{id:"mapp-edit-debug"}),c("div",{className:"mapp-icons-edit-shape-section"},c("div",{className:"mapp-icons-edit-header"},__("Shape")),(t=v[p.shapeFont],n=_.findWhere(v[p.glyphFont].glyphs,{name:p.glyph}),r=n?String.fromCharCode(n.codepoint):null,c("div",{className:"mapp-icons-edit-shapes",style:{color:p.fillColor,fontFamily:p.shapeFont}},_.map(t.glyphs,(function(e,t){var a=p.shape==e.name;return c("span",{className:"mapp-icons-edit-shape-wrapper"+(a?" mapp-selected":""),key:e.name,onClick:function(){return h({shape:e.name})},title:e.name},c("span",{className:"mapp-icons-edit-shape"},String.fromCharCode(e.codepoint),e.center&&n&&c("span",{className:"mapp-icons-edit-glyph",style:{left:e.center[0],top:e.center[1],color:p.glyphColor,fontFamily:p.glyphFont}},r)))}))))),c("div",{className:"mapp-icons-edit-color-section"},c("span",{className:"mapp-icons-edit-header"},__("Color")),c(a.MappColorPicker,{color:p.fillColor,isExtended:!1,onChange:function(e){return h({fillColor:e.color})}})),c("div",{className:"mapp-icons-edit-glyph-section"},c("div",{className:"mapp-icons-edit-search"},c("div",{className:"mapp-icons-edit-header"},__("Search")),c(o.Input,{onChange:function(e){return h({filter:e})}})),function(){p.glyphFont;var e=_.filter(v[p.glyphFont].glyphs,(function(e){return(!p.filter||e.name.includes(p.filter))&&"skip"!=e.name}));return c("div",{className:"mapp-icons-edit-glyph-list",style:{color:p.glyphColor,fontFamily:p.glyphFont}},_.map(e,(function(e,t){return c("div",{className:"mapp-icons-edit-glyph-wrapper"+(p.glyph==e.name?" mapp-selected":""),key:t,onClick:function(){return h({glyph:p.glyph==e.name?null:e.name})}},c("span",{className:"mapp-icons-edit-glyph"},String.fromCharCode(e.codepoint)),c("div",{className:"mapp-icons-edit-glyph-title"},e.name))})))}()),c("div",{className:"mapp-icons-edit-toolbar"},c("div",null,c(g,{isPrimary:!0,onClick:function(){return w("edit-save")}},__("Save")),c(g,{isSecondary:!0,onClick:function(){return w("edit-cancel")}},__("Cancel"))),c(b,{accept:"image/*",icon:"upload",multiple:!0,onChange:function(e){w("edit-upload",e.target.files)}},__("Upload icons"))))))}},938:(e,t,n)=>{"use strict";n.r(t);var a=n(477);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}window.mapp;var i=wp.element.createElement,l=wp.element,s=(l.Fragment,l.render,l.useEffect),p=(l.useLayoutEffect,l.useRef,l.useState),c=wp.components;c.Button,c.Modal;document.getElementById("mapp-library")&&(mappl10n.options.postid=0,wp.element.render(i((function(e){var t=o(p({mapid:null}),2),n=t[0];return t[1],s((function(){}),[]),i(a.default,{context:"library",mapid:n.mapid,onAction:function(e,t){switch(e){case"pick-shortcode":var n=jQuery("<input>");jQuery("body").append(n),n.val('[mappress mapid="'+t+'"]').select(),document.execCommand("copy"),n.remove(),alert((a="Shortcode copied",wp.i18n.__(a,"mappress-google-maps-for-wordpress")))}var a}})})),document.getElementById("mapp-library")))},816:(e,t,n)=>{"use strict";n.r(t);var a=n(429),o=n(477);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=window.mapp||{},u=wp.element.createElement,m=wp.element,d=m.Fragment,f=m.useEffect,h=(m.useLayoutEffect,m.useRef),g=m.useState,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function b(e){var t=wp.components,n=(t.BaseControl,t.Button),r=(t.ButtonGroup,t.CheckboxControl,t.Dropdown,t.Modal,t.Panel,t.PanelBody,t.PanelRow,t.Placeholder),l=(t.RadioControl,t.SelectControl,t.TextControl,t.ToggleControl,t.Toolbar),p=t.ToolbarButton,m=t.ToolbarGroup,b=wp.blockEditor,y=b.BlockControls,v=b.InspectorControls,w=s(g({isOpen:!1,map:null,mapdata:void 0,pickerMode:"list",pickerMapid:null}),2),O=w[0],k=w[1],C=h(null);function S(e){k((function(t){return i(i({},t),e)}))}function P(t,n){switch(t){case"add":S({isOpen:!0,pickerMapid:null,pickerMode:"edit"}),e.setAttributes({center:void 0,zoom:void 0});break;case"change-settings":e.setAttributes(n);break;case"edit":S({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"edit"});break;case"edit-close":S({isOpen:!1});break;case"pick-destroy":e.setAttributes({mapid:void 0,center:void 0,zoom:void 0,width:void 0,height:void 0}),S({isOpen:!1});break;case"pick-close":S({isOpen:!1});break;case"pick-insert":case"pick-duplicate":n!=e.attributes.mapid&&e.setAttributes({center:void 0,mapid:n,zoom:void 0}),S({isOpen:!1});break;case"open":S({isOpen:!0,pickerMapid:e.attributes.mapid,pickerMode:"list"})}}function j(){return u(y,null,u(void 0!==m?m:l,null,e.attributes.mapid&&u(p,{icon:"edit",label:__("Edit map"),onClick:function(){return P("edit")}}),u(p,{icon:"portfolio",label:__("Map Library"),onClick:function(){return P("open")}})))}function x(){if(O.isOpen)return u(o.default,{mapid:O.pickerMapid,mode:O.pickerMode,onAction:P,type:"post"})}return f((function(){var t=function(t){S({mapdata:t.maps[e.attributes.mapid]})};return c.store.subscribe(t),function(){return c.store.unsubscribe(t)}})),f((function(){e.attributes.mapid&&c.store.fetchMap({mapid:e.attributes.mapid})}),[e.attributes.mapid]),f((function(){var t;e.attributes.mapid&&C.current&&O.mapdata&&((t=new c.Map(O.mapdata,{alignment:e.attributes.align,center:e.attributes.center,height:e.attributes.height,mapOpts:{mapTypeControl:!1,streetViewControl:!1},poiList:e.attributes.poiList,sel:jQuery(C.current),width:e.attributes.width,zoom:e.attributes.zoom})).display(),S({map:t}))}),[O.mapdata]),f((function(){"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?u("img",{className:"mapp-gt-preview",src:mappl10n.options.baseurl+"/images/preview.png",width:"100%"}):e.attributes.mapid&&null!==O.mapdata?u(d,null,j(),function(){if(!O.map)return null;var t=e.attributes,n=t.align,o=t.center,r=t.height,i=t.poiList,l=t.width,s=t.zoom;return u(v,null,u("div",{className:"mapp-gt-inspector"},u(a.MappSettings,{map:O.map,alignment:n,context:"map",onAction:P,center:o,height:r,poiList:i,width:l,zoom:s})))}(),u("div",{className:"mapp-gt",ref:C}),x()):u(d,null,u(d,null,j(),u(r,{className:"mapp-gt-placeholder",icon:"location",label:__("MapPress Map"),instructions:__("Use the map library to create a new map or insert an existing map.")},u(n,{icon:"portfolio",isSecondary:!0,onClick:function(){return P("open")}},__("Map Library")))),x())}mappl10n.options.postid&&wp.blocks.registerBlockType("mappress/map",{title:__("MapPress Map"),icon:"location",description:__("Insert a map"),category:"mappress",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},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:function(e){return e.named.center}},height:{type:"string",shortcode:function(e){return e.named.height}},initialOpenDirections:{type:"boolean",shortcode:function(e){return"true"==e.named.initialOpenDirections||"true"==e.named.initialopendirections}},mapid:{type:"string",shortcode:function(e){return e.named.mapid}},poiList:{type:"boolean",shortcode:function(e){return"true"==e.named.poiList||"true"==e.named.poilist}},width:{type:"string",shortcode:function(e){return e.named.width}},zoom:{type:"number",shortcode:function(e){return parseInt(e.named.zoom)?parseInt(e.named.zoom):null}}}},{type:"block",blocks:["core/shortcode"],isMatch:function(e){var t=e.text,n=wp.shortcode.regexp("mappress");return n.lastIndex=0,n.test(t)},transform:function(e){var t=e.text;return wp.blocks.rawHandler({HTML:"<p>"+t+"</p>",mode:"BLOCKS"})}}]},edit:function(e){return u(b,e)},save:function(e){return e},example:{attributes:{preview:!0}}})},378:(e,t,n)=>{"use strict";n.r(t);n(429),n(670),n(308);window.mapp,wp.element.createElement;var a=wp.element,o=(a.Fragment,a.useEffect,a.useLayoutEffect,a.useRef,a.useState,wp.components);o.BaseControl,o.Button,o.ButtonGroup,o.Card,o.CardBody,o.CardFooter,o.CardHeader,o.CheckboxControl,o.ExternalLink,o.HorizontalRule,o.Panel,o.PanelBody,o.PanelRow,o.Placeholder,o.RadioControl,o.SelectControl,o.TabPanel,o.TextControl,o.TextareaControl,o.ToggleControl,o.Toolbar,wp.data.useSelect},498:(e,t,n)=>{"use strict";n.r(t);var a=n(477);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}window.mapp;var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=(c.useEffect,c.useLayoutEffect,c.useRef,c.useState),d=wp.components,f=(d.Button,d.Dashicon),__=(d.Modal,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function h(){var e=l(m({isOpen:!1,mapid:null}),2),t=e[0],n=e[1];function o(e){n((function(t){return r(r({},t),e)}))}function i(e,t){switch(e){case"pick-close":o({isOpen:!1,mapid:null});break;case"pick-insert":o({isOpen:!1});var n='[mappress mapid="'+t+'"]';"undefined"==typeof wpActiveEditor?__("Please select the post content to insert the map into."):send_to_editor(n);break;case"open":o({isOpen:!0,mapid:s()})}}function s(){var e=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;for(var n=null,a=t.anchorNode.data,o=-1,r=t.anchorOffset-1;r>=0;r--){var i=a[r];if("["==i){o=r;break}if("]"==i||"<"==i||">"==i)break}return o>=0&&(n=wp.shortcode.next("mappress",a,o))?n.shortcode.attrs.named.mapid:null}return p(u,null,p("button",{className:"button",type:"button",onClick:function(e){e.preventDefault(),i("open")}},p(f,{className:"wp-media-buttons-icon",icon:"location"}),__("MapPress")),t.isOpen&&p(a.default,{context:"mce",mapid:t.mapid,onAction:i}))}Array.from(document.getElementsByClassName("mapp-mce")).forEach((function(e,t){return wp.element.render(p(h),e)}))},670:(e,t,n)=>{"use strict";function a(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}n.r(t),n.d(t,{MappMultiSelect:()=>v});var c=wp.element.createElement,u=wp.element,m=(u.Fragment,u.useEffect),d=(u.useLayoutEffect,u.useRef),f=u.useState,h=wp.components,g=h.BaseControl,b=(h.Button,h.CheckboxControl),y=(h.Panel,h.PanelBody,h.PanelRow,h.Spinner,h.TextControl),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function v(e){var t,n=d(null),o=d(null),i=l(f({isOpen:!1,filter:"",filteredOptions:[]}),2),s=i[0],p=i[1];function u(e){p((function(t){return r(r({},t),e)}))}function h(t){var n=_.findWhere(e.options,{value:t});return n?n.label:t}function v(){var t;return e.values instanceof Array?t=a(e.values):e.values&&(t=[e.values]),t||[]}function w(t,n){var a=v(),o=a.indexOf(t);(n=void 0!==n?n:-1==o)?a.push(t):a.splice(o,1),e.onChange(a)}function O(){return s.isOpen?c("div",{className:"mapp-select-dropdown-wrapper"},c("div",{className:"mapp-select-dropdown"},!s.isOpen||!e.options||e.options.length<10?null:c("div",{className:"mapp-select-filter",ref:o},c(y,{autoComplete:"off",placeholder:__("Search"),value:s.filter,onChange:function(e){return u({filter:e})}})),c("div",{className:"mapp-select-dropdown-list"},(t=v(),0==s.filteredOptions.length?c("div",{className:"mapp-select-dropdown-item"},__("No results")):s.filteredOptions.map((function(e){return c(b,{className:"mapp-select-dropdown-item",checked:t.includes(e.value),key:e.value,onChange:function(t){return w(e.value,t)},label:e.label})})))))):null;var t}return m((function(){if(e.options)if(s.filter){var t=s.filter.toUpperCase();u({filteredOptions:e.options.filter((function(e){return 0==e.label.toUpperCase().indexOf(t)}))})}else u({filteredOptions:e.options})}),[e.options,s.filter]),m((function(){s.isOpen&&o.current&&(jQuery("input",jQuery(o.current)).focus(),u({filter:""}))}),[s.isOpen]),c(g,{className:"mapp-select",label:e.label},c("div",{ref:n,tabIndex:0,onBlur:function(e){return function(e){event.relatedTarget||document.activeElement,n.current.contains(e.relatedTarget)||u({isOpen:!1})}(e)}},((t=v())instanceof Array&&t.map((function(e){return h(e)})),void 0===e.options?c("div",{className:"mapp-select-input"},c("div",{className:"mapp-select-tokens"}),c("span",{className:"dashicons dashicons-arrow-down-alt2"})):c("div",{className:"mapp-select-input",onClick:function(){return u({isOpen:!s.isOpen})}},c("div",{className:"mapp-select-tokens"},t.map((function(e){return c("span",{className:"mapp-select-token",key:e,onClick:function(t){t.stopPropagation(),w(e,!1)}},h(e))}))),c("span",{className:"dashicons "+(s.isOpen?"dashicons-arrow-up-alt2":"dashicons-arrow-down-alt2")}))),O()))}},218:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>C});var a=n(824),o=n(143),r=n(710);function i(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var d=wp.element.createElement,f=wp.element,h=f.Fragment,g=f.useEffect,b=(f.useLayoutEffect,f.useCallback,f.useRef),y=f.useState,v=wp.data.useSelect,w=wp.components,O=w.Button,k=w.Dashicon,__=(w.ExternalLink,w.Modal,w.Panel,w.PanelBody,w.PanelRow,w.Popover,w.RadioControl,w.Spinner,w.TabPanel,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function C(e){var t,n,l,p,u,m,f=c(y(s({},mappress_options_state)),2),w=f[0],C=f[1],S=b(null);function P(e){C((function(t){return s(s({},t),e)}))}function j(e){return _.map(e,(function(e,t){return{value:t,label:e}}))}function x(e,t){return e&&Array.isArray(e)&&e.length?(_.map(e,(function(e){for(var t in e)"string"==typeof e[t]&&(e[t]=e[t].trim())})),t?e.filter((function(e){for(var t in e)if(0==e[t].length)return!1;return!0})):e):[]}function N(e,t){switch(e){case"license-check":mapp.lib.ajax({type:"POST",data:{action:"mapp_license_check",nonce:mappl10n.options.nonce,license:w.license},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"reset":mapp.lib.ajax({type:"POST",data:{action:"mapp_options_reset",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&window.location.reload()}});break;case"save":var n=s({},w);delete n.helpers,n.filters=x(n.filters,!1),n.metaKeys=x(n.metaKeys,!0),n.sizes=x(n.sizes,!0),n.autoicons&&n.autoicons.values&&(n.autoicons.values=x(n.autoicons.values,!0)),mapp.lib.ajax({type:"POST",data:{action:"mapp_options_save",nonce:mappl10n.options.nonce,settings:n},callback:function(e){e&&"OK"==e.status&&window.location.reload()}})}}return g((function(){S.current&&new mapp.Map(w.helpers.demo_map,{sel:jQuery(S.current)}).display()}),[]),g((function(){mappl10n.options.engine!=w.engine&&N("save")}),[w.engine]),d("div",{className:"mapp-options"},d("form",{onSubmit:function(e){e.preventDefault(),N("save")}},d(a.Section,{title:__("Sample Map"),className:"mapp-demo-section"},d("div",{className:"mapp-options-demo",ref:S})),mappl10n.options.pro&&(!w.helpers.is_multisite||w.helpers.is_super_admin||w.helpers.is_main_site)&&d(a.Section,{title:__("License")},d(a.Option,{title:__("MapPress license key")},d(a.Input,{value:w.license,onChange:function(e){return P({license:e})},size:37,placeholder:__("Enter license to enable automatic updates")}),(m=d("a",{className:"mapp-license-status",href:"https://mappresspro.com/account",target:"_blank"},__("Get license")),w.license&&w.helpers.license_status?"active"==w.helpers.license_status?d("span",{className:"mapp-license-status"},d(k,{icon:"yes"}),__("Active")):d(h,null,d(O,{className:"mapp-options-check-license",isSecondary:!0,onClick:function(){return N("license-check")}},__("Check now")),d("div",null,d(k,{icon:"no"}),w.helpers.license_message)):m)),d(a.Checkbox,{title:__("Beta versions"),label:__("Enable updates for beta versions"),checked:w.betas,onChange:function(e){return P({betas:e})}})),d(a.Section,{title:__("Basic Settings")},d(a.Radios,{title:__("Mapping API"),options:[{label:"Leaflet",value:"leaflet"},{label:"Google",value:"google"}],onChange:function(e){P({engine:e,geocoder:"google"==e?"google":""})},checked:w.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"==w.engine&&(u={},w.mapbox||(u={text:"Recommended: Mapbox provides great looking maps and an excellent geocoder",type:"warning"}),u.href="https://www.mapbox.com/help/define-access-token/",d(a.Input,{className:"mapp-option-mapbox",name:"mapbox",title:__("Mapbox access token"),value:w.mapbox,onChange:function(e){P({mapbox:e})},placeholder:__("Enter token to use Mapbox features"),help:u})),d(a.Input,{title:__("Google API key"),name:"apiKey",value:w.apiKey,onChange:function(e){P({apiKey:e})},placeholder:__("Enter key to use Google maps or geocoder"),size:50,help:{href:"https://mappresspro.com/mappress-faq/#toc-google-maps-api-keys"}}),"leaflet"==w.engine&&function(){var e=[{value:"nominatim",label:"Nominatim"},{value:"mapbox",label:"MapBox",disabled:!w.mapbox},{value:"google",label:"Google",disabled:!w.apiKey},{value:"",label:__("Algolia")}],t={};return""==w.geocoder?t={text:__("Algolia is discontinuing their geocoder in 2022."),type:"warning"}:"nominatim"==w.geocoder?t={text:__("Nominatim is free but inaccurate. Please consider using Mapbox or Google instead."),type:"warning"}:"google"!=w.geocoder||w.apiKey?"mapbox"!=w.geocoder||w.mapbox||(t={text:__("A Mapbox access token is required to use the Mapbox geocoder"),type:"error"}):t={text:__("A google API key is required to use the Google geocoder"),type:"error"},t.href="#toc-picking-a-geocoder",d(a.Option,{title:__("Geocoder")},d(a.Radios,{options:e,checked:w.geocoder,onChange:function(e){return P({geocoder:e})},help:t}))}()),d(a.Section,{title:__("Map Settings")},d(a.Checkboxes,{title:__("Post types"),values:w.postTypes,options:j(w.helpers.post_types),onChange:function(e){return P({postTypes:e})}}),d(a.Radios,{title:__("Automatic display"),options:[{value:"",label:__("None")},{value:"top",label:__("Top of post")},{value:"bottom",label:__("Bottom of post")}],checked:w.autodisplay,onChange:function(e){return P({autodisplay:e})}}),d(a.Radios,{title:__("Map alignment"),options:[{value:"",label:__("Default")},{value:"center",label:__("Center")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],checked:w.alignment,onChange:function(e){return P({alignment:e})}}),d(a.Radios,{title:__("Directions"),checked:w.directions,options:[{value:"google",label:"Google"},{value:"inline",label:__("Inline")}],onChange:function(e){return P({directions:e})}}),d(a.Checkbox,{title:__("POI list"),checked:w.poiList,label:__("Show a list of POIs with each map"),onChange:function(e){return P({poiList:e})}}),mappl10n.options.pro&&d(a.Radios,{title:__("POI list layout"),checked:w.layout,options:[{value:"left",label:"Left of map"},{value:"inline",label:__("Below map")}],onChange:function(e){return P({layout:e})}}),d(a.Input,{title:__("Mini width"),value:w.mini,onChange:function(e){return P({mini:e})},size:3,label:__("Width (px) to hide the POI list")}),d(a.Checkbox,{title:__("Sort"),checked:w.sort,label:__("Sort POI list by title"),onChange:function(e){return P({sort:e})}}),"leaflet"==mappl10n.options.engine&&d(a.Checkbox,{title:__("Scroll wheel zoom"),checked:w.scrollWheel,label:__("Enable map zoom with mouse scroll wheel"),onChange:function(e){return P({scrollWheel:e})}})),mappl10n.options.pro&&d(a.Section,{title:__("Styled Maps")},d(a.Option,{title:__("Default style")},d("div",{className:"mapp-option-style"},d(r.m,{selected:w.style,onChange:function(e){P({style:e}),mappl10n.options.style=e}}),d("div",null,__('Replace the default "roadmap" or "streets" style'))))),d(a.Section,{title:__("POI Settings")},d(a.Select,{title:__("Default zoom"),label:__("Default zoom when displaying a single POI"),value:w.poiZoom,options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(function(e){return{value:e,label:e}})),onChange:function(e){return P({poiZoom:e})}}),d(a.Checkbox,{title:__("Hover"),checked:w.tooltips,label:__("Open POIs on hover"),onChange:function(e){return P({tooltips:e})}}),d(a.Checkbox,{title:__("Open first POI"),checked:w.initialOpenInfo,onChange:function(e){return P({initialOpenInfo:e})},label:__("Open first POI")})),mappl10n.options.pro&&d(a.Section,{title:__("Icons")},d(a.Option,{title:__("Default icon")},d(o.MappIconPicker,{iconid:w.defaultIcon,onChange:function(e){mappl10n.options.defaultIcon=e,P({defaultIcon:e})}})),d(a.Option,{title:__("Icon directory")},d("code",null,w.helpers.icon_directory)),d(a.Option,{title:__("Highlight selected POI")},d(a.Radios,{checked:w.highlight,options:[{value:"",label:__("None")},{value:"circle",label:__("Circle")},{value:"scale",label:__("Scale")},{value:"icon",label:__("Icon")}],onChange:function(e){return P({highlight:e})}}),"icon"==w.highlight&&d(o.MappIconPicker,{defaultIcon:w.defaultIcon,iconid:w.highlightIcon,onChange:function(e){return P({highlightIcon:e})}})),(p=w.iconScale&&Array.isArray(w.iconScale)?i(w.iconScale):[0,0],d(a.Option,{title:__("Icon scaling")},d(a.Input,{value:p[0]?p[0]:"",onChange:function(e){e<=64&&(p[0]=e>0?e:"",P({iconScale:p}))},type:"number",min:0,max:64}),d("span",null," X "),d(a.Input,{value:p[1]?p[1]:"",onChange:function(e){e<=64&&(p[1]=e>0?e:"",P({iconScale:p}))},type:"number",min:0,max:64}),d("span",null," (px) "))),function(){var e=j(w.helpers.taxonomies);e.unshift({value:"post_type",label:__("Post type")});var t=v((function(e){if("post_type"==w.autoicons.key)return j(w.helpers.post_types);var t=wp.data.select("core").getEntityRecords("taxonomy",w.autoicons.key,{per_page:-1,_fields:"id,name,slug"});return t?t.map((function(e){return{value:e.slug,label:e.name}})):[]}),[w.autoicons.key]);return d(a.Option,{title:__("Automatic icons")},d(a.Select,{value:w.autoicons?w.autoicons.key:null,options:e,onChange:function(e){var t=w.autoicons?s({},w.autoicons):[];t.key=e,t.values=[],P({autoicons:t})},placeholder:""}),d(a.MappGrid,{cols:[{id:"key",label:__("Key"),type:"select",options:t},{id:"value",label:__("Icon"),type:"icon"}],data:w.autoicons.values,onChange:function(e){var t=w.autoicons?s({},w.autoicons):[];t.values=e,P({autoicons:t})}}))}()),d(a.Section,{title:__("Clustering")},d(a.Checkbox,{title:__("Clustering"),checked:w.clustering,label:__("Enable marker clustering"),onChange:function(e){return P({clustering:e})}}),function(){var e=w.clusteringOptions?w.clusteringOptions:{},t=function(t,n){e[t]=n,P({clusteringOptions:e})};if("google"==w.engine){return d("div",{className:"mapp-option-clustering-options"},d(a.Select,{help:{href:"https://github.com/googlemaps/v3-utility-library/blob/3fca406/packages/markerclustererplus/src/markerclusterer.ts"},label:d(h,null,__("Disable clustering at zoom"),d("code",null,"maxZoom")),onChange:function(e){return t("maxZoom",e)},options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(function(e){return{value:e,label:e}})),placeholder:__("None"),title:__("Max zoom"),value:e.maxZoom}))}var n="https://github.com/Leaflet/Leaflet.markercluster#all-options";return d("div",{className:"mapp-option-clustering-options"},d(a.Select,{help:{href:n},label:d(h,null,__("Disable clustering at zoom"),d("code",null,"disableClusteringAtZoom")),onChange:function(e){return t("disableClusteringAtZoom",e)},options:_.map([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],(function(e){return{value:e,label:e}})),placeholder:__("Auto"),title:__("Max zoom"),value:e.disableClusteringAtZoom}),d(a.Checkbox,{checked:e.spiderfyOnMaxZoom,help:{href:n},label:d(h,null,__("Spiderfy"),d("code",null,"spiderfyOnMaxZoom")),onChange:function(e){return t("spiderfyOnMaxZoom",e)},title:__("Spiderfy")}))}()),mappl10n.options.pro&&d(a.Section,{title:__("Mashups")},d(a.Option,{title:__("Filters")},d(a.MappGrid,{cols:[{id:"key",label:__("Taxonomy"),onRender:function(e){var t=j(w.helpers.taxonomies).map((function(t){return t.disabled=t.value!=e.value&&_.findWhere(w.filters,{key:t.value}),t}));return d(a.Select,{value:e.value,options:t,onChange:e.onChange,placeholder:""})}},{id:"sort",label:__("Sort"),onRender:function(e){return d(a.Select,{value:e.value,options:[{value:"name",label:__("Name")},{value:"slug",label:__("Slug")}],onChange:e.onChange})}},{id:"count",label:__("Show counts"),onRender:function(e){return d(a.Checkbox,{checked:e.value,onChange:e.onChange})}}],data:w.filters,onChange:function(e){P({filters:e})}})),(l=[{value:"poi",label:__("Open popup")},{value:"post",label:__("Open post")},{value:"postnew",label:__("Post in new tab")},{value:"postmodal",label:__("Post in modal")}],d(a.Radios,{title:__("Marker click"),checked:w.mashupClick,options:l,onChange:function(e){return P({mashupClick:e})}})),d(a.Radios,{title:__("Popup content"),checked:w.mashupBody,options:[{value:"poi",label:__("POI title + POI body")},{value:"post",label:__("Post title + post excerpt")}],onChange:function(e){return P({mashupBody:e})}}),d(a.Checkbox,{title:__("KMLs"),checked:w.mashupKml,label:__("Include KML POIs in mashups"),onChange:function(e){return P({mashupKml:e})}})),mappl10n.options.pro&&d(a.Section,{title:__("Mashup Search")},d(a.Checkbox,{title:__("Search"),checked:w.search,label:__("Enable search"),onChange:function(e){return P({search:e})}}),d(a.Select,{help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},title:__("Search radius"),label:__("Minimum search radius (km)"),value:w.radius,options:_.map([1,5,10,15,25,50,75,100,200,300],(function(e){return{value:e,label:e}})),onChange:function(e){return P({radius:e})}}),d(a.Select,{title:__("Search country"),label:__("Country code for searches"),value:w.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"],(function(e){return{value:e,label:e}})),onChange:function(e){return P({country:e})},help:{href:"https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements"}}),mappl10n.options.ssl?d(a.Checkbox,{title:__("User location"),checked:w.userLocation,label:__("Show user location on map"),onChange:function(e){return P({userLocation:e})}}):null,function(){if("google"!=w.engine)return d(a.Input,{onChange:function(e){return P({searchBox:e})},help:{href:"https://mappresspro.com/mappress-documentation/#toc-mashup-search"},label:__("Restrict searches to a bounding box (optional)"),title:__("Bounding box"),placeholder:"SW lon, SW lat, NE lng, NE lat",size:45,trim:!0,value:w.searchBox})}()),mappl10n.options.pro&&d(a.Section,{title:__("Geocoding")},d(a.Option,{title:__("Geocoding fields")},d(a.MappGrid,{cols:[{id:"key",label:__("Map field"),type:"select",options:j(w.helpers.meta_fields)},{id:"value",label:__("Custom field"),type:"select",options:j(w.helpers.meta_keys)}],data:w.metaKeys,onChange:function(e){P({metaKeys:e})}})),d(a.Checkbox,{title:__("Overwrite"),label:__("Overwrite maps when posts are saved"),checked:w.metaSyncSave,onChange:function(e){P({metaSyncSave:e})}}),"google"==w.engine&&d(a.Input,{title:__("Google Server API key"),name:"apiKeyServer",value:w.apiKeyServer,onChange:function(e){return P({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"}}),(n=__("No errors found"),w.helpers.geocoding_errors&&w.helpers.geocoding_errors.length>0&&(n=_.map(w.helpers.geocoding_errors,(function(e){return d("div",{key:e.ID},d("a",{href:mappl10n.options.editurl+"?post="+e.ID+"&action=edit"},e.post_title),d("span",null," : "+e.error))}))),d(a.Option,{title:__("Geocoding errors")},n))),mappl10n.options.pro&&mappl10n.options.acfActive&&d(a.Section,{title:__("Frontend Forms")},d(a.Option,{title:__("Advanced Custom Fields")},d(a.Input,{className:"mapp-option-acf",name:"acf",value:w.acf,onChange:function(e){P({acf:e})},placeholder:__("ACF field"),size:20}),__("ACF map field to include on MapPress mashups"),d(a.Help,{text:__("To generate MapPress maps from ACF fields, leave this blank and use the Geocoding section"),href:"#"}))),mappl10n.options.pro&&d(a.Section,{title:__("Templates")},d(a.Option,{title:__("Custom templates")},d(a.MappTemplateEditor)),d(a.Option,{title:__("Mashup thumbnails")},d(a.Select,{label:__("Popups"),onChange:function(e){return P({thumbsPopup:e})},options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:w.thumbsPopup}),d(a.Select,{label:__("POI lists"),onChange:function(e){return P({thumbsList:e})},options:[{value:"",label:__("None")},{value:"top",label:__("Top")},{value:"left",label:__("Left")},{value:"right",label:__("Right")}],value:w.thumbsList})),d(a.Option,{title:__("Thumbnail size")},d(a.Select,{onChange:function(e){return P({thumbSize:e})},options:j(w.helpers.thumbnail_sizes),value:w.thumbSize}),d("span",null," "+__("or")+" "),d(a.Input,{value:w.thumbWidth,onChange:function(e){return P({thumbWidth:e})},type:"number",min:0,max:9999}),d("span",null," X "),d(a.Input,{value:w.thumbHeight,onChange:function(e){return P({thumbHeight:e})},type:"number",min:0,max:9999}),d("span",null," (px) "))),d(a.Section,{title:__("Localization")},(t="leaflet"==w.engine?"https://en.wikipedia.org/wiki/ISO_639-1":"http://code.google.com/apis/maps/faq.html#languagesupport",d(a.Select,{title:__("Language"),label:__("Language for searches and Google map controls"),value:w.language,options:j(w.helpers.languages),onChange:function(e){return P({language:e})},help:{href:t}})),d(a.Input,{title:__("Directions server"),value:w.directionsServer,onChange:function(e){return P({directionsServer:e})},size:25})),d(a.Section,{title:__("Miscellaneous")},d(a.Option,{title:__("Map sizes")},d(a.MappGrid,{cols:[{id:"width",label:__("Width")+" (px, %, vw)",size:4},{id:"height",label:__("Height")+" (px, %, vh)"}],data:w.sizes,onChange:function(e,t){return P({sizes:e,size:t})},selectionColumn:"rowid",selected:w.size})),w.helpers.jetpack?null:d(a.Checkbox,{title:__("Scripts"),checked:w.footer,label:__("Output scripts in footer"),onChange:function(e){return P({footer:e})},help:{text:__("Disable footer scripts if maps are output using AJAX")}}),d(a.Checkbox,{title:"WPML",checked:w.wpml,label:__("Copy maps when overwriting a translation"),onChange:function(e){return P({wpml:e})},help:{href:"https://mappresspro.com/mappress-documentation#wpml"}}),d(a.Checkbox,{title:__("Compatiblity"),checked:w.deregister,label:__("Output maps in iframes to prevent compatibility issues"),onChange:function(e){return P({deregister:e})}})),d("div",{className:"mapp-options-toolbar"},d(O,{className:"mapp-options-save",type:"submit",isPrimary:!0},__("Save")),d(O,{isSecondary:!0,onClick:function(){return N("reset")}},__("Reset Defaults")))))}document.getElementById("mapp-options-settings")&&wp.element.render(d(C),document.getElementById("mapp-options-settings"))},824:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Checkbox:()=>C,Checkboxes:()=>S,Help:()=>P,Input:()=>j,Radios:()=>N,Select:()=>M,Textarea:()=>I,Section:()=>A,Option:()=>E,MappGrid:()=>D,MappTemplateEditor:()=>T});var a=n(143);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var m=wp.element.createElement,d=wp.element,f=d.Fragment,h=d.useEffect,g=(d.useLayoutEffect,d.useCallback),b=(d.useRef,d.useState),y=(wp.data.useSelect,wp.components),v=y.Button,w=(y.ColorPicker,y.Dashicon),O=(y.Dropdown,y.ExternalLink,y.Modal),k=(y.Panel,y.PanelBody,y.PanelRow,y.Popover,y.RadioControl,y.Spinner,y.TabPanel),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function C(e){var t=e.checked,n=e.title,a=e.label,o=e.onChange,r=e.help,i=u(e,["checked","title","label","onChange","help"]),l=m(f,null,m("label",null,m("input",p({type:"checkbox",onChange:function(e){o&&o(e.target.checked)},checked:void 0!==t&&t},i)),a&&m("span",{className:"mapp-option-label"},a)),r&&m(P,r));return n?m(E,{title:n},l):l}function S(e){var t=m(f,null,_.map(e.options,(function(t,n){var a=e.values?e.values.indexOf(t.value):-1;return m(C,{key:n,label:t.label,value:t.value,checked:a>=0,onChange:function(n){var o=r(e.values);n&&-1==a&&e.onChange(o.concat(t.value)),!n&&a>=0&&(o.splice(a,1),e.onChange(o))}})})),e.help&&m(P,e.help));return e.title?m(E,{title:e.title},t):t}function P(e){var t="mapp-help-text";e.type&&(t+=" mapp-help-"+e.type);var n=null;return e.href&&(n="#"==e.href.substr(0,1)?"https://mappresspro.com/mappress-documentation/"+e.href:e.href),m(f,null,n&&m("a",{className:"mapp-help-link",href:n,target:"_blank"},m(w,{icon:"editor-help"})),e.text&&m("div",{className:t},e.text))}function j(e){var t=e.title,n=e.value,a=e.label,o=e.onChange,r=e.help,i=e.trim,l=e.type,s=u(e,["title","value","label","onChange","help","trim","type"]);if(!o)return"Missing onChange handler in Input component";i=void 0===i||i;var c=m(f,null,m("input",p({value:null!==n?n:"",onChange:function(e){return o(i?e.target.value.trim():e.target.value)},type:l||"text"},s)),a&&m("span",{className:"mapp-option-label"},a),r&&m(P,r));return t?m(E,{title:t},c):c}var x=function(e){var t=e.onChange,n=e.label,a=u(e,["onChange","label"]);return m("label",null,m("input",p({type:"radio",onChange:function(e){return t(e.target.value)}},a)),n&&m("span",{className:"mapp-option-label"},n))};function N(e){var t=m(f,null,_.map(e.options,(function(t,n){return m(x,{key:n,value:t.value,checked:e.checked==t.value,onChange:function(t){return e.onChange(t)},disabled:t.disabled,label:t.label})})),e.help&&m(P,e.help));return e.title?m(E,{title:e.title},t):t}function M(e){var t=e.title,n=e.value,a=e.label,o=e.onChange,i=e.options,l=e.help,s=e.placeholder,c=u(e,["title","value","label","onChange","options","help","placeholder"]),d=r(i);void 0!==s&&d.unshift({value:"",label:s});var h=m(f,null,m("select",p({value:null!=n?n:"",onChange:function(e){return o(e.target.value)}},c),_.map(d,(function(e,t){return m("option",{key:t,value:e.value,disabled:e.disabled},e.label)}))),a&&m("span",{className:"mapp-option-label"},a),l&&m(P,l));return t?m(E,{title:t},h):h}function I(e){var t=e.title,n=e.onChange,a=e.label,o=e.help,r=u(e,["title","onChange","label","help"]),i=m(f,null,m("textarea",p({onChange:function(e){return n(e.target.value)}},r)),a&&m("span",{className:"mapp-option-label"},a),o&&m(P,o));return t?m(E,{title:t},i):i}function A(e){var t=e.className?" "+e.className:"";return m("div",{className:"mapp-option-section"+t},m("h2",null,e.title),e.children)}function E(e){return m("div",{className:"mapp-option"},m("div",{className:"mapp-option-title"},e.title),m("div",{className:"mapp-option-value"},e.children))}function D(e){var t,n,i=o(b({dragging:null,dragover:null}),2),l=i[0],s=i[1];function c(e){s((function(t){return p(p({},t),e)}))}function u(t,n){var a=r(e.data);switch(t){case"add":var o={};_.map(e.cols,(function(e){o[e.id]=""})),a.push(o),e.onChange(a,e.selected);break;case"change":a[n.i][n.id]=n.value,e.onChange(a,e.selected);break;case"delete":var i;a.splice(n,1),i=n==e.selected?null:n<e.selected?e.selected-1:e.selected,e.onChange(a,i);break;case"select":c({selected:n}),e.onChange(a,n);break;case"sort":var s=l.dragging,p=s<p?n-1:n;a.splice(p,0,a.splice(s,1)[0]),e.onChange(a,p),c({dragover:null})}}return h((function(){}),[]),m("div",{className:e.className?"mapp-grid "+e.className:"mapp-grid"},e.data&&!!e.data.length&&m("div",{className:"mapp-grid-table"},(t=e.selectionColumn?m("div",{className:"mapp-grid-cell",key:"select"},__("Default")):null,n=m("div",{className:"mapp-grid-cell",key:"actions"},""),m("div",{className:"mapp-grid-header"},m("div",{className:"mapp-grid-row"},t,_.map(e.cols,(function(e){return m("div",{className:"mapp-grid-cell",key:e.id},e.label)})),n))),m("div",{className:"mapp-grid-body"},_.map(e.data,(function(t,n){return function(t,n){return m("div",{className:"mapp-grid-row"+(l.dragover==n?" mapp-dragover":""),draggable:!0,key:n,onDragOver:function(e){return e.preventDefault()},onDragStart:function(e){return c({dragging:n})},onDragEnter:function(e){return c({dragover:n})},onDragEnd:function(e){return c({dragging:null,dragover:null})},onDrop:function(e){return u("sort",n)}},function(t,n){if(!e.selectionColumn)return null;var a,o;switch("rowid"==e.selectionColumn?a=n:t[e.selectionColumn]?a=t[e.selectionColumn]:o=!0,e.selectionType){case"checkbox":return m("div",{className:"mapp-grid-cell"},m(C,{value:a,checked:e.selected==a,disabled:o,onChange:function(e){u("select",e?a:null)}}));case"radio":default:return m("div",{className:"mapp-grid-cell"},m(x,{checked:e.selected==a,onChange:function(){return u("select",a)}}))}}(t,n),_.map(e.cols,(function(t,o){return m("div",{className:"mapp-grid-cell mapp-grid-cell-"+t.id,key:n+"-"+o},function(t,n){if(n.onRender)return n.onRender({id:n.id,value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});switch(n.type){case"icon":return m(a.MappIconPicker,{iconid:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"input":default:return m(j,{size:e.data[t][n.size],value:e.data[t][n.id],onChange:function(e){return u("change",{i:t,id:n.id,value:e})}});case"select":return m(M,{value:e.data[t][n.id],options:n.options,onChange:function(e){u("change",{i:t,id:n.id,value:e})},placeholder:""})}}(n,t))})),function(e){return m("div",{className:"mapp-grid-cell",key:"delete"},m(v,{icon:"trash",onClick:function(){return u("delete",e)}}))}(n))}(t,n)})))),m("div",{className:"mapp-grid-toolbar"},m(v,{isSecondary:!0,onClick:function(){return u("add")}},__("Add"))))}function T(e){var t=o(b({codeEditor:null,isOpen:!1,name:null,tab:"editor",template:null,tokens:null}),2),n=t[0],a=t[1];function r(e){a((function(t){return p(p({},t),e)}))}var i,l,s=g((function(e){if(null!=e){var t=wp.codeEditor.initialize(e);t.codemirror.setSize("auto","auto"),t.codemirror.setOption("readOnly","editor"!=n.tab),r({codeEditor:t})}}),[]);function c(e,t){switch(e){case"close":r({isOpen:!1});break;case"delete":confirm(mappl10n.delete_prompt)&&(mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_delete",name:n.template.name,nonce:mappl10n.options.nonce}}),r({isOpen:!1}));break;case"insert":var a=n.codeEditor.codemirror.getDoc(),o=a.getCursor();a.replaceRange("{{{poi."+t+"}}}",o);break;case"open":mapp.lib.ajax({type:"GET",data:{action:"mapp_tpl_get",name:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!0,name:t,tab:"editor",template:e.data.template,tokens:e.data.tokens})}});break;case"save":var i="editor"==n.tab?n.codeEditor.codemirror.getValue():n.template.content;mapp.lib.ajax({type:"POST",data:{action:"mapp_tpl_save",content:i,name:n.template.name,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status&&r({isOpen:!1,template:null,tokens:null})}});break;case"tab-select":if("editor"!=t){var l=p({},n.template);l.content=n.codeEditor.codemirror.getValue(),r({template:l})}r({tab:t})}}return m("div",{className:"mapp-templates"},(l=[{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")}],m("div",{className:"mapp-templates-list"},_.map(l,(function(e,t){return m("a",{href:"#",key:e.name,className:"mapp-templates-item",onClick:function(t){t.preventDefault(),c("open",e.name)}},e.label)})))),n.isOpen&&n.template?m(O,{title:(i=n.template.name+" ("+(n.template.exists?__("Custom"):__("New"))+")",m("div",{className:"mapp-templates-name"},i)),className:"mapp-templates-modal",onRequestClose:function(){return c("close")},shouldCloseOnClickOutside:!1},m(k,{className:"mapp-templates-tabs",onSelect:function(e){return c("tab-select",e)},tabs:[{name:"editor",title:__("Editor")},{name:"standard",title:__("Default")}]},(function(e){return t=m("div",{className:"mapp-templates-tokens"},_.map(n.tokens,(function(e,t){return m("code",{onClick:function(){return c("insert",e)},key:t,title:e},e)}))),a=m("div",{className:"mapp-templates-path"},n.template.path),m(f,null,"editor"==n.tab&&a,"editor"==n.tab&&t,m("div",{className:"editor"==n.tab?"mapp-templates-editor":"mapp-templates-standard"},m("textarea",{ref:s,defaultValue:"editor"==n.tab?n.template.content:n.template.standard})));var t,a})),m("div",{className:"mapp-templates-toolbar"},m(v,{isPrimary:!0,onClick:function(){return c("save")}},__("Save")),m(v,{isSecondary:!0,onClick:function(){return c("close")}},__("Cancel")),n.template.exists&&m("a",{onClick:function(e){e.preventDefault(),c("delete")}},__("Delete")))):null)}},149:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var a=wp.element.createElement,o=(wp.data.select,wp.element),r=(o.Fragment,o.useEffect,o.useLayoutEffect,o.useRef,o.useState,wp.components),i=(r.BaseControl,r.Button),sprintf=(r.Dashicon,r.Modal,r.PanelBody,r.RadioControl,r.Spinner,r.TextControl,wp.i18n.sprintf);function l(e){function t(t,n){var a=Math.ceil(e.count/e.pageSize);switch(t){case"first":e.onChange(1);break;case"last":e.onChange(a);break;case"next":e.onChange(e.page+1);break;case"prev":e.onChange(e.page-1)}}return o=Math.ceil(e.count/e.pageSize),r=e.page<=1,l=e.page>=o,a("div",{className:"mapp-paginate"},a(i,{disabled:r,onClick:function(){return t("first")},isSecondary:!0},"«"),a(i,{disabled:r,onClick:function(){return t("prev")},isSecondary:!0},"‹"),a("div",{className:"mapp-paginate-count"},sprintf((n="%d of %d",wp.i18n.__(n,"mappress-google-maps-for-wordpress")),e.page,o)),a(i,{disabled:l,onClick:function(){return t("next")},isSecondary:!0},"›"),a(i,{disabled:l,onClick:function(){return t("last")},isSecondary:!0},"»"));var n,o,r,l}},477:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>P});var a=n(713),o=n(999),r=n(149);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var u=window.mapp||{},m=wp.element.createElement,d=wp.data.select,f=wp.element,h=(f.Fragment,f.useEffect),g=(f.useLayoutEffect,f.useRef),b=f.useState,y=wp.components,v=(y.BaseControl,y.Button),w=y.Dashicon,O=y.Modal,k=(y.PanelBody,y.RadioControl),C=y.Spinner,S=y.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function P(e){var t=p(b({isFetchingItems:!0,items:null,mode:e.mode?e.mode:"list",mapid:e.mapid?e.mapid:null,page:1,search:"",type:mappl10n.options.postid?"post":"all"}),2),n=t[0],i=t[1],s=g(null),c=g(null);function f(e){i((function(t){return l(l({},t),e)}))}function y(t,a){switch(t){case"attach":u.store.mutateMap({mapdata:a});break;case"add-new":f({mode:"edit",mapid:null});break;case"change-type":f({type:a});break;case"close":e.onAction("pick-close");break;case"duplicate":u.store.duplicateMap({mapid:a,success:function(e){alert(__("Map copied")),f({mapid:e.mapid}),jQuery(".mapp-pick-items").scrollTop(0)}});break;case"destroy":confirm(mappl10n.delete_map_prompt)&&(u.store.destroyMap({mapid:a}),a==n.mapid&&e.onAction("pick-destroy",a)),s.current.focus();break;case"edit":f({mode:"edit",mapid:a});break;case"edit-close":"edit"==e.mode?e.onAction("pick-close"):f({mode:"list"});break;case"edit-destroy":f({mode:"list",mapid:null}),e.onAction("pick-destroy",a);break;case"edit-save":"edit"==e.mode?e.onAction("pick-close",a):f({mode:"list",mapid:a});break;case"insert":e.onAction("pick-insert",a);break;case"shortcode":e.onAction("pick-shortcode",a);break;case"sort":u.store.setSort({sortBy:a,sortAsc:u.store.state.sortBy!=a||!u.store.state.sortAsc})}}function P(t){var o,r=t.mapid==n.mapid;o=t.map_title?t.map_title:__("Untitled");var i=function(t){var n;return n=(n="map"==e.context||"mashup"==e.context&&t.postid==mappl10n.options.postid?d("core/editor").getEditedPostAttribute("title"):t.post_title)||__("Untitled"),t.postid>0&&t.postid==mappl10n.options.postid&&(n=__("Current post")),t.postid>0?t.postid==mappl10n.options.postid?n:m("a",{href:mappl10n.options.editurl+"?post="+t.postid+"&action=edit",target:"_blank",title:__("Edit post")},n):__("Unattached")}(t),l=[{action:"edit",label:__("Edit")},{action:"insert",label:__("Insert into post")},{action:"duplicate",label:__("Copy")},{action:"shortcode",label:__("Shortcode")},{action:"destroy",label:__("Delete")}];"library"==e.context?l.splice(1,1):l.splice(3,1),l=m("div",{className:"mapp-pick-actions"},l.map((function(e){return m("a",{href:"#",key:e.action,onClick:function(n){n.stopPropagation(),n.preventDefault(),y(e.action,t.mapid)}},e.label)})));var s=null;return s=t.postid>0?m("a",{href:"#",onClick:function(){return y("attach",{mapid:t.mapid,postid:0})}},__("Detach")):"library"==e.context?m(a.default,{onChange:function(e,n){return y("attach",{mapid:t.mapid,postid:e,post_title:n})}},__("Attach")):m("a",{href:"#",onClick:function(){return y("attach",{mapid:t.mapid,postid:mappl10n.options.postid,post_title:null})}},__("Attach")),m("div",{className:"mapp-pick-item"+(r?" mapp-selected":""),key:t.mapid+"|"+t.postid,ref:r?c:null},m("div",{className:"mapp-pick-col-map_title",onClick:function(e){return y("edit",t.mapid)}},m("div",null,o),m("div",null,l)),m("div",{className:"mapp-pick-col-mapid"},t.mapid),m("div",{className:"mapp-pick-col-post_title"},i,m("div",null,s)))}h((function(){var e=function(e){f({isFetchingItems:e.isFetchingItems,isSavingMap:e.isSavingMap,items:e.items})};return u.store.subscribe(e),function(){return u.store.unsubscribe(e)}})),h((function(){s.current&&s.current.focus(),u.store.fetchItems()}),[]),h((function(){f({page:1})}),[n.type,n.search]),h((function(){c.current&&u.lib.scrollTo(jQuery(".mapp-pick-items"),jQuery(c.current))}),[n.type,n.items]);var j=_.filter(n.items,(function(t){if("post"==n.type&&t.postid!=mappl10n.options.postid)return!1;if("current"==n.type&&t.mapid!=e.mapid)return!1;var a=n.search.toLowerCase();return!a||(t.mapid.indexOf(a)>=0||(!!(t.post_title&&t.post_title.toLowerCase().indexOf(a)>=0)||!!(t.map_title&&t.map_title.toLowerCase().indexOf(a)>=0)))})),x=m("div",{className:"mapp-list-panel"},m("div",{className:"mapp-gt-modal-header"},m("div",{className:"mapp-gt-modal-header-title"},m("h1",null,__("Select a map")),m(v,{isPrimary:!0,onClick:function(){return y("add-new")}},__("Add New"))),m(v,{onClick:function(){return y("close")},icon:"no-alt"})),function(){var t=[{label:__("Attached to post"),value:"post"},{label:__("All maps"),value:"all"}];e.mapid&&t.unshift({label:__("Current map"),value:"current"});var a="library"==e.context?null:m(k,{className:"mapp-pick-type",options:t,onChange:function(e){return y("change-type",e)},selected:n.type}),o=n.isFetchingItems||n.isAttaching&&"library"!=e.context;return m("div",{className:"mapp-pick-filter"},o&&m(C,null),m(S,{ref:s,className:"mapp-pick-search",tabIndex:1,label:__("Search"),placeholder:__("post title, map title, or map id"),onChange:function(e){return f({search:e})}}),a)}(),function(e){if(e){var t=20*(n.page-1),a=t+20;e=e.slice(t,a)}var o,r="";return r=n.isFetchingItems?null:e.length?_.map(e,P):m("div",{className:"mapp-pick-message"},__("No maps found")),m("div",{className:"mapp-pick-items-section"},m("div",{className:"mapp-pick-items"},(o={map_title:__("Map title"),mapid:__("Map ID"),post_title:__("Attached to")},m("div",{className:"mapp-pick-items-header"},_.map(o,(function(e,t){return m("div",{className:"mapp-pick-col-"+t,onClick:function(){return y("sort",t)},key:t},e,u.store.state.sortBy==t&&m(w,{icon:u.store.state.sortAsc?"arrow-up":"arrow-down"}))})))),r))}(j),function(e){return m("div",{className:"mapp-pick-toolbar"},function(e){return e&&e.length?m(r.Z,{count:e?e.length:0,onChange:function(e){return f({page:e})},page:n.page,pageSize:20}):null}(e))}(j)),N=null;if("edit"==n.mode){var M=m("div",{className:"mapp-edit-panel"},m(o.default,{context:e.context,mapid:n.mapid,onAction:y}));N="library"==e.context?m(O,{className:"mapp-gt-modal",isDismissible:!1},M):M}var I="mapp-pick mapp-mode-"+n.mode+" mapp-context-"+e.context;return"library"==e.context?m("div",{className:I},x,N):m(O,{className:"mapp-gt-modal "+I,isDismissible:"list"==n.mode,onRequestClose:function(){return y("close")},shouldCloseOnEsc:"list"==n.mode,shouldCloseOnClickOutside:"list"==n.mode},x,N)}},429:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappSettings:()=>y});var a=n(710);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}window.mapp;var i=wp.element.createElement,l=wp.element,s=l.Fragment,p=(l.useEffect,l.useLayoutEffect,l.useRef,l.useState),c=wp.components,u=c.BaseControl,m=c.Button,d=c.ButtonGroup,f=(c.Dashicon,c.Dropdown,c.Panel,c.PanelBody),h=c.PanelRow,g=(c.RadioControl,c.SelectControl),b=c.TextControl,__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function y(e){var t,n=o(p({}),2);n[0],n[1];function r(e){if(!e||"string"!=typeof e)return e;var t={px:2048,vw:100,vh:100,"%":100},n=parseInt(e),a=2048,o="";for(var r in t)e.includes(r)&&(o=r,a=t[r]);return n>a?a+o:e}function l(t,n){var a=null;switch(t){case"poiList":e.map.set({poiList:n}),a={poiList:n};break;case"size":n.hasOwnProperty("height")&&(n.height=r(n.height)),n.hasOwnProperty("width")&&(n.width=r(n.width)),e.map.setSize(n),a=n;break;case"style-set-maptypeid":e.map&&e.map.set({mapTypeId:n}),a={mapTypeId:n};break;case"viewport-reset":e.map.center=e.map.zoom=null,e.map.recenter(),a={center:void 0,zoom:void 0};break;case"viewport-set":var o=e.map.getCenter().toJSON();e.map.center=o,e.map.zoom=e.map.getZoom(),a={center:o.lat+","+o.lng,zoom:e.map.getZoom()},"mce"==e.context||"library"==e.context?alert(__("Viewport set")):wp.data.dispatch("core/notices").createNotice("success",__("Viewport set"),{type:"snackbar",isDismissible:!0})}a&&e.onAction("change-settings",a)}return i("div",{className:"mapp-settings"},i(f,{title:__("Map settings")},(t=e.map.title?e.map.title:__("Untitled"),i(h,null,"map"==e.context&&i(u,{className:"mapp-settings-title"},t),i(u,{className:"mapp-settings-id",label:__("Map ID")},e.map.mapid))),function(){if("mashup"==e.context)return i(h,{className:"mapp-style-toggle"},__("Style"),i(a.m,{map:e.map,selected:e.map.mapTypeId,onChange:function(e){return l("style-set-maptypeid",e)}}))}(),function(){var t=mappl10n.options.sizes[mappl10n.options.size]?mappl10n.options.sizes[mappl10n.options.size]:mappl10n.options.sizes[0],n=mappl10n.options.sizes.map((function(e,t){return{label:e.width+" X "+e.height,height:e.height,width:e.width,value:t+1}}));n.unshift({height:"",label:__("Default"),value:0,width:""}),n.push({label:__("Custom"),value:"custom",disabled:!0});for(var a="custom",o=0;o<n.length-1;o++)n[o].width==e.width&&n[o].height==e.height&&(a=o);return i(s,null,i(g,{className:"mapp-settings-dims-select",help:"",label:__("Size"),value:a,options:n,onChange:function(e){return l("size",{width:n[e].width,height:n[e].height})}}),i(h,null,i(b,{className:"mapp-settings-dims-custom",help:__("px, %, vw"),label:__("Width"),onChange:function(e){return l("size",{width:e})},placeholder:t.width,value:e.width?e.width:""}),i(b,{className:"mapp-settings-dims-custom",help:__("px, %, vh"),label:__("Height"),onChange:function(e){return l("size",{height:e})},placeholder:t.height,value:e.height?e.height:""})))}(),(e.center&&(e.center.lat,e.center.lng,__("Zoom"),e.zoom),i(s,null,i(u,{className:"mapp-settings-viewport",label:__("Center/Zoom")},i(d,{label:__("Center/Zoom")},i(m,{onClick:function(){return l("viewport-reset")},isPressed:!e.center,isSmall:!0},__("Automatic")),i(m,{onClick:function(){return l("viewport-set")},isPressed:e.center,isSmall:!0},__("Set"))))))))}},787:()=>{function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var r=window.mapp||{};r.Store=function(){this.subs=new Set,this.state={isFetchingMap:!1,isFetchingItems:!1,isSavingMap:!1,itemsFetched:!1,sortBy:"map_title",sortAsc:!0,maps:{},items:[]}},r.Store.prototype={createMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t;this.state.isFetchingMap=!1,this.publish(),n()},destroyMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;r.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(delete l.state.maps[t],l.destroyItem(t),a(t)):i(),l.publish()}})},duplicateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapid,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_duplicate",mapid:t,postid:mappl10n.options.postid,nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),a(t)}else i();l.state.isSavingMap=!1,l.publish()}})},fetchMap:function(e){var t=e.mapid,n=e.success,a=void 0===n?function(){}:n,o=(e.failure,this);if(void 0!==this.state.maps[t])return o.publish(),void a(this.state.maps[t]);this.state.isFetchingMap=!0,o.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(o.state.maps[t]=e.data,a(e.data)):o.state.maps[t]=null,o.state.isFetchingMap=!1,o.publish()}})},mutateMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;this.state.isSavingMap=!0,this.saveItem(t),this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_mutate",mapdata:t,nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(l.state.maps[e.data.mapid]=e.data,a(t)):i(),l.state.isSavingMap=!1,l.publish()}})},saveMap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mapdata,n=e.success,a=void 0===n?function(){}:n,o=e.failure,i=void 0===o?function(){}:o,l=this;this.state.isSavingMap=!0,this.publish(),r.lib.ajax({type:"POST",data:{action:"mapp_save",mapdata:JSON.stringify(t),nonce:mappl10n.options.nonce},callback:function(e){if(e&&"OK"==e.status){var t=e.data,n=t.mapid;l.state.maps[n]=t,l.saveItem(t),a(t)}else i();l.state.isSavingMap=!1,l.publish()}})},destroyItem:function(e){var t=this.state.items?this.state.items:[],a=_.findIndex(t,{mapid:e});a>-1&&t.splice(a,1),this.state.items=n(t),this.publish()},fetchItems:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.success,n=void 0===t?function(){}:t,a=e.failure,o=void 0===a?function(){}:a,i=this;if(this.state.itemsFetched)return n(this.state.items),void i.publish();this.state.isFetchingItems=!0,i.publish(),r.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(e){e&&"OK"==e.status?(i.state.items=e.data,i.sort(),n(i.state.items),i.state.itemsFetched=!0):o(),i.state.isFetchingItems=!1,i.sort(),i.publish()}})},saveItem:function(n){var a=this.state.items?this.state.items:[],o=_.findWhere(a,{mapid:n.mapid});o?(o.mapid=void 0!==n.mapid?n.mapid:o.mapid,o.map_title=void 0!==n.title?n.title:o.map_title,o.postid=void 0!==n.postid?n.postid:o.postid,o.post_title=void 0!==n.post_title?n.post_title:o.post_title,o=function(n){for(var a=1;a<arguments.length;a++){var o=null!=arguments[a]?arguments[a]:{};a%2?e(Object(o),!0).forEach((function(e){t(n,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}({},o)):(o={mapid:n.mapid,map_title:n.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){var n,a=this,o=(n="untitled",wp.i18n.__(n,"mappress-google-maps-for-wordpress"));this.state.items.sort((function(e,t){return function(e,t,n,a){if(a=a?1:-1,"mapid"==n)return a*(Number(e.mapid)-Number(t.mapid));var r=e[n]?e[n]:o,i=t[n]?t[n]:o,l=a*r.localeCompare(i);return 0==l?Number(e.mapid)-Number(t.mapid):l}(e,t,a.state.sortBy,a.state.sortAsc)}))},subscribe:function(e){this.subs.add(e)},unsubscribe:function(e){this.subs.delete(e)},publish:function(){var e,t=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(_e){throw _e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw i}}}}(n(this.subs));try{for(t.s();!(e=t.n()).done;){(0,e.value)(this.state)}}catch(e){t.e(e)}finally{t.f()}}},r.store=new r.Store},710:(e,t,n)=>{"use strict";n.d(t,{m:()=>w});var a=n(824),o=n(149);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var c=wp.element.createElement,u=wp.element,m=u.Fragment,d=(u.useEffect,u.useLayoutEffect,u.useRef,u.useState),f=wp.components,h=f.Button,g=(f.Dashicon,f.ExternalLink),b=f.Icon,y=f.Modal,v=(f.Panel,f.PanelBody,f.PanelRow,f.Spinner),__=function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")};function w(e){var t,n,r,l,p,u,f,w=s(d({apiKey:"6a0cfe9e-3670-4598-a63e-f1627b5c9e56",snazzyPagination:null,snazzySearch:"",snazzyStyles:null,isOpen:!1,isSaving:!0,isSearching:!1,json:"",map:null,mapboxError:"",mapboxId:"",mapboxName:"",mapboxUser:"",mapboxUrl:"",mapboxParsedUrl:"",mode:"pick",page:1,style:mappl10n.options.style,standardStyles:mappl10n.options.standardStyles,userStyles:mappl10n.options.userStyles}),2),O=w[0],k=w[1];function C(e){k((function(t){return i(i({},t),e)}))}function S(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=_.findIndex(O.userStyles,{id:t.id});if(a>=0){if(!n&&!confirm(__("Style already exists, overwrite?")))return;mappl10n.options.userStyles[a]=t}else mappl10n.options.userStyles.push(t);C({isOpen:!1,mode:"pick",userStyles:mappl10n.options.userStyles,selected:t.id}),e.onChange(t.id),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",settings:"leaflet"==mappl10n.options.engine?{stylesMapbox:mappl10n.options.userStyles}:{stylesGoogle:mappl10n.options.userStyles},nonce:mappl10n.options.nonce},callback:function(e){}})}function P(e){C({isSearching:!0,snazzyStyles:null}),mapp.lib.ajax({type:"GET",data:{sort:"popular",page:e,pageSize:20,text:O.snazzySearch,key:O.apiKey},url:"https://snazzymaps.com/explore.json",callback:function(e){(C({isSearching:!1,snazzyPagination:e&&e.pagination?e.pagination:null}),e&&e.styles)?C({snazzyStyles:_.map(e.styles,(function(e,t){return e.id=e.id+"",e}))}):alert("Error: unable to fetch styles")}})}function j(e,t){t="large"==t||"small"==t?t:"small",t=800;var n=mappl10n.options.baseurl+"/images/roadmap.png";return"leaflet"==mappl10n.options.engine?mappl10n.options.mapbox?e.user&&e.mapboxid&&(n="https://api.mapbox.com/styles/v1/"+e.user+"/"+e.mapboxid+"/static/-122.4194,37.7749,10,0/800x800?access_token="+mappl10n.options.mapbox):n=mappl10n.options.baseurl+"/images/osm.png":e.imageUrl&&(n=e.imageUrl),c("img",{src:n,title:e.name})}function x(t,n){switch(t){case"close":C({isOpen:!1});break;case"json-cancel":C({mode:"pick"});break;case"json-change":C({json:n});break;case"json-save":var a=_.findWhere(O.userStyles,{id:e.selected});a&&(a.json=JSON.stringify(JSON.parse(O.json)),S(a,!0));break;case"mapbox-cancel":C({mode:"pick"});break;case"mapbox-change-url":var o,r,i=n.trim().toLowerCase().replace(".html","").replace("https://api.mapbox.com/styles/v1/","").replace("mapbox://styles/","").split("?")[0].split("/");2==i.length&&(o=i[0],r=i[1]),C({mapboxUrl:n,mapboxUser:o,mapboxId:r});break;case"mapbox-save":O.mapboxName&&O.mapboxUser&&S({id:O.mapboxId,name:O.mapboxName,mapboxid:O.mapboxId,provider:"mapbox",url:O.mapboxUrl,user:O.mapboxUser});break;case"mode":C({mode:n});break;case"open":"leaflet"!=mappl10n.options.engine||mappl10n.options.mapbox?C({isOpen:!0}):alert(__("Please enter a Mapbox access token in the MapPress settings screen."));break;case"pick-add":alert(__("Please upgrade to MapPress Pro to use custom styles"));break;case"pick-cancel":C({isOpen:!1});break;case"pick-delete":confirm(mappl10n.delete_prompt)&&function(t){var n=_.findIndex(O.userStyles,{id:t});if(n<0)mapp.lib.alert("Invalid delete");else{var a=O.userStyles;a.splice(n,1),mappl10n.options.userStyles=a,C({userStyles:a}),e.selected==t&&e.onChange(null),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",settings:"leaflet"==mappl10n.options.engine?{stylesMapbox:a}:{stylesGoogle:a},nonce:mappl10n.options.nonce},callback:function(e){}})}}(n);break;case"pick-edit":e.onChange(n.id),"leaflet"==mappl10n.options.engine?C({mode:"mapbox",mapboxId:n.mapboxid,mapboxName:n.name,mapboxUrl:n.url,mapboxUser:n.user}):C({json:n.json,mode:"json"});break;case"pick-select":e.onChange(n.id),C({isOpen:!1});break;case"snazzy-cancel":C({mode:"pick"});break;case"snazzy-save":var l=n;l&&S({id:l.id,imageUrl:l.imageUrl,json:l.json,name:l.name});break;case"snazzy-search":P()}}function N(e){var t;return t=e.styles&&e.styles.length?_.map(e.styles,(function(t,n){return function(e,t){var n="mapp-style"+(t.selected==e.id?" mapp-selected":""),a=t.onDelete?c(b,{icon:"trash",onClick:function(){return t.onDelete(e.id)}}):null,o=t.onEdit?c("a",{onClick:function(){return t.onEdit(e)}},__("Edit")):null;return c("div",{className:n,key:e.id},c("div",{className:"mapp-style-image",onClick:function(){return t.onSelect(e)}},j(e)),c("div",{className:"mapp-style-details"},c("div",{className:"mapp-style-title"},e.name),c("div",{className:"mapp-style-actions"},o,a)))}(t,e)})):O.isSearching?"":c("div",{className:"mapp-style-list-msg"},__("No results")),c("div",{className:"mapp-style-list-wrapper"},c("div",{className:"mapp-style-list-header"},e.title),c("div",{className:"mapp-style-list"},t))}return c(m,null,(p=O.standardStyles.concat(O.userStyles),u=!mappl10n.options.style||"roadmap"!=e.selected&&"streets"!=e.selected&&e.selected?e.selected:mappl10n.options.style,f=(f=_.findWhere(p,{id:u}))||O.standardStyles[0],c(h,{className:"mapp-style-toggle",icon:j(f),iconSize:75,isSecondary:!0,onClick:function(){return x("open",null)},title:f.name})),"edit"==O.mode&&O.isOpen&&renderEdit(),"json"==O.mode&&O.isOpen&&function(){var e,t,n;try{e=JSON.parse(O.json),t=JSON.stringify(e,null,2)}catch(e){n=e.toString(),t=O.json}var a=n?"mapp-style-json mapp-style-error":"mapp-style-json";return c(y,{title:__("Edit style JSON"),className:"mapp-style-modal",onRequestClose:function(){return x("json-cancel")},shouldCloseOnClickOutside:!0},c("div",{className:a},c("textarea",{value:t,spellCheck:!1,onChange:function(e){return x("json-change",e.target.value)}})),c("div",{className:"mapp-style-json-error"},n||""),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{disabled:n,isPrimary:!0,onClick:function(){return x("json-save")}},__("Save")),c(h,{onClick:function(){return x("json-cancel")}},__("Cancel")))))}(),"mapbox"==O.mode&&O.isOpen&&(r=O.mapboxUser&&O.mapboxId?j({user:O.mapboxUser,mapboxid:O.mapboxId,name:O.mapboxName},"large"):null,l=!O.mapboxUser||!O.mapboxId||!O.mapboxName,c(y,{title:__("Add style"),className:"mapp-style-modal",onRequestClose:function(){return x("mapbox-cancel")},shouldCloseOnClickOutside:!0},c("div",{className:"mapp-style-mapbox-title"},__("Enter style from Mapbox Studio"),c(g,{href:"https://studio.mapbox.com"})),c("form",{className:"mapp-style-mapbox-form",onSubmit:function(e){e.stopPropagation(),e.preventDefault(),x("mapbox-save",O.snazzySelected)}},c("label",null,c("span",{className:"mapp-style-mapbox-label"},__("MapBox Share URL")),c(a.Help,{href:"#toc-mapbox-studio-styles"}),c(a.Input,{autoFocus:!0,className:"mapp-style-mapbox-url",value:O.mapboxUrl,onChange:function(e){return x("mapbox-change-url",e)}})),c("label",null,c("div",{className:"mapp-style-mapbox-label"},__("Style name")),c(a.Input,{className:"mapp-style-mapbox-name",value:O.mapboxName,onChange:function(e){return C({mapboxName:e})}})),c("div",{className:"mapp-style-mapbox-preview"},r),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{isPrimary:!0,disabled:l,type:"submit"},__("Save")),c(h,{onClick:function(){return x("mapbox-cancel")}},__("Cancel"))))))),"pick"==O.mode&&O.isOpen&&(n="",O.userStyles&&O.userStyles.length&&(n=N({selected:e.selected,onEdit:function(e){return x("pick-edit",e)},onDelete:function(e){return x("pick-delete",e)},onSelect:function(e){return x("pick-select",e)},styles:O.userStyles,title:__("Custom styles")})),c(y,{title:c("div",{className:"mapp-style-header"},__("Select a style")),className:"mapp-style-modal",onRequestClose:function(){return x("close")}},c("div",{className:"mapp-style-list-wrapper"},N({onSelect:function(e){return x("pick-select",e)},selected:e.selected,styles:O.standardStyles,title:__("Standard styles")}),n),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{isPrimary:!0,onClick:function(){return x("pick-add")}},__("New style")),c(h,{onClick:function(){return x("pick-cancel")}},__("Cancel")))))),"snazzy"==O.mode&&O.isOpen&&(O.snazzySelected,c(y,{title:__("Download style"),className:"mapp-style-modal mapp-style-modal-snazzy",onRequestClose:function(){return x("snazzy-cancel")},shouldCloseOnClickOutside:!0},c("form",{className:"mapp-style-snazzy-form",onSubmit:function(e){x("snazzy-search"),e.preventDefault()}},c(a.Input,{className:"mapp-style-snazzy-search",value:O.search,placeholder:__("Search"),onChange:function(e){return C({snazzySearch:e})}}),O.isSearching&&c(v,null),!O.isSearching&&c(h,{isPrimary:!0,icon:"search",onClick:function(){return x("snazzy-search")}})),N({selected:O.snazzySelected,styles:O.snazzyStyles,onSelect:function(e){return x("snazzy-save",e)}}),c("div",{className:"mapp-style-toolbar"},c("div",null,c(h,{onClick:function(){return x("snazzy-cancel")}},__("Cancel"))),(t=O.snazzyPagination)&&O.snazzyStyles&&O.snazzyStyles.length?c(o.Z,{count:t.totalItems,onChange:function(e){return P(e)},page:t.currentPage,pageSize:t.pageSize}):null))))}},214:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MappCard:()=>w});n(824);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],_n=!0,a=!1,_e=void 0;try{for(var o,r=e[Symbol.iterator]();!(_n=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){a=!0,_e=e}finally{try{_n||null==r.return||r.return()}finally{if(a)throw _e}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function s(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=wp.element.createElement,c=wp.element,u=c.Fragment,m=c.useEffect,d=(c.useLayoutEffect,c.useCallback,c.useRef),f=c.useState,h=(wp.data.useSelect,wp.components),g=h.Button,b=h.Dashicon,y=h.ExternalLink,v=h.Guide,__=(h.Modal,function(e){return wp.i18n.__(e,"mappress-google-maps-for-wordpress")});function w(e){var t=e.icon,n=e.title,a=s(e,["icon","title"]);return p("div",{className:"mapp-support-card"},n&&p("div",{className:"mapp-support-card-title"},p("h3",null,t&&p(b,{icon:t}),n)),p("div",{className:"mapp-support-card-content"},a.children))}document.getElementById("mapp-support-page")&&wp.element.render(p((function(e){var t=i(f({engine:e.engine?e.engine:"leaflet",isOpen:e.isOpen,apiKey:e.apiKey,mapbox:e.mapbox}),2),n=t[0],a=t[1];function r(e){a((function(t){return o(o({},t),e)}))}function l(e){return p("div",{className:"mapp-guide-engine"+(e.selected?" mapp-selected":""),onClick:function(){return e.onClick()}},p("h2",{className:"mapp-guide-engine-title"},e.title),p("div",{className:"mapp-guide-engine-content"},e.content))}return d(null),m((function(){}),[]),p("div",{className:"mapp-support"},p(u,null,p("div",{className:"mapp-support-section"},p("div",{className:"mapp-support-header"},p("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}),p("h1",null,__("Welcome to MapPress")),p("i",null,__("Build amazing maps with the easiest and most powerful mapping plugin available")),p("div",null,p("p",null,__("Get started with the setup wizard:"),p(g,{className:"mapp-support-guide-toggle",isPrimary:!0,onClick:function(){return r({isOpen:!0})}},__("Open Wizard")))))),p("div",{className:"mapp-support-section"},p("div",{className:"mapp-support-cards"},p(w,{icon:"book",title:__("Documentation")},p("p",null,__("Detailed plugin documentation:")),p(y,{href:"https://mappresspro.com/mappress-documentation/"},__("Documentation")),p(y,{href:"https://mappresspro.com/whats-new/"},__("What's new")),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Creating your first map"))),p(w,{icon:"warning",title:__("Troubleshooting")},p("p",null,p("b",null,__("Check for a plugin or theme conflict:"))),p("ol",null,p("li",null,__("Deactivate ALL other plugins")),p("li",null,__("Switch to a standard WordPress theme")),p("li",null,__("If the maps are working, reactivate one by one to find the conflict."))),p("p",null,__("For more info:")),p(y,{href:"https://mappresspro.com/mappress-faq/"},__("MapPress FAQ"))),p(w,{icon:"megaphone",title:__("Support")},p("p",null,__("Need some help?")),p(y,{href:"https://mappresspro.com/forums/forum/mappress-support/"},__("Support forum")),p(y,{href:"https://mappresspro.com/chris-contact/"},__("Contact")))))),function(){if(n.isOpen)return p(v,{className:"mapp-guide",onFinish:function(){return function(e,t){switch(e){case"save":r({isOpen:!1}),mapp.lib.ajax({type:"POST",data:{action:"mapp_option_save",nonce:mappl10n.options.nonce,settings:{engine:n.engine,apiKey:n.apiKey,mapbox:n.mapbox}},callback:function(e){"OK"!=e.status&&alert("Unable to save settings. Please check the support troubleshooting guide.")}})}}("save")},pages:[{content:p("div",{className:"mapp-guide-page mapp-guide-engines"},p("h1",null,__("Choose a Mapping API")),p("p",null,__("MapPress supports both Leaflet and Google mapping APIs."),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-picking-a-mapping-api"},__("Learn more"))),p("div",{className:"mapp-guide-engines"},l({onClick:function(){return r({engine:"leaflet"})},selected:"leaflet"==n.engine,title:"Leaflet",content:p("ul",null,p("li",null,__("No API key")),p("li",null,__("Free unlimited usage")),p("li",null,__("Good functionality")),p("li",null,__("Best for high traffic sites")))}),l({onClick:function(){return r({engine:"google"})},selected:"google"==n.engine,title:"Google",content:p("ul",null,p("li",null,__("API key required")),p("li",null,__("Limited free usage")),p("li",null,__("Excellent functionality")),p("li",null,__("Best for low traffic sites")))}))),image:p("div",{className:"mapp-guide-image mapp-guide-image-small"},p("img",{src:mappl10n.options.baseurl+"/images/icon-128x128.png"}))},{content:"google"==n.engine?p("div",{className:"mapp-guide-page mapp-guide-apikey"},p("h1",null,__("Get a Google API Key")),p("p",null,__("Google requires an API key and billing information.")),p("p",null,__("Use the button below to get an API key with the correct mapping libraries selected"),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-google-api-keys"},__("Learn more"))),p(g,{isPrimary:!0,href:"https://console.cloud.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend,places_backend,geolocation,static_maps_backend&keyType=CLIENT_SIDE&reusekey=true",target:"_blank"},__("Get API Key")),p("input",{className:"mapp-guide-apikey",onChange:function(e){return r({apiKey:e.target.value})},placeholder:__("Enter your API key here"),value:n.apiKey})):p("div",{className:"mapp-guide-page mapp-guide-apikey"},p("h1",null,__("Sign up with Mapbox")),p("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."),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-using-mapbox-with-leaflet"},__("Learn more"))),p(g,{isPrimary:!0,href:"https://account.mapbox.com/auth/signup/",target:"_blank"},__("Get Mapbox Access Token")),p("input",{className:"mapp-guide-apikey",onChange:function(e){return r({mapbox:e.target.value})},placeholder:__("Enter your access token here"),value:n.mapbox})),image:p("div",{className:"mapp-guide-image mapp-guide-image-small"},p("img",{src:mappl10n.options.baseurl+"/images/mapbox_logo_white.png"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-gutenberg"},p("h1",null,__("Maps in the Block Editor")),p("p",null,__("MapPress provides custom block types for the Gutenberg editor.")),p("p",null,__("Just insert a MapPress Map block to get started."),p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-gutenberg-block-editor"},__("Learn more")))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/gutenberg_map_block.gif"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-classic"},p("h1",null,__("Maps in the Classic Editor")),p("p",null,__('MapPress also supports the "classic" editor. Just click the MapPress button to open the map library.')),p("p",null,p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-create-a-map-with-the-classic-editor"},__("Learn more")))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/classic_map.gif"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-library"},p("h1",null,__("Map Library")),p("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.")),p("p",null,p(y,{href:"https://mappresspro.com/mappress-documentation/#toc-map-library-and-map-editors"},__("Learn more")))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/library_menu.gif"}))},{content:p("div",{className:"mapp-guide-page mapp-guide-end"},p("h1",null,__("Happy Mapping")),p("p",null,__("Enjoy the plugin! Replay this guide any time from the MapPress support menu."))),image:p("div",{className:"mapp-guide-image"},p("img",{src:mappl10n.options.baseurl+"/images/icon-128x128"}))}]})}())}),mappress_support_state),document.getElementById("mapp-support-page"))},308:(e,t,n)=>{"use strict";e.exports=function(e,t){var a,o,r,i,l,s,p,c,u,m,d,f,h,g=String(e).replace(/^&/,"").replace(/&$/,"").split("&"),b=g.length,y=function(e){return decodeURIComponent(e.replace(/\+/g,"%20"))},v="undefined"!=typeof window?window:n.g;v.$locutus=v.$locutus||{};var w=v.$locutus;for(w.php=w.php||{},t||(t=v),a=0;a<b&&(u=y((c=g[a].split("="))[0]),m=c.length<2?"":y(c[1]),!(u.includes("__proto__")||u.includes("constructor")||u.includes("prototype")));a++){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(f=[],d=0,o=0;o<u.length;o++)if("["!==u.charAt(o)||d){if("]"===u.charAt(o)&&d&&(f.length||f.push(u.slice(0,d-1)),f.push(u.substr(d,o-d)),d=0,"["!==u.charAt(o+1)))break}else d=o+1;for(f.length||(f=[u]),o=0;o<f[0].length&&(" "!==(p=f[0].charAt(o))&&"."!==p&&"["!==p||(f[0]=f[0].substr(0,o)+"_"+f[0].substr(o+1)),"["!==p);o++);for(s=t,o=0,h=f.length;o<h;o++){if(l=s,(""===(u=f[o].replace(/^['"]/,"").replace(/['"]$/,""))||" "===u)&&0!==o){for(i in r=-1,s)s.hasOwnProperty(i)&&+i>r&&i.match(/^\d+$/g)&&(r=+i);u=r+1}Object(s[u])!==s[u]&&(s[u]={}),s=s[u]}l[u]=m}}}}},t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={exports:{}};return e[a](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(787),n(844),n(215),n(713),n(525),n(371),n(999),n(143),n(938),n(816),n(378),n(498),n(670),n(218),n(824),n(477),n(429),n(214)})();
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.67.1\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: 2021-07-26T18:25:15+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
 
@@ -34,7 +34,7 @@ msgid "https://www.mappresspro.com/chris-contact"
34
  msgstr ""
35
 
36
  #: mappress.php:190
37
- #: mappress.php:777
38
  msgid "Settings"
39
  msgstr ""
40
 
@@ -62,125 +62,125 @@ msgstr ""
62
  msgid "MapPress Settings"
63
  msgstr ""
64
 
65
- #: mappress.php:520
66
  msgid "renew your license"
67
  msgstr ""
68
 
69
- #: mappress.php:521
70
  msgid "Your MapPress license has expired. Please %s to get the latest updates and prevent errors."
71
  msgstr ""
72
 
73
- #: mappress.php:530
74
  msgid "Please enter your MapPress license key to enable plugin updates"
75
  msgstr ""
76
 
77
- #: mappress.php:534
78
  msgid "MapPress Gutenberg blocks require WordPress 5.3 or the latest Gutenberg Plugin. Please update if using the block editor."
79
  msgstr ""
80
 
81
- #: mappress.php:538
82
  msgid "MapPress has many new features! %s."
83
  msgstr ""
84
 
85
- #: mappress.php:538
86
- #: mappress.php:542
87
- #: mappress.php:546
88
  msgid "Learn more"
89
  msgstr ""
90
 
91
- #: mappress.php:542
92
  msgid "MapPress popup templates have changed! Please update custom templates to the new format. %s."
93
  msgstr ""
94
 
95
- #: mappress.php:546
96
  msgid "MapPress templates and filters have changed. Please update custom templates and filters. %s."
97
  msgstr ""
98
 
99
- #: mappress.php:611
100
  msgid "Are you sure you want to delete?"
101
  msgstr ""
102
 
103
- #: mappress.php:612
104
  msgid "Permanently delete this map from the map library?"
105
  msgstr ""
106
 
107
- #: mappress.php:613
108
  msgid "Error reading KML file"
109
  msgstr ""
110
 
111
- #: mappress.php:614
112
  msgid "URL for KML file"
113
  msgstr ""
114
 
115
- #: mappress.php:615
116
  msgid "Loading"
117
  msgstr ""
118
 
119
- #: mappress.php:616
120
  msgid "Please select an editor to insert into."
121
  msgstr ""
122
 
123
- #: mappress.php:617
124
  msgid "Unable to get your location"
125
  msgstr ""
126
 
127
- #: mappress.php:618
128
  msgid "No results"
129
  msgstr ""
130
 
131
- #: mappress.php:619
132
  msgid "Save changes?"
133
  msgstr ""
134
 
135
- #: mappress.php:620
136
  msgid "Shape"
137
  msgstr ""
138
 
139
- #: mappress.php:650
140
- #: mappress.php:659
141
  msgid "Streets"
142
  msgstr ""
143
 
144
- #: mappress.php:651
145
  msgid "Outdoors"
146
  msgstr ""
147
 
148
- #: mappress.php:652
149
  msgid "Light"
150
  msgstr ""
151
 
152
- #: mappress.php:653
153
  msgid "Dark"
154
  msgstr ""
155
 
156
- #: mappress.php:654
157
- #: mappress.php:667
158
  msgid "Satellite"
159
  msgstr ""
160
 
161
- #: mappress.php:655
162
  msgid "Satellite Streets"
163
  msgstr ""
164
 
165
- #: mappress.php:665
166
  msgid "Roadmap"
167
  msgstr ""
168
 
169
- #: mappress.php:666
170
  msgid "Terrain"
171
  msgstr ""
172
 
173
- #: mappress.php:668
174
  msgid "Hybrid"
175
  msgstr ""
176
 
177
- #: mappress.php:778
178
- #: mappress_settings.php:390
179
- #: mappress_settings.php:416
180
  msgid "What's new"
181
  msgstr ""
182
 
183
- #: mappress.php:1085
184
  msgid "Version"
185
  msgstr ""
186
 
@@ -200,95 +200,95 @@ msgstr ""
200
  msgid "Post not found"
201
  msgstr ""
202
 
203
- #: mappress_settings.php:192
204
  msgid "Default"
205
  msgstr ""
206
 
207
- #: mappress_settings.php:240
208
  msgid "Maps for WordPress"
209
  msgstr ""
210
 
211
- #: mappress_settings.php:264
212
  msgid "Active"
213
  msgstr ""
214
 
215
- #: mappress_settings.php:267
216
  msgid "Communication error, please try again later: %s"
217
  msgstr ""
218
 
219
- #: mappress_settings.php:269
220
  msgid "License is invalid or expired"
221
  msgstr ""
222
 
223
- #: mappress_settings.php:277
224
  msgid "Address line "
225
  msgstr ""
226
 
227
- #: mappress_settings.php:278
228
  msgid "Latitude"
229
  msgstr ""
230
 
231
- #: mappress_settings.php:278
232
  msgid "Longitude"
233
  msgstr ""
234
 
235
- #: mappress_settings.php:278
236
  #: mappress_template.php:37
237
  msgid "Title"
238
  msgstr ""
239
 
240
- #: mappress_settings.php:278
241
  #: mappress_template.php:34
242
  msgid "Body"
243
  msgstr ""
244
 
245
- #: mappress_settings.php:278
246
  #: mappress_template.php:35
247
  msgid "Icon"
248
  msgstr ""
249
 
250
- #: mappress_settings.php:278
251
  msgid "Zoom"
252
  msgstr ""
253
 
254
- #: mappress_settings.php:367
255
  msgid "OK, you deserve it!"
256
  msgstr ""
257
 
258
- #: mappress_settings.php:368
259
  msgid "Nope, maybe later"
260
  msgstr ""
261
 
262
- #: mappress_settings.php:369
263
  msgid "I need help using the plugin"
264
  msgstr ""
265
 
266
- #: mappress_settings.php:371
267
  msgid "Help Spread the Word"
268
  msgstr ""
269
 
270
- #: mappress_settings.php:372
271
  msgid "Hi, I hope you're enjoying MapPress. Would you mind taking a moment to write a brief review? It would mean a lot to me!"
272
  msgstr ""
273
 
274
- #: mappress_settings.php:385
275
- #: mappress_settings.php:411
276
  msgid "MapPress"
277
  msgstr ""
278
 
279
- #: mappress_settings.php:389
280
- #: mappress_settings.php:415
281
  #: templates/map.php:62
282
  msgid "Get help"
283
  msgstr ""
284
 
285
- #: mappress_settings.php:392
286
- #: mappress_settings.php:418
287
  msgid "Your account"
288
  msgstr ""
289
 
290
- #: mappress_settings.php:394
291
- #: mappress_settings.php:420
292
  msgid "Upgrade to MapPress Pro"
293
  msgstr ""
294
 
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.67.2\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: 2021-07-27T15:08:09+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
 
34
  msgstr ""
35
 
36
  #: mappress.php:190
37
+ #: mappress.php:774
38
  msgid "Settings"
39
  msgstr ""
40
 
62
  msgid "MapPress Settings"
63
  msgstr ""
64
 
65
+ #: mappress.php:517
66
  msgid "renew your license"
67
  msgstr ""
68
 
69
+ #: mappress.php:518
70
  msgid "Your MapPress license has expired. Please %s to get the latest updates and prevent errors."
71
  msgstr ""
72
 
73
+ #: mappress.php:527
74
  msgid "Please enter your MapPress license key to enable plugin updates"
75
  msgstr ""
76
 
77
+ #: mappress.php:531
78
  msgid "MapPress Gutenberg blocks require WordPress 5.3 or the latest Gutenberg Plugin. Please update if using the block editor."
79
  msgstr ""
80
 
81
+ #: mappress.php:535
82
  msgid "MapPress has many new features! %s."
83
  msgstr ""
84
 
85
+ #: mappress.php:535
86
+ #: mappress.php:539
87
+ #: mappress.php:543
88
  msgid "Learn more"
89
  msgstr ""
90
 
91
+ #: mappress.php:539
92
  msgid "MapPress popup templates have changed! Please update custom templates to the new format. %s."
93
  msgstr ""
94
 
95
+ #: mappress.php:543
96
  msgid "MapPress templates and filters have changed. Please update custom templates and filters. %s."
97
  msgstr ""
98
 
99
+ #: mappress.php:608
100
  msgid "Are you sure you want to delete?"
101
  msgstr ""
102
 
103
+ #: mappress.php:609
104
  msgid "Permanently delete this map from the map library?"
105
  msgstr ""
106
 
107
+ #: mappress.php:610
108
  msgid "Error reading KML file"
109
  msgstr ""
110
 
111
+ #: mappress.php:611
112
  msgid "URL for KML file"
113
  msgstr ""
114
 
115
+ #: mappress.php:612
116
  msgid "Loading"
117
  msgstr ""
118
 
119
+ #: mappress.php:613
120
  msgid "Please select an editor to insert into."
121
  msgstr ""
122
 
123
+ #: mappress.php:614
124
  msgid "Unable to get your location"
125
  msgstr ""
126
 
127
+ #: mappress.php:615
128
  msgid "No results"
129
  msgstr ""
130
 
131
+ #: mappress.php:616
132
  msgid "Save changes?"
133
  msgstr ""
134
 
135
+ #: mappress.php:617
136
  msgid "Shape"
137
  msgstr ""
138
 
139
+ #: mappress.php:647
140
+ #: mappress.php:656
141
  msgid "Streets"
142
  msgstr ""
143
 
144
+ #: mappress.php:648
145
  msgid "Outdoors"
146
  msgstr ""
147
 
148
+ #: mappress.php:649
149
  msgid "Light"
150
  msgstr ""
151
 
152
+ #: mappress.php:650
153
  msgid "Dark"
154
  msgstr ""
155
 
156
+ #: mappress.php:651
157
+ #: mappress.php:664
158
  msgid "Satellite"
159
  msgstr ""
160
 
161
+ #: mappress.php:652
162
  msgid "Satellite Streets"
163
  msgstr ""
164
 
165
+ #: mappress.php:662
166
  msgid "Roadmap"
167
  msgstr ""
168
 
169
+ #: mappress.php:663
170
  msgid "Terrain"
171
  msgstr ""
172
 
173
+ #: mappress.php:665
174
  msgid "Hybrid"
175
  msgstr ""
176
 
177
+ #: mappress.php:775
178
+ #: mappress_settings.php:398
179
+ #: mappress_settings.php:424
180
  msgid "What's new"
181
  msgstr ""
182
 
183
+ #: mappress.php:1082
184
  msgid "Version"
185
  msgstr ""
186
 
200
  msgid "Post not found"
201
  msgstr ""
202
 
203
+ #: mappress_settings.php:200
204
  msgid "Default"
205
  msgstr ""
206
 
207
+ #: mappress_settings.php:248
208
  msgid "Maps for WordPress"
209
  msgstr ""
210
 
211
+ #: mappress_settings.php:272
212
  msgid "Active"
213
  msgstr ""
214
 
215
+ #: mappress_settings.php:275
216
  msgid "Communication error, please try again later: %s"
217
  msgstr ""
218
 
219
+ #: mappress_settings.php:277
220
  msgid "License is invalid or expired"
221
  msgstr ""
222
 
223
+ #: mappress_settings.php:285
224
  msgid "Address line "
225
  msgstr ""
226
 
227
+ #: mappress_settings.php:286
228
  msgid "Latitude"
229
  msgstr ""
230
 
231
+ #: mappress_settings.php:286
232
  msgid "Longitude"
233
  msgstr ""
234
 
235
+ #: mappress_settings.php:286
236
  #: mappress_template.php:37
237
  msgid "Title"
238
  msgstr ""
239
 
240
+ #: mappress_settings.php:286
241
  #: mappress_template.php:34
242
  msgid "Body"
243
  msgstr ""
244
 
245
+ #: mappress_settings.php:286
246
  #: mappress_template.php:35
247
  msgid "Icon"
248
  msgstr ""
249
 
250
+ #: mappress_settings.php:286
251
  msgid "Zoom"
252
  msgstr ""
253
 
254
+ #: mappress_settings.php:375
255
  msgid "OK, you deserve it!"
256
  msgstr ""
257
 
258
+ #: mappress_settings.php:376
259
  msgid "Nope, maybe later"
260
  msgstr ""
261
 
262
+ #: mappress_settings.php:377
263
  msgid "I need help using the plugin"
264
  msgstr ""
265
 
266
+ #: mappress_settings.php:379
267
  msgid "Help Spread the Word"
268
  msgstr ""
269
 
270
+ #: mappress_settings.php:380
271
  msgid "Hi, I hope you're enjoying MapPress. Would you mind taking a moment to write a brief review? It would mean a lot to me!"
272
  msgstr ""
273
 
274
+ #: mappress_settings.php:393
275
+ #: mappress_settings.php:419
276
  msgid "MapPress"
277
  msgstr ""
278
 
279
+ #: mappress_settings.php:397
280
+ #: mappress_settings.php:423
281
  #: templates/map.php:62
282
  msgid "Get help"
283
  msgstr ""
284
 
285
+ #: mappress_settings.php:400
286
+ #: mappress_settings.php:426
287
  msgid "Your account"
288
  msgstr ""
289
 
290
+ #: mappress_settings.php:402
291
+ #: mappress_settings.php:428
292
  msgid "Upgrade to MapPress Pro"
293
  msgstr ""
294
 
mappress.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Maps for WordPress
4
  Plugin URI: https://www.mappresspro.com/mappress
5
  Author URI: https://www.mappresspro.com/chris-contact
6
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
7
- Version: 2.67.1
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.67.1';
40
 
41
  static
42
  $baseurl,
@@ -289,9 +289,6 @@ class Mappress {
289
 
290
  // GT assets are still loaded when using classic editor, but this script doesn't run
291
  static function block_categories($categories, $post) {
292
- if (!in_array($post->post_type, self::$options->postTypes))
293
- return $categories;
294
-
295
  return array_merge(
296
  $categories,
297
  array(
4
  Plugin URI: https://www.mappresspro.com/mappress
5
  Author URI: https://www.mappresspro.com/chris-contact
6
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
7
+ Version: 2.67.2
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.67.2';
40
 
41
  static
42
  $baseurl,
289
 
290
  // GT assets are still loaded when using classic editor, but this script doesn't run
291
  static function block_categories($categories, $post) {
 
 
 
292
  return array_merge(
293
  $categories,
294
  array(
mappress_settings.php CHANGED
@@ -149,12 +149,20 @@ class Mappress_Settings {
149
  if ($settings->license && $settings->license != Mappress::$options->license)
150
  Mappress::$updater->clear_cache();
151
 
152
- // Convert nested booleans in clusterOptions
153
- foreach(array('spiderfyOnMaxZoom') as $opt) {
154
- if (isset($settings->clusteringOptions[$opt]))
155
- $settings->clusteringOptions[$opt] = ($settings->clusteringOptions[$opt] == "true") ? true : false;
 
 
 
 
 
 
 
156
  }
157
 
 
158
  // Merge in old values so they're not lost, e.g. stylesMapbox and stylesGoogle
159
  $options = Mappress_Options::get();
160
  $options->update($settings);
149
  if ($settings->license && $settings->license != Mappress::$options->license)
150
  Mappress::$updater->clear_cache();
151
 
152
+ // Update() converts strings to booleans, but it's not recursive, so explicitly convert nested booleans inside arrays
153
+ if (isset($settings->clusteringOptions['spiderfyOnMaxZoom']))
154
+ $settings->clusteringOptions['spiderfyOnMaxZoom'] = ($settings->clusteringOptions['spiderfyOnMaxZoom'] == "true") ? true : false;
155
+
156
+ if (isset($settings->filters)) {
157
+ foreach($settings->filters as &$filter) {
158
+ if (isset($filter['count']))
159
+ $filter['count'] = ($filter['count'] == "true") ? true : false;
160
+ }
161
+ } else {
162
+ $settings->filters = array();
163
  }
164
 
165
+
166
  // Merge in old values so they're not lost, e.g. stylesMapbox and stylesGoogle
167
  $options = Mappress_Options::get();
168
  $options->update($settings);
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.8
8
- Stable tag: 2.67.1
9
 
10
  == Description ==
11
  MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
@@ -83,6 +83,13 @@ Please see the plugin documentation pages:
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
 
86
  = 2.67.1 =
87
  * Fixed: error on settings screen
88
 
5
  Requires at least: 5.3
6
  Requires PHP: 5.6
7
  Tested up to: 5.8
8
+ Stable tag: 2.67.2
9
 
10
  == Description ==
11
  MapPress is the easiest way to add beautiful interactive Google and Leaflet maps to WordPress.
83
 
84
  == Changelog ==
85
 
86
+ = 2.67.2 =
87
+ * Fixed: unmounted component error from WP widgets screen unounting map
88
+ * Fixed: warning about invalid block category on map library screen
89
+ * Fixed: warning about toolbargroup vs toolbar
90
+ * Fixed: empty mashup filters not saving, and warning about boolean count setting
91
+ * Fixed: error from trimArray when saving settings
92
+
93
  = 2.67.1 =
94
  * Fixed: error on settings screen
95