text: define("Types/_collection/Flags",["require","exports","tslib","Types/_collection/Dictionary","Types/entity","Types/di","Types/util"],function(t,e,o,r,l,n,i){"use strict";function a(t){return null===t||void 0===t?null:!!t}Object.defineProperty(e,"__esModule",{value:true});var s=function(n){function i(t){var e=n.call(this,t)||this;return l.SerializableMixin.constructor.call(e),e._publish("onChange"),e._$values=e._$values||[],e}return o.__extends(i,n),i.produceInstance=function(t,e){return new this({dictionary:this.prototype._getDictionaryByFormat(e&&e.format),localeDictionary:this.prototype._getLocaleDictionaryByFormat(e&&e.format),values:t})},i.prototype.destroy=function(){l.ManyToManyMixin.destroy.call(this),n.prototype.destroy.call(this)},i.prototype.get=function(t,e){var n=this._getOrdinalIndex(t,e);if(void 0!==n)return a(this._$values[n]);return},i.prototype.set=function(t,e,n){var i=this._getOrdinalIndex(t,n);if(void 0===i)throw new ReferenceError(this._moduleName+'::set(): the value "'+t+"\" doesn't found in dictionary");if(e=a(e),this._$values[i]===e)return;this._$values[i]=e;var o=this._getIndex(t,n);this._notifyChange(t,o,e)},i.prototype.getByIndex=function(t){var e=this._getValue(t),n=this._getOrdinalIndex(e);return this._$values[n]},i.prototype.setByIndex=function(t,e){var n=this._getValue(t);if(void 0===n)throw new ReferenceError(this._moduleName+"::setByIndex(): the index "+t+" doesn't found in dictionary");var i=this._getOrdinalIndex(n);if(e=a(e),this._$values[i]===e)return;this._$values[i]=e,this._notifyChange(n,t,e)},i.prototype.fromArray=function(t){var e=this._$values,n=this.getEnumerator(),i=0,o=[];while(n.moveNext()){var r=void 0===t[i]?null:t[i],l;e[i]=r,o[n.getCurrentIndex()]=r,i++}this._notifyChanges(o)},i.prototype.setFalseAll=function(){this._setAll(false)},i.prototype.setTrueAll=function(){this._setAll(true)},i.prototype.setNullAll=function(){this._setAll(null)},i.prototype.isEqual=function(t){if(!(t instanceof i))return false;if(!r.default.prototype.isEqual.call(this,t))return false;var e=this.getEnumerator(),n;while(e.moveNext())if(n=e.getCurrent(),this.get(n)!==t.get(n))return false;return true},i.prototype.toString=function(){return"["+this._$values.map(function(t){return null===t?"null":t}).join(",")+"]"},i.prototype._getOrdinalIndex=function(t,e){var n=this.getEnumerator(e),i=0;while(n.moveNext()){if(n.getCurrent()===t)return i;i++}return},i.prototype._setAll=function(t){var e=this._$dictionary,n=this._$values,i=this.getEnumerator(),o=0;while(i.moveNext()){if(n[o]!==t){n[o]=t;var r=i.getCurrentIndex();this._notifyChange(e[r],r,t)}o++}},i.prototype._notifyChange=function(t,e,n){var i={};i[String(t)]=n,this._childChanged(i),this._notify("onChange",t,e,n)},i.prototype._notifyChanges=function(t){this._childChanged(t),this._notify("onChange",t)},i}(r.default);e.default=s,i.applyMixins(s,l.ManyToManyMixin,l.SerializableMixin,l.CloneableMixin),Object.assign(s.prototype,{"[Types/_collection/Flags]":true,"[Types/_collection/IFlags]":true,"[Types/_entity/ICloneable]":true,"[Types/_entity/IProducible]":true,_moduleName:"Types/collection:Flags",_$values:void 0,_type:"flags"}),s.prototype["[WS.Data/Type/Flags]"]=true,s.prototype["[WS.Data/Entity/ICloneable]"]=true,n.register("Types/collection:Flags",s,{instantiate:false})});