Liferay.Loader.define("layout-admin-web@5.0.101/js/layout/ChangeFaviconButtonPropsTransformer",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{additionalProps:t,portletNamespace:n}=e;return c(c({},function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},c=Object.keys(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r<c.length;r++)n=c[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["additionalProps","portletNamespace"])),{},{onClick(){const{url:e}=t;(0,r.openSelectionModal)({onSelect(e){if(e){const t=document.getElementById("".concat(n,"faviconFileEntryId")),r=document.getElementById("".concat(n,"faviconImage")),o=document.getElementById("".concat(n,"faviconTitle")),c=document.getElementById("".concat(n,"themeFaviconCETExternalReferenceCode"));if(t&&r&&o&&e&&e.value&&c){const n=JSON.parse(e.value);"com.liferay.client.extension.type.item.selector.CETItemSelectorReturnType"===e.returnType?(t.value=0,c.value=n.cetExternalReferenceCode):(t.value=n.fileEntryId,c.value=""),n.url?r.src=n.url:r.classList.add("d-none"),o.innerHTML=n.title||n.name}}},selectEventName:"".concat(n,"selectImage"),title:Liferay.Language.get("select-favicon"),url:e.toString()})}})};var r=n("frontend-js-web");function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}}}));
//# sourceMappingURL=ChangeFaviconButtonPropsTransformer.js.map