Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/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({selectId:e}){const t=(0,i.useSelector)((e=>e.availableSegmentsExperiences)),r=(0,i.useDispatch)(),l=(0,i.useSelector)(a.default),p=(0,n.useMemo)((()=>Object.values(t).sort(((e,t)=>t.priority-e.priority)).map(((e,t,r)=>{const n=c.config.availableSegmentsEntries[e.segmentsEntryId].name,o=r.find((t=>t.segmentsEntryId===e.segmentsEntryId||t.segmentsEntryId===c.config.defaultSegmentsEntryId));return f(f({},e),{},{active:o.segmentsExperienceId===e.segmentsExperienceId,segmentsEntryName:n})}))),[t]),u=(0,n.useMemo)((()=>Object.values(c.config.availableSegmentsEntries)),[]),d=t[l];return(0,n.useEffect)((()=>{r((0,o.default)("LOCKED_SEGMENTS_EXPERIMENT",d.hasLockedSegmentsExperiment))}),[r,d.hasLockedSegmentsExperiment]),n.default.createElement("div",{className:"page-editor__toolbar-experience"},n.default.createElement("label",{className:"d-lg-block d-none mr-2",htmlFor:e},Liferay.Language.get("experience")),n.default.createElement(s.default,{editSegmentsEntryURL:c.config.editSegmentsEntryURL,experiences:p,segments:u,selectId:e,selectedExperience:d}))};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=p();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 c=n?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(r,o,c):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),o=l(r("../../../app/actions/togglePermission")),c=r("../../../app/config/index"),i=r("../../../app/contexts/StoreContext"),a=l(r("../../../app/selectors/selectSegmentsExperienceId")),s=l(r("./ExperienceSelector"));function l(e){return e&&e.__esModule?e:{default:e}}function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function u(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 f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(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