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