"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),o={blogname:"name",custom_logo:"site_logo"},c=n=>{const[u,m]=s.useState(n.settings),r=s.useRef({}),a=i=>{const e=i.data;if(e.messageType&&e.messageType==="partial-update"){const t=r.current;o[e.property]?t[o[e.property]]=e.value:e.property.indexOf("menu")>-1&&(t.menu_settings||(t.menu_settings={}),t.menu_settings[e.property]=e.value),r.current=t,m({...r.current,random:Math.random()})}};return s.useEffect(()=>(window.addEventListener("message",a,!1),()=>{window.removeEventListener("message",a)}),[]),s.Children.map(n.children,(i,e)=>s.cloneElement(i,{...n,settings:{...u},key:`customizer-child-${e}`}))};exports.CustomizerWrapper=c;
