File "users.min.js"

Full Path: /home/warrior1/public_html/wp-content/plugins/woocommerce/assets/js/admin/users.min.js
File size: 1.87 KB
MIME-type: text/plain
Charset: utf-8

jQuery(function(u){var h={states:null,init:function(){"undefined"!=typeof wc_users_params.countries&&(this.states=JSON.parse(wc_users_params.countries.replace(/&quot;/g,'"'))),u(".js_field-country").selectWoo().on("change",this.change_country),u(".js_field-country").trigger("change",[!0]),u(document.body).on("change","select.js_field-state",this.change_state),u(document.body).on("click","button.js_copy-billing",this.copy_billing)},change_country:function(e,t){var a,n,o,i,c,s,l,r,p,d;void 0===t&&(t=!1),null!==h.states&&(n=(a=u(this)).val(),i=(o=a.parents(".form-table").find(":input.js_field-state")).parent(),c=o.attr("name"),s=o.attr("id"),l=a.data(l="woocommerce.stickState-"+n)?a.data(l):o.val(),r=o.attr("placeholder"),t&&a.data("woocommerce.stickState-"+n,l),i.show().find(".select2-container").remove(),u.isEmptyObject(h.states[n])?(d=u('<input type="text" />').prop("id",s).prop("name",c).prop("placeholder",r).addClass("js_field-state regular-text").val(l),o.replaceWith(d)):(p=h.states[n],t=u('<option value=""></option>').text(h.i18n_select_state_text),d=u('<select style="width: 25em;"></select>').prop("id",s).prop("name",c).prop("placeholder",r).addClass("js_field-state").append(t),u.each(p,function(e){e=u("<option></option>").prop("value",e).text(p[e]);d.append(e)}),d.val(l),o.replaceWith(d),d.show().selectWoo().hide().trigger("change")),u(document.body).trigger("contry-change.woocommerce",[n,u(this).closest("div")]),u(document.body).trigger("country-change.woocommerce",[n,u(this).closest("div")]))},change_state:function(){var e=u(this),t=e.val(),e=e.parents(".form-table").find(":input.js_field-country"),a=e.val();e.data("woocommerce.stickState-"+a,t)},copy_billing:function(e){e.preventDefault(),u("#fieldset-billing").find("input, select").each(function(e,t){var a=t.name.replace(/^billing_/,"shipping_"),a=u('[name="'+a+'"]');a.length&&a.val(t.value).trigger("change")})}};h.init()});