/*! Distpicker v2.0.7 | (c) 2014-present Chen Fengyuan | MIT */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jQuery)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(e);function n(e,t){for(var i=0;ii?n.eq(i):null})),this.bind(),this.reset(),this.ready=!0}},{key:"bind",value:function(){var e=this;this.$province&&this.$province.on(s,this.onChangeProvince=i.default.proxy((function(){e.output(d),e.output(l,!0)}),this)),this.$city&&this.$city.on(s,this.onChangeCity=i.default.proxy((function(){return e.output(l,!0)}),this))}},{key:"unbind",value:function(){this.$province&&this.$province.off(s,this.onChangeProvince),this.$city&&this.$city.off(s,this.onChangeCity)}},{key:"output",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.options,a=this.placeholders,o=this["$".concat(e)];if(o&&o.length){var c;switch(e){case f:c=r;break;case d:c=this.$province&&(this.$province.find(":selected").data("code")||"");break;case l:c=this.$city&&(this.$city.find(":selected").data("code")||"")}var u=this.getDistricts(c),h=n[e],p=[],v=!1;if(i.default.isPlainObject(u)&&i.default.each(u,(function(e,t){var i=t===h||e===String(h);i&&(v=!0),p.push({name:t,selected:i,code:e,value:"name"===n.valueType?t:e})})),!v){var y=n.autoselect||n.autoSelect;p.length&&(e===f&&y>0||e===d&&y>1||e===l&&y>2)&&(p[0].selected=!0),!this.ready&&h&&(a[e]=h)}n.placeholder&&p.unshift({code:"",name:a[e],value:"",selected:!1}),p.length?o.html(this.getList(p)):o.empty(),t&&o.trigger(s)}}},{key:"getList",value:function(e){var t=[];return i.default.each(e,(function(e,i){var n=['data-code="'.concat(i.code,'"'),'data-text="'.concat(i.name,'"'),'value="'.concat(i.value,'"')];i.selected&&n.push("selected"),t.push(""))})),t.join("")}},{key:"getDistricts",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;return o[e]||null}},{key:"reset",value:function(e){e?this.$province&&this.$province.find(":first").prop("selected",!0).end().trigger(s):(this.output(f),this.output(d),this.output(l))}},{key:"destroy",value:function(){this.unbind()}}])&&n(t.prototype,c),u&&n(t,u),e}();if(i.default.fn){var p=i.default.fn.distpicker;i.default.fn.distpicker=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a