Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.156/page_editor/plugins/experience/components/ExperienceToolbarSection",["module","exports","require","liferay!frontend-js-react-web$react","../../../app/actions/togglePermission","../../../app/config/index","../../../app/contexts/StoreContext","../../../app/selectors/selectSegmentsExperienceId","./ExperienceSelector"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function ExperienceToolbarSection(){const e=(0,c.useSelector)((e=>e.availableSegmentsExperiences)),t=(0,c.useDispatch)(),r=(0,c.useSelector)(a.default),p=(0,n.useMemo)((()=>Object.values(e).sort(((e,t)=>t.priority-e.priority)).map(((e,t,r)=>{const n=i.config.availableSegmentsEntries[e.segmentsEntryId].name,o=r.find((t=>t.segmentsEntryId===e.segmentsEntryId||t.segmentsEntryId===i.config.defaultSegmentsEntryId));return _objectSpread(_objectSpread({},e),{},{active:o.segmentsExperienceId===e.segmentsExperienceId,segmentsEntryName:n})}))),[e]),l=(0,n.useMemo)((()=>Object.values(i.config.availableSegmentsEntries)),[]),u=e[r];return(0,n.useEffect)((()=>{t((0,o.default)("LOCKED_SEGMENTS_EXPERIMENT",u.hasLockedSegmentsExperiment))}),[t,u.hasLockedSegmentsExperiment]),n.default.createElement("div",{className:"page-editor__toolbar-experience"},n.default.createElement("span",{"aria-hidden":!0,className:"d-lg-block d-none font-weight-bold mr-2"},Liferay.Language.get("experience")),n.default.createElement(s.default,{editSegmentsEntryURL:i.config.editSegmentsEntryURL,experiences:p,segments:l,selectedExperience:u}))};var n=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 r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=_interopRequireDefault(r("../../../app/actions/togglePermission")),i=r("../../../app/config/index"),c=r("../../../app/contexts/StoreContext"),a=_interopRequireDefault(r("../../../app/selectors/selectSegmentsExperienceId")),s=_interopRequireDefault(r("./ExperienceSelector"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(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 _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=ExperienceToolbarSection.js.map