(()=>{"use strict";var e={n:o=>{var n=o&&o.__esModule?()=>o.default:()=>o;return e.d(n,{a:n}),n},d:(o,n)=>{for(var t in n)e.o(n,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:n[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,n=window.wp.i18n,t=window.wp.blockEditor,a=window.wp.components,i=window.wp.serverSideRender;var l=e.n(i);const r=JSON.parse('{"UU":"maxmegamenu/location"}'),c=window.ReactJSXRuntime,{UU:s}=r;(0,o.registerBlockType)(r.UU,{edit:function({setAttributes:e,attributes:o,isSelected:i}){if(0===window.max_mega_menu_locations.length)return(0,c.jsx)("div",{...(0,t.useBlockProps)(),children:(0,n.__)("Error: max_mega_menu_locations missing.","megamenu")});const r=Object.keys(window.max_mega_menu_locations).map(e=>({value:e,label:window.max_mega_menu_locations[e]}));return 1===r.length?(0,c.jsx)("div",{...(0,t.useBlockProps)(),children:(0,n.__)("No locations found. Go to Mega Menu > Menu Locations to create a new menu location.","megamenu")}):(0,c.jsx)("div",{...(0,t.useBlockProps)(),children:i||!o.location||""===o.location?(0,c.jsx)(a.Placeholder,{label:(0,n.__)("Max Mega Menu","megamenu"),children:(0,c.jsx)(a.SelectControl,{label:(0,n.__)("Select a location","megamenu"),options:r,value:o.location,onChange:o=>{e({location:String(o)})}})}):(0,c.jsx)(a.Disabled,{children:(0,c.jsx)(l(),{block:s,attributes:o})})})}})})();