(function(F,Ia){function D(a){return a instanceof Array?new ta(a):a.iterator()}F.code=F.code||{};F.database=F.database||{};F.schema=F.schema||{};F.source=F.source||{};F.transform=F.transform||{};var ba=function(){return E.__string_rec(this,"")},ea=ea||{},R;class W{constructor(a,b){this.r=new RegExp(a,b.split("u").join(""))}match(a){this.r.global&&(this.r.lastIndex=0);this.r.m=this.r.exec(a);this.r.s=a;return null!=this.r.m}}W.__name__=!0;Object.assign(W.prototype,{__class__:W});class t{static cca(a,
b){a=a.charCodeAt(b);if(a==a)return a}static substr(a,b,c){if(null==c)c=a.length;else if(0>c)if(0==b)c=a.length+c;else return"";return a.substr(b,c)}static remove(a,b){b=a.indexOf(b);if(-1==b)return!1;a.splice(b,1);return!0}static now(){return Date.now()}}t.__name__=!0;class Ja{static zip(a,b){let c=window.document.getElementById(a).firstChild;a=new la;let e=0;for(;e<c.childNodes.length;){var d=c.childNodes.item(e).textContent,f=c.childNodes.item(e+1).textContent;f=Q.ofString(f);d={fileName:b+"/"+
d,fileSize:f.length,fileTime:new Date,compressed:!1,dataSize:0,data:f,crc32:Ga.make(f)};a.push(d);e+=2}b=new fa;(new ua(b)).write(a);return ha.encode(b.getBytes())}}F.JsZip=Ja;Ja.__name__=!0;class q{static array(a){let b=[];for(a=D(a);a.hasNext();){let c=a.next();b.push(c)}return b}static has(a,b){for(a=D(a);a.hasNext();)if(a.next()==b)return!0;return!1}static exists(a,b){for(a=D(a);a.hasNext();){let c=a.next();if(b(c))return!0}return!1}static iter(a,b){for(a=D(a);a.hasNext();){let c=a.next();b(c)}}static filter(a,
b){let c=[];for(a=D(a);a.hasNext();){let e=a.next();b(e)&&c.push(e)}return c}static count(a,b){let c=0;if(null==b)for(b=D(a);b.hasNext();)b.next(),++c;else for(a=D(a);a.hasNext();){let e=a.next();b(e)&&++c}return c}static find(a,b){for(a=D(a);a.hasNext();){let c=a.next();if(b(c))return c}return null}static findIndex(a,b){let c=0;for(a=D(a);a.hasNext();){let e=a.next();if(b(e))return c;++c}return-1}static concat(a,b){let c=[];for(a=D(a);a.hasNext();){let e=a.next();c.push(e)}for(b=D(b);b.hasNext();)a=
b.next(),c.push(a);return c}}q.__name__=!0;Math.__name__=!0;class r{static string(a){return E.__string_rec(a,"")}static parseInt(a){a=parseInt(a);return isNaN(a)?null:a}}r.__name__=!0;class va{constructor(){this.b=""}}va.__name__=!0;Object.assign(va.prototype,{__class__:va});class z{static htmlEscape(a,b){let c="",e=0;for(;e<a.length;){var d=a;let f=e++,g=d.charCodeAt(f);55296<=g&&56319>=g&&(g=g-55232<<10|d.charCodeAt(f+1)&1023);d=g;65536<=d&&++e;switch(d){case 34:c=b?c+"&quot;":c+String.fromCodePoint(d);
break;case 38:c+="&amp;";break;case 39:c=b?c+"&#039;":c+String.fromCodePoint(d);break;case 60:c+="&lt;";break;case 62:c+="&gt;";break;default:c+=String.fromCodePoint(d)}}return c}static isSpace(a,b){a=t.cca(a,b);return 8<a&&14>a?!0:32==a}static ltrim(a){let b=a.length,c=0;for(;c<b&&z.isSpace(a,c);)++c;return 0<c?t.substr(a,c,b-c):a}static rtrim(a){let b=a.length,c=0;for(;c<b&&z.isSpace(a,b-c-1);)++c;return 0<c?t.substr(a,0,b-c):a}static trim(a){return z.ltrim(z.rtrim(a))}static replace(a,b,c){return a.split(b).join(c)}}
z.__name__=!0;class Ka{static charAt(a,b){if(0>b)return"";let c=0,e=0;for(;e<a.length;){var d=e++;let f=a.charCodeAt(d);55296<=f&&56319>=f&&(f=f-55232<<10|a.charCodeAt(d+1)&1023);d=f;if(c==b)return String.fromCodePoint(d);65536<=d&&++e;++c}return""}static get_length(a){let b=0,c=0;for(;c<a.length;){let e=a,d=c++,f=e.charCodeAt(d);55296<=f&&56319>=f&&(f=f-55232<<10|e.charCodeAt(d+1)&1023);65536<=f&&++c;++b}return b}}class B{static toString(a){switch(a){case 0:return"Element";case 1:return"PCData";
case 2:return"CData";case 3:return"Comment";case 4:return"DocType";case 5:return"ProcessingInstruction";case 6:return"Document"}}}class m{constructor(a){this.nodeType=a;this.children=[];this.attributeMap=new S}get(a){if(this.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element but found "+(null==this.nodeType?"null":B.toString(this.nodeType)));return this.attributeMap.h[a]}set(a,b){if(this.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element but found "+(null==this.nodeType?
"null":B.toString(this.nodeType)));this.attributeMap.h[a]=b}attributes(){if(this.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element but found "+(null==this.nodeType?"null":B.toString(this.nodeType)));return new wa(this.attributeMap.h)}addChild(a){if(this.nodeType!=m.Document&&this.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==this.nodeType?"null":B.toString(this.nodeType)));null!=a.parent&&a.parent.removeChild(a);this.children.push(a);
a.parent=this}removeChild(a){if(this.nodeType!=m.Document&&this.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==this.nodeType?"null":B.toString(this.nodeType)));return t.remove(this.children,a)?(a.parent=null,!0):!1}toString(){return ma.print(this)}static createElement(a){let b=new m(m.Element);if(b.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element but found "+(null==b.nodeType?"null":B.toString(b.nodeType)));b.nodeName=a;return b}static createPCData(a){let b=
new m(m.PCData);if(b.nodeType==m.Document||b.nodeType==m.Element)throw x.thrown("Bad node type, unexpected "+(null==b.nodeType?"null":B.toString(b.nodeType)));b.nodeValue=a;return b}static createDocument(){return new m(m.Document)}}m.__name__=!0;Object.assign(m.prototype,{__class__:m});class I{static extractFieldName(a,b){null==b&&(b=3);return a.charAt(b).toLowerCase()+t.substr(a,b+1,null)}static overrides(a,b){return b.isStatic||null==a.superset?!1:q.exists(a.superset.methods,function(c){return c.className==
b.className})?!0:I.overrides(a.superset,b)}static getDefaultValue(a,b,c){null==c&&(c="null");if("Array"==t.substr(a,0,5))a=b;else switch(a){case "Bool":a="false";break;case "Double":case "Float":case "Int":a="0";break;case "String":a='""';break;default:a=c}return a}}I.__name__=!0;class T{static generate(a){let b=new S;for(a=a.iterator();a.hasNext();){var c=a.next();if(!(c instanceof H)||E.__cast(c,H).isClass()){let e=c.className+".hx";c=T.generateClass(c);b.h[e]=c}}return b}static generateClass(a){let b=
"";a.isGeneric()&&(b+="@:generic\n");b=a.isInterface?b+("interface "+a.className+(a.isGeneric()?"<T>":"")+" {\n"):b+((a.isAbstract?"abstract ":"")+"class "+a.className+(a.isGeneric()?"<T> ":" ")+(null!=a.superset?"extends "+a.superset.className+(a.superset.isGeneric()?"<T> ":" "):"")+"{\n");b+=T.generateFields(a);b+=T.generateConstructor(a);b+=T.generateMethods(a);return b+"}\n"}static generateFields(a){let b="";for(var c=a.fields,e=0;e<c.length;){let d=c[e];++e;b+="\t"+(d.visibility==p.ACCESS_PRIVATE||
d.visibility==p.ACCESS_PROTECTED?"":"public ")+(d.isStatic?"static ":"")+"var "+d.className+": "+T.getType(d.classType)+";\n"}a=a.navFields;for(c=0;c<a.length;)e=a[c],++c,b+="\t"+(e.visibility==p.ACCESS_PRIVATE||e.visibility==p.ACCESS_PROTECTED?"":"public ")+(e.isStatic?"static ":"")+"var "+e.className+": "+T.getType(e.classType)+";\n";return b}static generateMethods(a){let b="",c=0,e=[a.accessors,a.methods];for(;c<e.length;){let k=e[c];++c;let l=0;for(;l<k.length;){let n=k[l];++l;var d=n.isStatic&&
n.isGeneric(),f=n.visibility==p.ACCESS_PRIVATE||n.visibility==p.ACCESS_PROTECTED,g=n.isStatic?"static ":"",h=I.overrides(a,n)?"override ":"";d="\n\t"+(d?"@:generic ":"")+(f?"":"public ")+g+h+"function "+n.className+(n.isStatic&&n.isGeneric()?"<T>":"")+"(";f=[];for(g=D(n.params);g.hasNext();)h=g.next(),f.push(h.className+": "+T.getType(h.classType));b+=d+f.join(", ")+")"+(""==n.classType?"":": "+T.getType(n.classType))+" {\n";"get"==t.substr(n.className,0,3)||"set"==t.substr(n.className,0,3)?(d=a.getFieldCode(I.extractFieldName(n.className)),
null!=d&&("set"==t.substr(n.className,0,3)&&(b+="\t\tthis."+d.className+" = "+d.className+";\n"),b+="\t\treturn this."+d.className+("Array"==t.substr(d.classType,0,5)?".copy()":"")+";\n")):1!=n.params.length||"add"!=t.substr(n.className,0,3)&&"remove"!=t.substr(n.className,0,6)?""!=n.classType&&(b+="\t\treturn "+I.getDefaultValue(n.classType,"new Array()")+";\n"):(d=a.getFieldFromArrayType(n.params[0].classType),null!=d&&(b+="\t\tthis."+d.className+("add"==t.substr(n.className,0,3)?".push(":".remove(")+
n.params[0].className+");\n",b+="\t\treturn this;\n"));b+="\t}\n"}}return b}static generateConstructor(a){let b="";if(0!=a.constructors.length){let g=a.constructors[0];for(var c=[],e=D(g.params);e.hasNext();){var d=e.next();c.push(d.className+": "+T.getType(d.classType))}b+="\n\tpublic function new("+c.join(", ")+") {\n";if(null!=a.superset){c=[];e=0;for(d=q.filter(g.params,function(h){return null==a.getFieldCode(h.className)});e<d.length;){var f=d[e++];c.push(f.className)}b+="\t\tsuper("+c.join(", ")+
");\n"}c=0;for(e=g.params;c<e.length;)d=e[c],++c,f=a.getFieldCode(d.className),null!=f&&(b+="\t\tthis."+f.className+" = "+d.className+";\n");c=a.fields;for(e=0;e<c.length;){let h=c[e];++e;h.isStatic||q.exists(g.params,function(k){return h.className==k.className})||(b+="\t\tthis."+h.className+" = "+I.getDefaultValue(h.classType,"new Array()")+";\n")}c=a.navFields;for(e=0;e<c.length;){let h=c[e];++e;h.isStatic||q.exists(g.params,function(k){return h.className==k.className})||(b+="\t\tthis."+h.className+
" = "+I.getDefaultValue(h.classType,"new Array()")+";\n")}b+="\t}\n"}return b}static getType(a){let b=a;if("Time"==a||"DateTime"==a)b="Date";return b}}F.code.HaxeCode=T;T.__name__=!0;class J{static generate(a){let b=new S;for(a=a.iterator();a.hasNext();){var c=a.next();if(!(c instanceof H)||E.__cast(c,H).isClass()){let e=c.className+".java";c=J.generateClass(c);b.h[e]=c}}return b}static generateClass(a){let b;b=""+J.addImports(a);b=a.isInterface?b+("public interface "+a.className+(a.isGeneric()?"<T>":
"")+" {\n"):b+("public "+(a.isAbstract?"abstract ":"")+"class "+a.className+(a.isGeneric()?"<T> ":" ")+(null!=a.superset?"extends "+a.superset.className+(a.superset.isGeneric()?"<T> ":" "):"")+" {\n");b+=J.generateFields(a);b+=J.generateConstructors(a);b+=J.generateMethods(a);return b+"}\n"}static addImports(a){let b=[];for(var c=a.fields,e=0;e<c.length;){let d=c[e];++e;"Array"!=t.substr(d.classType,0,5)||q.has(b,"java.util.List")?"Date"!=t.substr(d.classType,0,4)||q.has(b,"java.time.LocalDate")?
"Time"!=t.substr(d.classType,0,4)||q.has(b,"java.time.LocalTime")?"DateTime"!=t.substr(d.classType,0,8)||q.has(b,"java.time.LocalDateTime")||b.push("java.time.LocalDateTime"):b.push("java.time.LocalTime"):b.push("java.time.LocalDate"):(b.push("java.util.List"),b.push("java.util.ArrayList"))}a=a.navFields;for(c=0;c<a.length;)e=a[c],++c,"Array"!=t.substr(e.classType,0,5)||q.has(b,"java.util.List")?"Date"!=t.substr(e.classType,0,4)||q.has(b,"java.time.LocalDate")?"Time"!=t.substr(e.classType,0,4)||q.has(b,
"java.time.LocalTime")?"DateTime"!=t.substr(e.classType,0,8)||q.has(b,"java.time.LocalDateTime")||b.push("java.time.LocalDateTime"):b.push("java.time.LocalTime"):b.push("java.time.LocalDate"):(b.push("java.util.List"),b.push("java.util.ArrayList"));a="";for(c=0;c<b.length;)e=b[c],++c,a+="import "+e+";\n";0!=b.length&&(a+="\n");return a}static generateFields(a){let b="";for(var c=a.fields,e=0;e<c.length;){let d=c[e];++e;b+="\t"+(d.visibility==p.ACCESS_PRIVATE?"":d.visibility==p.ACCESS_PROTECTED?"protected ":
"public ")+(d.isStatic?"static ":"")+J.getType(d.classType,!0)+" "+d.className+";\n"}a=a.navFields;for(c=0;c<a.length;)e=a[c],++c,b+="\t"+(e.visibility==p.ACCESS_PRIVATE?"":e.visibility==p.ACCESS_PROTECTED?"protected ":"public ")+(e.isStatic?"static ":"")+J.getType(e.classType,!0)+" "+e.className+";\n";return b}static generateMethods(a){let b="",c=0,e=[a.accessors,a.methods];for(;c<e.length;){let k=e[c];++c;let l=0;for(;l<k.length;){let n=k[l];++l;I.overrides(a,n)&&(b+="\n\t@Override");var d=n.visibility==
p.ACCESS_PRIVATE?"":n.visibility==p.ACCESS_PROTECTED?"protected ":"public ",f=n.isStatic?"static ":"",g=n.isStatic&&n.isGeneric(),h=""==n.classType?"void ":J.getType(n.classType)+" ";d="\n\t"+d+f+(g?"<T>":"")+h+n.className+"(";f=[];for(g=D(n.params);g.hasNext();)h=g.next(),f.push(J.getType(h.classType)+" "+h.className);b+=d+f.join(", ")+") {\n";"get"==t.substr(n.className,0,3)||"set"==t.substr(n.className,0,3)?(d=a.getFieldCode(I.extractFieldName(n.className)),null!=d&&("set"==t.substr(n.className,
0,3)&&(b+="\t\tthis."+d.className+" = "+d.className+";\n"),b="Array"==t.substr(d.classType,0,5)?b+("\t\treturn ("+J.getType(d.classType)+") new "+J.getType(d.classType,!0)+" (this."+d.className+");\n"):b+("\t\treturn this."+d.className+";\n"))):1!=n.params.length||"add"!=t.substr(n.className,0,3)&&"remove"!=t.substr(n.className,0,6)?""!=n.classType&&(b+="\t\treturn "+I.getDefaultValue(n.classType,"new "+J.getType(n.classType)+"()")+";\n"):(d=a.getFieldFromArrayType(n.params[0].classType),null!=d&&
(b+="\t\tthis."+d.className+("add"==t.substr(n.className,0,3)?".add(":".remove(")+n.params[0].className+");\n",b+="\t\treturn this;\n"));b+="\t}\n"}}return b}static generateConstructors(a){let b="",c=0,e=a.constructors;for(;c<e.length;){let k=e[c];++c;for(var d="\n\tpublic "+a.className+"(",f=[],g=D(k.params);g.hasNext();){var h=g.next();f.push(J.getType(h.classType)+" "+h.className)}b+=d+f.join(", ")+") {\n";if(null!=a.superset){d=[];f=0;for(g=q.filter(k.params,function(l){return null==a.getFieldCode(l.className)});f<
g.length;)h=g[f++],d.push(h.className);b+="\t\tsuper("+d.join(", ")+");\n"}d=0;for(f=k.params;d<f.length;)g=f[d],++d,h=a.getFieldCode(g.className),null!=h&&(b+="\t\tthis."+h.className+" = "+g.className+";\n");d=a.fields;for(f=0;f<d.length;){let l=d[f];++f;l.isStatic||q.exists(k.params,function(n){return l.className==n.className})||(b+="\t\tthis."+l.className+" = "+I.getDefaultValue(l.classType,"new Array"+J.getType(l.classType)+"()")+";\n")}d=a.navFields;for(f=0;f<d.length;){let l=d[f];++f;l.isStatic||
q.exists(k.params,function(n){return l.className==n.className})||(b+="\t\tthis."+l.className+" = "+I.getDefaultValue(l.classType,"new Array"+J.getType(l.classType)+"()")+";\n")}b+="\t}\n"}return b}static getType(a,b){null==b&&(b=!1);let c=a;"Array"==t.substr(a,0,5)?c=(b?"Array":"")+"List"+t.substr(a,5,null):"Int"==a||"Float"==a||"Double"==a?c=a.toLowerCase():"Bool"==a?c="boolean":"Date"==a?c="LocalDate":"Time"==a?c="LocalTime":"DateTime"==a&&(c="LocalDateTime");return c}}F.code.JavaCode=J;J.__name__=
!0;class K{static generate(a){let b=new S;for(a=a.iterator();a.hasNext();){var c=a.next();if(!(c instanceof H)||E.__cast(c,H).isClass()){let e=c.className+".php";c=K.generateClass(c);b.h[e]=c}}return b}static generateClass(a){let b;b="<?php\n"+K.addImports(a);b=a.isInterface?b+("interface "+a.className+(a.isGeneric()?"<T>":"")+" {\n"):b+((a.isAbstract?"abstract ":"")+"class "+a.className+(null!=a.superset?"extends "+a.superset.className:"")+" {\n");b+=K.generateFields(a);b+=K.generateConstructors(a);
b+=K.generateMethods(a);return b+"}\n?>\n"}static addImports(a){let b=[];for(var c=a.fields,e=0;e<c.length;){var d=c[e];++e;d=0==d.classType.indexOf("Array")?d.classType.substring(6,d.classType.length-1):d.classType;90>=t.cca(K.getType(d),0)&&d!=a.className&&"DateTime"!=K.getType(d)&&!q.has(b,"require_once('"+d+".php');")&&b.push("require_once('"+d+".php');")}c=a.navFields;for(e=0;e<c.length;)d=c[e],++e,d=0==d.classType.indexOf("Array")?d.classType.substring(6,d.classType.length-1):d.classType,90>=
t.cca(K.getType(d),0)&&d!=a.className&&"DateTime"!=K.getType(d)&&!q.has(b,"require_once('"+d+".php');")&&b.push("require_once('"+d+".php');");null==a.superset||q.has(b,"require_once('"+a.superset.className+".php');")||b.push("require_once('"+a.superset.className+".php');");return b.join("\n")+"\n\n"}static generateFields(a){let b="";for(var c=a.fields,e=0;e<c.length;){let d=c[e];++e;b+="\t"+(d.visibility==p.ACCESS_PRIVATE?"private ":d.visibility==p.ACCESS_PROTECTED?"protected ":"public ")+(d.isStatic?
"static ":"")+K.getType(d.classType)+" $"+d.className+";\n"}a=a.navFields;for(c=0;c<a.length;)e=a[c],++c,b+="\t"+(e.visibility==p.ACCESS_PRIVATE?"private ":e.visibility==p.ACCESS_PROTECTED?"protected ":"public ")+(e.isStatic?"static ":"")+K.getType(e.classType)+" $"+e.className+";\n";return b}static generateMethods(a){let b="",c=0,e=[a.accessors,a.methods];for(;c<e.length;){let f=e[c];++c;let g=0;for(;g<f.length;){let h=f[g];++g;var d="\n\t"+(h.visibility==p.ACCESS_PRIVATE?"private ":h.visibility==
p.ACCESS_PROTECTED?"protected ":"public ")+(h.isStatic?"static ":"")+"function "+h.className+"(";let k=[],l=D(h.params);for(;l.hasNext();){let n=l.next();k.push(K.getType(n.classType)+" $"+n.className)}b+=d+k.join(", ")+")"+(""==h.classType?"":": "+K.getType(h.classType))+" {\n";"get"==t.substr(h.className,0,3)||"set"==t.substr(h.className,0,3)?(d=a.getFieldCode(I.extractFieldName(h.className)),null!=d&&("set"==t.substr(h.className,0,3)&&(b+="\t\t$this->"+d.className+" = $"+d.className+";\n"),b="Array"==
t.substr(d.classType,0,5)?b+("\t\treturn $this->"+d.className+"->clone();\n"):b+("\t\treturn $this->"+d.className+";\n"))):1!=h.params.length||"add"!=t.substr(h.className,0,3)&&"remove"!=t.substr(h.className,0,6)?""!=h.classType&&(b+="\t\treturn "+I.getDefaultValue(h.classType,"[]")+";\n"):(d=a.getFieldFromArrayType(h.params[0].classType),null!=d&&(b+="\t\t$this->"+d.className+("add"==t.substr(h.className,0,3)?"->add(":"->remove(")+h.params[0].className+");\n",b+="\t\treturn $this;\n"));b+="\t}\n"}}return b}static generateConstructors(a){let b=
"",c=0,e=a.constructors;for(;c<e.length;){let k=e[c];++c;for(var d=[],f=D(k.params);f.hasNext();){var g=f.next();d.push(K.getType(g.classType)+" $"+g.className)}b+="\n\tfunction __construct("+d.join(", ")+") {\n";if(null!=a.superset){d=[];f=0;for(g=q.filter(k.params,function(l){return null==a.getFieldCode(l.className)});f<g.length;){var h=g[f++];d.push("$"+h.className)}b+="\t\tparrent::__construct("+d.join(", ")+");\n"}d=0;for(f=k.params;d<f.length;)g=f[d],++d,h=a.getFieldCode(g.className),null!=
h&&(b+="\t\t$this->"+h.className+" = $"+g.className+";\n");d=a.fields;for(f=0;f<d.length;){let l=d[f];++f;l.isStatic||q.exists(k.params,function(n){return l.className==n.className})||(b+="\t\t$this->"+l.className+" = "+I.getDefaultValue(l.classType,"[]")+";\n")}d=a.navFields;for(f=0;f<d.length;){let l=d[f];++f;l.isStatic||q.exists(k.params,function(n){return l.className==n.className})||(b+="\t\t$this->"+l.className+" = "+I.getDefaultValue(l.classType,"[]")+";\n")}b+="\t}\n"}return b}static getType(a){let b=
a;"Array"==t.substr(a,0,5)?b="array/*"+t.substr(a,5,null)+"*/":"Int"==a||"Float"==a||"Double"==a||"String"==a?b=a.toLowerCase():"Date"==a||"Time"==a||"DateTime"==a?b="DateTime":"Bool"==a?b="boolean":"T"==a&&(b="mixed");return b}}F.code.PhpCode=K;K.__name__=!0;class O{static generate(a){let b=new S;for(a=a.iterator();a.hasNext();){var c=a.next();if(!(c instanceof H)||E.__cast(c,H).isClass()){let e=c.className.toLowerCase()+".py";c=O.generateClass(c);b.h[e]=c}}return b}static generateClass(a){let b;
b=""+O.addImports(a);a.isInterface||(b+="class "+a.className+(null!=a.superset?"("+a.superset.className+")":"")+":\n");b+=O.generateFields(a);b+=O.generateConstructor(a);b+=O.generateMethods(a);return b+"\n"}static addImports(a){let b=[];b.push("from __future__ import annotations");let c=0,e=[a.fields,a.navFields];for(;c<e.length;){let f=e[c];++c;let g=0;for(;g<f.length;){var d=f[g];++g;"Array"==t.substr(d.classType,0,5)?(q.has(b,"from typing import List")||b.push("from typing import List"),d=d.classType.substring(6,
d.classType.length-1),q.has(b,"import "+d.toLowerCase())||b.push("import "+d.toLowerCase())):"Date"!=t.substr(d.classType,0,4)||q.has(b,"from datetime import date")?"Time"!=t.substr(d.classType,0,4)||q.has(b,"from datetime import time")?"DateTime"!=t.substr(d.classType,0,8)||q.has(b,"from datetime import datetime")?"T"!=d.classType&&90>=t.cca(O.getType(d.classType),0)&&d.classType!=a.className&&!q.has(b,"import "+d.classType.toLowerCase())&&b.push("import "+d.classType.toLowerCase()):b.push("from datetime import datetime"):
b.push("from datetime import time"):b.push("from datetime import date")}}null==a.superset||q.has(b,"from "+a.superset.className.toLowerCase()+" import "+a.superset.className)||b.push("from "+a.superset.className.toLowerCase()+" import "+a.superset.className);if(q.exists(a.fields,function(f){return-1==f.classType.indexOf("<T>")?"T"==f.classType:!0})||q.exists(a.methods,function(f){return f.isGeneric()}))b.push("from typing import TypeVar"),b.push('T = TypeVar("T")');return b.join("\n")+"\n\n"}static generateFields(a){let b=
"";for(var c=a.fields,e=0;e<c.length;){let d=c[e];++e;b+="\t"+(d.visibility==p.ACCESS_PRIVATE||d.visibility==p.ACCESS_PROTECTED?"_":"")+d.className+": "+O.getType(d.classType)+(d.isStatic?" #static":"")+"\n"}a=a.navFields;for(c=0;c<a.length;)e=a[c],++c,b+="\t"+(e.visibility==p.ACCESS_PRIVATE||e.visibility==p.ACCESS_PROTECTED?"_":"")+e.className+": "+O.getType(e.classType)+(e.isStatic?" #static":"")+"\n";return b}static generateMethods(a){let b="",c=0,e=[a.accessors,a.methods];for(;c<e.length;){let f=
e[c];++c;let g=0;for(;g<f.length;){let h=f[g];++g;var d=[];let k=D(h.params);for(;k.hasNext();){let l=k.next();d.push(l.className+": "+O.getType(l.classType))}h.isStatic||d.splice(0,0,"self");b+="\n\t"+(h.visibility==p.ACCESS_PRIVATE||h.visibility==p.ACCESS_PROTECTED?"_":"")+"def "+h.className+"("+d.join(", ")+")"+(""==h.classType?"":" -> "+O.getType(h.classType))+":\n";"get"==t.substr(h.className,0,3)||"set"==t.substr(h.className,0,3)?(d=a.getFieldCode(I.extractFieldName(h.className)),null!=d&&("set"==
t.substr(h.className,0,3)&&(b+="\t\tself."+(d.visibility==p.ACCESS_PRIVATE||d.visibility==p.ACCESS_PROTECTED?"_":"")+d.className+" = "+d.className+"\n"),b+="\t\treturn self."+(d.visibility==p.ACCESS_PRIVATE||d.visibility==p.ACCESS_PROTECTED?"_":"")+d.className+("Array"==t.substr(d.classType,0,5)?".copy()":"")+"\n")):1!=h.params.length||"add"!=t.substr(h.className,0,3)&&"remove"!=t.substr(h.className,0,6)?b=""!=h.classType?b+("\t\treturn "+I.getDefaultValue(h.classType,"None")+"\n"):b+"\t\tpass\n":
(d=a.getFieldFromArrayType(h.params[0].classType),null!=d&&(b+="\t\tself."+(d.visibility==p.ACCESS_PRIVATE||d.visibility==p.ACCESS_PROTECTED?"_":"")+d.className+("add"==t.substr(h.className,0,3)?".append(":".remove(")+h.params[0].className+")\n",b+="\t\treturn self;\n"))}}return b}static generateConstructor(a){let b="";if(0!=a.constructors.length){var c=!0;let g=a.constructors[0];for(var e=[],d=D(g.params);d.hasNext();){var f=d.next();e.push(f.className+": "+O.getType(f.classType))}e.splice(0,0,"self");
b+="\n\tdef __init__("+e.join(", ")+"):\n";if(null!=a.superset){c=[];e=0;for(d=q.filter(g.params,function(h){return null==a.getFieldCode(h.className)});e<d.length;)f=d[e++],c.push(f.className);b+="\t\tsuper().__init__("+c.join(", ")+")\n";c=!1}e=0;for(d=g.params;e<d.length;){f=d[e];++e;let h=a.getFieldCode(f.className);null!=h&&(b+="\t\tself."+(h.visibility==p.ACCESS_PRIVATE||h.visibility==p.ACCESS_PROTECTED?"_":"")+h.className+" = "+f.className+"\n",c=!1)}e=a.fields;for(d=0;d<e.length;){let h=e[d];
++d;h.isStatic||q.exists(g.params,function(k){return h.className==k.className})||(b+="\t\tself."+(h.visibility==p.ACCESS_PRIVATE||h.visibility==p.ACCESS_PROTECTED?"_":"")+h.className+" = "+I.getDefaultValue(h.classType,"[]","None")+"\n",c=!1)}e=a.navFields;for(d=0;d<e.length;){let h=e[d];++d;h.isStatic||q.exists(g.params,function(k){return h.className==k.className})||(b+="\t\tself."+(h.visibility==p.ACCESS_PRIVATE||h.visibility==p.ACCESS_PROTECTED?"_":"")+h.className+" = "+I.getDefaultValue(h.classType,
"[]","None")+"\n",c=!1)}c&&(b+="\t\tpass\n")}return b}static getType(a){let b=a;if("Array"==t.substr(a,0,5))b="List["+t.substr(a,6,a.length-7)+"]";else if("String"==a)b="str";else if("Int"==a||"Float"==a||"Double"==a||"Date"==a||"Time"==a||"DateTime"==a)b=a.toLowerCase();return b}}F.code.PythonCode=O;O.__name__=!0;class La{static generateSQL(a){let b="",c="";a=a.relations.h;let e=Object.keys(a),d=e.length,f=0;for(;f<d;){let g=a[e[f++]],h=!1;b+="CREATE TABLE IF NOT EXISTS "+g.name+" (";let k=!0,l=
0,n=g.fields;for(;l<n.length;){let v=n[l];++l;let y=q.find(g.foreignKeys,function(L){return L.name==v.name});k?k=!1:b+=", ";b+=v.name+" ";"COUNTER"==v.type.toUpperCase()?1==g.key.length&&g.key[0]==v.name?(b+="INT PRIMARY KEY AUTO_INCREMENT",h=!0):b+="INT":b+=v.dbType;h||1!=g.key.length||g.key[0]!=v.name||(b+=" PRIMARY KEY");null!=y&&(c+="ALTER TABLE "+g.name+" ADD FOREIGN KEY ("+v.name+") REFERENCES "+y.relation.name+"("+y.key+");\n")}1!=g.key.length&&(b+=", PRIMARY KEY("+g.key.join(",")+")");b+=
");\n"}return b+c}}F.database.DBMariaDB=La;La.__name__=!0;class Ma{static generateSQL(a){let b="",c="";a=a.relations.h;let e=Object.keys(a),d=e.length,f=0;for(;f<d;){let g=a[e[f++]],h=!1;b+="CREATE TABLE IF NOT EXISTS "+g.name+" (";let k=!0,l=0,n=g.fields;for(;l<n.length;){let v=n[l];++l;let y=q.find(g.foreignKeys,function(L){return L.name==v.name});k?k=!1:b+=", ";b+=v.name+" ";"COUNTER"==v.type.toUpperCase()?1==g.key.length&&g.key[0]==v.name?(b+="SERIAL PRIMARY KEY",h=!0):b+="INT":b+=v.dbType;h||
1!=g.key.length||g.key[0]!=v.name||(b+=" PRIMARY KEY");null!=y&&(c+="ALTER TABLE "+g.name+" ADD FOREIGN KEY ("+v.name+") REFERENCES "+y.relation.name+"("+y.key+");\n")}1!=g.key.length&&(b+=", PRIMARY KEY("+g.key.join(",")+")");b+=");\n"}return b+c}}F.database.DBPostgreSQL=Ma;Ma.__name__=!0;class Na{static generateSQL(a){let b="";a=a.relations.h;let c=Object.keys(a),e=c.length,d=0;for(;d<e;){let f=a[c[d++]],g=!1;b+="CREATE TABLE IF NOT EXISTS "+f.name+" (";let h=!0,k=0,l=f.fields;for(;k<l.length;){let n=
l[k];++k;let v=q.find(f.foreignKeys,function(y){return y.name==n.name});h?h=!1:b+=", ";b+=n.name+" ";"COUNTER"==n.type.toUpperCase()?1==f.key.length&&f.key[0]==n.name?(b+="INTEGER PRIMARY KEY AUTOINCREMENT",g=!0):b+="INT":b+=n.dbType;g||1!=f.key.length||f.key[0]!=n.name||(b+=" PRIMARY KEY");null!=v&&(b+=" REFERENCES "+v.relation.name+"("+v.key+")")}1!=f.key.length&&(b+=", PRIMARY KEY("+f.key.join(",")+")");b+=");\n"}return b}}F.database.DBSqlite=Na;Na.__name__=!0;class Ha{}Ha.__name__=!0;Ha.__isInterface__=
!0;class x extends Error{constructor(a,b,c){super(a);this.message=a;this.__previousException=b;this.__nativeException=null!=c?c:this}unwrap(){return this.__nativeException}toString(){return this.get_message()}get_message(){return this.message}get_native(){return this.__nativeException}static caught(a){return a instanceof x?a:a instanceof Error?new x(a.message,null,a):new ia(a,null,a)}static thrown(a){return a instanceof x?a.get_native():a instanceof Error?a:new ia(a)}}x.__name__=!0;x.__super__=Error;
Object.assign(x.prototype,{__class__:x});class ia extends x{constructor(a,b,c){super(String(a),b,c);this.value=a}unwrap(){return this.value}}ia.__name__=!0;ia.__super__=x;Object.assign(ia.prototype,{__class__:ia});class Q{constructor(a){this.length=a.byteLength;this.b=new Uint8Array(a);this.b.bufferValue=a;a.hxBytes=this;a.bytes=this.b}getString(a,b,c){if(0>a||0>b||a+b>this.length)throw x.thrown(Z.OutsideBounds);null==c&&(c=na.UTF8);let e="",d=this.b,f=a;a+=b;switch(c._hx_index){case 0:for(;f<a;)if(c=
d[f++],128>c){if(0==c)break;e+=String.fromCodePoint(c)}else if(224>c)c=(c&63)<<6|d[f++]&127,e+=String.fromCodePoint(c);else if(240>c)b=d[f++],c=(c&31)<<12|(b&127)<<6|d[f++]&127,e+=String.fromCodePoint(c);else{b=d[f++];let g=d[f++];c=(c&15)<<18|(b&127)<<12|(g&127)<<6|d[f++]&127;e+=String.fromCodePoint(c)}break;case 1:for(;f<a;)c=d[f++]|d[f++]<<8,e+=String.fromCodePoint(c)}return e}toString(){return this.getString(0,this.length)}static ofString(a,b){if(b==na.RawNative){b=new Uint8Array(a.length<<1);
for(var c=0,e=a.length;c<e;){let d=c++,f=a.charCodeAt(d);b[d<<1]=f&255;b[d<<1|1]=f>>8}return new Q(b.buffer)}b=[];for(c=0;c<a.length;)e=a.charCodeAt(c++),55296<=e&&56319>=e&&(e=e-55232<<10|a.charCodeAt(c++)&1023),127>=e?b.push(e):(2047>=e?b.push(192|e>>6):(65535>=e?b.push(224|e>>12):(b.push(240|e>>18),b.push(128|e>>12&63)),b.push(128|e>>6&63)),b.push(128|e&63));return new Q((new Uint8Array(b)).buffer)}}Q.__name__=!0;Object.assign(Q.prototype,{__class__:Q});var na=ea["haxe.io.Encoding"]={__ename__:!0,
__constructs__:null,UTF8:{_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding",toString:ba},RawNative:{_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding",toString:ba}};na.__constructs__=[na.UTF8,na.RawNative];class ha{static encode(a,b){null==b&&(b=!0);let c=(new xa(ha.BYTES)).encodeBytes(a).toString();if(b)switch(a.length%3){case 1:c+="==";break;case 2:c+="="}return c}}ha.__name__=!0;class xa{constructor(a){let b=a.length,c=1;for(;b>1<<c;)++c;if(8<c||b!=1<<c)throw x.thrown("BaseCode : base length must be a power of two.");
this.base=a;this.nbits=c}encodeBytes(a){let b=this.nbits,c=this.base,e=8*a.length/b|0,d=new Q(new ArrayBuffer(e+(0==8*a.length%b?0:1))),f=0,g=0,h=(1<<b)-1,k=0,l=0;for(;l<e;){for(;g<b;)g+=8,f<<=8,f|=a.b[k++];g-=b;d.b[l++]=c.b[f>>g&h]}0<g&&(d.b[l++]=c.b[f<<b-g&h]);return d}}xa.__name__=!0;Object.assign(xa.prototype,{__class__:xa});class Ga{static make(a){let b=-1,c=a.b.bufferValue,e=0;for(a=a.length;e<a;){var d=e++;d=(b^c.bytes[d])&255;d=d>>>1^-(d&1)&-306674912;d=d>>>1^-(d&1)&-306674912;d=d>>>1^-(d&
1)&-306674912;d=d>>>1^-(d&1)&-306674912;d=d>>>1^-(d&1)&-306674912;d=d>>>1^-(d&1)&-306674912;d=d>>>1^-(d&1)&-306674912;d=d>>>1^-(d&1)&-306674912;b=b>>>8^d}return b^-1}}Ga.__name__=!0;class la{constructor(){this.length=0}add(a){a=new oa(a,null);null==this.h?this.h=a:this.q.next=a;this.q=a;this.length++}push(a){this.h=a=new oa(a,this.h);null==this.q&&(this.q=a);this.length++}}la.__name__=!0;Object.assign(la.prototype,{__class__:la});class oa{constructor(a,b){this.item=a;this.next=b}}oa.__name__=!0;Object.assign(oa.prototype,
{__class__:oa});class S{constructor(){this.h=Object.create(null)}iterator(){return new ya(this.h)}}S.__name__=!0;S.__interfaces__=[Ha];Object.assign(S.prototype,{__class__:S});class wa{constructor(a){this.h=a;this.keys=Object.keys(a);this.length=this.keys.length;this.current=0}hasNext(){return this.current<this.length}next(){return this.keys[this.current++]}}wa.__name__=!0;Object.assign(wa.prototype,{__class__:wa});class ya{constructor(a){this.h=a;this.keys=Object.keys(a);this.length=this.keys.length;
this.current=0}hasNext(){return this.current<this.length}next(){return this.h[this.keys[this.current++]]}}ya.__name__=!0;Object.assign(ya.prototype,{__class__:ya});class ja extends x{constructor(a,b,c){super(a,b);this.posInfos=null==c?{fileName:"(unknown)",lineNumber:0,className:"(unknown)",methodName:"(unknown)"}:c}toString(){return""+super.toString()+" in "+this.posInfos.className+"."+this.posInfos.methodName+" at "+this.posInfos.fileName+":"+this.posInfos.lineNumber}}ja.__name__=!0;ja.__super__=
x;Object.assign(ja.prototype,{__class__:ja});class pa extends ja{constructor(a,b,c){null==a&&(a="Not implemented");super(a,b,c)}}pa.__name__=!0;pa.__super__=ja;Object.assign(pa.prototype,{__class__:pa});class za{constructor(){this.size=this.pos=0}addByte(a){this.pos==this.size&&this.grow(1);this.view.setUint8(this.pos++,a)}addBytes(a,b,c){if(0>b||0>c||b+c>a.length)throw x.thrown(Z.OutsideBounds);this.pos+c>this.size&&this.grow(c);0!=this.size&&(a=new Uint8Array(a.b.buffer,a.b.byteOffset+b,c),this.u8.set(a,
this.pos),this.pos+=c)}grow(a){var b=this.pos+a;for(a=0==this.size?16:this.size;a<b;)a=3*a>>1;b=new ArrayBuffer(a);let c=new Uint8Array(b);0<this.size&&c.set(this.u8);this.size=a;this.buffer=b;this.u8=c;this.view=new DataView(this.buffer)}getBytes(){if(0==this.size)return new Q(new ArrayBuffer(0));let a=new Q(this.buffer);a.length=this.pos;return a}}za.__name__=!0;Object.assign(za.prototype,{__class__:za});class qa{writeByte(a){throw new pa(null,null,{fileName:"haxe/io/Output.hx",lineNumber:47,className:"haxe.io.Output",
methodName:"writeByte"});}writeBytes(a,b,c){if(0>b||0>c||b+c>a.length)throw x.thrown(Z.OutsideBounds);a=a.b;let e=c;for(;0<e;)this.writeByte(a[b]),++b,--e;return c}write(a){let b=a.length,c=0;for(;0<b;){let e=this.writeBytes(a,c,b);if(0==e)throw x.thrown(Z.Blocked);c+=e;b-=e}}writeFullBytes(a,b,c){for(;0<c;){let e=this.writeBytes(a,b,c);b+=e;c-=e}}writeUInt16(a){if(0>a||65536<=a)throw x.thrown(Z.Overflow);this.bigEndian?(this.writeByte(a>>8),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>
8))}writeInt32(a){this.bigEndian?(this.writeByte(a>>>24),this.writeByte(a>>16&255),this.writeByte(a>>8&255),this.writeByte(a&255)):(this.writeByte(a&255),this.writeByte(a>>8&255),this.writeByte(a>>16&255),this.writeByte(a>>>24))}writeString(a,b){a=Q.ofString(a,b);this.writeFullBytes(a,0,a.length)}}qa.__name__=!0;Object.assign(qa.prototype,{__class__:qa});class fa extends qa{constructor(){super();this.b=new za}writeByte(a){this.b.addByte(a)}writeBytes(a,b,c){this.b.addBytes(a,b,c);return c}getBytes(){return this.b.getBytes()}}
fa.__name__=!0;fa.__super__=qa;Object.assign(fa.prototype,{__class__:fa});var Z=ea["haxe.io.Error"]={__ename__:!0,__constructs__:null,Blocked:{_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error",toString:ba},Overflow:{_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error",toString:ba},OutsideBounds:{_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error",toString:ba},Custom:(R=function(a){return{_hx_index:3,e:a,__enum__:"haxe.io.Error",toString:ba}},R._hx_name="Custom",R.__params__=["e"],
R)};Z.__constructs__=[Z.Blocked,Z.Overflow,Z.OutsideBounds,Z.Custom];class ta{constructor(a){this.current=0;this.array=a}hasNext(){return this.current<this.array.length}next(){return this.array[this.current++]}}ta.__name__=!0;Object.assign(ta.prototype,{__class__:ta});class ma{constructor(a){this.output=new va;this.pretty=a}writeNode(a,b){switch(a.nodeType){case 0:this.output.b+=r.string(b+"<");if(a.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element but found "+(null==a.nodeType?
"null":B.toString(a.nodeType)));this.output.b+=r.string(a.nodeName);for(var c=a.attributes();c.hasNext();){var e=c.next();this.output.b+=r.string(" "+e+'="');e=z.htmlEscape(a.get(e),!0);this.output.b+=r.string(e);this.output.b+='"'}if(this.hasChildren(a)){this.output.b+=">";this.pretty&&(this.output.b+="\n");if(a.nodeType!=m.Document&&a.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==a.nodeType?"null":B.toString(a.nodeType)));c=0;for(e=a.children;c<
e.length;){let d=e[c++];this.writeNode(d,this.pretty?b+"\t":b)}this.output.b+=r.string(b+"</");if(a.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element but found "+(null==a.nodeType?"null":B.toString(a.nodeType)));this.output.b+=r.string(a.nodeName);this.output.b+=">"}else this.output.b+="/>";this.pretty&&(this.output.b+="\n");break;case 1:if(a.nodeType==m.Document||a.nodeType==m.Element)throw x.thrown("Bad node type, unexpected "+(null==a.nodeType?"null":B.toString(a.nodeType)));
a=a.nodeValue;0!=a.length&&(b+=z.htmlEscape(a),this.output.b+=r.string(b),this.pretty&&(this.output.b+="\n"));break;case 2:this.output.b+=r.string(b+"<![CDATA[");if(a.nodeType==m.Document||a.nodeType==m.Element)throw x.thrown("Bad node type, unexpected "+(null==a.nodeType?"null":B.toString(a.nodeType)));this.output.b+=r.string(a.nodeValue);this.output.b+="]]\x3e";this.pretty&&(this.output.b+="\n");break;case 3:if(a.nodeType==m.Document||a.nodeType==m.Element)throw x.thrown("Bad node type, unexpected "+
(null==a.nodeType?"null":B.toString(a.nodeType)));a=a.nodeValue;a=a.replace(RegExp("[\n\r\t]+","g"),"");this.output.b+=null==b?"null":""+b;b=z.trim("\x3c!--"+a+"--\x3e");this.output.b+=r.string(b);this.pretty&&(this.output.b+="\n");break;case 4:if(a.nodeType==m.Document||a.nodeType==m.Element)throw x.thrown("Bad node type, unexpected "+(null==a.nodeType?"null":B.toString(a.nodeType)));this.output.b+=r.string("<!DOCTYPE "+a.nodeValue+">");this.pretty&&(this.output.b+="\n");break;case 5:if(a.nodeType==
m.Document||a.nodeType==m.Element)throw x.thrown("Bad node type, unexpected "+(null==a.nodeType?"null":B.toString(a.nodeType)));this.output.b+=r.string("<?"+a.nodeValue+"?>");this.pretty&&(this.output.b+="\n");break;case 6:if(a.nodeType!=m.Document&&a.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==a.nodeType?"null":B.toString(a.nodeType)));c=0;for(a=a.children;c<a.length;)e=a[c++],this.writeNode(e,b)}}hasChildren(a){if(a.nodeType!=m.Document&&a.nodeType!=
m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==a.nodeType?"null":B.toString(a.nodeType)));let b=0;for(a=a.children;b<a.length;){let c=a[b++];switch(c.nodeType){case 0:case 1:return!0;case 2:case 3:if(c.nodeType==m.Document||c.nodeType==m.Element)throw x.thrown("Bad node type, unexpected "+(null==c.nodeType?"null":B.toString(c.nodeType)));if(0!=z.ltrim(c.nodeValue).length)return!0}}return!1}static print(a,b){null==b&&(b=!1);b=new ma(b);b.writeNode(a,"");return b.output.b}}
ma.__name__=!0;Object.assign(ma.prototype,{__class__:ma});var Aa=ea["haxe.zip.ExtraField"]={__ename__:!0,__constructs__:null,FUnknown:(R=function(a,b){return{_hx_index:0,tag:a,bytes:b,__enum__:"haxe.zip.ExtraField",toString:ba}},R._hx_name="FUnknown",R.__params__=["tag","bytes"],R),FInfoZipUnicodePath:(R=function(a,b){return{_hx_index:1,name:a,crc:b,__enum__:"haxe.zip.ExtraField",toString:ba}},R._hx_name="FInfoZipUnicodePath",R.__params__=["name","crc"],R),FUtf8:{_hx_name:"FUtf8",_hx_index:2,__enum__:"haxe.zip.ExtraField",
toString:ba}};Aa.__constructs__=[Aa.FUnknown,Aa.FInfoZipUnicodePath,Aa.FUtf8];class ua{constructor(a){this.o=a;this.files=new la}writeZipDate(a){var b=a.getHours(),c=a.getMinutes();let e=a.getSeconds()>>1;this.o.writeUInt16(b<<11|c<<5|e);b=a.getFullYear()-1980;c=a.getMonth()+1;a=a.getDate();this.o.writeUInt16(b<<9|c<<5|a)}writeEntryHeader(a){let b=this.o;var c=0;if(null!=a.extraFields)for(var e=a.extraFields.h;null!=e;){var d=e.item;e=e.next;2==d._hx_index&&(c|=2048)}b.writeInt32(67324752);b.writeUInt16(20);
b.writeUInt16(c);if(null==a.data)a.fileSize=0,a.dataSize=0,a.crc32=0,a.compressed=!1,a.data=new Q(new ArrayBuffer(0));else{if(null==a.crc32){if(a.compressed)throw x.thrown("CRC32 must be processed before compression");a.crc32=Ga.make(a.data)}a.compressed||(a.fileSize=a.data.length);a.dataSize=a.data.length}b.writeUInt16(a.compressed?8:0);this.writeZipDate(a.fileTime);b.writeInt32(a.crc32);b.writeInt32(a.dataSize);b.writeInt32(a.fileSize);b.writeUInt16(a.fileName.length);c=new fa;if(null!=a.extraFields)for(e=
a.extraFields.h;null!=e;)switch(d=e.item,e=e.next,d._hx_index){case 0:var f=d.bytes;c.writeUInt16(d.tag);c.writeUInt16(f.length);c.write(f);break;case 1:f=d.crc,d=Q.ofString(d.name),c.writeUInt16(28789),c.writeUInt16(d.length+5),c.writeByte(1),c.writeInt32(f),c.write(d)}c=c.getBytes();b.writeUInt16(c.length);b.writeString(a.fileName);b.write(c);this.files.add({name:a.fileName,compressed:a.compressed,clen:a.data.length,size:a.fileSize,crc:a.crc32,date:a.fileTime,fields:c})}write(a){for(a=a.h;null!=
a;){var b=a.item;a=a.next;this.writeEntryHeader(b);this.o.writeFullBytes(b.data,0,b.data.length)}this.writeCDR()}writeCDR(){let a=0,b=0,c=this.files.h;for(;null!=c;){var e=c.item;c=c.next;let d=e.name.length,f=e.fields.length;this.o.writeInt32(33639248);this.o.writeUInt16(20);this.o.writeUInt16(20);this.o.writeUInt16(0);this.o.writeUInt16(e.compressed?8:0);this.writeZipDate(e.date);this.o.writeInt32(e.crc);this.o.writeInt32(e.clen);this.o.writeInt32(e.size);this.o.writeUInt16(d);this.o.writeUInt16(f);
this.o.writeUInt16(0);this.o.writeUInt16(0);this.o.writeUInt16(0);this.o.writeInt32(0);this.o.writeInt32(b);this.o.writeString(e.name);this.o.write(e.fields);a+=46+d+f;b+=30+d+f+e.clen}this.o.writeInt32(101010256);this.o.writeUInt16(0);this.o.writeUInt16(0);this.o.writeUInt16(this.files.length);this.o.writeUInt16(this.files.length);this.o.writeInt32(a);this.o.writeInt32(b);this.o.writeUInt16(0)}}ua.__name__=!0;Object.assign(ua.prototype,{__class__:ua});class E{static getClass(a){if(null==a)return null;
if(a instanceof Array)return Array;let b=a.__class__;if(null!=b)return b;a=E.__nativeClassName(a);return null!=a?E.__resolveNativeClass(a):null}static __string_rec(a,b){if(null==a)return"null";if(5<=b.length)return"<...>";var c=typeof a;"function"==c&&(a.__name__||a.__ename__)&&(c="object");switch(c){case "function":return"<function>";case "object":if(a.__enum__){var e=ea[a.__enum__].__constructs__[a._hx_index];c=e._hx_name;if(e.__params__){b+="\t";var d=[],f=0;for(e=e.__params__;f<e.length;){let g=
e[f];f+=1;d.push(E.__string_rec(a[g],b))}return c+"("+d.join(",")+")"}return c}if(a instanceof Array){c="[";b+="\t";d=0;for(f=a.length;d<f;)e=d++,c+=(0<e?",":"")+E.__string_rec(a[e],b);return c+"]"}try{d=a.toString}catch(g){return"???"}if(null!=d&&d!=Object.toString&&"function"==typeof d&&(c=a.toString(),"[object Object]"!=c))return c;c="{\n";b+="\t";d=null!=a.hasOwnProperty;f=null;for(f in a)d&&!a.hasOwnProperty(f)||"prototype"==f||"__class__"==f||"__super__"==f||"__interfaces__"==f||"__properties__"==
f||(2!=c.length&&(c+=", \n"),c+=b+f+" : "+E.__string_rec(a[f],b));b=b.substring(1);return c+("\n"+b+"}");case "string":return a;default:return String(a)}}static __interfLoop(a,b){if(null==a)return!1;if(a==b)return!0;let c=a.__interfaces__;if(null!=c&&(null==a.__super__||a.__super__.__interfaces__!=c)){let d=0,f=c.length;for(;d<f;){var e=d++;e=c[e];if(e==b||E.__interfLoop(e,b))return!0}}return E.__interfLoop(a.__super__,b)}static __instanceof(a,b){if(null==b)return!1;switch(b){case Array:return a instanceof
Array;case Oa:return"boolean"==typeof a;case Pa:return null!=a;case Qa:return"number"==typeof a;case Ra:return"number"==typeof a?(a|0)===a:!1;case String:return"string"==typeof a;default:if(null!=a)if("function"==typeof b){if(E.__downcastCheck(a,b))return!0}else{if("object"==typeof b&&E.__isNativeObj(b)&&a instanceof b)return!0}else return!1;return b==Sa&&null!=a.__name__||b==Ta&&null!=a.__ename__?!0:null!=a.__enum__?ea[a.__enum__]==b:!1}}static __downcastCheck(a,b){return a instanceof b?!0:b.__isInterface__?
E.__interfLoop(E.getClass(a),b):!1}static __cast(a,b){if(null==a||E.__instanceof(a,b))return a;throw x.thrown("Cannot cast "+r.string(a)+" to "+r.string(b));}static __nativeClassName(a){a=E.__toStr.call(a).slice(8,-1);return"Object"==a||"Function"==a||"Math"==a||"JSON"==a?null:a}static __isNativeObj(a){return null!=E.__nativeClassName(a)}static __resolveNativeClass(a){return Ia[a]}}E.__name__=!0;class X{constructor(a){this.set_name(a);this.fields=[]}set_name(a){this.name=a;this.dbName=X.fixName(a);
this.className=this.dbName.charAt(0).toUpperCase()+t.substr(this.dbName,1,null);return this.name}getField(a){return q.find(this.fields,function(b){return b.name==a})}getFieldIndex(a){return q.findIndex(this.fields,function(b){return b.name==a})}static fixName(a,b){null==b&&(b=!0);let c="",e=!1,d=0,f=Ka.get_length(a);for(;d<f;){var g=d++;g=Ka.charAt(a,g);switch(g){case " ":b?(e=!0,g=""):g="_";break;case ".":g="";break;case "\u00c0":case "\u00c2":case "\u00c4":g="A";break;case "\u00c6":g="EA";break;
case "\u00c7":g="C";break;case "\u00c8":case "\u00c9":case "\u00ca":case "\u00cb":g="E";break;case "\u00ce":case "\u00cf":g="I";break;case "\u00d4":case "\u00d6":g="O";break;case "\u00d9":case "\u00db":case "\u00dc":g="U";break;case "\u00e0":case "\u00e2":case "\u00e4":g="a";break;case "\u00e6":g="ea";break;case "\u00e7":g="c";break;case "\u00e8":case "\u00e9":case "\u00ea":case "\u00eb":g="e";break;case "\u00ee":case "\u00ef":g="i";break;case "\u00f4":case "\u00f6":g="o";break;case "\u00f9":case "\u00fb":case "\u00fc":g=
"u";break;case "\u0152":g="EO";break;case "\u0153":g="eo";break;default:e&&(e=!1,g=g.toUpperCase())}c+=g}return c}}X.__name__=!0;Object.assign(X.prototype,{__class__:X});class M extends X{constructor(a,b,c,e,d){null==d&&(d=!1);null==e&&(e=!1);null==c&&(c=!1);super(a);this.superset=b;this.subsets=[];this.subsetType="";this.subsetOption=-1;this.subsetCode="";this.id=[];this.compound=null;this.isTypedef=c;this.isInterface=e;this.isAbstract=d;this.interfaces=[];this.constructors=[];this.methods=[];this.accessors=
[];this.navFields=[]}getFieldCode(a){let b=q.find(this.fields,function(c){return c.className==a});null==b&&(b=q.find(this.navFields,function(c){return c.className==a}));return b}getFieldFromArrayType(a){let b=q.find(this.fields,function(c){return t.substr(c.classType,6,c.classType.length-7)==a});null==b&&(b=q.find(this.navFields,function(c){return t.substr(c.classType,6,c.classType.length-7)==a}));return b}isGeneric(){return q.exists(this.fields,function(a){return a.isStatic?!1:-1==a.classType.indexOf("<T>")?
"T"==a.classType:!0})?!0:q.exists(this.methods,function(a){return a.isStatic?!1:a.isGeneric()})}getPluralClassName(){let a=this.className.charAt(this.className.length-1).toLowerCase(),b=this.className.substring(this.className.length-2,this.className.length).toLowerCase(),c=this.className+"s";if("au"==b||"eu"==b)c=this.className+"x";else if("al"==b)c=this.className.substring(0,this.className.length-2)+"aux";else if("z"==a||"x"==a||"s"==a)c=this.className;return c}}M.__name__=!0;M.__super__=X;Object.assign(M.prototype,
{__class__:M});class H extends M{constructor(a){super(a);this.links=[];this.isAgregation=!1}isReflexive(){return 2==this.links.length?this.links[0].set.name==this.links[1].set.name:!1}isNN(){return!q.exists(this.links,function(a){return"1"==a.max})}isRelation(){return this.isClass()?!0:this.isNN()}isClass(){return 0==this.fields.length?2<this.links.length:!0}}H.__name__=!0;H.__super__=M;Object.assign(H.prototype,{__class__:H});class Ba{constructor(){this.sets=new S;this.associations=new S;this.width=
this.height=0}getObj(a){let b=this.sets.h[a];null==b&&(b=this.associations.h[a]);return b}iterator(){return new Ca(this)}getGrid(){let a=[];for(var b=0,c=this.height;b<c;){b++;let e=[],d=0,f=this.width;for(;d<f;)d++,e.push(null);a.push(e)}for(b=this.iterator();b.hasNext();)c=b.next(),a[c.row][c.col]=c;return a}loadGrid(a){this.height=a.length;this.width=0==this.height?0:a[0].length;let b=0,c=a.length;for(;b<c;){let e=b++,d=0,f=a[e].length;for(;d<f;){let g=d++;null!=a[e][g]&&(a[e][g].row=e,a[e][g].col=
g)}}}}Ba.__name__=!0;Object.assign(Ba.prototype,{__class__:Ba});class Ca{constructor(a){let b=q.array(a.sets);a=q.array(a.associations);this.objects=q.concat(b,a);this.i=0}hasNext(){return this.i!=this.objects.length}next(){this.i++;return this.objects[this.i-1]}}Ca.__name__=!0;Object.assign(Ca.prototype,{__class__:Ca});class p{constructor(a,b,c,e){null==e&&(e=!1);null==c&&(c=0);this.set_name(a);this.set_type(b);this.visibility=c;this.isStatic=e}set_name(a){this.name=a;this.className=X.fixName(a);
return this.name}set_type(a){this.type=a;this.dbType="COUNTER"==a.toUpperCase()?"INT":a.toUpperCase();this.languageType=this.classType=p.classOf(a);return this.type}isArray(){return"Array"==this.classType.substring(0,5)}toDomainString(){return p.getVisibilitySymbol(this.visibility)+" "+this.className}toUMLString(){let a=p.getVisibilitySymbol(this.visibility)+" "+this.className;""!=this.classType&&(a+=" : "+this.classType);return a}static getVisibilitySymbol(a){switch(a){case p.ACCESS_PRIVATE:return"-";
case p.ACCESS_PROTECTED:return"#";case p.ACCESS_PUBLIC:return"+";default:return" "}}static classOf(a){let b=a.toUpperCase();return"FLOAT"==b?"Float":"DOUBLE"==b?"Double":"BOOLEAN"==b?"Bool":"DATE"==b?"Date":"TIME"==b?"Time":"DATETIME"==b?"DateTime":"INTEGER"==b||"INT"==b||"COUNTER"==b?"Int":0==b.indexOf("CHAR(")||0==b.indexOf("VARCHAR(")||"TEXT"==b?"String":a}static arrayOf(a){return"Array<"+p.classOf(a)+">"}}p.__name__=!0;Object.assign(p.prototype,{__class__:p});class ra{constructor(a,b,c,e,d,f,
g,h){this.set=a;this.set_role(b);this.min=c;this.max=e;this.isWeak=d;this.isAgregate=f;this.hasArrow=g;this.visibility=h}set_role(a){this.role=a;this.classRole=X.fixName(a);return this.role}getMCDCards(){let a="X"==this.min&&"X"==this.max?"":this.min+","+this.max;""!=a&&this.isWeak&&(a="("+a+")");return a}getUMLCards(){let a="";if("X"!=this.min||"X"!=this.max)a=this.min==this.max?this.min:"0"==this.min&&"N"==this.max?"*":this.min+".."+z.replace(this.max,"N","*");return a}}ra.__name__=!0;Object.assign(ra.prototype,
{__class__:ra});class Da{constructor(){this.relations=new S}toString(a){null==a&&(a=!0);let b=[],c=D(this.relations);for(;c.hasNext();){let e=c.next();b.push(a?e.toUnivString():e.toENString())}return b.join("\n")}}Da.__name__=!0;Object.assign(Da.prototype,{__class__:Da});class aa extends p{constructor(a,b,c,e){null==e&&(e=!1);null==c&&(c=0);super(a,b,c,e);this.params=[]}toUMLString(){let a=p.getVisibilitySymbol(this.visibility)+" "+this.className+"(",b=[],c=D(this.params);for(;c.hasNext();){let e=
c.next();b.push(e.className+":"+e.classType)}a+=b.join(", ");a+=")";""!=this.classType&&(a+=" : "+this.classType);return a}isGeneric(){return-1==this.classType.indexOf("<T>")&&"T"!=this.classType?q.exists(this.params,function(a){return-1==a.classType.indexOf("<T>")?"T"==a.classType:!0}):!0}}aa.__name__=!0;aa.__super__=p;Object.assign(aa.prototype,{__class__:aa});class ka extends X{constructor(a){super(a);this.key=[];this.foreignKeys=[]}mergeForeignKeys(){let a=[],b=0;for(;b<this.foreignKeys.length;){let c=
{names:[this.foreignKeys[b].name],relation:this.foreignKeys[b].relation,keys:[this.foreignKeys[b].key]},e=1,d=c.relation.key.length;for(;e<d;){let f=e++;c.names.push(this.foreignKeys[b+f].name);c.keys.push(this.foreignKeys[b+f].key);++b}++b;a.push(c)}return a}toENString(){for(var a=this.name+" (",b=this.fields,c=Array(b.length),e=0,d=b.length;e<d;){var f=e++;c[f]=b[f].name}a=a+c.join(", ")+")\n    cl\u00e9 primaire : "+this.key.join(", ")+(0==this.foreignKeys.length?"":"\n");b=this.mergeForeignKeys();
c=Array(b.length);e=0;for(d=b.length;e<d;){f=e++;let g=b[f];c[f]="    cl\u00e9 \u00e9trang\u00e8re : "+g.names.join(", ")+" r\u00e9f\u00e9rence "+g.relation.name+"("+g.keys.join(", ")+")"}return a+c.join("\n")+"\n"}toUnivString(){let a=[];for(var b=0,c=this.key;b<c.length;){var e=c[b];++b;for(var d=[],f=D(this.foreignKeys);f.hasNext();){var g=f.next();d.push(g.name)}a.push("\u001b[4m"+(-1==d.indexOf(e)?"":"#")+e+"\u001b[0m")}b=0;for(c=this.fields;b<c.length;)if(e=c[b],++b,-1==this.key.indexOf(e.name)){d=
[];for(f=D(this.foreignKeys);f.hasNext();)g=f.next(),d.push(g.name);a.push((-1==d.indexOf(e.name)?"":"#")+e.name)}return"\u001b[1m"+this.name+"\u001b[0m ("+a.join(", ")+")\n"}}ka.__name__=!0;ka.__super__=X;Object.assign(ka.prototype,{__class__:ka});class A{constructor(a,b,c){this.topleft=a;this.width=b;this.height=c;this.center={x:a.x+b/2|0,y:a.y+c/2|0}}static areSameLine(a,b){return 5>Math.abs(a.center.y-b.center.y)}static areSameColumn(a,b){return 5>Math.abs(a.center.x-b.center.x)}static leftToRight(a,
b){return A.areSameColumn(a,b)?!1:a.center.x<b.center.x}static topToBottom(a,b){return A.areSameLine(a,b)?!1:a.center.y<b.center.y}static getLine(a,b){let c;A.areSameLine(a,b)?c=A.leftToRight(a,b)?new U({x:a.topleft.x+a.width,y:a.center.y},{x:b.topleft.x,y:a.center.y}):new U({x:a.topleft.x,y:a.center.y},{x:b.topleft.x+b.width,y:a.center.y}):A.areSameColumn(a,b)?c=A.topToBottom(a,b)?new U({x:a.center.x,y:a.topleft.y+a.height},{x:a.center.x,y:b.topleft.y}):new U({x:a.center.x,y:a.topleft.y},{x:a.center.x,
y:b.topleft.y+b.height}):(c=new U({x:a.center.x,y:a.center.y},{x:b.center.x,y:b.center.y}),A.diagonalLine(a,b,c));return c}static diagonalLine(a,b,c){var e=c.getSteering();let d=c.getOffset();var f=a.topleft.x+(a.center.x<b.center.x?a.width:0),g=a.topleft.y+(a.center.y<b.center.y?a.height:0);let h=Math.round((g-d)/e),k=Math.round(f*e+d);k>=a.topleft.y&&k<=a.topleft.y+a.height?(c.start.x=f,c.start.y=k):(c.start.x=h,c.start.y=g);f=b.topleft.x+(a.center.x<b.center.x?0:b.width);a=b.topleft.y+(a.center.y<
b.center.y?0:b.height);g=Math.round((a-d)/e);e=Math.round(f*e+d);e>=b.topleft.y&&e<=b.topleft.y+b.height?(c.end.x=f,c.end.y=e):(c.end.x=g,c.end.y=a)}}A.__name__=!0;Object.assign(A.prototype,{__class__:A});class U{constructor(a,b){this.start=a;this.end=b}getSteering(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}getOffset(){return this.end.y-this.getSteering()*this.end.x}getLabelPos(a,b,c){let e=b?this.end:this.start;b=b?this.start:this.end;return{x:b.x>=e.x?e.x+3:e.x-(10*a.length|0)-
3,y:b.y>=e.y?e.y+16*c:e.y-3-16*(c-1)}}}U.__name__=!0;Object.assign(U.prototype,{__class__:U});class N extends U{constructor(a,b,c,e){super(a,b);this.setMiddle(c,e)}setMiddle(a,b){var c=this.start.x+(this.end.x-this.start.x)/2|0;let e=this.start.y+(this.end.y-this.start.y)/2|0;if(this.start.x==this.end.x)a=this.start.x+a,c=e;else if(this.start.y==this.end.y)a=c,c=this.start.y-b;else{let d=Math.atan(-(this.end.x-this.start.x)/(this.end.y-this.start.y));a=c+Math.cos(d)*a|0;c=e+Math.sin(d)*b|0;if(0>b&&
e>c||0<b&&e<c)c=e+Math.sin(d)*-b|0}this.middle={x:a,y:c}}}N.__name__=!0;N.__super__=U;Object.assign(N.prototype,{__class__:N});class da{static generateSVG(a){let b=m.createDocument(),c=u.initSvg(b),e=a.iterator();for(;e.hasNext();){let d=e.next();d.svg=d instanceof H?da.generateAssociationSVG(E.__cast(d,H)):da.generateSetSVG(d);c.addChild(d.svg)}u.placeObjects(a,c,a.height,a.width);da.drawLines(a,c);return b}static generateAssociationSVG(a){for(var b=0,c=a.name.length,e=0,d=a.fields;e<d.length;){var f=
d[e];++e;++b;f.name.length>c&&(c=f.name.length)}e=m.createElement("g");a.isAgregation&&(d=m.createElement("rect"),e.addChild(d),d.set("height",r.string(16*(0==b?2:b+1)+6)),d.set("width",r.string(9.5*c+16)),d.set("style","fill:white"));d=m.createElement("rect");e.addChild(d);d.set("height",r.string(16*(0==b?2:b+1)+6));d.set("width",r.string(9.5*c+16));d.set("rx","20");d.set("ry","20");d.set("style","fill:white");b=m.createElement("line");e.addChild(b);b.set("x1","0");b.set("x2",r.string(9.5*c+16));
b.set("y1","19");b.set("y2","19");b=m.createElement("text");e.addChild(b);b.addChild(m.createPCData(a.name));b.set("x",r.string(8+9.5*(c-a.name.length)/2));b.set("y","17");c=m.createElement("text");e.addChild(c);b=0;for(d=a.fields.length;b<d;){f=b++;let g=m.createElement("tspan");c.addChild(g);g.set("x",r.string(8));g.set("y",r.string(16*(f+2)+3));g.addChild(m.createPCData(a.fields[f].name))}return e}static generateSetSVG(a){for(var b=0,c=a.name.length,e=0,d=a.fields;e<d.length;){var f=d[e];++e;f.isStatic||
(++b,f.name.length>c&&(c=f.name.length))}e=m.createElement("g");d=m.createElement("rect");e.addChild(d);d.set("height",r.string(16*(0==b?2:b+1)+6));d.set("width",r.string(9.5*c+6|0));d.set("style","fill:white");b=m.createElement("rect");e.addChild(b);b.set("height","19");b.set("width",r.string(9.5*c+6));b.set("style","fill:white");b=m.createElement("text");e.addChild(b);b.addChild(m.createPCData(a.name));b.set("x",r.string(3+9.5*(c-a.name.length)/2));b.set("y","16");c=m.createElement("text");e.addChild(c);
b=0;for(d=a.fields.length;b<d;)if(f=b++,!a.fields[f].isStatic){let g=m.createElement("tspan");c.addChild(g);g.set("x",r.string(1.5));g.set("y",r.string(16*(f+2)+3));-1!=a.id.indexOf(a.fields[f].name)&&g.set("style","text-decoration:underline");g.addChild(m.createPCData(a.fields[f].name))}if(0!=a.subsets.length){a=a.subsetType;if(e.nodeType!=m.Document&&e.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==e.nodeType?"null":B.toString(e.nodeType)));c=
r.parseInt(e.children[0].get("width"));if(e.nodeType!=m.Document&&e.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==e.nodeType?"null":B.toString(e.nodeType)));e.addChild(da.generateInheritanceSVG(a,c,r.parseInt(e.children[0].get("height"))))}return e}static generateInheritanceSVG(a,b,c){let e=m.createElement("g");var d=m.createElement("line");e.addChild(d);d.set("x1",r.string(17));d.set("x2",r.string(17));d.set("y1","0");d.set("y2","3");d=m.createElement("path");
e.addChild(d);d.set("d","M 35 22 a1,1 0 1,0 -35 0 l 35 0");d.set("style","fill:white");d=m.createElement("text");e.addChild(d);d.addChild(m.createPCData(a));d.set("x",r.string(8+9.5*(2-a.length)/2));d.set("y","20");e.set("transform","translate("+r.string((b-35)/2|0)+","+(null==c?"null":""+c)+")");return e}static drawLines(a,b){for(var c=a.associations.h,e=Object.keys(c),d=e.length,f=0;f<d;){var g=c[e[f++]];if(g.isReflexive()){var h=da.getDoubleCurves(g.links[0].set,g);b.addChild(u.getSvgCurve(h[0],
g.links[1].getMCDCards(),null,null));b.addChild(u.getSvgCurve(h[1],null,g.links[0].getMCDCards(),g.links[0].hasArrow?u.MARKERS[0].id:null))}else{h=0;for(var k=g.links;h<k.length;){var l=k[h];++h;let n=A.getLine(u.getBox(g.svg),u.getBox(l.set.svg));b.addChild(u.getSvgLine(n,null,l.getMCDCards(),l.hasArrow?u.MARKERS[0].id:null))}}}a=a.sets.h;c=Object.keys(a);e=c.length;for(d=0;d<e;)if(f=a[c[d++]],0!=f.subsets.length)for(g=0,h=f.subsets;g<h.length;)l=h[g],++g,k=u.getBox(f.svg),l=A.getLine(k,u.getBox(l.svg)),
l.start.x=k.center.x,l.start.y=k.topleft.y+k.height+16+6,b.addChild(u.getSvgLine(l,null,null,null))}static getDoubleCurves(a,b){a=u.getBox(a.svg);let c=u.getBox(b.svg);b=[];if(A.areSameLine(a,c)){var e=A.getLine(a,c);b.push(new N({x:e.start.x,y:a.topleft.y+16},{x:c.center.x,y:c.topleft.y},0,G.BEND_DST));b.push(new N({x:c.center.x,y:c.topleft.y+c.height},{x:e.start.x,y:a.topleft.y+a.height-16},0,-G.BEND_DST))}else A.areSameColumn(a,c)?(e=A.getLine(a,c),b.push(new N({x:a.topleft.x+16,y:e.start.y},{x:c.topleft.x,
y:c.center.y},-G.BEND_DST,0)),b.push(new N({x:c.topleft.x+c.width,y:c.center.y},{x:a.topleft.x+a.width-16,y:e.start.y},G.BEND_DST,0))):(A.leftToRight(a,c)?A.topToBottom(a,c)?(e=new N({x:a.topleft.x+a.width,y:a.topleft.y+a.height-32},{x:c.center.x,y:c.topleft.y},2*G.BEND_DST,2*G.BEND_DST),a=new N({x:c.topleft.x,y:c.center.y},{x:a.topleft.x+a.width-32,y:a.topleft.y+a.height},2*-G.BEND_DST,2*-G.BEND_DST)):(e=new N({x:a.topleft.x+a.width-32,y:a.topleft.y},{x:c.topleft.x,y:c.center.y},2*-G.BEND_DST,2*
G.BEND_DST),a=new N({x:c.center.x,y:c.topleft.y+c.height},{x:a.topleft.x+a.width,y:a.topleft.y+32},2*G.BEND_DST,2*-G.BEND_DST)):A.topToBottom(a,c)?(e=new N({x:a.topleft.x,y:a.topleft.y+a.height-32},{x:c.center.x,y:c.topleft.y},2*-G.BEND_DST,2*G.BEND_DST),a=new N({x:c.topleft.x+c.width,y:c.center.y},{x:a.topleft.x+32,y:a.topleft.y+a.height},2*G.BEND_DST,2*-G.BEND_DST)):(e=new N({x:a.topleft.x+32,y:a.topleft.y},{x:c.topleft.x+c.width,y:c.center.y},2*G.BEND_DST,2*G.BEND_DST),a=new N({x:c.center.x,y:c.topleft.y+
c.height},{x:a.topleft.x,y:a.topleft.y+32},2*-G.BEND_DST,2*-G.BEND_DST)),b.push(e),b.push(a));return b}}F.schema.MCDToSVG=da;da.__name__=!0;class Ea{static generateSVG(a,b){let c=m.createDocument(),e=u.initSvg(c);for(var d=a.relations.h,f=Object.keys(d),g=f.length,h=0;h<g;){var k=d[f[h++]];k.svg=Ea.generateTableSvg(k,b);e.addChild(k.svg)}u.placeObjects(a.relations,e,a.height,a.width);a=a.relations.h;b=Object.keys(a);d=b.length;for(f=0;f<d;)for(g=a[b[f++]],h=0,k=g.foreignKeys;h<k.length;){let l=k[h];
++h;e.addChild(Ea.generateLineSVG(g,l))}return c}static generateTableSvg(a,b){let c=a.name.length;for(var e=0,d=a.fields;e<d.length;){var f=d[e];++e;f=f.name.length+(b?f.dbType.length+2:0);f>c&&(c=f)}e=m.createElement("g");d=m.createElement("rect");e.addChild(d);d.set("height",r.string(16*(a.fields.length+1)+6));d.set("width",r.string(9.5*c+6|0));d.set("style","fill:white");d=m.createElement("rect");e.addChild(d);d.set("height","19");d.set("width",r.string(9.5*c+6));d.set("style","fill:white");d=
m.createElement("text");e.addChild(d);d.addChild(m.createPCData(a.name));d.set("x",r.string(3+9.5*(c-a.name.length)/2));d.set("y","16");d=m.createElement("text");e.addChild(d);f=0;let g=a.fields.length;for(;f<g;){let h=f++,k=m.createElement("tspan");d.addChild(k);k.set("x",r.string(1.5));k.set("y",r.string(16*(h+2)+3));-1!=a.key.indexOf(a.fields[h].name)&&k.set("style","text-decoration:underline");k.addChild(m.createPCData(a.fields[h].name));b&&(k=m.createElement("tspan"),d.addChild(k),k.set("x",
r.string(3+9.5*(c-a.fields[h].dbType.length))),k.set("y",r.string(16*(h+2)+3)),k.addChild(m.createPCData(a.fields[h].dbType)))}return e}static generateLineSVG(a,b){var c=u.coordRE,e=a.svg.get("transform").replace(c.r,"$1").split(",");c=r.parseInt(e[0]);e=r.parseInt(e[1]);var d=a.svg;if(d.nodeType!=m.Document&&d.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==d.nodeType?"null":B.toString(d.nodeType)));var f=r.parseInt(d.children[0].get("width"));d=
u.coordRE;var g=b.relation.svg.get("transform").replace(d.r,"$1").split(",");d=r.parseInt(g[0]);g=r.parseInt(g[1]);var h=b.relation.svg;if(h.nodeType!=m.Document&&h.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==h.nodeType?"null":B.toString(h.nodeType)));h=r.parseInt(h.children[0].get("width"));e+=16*(a.getFieldIndex(b.name)+2);g+=16*(b.relation.getFieldIndex(b.key)+2);a.col==b.relation.col?(c+=f,d+=h,b=a=(Math.max(c,d)|0)+6):a.col<b.relation.col?
(c+=f,a=c+6,b=d-6):(d+=h,a=c-6,b=d+6);f=m.createElement("g");h=m.createElement("path");h.set("d","M "+c+" "+e+" L "+a+" "+e+" L "+b+" "+g+" L "+d+" "+g);h.set("marker-end","url(#"+u.MARKERS[0].id+")");f.addChild(h);return f}}F.schema.MLDToSVG=Ea;Ea.__name__=!0;class G{}G.__name__=!0;class sa extends U{constructor(a,b,c,e){super(a,b);a.y==b.y?(this.point1={x:a.x,y:a.y+e},this.point2={x:b.x,y:a.y+e}):(this.point1={x:a.x+c,y:a.y},this.point2={x:a.x+c,y:b.y})}}sa.__name__=!0;sa.__super__=U;Object.assign(sa.prototype,
{__class__:sa});class u{static initSvg(a){let b=m.createElement("svg");a.addChild(b);b.set("xmlns","http://www.w3.org/2000/svg");a=m.createElement("defs");b.addChild(a);var c=m.createElement("style");a.addChild(c);c.addChild(m.createPCData("@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap')"));c=m.createElement("style");a.addChild(c);c.addChild(m.createPCData("text,text>tspan{font-family:'Roboto Mono';font-size:16px} rect{stroke:black} line,path{fill:none;stroke:black}"));
c=0;let e=u.MARKERS;for(;c<e.length;){let d=e[c];++c;let f=m.createElement("marker");f.set("id",d.id);f.set("orient","auto");f.set("refX",""+(d.width+1));f.set("refY",""+d.height/2);f.set("markerHeight",""+d.height);f.set("markerWidth",""+d.width);let g=m.createElement("path");g.set("style",d.style);g.set("d",d.path);f.addChild(g);a.addChild(f)}return b}static placeObjects(a,b,c,e){let d=[];for(var f=0;f<c;)f++,d.push(0);f=[];for(var g=0;g<e;)g++,f.push(0);for(g=D(a);g.hasNext();){var h=g.next();
if(null!=h.svg){var k=h.svg;if(k.nodeType!=m.Document&&k.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==k.nodeType?"null":B.toString(k.nodeType)));k=r.parseInt(k.children[0].get("width"));var l=h.svg;if(l.nodeType!=m.Document&&l.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==l.nodeType?"null":B.toString(l.nodeType)));l=r.parseInt(l.children[0].get("height"));k>f[h.col]&&(f[h.col]=k);l>d[h.row]&&
(d[h.row]=l)}}g=3;h=[];for(k=0;k<c;)l=k++,h[l]=g,g=g+d[l]+(0!=d[l]?60:0);c=3;k=[];for(l=0;l<e;){var n=l++;k[n]=c;c=c+f[n]+(0!=f[n]?60:0)}for(a=D(a);a.hasNext();)if(e=a.next(),null!=e.svg){l=k[e.col];n=f[e.col];var v=e.svg;if(v.nodeType!=m.Document&&v.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==v.nodeType?"null":B.toString(v.nodeType)));l=l+(n-r.parseInt(v.children[0].get("width")))/2|0;n=h[e.row];v=d[e.row];let y=e.svg;if(y.nodeType!=m.Document&&
y.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==y.nodeType?"null":B.toString(y.nodeType)));n=n+(v-r.parseInt(y.children[0].get("height")))/2|0;e.svg.set("transform","translate("+l+","+n+")")}b.set("width",null==c?"null":""+c);b.set("height",null==g?"null":""+g)}static getTransform(a){let b={x:0,y:0};if(null!=a.get("transform")){let c=u.coordRE;a=a.get("transform").replace(c.r,"$1").split(",");b.x=r.parseInt(a[0]);b.y=r.parseInt(a[1])}return b}static getBox(a){if(a.nodeType!=
m.Document&&a.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==a.nodeType?"null":B.toString(a.nodeType)));let b=a.children[0];return new A(u.getTransform(a),r.parseInt(b.get("width")),r.parseInt(b.get("height")))}static getSvgLine(a,b,c,e){let d=m.createElement("g"),f=m.createElement("line");d.addChild(f);f.set("x1",r.string(a.start.x));f.set("x2",r.string(a.end.x));f.set("y1",r.string(a.start.y));f.set("y2",r.string(a.end.y));u.addLineLabels(a,b,
c,d);null!=e&&f.set("marker-end","url(#"+e+")");return d}static getSvgCurve(a,b,c,e){let d=m.createElement("g"),f=m.createElement("path");d.addChild(f);f.set("d","M "+a.start.x+" "+a.start.y+" Q "+a.middle.x+" "+a.middle.y+" "+a.end.x+" "+a.end.y);u.addLineLabels(a,b,c,d);null!=e&&f.set("marker-end","url(#"+e+")");return d}static getQuadCurve(a,b,c,e){let d=m.createElement("g"),f=m.createElement("path");d.addChild(f);f.set("d","M "+a.start.x+" "+a.start.y+" L "+a.point1.x+" "+a.point1.y+" L "+a.point2.x+
" "+a.point2.y+" L "+a.end.x+" "+a.end.y);u.addLineLabels(a,b,c,d);null!=e&&f.set("marker-end","url(#"+e+")");return d}static addLineLabels(a,b,c,e,d){null==d&&(d=1);if(null!=b){var f=m.createElement("text");e.addChild(f);f.addChild(m.createPCData(b));b=a.getLabelPos(b,!1,d);f.set("x",null==b.x?"null":""+b.x);f.set("y",null==b.y?"null":""+b.y)}null!=c&&(f=m.createElement("text"),e.addChild(f),f.addChild(m.createPCData(c)),a=a.getLabelPos(c,!0,d),f.set("x",null==a.x?"null":""+a.x),f.set("y",null==
a.y?"null":""+a.y))}}u.__name__=!0;class C{static generateSVG(a,b,c){let e=m.createDocument(),d=u.initSvg(e);for(var f=a.sets.h,g=Object.keys(f),h=g.length,k=0;k<h;){var l=f[g[k++]];l.svg=C.generateSetSVG(l,b,c);d.addChild(l.svg)}f=a.associations.h;g=Object.keys(f);h=g.length;for(k=0;k<h;){l=f[g[k++]];if(l.isClass())l.svg=C.generateSetSVG(l,b,c);else{l.svg=m.createElement("g");l.svg.addChild(m.createElement("g"));var n=l.svg;if(n.nodeType!=m.Document&&n.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+
(null==n.nodeType?"null":B.toString(n.nodeType)));n.children[0].set("height",l.isReflexive()?"20":"0");n=l.svg;if(n.nodeType!=m.Document&&n.nodeType!=m.Element)throw x.thrown("Bad node type, expected Element or Document but found "+(null==n.nodeType?"null":B.toString(n.nodeType)));n.children[0].set("width","20")}d.addChild(l.svg)}u.placeObjects(a,d,a.height,a.width);C.drawInheritance(a,d);a=a.associations.h;c=Object.keys(a);f=c.length;for(g=0;g<f;)h=a[c[g++]],C.drawLinks(d,h,b);return e}static useField(a,
b,c){return!a.isStatic||b?a.visibility!=p.ACCESS_PUBLIC?c:!0:!1}static getFieldMaxWidth(a,b,c,e,d){C.useField(a,b,c)&&(a=b?a.toUMLString().length:a.toDomainString().length+(e?7:0),a>d&&(d=a));return d}static getMethodMaxWidth(a,b,c,e){C.useField(a,b,c)&&(a=a.toUMLString().length,a>e&&(e=a));return e}static getFieldsCount(a,b,c){let e;e=1+q.count(a.fields,function(d){return C.useField(d,b,c)});b&&(e+=q.count(a.navFields,function(d){return C.useField(d,b,c)}),e+=q.count(a.constructors,function(d){return C.useField(d,
b,c)}),e+=q.count(a.accessors,function(d){return C.useField(d,b,c)}),e+=q.count(a.methods,function(d){return C.useField(d,b,c)}));return e}static getMaxWidth(a,b,c){let e=a.className.length;q.iter(a.fields,function(d){e=C.getFieldMaxWidth(d,b,c,a.id.includes(d.name),e)});q.iter(a.navFields,function(d){e=C.getFieldMaxWidth(d,b,c,a.id.includes(d.name),e)});b&&(q.iter(a.constructors,function(d){e=C.getMethodMaxWidth(d,b,c,e)}),q.iter(a.accessors,function(d){e=C.getMethodMaxWidth(d,b,c,e)}),q.iter(a.methods,
function(d){e=C.getMethodMaxWidth(d,b,c,e)}));return e}static generateSetSVG(a,b,c){var e=C.getFieldsCount(a,b,c),d=C.getMaxWidth(a,b,c);let f=m.createElement("g");var g=m.createElement("rect");f.addChild(g);g.set("height",r.string(16*e+3*(b?3:2)));g.set("width",r.string(9.5*d+6));g.set("style","fill:white");e=m.createElement("rect");f.addChild(e);e.set("height","19");e.set("width",r.string(9.5*d+6));e.set("style","fill:white");e=m.createElement("text");f.addChild(e);e.addChild(m.createPCData(a.className));
e.set("x",r.string(3+9.5*(d-a.className.length)/2));e.set("y","16");e=m.createElement("text");f.addChild(e);g=2;var h=[a.fields];b&&h.push(a.navFields);for(var k=0;k<h.length;){var l=h[k];++k;let n=0;for(;n<l.length;){let v=l[n];++n;if(C.useField(v,b,c)){let y=m.createElement("tspan");e.addChild(y);y.set("x",r.string(1.5));y.set("y",r.string(16*g+3));v.isStatic&&y.set("style","text-decoration:underline");y.addChild(m.createPCData(b?v.toUMLString():v.toDomainString()+(a.id.includes(v.name)?" <<id>>":
"")));++g}}}if(b){h=m.createElement("line");f.addChild(h);h.set("x1","0");h.set("x2",r.string(6+9.5*d));h.set("y1",r.string(16*g-9));h.set("y2",r.string(16*g-9));d=a.constructors;for(h=0;h<d.length;)k=d[h],++h,C.useField(k,b,c)&&(l=m.createElement("tspan"),e.addChild(l),l.set("x",r.string(1.5)),l.set("y",r.string(16*g+6)),k.isStatic&&l.set("style","text-decoration:underline"),l.addChild(m.createPCData(k.toUMLString())),++g);d=a.accessors;for(h=0;h<d.length;)k=d[h],++h,C.useField(k,b,c)&&(l=m.createElement("tspan"),
e.addChild(l),l.set("x",r.string(1.5)),l.set("y",r.string(16*g+6)),k.isStatic&&l.set("style","text-decoration:underline"),l.addChild(m.createPCData(k.toUMLString())),++g);a=a.methods;for(d=0;d<a.length;)h=a[d],++d,C.useField(h,b,c)&&(k=m.createElement("tspan"),e.addChild(k),k.set("x",r.string(1.5)),k.set("y",r.string(16*g+6)),h.isStatic&&k.set("style","text-decoration:underline"),k.addChild(m.createPCData(h.toUMLString())),++g)}return f}static drawInheritance(a,b){a=a.sets.h;let c=Object.keys(a),
e=c.length,d=0;for(;d<e;){var f=a[c[d++]];null!=f.superset&&(f=A.getLine(u.getBox(f.svg),u.getBox(f.superset.svg)),b.addChild(u.getSvgLine(f,null,null,u.MARKERS[1].id)))}}static drawLinks(a,b,c){if(b.isClass()){var e=u.getBox(b.svg),d=u.getBox(b.links[0].set.svg),f=e.center.x,g=e.center.y;A.areSameLine(e,d)||A.areSameColumn(e,d)?A.areSameLine(e,d)?f=A.leftToRight(e,d)?e.topleft.x+e.width+20:e.topleft.x-20:g=A.topToBottom(e,d)?e.topleft.y+e.height+20:e.topleft.y-20:(f=A.leftToRight(e,d)?e.topleft.x+
e.width+20:e.topleft.x-20,g=A.topToBottom(e,d)?e.topleft.y+e.height+20:e.topleft.y-20);d=new A({x:f,y:g},0,0);e=m.createElement("path");e.set("transform","translate("+d.center.x+","+d.center.y+")");e.set("style","fill:white;stroke:black");e.set("d","M -10 0 L 0 -10 L 10 0 L 0 10 Z");f=0;for(g=b.links;f<g.length;){var h=g[f];++f;let k=A.getLine(u.getBox(h.set.svg),d),l=u.getSvgLine(k,null,null);c||u.addLineLabels(k,C.getLabel(null,h),null,l,1);a.addChild(l)}c=u.getSvgLine(A.getLine(u.getBox(b.svg),
d),null,null);c.set("stroke-dasharray","2,2");a.addChild(c);a.addChild(e)}else if(e=b.links[0],d=b.links[1],null!=e&&null!=d){if(d.isWeak||d.isAgregate||e.hasArrow)e=b.links[1],d=b.links[0];f=e.isWeak?u.MARKERS[3].id:e.isAgregate?u.MARKERS[2].id:d.hasArrow?u.MARKERS[0].id:null;g=u.getBox(e.set.svg);h=u.getBox(d.set.svg);g=A.getLine(g,h);h=e.getUMLCards();if(e.isWeak||e.isAgregate)h="\u00a0"+h+"\u00a0";e.set.name==d.set.name?(g=b=C.getQuadCurve(b,e),b=u.getQuadCurve(b,d.getUMLCards(),h,f)):b=u.getSvgLine(g,
d.getUMLCards(),h,f);c||u.addLineLabels(g,C.getLabel(d,e),C.getLabel(e,d),b,2);a.addChild(b)}}static getQuadCurve(a,b){var c=u.getBox(a.svg),e=u.getBox(b.set.svg);a=b=0;A.areSameLine(c,e)?(c={x:e.topleft.x+e.width,y:e.topleft.y+16+3},e={x:e.topleft.x+e.width,y:e.topleft.y+e.height-16-3},b=40):(c={x:Math.ceil(e.topleft.x+9.5),y:e.topleft.y+e.height},e={x:Math.ceil(e.topleft.x+e.width-9.5),y:e.topleft.y+e.height},a=40);return new sa(c,e,b,a)}static getLabel(a,b){let c="";null!=a&&a.hasArrow||(c=b.classRole,
""==c&&(c=null==a||"1"==a.max?b.set.className:b.set.getPluralClassName()),c=c.charAt(0).toLowerCase()+t.substr(c,1,null));return c}}F.schema.UMLToSVG=C;C.__name__=!0;class w{static deComment(a){var b=a.indexOf("//");-1!=b&&(a=a.substring(0,b));b=a.indexOf("/*");let c=a.indexOf("*/",b+2);for(;-1!=b&&-1!=c;)a=a.substring(0,b)+a.substring(c+2),b=a.indexOf("/*"),c=a.indexOf("*/",b+2);return a}static load(a){var b=a.split("\n");a=new Ba;try{w.loadSets(a,b),w.loadAssociations(a,b),w.loadSubsets(a,b),w.loadMethods(a,
b),w.loadLayout(a,b)}catch(c){b=x.caught(c),"string"==typeof b.unwrap()?a=null:Ia.console.log(b.get_message())}null!=a&&0>=Object.keys(a.sets.h).length&&(a=null);return a}static loadAssociations(a,b){for(var c=0,e=b.length;c<e;){var d=c++,f=w.deComment(b[d]);if(w.associationRE.match(f)){d=z.trim(f.substring(0,f.indexOf(",")));var g=new H(d),h=f.indexOf(":");-1==h&&(h=f.length);f=f.substring(h+1).split(",");h=0;let l=f.length;for(;h<l;){var k=h++;k=z.trim(f[k]);""!=k&&w.loadField(g,null,k)}a.associations.h[d]=
g}}c=0;for(e=b.length;c<e;)d=c++,g=b[d],w.associationRE.match(g)&&(f=z.trim(g.substring(0,g.indexOf(","))),f=a.associations.h[f],h=g.indexOf(":"),-1==h&&(h=g.length),g=g.substring(g.indexOf(",")+1,h).split(","),w.loadAssociationLinks(a,d,f,g))}static loadAssociationLinks(a,b,c,e){let d=b=null,f=0,g=e.length;for(;f<g;){var h=f++;h=z.trim(e[h]);let l=h.replace(w.linkRE.r,"$1");""!=l&&(l=t.substr(l,1,l.length-2));var k=z.trim(h.replace(w.linkRE.r,"$2"));let n=!1,v=!1,y=!1,L=p.ACCESS_UNSET,Y=a.sets.h[k];
null==Y&&(Y=a.associations.h[k],null!=Y&&(E.__cast(Y,H).isAgregation=!0));if(null!=Y){for(;"_"==h.charAt(0)||"*"==h.charAt(0)||"o"==h.charAt(0)||"-"==h.charAt(0)||"+"==h.charAt(0)||"#"==h.charAt(0);){switch(h.charAt(0)){case "#":L=p.ACCESS_PROTECTED;break;case "*":case "_":d=Y;n=!0;break;case "+":L=p.ACCESS_PUBLIC;break;case "-":L=p.ACCESS_PRIVATE;break;case "o":v=!0}h=h.substring(1)}n||(b=Y);k=h.charAt(0);let ca=h.charAt(1);">"==h.charAt(2)&&(y=!0);c.links.push(new ra(Y,l,k,ca,n,v,y,L))}}null!=d&&
(d.compound=b)}static loadSets(a,b){let c=0;for(;c<b.length;){var e=b[c];++c;e=w.deComment(e);if(w.entityRE.match(e)){let d=z.trim(e.substring(0,e.indexOf(":"))),f=new M(d,null,!1,!1);e=z.trim(e.substring(e.indexOf(":")+1));if(""!=e){e=e.split(",");let g=0,h=e.length;for(;g<h;){let k=g++;w.loadField(f,k,z.trim(e[k]))}}a.sets.h[d]=f}}}static loadField(a,b,c){null==b&&(b=-1);let e=w.DEFAULT_TYPE,d=p.ACCESS_UNSET,f=!1,g=!1;w.typeRE.match(c)&&(e=z.trim(c.replace(w.typeRE.r,"$2")),c=z.trim(c.replace(w.typeRE.r,
"$1")));for(;"_"==c.charAt(0)||"~"==c.charAt(0)||"-"==c.charAt(0)||"+"==c.charAt(0)||"#"==c.charAt(0);){switch(c.charAt(0)){case "#":d=p.ACCESS_PROTECTED;break;case "+":d=p.ACCESS_PUBLIC;break;case "-":d=p.ACCESS_PRIVATE;break;case "_":g=!0;break;case "~":f=!0}c=t.substr(c,1,null)}a instanceof H||(0==b&&!g||0!=b&&g)&&a.id.push(c);a.fields.push(new p(c,e,d,f))}static loadSubsets(a,b){let c=0,e=b.length;for(;c<e;){var d=c++,f=w.deComment(b[d]);if(w.legacySubsetRE.match(f)){var g=f.replace(w.legacySubsetRE.r,
"$4");d=z.trim(f.replace(w.legacySubsetRE.r,"$5"));d=a.sets.h[d];if(null!=d){d.subsetType=g;if("XT"==g||"TX"==g||"P"==g)d.isAbstract=!0;f=f.replace(w.legacySubsetRE.r,"$1").split(" U ");g=0;for(var h=f.length;g<h;){var k=g++;k=z.trim(f[k]);k=a.sets.h[k];null!=k&&(d.subsets.push(k),k.id=[],k.superset=d)}}}else if(w.subsetRE.match(f)&&(g=f.replace(w.subsetRE.r,"$1"),d=z.rtrim(f.replace(w.subsetRE.r,"$2")),d=a.sets.h[d],null!=d)){d.subsetType=g;switch(f.replace(w.subsetRE.r,"$3")){case "-":h=M.SUBSET_OPT_BOTH;
break;case "<":h=M.SUBSET_OPT_PARENT;break;case ">":h=M.SUBSET_OPT_CHILDREN;break;default:h=-1}d.subsetOption=h;if("XT"==g||"TX"==g||"P"==g)d.isAbstract=!0;g=f.replace(w.subsetRE.r,"$4");""!=g&&(d.subsetCode=t.substr(g,1,g.length-2));f=f.replace(w.subsetRE.r,"$5").split(",");g=0;for(h=f.length;g<h;)k=g++,k=z.trim(f[k]),k=a.sets.h[k],null!=k&&(d.subsets.push(k),k.id.shift(),k.superset=d)}}}static loadMethods(a,b){let c=0,e=b.length;for(;c<e;){var d=c++,f=w.deComment(b[d]);if(w.methodRE.match(f)){var g=
z.trim(f.substring(0,f.indexOf(":")-2));d=a.sets.h[g];null==d&&(d=new M(g,null,!1,!0,!0),a.sets.h[g]=d);f=f.substring(f.indexOf(":")+1);g=0;for(var h=f.indexOf(")",g);-1!=h;){let l=f.indexOf(",",h);var k=f.indexOf("[",h);h=f.indexOf("]",h);-1!=k&&l>k&&l<h&&(l=f.indexOf(",",h));-1!=l?(k=f.substring(g,l),g=l+1,h=f.indexOf(")",g)):(k=f.substring(g),h=-1);w.loadMethod(d,z.trim(k))}}}}static loadMethod(a,b){var c=p.ACCESS_PUBLIC;let e=!1,d=z.trim(b.substring(0,b.indexOf("("))),f=b.substring(b.indexOf(")")+
1);f=z.trim(f.substring(f.indexOf("[")+1,f.indexOf("]")));let g=d.charAt(0);for(;"~"==g||"-"==g||"+"==g||"#"==g;){switch(g){case "#":c=p.ACCESS_PROTECTED;break;case "+":c=p.ACCESS_PUBLIC;break;case "-":c=p.ACCESS_PRIVATE;break;case "~":e=!0}d=t.substr(d,1,null);g=d.charAt(0)}""==d&&(d=a.name);c=new aa(d,f,c,e);b=z.trim(b.substring(b.indexOf("(")+1,b.indexOf(")")));""!=b&&w.loadParams(a,c,b);d==a.name?a.constructors.push(c):a.methods.push(c)}static loadParams(a,b,c){let e=0;for(c=c.split(",");e<c.length;){var d=
c[e];++e;let f=z.trim(d),g="";-1!=d.indexOf("[")&&(f=z.trim(d.substring(0,d.indexOf("["))),-1!=d.indexOf("]",d.indexOf("["))&&(g=z.trim(d.substring(d.indexOf("[")+1,d.indexOf("]")))));""==g&&(d=a.getField(f),g=null!=d?d.dbType:w.DEFAULT_TYPE);b.params.push(new p(f,g))}}static loadLayout(a,b){let c=0,e=0,d=0,f=0;for(;f<b.length;){var g=b[f];++f;g=w.deComment(g);if(""==z.trim(g))0!=e&&(e>c&&(c=e),e=0,++d);else if(":"==z.trim(g))++e;else if(w.entityRE.match(g)){var h=a.sets;g=z.trim(g.substring(0,g.indexOf(":")));
g=h.h[g];g.row=d;g.col=e;++e}else w.associationRE.match(g)&&(h=a.associations,g=z.trim(g.substring(0,g.indexOf(","))),g=h.h[g],g.row=d,g.col=e,++e)}a.height=d;a.width=c}static save(a){let b="";a=a.getGrid();let c=0,e=a.length;for(;c<e;){let d=c++,f=0,g=a[d];for(;f<g.length;){let h=g[f];++f;b=null==h?b+":":h instanceof H?b+w.saveAssociation(E.__cast(h,H)):b+w.saveSet(h);b+="\n"}d!=a.length-1&&(b+="\n")}return b}static saveAssociation(a){let b=a.name;for(var c=0,e=a.links;c<e.length;){var d=e[c];++c;
b+=", "+(d.isWeak?"_":"")+d.min+d.max+" "+d.set.name}c=0;for(e=a.fields.length;c<e;)d=c++,b=0!=d?b+", ":b+": ",b+=a.fields[d].name+" ["+a.fields[d].type+"]";return b}static saveSet(a){let b=a.name+": ";for(var c=[],e=D(a.fields);e.hasNext();){var d=e.next();c.push(d.name+" ["+d.type+"]")}b+=c.join(", ");if(0!=a.subsets.length){c="\n/\\ "+a.name+" - ";e=[];for(a=D(a.subsets);a.hasNext();)d=a.next(),e.push(d.name);b+=c+e.join(", ")}return b}}F.source.Mocodo=w;w.__name__=!0;class P{static transform(a){let b=
new Da;P.setsToRelations(a,b);P.subsetsToRelations(a,b);P.componentsToRelations(a,b);P.associationsToRelations(a,b);P.supersetToChildren(a,b);P.subsetsToParent(a,b);P.copyLayout(a,b);let c=[];q.iter(b.relations,function(e){0==e.foreignKeys.length&&e.key.length==e.fields.length&&c.push(e.name)});q.iter(c,function(e){let d=b.relations;Object.prototype.hasOwnProperty.call(d.h,e)&&delete d.h[e]});for(a=0;a<c.length;){let e=c[a];++a;q.iter(b.relations,function(d){d.foreignKeys=q.filter(d.foreignKeys,function(f){return f.relation.name!=
e})})}return b}static setsToRelations(a,b){a=a.sets.h;let c=Object.keys(a),e=c.length,d=0;for(;d<e;){let f=a[c[d++]],g=f.dbName,h=new ka(g),k=0,l=f.fields;for(;k<l.length;){let n=l[k];++k;let v=n.className;n.isStatic||(h.fields.push(new p(v,n.type)),-1!=f.id.indexOf(n.name)&&h.key.push(v))}b.relations.h[g]=h}}static subsetsToRelations(a,b){a=a.sets.h;let c=Object.keys(a),e=c.length,d=0;for(;d<e;){var f=a[c[d++]];if(null!=f.superset){let h=b.relations.h[f.dbName];f=b.relations.h[f.superset.dbName];
let k=0!=h.key.length,l=0,n=0,v=f.key;for(;n<v.length;){let y=v[n];++n;k||h.key.push(y);var g=f.getField(y);let L=h.fields;g=new p(y,g.dbType);L.splice(l,0,g);++l;h.foreignKeys.push({name:y,relation:f,key:y})}}}}static componentsToRelations(a,b){a=a.sets.h;let c=Object.keys(a),e=c.length,d=0;for(;d<e;){var f=a[c[d++]];if(null!=f.compound){let h=b.relations.h[f.dbName],k=0;f=b.relations.h[f.compound.dbName];let l=0,n=f.key;for(;l<n.length;){let v=n[l];++l;h.key.splice(k,0,v);var g=f.getField(v).dbType;
let y=h.fields;g=new p(v,g);y.splice(k,0,g);h.foreignKeys.push({name:v,relation:f,key:v});++k}}}}static associationsToRelations(a,b){let c=[];var e=a.associations.h;let d=Object.keys(e),f=d.length,g=0;for(;g<f;){let h=e[d[g++]];c.push(h)}for(;0!=c.length;)e=c.pop(),q.exists(e.links,function(h){return null==b.relations.h[h.set.dbName]})?c.splice(0,0,e):e.isRelation()?P.associationToRelation(a,b,e):P.associationToForeignKey(a,b,e)}static associationToForeignKey(a,b,c){let e=a=null;var d=0;for(c=c.links;d<
c.length;){let f=c[d];++d;"1"==f.max?null==a?a=f:"1"==f.min?(e=a,a=f):e=f:e=f}null!=a&&null!=e&&(d=b.relations.h[a.set.dbName],a.isWeak||P.addForeignKey(b,e,d,!1))}static associationToRelation(a,b,c){a=new ka(c.dbName);for(var e=c.isNN(),d=0,f=c.links;d<f.length;){let g=f[d];++d;let h=g.role;g.set_role("");P.addForeignKey(b,g,a,e||"1"==g.max);g.set_role(h)}e=0;for(d=c.fields;e<d.length;)f=d[e],++e,f.isStatic||a.fields.push(new p(f.className,f.type));b.relations.h[c.dbName]=a}static addForeignKey(a,
b,c,e){let d=a.relations.h[b.set.dbName];null==d&&(d=a.relations.h[b.set.superset.dbName]);a=0;let f=d.key;for(;a<f.length;){let g=f[a];++a;let h=P.constructFieldName(c,g,b.classRole,d.dbName,1==d.key.length),k=d.getField(g).dbType;c.fields.push(new p(h,k));c.foreignKeys.push({name:h,relation:d,key:g});e&&c.key.push(h)}}static constructFieldName(a,b,c,e,d){b=""!=c?d?c:b+(97<=t.cca(b,b.length-1)&&90>=t.cca(c,0)?c.charAt(0).toUpperCase()+c.substring(1):"_"+c):-1==b.toLowerCase().indexOf(e.toLowerCase())&&
5>b.length?b+(97<=t.cca(b,b.length-1)&&90>=t.cca(e,0)?e.charAt(0).toUpperCase()+e.substring(1):"_"+e):b;c=a.fields;a=Array(c.length);e=0;for(d=c.length;e<d;){let f=e++;a[f]=c[f].name}c=b;for(e=0;-1!=a.indexOf(c);)++e,c=b+(null==e?"null":""+e);return c}static subsetsToParent(a,b){a=a.sets.h;let c=Object.keys(a),e=c.length,d=0;for(;d<e;){var f=a[c[d++]];if(f.subsetOption==M.SUBSET_OPT_PARENT){let h=b.relations.h[f.dbName];""!=f.subsetCode&&h.fields.push(new p(f.subsetCode,"INT"));let k=0;for(f=f.subsets;k<
f.length;){var g=f[k];++k;let l=b.relations.h[g.dbName];q.iter(l.fields,function(v){-1==h.key.indexOf(v.name)&&h.fields.push(v)});q.iter(l.foreignKeys,function(v){v.relation.name!=h.name&&h.foreignKeys.push(v)});q.iter(b.relations,function(v){q.iter(v.foreignKeys,function(y){y.relation.name==l.name&&(y.relation=h)})});g=b.relations;let n=l.name;Object.prototype.hasOwnProperty.call(g.h,n)&&delete g.h[n]}}}}static supersetToChildren(a,b){a=a.sets.h;let c=Object.keys(a),e=c.length,d=0;for(;d<e;){var f=
a[c[d++]];let n=b.relations.h[f.dbName];for(var g=[],h=D(f.subsets);h.hasNext();){var k=h.next();g.push(k.dbName)}let v=g;g=f.subsetType.toUpperCase();h=q.count(b.relations,function(y){return-1==v.indexOf(y.name)?q.exists(y.foreignKeys,function(L){return L.relation.name==n.name}):!1});if(f.subsetOption==M.SUBSET_OPT_CHILDREN&&0==h&&(1==f.subsets.length||"X"==g||"XT"==g||"TX"==g||"P"==g)){h=0;for(k=f.subsets;h<k.length;){var l=k[h];++h;let y=b.relations.h[l.dbName];l=y.key.length-1;let L=0,Y=n.fields;
for(;L<Y.length;){let ca=Y[L];++L;-1==n.key.indexOf(ca.name)&&y.fields.splice(l,0,ca);++l}q.iter(n.foreignKeys,function(ca){y.foreignKeys.push(ca)});if(1==f.subsets.length||"XT"==g||"TX"==g||"P"==g){let ca=[];q.iter(y.foreignKeys,function(Fa){Fa.relation.name==n.name&&ca.push(Fa)});q.iter(ca,function(Fa){t.remove(y.foreignKeys,Fa)})}}if(1==f.subsets.length||"XT"==g||"TX"==g||"P"==g)f=b.relations,g=n.name,Object.prototype.hasOwnProperty.call(f.h,g)&&delete f.h[g]}}}static copyLayout(a,b){b.height=
a.height;b.width=a.width;let c=[];for(var e=0,d=b.height;e<d;)e++,c.push(0);e=[];d=0;for(var f=b.width;d<f;)d++,e.push(0);for(a=a.iterator();a.hasNext();)d=a.next(),f=b.relations.h[d.dbName],null!=f&&(f.row=d.row,f.col=d.col,c[f.row]++,e[f.col]++);d=a=0;for(f=c.length;d<f;){var g=d++;0==c[g]?++a:c[g]=g-a}b.height-=a;d=a=0;for(f=e.length;d<f;)g=d++,0==e[g]?++a:e[g]=g-a;b.width-=a;b=b.relations.h;a=Object.keys(b);d=a.length;for(f=0;f<d;)g=b[a[f++]],g.row=c[g.row],g.col=e[g.col]}}F.transform.DiagramToMLD=
P;P.__name__=!0;class V{static transform(a){V.initNavigation(a);V.initConstructors(a);V.initAccessors(a)}static initNavigation(a){let b=a.associations.h,c=Object.keys(b),e=c.length,d=0;for(;d<e;){let h=b[c[d++]];if(h.isClass())for(var f=0,g=h.links;f<g.length;){let k=g[f];++f;h.navFields.push(new p(V.constructFieldName(k,"1"),k.set.className,k.visibility))}else 2==h.links.length&&(h.links[0].hasArrow||(f=a.getObj(h.links[0].set.name),g="1"==h.links[0].max?h.links[1].set.className:p.arrayOf(h.links[1].set.className),
f.navFields.push(new p(V.constructFieldName(h.links[1],h.links[0].max),g,h.links[1].visibility))),h.links[1].hasArrow||(f=a.getObj(h.links[1].set.name),g="1"==h.links[1].max?h.links[0].set.className:p.arrayOf(h.links[0].set.className),f.navFields.push(new p(V.constructFieldName(h.links[0],h.links[1].max),g,h.links[0].visibility))))}}static constructFieldName(a,b){let c=a.classRole;""==a.role&&(c="N"==b?a.set.getPluralClassName():a.set.className);return c=c.charAt(0).toLowerCase()+t.substr(c,1,null)}static initConstructors(a){for(a=
a.iterator();a.hasNext();){let b=a.next();if(!(0!=b.constructors.length||b instanceof H&&!E.__cast(b,H).isClass())){let c=new aa(b.className,"",b.isAbstract?p.ACCESS_PROTECTED:p.ACCESS_PUBLIC),e=0,d=V.retrieveConstructorFields(b);for(;e<d.length;){let f=d[e];++e;c.params.push(new p(f.className,f.classType))}b.constructors.push(c)}}}static retrieveConstructorFields(a){let b;b=null!=a.superset?V.retrieveConstructorFields(a.superset):[];for(var c=a.fields,e=0;e<c.length;){let d=c[e];++e;d.isArray()||
b.push(d)}a=a.navFields;for(c=0;c<a.length;)e=a[c],++c,e.isArray()||b.push(e);return b}static initAccessors(a){for(a=a.iterator();a.hasNext();){let b=a.next();b instanceof H&&!E.__cast(b,H).isClass()||(q.iter(b.fields,function(c){V.setAccessors(b,c)}),q.iter(b.navFields,function(c){V.setAccessors(b,c)}))}}static setAccessors(a,b){if(b.visibility==p.ACCESS_UNSET){b.visibility=p.ACCESS_PROTECTED;var c=new aa("get"+b.className.charAt(0).toUpperCase()+t.substr(b.className,1,null),b.classType,p.ACCESS_PUBLIC);
a.accessors.push(c);"Array"==t.substr(b.classType,0,5)?(b=t.substr(b.classType,6,b.classType.length-7),c=new aa("add"+b,a.className,p.ACCESS_PUBLIC),c.params.push(new p("item",b)),a.accessors.push(c),c=new aa("remove"+b,a.className,p.ACCESS_PUBLIC),c.params.push(new p("item",b)),a.accessors.push(c)):(c=new aa("set"+b.className.charAt(0).toUpperCase()+t.substr(b.className,1,null),b.classType,p.ACCESS_PUBLIC),c.params.push(new p(b.className,b.classType)),a.accessors.push(c))}}}F.transform.DiagramToUML=
V;V.__name__=!0;"undefined"!=typeof performance&&"function"==typeof performance.now&&(t.now=performance.now.bind(performance));null==String.fromCodePoint&&(String.fromCodePoint=function(a){return 65536>a?String.fromCharCode(a):String.fromCharCode((a>>10)+55232)+String.fromCharCode((a&1023)+56320)});Object.defineProperty(String.prototype,"__class__",{value:String,enumerable:!1,writable:!0});String.__name__=!0;Array.__name__=!0;Date.prototype.__class__=Date;Date.__name__="Date";var Ra={},Pa={},Qa=Number,
Oa=Boolean,Sa={},Ta={};E.__toStr={}.toString;m.Element=0;m.PCData=1;m.Document=6;T.__meta__={statics:{generateMethods:{SuppressWarnings:["checkstyle:CyclomaticComplexity"]}}};J.__meta__={statics:{generateMethods:{SuppressWarnings:["checkstyle:CyclomaticComplexity"]}}};K.__meta__={statics:{generateMethods:{SuppressWarnings:["checkstyle:CyclomaticComplexity"]}}};O.__meta__={statics:{generateMethods:{SuppressWarnings:["checkstyle:CyclomaticComplexity"]}}};ha.CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
ha.BYTES=Q.ofString(ha.CHARS);X.__meta__={statics:{fixName:{SuppressWarnings:["checkstyle:CyclomaticComplexity"]}}};M.SUBSET_OPT_BOTH=0;M.SUBSET_OPT_CHILDREN=1;M.SUBSET_OPT_PARENT=2;p.ACCESS_UNSET=0;p.ACCESS_PRIVATE=1;p.ACCESS_PROTECTED=2;p.ACCESS_PUBLIC=3;ra.__meta__={fields:{_:{SuppressWarnings:["checkstyle:ParameterNumber"]}}};G.LETTER_HEIGHT=16;G.LETTER_WIDTH=10;G.BEND_DST=20;u.coordRE=new W("^translate\\(([0-9]+,[0-9]+)\\)$","");u.PADDING=3;u.MARGIN=60;u.RXY=20;u.LETTER_HEIGHT=16;u.TEXT_STYLE=
"font-family:'Roboto Mono';font-size:16px";u.LETTER_WIDTH=9.5;u.UNDERLINE_STYLE="text-decoration:underline";u.RECT_STYLE="stroke:black";u.LINE_STYLE="fill:none;stroke:black";u.WHITE_STYLE="fill:white;stroke:black";u.DOTTED_STYLE="2,2";u.MARKERS=[{id:"arrowMarker",height:6,width:3,path:"M 0 0 L 3 3 L 0 6 Z",style:"fill:black;stroke:black"},{id:"inheritMarker",height:9,width:9,path:"M 0 0 L 9 4.5 L 0 9 Z",style:"fill:white;stroke:black"},{id:"aggregationMarker",height:9,width:12,path:"M 0 4.5 L 6 0 L 12 4.5 L 6 9 Z",
style:"fill:white;stroke:black"},{id:"compositionMarker",height:9,width:12,path:"M 0 4.5 L 6 0 L 12 4.5 L 6 9 Z",style:"fill:black;stroke:black"}];u.FILL_WHITE_STYLE="fill:white";C.N_A_ASSOC=5;w.DEFAULT_TYPE="VARCHAR(50)";w.typeRE=new W("([^\\[]*)\\[(.*)\\]","");w.entityRE=new W("^[^/,:(]{2,}:","");w.associationRE=new W("^[^/,:]{2,},","");w.legacySubsetRE=new W("([^/,:]{2,}( U [^,:]{2,})*) C( ?\\[(X?T?)\\])? ([^,:]{2,})$","i");w.subsetRE=new W("^/([XT]{0,2}|P)?\\\\ * ([^-><]{2,}) *([-><]) *(\\[.*\\])? *(.*$)",
"i");w.linkRE=new W("[^01NX]*[01NX]{2}>? *(\\[.*\\])?(.*)$","");w.methodRE=new W("^[^/,:(]{2,}\\(\\):","")})("undefined"!=typeof exports?exports:"undefined"!=typeof window?window:"undefined"!=typeof self?self:this,"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
