Liferay.Loader.define("layout-admin-web@5.0.145/js/layout/look_and_feel/MasterLayoutConfiguration",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/link","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function MasterLayoutConfiguration({changeMasterLayoutURL:t,editMasterLayoutURL:a,masterLayoutName:u,masterLayoutPlid:d,portletNamespace:s}){const[f,y]=(0,o.useState)({name:u,plid:d||e}),handleChangeMasterButtonClick=()=>{(0,c.openSelectionModal)({iframeBodyCssClass:"",onSelect(e){if(e){const t=JSON.parse(e.value);y({name:t.name,plid:t.plid})}},selectEventName:"".concat(s,"selectMasterLayout"),title:Liferay.Language.get("select-master"),url:t})};return(0,o.useEffect)((()=>{const t=document.getElementById("".concat(s,"themeContainer"));if(!t)return;const a=t.closest(".sheet");f.plid===e?(a.classList.remove("hide"),a.removeAttribute("aria-hidden")):(a.classList.add("hide"),a.setAttribute("aria-hidden","true"))}),[f.plid,s]),o.default.createElement(o.default.Fragment,null,o.default.createElement("input",{name:"".concat(s,"masterLayoutPlid"),type:"hidden",value:f.plid}),o.default.createElement("label",{htmlFor:"".concat(s,"masterLayout")},Liferay.Language.get("master")),a&&f.plid&&f.plid!==e?o.default.createElement("div",{className:"d-flex"},o.default.createElement(r.default.Group,{className:"c-mb-0 flex-grow-1"},o.default.createElement(r.ClayInput,{id:"".concat(s,"masterLayout"),onClick:handleChangeMasterButtonClick,readOnly:!0,value:f.name})),o.default.createElement(i.default,{"aria-label":Liferay.Language.get("edit-master"),button:{monospaced:!0},className:"c-ml-2",displayType:"secondary",href:a},o.default.createElement(n.default,{symbol:"pencil"})),o.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("change-master"),className:"c-ml-2",displayType:"secondary",onClick:handleChangeMasterButtonClick,symbol:"change"})):o.default.createElement("div",{className:"d-flex"},o.default.createElement(r.default.Group,{className:"c-mb-0 flex-grow-1"},o.default.createElement(r.ClayInput,{id:"".concat(s,"masterLayout"),onClick:handleChangeMasterButtonClick,readOnly:!0,value:f.name})),o.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("change-master"),className:"c-ml-2",displayType:"secondary",onClick:handleChangeMasterButtonClick,symbol:"plus"})))};var l=a("@frontend-taglib-clay$clayui/button"),r=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),i=_interopRequireDefault(a("@frontend-taglib-clay$clayui/link")),c=a("frontend-js-web"),o=_interopRequireWildcard(a("liferay!frontend-js-react-web$react"));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 _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 a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}const e="0"}}));
//# sourceMappingURL=MasterLayoutConfiguration.js.map