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