1function _typeof(e){return(_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})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);n=n.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}!function(){jQuery(function(a){return window.WC_Intuit_Payments_Payment_Form_Handler=window.SV_WC_Payment_Form_Handler_v6_2_3,a(document.body).trigger("wc_intuit_payments_payment_form_handler_loaded"),window.WC_Intuit_Payments_Tokenization_Handler=(()=>_createClass(function e(){var n=this;_classCallCheck(this,e),this.params=window.wc_intuit_payments_params,a(document.body).on("sv_wc_payment_form_valid_payment_data",function(e,t){return n.init(e,t)}),a(document.body).on("checkout_error",function(e){return a("input[name=wc-"+n.params.id_dasherized+"-js-token]").val("")})},[{key:"init",value:function(e,t){var n;if(this.payment_form=t.payment_form,("intuit_payments_credit_card"===(n=this.payment_form.id)||"intuit_payments_echeck"===n)&&!this.payment_form.saved_payment_method_selected&&t.passed_validation)return!!this.has_token()||("intuit_payments_credit_card"===this.payment_form.id?this.tokenize_method("credit_card"):this.tokenize_method("echeck"),!1)}},{key:"tokenize_method",value:function(e){var t=this;return this.payment_form.block_ui(),e=this.get_request_data(e),this.log_request(e),a.ajax(this.params.api_url,{method:"POST",dataType:"json",contentType:"application/json",crossDomain:!0,data:JSON.stringify(e),success:function(e){return t.handle_response(e)},error:function(e){return t.handle_response(e.responseJSON)}})}},{key:"get_request_data",value:function(e){var t,n=a("input[id=wc-"+this.payment_form.id_dasherized+"-account-number]").val(),r=a("input[name=billing_first_name]").val()+" "+a("input[name=billing_last_name]").val(),i=a("#billing_country").val();return"credit_card"===e?(a("select[name=wc-"+this.payment_form.id_dasherized+"-test-case]").val()&&(r=a("select[name=wc-"+this.payment_form.id_dasherized+"-test-case]").val()),t=(e=a("input[name=wc-"+this.payment_form.id_dasherized+"-expiry]").payment("cardExpiryVal")).month.toString(),t={card:{expYear:e.year.toString(),expMonth:t=1===t.length?"0"+t:t,name:r.substring(0,30),cvc:a("input[id=wc-"+this.payment_form.id_dasherized+"-csc]").val(),number:n}},i&&(t.card.address={postalCode:a("input[name=billing_postcode]").val().substring(0,10),streetAddress:a("input[name=billing_address_1]").val().substring(0,30),country:i.substring(0,2)}),a("#billing_city").val()&&(t.card.address.city=a("#billing_city").val().substring(0,30)),a("#billing_state").val()&&2<=a("#billing_state").val().length&&(t.card.address.region=a("#billing_state").val().substring(0,20))):("checking"===(e=a("#wc-"+this.payment_form.id_dasherized+"-account-type").val())?e="PERSONAL_CHECKING":"savings"===e&&(e="PERSONAL_SAVINGS"),t={bankAccount:{name:r.substring(0,30),routingNumber:a("input[id=wc-"+this.payment_form.id_dasherized+"-routing-number]").val(),accountNumber:n,accountType:e}},i&&(t.bankAccount.country=i.substring(0,2)),a("input[name=billing_phone]").length&&(t.bankAccount.phone=a("input[name=billing_phone]").val().replace(/\D/g,""))),t}},{key:"handle_response",value:function(t){var n;return this.log_response(t),null!=t.value?(this.set_token(t.value),this.payment_form.form.submit()):(t.errors&&console.error(t.errors),n=[this.params.generic_error],window.errorMessages=t.errors,a(t.errors).each(function(e){e=t.errors[e];if(e.code&&e.moreInfo&&-1<a.inArray(e.code,["PMT-4000","PMT-4001","PMT-4002"]))return n.push(e.moreInfo)}),this.payment_form.render_errors(n),this.payment_form.unblock_ui())}},{key:"set_token",value:function(e){return a("input[name=wc-"+this.payment_form.id_dasherized+"-js-token]").val(e),e=a("input[id=wc-"+this.payment_form.id_dasherized+"-account-number]").val().slice(-4),a("input[name=wc-"+this.payment_form.id_dasherized+"-last-four]").val(e),e=a.payment.cardType(a("input[id=wc-"+this.payment_form.id_dasherized+"-account-number]").val()),a("input[name=wc-"+this.payment_form.id_dasherized+"-card-type]").val(e)}},{key:"has_token",value:function(){return a("input[name=wc-"+this.payment_form.id_dasherized+"-js-token]").val()}},{key:"log_request",value:function(e){var t,n={};if(e.card){for(t in e.card)n[t]=e.card[t];n.number&&(n.number=n.number.replace(/\d(?=\d{4})/g,"*")),n.cvc&&(n.cvc=n.cvc.replace(/[0-9]/g,"*"))}if(e.bankAccount){for(t in e.bankAccount)n[t]=e.bankAccount[t];n.accountNumber&&(n.accountNumber=n.accountNumber.replace(/\d(?=\d{4})/g,"*")),n.routingNumber&&(n.routingNumber=n.routingNumber.replace(/[0-9]/g,"*"))}return this.log_data(n,"request")}},{key:"log_response",value:function(e){return this.log_data(e,"response")}},{key:"log_data",value:function(e,t){if(this.params.ajax_log)return t={action:"wc_"+this.payment_form.plugin_id+"_log_js_data",gateway_id:this.payment_form.id,security:this.params.ajax_log_nonce,type:t,data:e},a.ajax({url:this.params.ajax_url,data:t})}}
1]))(),window.wc_intuit_payments_tokenization_handler=new WC_Intuit_Payments_Tokenization_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.