Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/contexts/StyleErrorsContext",["module","exports","require","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.StyleErrorsContextProvider=function({children:e,initialState:t={}}){const[r,o]=(0,n.useState)(t);return n.default.createElement(f.Provider,{value:{setState:o,state:r}},e)},t.useDeleteStyleError=function(){const{setState:t,state:r}=(0,n.useContext)(f);return(0,n.useCallback)(((n,o=e)=>{var u;if(null===(u=r[o])||void 0===u?void 0:u[n]){const e={},{[o]:u}=r,c=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,[o].map(a));for(const t in u)t!==n&&(e[t]=u[t]);const l=i(i({},c),!!Object.keys(e).length&&{[o]:e});t(l)}}),[t,r])},t.useHasStyleErrors=function(){const{state:e}=(0,n.useContext)(f);return!!Object.keys(e).length},t.useSetStyleError=function(){const{setState:t,state:r}=(0,n.useContext)(f);return(0,n.useCallback)(((n,o,u=e)=>{t(i(i({},r),{},{[u]:i(i({},r[u]),{},{[n]:o})}))}),[t,r])},t.useStyleErrors=function(){const{state:e}=(0,n.useContext)(f);return e};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=n?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(r,u,i):r[u]=e[u]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}const e="defaultId",l={setState:()=>{},state:{}},f=n.default.createContext(l)}}));
//# sourceMappingURL=StyleErrorsContext.js.map