jQuery( function ( $ ) {
window.wcTracks = window.wcTracks || {};
window.wcTracks.recordEvent = window.wcTracks.recordEvent || function() { };
var wc_meta_boxes_order = {
states: null,
init: function() {
if (
! (
typeof woocommerce_admin_meta_boxes_order === 'undefined' ||
typeof woocommerce_admin_meta_boxes_order.countries === 'undefined'
)
) {
this.states = JSON.parse( woocommerce_admin_meta_boxes_order.countries.replace( /"/g, '"' ) );
}
$( '.js_field-country' ).selectWoo().on( 'change', this.change_country );
$( '.js_field-country' ).trigger( 'change', [ true ] );
$( document.body ).on( 'change', 'select.js_field-state', this.change_state );
$( '#woocommerce-order-actions input, #woocommerce-order-actions a' ).on( 'click', function() {
window.onbeforeunload = '';
});
$( 'a.edit_address' ).on( 'click', this.edit_address );
$( 'a.billing-same-as-shipping' ).on( 'click', this.copy_billing_to_shipping );
$( 'a.load_customer_billing' ).on( 'click', this.load_billing );
$( 'a.load_customer_shipping' ).on( 'click', this.load_shipping );
$( '#customer_user' ).on( 'change', this.change_customer_user );
},
change_country: function( e, stickValue ) {
if ( typeof stickValue === 'undefined' ){
stickValue = false;
}
if ( wc_meta_boxes_order.states === null ){