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