/** * angular-chosen-localytics - Angular Chosen directive is an AngularJS Directive that brings the Chosen jQuery in a Angular way * @version v1.9.2 * @link http://github.com/leocaseiro/angular-chosen * @license MIT */ (function(){var e,n=[].indexOf||function(e){for(var n=0,r=this.length;n=0)return c.$observe(r,function(e){var n;return n=String(o.attr(c.$attr[r])).slice(0,2),O[l(r)]="{{"===n?e:u.$eval(e),p()})}),m=function(){return o.addClass("loading").attr("disabled",!0).trigger("chosen:updated")},x=function(){return o.removeClass("loading"),angular.isDefined(c.disabled)?o.attr("disabled",c.disabled):o.attr("disabled",!1),o.trigger("chosen:updated")},h=null,S=!1,b=function(){if(!h)return u.$evalAsync(function(){if(!h)return h=o.chosen(O).data("chosen")})},p=function(){return h&&S&&o.attr("disabled",!0),o.trigger("chosen:updated")},y?(f=y.$render,y.$render=function(){var e,n,r,t;b();try{r=w.readValue()}catch(i){}f();try{n=w.readValue()}catch(i){}if(e=!V&&!c.multiple,t=e?r!==n:!angular.equals(r,n))return o.trigger("chosen:updated")},o.on("chosen:hiding_dropdown",function(){return u.$applyAsync(function(){return y.$setTouched()})}),c.multiple&&(T=function(){return y.$viewValue},u.$watch(T,y.$render,!0))):b(),c.$observe("disabled",function(){return o.trigger("chosen:updated")}),c.ngOptions&&y)return C=null,u.$watchCollection(A,function(e,n){return C=r(function(){return angular.isUndefined(e)?m():(S=s(e),x(),p())})}),u.$on("$destroy",function(e){if(null!=C)return r.cancel(C)})}}}])}).call(this);