Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/page_editor/app/processors/ImageProcessor",["module","exports","require","../../common/openImageSelector","../utils/getEditableLinkValue","../utils/getEditableLocalizedValue"],(function(e,t,l){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l("../../common/openImageSelector"),r=l("../utils/getEditableLinkValue"),n=l("../utils/getEditableLocalizedValue");var o={createEditor:function createEditor(e,t,l){(0,a.openImageSelector)((e=>{const l=e&&e.url?e.url:"";t({fileEntryId:e?e.fileEntryId:void 0,url:l},{imageTitle:e&&e.title?e.title:""})}),l)},destroyEditor:function destroyEditor(){},render:function render(e,t,l={},a){let o=null;if(o=e instanceof HTMLImageElement?e:e.querySelector("img"),o){o.alt=(0,n.getEditableLocalizedValue)(l.alt,a)||(null==t?void 0:t.alt)||"";const e=(0,r.getEditableLinkValue)(l,a);if(e.href)if(o.parentElement instanceof HTMLAnchorElement)o.parentElement.href=e.href,o.parentElement.target=e.target;else{const t=document.createElement("a");t.href="".concat(l.prefix||"").concat(e.href),t.target=e.target,o.parentElement.replaceChild(t,o),t.appendChild(o)}const i=t&&"string"!=typeof t?t.url:t;i&&(o.src=i),l.lazyLoading&&(o.loading="lazy")}}};t.default=o}));
//# sourceMappingURL=ImageProcessor.js.map