Liferay.Loader.define("journal-web@5.0.100/js/configuration/icon/ImportScript",["module","exports","require","frontend-js-web"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({namespace:e}){const t=document.getElementById("".concat(e,"importScript")),n=document.getElementById("".concat(e,"importScriptInput")),r=()=>{n.click()};t.addEventListener("click",r);const c=t=>{const n=t.target,[r]=n.files||[];r?r.text().then((t=>{t?Liferay.fire("".concat(e,"scriptImported"),{fileName:r.name,script:t}):i()})).catch((()=>{i()})).finally((()=>{n.value=""})):(n.value="",i())};return n.addEventListener("change",c),{dispose(){t.removeEventListener("click",r),n.removeEventListener("change",c)}}};var r=n("frontend-js-web");function i(){(0,r.openToast)({message:Liferay.Language.get("an-unexpected-error-occurred-while-importing-the-script"),title:Liferay.Language.get("error"),type:"danger"})}}}));
//# sourceMappingURL=ImportScript.js.map