(()=>{function e(e,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=function(){function o(){!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,o)}var r,n;return r=o,(n=[{key:"init",value:function(){$(document).on("click",".btn-update-order",(function(e){e.preventDefault();var o=$(e.currentTarget);o.addClass("button-loading"),$.ajax({type:"POST",cache:!1,url:o.closest("form").prop("action"),data:o.closest("form").serialize(),success:function(e){e.error?Botble.showError(e.message):Botble.showSuccess(e.message),o.removeClass("button-loading")},error:function(e){Botble.handleError(e),o.removeClass("button-loading")}})})),$(document).on("click",".btn-trigger-send-order-recover-modal",(function(e){e.preventDefault(),$("#confirm-send-recover-email-button").data("action",$(e.currentTarget).data("action")),$("#send-order-recover-email-modal").modal("show")})),$(document).on("click","#confirm-send-recover-email-button",(function(e){e.preventDefault();var o=$(e.currentTarget);o.addClass("button-loading"),$.ajax({type:"POST",cache:!1,url:o.data("action"),success:function(e){e.error?Botble.showError(e.message):Botble.showSuccess(e.message),o.removeClass("button-loading"),$("#send-order-recover-email-modal").modal("hide")},error:function(e){Botble.handleError(e),o.removeClass("button-loading")}})}))}}])&&e(r.prototype,n),o}();$(document).ready((function(){(new o).init()}))})();
