Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/reducers/widgetsReducer",["module","exports","require","../actions/types"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t=null,r){switch(r.type){case o.TOGGLE_WIDGET_HIGHLIGHTED:{const{highlighted:o,highlightedPortlets:n,portletId:l}=r,c=t.reduce(((t,r)=>(r.path!==e&&t.push(i(i({},r),{},{portlets:r.portlets.map((e=>e.portletId===l?i(i({},e),{},{highlighted:o}):e))})),t)),[]);return n.length&&c.unshift(i(i({},s),{},{portlets:n})),c}case o.UPDATE_WIDGETS:return a(r.widgets||t,r.fragmentEntryLinks);default:return t}};var o=r("../actions/types");function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e="root--category-highlighted",s={categories:[],path:e,portlets:[],title:Liferay.Language.get("highlighted")};function c(e,t){return e.map((e=>{var r;const o=i(i({},e),{},{used:t.has(e.portletId)});return(null===(r=e.portletItems)||void 0===r?void 0:r.length)&&(o.portletItems=c(e.portletItems,t)),o}))}function a(e,t){return e?e.map((e=>{var r;const o=new Set(Array.from(t).map((({portletId:e})=>e))),n=i(i({},e),{},{portlets:c(e.portlets,o)});return(null===(r=e.categories)||void 0===r?void 0:r.length)&&(n.categories=a(e.categories,o)),n})):null}}}));
//# sourceMappingURL=widgetsReducer.js.map