!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.keylime=e()}(this,function(){"use strict";function keylime(t){return"string"==typeof t&&(t=createNamedConstructor(t)),convertConstructorToKeylime(t)}function KeylimeConstructor(t){this.descriptor=new KeylimeDescriptor(t),this.prototype=this.prototype||{},Object.defineProperty(this.prototype,"keylime",{value:this.descriptor})}function KeylimeDescriptor(t){this.attributes=null!==t&&"object"==typeof t?t:{},this.initializers=null}function createNamedConstructor(name,runKeylime){return assert("string"==typeof name,"A 'name' string is required to create a named constructor."),eval(["function ",name,"(attrs) {","if (!this || !(this instanceof ",name,")) {","throw new Error(\"Cannot call constructor without the 'new' keyword!\");","}",runKeylime===!1?"":"if (this.keylime) { this.keylime.init(this, attrs); }","}; ",name].join(""))}function convertConstructorToKeylime(t,e){return assert("function"==typeof t,"A function parameter is required to convert to a KeylimeConstructor"),t.__proto__=KeylimeConstructor.prototype,t.descriptor=new KeylimeDescriptor(e),Object.defineProperty(t.prototype,"keylime",{value:t.descriptor}),t}function setAttributesUsingMapAndValues(t,e,r){var i,n;assert("object"==typeof t,"A 'target' object is required to set attribute values.");for(var o in e)if(e.hasOwnProperty(o)){if(i=e[o],r&&void 0!==r[i.name])n=r[i.name];else switch(i.copyMode){case"shallow":n=clone(i.defaultValue);break;case"deep":n=clone(i.defaultValue,!0);break;default:n=i.defaultValue}if("function"==typeof n&&(n=n()),i.handlers)if("function"==typeof i.handlers)n=i.handlers(n,t,i);else if(isArray(i.handlers))for(var s=0;s