Liferay.Loader.define("@liferay/commerce-order-rule-web@1.0.19/js/addCOREntry",["module","exports","require","commerce-frontend-js/ServiceProvider/index","commerce-frontend-js/utilities/eventsDefinitions","frontend-js-web"],(function(e,t,r){var n;window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({editCOREntryPortletURL:e,namespace:t}){const r=o.default.AdminOrderAPI("v1"),n=document.getElementById("".concat(t,"fm"));n.addEventListener("submit",(o=>{o.preventDefault();const a=n.querySelector("#".concat(t,"description")).value,d=n.querySelector("#".concat(t,"name")).value,s=n.querySelector("#".concat(t,"type")).value;return r.addOrderRule({description:a,name:d,type:s}).then((r=>{const n=(0,i.createPortletURL)(e);n.searchParams.append("".concat(t,"corEntryId"),r.id),n.searchParams.append("p_auth",Liferay.authToken),window.parent.Liferay.fire(c.CLOSE_MODAL,{redirectURL:n.toString(),successNotification:{message:Liferay.Language.get("your-request-completed-successfully"),showSuccessNotification:!0}})}))}))};var o=(n=r("commerce-frontend-js/ServiceProvider/index"))&&n.__esModule?n:{default:n},c=r("commerce-frontend-js/utilities/eventsDefinitions"),i=r("frontend-js-web")}));
//# sourceMappingURL=addCOREntry.js.map