window.ENUM=function(r,e){if(!(r instanceof Array))throw"First argument of ENUM must be an array";for(var a={},t=function(r){return e&&(r=e(r)),r=a[r],t[r]},n=0,o=r.length;n<o;n++){var s=r[n];s instanceof Array||(s=[s]);var f=Math.pow(2,n),i=s[0];a[i]=i;for(var u=0,w=s.length;u<w;u++){var c=s[u],g=new Number(f);g.asString=c,g.asLowerCase=c.toLowerCase(),g.asUpperCase=c.toUpperCase(),g.asInteger=f,g.ENUM=t,0==u?(t[c]=g,a[f]=i):a[c]=i}}return Object.freeze&&Object.freeze(t),t};