1"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function r(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,a){return t&&r(e.prototype,t),a&&r(e,a),e}}();function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(function(){var a=[].indexOf;jQuery(document).ready(function(r){return window.WC_Authorize_Net_CIM_Credit_Card_Accept_JS_Handler=function(){function e(){var a=this;_classCallCheck(this,e),this.params=window.wc_authorize_net_cim_params,void 0!==this.params&&this.params.accept_js_enabled&&(r(document.body).on("sv_wc_payment_form_valid_payment_data",function(e,t){return a.init(e,t)}),r(document.body).on("checkout_error",function(){return r("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").val("")}),r(document.body).on("updated_checkout",function(){return a.handle_saved_payment_methods()}))}return _createClass(e,[{key:"init",value:function(e,t){if(this.payment_form=t.payment_form,this.errors=[],"authorize_net_cim_credit_card"===this.payment_form.id&&!this.payment_form.saved_payment_method_selected&&t.passed_validation)return!this.payment_form.payment_fields.find("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").length||(!!this.has_nonce()||(this.dispatch_card(),!1))}},{key:"dispatch_card",value:function(){var e,t=this;return this.payment_form.block_ui(),e=this.get_request_data(),this.log_request(e),Accept.dispatchData(e,function(e){return t.handle_response(e)})}},{key:"get_request_data",value:function(){var e,t,a;return a=r.payment.cardExpiryVal(r("input[name=wc-authorize-net-cim-credit-card-expiry]").val()),t={authData:{clientKey:this.params.client_key,apiLoginID:this.params.login_id},cardData:{cardNumber:r("input[id=wc-authorize-net-cim-credit-card-account-number]").val().replace(/-|\s/g,""),month:a.month.toString(),year:a.year.toString()}},null!=(e=this.payment_form.payment_fields.find("input[id=wc-authorize-net-cim-credit-card-csc]").val())&&this.payment_form.csc_required&&(t.cardData.cardCode=e),t}},{key:"handle_response",value:function(e){var t,a,r,n;if(this.log_response(e),"Error"!==e.messages.resultCode)return this.set_nonce(e.opaqueData.dataValue,e.opaqueData.dataDescriptor),this.payment_form.form.submit();for(t=0,a=(n=e.messages.message).length;t<a;t++)r=n[t],this.handle_error(r.code,r.text);return this.payment_form.render_errors(this.errors),this.payment_form.unblock_ui()}},{key:"set_nonce",value:function(e,t){var a;return r("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").val(e),r("input[name=wc-authorize-net-cim-credit-card-payment-descriptor]").val(t),a=r("input[id=wc-authorize-net-cim-credit-card-account-number]").val(),r("input[name=wc-authorize-net-cim-credit-card-card-type]").val(r.payment.cardType(a)),r("input[name=wc-authorize-net-cim-credit-card-last-four]").val(a.slice(-4))}},{key:"handle_error",value:function(e,t){switch(console.log("Authorize.Net CIM Error: "+t+" ("+e+")"),e){case"E_WC_05":t=this.payment_form.params.card_number_invalid;break;case"E_WC_06":case"E_WC_07":case"E_WC_08":case"E00073":t=this.payment_form.params.card_exp_date_invalid;break;case"E_WC_15":t=this.payment_form.params.cvv_length_invalid;break;default:t=this.params.general_error}if(a.call(this.errors,t)<0)return this.errors.push(t)}},{key:"has_nonce",value:function(){return r("input[name=wc-authorize-net-cim-credit-card-payment-nonce]").val()}},{key:"handle_saved_payment_methods",value:function(){var t;return t="js-sv-wc-payment-gateway-credit-card-form-csc",r("input.js-wc-authorize-net-cim-credit-card-payment-token").change(function(){var e;return e=r("#wc-authorize-net-cim-credit-card-credit-card-form"),r("input.js-wc-authorize-net-cim-credit-card-payment-token:checked").val()?(e.hide(),r("#wc-authorize-net-cim-credit-card-csc").removeClass(t)):(r("#wc-authorize-net-cim-credit-card-csc").addClass(t),e.show())})}},{key:"log_request",value:function(e){var t;return(t=this.clone_log_data(e)).cardData&&(t.cardData.cardNumber&&(t.cardData.cardNumber=t.cardData.cardNumber.replace(/\d(?=\d{4})/g,"*")),t.cardData.cardCode&&(t.cardData.cardCode=t.cardData.cardCode.replace(/[0-9]/g,"*"))),this.log_data(t,"request")}},{key:"log_response",value:function(e){return this.log_data(e,"response")}},{key:"clone_log_data",value:function(e){var t,a;if(null==e||"object"!==(void 0===e?"undefined":_typeof(e)))return e;for(t in a={},e)a[t]=this.clone_log_data(e[t]);return a}},{key:"log_data",value:function(e,t){var a;if(this.params.ajax_log)return a={action:"wc_"+this.payment_form.id+"_log_js_data",security:this.params.ajax_log_nonce,type:t,data:e},r.ajax({url:this.params.ajax_url,data:a})}}]),e}(),window.wc_authorize_net_cim_credit_card_accept_js_handler=new WC_Authorize_Net_CIM_Credit_Card_Accept_JS_Handler})}).call(void 0);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.