jQuery(function(a){var b={states:null,init:function(){"undefined"!=typeof wc_users_params.countries&&(this.states=a.parseJSON(wc_users_params.countries.replace(/"/g,'"'))),a(".js_field-country").selectWoo().change(this.change_country),a(".js_field-country").trigger("change",[!0]),a(document.body).on("change","select.js_field-state",this.change_state),a(document.body).on("click","button.js_copy-billing",this.copy_billing)},change_country:function(c,d){if("undefined"==typeof d&&(d=!1),null!==b.states){var e=a(this),f=e.val(),g=e.parents(".form-table").find(":input.js_field-state"),h=g.parent(),i=g.attr("name"),j=g.attr("id"),k=e.data("woocommerce.stickState-"+f)?e.data("woocommerce.stickState-"+f):g.val();if(d&&e.data("woocommerce.stickState-"+f,k),h.show().find(".select2-container").remove(),a.isEmptyObject(b.states[f]))g.replaceWith('');else{var l=a(''),m=b.states[f];l.append(a('")),a.each(m,function(b){l.append(a('"))}),l.val(k),g.replaceWith(l),l.show().selectWoo().hide().change()}a(document.body).trigger("contry-change.woocommerce",[f,a(this).closest("div")]),a(document.body).trigger("country-change.woocommerce",[f,a(this).closest("div")])}},change_state:function(){var b=a(this),c=b.val(),d=b.parents(".form-table").find(":input.js_field-country"),e=d.val();d.data("woocommerce.stickState-"+e,c)},copy_billing:function(b){b.preventDefault(),a("#fieldset-billing").find("input, select").each(function(b,c){var d=c.name.replace(/^billing_/,"shipping_"),e=a('[name="'+d+'"]');e.length&&e.val(c.value).trigger("change")})}};b.init()});