Liferay.Loader.define("knowledge-base-web@5.0.98/admin/js/EditKBArticle",["module","exports","require"],(function(t,e,n){window;{function attachListener(t,e,n){return null==t||t.addEventListener(e,n),{detach(){null==t||t.removeEventListener(e,n)}}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function EditKBArticle({kbArticle:t,namespace:e,publishAction:n}){const c=document.getElementById("".concat(e,"contextualSidebarButton")),a=document.getElementById("".concat(e,"contextualSidebarContainer")),l=document.getElementById("".concat(e,"title")),o=document.getElementById("".concat(e,"urlTitle")),titleOnInputEvent=t=>{"false"===o.dataset.customUrl&&(o.value=Liferay.Util.normalizeFriendlyURL(t.target.value))},urlTitleOnInputEvent=t=>{t.currentTarget.dataset.customUrl=""!==o.value},i=document.getElementById("".concat(e,"publishButton")),u=document.getElementById("".concat(e,"fm")),d=[attachListener(i,"click",(()=>{const c=document.getElementById("".concat(e,"workflowAction"));if(c&&(c.value=n),!t){"false"===o.dataset.customUrl&&(o.value="")}})),attachListener(c,"click",(()=>{null==a||a.classList.toggle("contextual-sidebar-visible")})),attachListener(u,"submit",(()=>{document.getElementById("".concat(e,"content")).value=window["".concat(e,"contentEditor")].getHTML(),function updateMultipleKBArticleAttachments(){const t=document.getElementById("".concat(e,"selectedFileNameContainer")),n=[],c=u.querySelectorAll("input[name=".concat(e,"selectUploadedFile]:checked"));for(let t=0;t<c.length;t++)n.push('<input id="'.concat(e,"selectedFileName").concat(t,'"\n\t\t\t\t\tname="').concat(e,'selectedFileName"\n\t\t\t\t\ttype="hidden"\n\t\t\t\t\tvalue="').concat(c[t].value,'"\n\t\t\t\t/>'));t.innerHTML=n.join("")}()}))];t||(d.push(attachListener(l,"input",titleOnInputEvent)),d.push(attachListener(o,"input",urlTitleOnInputEvent)));return{dispose(){d.forEach((({detach:t})=>{t()}))}}}}}));
//# sourceMappingURL=EditKBArticle.js.map