Liferay.Loader.define("layout-admin-web@5.0.131/js/ThemeCSSReplacementSelector",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function ThemeCSSReplacementSelector({placeholder:e,portletNamespace:t,selectThemeCSSClientExtensionEventName:a,selectThemeCSSClientExtensionURL:o,themeCSSCETExternalReferenceCode:i,themeCSSExtensionName:u}){const[d,f]=(0,c.useState)(u),[s,m]=(0,c.useState)(i),onClick=()=>{(0,r.openSelectionModal)({onSelect:e=>{const t=JSON.parse(e.value);m(t.cetExternalReferenceCode),f(t.name)},selectEventName:a,title:Liferay.Language.get("select-theme-css-client-extension"),url:o})};return c.default.createElement(c.default.Fragment,null,c.default.createElement(n.ClayInput,{name:"".concat(t,"themeCSSCETExternalReferenceCode"),type:"hidden",value:s}),c.default.createElement(n.default.Group,null,c.default.createElement("label",{htmlFor:"".concat(t,"themeCSSReplacementExtension")},Liferay.Language.get("client-extension")),c.default.createElement(n.ClayInput.Group,{className:"w-50",small:!0},c.default.createElement(n.ClayInput.GroupItem,null,c.default.createElement(n.ClayInput,{id:"".concat(t,"themeCSSReplacementExtension"),onClick:onClick,placeholder:e,readOnly:!0,type:"text",value:d})),c.default.createElement(n.ClayInput.GroupItem,{shrink:!0},d?c.default.createElement(c.default.Fragment,null,c.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("replace"),className:"mr-2",displayType:"secondary",onClick:onClick,small:!0,symbol:"change"}),c.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("delete"),displayType:"secondary",onClick:()=>{f(""),m("")},small:!0,symbol:"trash"})):c.default.createElement(l.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("select"),displayType:"secondary",onClick:onClick,small:!0,symbol:"plus"})))))};var l=a("@frontend-taglib-clay$clayui/button"),n=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),r=a("frontend-js-web"),c=_interopRequireWildcard(a("liferay!frontend-js-react-web$react"));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 n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}}}));
//# sourceMappingURL=ThemeCSSReplacementSelector.js.map