Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/plugins/page-content/components/ContentsSidebar",["module","exports","require","liferay!frontend-js-react-web$react","../../../app/config/constants/editableFragmentEntryProcessor","../../../app/config/constants/editableTypes","../../../app/contexts/StoreContext","../../../app/selectors/selectLanguageId","../../../app/selectors/selectPageContents","../../../app/utils/editable-value/isMapped","../../../app/utils/getEditableLocalizedValue","../../../common/components/SidebarPanelHeader","./NoPageContents","./PageContents"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,l.useSelector)((e=>e.fragmentEntryLinks)),t=(0,l.useSelector)(c.default),n=(0,l.useSelector)(i.selectPageContents),a=(0,l.useSelector)((e=>e.segmentsExperienceId)),o=(0,r.useMemo)((()=>P(e,a).map((e=>E(e,t))).filter((e=>e.title))),[e,t,a]),s=m(m({},j(n)),o.length&&{[Liferay.Language.get("inline-text")]:o}),u=Object.keys(s).length?r.default.createElement(f.default,{pageContents:s}):r.default.createElement(d.default,null);return r.default.createElement(r.default.Fragment,null,r.default.createElement(p.default,null,Liferay.Language.get("page-content")),r.default.createElement("div",{className:"d-flex flex-column page-editor__page-contents"},u))};var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=b();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),a=n("../../../app/config/constants/editableFragmentEntryProcessor"),o=n("../../../app/config/constants/editableTypes"),l=n("../../../app/contexts/StoreContext"),c=g(n("../../../app/selectors/selectLanguageId")),i=n("../../../app/selectors/selectPageContents"),s=g(n("../../../app/utils/editable-value/isMapped")),u=n("../../../app/utils/getEditableLocalizedValue"),p=g(n("../../../common/components/SidebarPanelHeader")),d=g(n("./NoPageContents")),f=g(n("./PageContents"));function g(e){return e&&e.__esModule?e:{default:e}}function b(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return b=function(){return e},e}function y(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 m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const e=(e,t)=>{const n=document.createElement("div");return n.innerHTML=(0,u.getEditableLocalizedValue)(e,t),n.textContent.trim()},P=(e,t)=>Object.values(e).filter((e=>!e.masterLayout&&e.editableValues&&!e.removed&&e.segmentsExperienceId===t)).map((e=>{var t;return Object.entries(null!==(t=e.editableValues[a.EDITABLE_FRAGMENT_ENTRY_PROCESSOR])&&void 0!==t?t:{}).filter((([t,n])=>(e.editableTypes[t]===o.EDITABLE_TYPES.text||e.editableTypes[t]===o.EDITABLE_TYPES["rich-text"])&&!(0,s.default)(n))).map((([t,n])=>m(m({},n),{},{editableId:"".concat(e.fragmentEntryLinkId,"-").concat(t),type:e.editableTypes[t]})))})).reduce(((e,t)=>[...e,...t]),[]),E=(t,n)=>m(m({},t),{},{icon:"align-left",title:e(t,n)}),j=e=>e.reduce(((e,t)=>e[t.type]?m(m({},e),{},{[t.type]:[...e[t.type],t]}):m(m({},e),{},{[t.type]:[t]})),{})}}));
//# sourceMappingURL=ContentsSidebar.js.map