Liferay.Loader.define("layout-seo-web@2.0.43/js/seo/openGraph.es",["module","exports","require","frontend-js-web","./PreviewSeoEvents.es"],(function(e,t,n){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({namespace:e,uploadOpenGraphImageURL:t}){const n=document.getElementById("".concat(e,"openGraphImageButton")),l=document.getElementById("".concat(e,"openGraphImageFileEntryId")),c=document.getElementById("".concat(e,"openGraphImageTitle")),d=document.getElementById("".concat(e,"openGraphImageAlt")),i=document.getElementById("".concat(e,"openGraphImageAlt_").concat(Liferay.ThemeDisplay.getDefaultLanguageId())),g=document.querySelector('[for="'.concat(e,'openGraphImageAlt"'));n.addEventListener("click",(()=>{(0,a.openSelectionModal)({onSelect:t=>{if(t){const n=JSON.parse(t.value);l.value=n.fileEntryId,c.value=n.title,(0,o.previewSeoFireChange)(e,{type:"imgUrl",value:n.url}),(0,a.toggleDisabled)(d,!1),(0,a.toggleDisabled)(i,!1),(0,a.toggleDisabled)(g,!1)}},selectEventName:"".concat(e,"openGraphImageSelectedItem"),title:Liferay.Language.get("open-graph-image"),url:t})}));document.getElementById("".concat(e,"openGraphClearImageButton")).addEventListener("click",(()=>{l.value="",c.value="",(0,a.toggleDisabled)(d,!0),(0,a.toggleDisabled)(i,!0),(0,a.toggleDisabled)(g,!0),(0,o.previewSeoFireChange)(e,{type:"imgUrl",value:""})}));const r=document.getElementById("".concat(e,"openGraphTitleEnabled")),p=document.getElementById("".concat(e,"openGraphTitle")),m=document.getElementById("".concat(e,"openGraphTitle_").concat(Liferay.ThemeDisplay.getLanguageId()));r.addEventListener("click",(t=>{const n=!t.target.checked;(0,a.toggleDisabled)(p,n),(0,a.toggleDisabled)(m,n),(0,o.previewSeoFireChange)(e,{disabled:n,type:"title",value:p.value})}));const s=document.getElementById("".concat(e,"openGraphDescriptionEnabled")),u=document.getElementById("".concat(e,"openGraphDescription")),y=document.getElementById("".concat(e,"openGraphDescription_").concat(Liferay.ThemeDisplay.getLanguageId()));s.addEventListener("click",(t=>{const n=!t.target.checked;(0,a.toggleDisabled)(u,n),(0,a.toggleDisabled)(y,n),(0,o.previewSeoFireChange)(e,{disabled:n,type:"description",value:u.value})}))};var a=n("frontend-js-web"),o=n("./PreviewSeoEvents.es")}));
//# sourceMappingURL=openGraph.es.js.map