(function(){var t,e={}.hasOwnProperty,r=function(t,r){function n(){this.constructor=t}for(var o in r)e.call(r,o)&&(t[o]=r[o]);return n.prototype=r.prototype,t.prototype=new n,t.__super__=r.prototype,t};t=require("./TextTypes"),module.exports=function(e){var n,o,u,i,a;return i=t(e),a=i.types,u=i.parser,o=function(t){var e;return new(e=function(){function t(e){var r,u,i,l;l=e.map,i=function(r,u){return Object.defineProperty(t.prototype,r,{get:function(){var t;return t=u.val(),t instanceof n?o(t):t instanceof a.ImmutableObject?t.val():t},set:function(t){var n,o,u,i;if(t.constructor==={}.constructor){u=e.val(r),i=[];for(n in t)o=t[n],i.push(u.val(n,o,"immutable"));return i}return e.val(r,t,"immutable")},enumerable:!0,configurable:!1})};for(r in l)u=l[r],i(r,u)}return t}())(t)},n=function(t){function n(t,e,r){var o,u;if(n.__super__.constructor.call(this,t),null!=e){if("object"!=typeof e)throw new Error("The initial value of JsonTypes must be of type Object! (current type: "+typeof e+")");for(o in e)u=e[o],this.val(o,u,r)}}return r(n,t),n.prototype.mutable_default=!0,n.prototype.setMutableDefault=function(t){if(t===!0||"mutable"===t)n.prototype.mutable_default=!0;else{if(t!==!1&&"immutable"!==t)throw new Error('Set mutable either "mutable" or "immutable"!');n.prototype.mutable_default=!1}return"OK"},n.prototype.val=function(t,r,o){var u,i,l,c,p;if("object"==typeof t){for(l in t)i=t[l],this.val(l,i,r);return this}if(null!=t&&null!=r){if(o=null!=o?o===!0||"mutable"===o?!0:!1:this.mutable_default,"function"==typeof r)return this;if(o&&"number"!=typeof r||r.constructor===Object){if("string"==typeof r)return p=e.addOperation(new a.Word(void 0)).execute(),p.insertText(0,r),n.__super__.val.call(this,t,p);if(r.constructor===Object)return u=e.addOperation(new n(void 0,r,o)).execute(),n.__super__.val.call(this,t,u);throw new Error("You must not set "+typeof r+"-types in collaborative Json-objects!")}return c=e.addOperation(new a.ImmutableObject(void 0,r)).execute(),n.__super__.val.call(this,t,c)}return n.__super__.val.call(this,t,r)},Object.defineProperty(n.prototype,"value",{get:function(){return o(this)},set:function(t){var e,r,n;if(t.constructor==={}.constructor){n=[];for(e in t)r=t[e],n.push(this.val(e,r,"immutable"));return n}throw new Error("You must only set Object values!")}}),n.prototype._encode=function(){return{type:"JsonType",uid:this.getUid()}},n}(a.MapManager),u.JsonType=function(t){var e;return e=t.uid,new n(e)},a.JsonType=n,i}}).call(this);
//# sourceMappingURL=../Types/JsonTypes.js.map