Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/plugins/page-content/components/PageContents",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../app/config/constants/contentTypeLabels","./ContentFilter","./ContentList"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({pageContents:e}){const[t,n]=(0,r.useState)(""),[l,i]=(0,r.useState)(o.CONTENT_TYPE_LABELS.allContent),u=Object.keys(e),p=u.includes(o.CONTENT_TYPE_LABELS.collection)?[o.CONTENT_TYPE_LABELS.allContent,o.CONTENT_TYPE_LABELS.collection,...u.filter((e=>e!==o.CONTENT_TYPE_LABELS.collection))]:[o.CONTENT_TYPE_LABELS.allContent,...u],s=(0,r.useMemo)((()=>t?Object.entries(e).reduce(((e,[n,r])=>{const o=r.filter((e=>-1!==e.title.toLowerCase().indexOf(t.toLowerCase())));return o.length?f(f({},e),{[n]:o}):e}),{}):e),[e,t]);return r.default.createElement(r.default.Fragment,null,r.default.createElement(c.default,{contentTypes:p,onChangeInput:n,onChangeSelect:i,selectedType:l}),r.default.createElement(a.default,{contents:s,selectedType:l}))};i(n("liferay!frontend-js-react-web$prop-types"));var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var c=r?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(n,o,c):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),o=n("../../../app/config/constants/contentTypeLabels"),c=i(n("./ContentFilter")),a=i(n("./ContentList"));function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(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}}}));
//# sourceMappingURL=PageContents.js.map