(function(){jQuery(function(a){var e,t,r,n,c,o,i,u,m;return i=null!=(t=window.sv_wc_payment_gateway_admin_order)?t:{},u=null!=(r=window.woocommerce_admin)?r:{},m=null!=(n=window.woocommerce_admin_meta_boxes)?n:{},e=null!=(c=window.accounting)?c:{},window.sv_wc_payment_gateway_admin_order_add_capture_events=function(){if(!a(".sv-wc-payment-gateway-partial-capture.sv-wc-payment-gateway-partial-capture-with-events").length)return a(".sv-wc-payment-gateway-partial-capture").addClass("sv-wc-payment-gateway-partial-capture-with-events").appendTo("#woocommerce-order-items .inside"),a("#woocommerce-order-items").on("click",".sv-wc-payment-gateway-capture:not(.disabled)",function(e){return(e.preventDefault(),a(this).hasClass("partial-capture"))?(a("div.sv-wc-payment-gateway-partial-capture").slideDown(),a("div.wc-order-data-row-toggle").not("div.sv-wc-payment-gateway-partial-capture").slideUp(),a("div.wc-order-totals-items").slideUp()):o()}),a(".sv-wc-payment-gateway-partial-capture").on("change keyup","#capture_amount",function(t){var r;return(r=e.unformat(a(this).val(),u.mon_decimal_point))?a("button.capture-action").removeAttr("disabled"):a("button.capture-action").attr("disabled","disabled"),a("button .capture-amount .amount").text(e.formatMoney(r,{symbol:m.currency_format_symbol,decimal:m.currency_format_decimal_sep,thousand:m.currency_format_thousand_sep,precision:m.currency_format_num_decimals,format:m.currency_format}))}),a(".sv-wc-payment-gateway-partial-capture").on("click",".capture-action",function(e){var t,r;return e.preventDefault(),t=a(".sv-wc-payment-gateway-partial-capture #capture_amount").val(),r=a(".sv-wc-payment-gateway-partial-capture #capture_comment").val(),o(t,r)})},o=function(e="",t=""){var r;if(confirm(i.capture_ays))return a("#woocommerce-order-items").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),r={action:i.capture_action,nonce:i.capture_nonce,gateway_id:i.gateway_id,order_id:i.order_id,amount:e,comment:t},a.ajax({url:i.ajax_url,data:r}).done(function(a){if(null!=a.data&&null!=a.data.message&&alert(a.data.message),a.success)return location.reload()}).fail(function(){return alert(i.capture_error)}).always(function(){return a("#woocommerce-order-items").unblock()})},window.sv_wc_payment_gateway_admin_order_add_capture_events()})}).call({});
//# sourceMappingURL=sv-wc-payment-gateway-admin-order.js.map
